Blender V5.3
interface_intern.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include <functional>
12#include <optional>
13#include <ranges>
14
15#include "BLI_compiler_attrs.hh"
16#include "BLI_enum_flags.hh"
18#include "BLI_string_ref.hh"
19#include "BLI_vector.hh"
20
21#include "BKE_fcurve.hh"
22
23#include "DNA_listBase.h"
24
25#include "RNA_types.hh"
26
27#include "UI_interface.hh"
29#include "UI_resources.hh"
30
32
33struct IconTextOverlay;
34namespace blender {
35
37struct ARegion;
38struct bContext;
39struct bContextStore;
40struct CurveMapping;
41struct CurveProfile;
42struct ID;
43struct ImBuf;
45struct Main;
46struct Scene;
47struct uiListType;
48struct uiStyle;
49struct uiWidgetColors;
50struct UnitSettings;
51struct wmEvent;
52struct wmKeyConfig;
53struct wmOperatorType;
54struct wmTimer;
55
56namespace gpu {
57class Batch;
58}
59
60namespace ui {
61
62struct SafetyRect;
63struct HandleButtonData;
64struct Layout;
65struct UndoStack_Text;
66/* General defines. */
67
68#define RNA_ENUM_VALUE -2
69
70#define UI_MENU_PADDING int(0.2f * UI_UNIT_Y)
71
72#define UI_MENU_WIDTH_MIN (UI_UNIT_Y * 9)
74#define UI_MENU_SUBMENU_PADDING (6 * UI_SCALE_FAC)
75
76/* menu scrolling */
77#define UI_MENU_SCROLL_ARROW (12 * UI_SCALE_FAC)
78#define UI_MENU_SCROLL_MOUSE (UI_MENU_SCROLL_ARROW + 2 * UI_SCALE_FAC)
79#define UI_MENU_SCROLL_PAD (4 * UI_SCALE_FAC)
80
82#define UI_POPOVER_WIDTH_UNITS 10
83
87 UI_SELECT = (1 << 0),
89 UI_SCROLLED = (1 << 1),
97 UI_HOVER = (1 << 2),
98 UI_HAS_ICON = (1 << 3),
99 UI_HIDDEN = (1 << 4),
101 UI_SELECT_DRAW = (1 << 5),
104
109
110 /* WARNING: rest of #Button.flag in `UI_interface_c.hh`. */
111};
112
115{
116 return int64_t(a) | int64_t(b);
117}
119{
120 return int64_t(a) | int64_t(b);
121}
122
135
137#define UI_RADIAL_DIRECTION_NEXT(dir) RadialDirection((int(dir) + 1) % (int(UI_RADIAL_NW) + 1))
139#define UI_RADIAL_DIRECTION_PREV(dir) \
140 RadialDirection(((int(dir) + int(UI_RADIAL_NW))) % (int(UI_RADIAL_NW) + 1))
141
143#define UI_RADIAL_MASK_ALL_DIAGONAL \
144 ((1 << int(UI_RADIAL_NE)) | (1 << int(UI_RADIAL_SE)) | (1 << int(UI_RADIAL_SW)) | \
145 (1 << int(UI_RADIAL_NW)))
146#define UI_RADIAL_MASK_ALL_AXIS_ALIGNED \
147 ((1 << int(UI_RADIAL_N)) | (1 << int(UI_RADIAL_S)) | (1 << int(UI_RADIAL_E)) | \
148 (1 << int(UI_RADIAL_W)))
149
150extern const char radial_dir_order[8];
151extern const char radial_dir_to_numpad[8];
152extern const short radial_dir_to_angle[8];
153
154/* internal panel drawing defines */
155#define PNL_HEADER (UI_UNIT_Y * 1.25) /* 24 default */
156
157/* bit button defines */
158/* Bit operations */
159#define UI_BITBUT_TEST(a, b) (((a) & (1 << (b))) != 0)
160#define UI_BITBUT_VALUE_TOGGLED(a, b) ((a) ^ (1 << (b)))
161#define UI_BITBUT_VALUE_ENABLED(a, b) ((a) | (1 << (b)))
162#define UI_BITBUT_VALUE_DISABLED(a, b) ((a) & ~(1 << (b)))
163
164/* bit-row */
165#define UI_BITBUT_ROW(min, max) \
166 (((max) >= 31 ? 0xFFFFFFFF : (1 << ((max) + 1)) - 1) - ((min) ? ((1 << (min)) - 1) : 0))
167
169#define USE_NUMBUTS_LR_ALIGN
170
172enum {
176 PIE_DRAG_STYLE = (1 << 2),
178 PIE_INVALID_DIR = (1 << 3),
180 PIE_CLICK_STYLE = (1 << 4),
185};
186
187#define PIE_CLICK_THRESHOLD_SQ 50.0f
188
190#define PIE_MAX_ITEMS 8
191
192enum class TextDirection : int8_t {
193 Default, /* Horizontal. */
195 Up,
196};
197
199
201 Layout *layout = nullptr;
203 int drawflag = 0;
204
206
209 bool bit = false;
210 /* 0-31 bit index. */
211 char bitnr = 0;
212
215
220 int retval = 0;
221 short strwidth = 0;
222 short alignnr = 0;
223 int ofs = 0, pos = 0, selsta = 0, selend = 0;
224
229 uchar col[4] = {0};
230
231 std::string str;
232
233 std::string drawstr;
234
235 char *placeholder = nullptr;
236
238 rctf rect = {};
239
240 char *poin = nullptr;
241 float hardmin = 0, hardmax = 0, softmin = 0, softmax = 0;
242
245
247 void *func_arg1 = nullptr;
248 void *func_arg2 = nullptr;
253 std::function<void(bContext &)> apply_func;
254
256 void *func_argN = nullptr;
259
260 const bContextStore *context = nullptr;
261
263 void *autofunc_arg = nullptr;
264
267 void *hold_argN = nullptr;
268
271 void *tip_arg = nullptr;
274 std::function<std::string(const Button *)> tip_quick_func;
275
277
279 const char *disabled_info = nullptr;
280
283
289 bool changed = false;
290
291 BIFIconID icon = ICON_NONE;
293 float icon_scale = 1.0f;
294
296 float search_weight = 0.0f;
297
298 short iconadd = 0;
301
303 bool menu_no_hover_open = false;
304
307
310
312
313 /* RNA data */
316 int rnaindex = 0;
317
319 void *dragpoin = nullptr;
320 const ImBuf *imb = nullptr;
321 float imb_scale = 0;
324
330 /* Operator data */
333 PointerRNA *opptr = nullptr;
334
335 ListBaseT<ButtonExtraOpIcon> extra_op_icons = {nullptr, nullptr};
336
354
356 void *custom_data = nullptr;
357
358 char *editstr = nullptr;
359 double *editval = nullptr;
360 float *editvec = nullptr;
361
362 std::function<bool(const Button &)> pushed_state_func;
363
364 /* pointer back */
365 Block *block = nullptr;
366
367 Button() = default;
369 explicit Button(const Button &other) = default;
371 Button &operator=(const Button &other) = delete;
372
373 virtual ~Button() = default;
374};
375
377 int wrap_width = 0;
378 float aspect = 0.0f;
379 std::string text;
381};
382
384struct ButtonText : public Button {
385 std::function<void(bContext &, StringRefNull)> rename_func = nullptr;
386 char *rename_orig = nullptr;
391 std::function<void(StringRefNull new_name)> rename_full_func = nullptr;
392 std::string rename_full_new;
394 bool use_label_style = false;
395};
396
398struct ButtonTextBox : public Button {
399
402
404
406 std::unique_ptr<TextWrapCache> wrap_cache;
407
409 std::unique_ptr<TextWrapCache> placeholder_wrap_cache;
410
412 int line_scroll() const;
413 int visible_lines() const;
414};
415
417struct ButtonPush : public Button {
418 bool draw_as_link = false;
420 bool draw_as_overlay = false;
421};
422
424struct ButtonNumber : public Button {
425 float step_size = 0.0f;
426 float precision = 0.0f;
427};
428
430struct ButtonNumberSlider : public Button {
431 float step_size = 0.0f;
432 float precision = 0.0f;
433};
434
436struct ButtonColor : public Button {
437 bool is_palette_color = false;
439};
440
442struct ButtonTab : public Button {
443 MenuType *menu = nullptr;
444};
445
474
479struct ButtonDecorator : public Button {
483 /* The only action allowed to decorators currently is to set or clear animation keyframes.
484 * However, they should be able to do it only under some circumstances (typically, when they do
485 * display animation-related status). */
487};
488
496
500};
501
507
509struct ButtonLabel : public Button {
510 float alpha_factor = 1.0f;
512 bool draw_icon_border = false;
513
521 std::shared_ptr<TextWrapCache> wrap_cache;
523 std::shared_ptr<MarkdownLayoutCache> markdown_cache;
525 int max_lines = 0;
527};
528
530struct ButtonImage : public Button {
532 std::string key;
533};
534
536struct ButtonScrollBar : public Button {
538 float visual_height = -1.0f;
539};
540
541struct ButtonViewItem : public Button {
548 int draw_width = 0;
549 int draw_height = 0;
550};
551
556
558struct ButtonColorBand : public Button {
560};
561
563struct ButtonCurveProfile : public Button {
565};
566
572
577
585
598
601
611
617
618 /*
619 * RGB in color picker used for number sliders, when the space is not scene linear.
620 * When it is linear, the RNA property is used directly so that keyframing works.
621 */
623
624 /* Hex Color string */
625 char hexcol[128];
626
631 char tooltip_area[128];
632
638
641};
642
644 ListBaseT<ColorPicker> list = {nullptr, nullptr};
645};
646
649 const char *title = nullptr;
650 int icon = 0;
651
654 float pie_dir[2] = {};
655 float pie_center_init[2] = {};
656 float pie_center_spawned[2] = {};
657 float last_pos[2] = {};
658 double duration_gesture = 0.0;
659 int flags = 0;
661 short event_type = 0;
662 float alphafac = 0.0f;
663};
664
671
672/* #ButtonGroup.flag. */
680
691
697
698enum class BlockAlertLevel : int8_t { None, Info, Success, Warning, Error };
699
700struct ButStore;
701struct ViewLink;
702
703struct Block {
704 Block *next = nullptr, *prev = nullptr;
705
709
710 Panel *panel = nullptr;
711 Block *oldblock = nullptr;
712
714 ListBaseT<ButStore> butstore = {nullptr, nullptr};
715
717
718 ListBaseT<LayoutRoot> layouts = {nullptr, nullptr};
719 Layout *curlayout = nullptr;
720
722
726 ListBaseT<ViewLink> views = {nullptr, nullptr};
727
728 ListBaseT<BlockDynamicListener> dynamic_listeners = {nullptr, nullptr};
729
730 std::string name;
731
732 float winmat[4][4] = {};
733
734 rctf rect = {};
735 float aspect = 0.0f;
736
738
741
743 void *func_arg1 = nullptr;
744 void *func_arg2 = nullptr;
745
747 void *func_argN = nullptr;
750
752 void *handle_func_arg = nullptr;
753
756
758 int (*block_event_func)(const bContext *C, Block *, const wmEvent *) = nullptr;
759
761 std::function<void(const bContext *, rcti *)> drawextra;
762
763 int flag = 0;
764 short alignnr = 0;
768 short content_hints = 0; /* #eBlockContentHints */
769
770 char direction = 0;
772 char theme_style = 0;
775 bool auto_open = false;
776 double auto_open_last = 0.0;
777
778 const char *lockstr = nullptr;
779
780 bool lock = false;
782 bool active = false;
784 bool tooltipdisabled = false;
786 bool endblock = false;
790
794 int bounds_offset[2] = {};
796 int bounds = 0, minbounds = 0;
797
800 ListBaseT<SafetyRect> saferct = {nullptr, nullptr};
801
803
807 bool ui_operator_free = false;
808
810 void *evil_C = nullptr;
811
814 const UnitSettings *unit = nullptr;
817
820
825 char display_device[64] = "";
826
827 std::unique_ptr<PieMenuData> pie_data;
828
829 void remove_but(const Button *but);
830 [[nodiscard]] Button *first_but() const;
831 [[nodiscard]] Button *last_but() const;
832 int but_index(const Button *but) const;
833 [[nodiscard]] Button *next_but(const Button *but) const;
834 [[nodiscard]] Button *prev_but(const Button *but) const;
835
836 static Button &button_ptr_dereference(const std::unique_ptr<Button> &button)
837 {
838 return *button;
839 }
840
842 std::ranges::transform_view<std::ranges::ref_view<const Vector<std::unique_ptr<Button>>>,
843 Button &(*)(const std::unique_ptr<Button> &)>
844 buttons() const
845 {
846 return this->buttons_ptrs | std::views::transform(button_ptr_dereference);
847 }
848};
849
855/* `interface.cc` */
856
857void fontscale(float *points, float aspect);
858
860void button_to_pixelrect(rcti *rect, const ARegion *region, const Block *block, const Button *but);
861rcti rect_to_pixelrect(const ARegion *region, const Block *block, const rctf *src_rect);
862
863void block_to_region_fl(const ARegion *region, const Block *block, float *x, float *y);
864void block_to_window_fl(const ARegion *region, const Block *block, float *x, float *y);
865void block_to_window(const ARegion *region, const Block *block, int *x, int *y);
866void block_to_region_rctf(const ARegion *region,
867 const Block *block,
868 rctf *rct_dst,
869 const rctf *rct_src);
870void block_to_window_rctf(const ARegion *region,
871 const Block *block,
872 rctf *rct_dst,
873 const rctf *rct_src);
874float block_to_window_scale(const ARegion *region, const Block *block);
878void window_to_block_fl(const ARegion *region, const Block *block, float *x, float *y);
879void window_to_block(const ARegion *region, const Block *block, int *x, int *y);
880void window_to_block_rctf(const ARegion *region,
881 const Block *block,
882 rctf *rct_dst,
883 const rctf *rct_src);
884void window_to_region(const ARegion *region, int *x, int *y);
885void window_to_region_rcti(const ARegion *region, rcti *rect_dst, const rcti *rct_src);
886void window_to_region_rctf(const ARegion *region, rctf *rect_dst, const rctf *rct_src);
887void region_to_window(const ARegion *region, int *x, int *y);
889 const ARegion *region, int region_x, int region_y, int *r_window_x, int *r_window_y);
894void region_winrct_get_no_margin(const ARegion *region, rcti *r_rect);
895
898 void (*listener_func)(const wmRegionListenerParams *params));
899
900double button_value_get(Button *but);
901void button_value_set(Button *but, double value);
905void button_hsv_set(Button *but);
909void button_v3_get(Button *but, float vec[3]);
910void button_v3_set(Button *but, const float vec[3]);
911void button_v4_get(Button *but, float vec[4]);
912void button_v4_set(Button *but, const float vec[4]);
913
915 const rcti *rect, float mx, float my, float *r_val_rad, float *r_val_dist);
920 const ColorPicker *cpicker, const rcti *rect, const float *hsv, float *r_xpos, float *r_ypos);
922 const ButtonHSVCube *hsv_but, const rcti *rect, const float *hsv, float *r_xp, float *r_yp);
923
931 char *str,
932 size_t str_maxncpy,
933 int float_precision,
934 bool use_exp_float,
935 bool *r_use_exp_float) ATTR_NONNULL(1, 2);
936void button_string_get(Button *but, char *str, size_t str_maxncpy) ATTR_NONNULL();
943char *button_string_get_dynamic(Button *but, int *r_str_size);
947void button_convert_to_unit_alt_name(Button *but, char *str, size_t str_maxncpy) ATTR_NONNULL();
948bool button_string_set(bContext *C, Button *but, const char *str) ATTR_NONNULL();
949bool button_string_eval_number(bContext *C, const Button *but, const char *str, double *r_value)
950 ATTR_NONNULL();
961void button_set_string_interactive(bContext *C, Button *but, const char *value);
963
967const char *button_placeholder_get(Button *but);
968
972std::optional<StringRef> button_edit_unit_hint_get(const Button &but);
973
974void def_but_icon(Button *but, int icon, int64_t flag);
978void def_but_icon_clear(Button *but);
979
981
982void button_rna_menu_convert_to_panel_type(Button *but, const char *panel_type);
983void button_rna_menu_convert_to_menu_type(Button *but, const char *menu_type);
984bool button_menu_draw_as_popover(const Button *but);
985
988
996 const Button *but,
997 const wmOperatorCallParams *optype_params);
998
999void button_update(Button *but);
1000void button_update_edited(Button *but);
1008bool button_is_compatible(const Button *but_a, const Button *but_b) ATTR_WARN_UNUSED_RESULT;
1014
1020int button_is_pushed_ex(Button *but, double *value) ATTR_WARN_UNUSED_RESULT;
1022
1023void button_override_flag(Main *bmain, Button *but);
1024
1025void block_bounds_calc(Block *block);
1026
1028void block_cm_to_display_space_v3(Block *block, float pixel[3]);
1029
1030/* `interface_regions.cc` */
1031
1034 bool is_keynav = false;
1037};
1038
1039using BlockHandleCreateFunc = Block *(*)(bContext * C, PopupBlockHandle *handle, void *arg1);
1040
1053
1055 /* internal */
1056 ARegion *region = nullptr;
1057
1059 float towards_xy[2];
1060 double towardstime = 0.0;
1061 bool dotowards = false;
1062
1063 bool popup = false;
1064 void (*popup_func)(bContext *C, void *arg, int event) = nullptr;
1065 void (*cancel_func)(bContext *C, void *arg) = nullptr;
1066 void *popup_arg = nullptr;
1067
1073
1082 bool can_refresh = false;
1083 bool refresh = false;
1084
1086 float scrolloffset = 0.0f;
1087 float scrollmin = 0.0f;
1088 float scrollmax = 0.0f;
1089
1091
1092 /* for operator popups */
1094 ScrArea *ctx_area = nullptr;
1098
1099 /* return values */
1100 int menuretval = 0;
1101 int retvalue = 0;
1102 float retvec[4] = {0.0f, 0.0f, 0.0f, 0.0f};
1103
1105 int direction = 0;
1106
1107 /* Previous values so we don't resize or reposition on refresh. */
1110 short prev_dir1 = 0;
1111 short prev_dir2 = 0;
1112 int prev_bounds_offset[2] = {0, 0};
1113
1114 /* Maximum estimated size to avoid having to reposition on refresh. */
1115 float max_size_x = 0.0f;
1116 float max_size_y = 0.0f;
1117
1118 /* #ifdef USE_DRAG_POPUP */
1119 bool is_grab = false;
1120 int grab_xy_prev[2] = {0, 0};
1121 /* #endif */
1122
1123 char menu_idname[64] = "";
1124
1125 bool mmb_panning = false;
1130};
1131
1132/* -------------------------------------------------------------------- */
1137
1138/* `interface_region_tooltip.cc` */
1139
1140/* exposed as public API in UI_interface.hh */
1141
1142/* `interface_region_color_picker.cc` */
1143
1144void color_picker_rgb_to_hsv_compat(const float rgb[3], float r_cp[3]);
1145void color_picker_rgb_to_hsv(const float rgb[3], float r_cp[3]);
1146void color_picker_hsv_to_rgb(const float r_cp[3], float rgb[3]);
1147
1152bool button_is_color_gamma(Button *but);
1153
1158
1159void scene_linear_to_perceptual_space(Button *but, float rgb[3]);
1160void perceptual_to_scene_linear_space(Button *but, float rgb[3]);
1161
1162Block *block_func_COLOR(bContext *C, PopupBlockHandle *handle, void *arg_but);
1164
1165/* `interface_region_search.cc` */
1166
1172ARegion *searchbox_create_menu(bContext *C, ARegion *butregion, ButtonSearch *search_but);
1173
1177bool searchbox_inside(ARegion *region, const int xy[2]) ATTR_NONNULL(1, 2);
1178int searchbox_find_index(ARegion *region, const char *name);
1182void searchbox_update(bContext *C, ARegion *region, Button *but, bool reset);
1183int searchbox_autocomplete(bContext *C, ARegion *region, Button *but, char *str);
1184bool searchbox_event(
1185 bContext *C, ARegion *region, Button *but, ARegion *butregion, const wmEvent *event);
1189bool searchbox_apply(Button *but, ARegion *region);
1190void searchbox_free(bContext *C, ARegion *region);
1195
1196/* `interface_region_menu_popup.cc` */
1197
1198int button_menu_step(Button *but, int direction);
1199bool button_menu_step_poll(const Button *but);
1201void popup_menu_memory_set(Block *block, Button *but);
1202
1206Block *popup_block_refresh(bContext *C, PopupBlockHandle *handle, ARegion *butregion, Button *but);
1207
1209 ARegion *butregion,
1210 Button *but,
1211 BlockCreateFunc create_func,
1212 BlockHandleCreateFunc handle_create_func,
1213 void *arg,
1214 FreeArgFunc arg_free,
1215 bool can_refresh);
1230 ARegion *butregion,
1231 Button *but,
1232 MenuCreateFunc menu_func,
1233 void *arg,
1234 bool can_refresh);
1235
1236/* `interface_region_popover.cc` */
1237
1238using PopoverCreateFunc = std::function<void(bContext *, Layout *, PanelType *)>;
1239
1241 ARegion *butregion,
1242 Button *but,
1243 PopoverCreateFunc popover_func,
1244 const PanelType *panel_type);
1245
1246/* `interface_region_menu_pie.cc` */
1247
1251void pie_menu_level_create(Block *block,
1252 wmOperatorType *ot,
1253 StringRefNull propname,
1254 IDProperty *properties,
1255 const EnumPropertyItem *items,
1256 int totitem,
1257 wm::OpCallContext context,
1258 eUI_Item_Flag flag);
1259
1260/* `interface_region_popup.cc` */
1261
1265void popup_translate(ARegion *region, const int mdiff[2]);
1267void popup_block_scrolltest(Block *block);
1268
1270
1271/* `interface_panel.cc` */
1272
1279 const wmEvent *event,
1280 ARegion *region,
1281 const Button *active_but);
1285void draw_aligned_panel(const ARegion *region,
1286 const uiStyle *style,
1287 const Block *block,
1288 const rcti *rect,
1289 bool show_pin,
1290 bool show_background,
1291 bool region_search_filter_active);
1292void draw_layout_panels_backdrop(const ARegion *region,
1293 const Panel *panel,
1294 const float radius,
1295 float subpanel_backcolor[4]);
1296void panel_drag_collapse_handler_add(const bContext *C, const bool was_open);
1300LayoutPanelHeader *layout_panel_header_under_mouse(const Panel &panel, const int my);
1302void layout_panel_popup_scroll_apply(Panel *panel, const float dy);
1303
1307void draw_gradient(const rcti *rect,
1308 const float hsv[3],
1309 eButGradientType type,
1310 float alpha,
1311 const ColorManagedDisplay *display);
1312
1319void draw_rounded_corners_inverted(const rcti &rect, const float rad, const float4 color);
1320
1321void draw_but_TAB_outline(const rcti *rect,
1322 float rad,
1323 uchar highlight[3],
1324 uchar highlight_fade[3]);
1325void draw_but_HISTOGRAM(ARegion *region,
1326 Button *but,
1327 const uiWidgetColors *wcol,
1328 const rcti *recti);
1329void draw_but_WAVEFORM(const bContext *C,
1330 ARegion *region,
1331 Button *but,
1332 const uiWidgetColors *wcol,
1333 const rcti *recti);
1334void draw_but_VECTORSCOPE(const bContext *C,
1335 ARegion *region,
1336 Button *but,
1337 const uiWidgetColors *wcol,
1338 const rcti *recti);
1339void draw_but_COLORBAND(Button *but, const uiWidgetColors *wcol, const rcti *rect);
1340void draw_but_UNITVEC(Button *but, const uiWidgetColors *wcol, const rcti *rect, float radius);
1341void draw_but_CURVE(ARegion *region, Button *but, const uiWidgetColors *wcol, const rcti *rect);
1345void draw_but_CURVEPROFILE(ARegion *region,
1346 Button *but,
1347 const uiWidgetColors *wcol,
1348 const rcti *rect);
1349void draw_but_IMAGE(ARegion *region, Button *but, const uiWidgetColors *wcol, const rcti *rect);
1350void draw_but_TRACKPREVIEW(ARegion *region,
1351 Button *but,
1352 const uiWidgetColors *wcol,
1353 const rcti *recti);
1354
1355/* `interface_undo.cc` */
1356
1369void textedit_undo_push(UndoStack_Text *stack, const char *text, int cursor_index);
1370const char *textedit_undo(UndoStack_Text *stack, int direction, int *r_cursor_index);
1371
1372/* `interface_handlers.cc` */
1373
1375
1380void pan_to_scroll(const wmEvent *event, int *type, int *val);
1386void button_activate_event(bContext *C, ARegion *region, Button *but);
1393void button_activate_over(bContext *C, ARegion *region, Button *but);
1394void button_execute_begin(bContext *C, ARegion *region, Button *but, void **active_back);
1395void button_execute_end(bContext *C, ARegion *region, Button *but, void *active_back);
1396void button_active_free(const bContext *C, Button *but);
1402void button_update_view_for_active(const bContext *C, const Block *block);
1404void button_text_password_hide(std::string &password_str, Button *but, bool restore);
1410Button *button_find_select_in_enum(Button *but, int direction);
1411bool button_is_editing(const Button *but);
1412float block_calc_pie_segment(Block *block, const float event_xy[2]);
1413
1414/* XXX, this code will shorten any allocated string to 'UI_MAX_NAME_STR'
1415 * since this is really long its unlikely to be an issue,
1416 * but this could be supported */
1417void button_add_shortcut(Button *but, const char *shortcut_str, bool do_strip);
1419bool button_rna_equals(const Button *a, const Button *b);
1420bool button_rna_equals_ex(const Button *but,
1421 const PointerRNA *ptr,
1422 const PropertyRNA *prop,
1423 int index);
1424Button *button_find_old(Block *block_old, const Button *but_new);
1425Button *button_find_new(Block *block_new, const Button *but_old);
1427int button_text_padding(const Button *but);
1428
1429#ifdef WITH_INPUT_IME
1430void button_ime_reposition(Button *but, int x, int y);
1431const wmIMEData *button_ime_data_get(Button *but);
1432#endif
1433
1434/* `interface_widgets.cc` */
1435
1439 float radi, rad;
1440 float facxi, facyi;
1444 float color_tria[4];
1448 /* We pack alpha check and discard factor in alpha_discard.
1449 * If the value is negative then we do alpha check.
1450 * The absolute value itself is the discard factor.
1451 * Initialize value to 1.0f if you don't want discard. */
1454 float _pad[3];
1455};
1456
1457enum {
1465
1466 ROUNDBOX_TRIA_MAX, /* don't use */
1467};
1468
1469gpu::Batch *batch_roundbox_widget_get();
1470gpu::Batch *batch_roundbox_shadow_get();
1471
1472void draw_menu_back(uiStyle *style, Block *block, const rcti *rect);
1473void draw_popover_back(ARegion *region, uiStyle *style, Block *block, const rcti *rect);
1474void draw_pie_center(Block *block);
1476
1477void draw_widget_menu_back_color(const rcti *rect, bool use_shadow, const float color[4]);
1478void draw_widget_menu_back(const rcti *rect, bool use_shadow);
1479void draw_tooltip_background(const uiStyle *style, Block *block, const rcti *rect);
1480
1484void draw_button(const bContext *C, ARegion *region, uiStyle *style, Button *but, rcti *rect);
1485
1500
1511void draw_menu_item(const uiFontStyle *fstyle,
1512 rcti *rect,
1513 rcti *back_rect,
1514 float zoom,
1515 bool use_unpadded,
1516 const char *name,
1517 int iconid,
1518 int64_t but_flag,
1519 MenuItemSeparatorType separator_type,
1520 int *r_xmax);
1521void draw_preview_item(const uiFontStyle *fstyle,
1522 rcti *rect,
1523 float zoom,
1524 const char *name,
1525 int iconid,
1526 int64_t but_flag,
1527 FontStyleAlign text_align);
1532void draw_preview_item_stateless(const uiFontStyle *fstyle,
1533 rcti *rect,
1534 StringRef name,
1535 int iconid,
1536 const uchar text_col[4],
1537 FontStyleAlign text_align,
1538 const bool add_padding);
1539
1540#define UI_TEXT_MARGIN_X 0.4f
1541#define UI_POPUP_MARGIN (UI_SCALE_FAC * 12)
1546#define UI_POPUP_MENU_TOP int(10 * UI_SCALE_FAC)
1547
1548#define UI_PIXEL_AA_JITTER 8
1549extern const float ui_pixel_jitter[UI_PIXEL_AA_JITTER][2];
1550
1551/* `interface_style.cc` */
1552
1557void style_init();
1558
1559/* `interface_icons.cc` */
1560
1562bool icon_is_preview_deferred_loading(int icon_id, bool big);
1563int id_icon_get(const bContext *C, ID *id, bool big);
1564
1565/* `interface_icons_event.cc` */
1566
1567float event_icon_offset(int icon_id);
1568
1570 float x, float y, int w, int h, int icon_id, float aspect, float alpha, bool inverted);
1571
1572/* `resources.cc` */
1573
1574void resources_init();
1575void resources_free();
1576
1577/* `interface_layout.cc` */
1578
1579void layout_add_but(Layout *layout, Button *but);
1580void layout_remove_but(Layout *layout, const Button *but);
1584bool layout_replace_but_ptr(Layout *layout, const void *old_but_ptr, Button *new_but);
1585
1591void button_configure_search(Button *but,
1592 PointerRNA *ptr,
1593 PropertyRNA *prop,
1594 PointerRNA *searchptr,
1595 PropertyRNA *searchprop,
1596 PropertyRNA *item_searchprop,
1597 bool results_are_suggestions);
1603void layout_list_set_labels_active(Layout *layout);
1604/* menu callback */
1605void item_menutype_func(bContext *C, Layout *layout, void *arg_mt);
1606void item_paneltype_func(bContext *C, Layout *layout, void *arg_pt);
1607
1608/* `interface_button_group.cc` */
1609
1614void block_new_button_group(Block *block, ButtonGroupFlag flag);
1615void button_group_add_but(Block *block, Button *but);
1616void button_group_replace_but_ptr(Block *block, const Button *old_but_ptr, Button *new_but);
1617
1618/* `interface_drag.cc` */
1619
1620void button_drag_free(Button *but);
1621bool button_drag_is_draggable(const Button *but);
1622void button_drag_start(bContext *C, Button *but);
1623
1624/* `interface_align.cc` */
1625
1626bool button_can_align(const Button *but) ATTR_WARN_UNUSED_RESULT;
1635void block_align_calc(Block *block, const ARegion *region);
1636
1637/* `interface_anim.cc` */
1638
1639void button_anim_flag(Button *but, const AnimationEvalContext *anim_eval_context);
1640void button_anim_copy_driver(bContext *C);
1641void button_anim_paste_driver(bContext *C);
1646bool button_anim_expression_get(Button *but, char *str, size_t str_maxncpy);
1647bool button_anim_expression_set(Button *but, const char *str);
1651bool button_anim_expression_create(Button *but, const char *str);
1652void button_anim_autokey(bContext *C, Button *but, Scene *scene, float cfra);
1653
1654void button_anim_decorate_cb(bContext *C, void *arg_but, void *arg_dummy);
1655void button_anim_decorate_update_from_flag(ButtonDecorator *but);
1659bool button_anim_decorate_pushed_state(ButtonDecorator *but);
1660
1661/* `interface_query.cc` */
1662
1663bool button_is_editable(const Button *but) ATTR_WARN_UNUSED_RESULT;
1665bool button_is_toggle(const Button *but) ATTR_WARN_UNUSED_RESULT;
1671bool button_is_interactive_ex(const Button *but, const bool labeledit, const bool for_tooltip);
1672bool button_is_interactive(const Button *but, bool labeledit) ATTR_WARN_UNUSED_RESULT;
1674bool button_has_array_value(const Button *but) ATTR_WARN_UNUSED_RESULT;
1675int button_icon(const Button *but);
1676void button_pie_dir(RadialDirection dir, float vec[2]);
1677
1678bool button_is_cursor_warp(const Button *but) ATTR_WARN_UNUSED_RESULT;
1679
1680bool button_contains_pt(const Button *but, float mx, float my) ATTR_WARN_UNUSED_RESULT;
1681bool button_contains_rect(const Button *but, const rctf *rect);
1682bool but_contains_point_px_icon(const Button *but,
1683 ARegion *region,
1684 const wmEvent *event) ATTR_WARN_UNUSED_RESULT;
1685bool button_contains_point_px(const Button *but, const ARegion *region, const int xy[2])
1687
1689 const wmEvent *event) ATTR_WARN_UNUSED_RESULT;
1690Button *listrow_find_mouse_over(const ARegion *region, const int xy[2])
1692Button *listrow_find_index(const ARegion *region,
1693 int index,
1695Button *view_item_find_mouse_over(const ARegion *region, const int xy[2]) ATTR_NONNULL(1, 2);
1696Button *view_item_find_active(const ARegion *region, const AbstractView *view = nullptr);
1698
1699using ButtonFindPollFn = bool (*)(const Button *but, const void *customdata);
1704 const int xy[2],
1705 bool labeledit,
1706 bool for_tooltip,
1707 const ButtonFindPollFn find_poll,
1708 const void *find_custom_data)
1710Button *button_find_rect_over(const ARegion *region, const rcti *rect_px) ATTR_WARN_UNUSED_RESULT;
1711
1712Button *listbox_find_mouse_over_ex(const ARegion *region, const int xy[2])
1714
1716
1719size_t button_tip_len_only_first_line(const Button *but);
1720
1725bool button_opens_link(const Button *button);
1726std::string button_get_link(const Button *button, bContext *C);
1727bool button_draw_as_link(const Button *button);
1728
1729Button *block_active_but_get(const Block *block);
1734
1735Block *block_find_mouse_over_ex(const ARegion *region, const int xy[2], bool only_clip)
1736 ATTR_NONNULL(1, 2);
1737Block *block_find_mouse_over(const ARegion *region, const wmEvent *event, bool only_clip);
1738
1740 int64_t flag_include,
1741 int64_t flag_exclude);
1743bool region_contains_point_px(const ARegion *region, const int xy[2])
1745bool region_contains_rect_px(const ARegion *region, const rcti *rect_px);
1746
1750ARegion *screen_region_find_mouse_over_ex(bScreen *screen, const int xy[2]) ATTR_NONNULL(1, 2);
1752
1753/* `interface_context_menu.cc` */
1754
1755bool popup_context_menu_for_button(bContext *C, Button *but, const wmEvent *event);
1759int popup_context_menu_for_panel(bContext *C, ARegion *region, Panel *panel);
1760
1761/* `eyedroppers/interface_eyedropper.cc` */
1762
1765
1766/* `eyedroppers/eyedropper_color.cc` */
1767
1769
1770/* `interface_eyedropper_colorband.cc` */
1771
1774
1776
1777/* `eyedroppers/eyedropper_datablock.cc` */
1778
1780
1781/* `eyedroppers/eyedropper_depth.cc` */
1782
1784
1785/* `eyedroppers/eyedropper_driver.cc` */
1786
1788
1789/* `eyedroppers/eyedropper_grease_pencil_colorr.cc` */
1790
1792
1793/* interface_ops_color.cc */
1794
1796
1797/* `templates/interface_template_asset_shelf_popover.cc` */
1799
1818 const bContext *C, void *arg, const char *str, SearchItems *items, bool is_first);
1819
1820/* `interface_ops.cc` */
1821
1823
1824/* `interface_query.cc` */
1825
1827
1828/* `views/interface_view.cc` */
1829
1830void block_free_views(Block *block);
1831void block_views_end(ARegion *region, const Block *block);
1833 const Block &block,
1834 AbstractView &view);
1835void block_views_listen(const Block *block, const wmRegionListenerParams *listener_params);
1836void block_views_draw_overlays(const ARegion *region, const Block *block);
1838 const AbstractView &new_view);
1839
1841 const Block &new_block, const AbstractViewItem &new_item);
1842
1843/* `views/abstract_view_item.cc` */
1844
1846
1847/* `views/interface_templates.cc` */
1848
1850
1852 bContext *C, Main *bmain, ID *owner_id, ID *id, const char **r_undo_push_label);
1853
1858namespace internal {
1859
1881 PointerRNA *ptr, PropertyRNA *prop, bool get_all, int index, bool *r_is_array_prop);
1882
1906 bool is_array_prop,
1907 PointerRNA *dst_ptr,
1908 PropertyRNA *dst_prop);
1909
1910} // namespace internal
1911void panel_region_width_set(ARegion *region, const float aspect, int unscaled_size);
1913
1914} // namespace ui
1915} // namespace blender
#define ATTR_WARN_UNUSED_RESULT
These structs are the foundation for all linked lists in the library system.
struct uiStyle uiStyle
struct uiWidgetColors uiWidgetColors
#define C
Definition RandGen.cpp:29
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
void reset()
Definition scene.h:133
NonMovable(NonMovable &&other)=delete
#define str(s)
#define UI_PIXEL_AA_JITTER
ccl_device_inline float3x3 inverted(const float3x3 m)
int paste_property_drivers(Span< FCurve * > src_drivers, bool is_array_prop, PointerRNA *dst_ptr, PropertyRNA *dst_prop)
Vector< FCurve * > get_property_drivers(PointerRNA *ptr, PropertyRNA *prop, bool get_all, int index, bool *r_is_array_prop)
void button_execute_begin(bContext *, ARegion *region, Button *but, void **active_back)
bool button_context_poll_operator_ex(bContext *C, const Button *but, const wmOperatorCallParams *optype_params)
void item_menutype_func(bContext *C, Layout *layout, void *arg_mt)
void draw_preview_item(const uiFontStyle *fstyle, rcti *rect, float zoom, const char *name, int iconid, int64_t but_flag, FontStyleAlign text_align)
size_t button_drawstr_len_without_sep_char(const Button *but)
void resources_init()
Definition resources.cc:55
LayoutPanelHeader * layout_panel_header_under_mouse(const Panel &panel, const int my)
void button_anim_decorate_update_from_flag(ButtonDecorator *but)
Block * block_func_COLOR(bContext *C, PopupBlockHandle *handle, void *arg_but)
void button_anim_copy_driver(bContext *C)
void button_update_view_for_active(const bContext *C, const Block *block)
void button_anim_paste_driver(bContext *C)
bool region_contains_rect_px(const ARegion *region, const rcti *rect_px)
void button_search_refresh(ButtonSearch *but)
int button_string_get_maxncpy(Button *but)
void button_execute_end(bContext *C, ARegion *, Button *but, void *active_back)
UndoStack_Text * textedit_undo_stack_create()
void(*)(bContext *C, Layout *layout, void *arg1) MenuCreateFunc
Block * popup_block_refresh(bContext *C, PopupBlockHandle *handle, ARegion *butregion, Button *but)
Button * block_active_but_get(const Block *block)
Block Block * block_find_mouse_over(const ARegion *region, const wmEvent *event, bool only_clip)
void layout_panel_popup_scroll_apply(Panel *panel, const float dy)
void hsvcircle_vals_from_pos(const rcti *rect, float mx, float my, float *r_val_rad, float *r_val_dist)
void perceptual_to_scene_linear_space(Button *but, float rgb[3])
Button * button_prev(Button *but) ATTR_WARN_UNUSED_RESULT
int button_icon(const Button *but)
void button_extra_operator_icons_free(Button *but)
bool button_supports_cycling(const Button *but)
void button_active_free(const bContext *C, Button *but)
void button_v4_set(Button *but, const float vec[4])
void button_active_string_clear_and_exit(bContext *C, Button *but)
void button_anim_flag(Button *but, const AnimationEvalContext *anim_eval_context)
bool layout_panel_toggle_open(const bContext *C, LayoutPanelHeader *header)
bool but_contains_point_px_icon(const Button *but, ARegion *region, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
void draw_tooltip_background(const uiStyle *style, Block *block, const rcti *rect)
gpu::Batch * batch_roundbox_widget_get()
void button_anim_autokey(bContext *C, Button *but, Scene *scene, float cfra)
void draw_but_VECTORSCOPE(const bContext *C, ARegion *region, Button *but, const uiWidgetColors *, const rcti *recti)
void button_group_replace_but_ptr(Block *block, const Button *old_but_ptr, Button *new_but)
void UI_OT_eyedropper_id(wmOperatorType *ot)
ARegion * searchbox_create_menu(bContext *C, ARegion *butregion, ButtonSearch *search_but)
bool icon_is_preview_deferred_loading(const int icon_id, const bool big)
void button_configure_search(Button *but, PointerRNA *ptr, PropertyRNA *prop, PointerRNA *searchptr, PropertyRNA *searchprop, PropertyRNA *item_searchprop, bool results_are_suggestions)
void block_to_region_rctf(const ARegion *region, const Block *block, rctf *rct_dst, const rctf *rct_src)
Definition interface.cc:162
void button_string_get(Button *but, char *str, const size_t str_maxncpy)
bool button_contains_pt(const Button *but, float mx, float my) ATTR_WARN_UNUSED_RESULT
void(*)(bContext *C, void *argN, void *arg2) ButtonHandleNFunc
bool but_contains_password(const Button *but) ATTR_WARN_UNUSED_RESULT
void(*)(bContext *C, void *arg1, void *arg2) ButtonHandleFunc
bool button_menu_draw_as_popover(const Button *but)
void def_but_icon_clear(Button *but)
void block_to_window(const ARegion *region, const Block *block, int *x, int *y)
Definition interface.cc:151
bool button_rna_equals(const Button *a, const Button *b)
Definition interface.cc:790
void button_v4_get(Button *but, float vec[4])
bool button_is_interactive_ex(const Button *but, const bool labeledit, const bool for_tooltip)
int button_is_pushed_ex(Button *but, double *value)
void window_to_block_rctf(const ARegion *region, const Block *block, rctf *rct_dst, const rctf *rct_src)
Definition interface.cc:220
Button * view_item_find_mouse_over(const ARegion *region, const int xy[2]) ATTR_NONNULL(1
void block_views_listen(const Block *block, const wmRegionListenerParams *listener_params)
void resources_free()
Definition resources.cc:60
const ColorManagedDisplay * block_cm_display_get(Block *block)
bool button_menu_step_poll(const Button *but)
void draw_widget_menu_back(const rcti *rect, bool use_shadow)
Button * view_item_find_search_highlight(const ARegion *region)
const char * button_placeholder_get(Button *but)
void button_value_set(Button *but, double value)
void button_range_set_hard(Button *but)
Button * listbox_find_mouse_over_ex(const ARegion *region, const int xy[2]) ATTR_NONNULL(1
const char radial_dir_to_numpad[8]
void button_text_password_hide(std::string &password_str, Button *but, const bool restore)
bool region_contains_point_px(const ARegion *region, const int xy[2]) ATTR_NONNULL(1
void searchbox_update(bContext *C, ARegion *region, Button *but, bool reset)
bool button_is_toggle(const Button *but) ATTR_WARN_UNUSED_RESULT
void draw_but_WAVEFORM(const bContext *C, ARegion *region, Button *but, const uiWidgetColors *, const rcti *recti)
bool button_contains_rect(const Button *but, const rctf *rect)
void draw_aligned_panel(const ARegion *region, const uiStyle *style, const Block *block, const rcti *rect, bool show_pin, bool show_background, bool region_search_filter_active)
void popup_block_free(bContext *C, PopupBlockHandle *handle)
bool button_is_cursor_warp(const Button *but) ATTR_WARN_UNUSED_RESULT
int popup_context_menu_for_panel(bContext *C, ARegion *region, Panel *panel)
ARegion * screen_region_find_mouse_over_ex(bScreen *screen, const int xy[2]) ATTR_NONNULL(1
void button_semi_modal_state_free(const bContext *C, Button *but)
void UI_OT_eyedropper_colorramp(wmOperatorType *ot)
void button_anim_decorate_cb(bContext *C, void *arg_but, void *)
void button_pie_dir(RadialDirection dir, float vec[2])
void button_update_edited(Button *but)
bool button_is_float(const Button *but)
void button_activate_event(bContext *C, ARegion *region, Button *but)
void panel_drag_collapse_handler_add(const bContext *C, const bool was_open)
void button_drag_start(bContext *C, Button *but)
bool(*)(const Button *a, const Button *b) ButtonIdentityCompareFunc
int handler_panel_region(bContext *C, const wmEvent *event, ARegion *region, const Button *active_but)
void layout_remove_but(Layout *layout, const Button *but)
Button * button_find_old(Block *block_old, const Button *but_new)
Definition interface.cc:903
void layout_add_but(Layout *layout, Button *but)
Button * region_find_first_but_test_flag(ARegion *region, int64_t flag_include, int64_t flag_exclude)
void block_cm_to_display_space_v3(Block *block, float pixel[3])
bool searchbox_event(bContext *C, ARegion *region, Button *but, ARegion *butregion, const wmEvent *event)
void window_to_block(const ARegion *region, const Block *block, int *x, int *y)
Definition interface.cc:230
void popup_block_scrolltest(Block *block)
void block_views_draw_overlays(const ARegion *region, const Block *block)
void(*)(void *arg) FreeArgFunc
void UI_OT_eyedropper_colorramp_point(wmOperatorType *ot)
void block_to_region_fl(const ARegion *region, const Block *block, float *x, float *y)
Definition interface.cc:125
bool button_is_compatible(const Button *but_a, const Button *but_b)
bool button_anim_expression_create(Button *but, const char *str)
void window_to_region_rctf(const ARegion *region, rctf *rect_dst, const rctf *rct_src)
Definition interface.cc:255
uiListType * UI_UL_cache_file_layers()
float block_to_window_scale(const ARegion *region, const Block *block)
Definition interface.cc:182
void block_to_window_fl(const ARegion *region, const Block *block, float *x, float *y)
Definition interface.cc:144
void draw_widget_menu_back_color(const rcti *rect, bool use_shadow, const float color[4])
void draw_but_CURVEPROFILE(ARegion *region, Button *but, const uiWidgetColors *wcol, const rcti *rect)
std::function< void(bContext *, Layout *, PanelType *)> PopoverCreateFunc
bool jump_to_target_button_poll(bContext *C)
void block_views_end(ARegion *region, const Block *block)
void draw_popover_back(ARegion *region, uiStyle *style, Block *block, const rcti *rect)
void region_panels_sort_for_search_filter_visibility_change(bContext *C, const ARegion *region)
Button * region_find_active_but(ARegion *region) ATTR_WARN_UNUSED_RESULT
PropertyScaleType button_scale_type(const Button *but)
ARegion *(*)(bContext *C, ARegion *region, const rcti *item_rect, void *arg, void *active) ButtonSearchTooltipFn
Button * popup_menu_memory_get(Block *block)
void draw_but_TAB_outline(const rcti *rect, float rad, uchar highlight[3], uchar highlight_fade[3])
int id_icon_get(const bContext *C, ID *id, const bool big)
void searchbox_free(bContext *C, ARegion *region)
void fontscale(float *points, float aspect)
size_t button_tip_len_only_first_line(const Button *but)
void hsvcube_pos_from_vals(const ButtonHSVCube *hsv_but, const rcti *rect, const float *hsv, float *r_xp, float *r_yp)
const char * textedit_undo(UndoStack_Text *stack, int direction, int *r_cursor_index)
void(*)(bContext *C, ARegion *butregion, Button *but) ButtonHandleHoldFunc
bool block_is_menu(const Block *block) ATTR_WARN_UNUSED_RESULT
rcti rect_to_pixelrect(const ARegion *region, const Block *block, const rctf *src_rect)
bool(*)(bContext *C, int direction, void *arg1) MenuStepFunc
Button * button_drag_multi_edit_get(Button *but)
void draw_but_IMAGE(ARegion *, Button *but, const uiWidgetColors *, const rcti *rect)
void interface_tag_script_reload_queries()
void button_range_set_soft(Button *but)
ColorPicker * block_colorpicker_create(Block *block)
Button * button_find_select_in_enum(Button *but, int direction)
PopupBlockHandle * popup_menu_create(bContext *C, ARegion *butregion, Button *but, MenuCreateFunc menu_func, void *arg, bool can_refresh)
void textedit_undo_stack_destroy(UndoStack_Text *stack)
void draw_menu_back(uiStyle *style, Block *block, const rcti *rect)
bool button_anim_expression_set(Button *but, const char *str)
bool button_is_bool(const Button *but)
void UI_OT_eyedropper_grease_pencil_color(wmOperatorType *ot)
ID * template_id_liboverride_hierarchy_make(bContext *C, Main *bmain, ID *owner_id, ID *id, const char **r_undo_push_label)
void scene_linear_to_perceptual_space(Button *but, float rgb[3])
void region_to_window(const ARegion *region, int *x, int *y)
Definition interface.cc:263
bool button_anim_expression_get(Button *but, char *str, size_t str_maxncpy)
void block_align_calc(Block *block, const ARegion *region)
bool button_color_has_alpha(Button *but)
void view_item_swap_button_pointers(AbstractViewItem &a, AbstractViewItem &b)
void color_picker_rgb_to_hsv(const float rgb[3], float r_cp[3])
void draw_but_COLORBAND(Button *but, const uiWidgetColors *wcol, const rcti *rect)
void button_string_get_ex(Button *but, char *str, const size_t str_maxncpy, const int float_precision, const bool use_exp_float, bool *r_use_exp_float)
static std::unique_ptr< Button > but_new(const ButtonType type)
ARegion * searchbox_create_operator(bContext *C, ARegion *butregion, ButtonSearch *search_but)
Button * button_find_mouse_over_ex(const ARegion *region, const int xy[2], bool labeledit, bool for_tooltip, const ButtonFindPollFn find_poll, const void *find_custom_data) ATTR_NONNULL(1
void(*)(bContext *C, void *arg, int event) BlockHandleFunc
std::optional< StringRef > button_edit_unit_hint_get(const Button &but)
void button_rna_menu_convert_to_menu_type(Button *but, const char *menu_type)
void handle_afterfunc_add_operator(wmOperatorType *ot, wm::OpCallContext opcontext)
int(*)(bContext *C, char *str, void *arg) ButtonCompleteFunc
bool button_string_eval_number(bContext *C, const Button *but, const char *str, double *r_value)
ARegion *(*)(bContext *C, ARegion *butregion, ButtonSearch *search_but) ButtonSearchCreateFn
void button_v3_get(Button *but, float vec[3])
void block_to_window_rctf(const ARegion *region, const Block *block, rctf *rct_dst, const rctf *rct_src)
Definition interface.cc:172
ARegion ARegion * screen_region_find_mouse_over(bScreen *screen, const wmEvent *event)
Block *(*)(bContext *C, ARegion *region, void *arg1) BlockCreateFunc
void draw_but_UNITVEC(Button *but, const uiWidgetColors *wcol, const rcti *rect, const float radius)
void button_set_string_interactive(bContext *C, Button *but, const char *value)
void *(*)(const void *argN) ButtonArgNCopy
bool block_is_popover(const Block *block) ATTR_WARN_UNUSED_RESULT
bool(*)(const Button *but, const void *customdata) ButtonFindPollFn
void window_to_region(const ARegion *region, int *x, int *y)
Definition interface.cc:241
void button_to_pixelrect(rcti *rect, const ARegion *region, const Block *block, const Button *but)
Block *(*)(bContext *C, PopupBlockHandle *handle, void *arg1) BlockHandleCreateFunc
Button Button * view_item_find_active(const ARegion *region, const AbstractView *view=nullptr)
wmKeyMap * eyedropper_modal_keymap(wmKeyConfig *keyconf)
void draw_but_TRACKPREVIEW(ARegion *region, Button *but, const uiWidgetColors *, const rcti *recti)
MenuType * UI_MT_color_space_select()
Button * listrow_find_index(const ARegion *region, int index, Button *listbox) ATTR_WARN_UNUSED_RESULT
void draw_rounded_corners_inverted(const rcti &rect, const float rad, const float4 color)
bool button_rna_equals_ex(const Button *but, const PointerRNA *ptr, const PropertyRNA *prop, int index)
Definition interface.cc:795
void block_new_button_group(Block *block, ButtonGroupFlag flag)
Button * button_find_new(Block *block_new, const Button *but_old)
Definition interface.cc:922
float event_icon_offset(const int icon_id)
const uiWidgetColors * tooltip_get_theme()
int button_menu_step(Button *but, int direction)
double button_value_get(Button *but)
PopupBlockHandle * popup_block_create(bContext *C, ARegion *butregion, Button *but, BlockCreateFunc create_func, BlockHandleCreateFunc handle_create_func, void *arg, FreeArgFunc arg_free, bool can_refresh)
Button * listrow_find_mouse_over(const ARegion *region, const int xy[2]) ATTR_NONNULL(1
void region_winrct_get_no_margin(const ARegion *region, rcti *r_rect)
Definition interface.cc:390
void draw_pie_center(Block *block)
bool button_string_set(bContext *C, Button *but, const char *str)
int button_menu_direction(Button *but)
bool block_is_pie_menu(const Block *block) ATTR_WARN_UNUSED_RESULT
void item_paneltype_func(bContext *C, Layout *layout, void *arg_pt)
bool button_is_editable(const Button *but) ATTR_WARN_UNUSED_RESULT
void rna_collection_search_update_fn(const bContext *C, void *arg, const char *str, SearchItems *items, bool is_first)
void layout_list_set_labels_active(Layout *layout)
bool searchbox_inside(ARegion *region, const int xy[2]) ATTR_NONNULL(1
Button * button_first(Block *block) ATTR_WARN_UNUSED_RESULT
void window_to_region_rcti(const ARegion *region, rcti *rect_dst, const rcti *rct_src)
Definition interface.cc:247
float block_calc_pie_segment(Block *block, const float event_xy[2])
std::optional< StringRefNull > asset_shelf_idname_from_button_context(const Button *but)
void button_convert_to_unit_alt_name(Button *but, char *str, size_t str_maxncpy)
void UI_OT_eyedropper_bone(wmOperatorType *ot)
wmKeyMap * eyedropper_colorband_modal_keymap(wmKeyConfig *keyconf)
void pan_to_scroll(const wmEvent *event, int *type, int *val)
const char radial_dir_order[8]
bool searchbox_apply(Button *but, ARegion *region)
void def_but_icon(Button *but, const int icon, const int64_t flag)
char * button_string_get_dynamic(Button *but, int *r_str_size)
bool button_has_array_value(const Button *but) ATTR_WARN_UNUSED_RESULT
bool button_is_interactive(const Button *but, bool labeledit) ATTR_WARN_UNUSED_RESULT
bool button_drag_is_draggable(const Button *but)
Button * button_last(Block *block) ATTR_WARN_UNUSED_RESULT
void hsvcircle_pos_from_vals(const ColorPicker *cpicker, const rcti *rect, const float *hsv, float *r_xpos, float *r_ypos)
bool button_opens_link(const Button *button)
void color_picker_hsv_to_rgb(const float r_cp[3], float rgb[3])
Button * listbox_find_mouse_over(const ARegion *region, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
bool layout_replace_but_ptr(Layout *layout, const void *old_but_ptr, Button *new_but)
ARegion * searchbox_create_generic(bContext *C, ARegion *butregion, ButtonSearch *search_but)
Button * button_find_rect_over(const ARegion *region, const rcti *rect_px) ATTR_WARN_UNUSED_RESULT
bool button_is_color_gamma(Button &but)
bool popup_context_menu_for_button(bContext *C, Button *but, const wmEvent *event)
bool button_contains_point_px(const Button *but, const ARegion *region, const int xy[2]) ATTR_NONNULL(1
bool button_is_editable_as_text(const Button *but) ATTR_WARN_UNUSED_RESULT
bool button_is_popover_once_compat(const Button *but) ATTR_WARN_UNUSED_RESULT
void button_activate_over(bContext *C, ARegion *region, Button *but)
bool button_anim_decorate_pushed_state(ButtonDecorator *but)
int button_text_padding(const Button *button)
void button_override_flag(Main *bmain, Button *but)
ENUM_OPERATORS(ButPointerType)
void but_handle_data_free(HandleButtonData **data)
void button_v3_set(Button *but, const float vec[3])
void UI_OT_eyedropper_driver(wmOperatorType *ot)
void(*)(bContext &C, TooltipData &data, Button *but, void *argN) ButtonToolTipCustomFunc
void UI_OT_eyedropper_depth(wmOperatorType *ot)
void window_to_block_fl(const ARegion *region, const Block *block, float *x, float *y)
Definition interface.cc:193
bool button_can_align(const Button *but)
void button_group_add_but(Block *block, Button *but)
int searchbox_autocomplete(bContext *C, ARegion *region, Button *but, char *str)
void(*)(const bContext *C, void *arg, const char *str, SearchItems *items, bool is_first) ButtonSearchUpdateFn
void UI_OT_eyedropper_color(wmOperatorType *ot)
void draw_layout_panels_backdrop(const ARegion *region, const Panel *panel, const float radius, float subpanel_backcolor[4])
bool button_context_poll_operator(bContext *C, wmOperatorType *ot, const Button *but)
void popup_menu_memory_set(Block *block, Button *but)
int button_is_pushed(Button *but)
void icon_draw_rect_input(const float x, const float y, const int w, const int h, const int icon_id, const float aspect, const float alpha, const bool inverted)
std::string(*)(bContext *C, void *argN, StringRef tip) ButtonToolTipFunc
void button_hsv_set(Button *but)
void block_add_dynamic_listener(Block *block, void(*listener_func)(const wmRegionListenerParams *params))
PopupBlockHandle * popover_panel_create(bContext *C, ARegion *butregion, Button *but, PopoverCreateFunc popover_func, const PanelType *panel_type)
AbstractView * block_view_find_matching_in_old_block(const Block &new_block, const AbstractView &new_view)
void popup_translate(ARegion *region, const int mdiff[2])
bool int searchbox_find_index(ARegion *region, const char *name)
const float ui_pixel_jitter[UI_PIXEL_AA_JITTER][2]
gpu::Batch * batch_roundbox_shadow_get()
bool button_is_editing(const Button *but)
std::string button_get_link(const Button *button, bContext *C)
void block_bounds_calc(Block *block)
Definition interface.cc:496
const short radial_dir_to_angle[8]
void panel_tag_search_filter_match(Panel *panel)
void draw_but_HISTOGRAM(ARegion *region, Button *but, const uiWidgetColors *, const rcti *recti)
void block_view_persistent_state_restore(const ARegion &region, const Block &block, AbstractView &view)
bool button_draw_as_link(const Button *button)
void(*)(void *argN) ButtonArgNFree
void textedit_undo_push(UndoStack_Text *stack, const char *text, int cursor_index)
void button_rna_menu_convert_to_panel_type(Button *but, const char *panel_type)
bool block_is_popup_any(const Block *block) ATTR_WARN_UNUSED_RESULT
void draw_preview_item_stateless(const uiFontStyle *fstyle, rcti *rect, StringRef name, int iconid, const uchar text_col[4], FontStyleAlign text_align, const bool add_padding)
void panel_region_width_set(ARegion *region, const float aspect, int unscaled_size)
StringRef button_drawstr_without_sep_char(const Button *but) ATTR_NONNULL()
void button_update(Button *but)
bool(*)(bContext *C, void *arg, void *active, const wmEvent *event) ButtonSearchContextMenuFn
void color_picker_rgb_to_hsv_compat(const float rgb[3], float r_cp[3])
void button_add_shortcut(Button *but, const char *shortcut_str, const bool do_strip)
void button_drag_free(Button *but)
void block_free_views(Block *block)
void draw_menu_item(const uiFontStyle *fstyle, rcti *rect, rcti *back_rect, float zoom, bool use_unpadded, const char *name, int iconid, int64_t but_flag, MenuItemSeparatorType separator_type, int *r_xmax)
void(*)(const wmRegionListenerParams *params, void *arg) ButtonSearchListenFn
bool button_is_rna_valid(Button *but)
void draw_gradient(const rcti *rect, const float hsv[3], eButGradientType type, float alpha, const ColorManagedDisplay *display)
Button * button_next(Button *but) ATTR_WARN_UNUSED_RESULT
int button_align_opposite_to_area_align_get(const ARegion *region)
void pie_menu_level_create(Block *block, wmOperatorType *ot, StringRefNull propname, IDProperty *properties, const EnumPropertyItem *items, int totitem, wm::OpCallContext context, eUI_Item_Flag flag)
void draw_but_CURVE(ARegion *region, Button *but, const uiWidgetColors *wcol, const rcti *rect)
Block * block_find_mouse_over_ex(const ARegion *region, const int xy[2], bool only_clip) ATTR_NONNULL(1
int64_t operator|(const ButtonFlag a, const ButtonFlagInternal b)
ButtonViewItem * block_view_find_matching_view_item_but_in_old_block(const Block &new_block, const AbstractViewItem &new_item)
void draw_button(const bContext *C, ARegion *region, uiStyle *style, Button *but, rcti *rect)
bool button_is_unit(const Button *but)
BMesh Iterators.
__int64 int64_t
Definition BKE_text.h:90
unsigned int uint
Definition BKE_text.h:55
wmEventModifierFlag
Definition WM_types.hh:290
VecBase< float, 4 > float4
PropertyScaleType
Definition RNA_types.hh:251
VecBase< int32_t, 2 > int2
unsigned char uchar
Definition BKE_text.h:58
BMesh const char void * data
int BIFIconID
Definition ED_asset.hh:30
void ATTR_NONNULL(1, 2)
signed char int8_t
Definition BKE_text.h:76
ocio::Display ColorManagedDisplay
@ Default
Definition types.hh:129
void(*) listener_func(const wmRegionListenerParams *params)
ButtonHandleNFunc funcN
std::function< void(const bContext *, rcti *)> drawextra
ListBaseT< ViewLink > views
BlockAlertLevel alert_level
Button * last_but() const
Definition interface.cc:311
Vector< ButtonGroup > button_groups
int but_index(const Button *but) const
Definition interface.cc:276
ListBaseT< LayoutRoot > layouts
Vector< std::unique_ptr< bContextStore > > contexts
ListBaseT< SafetyRect > saferct
ListBaseT< ButStore > butstore
static Button & button_ptr_dereference(const std::unique_ptr< Button > &button)
int(*) block_event_func(const bContext *C, Block *, const wmEvent *)
Vector< std::unique_ptr< Button > > buttons_ptrs
BlockBoundsCalc bounds_type
Button * first_but() const
Definition interface.cc:306
Button * prev_but(const Button *but) const
Definition interface.cc:294
Vector< std::shared_ptr< MarkdownLayoutCache > > markdown_layout_cache
Vector< std::shared_ptr< TextWrapCache > > text_wrap_cache
std::ranges::transform_view< std::ranges::ref_view< const Vector< std::unique_ptr< Button > > >, Button &(*)(const std::unique_ptr< Button > &)> buttons() const
BlockHandleFunc handle_func
const UnitSettings * unit
Button * next_but(const Button *but) const
Definition interface.cc:288
ListBaseT< BlockDynamicListener > dynamic_listeners
std::unique_ptr< PieMenuData > pie_data
ButtonArgNFree func_argN_free_fn
PopupBlockHandle * handle
ButtonHandleFunc func
void remove_but(const Button *but)
Definition interface.cc:300
ButtonArgNCopy func_argN_copy_fn
ColorPickerData color_pickers
BlockInteraction_CallbackData custom_interaction_callbacks
wmOperatorCallParams * optype_params
std::shared_ptr< MarkdownLayoutCache > markdown_cache
std::shared_ptr< TextWrapCache > wrap_cache
PopupAttachDirection popup_attach_direction
ButtonSearchCreateFn popup_create_fn
std::shared_ptr< void > arg
ButtonSearchListenFn listen_fn
ButtonSearchContextMenuFn item_context_menu_fn
ButtonSearchTooltipFn item_tooltip_fn
ButtonSearchUpdateFn items_update_fn
void line_scroll_set(int line_scroll)
std::unique_ptr< TextWrapCache > placeholder_wrap_cache
std::unique_ptr< TextWrapCache > wrap_cache
std::function< void(StringRefNull new_name)> rename_full_func
std::function< void(bContext &, StringRefNull)> rename_func
wm::OpCallContext opcontext
ButtonIdentityCompareFunc identity_cmp_func
ButtonArgNFree func_argN_free_fn
Button & operator=(const Button &other)=delete
ButtonToolTipCustomFunc tip_custom_func
ButtonHandleFunc func
std::function< void(bContext &)> apply_func
ButtonToolTipFunc tip_func
eWM_DragDataType dragtype
Button(const Button &other)=default
ButtonCompleteFunc autocomplete_func
std::function< std::string(const Button *)> tip_quick_func
ButtonHandleHoldFunc hold_func
TextDirection text_direction
RadialDirection pie_dir
IconTextOverlay icon_overlay_text
MenuCreateFunc menu_create_func
ButtonArgNCopy func_argN_copy_fn
HandleButtonData * semi_modal_state
BlockCreateFunc block_create_func
wmOperatorType * optype
const bContextStore * context
HandleButtonData * active
virtual ~Button()=default
ButtonHandleNFunc funcN
ListBaseT< ButtonExtraOpIcon > extra_op_icons
std::function< bool(const Button &)> pushed_state_func
ListBaseT< ColorPicker > list
BlockHandleCreateFunc handle_create_func
void(*) cancel_func(bContext *C, void *arg)
void(*) popup_func(bContext *C, void *arg, int event)
Vector< StringRef > wrapped_lines