Blender  V3.3
Classes | Macros | Typedefs | Functions | Variables
file_intern.h File Reference
#include "DNA_space_types.h"
#include "DNA_windowmanager_types.h"

Go to the source code of this file.

Classes

struct  SpaceFile_Runtime
 

Macros

#define ATTRIBUTE_COLUMN_PADDING   (0.5f * UI_UNIT_X)
 
#define SMALL_SIZE_CHECK(_size)   ((_size) < 64)
 

Typedefs

typedef voidonReloadFnData
 
typedef void(* onReloadFn) (struct SpaceFile *space_data, onReloadFnData custom_data)
 
typedef struct SpaceFile_Runtime SpaceFile_Runtime
 
typedef struct FileAssetCatalogFilterSettingsHandle FileAssetCatalogFilterSettingsHandle
 

Functions

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, struct 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 (struct wmOperatorType *ot)
 
void FILE_OT_sort_column_ui_context (struct wmOperatorType *ot)
 
void FILE_OT_select (struct wmOperatorType *ot)
 
void FILE_OT_select_walk (struct wmOperatorType *ot)
 
void FILE_OT_select_all (struct wmOperatorType *ot)
 
void FILE_OT_select_box (struct wmOperatorType *ot)
 
void FILE_OT_select_bookmark (struct wmOperatorType *ot)
 
void FILE_OT_bookmark_add (struct wmOperatorType *ot)
 
void FILE_OT_bookmark_delete (struct wmOperatorType *ot)
 
void FILE_OT_bookmark_cleanup (struct wmOperatorType *ot)
 
void FILE_OT_bookmark_move (struct wmOperatorType *ot)
 
void FILE_OT_reset_recent (wmOperatorType *ot)
 
void FILE_OT_hidedot (struct wmOperatorType *ot)
 
void FILE_OT_execute (struct wmOperatorType *ot)
 
void FILE_OT_mouse_execute (struct wmOperatorType *ot)
 
void FILE_OT_cancel (struct wmOperatorType *ot)
 
void FILE_OT_parent (struct wmOperatorType *ot)
 
void FILE_OT_directory_new (struct wmOperatorType *ot)
 
void FILE_OT_previous (struct wmOperatorType *ot)
 
void FILE_OT_next (struct wmOperatorType *ot)
 
void FILE_OT_refresh (struct wmOperatorType *ot)
 
void FILE_OT_filenum (struct wmOperatorType *ot)
 
void FILE_OT_delete (struct wmOperatorType *ot)
 
void FILE_OT_rename (struct wmOperatorType *ot)
 
void FILE_OT_smoothscroll (struct wmOperatorType *ot)
 
void FILE_OT_filepath_drop (struct wmOperatorType *ot)
 
void FILE_OT_start_filter (struct wmOperatorType *ot)
 
void FILE_OT_edit_directory_path (struct wmOperatorType *ot)
 
void FILE_OT_view_selected (struct 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 (struct SpaceFile *sfile, struct ARegion *region, int mx, int my)
 
void file_sfile_filepath_set (struct SpaceFile *sfile, const char *filepath)
 
void file_sfile_to_operator_ex (struct Main *bmain, struct wmOperator *op, struct SpaceFile *sfile, char *filepath)
 
void file_sfile_to_operator (struct Main *bmain, struct wmOperator *op, struct SpaceFile *sfile)
 
void file_operator_to_sfile (struct Main *bmain, struct SpaceFile *sfile, struct wmOperator *op)
 
void fileselect_refresh_params (struct SpaceFile *sfile)
 
void fileselect_file_set (SpaceFile *sfile, int index)
 
bool file_attribute_column_type_enabled (const FileSelectParams *params, FileAttributeColumnType column)
 
bool file_attribute_column_header_is_inside (const struct 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)
 
void file_select_deselect_all (SpaceFile *sfile, uint flag)
 
int file_select_match (struct SpaceFile *sfile, const char *pattern, char *matched_file)
 
int autocomplete_directory (struct bContext *C, char *str, void *arg_v)
 
int autocomplete_file (struct bContext *C, char *str, void *arg_v)
 
void file_params_smoothscroll_timer_clear (struct wmWindowManager *wm, struct wmWindow *win, SpaceFile *sfile)
 
void file_params_renamefile_clear (struct FileSelectParams *params)
 
void file_params_invoke_rename_postscroll (struct wmWindowManager *wm, struct wmWindow *win, SpaceFile *sfile)
 
void file_params_rename_end (struct wmWindowManager *wm, struct wmWindow *win, SpaceFile *sfile, struct FileDirEntry *rename_file)
 
void file_params_renamefile_activate (struct SpaceFile *sfile, struct FileSelectParams *params)
 
void file_on_reload_callback_register (struct SpaceFile *sfile, onReloadFn callback, onReloadFnData custom_data)
 
void file_tool_props_region_panels_register (struct ARegionType *art)
 
void file_execute_region_panels_register (struct ARegionType *art)
 
void file_tools_region_panels_register (struct 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_pathi, int max_size)
 
FileAssetCatalogFilterSettingsHandlefile_create_asset_catalog_filter_settings (void)
 
void file_delete_asset_catalog_filter_settings (FileAssetCatalogFilterSettingsHandle **filter_settings_handle)
 
bool file_set_asset_catalog_filter_settings (FileAssetCatalogFilterSettingsHandle *filter_settings_handle, eFileSel_Params_AssetCatalogVisibility catalog_visibility, bUUID catalog_id)
 
void file_ensure_updated_catalog_filter_data (FileAssetCatalogFilterSettingsHandle *filter_settings_handle, const struct AssetLibrary *asset_library)
 
bool file_is_asset_visible_in_catalog_filter_settings (const FileAssetCatalogFilterSettingsHandle *filter_settings_handle, const AssetMetaData *asset_data)
 
void file_create_asset_catalog_tree_view_in_layout (struct AssetLibrary *asset_library, struct uiLayout *layout, struct SpaceFile *space_file, struct FileAssetSelectParams *params)
 

Variables

const char * file_context_dir []
 

Macro Definition Documentation

◆ ATTRIBUTE_COLUMN_PADDING

#define ATTRIBUTE_COLUMN_PADDING   (0.5f * UI_UNIT_X)

Definition at line 30 of file file_intern.h.

◆ SMALL_SIZE_CHECK

#define SMALL_SIZE_CHECK (   _size)    ((_size) < 64)

Related to FileSelectParams.thumbnail_size.

Definition at line 33 of file file_intern.h.

Typedef Documentation

◆ FileAssetCatalogFilterSettingsHandle

Definition at line 204 of file file_intern.h.

◆ onReloadFn

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

Definition at line 169 of file file_intern.h.

◆ onReloadFnData

typedef void* onReloadFnData

Definition at line 168 of file file_intern.h.

◆ SpaceFile_Runtime

Function Documentation

◆ autocomplete_directory()

int autocomplete_directory ( struct bContext C,
char *  str,
void arg_v 
)

Referenced by ED_file_path_button().

◆ autocomplete_file()

int autocomplete_file ( struct bContext C,
char *  str,
void arg_v 
)

◆ file_attribute_column_header_is_inside()

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

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

Referenced by file_column_sort_ui_context_invoke().

◆ file_attribute_column_type_enabled()

bool file_attribute_column_type_enabled ( const FileSelectParams params,
FileAttributeColumnType  column 
)

◆ file_attribute_column_type_find_isect()

FileAttributeColumnType file_attribute_column_type_find_isect ( const View2D v2d,
const FileSelectParams params,
FileLayout layout,
int  x 
)

◆ file_calc_previews()

void file_calc_previews ( const bContext C,
ARegion region 
)

◆ file_create_asset_catalog_filter_settings()

FileAssetCatalogFilterSettingsHandle* file_create_asset_catalog_filter_settings ( void  )

◆ file_create_asset_catalog_tree_view_in_layout()

void file_create_asset_catalog_tree_view_in_layout ( struct AssetLibrary asset_library,
struct uiLayout layout,
struct SpaceFile space_file,
struct FileAssetSelectParams params 
)

◆ file_delete_asset_catalog_filter_settings()

void file_delete_asset_catalog_filter_settings ( FileAssetCatalogFilterSettingsHandle **  filter_settings_handle)

Definition at line 677 of file asset_catalog_tree_view.cc.

Referenced by filelist_clear_asset_library().

◆ file_directory_enter_handle()

void file_directory_enter_handle ( bContext C,
void arg_unused,
void arg_but 
)

Referenced by ED_file_path_button().

◆ file_draw_check()

void file_draw_check ( bContext C)

◆ file_draw_check_cb()

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

◆ file_draw_check_ex()

void file_draw_check_ex ( bContext C,
struct ScrArea area 
)

◆ file_draw_check_exists()

bool file_draw_check_exists ( SpaceFile sfile)

◆ file_draw_hint_if_invalid()

bool file_draw_hint_if_invalid ( const bContext C,
const SpaceFile sfile,
ARegion region 
)

◆ file_draw_list()

void file_draw_list ( const bContext C,
ARegion region 
)

Definition at line 856 of file file_draw.c.

References ATTRIBUTE_COLUMN_PADDING, FileLayout::attribute_columns, BLF_batch_draw_begin(), BLF_batch_draw_end(), BLI_assert, BLI_join_dirfile(), BLI_rcti_translate(), C, CHECK_ALL, COLUMN_NAME, CTX_wm_manager(), CTX_wm_space_file(), CTX_wm_window(), View2D::cur, 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_ATTR_ANY_LINK, FILE_ATTR_HIDDEN, file_draw_icon(), file_draw_preview(), file_draw_string(), FILE_IMGDISPLAY, FILE_LAYOUT_HOR, FILE_MAX_LIBEXTRA, file_params_rename_end(), FILE_SEL_EDITING, FILE_SEL_HIGHLIGHTED, FILE_SEL_SELECTED, FILE_VERTICALDISPLAY, filelist_cache_previews_done(), filelist_cache_previews_running(), filelist_cache_previews_update(), filelist_dir(), filelist_entry_select_get(), filelist_file(), filelist_file_cache_block(), filelist_file_cache_slidingwindow_set(), filelist_files_ensure(), filelist_geticon(), filelist_geticon_image(), filelist_getimage(), FILENAME_IS_CURRPAR, SpaceFile::files, FileLayout::flag, FileLayout::flow_columns, ICON_DEFAULT_HEIGHT_SCALE, ICON_DEFAULT_WIDTH_SCALE, MIN2, min_ii(), NC_SPACE, ND_SPACE_FILE_PARAMS, ND_SPACE_FILE_PREVIEW, NULL, offset, 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_w, UI_block_begin(), UI_block_draw(), UI_block_end(), UI_BTYPE_TEXT, UI_but_active_only(), UI_but_flag_disable(), UI_but_flag_enable(), UI_but_func_rename_set(), UI_BUT_NO_UTF8, UI_BUT_UNDO, UI_CNR_NONE, UI_draw_roundbox_corner_set(), UI_EMBOSS, UI_GetThemeColor4ubv(), UI_STYLE_TEXT_CENTER, UI_STYLE_TEXT_LEFT, UI_UNIT_X, uiDefBut(), UNUSED_VARS_NDEBUG, ARegion::v2d, FileAttributeColumn::width, width, WM_event_add_notifier_ex(), WM_event_add_timer_notifier(), WM_event_remove_timer_notifier(), rcti::xmin, rctf::xmin, rcti::ymax, rctf::ymax, and rcti::ymin.

Referenced by file_main_region_draw().

◆ file_ensure_updated_catalog_filter_data()

void file_ensure_updated_catalog_filter_data ( FileAssetCatalogFilterSettingsHandle filter_settings_handle,
const struct AssetLibrary asset_library 
)

◆ file_execute_region_panels_register()

void file_execute_region_panels_register ( struct ARegionType art)

◆ file_filename_enter_handle()

void file_filename_enter_handle ( bContext C,
void arg_unused,
void arg_but 
)

◆ file_font_pointsize()

float file_font_pointsize ( void  )

◆ file_highlight_set()

int file_highlight_set ( struct SpaceFile sfile,
struct ARegion region,
int  mx,
int  my 
)

◆ file_is_asset_visible_in_catalog_filter_settings()

bool file_is_asset_visible_in_catalog_filter_settings ( const FileAssetCatalogFilterSettingsHandle filter_settings_handle,
const AssetMetaData asset_data 
)

◆ file_on_reload_callback_register()

void file_on_reload_callback_register ( struct 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 407 of file space_file.c.

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()

void file_operator_to_sfile ( struct Main bmain,
struct SpaceFile sfile,
struct wmOperator op 
)

◆ FILE_OT_bookmark_add()

void FILE_OT_bookmark_add ( struct wmOperatorType ot)

◆ FILE_OT_bookmark_cleanup()

void FILE_OT_bookmark_cleanup ( struct wmOperatorType ot)

◆ FILE_OT_bookmark_delete()

void FILE_OT_bookmark_delete ( struct wmOperatorType ot)

◆ FILE_OT_bookmark_move()

void FILE_OT_bookmark_move ( struct wmOperatorType ot)

◆ FILE_OT_cancel()

void FILE_OT_cancel ( struct wmOperatorType ot)

◆ FILE_OT_delete()

void FILE_OT_delete ( struct wmOperatorType ot)

◆ FILE_OT_directory_new()

void FILE_OT_directory_new ( struct wmOperatorType ot)

◆ FILE_OT_edit_directory_path()

void FILE_OT_edit_directory_path ( struct wmOperatorType ot)

◆ FILE_OT_execute()

void FILE_OT_execute ( struct wmOperatorType ot)

◆ FILE_OT_filenum()

void FILE_OT_filenum ( struct wmOperatorType ot)

◆ FILE_OT_filepath_drop()

void FILE_OT_filepath_drop ( struct wmOperatorType ot)

◆ FILE_OT_hidedot()

void FILE_OT_hidedot ( struct wmOperatorType ot)

◆ FILE_OT_highlight()

void FILE_OT_highlight ( struct wmOperatorType ot)

◆ FILE_OT_mouse_execute()

void FILE_OT_mouse_execute ( struct wmOperatorType ot)

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

Definition at line 1901 of file file_ops.c.

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()

void FILE_OT_next ( struct wmOperatorType ot)

◆ FILE_OT_parent()

void FILE_OT_parent ( struct wmOperatorType ot)

◆ FILE_OT_previous()

void FILE_OT_previous ( struct wmOperatorType ot)

◆ FILE_OT_refresh()

void FILE_OT_refresh ( struct wmOperatorType ot)

◆ FILE_OT_rename()

void FILE_OT_rename ( struct wmOperatorType ot)

◆ FILE_OT_reset_recent()

void FILE_OT_reset_recent ( wmOperatorType ot)

◆ FILE_OT_select()

void FILE_OT_select ( struct wmOperatorType ot)

◆ FILE_OT_select_all()

void FILE_OT_select_all ( struct wmOperatorType ot)

◆ FILE_OT_select_bookmark()

void FILE_OT_select_bookmark ( struct wmOperatorType ot)

◆ FILE_OT_select_box()

void FILE_OT_select_box ( struct wmOperatorType ot)

◆ FILE_OT_select_walk()

void FILE_OT_select_walk ( struct wmOperatorType ot)

◆ FILE_OT_smoothscroll()

void FILE_OT_smoothscroll ( struct wmOperatorType ot)

◆ FILE_OT_sort_column_ui_context()

void FILE_OT_sort_column_ui_context ( struct wmOperatorType ot)

◆ FILE_OT_start_filter()

void FILE_OT_start_filter ( struct wmOperatorType ot)

◆ FILE_OT_view_selected()

void FILE_OT_view_selected ( struct wmOperatorType ot)

◆ file_params_invoke_rename_postscroll()

void file_params_invoke_rename_postscroll ( struct wmWindowManager wm,
struct 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 1267 of file filesel.c.

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

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

◆ file_params_rename_end()

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

◆ file_params_renamefile_activate()

void file_params_renamefile_activate ( struct SpaceFile sfile,
struct FileSelectParams params 
)

◆ file_params_renamefile_clear()

void file_params_renamefile_clear ( struct FileSelectParams params)

Definition at line 1297 of file filesel.c.

References NULL, and params.

Referenced by file_params_renamefile_activate(), and file_smoothscroll_invoke().

◆ file_params_smoothscroll_timer_clear()

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

◆ file_path_to_ui_path()

void file_path_to_ui_path ( const char *  path,
char *  r_pathi,
int  max_size 
)

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

Definition at line 35 of file file_utils.c.

References BLI_path_slash_rstrip(), BLI_strncpy(), BLO_has_bfile_extension(), and PATH_MAX.

Referenced by file_draw_invalid_asset_library_hint().

◆ file_select_deselect_all()

void file_select_deselect_all ( SpaceFile sfile,
uint  flag 
)

◆ file_select_match()

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

◆ file_set_asset_catalog_filter_settings()

bool file_set_asset_catalog_filter_settings ( FileAssetCatalogFilterSettingsHandle filter_settings_handle,
eFileSel_Params_AssetCatalogVisibility  catalog_visibility,
bUUID  catalog_id 
)
Returns
True if the file list should update its filtered results (e.g. because filtering parameters changed).

◆ file_sfile_filepath_set()

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

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

Definition at line 1692 of file file_ops.c.

References BLI_assert, BLI_exists(), BLI_is_dir(), BLI_split_dir_part(), BLI_split_dirfile(), BLI_strncpy(), ED_fileselect_get_active_params(), FILE_DIRSEL_ONLY, and params.

Referenced by filepath_drop_exec().

◆ file_sfile_to_operator()

void file_sfile_to_operator ( struct Main bmain,
struct wmOperator op,
struct SpaceFile sfile 
)

Definition at line 1657 of file file_ops.c.

References FILE_MAX, and file_sfile_to_operator_ex().

Referenced by file_draw_check_ex(), and filepath_drop_exec().

◆ file_sfile_to_operator_ex()

void file_sfile_to_operator_ex ( struct Main bmain,
struct wmOperator op,
struct SpaceFile sfile,
char *  filepath 
)

◆ file_string_width()

float file_string_width ( const char *  str)

◆ file_tile_boundbox()

void file_tile_boundbox ( const ARegion region,
FileLayout layout,
int  file,
rcti r_bounds 
)

◆ file_tool_props_region_panels_register()

void file_tool_props_region_panels_register ( struct ARegionType art)

◆ file_tools_region_panels_register()

void file_tools_region_panels_register ( struct ARegionType art)

◆ fileselect_file_set()

void fileselect_file_set ( SpaceFile sfile,
int  index 
)

◆ fileselect_refresh_params()

void fileselect_refresh_params ( struct SpaceFile sfile)

Definition at line 438 of file filesel.c.

References ED_fileselect_get_asset_params(), and fileselect_refresh_asset_params().

Referenced by file_init(), and file_refresh().

Variable Documentation

◆ file_context_dir

const char* file_context_dir[]
extern

Definition at line 889 of file space_file.c.

Referenced by bpy_context_members(), and file_context().