Blender V4.3
file_intern.hh File Reference

Go to the source code of this file.

Classes

struct  SpaceFile_Runtime
 

Namespaces

namespace  blender
 
namespace  blender::asset_system
 
namespace  blender::ed
 
namespace  blender::ed::asset_browser
 

Macros

#define ATTRIBUTE_COLUMN_PADDING   (0.5f * UI_UNIT_X)
 
#define FILE_LAYOUT_COMPACT(_layout)    (_layout->flag & FILE_LAYOUT_VER && (_layout->width / UI_SCALE_FAC) < 500)
 
#define FILE_LAYOUT_HIDE_DATE(_layout)    (_layout->flag & FILE_LAYOUT_VER && (_layout->width / UI_SCALE_FAC) < 250)
 
#define FILE_LAYOUT_HIDE_SIZE(_layout)    (_layout->flag & FILE_LAYOUT_VER && (_layout->width / UI_SCALE_FAC) < 350)
 

Typedefs

typedef void * onReloadFnData
 
typedef void(* onReloadFn) (SpaceFile *space_data, onReloadFnData custom_data)
 

Functions

bool file_main_region_needs_refresh_before_draw (SpaceFile *sfile)
 
int file_context (const bContext *C, const char *member, bContextDataResult *result)
 
void file_calc_previews (const bContext *C, ARegion *region)
 
void file_draw_list (const bContext *C, ARegion *region)
 
bool file_draw_hint_if_invalid (const bContext *C, const SpaceFile *sfile, ARegion *region)
 
void file_draw_check_ex (bContext *C, ScrArea *area)
 
void file_draw_check (bContext *C)
 
void file_draw_check_cb (bContext *C, void *arg1, void *arg2)
 
bool file_draw_check_exists (SpaceFile *sfile)
 
void FILE_OT_highlight (wmOperatorType *ot)
 
void FILE_OT_sort_column_ui_context (wmOperatorType *ot)
 
void FILE_OT_select (wmOperatorType *ot)
 
void FILE_OT_select_walk (wmOperatorType *ot)
 
void FILE_OT_select_all (wmOperatorType *ot)
 
void FILE_OT_select_box (wmOperatorType *ot)
 
void FILE_OT_select_bookmark (wmOperatorType *ot)
 
void FILE_OT_bookmark_add (wmOperatorType *ot)
 
void FILE_OT_bookmark_delete (wmOperatorType *ot)
 
void FILE_OT_bookmark_cleanup (wmOperatorType *ot)
 
void FILE_OT_bookmark_move (wmOperatorType *ot)
 
void FILE_OT_reset_recent (wmOperatorType *ot)
 
void FILE_OT_hidedot (wmOperatorType *ot)
 
void FILE_OT_execute (wmOperatorType *ot)
 
void FILE_OT_external_operation (wmOperatorType *ot)
 
void file_external_operations_menu_register ()
 
void FILE_OT_mouse_execute (wmOperatorType *ot)
 
void FILE_OT_cancel (wmOperatorType *ot)
 
void FILE_OT_parent (wmOperatorType *ot)
 
void FILE_OT_directory_new (wmOperatorType *ot)
 
void FILE_OT_previous (wmOperatorType *ot)
 
void FILE_OT_next (wmOperatorType *ot)
 
void FILE_OT_refresh (wmOperatorType *ot)
 
void FILE_OT_filenum (wmOperatorType *ot)
 
void FILE_OT_delete (wmOperatorType *ot)
 
void FILE_OT_rename (wmOperatorType *ot)
 
void FILE_OT_smoothscroll (wmOperatorType *ot)
 
void FILE_OT_filepath_drop (wmOperatorType *ot)
 
void FILE_OT_start_filter (wmOperatorType *ot)
 
void FILE_OT_edit_directory_path (wmOperatorType *ot)
 
void FILE_OT_view_selected (wmOperatorType *ot)
 
void file_directory_enter_handle (bContext *C, void *arg_unused, void *arg_but)
 
void file_filename_enter_handle (bContext *C, void *arg_unused, void *arg_but)
 
int file_highlight_set (SpaceFile *sfile, ARegion *region, int mx, int my)
 
void file_sfile_filepath_set (SpaceFile *sfile, const char *filepath)
 
void file_sfile_to_operator_ex (bContext *C, Main *bmain, wmOperator *op, SpaceFile *sfile, char *filepath)
 
void file_sfile_to_operator (bContext *C, Main *bmain, wmOperator *op, SpaceFile *sfile)
 
void file_operator_to_sfile (Main *bmain, SpaceFile *sfile, wmOperator *op)
 
void fileselect_refresh_params (SpaceFile *sfile)
 
void fileselect_file_set (bContext *C, SpaceFile *sfile, int index)
 
bool file_attribute_column_type_enabled (const FileSelectParams *params, FileAttributeColumnType column, const FileLayout *layout)
 
bool file_attribute_column_header_is_inside (const View2D *v2d, const FileLayout *layout, int x, int y)
 
FileAttributeColumnType file_attribute_column_type_find_isect (const View2D *v2d, const FileSelectParams *params, FileLayout *layout, int x)
 
float file_string_width (const char *str)
 
float file_font_pointsize ()
 
void file_select_deselect_all (SpaceFile *sfile, eDirEntry_SelectFlag flag)
 
int file_select_match (SpaceFile *sfile, const char *pattern, char *matched_file)
 
int autocomplete_directory (bContext *C, char *str, void *arg_v)
 
int autocomplete_file (bContext *C, char *str, void *arg_v)
 
void file_params_smoothscroll_timer_clear (wmWindowManager *wm, wmWindow *win, SpaceFile *sfile)
 
void file_params_renamefile_clear (FileSelectParams *params)
 
void file_params_invoke_rename_postscroll (wmWindowManager *wm, wmWindow *win, SpaceFile *sfile)
 
void file_params_rename_end (wmWindowManager *wm, wmWindow *win, SpaceFile *sfile, const FileDirEntry *rename_file)
 
void file_params_renamefile_activate (SpaceFile *sfile, FileSelectParams *params)
 
void file_on_reload_callback_register (SpaceFile *sfile, onReloadFn callback, onReloadFnData custom_data)
 
void folderlist_free (ListBase *folderlist)
 
void folderlist_popdir (ListBase *folderlist, char *dir)
 
void folderlist_pushdir (ListBase *folderlist, const char *dir)
 
const char * folderlist_peeklastdir (ListBase *folderlist)
 
bool folderlist_clear_next (SpaceFile *sfile)
 
void folder_history_list_ensure_for_active_browse_mode (SpaceFile *sfile)
 
void folder_history_list_free (SpaceFile *sfile)
 
ListBase folder_history_list_duplicate (ListBase *listbase)
 
void file_tool_props_region_panels_register (ARegionType *art)
 
void file_execute_region_panels_register (ARegionType *art)
 
void file_tools_region_panels_register (ARegionType *art)
 
void file_tile_boundbox (const ARegion *region, FileLayout *layout, int file, rcti *r_bounds)
 
void file_path_to_ui_path (const char *path, char *r_path, int r_path_maxncpy)
 
void blender::ed::asset_browser::file_create_asset_catalog_tree_view_in_layout (asset_system::AssetLibrary *asset_library, uiLayout *layout, SpaceFile *space_file, FileAssetSelectParams *params)
 
AssetCatalogFilterSettingsblender::ed::asset_browser::file_create_asset_catalog_filter_settings ()
 
void blender::ed::asset_browser::file_delete_asset_catalog_filter_settings (AssetCatalogFilterSettings **filter_settings)
 
bool blender::ed::asset_browser::file_set_asset_catalog_filter_settings (AssetCatalogFilterSettings *filter_settings, eFileSel_Params_AssetCatalogVisibility catalog_visibility, const ::bUUID &catalog_id)
 
void blender::ed::asset_browser::file_ensure_updated_catalog_filter_data (AssetCatalogFilterSettings *filter_settings, const asset_system::AssetLibrary *asset_library)
 
bool blender::ed::asset_browser::file_is_asset_visible_in_catalog_filter_settings (const AssetCatalogFilterSettings *filter_settings, const AssetMetaData *asset_data)
 

Variables

const char * file_context_dir []
 

Macro Definition Documentation

◆ ATTRIBUTE_COLUMN_PADDING

#define ATTRIBUTE_COLUMN_PADDING   (0.5f * UI_UNIT_X)

◆ FILE_LAYOUT_COMPACT

#define FILE_LAYOUT_COMPACT ( _layout)     (_layout->flag & FILE_LAYOUT_VER && (_layout->width / UI_SCALE_FAC) < 500)

◆ FILE_LAYOUT_HIDE_DATE

#define FILE_LAYOUT_HIDE_DATE ( _layout)     (_layout->flag & FILE_LAYOUT_VER && (_layout->width / UI_SCALE_FAC) < 250)

Definition at line 43 of file file_intern.hh.

Referenced by file_attribute_column_type_enabled().

◆ FILE_LAYOUT_HIDE_SIZE

#define FILE_LAYOUT_HIDE_SIZE ( _layout)     (_layout->flag & FILE_LAYOUT_VER && (_layout->width / UI_SCALE_FAC) < 350)

Definition at line 45 of file file_intern.hh.

Referenced by file_attribute_column_type_enabled().

Typedef Documentation

◆ onReloadFn

typedef void(* onReloadFn) (SpaceFile *space_data, onReloadFnData custom_data)

Definition at line 181 of file file_intern.hh.

◆ onReloadFnData

typedef void* onReloadFnData

Definition at line 180 of file file_intern.hh.

Function Documentation

◆ autocomplete_directory()

◆ autocomplete_file()

◆ file_attribute_column_header_is_inside()

bool file_attribute_column_header_is_inside ( const View2D * v2d,
const FileLayout * layout,
int x,
int y )

Check if the region coordinate defined by x and y are inside the column header.

Definition at line 890 of file filesel.cc.

References FileLayout::attribute_column_header_h, BLI_rcti_isect_pt(), View2D::mask, rcti::ymax, and rcti::ymin.

Referenced by file_column_sort_ui_context_invoke().

◆ file_attribute_column_type_enabled()

◆ file_attribute_column_type_find_isect()

◆ file_calc_previews()

void file_calc_previews ( const bContext * C,
ARegion * region )

◆ file_context()

◆ file_directory_enter_handle()

◆ file_draw_check()

◆ file_draw_check_cb()

void file_draw_check_cb ( bContext * C,
void * arg1,
void * arg2 )

For use with; UI_block_func_set.

Definition at line 1760 of file file_ops.cc.

References file_draw_check().

Referenced by ED_file_path_button(), file_panel_execution_buttons_draw(), and file_panel_operator().

◆ file_draw_check_ex()

◆ file_draw_check_exists()

bool file_draw_check_exists ( SpaceFile * sfile)

◆ file_draw_hint_if_invalid()

◆ file_draw_list()

void file_draw_list ( const bContext * C,
ARegion * region )

Definition at line 1113 of file file_draw.cc.

References ATTRIBUTE_COLUMN_PADDING, FileLayout::attribute_columns, BLF_batch_draw_begin(), BLF_batch_draw_end(), BLI_assert, BLI_rcti_translate(), CHECK_ALL, COLUMN_NAME, copy_v4_v4_uchar(), CTX_wm_manager(), CTX_wm_space_file(), CTX_wm_window(), FileLayout::curr_size, draw_background(), draw_columnheader_background(), draw_columnheader_columns(), draw_details_columns(), draw_dividers(), draw_tile_background(), ED_fileselect_get_active_params(), ED_fileselect_get_layout(), ED_fileselect_layout_numfiles(), ED_fileselect_layout_offset(), file, file_add_icon_but(), file_add_preview_drag_but(), FILE_ATTR_ANY_LINK, FILE_ATTR_HIDDEN, file_but_enable_drag(), file_draw_preview(), file_draw_string(), file_draw_tooltip_custom_func(), FILE_IMGDISPLAY, FILE_LAYOUT_HOR, FILE_MAX_LIBEXTRA, file_params_rename_end(), FILE_SEL_EDITING, FILE_SEL_HIGHLIGHTED, FILE_SEL_SELECTED, file_tooltip_data_create(), FILE_VERTICALDISPLAY, filelist_cache_previews_done(), filelist_cache_previews_running(), filelist_cache_previews_update(), filelist_entry_select_get(), filelist_file(), filelist_file_cache_block(), filelist_file_cache_slidingwindow_set(), filelist_file_get_full_path(), filelist_files_ensure(), filelist_geticon(), filelist_geticon_image(), filelist_getimage(), filelist_is_ready(), FILENAME_IS_CURRPAR, SpaceFile::files, FileLayout::flag, FileLayout::flow_columns, ICON_DEFAULT_HEIGHT_SCALE, ICON_DEFAULT_WIDTH_SCALE, IFACE_, int, MEM_freeN(), min_ii(), NC_SPACE, ND_SPACE_FILE_PARAMS, ND_SPACE_FILE_PREVIEW, params, SpaceFile::previews_timer, renamebutton_cb(), round_fl_to_int(), FileLayout::rows, FileLayout::textheight, TH_BACK, TH_HILITE, TH_TEXT, FileLayout::tile_border_x, FileLayout::tile_border_y, tile_draw_rect_get(), FileLayout::tile_h, FileLayout::tile_w, UI_block_begin(), UI_block_draw(), UI_block_end(), UI_BTYPE_LABEL, UI_BTYPE_TEXT, UI_but_active_only(), UI_BUT_DRAG_FULL_BUT, UI_but_dragflag_enable(), UI_but_flag_disable(), UI_but_flag_enable(), UI_but_func_rename_set(), UI_but_func_tooltip_custom_set(), UI_BUT_NO_UTF8, UI_BUT_UNDO, UI_CNR_NONE, UI_draw_roundbox_corner_set(), UI_EMBOSS, UI_fontstyle_draw_simple(), UI_fontstyle_string_width(), UI_GetThemeColor4ubv(), UI_SCALE_FAC, UI_style_get(), UI_STYLE_TEXT_CENTER, UI_STYLE_TEXT_LEFT, UI_UNIT_X, UI_UNIT_Y, uiDefBut(), UNUSED_VARS_NDEBUG, uiStyle::widget, FileAttributeColumn::width, FileLayout::width, WM_event_add_notifier_ex(), WM_event_timer_add_notifier(), WM_event_timer_remove_notifier(), rcti::xmin, rcti::ymax, and rcti::ymin.

Referenced by file_main_region_draw().

◆ file_execute_region_panels_register()

◆ file_external_operations_menu_register()

◆ file_filename_enter_handle()

◆ file_font_pointsize()

◆ file_highlight_set()

◆ file_main_region_needs_refresh_before_draw()

bool file_main_region_needs_refresh_before_draw ( SpaceFile * sfile)

◆ file_on_reload_callback_register()

void file_on_reload_callback_register ( SpaceFile * sfile,
onReloadFn callback,
onReloadFnData custom_data )

Register an on-reload callback function. Note that there can only be one such function at a time; registering a new one will overwrite the previous one.

Definition at line 327 of file space_file.cc.

References callback, SpaceFile_Runtime::on_reload, SpaceFile_Runtime::on_reload_custom_data, and SpaceFile::runtime.

Referenced by ED_fileselect_activate_by_id(), and ED_fileselect_activate_by_relpath().

◆ file_operator_to_sfile()

◆ FILE_OT_bookmark_add()

◆ FILE_OT_bookmark_cleanup()

◆ FILE_OT_bookmark_delete()

◆ FILE_OT_bookmark_move()

◆ FILE_OT_cancel()

◆ FILE_OT_delete()

◆ FILE_OT_directory_new()

◆ FILE_OT_edit_directory_path()

◆ FILE_OT_execute()

◆ FILE_OT_external_operation()

◆ FILE_OT_filenum()

◆ FILE_OT_filepath_drop()

◆ FILE_OT_hidedot()

◆ FILE_OT_highlight()

◆ FILE_OT_mouse_execute()

void FILE_OT_mouse_execute ( wmOperatorType * ot)

Variation of FILE_OT_execute that accounts for some mouse specific handling. Otherwise calls the same logic.

Definition at line 2181 of file file_ops.cc.

References wmOperatorType::description, ED_operator_file_browsing_active(), file_execute_mouse_invoke(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_INTERNAL, ot, and wmOperatorType::poll.

Referenced by file_operatortypes().

◆ FILE_OT_next()

◆ FILE_OT_parent()

◆ FILE_OT_previous()

◆ FILE_OT_refresh()

◆ FILE_OT_rename()

◆ FILE_OT_reset_recent()

◆ FILE_OT_select()

◆ FILE_OT_select_all()

◆ FILE_OT_select_bookmark()

◆ FILE_OT_select_box()

◆ FILE_OT_select_walk()

◆ FILE_OT_smoothscroll()

◆ FILE_OT_sort_column_ui_context()

◆ FILE_OT_start_filter()

◆ FILE_OT_view_selected()

◆ file_params_invoke_rename_postscroll()

void file_params_invoke_rename_postscroll ( wmWindowManager * wm,
wmWindow * win,
SpaceFile * sfile )

Set the renaming-state to FILE_PARAMS_RENAME_POSTSCROLL_PENDING and trigger the smooth-scroll timer. To be used right after a file was renamed. Note that the caller is responsible for setting the correct rename-file info (FileSelectParams.renamefile or FileSelectParams.rename_id).

Definition at line 1343 of file filesel.cc.

References ED_fileselect_get_active_params(), FILE_PARAMS_RENAME_POSTSCROLL_PENDING, file_params_smoothscroll_timer_clear(), params, SpaceFile::scroll_offset, SpaceFile::smoothscroll_timer, TIMER1, and WM_event_timer_add().

Referenced by file_directory_new_exec(), file_listener(), file_params_rename_end(), and renamebutton_cb().

◆ file_params_rename_end()

void file_params_rename_end ( wmWindowManager * wm,
wmWindow * win,
SpaceFile * sfile,
const FileDirEntry * rename_file )

◆ file_params_renamefile_activate()

◆ file_params_renamefile_clear()

void file_params_renamefile_clear ( FileSelectParams * params)

Definition at line 1373 of file filesel.cc.

References params.

Referenced by file_params_renamefile_activate(), and file_smoothscroll_invoke().

◆ file_params_smoothscroll_timer_clear()

void file_params_smoothscroll_timer_clear ( wmWindowManager * wm,
wmWindow * win,
SpaceFile * sfile )

◆ file_path_to_ui_path()

void file_path_to_ui_path ( const char * path,
char * r_path,
int r_path_maxncpy )

If path leads to a .blend, remove the trailing slash (if needed).

Definition at line 32 of file file_utils.cc.

References BKE_blendfile_extension_check(), BLI_path_slash_rstrip(), BLI_strncpy(), FILE_MAX_LIBEXTRA, and STRNCPY.

Referenced by file_draw_invalid_asset_library_hint().

◆ file_select_deselect_all()

◆ file_select_match()

int file_select_match ( SpaceFile * sfile,
const char * pattern,
char * matched_file )

◆ file_sfile_filepath_set()

void file_sfile_filepath_set ( SpaceFile * sfile,
const char * filepath )

Use to set the file selector path from some arbitrary source.

Definition at line 1711 of file file_ops.cc.

References BLI_assert, BLI_exists(), BLI_is_dir(), BLI_path_split_dir_file(), BLI_path_split_dir_part(), ED_fileselect_get_active_params(), FILE_DIRSEL_ONLY, params, and STRNCPY.

Referenced by filepath_drop_exec().

◆ file_sfile_to_operator()

void file_sfile_to_operator ( bContext * C,
Main * bmain,
wmOperator * op,
SpaceFile * sfile )

Definition at line 1676 of file file_ops.cc.

References FILE_MAX, and file_sfile_to_operator_ex().

Referenced by file_draw_check_ex(), filepath_drop_exec(), and fileselect_file_set().

◆ file_sfile_to_operator_ex()

◆ file_string_width()

float file_string_width ( const char * str)

◆ file_tile_boundbox()

◆ file_tool_props_region_panels_register()

◆ file_tools_region_panels_register()

◆ fileselect_file_set()

◆ fileselect_refresh_params()

void fileselect_refresh_params ( SpaceFile * sfile)

Definition at line 454 of file filesel.cc.

References ED_fileselect_get_asset_params(), and fileselect_refresh_asset_params().

Referenced by file_init(), and file_refresh().

◆ folder_history_list_duplicate()

ListBase folder_history_list_duplicate ( ListBase * listbase)

◆ folder_history_list_ensure_for_active_browse_mode()

◆ folder_history_list_free()

void folder_history_list_free ( SpaceFile * sfile)

◆ folderlist_clear_next()

◆ folderlist_free()

void folderlist_free ( ListBase * folderlist)

◆ folderlist_peeklastdir()

const char * folderlist_peeklastdir ( ListBase * folderlist)

Definition at line 80 of file folder_history.cc.

References FolderList::foldername, and ListBase::last.

Referenced by file_directory_enter_handle().

◆ folderlist_popdir()

void folderlist_popdir ( ListBase * folderlist,
char * dir )

◆ folderlist_pushdir()

void folderlist_pushdir ( ListBase * folderlist,
const char * dir )

Variable Documentation

◆ file_context_dir

const char* file_context_dir[]

Definition at line 124 of file file_intern.hh.