|
Blender V4.5
|
#include <algorithm>#include <cstdio>#include <cstdlib>#include <cstring>#include "MEM_guardedalloc.h"#include "BLI_fileops.h"#include "BLI_path_utils.hh"#include "BLI_string.h"#include "BLI_string_utils.hh"#include "BLI_utildefines.h"#include "BLT_translation.hh"#include "BKE_appdir.hh"#include "ED_fileselect.hh"#include "UI_resources.hh"#include "WM_api.hh"#include "WM_types.hh"#include "fsmenu.h"Go to the source code of this file.
Classes | |
| struct | FSMenu |
Variables | |
| static FSMenu * | g_fsmenu = nullptr |
| int ED_fsmenu_entry_get_icon | ( | FSMenuEntry * | fsentry | ) |
Definition at line 148 of file fsmenu.cc.
References FSMenuEntry::icon.
| char * ED_fsmenu_entry_get_name | ( | FSMenuEntry * | fsentry | ) |
Definition at line 175 of file fsmenu.cc.
References fsmenu_entry_generate_name(), and FSMenuEntry::name.
| char * ED_fsmenu_entry_get_path | ( | FSMenuEntry * | fsentry | ) |
Definition at line 124 of file fsmenu.cc.
References FSMenuEntry::path.
| void ED_fsmenu_entry_set_icon | ( | FSMenuEntry * | fsentry, |
| const int | icon ) |
Definition at line 153 of file fsmenu.cc.
References FSMenuEntry::icon.
Referenced by fsmenu_insert_entry().
| void ED_fsmenu_entry_set_name | ( | FSMenuEntry * | fsentry, |
| const char * | name ) |
Definition at line 189 of file fsmenu.cc.
References BKE_appdir_folder_id_create(), BLENDER_BOOKMARK_FILE, BLENDER_USER_CONFIG, BLI_path_join, ED_fsmenu_get(), FILE_MAXFILE, fsmenu_entry_generate_name(), fsmenu_write_file(), FSMenuEntry::name, STREQ, and STRNCPY().
| void ED_fsmenu_entry_set_path | ( | FSMenuEntry * | fsentry, |
| const char * | path ) |
Definition at line 129 of file fsmenu.cc.
References BKE_appdir_folder_id_create(), BLENDER_BOOKMARK_FILE, BLENDER_USER_CONFIG, BLI_path_join, BLI_strdup(), ED_fsmenu_get(), FILE_MAXFILE, fsmenu_write_file(), MEM_SAFE_FREE, FSMenuEntry::path, and STREQ.
| FSMenu * ED_fsmenu_get | ( | ) |
Definition at line 46 of file fsmenu.cc.
References g_fsmenu, and MEM_callocN().
Referenced by bookmark_add_exec(), bookmark_cleanup_exec(), bookmark_delete_exec(), bookmark_move_exec(), ED_file_read_bookmarks(), ED_fsmenu_entry_set_name(), ED_fsmenu_entry_set_path(), file_execute(), file_refresh(), file_refresh_exec(), filelist_geticon_file_type_ex(), fsmenu_bookmark_validate_job_update(), fsmenu_refresh_bookmarks_status(), and reset_recent_exec().
| FSMenuEntry * ED_fsmenu_get_category | ( | FSMenu * | fsmenu, |
| FSMenuCategory | category ) |
Definition at line 54 of file fsmenu.cc.
References FS_CATEGORY_BOOKMARKS, FS_CATEGORY_OTHER, FS_CATEGORY_RECENT, FS_CATEGORY_SYSTEM, FS_CATEGORY_SYSTEM_BOOKMARKS, FSMenu::fsmenu_bookmarks, FSMenu::fsmenu_other, FSMenu::fsmenu_recent, FSMenu::fsmenu_system, and FSMenu::fsmenu_system_bookmarks.
Referenced by bookmark_cleanup_exec(), bookmark_move_exec(), ED_fsmenu_get_entry(), ED_fsmenu_get_nentries(), filelist_geticon_file_type_ex(), fsmenu_bookmark_validate_job_startjob(), fsmenu_bookmark_validate_job_update(), fsmenu_can_save(), fsmenu_copy_category(), fsmenu_free_category(), fsmenu_get_active_indices(), fsmenu_insert_entry(), fsmenu_remove_entry(), and fsmenu_write_file().
| FSMenuEntry * ED_fsmenu_get_entry | ( | FSMenu * | fsmenu, |
| FSMenuCategory | category, | ||
| int | idx ) |
Definition at line 111 of file fsmenu.cc.
References ED_fsmenu_get_category(), and FSMenuEntry::next.
Referenced by reset_recent_exec().
| int ED_fsmenu_get_nentries | ( | FSMenu * | fsmenu, |
| FSMenuCategory | category ) |
Definition at line 99 of file fsmenu.cc.
References count, ED_fsmenu_get_category(), and FSMenuEntry::next.
Referenced by bookmark_delete_exec(), and bookmark_move_exec().
| void ED_fsmenu_set_category | ( | FSMenu * | fsmenu, |
| FSMenuCategory | category, | ||
| FSMenuEntry * | fsm_head ) |
Definition at line 78 of file fsmenu.cc.
References FS_CATEGORY_BOOKMARKS, FS_CATEGORY_OTHER, FS_CATEGORY_RECENT, FS_CATEGORY_SYSTEM, FS_CATEGORY_SYSTEM_BOOKMARKS, FSMenu::fsmenu_bookmarks, FSMenu::fsmenu_other, FSMenu::fsmenu_recent, FSMenu::fsmenu_system, and FSMenu::fsmenu_system_bookmarks.
Referenced by bookmark_move_exec(), fsmenu_copy_category(), fsmenu_insert_entry(), fsmenu_refresh_system_category(), and fsmenu_remove_entry().
|
static |
Definition at line 645 of file fsmenu.cc.
References fsmenu_bookmark_validate_job_update().
Referenced by fsmenu_bookmark_validate_job_start().
|
static |
Definition at line 651 of file fsmenu.cc.
References fsmenu_free_ex().
Referenced by fsmenu_bookmark_validate_job_start().
|
static |
Definition at line 657 of file fsmenu.cc.
References fsmenu_bookmark_validate_job_end(), fsmenu_bookmark_validate_job_free(), fsmenu_bookmark_validate_job_startjob(), fsmenu_bookmark_validate_job_update(), fsmenu_copy(), g_fsmenu, NC_SPACE, ND_SPACE_FILE_LIST, wmWindowManager::winactive, WM_JOB_TYPE_FSMENU_BOOKMARK_VALIDATE, WM_jobs_callbacks(), WM_jobs_customdata_set(), WM_jobs_get(), WM_jobs_start(), and WM_jobs_timer().
Referenced by fsmenu_refresh_bookmarks_status().
|
static |
Thanks to some bookmarks sometimes being network drives that can have tens of seconds of delay before being defined as unreachable by the OS, we need to validate the bookmarks in an asynchronous job.
Definition at line 601 of file fsmenu.cc.
References ARRAY_SIZE, ED_fsmenu_get_category(), FS_CATEGORY_BOOKMARKS, FS_CATEGORY_RECENT, FS_CATEGORY_SYSTEM, FS_CATEGORY_SYSTEM_BOOKMARKS, fsmenu_entry_refresh_valid(), i, and FSMenuEntry::next.
Referenced by fsmenu_bookmark_validate_job_start().
|
static |
Definition at line 681 of file fsmenu.cc.
References WM_JOB_TYPE_FSMENU_BOOKMARK_VALIDATE, and WM_jobs_kill_type().
Referenced by fsmenu_refresh_bookmarks_status().
|
static |
Definition at line 622 of file fsmenu.cc.
References ARRAY_SIZE, ED_fsmenu_get(), ED_fsmenu_get_category(), FS_CATEGORY_BOOKMARKS, FS_CATEGORY_RECENT, FS_CATEGORY_SYSTEM, FS_CATEGORY_SYSTEM_BOOKMARKS, i, FSMenuEntry::next, FSMenuEntry::path, STREQ, and FSMenuEntry::valid.
Referenced by fsmenu_bookmark_validate_job_end(), and fsmenu_bookmark_validate_job_start().
| short fsmenu_can_save | ( | struct FSMenu * | fsmenu, |
| enum FSMenuCategory | category, | ||
| int | idx ) |
Return whether the entry was created by the user and can be saved and deleted
Definition at line 239 of file fsmenu.cc.
References ED_fsmenu_get_category(), FSMenuEntry::next, and FSMenuEntry::save.
Definition at line 569 of file fsmenu.cc.
References FS_CATEGORY_BOOKMARKS, FS_CATEGORY_OTHER, FS_CATEGORY_RECENT, FS_CATEGORY_SYSTEM, FS_CATEGORY_SYSTEM_BOOKMARKS, fsmenu_copy(), fsmenu_copy_category(), and MEM_dupallocN().
Referenced by fsmenu_bookmark_validate_job_start(), and fsmenu_copy().
|
static |
Definition at line 544 of file fsmenu.cc.
References ED_fsmenu_get_category(), ED_fsmenu_set_category(), MEM_dupallocN(), FSMenuEntry::next, and FSMenuEntry::path.
Referenced by fsmenu_copy().
|
static |
Definition at line 158 of file fsmenu.cc.
References BLI_path_name_at_index(), BLI_strncpy(), len, and FSMenuEntry::path.
Referenced by ED_fsmenu_entry_get_name(), ED_fsmenu_entry_set_name(), and fsmenu_write_file().
| void fsmenu_entry_refresh_valid | ( | struct FSMenuEntry * | fsentry | ) |
Refresh 'valid' status of given menu entry
Definition at line 214 of file fsmenu.cc.
References BLI_is_dir(), i, FSMenuEntry::path, STRCASEEQLEN, and FSMenuEntry::valid.
Referenced by fsmenu_bookmark_validate_job_startjob(), and fsmenu_insert_entry().
| void fsmenu_free | ( | void | ) |
Frees all the memory associated with the fsmenu.
Definition at line 539 of file fsmenu.cc.
References fsmenu_free_ex(), and g_fsmenu.
Referenced by ED_file_exit(), and ED_file_read_bookmarks().
|
static |
Definition at line 497 of file fsmenu.cc.
References ED_fsmenu_get_category(), MEM_freeN(), FSMenuEntry::next, and FSMenuEntry::path.
Referenced by fsmenu_free_ex(), and fsmenu_refresh_system_category().
|
static |
Definition at line 525 of file fsmenu.cc.
References FS_CATEGORY_BOOKMARKS, FS_CATEGORY_OTHER, FS_CATEGORY_RECENT, FS_CATEGORY_SYSTEM, FS_CATEGORY_SYSTEM_BOOKMARKS, fsmenu_free_category(), and MEM_freeN().
Referenced by fsmenu_bookmark_validate_job_free(), and fsmenu_free().
| int fsmenu_get_active_indices | ( | struct FSMenu * | fsmenu, |
| enum FSMenuCategory | category, | ||
| const char * | dir ) |
Get active index based on given directory.
Definition at line 582 of file fsmenu.cc.
References BLI_path_cmp, ED_fsmenu_get_category(), i, FSMenuEntry::next, and FSMenuEntry::path.
Referenced by file_refresh().
| void fsmenu_insert_entry | ( | struct FSMenu * | fsmenu, |
| enum FSMenuCategory | category, | ||
| const char * | path, | ||
| const char * | name, | ||
| int | icon, | ||
| enum FSMenuInsert | flag ) |
Inserts a new fsmenu entry with the given path. Duplicate entries are not added.
Definition at line 252 of file fsmenu.cc.
References ARRAY_SIZE, BLI_assert, BLI_path_is_rel(), BLI_path_ncmp, BLI_strdup(), BLI_string_joinN, DATA_, ED_fsmenu_entry_set_icon(), ED_fsmenu_get_category(), ED_fsmenu_set_category(), ELEM, flag, FS_CATEGORY_BOOKMARKS, FS_CATEGORY_OTHER, FS_CATEGORY_RECENT, FS_CATEGORY_SYSTEM, FS_CATEGORY_SYSTEM_BOOKMARKS, FS_INSERT_FIRST, FS_INSERT_NO_VALIDATE, FS_INSERT_SAVE, FS_INSERT_SORTED, fsmenu_entry_refresh_valid(), i, FSMenuEntry::icon, MEM_mallocN(), FSMenuEntry::name, FSMenuEntry::next, FSMenuEntry::path, FSMenuEntry::save, SEP, SEP_STR, STREQ, STRNCPY(), and FSMenuEntry::valid.
Referenced by bookmark_add_exec(), file_execute(), fsmenu_read_bookmarks(), fsmenu_read_system(), and fsmenu_xdg_insert_entry().
| void fsmenu_read_bookmarks | ( | struct FSMenu * | fsmenu, |
| const char * | filepath ) |
reads the 'bookmarks' from the specified file
Definition at line 444 of file fsmenu.cc.
References BLI_exists(), BLI_fopen(), FILE_MAXDIR, FILE_MAXFILE, FS_CATEGORY_BOOKMARKS, FS_CATEGORY_RECENT, FS_INSERT_SAVE, fsmenu_insert_entry(), len, STRNCPY(), and STRPREFIX.
Referenced by ED_file_read_bookmarks().
| void fsmenu_refresh_bookmarks_status | ( | struct wmWindowManager * | wm, |
| struct FSMenu * | fsmenu ) |
Refresh 'valid' status of all menu entries
Definition at line 686 of file fsmenu.cc.
References BLI_assert, ED_fsmenu_get(), fsmenu_bookmark_validate_job_start(), fsmenu_bookmark_validate_job_stop(), and UNUSED_VARS_NDEBUG.
Referenced by bookmark_cleanup_exec(), and file_refresh_exec().
| void fsmenu_refresh_system_category | ( | struct FSMenu * | fsmenu | ) |
Refresh system directory menu
Definition at line 513 of file fsmenu.cc.
References ED_fsmenu_set_category(), FS_CATEGORY_SYSTEM, FS_CATEGORY_SYSTEM_BOOKMARKS, fsmenu_free_category(), and fsmenu_read_system().
Referenced by file_refresh_exec().
| void fsmenu_remove_entry | ( | struct FSMenu * | fsmenu, |
| enum FSMenuCategory | category, | ||
| int | idx ) |
Removes the fsmenu entry at the given index.
Definition at line 369 of file fsmenu.cc.
References ED_fsmenu_get_category(), ED_fsmenu_set_category(), MEM_freeN(), FSMenuEntry::next, FSMenuEntry::path, and FSMenuEntry::save.
Referenced by bookmark_cleanup_exec(), bookmark_delete_exec(), and reset_recent_exec().
| bool fsmenu_write_file | ( | struct FSMenu * | fsmenu, |
| const char * | filepath ) |
Saves the 'bookmarks' to the specified file.
Definition at line 402 of file fsmenu.cc.
References BLI_fopen(), ED_fsmenu_get_category(), FILE_MAX, FS_CATEGORY_BOOKMARKS, FS_CATEGORY_RECENT, fsmenu_entry_generate_name(), FSMENU_RECENT_MAX, FSMenuEntry::name, FSMenuEntry::next, FSMenuEntry::path, FSMenuEntry::save, and STREQ.
Referenced by ED_fsmenu_entry_set_name(), ED_fsmenu_entry_set_path(), and fsmenu_write_file_and_refresh_or_report_error().
Definition at line 44 of file fsmenu.cc.
Referenced by ED_fsmenu_get(), fsmenu_bookmark_validate_job_start(), and fsmenu_free().