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
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,
1138 data->applied =
true;
1147 data->applied =
true;
1159 data->applied =
true;
1170 value_toggle = (value == 0.0);
1181 data->applied =
true;
1198 data->applied =
true;
1206 if (
data->apply_through_extra_icon) {
1222 const uiBut *context_but,
1252 if (!
data->text_edit.edit_string) {
1270 data->text_edit.original_string =
nullptr;
1289 data->applied =
true;
1294 if (
data->text_edit.edit_string) {
1304 data->applied =
true;
1309 if (
data->text_edit.edit_string) {
1322 data->cancel =
true;
1331 data->cancel =
true;
1343 data->applied =
true;
1353 data->applied =
true;
1360 data->applied =
true;
1367 data->applied =
true;
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) {
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;
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;
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;
1861 if (
ptr.data && prop) {
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) {
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,
2164 if (lock_axis != -1) {
2165 drag_info->
xy_lock[lock_axis] =
true;
2227 data->applied =
true;
2234 data->applied =
true;
2241 data->applied =
true;
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;
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++) {
2534 const int values_len,
2538 const int values_end = values_len - 1;
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__));
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];
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)
3446 return data->window->ime_data;
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;
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)) {
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;
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;
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;
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) {
4436 else if (popoverfunc) {
4446 data->select_others.is_enabled =
true;
4474 data->menu =
nullptr;
4483 return data->menu->direction;
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;
4924 data->cancel =
true;
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;
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) {
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) {
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;
5433 if (temp != lvalue) {
5434 data->dragchange =
true;
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;
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)) :
5661 if (value_test !=
data->value) {
5665 data->cancel =
true;
5685 if (
UNLIKELY(!isfinite(precision))) {
5694 const double value_test =
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;
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;
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++) {
6388 angle_snap = roundf(
angle / snap_steps_angle) * snap_steps_angle;
6389 fp[i] =
sinf(angle_snap);
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) {
6506 if (brush ==
nullptr) {
6523 bool updated =
false;
6566 int mx =
event->xy[0];
6567 int my =
event->xy[1];
6573 data->dragstartx = mx;
6574 data->dragstarty = my;
6575 data->draglastx = mx;
6576 data->draglasty = my;
6598 data->cancel =
true;
6599 data->escapecancel =
true;
6617 const float v_max =
max_fff(
v[0],
v[1],
v[2]);
6681 const bool changed =
true;
6685#ifdef USE_CONT_MOUSE_CORRECT
6688 data->ungrab_mval[0] = mx_fl;
6689 data->ungrab_mval[1] = my_fl;
6702 float xpos, ypos, hsvo[3];
6717 mx_fl = xpos - (
data->dragstartx - mx_fl);
6718 my_fl = ypos - (
data->dragstarty - my_fl);
6780 data->draglastx = mx;
6781 data->draglasty = my;
6786#ifdef WITH_INPUT_NDOF
6787static void ui_ndofedit_but_HSVCUBE(
uiButHSVCube *hsv_but,
6789 const wmNDOFMotionData *ndof,
6797 const float sensitivity = (shift ? 0.15f : 0.3f) * ndof->dt;
6803 switch (hsv_but->gradient_type) {
6805 hsv[1] += ndof->rvec[2] * sensitivity;
6806 hsv[2] += ndof->rvec[0] * sensitivity;
6809 hsv[0] += ndof->rvec[2] * sensitivity;
6810 hsv[2] += ndof->rvec[0] * sensitivity;
6813 hsv[0] += ndof->rvec[2] * sensitivity;
6814 hsv[1] += ndof->rvec[0] * sensitivity;
6817 hsv[0] += ndof->rvec[2] * sensitivity;
6820 hsv[1] += ndof->rvec[2] * sensitivity;
6823 hsv[2] += ndof->rvec[2] * sensitivity;
6830 hsv[2] += ndof->rvec[0] * sensitivity;
6832 CLAMP(hsv[2], hsv_but->softmin, hsv_but->softmax);
6860 int mx =
event->xy[0];
6861 int my =
event->xy[1];
6868 data->dragstartx = mx;
6869 data->dragstarty = my;
6870 data->draglastx = mx;
6871 data->draglasty = my;
6881#ifdef WITH_INPUT_NDOF
6883 const wmNDOFMotionData *ndof =
static_cast<const wmNDOFMotionData *
>(
event->customdata);
6903 float rgb[3], def_hsv[3];
6914 def_hsv[0] = hsv[0];
6915 def_hsv[1] = hsv[1];
6929 data->cancel =
true;
6930 data->escapecancel =
true;
6960 const bool changed =
true;
6967#ifdef USE_CONT_MOUSE_CORRECT
6970 data->ungrab_mval[0] = mx_fl;
6971 data->ungrab_mval[1] = my_fl;
6995 if (hsv[2] == 0.0f) {
7000 if (hsv[2] == 0.0f) {
7003 if (hsv[2] >= 0.9999f) {
7011 float xpos, ypos, hsvo[3], rgbo[3];
7022 mx_fl = xpos - (
data->dragstartx - mx_fl);
7023 my_fl = ypos - (
data->dragstarty - my_fl);
7029 hsv[1] = 1.0f -
sqrt3f(1.0f - hsv[1]);
7047 data->draglastx = mx;
7048 data->draglasty = my;
7053#ifdef WITH_INPUT_NDOF
7054static void ui_ndofedit_but_HSVCIRCLE(
uiBut *but,
7056 const wmNDOFMotionData *ndof,
7064 const float sensitivity = (shift ? 0.06f : 0.3f) * ndof->dt;
7076 v[0] = r *
cosf(phi);
7077 v[1] = r *
sinf(phi);
7080 v[0] += ndof->rvec[2] * sensitivity;
7081 v[1] += ndof->rvec[0] * sensitivity;
7087 phi += ndof->rvec[1] * sensitivity * 0.5f;
7096 if (cpicker->use_color_lock) {
7098 if (hsv[2] == 0.0f) {
7103 if (hsv[2] == 0.0f) {
7106 if (hsv[2] == 1.0f) {
7120 if (cpicker->use_luminosity_lock) {
7136 int mx =
event->xy[0];
7137 int my =
event->xy[1];
7143 data->dragstartx = mx;
7144 data->dragstarty = my;
7145 data->draglastx = mx;
7146 data->draglasty = my;
7156#ifdef WITH_INPUT_NDOF
7159 const wmNDOFMotionData *ndof =
static_cast<const wmNDOFMotionData *
>(
event->customdata);
7177 float rgb[3], def_hsv[3];
7178 float *def =
static_cast<float *
>(
MEM_callocN(
sizeof(
float) *
len, __func__));
7186 def_hsv[0] = hsv[0];
7187 def_hsv[2] = hsv[2];
7202 data->cancel =
true;
7203 data->escapecancel =
true;
7209 hsv[2] =
clamp_f(hsv[2] - 0.05f, 0.0f, 1.0f);
7214 hsv[2] =
clamp_f(hsv[2] + 0.05f, 0.0f, 1.0f);
7238 bool changed =
false;
7240 if (
data->draglastx == mx) {
7244 if (
data->coba->tot == 0) {
7249 data->dragcbd->pos += dx;
7255 data->draglastx = mx;
7264 int mx =
event->xy[0];
7265 int my =
event->xy[1];
7283 data->dragstartx = mx;
7284 data->dragstarty = my;
7285 data->draglastx = mx;
7286 data->draglasty = my;
7290 for (a = 0, cbd = coba->
data; a < coba->tot; a++, cbd++) {
7292 xco =
abs(xco - mx);
7293 if (a == coba->
cur) {
7297 if (xco < mindist) {
7304 data->dragfstart =
data->dragcbd->pos;
7313 if (mx !=
data->draglastx || my !=
data->draglasty) {
7324 data->dragcbd->pos =
data->dragfstart;
7326 data->cancel =
true;
7327 data->escapecancel =
true;
7348 bool changed =
false;
7355 int dragx =
data->draglastx;
7356 int dragy =
data->draglasty;
7365 d[0] = mx -
data->dragstartx;
7366 d[1] = my -
data->dragstarty;
7373 float fx = (mx - dragx) / zoomx;
7374 float fy = (my - dragy) / zoomy;
7376 if (
data->dragsel != -1) {
7379 bool moved_point =
false;
7384 for (
int a = 0; a < cuma->
totpoint; a++) {
7386 const float origx = cmp[a].
x, origy = cmp[a].
y;
7390 cmp[a].
x = 0.125f * roundf(8.0f * cmp[a].
x);
7391 cmp[a].
y = 0.125f * roundf(8.0f * cmp[a].
y);
7393 if (cmp[a].
x != origx || cmp[a].
y != origy) {
7404 data->draglastx = evtx;
7405 data->draglasty = evty;
7408#ifdef USE_CONT_MOUSE_CORRECT
7420 data->dragchange =
true;
7425 if (cumap->
curr.
xmin - fx < cumap->clipr.xmin) {
7431 if (cumap->
curr.
ymin - fy < cumap->clipr.ymin) {
7444 data->draglastx = evtx;
7445 data->draglasty = evty;
7456 bool changed =
false;
7460 int mx =
event->xy[0];
7461 int my =
event->xy[1];
7468 const float m_xy[2] = {
float(mx),
float(my)};
7483 for (
int a = 0; a < cuma->
totpoint; a++) {
7487 if (dist_sq < dist_min_sq) {
7489 dist_min_sq = dist_sq;
7494 float f_xy[2], f_xy_prev[2];
7506 for (
int i = 1; i <=
CM_TABLE; i++) {
7523 for (
int a = 0; a < cuma->
totpoint; a++) {
7524 if (cmp[a].
x == f_xy[0]) {
7537 for (
int a = 0; a < cuma->
totpoint; a++) {
7548 data->cancel =
true;
7551 data->dragsel = sel;
7553 data->dragstartx =
event->xy[0];
7554 data->dragstarty =
event->xy[1];
7555 data->draglastx =
event->xy[0];
7556 data->draglasty =
event->xy[1];
7564 if (event->
xy[0] !=
data->draglastx || event->
xy[1] !=
data->draglasty) {
7579 if (
data->dragsel != -1) {
7584 if (
data->dragchange ==
false) {
7587 for (
int a = 0; a < cuma->
totpoint; a++) {
7622 bool changed =
false;
7629 int dragx =
data->draglastx;
7630 int dragy =
data->draglasty;
7643 float fx = (mx - dragx) / zoomx;
7644 float fy = (my - dragy) / zoomy;
7646 if (
data->dragsel != -1) {
7647 float last_x, last_y;
7649 bool moved_point =
false;
7655 const float delta[2] = {fx, fy};
7656 for (
int a = 0; a < profile->
path_len; a++) {
7667 last_x = pts[a].
h1_loc[0];
7668 last_y = pts[a].
h1_loc[1];
7672 last_x = pts[a].
h2_loc[0];
7673 last_y = pts[a].
h2_loc[1];
7681 data->draglastx = evtx;
7682 data->draglasty = evty;
7684#ifdef USE_CONT_MOUSE_CORRECT
7695 data->dragchange =
true;
7700 if (profile->
view_rect.
xmin - fx < profile->clip_rect.xmin) {
7706 if (profile->
view_rect.
ymin - fy < profile->clip_rect.ymin) {
7719 data->draglastx = evtx;
7720 data->draglasty = evty;
7746 int mx =
event->xy[0];
7747 int my =
event->xy[1];
7753 data->dragstartx = mx;
7754 data->dragstarty = my;
7755 data->draglastx = mx;
7756 data->draglasty = my;
7772 const float m_xy[2] = {
float(mx),
float(my)};
7786 int i_selected = -1;
7787 short selection_type = 0;
7788 for (
int i = 0; i < profile->
path_len; i++) {
7792 if (dist_sq < dist_min_sq) {
7795 dist_min_sq = dist_sq;
7803 if (dist_sq < dist_min_sq) {
7806 dist_min_sq = dist_sq;
7812 if (dist_sq < dist_min_sq) {
7815 dist_min_sq = dist_sq;
7822 if (i_selected == -1) {
7823 float f_xy[2], f_xy_prev[2];
7841 i_selected =
int(new_pt - profile->
path);
7842 BLI_assert(i_selected >= 0 && i_selected <= profile->path_len);
7850 if (i_selected != -1) {
7853 pts[i_selected].
flag ^= selection_type;
7856 for (
int i = 0; i < profile->
path_len; i++) {
7860 profile->
path[i_selected].
flag |= selection_type;
7865 data->cancel =
true;
7868 data->dragsel = i_selected;
7870 data->dragstartx = mx;
7871 data->dragstarty = my;
7872 data->draglastx = mx;
7873 data->draglasty = my;
7881 if (mx !=
data->draglastx || my !=
data->draglasty) {
7891 if (
data->dragsel != -1) {
7893 if (
data->dragchange ==
false) {
7912 const bool changed =
true;
7913 const float dy = my -
data->draglasty;
7917 hist->
ymax += (dy * 0.1f) * yfac;
7922 data->draglastx = mx;
7923 data->draglasty = my;
7931 int mx =
event->xy[0];
7932 int my =
event->xy[1];
7937 data->dragstartx = mx;
7938 data->dragstarty = my;
7939 data->draglastx = mx;
7940 data->draglasty = my;
7962 data->cancel =
true;
7963 data->escapecancel =
true;
7968 if (mx !=
data->draglastx || my !=
data->draglasty) {
7986 const bool changed =
true;
7988 const float dy = my -
data->draglasty;
7995 data->draglastx = mx;
7996 data->draglasty = my;
8004 int mx =
event->xy[0];
8005 int my =
event->xy[1];
8010 data->dragstartx = mx;
8011 data->dragstarty = my;
8012 data->draglastx = mx;
8013 data->draglasty = my;
8035 data->cancel =
true;
8036 data->escapecancel =
true;
8041 if (mx !=
data->draglastx || my !=
data->draglasty) {
8060 const bool changed =
true;
8062 float dx = mx -
data->draglastx;
8063 float dy = my -
data->draglasty;
8086 data->draglastx = mx;
8087 data->draglasty = my;
8095 int mx =
event->xy[0];
8096 int my =
event->xy[1];
8101 data->dragstartx = mx;
8102 data->dragstarty = my;
8103 data->draglastx = mx;
8104 data->draglasty = my;
8118 data->cancel =
true;
8119 data->escapecancel =
true;
8124 if (mx !=
data->draglastx || my !=
data->draglasty) {
8155 bool is_press_ctrl_but_no_shift = (
event->val ==
KM_PRESS) &&
8158 const bool do_copy =
event->type ==
EVT_CKEY && is_press_ctrl_but_no_shift;
8159 const bool do_paste =
event->type ==
EVT_VKEY && is_press_ctrl_but_no_shift;
8190 if (clicked_view_item_but) {
8204#ifdef WITH_INPUT_NDOF
8242 switch (but->
type) {
8356#ifdef USE_DRAG_MULTINUM
8374 const float dir_nor_y[2] = {0.0, 1.0f};
8375 float dir_nor_drag[2];
8381 data->multi_data.drag_lock_x =
event->xy[0];
8392 if ((
data->text_edit.edit_string &&
8394 ((
abs(
data->multi_data.drag_lock_x - event->
xy[0]) > margin_x) &&
8398 if (
data->multi_data.has_mbuts) {
8435 block->tooltipdisabled = !enable;
8454 if (
data->autoopentimer) {
8456 data->autoopentimer =
nullptr;
8466 bContext *
C,
ARegion *region,
int *pass,
double *r_pass_delay,
bool *r_exit_on_event)
8468 bool is_label =
false;
8476 *r_exit_on_event =
false;
8549 if (
data->used_mouse && !
data->autoopentimer) {
8558 time = 5 *
U.menuthreshold2;
8561 time = 5 *
U.menuthreshold1;
8605 status.
item(
" ", ICON_NONE);
8622 "Can't edit driven number value, see driver editor for the driver setup");
8628#ifdef USE_CONT_MOUSE_CORRECT
8631 int mouse_ungrab_xy[2];
8634 mouse_ungrab_xy[0] =
data->ungrab_mval[0];
8635 mouse_ungrab_xy[1] =
data->ungrab_mval[1];
8659 else if (
data->flashtimer) {
8661 data->flashtimer =
nullptr;
8669 else if (
data->hold_action_timer) {
8671 data->hold_action_timer =
nullptr;
8680 &
data->window->modalhandlers,
8746 data->region = region;
8748#ifdef USE_CONT_MOUSE_CORRECT
8757 data->interactive =
true;
8778 data->used_mouse =
true;
8786 if (
data->menu &&
data->menu->region) {
8847#ifdef USE_DRAG_MULTINUM
8848 if (
data->multi_data.has_mbuts) {
8853 if (!
data->cancel) {
8867 if (!
data->cancel ||
data->escapecancel) {
8876 if (!onfree && !
data->cancel) {
8884 uiBut but_temp = *but;
8886 for (
int i = 0; i < selctx_data->
elems_len; i++) {
8899 if (
U.runtime.is_dirty ==
false) {
8910 block_iter->tooltipdisabled =
true;
8916 if (
data->text_edit.edit_string) {
8919 if (
data->text_edit.original_string) {
8927 if (
data->changed_cursor) {
8936 if (
data->custom_interaction_handle !=
nullptr) {
8939 data->custom_interaction_handle->user_count--;
8942 if (
data->custom_interaction_handle->user_count == 0) {
8946 data->custom_interaction_handle =
nullptr;
8976 data->cancel =
true;
8990 [&]() { ui_but_active_free(C, but); });
8996 uiBut *but_found =
nullptr;
9004 uiBut *active_but_override =
nullptr;
9005 uiBut *active_but_real =
nullptr;
9006 uiBut *active_but_last =
nullptr;
9012 active_but_override = but;
9015 active_but_real = but;
9018 active_but_last = but;
9023 uiBut *activebut = active_but_override;
9025 activebut = active_but_real;
9028 activebut = active_but_last;
9031 if (activebut && (but_check_cb ==
nullptr || but_check_cb(activebut))) {
9034 but_found = activebut;
9037 if (
data &&
data->menu && (region !=
data->menu->region)) {
9038 region =
data->menu->region;
9107 region_popup ? region_popup :
CTX_wm_region(
C), r_ptr, r_prop, r_index);
9139 if (region_ctx ==
nullptr) {
9145 if (block->ui_operator) {
9146 return block->ui_operator;
9155 if (region == region_ctx) {
9159 if (block->ui_operator) {
9160 return block->ui_operator;
9185 uiBut *activebut =
nullptr;
9210 region =
data->menu->region;
9226 if (!active_but || !active_but->
active || !active_but->
changed || active_but->
block != block) {
9232 if (
data->searchbox) {
9260 const bool labeledit =
event->modifier &
KM_CTRL;
9264 const bool for_tooltip =
true;
9266 region, event->
xy, labeledit, for_tooltip,
nullptr,
nullptr);
9303 event.customdata = but;
9304 event.customdata_free =
false;
9321 *active_back = but->
active;
9322 data = MEM_cnew<uiHandleButtonData>(__func__);
9325 data->region = region;
9348 data->cancel =
true;
9374 printf(
"%s: error, unhandled type: %d\n", __func__, but->
type);
9400 if (prev_active_but) {
9401 prev_active_but->
active =
nullptr;
9417 if (prev_active_but) {
9418 prev_active_but->
active = prev_active_data;
9454 double default_value;
9475 *r_value = default_value;
9493 switch (event->
type) {
9496 data->cancel =
true;
9499#ifdef USE_UI_POPOVER_ONCE
9505 data->cancel =
false;
9540 data->cancel =
true;
9558 data->autoopentimer =
nullptr;
9583 switch (event->
type) {
9585 data->cancel =
true;
9592 data->cancel =
true;
9600 data->hold_action_timer =
nullptr;
9613 if (
data->hold_action_timer) {
9629 data->cancel =
false;
9636 data->cancel =
true;
9651 switch (event->
type) {
9664 switch (event->
type) {
9668 if (
data->menu &&
data->menu->region) {
9678 data->cancel =
true;
9710 if ((
data->cancel ==
false) && (
data->text_edit.edit_string !=
nullptr) &&
9711 (
data->text_edit.edit_string[0] ==
'\0') &&
9717#ifdef USE_DRAG_MULTINUM
9718 if (
data->multi_data.mbuts) {
9722 double default_value;
9729 data->multi_data.skip =
true;
9772 bool activate_dragging)
9796 if (activate_dragging && do_drag) {
9797 ((
uiList *)ui_list)->dyn_data->custom_activate_optype =
nullptr;
9804 ((
uiList *)ui_list)->dyn_data->custom_activate_optype = custom_activate_optype;
9820 region, mouse_xy,
false,
false,
nullptr,
nullptr);
9844 bool activate_dragging =
false;
9848 activate_dragging =
true;
9871 if (new_active_row) {
9914 int type =
event->type, val =
event->val;
9916 bool redraw =
false;
9919 if (!ui_list || !ui_list->
dyn_data) {
9924 int mx =
event->xy[0];
9925 int my =
event->xy[1];
9962 int *org_order =
static_cast<int *
>(
9966 int current_idx = -1;
9968 for (
int i = 0; i <
len; i++) {
9970 org_order[new_order ? new_order[++org_idx] : ++org_idx] = i;
9972 current_idx = new_order ? new_order[org_idx] : org_idx;
9975 else if (i == value && org_idx >= 0) {
9976 current_idx = -(new_order ? new_order[org_idx] : org_idx) - 1;
9983 if (current_idx < 0) {
9984 current_idx = (current_idx * -1) + (inc < 0 ? inc : inc - 1);
9990 value = org_order[current_idx];
10002 if (value != value_orig) {
10043 const bool has_view = [&]() {
10052 if (!has_view && !has_list) {
10058 uiBut *highlight_row_but = [&]() ->
uiBut * {
10071 bool changed =
false;
10073 if (highlight_row_but && !(highlight_row_but->
flag &
UI_HOVER)) {
10080 if (but == highlight_row_but) {
10106 switch (event->
type) {
10123 const bool close_popup = view_but == active_but;
10162 if (
data->interactive) {
10175 data->cancel =
true;
10191 data->cancel =
true;
10248 const bool use_wiggle_room)
10263 }
while ((region = region->
next));
10285 const float p1[2] = {rect_px.
xmin - margin, rect_px.
ymin - margin};
10286 const float p2[2] = {rect_px.
xmax + margin, rect_px.
ymin - margin};
10287 const float p3[2] = {rect_px.
xmax + margin, rect_px.
ymax + margin};
10288 const float p4[2] = {rect_px.
xmin - margin, rect_px.
ymax + margin};
10292 if (use_wiggle_room) {
10317#ifdef USE_KEYNAV_LIMIT
10372 ymax =
max_ff(ymax, bt->rect.ymax);
10375 dy = block->
rect.
ymax - ymax - scroll_pad;
10382 ymin =
min_ff(ymin, bt->rect.ymin);
10385 dy = block->
rect.
ymin - ymin + scroll_pad;
10396 bt->rect.ymin += dy;
10397 bt->rect.ymax += dy;
10435 else if (test ==
'b') {
10448 if (scroll_dir == 1) {
10454 else if (scroll_dir == -1) {
10477 block->auto_open =
false;
10493 const bool is_parent_menu,
10499 if ((level != 0) && (but ==
nullptr) && (is_parent_menu || menu->
popup ==
false)) {
10600 after->
opptr = MEM_new<PointerRNA>(__func__);
10606 if (num_bytes != -1) {
10607 char buf[
sizeof(
event->utf8_buf) + 1];
10608 memcpy(buf, event->
utf8_buf, num_bytes);
10609 buf[num_bytes] =
'\0';
10623 const bool is_parent_inside,
10624 const bool is_parent_menu,
10625 const bool is_floating)
10633 int mx =
event->xy[0];
10634 int my =
event->xy[1];
10640 const bool inside_title = inside && ((my + (
UI_UNIT_Y * 1.4f)) > block->
rect.
ymax);
10645#ifdef USE_DRAG_POPUP
10647# if defined(__APPLE__)
10657 if (!menu->
is_grab && is_floating) {
10668 else if (win->
cursor == PopupTitleHoverCursor) {
10733 switch (event->
type) {
10741 if (inside ==
false) {
10774 menu, but, level, is_parent_menu, retval))
10806 const float dy =
event->xy[1] -
event->prev_xy[1];
10827 const int scroll_dir = (
event->type ==
WHEELUPMOUSE) ? 1 : -1;
10850 int type =
event->type;
10851 int val =
event->val;
10876 menu, but, level, is_parent_menu, retval))
10881#ifdef USE_KEYNAV_LIMIT
10904 uiBut *but_wrap =
nullptr;
10989 menu, but, level, is_parent_menu, retval))
11095 if ((level != 0) && (but ==
nullptr || !menu->
menu_idname[0])) {
11106 menu, but, level, is_parent_menu, retval))
11139 if ((inside ==
false) && (menu->
menuretval == 0)) {
11154 &saferct->
parent,
float(event->
xy[0]),
float(event->
xy[1])))
11179#ifdef USE_KEYNAV_LIMIT
11194 if ((but_default !=
nullptr) && (but_default->
active ==
nullptr)) {
11208 if (but_active ==
nullptr) {
11213#ifdef USE_DRAG_POPUP
11215 (inside && is_floating && inside_title))
11240 saferct = saferct->
next)
11287#ifdef USE_UI_POPOVER_ONCE
11377 if (!force_close) {
11419 if (but ==
nullptr) {
11476 if (duration > 0.01 *
U.pie_initial_timeout) {
11482 const double final_time = 0.01 *
U.pie_animation_timeout;
11483 float fac = duration / final_time;
11498 center[0] = (vec[0] > 0.01f) ? 0.5f : ((vec[0] < -0.01f) ? -0.5f : 0.0f);
11499 center[1] = (vec[1] > 0.99f) ? 0.5f : ((vec[1] < -0.99f) ? -0.5f : 0.0f);
11529 if (len_sq < 1.0f) {
11558 if (but && (
U.pie_menu_confirm > 0) &&
11559 (dist >=
UI_SCALE_FAC * (
U.pie_menu_threshold +
U.pie_menu_confirm)))
11572 switch (event->
type) {
11574 if (!is_click_style) {
11584 if ((
U.pie_menu_confirm > 0) &&
11585 (dist >=
UI_SCALE_FAC * (
U.pie_menu_threshold +
U.pie_menu_confirm)))
11600 if (is_click_style) {
11653#define CASE_NUM_TO_DIR(n, d) \
11654 case (EVT_ZEROKEY + n): \
11655 case (EVT_PAD0 + n): { \
11656 if (num_dir == UI_RADIAL_NONE) { \
11682#undef CASE_NUM_TO_DIR
11697 const bool is_parent_inside,
11698 const bool is_parent_menu,
11699 const bool is_floating)
11702 bool do_towards_reinit =
false;
11712 bool inside =
false;
11718 if (do_recursion) {
11719 if (is_parent_inside ==
false) {
11720 int mx =
event->xy[0];
11721 int my =
event->xy[1];
11727 C, event, submenu, level + 1, is_parent_inside || inside, is_menu,
false);
11732 if (block->panel) {
11733 int mx =
event->xy[0];
11734 int my =
event->xy[1];
11736 if (!
IN_RANGE(
float(mx), block->rect.xmin, block->rect.xmax)) {
11776 if (do_but_search) {
11785 do_towards_reinit =
true;
11796 bool handled =
false;
11801 retval = retval_test;
11806 if (handled ==
false) {
11808 C, event, menu, level, is_parent_inside, is_parent_menu, is_floating);
11820 if (do_towards_reinit) {
11904 if (region ==
nullptr) {
11910 if (screen ==
nullptr) {
11926 BLI_assert(active_but->semi_modal_state ==
nullptr);
11993 if (
data->menu &&
data->menu->menuretval) {
12046 bool reset_pie =
false;
12083#ifdef USE_DRAG_TOGGLE
12203 const void *rna_poin_data,
12204 const char *rna_prop_id)
12206 uiBlock *block_text =
nullptr;
12207 uiBut *but_text =
nullptr;
12214 block_text = block;
12241 uiBlock *block_text =
nullptr;
12242 uiBut *but_text =
nullptr;
12247 block_text = block;
12275 if (but->
active ==
nullptr) {
12293 if (
data->menu ==
nullptr &&
data->searchbox ==
nullptr) {
12350 const bool is_click)
12355 int unique_retval_ids_len = 0;
12358 unique_retval_ids_len++;
12362 int *unique_retval_ids =
static_cast<int *
>(
12363 MEM_mallocN(
sizeof(*unique_retval_ids) * unique_retval_ids_len, __func__));
12364 unique_retval_ids_len = 0;
12367 unique_retval_ids[unique_retval_ids_len++] = but->
retval;
12371 if (unique_retval_ids_len > 1) {
12374 unique_retval_ids_len);
12375 unique_retval_ids =
static_cast<int *
>(
12376 MEM_reallocN(unique_retval_ids,
sizeof(*unique_retval_ids) * unique_retval_ids_len));
12385 return interaction;
12420 const bool is_click)
12422 if (
data->custom_interaction_handle) {
12431 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)
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)
@ PROF_UPDATE_REMOVE_DOUBLES
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]
#define RGN_ALIGN_ENUM_FROM_MASK(align)
#define UI_LIST_AUTO_SIZE_THRESHOLD
@ UILST_LAYOUT_BIG_PREVIEW_GRID
@ UILST_SCROLL_TO_ACTIVE_ITEM
@ 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)
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a color
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
#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)
void UI_blocklist_free(const bContext *C, ARegion *region)
void(*)(bContext *C, uiLayout *layout, void *arg1) uiMenuCreateFunc
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)
@ UI_BLOCK_MOVEMOUSE_QUIT
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
@ UI_BUT2_FORCE_SEMI_MODAL_ACTIVE
@ UI_BUT2_ACTIVATE_ON_INIT_NO_SELECT
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
BPy_StructRNA * depsgraph
void activate(bool forceActivation=false) const
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
void jump(const btVector3 &v=btVector3(0, 0, 0))
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
void item(std::string text, int icon1, int icon2=0)
void activate(bContext &C)
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)
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
@ UI_PIE_ANIMATION_FINISHED
@ UI_PIE_INITIAL_DIRECTION
@ UI_PIE_GESTURE_END_WAIT
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)
static void init(bNodeTree *, bNode *node)
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
CurveProfilePoint * table
struct MovieTrackingMarker * marker
struct MovieTrackingTrack * track
char idname[BKE_ST_MAXNAME]
struct wmTooltipState * tool_tip
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
struct PointerRNA * custom_activate_opptr
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)