diff options
Diffstat (limited to 'source')
5 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index aa1044647c8..529f70193c3 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -520,6 +520,7 @@ typedef bool (*uiMenuStepFunc)(struct bContext *C, int direction, void *arg1); /* interface_query.c */ bool UI_but_has_tooltip_label(const uiBut *but); bool UI_but_is_tool(const uiBut *but); +bool UI_but_is_utf8(const uiBut *but); #define UI_but_is_decorator(but) ((but)->func == ui_but_anim_decorate_cb) bool UI_block_is_empty(const uiBlock *block); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index ee354df3a25..78b190a59e0 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2509,7 +2509,7 @@ void ui_but_string_get_ex(uiBut *but, else if (buf && buf != str) { BLI_assert(maxlen <= buf_len + 1); /* string was too long, we have to truncate */ - if (ui_but_is_utf8(but)) { + if (UI_but_is_utf8(but)) { BLI_strncpy_utf8(str, buf, maxlen); } else { @@ -2834,7 +2834,7 @@ bool ui_but_string_set(bContext *C, uiBut *but, const char *str) if (!but->poin) { str = ""; } - else if (ui_but_is_utf8(but)) { + else if (UI_but_is_utf8(but)) { BLI_strncpy_utf8(but->poin, str, but->hardmax); } else { diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 55980099116..670397a7b8a 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -2702,7 +2702,7 @@ static void ui_textedit_string_set(uiBut *but, uiHandleButtonData *data, const c ui_textedit_string_ensure_max_length(but, data, strlen(str) + 1); } - if (ui_but_is_utf8(but)) { + if (UI_but_is_utf8(but)) { BLI_strncpy_utf8(data->str, str, data->maxlen); } else { @@ -2887,7 +2887,7 @@ static bool ui_textedit_insert_buf(uiBut *but, } if ((len + step >= data->maxlen) && (data->maxlen - (len + 1) > 0)) { - if (ui_but_is_utf8(but)) { + if (UI_but_is_utf8(but)) { /* shorten 'step' to a utf8 aligned size that fits */ BLI_strnlen_utf8_ex(buf, data->maxlen - (len + 1), &step); } @@ -2911,7 +2911,7 @@ static bool ui_textedit_insert_ascii(uiBut *but, uiHandleButtonData *data, char { char buf[2] = {ascii, '\0'}; - if (ui_but_is_utf8(but) && (BLI_str_utf8_size(buf) == -1)) { + if (UI_but_is_utf8(but) && (BLI_str_utf8_size(buf) == -1)) { printf( "%s: entering invalid ascii char into an ascii key (%d)\n", __func__, (int)(uchar)ascii); @@ -3092,7 +3092,7 @@ static bool ui_textedit_copypaste(uiBut *but, uiHandleButtonData *data, const in pbuf = WM_clipboard_text_get_firstline(false, &buf_len); if (pbuf) { - if (ui_but_is_utf8(but)) { + if (UI_but_is_utf8(but)) { buf_len -= BLI_utf8_invalid_strip(pbuf, (size_t)buf_len); } @@ -3261,7 +3261,7 @@ static void ui_textedit_end(bContext *C, uiBut *but, uiHandleButtonData *data) wmWindow *win = CTX_wm_window(C); if (but) { - if (ui_but_is_utf8(but)) { + if (UI_but_is_utf8(but)) { int strip = BLI_utf8_invalid_strip(but->editstr, strlen(but->editstr)); /* not a file?, strip non utf-8 chars */ if (strip) { @@ -4162,7 +4162,7 @@ static int ui_do_but_TEX( { if (data->state == BUTTON_STATE_HIGHLIGHT) { if (ELEM(event->type, LEFTMOUSE, EVT_BUT_OPEN, PADENTER, RETKEY) && event->val == KM_PRESS) { - if (ELEM(event->type, PADENTER, RETKEY) && (!ui_but_is_utf8(but))) { + if (ELEM(event->type, PADENTER, RETKEY) && (!UI_but_is_utf8(but))) { /* pass - allow filesel, enter to execute */ } else if (but->dt == UI_EMBOSS_NONE && !event->ctrl) { diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index a5d9d35e2fe..9705f0fa161 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -892,7 +892,6 @@ bool ui_but_is_editable(const uiBut *but) ATTR_WARN_UNUSED_RESULT; bool ui_but_is_editable_as_text(const uiBut *but) ATTR_WARN_UNUSED_RESULT; bool ui_but_is_toggle(const uiBut *but) ATTR_WARN_UNUSED_RESULT; bool ui_but_is_interactive(const uiBut *but, const bool labeledit) ATTR_WARN_UNUSED_RESULT; -bool ui_but_is_utf8(const uiBut *but) ATTR_WARN_UNUSED_RESULT; bool ui_but_is_popover_once_compat(const uiBut *but) ATTR_WARN_UNUSED_RESULT; bool ui_but_has_array_value(const uiBut *but) ATTR_WARN_UNUSED_RESULT; void ui_but_pie_dir(RadialDirection dir, float vec[2]); diff --git a/source/blender/editors/interface/interface_query.c b/source/blender/editors/interface/interface_query.c index d0efb3714bc..1c3d99d8bd2 100644 --- a/source/blender/editors/interface/interface_query.c +++ b/source/blender/editors/interface/interface_query.c @@ -100,7 +100,7 @@ bool ui_but_is_interactive(const uiBut *but, const bool labeledit) } /* file selectors are exempt from utf-8 checks */ -bool ui_but_is_utf8(const uiBut *but) +bool UI_but_is_utf8(const uiBut *but) { if (but->rnaprop) { const int subtype = RNA_property_subtype(but->rnaprop); |