94 for (j = 0; j <= n->
idx_max; j++) {
107 const char *heading_exp =
"", *trailing_exp =
"";
128 double(n->
val[i] * fac),
148 const char *cur = (i == n->
idx) ?
"|" :
"";
162 const char *cur = (i == n->
idx) ?
"|" :
"";
181 for (i = 0; i <= n->
idx_max; i++) {
196 for (j = 0; j <= n->
idx_max; j++) {
224 n->
flag &= ~NUM_FAKE_EDITED;
230 for (j = 0; j <= n->
idx_max; j++) {
252 int len = strlen(&n->
str[cur]) + 1;
253 int n_cur = cur + buf_len;
259 memmove(&n->
str[n_cur], &n->
str[cur],
len);
260 memcpy(&n->
str[cur], buf,
sizeof(
char) * buf_len);
271 const bool use_single_line_error,
277 err_info.r_string = r_error;
281 char str_unit_convert[256];
284 str_unit_convert,
sizeof(str_unit_convert),
str, unit_scale, unit->system, type);
291 *r_value /= unit_scale;
295 UNUSED_VARS(C, unit, type, use_single_line_error, r_error);
296 *r_value = atof(
str);
303 if (ascii >=
'0' && ascii <=
'9') {
314 const char *utf8_buf =
nullptr;
316 char ascii[2] = {
'\0',
'\0'};
317 bool updated =
false;
327 strchr(
"01234567890@%^&*-+/{}()[]<>.|", event_ascii))
339 if (
ELEM(event_ascii,
'=',
'*')) {
346 n->
flag &= ~NUM_EDIT_FULL;
352 switch (event->
type) {
362 utf8_buf =
event->utf8_buf;
363 ascii[0] = event_ascii;
407 std::swap(t_cur, cur);
411 memmove(&n->
str[cur], &n->
str[t_cur], strlen(&n->
str[t_cur]) + 1);
458 idx = (idx + idx_max + ((
event->modifier &
KM_CTRL) ? 0 : 2)) % (idx_max + 1);
487 n->
flag &= ~NUM_EDIT_FULL;
539 if (!updated && !utf8_buf && event->
utf8_buf[0]) {
540 utf8_buf =
event->utf8_buf;
541 ascii[0] = event_ascii;
551 if ((!utf8_buf || !utf8_buf[0]) && ascii[0]) {
556 if (utf8_buf && utf8_buf[0]) {
580 const float val_prev = n->
val[idx];
582 char *
error =
nullptr;
606 n->
val[idx] = -n->
val[idx];
624 n->
val[idx] = val_prev;
ReportList * CTX_wm_reports(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
void BKE_report(ReportList *reports, eReportType type, const char *message)
double BKE_scene_unit_scale(const UnitSettings *unit, int unit_type, double value)
bool BKE_unit_replace_string(char *str, int str_maxncpy, const char *str_prev, double scale_pref, int system, int type)
double BKE_unit_apply_preferred_unit(const UnitSettings *settings, int type, double value)
bool BKE_unit_string_contains_unit(const char *str, int type)
size_t BKE_unit_value_as_string_adaptive(char *str, int str_maxncpy, double value, int prec, int system, int type, bool split, bool pad)
void copy_vn_short(short *array_tar, int size, short val)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void copy_vn_fl(float *array_tar, int size, float val)
void copy_vn_i(int *array_tar, int size, int val)
MINLINE void zero_v3(float r[3])
#define STRNCPY(dst, src)
size_t BLI_snprintf(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
void BLI_str_cursor_step_utf8(const char *str, int str_maxlen, int *pos, eStrCursorJumpDirection direction, eStrCursorJumpType jump, bool use_init_step)
int BLI_str_utf8_invalid_strip(char *str, size_t length) ATTR_NONNULL(1)
int BLI_str_utf8_size_or_error(const char *p) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
bool BPY_run_string_as_number(bContext *C, const char *imports[], const char *expr, BPy_RunErrInfo *err_info, double *r_value) ATTR_NONNULL(1
@ USER_FLAG_NUMINPUT_ADVANCED
Read Guarded memory(de)allocation.
int UI_calc_float_precision(int prec, double value)
draw_view in_light_buf[] float
void MEM_freeN(void *vmemh)
static void error(const char *str)
bool use_single_line_error
char WM_event_utf8_to_ascii(const wmEvent *event)
void WM_clipboard_text_set(const char *buf, bool selection)
char * WM_clipboard_text_get_firstline(bool selection, bool ensure_utf8, int *r_len)