Blender V5.3
DNA_screen_types.h
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 "BLI_enum_flags.hh"
12
13#include "DNA_asset_types.h"
14#include "DNA_defs.h"
15#include "DNA_listBase.h"
16#include "DNA_vec_types.h"
17#include "DNA_view2d_types.h"
18
19#include "DNA_ID.h"
20
21namespace blender {
22
23struct ARegion;
24struct ARegionType;
25struct PanelType;
26struct PointerRNA;
27struct Scene;
28struct SpaceLink;
29struct SpaceType;
30struct uiList;
31struct uiListType;
32struct wmDrawBuffer;
33struct wmTimer;
34struct wmTooltipState;
35struct Panel_Runtime;
36namespace bke {
37struct ARegionRuntime;
38struct FileHandlerType;
39} // namespace bke
40namespace ui {
41struct Layout;
42} // namespace ui
43
50
51
64
72
73
75 TIME_REGION = (1 << 0),
76 TIME_ALL_3D_WIN = (1 << 1),
79 // TIME_WITH_SEQ_AUDIO = (1 << 4), /* DEPRECATED */
80 TIME_SEQ = (1 << 5),
82 // TIME_CONTINUE_PHYSICS = (1 << 7), /* UNUSED */
83 TIME_NODES = (1 << 8),
84 TIME_CLIPS = (1 << 9),
85 TIME_SPREADSHEETS = (1 << 10),
86
87 TIME_FOLLOW = static_cast<short>(1 << 15),
88};
90
91/* TODO: Doing this is quite ugly :)
92 * Once the top-bar is merged bScreen should be refactored to use ScrAreaMap. */
93#define AREAMAP_FROM_SCREEN(screen) ((ScrAreaMap *)&(screen)->vertbase)
94
95struct bScreen {
96#ifdef __cplusplus
98 static constexpr ID_Type id_type = ID_SCR;
99#endif
100
102
103 /* TODO: Should become ScrAreaMap now.
104 * NOTE: KEEP ORDER IN SYNC WITH #ScrAreaMap! (see AREAMAP_FROM_SCREEN macro above). */
106 ListBaseT<struct ScrVert> vertbase = {nullptr, nullptr};
107 ListBaseT<struct ScrEdge> edgebase = {nullptr, nullptr};
108 ListBaseT<struct ScrArea> areabase = {nullptr, nullptr};
109 /* End variables that must be in sync with #ScrAreaMap. */
110
112 ListBaseT<ARegion> regionbase = {nullptr, nullptr};
113
114 DNA_DEPRECATED struct Scene *scene = nullptr;
115
119 short winid = 0;
122
124 char temp = 0;
128 char do_draw = 0;
130 char do_refresh = 0;
136 char do_draw_drag = 0;
140 char scrubbing = 0;
141 char _pad[1] = {};
142
144 struct ARegion *active_region = nullptr;
145
147 struct wmTimer *animtimer = nullptr;
149 void /*bContextDataCallback*/ *context = nullptr;
150
151 /* Used to restore after SCREENFULL state. */
153 char _pad2[6] = {};
154
156 struct wmTooltipState *tool_tip = nullptr;
157
159};
160
161struct ScrVert {
162 struct ScrVert *next = nullptr, *prev = nullptr, *newv = nullptr;
163 vec2s vec = {};
164 /* first one used internally, second one for tools */
165 short flag = 0, editflag = 0;
166};
167
168struct ScrEdge {
169 struct ScrEdge *next = nullptr, *prev = nullptr;
170 ScrVert *v1 = nullptr, *v2 = nullptr;
172 short border = 0;
173 short flag = 0;
174 char _pad[4] = {};
175};
176
178 /* ** NOTE: KEEP ORDER IN SYNC WITH LISTBASES IN bScreen! ** */
179
181 ListBaseT<ScrVert> vertbase = {nullptr, nullptr};
182 ListBaseT<ScrEdge> edgebase = {nullptr, nullptr};
183 ListBaseT<ScrArea> areabase = {nullptr, nullptr};
184};
185
191
192
219
220
221enum ePanel_Flag : short {
222 PNL_SELECT = (1 << 0),
223 PNL_UNUSED_1 = (1 << 1), /* Cleared */
224 PNL_CLOSED = (1 << 2),
225 // PNL_TABBED = (1 << 3), /* UNUSED */
226 // PNL_OVERLAP = (1 << 4), /* UNUSED */
227 PNL_PIN = (1 << 5),
228 PNL_POPOVER = (1 << 6),
231};
233
234
235#define PNL_CATEGORY_FALLBACK "Misc"
236
238 struct LayoutPanelState *next = nullptr, *prev = nullptr;
240 char *idname = nullptr;
242 char _pad[3] = {};
248};
249
250struct Panel {
251 struct Panel *next = nullptr, *prev = nullptr;
252
254 struct PanelType *type = nullptr;
256 ui::Layout *layout = nullptr;
257
258 char panelname[/*BKE_ST_MAXNAME*/ 64] = "";
260 char *drawname = nullptr;
262 int ofsx = 0, ofsy = 0;
264 int sizex = 0, sizey = 0;
266 int blocksizex = 0, blocksizey = 0;
267 short labelofs = 0;
269 short runtime_flag = 0;
270 char _pad[6] = {};
272 int sortorder = 0;
274 void *activedata = nullptr;
276 ListBaseT<Panel> children = {nullptr, nullptr};
277
283 ListBaseT<LayoutPanelState> layout_panel_states = {nullptr, nullptr};
290 char _pad2[4] = {};
291
292 struct Panel_Runtime *runtime = nullptr;
293};
294
310
311/* region level tabs */
312#
313#
315 struct PanelCategoryDyn *next = nullptr, *prev = nullptr;
316 char idname[64] = "";
317 int icon = 0;
318};
319
322 struct PanelCategoryStack *next = nullptr, *prev = nullptr;
323 char idname[64] = "";
324};
325
331
338
339
340#define UI_LIST_AUTO_SIZE_THRESHOLD 1
341
349enum euiList_Filter : int {
350 /* Don't use (1 << 0) to (1 << 15) here! See warning above. */
351
352 /* Filtering returned #UI_LIST_ITEM_NEVER_SHOW. */
354 UILST_FLT_ITEM = 1 << 30, /* This item has passed the filter process successfully. */
355};
357
358
360 UILST_FLT_SHOW = 1 << 0, /* Show filtering UI. */
361 UILST_FLT_EXCLUDE = UILST_FLT_ITEM, /* Exclude filtered items, *must* use this same value. */
362};
364
365
367 /* Plain values (only one is valid at a time, once masked with UILST_FLT_SORT_MASK). */
369 /* UILST_FLT_SORT_INDEX = 0, */ /* UNUSED */
371
372 /* Bitflags affecting behavior of any kind of sorting. */
374 UILST_FLT_SORT_LOCK = int(1u << 30),
376 UILST_FLT_SORT_REVERSE = int(1u << 31),
377};
379
380#define UILST_FLT_SORT_MASK (((unsigned int)(UILST_FLT_SORT_REVERSE | UILST_FLT_SORT_LOCK)) - 1)
381
382typedef void (*uiListFreeRuntimeDataFunc)(struct uiList *ui_list);
383
384/* uiList dynamic data... */
385/* These two lines with # tell `makesdna` this struct can be excluded. */
386#
387#
388struct uiListDyn {
391
393 int height = 0;
398
400 int items_len = 0;
402 int items_shown = 0;
403
404 /* Those are temp data used during drag-resize with GRIP button
405 * (they are in pixels, the meaningful data is the
406 * difference between resize_prev and resize)...
407 */
408 int resize = 0;
409 int resize_prev = 0;
410
412 void *customdata = nullptr;
413
414 /* Filtering data. */
418 int *items_filter_flags = nullptr;
420 int *items_filter_neworder = nullptr;
421
423};
424
425struct uiList { /* some list UI data need to be saved in file */
426 struct uiList *next = nullptr, *prev = nullptr;
427
429 struct uiListType *type = nullptr;
430
431 char list_id[/*UI_MAX_NAME_STR*/ 256] = "";
432
436
437 int list_scroll = 0;
438 int list_grip = 0;
441
442 /* Filtering data. */
444 char filter_byname[/*UI_MAX_NAME_STR*/ 256] = "";
447
450
452 uiListDyn *dyn_data = nullptr;
453};
454
461
462
476 char _pad[5] = {};
478 char search_string[/*UI_MAX_NAME_STR*/ 256] = "";
479};
480
489 struct uiViewStateLink *next = nullptr, *prev = nullptr;
490
491 char idname[/*BKE_ST_MAXNAME*/ 64] = "";
492
494};
495
497 struct TransformOrientation *next = nullptr, *prev = nullptr;
498 char name[/*MAX_NAME*/ 64] = "";
499 float mat[3][3] = {};
500 char _pad[4] = {};
501};
502
503enum uiPreviewTag : short {
506};
508
509
510struct uiPreview {
511 struct uiPreview *next = nullptr, *prev = nullptr;
512
513 char preview_id[/*BKE_ST_MAXNAME*/ 64] = "";
514 short height = 0;
515
516 /* Unset on file read. */
518
520 unsigned int id_session_uid = 0;
521};
522
528 int scroll = 0;
529};
530
539 struct uiTextboxStateLink *next = nullptr, *prev = nullptr;
540 char *idname = nullptr;
542};
543
544enum GlobalAreaFlag : short {
546};
548
553
571
573enum eScrArea_Flag : short {
575// AREA_FLAG_UNUSED_1 = (1 << 1),
576// AREA_FLAG_UNUSED_2 = (1 << 2),
578 AREA_TEMP_INFO = (1 << 3), /* versioned to make slot reusable */
579#endif
583 // AREA_FLAG_UNUSED_5 = (1 << 5),
584
585 AREA_FLAG_UNUSED_6 = (1 << 6), /* cleared */
586
596};
598
599#define AREAGRID 1
600#define AREAMINX 29
601#define HEADER_PADDING_Y 6
602#define HEADERY (20 + HEADER_PADDING_Y)
603
605 struct bToolRef *tool = nullptr;
606 char is_tool_set = 0;
607 char _pad0[7] = {};
608};
609
610struct ScrArea {
612
613 struct ScrArea *next = nullptr, *prev = nullptr;
614
616 ScrVert *v1 = nullptr, *v2 = nullptr, *v3 = nullptr, *v4 = nullptr;
618 bScreen *full = nullptr;
619
622
624 char spacetype = 0;
632 char butspacetype = 0;
634
636 short winx = 0, winy = 0;
637
641 char do_refresh = 0;
648 char _pad[2] = {};
649
651 struct SpaceType *type = nullptr;
652
655
656 float quadview_ratio[2] = {};
657
663 ListBaseT<SpaceLink> spacedata = {nullptr, nullptr};
668 ListBaseT<ARegion> regionbase = {nullptr, nullptr};
669 ListBaseT<struct wmEventHandler> handlers = {nullptr, nullptr};
670
671 ListBaseT<struct AZone> actionzones = {nullptr, nullptr};
672
674};
675
680enum eRegion_Type : short {
690 /* Region to navigate the main region from (RGN_TYPE_WINDOW). */
692 /* A place for buttons to trigger execution of something that was set up in other regions. */
696 /* Region type used exclusively by internal code and add-ons to register draw callbacks to the XR
697 * context (surface, mirror view). Does not represent any real region. */
702
703#define RGN_TYPE_NUM (RGN_TYPE_SCRUBBING + 1)
704};
705
707#define RGN_TYPE_ANY -1
708
710#define RGN_TYPE_IS_HEADER_ANY(regiontype) \
711 (((1 << (regiontype)) & \
712 ((1 << RGN_TYPE_HEADER) | 1 << (RGN_TYPE_TOOL_HEADER) | (1 << RGN_TYPE_FOOTER) | \
713 (1 << RGN_TYPE_ASSET_SHELF_HEADER) | (1 << RGN_TYPE_SCRUBBING))) != 0)
714
745
746
747#define RGN_ALIGN_ENUM_FROM_MASK(align) ((align) & eRegion_Alignment((1 << 4) - 1))
748#define RGN_ALIGN_FLAG_FROM_MASK(align) ((align) & ~eRegion_Alignment((1 << 4) - 1))
749
784
785
810
811struct ARegion {
812 struct ARegion *next = nullptr, *prev = nullptr;
813
819 short winx = 0, winy = 0;
825
832
837 short sizex = 0, sizey = 0;
838
840 short overlap = 0;
842 short flagfullscreen = 0;
843
844 char _pad[2] = {};
845
846 ListBaseT<Panel> panels = {nullptr, nullptr};
848 ListBaseT<PanelCategoryStack> panels_category_active = {nullptr, nullptr};
849 ListBaseT<uiList> ui_lists = {nullptr, nullptr};
850 ListBaseT<uiPreview> ui_previews = {nullptr, nullptr};
855 ListBaseT<uiViewStateLink> view_states = {nullptr, nullptr};
860 ListBaseT<uiTextboxStateLink> textbox_states = {nullptr, nullptr};
861
863 void *regiondata = nullptr;
864
866};
867
868/* #AssetShelfSettings.display_flag */
873
874/* #AssetShelfSettings.instance_flag */
884
887
888 ListBaseT<AssetCatalogPathLink> enabled_catalog_paths = {nullptr, nullptr};
890 const char *active_catalog_path = nullptr;
891
893 char search_string[64] = "";
894
895 short preview_size = 0;
897 char _pad1[4] = {};
898
899#if defined(__cplusplus) && !defined(DNA_NO_EXTERNAL_CONSTRUCTORS)
900 /* Zero initializes. */
902 /* Proper deep copy. */
906#endif
907};
908
911
912 struct AssetShelf *next = nullptr, *prev = nullptr;
913
916 char idname[/*MAX_NAME*/ 64] = "";
918 struct AssetShelfType *type = nullptr;
919
921
925 char _pad[4] = {};
926};
927
937 ListBaseT<AssetShelf> shelves = {nullptr, nullptr};
943 AssetShelf *active_shelf = nullptr; /* Non-owning. */
944#ifdef __cplusplus
945 static RegionAssetShelf *get_from_asset_shelf_region(const ARegion &region);
947 static RegionAssetShelf *ensure_from_asset_shelf_region(ARegion &region);
948#endif
949};
950
956
957} // namespace blender
#define ENUM_OPERATORS(_enum_type)
ID and Library types, which are fundamental for SDNA.
#define DNA_DEFINE_CXX_METHODS(class_name)
Definition DNA_defs.h:104
#define DNA_DEPRECATED
Definition DNA_defs.h:21
These structs are the foundation for all linked lists in the library system.
btGeneric6DofConstraint & operator=(btGeneric6DofConstraint &other)
ENUM_OPERATORS(Layer::Flags)
BMesh Iterators.
@ UI_SUBPANEL_DATA_EXPAND_2
@ UI_SUBPANEL_DATA_EXPAND_9
@ UI_SUBPANEL_DATA_EXPAND_13
@ UI_SUBPANEL_DATA_EXPAND_6
@ UI_SUBPANEL_DATA_EXPAND_10
@ UI_SUBPANEL_DATA_EXPAND_11
@ UI_SUBPANEL_DATA_EXPAND_5
@ UI_SUBPANEL_DATA_EXPAND_15
@ UI_SUBPANEL_DATA_EXPAND_1
@ UI_PANEL_DATA_EXPAND_ROOT
@ UI_SUBPANEL_DATA_EXPAND_14
@ UI_SUBPANEL_DATA_EXPAND_8
@ UI_SUBPANEL_DATA_EXPAND_7
@ UI_SUBPANEL_DATA_EXPAND_3
@ UI_SUBPANEL_DATA_EXPAND_4
@ UI_SUBPANEL_DATA_EXPAND_12
@ LAYOUT_PANEL_STATE_FLAG_OPEN
@ UILST_SCROLL_TO_ACTIVE_ITEM
@ FULLSCREEN_RESTORE_STATS
@ FULLSCREEN_RESTORE_TEXT
@ FULLSCREEN_RESTORE_GIZMO_NAVIGATE
@ RGN_TYPE_ASSET_SHELF_HEADER
@ GLOBAL_AREA_ALIGN_BOTTOM
void(*) uiListFreeRuntimeDataFunc(struct uiList *ui_list)
unsigned short ushort
Definition BKE_text.h:56
@ RGN_DRAW_EDITOR_OVERLAYS
@ SCREEN_COLLAPSE_STATUSBAR
@ RGN_ALIGN_HIDE_WITH_PREV
unsigned short uint16_t
Definition BKE_text.h:80
unsigned int uint32_t
Definition BKE_text.h:81
unsigned char uchar
Definition BKE_text.h:58
@ UILST_FLT_ITEM_NEVER_SHOW
unsigned char uint8_t
Definition BKE_text.h:79
@ UI_VIEW_SHOW_FILTER_OPTIONS
@ PNL_INSTANCED_LIST_ORDER_CHANGED
@ ASSETSHELF_REGION_IS_HIDDEN
AssetShelfSettings_DisplayFlag
@ RGN_FLAG_INDICATE_OVERFLOW
@ RGN_FLAG_SEARCH_FILTER_SHOW
@ RGN_FLAG_NO_USER_RESIZE
@ RGN_FLAG_HIDDEN_BY_USER
@ RGN_FLAG_SEARCH_FILTER_ACTIVE
@ RGN_FLAG_SEARCH_FILTER_UPDATE
@ RGN_FLAG_RESIZE_RESPECT_BUTTON_SECTIONS
@ RGN_FLAG_TEMP_REGIONDATA
@ AREA_FLAG_REGION_SIZE_UPDATE
@ AREA_FLAG_ACTIONZONES_UPDATE
@ AREA_FLAG_ACTIVE_TOOL_UPDATE
@ AREA_FLAG_STACKED_FULLSCREEN
ListBaseT< uiList > ui_lists
struct ARegion * next
ListBaseT< Panel > panels
bke::ARegionRuntime * runtime
ListBaseT< uiTextboxStateLink > textbox_states
struct ARegion * prev
ListBaseT< uiViewStateLink > view_states
eRegion_Alignment alignment
ListBaseT< uiPreview > ui_previews
eRegion_Type regiontype
ListBaseT< PanelCategoryStack > panels_category_active
AssetLibraryReference asset_library_reference
ListBaseT< AssetCatalogPathLink > enabled_catalog_paths
AssetShelfSettings_DisplayFlag display_flag
struct AssetShelf * next
struct AssetShelf * prev
AssetShelf_InstanceFlag instance_flag
struct AssetShelfType * type
AssetShelfSettings settings
bke::FileHandlerType * type
LayoutPanelStateFlag flag
struct LayoutPanelState * next
struct LayoutPanelState * prev
struct PanelCategoryDyn * next
struct PanelCategoryDyn * prev
struct PanelCategoryStack * next
struct PanelCategoryStack * prev
struct PanelType * type
uint32_t layout_panel_states_clock
ListBaseT< Panel > children
ListBaseT< LayoutPanelState > layout_panel_states
struct Panel * prev
ui::Layout * layout
struct Panel * next
struct Panel_Runtime * runtime
ListBaseT< AssetShelf > shelves
ListBaseT< ScrArea > areabase
ListBaseT< ScrVert > vertbase
ListBaseT< ScrEdge > edgebase
ListBaseT< struct wmEventHandler > handlers
ListBaseT< struct AZone > actionzones
ListBaseT< ARegion > regionbase
ScrArea_Runtime runtime
DNA_DEPRECATED char headertype
struct ScrArea * next
ListBaseT< SpaceLink > spacedata
ScrGlobalAreaData * global
struct SpaceType * type
struct ScrArea * prev
struct ScrEdge * next
struct ScrEdge * prev
struct ScrVert * newv
struct ScrVert * next
struct ScrVert * prev
struct TransformOrientation * prev
struct TransformOrientation * next
eScreen_State state
eScreen_Fullscreen_Flag fullscreen_flag
struct wmTimer * animtimer
struct ARegion * active_region
ListBaseT< struct ScrEdge > edgebase
ListBaseT< struct ScrVert > vertbase
ListBaseT< struct ScrArea > areabase
DNA_DEPRECATED struct Scene * scene
eScreen_Redraws_Flag redraws_flag
PreviewImage * preview
ListBaseT< ARegion > regionbase
struct wmTooltipState * tool_tip
uiListFreeRuntimeDataFunc free_runtime_data_fn
struct wmOperatorType * custom_drag_optype
euiList_FilterSortFlag filter_sort_flag
euiList_LayoutType layout_type
euiList_FilterFlag filter_flag
IDProperty * properties
struct uiListType * type
struct uiList * next
struct uiList * prev
unsigned int id_session_uid
struct uiPreview * prev
struct uiPreview * next
#define DNA_DEPRECATED_ALLOW
Definition versioning.cc:11