39 char *path = (
char *)argN;
56 char version_str[128] = {0};
62 thumb->
metadata,
"Thumb::Blender::Version", version_str,
sizeof(version_str));
70 SNPRINTF_UTF8(version_str,
"%d.%01d", version / 100, version % 100);
83 bool is_today, is_yesterday;
84 std::string day_string;
86 nullptr,
int64_t(
status.st_mtime),
false, time_st, date_str, &is_today, &is_yesterday);
87 if (is_today || is_yesterday) {
88 day_string = (is_today ?
N_(
"Today") :
N_(
"Yesterday")) + std::string(
" ");
91 fmt::format(
"{}: {}{}{}",
94 (is_today || is_yesterday) ?
"" : date_str,
95 (is_today || is_yesterday) ? time_st :
""),
122 float scale = (72.0f *
UI_SCALE_FAC) /
float(std::max(thumb->
x, thumb->
y));
123 image_data.ibuf = thumb;
124 image_data.width = short(
float(thumb->
x) * scale);
125 image_data.height = short(
float(thumb->
y) * scale);
126 image_data.border =
true;
128 image_data.premultiplied =
true;
bool BKE_blendfile_extension_check(const char *str)
ImBuf * BKE_main_thumbnail_to_imbuf(Main *bmain, BlendThumbnail *data)
File and directory operations.
eFileAttributes BLI_file_attributes(const char *path)
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_stat(const char *path, BLI_stat_t *buffer) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
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])
void BLI_filelist_entry_datetime_to_string(const struct stat *st, int64_t ts, bool compact, char r_time[FILELIST_DIRENTRY_TIME_LEN], char r_date[FILELIST_DIRENTRY_DATE_LEN], bool *r_is_today, bool *r_is_yesterday)
#define FILELIST_DIRENTRY_DATE_LEN
#define FILELIST_DIRENTRY_TIME_LEN
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
void void void const char * BLI_path_basename(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
void BLI_path_split_dir_file(const char *filepath, char *dir, size_t dir_maxncpy, char *file, size_t file_maxncpy) ATTR_NONNULL(1
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
#define SNPRINTF_UTF8(dst, format,...)
const char * dirname(char *path)
external readfile function prototypes.
BlendThumbnail * BLO_thumbnail_from_file(const char *filepath)
short BLO_version_from_file(const char *filepath)
void IMB_freeImBuf(ImBuf *ibuf)
ImBuf * IMB_thumb_read(const char *file_or_lib_path, ThumbSize size)
void UI_but_func_tooltip_custom_set(uiBut *but, uiButToolTipCustomFunc func, void *arg, uiFreeArgFunc free_arg)
void UI_tooltip_image_field_add(uiTooltipData &data, const uiTooltipImage &image_data)
void UI_tooltip_text_field_add(uiTooltipData &data, std::string text, std::string suffix, const uiTooltipStyle style, const uiTooltipColorID color_id, const bool is_pad=false)
BMesh const char void * data
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
uiBut * ui_but_last(uiBlock *block) ATTR_WARN_UNUSED_RESULT
static void uiTemplateRecentFiles_tooltip_func(bContext &, uiTooltipData &tip, uiBut *, void *argN)
int uiTemplateRecentFiles(uiLayout *layout, int rows)
void MEM_freeN(void *vmemh)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
PointerRNA op(wmOperatorType *ot, std::optional< blender::StringRef > name, int icon, blender::wm::OpCallContext context, eUI_Item_Flag flag)