97 #define USE_CONT_MOUSE_CORRECT
99 #define USE_DRAG_TOGGLE
102 #define USE_DRAG_MULTINUM
105 #define USE_ALLSELECT
111 #define USE_KEYNAV_LIMIT
114 #define USE_DRAG_POPUP
126 #define UI_MAX_PASSWORD_STR 128
139 #define UI_DRAG_MAP_SOFT_RANGE_PIXEL_MAX 1000
155 #ifdef USE_KEYNAV_LIMIT
166 #define BUTTON_FLASH_DELAY 0.020
167 #define MENU_SCROLL_INTERVAL 0.1
168 #define PIE_MENU_INTERVAL 0.01
169 #define BUTTON_AUTO_OPEN_THRESH 0.2
170 #define BUTTON_MOUSE_TOWARDS_THRESH 1.0
172 #define BUTTON_KEYNAV_PX_LIMIT 8
175 #define MENU_TOWARDS_MARGIN 20
177 #define MENU_TOWARDS_WIGGLE_ROOM 64
179 #define BUTTON_DRAGLOCK_THRESH 3
214 # define USE_ALLSELECT_LAYER_HACK
245 const double value_orig);
247 # define IS_ALLSELECT_EVENT(event) ((event)->alt != 0)
250 # define UI_BUT_IS_SELECT_CONTEXT UI_BUT_NODE_ACTIVE
254 #ifdef USE_DRAG_MULTINUM
259 # define DRAG_MULTINUM_THRESHOLD_DRAG_X (UI_UNIT_Y / 4)
266 # define DRAG_MULTINUM_THRESHOLD_DRAG_Y (UI_UNIT_Y / 4)
276 # define DRAG_MULTINUM_THRESHOLD_VERTICAL (0.75f)
283 # ifdef USE_ALLSELECT
350 int togdual, togonly;
388 #ifdef USE_CONT_MOUSE_CORRECT
402 #ifdef USE_KEYNAV_LIMIT
406 #ifdef USE_DRAG_MULTINUM
481 #ifdef USE_DRAG_MULTINUM
508 static int lastdy = 0;
516 if ((dy > 0 && lastdy < 0) || (dy < 0 && lastdy > 0)) {
551 uiBut *but_iter = but;
556 but_iter = but_iter->
prev;
561 but_found = but_iter;
562 if (direction == 1) {
566 but_iter = but_iter->
next;
574 return shift ? 0.05f : 1.0f;
587 *r_mx = (
data->dragstartx * (1.0f - fac) + mx * fac);
588 *r_my = (
data->dragstarty * (1.0f - fac) + my * fac);
602 if (mx ==
data->draglastx) {
606 if (
data->draglock) {
610 #ifdef USE_DRAG_MULTINUM
611 if (
ELEM(
data->multi_data.init, BUTTON_MULTI_INIT_UNSET, BUTTON_MULTI_INIT_SETUP)) {
615 data->draglock =
false;
616 data->dragstartx = mx;
651 U.runtime.is_dirty =
true;
693 *r_hue = roundf((*r_hue) * snap_increment) / snap_increment;
827 bool skip_undo =
false;
844 if (
str ==
NULL ||
str[0] ==
'\0' || str_len_clip == 0) {
845 str =
"Unknown Action";
846 str_len_clip = strlen(
str);
856 extern PropertyRNA rna_Object_active_shape_key_index;
857 if (
ELEM(but->
rnaprop, &rna_ID_name, &rna_Object_active_shape_key_index)) {
868 if (skip_undo ==
false) {
994 data->applied =
true;
1003 data->applied =
true;
1015 data->applied =
true;
1026 value_toggle = (value == 0.0);
1028 value_toggle = !value_toggle;
1040 data->applied =
true;
1057 data->applied =
true;
1096 data->applied =
true;
1111 data->applied =
true;
1121 data->cancel =
true;
1133 data->applied =
true;
1143 data->applied =
true;
1150 data->applied =
true;
1157 data->applied =
true;
1164 data->applied =
true;
1173 #ifdef USE_DRAG_MULTINUM
1182 mbut_state->
but = but;
1184 # ifdef USE_ALLSELECT
1198 if (mbut_state->
but == but) {
1214 # ifdef USE_ALLSELECT
1229 # ifdef USE_ALLSELECT
1230 if (
data->multi_data.mbuts) {
1251 if (
data->multi_data.bs_mbuts) {
1262 bool changed =
false;
1264 seg[0][0] =
data->multi_data.drag_start[0];
1265 seg[0][1] =
data->multi_data.drag_start[1];
1267 seg[1][0] =
event->x;
1268 seg[1][1] =
event->y;
1275 data->multi_data.has_mbuts =
false;
1279 bool drag_prev =
false;
1280 bool drag_curr =
false;
1291 if (but_active != but) {
1300 data->multi_data.has_mbuts =
true;
1307 changed |= (drag_prev != drag_curr);
1331 if (
data->origvalue != 0.0) {
1332 data->multi_data.is_proportional =
true;
1340 const double value_delta =
data->value -
data->origvalue;
1341 const double value_scale =
data->multi_data.is_proportional ? (
data->value /
data->origvalue) :
1354 if (mbut_state ==
NULL) {
1356 printf(
"%s: Can't find button\n", __func__);
1365 # ifdef USE_ALLSELECT
1366 if (
data->select_others.is_enabled) {
1377 but->active->origvalue = mbut_state->
origvalue;
1379 but->active->select_others.
do_free =
false;
1386 but->active->value =
data->value;
1391 if (
data->multi_data.is_proportional) {
1392 but->active->value = mbut_state->
origvalue * value_scale;
1395 but->active->value = mbut_state->
origvalue + value_delta;
1399 CLAMP(but->active->value, (
double)but->softmin, (
double)but->softmax);
1414 #ifdef USE_DRAG_TOGGLE
1429 ICON_DECORATE_KEYFRAME,
1430 ICON_DECORATE_ANIMATE,
1431 ICON_DECORATE_OVERRIDE);
1468 bContext *
C,
ARegion *region,
const int pushed_state,
const int xy_src[2],
const int xy_dst[2])
1472 bool changed =
false;
1475 float xy_a_block[2] = {
UNPACK2(xy_src)};
1476 float xy_b_block[2] = {
UNPACK2(xy_dst)};
1491 if (pushed_state_but != pushed_state) {
1496 if (
U.runtime.is_dirty ==
false) {
1518 bool do_draw =
false;
1532 const float but_cent_new[2] = {
1558 xy[0] = (drag_info->
xy_lock[0] ==
false) ? xy_input[0] : drag_info->
xy_last[0];
1559 xy[1] = (drag_info->
xy_lock[1] ==
false) ? xy_input[1] : drag_info->
xy_last[1];
1582 switch (event->
type) {
1627 #ifdef USE_ALLSELECT
1633 bool success =
false;
1649 bool use_path_from_id;
1667 if (link->ptr.data !=
ptr.
data) {
1668 if (use_path_from_id) {
1727 success = (selctx_data->
elems_len != 0);
1751 if (selctx_data->
elems) {
1763 const double value_orig)
1765 if (selctx_data->
elems) {
1769 const bool use_delta = (selctx_data->
is_copy ==
false);
1782 delta.f = use_delta ? (value - value_orig) : value;
1786 delta.i = use_delta ? ((int)value - (
int)value_orig) : (
int)value;
1808 # ifdef USE_ALLSELECT_LAYER_HACK
1821 tmparray[index] =
true;
1823 for (
int i = 0; i < selctx_data->
elems_len; i++) {
1838 for (
int i = 0; i < selctx_data->
elems_len; i++) {
1843 float other_value = use_delta ? (other->
val_f + delta.f) : delta.f;
1853 int other_value = use_delta ? (other->
val_i + delta.i) : delta.i;
1863 const bool other_value = delta.b;
1872 const int other_value = delta.i;
1904 const int drag_threshold =
min_ii(
1908 if (
abs(
data->dragstartx - event->
x) +
abs(
data->dragstarty - event->
y) > drag_threshold) {
1910 data->cancel =
true;
1911 #ifdef USE_DRAG_TOGGLE
1931 &
data->window->modalhandlers,
1955 if (lock_axis != -1) {
1956 drag_info->
xy_lock[lock_axis] =
true;
2027 data->applied =
true;
2034 data->applied =
true;
2041 data->applied =
true;
2048 data->applied =
true;
2061 if (!
data->applied) {
2078 data->applied_interactive =
true;
2080 else if (
data->applied_interactive) {
2084 #ifdef USE_ALLSELECT
2085 # ifdef USE_DRAG_MULTINUM
2091 if (
data->select_others.elems_len == 0) {
2096 data->select_others.is_enabled =
true;
2099 if (
data->select_others.elems_len == 0) {
2101 data->select_others.elems_len = -1;
2108 double *editval = but->
editval;
2109 float *editvec = but->
editvec;
2223 #ifdef USE_DRAG_MULTINUM
2224 if (
data->multi_data.has_mbuts) {
2225 if ((
data->multi_data.init == BUTTON_MULTI_INIT_ENABLE) && (
data->multi_data.skip ==
false)) {
2236 #ifdef USE_ALLSELECT
2241 data->origvalue = 0.0;
2271 ListBase *drags =
event->customdata;
2327 for (
int i = 0; i < array_length; i++) {
2350 output_len_max -= 10;
2352 int current_index = 0;
2353 output[current_index] =
'[';
2356 for (
int i = 0; i < array_length; i++) {
2358 output + current_index, output_len_max - current_index,
"%f", values[i]);
2361 if (i < array_length - 1) {
2362 if (current_index < output_len_max) {
2363 output[current_index + 0] =
',';
2364 output[current_index + 1] =
' ';
2370 output[current_index + 0] =
']';
2371 output[current_index + 1] =
'\0';
2377 float *values = alloca(array_length *
sizeof(
float));
2385 BLI_assert(0 <= expected_length && expected_length <= 4);
2388 const int actual_length = sscanf(
2389 text,
"[%f, %f, %f, %f, %f]", &
v[0], &
v[1], &
v[2], &
v[3], &
v[4]);
2391 if (actual_length == expected_length) {
2392 memcpy(values,
v,
sizeof(
float) * expected_length);
2404 if (array_length > 4) {
2409 float *values = alloca(
sizeof(
float) * array_length);
2435 data->value = value;
2625 char buf[4096] = {0};
2626 const int buf_max_len =
sizeof(buf);
2629 bool is_buf_set =
false;
2633 switch (but->
type) {
2636 if (!has_required_data) {
2649 if (!has_required_data) {
2657 if (!has_required_data) {
2666 if (!has_required_data) {
2718 int buf_paste_len = 0;
2724 switch (but->
type) {
2727 if (!has_required_data) {
2739 if (!has_required_data) {
2746 if (!has_required_data) {
2754 if (!has_required_data) {
2803 const char *strpos = butstr;
2804 for (
int i = 0; i <
pos; i++) {
2808 return (strpos - butstr);
2832 if (but->
pos >= 0) {
2843 if (but->
pos >= 0) {
2851 memset(butstr,
'*',
len);
2883 if (maxlen >
data->maxlen) {
2885 data->maxlen = maxlen;
2891 if (
data->is_str_dynamic) {
2906 const int len = strlen(
str);
2907 bool changed =
false;
2918 const size_t str_step_ofs,
2919 const rcti *glyph_step_bounds,
2920 const int UNUSED(glyph_advance_x),
2921 const rctf *glyph_bounds,
2922 const int UNUSED(glyph_bearing[2]),
2927 if (cursor_data[0] <
center) {
2928 cursor_data[1] = str_step_ofs;
2946 float starty_dummy = 0.0f;
2975 str_last = &
str[but->
ofs];
2993 str_last = &
str[but->
ofs];
2994 const int str_last_len = strlen(str_last);
2995 const int x_pos = (int)(
x - startx);
2996 int glyph_data[2] = {
3006 if (glyph_data[1] == -1) {
3007 glyph_data[1] = str_last_len;
3009 but->
pos = glyph_data[1] + but->
ofs;
3044 bool changed =
false;
3046 if (
data->is_str_dynamic) {
3050 if (len_new <= data->maxlen) {
3052 size_t step = buf_len;
3060 if ((
len + step >=
data->maxlen) && (
data->maxlen - (
len + 1) > 0)) {
3066 step =
data->maxlen - (
len + 1);
3070 if (step && (
len + step < data->maxlen)) {
3072 memcpy(&
str[but->
pos], buf, step *
sizeof(
char));
3083 const char buf[2] = {ascii,
'\0'};
3087 "%s: entering invalid ascii char into an ascii key (%d)\n", __func__, (
int)(
uchar)ascii);
3103 const int len = strlen(
str);
3104 const int pos_prev = but->
pos;
3110 if (has_sel && !
select) {
3122 data->sel_pos_init = but->
pos;
3125 int pos_i = but->
pos;
3130 if (has_sel ==
false) {
3131 data->sel_pos_init = pos_prev;
3148 const int len = strlen(
str);
3150 bool changed =
false;
3159 else if (direction) {
3163 else if (but->
pos >= 0 && but->
pos <
len) {
3177 else if (but->
pos > 0) {
3198 if (
data->searchbox) {
3220 bool changed =
false;
3244 char *buf =
MEM_mallocN(
sizeof(
char) * (sellen + 1),
"ui_textedit_copypaste");
3261 #ifdef WITH_INPUT_IME
3275 wm_window_IME_begin(win,
x,
y, 0, 0,
true);
3281 wm_window_IME_end(win);
3284 void ui_but_ime_reposition(
uiBut *but,
int x,
int y,
bool complete)
3289 wm_window_IME_begin(but->
active->
window,
x,
y - 4, 0, 0, complete);
3292 wmIMEData *ui_but_ime_data_get(
uiBut *but)
3307 bool no_zero_strip =
false;
3314 #ifdef USE_DRAG_MULTINUM
3316 if (
data->applied_interactive) {
3318 data->cancel =
true;
3320 data->cancel =
false;
3322 data->applied_interactive =
false;
3326 #ifdef USE_ALLSELECT
3329 data->select_others.is_enabled =
true;
3330 data->select_others.is_copy =
true;
3337 if (
data->maxlen != 0) {
3345 data->is_str_dynamic =
true;
3360 const int len = strlen(
data->str);
3363 data->sel_pos_init = 0;
3390 #ifdef WITH_INPUT_IME
3392 ui_textedit_ime_begin(win, but);
3407 printf(
"%s: invalid utf8 - stripped chars %d\n", __func__, strip);
3411 if (
data->searchbox) {
3412 if (
data->cancel ==
false) {
3419 data->cancel =
true;
3422 data->escapecancel =
true;
3443 #ifdef WITH_INPUT_IME
3445 ui_textedit_ime_end(win, but);
3465 data->postbut = but;
3474 data->postbut = but;
3497 data->postbut = but;
3506 data->postbut = but;
3518 bool changed =
false, inbox =
false,
update =
false, skip_undo_push =
false;
3520 #ifdef WITH_INPUT_IME
3522 wmIMEData *ime_data = win->
ime_data;
3523 const bool is_ime_composing = ime_data && ime_data->is_ime_composing;
3525 const bool is_ime_composing =
false;
3528 switch (event->
type) {
3531 if (
data->searchbox) {
3532 #ifdef USE_KEYNAV_LIMIT
3552 if (
data->searchbox) {
3560 #ifdef WITH_INPUT_IME
3562 if (is_ime_composing) {
3566 data->cancel =
true;
3567 data->escapecancel =
true;
3582 if (
data->searchbox) {
3589 float mx =
event->x;
3590 float my =
event->y;
3596 data->sel_pos_init = but->
pos;
3601 else if (inbox ==
false) {
3603 if (
data->searchbox) {
3604 data->cancel =
data->escapecancel =
true;
3630 if (event->
val ==
KM_PRESS && !is_ime_composing) {
3631 switch (event->
type) {
3667 if (
data->searchbox) {
3668 #ifdef USE_KEYNAV_LIMIT
3684 if (
data->searchbox) {
3685 #ifdef USE_KEYNAV_LIMIT
3719 #if defined(__APPLE__)
3758 const bool is_redo = (
event->shift != 0);
3760 #
if defined(__APPLE__)
3766 data->undo_stack_text, is_redo ? 1 : -1, &undo_pos);
3767 if (undo_str !=
NULL) {
3771 but->
pos = undo_pos;
3777 skip_undo_push =
true;
3784 #ifdef WITH_INPUT_IME
3788 char ascii =
event->ascii;
3789 const char *utf8_buf =
event->utf8_buf;
3800 if (utf8_buf && utf8_buf[0]) {
3817 #ifdef WITH_INPUT_IME
3835 if ((skip_undo_push ==
false) && (
data->undo_stack_text !=
NULL)) {
3848 if (
data->searchbox) {
3863 switch (event->
type) {
3896 data->origvalue =
data->startvalue;
3930 float softrange = softmax - softmin;
3936 const float value_step_float_min = 0.1f;
3938 const double value_step = is_float ?
3942 const float softrange_max =
min_ff(
3944 2 * (is_float ?
min_ff(value_step, value_step_float_min) *
3945 (drag_map_softrange_max / value_step_float_min) :
3946 drag_map_softrange_max));
3948 if (softrange > softrange_max) {
3950 softmin =
data->origvalue - (softrange_max / 2);
3951 softmax =
data->origvalue + (softrange_max / 2);
3953 softmin = (
data->origvalue > 0.0f ? FLT_MAX : -FLT_MAX);
3956 softmax = (
data->origvalue > 0.0f ? FLT_MAX : -FLT_MAX);
3959 if (softmin < but->softmin) {
3961 softmax = softmin + softrange_max;
3963 else if (softmax > but->
softmax) {
3965 softmin = softmax - softrange_max;
3969 if (
UNLIKELY(softmin == softmax)) {
3970 if (
data->origvalue > 0.0) {
3971 softmin = nextafterf(softmin, -FLT_MAX);
3974 softmax = nextafterf(softmax, FLT_MAX);
3978 softrange = softmax - softmin;
3982 data->dragfstart = (softrange == 0.0f) ? 0.0f : ((
float)
data->value - softmin) / softrange;
3985 data->drag_map_soft_min = softmin;
3986 data->drag_map_soft_max = softmax;
3989 data->dragchange =
false;
3990 data->draglock =
true;
4009 data->dragstartx = 0;
4010 data->draglastx = 0;
4011 data->dragchange =
false;
4018 if (
data->interactive) {
4059 switch (but->
type) {
4101 if (func || handlefunc) {
4107 else if (menufunc) {
4113 else if (popoverfunc) {
4120 #ifdef USE_ALLSELECT
4123 data->select_others.is_enabled =
true;
4154 return data->menu->direction;
4175 data->cancel =
true;
4198 int x =
event->x,
y =
event->y;
4206 xmax -= 0.2 * icon_size;
4215 if ((
x > (xmax - icon_size)) &&
x <= xmax) {
4258 if (op_icon->highlighted) {
4259 old_highlighted = op_icon;
4270 if (old_highlighted != hovered) {
4275 #ifdef USE_DRAG_TOGGLE
4283 data->togdual =
event->ctrl;
4284 data->togonly = !
event->shift;
4288 data->dragstartx =
event->x;
4289 data->dragstarty =
event->y;
4297 data->applied =
false;
4307 #ifdef USE_DRAG_TOGGLE
4324 data->cancel =
true;
4337 data->cancel =
true;
4381 data->cancel =
true;
4412 data->cancel =
true;
4420 data->cancel =
true;
4421 data->escapecancel =
true;
4452 data->cancel =
true;
4467 #ifdef USE_DRAG_TOGGLE
4486 if (event->
val == event_val) {
4551 #ifdef USE_DRAG_TOGGLE
4561 bool do_activate =
false;
4580 data->togdual =
event->ctrl;
4581 data->togonly = !
event->shift;
4589 int type =
event->type;
4590 int val =
event->val;
4604 uiBut *but_other = (direction == -1) ? but_select->
next : but_select->
prev;
4608 data->cancel =
true;
4645 data->dragstartx =
event->x;
4646 data->dragstarty =
event->y;
4650 #ifdef USE_DRAG_TOGGLE
4653 data->dragstartx =
event->x;
4654 data->dragstarty =
event->y;
4696 if (tempf == softmin || tempf == softmax ||
snap ==
SNAP_OFF) {
4700 float softrange = softmax - softmin;
4726 if (softrange >= 21.0f) {
4738 if (softrange < 2.10f) {
4739 tempf = roundf(tempf * 10.0f) * 0.1f;
4741 else if (softrange < 21.0f) {
4742 tempf = roundf(tempf);
4745 tempf = roundf(tempf * 0.1f) * 10.0f;
4749 if (softrange < 2.10f) {
4750 tempf = roundf(tempf * 100.0f) * 0.01f;
4752 else if (softrange < 21.0f) {
4753 tempf = roundf(tempf * 10.0f) * 0.1f;
4756 tempf = roundf(tempf);
4776 if (
ELEM(temp, softmin, softmax)) {
4784 temp = 10 * (temp / 10);
4787 temp = 100 * (temp / 100);
4797 const bool is_motion,
4804 bool changed =
false;
4813 const float softmin = but->
softmin;
4814 const float softmax = but->
softmax;
4815 const float softrange = softmax - softmin;
4821 tempf = (
float)
data->startvalue + ((
float)(mx -
data->dragstartx) * fac);
4825 if (tempf < softmin) {
4826 data->dragstartx -= (softmin - tempf) / fac;
4829 else if (tempf > softmax) {
4830 data->dragstartx += (tempf - softmax) / fac;
4834 CLAMP(tempf, softmin, softmax);
4837 if (tempf != (
float)
data->value) {
4838 data->dragchange =
true;
4839 data->value = tempf;
4844 if (softrange > 256) {
4847 else if (softrange > 32) {
4858 if (temp < softmin) {
4859 data->dragstartx -= (softmin - temp) / fac;
4862 else if (temp > softmax) {
4863 data->dragstartx += (temp - softmax) / fac;
4867 CLAMP(temp, softmin, softmax);
4870 if (temp !=
data->value) {
4871 data->dragchange =
true;
4877 data->draglastx = mx;
4881 const float softmin =
data->drag_map_soft_min;
4882 const float softmax =
data->drag_map_soft_max;
4883 const float softrange = softmax - softmin;
4885 float non_linear_range_limit;
4886 float non_linear_pixel_map;
4887 float non_linear_scale;
4894 non_linear_range_limit = 11.0f;
4895 non_linear_pixel_map = 500.0f;
4899 non_linear_range_limit = 129.0f;
4901 non_linear_pixel_map = 250.0f;
4904 if (softrange > 600) {
4905 deler =
powf(softrange, 0.75f);
4907 else if (softrange < 25) {
4910 else if (softrange < 100) {
4916 if (softrange > non_linear_range_limit) {
4917 non_linear_scale = (
float)
abs(mx -
data->dragstartx) / non_linear_pixel_map;
4920 non_linear_scale = 1.0f;
4923 if (is_float ==
false) {
4928 data->dragf += (((
float)(mx -
data->draglastx)) / deler) * non_linear_scale;
4930 if (but->
softmin == softmin) {
4933 if (but->
softmax == softmax) {
4937 data->draglastx = mx;
4938 tempf = (softmin +
data->dragf * softrange);
4946 lvalue = (int)
data->value;
4948 if (temp != lvalue) {
4949 data->dragchange =
true;
4960 if (tempf != (
float)
data->value) {
4961 data->dragchange =
true;
4962 data->value = tempf;
4982 if (
data->dragchange ==
false) {
4987 int mx =
data->window->eventstate->x;
4988 int my =
data->window->eventstate->y;
4991 if (mx < (but->
rect.
xmin + handle_width)) {
4994 else if (mx > (but->
rect.
xmax - handle_width)) {
5002 if (
data->changed_cursor) {
5004 data->changed_cursor =
false;
5008 if (
data->changed_cursor ==
false) {
5010 data->changed_cursor =
true;
5031 const int screen_mx =
event->x;
5039 int type =
event->type, val =
event->val;
5082 #ifdef USE_DRAG_MULTINUM
5090 data->cancel =
true;
5091 data->escapecancel =
true;
5096 if (
data->dragchange) {
5097 #ifdef USE_DRAG_MULTINUM
5099 if (
data->multi_data.init == BUTTON_MULTI_INIT_SETUP) {
5113 const bool is_motion = (
event->type ==
MOUSEMOVE);
5117 #ifdef USE_DRAG_MULTINUM
5118 data->multi_data.drag_dir[0] +=
abs(
data->draglastx - mx);
5119 data->multi_data.drag_dir[1] +=
abs(
data->draglasty - my);
5135 #ifdef USE_DRAG_MULTINUM
5136 else if (
data->multi_data.has_mbuts) {
5137 if (
data->multi_data.init == BUTTON_MULTI_INIT_ENABLE) {
5163 const int value_step = (int)number_but->
step_size;
5168 (
double)
max_ii(softmin, (
int)
data->value - value_step) :
5170 if (value_test !=
data->value) {
5174 data->cancel =
true;
5191 (
float)(
data->value - value_step)) :
5193 (
float)(
data->value + value_step));
5194 if (value_test !=
data->value) {
5195 data->value = value_test;
5198 data->cancel =
true;
5210 data->draglastx = mx;
5211 data->draglasty = my;
5219 const bool is_horizontal,
5220 const bool is_motion,
5224 float cursor_x_range, f, tempf, softmin, softmax, softrange;
5226 bool changed =
false;
5237 softrange = softmax - softmin;
5256 f = (mx_fl -
data->dragstartx) / cursor_x_range +
data->dragfstart;
5257 CLAMP(f, 0.0f, 1.0f);
5260 #ifdef USE_CONT_MOUSE_CORRECT
5263 if (is_horizontal) {
5264 data->ungrab_mval[0] = but->
rect.
xmin + (f * cursor_x_range);
5268 data->ungrab_mval[1] = but->
rect.
ymin + (f * cursor_x_range);
5276 tempf = softmin + f * softrange;
5280 if (
ELEM(tempf, softmin, softmax)) {
5286 if (
ELEM(tempf, softmin, softmax)) {
5288 else if (softrange < 2.10f) {
5289 tempf = roundf(tempf * 100.0f) * 0.01f;
5291 else if (softrange < 21.0f) {
5292 tempf = roundf(tempf * 10.0f) * 0.1f;
5295 tempf = roundf(tempf);
5299 if (softrange < 2.10f) {
5300 tempf = roundf(tempf * 10.0f) * 0.1f;
5302 else if (softrange < 21.0f) {
5303 tempf = roundf(tempf);
5306 tempf = roundf(tempf * 0.1f) * 10.0f;
5311 temp = 10 * (temp / 10);
5317 lvalue = round(
data->value);
5319 CLAMP(temp, softmin, softmax);
5321 if (temp != lvalue) {
5323 data->dragchange =
true;
5328 CLAMP(tempf, softmin, softmax);
5330 if (tempf != (
float)
data->value) {
5331 data->value = tempf;
5332 data->dragchange =
true;
5351 int type =
event->type, val =
event->val;
5375 #ifndef USE_ALLSELECT
5390 data->dragstartx = mx;
5391 data->draglastx = mx;
5405 #ifdef USE_DRAG_MULTINUM
5412 data->cancel =
true;
5413 data->escapecancel =
true;
5418 if (
data->dragchange) {
5419 #ifdef USE_DRAG_MULTINUM
5421 if (
data->multi_data.init == BUTTON_MULTI_INIT_SETUP) {
5431 #ifdef USE_CONT_MOUSE_CORRECT
5439 const bool is_motion = (
event->type ==
MOUSEMOVE);
5440 #ifdef USE_DRAG_MULTINUM
5441 data->multi_data.drag_dir[0] +=
abs(
data->draglastx - mx);
5442 data->multi_data.drag_dir[1] +=
abs(
data->draglasty - my);
5445 but,
data, mx,
true, is_motion, event->
ctrl != 0, event->
shift != 0)) {
5449 #ifdef USE_DRAG_MULTINUM
5450 else if (
data->multi_data.has_mbuts) {
5451 if (
data->multi_data.init == BUTTON_MULTI_INIT_ENABLE) {
5471 float f, tempf, softmin, softmax, softrange;
5478 softrange = softmax - softmin;
5480 tempf =
data->value;
5481 temp = (int)
data->value;
5494 f = softmin + f * softrange;
5504 if (temp >= softmin && temp <= softmax) {
5508 data->cancel =
true;
5519 if (tempf >= softmin && tempf <= softmax) {
5520 data->value = tempf;
5523 data->cancel =
true;
5537 data->draglastx = mx;
5538 data->draglasty = my;
5557 data->dragstartx = mx;
5558 data->draglastx = mx;
5561 data->dragstartx = my;
5562 data->draglastx = my;
5572 data->cancel =
true;
5573 data->escapecancel =
true;
5581 const bool is_motion = (
event->type ==
MOUSEMOVE);
5583 but,
data, (horizontal) ? mx : my, horizontal, is_motion,
false,
false)) {
5613 data->dragstartx =
event->x;
5614 data->dragstarty =
event->y;
5623 data->cancel =
true;
5624 data->escapecancel =
true;
5632 int dragstartx =
data->dragstartx;
5633 int dragstarty =
data->dragstarty;
5635 data->value =
data->origvalue + (horizontal ? mx - dragstartx : dragstarty - my);
5677 data->dragstartx =
event->x;
5678 data->dragstarty =
event->y;
5682 #ifdef USE_DRAG_TOGGLE
5685 data->dragstartx =
event->x;
5686 data->dragstarty =
event->y;
5697 int type =
event->type;
5698 int val =
event->val;
5724 data->postbut = but;
5751 data->cancel =
true;
5768 bool changed =
true;
5776 float *fp =
data->origvec;
5778 const float radsq = rad * rad;
5782 mdx = (rad * fp[0]);
5783 mdy = (rad * fp[1]);
5785 else if (fp[2] > -1.0f) {
5786 mrad = rad /
sqrtf(fp[0] * fp[0] + fp[1] * fp[1]);
5788 mdx = 2.0f * mrad * fp[0] - (rad * fp[0]);
5789 mdy = 2.0f * mrad * fp[1] - (rad * fp[1]);
5795 float dx = (
float)(mx + mdx -
data->dragstartx);
5796 float dy = (
float)(my + mdy -
data->dragstarty);
5799 mrad = dx * dx + dy * dy;
5803 fp[2] =
sqrtf(radsq - dx * dx - dy * dy);
5807 mrad = rad /
sqrtf(mrad);
5809 dx *= (2.0f * mrad - 1.0f);
5810 dy *= (2.0f * mrad - 1.0f);
5812 mrad = dx * dx + dy * dy;
5816 fp[2] = -
sqrtf(radsq - dx * dx - dy * dy);
5822 const int snap_steps = (
snap ==
SNAP_ON) ? 4 : 12;
5823 const float snap_steps_angle =
M_PI / snap_steps;
5824 float angle, angle_snap;
5828 for (
int i = 0; i < 3; i++) {
5830 angle_snap = roundf((
angle / snap_steps_angle)) * snap_steps_angle;
5831 fp[i] =
sinf(angle_snap);
5837 data->draglastx = mx;
5838 data->draglasty = my;
5863 data->dragstartx =
event->x;
5864 data->dragstarty =
event->y;
5868 #ifdef USE_DRAG_TOGGLE
5872 data->dragstartx =
event->x;
5873 data->dragstarty =
event->y;
5885 float hsv_static[3] = {0.0f};
5893 hsv[2] =
clamp_f(hsv[2] - 0.05f, 0.0f, 1.0f);
5896 hsv[2] =
clamp_f(hsv[2] + 0.05f, 0.0f, 1.0f);
5899 const float fac = 0.005 * (
event->y -
event->prevy);
5900 hsv[2] =
clamp_f(hsv[2] + fac, 0.0f, 1.0f);
5936 data->cancel =
true;
5960 bool updated =
false;
6010 data->dragstartx = mx;
6011 data->dragstarty = my;
6012 data->draglastx = mx;
6013 data->draglasty = my;
6035 data->cancel =
true;
6036 data->escapecancel =
true;
6054 const float v_max =
max_fff(
v[0],
v[1],
v[2]);
6118 const bool changed =
true;
6122 #ifdef USE_CONT_MOUSE_CORRECT
6125 data->ungrab_mval[0] = mx_fl;
6126 data->ungrab_mval[1] = my_fl;
6139 float xpos, ypos, hsvo[3];
6154 mx_fl = xpos - (
data->dragstartx - mx_fl);
6155 my_fl = ypos - (
data->dragstarty - my_fl);
6217 data->draglastx = mx;
6218 data->draglasty = my;
6223 #ifdef WITH_INPUT_NDOF
6224 static void ui_ndofedit_but_HSVCUBE(
uiButHSVCube *hsv_but,
6226 const wmNDOFMotionData *ndof,
6234 const float sensitivity = (shift ? 0.15f : 0.3f) * ndof->dt;
6242 hsv[1] += ndof->rvec[2] * sensitivity;
6243 hsv[2] += ndof->rvec[0] * sensitivity;
6246 hsv[0] += ndof->rvec[2] * sensitivity;
6247 hsv[2] += ndof->rvec[0] * sensitivity;
6250 hsv[0] += ndof->rvec[2] * sensitivity;
6251 hsv[1] += ndof->rvec[0] * sensitivity;
6254 hsv[0] += ndof->rvec[2] * sensitivity;
6257 hsv[1] += ndof->rvec[2] * sensitivity;
6260 hsv[2] += ndof->rvec[2] * sensitivity;
6267 hsv[2] += ndof->rvec[0] * sensitivity;
6305 data->dragstartx = mx;
6306 data->dragstarty = my;
6307 data->draglastx = mx;
6308 data->draglasty = my;
6318 #ifdef WITH_INPUT_NDOF
6320 const wmNDOFMotionData *ndof =
event->customdata;
6323 ui_ndofedit_but_HSVCUBE(hsv_but,
data, ndof,
snap, event->
shift != 0);
6340 float rgb[3], def_hsv[3];
6351 def_hsv[0] = hsv[0];
6352 def_hsv[1] = hsv[1];
6366 data->cancel =
true;
6367 data->escapecancel =
true;
6397 const bool changed =
true;
6404 #ifdef USE_CONT_MOUSE_CORRECT
6407 data->ungrab_mval[0] = mx_fl;
6408 data->ungrab_mval[1] = my_fl;
6432 if (hsv[2] == 0.0f) {
6437 if (hsv[2] == 0.0f) {
6440 if (hsv[2] >= 0.9999f) {
6448 float xpos, ypos, hsvo[3], rgbo[3];
6459 mx_fl = xpos - (
data->dragstartx - mx_fl);
6460 my_fl = ypos - (
data->dragstarty - my_fl);
6466 hsv[1] = 1.0f -
sqrt3f(1.0f - hsv[1]);
6484 data->draglastx = mx;
6485 data->draglasty = my;
6490 #ifdef WITH_INPUT_NDOF
6491 static void ui_ndofedit_but_HSVCIRCLE(
uiBut *but,
6493 const wmNDOFMotionData *ndof,
6500 float phi,
r ,
v[2];
6501 const float sensitivity = (shift ? 0.06f : 0.3f) * ndof->dt;
6517 v[0] += ndof->rvec[2] * sensitivity;
6518 v[1] += ndof->rvec[0] * sensitivity;
6524 phi += ndof->rvec[1] * sensitivity * 0.5f;
6535 if (hsv[2] == 0.0f) {
6540 if (hsv[2] == 0.0f) {
6543 if (hsv[2] == 1.0f) {
6580 data->dragstartx = mx;
6581 data->dragstarty = my;
6582 data->draglastx = mx;
6583 data->draglasty = my;
6593 #ifdef WITH_INPUT_NDOF
6596 const wmNDOFMotionData *ndof =
event->customdata;
6598 ui_ndofedit_but_HSVCIRCLE(but,
data, ndof,
snap, event->
shift != 0);
6614 float rgb[3], def_hsv[3];
6616 def =
MEM_callocN(
sizeof(
float) *
len,
"reset_defaults - float");
6624 def_hsv[0] = hsv[0];
6625 def_hsv[2] = hsv[2];
6640 data->cancel =
true;
6641 data->escapecancel =
true;
6647 hsv[2] =
clamp_f(hsv[2] - 0.05f, 0.0f, 1.0f);
6652 hsv[2] =
clamp_f(hsv[2] + 0.05f, 0.0f, 1.0f);
6676 bool changed =
false;
6678 if (
data->draglastx == mx) {
6682 if (
data->coba->tot == 0) {
6687 data->dragcbd->pos += dx;
6693 data->draglastx = mx;
6721 data->dragstartx = mx;
6722 data->dragstarty = my;
6723 data->draglastx = mx;
6724 data->draglasty = my;
6728 for (
a = 0, cbd = coba->
data; a < coba->tot;
a++, cbd++) {
6730 xco =
abs(xco - mx);
6731 if (
a == coba->
cur) {
6735 if (xco < mindist) {
6742 data->dragfstart =
data->dragcbd->pos;
6751 if (mx !=
data->draglastx || my !=
data->draglasty) {
6762 data->dragcbd->pos =
data->dragfstart;
6764 data->cancel =
true;
6765 data->escapecancel =
true;
6786 bool changed =
false;
6793 int dragx =
data->draglastx;
6794 int dragy =
data->draglasty;
6803 d[0] = mx -
data->dragstartx;
6804 d[1] = my -
data->dragstarty;
6811 float fx = (mx - dragx) / zoomx;
6812 float fy = (my - dragy) / zoomy;
6814 if (
data->dragsel != -1) {
6817 bool moved_point =
false;
6822 for (
int a = 0;
a < cuma->totpoint;
a++) {
6824 const float origx = cmp[
a].x, origy = cmp[
a].y;
6828 cmp[
a].x = 0.125f * roundf(8.0f * cmp[
a].
x);
6829 cmp[
a].y = 0.125f * roundf(8.0f * cmp[
a].
y);
6831 if (cmp[
a].
x != origx || cmp[
a].
y != origy) {
6842 data->draglastx = evtx;
6843 data->draglasty = evty;
6846 #ifdef USE_CONT_MOUSE_CORRECT
6858 data->dragchange =
true;
6863 if (cumap->
curr.
xmin - fx < cumap->clipr.xmin) {
6869 if (cumap->
curr.
ymin - fy < cumap->clipr.ymin) {
6882 data->draglastx = evtx;
6883 data->draglasty = evty;
6894 bool changed =
false;
6906 const float m_xy[2] = {mx, my};
6907 float dist_min_sq =
square_f(
U.dpi_fac * 14.0f);
6921 for (
int a = 0;
a < cuma->totpoint;
a++) {
6925 if (dist_sq < dist_min_sq) {
6927 dist_min_sq = dist_sq;
6932 float f_xy[2], f_xy_prev[2];
6941 dist_min_sq =
square_f(
U.dpi_fac * 8.0f);
6944 for (
int i = 1; i <=
CM_TABLE; i++) {
6961 for (
int a = 0;
a < cuma->totpoint;
a++) {
6962 if (cmp[
a].
x == f_xy[0]) {
6974 if (!event->
shift) {
6975 for (
int a = 0;
a < cuma->totpoint;
a++) {
6986 data->cancel =
true;
6989 data->dragsel = sel;
6991 data->dragstartx =
event->x;
6992 data->dragstarty =
event->y;
6993 data->draglastx =
event->x;
6994 data->draglasty =
event->y;
7002 if (event->x !=
data->draglastx || event->y !=
data->draglasty) {
7005 block, but,
data, event->x, event->y, event->ctrl != 0, event->shift != 0)) {
7011 if (
data->dragsel != -1) {
7016 if (
data->dragchange ==
false) {
7018 if (!event->shift) {
7019 for (
int a = 0;
a < cuma->totpoint;
a++) {
7054 bool changed =
false;
7061 int dragx =
data->draglastx;
7062 int dragy =
data->draglasty;
7069 float d[2] = {mx -
data->dragstartx,
data->dragstarty};
7076 float fx = (mx - dragx) / zoomx;
7077 float fy = (my - dragy) / zoomy;
7079 if (
data->dragsel != -1) {
7080 float last_x, last_y;
7082 bool moved_point =
false;
7088 const float delta[2] = {fx, fy};
7100 last_x = pts[
a].h1_loc[0];
7101 last_y = pts[
a].h1_loc[1];
7105 last_x = pts[
a].h2_loc[0];
7106 last_y = pts[
a].h2_loc[1];
7114 data->draglastx = evtx;
7115 data->draglasty = evty;
7117 #ifdef USE_CONT_MOUSE_CORRECT
7128 data->dragchange =
true;
7133 if (profile->
view_rect.
xmin - fx < profile->clip_rect.xmin) {
7139 if (profile->
view_rect.
ymin - fy < profile->clip_rect.ymin) {
7152 data->draglastx = evtx;
7153 data->draglasty = evty;
7186 data->dragstartx = mx;
7187 data->dragstarty = my;
7188 data->draglastx = mx;
7189 data->draglasty = my;
7205 const float m_xy[2] = {mx, my};
7217 float dist_min_sq =
square_f(
U.dpi_fac * 14.0f);
7218 int i_selected = -1;
7219 short selection_type = 0;
7220 for (
int i = 0; i < profile->
path_len; i++) {
7224 if (dist_sq < dist_min_sq) {
7227 dist_min_sq = dist_sq;
7235 if (dist_sq < dist_min_sq) {
7238 dist_min_sq = dist_sq;
7244 if (dist_sq < dist_min_sq) {
7247 dist_min_sq = dist_sq;
7254 if (i_selected == -1) {
7255 float f_xy[2], f_xy_prev[2];
7259 dist_min_sq =
square_f(
U.dpi_fac * 8.0f);
7273 i_selected = (int)(new_pt - profile->
path);
7274 BLI_assert(i_selected >= 0 && i_selected <= profile->path_len);
7282 if (i_selected != -1) {
7285 pts[i_selected].
flag ^= selection_type;
7288 for (
int i = 0; i < profile->
path_len; i++) {
7292 profile->
path[i_selected].
flag |= selection_type;
7297 data->cancel =
true;
7300 data->dragsel = i_selected;
7302 data->dragstartx = mx;
7303 data->dragstarty = my;
7304 data->draglastx = mx;
7305 data->draglasty = my;
7313 if (mx !=
data->draglastx || my !=
data->draglasty) {
7315 block, but,
data, mx, my, event->
ctrl != 0, event->
shift != 0)) {
7322 if (
data->dragsel != -1) {
7324 if (
data->dragchange ==
false) {
7343 const bool changed =
true;
7344 const float dy = my -
data->draglasty;
7348 hist->
ymax += (dy * 0.1f) * yfac;
7353 data->draglastx = mx;
7354 data->draglasty = my;
7368 data->dragstartx = mx;
7369 data->dragstarty = my;
7370 data->draglastx = mx;
7371 data->draglasty = my;
7393 data->cancel =
true;
7394 data->escapecancel =
true;
7399 if (mx !=
data->draglastx || my !=
data->draglasty) {
7417 const bool changed =
true;
7419 const float dy = my -
data->draglasty;
7426 data->draglastx = mx;
7427 data->draglasty = my;
7441 data->dragstartx = mx;
7442 data->dragstarty = my;
7443 data->draglastx = mx;
7444 data->draglasty = my;
7466 data->cancel =
true;
7467 data->escapecancel =
true;
7472 if (mx !=
data->draglastx || my !=
data->draglasty) {
7491 const bool changed =
true;
7493 float dx = mx -
data->draglastx;
7494 float dy = my -
data->draglasty;
7517 data->draglastx = mx;
7518 data->draglasty = my;
7532 data->dragstartx = mx;
7533 data->dragstarty = my;
7534 data->draglastx = mx;
7535 data->draglasty = my;
7549 data->cancel =
true;
7550 data->escapecancel =
true;
7555 if (mx !=
data->draglastx || my !=
data->draglasty) {
7586 bool is_press_ctrl_but_no_shift =
event->val ==
KM_PRESS &&
IS_EVENT_MOD(event, ctrl, oskey) &&
7588 const bool do_copy =
event->type ==
EVT_CKEY && is_press_ctrl_but_no_shift;
7589 const bool do_paste =
event->type ==
EVT_VKEY && is_press_ctrl_but_no_shift;
7642 switch (but->
type) {
7752 #ifdef USE_DRAG_MULTINUM
7757 (
data->multi_data.init == BUTTON_MULTI_INIT_SETUP)) {
7761 if (
data->multi_data.init == BUTTON_MULTI_INIT_UNSET) {
7768 const float dir_nor_y[2] = {0.0, 1.0f};
7769 float dir_nor_drag[2];
7774 data->multi_data.init = BUTTON_MULTI_INIT_SETUP;
7775 data->multi_data.drag_lock_x =
event->x;
7778 data->multi_data.init = BUTTON_MULTI_INIT_DISABLE;
7782 else if (
data->multi_data.init == BUTTON_MULTI_INIT_SETUP) {
7788 ((
abs(
data->multi_data.drag_lock_x - event->
x) > margin_x) &&
7791 if (
data->multi_data.has_mbuts) {
7793 data->multi_data.init = BUTTON_MULTI_INIT_ENABLE;
7796 data->multi_data.init = BUTTON_MULTI_INIT_DISABLE;
7801 if (
data->multi_data.init == BUTTON_MULTI_INIT_SETUP) {
7829 block->tooltipdisabled = !enable;
7855 if (
data->autoopentimer) {
7867 bContext *
C,
ARegion *region,
int *pass,
double *r_pass_delay,
bool *r_exit_on_event)
7869 bool is_label =
false;
7877 *r_exit_on_event =
false;
7945 if (
data->used_mouse && !
data->autoopentimer) {
7953 time = 5 *
U.menuthreshold2;
7956 time = 5 *
U.menuthreshold1;
8001 "Can't edit driven number value, see graph editor for the driver setup.");
8007 #ifdef USE_CONT_MOUSE_CORRECT
8010 int mouse_ungrab_xy[2];
8013 mouse_ungrab_xy[0] =
data->ungrab_mval[0];
8014 mouse_ungrab_xy[1] =
data->ungrab_mval[1];
8038 else if (
data->flashtimer) {
8048 else if (
data->hold_action_timer) {
8107 data->region = region;
8109 #ifdef USE_CONT_MOUSE_CORRECT
8118 data->interactive =
true;
8139 data->used_mouse =
true;
8155 if (
data->menu &&
data->menu->region) {
8216 #ifdef USE_DRAG_MULTINUM
8217 if (
data->multi_data.has_mbuts) {
8222 if (!
data->cancel) {
8236 if (!
data->cancel ||
data->escapecancel) {
8245 if (!onfree && !
data->cancel) {
8250 #ifdef USE_ALLSELECT
8253 uiBut but_temp = *but;
8255 for (
int i = 0; i < selctx_data->
elems_len; i++) {
8268 if (
U.runtime.is_dirty ==
false) {
8279 block_iter->tooltipdisabled =
true;
8288 if (
data->origstr) {
8292 #ifdef USE_ALLSELECT
8296 if (
data->changed_cursor) {
8331 data->cancel =
true;
8356 if (activebut && (but_check_cb ==
NULL || but_check_cb(activebut))) {
8359 but_found = activebut;
8362 if (
data &&
data->menu && (region !=
data->menu->region)) {
8363 region =
data->menu->region;
8439 memset(r_ptr, 0,
sizeof(*r_ptr));
8471 if (region_ctx ==
NULL) {
8477 if (block->ui_operator) {
8478 return block->ui_operator;
8487 if (region == region_ctx) {
8491 if (block->ui_operator) {
8492 return block->ui_operator;
8546 region =
data->menu->region;
8617 event.is_repeat =
false;
8618 event.customdata = but;
8619 event.customdatafree =
false;
8645 *active_back = but->
active;
8649 data->region = region;
8664 but->
active = active_back;
8675 data->cancel =
true;
8701 printf(
"%s: error, unhandled type: %u\n", __func__, but->
type);
8719 double default_value;
8740 *r_value = default_value;
8758 switch (event->
type) {
8761 data->cancel =
true;
8764 #ifdef USE_UI_POPOVER_ONCE
8770 data->cancel =
false;
8804 data->cancel =
true;
8807 else if (event->
x != event->
prevx || event->
y != event->
prevy) {
8847 switch (event->
type) {
8849 data->cancel =
true;
8856 data->cancel =
true;
8877 if (
data->hold_action_timer) {
8892 data->cancel =
false;
8899 data->cancel =
true;
8914 switch (event->
type) {
8927 switch (event->
type) {
8931 if (
data->menu &&
data->menu->region) {
8941 data->cancel =
true;
8973 if ((
data->cancel ==
false) && (
data->str !=
NULL) && (
data->str[0] ==
'\0') &&
8978 #ifdef USE_DRAG_MULTINUM
8979 if (
data->multi_data.mbuts) {
8983 double default_value;
8990 data->multi_data.skip =
true;
9026 int type =
event->type, val =
event->val;
9028 bool redraw =
false;
9031 if (!ui_list || !ui_list->
dyn_data) {
9062 int value,
min,
max, inc;
9079 int current_idx = -1;
9082 for (
int i = 0; i <
len; i++) {
9085 org_order[new_order ? new_order[++org_idx] : ++org_idx] = i;
9087 current_idx = new_order ? new_order[org_idx] : org_idx;
9090 else if (i == value && org_idx >= 0) {
9091 current_idx = -(new_order ? new_order[org_idx] : org_idx) - 1;
9098 if (current_idx < 0) {
9099 current_idx = (current_idx * -1) + (inc < 0 ? inc : inc - 1);
9105 value = org_order[current_idx];
9117 if (value != value_orig) {
9175 if (
data->interactive) {
9188 data->cancel =
true;
9205 data->cancel =
true;
9262 const bool use_wiggle_room)
9277 }
while ((region = region->
next));
9286 const float newp[2] = {xy[0], xy[1]};
9299 const float p1[2] = {rect_px.
xmin - margin, rect_px.
ymin - margin};
9300 const float p2[2] = {rect_px.
xmax + margin, rect_px.
ymin - margin};
9301 const float p3[2] = {rect_px.
xmax + margin, rect_px.
ymax + margin};
9302 const float p4[2] = {rect_px.
xmin - margin, rect_px.
ymax + margin};
9306 if (use_wiggle_room) {
9331 #ifdef USE_KEYNAV_LIMIT
9383 float ymax = -FLT_MAX;
9385 ymax =
max_ff(ymax, bt->rect.ymax);
9388 dy = block->
rect.
ymax - ymax - scroll_pad;
9393 float ymin = FLT_MAX;
9395 ymin =
min_ff(ymin, bt->rect.ymin);
9398 dy = block->
rect.
ymin - ymin + scroll_pad;
9407 bt->rect.ymin += dy;
9408 bt->rect.ymax += dy;
9446 else if (test ==
'b') {
9459 if (scroll_dir == 1) {
9465 else if (scroll_dir == -1) {
9488 block->auto_open =
false;
9506 if ((level != 0) && (but ==
NULL)) {
9590 if (
len <
U.pie_menu_threshold *
U.dpi_fac) {
9604 const bool is_parent_inside,
9605 const bool is_parent_menu,
9606 const bool is_floating)
9621 const bool inside_title = inside && ((my + (
UI_UNIT_Y * 1.5f)) > block->
rect.
ymax);
9626 #ifdef USE_DRAG_POPUP
9685 switch (event->
type) {
9693 if (inside ==
false) {
9756 const float dy =
event->y -
event->prevy;
9777 const int scroll_dir = (
event->type ==
WHEELUPMOUSE) ? 1 : -1;
9800 int type =
event->type;
9801 int val =
event->val;
9830 #ifdef USE_KEYNAV_LIMIT
10065 if ((inside ==
false) && (menu->
menuretval == 0)) {
10103 #ifdef USE_KEYNAV_LIMIT
10130 if (but_active ==
NULL) {
10135 #ifdef USE_DRAG_POPUP
10137 (inside && is_floating && inside_title)) {
10201 #ifdef USE_UI_POPOVER_ONCE
10291 if (!force_close) {
10375 float event_xy[2] = {
event->x,
event->y};
10389 if (duration > 0.01 *
U.pie_initial_timeout) {
10395 const double final_time = 0.01 *
U.pie_animation_timeout;
10396 float fac = duration / final_time;
10397 const float pie_radius =
U.pie_menu_radius *
UI_DPI_FAC;
10411 center[0] = (vec[0] > 0.01f) ? 0.5f : ((vec[0] < -0.01f) ? -0.5f : 0.0f);
10412 center[1] = (vec[1] > 0.99f) ? 0.5f : ((vec[1] < -0.99f) ? -0.5f : 0.0f);
10442 if (len_sq < 1.0f) {
10464 if ((duration < 0.01 *
U.pie_tap_timeout) &&
10471 if (but && (
U.pie_menu_confirm > 0) &&
10472 (dist >=
U.dpi_fac * (
U.pie_menu_threshold +
U.pie_menu_confirm))) {
10484 switch (event->
type) {
10486 if (!is_click_style) {
10496 if ((
U.pie_menu_confirm > 0) &&
10497 (dist >=
U.dpi_fac * (
U.pie_menu_threshold +
U.pie_menu_confirm))) {
10511 if (is_click_style) {
10563 #define CASE_NUM_TO_DIR(n, d) \
10564 case (EVT_ZEROKEY + n): \
10565 case (EVT_PAD0 + n): { \
10566 if (num_dir == UI_RADIAL_NONE) { \
10592 #undef CASE_NUM_TO_DIR
10607 const bool is_parent_inside,
10608 const bool is_parent_menu,
10609 const bool is_floating)
10612 bool do_towards_reinit =
false;
10622 bool inside =
false;
10628 if (do_recursion) {
10629 if (is_parent_inside ==
false) {
10637 C, event, submenu, level + 1, is_parent_inside || inside, is_menu,
false);
10644 if (submenu && submenu->menuretval) {
10657 if (do_but_search) {
10666 do_towards_reinit =
true;
10678 bool handled =
false;
10683 retval = retval_test;
10688 if (handled ==
false) {
10690 C, event, menu, level, is_parent_inside, is_parent_menu, is_floating);
10696 if (do_towards_reinit) {
10771 if (region ==
NULL) {
10778 if (screen ==
NULL) {
10839 if (
data->menu &&
data->menu->menuretval) {
10890 bool reset_pie =
false;
10927 #ifdef USE_DRAG_TOGGLE
11035 const void *rna_poin_data,
11036 const char *rna_prop_id)
11046 block_text = block;
11074 block_text = block;
typedef float(TangentPoint)[2]
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time)
void BKE_brush_color_set(struct Scene *scene, struct Brush *brush, const float color[3])
struct CBData * BKE_colorband_element_add(struct ColorBand *coba, float position)
void BKE_colorband_update_sort(struct ColorBand *coba)
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
void CTX_store_set(bContext *C, bContextStore *store)
void CTX_wm_region_set(bContext *C, struct ARegion *region)
struct ARegion * CTX_wm_menu(const bContext *C)
void CTX_wm_menu_set(bContext *C, struct ARegion *menu)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
bContextStore * CTX_store_copy(bContextStore *store)
void CTX_store_free(bContextStore *store)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct MovieClip * CTX_data_edit_movieclip(const bContext *C)
struct bScreen * CTX_wm_screen(const bContext *C)
struct ReportList * CTX_wm_reports(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
void CTX_wm_area_set(bContext *C, struct ScrArea *area)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
@ PROF_UPDATE_REMOVE_DOUBLES
void BKE_curveprofile_update(struct CurveProfile *profile, const int update_flags)
void BKE_curveprofile_copy_data(struct CurveProfile *target, const struct CurveProfile *profile)
struct CurveProfilePoint * BKE_curveprofile_insert(struct CurveProfile *profile, float x, float y)
void BKE_curveprofile_remove_by_flag(struct CurveProfile *profile, const short flag)
bool BKE_curveprofile_move_point(struct CurveProfile *profile, struct CurveProfilePoint *point, const bool snap, const float delta[2])
bool BKE_curveprofile_move_handle(struct CurveProfilePoint *point, const bool handle_1, const bool snap, const float delta[2])
void BKE_curveprofile_free_data(struct CurveProfile *profile)
float BKE_movieclip_remap_scene_to_clip_frame(const struct MovieClip *clip, float framenr)
void BKE_paint_invalidate_cursor_overlay(struct Scene *scene, struct ViewLayer *view_layer, struct CurveMapping *curve)
ePaintMode BKE_paintmode_get_active_from_context(const struct bContext *C)
struct Brush * BKE_paint_brush(struct Paint *paint)
void BKE_palette_color_remove(struct Palette *palette, struct PaletteColor *color)
struct Paint * BKE_paint_get_active_from_context(const struct bContext *C)
void BKE_report(ReportList *reports, ReportType type, const char *message)
struct MovieTrackingMarker * BKE_tracking_marker_ensure(struct MovieTrackingTrack *track, int framenr)
bool BKE_unit_is_valid(int system, int type)
double BKE_unit_base_scalar(int system, int type)
#define BLF_KERNING_DEFAULT
float BLF_width(int fontid, const char *str, size_t len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLF_disable(int fontid, int option)
void BLF_boundbox_foreach_glyph(int fontid, const char *str, size_t len, BLF_GlyphBoundsFn user_fn, void *user_data) ATTR_NONNULL(2)
void BLF_enable(int fontid, int option)
void BLI_linklist_freeN(LinkNode *list)
void void BLI_linklist_prepend(LinkNode **listp, void *ptr) ATTR_NONNULL(1)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int round_fl_to_int_clamp(float a)
MINLINE float max_fff(float a, float b, float c)
MINLINE int round_fl_to_int(float a)
MINLINE float max_ff(float a, float b)
MINLINE size_t min_zz(size_t a, size_t b)
MINLINE int min_ii(int a, int b)
MINLINE float pow2f(float x)
MINLINE float clamp_f(float value, float min, float max)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
MINLINE float square_f(float a)
MINLINE float sqrt3f(float f)
void hsv_to_rgb_v(const float hsv[3], float r_rgb[3])
void rgb_to_hsv_v(const float rgb[3], float r_hsv[3])
MINLINE void srgb_to_linearrgb_v3_v3(float linear[3], const float srgb[3])
void rgb_to_hsv_compat_v(const float rgb[3], float r_hsv[3])
void hsl_to_rgb_v(const float hsl[3], float r_rgb[3])
void hsv_clamp_v(float hsv[3], float v_max)
MINLINE void linearrgb_to_srgb_v3_v3(float srgb[3], const float linear[3])
void rgb_to_hsl_v(const float rgb[3], float r_hsl[3])
void rgb_to_hsl_compat_v(const float rgb[3], float r_hsl[3])
int isect_point_tri_v2(const float pt[2], const float v1[2], const float v2[2], const float v3[2])
float dist_squared_to_line_segment_v2(const float p[2], const float l1[2], const float l2[2])
MINLINE void sub_v2_v2v2_int(int r[2], const int a[2], const int b[2])
MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_squared_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE bool compare_v3v3(const float a[3], const float b[3], const float limit) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v3(float r[3])
MINLINE void add_v2_v2v2_int(int r[2], const int a[2], const int b[2])
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE bool is_zero_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v2_v2(float r[2], const float a[2])
MINLINE float normalize_v2_length(float r[2], const float unit_scale)
MINLINE int len_manhattan_v2v2_int(const int a[2], const int b[2]) ATTR_WARN_UNUSED_RESULT
void dist_ensure_v2_v2fl(float v1[2], const float v2[2], const float dist)
MINLINE float len_manhattan_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE float dot_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v3_length(float r[3], const float unit_scale)
MINLINE float len_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_v2(const float a[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v3(float r[3])
MINLINE float normalize_v2_v2(float r[2], const float a[2])
MINLINE void copy_v2_fl(float r[2], float f)
bool BLI_rctf_clamp_pt_v(const struct rctf *rect, float xy[2])
bool BLI_rctf_isect_pt(const struct rctf *rect, const float x, const float y)
BLI_INLINE float BLI_rctf_cent_y(const struct rctf *rct)
void BLI_rctf_transform_pt_v(const rctf *dst, const rctf *src, float xy_dst[2], const float xy_src[2])
BLI_INLINE float BLI_rctf_cent_x(const struct rctf *rct)
bool BLI_rctf_isect_rect_y(const struct rctf *src1, const struct rctf *src2, float range_y[2])
bool BLI_rctf_isect_segment(const struct rctf *rect, const float s1[2], const float s2[2])
bool BLI_rctf_isect_rect_x(const struct rctf *src1, const struct rctf *src2, float range_x[2])
void BLI_rctf_recenter(struct rctf *rect, float x, float y)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
void BLI_rcti_rctf_copy(struct rcti *dst, const struct rctf *src)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
char * BLI_strdupn(const char *str, const size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
int BLI_str_rstrip_float_zero(char *str, const char pad) ATTR_NONNULL()
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
void BLI_str_cursor_step_utf8(const char *str, size_t maxlen, int *pos, eStrCursorJumpDirection direction, eStrCursorJumpType jump, bool use_init_step)
bool BLI_str_cursor_step_prev_utf8(const char *str, size_t maxlen, int *pos)
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
size_t BLI_strlen_utf8(const char *strc) ATTR_NONNULL()
int BLI_str_utf8_size(const char *p) ATTR_NONNULL()
char * BLI_str_find_next_char_utf8(const char *p, const char *end) ATTR_NONNULL(1)
size_t BLI_strnlen_utf8_ex(const char *strc, const size_t maxlen, size_t *r_len_bytes) ATTR_NONNULL()
int BLI_utf8_invalid_strip(char *str, size_t length) ATTR_NONNULL()
size_t BLI_strnlen_utf8(const char *strc, const size_t maxlen) ATTR_NONNULL()
bool BLT_lang_is_ime_supported(void)
typedef double(DMatrix)[4][4]
struct Depsgraph Depsgraph
#define PROF_TABLE_LEN(n_pts)
#define USER_UNIT_ROT_RADIANS
#define RGN_ALIGN_ENUM_FROM_MASK(align)
#define UI_LIST_AUTO_SIZE_THRESHOLD
@ UILST_SCROLL_TO_ACTIVE_ITEM
#define ED_screen_areas_iter(win, screen, area_name)
void ED_region_tag_refresh_ui(struct ARegion *region)
void ED_region_tag_redraw_no_rebuild(struct ARegion *region)
void ED_region_tag_redraw(struct ARegion *region)
bool ED_undo_is_legacy_compatible_for_property(struct bContext *C, struct ID *id)
void ED_undo_push(struct bContext *C, const char *str)
NSNotificationCenter * center
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
void IMB_colormanagement_scene_linear_to_srgb_v3(float pixel[3])
void IMB_colormanagement_srgb_to_scene_linear_v3(float pixel[3])
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
Group RGB to Bright Vector Camera CLAMP
Platform independent time functions.
StructRNA RNA_KeyConfigPreferences
StructRNA RNA_AddonPreferences
StructRNA RNA_UserAssetLibrary
#define RNA_SUBTYPE_UNIT_VALUE(subtype)
#define AUTOCOMPLETE_FULL_MATCH
void UI_blocklist_free(const struct bContext *C, struct ListBase *lb)
@ UI_EMBOSS_NONE_OR_STATUS
void UI_fontstyle_set(const struct uiFontStyle *fs)
struct ARegion * UI_tooltip_create_from_button(struct bContext *C, struct ARegion *butregion, uiBut *but, bool is_label)
void(* uiButHandleNFunc)(struct bContext *C, void *argN, void *arg2)
void(* uiBlockHandleFunc)(struct bContext *C, void *arg, int event)
struct PointerRNA * UI_but_operator_ptr_get(uiBut *but)
int UI_but_unit_type_get(const uiBut *but)
const struct uiStyle * UI_style_get(void)
bool UI_but_is_utf8(const uiBut *but)
#define AUTOCOMPLETE_NO_MATCH
#define UI_TOOLTIP_DELAY_LABEL
void UI_popover_once_clear(uiPopover *pup)
void UI_butstore_free(uiBlock *block, uiButStore *bs)
#define UI_PRECISION_FLOAT_MAX
#define UI_PRECISION_FLOAT_SCALE
struct PanelType * UI_but_paneltype_get(uiBut *but)
void(* uiButSearchArgFreeFn)(void *arg)
void(* uiButHandleRenameFunc)(struct bContext *C, void *arg, char *origstr)
bool UI_but_active_only(const struct bContext *C, struct ARegion *region, uiBlock *block, uiBut *but)
@ UI_BLOCK_MOVEMOUSE_QUIT
void(* uiButHandleFunc)(struct bContext *C, void *arg1, void *arg2)
struct MenuType * UI_but_menutype_get(uiBut *but)
uiButStore * UI_butstore_create(uiBlock *block)
void UI_but_execute(const struct bContext *C, struct ARegion *region, uiBut *but)
void UI_butstore_register(uiButStore *bs_handle, uiBut **but_p)
void(* uiMenuCreateFunc)(struct bContext *C, struct uiLayout *layout, void *arg1)
void(* uiMenuHandleFunc)(struct bContext *C, void *arg, int event)
bool UI_context_copy_to_selected_list(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, struct ListBase *r_lb, bool *r_use_path_from_id, char **r_path)
uiBlock *(* uiBlockCreateFunc)(struct bContext *C, struct ARegion *region, void *arg1)
bool UI_but_has_tooltip_label(const uiBut *but)
#define UI_but_is_decorator(but)
#define WM_UI_HANDLER_CONTINUE
#define ND_SPACE_INFO_REPORT
#define WM_EVENT_CURSOR_MOTION_THRESHOLD
#define WM_UI_HANDLER_BREAK
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert * v
void activate(bool forceActivation=false) const
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void jump(const btVector3 &v=btVector3(0, 0, 0))
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
const Depsgraph * depsgraph
bool ui_but_is_unit(const uiBut *but)
void ui_but_range_set_hard(uiBut *but)
void ui_but_extra_operator_icons_free(uiBut *but)
bool ui_but_is_compatible(const uiBut *but_a, const uiBut *but_b)
void ui_but_range_set_soft(uiBut *but)
void ui_but_update(uiBut *but)
void ui_block_to_window_rctf(const ARegion *region, uiBlock *block, rctf *rct_dst, const rctf *rct_src)
float ui_block_to_window_scale(const ARegion *region, uiBlock *block)
int ui_but_is_pushed(uiBut *but)
bool ui_but_is_float(const uiBut *but)
void ui_but_override_flag(Main *bmain, uiBut *but)
double ui_but_value_get(uiBut *but)
void ui_region_to_window(const ARegion *region, int *r_x, int *r_y)
void ui_but_string_get(uiBut *but, char *str, const size_t maxlen)
bool ui_but_is_rna_valid(uiBut *but)
void ui_window_to_block_fl(const ARegion *region, uiBlock *block, float *r_x, float *r_y)
bool ui_but_string_set(bContext *C, uiBut *but, const char *str)
bool ui_but_menu_draw_as_popover(const uiBut *but)
void ui_but_value_set(uiBut *but, double value)
void ui_but_convert_to_unit_alt_name(uiBut *but, char *str, size_t maxlen)
void ui_but_string_get_ex(uiBut *but, char *str, const size_t maxlen, const int float_precision, const bool use_exp_float, bool *r_use_exp_float)
void ui_but_update_edited(uiBut *but)
void ui_but_v3_set(uiBut *but, const float vec[3])
void ui_but_v3_get(uiBut *but, float vec[3])
bool ui_but_string_eval_number(bContext *C, const uiBut *but, const char *str, double *r_value)
void ui_block_to_window_fl(const ARegion *region, uiBlock *block, float *r_x, float *r_y)
int ui_but_string_get_max_length(uiBut *but)
void ui_window_to_block(const ARegion *region, uiBlock *block, int *r_x, int *r_y)
char * ui_but_string_get_dynamic(uiBut *but, int *r_str_size)
bool ui_but_supports_cycling(const uiBut *but)
bool ui_but_is_bool(const uiBut *but)
void ui_fontscale(short *points, float aspect)
void ui_but_anim_flag(uiBut *but, const AnimationEvalContext *anim_eval_context)
void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra)
bool ui_but_anim_expression_get(uiBut *but, char *str, size_t maxlen)
void ui_but_anim_decorate_update_from_flag(uiButDecorator *decorator_but)
void UI_context_update_anim_flag(const bContext *C)
static int ui_drag_toggle_but_pushed_state(bContext *C, uiBut *but)
static void ui_color_picker_to_rgb_HSVCUBE_v(const uiButHSVCube *hsv_but, const float hsv[3], float rgb[3])
static void ui_do_but_extra_operator_icons_mousemove(uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static void ui_but_paste(bContext *C, uiBut *but, uiHandleButtonData *data, const bool paste_array)
static void ui_multibut_states_apply(bContext *C, uiHandleButtonData *data, uiBlock *block)
static void ui_multibut_free(uiHandleButtonData *data, uiBlock *block)
static void float_array_to_string(float *values, int array_length, char *output, int output_len_max)
static CurveProfile but_copypaste_profile
struct uiDragToggleHandle uiDragToggleHandle
static float ui_numedit_apply_snapf(uiBut *but, float tempf, float softmin, float softmax, const enum eSnapType snap)
bool UI_textbutton_activate_rna(const bContext *C, ARegion *region, const void *rna_poin_data, const char *rna_prop_id)
#define BUTTON_FLASH_DELAY
static int ui_handle_menu_event(bContext *C, const wmEvent *event, uiPopupBlockHandle *menu, int level, const bool is_parent_inside, const bool is_parent_menu, const bool is_floating)
static bool ui_context_rna_button_active_test(const uiBut *but)
static void button_activate_exit(bContext *C, uiBut *but, uiHandleButtonData *data, const bool mousemove, const bool onfree)
uiBlock * UI_region_block_find_mouse_over(const struct ARegion *region, const int xy[2], bool only_clip)
static bool ui_numedit_but_CURVE(uiBlock *block, uiBut *but, uiHandleButtonData *data, int evtx, int evty, bool snap, const bool shift)
uiBut * UI_context_active_but_get_respect_menu(const bContext *C)
static void ui_afterfunc_update_preferences_dirty(uiAfterFunc *after)
static bool ui_multibut_states_tag(uiBut *but_active, uiHandleButtonData *data, const wmEvent *event)
void ui_but_execute_end(struct bContext *C, struct ARegion *UNUSED(region), uiBut *but, void *active_back)
static bool ui_but_is_drag_toggle(const uiBut *but)
static bool but_copypaste_curve_alive
static void ui_but_paste_numeric_array(bContext *C, uiBut *but, uiHandleButtonData *data, char *buf_paste)
static int ui_do_but_SCROLL(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static char ui_menu_scroll_test(uiBlock *block, int my)
static int ui_do_but_TEX(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
bool ui_but_is_editing(const uiBut *but)
int ui_but_menu_direction(uiBut *but)
static bool ui_menu_scroll_step(ARegion *region, uiBlock *block, const int scroll_dir)
#define DRAG_MULTINUM_THRESHOLD_DRAG_X
static void ui_numedit_apply(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data)
static bool ui_numedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, float mx, float my, const enum eSnapType snap, const bool shift)
static bool ui_textedit_insert_buf(uiBut *but, uiHandleButtonData *data, const char *buf, int buf_len)
static void ui_but_copy_colorband(uiBut *but)
bool UI_but_active_drop_name(bContext *C)
static bool ui_button_value_default(uiBut *but, double *r_value)
static void ui_but_paste_curvemapping(bContext *C, uiBut *but)
static int ui_handle_button_over(bContext *C, const wmEvent *event, ARegion *region)
static void ui_rgb_to_color_picker_HSVCUBE_compat_v(const uiButHSVCube *hsv_but, const float rgb[3], float hsv[3])
#define MENU_TOWARDS_WIGGLE_ROOM
#define BUTTON_MOUSE_TOWARDS_THRESH
#define UI_MAX_PASSWORD_STR
static void ui_apply_but_ROW(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data)
static bool ui_numedit_but_HISTOGRAM(uiBut *but, uiHandleButtonData *data, int mx, int my)
struct uiAfterFunc uiAfterFunc
static void ui_but_drop(bContext *C, const wmEvent *event, uiBut *but, uiHandleButtonData *data)
static uiButExtraOpIcon * ui_but_extra_operator_icon_mouse_over_get(uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static int ui_handle_menu_return_submenu(bContext *C, const wmEvent *event, uiPopupBlockHandle *menu)
static int ui_do_but_BUT(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static CurveMapping but_copypaste_curve
static bool ui_mouse_motion_towards_check(uiBlock *block, uiPopupBlockHandle *menu, const int xy[2], const bool use_wiggle_room)
float ui_block_calc_pie_segment(uiBlock *block, const float event_xy[2])
static bool ui_rna_is_userdef(PointerRNA *ptr, PropertyRNA *prop)
static int ui_do_but_CURVEPROFILE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static bool ui_afterfunc_check(const uiBlock *block, const uiBut *but)
static bool but_copypaste_profile_alive
static void button_activate_init(bContext *C, ARegion *region, uiBut *but, uiButtonActivateType type)
static bool ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx, int my, const enum eSnapType snap, const bool shift)
uiBut * UI_context_active_but_get(const bContext *C)
static bool ui_textedit_set_cursor_pos_foreach_glyph(const char *UNUSED(str), const size_t str_step_ofs, const rcti *glyph_step_bounds, const int UNUSED(glyph_advance_x), const rctf *glyph_bounds, const int UNUSED(glyph_bearing[2]), void *user_data)
static void ui_handle_button_activate(bContext *C, ARegion *region, uiBut *but, uiButtonActivateType type)
void ui_but_activate_over(bContext *C, ARegion *region, uiBut *but)
static void ui_multibut_states_create(uiBut *but_active, uiHandleButtonData *data)
static bool ui_event_is_snap(const wmEvent *event)
static bool ui_do_but_extra_operator_icon(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static void ui_but_copy_numeric_value(uiBut *but, char *output, int output_len_max)
static int ui_do_but_COLOR(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static void ui_textedit_string_ensure_max_length(uiBut *but, uiHandleButtonData *data, int maxlen)
static int ui_region_handler(bContext *C, const wmEvent *event, void *UNUSED(userdata))
static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
bool UI_but_is_userdef(const uiBut *but)
static bool ui_mouse_motion_keynav_test(struct uiKeyNavLock *keynav, const wmEvent *event)
static void ui_but_set_float_array(bContext *C, uiBut *but, uiHandleButtonData *data, float *values, int array_length)
static int ui_but_pie_menu_apply(bContext *C, uiPopupBlockHandle *menu, uiBut *but, bool force_close)
static void ui_apply_but_TRACKPREVIEW(bContext *C, uiBut *but, uiHandleButtonData *data)
static int ui_do_but_GRIP(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static void ui_apply_but_CURVEPROFILE(bContext *C, uiBut *but, uiHandleButtonData *data)
void UI_screen_free_active_but(const bContext *C, bScreen *screen)
#define DRAG_MULTINUM_THRESHOLD_DRAG_Y
static bool ui_do_but_ANY_drag_toggle(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event, int *r_retval)
static void ui_do_but_textedit_select(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static bool ui_but_dragedit_update_mval(uiHandleButtonData *data, int mx)
static void popup_check(bContext *C, wmOperator *op)
uiBut * UI_region_active_but_get(const ARegion *region)
static void ui_apply_but_WAVEFORM(bContext *C, uiBut *but, uiHandleButtonData *data)
static void ui_but_paste_color(bContext *C, uiBut *but, char *buf_paste)
static uiBut * ui_block_pie_dir_activate(uiBlock *block, const wmEvent *event, RadialDirection dir)
static int ui_do_but_HSVCUBE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static bool ui_menu_scroll_to_y(ARegion *region, uiBlock *block, int y)
ARegion * UI_region_searchbox_region_get(const ARegion *button_region)
static void ui_numedit_begin_set_values(uiBut *but, uiHandleButtonData *data)
static bool ui_but_copy_menu(uiBut *but, char *output, int output_len_max)
static bool ui_drag_toggle_but_is_supported(const uiBut *but)
static bool ui_numedit_but_SLI(uiBut *but, uiHandleButtonData *data, int mx, const bool is_horizontal, const bool is_motion, const bool snap, const bool shift)
static void ui_palette_set_active(uiButColor *color_but)
static bool ui_but_pie_menu_supported_apply(uiBut *but)
static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *event)
static void ui_region_auto_open_clear(ARegion *region)
static void ui_rna_update_preferences_dirty(PointerRNA *ptr, PropertyRNA *prop)
void ui_but_clipboard_free(void)
void UI_but_tooltip_timer_remove(bContext *C, uiBut *but)
void UI_popup_menu_retval_set(const uiBlock *block, const int retval, const bool enable)
static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static int ui_do_but_LISTROW(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static void ui_selectcontext_apply(bContext *C, uiBut *but, struct uiSelectContextStore *selctx_data, const double value, const double value_orig)
static void ui_apply_but_CURVE(bContext *C, uiBut *but, uiHandleButtonData *data)
static bool button_modal_state(uiHandleButtonState state)
static float ui_mouse_scale_warp_factor(const bool shift)
static void ui_apply_but_IMAGE(bContext *C, uiBut *but, uiHandleButtonData *data)
static ListBase UIAfterFuncs
static void ui_block_open_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
uiBut * UI_context_active_but_prop_get(const bContext *C, struct PointerRNA *r_ptr, struct PropertyRNA **r_prop, int *r_index)
void ui_but_active_free(const bContext *C, uiBut *but)
static void ui_color_snap_hue(const enum eSnapType snap, float *r_hue)
static void ui_menu_scroll_apply_offset_y(ARegion *region, uiBlock *block, float dy)
static bool ui_textedit_insert_ascii(uiBut *but, uiHandleButtonData *data, char ascii)
void ui_but_active_string_clear_and_exit(bContext *C, uiBut *but)
static void ui_apply_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data)
static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonData *data)
@ BUTTON_STATE_WAIT_FLASH
@ BUTTON_STATE_NUM_EDITING
@ BUTTON_STATE_TEXT_EDITING
@ BUTTON_STATE_TEXT_SELECTING
@ BUTTON_STATE_WAIT_KEY_EVENT
@ BUTTON_STATE_WAIT_RELEASE
static int ui_do_but_SEARCH_UNLINK(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static void ui_apply_but_NUM(bContext *C, uiBut *but, uiHandleButtonData *data)
static void ui_but_paste_numeric_value(bContext *C, uiBut *but, uiHandleButtonData *data, char *buf_paste)
static void ui_numedit_end(uiBut *but, uiHandleButtonData *data)
static int ui_do_but_HOTKEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static void ui_but_extra_operator_icon_apply(bContext *C, uiBut *but, uiButExtraOpIcon *op_icon)
static void ui_but_paste_normalized_vector(bContext *C, uiBut *but, uiHandleButtonData *data, char *buf_paste)
static void ui_but_update_preferences_dirty(uiBut *but)
void ui_pan_to_scroll(const wmEvent *event, int *type, int *val)
static int ui_do_but_HISTOGRAM(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static uiBut * ui_context_rna_button_active(const bContext *C)
static int ui_do_but_WAVEFORM(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static void ui_apply_but_func(bContext *C, uiBut *but)
static void ui_mouse_scale_warp(uiHandleButtonData *data, const float mx, const float my, float *r_mx, float *r_my, const bool shift)
struct uiSelectContextStore uiSelectContextStore
PointerRNA * ui_handle_afterfunc_add_operator(wmOperatorType *ot, int opcontext, bool create_props)
static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, const float x)
static void ui_apply_but_COLORBAND(bContext *C, uiBut *but, uiHandleButtonData *data)
static bool ui_numedit_but_CURVEPROFILE(uiBlock *block, uiBut *but, uiHandleButtonData *data, int evtx, int evty, bool snap, const bool shift)
static bool ui_drag_toggle_set_xy_xy(bContext *C, ARegion *region, const int pushed_state, const int xy_src[2], const int xy_dst[2])
static void ui_apply_but_VEC(bContext *C, uiBut *but, uiHandleButtonData *data)
static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, eStrCursorJumpDirection direction, const bool select, eStrCursorJumpType jump)
static bool ui_numedit_but_UNITVEC(uiBut *but, uiHandleButtonData *data, int mx, int my, const enum eSnapType snap)
static void ui_apply_but_BUTM(bContext *C, uiBut *but, uiHandleButtonData *data)
static enum eSnapType ui_event_to_snap(const wmEvent *event)
struct uiHandleButtonMulti uiHandleButtonMulti
static void ui_but_copy_operator(bContext *C, uiBut *but, char *output, int output_len_max)
#define MENU_SCROLL_INTERVAL
static void ui_apply_but_BUT(bContext *C, uiBut *but, uiHandleButtonData *data)
#define MENU_TOWARDS_MARGIN
static void ui_selectcontext_end(uiBut *but, uiSelectContextStore *selctx_data)
static int ui_do_but_TRACKPREVIEW(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static bool parse_float_array(char *text, float *values, int expected_length)
bool UI_textbutton_activate_but(const bContext *C, uiBut *actbut)
void UI_context_active_but_clear(bContext *C, wmWindow *win, ARegion *region)
static int ui_handle_menu_button(bContext *C, const wmEvent *event, uiPopupBlockHandle *menu)
static bool ui_textedit_copypaste(uiBut *but, uiHandleButtonData *data, const int mode)
static void ui_numedit_set_active(uiBut *but)
struct uiSelectContextElem uiSelectContextElem
static ColorBand but_copypaste_coba
static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static int ui_do_but_EXIT(bContext *C, uiBut *but, struct uiHandleButtonData *data, const wmEvent *event)
static bool point_draw_handles(CurveProfilePoint *point)
static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState state)
static void ui_mouse_motion_keynav_init(struct uiKeyNavLock *keynav, const wmEvent *event)
static void ui_apply_but_autokey(bContext *C, uiBut *but)
static uiBut * ui_context_button_active(const ARegion *region, bool(*but_check_cb)(const uiBut *))
static bool ui_but_drag_init(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
@ BUTTON_ACTIVATE_TEXT_EDITING
static bool ui_numedit_but_TRACKPREVIEW(bContext *C, uiBut *but, uiHandleButtonData *data, int mx, int my, const bool shift)
static void ui_apply_but_undo(uiBut *but)
static float ui_numedit_apply_snap(int temp, float softmin, float softmax, const enum eSnapType snap)
#define DRAG_MULTINUM_THRESHOLD_VERTICAL
static void ui_textedit_end(bContext *C, uiBut *but, uiHandleButtonData *data)
static void ui_handler_region_drag_toggle_remove(bContext *UNUSED(C), void *userdata)
static void ui_numedit_begin(uiBut *but, uiHandleButtonData *data)
static uiBut * ui_but_find_open_event(ARegion *region, const wmEvent *event)
#define UI_DRAG_MAP_SOFT_RANGE_PIXEL_MAX
#define BUTTON_DRAGLOCK_THRESH
static void ui_textedit_set_cursor_select(uiBut *but, uiHandleButtonData *data, const float x)
void ui_but_activate_event(bContext *C, ARegion *region, uiBut *but)
uiBut * ui_but_find_select_in_enum(uiBut *but, int direction)
static int ui_handler_region_drag_toggle(bContext *C, const wmEvent *event, void *userdata)
static bool ui_numedit_but_NUM(uiButNumber *number_but, uiHandleButtonData *data, int mx, const bool is_motion, const enum eSnapType snap, float fac)
static int ui_handle_list_event(bContext *C, const wmEvent *event, ARegion *region, uiBut *listbox)
static int ui_do_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static void ui_handle_button_return_submenu(bContext *C, const wmEvent *event, uiBut *but)
static void ui_textedit_string_set(uiBut *but, struct uiHandleButtonData *data, const char *str)
static void ui_but_copy(bContext *C, uiBut *but, const bool copy_array)
static void ui_textedit_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonData *data)
static void ui_multibut_add(uiHandleButtonData *data, uiBut *but)
static void ui_but_copy_numeric_array(uiBut *but, char *output, int output_len_max)
void UI_but_tooltip_refresh(bContext *C, uiBut *but)
#define IS_ALLSELECT_EVENT(event)
static void ui_but_copy_text(uiBut *but, char *output, int output_len_max)
static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static bool ui_handle_button_activate_by_type(bContext *C, ARegion *region, uiBut *but)
bool UI_but_active_drop_color(bContext *C)
static int ui_do_but_TAB(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static void ui_block_open_end(bContext *C, uiBut *but, uiHandleButtonData *data)
#define UI_BUT_IS_SELECT_CONTEXT
static void ui_mouse_motion_towards_init(uiPopupBlockHandle *menu, const int xy[2])
static void ui_region_handler_remove(bContext *C, void *UNUSED(userdata))
static void ui_mouse_motion_towards_init_ex(uiPopupBlockHandle *menu, const int xy[2], const bool force)
struct uiHandleButtonData uiHandleButtonData
static void ui_apply_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data)
static void ui_but_copy_CurveProfile(uiBut *but)
static void ui_drag_toggle_set(bContext *C, uiDragToggleHandle *drag_info, const int xy_input[2])
static void ui_apply_but(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const bool interactive)
static void ui_apply_but_HISTOGRAM(bContext *C, uiBut *but, uiHandleButtonData *data)
static bool ui_textedit_delete_selection(uiBut *but, uiHandleButtonData *data)
static void ui_but_paste_CurveProfile(bContext *C, uiBut *but)
static void clamp_axis_max_v3(float v[3], const float max)
static uiAfterFunc * ui_afterfunc_new(void)
#define CASE_NUM_TO_DIR(n, d)
static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static uiButMultiState * ui_multibut_lookup(uiHandleButtonData *data, const uiBut *but)
static void ui_rgb_to_color_picker_HSVCUBE_v(const uiButHSVCube *hsv_but, const float rgb[3], float hsv[3])
static void ui_apply_but_TEX(bContext *C, uiBut *but, uiHandleButtonData *data)
static void ui_but_get_pasted_text_from_clipboard(char **buf_paste, int *buf_len)
static int ui_text_position_to_hidden(uiBut *but, int pos)
static void ui_apply_but_funcs_after(bContext *C)
#define BUTTON_KEYNAV_PX_LIMIT
static int ui_popup_handler(bContext *C, const wmEvent *event, void *userdata)
static int ui_do_but_NUM(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
void UI_context_active_but_prop_handle(bContext *C)
static int ui_do_but_COLORBAND(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static int get_but_property_array_length(uiBut *but)
#define PIE_MENU_INTERVAL
wmOperator * UI_context_active_operator_get(const struct bContext *C)
static int ui_text_position_from_hidden(uiBut *but, int pos)
static void ui_multibut_restore(bContext *C, uiHandleButtonData *data, uiBlock *block)
static ARegion * ui_but_tooltip_init(bContext *C, ARegion *region, int *pass, double *r_pass_delay, bool *r_exit_on_event)
static void ui_but_paste_colorband(bContext *C, uiBut *but, uiHandleButtonData *data)
static bool ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int direction, eStrCursorJumpType jump)
static void ui_but_copy_curvemapping(uiBut *but)
static int ui_do_but_SLI(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static int ui_but_pie_button_activate(bContext *C, uiBut *but, uiPopupBlockHandle *menu)
void UI_popup_handlers_remove(ListBase *handlers, uiPopupBlockHandle *popup)
static bool ui_but_copy_popover(uiBut *but, char *output, int output_len_max)
static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but)
static void ui_blocks_set_tooltips(ARegion *region, const bool enable)
static void ui_popup_handler_remove(bContext *C, void *userdata)
static void ui_mouse_motion_towards_reinit(uiPopupBlockHandle *menu, const int xy[2])
static int ui_do_but_UNITVEC(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
void UI_region_handlers_add(ListBase *handlers)
static bool ui_selectcontext_begin(bContext *C, uiBut *but, struct uiSelectContextStore *selctx_data)
static int ui_textedit_autocomplete(bContext *C, uiBut *but, uiHandleButtonData *data)
void ui_but_text_password_hide(char password_str[UI_MAX_PASSWORD_STR], uiBut *but, const bool restore)
static bool ui_but_find_select_in_enum__cmp(const uiBut *but_a, const uiBut *but_b)
static int ui_handle_menus_recursive(bContext *C, const wmEvent *event, uiPopupBlockHandle *menu, int level, const bool is_parent_inside, const bool is_parent_menu, const bool is_floating)
static bool ui_numedit_but_COLORBAND(uiBut *but, uiHandleButtonData *data, int mx)
static int ui_do_but_KEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static void ui_but_copy_color(uiBut *but, char *output, int output_len_max)
struct uiButMultiState uiButMultiState
static void button_tooltip_timer_reset(bContext *C, uiBut *but)
void UI_popup_handlers_add(bContext *C, ListBase *handlers, uiPopupBlockHandle *popup, const char flag)
static bool ui_menu_scroll_to_but(ARegion *region, uiBlock *block, uiBut *but_target)
static bool ui_numedit_but_WAVEFORM(uiBut *but, uiHandleButtonData *data, int mx, int my)
#define BUTTON_AUTO_OPEN_THRESH
static int ui_handler_region_menu(bContext *C, const wmEvent *event, void *userdata)
static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle *menu)
static void ui_but_paste_text(bContext *C, uiBut *but, uiHandleButtonData *data, char *buf_paste)
void ui_but_execute_begin(struct bContext *UNUSED(C), struct ARegion *region, uiBut *but, void **active_back)
static uiBut * ui_but_list_row_text_activate(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event, uiButtonActivateType activate_type)
uiBut * UI_region_but_find_rect_over(const ARegion *region, const rcti *rect_px)
static bool ui_menu_pass_event_to_parent_if_nonactive(uiPopupBlockHandle *menu, const uiBut *but, const int level, const int retval)
void UI_popup_handlers_remove_all(bContext *C, ListBase *handlers)
static void ui_apply_but_TAB(bContext *C, uiBut *but, uiHandleButtonData *data)
struct uiUndoStack_Text * ui_textedit_undo_stack_create(void)
bool ui_but_is_cursor_warp(const uiBut *but) ATTR_WARN_UNUSED_RESULT
size_t ui_but_drawstr_len_without_sep_char(const uiBut *but)
bool ui_searchbox_apply(uiBut *but, struct ARegion *region)
uiBut * ui_region_find_active_but(struct ARegion *region) ATTR_WARN_UNUSED_RESULT
void ui_perceptual_to_scene_linear_space(uiBut *but, float rgb[3])
void ui_popup_menu_memory_set(uiBlock *block, struct uiBut *but)
void ui_color_picker_hsv_to_rgb(const float r_cp[3], float rgb[3])
bool ui_block_is_pie_menu(const uiBlock *block) ATTR_WARN_UNUSED_RESULT
uiBlock *(* uiBlockHandleCreateFunc)(struct bContext *C, struct uiPopupBlockHandle *handle, void *arg1)
int ui_handler_panel_region(struct bContext *C, const struct wmEvent *event, struct ARegion *region, const uiBut *active_but)
uiBut * ui_but_find_mouse_over_ex(const struct ARegion *region, const int x, const int y, const bool labeledit) ATTR_WARN_UNUSED_RESULT
bool ui_searchbox_event(struct bContext *C, struct ARegion *region, uiBut *but, struct ARegion *butregion, const struct wmEvent *event)
bool ui_but_contains_point_px(const uiBut *but, const struct ARegion *region, int x, int y) ATTR_WARN_UNUSED_RESULT
bool ui_but_has_array_value(const uiBut *but) ATTR_WARN_UNUSED_RESULT
#define UI_BITBUT_VALUE_TOGGLED(a, b)
uiBut * ui_but_next(uiBut *but) ATTR_WARN_UNUSED_RESULT
size_t ui_but_tip_len_only_first_line(const uiBut *but)
@ UI_PIE_ANIMATION_FINISHED
@ UI_PIE_INITIAL_DIRECTION
@ UI_PIE_GESTURE_END_WAIT
uiBut * ui_but_find_rect_over(const struct ARegion *region, const rcti *rect_px) ATTR_WARN_UNUSED_RESULT
const char * ui_textedit_undo(struct uiUndoStack_Text *undo_stack, int direction, int *r_cursor_index)
void ui_scene_linear_to_perceptual_space(uiBut *but, float rgb[3])
#define PIE_CLICK_THRESHOLD_SQ
int ui_but_menu_step(uiBut *but, int direction)
int ui_searchbox_find_index(struct ARegion *region, const char *name)
void ui_hsvcube_pos_from_vals(const struct uiButHSVCube *hsv_but, const rcti *rect, const float *hsv, float *xp, float *yp)
void ui_popup_block_free(struct bContext *C, uiPopupBlockHandle *handle)
void ui_searchbox_update(struct bContext *C, struct ARegion *region, uiBut *but, const bool reset)
bool ui_block_is_menu(const uiBlock *block) ATTR_WARN_UNUSED_RESULT
#define UI_MENU_SCROLL_PAD
bool ui_but_contains_point_px_icon(const uiBut *but, struct ARegion *region, const struct wmEvent *event) ATTR_WARN_UNUSED_RESULT
void ui_but_hsv_set(uiBut *but)
uiBut * ui_but_find_mouse_over(const struct ARegion *region, const struct wmEvent *event) ATTR_WARN_UNUSED_RESULT
void ui_hsvcircle_pos_from_vals(const ColorPicker *cpicker, const rcti *rect, const float *hsv, float *xpos, float *ypos)
void ui_textedit_undo_stack_destroy(struct uiUndoStack_Text *undo_stack)
#define UI_MENU_SCROLL_ARROW
bool ui_searchbox_inside(struct ARegion *region, int x, int y)
bool ui_but_is_interactive(const uiBut *but, const bool labeledit) ATTR_WARN_UNUSED_RESULT
bool ui_but_contains_pt(const uiBut *but, float mx, float my) ATTR_WARN_UNUSED_RESULT
bool ui_but_contains_password(const uiBut *but) ATTR_WARN_UNUSED_RESULT
bool ui_but_is_editable(const uiBut *but) ATTR_WARN_UNUSED_RESULT
void ui_textedit_undo_push(struct uiUndoStack_Text *undo_stack, const char *text, int cursor_index)
void ui_hsvcircle_vals_from_pos(const rcti *rect, const float mx, const float my, float *r_val_rad, float *r_val_dist)
uiBut * ui_but_last(uiBlock *block) ATTR_WARN_UNUSED_RESULT
void ui_color_picker_rgb_to_hsv_compat(const float rgb[3], float r_cp[3])
uiBut * ui_list_find_mouse_over(struct ARegion *region, const struct wmEvent *event) ATTR_WARN_UNUSED_RESULT
uiPopupBlockHandle * ui_popup_menu_create(struct bContext *C, struct ARegion *butregion, uiBut *but, uiMenuCreateFunc menu_func, void *arg)
uiBut * ui_region_find_first_but_test_flag(struct ARegion *region, int flag_include, int flag_exclude)
uiBut * ui_but_prev(uiBut *but) ATTR_WARN_UNUSED_RESULT
struct ARegion * ui_screen_region_find_mouse_over(struct bScreen *screen, const struct wmEvent *event)
void ui_but_pie_dir(RadialDirection dir, float vec[2])
void ui_popup_translate(struct ARegion *region, const int mdiff[2])
uiBlock * ui_block_find_mouse_over_ex(const struct ARegion *region, const int x, const int y, bool only_clip)
bool ui_region_contains_point_px(const struct ARegion *region, int x, int y) ATTR_WARN_UNUSED_RESULT
bool ui_but_is_popover_once_compat(const uiBut *but) ATTR_WARN_UNUSED_RESULT
bool ui_but_is_editable_as_text(const uiBut *but) ATTR_WARN_UNUSED_RESULT
uiPopupBlockHandle * ui_popup_block_create(struct bContext *C, struct ARegion *butregion, uiBut *but, uiBlockCreateFunc create_func, uiBlockHandleCreateFunc handle_create_func, void *arg, void(*arg_free)(void *arg))
int ui_searchbox_autocomplete(struct bContext *C, struct ARegion *region, uiBut *but, char *str)
uiBlock * ui_block_func_COLOR(struct bContext *C, uiPopupBlockHandle *handle, void *arg_but)
uiBut * ui_but_first(uiBlock *block) ATTR_WARN_UNUSED_RESULT
void ui_popup_block_scrolltest(struct uiBlock *block)
void ui_searchbox_free(struct bContext *C, struct ARegion *region)
uiPopupBlockHandle * ui_popover_panel_create(struct bContext *C, struct ARegion *butregion, uiBut *but, uiMenuCreateFunc menu_func, void *arg)
#define UI_MENU_SCROLL_MOUSE
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
static void copy_array(const Node *node, const SocketType &socket, const Node *other, const SocketType &other_socket)
static void update(bNodeTree *ntree)
vector snap(vector a, vector b)
float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_float_get_default_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, bool value)
void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
bool RNA_property_array_check(PropertyRNA *prop)
void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
const char * RNA_property_identifier(const PropertyRNA *prop)
void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, float value)
float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value, ReportList *reports)
float RNA_property_float_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index)
void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin, float *hardmax)
PropertyType RNA_property_type(PropertyRNA *prop)
const PointerRNA PointerRNA_NULL
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
int RNA_property_int_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, int value)
int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
int RNA_property_flag(PropertyRNA *prop)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
int RNA_property_int_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
PropertySubType RNA_property_subtype(PropertyRNA *prop)
void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax)
bool RNA_path_resolve_property(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
bool RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop_orig)
bool RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
float RNA_property_float_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const bool *values)
StructRNA * RNA_struct_base(StructRNA *type)
struct ColorBand * gradient
float luminosity_lock_value
CurveProfilePoint * table
struct MovieTrackingMarker * marker
struct MovieTrackingTrack * track
char idname[BKE_ST_MAXNAME]
struct wmTooltipState * tool_tip
char undostr[BKE_UNDO_STR_MAX]
struct uiAfterFunc * next
uiBlockHandleFunc handle_func
uiMenuHandleFunc butm_func
struct uiAfterFunc * prev
uiButHandleRenameFunc rename_func
uiButSearchArgFreeFn search_arg_free_fn
struct UnitSettings * unit
uiPopupBlockHandle * handle
struct PieMenuData pie_data
uiBlockHandleFunc handle_func
uiMenuHandleFunc butm_func
int(* block_event_func)(const struct bContext *C, struct uiBlock *, const struct wmEvent *)
struct ColorBand * edit_coba
struct CurveMapping * edit_cumap
struct CurveProfile * edit_profile
eButGradientType gradient_type
uiSelectContextStore select_others
bool results_are_suggestions
uiButSearchArgFreeFn arg_free_fn
uiButSearchCreateFn popup_create_fn
uiButCompleteFunc autocomplete_func
struct bContextStore * context
struct uiHandleButtonData * active
uiMenuCreateFunc menu_create_func
uiButHandleHoldFunc hold_func
struct PointerRNA * opptr
struct wmOperatorType * optype
uiButHandleRenameFunc rename_func
uiBlockCreateFunc block_create_func
char drawstr[UI_MAX_DRAW_STR]
struct PropertyRNA * rnaprop
uiButPushedStateFunc pushed_state_func
struct PointerRNA rnapoin
int * items_filter_neworder
struct wmTimer * scrolltimer
struct ARegion * ctx_region
struct wmOperator * popup_op
struct uiKeyNavLock keynav_state
struct ScrArea * ctx_area
struct uiPopupBlockCreate popup_create_vars
void(* cancel_func)(struct bContext *C, void *arg)
void(* popup_func)(struct bContext *C, void *arg, int event)
struct uiSafetyRct * next
uiSelectContextElem * elems
wmUIHandlerRemoveFunc remove_fn
wmUIHandlerFunc handle_fn
struct wmEventHandler * next
enum eWM_EventHandlerType type
char is_direction_inverted
struct wmOperatorType * optype
struct PointerRNA * opptr
bool(* check)(struct bContext *, struct wmOperator *)
struct wmOperatorType * type
struct wmEvent * eventstate
short pie_event_type_last
struct wmIMEData * ime_data
double PIL_check_seconds_timer(void)
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
__forceinline const avxi abs(const avxi &a)
void WM_cursor_modal_set(wmWindow *win, int val)
void WM_cursor_grab_enable(wmWindow *win, int wrap, bool hide, int bounds[4])
void WM_cursor_modal_restore(wmWindow *win)
void WM_cursor_grab_disable(wmWindow *win, const int mouse_ungrab_xy[2])
ID * WM_drag_get_local_ID(const wmDrag *drag, short idcode)
wmDrag * WM_event_start_drag(struct bContext *C, int icon, int type, void *poin, double value, unsigned int flags)
void WM_event_drag_image(wmDrag *drag, ImBuf *imb, float scale, int sx, int sy)
int WM_event_drag_threshold(const struct wmEvent *event)
int WM_event_absolute_delta_y(const struct wmEvent *event)
wmEventHandler_UI * WM_event_add_ui_handler(const bContext *C, ListBase *handlers, wmUIHandlerFunc handle_fn, wmUIHandlerRemoveFunc remove_fn, void *user_data, const char flag)
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_report_banner_show(void)
void WM_event_free_ui_handler_all(bContext *C, ListBase *handlers, wmUIHandlerFunc handle_fn, wmUIHandlerRemoveFunc remove_fn)
void WM_report(ReportType type, const char *message)
void WM_reportf(ReportType type, const char *format,...)
void WM_event_remove_ui_handler(ListBase *handlers, wmUIHandlerFunc handle_fn, wmUIHandlerRemoveFunc remove_fn, void *user_data, const bool postpone)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void wm_event_handler_ui_cancel_ex(bContext *C, wmWindow *win, ARegion *region, bool reactivate_button)
int WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, short context, PointerRNA *properties)
void wm_event_init_from_window(wmWindow *win, wmEvent *event)
void WM_event_add_mousemove(wmWindow *win)
#define ISKEYBOARD(event_type)
#define ISHOTKEY(event_type)
#define IS_EVENT_MOD(...)
#define ISMOUSE(event_type)
void WM_gestures_remove(wmWindow *win)
const char * WM_key_event_string(const short type, const bool compact)
char * WM_prop_pystring_assign(bContext *C, PointerRNA *ptr, PropertyRNA *prop, int index)
char * WM_operator_pystring_ex(bContext *C, wmOperator *op, const bool all_args, const bool macro_args, wmOperatorType *ot, PointerRNA *opptr)
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
void WM_operator_properties_free(PointerRNA *ptr)
bool WM_stereo3d_enabled(wmWindow *win, bool skip_stereo3d_check)
void WM_event_remove_timer(wmWindowManager *wm, wmWindow *UNUSED(win), wmTimer *timer)
void WM_clipboard_text_set(const char *buf, bool selection)
char * WM_clipboard_text_get_firstline(bool selection, int *r_len)
bScreen * WM_window_get_active_screen(const wmWindow *win)
wmTimer * WM_event_add_timer(wmWindowManager *wm, wmWindow *win, int event_type, double timestep)