Blender  V3.3
DNA_screen_types.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #pragma once
9 
10 #include "DNA_defs.h"
11 #include "DNA_listBase.h"
12 #include "DNA_vec_types.h"
13 #include "DNA_view2d_types.h"
14 
15 #include "DNA_ID.h"
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 struct ARegion;
22 struct ARegionType;
23 struct PanelType;
24 struct PointerRNA;
25 struct Scene;
26 struct SpaceLink;
27 struct SpaceType;
28 struct uiBlock;
29 struct uiLayout;
30 struct uiList;
31 struct wmDrawBuffer;
32 struct wmTimer;
33 struct wmTooltipState;
34 
35 /* TODO: Doing this is quite ugly :)
36  * Once the top-bar is merged bScreen should be refactored to use ScrAreaMap. */
37 #define AREAMAP_FROM_SCREEN(screen) ((ScrAreaMap *)&(screen)->vertbase)
38 
39 typedef struct bScreen {
40  ID id;
41 
42  /* TODO: Should become ScrAreaMap now.
43  * NOTE: KEEP ORDER IN SYNC WITH #ScrAreaMap! (see AREAMAP_FROM_SCREEN macro above). */
48  /* End variables that must be in sync with #ScrAreaMap. */
49 
52 
54 
56  short flag;
58  short winid;
60  short redraws_flag;
61 
63  char temp;
65  char state;
67  char do_draw;
69  char do_refresh;
79  char scrubbing;
80  char _pad[1];
81 
84 
86  struct wmTimer *animtimer;
88  void /*bContextDataCallback*/ *context;
89 
92 
95 
96 typedef struct ScrVert {
97  struct ScrVert *next, *prev, *newv;
99  /* first one used internally, second one for tools */
100  short flag, editflag;
102 
103 typedef struct ScrEdge {
104  struct ScrEdge *next, *prev;
107  short border;
108  short flag;
109  char _pad[4];
111 
112 typedef struct ScrAreaMap {
113  /* ** NOTE: KEEP ORDER IN SYNC WITH LISTBASES IN bScreen! ** */
114 
122 
123 typedef struct Panel_Runtime {
124  /* Applied to Panel.ofsx, but saved separately so we can track changes between redraws. */
126 
127  char _pad[4];
128 
137 
138  /* Pointer to the panel's block. Useful when changes to panel #uiBlocks
139  * need some context from traversal of the panel "tree". */
140  struct uiBlock *block;
141 
142  /* Non-owning pointer. The context is stored in the block. */
145 
147 typedef struct Panel {
148  struct Panel *next, *prev;
149 
151  struct PanelType *type;
153  struct uiLayout *layout;
154 
156  char panelname[64];
158  char drawname[64];
160  int ofsx, ofsy;
162  int sizex, sizey;
165  short labelofs;
167  char _pad[6];
171  void *activedata;
174 
177 
186 typedef enum uiPanelDataExpansion {
205 
222 /* region level tabs */
223 #
224 #
225 typedef struct PanelCategoryDyn {
227  char idname[64];
230 
232 typedef struct PanelCategoryStack {
234  char idname[64];
236 
237 typedef void (*uiListFreeRuntimeDataFunc)(struct uiList *ui_list);
238 
239 /* uiList dynamic data... */
240 /* These two Lines with # tell makesdna this struct can be excluded. */
241 #
242 #
243 typedef struct uiListDyn {
246 
248  int height;
253 
255  int columns;
256 
261 
262  /* Those are temp data used during drag-resize with GRIP button
263  * (they are in pixels, the meaningful data is the
264  * difference between resize_prev and resize)...
265  */
266  int resize;
268 
270  void *customdata;
271 
272  /* Filtering data. */
277 
283 
284 typedef struct uiList { /* some list UI data need to be saved in file */
285  struct uiList *next, *prev;
286 
288  struct uiListType *type;
289 
291  char list_id[64];
292 
295  int flag;
296 
301 
302  /* Filtering data. */
304  char filter_byname[64];
307 
308  /* Custom sub-classes properties. */
310 
311  /* Dynamic data (runtime). */
314 
315 typedef struct TransformOrientation {
318  char name[64];
319  float mat[3][3];
320  char _pad[4];
322 
324 typedef struct uiPreview {
325  struct uiPreview *next, *prev;
326 
328  char preview_id[64];
329  short height;
330  char _pad1[6];
332 
333 typedef struct ScrGlobalAreaData {
334  /* Global areas have a non-dynamic size. That means, changing the window
335  * size doesn't affect their size at all. However, they can still be
336  * 'collapsed', by changing this value. Ignores DPI (ED_area_global_size_y
337  * and winx/winy don't) */
339  /* For global areas, this is the min and max size they can use depending on
340  * if they are 'collapsed' or not. */
343  short align;
344 
346  short flag;
347  char _pad[2];
349 
352 };
353 
354 typedef enum GlobalAreaAlign {
358 
359 typedef struct ScrArea_Runtime {
360  struct bToolRef *tool;
362  char _pad0[7];
364 
365 typedef struct ScrArea {
366  struct ScrArea *next, *prev;
367 
369  ScrVert *v1, *v2, *v3, *v4;
372 
375 
383  char spacetype;
387 
389  short winx, winy;
390 
392  char headertype DNA_DEPRECATED;
395  short flag;
401  char _pad[2];
402 
404  struct SpaceType *type;
405 
406  /* Non-NULL if this area is global. */
408 
409  /* A list of space links (editors) that were open in this area before. When
410  * changing the editor type, we try to reuse old editor data from this list.
411  * The first item is the active/visible one.
412  */
415  /* NOTE: This region list is the one from the active/visible editor (first item in
416  * spacedata list). Use SpaceLink.regionbase if it's inactive (but only then)!
417  */
422 
425 
428 
429 typedef struct ARegion_Runtime {
430  /* Panel category to use between 'layout' and 'draw'. */
431  const char *category;
432 
439 
440  /* The offset needed to not overlap with window scrollbars. Only used by HUD regions for now. */
442 
443  /* Maps uiBlock->name to uiBlock for faster lookups. */
446 
447 typedef struct ARegion {
448  struct ARegion *next, *prev;
449 
457  short winx, winy;
458 
460  short visible;
462  short regiontype;
464  short alignment;
466  short flag;
467 
472  short sizex, sizey;
473 
475  short do_draw;
479  short overlap;
482 
484  struct ARegionType *type;
485 
500 
506 
508  char *headerstr;
510  void *regiondata;
511 
514 
516 enum {
517  HEADER_NO_PULLDOWN = (1 << 0),
518 // AREA_FLAG_UNUSED_1 = (1 << 1),
519 // AREA_FLAG_UNUSED_2 = (1 << 2),
521  AREA_TEMP_INFO = (1 << 3), /* versioned to make slot reusable */
522 #endif
526  // AREA_FLAG_UNUSED_5 = (1 << 5),
527 
528  AREA_FLAG_UNUSED_6 = (1 << 6), /* cleared */
529 
539 };
540 
541 #define AREAGRID 4
542 #define AREAMINX 32
543 #define HEADER_PADDING_Y 6
544 #define HEADERY (20 + HEADER_PADDING_Y)
545 
547 enum {
550 };
551 
553 enum {
555  SCREENMAXIMIZED = 1, /* one editor taking over the screen */
556  SCREENFULL = 2, /* one editor taking over the screen with no bare-minimum UI elements */
557 };
558 
560 typedef enum eScreen_Redraws_Flag {
561  TIME_REGION = (1 << 0),
562  TIME_ALL_3D_WIN = (1 << 1),
563  TIME_ALL_ANIM_WIN = (1 << 2),
564  TIME_ALL_BUTS_WIN = (1 << 3),
565  // TIME_WITH_SEQ_AUDIO = (1 << 4), /* DEPRECATED */
566  TIME_SEQ = (1 << 5),
567  TIME_ALL_IMAGE_WIN = (1 << 6),
568  // TIME_CONTINUE_PHYSICS = (1 << 7), /* UNUSED */
569  TIME_NODES = (1 << 8),
570  TIME_CLIPS = (1 << 9),
571 
572  TIME_FOLLOW = (1 << 15),
574 
576 enum {
577  PNL_SELECT = (1 << 0),
578  PNL_UNUSED_1 = (1 << 1), /* Cleared */
579  PNL_CLOSED = (1 << 2),
580  // PNL_TABBED = (1 << 3), /* UNUSED */
581  // PNL_OVERLAP = (1 << 4), /* UNUSED */
582  PNL_PIN = (1 << 5),
583  PNL_POPOVER = (1 << 6),
586 };
587 
588 /* Fallback panel category (only for old scripts which need updating) */
589 #define PNL_CATEGORY_FALLBACK "Misc"
590 
592 enum {
597 };
598 
600 enum {
601  /* Scroll list to make active item visible. */
603 };
604 
605 /* Value (in number of items) we have to go below minimum shown items to enable auto size. */
606 #define UI_LIST_AUTO_SIZE_THRESHOLD 1
607 
608 /* uiList filter flags (dyn_data) */
609 /* WARNING! Those values are used by integer RNA too, which does not handle well values > INT_MAX.
610  * So please do not use 32nd bit here. */
611 enum {
612  UILST_FLT_ITEM = 1 << 30, /* This item has passed the filter process successfully. */
613 };
614 
616 enum {
617  UILST_FLT_SHOW = 1 << 0, /* Show filtering UI. */
618  UILST_FLT_EXCLUDE = UILST_FLT_ITEM, /* Exclude filtered items, *must* use this same value. */
619 };
620 
622 enum {
623  /* Plain values (only one is valid at a time, once masked with UILST_FLT_SORT_MASK. */
625  /* UILST_FLT_SORT_INDEX = 0, */ /* UNUSED */
627 
628  /* Bitflags affecting behavior of any kind of sorting. */
633 };
634 
635 #define UILST_FLT_SORT_MASK (((unsigned int)(UILST_FLT_SORT_REVERSE | UILST_FLT_SORT_LOCK)) - 1)
636 
641 typedef enum eRegion_Type {
651  /* Region to navigate the main region from (RGN_TYPE_WINDOW). */
653  /* A place for buttons to trigger execution of something that was set up in other regions. */
657  /* Region type used exclusively by internal code and add-ons to register draw callbacks to the XR
658  * context (surface, mirror view). Does not represent any real region. */
660 
661 #define RGN_TYPE_NUM (RGN_TYPE_XR + 1)
663 
664 /* use for function args */
665 #define RGN_TYPE_ANY -1
666 
667 /* Region supports panel tabs (categories). */
668 #define RGN_TYPE_HAS_CATEGORY_MASK (1 << RGN_TYPE_UI)
669 
670 /* Check for any kind of header region. */
671 #define RGN_TYPE_IS_HEADER_ANY(regiontype) \
672  (((1 << (regiontype)) & \
673  ((1 << RGN_TYPE_HEADER) | 1 << (RGN_TYPE_TOOL_HEADER) | (1 << RGN_TYPE_FOOTER))) != 0)
674 
676 enum {
686  /* Maximum 15. */
687 
688  /* Flags start here. */
690 };
691 
693 #define RGN_ALIGN_ENUM_FROM_MASK(align) ((align) & ((1 << 4) - 1))
694 #define RGN_ALIGN_FLAG_FROM_MASK(align) ((align) & ~((1 << 4) - 1))
695 
697 enum {
698  RGN_FLAG_HIDDEN = (1 << 0),
699  RGN_FLAG_TOO_SMALL = (1 << 1),
724 };
725 
727 enum {
728  /* Region must be fully redrawn. */
729  RGN_DRAW = 1,
730  /* Redraw only part of region, for sculpting and painting to get smoother
731  * stroke painting on heavy meshes. */
733  /* For outliner, to do faster redraw without rebuilding outliner tree.
734  * For 3D viewport, to display a new progressive render sample without
735  * while other buffers and overlays remain unchanged. */
737 
738  /* Set while region is being drawn. */
740  /* For popups, to refresh UI layout along with drawing. */
742 
743  /* Only editor overlays (currently gizmos only!) should be redrawn. */
745 };
746 
747 #ifdef __cplusplus
748 }
749 #endif
ID and Library types, which are fundamental for sdna.
These structs are the foundation for all linked lists in the library system.
struct TransformOrientation TransformOrientation
struct ScrAreaMap ScrAreaMap
@ AREA_FLAG_ACTIVE_TOOL_UPDATE
@ AREA_FLAG_OFFSCREEN
@ AREA_FLAG_REGION_SIZE_UPDATE
@ AREA_FLAG_UNUSED_6
@ AREA_FLAG_STACKED_FULLSCREEN
@ AREA_FLAG_ACTIONZONES_UPDATE
@ HEADER_NO_PULLDOWN
@ UILST_FLT_ITEM
struct PanelCategoryDyn PanelCategoryDyn
struct PanelCategoryStack PanelCategoryStack
@ RGN_FLAG_SEARCH_FILTER_UPDATE
@ RGN_FLAG_DYNAMIC_SIZE
@ RGN_FLAG_SIZE_CLAMP_X
@ RGN_FLAG_HIDDEN
@ RGN_FLAG_SIZE_CLAMP_Y
@ RGN_FLAG_PREFSIZE_OR_HIDDEN
@ RGN_FLAG_TOO_SMALL
@ RGN_FLAG_TEMP_REGIONDATA
@ RGN_FLAG_SEARCH_FILTER_ACTIVE
@ RGN_FLAG_HIDDEN_BY_USER
@ PNL_SELECT
@ PNL_PIN
@ PNL_UNUSED_1
@ PNL_CLOSED
@ PNL_POPOVER
@ PNL_INSTANCED_LIST_ORDER_CHANGED
@ SCREENFULL
@ SCREENMAXIMIZED
@ SCREENNORMAL
uiPanelDataExpansion
@ UI_SUBPANEL_DATA_EXPAND_14
@ UI_SUBPANEL_DATA_EXPAND_7
@ UI_SUBPANEL_DATA_EXPAND_10
@ UI_PANEL_DATA_EXPAND_ROOT
@ UI_SUBPANEL_DATA_EXPAND_16
@ UI_SUBPANEL_DATA_EXPAND_8
@ UI_SUBPANEL_DATA_EXPAND_11
@ UI_SUBPANEL_DATA_EXPAND_2
@ UI_SUBPANEL_DATA_EXPAND_1
@ UI_SUBPANEL_DATA_EXPAND_9
@ UI_SUBPANEL_DATA_EXPAND_5
@ UI_SUBPANEL_DATA_EXPAND_4
@ UI_SUBPANEL_DATA_EXPAND_3
@ UI_SUBPANEL_DATA_EXPAND_12
@ UI_SUBPANEL_DATA_EXPAND_13
@ UI_SUBPANEL_DATA_EXPAND_6
@ UI_SUBPANEL_DATA_EXPAND_15
struct uiListDyn uiListDyn
struct uiPreview uiPreview
GlobalAreaFlag
@ GLOBAL_AREA_IS_HIDDEN
@ UILST_SCROLL_TO_ACTIVE_ITEM
@ UILST_LAYOUT_COMPACT
@ UILST_LAYOUT_DEFAULT
@ UILST_LAYOUT_BIG_PREVIEW_GRID
@ UILST_LAYOUT_GRID
struct uiList uiList
eRegion_Type
@ RGN_TYPE_CHANNELS
@ RGN_TYPE_TOOL_HEADER
@ RGN_TYPE_EXECUTE
@ RGN_TYPE_UI
@ RGN_TYPE_TEMPORARY
@ RGN_TYPE_WINDOW
@ RGN_TYPE_HUD
@ RGN_TYPE_PREVIEW
@ RGN_TYPE_NAV_BAR
@ RGN_TYPE_FOOTER
@ RGN_TYPE_HEADER
@ RGN_TYPE_XR
@ RGN_TYPE_TOOLS
@ RGN_TYPE_TOOL_PROPS
@ SCREEN_COLLAPSE_STATUSBAR
@ SCREEN_DEPRECATED
@ RGN_ALIGN_BOTTOM
@ RGN_ALIGN_LEFT
@ RGN_ALIGN_TOP
@ RGN_ALIGN_RIGHT
@ RGN_SPLIT_PREV
@ RGN_ALIGN_HSPLIT
@ RGN_ALIGN_VSPLIT
@ RGN_ALIGN_NONE
@ RGN_ALIGN_FLOAT
@ RGN_ALIGN_QSPLIT
struct bScreen bScreen
struct Panel_Runtime Panel_Runtime
void(* uiListFreeRuntimeDataFunc)(struct uiList *ui_list)
@ RGN_DRAW_NO_REBUILD
@ RGN_DRAW_PARTIAL
@ RGN_DRAWING
@ RGN_DRAW
@ RGN_REFRESH_UI
@ RGN_DRAW_EDITOR_OVERLAYS
struct ScrVert ScrVert
eScreen_Redraws_Flag
@ TIME_SEQ
@ TIME_ALL_IMAGE_WIN
@ TIME_ALL_BUTS_WIN
@ TIME_FOLLOW
@ TIME_REGION
@ TIME_ALL_3D_WIN
@ TIME_CLIPS
@ TIME_NODES
@ TIME_ALL_ANIM_WIN
@ UILST_FLT_SORT_LOCK
@ UILST_FLT_SORT_ALPHA
@ UILST_FLT_SORT_REVERSE
@ UILST_FLT_EXCLUDE
@ UILST_FLT_SHOW
struct ScrArea ScrArea
struct ScrEdge ScrEdge
GlobalAreaAlign
@ GLOBAL_AREA_ALIGN_BOTTOM
@ GLOBAL_AREA_ALIGN_TOP
struct ARegion_Runtime ARegion_Runtime
struct Panel Panel
struct ScrGlobalAreaData ScrGlobalAreaData
struct ScrArea_Runtime ScrArea_Runtime
struct ARegion ARegion
#define DNA_DEPRECATED_ALLOW
Definition: action.c:16
Scene scene
SyclQueue void void size_t num_bytes void
const char * category
struct GHash * block_name_map
short do_draw_paintcursor
struct wmTimer * regiontimer
ARegion_Runtime runtime
void * regiondata
struct ARegion * prev
ListBase panels_category_active
ListBase ui_previews
short flagfullscreen
char * headerstr
struct ARegion * next
ListBase panels_category
ListBase panels
ListBase ui_lists
ListBase handlers
short alignment
struct wmDrawBuffer * draw_buffer
short regiontype
struct wmGizmoMap * gizmo_map
struct ARegionType * type
ListBase uiblocks
Definition: DNA_ID.h:368
struct PanelCategoryDyn * next
struct PanelCategoryDyn * prev
struct PanelCategoryStack * prev
struct PanelCategoryStack * next
struct bContextStore * context
struct uiBlock * block
struct PointerRNA * custom_data_ptr
struct PanelType * type
short labelofs
struct uiLayout * layout
Panel_Runtime runtime
int blocksizey
char _pad[6]
void * activedata
int blocksizex
short runtime_flag
char drawname[64]
short flag
char panelname[64]
struct Panel * prev
struct Panel * next
ListBase children
ListBase vertbase
ListBase edgebase
ListBase areabase
struct bToolRef * tool
ListBase handlers
ScrVert * v2
ListBase actionzones
ScrVert * v3
ListBase spacedata
short butspacetype_subtype
short region_active_win
struct SpaceType * type
bScreen * full
ScrArea_Runtime runtime
ScrVert * v1
struct ScrArea * next
ListBase regionbase
char _pad[2]
ScrGlobalAreaData * global
ScrVert * v4
char butspacetype
char headertype DNA_DEPRECATED
struct ScrArea * prev
ScrVert * v1
struct ScrEdge * next
char _pad[4]
struct ScrEdge * prev
ScrVert * v2
short editflag
struct ScrVert * prev
struct ScrVert * next
struct ScrVert * newv
struct TransformOrientation * next
struct TransformOrientation * prev
char do_draw_drag
struct Scene *scene DNA_DEPRECATED
char do_refresh
ListBase edgebase
void * context
short redraws_flag
char _pad[1]
PreviewImage * preview
ListBase regionbase
char skip_handling
struct wmTooltipState * tool_tip
ListBase vertbase
char do_draw_paintcursor
struct wmTimer * animtimer
char scrubbing
char do_draw_gesture
ListBase areabase
struct ARegion * active_region
struct wmOperatorType * custom_activate_optype
struct PointerRNA * custom_drag_opptr
uiListFreeRuntimeDataFunc free_runtime_data_fn
int * items_filter_neworder
void * customdata
struct wmOperatorType * custom_drag_optype
int * items_filter_flags
struct PointerRNA * custom_activate_opptr
char list_id[64]
int list_last_len
IDProperty * properties
int filter_sort_flag
uiListDyn * dyn_data
int list_last_activei
struct uiList * next
struct uiListType * type
char filter_byname[64]
struct uiList * prev
char preview_id[64]
struct uiPreview * next
struct uiPreview * prev