41#include "RNA_prototypes.hh"
73 ot->
idname =
"BUTTONS_OT_start_filter";
96 ot->
name =
"Clear Filter";
98 ot->
idname =
"BUTTONS_OT_clear_filter";
135 ot->
name =
"Toggle Pin ID";
136 ot->
description =
"Keep the current data-block displayed";
137 ot->
idname =
"BUTTONS_OT_toggle_pin";
157 layout.
menu(
"INFO_MT_area", std::nullopt, ICON_NONE);
158 popup_menu_end(
C, pup);
166 ot->
name =
"Context Menu";
167 ot->
description =
"Display properties editor context_menu";
168 ot->
idname =
"BUTTONS_OT_context_menu";
211 const bool path_is_template =
false;
231 if (fbo ==
nullptr) {
252 if ((prop_subtype ==
PROP_DIRPATH) || (is_relative || make_relative)) {
274 std::string path_str = path;
299 U.runtime.is_dirty =
true;
324 if (sfile && sfile->
op) {
338 const std::optional<bke::path_templates::VariableMap> variables =
359 const bool do_open_directory =
event->modifier &
KM_ALT ||
404 if (ptr.
data == &
U || is_userdef) [[unlikely]] {
418 if (
STR_ELEM(prop_id,
"font_path_ui",
"font_path_ui_mono",
"font_directory")) {
469 if (
STREQ(prop_id,
"relative_path")) {
480 ot->
name =
"Select File";
482 "Open a file browser, hold Shift to open the file, Alt to browse containing directory";
483 ot->
idname =
"BUTTONS_OT_file_browse";
505 prop =
RNA_def_string(ot->
srna,
"filter_glob",
nullptr, 0,
"Glob Filter",
"Custom filter");
512 ot->
name =
"Select Directory";
514 "Open a directory browser, hold Shift to open the file, Alt to browse containing directory";
515 ot->
idname =
"BUTTONS_OT_directory_browse";
Functions and classes for evaluating template expressions in filepaths.
File and directory operations.
#define ID_BLEND_PATH(_bmain, _id)
Read Blender memory allocation and freeing.
void context_active_but_prop_get_filebrowser(const bContext *C, PointerRNA *r_ptr, PropertyRNA **r_prop, bool *r_is_undo, bool *r_is_userdef)
PopupMenu * popup_menu_begin(bContext *C, const char *title, int icon) ATTR_NONNULL()
static wmOperatorStatus buttons_start_filter_exec(bContext *C, wmOperator *)
static wmOperatorStatus buttons_clear_filter_exec(bContext *C, wmOperator *)
char * RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fixedbuf, int fixedlen, int *r_len)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
ScrArea * CTX_wm_area(const bContext *C)
char * STRNCPY(char(&dst)[N], const char *src)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
bool ED_undo_operator_repeat(bContext *C, wmOperator *op)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
const char * BKE_appdir_folder_default_or_root() ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
static wmOperatorStatus context_menu_invoke(bContext *C, wmOperator *, const wmEvent *)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
PointerRNA RNA_id_pointer_create(ID *id)
void WM_operator_properties_free(PointerRNA *ptr)
ID * buttons_context_id_path(const bContext *C)
const char * RNA_property_identifier(const PropertyRNA *prop)
bool ED_operator_buttons_active(bContext *C)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
static wmOperatorStatus file_browse_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Vector< bke::path_templates::Error > BKE_path_apply_template_alloc(char **path, int path_maxncpy, const bke::path_templates::VariableMap &template_variables)
void BUTTONS_OT_file_browse(wmOperatorType *ot)
PointerRNA WM_operator_properties_create_ptr(wmOperatorType *ot)
void BKE_report_path_template_errors(ReportList *reports, eReportType report_type, StringRef path, Span< bke::path_templates::Error > errors)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
void ED_region_search_filter_update(const ScrArea *area, ARegion *region)
auto BKE_blender_project_read_callback(const Main *bmain, Fn lambda)
static wmOperatorStatus toggle_pin_exec(bContext *C, wmOperator *)
void BUTTONS_OT_start_filter(wmOperatorType *ot)
static void file_browse_apply_path_templates(const Main *bmain, PropertyRNA *prop, std::string &path)
static void file_browse_cancel(bContext *, wmOperator *op)
void WM_operator_properties_filesel(wmOperatorType *ot, const int filter, const short type, const eFileSel_Action action, const eFileSel_Flag flag, const short display, const short sort)
char * RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen, int *r_len)
static wmOperatorStatus file_browse_exec(bContext *C, wmOperator *op)
static bool file_browse_operator_relative_paths_supported(wmOperator *op)
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
PropertyPathTemplateType RNA_property_path_template_type(PropertyRNA *prop)
void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value)
std::string BKE_path_template_escape(StringRef text)
void BUTTONS_OT_toggle_pin(wmOperatorType *ot)
void BKE_report(ReportList *reports, eReportType type, const char *message)
static bool file_browse_poll_property(const bContext *, wmOperator *op, const PropertyRNA *prop)
void ED_undo_push(bContext *C, const char *str, UndoEncodeHints hints=UndoEncodeHints(0))
std::optional< bke::path_templates::VariableMap > BKE_build_template_variables_for_prop(const bContext *C, PointerRNA *ptr, PropertyRNA *prop)
int RNA_property_flag(PropertyRNA *prop)
bool void BLI_path_rel(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int BLI_path_slash_ensure(char *path, size_t path_maxncpy) ATTR_NONNULL(1)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
std::optional< std::string > RNA_property_string_path_filter(const bContext *C, PointerRNA *ptr, PropertyRNA *prop)
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
PropertySubType RNA_property_subtype(PropertyRNA *prop)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Main * CTX_data_main(const bContext *C)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
bool BLI_path_is_rel(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
void BUTTONS_OT_context_menu(wmOperatorType *ot)
@ PROP_PATH_SUPPORTS_TEMPLATES
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
bool BKE_appdir_font_folder_default(char *dir, size_t dir_maxncpy)
void BUTTONS_OT_directory_browse(wmOperatorType *ot)
wmOperator * WM_operator_last_redo(const bContext *C)
bool RNA_property_editable(const PointerRNA *ptr, PropertyRNA *prop)
SpaceFile * CTX_wm_space_file(const bContext *C)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
bScreen * CTX_wm_screen(const bContext *C)
void RNA_pointer_set(PointerRNA *ptr, const char *name, PointerRNA ptr_value)
void ED_region_activate_rna_prop(bContext *C, ARegion *region, const void *data, StringRefNull prop_name)
void BUTTONS_OT_clear_filter(wmOperatorType *ot)
SpaceProperties * CTX_wm_space_properties(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
const char * BLI_path_slash_rfind(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
void WM_event_add_fileselect(bContext *C, wmOperator *op)
std::string BKE_blender_project_path_make_relative(StringRef path, bool path_is_template, const bke::BlenderProject &project)
void ED_area_tag_redraw(ScrArea *area)
char search_string[UI_MAX_NAME_STR]
struct SpaceProperties_Runtime * runtime
void menu(MenuType *mt, std::optional< StringRef > name, int icon)
wmEventModifierFlag modifier
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
bool(*) poll_property(const bContext *C, wmOperator *op, const PropertyRNA *prop) ATTR_WARN_UNUSED_RESULT
void(*) cancel(bContext *C, wmOperator *op)
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports