21#include "RNA_prototypes.hh"
38 if (project_ptr.
data ==
nullptr) {
47 layout->
op(
"PROJECT_OT_splash_image_create",
IFACE_(
"Create from Image..."), ICON_FILEBROWSER);
71 row.
op(
"PROJECT_OT_splash_image_create",
"", ICON_FILEBROWSER);
72 row.
op(
"PROJECT_OT_splash_image_clear",
"", ICON_X);
79 if (!filepath.empty() &&
BLI_stat(filepath.c_str(), &stat) == 0) {
81 const std::string key = fmt::format(
82 "{}:{}:{}", filepath,
int64_t(stat.st_mtime),
int64_t(stat.st_size));
83 const bool loaded = layout->
image(key, [&]() ->
ImBuf * {
95 layout->
label(
IFACE_(
"Failed to load splash image"), ICON_ERROR);
File and directory operations.
Button * uiDefButR(Block *block, ButtonType type, std::optional< StringRef > str, int x, int y, short width, short height, PointerRNA *ptr, StringRefNull propname, int index, float min, float max, std::optional< StringRef > tip)
void template_project_splash(Layout *layout, bContext *C)
void block_layout_set_current(Block *block, Layout *layout)
std::string WM_project_splash_image_filepath(const Main *bmain)
auto BKE_blender_project_read_callback(const Main *bmain, Fn lambda)
int BLI_stat(const char *path, BLI_stat_t *buffer) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
ImBuf * WM_project_splash_image_load(const StringRefNull filepath, const int width, const bool add_logo)
Main * CTX_data_main(const bContext *C)
auto BKE_blender_project_write_callback(const Main *bmain, Fn lambda)
void IMB_premultiply_alpha(ImBuf *ibuf)
void enabled_set(bool enabled)
void label(StringRef name, int icon)
PointerRNA op(wmOperatorType *ot, std::optional< StringRef > name, int icon, wm::OpCallContext context, eUI_Item_Flag flag)
void separator(float factor=1.0f, LayoutSeparatorType type=LayoutSeparatorType::Auto)
bool image(StringRef key, FunctionRef< ImBuf *()> create_fn)