68#include "RNA_prototypes.hh"
88#define USE_CONT_MOUSE_CORRECT
90#define USE_DRAG_TOGGLE
93#define USE_DRAG_MULTINUM
102#define USE_KEYNAV_LIMIT
105#define USE_DRAG_POPUP
117#define UI_MAX_PASSWORD_STR 128
129#define UI_PROP_SCALE_LOG_MIN 0.5e-8f
135#define UI_PROP_SCALE_LOG_SNAP_OFFSET 0.03f
148#define UI_DRAG_MAP_SOFT_RANGE_PIXEL_MAX 1000
167 const bool is_click);
170 const bool is_click);
178#ifdef USE_KEYNAV_LIMIT
195#define BUTTON_FLASH_DELAY 0.020
196#define MENU_SCROLL_INTERVAL 0.1
197#define PIE_MENU_INTERVAL 0.01
198#define BUTTON_AUTO_OPEN_THRESH 0.2
199#define BUTTON_MOUSE_TOWARDS_THRESH 1.0
201#define BUTTON_KEYNAV_PX_LIMIT 8
204#define MENU_TOWARDS_MARGIN 20
206#define MENU_TOWARDS_WIGGLE_ROOM 64
208#define BUTTON_DRAGLOCK_THRESH 3
256# define USE_ALLSELECT_LAYER_HACK
285 const double value_orig);
293# define IS_ALLSELECT_EVENT(event) (((event)->modifier & KM_ALT) != 0)
296# define UI_BUT_IS_SELECT_CONTEXT UI_BUT_NODE_ACTIVE
300#ifdef USE_DRAG_MULTINUM
305# define DRAG_MULTINUM_THRESHOLD_DRAG_X (UI_UNIT_Y / 4)
312# define DRAG_MULTINUM_THRESHOLD_DRAG_Y (UI_UNIT_Y / 4)
322# define DRAG_MULTINUM_THRESHOLD_VERTICAL (0.75f)
453#ifdef USE_CONT_MOUSE_CORRECT
466#ifdef USE_KEYNAV_LIMIT
470#ifdef USE_DRAG_MULTINUM
552#ifdef USE_DRAG_MULTINUM
578 static int lastdy = 0;
586 if ((dy > 0 && lastdy < 0) || (dy < 0 && lastdy > 0)) {
616 uiBut *but_iter = but;
617 uiBut *but_found =
nullptr;
621 but_iter = but_iter->
prev;
626 but_found = but_iter;
627 if (direction == 1) {
631 but_iter = but_iter->
next;
639 return shift ? 0.05f : 1.0f;
652 *r_mx = (data->dragstartx * (1.0f - fac) + mx * fac);
653 *r_my = (data->dragstarty * (1.0f - fac) + my * fac);
667 if (mx == data->draglastx) {
671 if (data->draglock) {
675#ifdef USE_DRAG_MULTINUM
676 if (
ELEM(data->multi_data.init,
683 data->draglock =
false;
684 data->dragstartx = mx;
702 if (base ==
nullptr) {
706 &RNA_AddonPreferences,
707 &RNA_KeyConfigPreferences,
709 &RNA_UserAssetLibrary);
721 U.runtime.is_dirty =
true;
764 *r_hue = roundf((*r_hue) * snap_increment) / snap_increment;
777 uiAfterFunc *after = MEM_new<uiAfterFunc>(__func__);
800 const uiBut *context_but)
807 after->
opptr = *properties;
808 *properties =
nullptr;
811 if (context_but && context_but->
context) {
897 but->
opptr =
nullptr;
908 search_but->
arg =
nullptr;
911 if (but->
active !=
nullptr) {
913 if (data->custom_interaction_handle !=
nullptr) {
946 const char *
str =
nullptr;
948 bool skip_undo =
false;
955 else if (!but->
drawstr.empty()) {
965 if (
str ==
nullptr ||
str[0] ==
'\0' || str_len_clip == 0) {
966 str =
"Unknown Action";
967 str_len_clip = strlen(
str);
976 if (
ELEM(but->
rnaprop, &rna_ID_name, &rna_Object_active_shape_key_index)) {
989 if (skip_undo ==
false) {
1026 if (!
str.has_value()) {
1055 opptr = *after.
opptr;
1056 MEM_delete(after.
opptr);
1063 (after.
opptr) ? &opptr :
nullptr,
1137 data->retval = but->
retval;
1138 data->applied =
true;
1146 data->retval = but->
retval;
1147 data->applied =
true;
1158 data->retval = but->
retval;
1159 data->applied =
true;
1170 value_toggle = (value == 0.0);
1180 data->retval = but->
retval;
1181 data->applied =
true;
1197 data->retval = but->
retval;
1198 data->applied =
true;
1206 if (data->apply_through_extra_icon) {
1222 const uiBut *context_but,
1241 if (list && list->dyn_data->custom_activate_optype) {
1243 C, but, list->dyn_data->custom_activate_optype, &list->dyn_data->custom_activate_opptr);
1252 if (!data->text_edit.edit_string) {
1269 but->
rename_orig = data->text_edit.original_string;
1270 data->text_edit.original_string =
nullptr;
1288 data->retval = but->
retval;
1289 data->applied =
true;
1294 if (data->text_edit.edit_string) {
1303 data->retval = but->
retval;
1304 data->applied =
true;
1309 if (data->text_edit.edit_string) {
1322 data->cancel =
true;
1331 data->cancel =
true;
1342 data->retval = but->
retval;
1343 data->applied =
true;
1352 data->retval = but->
retval;
1353 data->applied =
true;
1359 data->retval = but->
retval;
1360 data->applied =
true;
1366 data->retval = but->
retval;
1367 data->applied =
true;
1373 data->retval = but->
retval;
1374 data->applied =
true;
1383#ifdef USE_DRAG_MULTINUM
1392 mbut_state->
but = but;
1394# ifdef USE_ALLSELECT
1408 if (mbut_state->
but == but) {
1424# ifdef USE_ALLSELECT
1439# ifdef USE_ALLSELECT
1440 if (data->multi_data.mbuts) {
1441 LinkNode *list = data->multi_data.mbuts;
1459 data->multi_data.mbuts =
nullptr;
1461 if (data->multi_data.bs_mbuts) {
1463 data->multi_data.bs_mbuts =
nullptr;
1472 bool changed =
false;
1474 seg[0][0] = data->multi_data.drag_start[0];
1475 seg[0][1] = data->multi_data.drag_start[1];
1477 seg[1][0] =
event->xy[0];
1478 seg[1][1] =
event->xy[1];
1485 data->multi_data.has_mbuts =
false;
1489 bool drag_prev =
false;
1490 bool drag_curr =
false;
1494 but->
flag &= ~UI_BUT_DRAG_MULTI;
1501 if (but_active != but) {
1510 data->multi_data.has_mbuts =
true;
1517 changed |= (drag_prev != drag_curr);
1542 if (data->origvalue != 0.0) {
1543 data->multi_data.is_proportional =
true;
1550 ARegion *region = data->region;
1551 const double value_delta = data->value - data->origvalue;
1552 const double value_scale = data->multi_data.is_proportional ? (data->value / data->origvalue) :
1565 if (mbut_state ==
nullptr) {
1567 printf(
"%s: Can't find button\n", __func__);
1576# ifdef USE_ALLSELECT
1577 if (data->select_others.is_enabled) {
1595 if (data->text_edit.edit_string) {
1602 if (data->multi_data.is_proportional) {
1625#ifdef USE_DRAG_TOGGLE
1640 ICON_DECORATE_KEYFRAME,
1641 ICON_DECORATE_ANIMATE,
1642 ICON_DECORATE_OVERRIDE);
1676 bContext *C,
ARegion *region,
const int pushed_state,
const int xy_src[2],
const int xy_dst[2])
1680 bool changed =
false;
1683 float xy_a_block[2] = {
float(xy_src[0]),
float(xy_src[1])};
1684 float xy_b_block[2] = {
float(xy_dst[0]),
float(xy_dst[1])};
1704 if (pushed_state_but == pushed_state) {
1713 if (
U.runtime.is_dirty ==
false) {
1731 bool do_draw =
false;
1745 const float but_cent_new[2] = {
1772 xy[0] = (drag_info->
xy_lock[0] ==
false) ? xy_input[0] : drag_info->
xy_last[0];
1773 xy[1] = (drag_info->
xy_lock[1] ==
false) ? xy_input[1] : drag_info->
xy_last[1];
1796 switch (event->
type) {
1813 region, drag_info->
xy_init,
true,
false,
nullptr,
nullptr);
1847 bool success =
false;
1862 bool use_path_from_id;
1868 std::optional<std::string> path;
1878 for (i = 0, link = lb.
data(); i < selctx_data->
elems_len; i++, link++) {
1882 path.has_value() ? path->c_str() :
nullptr,
1926 success = (selctx_data->
elems_len != 0);
1947 if (selctx_data->
elems) {
1952 but->
flag &= ~UI_BUT_IS_SELECT_CONTEXT;
1959 const double value_orig)
1961 if (selctx_data->
elems) {
1965 const bool use_delta = (selctx_data->
is_copy ==
false);
1967 std::variant<bool, int, float, std::string, PointerRNA> delta,
min,
max;
1973 delta.emplace<
float>(use_delta ? (value - value_orig) : value);
1976 min.emplace<
float>(min_v);
1977 max.emplace<
float>(max_v);
1980 delta.emplace<
int>(
int(use_delta ? (value - value_orig) : value));
1983 min.emplace<
int>(min_v);
1984 max.emplace<
int>(max_v);
2009# ifdef USE_ALLSELECT_LAYER_HACK
2021 bool *tmparray =
static_cast<bool *
>(
MEM_callocN(
sizeof(
bool) *
len, __func__));
2023 tmparray[index] =
true;
2025 for (
int i = 0; i < selctx_data->
elems_len; i++) {
2040 for (
int i = 0; i < selctx_data->
elems_len; i++) {
2045 float other_value = std::get<float>(delta) + (use_delta ? other->val_f : 0.0f);
2046 CLAMP(other_value, std::get<float>(
min), std::get<float>(max));
2055 int other_value = std::get<int>(delta) + (use_delta ? other->val_i : 0);
2056 CLAMP(other_value, std::get<int>(
min), std::get<int>(max));
2065 const bool other_value = std::get<bool>(delta);
2074 const int other_value = std::get<int>(delta);
2079 const PointerRNA &other_value = std::get<PointerRNA>(delta);
2083 const std::string &other_value = std::get<std::string>(delta);
2110 const int drag_threshold =
min_ii(
2114 if (
abs(data->dragstartx - event->
xy[0]) +
abs(data->dragstarty - event->
xy[1]) > drag_threshold)
2117 data->cancel =
true;
2118#ifdef USE_DRAG_TOGGLE
2138 &data->window->modalhandlers,
2148 if (
ELEM(data->region->regiontype,
2164 if (lock_axis != -1) {
2165 drag_info->
xy_lock[lock_axis] =
true;
2226 data->retval = but->
retval;
2227 data->applied =
true;
2233 data->retval = but->
retval;
2234 data->applied =
true;
2240 data->retval = but->
retval;
2241 data->applied =
true;
2247 data->retval = but->
retval;
2248 data->applied =
true;
2261 if (!data->applied) {
2265 if (data->text_edit.edit_string) {
2268 data->text_edit.edit_string = data->text_edit.original_string;
2269 data->text_edit.original_string =
nullptr;
2270 data->value = data->origvalue;
2278 data->applied_interactive =
true;
2280 else if (data->applied_interactive) {
2285# ifdef USE_DRAG_MULTINUM
2291 if (data->select_others.elems_len == 0)
2298 const bool is_array_paste = (
event->val ==
KM_PRESS) &&
2301 if (!is_array_paste) {
2303 data->select_others.is_enabled =
true;
2307 if (data->select_others.elems_len == 0) {
2309 data->select_others.elems_len = -1;
2316 double *editval = but->
editval;
2317 float *editvec = but->
editvec;
2437#ifdef USE_DRAG_MULTINUM
2438 if (data->multi_data.has_mbuts) {
2440 (data->multi_data.skip ==
false))
2457 data->origvalue = 0.0;
2477 if (data->custom_interaction_handle !=
nullptr) {
2498 *r_buf_paste = text;
2502 *r_buf_paste =
static_cast<char *
>(
MEM_callocN(
sizeof(
char), __func__));
2517 for (
int i = 0; i < values_len; i++) {
2526 data->value = values[but->
rnaindex];
2534 const int values_len,
2538 const int values_end = values_len - 1;
2540 output[ofs++] =
'[';
2541 for (
int i = 0; i < values_len; i++) {
2543 output + ofs, output_maxncpy - ofs, (i != values_end) ?
"%f, " :
"%f]", values[i]);
2558 BLI_assert(0 <= values_len_expected && values_len_expected <= 4);
2561 const int values_len_actual = sscanf(
2562 text,
"[%f, %f, %f, %f, %f]", &
v[0], &
v[1], &
v[2], &
v[3], &
v[4]);
2564 if (values_len_actual == values_len_expected) {
2565 memcpy(values,
v,
sizeof(
float) * values_len_expected);
2577 if (values_len > 4) {
2608 data->value = value;
2691 if (but->
poin !=
nullptr) {
2700 but->
poin =
reinterpret_cast<char *
>(MEM_cnew<ColorBand>(__func__));
2711 if (but->
poin !=
nullptr) {
2722 but->
poin =
reinterpret_cast<char *
>(MEM_cnew<CurveMapping>(__func__));
2734 if (but->
poin !=
nullptr) {
2745 but->
poin =
reinterpret_cast<char *
>(MEM_cnew<CurveProfile>(__func__));
2767 BLI_snprintf(output, output_maxncpy,
"bpy.ops.wm.call_menu(name=\"%s\")", mt->
idname);
2777 BLI_snprintf(output, output_maxncpy,
"bpy.ops.wm.call_panel(name=\"%s\")", pt->
idname);
2791 char buf[4096] = {0};
2792 const int buf_maxncpy =
sizeof(buf);
2795 bool is_buf_set =
false;
2797 const bool has_required_data = !(but->
poin ==
nullptr && but->
rnapoin.
data ==
nullptr);
2799 switch (but->
type) {
2802 if (!has_required_data) {
2815 if (!has_required_data) {
2823 if (!has_required_data) {
2832 if (!has_required_data) {
2885 int buf_paste_len = 0;
2889 const bool has_required_data = !(but->
poin ==
nullptr && but->
rnapoin.
data ==
nullptr);
2891 switch (but->
type) {
2894 if (!has_required_data) {
2906 if (!has_required_data) {
2913 if (!has_required_data) {
2921 if (!has_required_data) {
2970 const char *strpos = butstr;
2971 const char *str_end = butstr + strlen(butstr);
2972 for (
int i = 0; i <
pos; i++) {
2976 return (strpos - butstr);
3000 if (but->
pos >= 0) {
3011 if (but->
pos >= 0) {
3019 memset(butstr,
'*',
len);
3093 const int len = strlen(
str);
3094 bool changed =
false;
3116 float starty_dummy = 0.0f;
3134 startx -=
U.pixelsize / aspect;
3143 str_last = &
str[but->
ofs];
3174 but->
selend = data->text_edit.sel_pos_init;
3191 bool changed =
false;
3199 size_t step = buf_len;
3219 memcpy(&
str[but->
pos], buf, step *
sizeof(
char));
3228#ifdef WITH_INPUT_IME
3232 const char buf[2] = {ascii,
'\0'};
3244 const int len = strlen(
str);
3245 const int pos_prev = but->
pos;
3251 if (has_sel && !
select) {
3266 int pos_i = but->
pos;
3271 if (has_sel ==
false) {
3276 else if (but->
selsta == pos_prev) {
3297 const int len = strlen(
str);
3299 bool changed =
false;
3308 else if (direction) {
3312 else if (but->
pos >= 0 && but->
pos <
len) {
3326 else if (but->
pos > 0) {
3344 char *
str = data->text_edit.edit_string;
3347 if (data->searchbox) {
3369 bool changed =
false;
3389 char *buf =
static_cast<char *
>(
3390 MEM_mallocN(
sizeof(
char) * (sellen + 1),
"ui_textedit_copypaste"));
3409#ifdef WITH_INPUT_IME
3423 wm_window_IME_begin(win, x, y, 0, 0,
true);
3429 wm_window_IME_end(win);
3432void ui_but_ime_reposition(
uiBut *but,
int x,
int y,
bool complete)
3438 wm_window_IME_begin(data->window, x, y - 4, 0, 0, complete);
3441const wmIMEData *ui_but_ime_data_get(
uiBut *but)
3445 if (data && data->window) {
3459 bool no_zero_strip =
false;
3465 status.
item(
" ", ICON_NONE);
3467#ifdef USE_DRAG_MULTINUM
3469 if (data->applied_interactive) {
3471 data->cancel =
true;
3473 data->cancel =
false;
3475 data->applied_interactive =
false;
3482 data->select_others.is_enabled =
true;
3483 data->select_others.is_copy =
true;
3545 data->searchbox = search_but->
popup_create_fn(C, data->region, search_but);
3550 but->
flag &= ~UI_BUT_REDALERT;
3555 if (data->searchbox) {
3575#ifdef WITH_INPUT_IME
3577 ui_textedit_ime_begin(win, but);
3598 printf(
"%s: invalid utf8 - stripped chars %d\n", __func__, strip);
3602 if (data->searchbox) {
3603 if (data->cancel ==
false) {
3617 data->cancel =
true;
3620 data->escapecancel =
true;
3628 data->searchbox =
nullptr;
3644#ifdef WITH_INPUT_IME
3646# if defined(WIN32) || defined(__APPLE__)
3650 ui_textedit_ime_end(win, but);
3671 data->postbut = but;
3680 data->postbut = but;
3704 data->postbut = but;
3713 data->postbut = but;
3728#if defined(__APPLE__) && 0
3748 bool changed =
false, inbox =
false,
update =
false, skip_undo_push =
false;
3750#ifdef WITH_INPUT_IME
3752 const wmIMEData *ime_data = win->
ime_data;
3755 const bool is_ime_composing =
false;
3758 switch (event->
type) {
3761 if (data->searchbox) {
3762#ifdef USE_KEYNAV_LIMIT
3781 if (data->is_semi_modal) {
3787 if (data->searchbox) {
3795#ifdef WITH_INPUT_IME
3797 if (is_ime_composing) {
3801 data->cancel =
true;
3802 data->escapecancel =
true;
3817 if (data->searchbox) {
3821 bool is_press_in_button =
false;
3823 float mx =
event->xy[0];
3824 float my =
event->xy[1];
3828 is_press_in_button =
true;
3835 if (is_press_in_button) {
3843 else if (inbox ==
false && !data->is_semi_modal) {
3845 if (data->searchbox) {
3846 data->cancel = data->escapecancel =
true;
3855 if (is_press_in_button) {
3856 const int str_len = strlen(text_edit.
edit_string);
3864 but->
pos = short(selend);
3865 but->
selsta = short(selsta);
3866 but->
selend = short(selend);
3868 text_edit.
sel_pos_init = ((selend == str_len) && (selsta != 0)) ? selend : selsta;
3873 else if (inbox && !data->is_semi_modal) {
3885 if (event->
val ==
KM_PRESS && !is_ime_composing) {
3886 switch (event->
type) {
3890#if defined(__APPLE__)
3921 if (data->searchbox) {
3922#ifdef USE_KEYNAV_LIMIT
3939 if (data->searchbox) {
3940#ifdef USE_KEYNAV_LIMIT
3973#if defined(__APPLE__)
4011 const bool is_redo = (
event->modifier &
KM_SHIFT);
4013#
if defined(__APPLE__)
4021 if (undo_str !=
nullptr) {
4025 but->
pos = undo_pos;
4031 skip_undo_push =
true;
4038#ifdef WITH_INPUT_IME
4039 && !is_ime_composing && !WM_event_is_ime_switch(event)
4043 char utf8_buf_override[2] = {
'\0',
'\0'};
4044 const char *utf8_buf =
event->utf8_buf;
4050 utf8_buf_override[0] =
'.';
4051 utf8_buf = utf8_buf_override;
4069#ifdef WITH_INPUT_IME
4078 if (ime_data->result_len) {
4080 STREQ(ime_data->str_result,
"\xE3\x80\x82"))
4083 ui_textedit_insert_ascii(but, data,
'.');
4097 if ((skip_undo_push ==
false) && (text_edit.
undo_stack_text !=
nullptr)) {
4102 if (
update && data->interactive) {
4110 if (data->searchbox) {
4117 if (!data->searchbox) {
4133 switch (event->
type) {
4135 int mx =
event->xy[0];
4136 int my =
event->xy[1];
4168 data->origvalue = data->startvalue;
4169 data->value = data->origvalue;
4199 float softrange = softmax - softmin;
4212 const float value_step_float_min = 0.1f;
4214 const double value_step = is_float ?
4218 const float softrange_max =
min_ff(
4220 2 * (is_float ?
min_ff(value_step, value_step_float_min) *
4221 (drag_map_softrange_max / value_step_float_min) :
4222 drag_map_softrange_max));
4224 if (softrange > softrange_max) {
4226 softmin = data->origvalue - (softrange_max / 2);
4227 softmax = data->origvalue + (softrange_max / 2);
4228 if (!isfinite(softmin)) {
4231 if (!isfinite(softmax)) {
4235 if (softmin < but->softmin) {
4237 softmax = softmin + softrange_max;
4239 else if (softmax > but->
softmax) {
4241 softmin = softmax - softrange_max;
4245 if (
UNLIKELY(softmin == softmax)) {
4246 if (data->origvalue > 0.0) {
4247 softmin = nextafterf(softmin, -
FLT_MAX);
4250 softmax = nextafterf(softmax,
FLT_MAX);
4254 softrange = softmax - softmin;
4258 if (softrange == 0.0f) {
4259 data->dragfstart = 0.0f;
4262 switch (scale_type) {
4264 data->dragfstart = (
float(data->value) - softmin) / softrange;
4269 const float base = softmax / log_min;
4270 data->dragfstart =
logf(
float(data->value) / log_min) /
logf(base);
4274 const float cubic_min =
cube_f(softmin);
4275 const float cubic_max =
cube_f(softmax);
4276 const float cubic_range = cubic_max - cubic_min;
4277 const float f = (
float(data->value) - softmin) * cubic_range / softrange + cubic_min;
4278 data->dragfstart = (cbrtf(f) - softmin) / softrange;
4283 data->dragf = data->dragfstart;
4285 data->drag_map_soft_min = softmin;
4286 data->drag_map_soft_max = softmax;
4289 data->dragchange =
false;
4290 data->draglock =
true;
4309 data->dragstartx = 0;
4310 data->draglastx = 0;
4311 data->dragchange =
false;
4312 data->dragcbd =
nullptr;
4318 if (data->interactive) {
4361 PanelType *popover_panel_type =
nullptr;
4362 void *arg =
nullptr;
4367 status.
item(
" ", ICON_NONE);
4370 switch (but->
type) {
4386 const char *idname =
static_cast<const char *
>(but->
func_argN);
4397 popover_panel_type =
reinterpret_cast<PanelType *
>(but->
poin);
4406 const char *idname =
static_cast<const char *
>(but->
func_argN);
4420 if (func || handlefunc) {
4422 C, data->region, but, func, handlefunc, arg,
nullptr,
false);
4427 else if (menufunc) {
4430 STRNCPY(data->menu->menu_idname, mt->idname);
4436 else if (popoverfunc) {
4446 data->select_others.is_enabled =
true;
4474 data->menu =
nullptr;
4482 if (data && data->menu) {
4499 ARegion *region = data->region;
4504 data->cancel =
true;
4529 int x =
event->xy[0], y =
event->xy[1];
4538 xmax -= 0.2 * icon_size;
4547 if ((x > (xmax - icon_size)) && x <= xmax) {
4590 if (op_icon->highlighted) {
4591 old_highlighted = op_icon;
4602 if (old_highlighted != hovered) {
4607#ifdef USE_DRAG_TOGGLE
4616 data->dragstartx =
event->xy[0];
4617 data->dragstarty =
event->xy[1];
4625 data->applied =
false;
4635#ifdef USE_DRAG_TOGGLE
4652 data->cancel =
true;
4665 data->cancel =
true;
4709 data->cancel =
true;
4711 data->escapecancel =
true;
4729 data->cancel =
true;
4737 data->cancel =
true;
4738 data->escapecancel =
true;
4769 data->cancel =
true;
4782 const bool is_property = (but->
rnaprop !=
nullptr);
4784#ifdef USE_DRAG_TOGGLE
4805 if (event->
val == event_val) {
4871#ifdef USE_DRAG_TOGGLE
4881 bool do_activate =
false;
4905 int type =
event->type;
4906 int val =
event->val;
4920 uiBut *but_other = (direction == -1) ? but_select->
next : but_select->
prev;
4922 ARegion *region = data->region;
4924 data->cancel =
true;
4929 data = but_other->
active;
4960 const bool close_popup =
true)
4986 switch (event->
val) {
4995 data->dragstartx =
event->xy[0];
4996 data->dragstarty =
event->xy[1];
5008 data->cancel =
true;
5036 data->dragstartx =
event->xy[0];
5037 data->dragstarty =
event->xy[1];
5041#ifdef USE_DRAG_TOGGLE
5044 data->dragstartx =
event->xy[0];
5045 data->dragstarty =
event->xy[1];
5102 if (tempf == softmin || tempf == softmax ||
snap ==
SNAP_OFF) {
5107 float softrange = softmax - softmin;
5117 fac /= unit->scale_length;
5133 if (softrange >= 21.0f) {
5145 switch (scale_type) {
5149 if (softrange < 2.10f) {
5150 tempf = roundf(tempf * 10.0f / snap_fac) * 0.1f * snap_fac;
5152 else if (softrange < 21.0f) {
5153 tempf = roundf(tempf / snap_fac) * snap_fac;
5156 tempf = roundf(tempf * 0.1f / snap_fac) * 10.0f * snap_fac;
5161 const float snap_fac =
powf(10.0f,
5164 tempf = roundf(tempf / snap_fac) * snap_fac;
5182 if (
ELEM(temp, softmin, softmax)) {
5190 temp = 10 * (temp / 10);
5193 temp = 100 * (temp / 100);
5203 const bool is_motion,
5209 bool changed =
false;
5222 const float softmin = but->
softmin;
5223 const float softmax = but->
softmax;
5224 const float softrange = softmax - softmin;
5235 switch (scale_type) {
5237 tempf =
float(data->startvalue) +
float(mx - data->dragstartx) * fac;
5241 const float startvalue =
max_ff(
float(data->startvalue), log_min);
5242 tempf =
expf(
float(mx - data->dragstartx) * fac) * startvalue;
5243 if (tempf <= log_min) {
5249 tempf = cbrtf(
float(data->startvalue)) +
float(mx - data->dragstartx) * fac;
5250 tempf *= tempf * tempf;
5258 switch (scale_type) {
5260 if (tempf < softmin) {
5261 data->dragstartx -= (softmin - tempf) / fac;
5264 else if (tempf > softmax) {
5265 data->dragstartx -= (softmax - tempf) / fac;
5271 const float startvalue =
max_ff(
float(data->startvalue), log_min);
5272 if (tempf < log_min) {
5273 data->dragstartx -=
logf(log_min / startvalue) / fac -
float(mx - data->dragstartx);
5276 else if (tempf > softmax) {
5277 data->dragstartx -=
logf(softmax / startvalue) / fac -
float(mx - data->dragstartx);
5283 if (tempf < softmin) {
5284 data->dragstartx = mx -
int((cbrtf(softmin) - cbrtf(
float(data->startvalue))) / fac);
5287 else if (tempf > softmax) {
5288 data->dragstartx = mx -
int((cbrtf(softmax) - cbrtf(
float(data->startvalue))) / fac);
5295 CLAMP(tempf, softmin, softmax);
5298 if (tempf !=
float(data->value)) {
5299 data->dragchange =
true;
5300 data->value = tempf;
5305 if (softrange > 256) {
5308 else if (softrange > 32) {
5315 temp = data->startvalue + ((
double(mx) - data->dragstartx) *
double(fac));
5319 if (temp < softmin) {
5320 data->dragstartx -= (softmin - temp) / fac;
5323 else if (temp > softmax) {
5324 data->dragstartx += (temp - softmax) / fac;
5328 CLAMP(temp, softmin, softmax);
5331 if (temp != data->value) {
5332 data->dragchange =
true;
5338 data->draglastx = mx;
5342 const float softmin = data->drag_map_soft_min;
5343 const float softmax = data->drag_map_soft_max;
5344 const float softrange = softmax - softmin;
5346 float non_linear_range_limit;
5347 float non_linear_pixel_map;
5348 float non_linear_scale;
5355 non_linear_range_limit = 11.0f;
5356 non_linear_pixel_map = 500.0f;
5360 non_linear_range_limit = 129.0f;
5362 non_linear_pixel_map = 250.0f;
5365 if (softrange > 600) {
5366 deler =
powf(softrange, 0.75f);
5368 else if (softrange < 25) {
5371 else if (softrange < 100) {
5377 if (softrange > non_linear_range_limit) {
5378 non_linear_scale =
float(
abs(mx - data->dragstartx)) / non_linear_pixel_map;
5381 non_linear_scale = 1.0f;
5384 if (is_float ==
false) {
5389 data->dragf += (
float(mx - data->draglastx) / deler) * non_linear_scale;
5391 if (but->
softmin == softmin) {
5394 if (but->
softmax == softmax) {
5398 data->draglastx = mx;
5400 switch (scale_type) {
5402 tempf = (softmin + data->dragf * softrange);
5408 const float base = softmax / log_min;
5409 tempf =
powf(base, data->dragf) * log_min;
5410 if (tempf <= log_min) {
5416 tempf = (softmin + data->dragf * softrange);
5417 tempf *= tempf * tempf;
5418 float cubic_min = softmin * softmin * softmin;
5419 float cubic_max = softmax * softmax * softmax;
5420 tempf = (tempf - cubic_min) / (cubic_max - cubic_min) * softrange + softmin;
5431 lvalue =
int(data->value);
5433 if (temp != lvalue) {
5434 data->dragchange =
true;
5435 data->value =
double(temp);
5445 if (tempf !=
float(data->value)) {
5446 data->dragchange =
true;
5447 data->value = tempf;
5467 if (data->dragchange ==
false) {
5472 int mx = data->window->eventstate->xy[0];
5473 int my = data->window->eventstate->xy[1];
5476 if (mx < (but->
rect.
xmin + handle_width)) {
5479 else if (mx > (but->
rect.
xmax - handle_width)) {
5487 if (data->changed_cursor) {
5489 data->changed_cursor =
false;
5493 if (data->changed_cursor ==
false) {
5495 data->changed_cursor =
true;
5513 int mx =
event->xy[0];
5514 int my =
event->xy[1];
5516 const int screen_mx =
event->xy[0];
5524 int type =
event->type, val =
event->val;
5537 but->
drawflag &= ~UI_BUT_HOVER_RIGHT;
5543 but->
drawflag &= ~UI_BUT_HOVER_LEFT;
5567 data->value = -data->value;
5572#ifdef USE_DRAG_MULTINUM
5580 data->cancel =
true;
5581 data->escapecancel =
true;
5586 if (data->dragchange) {
5587#ifdef USE_DRAG_MULTINUM
5603 const bool is_motion = (
event->type ==
MOUSEMOVE);
5607#ifdef USE_DRAG_MULTINUM
5608 data->multi_data.drag_dir[0] +=
abs(data->draglastx - mx);
5609 data->multi_data.drag_dir[1] +=
abs(data->draglasty - my);
5626#ifdef USE_DRAG_MULTINUM
5627 else if (data->multi_data.has_mbuts) {
5659 double(
max_ii(softmin,
int(data->value) - value_step)) :
5660 double(
min_ii(softmax,
int(data->value) + value_step));
5661 if (value_test != data->value) {
5662 data->value =
double(value_test);
5665 data->cancel =
true;
5685 if (
UNLIKELY(!isfinite(precision))) {
5694 const double value_test =
5696 double(
max_ff(but->
softmin,
float(data->value - value_step))) :
5698 if (value_test != data->value) {
5699 data->value = value_test;
5702 data->cancel =
true;
5714 data->draglastx = mx;
5715 data->draglasty = my;
5723 const bool is_horizontal,
5724 const bool is_motion,
5729 float cursor_x_range, f, tempf, softmin, softmax, softrange;
5731 bool changed =
false;
5748 softrange = softmax - softmin;
5767 f = (mx_fl - data->dragstartx) / cursor_x_range + data->dragfstart;
5768 CLAMP(f, 0.0f, 1.0f);
5771#ifdef USE_CONT_MOUSE_CORRECT
5774 if (is_horizontal) {
5775 data->ungrab_mval[0] = but->
rect.
xmin + (f * cursor_x_range);
5779 data->ungrab_mval[1] = but->
rect.
ymin + (f * cursor_x_range);
5787 switch (scale_type) {
5789 tempf = softmin + f * softrange;
5793 tempf =
powf(softmax / softmin, f) * softmin;
5797 const float cubicmin =
cube_f(softmin);
5798 const float cubicmax =
cube_f(softmax);
5799 const float cubicrange = cubicmax - cubicmin;
5800 tempf =
cube_f(softmin + f * softrange);
5801 tempf = (tempf - cubicmin) / cubicrange * softrange + softmin;
5808 if (
ELEM(tempf, softmin, softmax)) {
5814 if (
ELEM(tempf, softmin, softmax)) {
5816 else if (softrange < 2.10f) {
5817 tempf = roundf(tempf * 100.0f) * 0.01f;
5819 else if (softrange < 21.0f) {
5820 tempf = roundf(tempf * 10.0f) * 0.1f;
5823 tempf = roundf(tempf);
5827 if (softrange < 2.10f) {
5828 tempf = roundf(tempf * 10.0f) * 0.1f;
5830 else if (softrange < 21.0f) {
5831 tempf = roundf(tempf);
5834 tempf = roundf(tempf * 0.1f) * 10.0f;
5839 temp = 10 * (temp / 10);
5845 lvalue = round(data->value);
5847 CLAMP(temp, softmin, softmax);
5849 if (temp != lvalue) {
5851 data->dragchange =
true;
5856 CLAMP(tempf, softmin, softmax);
5858 if (tempf !=
float(data->value)) {
5859 data->value = tempf;
5860 data->dragchange =
true;
5874 int mx =
event->xy[0];
5875 int my =
event->xy[1];
5879 int type =
event->type, val =
event->val;
5903#ifndef USE_ALLSELECT
5918 data->dragstartx = mx;
5919 data->draglastx = mx;
5928 data->value = -data->value;
5933#ifdef USE_DRAG_MULTINUM
5940 data->cancel =
true;
5941 data->escapecancel =
true;
5946 if (data->dragchange) {
5947#ifdef USE_DRAG_MULTINUM
5959#ifdef USE_CONT_MOUSE_CORRECT
5967 const bool is_motion = (
event->type ==
MOUSEMOVE);
5968#ifdef USE_DRAG_MULTINUM
5969 data->multi_data.drag_dir[0] +=
abs(data->draglastx - mx);
5970 data->multi_data.drag_dir[1] +=
abs(data->draglasty - my);
5983#ifdef USE_DRAG_MULTINUM
5984 else if (data->multi_data.has_mbuts) {
6007 float f, tempf, softmin, softmax, softrange;
6014 softrange = softmax - softmin;
6016 tempf = data->value;
6017 temp =
int(data->value);
6020 if (but->
type == SLI) {
6031 f =
powf(softmax / softmin, f) * softmin;
6034 f = softmin + f * softrange;
6046 if (temp >= softmin && temp <= softmax) {
6050 data->cancel =
true;
6054 if (tempf >= softmin && tempf <= softmax) {
6064 tempf -= value_step;
6067 tempf += value_step;
6070 CLAMP(tempf, softmin, softmax);
6071 data->value = tempf;
6074 data->cancel =
true;
6088 data->draglastx = mx;
6089 data->draglasty = my;
6100 int mx =
event->xy[0];
6101 int my =
event->xy[1];
6108 data->dragstartx = mx;
6109 data->draglastx = mx;
6112 data->dragstartx = my;
6113 data->draglastx = my;
6123 data->cancel =
true;
6124 data->escapecancel =
true;
6132 const bool is_motion =
true;
6134 but, data, (horizontal) ? mx : my, horizontal, is_motion,
false,
false))
6162 int mx =
event->xy[0];
6163 int my =
event->xy[1];
6169 data->dragstartx =
event->xy[0];
6170 data->dragstarty =
event->xy[1];
6179 data->cancel =
true;
6180 data->escapecancel =
true;
6188 int dragstartx = data->dragstartx;
6189 int dragstarty = data->dragstarty;
6191 data->value = data->origvalue + (horizontal ? mx - dragstartx : dragstarty - my);
6234 data->dragstartx =
event->xy[0];
6235 data->dragstarty =
event->xy[1];
6239#ifdef USE_DRAG_TOGGLE
6242 data->dragstartx =
event->xy[0];
6243 data->dragstarty =
event->xy[1];
6255 int type =
event->type;
6256 int val =
event->val;
6282 data->postbut = but;
6309 data->cancel =
true;
6326 bool changed =
true;
6334 float *fp = data->origvec;
6336 const float radsq = rad * rad;
6340 mdx = (rad * fp[0]);
6341 mdy = (rad * fp[1]);
6343 else if (fp[2] > -1.0f) {
6344 mrad = rad /
sqrtf(fp[0] * fp[0] + fp[1] * fp[1]);
6346 mdx = 2.0f * mrad * fp[0] - (rad * fp[0]);
6347 mdy = 2.0f * mrad * fp[1] - (rad * fp[1]);
6353 float dx =
float(mx + mdx - data->dragstartx);
6354 float dy =
float(my + mdy - data->dragstarty);
6357 mrad = dx * dx + dy * dy;
6361 fp[2] =
sqrtf(radsq - dx * dx - dy * dy);
6365 mrad = rad /
sqrtf(mrad);
6367 dx *= (2.0f * mrad - 1.0f);
6368 dy *= (2.0f * mrad - 1.0f);
6370 mrad = dx * dx + dy * dy;
6374 fp[2] = -
sqrtf(radsq - dx * dx - dy * dy);
6380 const int snap_steps = (
snap ==
SNAP_ON) ? 4 : 12;
6381 const float snap_steps_angle =
M_PI / snap_steps;
6382 float angle, angle_snap;
6386 for (
int i = 0; i < 3; i++) {
6387 angle =
asinf(fp[i]);
6388 angle_snap = roundf(angle / snap_steps_angle) * snap_steps_angle;
6389 fp[i] =
sinf(angle_snap);
6392 changed = !
compare_v3v3(fp, data->origvec, FLT_EPSILON);
6395 data->draglastx = mx;
6396 data->draglasty = my;
6421 data->dragstartx =
event->xy[0];
6422 data->dragstarty =
event->xy[1];
6426#ifdef USE_DRAG_TOGGLE
6430 data->dragstartx =
event->xy[0];
6431 data->dragstarty =
event->xy[1];
6443 float hsv_static[3] = {0.0f};
6451 hsv[2] =
clamp_f(hsv[2] - 0.05f, 0.0f, 1.0f);
6454 hsv[2] =
clamp_f(hsv[2] + 0.05f, 0.0f, 1.0f);
6457 const float fac = 0.005 * (
event->xy[1] -
event->prev_xy[1]);
6458 hsv[2] =
clamp_f(hsv[2] + fac, 0.0f, 1.0f);
6494 data->cancel =
true;
6503 if (paint !=
nullptr) {
6520 bool updated =
false;
6563 int mx =
event->xy[0];
6564 int my =
event->xy[1];
6570 data->dragstartx = mx;
6571 data->dragstarty = my;
6572 data->draglastx = mx;
6573 data->draglasty = my;
6586 if (mx != data->draglastx || my != data->draglasty || event->
type !=
MOUSEMOVE) {
6595 data->cancel =
true;
6596 data->escapecancel =
true;
6614 const float v_max =
max_fff(
v[0],
v[1],
v[2]);
6678 const bool changed =
true;
6682#ifdef USE_CONT_MOUSE_CORRECT
6685 data->ungrab_mval[0] = mx_fl;
6686 data->ungrab_mval[1] = my_fl;
6699 float xpos, ypos, hsvo[3];
6714 mx_fl = xpos - (data->dragstartx - mx_fl);
6715 my_fl = ypos - (data->dragstarty - my_fl);
6721 CLAMP(x, 0.0f, 1.0f);
6722 CLAMP(y, 0.0f, 1.0f);
6753 hsv[2] = y * (max -
min) +
min;
6777 data->draglastx = mx;
6778 data->draglasty = my;
6783#ifdef WITH_INPUT_NDOF
6784static void ui_ndofedit_but_HSVCUBE(
uiButHSVCube *hsv_but,
6786 const wmNDOFMotionData *ndof,
6794 const float sensitivity = (shift ? 0.15f : 0.3f) * ndof->dt;
6800 switch (hsv_but->gradient_type) {
6802 hsv[1] += ndof->rvec[2] * sensitivity;
6803 hsv[2] += ndof->rvec[0] * sensitivity;
6806 hsv[0] += ndof->rvec[2] * sensitivity;
6807 hsv[2] += ndof->rvec[0] * sensitivity;
6810 hsv[0] += ndof->rvec[2] * sensitivity;
6811 hsv[1] += ndof->rvec[0] * sensitivity;
6814 hsv[0] += ndof->rvec[2] * sensitivity;
6817 hsv[1] += ndof->rvec[2] * sensitivity;
6820 hsv[2] += ndof->rvec[2] * sensitivity;
6827 hsv[2] += ndof->rvec[0] * sensitivity;
6829 CLAMP(hsv[2], hsv_but->softmin, hsv_but->softmax);
6857 int mx =
event->xy[0];
6858 int my =
event->xy[1];
6865 data->dragstartx = mx;
6866 data->dragstarty = my;
6867 data->draglastx = mx;
6868 data->draglasty = my;
6878#ifdef WITH_INPUT_NDOF
6880 const wmNDOFMotionData *ndof =
static_cast<const wmNDOFMotionData *
>(
event->customdata);
6900 float rgb[3], def_hsv[3];
6911 def_hsv[0] = hsv[0];
6912 def_hsv[1] = hsv[1];
6926 data->cancel =
true;
6927 data->escapecancel =
true;
6932 if (mx != data->draglastx || my != data->draglasty || event->
type !=
MOUSEMOVE) {
6957 const bool changed =
true;
6964#ifdef USE_CONT_MOUSE_CORRECT
6967 data->ungrab_mval[0] = mx_fl;
6968 data->ungrab_mval[1] = my_fl;
6972 const float len =
len_v2v2(cent, data->ungrab_mval);
6992 if (hsv[2] == 0.0f) {
6997 if (hsv[2] == 0.0f) {
7000 if (hsv[2] >= 0.9999f) {
7008 float xpos, ypos, hsvo[3], rgbo[3];
7019 mx_fl = xpos - (data->dragstartx - mx_fl);
7020 my_fl = ypos - (data->dragstarty - my_fl);
7026 hsv[1] = 1.0f -
sqrt3f(1.0f - hsv[1]);
7044 data->draglastx = mx;
7045 data->draglasty = my;
7050#ifdef WITH_INPUT_NDOF
7051static void ui_ndofedit_but_HSVCIRCLE(
uiBut *but,
7053 const wmNDOFMotionData *ndof,
7061 const float sensitivity = (shift ? 0.06f : 0.3f) * ndof->dt;
7073 v[0] = r *
cosf(phi);
7074 v[1] = r *
sinf(phi);
7077 v[0] += ndof->rvec[2] * sensitivity;
7078 v[1] += ndof->rvec[0] * sensitivity;
7084 phi += ndof->rvec[1] * sensitivity * 0.5f;
7093 if (cpicker->use_color_lock) {
7095 if (hsv[2] == 0.0f) {
7100 if (hsv[2] == 0.0f) {
7103 if (hsv[2] == 1.0f) {
7117 if (cpicker->use_luminosity_lock) {
7133 int mx =
event->xy[0];
7134 int my =
event->xy[1];
7140 data->dragstartx = mx;
7141 data->dragstarty = my;
7142 data->draglastx = mx;
7143 data->draglasty = my;
7153#ifdef WITH_INPUT_NDOF
7156 const wmNDOFMotionData *ndof =
static_cast<const wmNDOFMotionData *
>(
event->customdata);
7174 float rgb[3], def_hsv[3];
7175 float *def =
static_cast<float *
>(
MEM_callocN(
sizeof(
float) *
len, __func__));
7183 def_hsv[0] = hsv[0];
7184 def_hsv[2] = hsv[2];
7199 data->cancel =
true;
7200 data->escapecancel =
true;
7206 hsv[2] =
clamp_f(hsv[2] - 0.05f, 0.0f, 1.0f);
7211 hsv[2] =
clamp_f(hsv[2] + 0.05f, 0.0f, 1.0f);
7216 if (mx != data->draglastx || my != data->draglasty || event->
type !=
MOUSEMOVE) {
7235 bool changed =
false;
7237 if (data->draglastx == mx) {
7241 if (data->coba->tot == 0) {
7246 data->dragcbd->pos += dx;
7247 CLAMP(data->dragcbd->pos, 0.0f, 1.0f);
7250 data->dragcbd = data->coba->data + data->coba->cur;
7252 data->draglastx = mx;
7261 int mx =
event->xy[0];
7262 int my =
event->xy[1];
7280 data->dragstartx = mx;
7281 data->dragstarty = my;
7282 data->draglastx = mx;
7283 data->draglasty = my;
7287 for (a = 0, cbd = coba->
data; a < coba->
tot; a++, cbd++) {
7289 xco =
abs(xco - mx);
7290 if (a == coba->
cur) {
7294 if (xco < mindist) {
7300 data->dragcbd = coba->
data + coba->
cur;
7301 data->dragfstart = data->dragcbd->pos;
7310 if (mx != data->draglastx || my != data->draglasty) {
7321 data->dragcbd->pos = data->dragfstart;
7323 data->cancel =
true;
7324 data->escapecancel =
true;
7345 bool changed =
false;
7352 int dragx = data->draglastx;
7353 int dragy = data->draglasty;
7362 d[0] = mx - data->dragstartx;
7363 d[1] = my - data->dragstarty;
7370 float fx = (mx - dragx) / zoomx;
7371 float fy = (my - dragy) / zoomy;
7373 if (data->dragsel != -1) {
7376 bool moved_point =
false;
7381 for (
int a = 0; a < cuma->
totpoint; a++) {
7383 const float origx = cmp[a].
x, origy = cmp[a].
y;
7387 cmp[a].
x = 0.125f * roundf(8.0f * cmp[a].x);
7388 cmp[a].
y = 0.125f * roundf(8.0f * cmp[a].y);
7390 if (cmp[a].x != origx || cmp[a].y != origy) {
7401 data->draglastx = evtx;
7402 data->draglasty = evty;
7405#ifdef USE_CONT_MOUSE_CORRECT
7410 data->ungrab_mval[0] = but->
rect.
xmin + ((cmp_last->
x - cumap->
curr.
xmin) * zoomx);
7411 data->ungrab_mval[1] = but->
rect.
ymin + ((cmp_last->
y - cumap->
curr.
ymin) * zoomy);
7417 data->dragchange =
true;
7422 if (cumap->
curr.
xmin - fx < cumap->clipr.xmin) {
7428 if (cumap->
curr.
ymin - fy < cumap->clipr.ymin) {
7441 data->draglastx = evtx;
7442 data->draglasty = evty;
7453 bool changed =
false;
7457 int mx =
event->xy[0];
7458 int my =
event->xy[1];
7465 const float m_xy[2] = {
float(mx),
float(my)};
7480 for (
int a = 0; a < cuma->
totpoint; a++) {
7484 if (dist_sq < dist_min_sq) {
7486 dist_min_sq = dist_sq;
7491 float f_xy[2], f_xy_prev[2];
7503 for (
int i = 1; i <=
CM_TABLE; i++) {
7520 for (
int a = 0; a < cuma->
totpoint; a++) {
7521 if (cmp[a].x == f_xy[0]) {
7534 for (
int a = 0; a < cuma->
totpoint; a++) {
7535 cmp[a].
flag &= ~CUMA_SELECT;
7545 data->cancel =
true;
7548 data->dragsel = sel;
7550 data->dragstartx =
event->xy[0];
7551 data->dragstarty =
event->xy[1];
7552 data->draglastx =
event->xy[0];
7553 data->draglasty =
event->xy[1];
7561 if (event->
xy[0] != data->draglastx || event->
xy[1] != data->draglasty) {
7576 if (data->dragsel != -1) {
7581 if (data->dragchange ==
false) {
7584 for (
int a = 0; a < cuma->
totpoint; a++) {
7585 cmp[a].
flag &= ~CUMA_SELECT;
7619 bool changed =
false;
7626 int dragx = data->draglastx;
7627 int dragy = data->draglasty;
7634 const float d[2] = {
float(mx - data->dragstartx),
float(data->dragstarty)};
7640 float fx = (mx - dragx) / zoomx;
7641 float fy = (my - dragy) / zoomy;
7643 if (data->dragsel != -1) {
7644 float last_x, last_y;
7646 bool moved_point =
false;
7652 const float delta[2] = {fx, fy};
7653 for (
int a = 0; a < profile->path_len; a++) {
7664 last_x = pts[a].
h1_loc[0];
7665 last_y = pts[a].
h1_loc[1];
7669 last_x = pts[a].
h2_loc[0];
7670 last_y = pts[a].
h2_loc[1];
7678 data->draglastx = evtx;
7679 data->draglasty = evty;
7681#ifdef USE_CONT_MOUSE_CORRECT
7686 data->ungrab_mval[0] = but->
rect.
xmin + ((last_x - profile->view_rect.xmin) * zoomx);
7687 data->ungrab_mval[1] = but->
rect.
ymin + ((last_y - profile->view_rect.ymin) * zoomy);
7692 data->dragchange =
true;
7697 if (profile->view_rect.xmin - fx < profile->clip_rect.xmin) {
7698 fx = profile->view_rect.xmin - profile->clip_rect.xmin;
7700 else if (profile->view_rect.xmax - fx > profile->clip_rect.xmax) {
7701 fx = profile->view_rect.xmax - profile->clip_rect.xmax;
7703 if (profile->view_rect.ymin - fy < profile->clip_rect.ymin) {
7704 fy = profile->view_rect.ymin - profile->clip_rect.ymin;
7706 else if (profile->view_rect.ymax - fy > profile->clip_rect.ymax) {
7707 fy = profile->view_rect.ymax - profile->clip_rect.ymax;
7711 profile->view_rect.xmin -= fx;
7712 profile->view_rect.ymin -= fy;
7713 profile->view_rect.xmax -= fx;
7714 profile->view_rect.ymax -= fy;
7716 data->draglastx = evtx;
7717 data->draglasty = evty;
7743 int mx =
event->xy[0];
7744 int my =
event->xy[1];
7750 data->dragstartx = mx;
7751 data->dragstarty = my;
7752 data->draglastx = mx;
7753 data->draglasty = my;
7769 const float m_xy[2] = {
float(mx),
float(my)};
7783 int i_selected = -1;
7784 short selection_type = 0;
7785 for (
int i = 0; i < profile->path_len; i++) {
7789 if (dist_sq < dist_min_sq) {
7792 dist_min_sq = dist_sq;
7800 if (dist_sq < dist_min_sq) {
7803 dist_min_sq = dist_sq;
7809 if (dist_sq < dist_min_sq) {
7812 dist_min_sq = dist_sq;
7819 if (i_selected == -1) {
7820 float f_xy[2], f_xy_prev[2];
7838 i_selected =
int(new_pt - profile->path);
7839 BLI_assert(i_selected >= 0 && i_selected <= profile->path_len);
7847 if (i_selected != -1) {
7850 pts[i_selected].
flag ^= selection_type;
7853 for (
int i = 0; i < profile->path_len; i++) {
7857 profile->path[i_selected].flag |= selection_type;
7862 data->cancel =
true;
7865 data->dragsel = i_selected;
7867 data->dragstartx = mx;
7868 data->dragstarty = my;
7869 data->draglastx = mx;
7870 data->draglasty = my;
7878 if (mx != data->draglastx || my != data->draglasty) {
7888 if (data->dragsel != -1) {
7890 if (data->dragchange ==
false) {
7909 const bool changed =
true;
7910 const float dy = my - data->draglasty;
7914 hist->
ymax += (dy * 0.1f) * yfac;
7919 data->draglastx = mx;
7920 data->draglasty = my;
7928 int mx =
event->xy[0];
7929 int my =
event->xy[1];
7934 data->dragstartx = mx;
7935 data->dragstarty = my;
7936 data->draglastx = mx;
7937 data->draglasty = my;
7959 data->cancel =
true;
7960 data->escapecancel =
true;
7965 if (mx != data->draglastx || my != data->draglasty) {
7983 const bool changed =
true;
7985 const float dy = my - data->draglasty;
7992 data->draglastx = mx;
7993 data->draglasty = my;
8001 int mx =
event->xy[0];
8002 int my =
event->xy[1];
8007 data->dragstartx = mx;
8008 data->dragstarty = my;
8009 data->draglastx = mx;
8010 data->draglasty = my;
8032 data->cancel =
true;
8033 data->escapecancel =
true;
8038 if (mx != data->draglastx || my != data->draglasty) {
8057 const bool changed =
true;
8059 float dx = mx - data->draglastx;
8060 float dy = my - data->draglasty;
8083 data->draglastx = mx;
8084 data->draglasty = my;
8092 int mx =
event->xy[0];
8093 int my =
event->xy[1];
8098 data->dragstartx = mx;
8099 data->dragstarty = my;
8100 data->draglastx = mx;
8101 data->draglasty = my;
8115 data->cancel =
true;
8116 data->escapecancel =
true;
8121 if (mx != data->draglastx || my != data->draglasty) {
8152 bool is_press_ctrl_but_no_shift = (
event->val ==
KM_PRESS) &&
8155 const bool do_copy =
event->type ==
EVT_CKEY && is_press_ctrl_but_no_shift;
8156 const bool do_paste =
event->type ==
EVT_VKEY && is_press_ctrl_but_no_shift;
8187 if (clicked_view_item_but) {
8201#ifdef WITH_INPUT_NDOF
8239 switch (but->
type) {
8353#ifdef USE_DRAG_MULTINUM
8370 if (
len_squared_v2(data->multi_data.drag_dir) > (margin_y * margin_y)) {
8371 const float dir_nor_y[2] = {0.0, 1.0f};
8372 float dir_nor_drag[2];
8378 data->multi_data.drag_lock_x =
event->xy[0];
8389 if ((data->text_edit.edit_string &&
8391 ((
abs(data->multi_data.drag_lock_x - event->
xy[0]) > margin_x) &&
8395 if (data->multi_data.has_mbuts) {
8432 block->tooltipdisabled = !enable;
8441 if (screen->tool_tip && screen->tool_tip->region) {
8451 if (data->autoopentimer) {
8453 data->autoopentimer =
nullptr;
8463 bContext *C,
ARegion *region,
int *pass,
double *r_pass_delay,
bool *r_exit_on_event)
8465 bool is_label =
false;
8473 *r_exit_on_event =
false;
8500 if (screen->tool_tip) {
8501 screen->tool_tip->pass = 1;
8529 if (data->state ==
state) {
8535 but->
flag &= ~UI_SELECT;
8546 if (data->used_mouse && !data->autoopentimer) {
8555 time = 5 *
U.menuthreshold2;
8558 time = 5 *
U.menuthreshold1;
8566 data->wm, data->window,
TIMER, 0.02 *
double(time));
8602 status.
item(
" ", ICON_NONE);
8619 "Can't edit driven number value, see driver editor for the driver setup");
8625#ifdef USE_CONT_MOUSE_CORRECT
8628 int mouse_ungrab_xy[2];
8630 data->region, but->
block, &data->ungrab_mval[0], &data->ungrab_mval[1]);
8631 mouse_ungrab_xy[0] = data->ungrab_mval[0];
8632 mouse_ungrab_xy[1] = data->ungrab_mval[1];
8656 else if (data->flashtimer) {
8658 data->flashtimer =
nullptr;
8666 else if (data->hold_action_timer) {
8668 data->hold_action_timer =
nullptr;
8677 &data->window->modalhandlers,
8695 but->
flag &= ~UI_SELECT;
8708 data->state =
state;
8743 data->region = region;
8745#ifdef USE_CONT_MOUSE_CORRECT
8754 data->interactive =
true;
8775 data->used_mouse =
true;
8783 if (data->menu && data->menu->region) {
8784 ARegion *subar = data->menu->region;
8817 if (screen->tool_tip) {
8818 screen->tool_tip->pass = 1;
8844#ifdef USE_DRAG_MULTINUM
8845 if (data->multi_data.has_mbuts) {
8848 bt->flag &= ~UI_BUT_DRAG_MULTI;
8850 if (!data->cancel) {
8864 if (!data->cancel || data->escapecancel) {
8873 if (!onfree && !data->cancel) {
8881 uiBut but_temp = *but;
8883 for (
int i = 0; i < selctx_data->
elems_len; i++) {
8885 but_temp.
rnapoin = other->ptr;
8896 if (
U.runtime.is_dirty ==
false) {
8904 bt->flag &= ~UI_BUT_LAST_ACTIVE;
8907 block_iter->tooltipdisabled =
true;
8913 if (data->text_edit.edit_string) {
8916 if (data->text_edit.original_string) {
8917 MEM_freeN(data->text_edit.original_string);
8924 if (data->changed_cursor) {
8933 if (data->custom_interaction_handle !=
nullptr) {
8936 data->custom_interaction_handle->user_count--;
8938 BLI_assert(data->custom_interaction_handle->user_count >= 0);
8939 if (data->custom_interaction_handle->user_count == 0) {
8943 data->custom_interaction_handle =
nullptr;
8987 [&]() { ui_but_active_free(C, but); });
8993 uiBut *but_found =
nullptr;
9001 uiBut *active_but_override =
nullptr;
9002 uiBut *active_but_real =
nullptr;
9003 uiBut *active_but_last =
nullptr;
9009 active_but_override = but;
9012 active_but_real = but;
9015 active_but_last = but;
9020 uiBut *activebut = active_but_override;
9022 activebut = active_but_real;
9025 activebut = active_but_last;
9028 if (activebut && (but_check_cb ==
nullptr || but_check_cb(activebut))) {
9031 but_found = activebut;
9034 if (data && data->menu && (region != data->menu->region)) {
9035 region = data->menu->region;
9104 region_popup ? region_popup :
CTX_wm_region(C), r_ptr, r_prop, r_index);
9136 if (region_ctx ==
nullptr) {
9142 if (block->ui_operator) {
9143 return block->ui_operator;
9152 if (region == region_ctx) {
9156 if (block->ui_operator) {
9157 return block->ui_operator;
9178 depsgraph, (scene) ? scene->r.cfra : 0.0f);
9182 uiBut *activebut =
nullptr;
9206 if (data && data->menu) {
9223 if (!active_but || !active_but->
active || !active_but->
changed || active_but->
block != block) {
9229 if (data->searchbox) {
9257 const bool labeledit =
event->modifier &
KM_CTRL;
9261 const bool for_tooltip =
true;
9263 region, event->
xy, labeledit, for_tooltip,
nullptr,
nullptr);
9300 event.customdata = but;
9301 event.customdata_free =
false;
9318 *active_back = but->
active;
9319 data = MEM_cnew<uiHandleButtonData>(__func__);
9322 data->region = region;
9371 printf(
"%s: error, unhandled type: %d\n", __func__, but->
type);
9397 if (prev_active_but) {
9398 prev_active_but->
active =
nullptr;
9414 if (prev_active_but) {
9415 prev_active_but->
active = prev_active_data;
9451 double default_value;
9472 *r_value = default_value;
9485 ARegion *region = data->region;
9490 switch (event->
type) {
9493 data->cancel =
true;
9496#ifdef USE_UI_POPOVER_ONCE
9502 data->cancel =
false;
9537 data->cancel =
true;
9553 if (event->
customdata == data->autoopentimer) {
9555 data->autoopentimer =
nullptr;
9580 switch (event->
type) {
9582 data->cancel =
true;
9587 if (event->
customdata == data->hold_action_timer) {
9589 data->cancel =
true;
9597 data->hold_action_timer =
nullptr;
9610 if (data->hold_action_timer) {
9626 data->cancel =
false;
9633 data->cancel =
true;
9648 switch (event->
type) {
9661 switch (event->
type) {
9665 if (data->menu && data->menu->region) {
9673 if (bt && bt->
active != data) {
9675 data->cancel =
true;
9684 if (bt && bt->
active == data) {
9703 uiBut *post_but = data->postbut;
9707 if ((data->cancel ==
false) && (data->text_edit.edit_string !=
nullptr) &&
9708 (data->text_edit.edit_string[0] ==
'\0') &&
9714#ifdef USE_DRAG_MULTINUM
9715 if (data->multi_data.mbuts) {
9719 double default_value;
9726 data->multi_data.skip =
true;
9769 bool activate_dragging)
9793 if (activate_dragging && do_drag) {
9794 ((
uiList *)ui_list)->dyn_data->custom_activate_optype =
nullptr;
9801 ((
uiList *)ui_list)->dyn_data->custom_activate_optype = custom_activate_optype;
9817 region, mouse_xy,
false,
false,
nullptr,
nullptr);
9819 if (list->dyn_data->custom_drag_optype) {
9841 bool activate_dragging =
false;
9845 activate_dragging =
true;
9868 if (new_active_row) {
9911 int type =
event->type, val =
event->val;
9913 bool redraw =
false;
9916 if (!ui_list || !ui_list->
dyn_data) {
9921 int mx =
event->xy[0];
9922 int my =
event->xy[1];
9959 int *org_order =
static_cast<int *
>(
9963 int current_idx = -1;
9965 for (
int i = 0; i <
len; i++) {
9967 org_order[new_order ? new_order[++org_idx] : ++org_idx] = i;
9969 current_idx = new_order ? new_order[org_idx] : org_idx;
9972 else if (i == value && org_idx >= 0) {
9973 current_idx = -(new_order ? new_order[org_idx] : org_idx) - 1;
9980 if (current_idx < 0) {
9981 current_idx = (current_idx * -1) + (inc < 0 ? inc : inc - 1);
9987 value = org_order[current_idx];
9999 if (value != value_orig) {
10040 const bool has_view = [&]() {
10049 if (!has_view && !has_list) {
10055 uiBut *highlight_row_but = [&]() ->
uiBut * {
10068 bool changed =
false;
10070 if (highlight_row_but && !(highlight_row_but->
flag &
UI_HOVER)) {
10077 if (but == highlight_row_but) {
10085 but->
flag &= ~UI_HOVER;
10103 switch (event->
type) {
10120 const bool close_popup = view_but == active_but;
10159 if (data->interactive) {
10172 data->cancel =
true;
10188 data->cancel =
true;
10245 const bool use_wiggle_room)
10256 uiBlock *block_iter =
static_cast<uiBlock *
>(region->uiblocks.first);
10260 }
while ((region = region->next));
10282 const float p1[2] = {rect_px.
xmin - margin, rect_px.
ymin - margin};
10283 const float p2[2] = {rect_px.
xmax + margin, rect_px.
ymin - margin};
10284 const float p3[2] = {rect_px.
xmax + margin, rect_px.
ymax + margin};
10285 const float p4[2] = {rect_px.
xmin - margin, rect_px.
ymax + margin};
10289 if (use_wiggle_room) {
10314#ifdef USE_KEYNAV_LIMIT
10369 ymax =
max_ff(ymax, bt->rect.ymax);
10372 dy = block->
rect.
ymax - ymax - scroll_pad;
10379 ymin =
min_ff(ymin, bt->rect.ymin);
10382 dy = block->
rect.
ymin - ymin + scroll_pad;
10393 bt->rect.ymin += dy;
10394 bt->rect.ymax += dy;
10432 else if (test ==
'b') {
10445 if (scroll_dir == 1) {
10451 else if (scroll_dir == -1) {
10474 block->auto_open =
false;
10490 const bool is_parent_menu,
10496 if ((level != 0) && (but ==
nullptr) && (is_parent_menu || menu->
popup ==
false)) {
10597 after->
opptr = MEM_new<PointerRNA>(__func__);
10603 if (num_bytes != -1) {
10604 char buf[
sizeof(
event->utf8_buf) + 1];
10605 memcpy(buf, event->
utf8_buf, num_bytes);
10606 buf[num_bytes] =
'\0';
10620 const bool is_parent_inside,
10621 const bool is_parent_menu,
10622 const bool is_floating)
10626 uiBlock *block =
static_cast<uiBlock *
>(region->uiblocks.first);
10630 int mx =
event->xy[0];
10631 int my =
event->xy[1];
10637 const bool inside_title = inside && ((my + (
UI_UNIT_Y * 1.4f)) > block->
rect.
ymax);
10642#ifdef USE_DRAG_POPUP
10644# if defined(__APPLE__)
10654 if (!menu->
is_grab && is_floating) {
10665 else if (win->
cursor == PopupTitleHoverCursor) {
10730 switch (event->
type) {
10738 if (inside ==
false) {
10771 menu, but, level, is_parent_menu, retval))
10803 const float dy =
event->xy[1] -
event->prev_xy[1];
10824 const int scroll_dir = (
event->type ==
WHEELUPMOUSE) ? 1 : -1;
10847 int type =
event->type;
10848 int val =
event->val;
10873 menu, but, level, is_parent_menu, retval))
10878#ifdef USE_KEYNAV_LIMIT
10901 uiBut *but_wrap =
nullptr;
10986 menu, but, level, is_parent_menu, retval))
11092 if ((level != 0) && (but ==
nullptr || !menu->
menu_idname[0])) {
11103 menu, but, level, is_parent_menu, retval))
11136 if ((inside ==
false) && (menu->
menuretval == 0)) {
11176#ifdef USE_KEYNAV_LIMIT
11191 if ((but_default !=
nullptr) && (but_default->
active ==
nullptr)) {
11205 if (but_active ==
nullptr) {
11210#ifdef USE_DRAG_POPUP
11212 (inside && is_floating && inside_title))
11237 saferct = saferct->
next)
11284#ifdef USE_UI_POPOVER_ONCE
11288 block->
flag &= ~UI_BLOCK_POPOVER_ONCE;
11315 uiBlock *block =
static_cast<uiBlock *
>(region->uiblocks.first);
11374 if (!force_close) {
11416 if (but ==
nullptr) {
11444 uiBlock *block =
static_cast<uiBlock *
>(region->uiblocks.first);
11473 if (duration > 0.01 *
U.pie_initial_timeout) {
11479 const double final_time = 0.01 *
U.pie_animation_timeout;
11480 float fac = duration / final_time;
11495 center[0] = (vec[0] > 0.01f) ? 0.5f : ((vec[0] < -0.01f) ? -0.5f : 0.0f);
11496 center[1] = (vec[1] > 0.99f) ? 0.5f : ((vec[1] < -0.99f) ? -0.5f : 0.0f);
11526 if (len_sq < 1.0f) {
11555 if (but && (
U.pie_menu_confirm > 0) &&
11556 (dist >=
UI_SCALE_FAC * (
U.pie_menu_threshold +
U.pie_menu_confirm)))
11569 switch (event->
type) {
11571 if (!is_click_style) {
11581 if ((
U.pie_menu_confirm > 0) &&
11582 (dist >=
UI_SCALE_FAC * (
U.pie_menu_threshold +
U.pie_menu_confirm)))
11597 if (is_click_style) {
11650#define CASE_NUM_TO_DIR(n, d) \
11651 case (EVT_ZEROKEY + n): \
11652 case (EVT_PAD0 + n): { \
11653 if (num_dir == UI_RADIAL_NONE) { \
11679#undef CASE_NUM_TO_DIR
11694 const bool is_parent_inside,
11695 const bool is_parent_menu,
11696 const bool is_floating)
11699 bool do_towards_reinit =
false;
11709 bool inside =
false;
11715 if (do_recursion) {
11716 if (is_parent_inside ==
false) {
11717 int mx =
event->xy[0];
11718 int my =
event->xy[1];
11724 C, event, submenu, level + 1, is_parent_inside || inside, is_menu,
false);
11729 if (block->panel) {
11730 int mx =
event->xy[0];
11731 int my =
event->xy[1];
11733 if (!
IN_RANGE(
float(mx), block->rect.xmin, block->rect.xmax)) {
11773 if (do_but_search) {
11782 do_towards_reinit =
true;
11793 bool handled =
false;
11798 retval = retval_test;
11803 if (handled ==
false) {
11805 C, event, menu, level, is_parent_inside, is_parent_menu, is_floating);
11817 if (do_towards_reinit) {
11901 if (region ==
nullptr) {
11907 if (screen ==
nullptr) {
11923 BLI_assert(active_but->semi_modal_state ==
nullptr);
11990 if (data->menu && data->menu->menuretval) {
12043 bool reset_pie =
false;
12080#ifdef USE_DRAG_TOGGLE
12200 const void *rna_poin_data,
12201 const char *rna_prop_id)
12203 uiBlock *block_text =
nullptr;
12204 uiBut *but_text =
nullptr;
12211 block_text = block;
12238 uiBlock *block_text =
nullptr;
12239 uiBut *but_text =
nullptr;
12244 block_text = block;
12272 if (but->
active ==
nullptr) {
12290 if (data->menu ==
nullptr && data->searchbox ==
nullptr) {
12347 const bool is_click)
12352 int unique_retval_ids_len = 0;
12355 unique_retval_ids_len++;
12359 int *unique_retval_ids =
static_cast<int *
>(
12360 MEM_mallocN(
sizeof(*unique_retval_ids) * unique_retval_ids_len, __func__));
12361 unique_retval_ids_len = 0;
12364 unique_retval_ids[unique_retval_ids_len++] = but->
retval;
12368 if (unique_retval_ids_len > 1) {
12371 unique_retval_ids_len);
12372 unique_retval_ids =
static_cast<int *
>(
12373 MEM_reallocN(unique_retval_ids,
sizeof(*unique_retval_ids) * unique_retval_ids_len));
12382 return interaction;
12417 const bool is_click)
12419 if (data->custom_interaction_handle) {
12428 data->custom_interaction_handle = interaction;
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time) ATTR_WARN_UNUSED_RESULT
void BKE_brush_color_set(Scene *scene, const Paint *paint, Brush *brush, const float color[3])
void BKE_brush_tag_unsaved_changes(Brush *brush)
CBData * BKE_colorband_element_add(ColorBand *coba, float position)
void BKE_colorband_update_sort(ColorBand *coba)
ReportList * CTX_wm_reports(const bContext *C)
bScreen * CTX_wm_screen(const bContext *C)
MovieClip * CTX_data_edit_movieclip(const bContext *C)
ARegion * CTX_wm_region_popup(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
void CTX_store_set(bContext *C, const bContextStore *store)
void CTX_wm_area_set(bContext *C, ScrArea *area)
void CTX_wm_region_set(bContext *C, ARegion *region)
ARegion * CTX_wm_region(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
void CTX_wm_region_popup_set(bContext *C, ARegion *region_popup)
ViewLayer * CTX_data_view_layer(const bContext *C)
bool BKE_curveprofile_move_point(struct CurveProfile *profile, struct CurveProfilePoint *point, bool snap, const float delta[2])
void BKE_curveprofile_update(struct CurveProfile *profile, int update_flags)
@ PROF_UPDATE_REMOVE_DOUBLES
struct CurveProfilePoint * BKE_curveprofile_insert(struct CurveProfile *profile, float x, float y)
void BKE_curveprofile_copy_data(struct CurveProfile *target, const struct CurveProfile *profile)
bool BKE_curveprofile_move_handle(struct CurveProfilePoint *point, bool handle_1, bool snap, const float delta[2])
void BKE_curveprofile_remove_by_flag(struct CurveProfile *profile, short flag)
int BKE_curveprofile_table_size(const struct CurveProfile *profile)
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(Scene *scene, ViewLayer *view_layer, CurveMapping *curve)
void BKE_palette_color_remove(Palette *palette, PaletteColor *color)
Paint * BKE_paint_get_active_from_context(const bContext *C)
Brush * BKE_paint_brush(Paint *paint)
PaintMode BKE_paintmode_get_active_from_context(const bContext *C)
void BKE_report(ReportList *reports, eReportType 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)
float BLF_width(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
size_t BLF_str_offset_from_cursor_position(int fontid, const char *str, size_t str_len, int location_x) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
Generic array manipulation API.
#define BLI_array_deduplicate_ordered(arr, arr_len)
#define BLI_assert_msg(a, msg)
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)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(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)
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 cube_f(float a)
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])
void rgb_to_hsv_compat_v(const float rgb[3], float r_hsv[3])
void linearrgb_to_srgb_v3_v3(float srgb[3], const float linear[3])
void hsl_to_rgb_v(const float hsl[3], float r_rgb[3])
void hsv_clamp_v(float hsv[3], float v_max)
void srgb_to_linearrgb_v3_v3(float linear[3], const float srgb[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_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 void add_v2_v2v2_int(int r[2], const int a[2], const int b[2])
MINLINE float normalize_v2_length(float n[2], float unit_length)
MINLINE float len_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
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])
void dist_ensure_v2_v2fl(float v1[2], const float v2[2], float dist)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v2_v2(float r[2], const float a[2])
MINLINE int len_manhattan_v2v2_int(const int a[2], const int b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE bool compare_v3v3(const float v1[3], const float v2[3], float limit) ATTR_WARN_UNUSED_RESULT
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 bool is_zero_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float dot_v2v2(const float a[2], const float b[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 float normalize_v3_length(float n[3], float unit_length)
MINLINE float normalize_v3(float n[3])
MINLINE void copy_v2_fl(float r[2], float f)
bool BLI_rctf_clamp_pt_v(const struct rctf *rect, float xy[2])
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)
bool BLI_rctf_isect_pt(const 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)
int BLI_sortutil_cmp_int(const void *a_, const void *b_)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
#define STRNCPY(dst, src)
char * BLI_strdupn(const char *str, size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_str_rstrip_float_zero(char *str, char pad) ATTR_NONNULL(1)
size_t BLI_snprintf_rlen(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
size_t BLI_snprintf(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
bool BLI_str_cursor_step_prev_utf8(const char *str, int str_maxlen, int *pos)
void BLI_str_cursor_step_utf8(const char *str, int str_maxlen, int *pos, eStrCursorJumpDirection direction, eStrCursorJumpType jump, bool use_init_step)
void BLI_str_cursor_step_bounds_utf8(const char *str, int str_maxlen, int pos, int *r_start, int *r_end)
const char const char * BLI_str_find_next_char_utf8(const char *p, const char *str_end) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(1
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
size_t size_t BLI_strnlen_utf8(const char *strc, size_t strc_maxlen) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
size_t BLI_strlen_utf8(const char *strc) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
size_t BLI_strnlen_utf8_ex(const char *strc, size_t strc_maxlen, size_t *r_len_bytes) ATTR_NONNULL(1
int BLI_str_utf8_invalid_strip(char *str, size_t length) ATTR_NONNULL(1)
int BLI_str_utf8_size_or_error(const char *p) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Platform independent time functions.
double BLI_time_now_seconds(void)
#define IN_RANGE(a, b, c)
#define UNUSED_VARS_NDEBUG(...)
typedef double(DMatrix)[4][4]
@ UILST_SCROLL_TO_ACTIVE_ITEM
@ UILST_LAYOUT_BIG_PREVIEW_GRID
#define RGN_ALIGN_ENUM_FROM_MASK(align)
#define UI_LIST_AUTO_SIZE_THRESHOLD
@ RGN_TYPE_ASSET_SHELF_HEADER
@ USER_FLAG_RECENT_SEARCHES_DISABLE
void ED_region_tag_refresh_ui(ARegion *region)
#define ED_screen_areas_iter(win, screen, area_name)
void ED_region_tag_redraw_no_rebuild(ARegion *region)
void ED_workspace_status_text(bContext *C, const char *str)
void ED_region_tag_redraw(ARegion *region)
void ED_undo_push(bContext *C, const char *str)
bool ED_undo_is_legacy_compatible_for_property(bContext *C, ID *id)
GHOST C-API function and type declarations.
void GHOST_SetAutoFocus(bool auto_focus)
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
BLI_INLINE void IMB_colormanagement_srgb_to_scene_linear_v3(float scene_linear[3], const float srgb[3])
BLI_INLINE void IMB_colormanagement_scene_linear_to_srgb_v3(float srgb[3], const float scene_linear[3])
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
#define RNA_SUBTYPE_UNIT_VALUE(subtype)
constexpr PointerRNA PointerRNA_NULL
bool UI_view_item_can_rename(const blender::ui::AbstractViewItem &item)
void UI_region_views_clear_search_highlight(const ARegion *region)
void(*)(void *arg) uiFreeArgFunc
#define AUTOCOMPLETE_FULL_MATCH
@ UI_EMBOSS_NONE_OR_STATUS
ARegion * UI_tooltip_create_from_button_or_extra_icon(bContext *C, ARegion *butregion, uiBut *but, uiButExtraOpIcon *extra_icon, bool is_label)
@ UI_BLOCK_MOVEMOUSE_QUIT
void UI_blocklist_free(const bContext *C, ARegion *region)
void(*)(bContext *C, uiLayout *layout, void *arg1) uiMenuCreateFunc
@ UI_BUT2_FORCE_SEMI_MODAL_ACTIVE
@ UI_BUT2_ACTIVATE_ON_INIT_NO_SELECT
bool UI_view_item_popup_keep_open(const blender::ui::AbstractViewItem &item)
int UI_but_unit_type_get(const uiBut *but)
void(*)(bContext *C, void *arg, char *origstr) uiButHandleRenameFunc
bool UI_list_item_index_is_filtered_visible(const struct uiList *ui_list, int item_idx)
MenuType * UI_but_menutype_get(const uiBut *but)
bool UI_but_is_utf8(const uiBut *but)
#define AUTOCOMPLETE_NO_MATCH
#define UI_TOOLTIP_DELAY_LABEL
void UI_popover_once_clear(uiPopover *pup)
bool UI_view_item_drag_start(bContext &C, const blender::ui::AbstractViewItem &item)
#define UI_PRECISION_FLOAT_MAX
#define UI_PRECISION_FLOAT_SCALE
void(*)(void *argN) uiButArgNFree
void UI_but_execute(const bContext *C, ARegion *region, uiBut *but)
void UI_view_item_begin_rename(blender::ui::AbstractViewItem &item)
void(*)(bContext *C, void *arg, int event) uiBlockHandleFunc
const uiStyle * UI_style_get()
void UI_fontstyle_set(const uiFontStyle *fs)
PointerRNA * UI_but_operator_ptr_ensure(uiBut *but)
PanelType * UI_but_paneltype_get(const uiBut *but)
void UI_butstore_register(uiButStore *bs_handle, uiBut **but_p)
bool UI_block_layout_needs_resolving(const uiBlock *block)
uiButStore * UI_butstore_create(uiBlock *block)
bool UI_context_copy_to_selected_list(bContext *C, PointerRNA *ptr, PropertyRNA *prop, blender::Vector< PointerRNA > *r_lb, bool *r_use_path_from_id, std::optional< std::string > *r_path)
bool UI_but_active_only(const bContext *C, ARegion *region, uiBlock *block, uiBut *but)
void(*)(bContext *C, void *argN, void *arg2) uiButHandleNFunc
void(*)(bContext *C, void *arg1, void *arg2) uiButHandleFunc
bool UI_view_item_supports_drag(const blender::ui::AbstractViewItem &item)
void UI_popup_menu_close_from_but(const uiBut *but, bool is_cancel=false)
void UI_butstore_free(uiBlock *block, uiButStore *bs_handle)
void UI_but_ensure_in_view(const bContext *C, ARegion *region, const uiBut *but)
uiBlock *(*)(bContext *C, ARegion *region, void *arg1) uiBlockCreateFunc
bool UI_context_copy_to_selected_check(PointerRNA *ptr, PointerRNA *ptr_link, PropertyRNA *prop, const char *path, bool use_path_from_id, PointerRNA *r_ptr, PropertyRNA **r_prop)
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 btDbvtVolume bounds(btDbvtNode **leaves, int count)
void jump(const btVector3 &v=btVector3(0, 0, 0))
SIMD_FORCE_INLINE btScalar length() const
Return the length of the vector.
void item(std::string text, int icon1, int icon2=0)
void activate(bContext &C)
const Depsgraph * depsgraph
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
static void copy_array(const Node *node, const SocketType &socket, const Node *other, const SocketType &other_socket)
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_window_to_block(const ARegion *region, const uiBlock *block, int *x, int *y)
void ui_but_string_get_ex(uiBut *but, char *str, const size_t str_maxncpy, const int float_precision, const bool use_exp_float, bool *r_use_exp_float)
void ui_but_range_set_soft(uiBut *but)
void ui_but_update(uiBut *but)
int ui_but_is_pushed(uiBut *but)
bool ui_but_is_float(const uiBut *but)
PropertyScaleType ui_but_scale_type(const uiBut *but)
void ui_but_override_flag(Main *bmain, uiBut *but)
double ui_but_value_get(uiBut *but)
float ui_block_to_window_scale(const ARegion *region, const uiBlock *block)
void ui_but_string_get(uiBut *but, char *str, const size_t str_maxncpy)
void ui_region_to_window(const ARegion *region, int *x, int *y)
void ui_window_to_block_fl(const ARegion *region, const uiBlock *block, float *x, float *y)
bool ui_but_is_rna_valid(uiBut *but)
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)
char * ui_but_string_get_dynamic(uiBut *but, int *r_str_size)
void ui_block_to_window_rctf(const ARegion *region, const uiBlock *block, rctf *rct_dst, const rctf *rct_src)
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])
int ui_but_string_get_maxncpy(uiBut *but)
bool ui_but_string_eval_number(bContext *C, const uiBut *but, const char *str, double *r_value)
void ui_fontscale(float *points, float aspect)
void ui_block_to_window_fl(const ARegion *region, const uiBlock *block, float *x, float *y)
void ui_but_convert_to_unit_alt_name(uiBut *but, char *str, size_t str_maxncpy)
bool ui_but_context_poll_operator(bContext *C, wmOperatorType *ot, const uiBut *but)
bool ui_but_supports_cycling(const uiBut *but)
bool ui_but_is_bool(const uiBut *but)
void ui_but_anim_decorate_update_from_flag(uiButDecorator *but)
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 str_maxncpy)
bool ui_but_drag_is_draggable(const uiBut *but)
void ui_but_drag_start(bContext *C, uiBut *but)
void UI_context_update_anim_flag(const bContext *C)
static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
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 ui_list_activate_row_from_index(bContext *C, ARegion *region, uiBut *listbox, uiList *ui_list, int index)
static CurveProfile but_copypaste_profile
static int ui_handle_menu_letter_press_search(uiPopupBlockHandle *menu, const wmEvent *event)
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)
void UI_context_active_but_prop_handle(bContext *C, const bool handle_undo)
#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 void button_activate_exit(bContext *C, uiBut *but, uiHandleButtonData *data, const bool mousemove, const bool onfree)
static bool ui_numedit_but_CURVE(uiBlock *block, uiBut *but, uiHandleButtonData *data, int evtx, int evty, bool snap, const bool shift)
static void ui_afterfunc_update_preferences_dirty(uiAfterFunc *after)
static bool ui_multibut_states_tag(uiBut *but_active, uiHandleButtonData *data, const wmEvent *event)
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 bool ui_textedit_copypaste(uiBut *but, uiTextEdit &text_edit, const int mode)
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 void ui_but_get_pasted_text_from_clipboard(const bool ensure_utf8, char **r_buf_paste, int *r_buf_len)
bool UI_but_active_drop_name(const bContext *C)
static bool ui_mouse_motion_keynav_test(uiKeyNavLock *keynav, const wmEvent *event)
static bool ui_menu_scroll_step(ARegion *region, uiBlock *block, const int scroll_dir)
#define DRAG_MULTINUM_THRESHOLD_DRAG_X
static int ui_region_handler(bContext *C, const wmEvent *event, void *)
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)
void ui_handle_afterfunc_add_operator(wmOperatorType *ot, wmOperatorCallContext opcontext)
static void force_activate_view_item_but(bContext *C, ARegion *region, uiButViewItem *but, const bool close_popup=true)
static void ui_but_copy_colorband(uiBut *but)
static bool ui_button_value_default(uiBut *but, double *r_value)
static void ui_but_paste_curvemapping(bContext *C, uiBut *but)
static int ui_list_handle_click_drag(bContext *C, const uiList *ui_list, ARegion *region, const wmEvent *event)
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
void UI_block_interaction_set(uiBlock *block, uiBlockInteraction_CallbackData *callbacks)
#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)
static void ui_but_copy_numeric_array(uiBut *but, char *output, int output_maxncpy)
static bool ui_list_invoke_item_operator(bContext *C, const uiBut *context_but, wmOperatorType *ot, PointerRNA **properties)
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)
static void ui_but_copy_numeric_value(uiBut *but, char *output, int output_maxncpy)
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_textedit_delete(uiBut *but, uiTextEdit &text_edit, eStrCursorJumpDirection direction, eStrCursorJumpType jump)
static int ui_handle_viewlist_items_hover(const wmEvent *event, ARegion *region)
static void with_but_active_as_semi_modal(bContext *C, ARegion *region, uiBut *but, blender::FunctionRef< void()> fn)
static bool ui_afterfunc_check(const uiBlock *block, const uiBut *but)
static uiBut * ui_but_find_open_event(ARegion *region, const wmEvent *event)
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)
static void ui_but_copy_operator(bContext *C, uiBut *but, char *output, int output_maxncpy)
uiBlock * UI_region_block_find_mouse_over(const ARegion *region, const int xy[2], bool only_clip)
uiBut * UI_region_active_but_get(const ARegion *region)
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 int ui_do_but_COLOR(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
ARegion * UI_region_searchbox_region_get(const ARegion *button_region)
static uiBut * ui_block_pie_dir_activate(uiBlock *block, const wmEvent *event, RadialDirection dir)
static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
bool UI_but_is_userdef(const uiBut *but)
static void ui_selectcontext_apply(bContext *C, uiBut *but, uiSelectContextStore *selctx_data, const double value, const double value_orig)
uiBut * UI_region_but_find_rect_over(const ARegion *region, const rcti *rect_px)
static void ui_but_set_float_array(bContext *C, uiBut *but, uiHandleButtonData *data, const float *values, const int values_len)
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 bool ui_textedit_delete_selection(uiBut *but, uiTextEdit &text_edit)
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)
#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)
#define UI_PROP_SCALE_LOG_SNAP_OFFSET
static int ui_handle_region_semi_modal_buttons(bContext *C, const wmEvent *event, ARegion *region)
static bool ui_but_dragedit_update_mval(uiHandleButtonData *data, int mx)
static void popup_check(bContext *C, wmOperator *op)
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 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)
static void ui_numedit_begin_set_values(uiBut *but, uiHandleButtonData *data)
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 eStrCursorJumpType ui_textedit_jump_type_from_event(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_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_drag_toggle_but_pushed_state(uiBut *but)
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_apply_but_CURVE(bContext *C, uiBut *but, uiHandleButtonData *data)
void ui_but_execute_end(bContext *C, ARegion *, uiBut *but, void *active_back)
static void ui_textedit_string_set(uiBut *but, uiTextEdit &text_edit, const char *str)
static bool button_modal_state(uiHandleButtonState state)
static float ui_mouse_scale_warp_factor(const bool shift)
static bool ui_numedit_but_NUM(uiButNumber *but, uiHandleButtonData *data, int mx, const bool is_motion, const enum eSnapType snap, float fac)
uiBut * UI_context_active_but_get(const bContext *C)
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)
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 int ui_list_activate_hovered_row(bContext *C, ARegion *region, const uiList *ui_list, const wmEvent *event, bool activate_dragging)
void ui_but_active_string_clear_and_exit(bContext *C, uiBut *but)
static uiBut * ui_context_button_active(const ARegion *region, bool(*but_check_cb)(const uiBut *))
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 bool ui_but_copy_menu(uiBut *but, char *output, int output_maxncpy)
static void ui_apply_but_VIEW_ITEM(bContext *C, uiBlock *block, 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)
#define UI_PROP_SCALE_LOG_MIN
static void ui_but_update_preferences_dirty(uiBut *but)
static void float_array_to_string(const float *values, const int values_len, char *output, int output_maxncpy)
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 int ui_list_get_increment(const uiList *ui_list, const int type, const int columns)
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)
static bool ui_list_is_hovering_draggable_but(bContext *C, const uiList *list, const ARegion *region, const wmEvent *event)
static void ui_apply_but_COLORBAND(bContext *C, uiBut *but, uiHandleButtonData *data)
uiBut * UI_context_active_but_prop_get(const bContext *C, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
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_block_interaction_update(bContext *C, uiBlockInteraction_CallbackData *callbacks, uiBlockInteraction_Handle *interaction)
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)
static void ui_handler_region_drag_toggle_remove(bContext *, void *userdata)
static ARegion * ui_but_tooltip_init(bContext *C, ARegion *region, int *pass, double *r_pass_delay, bool *r_exit_on_event)
uiBut * ui_but_find_select_in_enum(uiBut *but, int direction)
void ui_but_execute_begin(bContext *, ARegion *region, uiBut *but, void **active_back)
#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)
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 uiBut * ui_but_list_row_text_activate(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event, uiButtonActivateType activate_type)
static void ui_numedit_set_active(uiBut *but)
static ColorBand but_copypaste_coba
static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static uiBlockInteraction_Handle * ui_block_interaction_begin(bContext *C, uiBlock *block, const bool is_click)
static bool point_draw_handles(CurveProfilePoint *point)
static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState state)
static void ui_apply_but_autokey(bContext *C, uiBut *but)
static void ui_mouse_motion_keynav_init(uiKeyNavLock *keynav, const wmEvent *event)
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)
uiBut * UI_but_active_drop_name_button(const bContext *C)
uiBut * UI_context_active_but_get_respect_popup(const bContext *C)
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 bool ui_but_copy(bContext *C, uiBut *but, const bool copy_array)
static void ui_textedit_end(bContext *C, uiBut *but, uiHandleButtonData *data)
static void ui_numedit_begin(uiBut *but, uiHandleButtonData *data)
static bool ui_but_copy_popover(uiBut *but, char *output, int output_maxncpy)
#define UI_DRAG_MAP_SOFT_RANGE_PIXEL_MAX
static int ui_do_but_VIEW_ITEM(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
#define BUTTON_DRAGLOCK_THRESH
static void ui_handle_afterfunc_add_operator_ex(wmOperatorType *ot, PointerRNA **properties, wmOperatorCallContext opcontext, const uiBut *context_but)
void ui_but_clipboard_free()
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)
static int ui_handler_region_drag_toggle(bContext *C, const wmEvent *event, void *userdata)
static int ui_handle_list_event(bContext *C, const wmEvent *event, ARegion *region, uiBut *listbox)
uiBut * UI_region_active_but_prop_get(const ARegion *region, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
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_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonData *data)
static void ui_multibut_add(uiHandleButtonData *data, uiBut *but)
void UI_but_tooltip_refresh(bContext *C, uiBut *but)
#define IS_ALLSELECT_EVENT(event)
static bool ui_handle_button_activate_by_type(bContext *C, ARegion *region, uiBut *but)
static bool parse_float_array(char *text, float *values, int values_len_expected)
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)
static void ui_textedit_move(uiBut *but, uiTextEdit &text_edit, eStrCursorJumpDirection direction, const bool select, eStrCursorJumpType jump)
#define UI_BUT_IS_SELECT_CONTEXT
static void ui_mouse_motion_towards_init(uiPopupBlockHandle *menu, const int xy[2])
static void ui_mouse_motion_towards_init_ex(uiPopupBlockHandle *menu, const int xy[2], const bool force)
static void ui_apply_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data)
static int ui_handle_view_item_event(bContext *C, const wmEvent *event, uiBut *active_but, ARegion *region)
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)
void UI_screen_free_active_but_highlight(const bContext *C, bScreen *screen)
static void ui_but_paste_CurveProfile(bContext *C, uiBut *but)
static void clamp_axis_max_v3(float v[3], const float max)
#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)
void ui_but_update_view_for_active(const bContext *C, const uiBlock *block)
static int ui_text_position_to_hidden(uiBut *but, int pos)
static int ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static void ui_apply_but_funcs_after(bContext *C)
void ui_but_set_string_interactive(bContext *C, uiBut *but, const char *value)
#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)
static void ui_textedit_string_ensure_max_length(uiBut *but, uiTextEdit &text_edit, int str_maxncpy)
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
static int ui_text_position_from_hidden(uiBut *but, int pos)
static void ui_multibut_restore(bContext *C, uiHandleButtonData *data, uiBlock *block)
static void ui_but_paste_colorband(bContext *C, uiBut *but, uiHandleButtonData *data)
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 void ui_but_copy_text(uiBut *but, char *output, int output_maxncpy)
static bool ui_menu_pass_event_to_parent_if_nonactive(uiPopupBlockHandle *menu, const uiBut *but, const int level, const bool is_parent_menu, const int retval)
static int ui_but_pie_button_activate(bContext *C, uiBut *but, uiPopupBlockHandle *menu)
void UI_popup_handlers_remove(ListBase *handlers, uiPopupBlockHandle *popup)
static void foreach_semi_modal_but_as_active(bContext *C, ARegion *region, blender::FunctionRef< void(uiBut *semi_modal_but)> fn)
static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but)
wmOperator * UI_context_active_operator_get(const bContext *C)
static void ui_textedit_set_cursor_pos(uiBut *but, const ARegion *region, const float x)
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])
void ui_but_semi_modal_state_free(const bContext *C, uiBut *but)
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 int ui_do_but_textedit_select(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
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 void ui_region_handler_remove(bContext *C, void *)
static int ui_do_but_KEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
static void button_tooltip_timer_reset(bContext *C, uiBut *but)
static bool ui_textedit_insert_buf(uiBut *but, uiTextEdit &text_edit, const char *buf, int buf_len)
void UI_popup_handlers_add(bContext *C, ListBase *handlers, uiPopupBlockHandle *popup, const char flag)
static void ui_block_interaction_begin_ensure(bContext *C, uiBlock *block, uiHandleButtonData *data, const bool is_click)
static void ui_block_interaction_end(bContext *C, uiBlockInteraction_CallbackData *callbacks, uiBlockInteraction_Handle *interaction)
static bool ui_menu_scroll_to_but(ARegion *region, uiBlock *block, uiBut *but_target)
void UI_region_free_active_but_all(bContext *C, ARegion *region)
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 uiAfterFunc * ui_afterfunc_new()
static uiButExtraOpIcon * ui_but_extra_operator_icon_mouse_over_get(uiBut *but, ARegion *region, const wmEvent *event)
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)
static bool ui_selectcontext_begin(bContext *C, uiBut *but, uiSelectContextStore *selctx_data)
static void ui_apply_but_LISTROW(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data)
void UI_popup_handlers_remove_all(bContext *C, ListBase *handlers)
static void ui_but_copy_color(uiBut *but, char *output, int output_maxncpy)
static void ui_apply_but_TAB(bContext *C, uiBut *but, uiHandleButtonData *data)
uiBut * ui_but_find_mouse_over(const ARegion *region, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
bool ui_but_contains_point_px(const uiBut *but, const ARegion *region, const int xy[2]) ATTR_NONNULL(1
ARegion ARegion * ui_screen_region_find_mouse_over(bScreen *screen, const wmEvent *event)
void ui_hsvcircle_vals_from_pos(const rcti *rect, float mx, float my, float *r_val_rad, float *r_val_dist)
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)
uiBlock * ui_block_find_mouse_over_ex(const ARegion *region, const int xy[2], bool only_clip) ATTR_NONNULL(1
uiBut * ui_block_active_but_get(const uiBlock *block)
void ui_searchbox_update(bContext *C, ARegion *region, uiBut *but, bool reset)
uiBlock *(*)(bContext *C, uiPopupBlockHandle *handle, void *arg1) uiBlockHandleCreateFunc
void ui_perceptual_to_scene_linear_space(uiBut *but, float rgb[3])
uiBut * ui_list_find_from_row(const ARegion *region, const uiBut *row_but) ATTR_WARN_UNUSED_RESULT
void ui_color_picker_hsv_to_rgb(const float r_cp[3], float rgb[3])
uiBut * ui_list_row_find_index(const ARegion *region, int index, uiBut *listbox) ATTR_WARN_UNUSED_RESULT
bool ui_block_is_pie_menu(const uiBlock *block) ATTR_WARN_UNUSED_RESULT
void ui_popup_block_scrolltest(uiBlock *block)
bool ui_but_has_array_value(const uiBut *but) ATTR_WARN_UNUSED_RESULT
#define UI_BITBUT_VALUE_TOGGLED(a, b)
bool int ui_searchbox_find_index(ARegion *region, const char *name)
size_t ui_but_tip_len_only_first_line(const uiBut *but)
uiBut * ui_view_item_find_mouse_over(const ARegion *region, const int xy[2]) ATTR_NONNULL(1
void ui_hsvcircle_pos_from_vals(const ColorPicker *cpicker, const rcti *rect, const float *hsv, float *r_xpos, float *r_ypos)
bool ui_but_contains_point_px_icon(const uiBut *but, ARegion *region, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
bool ui_block_is_popup_any(const uiBlock *block) ATTR_WARN_UNUSED_RESULT
bool ui_layout_panel_toggle_open(const bContext *C, LayoutPanelHeader *header)
uiPopupBlockHandle * ui_popup_block_create(bContext *C, ARegion *butregion, uiBut *but, uiBlockCreateFunc create_func, uiBlockHandleCreateFunc handle_create_func, void *arg, uiFreeArgFunc arg_free, bool can_refresh)
@ UI_PIE_ANIMATION_FINISHED
@ UI_PIE_INITIAL_DIRECTION
@ UI_PIE_GESTURE_END_WAIT
uiPopupBlockHandle * ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut *but, uiMenuCreateFunc menu_func, void *arg)
int ui_handler_panel_region(bContext *C, const wmEvent *event, ARegion *region, const uiBut *active_but)
void ui_hsvcube_pos_from_vals(const uiButHSVCube *hsv_but, const rcti *rect, const float *hsv, float *r_xp, float *r_yp)
void ui_scene_linear_to_perceptual_space(uiBut *but, float rgb[3])
void ui_popup_block_free(bContext *C, uiPopupBlockHandle *handle)
void ui_searchbox_free(bContext *C, ARegion *region)
#define PIE_CLICK_THRESHOLD_SQ
int ui_but_menu_step(uiBut *but, int direction)
uiBut * ui_but_find_rect_over(const ARegion *region, const rcti *rect_px) ATTR_WARN_UNUSED_RESULT
bool ui_region_contains_point_px(const ARegion *region, const int xy[2]) ATTR_NONNULL(1
bool ui_searchbox_apply(uiBut *but, ARegion *region)
void ui_popup_translate(ARegion *region, const int mdiff[2])
bool ui_block_is_menu(const uiBlock *block) ATTR_WARN_UNUSED_RESULT
uiBut * ui_view_item_find_search_highlight(const ARegion *region)
#define UI_MENU_SCROLL_PAD
uiBut * ui_region_find_first_but_test_flag(ARegion *region, int flag_include, int flag_exclude)
const char * ui_textedit_undo(uiUndoStack_Text *stack, int direction, int *r_cursor_index)
void ui_but_hsv_set(uiBut *but)
LayoutPanelHeader * ui_layout_panel_header_under_mouse(const Panel &panel, const int my)
bool ui_searchbox_inside(ARegion *region, const int xy[2]) ATTR_NONNULL(1
uiBut * ui_but_first(uiBlock *block) ATTR_WARN_UNUSED_RESULT
#define UI_MENU_SCROLL_ARROW
bool ui_but_contains_pt(const uiBut *but, float mx, float my) ATTR_WARN_UNUSED_RESULT
uiBut * ui_list_find_mouse_over(const ARegion *region, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
blender::StringRef ui_but_drawstr_without_sep_char(const uiBut *but) ATTR_NONNULL()
bool ui_searchbox_event(bContext *C, ARegion *region, uiBut *but, ARegion *butregion, const wmEvent *event)
bool ui_but_contains_password(const uiBut *but) ATTR_WARN_UNUSED_RESULT
uiBut * ui_but_find_mouse_over_ex(const ARegion *region, const int xy[2], bool labeledit, bool for_tooltip, const uiButFindPollFn find_poll, const void *find_custom_data) ATTR_NONNULL(1
bool ui_but_is_editable(const uiBut *but) ATTR_WARN_UNUSED_RESULT
uiBut * ui_list_row_find_mouse_over(const ARegion *region, const int xy[2]) ATTR_NONNULL(1
uiBlock * ui_block_func_COLOR(bContext *C, uiPopupBlockHandle *handle, void *arg_but)
bool ui_but_is_interactive(const uiBut *but, bool labeledit) ATTR_WARN_UNUSED_RESULT
void ui_color_picker_rgb_to_hsv_compat(const float rgb[3], float r_cp[3])
void ui_popup_menu_memory_set(uiBlock *block, uiBut *but)
uiBut * ui_but_last(uiBlock *block) ATTR_WARN_UNUSED_RESULT
uiPopupBlockHandle * ui_popover_panel_create(bContext *C, ARegion *butregion, uiBut *but, uiPopoverCreateFunc popover_func, const PanelType *panel_type)
uiBut * ui_region_find_active_but(ARegion *region) ATTR_WARN_UNUSED_RESULT
void ui_but_pie_dir(RadialDirection dir, float vec[2])
uiBut * ui_but_next(uiBut *but) ATTR_WARN_UNUSED_RESULT
void ui_textedit_undo_stack_destroy(uiUndoStack_Text *stack)
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
uiUndoStack_Text * ui_textedit_undo_stack_create()
void ui_textedit_undo_push(uiUndoStack_Text *stack, const char *text, int cursor_index)
void ui_panel_drag_collapse_handler_add(const bContext *C, const bool was_open)
uiBut * ui_but_prev(uiBut *but) ATTR_WARN_UNUSED_RESULT
int ui_searchbox_autocomplete(bContext *C, ARegion *region, uiBut *but, char *str)
void ui_layout_panel_popup_scroll_apply(Panel *panel, const float dy)
#define UI_MENU_SCROLL_MOUSE
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
ccl_device_inline float4 select(const int4 mask, const float4 a, const float4 b)
void add_recent_search(StringRef chosen_str)
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_string_set(PointerRNA *ptr, const char *name, const char *value)
int RNA_property_int_get_default(PointerRNA *ptr, PropertyRNA *prop)
int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, float value)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
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)
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
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)
float RNA_property_float_get_default(PointerRNA *ptr, PropertyRNA *prop)
int RNA_property_flag(PropertyRNA *prop)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
StructRNA * RNA_struct_base(StructRNA *type)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
std::string RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop)
PropertySubType RNA_property_subtype(PropertyRNA *prop)
void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax)
bool RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
const char * RNA_property_identifier(const PropertyRNA *prop)
void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const bool *values)
PointerRNA RNA_id_pointer_create(ID *id)
void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value)
struct ColorBand * gradient
float luminosity_lock_value
struct MovieTrackingMarker * marker
struct MovieTrackingTrack * track
char idname[BKE_ST_MAXNAME]
std::optional< bContextStore > context
char undostr[BKE_UNDO_STR_MAX]
uiBlockInteraction_Handle * custom_interaction_handle
wmOperatorCallContext opcontext
std::string rename_full_new
std::function< void(bContext &)> apply_func
std::function< void(std::string &new_name)> rename_full_func
uiBlockInteraction_CallbackData custom_interaction_callbacks
uiButArgNFree func_argN_free_fn
uiBlockHandleFunc handle_func
uiButHandleRenameFunc rename_func
uiFreeArgFunc search_arg_free_fn
uiBlockInteractionBeginFn begin_fn
uiBlockInteractionEndFn end_fn
uiBlockInteractionUpdateFn update_fn
uiBlockInteraction_Params params
uint unique_retval_ids_len
uiPopupBlockHandle * handle
uiBlockHandleFunc handle_func
uiBlockInteraction_CallbackData custom_interaction_callbacks
const UnitSettings * unit
int(* block_event_func)(const bContext *C, uiBlock *, const wmEvent *)
CurveMapping * edit_cumap
CurveProfile * edit_profile
eButGradientType gradient_type
uiSelectContextStore select_others
bool results_are_suggestions
uiButSearchCreateFn popup_create_fn
uiFreeArgFunc arg_free_fn
blender::ui::AbstractViewItem * view_item
wmOperatorCallContext opcontext
uiButCompleteFunc autocomplete_func
std::function< void(bContext &)> apply_func
uiHandleButtonData * active
uiMenuCreateFunc menu_create_func
std::function< void(std::string &new_name)> rename_full_func
std::string rename_full_new
const bContextStore * context
uiButArgNFree func_argN_free_fn
uiButHandleHoldFunc hold_func
uiButHandleRenameFunc rename_func
uiBlockCreateFunc block_create_func
uiButArgNCopy func_argN_copy_fn
uiHandleButtonData * semi_modal_state
struct wmOperatorType * custom_activate_optype
struct PointerRNA * custom_drag_opptr
int * items_filter_neworder
struct wmOperatorType * custom_drag_optype
void(* popup_func)(bContext *C, void *arg, int event)
void(* cancel_func)(bContext *C, void *arg)
uiPopupBlockCreate popup_create_vars
uiKeyNavLock keynav_state
uiSelectContextElem * elems
uiUndoStack_Text * undo_stack_text
wmUIHandlerRemoveFunc remove_fn
wmUIHandlerFunc handle_fn
eWM_EventHandlerType type
wmOperatorCallContext opcontext
bool(* check)(bContext *C, wmOperator *op)
struct wmOperatorType * type
struct wmEvent * eventstate
short pie_event_type_last
const struct wmIMEData * ime_data
char ime_data_is_composing
ccl_device_inline int abs(int x)
void WM_cursor_modal_set(wmWindow *win, int val)
void WM_cursor_set(wmWindow *win, int curs)
void WM_cursor_modal_restore(wmWindow *win)
void WM_cursor_grab_enable(wmWindow *win, const eWM_CursorWrapAxis wrap, const rcti *wrap_region, const bool hide)
void WM_cursor_grab_disable(wmWindow *win, const int mouse_ungrab_xy[2])
void WM_event_start_drag(bContext *C, int icon, eWM_DragDataType type, void *poin, uint flags)
int WM_event_absolute_delta_y(const wmEvent *event)
void WM_event_drag_start_xy(const wmEvent *event, int r_xy[2])
int WM_event_drag_threshold(const wmEvent *event)
wmEventHandler_UI * WM_event_add_ui_handler(const bContext *C, ListBase *handlers, wmUIHandlerFunc handle_fn, wmUIHandlerRemoveFunc remove_fn, void *user_data, const eWM_EventHandlerFlag flag)
void WM_report(eReportType type, const char *message)
void WM_event_free_ui_handler_all(bContext *C, ListBase *handlers, wmUIHandlerFunc handle_fn, wmUIHandlerRemoveFunc remove_fn)
void WM_main_add_notifier(uint type, void *reference)
void WM_reportf(eReportType type, const char *format,...)
void WM_operator_name_call_ptr_with_depends_on_cursor(bContext *C, wmOperatorType *ot, wmOperatorCallContext opcontext, PointerRNA *properties, const wmEvent *event, const char *drawstr)
void WM_event_remove_ui_handler(ListBase *handlers, wmUIHandlerFunc handle_fn, wmUIHandlerRemoveFunc remove_fn, void *user_data, const bool postpone)
void WM_report_banner_show(wmWindowManager *wm, wmWindow *win)
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)
void wm_event_init_from_window(wmWindow *win, wmEvent *event)
void WM_event_add_mousemove(wmWindow *win)
#define ISMOUSE_BUTTON(event_type)
#define ISMOUSE_MOTION(event_type)
#define ISKEYBOARD(event_type)
#define ISHOTKEY(event_type)
void WM_gestures_remove(wmWindow *win)
const char * WM_key_event_string(const short type, const bool compact)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
std::string 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)
std::optional< std::string > WM_prop_pystring_assign(bContext *C, PointerRNA *ptr, PropertyRNA *prop, int index)
void WM_operator_properties_free(PointerRNA *ptr)
PanelType * WM_paneltype_find(const char *idname, bool quiet)
bool WM_stereo3d_enabled(wmWindow *win, bool skip_stereo3d_check)
void WM_clipboard_text_set(const char *buf, bool selection)
char * WM_clipboard_text_get_firstline(bool selection, bool ensure_utf8, int *r_len)
void WM_event_timer_remove(wmWindowManager *wm, wmWindow *, wmTimer *timer)
wmTimer * WM_event_timer_add(wmWindowManager *wm, wmWindow *win, const int event_type, const double time_step)
bScreen * WM_window_get_active_screen(const wmWindow *win)