63 const char *identifier,
65 const char *description)
90 if (description && description[0]) {
92 but, [tip = std::string(description)](
const Button *) {
return tip; });
104 if (!ptr || prop ==
nullptr) {
118 const char *family_cstr =
colorspace->family().c_str();
119 StringRef remaining(family_cstr ? family_cstr :
"");
149 remaining = remaining.
substr(0, pos);
152 subdirs_set.
add(remaining);
157 std::ranges::sort(subdirs);
167 const std::string root = (parent_path) ? std::string(parent_path->c_str()) +
"/" :
"";
169 col.context_ptr_set(
"colorspace_pointer_rna", &ptr);
173 std::string path = root + std::string(dir);
174 col.context_string_set(
"colorspace_parent_path", path);
182 for (
const ColorSpace *cs : colorspaces_at_this_level) {
198 TIP_(
"Working color space of the current file"));
#define BLT_I18NCONTEXT_COLOR_MANAGEMENT
#define CTX_IFACE_(context, msgid)
constexpr IndexRange()=default
constexpr StringRef drop_prefix(int64_t n) const
constexpr StringRef drop_known_prefix(StringRef prefix) const
constexpr int64_t find_first_of(StringRef chars, int64_t pos=0) const
constexpr bool startswith(StringRef prefix) const
static constexpr int64_t not_found
constexpr bool is_empty() const
constexpr int64_t find_first_not_of(StringRef chars, int64_t pos=0) const
constexpr StringRef substr(int64_t start, int64_t size) const
void append(const T &value)
virtual const ColorSpace * get_sorted_color_space_by_index(int index) const =0
virtual int get_num_active_color_spaces() const =0
Button * uiDefIconTextBut(Block *block, ButtonTypeWithPointerType but_and_ptr_type, int icon, StringRef str, int x, int y, short width, short height, void *poin, std::optional< StringRef > tip)
void button_func_set(Button *but, std::function< void(bContext &)> func)
static void colorspaces_menu_draw(const bContext *C, Menu *menu)
void button_func_quick_tooltip_set(Button *but, std::function< std::string(const Button *but)> func)
static void colorspaces_menu_add_button(ui::Layout &layout, PointerRNA ptr, PropertyRNA *prop, const char *identifier, const char *name, const char *description)
static std::optional< StringRefNull > colorspace_rna_details_from_context(const bContext *C, PointerRNA *ptr, PropertyRNA **prop)
const char * COLORSPACE_MENU_ID
MenuType * UI_MT_color_space_select()
Button * context_active_but_prop_get(const bContext *C, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
char * STRNCPY(char(&dst)[N], const char *src)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
int IMB_colormanagement_colorspace_get_named_index(const char *name)
const char * RNA_property_identifier(const PropertyRNA *prop)
std::optional< StringRefNull > CTX_data_string_get(const bContext *C, const char *member)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
PointerRNA CTX_data_pointer_get(const bContext *C, const char *member)
const char * IMB_colormanagement_colorspace_get_name(const ColorSpace *colorspace)
ocio::Config ColorManagedConfig
ColorManagedConfig & IMB_colormanagement_get_config()
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
const char * IMB_colormanagement_colorspace_get_description(const ColorSpace *colorspace)
ocio::ColorSpace ColorSpace
Layout & column(bool align)
void context_string_set(StringRef name, StringRef value)