Blender V5.0
UI_interface_c.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 <string>
14
15#include "BLI_compiler_attrs.h"
16#include "BLI_string_ref.hh"
18#include "BLI_sys_types.h" /* size_t */
19#include "BLI_utildefines.h"
20
21#include "DNA_userdef_types.h"
22
23#include "UI_interface_icons.hh"
24#include "UI_interface_types.hh"
25
26#include "WM_types.hh"
27
28#include "MEM_guardedalloc.h"
29
30/* Struct Declarations */
31
32struct ARegion;
33struct AutoComplete;
34struct Depsgraph;
35struct EnumPropertyItem;
36struct FileSelectParams;
37struct ID;
38struct IDProperty;
39struct ImBuf;
40struct Image;
41struct ImageUser;
42struct ListBase;
43struct MTex;
44struct Panel;
45struct PanelType;
46struct PanelCategoryDyn;
48struct PointerRNA;
49struct PropertyRNA;
50struct ReportList;
51struct ResultBLF;
52struct bContext;
53struct bContextStore;
54struct bNode;
55struct bNodeSocket;
56struct bNodeTree;
57struct bScreen;
58struct MenuType;
59struct rctf;
60struct rcti;
61struct uiButSearch;
62struct uiFontStyle;
63struct uiList;
64struct uiStyle;
65struct uiWidgetColors;
66struct wmDrag;
67struct wmDropBox;
68struct wmEvent;
69struct wmGizmo;
70struct wmKeyConfig;
71struct wmKeyMap;
72struct wmKeyMapItem;
73struct wmMsgBus;
74struct wmOperator;
75struct wmOperatorType;
77struct wmWindow;
78namespace blender::ed::asset {
80}
81namespace blender::ui {
82class AbstractView;
84} // namespace blender::ui
85
86struct uiBlock;
87struct uiBut;
88struct uiButExtraOpIcon;
89struct uiLayout;
91struct uiTooltipData;
92
93/* Defines */
94
100#define UI_SEP_CHAR '|'
101#define UI_SEP_CHAR_S "|"
102
106#define UI_VALUE_INDETERMINATE_CHAR BLI_STR_UTF8_EM_DASH
107
112#define UI_MENU_ARROW_SEP BLI_STR_UTF8_BLACK_RIGHT_POINTING_SMALL_TRIANGLE
113
120#define UI_REGION_OVERLAP_MARGIN (U.widget_unit / 3)
121
123#define UI_SCREEN_MARGIN 10
124
125namespace blender::ui {
127enum class EmbossType : uint8_t {
131 None = 1,
143};
144
145} // namespace blender::ui
146
148enum {
149 UI_DIR_UP = 1 << 0,
150 UI_DIR_DOWN = 1 << 1,
151 UI_DIR_LEFT = 1 << 2,
152 UI_DIR_RIGHT = 1 << 3,
155
157};
158
160enum {
175
176 /* #uiBlock::flags bits 14-17 are identical to #uiBut::drawflag bits. */
177
194};
195
197enum {
201 UI_RETURN_OK = 1 << 1,
210};
211
213enum {
214 /* WARNING: the first 8 flags are internal (see #UI_SELECT definition). */
215
218
224
227 UI_BUT_DRIVEN = 1 << 16,
232 UI_BUT_UNDO = 1 << 20,
233 /* UNUSED = 1 << 21, */
234 UI_BUT_NO_UTF8 = 1 << 22,
235
240
247
261
263 UI_BUT_OVERRIDDEN = 1u << 31u,
264};
265
266enum {
279};
280
282enum {
287
288 /* --- Internal flags. --- */
290};
291
293#define UI_DEFAULT_TEXT_POINTS 11.0f
294
296#define UI_DEFAULT_TITLE_POINTS 11.0f
297
299#define UI_DEFAULT_TOOLTIP_POINTS 11.0f
300
301#define UI_PANEL_WIDTH 340
302#define UI_COMPACT_PANEL_WIDTH 160
303#define UI_SIDEBAR_PANEL_WIDTH 280
304#define UI_NAVIGATION_REGION_WIDTH UI_COMPACT_PANEL_WIDTH
305#define UI_NARROW_NAVIGATION_REGION_WIDTH 100
306
308#define UI_TOOLBAR_COLUMN (1.25f * ICON_DEFAULT_HEIGHT_TOOLBAR)
310#define UI_TOOLBAR_MARGIN (0.5f * ICON_DEFAULT_HEIGHT_TOOLBAR)
312#define UI_TOOLBAR_WIDTH UI_TOOLBAR_MARGIN + UI_TOOLBAR_COLUMN
313
314#define UI_PANEL_CATEGORY_MARGIN_WIDTH (U.widget_unit * 1.0f)
315
316/* Minimum width for a panel showing only category tabs. */
317#define UI_PANEL_CATEGORY_MIN_WIDTH 26.0f
318
319/* Both these margins should be ignored if the panel doesn't show a background (check
320 * #UI_panel_should_show_background()). */
321#define UI_PANEL_MARGIN_X (U.widget_unit * 0.4f)
322#define UI_PANEL_MARGIN_Y (U.widget_unit * 0.1f)
323
330enum {
345
346 /* Button align flag, for drawing groups together.
347 * Used in 'uiBlock.flag', take care! */
353 /* end bits shared with 'uiBlock.flag' */
354
364
367
372
375
378
381
384
387};
388
389enum class ButPointerType : uint8_t {
390 None = 0,
395 // ButPointerType::Function = 192, /* UNUSED */
396 Bit = 1 << 7, /* OR'd with a bit index. */
397};
400#define UI_BUT_POIN_TYPES (ButPointerType::Float | ButPointerType::Short | ButPointerType::Char)
401
468namespace blender::ui {
470{
471 switch (pointer_type) {
473 return sizeof(char) * 8;
475 return sizeof(short) * 8;
477 return sizeof(int) * 8;
478 default:
479 break;
480 }
481 return 0;
482}
483} // namespace blender::ui
484
511
525
526/* Drawing
527 *
528 * Functions to draw various shapes, taking theme settings into account.
529 * Used for code that draws its own UI style elements. */
530
531void UI_draw_roundbox_corner_set(int type);
532void UI_draw_roundbox_aa(const rctf *rect, bool filled, float rad, const float color[4]);
533void UI_draw_roundbox_4fv(const rctf *rect, bool filled, float rad, const float col[4]);
535 const rctf *rect, bool filled, float rad, const unsigned char col[3], unsigned char alpha);
537 const rctf *rect, bool filled, float rad, const float col[3], float alpha);
538void UI_draw_roundbox_4fv_ex(const rctf *rect,
539 const float inner1[4],
540 const float inner2[4],
541 float shade_dir,
542 const float outline[4],
543 float outline_width,
544 float rad);
545
546#if 0 /* unused */
547int UI_draw_roundbox_corner_get();
548#endif
549
550void ui_draw_dropshadow(const rctf *rct, float radius, float width, float aspect, float alpha);
551
552void UI_draw_text_underline(int pos_x, int pos_y, int len, int height, const float color[4]);
553
563 const rctf *rect,
564 const float title_aspect[2],
565 const float action_aspect[2]);
566
568enum {
571};
575void UI_draw_widget_scroll(uiWidgetColors *wcol, const rcti *rect, const rcti *slider, int state);
576
590float UI_text_clip_middle_ex(const uiFontStyle *fstyle,
591 char *str,
592 float okwidth,
593 float minwidth,
594 size_t max_len,
595 char rpart_sep,
596 bool clip_right_if_tight = true);
597
599 const uiFontStyle *fstyle,
600 const char *str,
601 char *clipped_str_buf,
602 const size_t max_len_clipped_str_buf,
603 const float max_line_width,
604 const int max_lines);
605
621
622struct uiSearchItems;
623
624using uiButHandleFunc = void (*)(bContext *C, void *arg1, void *arg2);
625using uiButHandleRenameFunc = void (*)(bContext *C, void *arg, char *origstr);
626using uiButHandleNFunc = void (*)(bContext *C, void *argN, void *arg2);
627using uiButHandleHoldFunc = void (*)(bContext *C, ARegion *butregion, uiBut *but);
628using uiButCompleteFunc = int (*)(bContext *C, char *str, void *arg);
629
634using uiButArgNFree = void (*)(void *argN);
635using uiButArgNCopy = void *(*)(const void *argN);
636
641using uiButIdentityCompareFunc = bool (*)(const uiBut *a, const uiBut *b);
642
643/* Search types. */
645 ARegion *butregion,
646 uiButSearch *search_but);
653 void (*)(const bContext *C, void *arg, const char *str, uiSearchItems *items, bool is_first);
655 void *arg,
656 void *active,
657 const wmEvent *event);
659 ARegion *(*)(bContext * C, ARegion *region, const rcti *item_rect, void *arg, void *active);
660using uiButSearchListenFn = void (*)(const wmRegionListenerParams *params, void *arg);
661
662using uiBlockHandleFunc = void (*)(bContext *C, void *arg, int event);
663
664/* -------------------------------------------------------------------- */
673
687
691 void *arg1);
694 void *arg1,
695 void *user_data);
698 void *arg1,
699 void *user_data);
700
707
709
711
712/* `interface_query.cc` */
713
714bool UI_but_has_quick_tooltip(const uiBut *but);
715bool UI_but_is_tool(const uiBut *but);
717bool UI_but_is_utf8(const uiBut *but);
718#define UI_but_is_decorator(but) ((but)->type == ButType::Decorator)
719
720bool UI_block_is_empty_ex(const uiBlock *block, bool skip_title);
721bool UI_block_is_empty(const uiBlock *block);
722bool UI_block_can_add_separator(const uiBlock *block);
728
735
736uiList *UI_list_find_mouse_over(const ARegion *region, const wmEvent *event);
737
738/* `interface_region_menu_popup.cc` */
739
748struct uiPopupMenu;
749
750uiPopupMenu *UI_popup_menu_begin(bContext *C, const char *title, int icon) ATTR_NONNULL();
758 const char *title,
759 const char *block_name,
760 int icon) ATTR_NONNULL();
767
770 ATTR_NONNULL(1, 2);
771
777void UI_popup_menu_close(const uiBlock *block, bool is_cancel = false);
782void UI_popup_menu_close_from_but(const uiBut *but, bool is_cancel = false);
783
788void UI_popup_menu_retval_set(const uiBlock *block, int retval, bool enable);
798
799/* `interface_region_popover.cc` */
800
801struct uiPopover;
802
804 const char *idname,
805 bool keep_open,
806 ReportList *reports);
807
814uiPopover *UI_popover_begin(bContext *C, int ui_menu_width, bool from_active_button)
815 ATTR_NONNULL(1);
822
823/* `interface_region_menu_pie.cc` */
824
825/* Pie menus */
826struct uiPieMenu;
827
828wmOperatorStatus UI_pie_menu_invoke(bContext *C, const char *idname, const wmEvent *event);
829
830uiPieMenu *UI_pie_menu_begin(bContext *C, const char *title, int icon, const wmEvent *event)
831 ATTR_NONNULL();
834
835/* `interface_region_menu_popup.cc` */
836
837/* Popup Blocks
838 *
839 * Functions used to create popup blocks. These are like popup menus
840 * but allow using all button types and creating their own layout. */
841using uiBlockCreateFunc = uiBlock *(*)(bContext * C, ARegion *region, void *arg1);
842using uiBlockCancelFunc = void (*)(bContext *C, void *arg1);
843
844void UI_popup_block_invoke(bContext *C, uiBlockCreateFunc func, void *arg, uiFreeArgFunc arg_free);
851 bContext *C, uiBlockCreateFunc func, void *arg, uiFreeArgFunc arg_free, bool can_refresh);
854 uiBlockHandleFunc popup_func,
855 uiBlockCancelFunc cancel_func,
856 void *arg,
857 wmOperator *op);
858
867 bool cancel_default,
868 blender::FunctionRef<uiBut *()> confirm_fn,
869 blender::FunctionRef<uiBut *()> cancel_fn);
879 std::optional<blender::StringRef> confirm_text,
880 std::optional<blender::StringRef> cancel_text,
881 const int icon,
882 bool cancel_default,
883 PointerRNA *r_ptr);
884
885#if 0 /* UNUSED */
886void uiPupBlockOperator(bContext *C,
888 wmOperator *op,
890#endif
891
892void UI_popup_block_close(bContext *C, wmWindow *win, uiBlock *block);
893
895
896/* Blocks
897 *
898 * Functions for creating, drawing and freeing blocks. A Block is a
899 * container of buttons and used for various purposes.
900 *
901 * Begin/Define Buttons/End/Draw is the typical order in which these
902 * function should be called, though for popup blocks Draw is left out.
903 * Freeing blocks is done by the screen/ module automatically.
904 */
905
907 ARegion *region,
908 std::string name,
911 Scene *scene,
912 wmWindow *window,
913 ARegion *region,
914 std::string name,
916void UI_block_end_ex(const bContext *C,
917 Main *bmain,
918 wmWindow *window,
919 Scene *scene,
920 ARegion *region,
921 Depsgraph *depsgraph,
922 uiBlock *block,
923 const int xy[2] = nullptr,
924 int r_xy[2] = nullptr);
925void UI_block_end(const bContext *C, uiBlock *block);
929void UI_block_draw(const bContext *C, uiBlock *block);
932void UI_blocklist_draw(const bContext *C, const ListBase *lb);
933void UI_block_update_from_old(const bContext *C, uiBlock *block);
934
935enum {
938};
939void UI_block_theme_style_set(uiBlock *block, char theme_style);
942bool UI_block_is_search_only(const uiBlock *block);
947void UI_block_set_search_only(uiBlock *block, bool search_only);
948
952void UI_block_set_active_operator(uiBlock *block, wmOperator *op, const bool free);
953
957void UI_block_free(const bContext *C, uiBlock *block);
958
959void UI_block_listen(const uiBlock *block, const wmRegionListenerParams *listener_params);
960
964void UI_blocklist_free(const bContext *C, ARegion *region);
965void UI_blocklist_free_inactive(const bContext *C, ARegion *region);
966
972
973void UI_block_region_set(uiBlock *block, ARegion *region);
974
975void UI_block_lock_set(uiBlock *block, bool val, const char *lockstr);
976void UI_block_lock_clear(uiBlock *block);
977
978#define UI_BUTTON_SECTION_MERGE_DISTANCE (UI_UNIT_X * 3)
979/* Separator line between regions if the #uiButtonSectionsAlign is not #None. */
980#define UI_BUTTON_SECTION_SEPERATOR_LINE_WITH (U.pixelsize * 2)
981
982enum class uiButtonSectionsAlign : int8_t { None = 1, Top, Bottom };
992void UI_region_button_sections_draw(const ARegion *region,
993 int /*THemeColorID*/ colorid,
995bool UI_region_button_sections_is_inside_x(const ARegion *region, const int mval_x);
996
1000void UI_block_align_begin(uiBlock *block);
1001void UI_block_align_end(uiBlock *block);
1002
1013
1017void UI_block_bounds_set_normal(uiBlock *block, int addval);
1021void UI_block_bounds_set_text(uiBlock *block, int addval);
1025void UI_block_bounds_set_popup(uiBlock *block, int addval, const int bounds_offset[2]);
1029void UI_block_bounds_set_menu(uiBlock *block, int addval, const int bounds_offset[2]);
1033void UI_block_bounds_set_centered(uiBlock *block, int addval);
1034void UI_block_bounds_set_explicit(uiBlock *block, int minx, int miny, int maxx, int maxy);
1035
1037
1038void UI_block_direction_set(uiBlock *block, char direction);
1042void UI_block_flag_enable(uiBlock *block, int flag);
1043void UI_block_flag_disable(uiBlock *block, int flag);
1044void UI_block_translate(uiBlock *block, float x, float y);
1045
1047
1055
1056void UI_but_flag_enable(uiBut *but, int flag);
1057void UI_but_flag_disable(uiBut *but, int flag);
1058bool UI_but_flag_is_set(uiBut *but, int flag);
1059void UI_but_flag2_enable(uiBut *but, int flag);
1060
1061void UI_but_drawflag_enable(uiBut *but, int flag);
1062void UI_but_drawflag_disable(uiBut *but, int flag);
1063
1064void UI_but_dragflag_enable(uiBut *but, int flag);
1065void UI_but_dragflag_disable(uiBut *but, int flag);
1066
1067void UI_but_disable(uiBut *but, const char *disabled_hint);
1068
1070
1075void UI_but_color_set(uiBut *but, const uchar color[4]);
1076
1077bool UI_but_is_color_gamma(uiBut &but);
1079
1083void UI_but_placeholder_set(uiBut *but, blender::StringRef placeholder_text);
1084
1093 const bContext *C, ARegion *region, uiBlock *block, uiBut *but, bool remove_on_failure);
1094bool UI_but_active_only(const bContext *C, ARegion *region, uiBlock *block, uiBut *but);
1099bool UI_block_active_only_flagged_buttons(const bContext *C, ARegion *region, uiBlock *block);
1100
1104void UI_but_execute(const bContext *C, ARegion *region, uiBut *but);
1105
1106std::optional<std::string> UI_but_online_manual_id(const uiBut *but) ATTR_WARN_UNUSED_RESULT;
1107std::optional<std::string> UI_but_online_manual_id_from_active(const bContext *C)
1109bool UI_but_is_userdef(const uiBut *but);
1110
1111/* Buttons
1112 *
1113 * Functions to define various types of buttons in a block. Postfixes:
1114 * - F: float
1115 * - I: int
1116 * - S: short
1117 * - C: char
1118 * - R: RNA
1119 * - O: operator */
1120
1121uiBut *uiDefBut(uiBlock *block,
1122 uiButTypeWithPointerType but_and_ptr_type,
1123 int retval,
1125 int x,
1126 int y,
1127 short width,
1128 short height,
1129 void *poin,
1130 float min,
1131 float max,
1132 std::optional<blender::StringRef> tip);
1133uiBut *uiDefButF(uiBlock *block,
1134 ButType type,
1135 int retval,
1137 int x,
1138 int y,
1139 short width,
1140 short height,
1141 float *poin,
1142 float min,
1143 float max,
1144 std::optional<blender::StringRef> tip);
1145uiBut *uiDefButI(uiBlock *block,
1146 ButType type,
1147 int retval,
1149 int x,
1150 int y,
1151 short width,
1152 short height,
1153 int *poin,
1154 float min,
1155 float max,
1156 std::optional<blender::StringRef> tip);
1157uiBut *uiDefButBitI(uiBlock *block,
1158 ButType type,
1159 int bit,
1160 int retval,
1162 int x,
1163 int y,
1164 short width,
1165 short height,
1166 int *poin,
1167 float min,
1168 float max,
1169 std::optional<blender::StringRef> tip);
1170uiBut *uiDefButS(uiBlock *block,
1171 ButType type,
1172 int retval,
1174 int x,
1175 int y,
1176 short width,
1177 short height,
1178 short *poin,
1179 float min,
1180 float max,
1181 std::optional<blender::StringRef> tip);
1182uiBut *uiDefButBitS(uiBlock *block,
1183 ButType type,
1184 int bit,
1185 int retval,
1187 int x,
1188 int y,
1189 short width,
1190 short height,
1191 short *poin,
1192 float min,
1193 float max,
1194 std::optional<blender::StringRef> tip);
1195uiBut *uiDefButC(uiBlock *block,
1196 ButType type,
1197 int retval,
1199 int x,
1200 int y,
1201 short width,
1202 short height,
1203 char *poin,
1204 float min,
1205 float max,
1206 std::optional<blender::StringRef> tip);
1207uiBut *uiDefButBitC(uiBlock *block,
1208 ButType type,
1209 int bit,
1210 int retval,
1212 int x,
1213 int y,
1214 short width,
1215 short height,
1216 char *poin,
1217 float min,
1218 float max,
1219 std::optional<blender::StringRef> tip);
1220uiBut *uiDefButR(uiBlock *block,
1221 ButType type,
1222 int retval,
1223 std::optional<blender::StringRef> str,
1224 int x,
1225 int y,
1226 short width,
1227 short height,
1228 PointerRNA *ptr,
1229 blender::StringRefNull propname,
1230 int index,
1231 float min,
1232 float max,
1233 std::optional<blender::StringRef> tip);
1235 ButType type,
1236 int retval,
1237 std::optional<blender::StringRef> str,
1238 int x,
1239 int y,
1240 short width,
1241 short height,
1242 PointerRNA *ptr,
1243 PropertyRNA *prop,
1244 int index,
1245 float min,
1246 float max,
1247 std::optional<blender::StringRef> tip);
1248uiBut *uiDefButO(uiBlock *block,
1249 ButType type,
1252 const std::optional<blender::StringRef> str,
1253 int x,
1254 int y,
1255 short width,
1256 short height,
1257 std::optional<blender::StringRef> tip);
1259 ButType type,
1263 int x,
1264 int y,
1265 short width,
1266 short height,
1267 std::optional<blender::StringRef> tip);
1268
1269uiBut *uiDefIconBut(uiBlock *block,
1270 uiButTypeWithPointerType but_and_ptr_type,
1271 int retval,
1272 int icon,
1273 int x,
1274 int y,
1275 short width,
1276 short height,
1277 void *poin,
1278 float min,
1279 float max,
1280 std::optional<blender::StringRef> tip);
1282 ButType type,
1283 int retval,
1284 int icon,
1285 int x,
1286 int y,
1287 short width,
1288 short height,
1289 int *poin,
1290 float min,
1291 float max,
1292 std::optional<blender::StringRef> tip);
1294 ButType type,
1295 int bit,
1296 int retval,
1297 int icon,
1298 int x,
1299 int y,
1300 short width,
1301 short height,
1302 int *poin,
1303 float min,
1304 float max,
1305 std::optional<blender::StringRef> tip);
1307 ButType type,
1308 int retval,
1309 int icon,
1310 int x,
1311 int y,
1312 short width,
1313 short height,
1314 short *poin,
1315 float min,
1316 float max,
1317 std::optional<blender::StringRef> tip);
1319 ButType type,
1320 int bit,
1321 int retval,
1322 int icon,
1323 int x,
1324 int y,
1325 short width,
1326 short height,
1327 short *poin,
1328 float min,
1329 float max,
1330 std::optional<blender::StringRef> tip);
1332 ButType type,
1333 int bit,
1334 int retval,
1335 int icon,
1336 int x,
1337 int y,
1338 short width,
1339 short height,
1340 char *poin,
1341 float min,
1342 float max,
1343 std::optional<blender::StringRef> tip);
1345 ButType type,
1346 int retval,
1347 int icon,
1348 int x,
1349 int y,
1350 short width,
1351 short height,
1352 PointerRNA *ptr,
1353 blender::StringRefNull propname,
1354 int index,
1355 float min,
1356 float max,
1357 std::optional<blender::StringRef> tip);
1359 ButType type,
1360 int retval,
1361 int icon,
1362 int x,
1363 int y,
1364 short width,
1365 short height,
1366 PointerRNA *ptr,
1367 PropertyRNA *prop,
1368 int index,
1369 float min,
1370 float max,
1371 std::optional<blender::StringRef> tip);
1373 ButType type,
1376 int icon,
1377 int x,
1378 int y,
1379 short width,
1380 short height,
1381 std::optional<blender::StringRef> tip);
1383 ButType type,
1386 int icon,
1387 int x,
1388 int y,
1389 short width,
1390 short height,
1391 std::optional<blender::StringRef> tip);
1393 ButType type,
1394 int retval,
1395 int icon,
1396 int x,
1397 int y,
1398 short width,
1399 short height,
1400 void *poin,
1401 float min,
1402 float max,
1403 std::optional<blender::StringRef> tip);
1405 uiBlock *block, void *imbuf, int x, int y, short width, short height, const uchar color[4]);
1406uiBut *uiDefButAlert(uiBlock *block, int icon, int x, int y, short width, short height);
1409 uiButTypeWithPointerType but_and_ptr_type,
1410 int retval,
1411 int icon,
1413 int x,
1414 int y,
1415 short width,
1416 short height,
1417 void *poin,
1418 std::optional<blender::StringRef> tip);
1420 ButType type,
1421 int retval,
1422 int icon,
1424 int x,
1425 int y,
1426 short width,
1427 short height,
1428 int *poin,
1429 std::optional<blender::StringRef> tip);
1431 ButType type,
1432 int retval,
1433 int icon,
1435 int x,
1436 int y,
1437 short width,
1438 short height,
1439 short *poin,
1440 std::optional<blender::StringRef> tip);
1442 ButType type,
1443 int retval,
1444 int icon,
1445 std::optional<blender::StringRefNull> str,
1446 int x,
1447 int y,
1448 short width,
1449 short height,
1450 PointerRNA *ptr,
1451 blender::StringRefNull propname,
1452 int index,
1453 std::optional<blender::StringRef> tip);
1455 ButType type,
1456 int retval,
1457 int icon,
1458 std::optional<blender::StringRef> str,
1459 int x,
1460 int y,
1461 short width,
1462 short height,
1463 PointerRNA *ptr,
1464 PropertyRNA *prop,
1465 int index,
1466 float min,
1467 float max,
1468 std::optional<blender::StringRef> tip);
1470 ButType type,
1473 int icon,
1475 int x,
1476 int y,
1477 short width,
1478 short height,
1479 std::optional<blender::StringRef> tip);
1481 ButType type,
1484 int icon,
1486 int x,
1487 int y,
1488 short width,
1489 short height,
1490 std::optional<blender::StringRef> tip);
1491
1492void UI_but_operator_set(uiBut *but,
1493 wmOperatorType *optype,
1495 const PointerRNA *opptr = nullptr);
1502
1505
1507 uiBut *but,
1509 const PointerRNA *ptr);
1511const PointerRNA *UI_but_context_ptr_get(const uiBut *but,
1513 const StructRNA *type = nullptr);
1514std::optional<blender::StringRefNull> UI_but_context_string_get(const uiBut *but,
1516std::optional<int64_t> UI_but_context_int_get(const uiBut *but, blender::StringRef name);
1517const bContextStore *UI_but_context_get(const uiBut *but);
1518
1519void UI_but_unit_type_set(uiBut *but, int unit_type);
1520int UI_but_unit_type_get(const uiBut *but);
1521
1522std::optional<EnumPropertyItem> UI_but_rna_enum_item_get(bContext &C, uiBut &but);
1523
1524std::string UI_but_string_get_rna_property_identifier(const uiBut &but);
1525std::string UI_but_string_get_rna_struct_identifier(const uiBut &but);
1526std::string UI_but_string_get_label(uiBut &but);
1532std::string UI_but_string_get_tooltip_label(const uiBut &but);
1533std::string UI_but_string_get_rna_label(uiBut &but);
1535std::string UI_but_string_get_rna_label_context(const uiBut &but);
1536std::string UI_but_string_get_tooltip(bContext &C, uiBut &but);
1537std::string UI_but_string_get_rna_tooltip(bContext &C, uiBut &but);
1542
1543std::string UI_but_extra_icon_string_get_label(const uiButExtraOpIcon &extra_icon);
1544std::string UI_but_extra_icon_string_get_tooltip(bContext &C, const uiButExtraOpIcon &extra_icon);
1546 const uiButExtraOpIcon &extra_icon);
1547
1559enum {
1564 UI_ID_ALONE = 1 << 4,
1565 UI_ID_OPEN = 1 << 3,
1567 UI_ID_LOCAL = 1 << 6,
1570 UI_ID_PIN = 1 << 9,
1575};
1576
1581enum {
1584};
1585
1586/***************************** ID Utilities *******************************/
1587
1588int UI_icon_from_id(const ID *id);
1590int UI_icon_from_report_type(int type);
1593
1594int UI_icon_from_event_type(short event_type, short event_value);
1595int UI_icon_from_keymap_item(const wmKeyMapItem *kmi, int r_icon_mod[KM_MOD_NUM]);
1596
1597uiBut *uiDefMenuBut(uiBlock *block,
1598 uiMenuCreateFunc func,
1599 void *arg,
1601 int x,
1602 int y,
1603 short width,
1604 short height,
1605 std::optional<blender::StringRef> tip);
1607 uiMenuCreateFunc func,
1608 void *arg,
1609 int icon,
1611 int x,
1612 int y,
1613 short width,
1614 short height,
1615 std::optional<blender::StringRef> tip);
1617 uiMenuCreateFunc func,
1618 void *arg,
1619 int icon,
1620 int x,
1621 int y,
1622 short width,
1623 short height,
1624 std::optional<blender::StringRef> tip);
1625
1627 uiBlockCreateFunc func,
1628 void *arg,
1630 int x,
1631 int y,
1632 short width,
1633 short height,
1634 std::optional<blender::StringRef> tip);
1636 uiBlockCreateFunc func,
1637 void *argN,
1639 int x,
1640 int y,
1641 short width,
1642 short height,
1643 std::optional<blender::StringRef> tip,
1644 uiButArgNFree func_argN_free_fn = MEM_freeN,
1645 uiButArgNCopy func_argN_copy_fn = MEM_dupallocN);
1646
1651 uiBlockCreateFunc func,
1652 void *arg,
1653 int retval,
1654 int icon,
1655 int x,
1656 int y,
1657 short width,
1658 short height,
1659 std::optional<blender::StringRef> tip);
1660
1665 void *arg,
1666 int retval,
1667 int icon,
1668 int maxncpy,
1669 int x,
1670 int y,
1671 short width,
1672 short height,
1673 std::optional<blender::StringRef> tip);
1680 IDProperty *properties,
1681 void *arg,
1682 int retval,
1683 int icon,
1684 int maxncpy,
1685 int x,
1686 int y,
1687 short width,
1688 short height,
1689 std::optional<blender::StringRef> tip);
1690
1700
1708
1710
1712 PointerRNA *ptr,
1713 PropertyRNA *prop,
1714 int index,
1715 std::optional<blender::StringRef> name,
1716 int icon,
1717 int x,
1718 int y,
1719 int width,
1720 int height);
1721void uiDefAutoButsArrayR(uiBlock *block,
1722 PointerRNA *ptr,
1723 PropertyRNA *prop,
1724 const int icon,
1725 const int x,
1726 const int y,
1727 const int tot_width,
1728 const int height);
1736 PointerRNA *ptr,
1737 bool (*check_prop)(PointerRNA *ptr,
1738 PropertyRNA *prop,
1739 void *user_data),
1740 void *user_data,
1741 PropertyRNA *prop_activate_init,
1742 eButLabelAlign label_align,
1743 bool compact);
1744
1756
1773 void *poin,
1774 int iconid,
1775 int but_flag,
1776 uint8_t name_prefix_offset);
1777
1794 uiButSearchCreateFn search_create_fn,
1795 uiButSearchUpdateFn search_update_fn,
1796 void *arg,
1797 bool free_arg,
1798 uiFreeArgFunc search_arg_free_fn,
1799 uiButHandleFunc search_exec_fn,
1800 void *active);
1808void UI_but_func_search_set_sep_string(uiBut *but, const char *search_sep_string);
1810
1811#define UI_SEARCHBOX_BOUNDS (6.0f * UI_SCALE_FAC)
1812#define UI_SEARCHBOX_TRIA_H (12.0f * UI_SCALE_FAC)
1824int UI_searchbox_size_x_guess(const bContext *C, const uiButSearchUpdateFn update_fn, void *arg);
1828int UI_search_items_find_index(const uiSearchItems *items, const char *name);
1829
1833void UI_but_hint_drawstr_set(uiBut *but, const char *string);
1834void UI_but_icon_indicator_number_set(uiBut *but, const int indicator_number);
1835void UI_but_icon_indicator_set(uiBut *but, const char *string);
1836void UI_but_icon_indicator_color_set(uiBut *but, const uchar color[4]);
1837
1838void UI_but_node_link_set(uiBut *but, bNodeSocket *socket, const float draw_color[4]);
1839
1840void UI_but_number_step_size_set(uiBut *but, float step_size);
1841void UI_but_number_precision_set(uiBut *but, float precision);
1842
1843void UI_but_number_slider_step_size_set(uiBut *but, float step_size);
1844void UI_but_number_slider_precision_set(uiBut *but, float precision);
1845
1846void UI_but_label_alpha_factor_set(uiBut *but, float alpha_factor);
1847
1848void UI_but_search_preview_grid_size_set(uiBut *but, int rows, int cols);
1849
1851 const std::optional<int> draw_width = std::nullopt,
1852 const std::optional<int> draw_height = std::nullopt);
1853
1854void UI_block_func_handle_set(uiBlock *block, uiBlockHandleFunc func, void *arg);
1855void UI_block_func_set(uiBlock *block, uiButHandleFunc func, void *arg1, void *arg2);
1856void UI_block_funcN_set(uiBlock *block,
1857 uiButHandleNFunc funcN,
1858 void *argN,
1859 void *arg2,
1860 uiButArgNFree func_argN_free_fn = MEM_freeN,
1861 uiButArgNCopy func_argN_copy_fn = MEM_dupallocN);
1862
1863void UI_but_func_rename_set(uiBut *but, uiButHandleRenameFunc func, void *arg1);
1865 std::function<void(std::string &new_name)> rename_full_func);
1866void UI_but_func_set(uiBut *but, uiButHandleFunc func, void *arg1, void *arg2);
1867void UI_but_funcN_set(uiBut *but,
1868 uiButHandleNFunc funcN,
1869 void *argN,
1870 void *arg2,
1871 uiButArgNFree func_argN_free_fn = MEM_freeN,
1872 uiButArgNCopy func_argN_copy_fn = MEM_dupallocN);
1873
1874void UI_but_func_complete_set(uiBut *but, uiButCompleteFunc func, void *arg);
1875
1877 std::function<void(const bContext *C, rcti *rect)> func);
1878
1880
1887
1888void UI_but_func_tooltip_set(uiBut *but, uiButToolTipFunc func, void *arg, uiFreeArgFunc free_arg);
1898void UI_but_func_quick_tooltip_set(uiBut *but, std::function<std::string(const uiBut *but)> func);
1899
1901 UI_TIP_STYLE_NORMAL = 0, /* Regular text. */
1902 UI_TIP_STYLE_HEADER, /* Header text. */
1903 UI_TIP_STYLE_MONO, /* Mono-spaced text. */
1904 UI_TIP_STYLE_IMAGE, /* Image field. */
1905 UI_TIP_STYLE_SPACER, /* Padding to separate sections. */
1906};
1907
1909 UI_TIP_LC_MAIN = 0, /* Color of primary text. */
1910 UI_TIP_LC_VALUE, /* Color for the value of buttons (also shortcuts). */
1911 UI_TIP_LC_ACTIVE, /* Color of titles of active enum values. */
1912 UI_TIP_LC_NORMAL, /* Color of regular text. */
1913 UI_TIP_LC_PYTHON, /* Color of python snippets. */
1914 UI_TIP_LC_ALERT, /* Warning text color, eg: why operator can't run. */
1916};
1917
1923
1933
1936 void *arg,
1937 uiFreeArgFunc free_arg);
1938
1944 std::string text,
1945 std::string suffix,
1946 const uiTooltipStyle style,
1947 const uiTooltipColorID color_id,
1948 const bool is_pad = false);
1949
1955
1957 const blender::float4 &color,
1958 bool has_alpha,
1959 bool is_gamma,
1960 const ColorManagedDisplay *display,
1961 uiTooltipColorID color_id);
1962
1968 bContext &C,
1969 uiBut &but,
1970 uiButExtraOpIcon *extra_icon);
1971
1981
1983 ARegion *region,
1984 const void *rna_poin_data,
1985 const char *rna_prop_id);
1986bool UI_textbutton_activate_but(const bContext *C, uiBut *actbut);
1987
1993
1994void UI_but_func_hold_set(uiBut *but, uiButHandleHoldFunc func, void *argN);
1995
1999 int icon);
2002
2007int UI_preview_tile_size_x(const int size_px = 96);
2008int UI_preview_tile_size_y(const int size_px = 96);
2009int UI_preview_tile_size_y_no_label(const int size_px = 96);
2010
2011/* Autocomplete
2012 *
2013 * Tab complete helper functions, for use in uiButCompleteFunc callbacks.
2014 * Call begin once, then multiple times do_name with all possibilities,
2015 * and finally end to finish and get the completed name. */
2016
2017struct AutoComplete;
2018
2019#define AUTOCOMPLETE_NO_MATCH 0
2020#define AUTOCOMPLETE_FULL_MATCH 1
2021#define AUTOCOMPLETE_PARTIAL_MATCH 2
2022
2025int UI_autocomplete_end(AutoComplete *autocpl, char *autoname);
2026
2027/* Button drag-data (interface_drag.cc).
2028 *
2029 * Functions to set drag data for buttons. This enables dragging support, whereby the drag data is
2030 * "dragged", not the button itself. */
2031
2032void UI_but_drag_set_id(uiBut *but, ID *id);
2039void UI_but_drag_attach_image(uiBut *but, const ImBuf *imb, float scale);
2040
2050 const AssetImportSettings &import_settings,
2051 int icon,
2052 int preview_icon);
2053
2059void UI_but_drag_set_path(uiBut *but, const char *path);
2060void UI_but_drag_set_name(uiBut *but, const char *name);
2061
2066void UI_but_drag_set_image(uiBut *but, const char *path, int icon, const ImBuf *imb, float scale);
2067
2068/* Panels
2069 *
2070 * Functions for creating, freeing and drawing panels. The API here
2071 * could use a good cleanup, though how they will function in 2.5 is
2072 * not clear yet so we postpone that. */
2073
2074void UI_panels_begin(const bContext *C, ARegion *region);
2075void UI_panels_end(const bContext *C, ARegion *region, int *r_x, int *r_y);
2079void UI_panels_draw(const bContext *C, ARegion *region);
2080
2086 ARegion *region, ListBase *lb, uiBlock *block, PanelType *pt, Panel *panel, bool *r_open);
2097void UI_panel_end(Panel *panel, int width, int height);
2098
2101
2107void UI_panel_context_pointer_set(Panel *panel, const char *name, PointerRNA *ptr);
2108
2113bool UI_panel_is_closed(const Panel *panel);
2114bool UI_panel_is_active(const Panel *panel);
2118void UI_panel_label_offset(const uiBlock *block, int *r_x, int *r_y);
2119bool UI_panel_should_show_background(const ARegion *region, const PanelType *panel_type);
2120int UI_panel_size_y(const Panel *panel);
2121bool UI_panel_is_dragging(const Panel *panel);
2126bool UI_panel_matches_search_filter(const Panel *panel);
2127bool UI_panel_can_be_pinned(const Panel *panel);
2128
2129bool UI_panel_category_is_visible(const ARegion *region);
2130void UI_panel_category_add(ARegion *region, const char *name);
2131PanelCategoryDyn *UI_panel_category_find(const ARegion *region, const char *idname);
2132int UI_panel_category_index_find(ARegion *region, const char *idname);
2133PanelCategoryStack *UI_panel_category_active_find(ARegion *region, const char *idname);
2134const char *UI_panel_category_active_get(ARegion *region, bool set_fallback);
2135void UI_panel_category_active_set(ARegion *region, const char *idname);
2137void UI_panel_category_index_active_set(ARegion *region, const int index);
2138void UI_panel_category_active_set_default(ARegion *region, const char *idname);
2143void UI_panel_category_draw_all(ARegion *region, const char *category_id_active);
2144
2145void UI_panel_stop_animation(const bContext *C, Panel *panel);
2146
2147/* Panel custom data. */
2150void UI_panel_custom_data_set(Panel *panel, PointerRNA *custom_data);
2151
2152/* Poly-instantiated panels for representing a list of data. */
2158 ARegion *region,
2159 ListBase *panels,
2160 const char *panel_idname,
2161 PointerRNA *custom_data);
2168void UI_panels_free_instanced(const bContext *C, ARegion *region);
2169
2170#define INSTANCED_PANEL_UNIQUE_STR_SIZE 16
2175void UI_list_panel_unique_str(Panel *panel, char *r_name);
2176
2177using uiListPanelIDFromDataFunc = void (*)(void *data_link, char *r_idname);
2188 ListBase *data,
2189 uiListPanelIDFromDataFunc panel_idname_func);
2190
2191/* Handlers
2192 *
2193 * Handlers that can be registered in regions, areas and windows for
2194 * handling WM events. Mostly this is done automatic by modules such
2195 * as screen/ if ED_KEYMAP_UI is set, or internally in popup functions. */
2196
2197void UI_region_handlers_add(ListBase *handlers);
2198void UI_popup_handlers_add(bContext *C, ListBase *handlers, uiPopupBlockHandle *popup, char flag);
2201
2202/* Module
2203 *
2204 * init and exit should be called before using this module. init_userdef must
2205 * be used to reinitialize some internal state if user preferences change. */
2206
2207void UI_init();
2208/* after reading userdef file */
2209void UI_init_userdef();
2210void UI_reinit_font();
2211void UI_exit();
2212
2213/* When changing UI font, update text style weights with default font weight
2214 * if non-variable. Therefore fixed weight bold font will look bold. */
2216
2217#define UI_UNIT_X ((void)0, U.widget_unit)
2218#define UI_UNIT_Y ((void)0, U.widget_unit)
2219
2220#define UI_HEADER_OFFSET \
2221 ((void)0, ((U.uiflag & USER_AREA_CORNER_HANDLE) ? 16.0f : 8.0f) * UI_SCALE_FAC)
2222
2223#define UI_AZONESPOTW_LEFT UI_HEADER_OFFSET /* Width of left-side corner #AZone. */
2224#define UI_AZONESPOTW_RIGHT (8.0f * UI_SCALE_FAC) /* Width of right-side corner #AZone. */
2225#define UI_AZONESPOTH (0.6f * U.widget_unit) /* Height of corner action zone #AZone. */
2226
2227/* uiLayoutOperatorButs flags */
2228enum {
2233 /* Disable property split for the default layout (custom ui callbacks still have full control
2234 * over the layout and can enable it). */
2245};
2246
2247/* Used for transparent checkers shown under color buttons that have an alpha component. */
2248#define UI_ALPHA_CHECKER_DARK 100
2249#define UI_ALPHA_CHECKER_LIGHT 160
2250
2251/* flags to set which corners will become rounded:
2252 *
2253 * 1------2
2254 * | |
2255 * 8------4 */
2256
2257enum {
2262 /* just for convenience */
2265};
2266
2267void UI_region_message_subscribe(ARegion *region, wmMsgBus *mbus);
2268
2284std::optional<blender::StringRefNull> UI_but_asset_shelf_type_idname_get(const uiBut *but);
2285
2286/* templates */
2287void uiTemplateHeader(uiLayout *layout, bContext *C);
2288void uiTemplateID(uiLayout *layout,
2289 const bContext *C,
2290 PointerRNA *ptr,
2291 blender::StringRefNull propname,
2292 const char *newop,
2293 const char *openop,
2294 const char *unlinkop,
2296 bool live_icon = false,
2297 std::optional<blender::StringRef> text = std::nullopt);
2298void uiTemplateIDBrowse(uiLayout *layout,
2299 bContext *C,
2300 PointerRNA *ptr,
2301 blender::StringRefNull propname,
2302 const char *newop,
2303 const char *openop,
2304 const char *unlinkop,
2306 const char *text = nullptr);
2307void uiTemplateIDPreview(uiLayout *layout,
2308 bContext *C,
2309 PointerRNA *ptr,
2310 blender::StringRefNull propname,
2311 const char *newop,
2312 const char *openop,
2313 const char *unlinkop,
2314 int rows,
2315 int cols,
2317 bool hide_buttons = false);
2322void uiTemplateIDTabs(uiLayout *layout,
2323 bContext *C,
2324 PointerRNA *ptr,
2325 blender::StringRefNull propname,
2326 const char *newop,
2327 const char *menu,
2337void uiTemplateAnyID(uiLayout *layout,
2338 PointerRNA *ptr,
2339 blender::StringRefNull propname,
2340 blender::StringRefNull proptypename,
2341 std::optional<blender::StringRef> text);
2342
2352void uiTemplateAction(uiLayout *layout,
2353 const bContext *C,
2354 ID *id,
2355 const char *newop,
2356 const char *unlinkop,
2357 std::optional<blender::StringRef> text);
2358
2363void uiTemplateSearch(uiLayout *layout,
2364 const bContext *C,
2365 PointerRNA *ptr,
2366 blender::StringRefNull propname,
2367 PointerRNA *searchptr,
2368 const char *searchpropname,
2369 const char *newop,
2370 const char *unlinkop,
2371 std::optional<blender::StringRef> text = std::nullopt);
2373 bContext *C,
2374 PointerRNA *ptr,
2375 blender::StringRefNull propname,
2376 PointerRNA *searchptr,
2377 const char *searchpropname,
2378 const char *newop,
2379 const char *unlinkop,
2380 int rows,
2381 int cols,
2382 std::optional<blender::StringRef> text = std::nullopt);
2390void uiTemplatePathBuilder(uiLayout *layout,
2391 PointerRNA *ptr,
2392 blender::StringRefNull propname,
2393 PointerRNA *root_ptr,
2394 std::optional<blender::StringRefNull> text);
2395void uiTemplateModifiers(uiLayout *layout, bContext *C);
2400void uiTemplateShaderFx(uiLayout *layout, bContext *C);
2404void uiTemplateConstraints(uiLayout *layout, bContext *C, bool use_bone_constraints);
2405
2408 bContext *C,
2409 PointerRNA *ptr,
2410 blender::StringRefNull propname,
2411 int rows,
2412 int cols,
2413 float scale,
2414 int filter);
2415
2417
2419void uiTemplatePreview(uiLayout *layout,
2420 bContext *C,
2421 ID *id,
2422 bool show_buttons,
2423 ID *parent,
2424 MTex *slot,
2425 const char *preview_id);
2426void uiTemplateColorRamp(uiLayout *layout,
2427 PointerRNA *ptr,
2428 blender::StringRefNull propname,
2429 bool expand);
2433void uiTemplateIcon(uiLayout *layout, int icon_value, float icon_scale);
2437void uiTemplateIconView(uiLayout *layout,
2438 PointerRNA *ptr,
2439 blender::StringRefNull propname,
2440 bool show_labels,
2441 float icon_scale,
2442 float icon_scale_popup);
2446void uiTemplateCurveMapping(uiLayout *layout,
2447 PointerRNA *ptr,
2448 blender::StringRefNull propname,
2449 int type,
2450 bool levels,
2451 bool brush,
2452 bool neg_slope,
2453 bool tone,
2454 bool presets);
2463void uiTemplateColorPicker(uiLayout *layout,
2464 PointerRNA *ptr,
2465 blender::StringRefNull propname,
2466 bool value_slider,
2467 bool lock,
2468 bool lock_luminosity,
2469 bool cubic);
2470void uiTemplatePalette(uiLayout *layout,
2471 PointerRNA *ptr,
2472 blender::StringRefNull propname,
2473 bool colors);
2474void uiTemplateCryptoPicker(uiLayout *layout,
2475 PointerRNA *ptr,
2476 blender::StringRefNull propname,
2477 int icon);
2482void uiTemplateLayers(uiLayout *layout,
2483 PointerRNA *ptr,
2484 blender::StringRefNull propname,
2485 PointerRNA *used_ptr,
2486 const char *used_propname,
2487 int active_layer);
2488void uiTemplateImage(uiLayout *layout,
2489 bContext *C,
2490 PointerRNA *ptr,
2491 blender::StringRefNull propname,
2492 PointerRNA *userptr,
2493 bool compact,
2494 bool multiview);
2496 bContext *C,
2497 PointerRNA *imfptr,
2498 bool color_management,
2499 const char *panel_idname = nullptr);
2500void uiTemplateImageStereo3d(uiLayout *layout, PointerRNA *stereo3d_format_ptr);
2501void uiTemplateImageViews(uiLayout *layout, PointerRNA *imaptr);
2503void uiTemplateImageLayers(uiLayout *layout, bContext *C, Image *ima, ImageUser *iuser);
2504void uiTemplateImageInfo(uiLayout *layout, bContext *C, Image *ima, ImageUser *iuser);
2508
2509void UI_but_func_menu_search(uiBut *but, const char *single_menu_idname = nullptr);
2510void uiTemplateMenuSearch(uiLayout *layout);
2511
2518 const bContext *C, uiLayout *layout, wmOperator *op, eButLabelAlign label_align, short flag);
2523void uiTemplateStatusInfo(uiLayout *layout, bContext *C);
2525
2528 const wmKeyMapItem *kmi,
2529 bool text_fallback);
2530
2531/* Draw keymap item for status bar. Returns number of items consumed,
2532 * as X/Y/Z items may get merged to use less space. */
2534 const wmKeyMap *keymap,
2535 const EnumPropertyItem *item);
2536
2538 PointerRNA *ptr,
2539 blender::StringRefNull propname,
2541void uiTemplateNodeSocket(uiLayout *layout, bContext *C, const float color[4]);
2542
2547void uiTemplateCacheFile(uiLayout *layout,
2548 const bContext *C,
2549 PointerRNA *ptr,
2550 blender::StringRefNull propname);
2551
2558 blender::StringRefNull propname,
2559 PointerRNA *r_file_ptr);
2560
2564void uiTemplateCacheFileVelocity(uiLayout *layout, PointerRNA *fileptr);
2565
2570
2574void uiTemplateCacheFileLayers(uiLayout *layout, const bContext *C, PointerRNA *fileptr);
2575
2577#define UI_UL_DEFAULT_CLASS_NAME "UI_UL_list"
2593
2594void uiTemplateList(uiLayout *layout,
2595 const bContext *C,
2596 const char *listtype_name,
2597 const char *list_id,
2598 PointerRNA *dataptr,
2599 blender::StringRefNull propname,
2600 PointerRNA *active_dataptr,
2601 const char *active_propname,
2602 const char *item_dyntip_propname,
2603 int rows,
2604 int maxrows,
2605 int layout_type,
2606 int columns,
2607 enum uiTemplateListFlags flags);
2609 const bContext *C,
2610 const char *listtype_name,
2611 const char *list_id,
2612 PointerRNA *dataptr,
2613 blender::StringRefNull propname,
2614 PointerRNA *active_dataptr,
2615 blender::StringRefNull active_propname,
2616 const char *item_dyntip_propname,
2617 int rows,
2618 int maxrows,
2619 int layout_type,
2620 int columns,
2621 enum uiTemplateListFlags flags,
2622 void *customdata);
2623
2625 uiLayout *layout, bContext *C, bNodeTree *ntree, bNode *node, bNodeSocket *input);
2627 uiLayout *layout, bContext *C, bNodeTree *ntree, bNode *node, bNodeSocket *input);
2632void uiTemplateTextureShow(uiLayout *layout,
2633 const bContext *C,
2634 PointerRNA *ptr,
2635 PropertyRNA *prop);
2636
2638 uiLayout *layout, bContext *C, PointerRNA *ptr, blender::StringRefNull propname, bool compact);
2640void uiTemplateMarker(uiLayout *layout,
2641 PointerRNA *ptr,
2642 blender::StringRefNull propname,
2643 PointerRNA *userptr,
2644 PointerRNA *trackptr,
2645 bool compact);
2647 PointerRNA *ptr,
2648 blender::StringRefNull propname,
2649 PointerRNA *userptr);
2650
2652 PointerRNA *ptr,
2653 blender::StringRefNull propname);
2655 bContext *C,
2656 PointerRNA *ptr,
2657 blender::StringRefNull propname);
2658
2659int uiTemplateRecentFiles(uiLayout *layout, int rows);
2661
2662namespace blender::ui {
2663
2665 uiLayout &layout, const bContext &C, StringRefNull asset_shelf_id, StringRef name, int icon);
2666
2667}
2668
2670 bContext *C,
2671 uiLayout *context_layout,
2672 PointerRNA *ptr,
2673 blender::StringRefNull propname);
2674
2677
2683
2685
2687void template_tree(uiLayout *layout, bContext *C);
2688}
2689
2693bool UI_list_item_index_is_filtered_visible(const struct uiList *ui_list, int item_idx);
2694
2695/* UI Operators */
2701
2702void ED_operatortypes_ui();
2706void ED_keymap_ui(wmKeyConfig *keyconf);
2707void ED_dropboxes_ui();
2708void ED_uilisttypes_ui();
2709
2710void UI_drop_color_copy(bContext *C, wmDrag *drag, wmDropBox *drop);
2711bool UI_drop_color_poll(bContext *C, wmDrag *drag, const wmEvent *event);
2712
2714 PointerRNA *ptr,
2715 PropertyRNA *prop,
2717 bool *r_use_path_from_id,
2718 std::optional<std::string> *r_path);
2720 PointerRNA *ptr_link,
2721 PropertyRNA *prop,
2722 const char *path,
2723 bool use_path_from_id,
2724 PointerRNA *r_ptr,
2725 PropertyRNA **r_prop);
2726
2727/* Helpers for Operators */
2741 PointerRNA *r_ptr,
2742 PropertyRNA **r_prop,
2743 int *r_index);
2744
2751 PointerRNA *r_ptr,
2752 PropertyRNA **r_prop,
2753 int *r_index);
2754
2755void UI_context_active_but_prop_handle(bContext *C, bool handle_undo);
2757
2764 PointerRNA *r_ptr,
2765 PropertyRNA **r_prop,
2766 bool *r_is_undo,
2767 bool *r_is_userdef);
2774 PointerRNA *r_ptr,
2775 PropertyRNA **r_prop);
2777
2778uiBut *UI_region_active_but_get(const ARegion *region);
2779uiBut *UI_region_but_find_rect_over(const ARegion *region, const rcti *rect_px);
2780uiBlock *UI_region_block_find_mouse_over(const ARegion *region, const int xy[2], bool only_clip);
2784ARegion *UI_region_searchbox_region_get(const ARegion *button_region);
2785
2792
2797
2798/* Styled text draw */
2799void UI_fontstyle_set(const uiFontStyle *fs);
2800void UI_fontstyle_draw_ex(const uiFontStyle *fs,
2801 const rcti *rect,
2802 const char *str,
2803 size_t str_len,
2804 const uchar col[4],
2805 const uiFontStyleDraw_Params *fs_params,
2806 int *r_xofs,
2807 int *r_yofs,
2808 ResultBLF *r_info);
2809
2810void UI_fontstyle_draw(const uiFontStyle *fs,
2811 const rcti *rect,
2812 const char *str,
2813 size_t str_len,
2814 const uchar col[4],
2815 const uiFontStyleDraw_Params *fs_params);
2816
2818 const rcti *rect,
2819 const char *str,
2820 const uchar col[4],
2821 eFontStyle_Align align,
2822 int *r_xofs,
2823 int *r_yofs,
2824 ResultBLF *r_info);
2829 const rcti *rect,
2830 const char *str,
2831 const uchar col[4],
2832 eFontStyle_Align align);
2833
2838 const rcti *rect,
2839 const char *str,
2840 const uchar col[4]);
2848 const uiFontStyle *fs, float x, float y, const char *str, const uchar col[4]);
2853 float x,
2854 float y,
2856 const float col_fg[4],
2857 const float col_bg[4]);
2858
2860 ATTR_NONNULL(1, 2);
2873 float aspect) ATTR_WARN_UNUSED_RESULT
2874 ATTR_NONNULL(1);
2876
2880void UI_draw_icon_tri(float x, float y, char dir, const float[4]);
2881
2885const uiStyle *UI_style_get(); /* use for fonts etc */
2889const uiStyle *UI_style_get_dpi();
2890
2891/* #UI_OT_editsource helpers. */
2898void UI_editsource_but_replace(const uiBut *old_but, uiBut *new_but);
2899
2910void UI_but_ensure_in_view(const bContext *C, ARegion *region, const uiBut *but);
2911
2912/* UI_butstore_ helpers */
2913struct uiButStore;
2914
2927void UI_butstore_free(uiBlock *block, uiButStore *bs_handle);
2928bool UI_butstore_is_valid(uiButStore *bs_handle);
2930void UI_butstore_register(uiButStore *bs_handle, uiBut **but_p);
2934bool UI_butstore_register_update(uiBlock *block, uiBut *but_dst, const uiBut *but_src);
2935void UI_butstore_unregister(uiButStore *bs_handle, uiBut **but_p);
2936
2937/* ui_interface_region_tooltip.c */
2938
2943 ARegion *butregion,
2944 uiBut *but,
2945 bool is_quick_tip);
2947 bContext *C, ARegion *butregion, uiBut *but, uiButExtraOpIcon *extra_icon, bool is_quick_tip);
2949void UI_tooltip_free(bContext *C, bScreen *screen, ARegion *region);
2950
2959 const ARegion *searchbox_region,
2960 const rcti *item_rect,
2961 ID *id);
2962
2963/* How long before a tool-tip shows. */
2964#define UI_TOOLTIP_DELAY 0.5
2965#define UI_TOOLTIP_DELAY_QUICK 0.2
2966
2967/* Float precision helpers */
2968
2969/* Maximum number of digits of precision (not number of decimal places)
2970 * to display for float values. Note that the UI_FLOAT_VALUE_DISPLAY_*
2971 * defines that follow depend on this. */
2972#define UI_PRECISION_FLOAT_MAX 6
2973
2974/* Values exceeding this range are displayed as "inf" / "-inf".
2975 * This range is almost FLT_MAX to -FLT_MAX, but each is truncated
2976 * to our display precision, set by UI_PRECISION_FLOAT_MAX. Each
2977 * is approximately `FLT_MAX / 1.000001` but that calculation does
2978 * not give us the explicit zeros needed for this exact range. */
2979#define UI_FLOAT_VALUE_DISPLAY_MAX 3.402820000e+38F
2980#define UI_FLOAT_VALUE_DISPLAY_MIN -3.402820000e+38F
2981
2982/* For float buttons the 'step', is scaled */
2983#define UI_PRECISION_FLOAT_SCALE 0.01f
2984
2985/* Typical UI text */
2986#define UI_FSTYLE_WIDGET (const uiFontStyle *)&(UI_style_get()->widget)
2987#define UI_FSTYLE_TOOLTIP (const uiFontStyle *)&(UI_style_get()->tooltip)
2988
2993int UI_calc_float_precision(int prec, double value);
2994
2995/* widget batched drawing */
2999
3000/* Use for resetting the theme. */
3009
3011
3013#define USE_UI_TOOLBAR_HACK
3014
3016#define USE_UI_POPOVER_ONCE
3017
3027
3037
3042blender::ui::AbstractView *UI_region_view_find_at(const ARegion *region, const int xy[2], int pad);
3047 const int xy[2]);
#define BLI_assert(a)
Definition BLI_assert.h:46
#define ATTR_WARN_UNUSED_RESULT
#define ATTR_NONNULL(...)
void BLI_kdtree_nd_ free(KDTree *tree)
unsigned char uchar
unsigned int uint
#define ENUM_OPERATORS(_type, _max)
void(*)(void *data_link, char *r_idname) uiListPanelIDFromDataFunc
Read Guarded memory(de)allocation.
#define C
Definition RandGen.cpp:29
uiBut * uiDefButF(uiBlock *block, ButType type, int retval, blender::StringRef str, int x, int y, short width, short height, float *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_block_update_from_old(const bContext *C, uiBlock *block)
void UI_context_update_anim_flag(const bContext *C)
uiBut * uiDefButI(uiBlock *block, ButType type, int retval, blender::StringRef str, int x, int y, short width, short height, int *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_region_button_sections_draw(const ARegion *region, int colorid, uiButtonSectionsAlign align)
int UI_text_colorid_from_report_type(int type)
void UI_but_flag_disable(uiBut *but, int flag)
void UI_but_disable(uiBut *but, const char *disabled_hint)
uiBut * uiDefIconTextBut(uiBlock *block, uiButTypeWithPointerType but_and_ptr_type, int retval, int icon, blender::StringRef str, int x, int y, short width, short height, void *poin, std::optional< blender::StringRef > tip)
bool UI_view_item_can_rename(const blender::ui::AbstractViewItem &item)
ARegion * UI_tooltip_create_from_gizmo(bContext *C, wmGizmo *gz)
void UI_region_views_clear_search_highlight(const ARegion *region)
eAutoPropButsReturn
@ UI_PROP_BUTS_ANY_FAILED_CHECK
@ UI_PROP_BUTS_NONE_ADDED
void UI_blocklist_update_window_matrix(const bContext *C, const ListBase *lb)
void UI_draw_roundbox_3ub_alpha(const rctf *rect, bool filled, float rad, const unsigned char col[3], unsigned char alpha)
void UI_panel_stop_animation(const bContext *C, Panel *panel)
void UI_but_placeholder_set(uiBut *but, blender::StringRef placeholder_text)
bool UI_panel_is_closed(const Panel *panel)
bool UI_textbutton_activate_rna(const bContext *C, ARegion *region, const void *rna_poin_data, const char *rna_prop_id)
void uiTemplateLightLinkingCollection(uiLayout *layout, bContext *C, uiLayout *context_layout, PointerRNA *ptr, blender::StringRefNull propname)
void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname, PointerRNA *userptr, PointerRNA *trackptr, bool compact)
void UI_but_drag_attach_image(uiBut *but, const ImBuf *imb, float scale)
uiBut * uiDefButR(uiBlock *block, ButType type, int retval, std::optional< blender::StringRef > str, int x, int y, short width, short height, PointerRNA *ptr, blender::StringRefNull propname, int index, float min, float max, std::optional< blender::StringRef > tip)
void UI_draw_roundbox_4fv(const rctf *rect, bool filled, float rad, const float col[4])
void uiTemplateInputStatus(uiLayout *layout, bContext *C)
void ui_draw_dropshadow(const rctf *rct, float radius, float width, float aspect, float alpha)
uiLayout * UI_pie_menu_layout(uiPieMenu *pie)
void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname, PointerRNA *used_ptr, const char *used_propname, int active_layer)
uiList * UI_list_find_mouse_over(const ARegion *region, const wmEvent *event)
void UI_init_userdef()
void UI_block_emboss_set(uiBlock *block, blender::ui::EmbossType emboss)
void UI_popover_end(bContext *C, uiPopover *pup, wmKeyMap *keymap)
void UI_panel_category_draw_all(ARegion *region, const char *category_id_active)
void uiTemplateIconView(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname, bool show_labels, float icon_scale, float icon_scale_popup)
void uiTemplateStatusInfo(uiLayout *layout, bContext *C)
bool UI_but_active_drop_name(const bContext *C)
uiBut * uiDefIconButBitI(uiBlock *block, ButType type, int bit, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_fontstyle_draw_simple(const uiFontStyle *fs, float x, float y, const char *str, const uchar col[4])
ButPointerType
void UI_popup_menu_retval_set(const uiBlock *block, int retval, bool enable)
@ UI_BLOCK_SEARCH_MENU
@ UI_BLOCK_CLIP_EVENTS
@ UI_BLOCK_SEARCH_ONLY
@ UI_BLOCK_CLIPBOTTOM
@ UI_BLOCK_POPOVER_ONCE
@ UI_BLOCK_NUMSELECT
@ UI_BLOCK_LOOP
@ UI_BLOCK_POPUP_MEMORY
@ UI_BLOCK_MOVEMOUSE_QUIT
@ UI_BLOCK_NO_ACCELERATOR_KEYS
@ UI_BLOCK_PIE_MENU
@ UI_BLOCK_NO_DRAW_OVERRIDDEN_STATE
@ UI_BLOCK_KEEP_OPEN
@ UI_BLOCK_POPUP
@ UI_BLOCK_CLIPTOP
@ UI_BLOCK_SHOW_SHORTCUT_ALWAYS
@ UI_BLOCK_LIST_ITEM
@ UI_BLOCK_POPOVER
@ UI_BLOCK_OUT_1
@ UI_BLOCK_POPUP_HOLD
@ UI_BLOCK_QUICK_SETUP
@ UI_BLOCK_NO_WIN_CLIP
void UI_block_theme_style_set(uiBlock *block, char theme_style)
PanelCategoryDyn * UI_panel_category_find(const ARegion *region, const char *idname)
void UI_init()
bool UI_panel_can_be_pinned(const Panel *panel)
void UI_but_focus_on_enter_event(wmWindow *win, uiBut *but)
void uiTemplateComponentMenu(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname, blender::StringRef name)
void uiTemplateNodeView(uiLayout *layout, bContext *C, bNodeTree *ntree, bNode *node, bNodeSocket *input)
void UI_but_func_drawextra_set(uiBlock *block, std::function< void(const bContext *C, rcti *rect)> func)
void UI_but_func_tooltip_custom_set(uiBut *but, uiButToolTipCustomFunc func, void *arg, uiFreeArgFunc free_arg)
std::string UI_but_string_get_property_keymap(bContext &C, uiBut &but)
uiBlock * UI_block_begin(const bContext *C, ARegion *region, std::string name, blender::ui::EmbossType emboss)
int UI_icon_from_keymap_item(const wmKeyMapItem *kmi, int r_icon_mod[KM_MOD_NUM])
void UI_but_icon_indicator_number_set(uiBut *but, const int indicator_number)
void UI_draw_icon_tri(float x, float y, char dir, const float[4])
bool UI_view_item_drag_start(bContext &C, blender::ui::AbstractViewItem &item)
void ED_dropboxes_ui()
void UI_popup_menu_but_set(uiPopupMenu *pup, ARegion *butregion, uiBut *but)
void UI_draw_safe_areas(uint pos, const rctf *rect, const float title_aspect[2], const float action_aspect[2])
bool UI_block_can_add_separator(const uiBlock *block)
int UI_icon_from_report_type(int type)
void UI_tooltip_free(bContext *C, bScreen *screen, ARegion *region)
void UI_block_interaction_set(uiBlock *block, uiBlockInteraction_CallbackData *callbacks)
void UI_popup_block_template_confirm(uiBlock *block, bool cancel_default, blender::FunctionRef< uiBut *()> confirm_fn, blender::FunctionRef< uiBut *()> cancel_fn)
void UI_tooltip_image_field_add(uiTooltipData &data, const uiTooltipImage &image_data)
uiPopover * UI_popover_begin(bContext *C, int ui_menu_width, bool from_active_button) ATTR_NONNULL(1)
void UI_but_func_rename_full_set(uiBut *but, std::function< void(std::string &new_name)> rename_full_func)
uiPopupMenu * UI_popup_menu_begin_ex(bContext *C, const char *title, const char *block_name, int icon) ATTR_NONNULL()
bool UI_but_has_quick_tooltip(const uiBut *but)
void uiTemplateTextureUser(uiLayout *layout, bContext *C)
uiBut * uiDefIconTextButI(uiBlock *block, ButType type, int retval, int icon, blender::StringRef str, int x, int y, short width, short height, int *poin, std::optional< blender::StringRef > tip)
void UI_blocklist_free(const bContext *C, ARegion *region)
uiBut * uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, blender::StringRef str, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
void uiTemplateIcon(uiLayout *layout, int icon_value, float icon_scale)
void uiTemplateModifiers(uiLayout *layout, bContext *C)
@ UI_SCROLL_PRESSED
@ UI_SCROLL_ARROWS
void(*)(bContext *C, const uiBlockInteraction_Params *params, void *arg1, void *user_data) uiBlockInteractionUpdateFn
PointerRNA * UI_but_extra_operator_icon_add(uiBut *but, blender::StringRefNull opname, blender::wm::OpCallContext opcontext, int icon)
void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
uiBut * uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, blender::StringRef str, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
bool(*)(const uiBut *a, const uiBut *b) uiButIdentityCompareFunc
void UI_but_color_set(uiBut *but, const uchar color[4])
void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname)
wmOperatorStatus UI_pie_menu_invoke(bContext *C, const char *idname, const wmEvent *event)
std::string UI_but_string_get_rna_label_context(const uiBut &but)
void UI_block_lock_clear(uiBlock *block)
void UI_but_func_search_set_results_are_suggestions(uiBut *but, bool value)
@ UI_BUT_DRAG_LOCK
@ UI_BUT_LIST_ITEM
@ UI_BUT_REDALERT
@ UI_BUT_UNDO
@ UI_BUT_ACTIVE_DEFAULT
@ UI_BUT_ACTIVATE_ON_INIT
@ UI_BUT_ANIMATED
@ UI_BUT_DISABLED
@ UI_BUT_INACTIVE
@ UI_BUT_OVERRIDDEN
@ UI_BUT_NO_UTF8
@ UI_BUT_HAS_SEP_CHAR
@ UI_BUT_NODE_LINK
@ UI_BUT_ICON_PREVIEW
@ UI_BUT_NODE_ACTIVE
@ UI_BUT_DRIVEN
@ UI_BUT_DRAG_MULTI
@ UI_BUT_UPDATE_DELAY
@ UI_BUT_ICON_SUBMENU
@ UI_BUT_VALUE_CLEAR
@ UI_BUT_TEXTEDIT_UPDATE
@ UI_BUT_ANIMATED_KEY
@ UI_BUT_LAST_ACTIVE
void UI_but_func_tooltip_set(uiBut *but, uiButToolTipFunc func, void *arg, uiFreeArgFunc free_arg)
void uiTemplateImageLayers(uiLayout *layout, bContext *C, Image *ima, ImageUser *iuser)
void UI_panel_drawname_set(Panel *panel, blender::StringRef name)
uiBut * uiDefIconBut(uiBlock *block, uiButTypeWithPointerType but_and_ptr_type, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_block_bounds_set_popup(uiBlock *block, int addval, const int bounds_offset[2])
Definition interface.cc:653
void UI_interface_tag_script_reload()
bool UI_view_item_popup_keep_open(const blender::ui::AbstractViewItem &item)
void UI_draw_text_underline(int pos_x, int pos_y, int len, int height, const float color[4])
void UI_popup_dummy_panel_set(ARegion *region, uiBlock *block)
int UI_but_unit_type_get(const uiBut *but)
void(*)(bContext *C, void *arg, char *origstr) uiButHandleRenameFunc
uiBlock * UI_region_block_find_mouse_over(const ARegion *region, const int xy[2], bool only_clip)
void uiTemplateNodeLink(uiLayout *layout, bContext *C, bNodeTree *ntree, bNode *node, bNodeSocket *input)
uiBut * UI_region_active_but_get(const ARegion *region)
uiBut * uiDefSearchButO_ptr(uiBlock *block, wmOperatorType *ot, IDProperty *properties, void *arg, int retval, int icon, int maxncpy, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
void UI_popup_block_invoke(bContext *C, uiBlockCreateFunc func, void *arg, uiFreeArgFunc arg_free)
void UI_but_menu_disable_hover_open(uiBut *but)
void UI_block_bounds_set_normal(uiBlock *block, int addval)
Definition interface.cc:637
Panel * UI_panel_find_by_type(ListBase *lb, const PanelType *pt)
void uiTemplateConstraintHeader(uiLayout *layout, PointerRNA *ptr)
blender::ui::AbstractView * UI_region_view_find_at(const ARegion *region, const int xy[2], int pad)
void UI_draw_roundbox_4fv_ex(const rctf *rect, const float inner1[4], const float inner2[4], float shade_dir, const float outline[4], float outline_width, float rad)
ARegion * UI_region_searchbox_region_get(const ARegion *button_region)
void UI_but_func_search_set(uiBut *but, uiButSearchCreateFn search_create_fn, uiButSearchUpdateFn search_update_fn, void *arg, bool free_arg, uiFreeArgFunc search_arg_free_fn, uiButHandleFunc search_exec_fn, void *active)
std::optional< int64_t > UI_but_context_int_get(const uiBut *but, blender::StringRef name)
bool UI_but_is_userdef(const uiBut *but)
bool UI_panel_matches_search_filter(const Panel *panel)
void UI_blocklist_update_view_for_buttons(const bContext *C, const ListBase *lb)
void UI_panel_header_buttons_begin(Panel *panel)
uiBut * UI_region_but_find_rect_over(const ARegion *region, const rcti *rect_px)
uiTooltipImageBackground
void UI_panels_free_instanced(const bContext *C, ARegion *region)
bool UI_list_item_index_is_filtered_visible(const struct uiList *ui_list, int item_idx)
MenuType * UI_but_menutype_get(const uiBut *but)
void uiTemplateCacheFileLayers(uiLayout *layout, const bContext *C, PointerRNA *fileptr)
void UI_tooltip_text_field_add(uiTooltipData &data, std::string text, std::string suffix, const uiTooltipStyle style, const uiTooltipColorID color_id, const bool is_pad=false)
void UI_fontstyle_draw_simple_backdrop(const uiFontStyle *fs, float x, float y, blender::StringRef str, const float col_fg[4], const float col_bg[4])
bool UI_but_is_utf8(const uiBut *but)
const uiStyle * UI_style_get_dpi()
uiLayout * uiTemplateGpencilModifier(uiLayout *layout, bContext *C, PointerRNA *ptr)
void uiTemplateMovieclipInformation(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname, PointerRNA *userptr)
@ UI_ID_FULL
@ UI_ID_BROWSE
@ UI_ID_DELETE
@ UI_ID_ADD_NEW
@ UI_ID_OPEN
@ UI_ID_PIN
@ UI_ID_RENAME
@ UI_ID_NOP
@ UI_ID_PREVIEWS
@ UI_ID_AUTO_NAME
@ UI_ID_OVERRIDE
@ UI_ID_LOCAL
@ UI_ID_FAKE_USER
@ UI_ID_ALONE
bool UI_block_is_empty(const uiBlock *block)
int UI_preview_tile_size_y(const int size_px=96)
std::optional< std::string > UI_but_online_manual_id_from_active(const bContext *C) ATTR_WARN_UNUSED_RESULT
void uiTemplateIDTabs(uiLayout *layout, bContext *C, PointerRNA *ptr, blender::StringRefNull propname, const char *newop, const char *menu, int filter=UI_TEMPLATE_ID_FILTER_ALL)
void UI_but_func_menu_step_set(uiBut *but, uiMenuStepFunc func)
bool UI_drop_color_poll(bContext *C, wmDrag *drag, const wmEvent *event)
bool UI_panel_category_is_visible(const ARegion *region)
int UI_icon_from_id(const ID *id)
void uiTemplateColorPicker(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname, bool value_slider, bool lock, bool lock_luminosity, bool cubic)
void UI_popup_block_ex(bContext *C, uiBlockCreateFunc func, uiBlockHandleFunc popup_func, uiBlockCancelFunc cancel_func, void *arg, wmOperator *op)
bool UI_editsource_enable_check()
int UI_icon_colorid_from_report_type(int type)
void(*)(bContext *C, void *arg1) uiBlockCancelFunc
uiList * uiTemplateList_ex(uiLayout *layout, const bContext *C, const char *listtype_name, const char *list_id, PointerRNA *dataptr, blender::StringRefNull propname, PointerRNA *active_dataptr, blender::StringRefNull active_propname, const char *item_dyntip_propname, int rows, int maxrows, int layout_type, int columns, enum uiTemplateListFlags flags, void *customdata)
void UI_popup_menu_end(bContext *C, uiPopupMenu *pup)
void UI_popup_block_invoke_ex(bContext *C, uiBlockCreateFunc func, void *arg, uiFreeArgFunc arg_free, bool can_refresh)
void UI_block_listen(const uiBlock *block, const wmRegionListenerParams *listener_params)
void UI_block_translate(uiBlock *block, float x, float y)
Definition interface.cc:402
void uiTemplateMovieClip(uiLayout *layout, bContext *C, PointerRNA *ptr, blender::StringRefNull propname, bool compact)
void UI_block_flag_disable(uiBlock *block, int flag)
uiBut * uiDefIconButBitS(uiBlock *block, ButType type, int bit, int retval, int icon, int x, int y, short width, short height, short *poin, float min, float max, std::optional< blender::StringRef > tip)
std::optional< EnumPropertyItem > UI_but_rna_enum_item_get(bContext &C, uiBut &but)
void UI_popover_once_clear(uiPopover *pup)
void UI_widgetbase_draw_cache_end()
std::string UI_but_context_menu_title_from_button(uiBut &but)
void UI_but_drawflag_enable(uiBut *but, int flag)
void UI_butstore_update(uiBlock *block)
void uiTemplateHeader3D_mode(uiLayout *layout, bContext *C)
int UI_but_return_value_get(uiBut *but)
void uiTemplateColormanagedViewSettings(uiLayout *layout, bContext *C, PointerRNA *ptr, blender::StringRefNull propname)
void UI_but_func_search_set_tooltip(uiBut *but, uiButSearchTooltipFn tooltip_fn)
void uiTemplateReportsBanner(uiLayout *layout, bContext *C)
@ UI_BUT2_FORCE_SEMI_MODAL_ACTIVE
@ UI_BUT2_ACTIVATE_ON_INIT_NO_SELECT
void uiDefAutoButsArrayR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, const int icon, const int x, const int y, const int tot_width, const int height)
uiBut * UI_but_find_mouse_over(const ARegion *region, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
PointerRNA * UI_but_extra_operator_icon_opptr_get(const uiButExtraOpIcon *extra_icon)
uiBut * uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxncpy, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
uiBut * uiDefIconButR(uiBlock *block, ButType type, int retval, int icon, int x, int y, short width, short height, PointerRNA *ptr, blender::StringRefNull propname, int index, float min, float max, std::optional< blender::StringRef > tip)
ARegion * UI_tooltip_create_from_button(bContext *C, ARegion *butregion, uiBut *but, bool is_quick_tip)
void UI_but_flag2_enable(uiBut *but, int flag)
void uiTemplateImageSettings(uiLayout *layout, bContext *C, PointerRNA *imfptr, bool color_management, const char *panel_idname=nullptr)
void UI_but_drag_set_image(uiBut *but, const char *path, int icon, const ImBuf *imb, float scale)
void uiTemplateAnyID(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname, blender::StringRefNull proptypename, std::optional< blender::StringRef > text)
void UI_but_tooltip_timer_remove(bContext *C, uiBut *but)
void UI_draw_roundbox_corner_set(int type)
void UI_reinit_font()
void UI_but_number_step_size_set(uiBut *but, float step_size)
uiBut * uiDefIconTextButO(uiBlock *block, ButType type, blender::StringRefNull, blender::wm::OpCallContext opcontext, int icon, blender::StringRef str, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
void UI_block_func_handle_set(uiBlock *block, uiBlockHandleFunc func, void *arg)
void UI_panels_begin(const bContext *C, ARegion *region)
Panel * UI_panel_begin(ARegion *region, ListBase *lb, uiBlock *block, PanelType *pt, Panel *panel, bool *r_open)
bool uiTemplateCacheFilePointer(PointerRNA *ptr, blender::StringRefNull propname, PointerRNA *r_file_ptr)
std::string UI_but_string_get_operator_keymap(bContext &C, uiBut &but)
void uiTemplateMenuSearch(uiLayout *layout)
std::string UI_but_string_get_rna_tooltip(bContext &C, uiBut &but)
void UI_but_func_identity_compare_set(uiBut *but, uiButIdentityCompareFunc cmp_fn)
eButLabelAlign
@ UI_BUT_LABEL_ALIGN_SPLIT_COLUMN
@ UI_BUT_LABEL_ALIGN_NONE
@ UI_BUT_LABEL_ALIGN_COLUMN
uiBut * uiDefIconButBitC(uiBlock *block, ButType type, int bit, int retval, int icon, int x, int y, short width, short height, char *poin, float min, float max, std::optional< blender::StringRef > tip)
uiPieMenu * UI_pie_menu_begin(bContext *C, const char *title, int icon, const wmEvent *event) ATTR_NONNULL()
wmOperatorStatus UI_popover_panel_invoke(bContext *C, const char *idname, bool keep_open, ReportList *reports)
bool UI_block_active_only_flagged_buttons(const bContext *C, ARegion *region, uiBlock *block)
void UI_popup_block_close(bContext *C, wmWindow *win, uiBlock *block)
void uiTemplateOperatorSearch(uiLayout *layout)
std::string UI_but_string_get_label(uiBut &but)
void ED_operatortypes_ui()
uiBut * UI_context_active_but_get(const bContext *C)
std::string UI_but_string_get_rna_label(uiBut &but)
@ UI_BUT_DRAGPOIN_FREE
@ UI_BUT_DRAG_FULL_BUT
bool UI_popup_block_name_exists(const bScreen *screen, blender::StringRef name)
void uiTemplateImageViews(uiLayout *layout, PointerRNA *imaptr)
int UI_searchbox_size_x_guess(const bContext *C, const uiButSearchUpdateFn update_fn, void *arg)
uiBut * uiDefIconButO(uiBlock *block, ButType type, blender::StringRefNull opname, blender::wm::OpCallContext opcontext, int icon, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
int UI_fontstyle_height_max(const uiFontStyle *fs)
eAutoPropButsReturn uiDefAutoButsRNA(uiLayout *layout, PointerRNA *ptr, bool(*check_prop)(PointerRNA *ptr, PropertyRNA *prop, void *user_data), void *user_data, PropertyRNA *prop_activate_init, eButLabelAlign label_align, bool compact)
void UI_but_context_int_set(uiBlock *block, uiBut *but, blender::StringRef name, int64_t value)
void UI_editsource_but_replace(const uiBut *old_but, uiBut *new_but)
void *(*)(const void *argN) uiButArgNCopy
int UI_panel_size_y(const Panel *panel)
void UI_fontstyle_draw_ex(const uiFontStyle *fs, const rcti *rect, const char *str, size_t str_len, const uchar col[4], const uiFontStyleDraw_Params *fs_params, int *r_xofs, int *r_yofs, ResultBLF *r_info)
void(*)(void *argN) uiButArgNFree
void UI_but_execute(const bContext *C, ARegion *region, uiBut *but)
void UI_panels_end(const bContext *C, ARegion *region, int *r_x, int *r_y)
int UI_searchbox_size_x()
bool UI_block_has_active_default_button(const uiBlock *block)
@ UI_TEMPLATE_ID_FILTER_AVAILABLE
@ UI_TEMPLATE_ID_FILTER_ALL
void UI_fontstyle_draw_rotated(const uiFontStyle *fs, const rcti *rect, const char *str, const uchar col[4])
uiLayout * UI_popover_layout(uiPopover *pup)
void UI_update_text_styles()
uiBut * uiDefButR_prop(uiBlock *block, ButType type, int retval, std::optional< blender::StringRef > str, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, std::optional< blender::StringRef > tip)
void UI_butstore_unregister(uiButStore *bs_handle, uiBut **but_p)
uiBut * uiDefButS(uiBlock *block, ButType type, int retval, blender::StringRef str, int x, int y, short width, short height, short *poin, float min, float max, std::optional< blender::StringRef > tip)
blender::Vector< blender::StringRef > UI_text_clip_multiline_middle(const uiFontStyle *fstyle, const char *str, char *clipped_str_buf, const size_t max_len_clipped_str_buf, const float max_line_width, const int max_lines)
uiBut * uiDefIconTextButR_prop(uiBlock *block, ButType type, int retval, int icon, std::optional< blender::StringRef > str, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, std::optional< blender::StringRef > tip)
uiBut * uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int index, std::optional< blender::StringRef > name, int icon, int x, int y, int width, int height)
void UI_view_item_begin_rename(blender::ui::AbstractViewItem &item)
void(*)(bContext *C, const uiBlockInteraction_Params *params, void *arg1, void *user_data) uiBlockInteractionEndFn
bool UI_butstore_register_update(uiBlock *block, uiBut *but_dst, const uiBut *but_src)
void UI_region_message_subscribe(ARegion *region, wmMsgBus *mbus)
void UI_panel_category_active_set(ARegion *region, const char *idname)
ID * UI_context_active_but_get_tab_ID(bContext *C)
eFontStyle_Align
@ UI_STYLE_TEXT_LEFT
@ UI_STYLE_TEXT_CENTER
@ UI_STYLE_TEXT_RIGHT
void uiTemplateFileSelectPath(uiLayout *layout, bContext *C, FileSelectParams *params)
ARegion * UI_tooltip_create_from_button_or_extra_icon(bContext *C, ARegion *butregion, uiBut *but, uiButExtraOpIcon *extra_icon, bool is_quick_tip)
void(*)(bContext *C, void *arg, int event) uiBlockHandleFunc
void uiTemplateBoneCollectionTree(uiLayout *layout, bContext *C)
void UI_panel_custom_data_set(Panel *panel, PointerRNA *custom_data)
void uiTemplatePreview(uiLayout *layout, bContext *C, ID *id, bool show_buttons, ID *parent, MTex *slot, const char *preview_id)
bool UI_search_item_add(uiSearchItems *items, blender::StringRef name, void *poin, int iconid, int but_flag, uint8_t name_prefix_offset)
void UI_but_number_slider_precision_set(uiBut *but, float precision)
void uiTemplateConstraints(uiLayout *layout, bContext *C, bool use_bone_constraints)
void UI_but_func_operator_search(uiBut *but)
int UI_autocomplete_end(AutoComplete *autocpl, char *autoname)
void UI_editsource_active_but_test(uiBut *but)
bool UI_panel_is_active(const Panel *panel)
const uiStyle * UI_style_get()
bool UI_panel_should_show_background(const ARegion *region, const PanelType *panel_type)
void UI_but_dragflag_enable(uiBut *but, int flag)
uiPopupMenu * UI_popup_menu_begin(bContext *C, const char *title, int icon) ATTR_NONNULL()
void uiTemplateOperatorPropertyButs(const bContext *C, uiLayout *layout, wmOperator *op, eButLabelAlign label_align, short flag)
ARegion *(*)(bContext *C, ARegion *butregion, uiButSearch *search_but) uiButSearchCreateFn
bool UI_block_is_search_only(const uiBlock *block)
bool UI_but_active_only_ex(const bContext *C, ARegion *region, uiBlock *block, uiBut *but, bool remove_on_failure)
void uiTemplateNodeTreeInterface(uiLayout *layout, const bContext *C, PointerRNA *ptr)
void UI_but_type_set_menu_from_pulldown(uiBut *but)
void UI_fontstyle_set(const uiFontStyle *fs)
void UI_draw_roundbox_3fv_alpha(const rctf *rect, bool filled, float rad, const float col[3], float alpha)
void uiTemplateMatrix(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname)
uiBut * uiDefIconTextButS(uiBlock *block, ButType type, int retval, int icon, blender::StringRef str, int x, int y, short width, short height, short *poin, std::optional< blender::StringRef > tip)
void UI_but_drag_set_path(uiBut *but, const char *path)
uiBut * uiDefBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, blender::StringRef str, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
eBlockBoundsCalc
@ UI_BLOCK_BOUNDS_PIE_CENTER
@ UI_BLOCK_BOUNDS_POPUP_MOUSE
@ UI_BLOCK_BOUNDS_POPUP_CENTER
@ UI_BLOCK_BOUNDS_POPUP_MENU
@ UI_BLOCK_BOUNDS_TEXT
@ UI_BLOCK_BOUNDS
@ UI_BLOCK_BOUNDS_NONE
uiBut * uiDefButAlert(uiBlock *block, int icon, int x, int y, short width, short height)
void UI_tooltip_uibut_python_add(uiTooltipData &data, bContext &C, uiBut &but, uiButExtraOpIcon *extra_icon)
void UI_panel_category_clear_all(ARegion *region)
bool uiTemplateEventFromKeymapItem(uiLayout *layout, blender::StringRefNull text, const wmKeyMapItem *kmi, bool text_fallback)
void uiTemplateColorRamp(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname, bool expand)
void uiTemplateCurveMapping(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname, int type, bool levels, bool brush, bool neg_slope, bool tone, bool presets)
std::optional< std::string > UI_but_online_manual_id(const uiBut *but) ATTR_WARN_UNUSED_RESULT
uiBlock *(*)(bContext *C, ARegion *region, void *arg1) uiBlockCreateFunc
void UI_pie_menu_end(bContext *C, uiPieMenu *pie)
blender::ui::AbstractViewItem * UI_region_views_find_active_item(const ARegion *region)
void uiTemplateCacheFileVelocity(uiLayout *layout, PointerRNA *fileptr)
uiBut * UI_context_active_but_prop_get(const bContext *C, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
PointerRNA * UI_but_operator_ptr_ensure(uiBut *but)
ARegion *(*)(bContext *C, ARegion *region, const rcti *item_rect, void *arg, void *active) uiButSearchTooltipFn
uiTooltipStyle
@ UI_TIP_STYLE_IMAGE
@ UI_TIP_STYLE_MONO
@ UI_TIP_STYLE_NORMAL
@ UI_TIP_STYLE_SPACER
@ UI_TIP_STYLE_HEADER
void UI_block_func_set(uiBlock *block, uiButHandleFunc func, void *arg1, void *arg2)
int(*)(bContext *C, char *str, void *arg) uiButCompleteFunc
PanelCategoryStack * UI_panel_category_active_find(ARegion *region, const char *idname)
void UI_but_func_search_set_context_menu(uiBut *but, uiButSearchContextMenuFn context_menu_fn)
float UI_text_clip_middle_ex(const uiFontStyle *fstyle, char *str, float okwidth, float minwidth, size_t max_len, char rpart_sep, bool clip_right_if_tight=true)
void UI_context_active_but_prop_get_filebrowser(const bContext *C, PointerRNA *r_ptr, PropertyRNA **r_prop, bool *r_is_undo, bool *r_is_userdef)
void UI_but_number_slider_step_size_set(uiBut *but, float step_size)
void UI_block_bounds_set_menu(uiBlock *block, int addval, const int bounds_offset[2])
Definition interface.cc:667
uiBut * uiDefIconButI(uiBlock *block, ButType type, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, std::optional< blender::StringRef > tip)
uiBut * uiDefIconButR_prop(uiBlock *block, ButType type, int retval, int icon, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, std::optional< blender::StringRef > tip)
void UI_but_func_rename_set(uiBut *but, uiButHandleRenameFunc func, void *arg1)
bool UI_view_item_matches(const blender::ui::AbstractViewItem &a, const blender::ui::AbstractViewItem &b)
std::string UI_but_string_get_rna_property_identifier(const uiBut &but)
uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
bool UI_block_is_empty_ex(const uiBlock *block, bool skip_title)
uiBut * uiDefIconButO_ptr(uiBlock *block, ButType type, wmOperatorType *ot, blender::wm::OpCallContext opcontext, int icon, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
void UI_but_drawflag_disable(uiBut *but, int flag)
void UI_block_draw(const bContext *C, uiBlock *block)
bool(*)(bContext *C, void *arg, void *active, const wmEvent *event) uiButSearchContextMenuFn
void uiTemplateID(uiLayout *layout, const bContext *C, PointerRNA *ptr, blender::StringRefNull propname, const char *newop, const char *openop, const char *unlinkop, int filter=UI_TEMPLATE_ID_FILTER_ALL, bool live_icon=false, std::optional< blender::StringRef > text=std::nullopt)
void UI_but_dragflag_disable(uiBut *but, int flag)
@ UI_RETURN_UPDATE
@ UI_RETURN_OUT_PARENT
@ UI_RETURN_CANCEL
@ UI_RETURN_POPUP_OK
@ UI_RETURN_OK
@ UI_RETURN_OUT
@ UI_CNR_BOTTOM_LEFT
@ UI_CNR_BOTTOM_RIGHT
@ UI_CNR_ALL
@ UI_CNR_TOP_LEFT
@ UI_CNR_TOP_RIGHT
@ UI_CNR_NONE
int UI_search_items_find_index(const uiSearchItems *items, const char *name)
std::string UI_but_extra_icon_string_get_tooltip(bContext &C, const uiButExtraOpIcon &extra_icon)
bool UI_textbutton_activate_but(const bContext *C, uiBut *actbut)
void UI_drop_color_copy(bContext *C, wmDrag *drag, wmDropBox *drop)
void uiTemplateIDBrowse(uiLayout *layout, bContext *C, PointerRNA *ptr, blender::StringRefNull propname, const char *newop, const char *openop, const char *unlinkop, int filter=UI_TEMPLATE_ID_FILTER_ALL, const char *text=nullptr)
void uiTemplateSearchPreview(uiLayout *layout, bContext *C, PointerRNA *ptr, blender::StringRefNull propname, PointerRNA *searchptr, const char *searchpropname, const char *newop, const char *unlinkop, int rows, int cols, std::optional< blender::StringRef > text=std::nullopt)
void UI_context_active_but_clear(bContext *C, wmWindow *win, ARegion *region)
void uiTemplateNodeSocket(uiLayout *layout, bContext *C, const float color[4])
void UI_exit()
void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname)
uiBut * uiDefButBitS(uiBlock *block, ButType type, int bit, int retval, blender::StringRef str, int x, int y, short width, short height, short *poin, float min, float max, std::optional< blender::StringRef > tip)
bool UI_butstore_is_registered(uiBlock *block, uiBut *but)
void uiTemplatePalette(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname, bool colors)
void UI_block_bounds_set_text(uiBlock *block, int addval)
Definition interface.cc:647
void *(*)(bContext *C, const uiBlockInteraction_Params *params, void *arg1) uiBlockInteractionBeginFn
void UI_but_func_set(uiBut *but, uiButHandleFunc func, void *arg1, void *arg2)
void uiTemplateIDPreview(uiLayout *layout, bContext *C, PointerRNA *ptr, blender::StringRefNull propname, const char *newop, const char *openop, const char *unlinkop, int rows, int cols, int filter=UI_TEMPLATE_ID_FILTER_ALL, bool hide_buttons=false)
PanelType * UI_but_paneltype_get(const uiBut *but)
bool UI_popup_menu_end_or_cancel(bContext *C, uiPopupMenu *pup)
void UI_block_align_begin(uiBlock *block)
int UI_searchbox_size_y()
void uiTemplateStripModifiers(uiLayout *layout, bContext *C)
void UI_style_init_default()
void UI_but_drag_set_asset(uiBut *but, const blender::asset_system::AssetRepresentation *asset, const AssetImportSettings &import_settings, int icon, int preview_icon)
void UI_but_context_ptr_set(uiBlock *block, uiBut *but, blender::StringRef name, const PointerRNA *ptr)
uiBut * uiDefIconButS(uiBlock *block, ButType type, int retval, int icon, int x, int y, short width, short height, short *poin, float min, float max, std::optional< blender::StringRef > tip)
bool UI_butstore_is_valid(uiButStore *bs_handle)
void uiTemplateCollectionExporters(uiLayout *layout, bContext *C)
void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname)
void UI_butstore_register(uiButStore *bs_handle, uiBut **but_p)
void UI_blocklist_free_inactive(const bContext *C, ARegion *region)
void uiTemplateOperatorRedoProperties(uiLayout *layout, const bContext *C)
void UI_butstore_clear(uiBlock *block)
uiBut * UI_but_active_drop_name_button(const bContext *C)
void(*)(bContext *C, ARegion *butregion, uiBut *but) uiButHandleHoldFunc
uiBut * UI_context_active_but_get_respect_popup(const bContext *C)
void UI_but_icon_indicator_set(uiBut *but, const char *string)
int UI_panel_category_index_find(ARegion *region, const char *idname)
int UI_fontstyle_string_width(const uiFontStyle *fs, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
void UI_context_active_but_prop_get_templateID(const bContext *C, PointerRNA *r_ptr, PropertyRNA **r_prop)
void uiTemplateNodeInputs(uiLayout *layout, bContext *C, PointerRNA *ptr)
void UI_autocomplete_update_name(AutoComplete *autocpl, blender::StringRef name)
void UI_but_func_search_set_sep_string(uiBut *but, const char *search_sep_string)
void UI_but_hint_drawstr_set(uiBut *but, const char *string)
void UI_popup_handlers_add(bContext *C, ListBase *handlers, uiPopupBlockHandle *popup, char flag)
wmOperatorType * UI_but_extra_operator_icon_optype_get(const uiButExtraOpIcon *extra_icon)
int uiTemplateRecentFiles(uiLayout *layout, int rows)
void UI_panel_category_active_set_default(ARegion *region, const char *idname)
uiBut * uiDefIconMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
void UI_but_operator_set_never_call(uiBut *but)
void UI_fontstyle_draw_multiline_clipped(const uiFontStyle *fs, const rcti *rect, const char *str, const uchar col[4], eFontStyle_Align align)
blender::ui::EmbossType UI_block_emboss_get(uiBlock *block)
void UI_blocklist_draw(const bContext *C, const ListBase *lb)
int UI_blocklist_min_y_get(ListBase *lb)
int int UI_fontstyle_string_width_with_block_aspect(const uiFontStyle *fs, blender::StringRef str, float aspect) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void uiTemplateGpencilColorPreview(uiLayout *layout, bContext *C, PointerRNA *ptr, blender::StringRefNull propname, int rows, int cols, float scale, int filter)
eButGradientType
@ UI_GRAD_L_ALT
@ UI_GRAD_SV
@ UI_GRAD_V_ALT
@ UI_GRAD_S
@ UI_GRAD_HV
@ UI_GRAD_HS
@ UI_GRAD_V
@ UI_GRAD_H
@ UI_GRAD_NONE
void uiTemplateEditModeSelection(uiLayout *layout, bContext *C)
uiBut * uiDefButImage(uiBlock *block, void *imbuf, int x, int y, short width, short height, const uchar color[4])
void UI_context_active_but_prop_handle(bContext *C, bool handle_undo)
uiButStore * UI_butstore_create(uiBlock *block)
void UI_draw_widget_scroll(uiWidgetColors *wcol, const rcti *rect, const rcti *slider, int state)
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)
void UI_block_funcN_set(uiBlock *block, uiButHandleNFunc funcN, void *argN, void *arg2, uiButArgNFree func_argN_free_fn=MEM_freeN, uiButArgNCopy func_argN_copy_fn=MEM_dupallocN)
wmOperatorStatus UI_popup_menu_invoke(bContext *C, const char *idname, ReportList *reports) ATTR_NONNULL(1
void(*)(const bContext *C, void *arg, const char *str, uiSearchItems *items, bool is_first) uiButSearchUpdateFn
bool UI_popup_block_template_confirm_is_supported(const uiBlock *block)
void UI_panel_label_offset(const uiBlock *block, int *r_x, int *r_y)
void UI_but_number_precision_set(uiBut *but, float precision)
void UI_block_bounds_set_centered(uiBlock *block, int addval)
Definition interface.cc:679
void uiTemplatePathBuilder(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname, PointerRNA *root_ptr, std::optional< blender::StringRefNull > text)
void uiTemplateImageStereo3d(uiLayout *layout, PointerRNA *stereo3d_format_ptr)
bool UI_but_active_only(const bContext *C, ARegion *region, uiBlock *block, uiBut *but)
void UI_but_drag_set_rna(uiBut *but, PointerRNA *ptr)
uiBut * uiDefIconTextButO_ptr(uiBlock *block, ButType type, wmOperatorType *ot, blender::wm::OpCallContext opcontext, int icon, blender::StringRef str, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
uiBut * UI_region_active_but_prop_get(const ARegion *region, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
void UI_fontstyle_draw(const uiFontStyle *fs, const rcti *rect, const char *str, size_t str_len, const uchar col[4], const uiFontStyleDraw_Params *fs_params)
void UI_popup_block_template_confirm_op(uiLayout *layout, wmOperatorType *ot, std::optional< blender::StringRef > confirm_text, std::optional< blender::StringRef > cancel_text, const int icon, bool cancel_default, PointerRNA *r_ptr)
void uiTemplateTextureShow(uiLayout *layout, const bContext *C, PointerRNA *ptr, PropertyRNA *prop)
void(*)(bContext *C, void *argN, void *arg2) uiButHandleNFunc
void uiTemplateGreasePencilLayerTree(uiLayout *layout, bContext *C)
int UI_icon_from_event_type(short event_type, short event_value)
uiBut * uiDefIconTextButR(uiBlock *block, ButType type, int retval, int icon, std::optional< blender::StringRefNull > str, int x, int y, short width, short height, PointerRNA *ptr, blender::StringRefNull propname, int index, std::optional< blender::StringRef > tip)
void UI_but_tooltip_refresh(bContext *C, uiBut *but)
void uiTemplateList(uiLayout *layout, const bContext *C, const char *listtype_name, const char *list_id, PointerRNA *dataptr, blender::StringRefNull propname, PointerRNA *active_dataptr, const char *active_propname, const char *item_dyntip_propname, int rows, int maxrows, int layout_type, int columns, enum uiTemplateListFlags flags)
int UI_preview_tile_size_x(const int size_px=96)
void UI_popup_menu_reports(bContext *C, ReportList *reports) ATTR_NONNULL()
void ED_keymap_ui(wmKeyConfig *keyconf)
User Interface Keymap.
void uiTemplateCurveProfile(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname)
std::string UI_but_extra_icon_string_get_label(const uiButExtraOpIcon &extra_icon)
void UI_block_free(const bContext *C, uiBlock *block)
void(*)(bContext *C, void *arg1, void *arg2) uiButHandleFunc
bool UI_but_active_drop_color(bContext *C)
void UI_but_func_menu_search(uiBut *but, const char *single_menu_idname=nullptr)
bool UI_region_button_sections_is_inside_x(const ARegion *region, const int mval_x)
void UI_but_label_alpha_factor_set(uiBut *but, float alpha_factor)
uiButtonSectionsAlign
void uiTemplateImageFormatViews(uiLayout *layout, PointerRNA *imfptr, PointerRNA *ptr)
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 uiTemplateAction(uiLayout *layout, const bContext *C, ID *id, const char *newop, const char *unlinkop, std::optional< blender::StringRef > text)
uiTooltipColorID
@ UI_TIP_LC_ALERT
@ UI_TIP_LC_PYTHON
@ UI_TIP_LC_MAIN
@ UI_TIP_LC_VALUE
@ UI_TIP_LC_NORMAL
@ UI_TIP_LC_ACTIVE
@ UI_TIP_LC_MAX
void uiTemplateKeymapItemProperties(uiLayout *layout, PointerRNA *ptr)
void UI_panel_end(Panel *panel, int width, int height)
void UI_block_region_set(uiBlock *block, ARegion *region)
void UI_panel_category_index_active_set(ARegion *region, const int index)
bool UI_panel_list_matches_data(ARegion *region, ListBase *data, uiListPanelIDFromDataFunc panel_idname_func)
void UI_block_direction_set(uiBlock *block, char direction)
void UI_but_func_hold_set(uiBut *but, uiButHandleHoldFunc func, void *argN)
@ UI_BLOCK_THEME_STYLE_REGULAR
@ UI_BLOCK_THEME_STYLE_POPUP
const PointerRNA * UI_but_context_ptr_get(const uiBut *but, blender::StringRef name, const StructRNA *type=nullptr)
void UI_butstore_free(uiBlock *block, uiButStore *bs_handle)
uiBut * uiDefButO(uiBlock *block, ButType type, blender::StringRefNull opname, blender::wm::OpCallContext opcontext, const std::optional< blender::StringRef > str, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
void UI_but_ensure_in_view(const bContext *C, ARegion *region, const uiBut *but)
void UI_screen_free_active_but_highlight(const bContext *C, bScreen *screen)
void UI_block_set_active_operator(uiBlock *block, wmOperator *op, const bool free)
void UI_but_icon_indicator_color_set(uiBut *but, const uchar color[4])
void UI_but_func_complete_set(uiBut *but, uiButCompleteFunc func, void *arg)
void UI_panel_header_buttons_end(Panel *panel)
void UI_tooltip_color_field_add(uiTooltipData &data, const blender::float4 &color, bool has_alpha, bool is_gamma, const ColorManagedDisplay *display, uiTooltipColorID color_id)
bool UI_panel_is_dragging(const Panel *panel)
uiBut * uiDefButBitC(uiBlock *block, ButType type, int bit, int retval, blender::StringRef str, int x, int y, short width, short height, char *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_but_func_search_set_listen(uiBut *but, uiButSearchListenFn listen_fn)
uiBut * uiDefButO_ptr(uiBlock *block, ButType type, wmOperatorType *ot, blender::wm::OpCallContext opcontext, blender::StringRef str, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname)
std::string UI_but_string_get_tooltip_label(const uiBut &but)
std::string UI_but_string_get_tooltip(bContext &C, uiBut &but)
void UI_panels_draw(const bContext *C, ARegion *region)
int uiTemplateStatusBarModalItem(uiLayout *layout, const wmKeyMap *keymap, const EnumPropertyItem *item)
void UI_but_operator_set(uiBut *but, wmOperatorType *optype, blender::wm::OpCallContext opcontext, const PointerRNA *opptr=nullptr)
void UI_block_flag_enable(uiBlock *block, int flag)
uiBut * uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int retval, int icon, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
@ UI_TEMPLATE_OP_PROPS_HIDE_ADVANCED
@ UI_TEMPLATE_OP_PROPS_SHOW_EMPTY
@ UI_TEMPLATE_OP_PROPS_ALLOW_UNDO_PUSH
@ UI_TEMPLATE_OP_PROPS_SHOW_TITLE
@ UI_TEMPLATE_OP_PROPS_HIDE_PRESETS
@ UI_TEMPLATE_OP_PROPS_COMPACT
@ UI_TEMPLATE_OP_PROPS_NO_SPLIT_LAYOUT
std::string UI_but_string_get_rna_struct_identifier(const uiBut &but)
const bContextStore * UI_but_context_get(const uiBut *but)
const ColorManagedDisplay * UI_but_cm_display_get(uiBut &but)
void UI_but_drag_set_id(uiBut *but, ID *id)
PointerRNA * UI_panel_custom_data_get(const Panel *panel)
ARegion * UI_tooltip_create_from_search_item_generic(bContext *C, const ARegion *searchbox_region, const rcti *item_rect, ID *id)
@ UI_BUT_TEXT_RIGHT
@ UI_BUT_ICON_LEFT
@ UI_BUT_ALIGN_ALL
@ UI_BUT_INDETERMINATE
@ UI_BUT_ICON_INVERT
@ UI_BUT_HAS_QUICK_TOOLTIP
@ UI_BUT_ALIGN_DOWN
@ UI_BUT_ALIGN_TOP
@ UI_BUT_ALIGN
@ UI_BUT_NO_TEXT_PADDING
@ UI_BUT_NO_TOOLTIP
@ UI_BUT_CHECKBOX_INVERT
@ UI_BUT_NO_PREVIEW_PADDING
@ UI_BUT_HOVER_RIGHT
@ UI_BUT_ALIGN_STITCH_TOP
@ UI_BUT_HOVER_LEFT
@ UI_BUT_ANIMATED_CHANGED
@ UI_BUT_TEXT_LEFT
@ UI_BUT_BOX_ITEM
@ UI_BUT_ALIGN_STITCH_LEFT
@ UI_BUT_ALIGN_RIGHT
@ UI_BUT_ALIGN_LEFT
@ UI_BUT_ICON_REVERSE
void ED_uilisttypes_ui()
int UI_preview_tile_size_y_no_label(const int size_px=96)
void UI_theme_init_default()
void uiTemplateColorspaceSettings(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname)
void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, blender::StringRefNull propname, PointerRNA *userptr, bool compact, bool multiview)
void UI_draw_roundbox_aa(const rctf *rect, bool filled, float rad, const float color[4])
void UI_list_panel_unique_str(Panel *panel, char *r_name)
void UI_popup_handlers_remove(ListBase *handlers, uiPopupBlockHandle *popup)
void UI_panel_context_pointer_set(Panel *panel, const char *name, PointerRNA *ptr)
wmOperator * UI_context_active_operator_get(const bContext *C)
int UI_calc_float_precision(int prec, double value)
void UI_but_funcN_set(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2, uiButArgNFree func_argN_free_fn=MEM_freeN, uiButArgNCopy func_argN_copy_fn=MEM_dupallocN)
Panel * UI_panel_add_instanced(const bContext *C, ARegion *region, ListBase *panels, const char *panel_idname, PointerRNA *custom_data)
std::string UI_but_extra_icon_string_get_operator_keymap(const bContext &C, const uiButExtraOpIcon &extra_icon)
void UI_panel_category_add(ARegion *region, const char *name)
void uiTemplateCacheFileTimeSettings(uiLayout *layout, PointerRNA *fileptr)
uiBut * uiDefButBitI(uiBlock *block, ButType type, int bit, int retval, blender::StringRef str, int x, int y, short width, short height, int *poin, float min, float max, std::optional< blender::StringRef > tip)
void uiTemplateShaderFx(uiLayout *layout, bContext *C)
void UI_but_unit_type_set(uiBut *but, int unit_type)
void UI_block_end_ex(const bContext *C, Main *bmain, wmWindow *window, Scene *scene, ARegion *region, Depsgraph *depsgraph, uiBlock *block, const int xy[2]=nullptr, int r_xy[2]=nullptr)
bool UI_but_is_color_gamma(uiBut &but)
bool UI_but_is_tool(const uiBut *but)
std::optional< blender::StringRefNull > UI_but_context_string_get(const uiBut *but, blender::StringRef name)
void UI_widgetbase_draw_cache_flush()
void UI_region_handlers_add(ListBase *handlers)
void UI_block_end(const bContext *C, uiBlock *block)
uiBut * uiDefButC(uiBlock *block, ButType type, int retval, blender::StringRef str, int x, int y, short width, short height, char *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_but_search_preview_grid_size_set(uiBut *but, int rows, int cols)
void UI_block_set_search_only(uiBlock *block, bool search_only)
void UI_but_node_link_set(uiBut *but, bNodeSocket *socket, const float draw_color[4])
void UI_block_lock_set(uiBlock *block, bool val, const char *lockstr)
AutoComplete * UI_autocomplete_begin(const char *startname, size_t maxncpy)
void UI_but_func_quick_tooltip_set(uiBut *but, std::function< std::string(const uiBut *but)> func)
uiBut * uiDefBut(uiBlock *block, uiButTypeWithPointerType but_and_ptr_type, int retval, blender::StringRef str, int x, int y, short width, short height, void *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_widgetbase_draw_cache_begin()
PointerRNA * UI_region_panel_custom_data_under_cursor(const bContext *C, const wmEvent *event)
const char * UI_panel_category_active_get(ARegion *region, bool set_fallback)
wmOperatorStatus void UI_popup_menu_close(const uiBlock *block, bool is_cancel=false)
uiBut * uiDefIconPreviewBut(uiBlock *block, ButType type, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, std::optional< blender::StringRef > tip)
void uiTemplateSearch(uiLayout *layout, const bContext *C, PointerRNA *ptr, blender::StringRefNull propname, PointerRNA *searchptr, const char *searchpropname, const char *newop, const char *unlinkop, std::optional< blender::StringRef > text=std::nullopt)
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)
void UI_but_flag_enable(uiBut *but, int flag)
void UI_region_free_active_but_all(bContext *C, ARegion *region)
uiTemplateListFlags
@ UI_TEMPLATE_LIST_SORT_LOCK
@ UI_TEMPLATE_LIST_SORT_REVERSE
@ UI_TEMPLATE_LIST_NO_NAMES
@ UI_TEMPLATE_LIST_FLAGS_LAST
@ UI_TEMPLATE_LIST_FLAG_NONE
@ UI_TEMPLATE_LIST_NO_FILTER_OPTIONS
@ UI_TEMPLATE_LIST_NO_GRIP
uiBut * uiDefBlockButN(uiBlock *block, uiBlockCreateFunc func, void *argN, blender::StringRef str, int x, int y, short width, short height, std::optional< blender::StringRef > tip, uiButArgNFree func_argN_free_fn=MEM_freeN, uiButArgNCopy func_argN_copy_fn=MEM_dupallocN)
void(*)(const wmRegionListenerParams *params, void *arg) uiButSearchListenFn
@ UI_DIR_CENTER_X
@ UI_DIR_CENTER_Y
@ UI_DIR_ALL
@ UI_DIR_DOWN
@ UI_DIR_RIGHT
@ UI_DIR_LEFT
@ UI_DIR_UP
void UI_but_view_item_draw_size_set(uiBut *but, const std::optional< int > draw_width=std::nullopt, const std::optional< int > draw_height=std::nullopt)
std::optional< blender::StringRefNull > UI_but_asset_shelf_type_idname_get(const uiBut *but)
uiBut * UI_region_views_find_active_item_but(const ARegion *region)
void UI_fontstyle_draw_multiline_clipped_ex(const uiFontStyle *fs, const rcti *rect, const char *str, const uchar col[4], eFontStyle_Align align, int *r_xofs, int *r_yofs, ResultBLF *r_info)
void uiTemplateCacheFile(uiLayout *layout, const bContext *C, PointerRNA *ptr, blender::StringRefNull propname)
bool UI_but_flag_is_set(uiBut *but, int flag)
wmOperatorType * UI_but_operatortype_get_from_enum_menu(uiBut *but, PropertyRNA **r_prop)
void uiTemplateCryptoPicker(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname, int icon)
blender::ui::AbstractViewItem * UI_region_views_find_item_at(const ARegion &region, const int xy[2])
void UI_popup_handlers_remove_all(bContext *C, ListBase *handlers)
void uiTemplateHeader(uiLayout *layout, bContext *C)
void UI_but_drag_set_name(uiBut *but, const char *name)
void uiTemplateImageInfo(uiLayout *layout, bContext *C, Image *ima, ImageUser *iuser)
void UI_block_bounds_set_explicit(uiBlock *block, int minx, int miny, int maxx, int maxy)
Definition interface.cc:685
void UI_block_align_end(uiBlock *block)
void(*)(void *arg) uiFreeArgFunc
void(*)(bContext *C, uiLayout *layout, void *arg1) uiMenuCreateFunc
std::string(*)(bContext *C, void *argN, blender::StringRef tip) uiButToolTipFunc
void(*)(bContext &C, uiTooltipData &data, uiBut *but, void *argN) uiButToolTipCustomFunc
blender::ocio::Display ColorManagedDisplay
bool(*)(bContext *C, int direction, void *arg1) uiMenuStepFunc
#define KM_MOD_NUM
Definition WM_types.hh:297
int pad[32 - sizeof(int)]
volatile int lock
BMesh const char void * data
BPy_StructRNA * depsgraph
long long int int64_t
#define str(s)
uint pos
uint col
#define input
#define active
#define filter
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void * MEM_dupallocN(const void *vmemh)
Definition mallocn.cc:143
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
static ulong state[N]
void template_tree(uiLayout *layout, bContext *C)
char but_pointer_bit_max_index(ButPointerType pointer_type)
void template_asset_shelf_popover(uiLayout &layout, const bContext &C, StringRefNull asset_shelf_id, StringRef name, int icon)
VecBase< float, 4 > float4
const char * name
#define min(a, b)
Definition sort.cc:36
const char * startname
Definition DNA_ID.h:414
uiBlockInteractionBeginFn begin_fn
uiBlockInteractionEndFn end_fn
uiBlockInteractionUpdateFn update_fn
uiBlock * block
uiButTypeWithPointerType(ButType bt, ButPointerType pt)
uiButTypeWithPointerType(ButType bt, ButPointerType pt, int i)
uiTooltipImageBackground background
i
Definition text_draw.cc:230
max
Definition text_draw.cc:251
uint len
int xy[2]
Definition wm_draw.cc:178
PointerRNA * ptr
Definition wm_files.cc:4238
wmOperatorType * ot
Definition wm_files.cc:4237
uint8_t flag
Definition wm_window.cc:145