14#include <fmt/format.h>
65#include "RNA_prototypes.hh"
102 "File select parameters not set. The caller is expected to check this.");
107 space_ptr, RNA_FileSelectParams, params);
112 but = uiDefButR(block,
141 block_func_set(block,
nullptr,
nullptr,
nullptr);
174 bool free_imbuf = (thumb ==
nullptr);
191 tooltip_text_field_add(
199 tooltip_text_field_add(
203 tooltip_text_field_add(
207 tooltip_text_field_add(tip,
208 TIP_(
"This is a restricted system file"),
215 char version_str[128] = {0};
223 thumb->
metadata(),
"Thumb::Blender::Version", version_str,
sizeof(version_str));
230 SNPRINTF_UTF8(version_str,
"%d.%01d", version / 100, version % 100);
234 if (version_str[0]) {
235 tooltip_text_field_add(tip,
236 fmt::format(
"Blender {}", version_str),
252 thumb->
metadata(),
"Thumb::Image::Width", value1,
sizeof(value1)) &&
254 thumb->
metadata(),
"Thumb::Image::Height", value2,
sizeof(value2)))
256 tooltip_text_field_add(tip,
257 fmt::format(
"{} \u00D7 {}", value1, value2),
275 thumb->
metadata(),
"Thumb::Video::Width", value1,
sizeof(value1)) &&
277 thumb->
metadata(),
"Thumb::Video::Height", value2,
sizeof(value2)))
279 tooltip_text_field_add(tip,
280 fmt::format(
"{} \u00D7 {}", value1, value2),
286 thumb->
metadata(),
"Thumb::Video::Frames", value1,
sizeof(value1)) &&
288 thumb->
metadata(),
"Thumb::Video::FPS", value2,
sizeof(value2)) &&
290 thumb->
metadata(),
"Thumb::Video::Duration", value3,
sizeof(value3)))
292 tooltip_text_field_add(
294 fmt::format(fmt::runtime(
TIP_(
"{} Frames @ {} FPS")), value1, value2),
298 tooltip_text_field_add(tip,
299 fmt::format(fmt::runtime(
TIP_(
"{} seconds")), value3),
314 TIP_(
"The five boxing wizards jump quickly! 0123456789"));
318 const time_t file_time = (time_t)file->
time;
320 const time_t ts_now = time(
nullptr);
330 tooltip_text_field_add(tip,
331 fmt::format(fmt::runtime(
TIP_(
"Modified: {}")), modified_s),
339 if (file->
size < 10000) {
342 tooltip_text_field_add(
344 fmt::format(fmt::runtime(
TIP_(
"Size: {} ({} bytes)")), size, size_full),
350 tooltip_text_field_add(tip,
351 fmt::format(fmt::runtime(
TIP_(
"Size: {}")), size),
362 image_data.
ibuf = thumb;
368 image_data.
border =
false;
370 tooltip_image_field_add(tip, image_data);
378 image_data.ibuf = thumb;
379 image_data.width = short(
float(thumb->
x) *
scale);
380 image_data.height = short(
float(thumb->
y) *
scale);
381 image_data.border =
true;
383 image_data.premultiplied =
true;
384 tooltip_image_field_add(tip, image_data);
387 if (thumb && free_imbuf) {
404 float color_background_1[4], color_background_2[4], color_outline[4];
405 const float roundness = wcol.
roundness *
U.widget_unit;
421 copy_v4_v4(color_background_2, color_background_1);
424 constexpr float inv_255 = 1.0f / 255.0f;
428 for (
int i = 0; i < 3; i++) {
429 color_background_1[i] = std::clamp(color_base[i] + wcol.
shadetop * inv_255, 0.0f, 1.0f);
430 color_background_2[i] = std::clamp(color_base[i] + wcol.
shadedown * inv_255, 0.0f, 1.0f);
435 if (is_highlighted) {
436 color_background_1[3] = std::min(color_background_1[3] + 0.1f, 1.0f);
439 color_background_2[3] = color_background_1[3];
443 &draw_rect_fl, color_background_1, color_background_2, 1.0f, color_outline, 1.0f, roundness);
450 const ImBuf *preview_image,
457 button_drag_set_id(but,
id);
459 button_drag_attach_image(but, preview_image,
scale);
467 if (import_method > -1) {
479 else if (preview_image) {
480 button_drag_set_image(but, path, icon, preview_image,
scale);
484 button_drag_set_path(but, path);
496 button_func_tooltip_custom_set(but,
507 const rcti *tile_draw_rect,
516 const int x = tile_draw_rect->
xmin + padx;
517 const int y = tile_draw_rect->
ymin +
522 but = uiDefIconBut(block,
538 but = uiDefIconPreviewBut(block,
550 button_label_alpha_factor_set(but, dimmed ? 0.3f : 1.0f);
571 button_label_alpha_factor_set(but, 0.6f);
572 const uchar light[4] = {255, 255, 255, 255};
573 button_color_set(but, light);
590 if (
string[0] ==
'\0' || width < 1) {
604 rect.
ymin = sy - height;
608 font_style_params.
align = align;
610 fontstyle_draw(&fs, &rect,
filename,
sizeof(
filename), col, &font_style_params);
628 fontstyle_draw_multiline_clipped(&fs, rect,
string, col, align);
633 if (
string[0] ==
'\0' || wrap_width < 1) {
634 return {.xmin = 0, .xmax = 0, .ymin = 0, .ymax = 0};
661 const uchar text_col[4],
667 if (
string[0] ==
'\0' || wrap_width < 1) {
677 rect.
xmax = sx + wrap_width;
688 fontstyle_draw_ex(&style->
widget,
701 *r_sy = rect.
ymin + line_height;
706 const int image_height,
713 float scaledx, scaledy;
714 if (((ui_imbx > layout.
prv_w) || (ui_imby > layout.
prv_h)) ||
715 ((ui_imbx < layout.
prv_w) || (ui_imby < layout.
prv_h)))
717 if (image_width > image_height) {
720 scale = scaledx / image_width;
725 scale = scaledy / image_height;
734 return std::make_tuple(
int(scaledx),
int(scaledy),
scale);
741 const rcti *tile_draw_rect,
742 const int file_type_icon)
748 tile_draw_rect->
xmin,
749 tile_draw_rect->
ymin,
758 const ImBuf *drag_image = (preview_image || file->
asset) ?
763 std::max(drag_image->
x, drag_image->
y) :
772 const rcti *tile_draw_rect)
778 const int icon_x = preview_center_x - icon_width * 0.5f;
779 const int icon_y = preview_center_y - icon_height * 0.5f;
783 "ASSET_OT_asset_download",
798 const rcti *tile_draw_rect,
808 const float ofs_x = (
float(layout->
prv_w) -
float(scaled_width)) / 2.0f;
809 const float ofs_y = (
float(layout->
prv_h) -
float(scaled_height)) / 2.0f;
810 const int xmin = tile_draw_rect->
xmin + layout->
prv_border_x + int(ofs_x + 0.5f);
815 float document_img_col[4] = {1.0f, 1.0f, 1.0f, 1.0f};
820 document_img_col[3] *= 0.3f;
826 float(xmin),
float(ymin),
float(xmin + scaled_width),
float(ymin + scaled_height));
838 drawer.
draw(
float(xmin),
858 float border_color[4] = {1.0f, 1.0f, 1.0f, 0.15f};
862 border_color[0] = 0.0f;
863 border_color[1] = 0.0f;
864 border_color[2] = 0.0f;
870 float(xmin + scaled_width + 1),
871 float(ymin + scaled_height + 1));
879 const rcti *tile_draw_rect,
880 const int file_type_icon,
881 const float icon_aspect,
886 float document_img_col[4] = {1.0f, 1.0f, 1.0f, 1.0f};
897 document_img_col[3] *= 0.3f;
914 const float scale = 4.0f;
928 if (file_type_icon) {
930 float icon_opacity = 0.4f;
931 uchar icon_color[4] = {0, 0, 0, 255};
956 const float preview_icon_aspect,
959 uchar icon_color[4] = {0, 0, 0, 255};
965 const float aspect = preview_icon_aspect /
UI_SCALE_FAC;
969 ICON_PREVIEW_LOADING,
981 const rcti *tile_draw_rect,
982 const float preview_icon_aspect,
983 const int file_type_icon,
984 const bool has_special_file_image,
995 const bool show_icon_border = (icon_color_lightness > 96);
999 if (preview_icon_aspect < 2.0f) {
1026 else if (file_type_icon) {
1053 if (is_current_main_data) {
1077 else if (file->
asset &&
1083 ICON_STATUS_WARNING_FILLED,
1110 if (!
STREQ(orgname, newname)) {
1114 RPT_ERROR,
"Could not rename: %s", errno ? strerror(errno) :
"unknown error");
1146 float col_alternating[4];
1151 for (i = 2; (i <= layout->
rows + 1); i += 2) {
1173 uint vertex_len = 0;
1175 while (sx < v2d->cur.xmax) {
1180 if (vertex_len > 0) {
1182 float col_hi[3], col_lo[3];
1198 while (sx < v2d->cur.xmax) {
1207 v1[0] =
v2[0] = sx + 1;
1234 const uchar text_col[4])
1280 sx += column->
width;
1306 const bool update_stat_strings)
1311 if (file->
draw_data.datetime_str[0] ==
'\0' || update_stat_strings) {
1312 const time_t file_time = (time_t)file->
time;
1314 const time_t ts_now = time(
nullptr);
1317 std::string modified_s =
1335 if (file->
draw_data.size_str[0] ==
'\0' || update_stat_strings) {
1353 const rcti *tile_draw_rect,
1354 const uchar text_col[4])
1357 const bool update_stat_strings = layout->
width != layout->
curr_size;
1365 sx += column->
width;
1378 tile_draw_rect->
ymax,
1386 sx += column->
width;
1392 int tile_pos_x, tile_pos_y;
1394 tile_pos_x += int(v2d->
tot.
xmin);
1395 tile_pos_y = int(v2d->
tot.
ymax - tile_pos_y);
1398 rect.
xmin = tile_pos_x;
1400 rect.
ymax = tile_pos_y;
1413 const int icon_ofs_x)
1417 rcti rect = tile_rect;
1423 rect.
xmin += icon_ofs_x + 1;
1443 int numfiles_layout;
1451 const float thumb_icon_aspect = std::min(64.0f /
float(params->
thumbnail_size), 4.0f);
1462 offset = std::max(offset, 0);
1468 numfiles_layout += layout->
rows;
1480 files,
min_ii(offset + (numfiles_layout / 2), numfiles - 1));
1516 for (i = offset; (i < numfiles) && (i < offset + numfiles_layout); i++) {
1563 bool has_special_file_image =
false;
1569 else if (preview_buf) {
1581 has_special_file_image =
true;
1590 has_special_file_image,
1606 if (filelist_loading) {
1614 icon_ofs += layout->
prv_w + 2 * padx;
1620 const int drag_width = std::min(
1621 str_width + icon_ofs,
1623 if (drag_width > 0) {
1629 tile_draw_rect.
xmin,
1665 tile_draw_rect.
xmin + padx - 2,
1675 const int but_height =
1685 text_rect.
ymax - but_height,
1695 if (
false == button_active_only(
C, region, block, but)) {
1740 uchar text_col_mod[4];
1743 text_col_mod[3] /= 2;
1746 const char *message = [&]() {
1748 return IFACE_(
"Loading...");
1751 return IFACE_(
"No results match the search filter");
1755 return IFACE_(
"No items. Note: The \"Only Online\" filter option is enabled.");
1758 return IFACE_(
"No items. Note: The \"Only Offline\" filter option is enabled.");
1760 return IFACE_(
"No items");
1772 block_end(
C, block);
1773 block_draw(
C, block);
1776 if (draw_columnheader) {
1781 if (numfiles != -1) {
1790 static const char *funcname = __func__;
1807 banner.
layout(*sfile, layout.
row(
false));
1809 block_layout_resolve(block);
1810 block_end(
C, block);
1811 block_draw(
C, block);
1819 bool is_project_library)
1836 const char *message =
RPT_(
"Path to asset library does not exist:");
1845 sy -= line_height * 2.2f;
1850 const char *suggestion =
RPT_(
1851 "Asset Libraries are local directories that can contain .blend files with assets inside.\n"
1852 "Manage Asset Libraries from the Asset Libraries section in the Preferences");
1854 sx +
UI_UNIT_X, sy, suggestion, width -
UI_UNIT_X, line_height, text_col,
nullptr, &sy);
1858 if (is_project_library) {
1864 ui::Button *but = uiDefIconTextButO_ptr(block,
1875 PointerRNA *but_opptr = button_operator_ptr_ensure(but);
1876 if (is_project_library) {
1883 block_end(
C, block);
1884 block_draw(
C, block);
1902 const char *message =
RPT_(
1903 "Allow Online Access in order to browse and download online assets, or turn off the "
1904 "\"Remote Assets\" filter to show only the downloaded assets.\n\nYou can adjust this "
1905 "later from the \"System\" preferences.");
1907 const int box_width = std::min(available_width,
UI_UNIT_X * 28);
1909 const int wrap_width = box_width - 2 * pad_x;
1912 const int message_height =
BLI_rcti_size_y(&message_textbox) + 0.5f * line_height;
1915 const int box_height = heading_height + message_height +
1945 uiDefIconTextBut(block,
1947 ICON_INTERNET_OFFLINE,
1948 "Internet Access Required",
1950 sy - heading_height,
1956 const int button_width = (wrap_width - pad_x) * 0.5f;
1959 "WM_OT_context_set_boolean",
1964 sy + pad_y - box_height + pad_y,
1969 RNA_string_set(but_opptr,
"data_path",
"preferences.extensions.use_online_access_handled");
1972 uiDefIconTextButO(block,
1974 "extensions.userpref_allow_online",
1977 "Allow Online Access",
1978 sx + button_width + pad_x,
1979 sy + pad_y - box_height + pad_y,
1990 sy - heading_height - pad_y,
2018 const int box_width = std::min({available_width,
UI_UNIT_X * 28, message_width + (2 * pad_x)});
2020 const int wrap_width = box_width - 2 * pad_x;
2023 const int message_height =
BLI_rcti_size_y(&message_textbox) + 0.5f * line_height;
2026 const int box_height = heading_height + message_height +
2054 uiDefIconTextBut(block,
2056 ICON_STATUS_ERROR_FILLED,
2057 "Asset Library Download Failed",
2059 sy - heading_height,
2071 sy - heading_height - pad_y,
2083 const char *blendfile_path,
2098 const char *message =
RPT_(
"Unreadable Blender library file:");
2106 sy -= line_height * 2.2f;
2109 const short report_type = report.
type;
2114 int icon = ICON_STATUS_INFO;
2116 icon = ICON_STATUS_WARNING_FILLED;
2151 const auto setup_view)
2167 if (is_remote_library) {
2177 if (!is_online_allowed && !was_choice_made) {
2211 const bool is_library_browser = !is_asset_browser &&
2214 const auto setup_view = [region]() {
2224 if (is_library_browser) {
Main runtime representation of an asset.
File and directory operations.
#define FILE_ATTR_ANY_LINK
Some types for dealing with directories.
#define BLI_path_join(...)
#define FILENAME_IS_CURRPAR(_n)
#define BLI_STR_FORMAT_UINT64_GROUPED_SIZE
#define SNPRINTF_UTF8(dst, format,...)
#define STRNCPY_UTF8(dst, src)
Compatibility-like things for windows.
external readfile function prototypes.
#define FILE_MAX_LIBEXTRA
Read Blender memory allocation and freeing.
#define ICON_DEFAULT_HEIGHT
#define ICON_DEFAULT_WIDTH_SCALE
#define UI_NO_ICON_OVERLAY_TEXT
#define PREVIEW_DRAG_DRAW_SIZE
#define ICON_DEFAULT_HEIGHT_SCALE
#define ICON_DEFAULT_WIDTH
#define ND_SPACE_FILE_PREVIEW
#define ND_SPACE_FILE_PARAMS
int pad[32 - sizeof(int)]
#define UNUSED_VARS_NDEBUG(...)
#define BLI_assert_msg(a, msg)
void draw(float x, float y, int img_w, int img_h, gpu::TextureFormat gpu_format, bool use_filter, const void *rect, float scale_x, float scale_y, const float color[4])
constexpr const char * c_str() const
PreviewImage * get_preview() const
bool needs_download() const
RemoteAssetFileStatus remote_file_status() const
void ensure_previewable(const bContext &C, ReportList *reports=nullptr)
static std::optional< StringRefNull > failure_message(StringRef url)
static std::optional< RemoteLibraryLoadingStatus::Status > status(StringRef url)
constexpr const T * data() const
#define FILE_LAYOUT_COMPACT(_layout)
#define ATTRIBUTE_COLUMN_PADDING
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
float3x3 scale(float3x3 mat, float2 scale)
std::string datetime(const std::tm &date_time, StringRef locale_iso={}, DateFormat date_format=DateFormat::Default, TimeFormat time_format=TimeFormat::H24, const std::tm *now=nullptr, StringRef today={}, StringRef yesterday={})
std::tm localtime_safe(time_t time)
std::string date(const std::tm &date_time, StringRef locale_iso={}, DateFormat format=DateFormat::Default)
void asset_tooltip(const asset_system::AssetRepresentation &asset, ui::TooltipData &tip, const bool include_name)
void operator_asset_reference_props_set(const asset_system::AssetRepresentation &asset, PointerRNA &ptr)
BIFIconID asset_preview_or_icon(const asset_system::AssetRepresentation &asset)
std::string filename(const std::string_view &str, size_t pos)
void get_color_4ubv(int colorid, unsigned char col[4])
void get_color_4fv(int colorid, float col[4])
void get_color_shade_3fv(int colorid, int offset, float col[3])
const bTheme * theme_get()
void view2d_view_ortho(const View2D *v2d)
void view2d_totRect_set(View2D *v2d, int width, int height)
const uiStyle * style_get()
int fontstyle_string_width(const uiFontStyle *fs, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
PointerRNA * button_operator_ptr_ensure(Button *but)
void icon_draw_ex(float x, float y, int icon_id, float aspect, float alpha, float desaturate, const uchar mono_color[4], bool mono_border, const IconTextOverlay *text_overlay, const bool inverted=false, float scale=1.0f)
void button_icon_scale_set(Button *but, float scale)
float text_clip_middle_ex(const uiFontStyle *fstyle, char *str, float okwidth, float minwidth, size_t str_maxncpy, char rpart_sep, bool clip_right_if_tight=true, bool shorten_template_variables=false)
const uiStyle * style_get_dpi()
void draw_icon_tri(float x, float y, char dir, const float[4], float aspect=1.0f)
Block * block_begin(const bContext *C, ARegion *region, std::string name, EmbossType emboss)
void icon_render_id_ex(const bContext *C, Scene *scene, ID *id_to_render, const enum eIconSizes size, const bool use_job, PreviewImage *r_preview_image)
void fontstyle_draw_simple(const uiFontStyle *fs, float x, float y, const char *str, const uchar col[4])
void draw_roundbox_4fv_ex(const rctf *rect, const float inner1[4], const float inner2[4], float shade_dir, const float outline[4], float outline_width, float rad)
void block_draw(const bContext *C, Block *block)
void block_end(const bContext *C, Block *block, bool postpone_callbacks=false)
void icon_draw(float x, float y, int icon_id)
Layout & block_layout(Block *block, LayoutDirection direction, LayoutType type, int x, int y, int size, int em, int padding, const uiStyle *style)
@ BUT_TEXTEDIT_AUTOCOMPLETE_KEEP_ACTIVE
void button_pushbutton_draw_as_overlay_set(Button *but, bool value)
void * MEM_new_uninitialized(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void WM_global_reportf(eReportType type, const char *format,...)
void BLF_boundbox(int fontid, const char *str, size_t str_len, rcti *r_box, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
int ED_fileselect_layout_offset(FileLayout *layout, int x, int y)
void WM_report_banner_show(wmWindowManager *wm, wmWindow *win)
MINLINE void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
void file_draw_check_cb(bContext *C, void *arg1, void *arg2)
void immUniformThemeColorBlend(int color_id1, int color_id2, float fac)
char * STRNCPY(char(&dst)[N], const char *src)
ImBuf * IMB_font_preview(const char *filepath, unsigned int width, const float color[4], const char *sample_text=nullptr)
static void file_draw_invalid_asset_library_hint(const bContext *C, const SpaceFile *sfile, ARegion *region, FileAssetSelectParams *asset_params, bool is_project_library)
int ED_fileselect_layout_numfiles(FileLayout *layout, ARegion *region)
void WM_event_add_notifier_ex(wmWindowManager *wm, const wmWindow *win, uint type, void *reference)
static void file_draw_asset_library_remote_loading_failed_hint(const bContext *C, const SpaceFile *sfile, ARegion *region, const bUserAssetLibrary *library)
FileLayout * ED_fileselect_get_layout(SpaceFile *sfile, ARegion *region)
bool filelist_cache_previews_update(FileList *filelist)
static rcti file_measure_string_multiline(const StringRef string, const int wrap_width)
static void file_draw_loading_icon(const rcti *tile_draw_rect, const float preview_icon_aspect, const FileLayout *layout)
MINLINE void copy_v3_v3(float r[3], const float a[3])
std::string WM_operatortype_name(wmOperatorType *ot, PointerRNA *properties)
ImBuf * filelist_file_get_preview_image(const FileDirEntry *file)
bool filelist_is_dir(const FileList *filelist, const char *path)
MINLINE int round_fl_to_int(float a)
MINLINE unsigned char srgb_to_grayscale_byte(const unsigned char rgb[3])
short BLO_version_from_file(const char *filepath)
@ ASSET_LIBRARY_PROJECT_DEFINED
@ ASSET_LIBRARY_USE_REMOTE_URL
static rcti text_draw_rect_get(const View2D *v2d, const eFileDisplayType display_type, const FileLayout *layout, const int file_idx, const int icon_ofs_x)
void BLF_wordwrap(int fontid, int wrap_width, BLFWrapMode mode=BLFWrapMode::Minimal)
void WM_event_timer_remove_notifier(wmWindowManager *wm, wmWindow *win, wmTimer *timer)
void imm_draw_box_checker_2d(float x1, float y1, float x2, float y2, bool clear_alpha=false)
void filelist_online_asset_preview_request(const bContext *C, FileDirEntry *entry)
void immAttrSkip(uint attr_id)
GPUVertFormat * immVertexFormat()
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
bool ED_fileselect_is_asset_browser(const SpaceFile *sfile)
bool BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLF_batch_draw_begin()
bool file_draw_hint_if_invalid(const bContext *C, const SpaceFile *sfile, ARegion *region)
void immBegin(GPUPrimType, uint vertex_len)
ImBuf * IMB_thumb_read(const char *file_or_lib_path, ThumbSize size)
struct bUserAssetLibrary * BKE_preferences_asset_library_find_index(const struct UserDef *userdef, int index) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
void ED_fileselect_layout_tilepos(const FileLayout *layout, int tile, int *x, int *y)
wmWindow * CTX_wm_window(const bContext *C)
@ FILE_BROWSE_MODE_ASSETS
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
void BKE_reports_clear(ReportList *reports)
void file_directory_enter_handle(bContext *C, void *arg_unused, void *arg_but)
static void file_draw_tooltip_custom_func(bContext &, ui::TooltipData &tip, ui::Button *, void *argN)
static const bUserAssetLibrary * assetlib_ref_as_library(const AssetLibraryReference &asset_library_ref)
void immUniformColor4fv(const float rgba[4])
void ED_region_tag_redraw(ARegion *region)
static void renamebutton_cb(bContext &C, StringRefNull oldname)
int filelist_geticon_file_type(FileList *filelist, int index, bool is_main)
MINLINE float srgb_to_grayscale(const float rgb[3])
int autocomplete_directory(bContext *C, char *str, void *arg_v)
void BLF_disable(int fontid, FontFlags flag)
void MEM_delete_void(void *vmemh)
@ USER_EXTENSION_FLAG_ONLINE_ACCESS_HANDLED
eDirEntry_SelectFlag filelist_entry_select_get(FileList *filelist, FileDirEntry *entry, FileCheckType check)
void BLI_rctf_rcti_copy(struct rctf *dst, const struct rcti *src)
wmTimer * WM_event_timer_add_notifier(wmWindowManager *wm, wmWindow *win, const uint type, const double time_step)
@ GPU_BLEND_ALPHA_PREMULT
static void file_draw_string_multiline(int sx, int sy, const StringRef string, int wrap_width, int line_height, const uchar text_col[4], int *r_sx, int *r_sy)
void file_path_to_ui_path(const char *path, char *r_path, int r_path_maxncpy)
void immAttr3fv(uint attr_id, const float data[3])
void immBindBuiltinProgram(GPUBuiltinShader shader_id)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
static ui::Button * file_add_icon_but(const SpaceFile *sfile, ui::Block *block, const char *, const FileDirEntry *file, const rcti *tile_draw_rect, int icon, int width, int height, int padx, bool dimmed)
bool BKE_blendfile_is_readable(const char *path, ReportList *reports)
void void BLI_path_split_dir_part(const char *filepath, char *dir, size_t dir_maxncpy) ATTR_NONNULL(1
void IMB_freeImBuf(ImBuf *ibuf)
void file_params_rename_end(wmWindowManager *wm, wmWindow *win, SpaceFile *sfile, const FileDirEntry *rename_file)
FileDirEntry * filelist_file(FileList *filelist, int index)
void immVertex2f(uint attr_id, float x, float y)
bool filelist_cache_previews_done(FileList *filelist)
int BLI_rename(const char *from, const char *to) ATTR_NONNULL()
void file_banners_for_first_visible(const SpaceFile &sfile, FunctionRef< void(const BannerType &)> fn)
static const char * filelist_get_details_column_string(FileAttributeColumnType column, FileDirEntry *file, const bool compact, const bool update_stat_strings)
static void draw_background(FileLayout *layout, View2D *v2d)
BMesh const char void * data
static std::tuple< int, int, float > preview_image_scaled_dimensions_get(const int image_width, const int image_height, const FileLayout &layout)
ImBuf * filelist_geticon_special_file_image_ex(const FileDirEntry *file)
@ GPU_SHADER_3D_IMAGE_COLOR
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_SHADER_3D_FLAT_COLOR
bool filelist_islibrary(FileList *filelist, char *dir, char **r_group)
wmWindowManager * CTX_wm_manager(const bContext *C)
bool filelist_file_cache_block(FileList *filelist, int index)
bool filelist_is_ready(const FileList *filelist)
void ED_fileselect_clear(wmWindowManager *wm, SpaceFile *sfile)
void immUniformThemeColorShade(int color_id, int offset)
int ED_fileselect_asset_import_method_get(const SpaceFile *sfile, const FileDirEntry *file)
static void draw_columnheader_columns(const FileSelectParams *params, FileLayout *layout, const View2D *v2d, const uchar text_col[4])
static void draw_details_columns(const FileSelectParams *params, const FileLayout *layout, FileDirEntry *file, const rcti *tile_draw_rect, const uchar text_col[4])
static void file_but_enable_drag(ui::Button *but, const SpaceFile *sfile, const FileDirEntry *file, const char *path, const ImBuf *preview_image, int icon, float scale)
@ FILE_ASSET_IMPORT_INSTANCE_COLLECTIONS_ON_APPEND
@ FILE_ASSET_IMPORT_INSTANCE_COLLECTIONS_ON_LINK
static void file_draw_string(int sx, int sy, const char *string, float width, int height, ui::FontStyleAlign align, const uchar col[4])
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
static void file_draw_preview(const FileDirEntry *file, const rcti *tile_draw_rect, const IconBufferRef &preview, FileLayout *layout, const bool dimmed)
void file_params_invoke_rename_postscroll(wmWindowManager *wm, wmWindow *win, SpaceFile *sfile)
BlendHandle * filelist_lib(FileList *filelist)
int filelist_files_ensure(FileList *filelist)
static void draw_fixed_header_background(const View2D *v2d, const float height)
static rcti tile_draw_rect_get(const View2D *v2d, const FileLayout *layout, const int file_idx)
void ED_file_path_button(bScreen *screen, SpaceFile *sfile, FileSelectParams *params, ui::Block *block)
MINLINE void copy_v4_v4_uchar(unsigned char r[4], const unsigned char a[4])
FileSelectParams * ED_fileselect_get_active_params(const SpaceFile *sfile)
void BLF_batch_draw_end()
uint GPU_vertformat_attr_add(GPUVertFormat *format, StringRef name, gpu::VertAttrType type)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
void file_draw_list(const bContext *C, ARegion *region)
static void file_draw_invalid_library_hint(const bContext *, const SpaceFile *sfile, ARegion *region, const char *blendfile_path, ReportList *reports)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
static void file_add_preview_drag_but(const SpaceFile *sfile, ui::Block *block, const FileDirEntry *file, const char *path, const rcti *tile_draw_rect, const int file_type_icon)
static void file_but_tooltip_func_set(const SpaceFile *sfile, const FileDirEntry *file, ui::Button *but)
SpaceLink * CTX_wm_space_data(const bContext *C)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
static ui::Button * file_add_overlay_icon_but(ui::Block *block, int pos_x, int pos_y, int icon)
bool filelist_file_is_preview_pending(const FileList *filelist, const FileDirEntry *file)
static void file_add_asset_download_but(ui::Block *block, const FileLayout *layout, const FileDirEntry *file, const rcti *tile_draw_rect)
FileAssetSelectParams * ED_fileselect_get_asset_params(const SpaceFile *sfile)
ImBuf * IMB_thumb_manage(const char *file_or_lib_path, ThumbSize size, ThumbSource source, const ThumbCancellationToken *cancel_token=nullptr)
static void file_draw_indicator_icons(const FileList *files, const FileDirEntry *file, const FileLayout *layout, const rcti *tile_draw_rect, const float preview_icon_aspect, const int file_type_icon, const bool has_special_file_image, const eDirEntry_SelectFlag file_selflag)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
static void file_draw_special_image(const FileDirEntry *file, const rcti *tile_draw_rect, const int file_type_icon, const float icon_aspect, const FileLayout *layout, const bool dimmed, eDirEntry_SelectFlag file_selflag)
void imm_draw_box_wire_2d(uint pos, float x1, float y1, float x2, float y2)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
void file_draw_banner(const bContext *C, const SpaceFile *sfile, ARegion *region)
static void file_draw_asset_library_internet_access_required_hint(const bContext *C, const SpaceFile *sfile, ARegion *region)
bool filelist_cache_previews_running(FileList *filelist)
ID * filelist_file_get_id(const FileDirEntry *file)
const char * BLT_lang_get()
BLI_INLINE float BLI_rctf_cent_y(const struct rctf *rct)
static void draw_dividers(FileLayout *layout, View2D *v2d)
@ FILE_TYPE_BLENDER_BACKUP
bool IMB_metadata_get_field(const IDProperty *metadata, const char *key, char *value, size_t value_maxncpy)
void filelist_file_cache_slidingwindow_set(FileList *filelist, size_t window_size)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
SpaceFile * CTX_wm_space_file(const bContext *C)
MINLINE void copy_v4_v4(float r[4], const float a[4])
void GPU_blend(GPUBlend blend)
bool BLI_path_make_safe_filename(char *filename) ATTR_NONNULL(1)
BLI_INLINE int BLI_rcti_cent_x(const struct rcti *rct)
static void draw_tile_background(const rcti *draw_rect, bool is_selected, bool is_highlighted)
void immVertex2fv(uint attr_id, const float data[2])
bool file_attribute_column_type_enabled(const FileSelectParams *params, FileAttributeColumnType column, const FileLayout *layout)
void filelist_file_get_full_path(const FileList *filelist, const FileDirEntry *file, char r_filepath[1282])
MINLINE int min_ii(int a, int b)
static void file_draw_asset_tooltip_custom_func(bContext &, ui::TooltipData &tip, ui::Button *, void *argN)
static FileTooltipData * file_tooltip_data_create(const SpaceFile *sfile, const FileDirEntry *file)
void immRectf(uint pos, float x1, float y1, float x2, float y2)
ARegion * CTX_wm_region(const bContext *C)
BLI_INLINE float BLI_rctf_cent_x(const struct rctf *rct)
int filelist_files_num_entries(FileList *filelist)
std::optional< IconBufferRef > BKE_icon_get_buffer(int icon_id, eIconSizes size)
void BLF_enable(int fontid, FontFlags flag)
static void file_draw_string_mulitline_clipped(const rcti *rect, const char *string, ui::FontStyleAlign align, const uchar col[4])
MINLINE void rgba_float_to_uchar(unsigned char r_col[4], const float col_f[4])
size_t BLI_str_format_uint64_grouped(char dst[BLI_STR_FORMAT_UINT64_GROUPED_SIZE], uint64_t num) ATTR_NONNULL(1)
static bool show_asset_library_message(const bContext *C, const SpaceFile *sfile, ARegion *region, const auto setup_view)
void BLI_filelist_entry_size_to_string(const struct stat *st, uint64_t st_size_fallback, bool compact, char r_size[FILELIST_DIRENTRY_SIZE_LEN])
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
uiWidgetColors wcol_list_item
uiWidgetColors wcol_tooltip
bool use_instance_collections
eAssetImportMethod method
void(*) layout(const SpaceFile &, ui::Layout &)
AssetLibraryReference asset_library_ref
FileSelectParams base_params
eFileAssetImportFlags import_flags
asset_system::AssetRepresentation * asset
struct blender::FileDirEntry::@160236320132271345207305066317263254357061006370 draw_data
FileAttributeColumn attribute_columns[ATTRIBUTE_COLUMN_MAX]
int attribute_column_header_h
unsigned short thumbnail_size
eFileSel_Params_Flag flag
const IDProperty * metadata() const
bool is_blendfile_status_set
bool is_blendfile_readable
ReportList is_blendfile_readable_reports
eFileBrowse_Mode browse_mode
FileSelectParams * params
struct FileLayout * layout
struct wmTimer * previews_timer
SpaceFile_Runtime * runtime
FileAssetSelectParams * asset_params