|
Blender V5.0
|
#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(), FSMenuEntry::name, and 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, 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(), 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_can_save(), 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_insert_entry(), fsmenu_refresh_system_category(), and fsmenu_remove_entry().
| 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 214 of file fsmenu.cc.
References ED_fsmenu_get_category(), FSMenuEntry::next, and FSMenuEntry::save.
|
static |
Definition at line 158 of file fsmenu.cc.
References BLI_path_name_at_index(), BLI_strncpy(), len, name, and FSMenuEntry::path.
Referenced by ED_fsmenu_entry_get_name(), ED_fsmenu_entry_set_name(), and fsmenu_write_file().
| void fsmenu_free | ( | void | ) |
Frees all the memory associated with the fsmenu.
Definition at line 511 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 469 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 497 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_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 516 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 227 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_SAVE, FS_INSERT_SORTED, i, FSMenuEntry::icon, MEM_mallocN(), FSMenuEntry::name, name, FSMenuEntry::next, FSMenuEntry::path, FSMenuEntry::save, SEP, SEP_STR, STREQ, and STRNCPY().
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 421 of file fsmenu.cc.
References BLI_fopen(), FILE_MAXDIR, FILE_MAXFILE, FS_CATEGORY_BOOKMARKS, FS_CATEGORY_RECENT, FS_INSERT_SAVE, fsmenu_insert_entry(), len, name, STRNCPY(), and STRPREFIX.
Referenced by ED_file_read_bookmarks().
| void fsmenu_refresh_system_category | ( | struct FSMenu * | fsmenu | ) |
Refresh system directory menu
Definition at line 485 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 346 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 379 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(), and fsmenu_free().