Blender  V2.93
DNA_screen_types.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "DNA_defs.h"
27 #include "DNA_listBase.h"
28 #include "DNA_vec_types.h"
29 #include "DNA_view2d_types.h"
30 
31 #include "DNA_ID.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 struct ARegion;
38 struct ARegionType;
39 struct PanelType;
40 struct PointerRNA;
41 struct Scene;
42 struct SpaceLink;
43 struct SpaceType;
44 struct uiBlock;
45 struct uiLayout;
46 struct wmDrawBuffer;
47 struct wmTimer;
48 struct wmTooltipState;
49 
50 /* TODO Doing this is quite ugly :)
51  * Once the top-bar is merged bScreen should be refactored to use ScrAreaMap. */
52 #define AREAMAP_FROM_SCREEN(screen) ((ScrAreaMap *)&(screen)->vertbase)
53 
54 typedef struct bScreen {
55  ID id;
56 
57  /* TODO Should become ScrAreaMap now.
58  * ** NOTE: KEEP ORDER IN SYNC WITH ScrAreaMap! (see AREAMAP_FROM_SCREEN macro above) ** */
63 
66 
68 
70  short flag;
72  short winid;
74  short redraws_flag;
75 
77  char temp;
79  char state;
81  char do_draw;
83  char do_refresh;
93  char scrubbing;
94  char _pad[1];
95 
98 
102  void /*bContextDataCallback*/ *context;
103 
106 
109 
110 typedef struct ScrVert {
111  struct ScrVert *next, *prev, *newv;
113  /* first one used internally, second one for tools */
114  short flag, editflag;
116 
117 typedef struct ScrEdge {
118  struct ScrEdge *next, *prev;
121  short border;
122  short flag;
123  char _pad[4];
125 
126 typedef struct ScrAreaMap {
127  /* ** NOTE: KEEP ORDER IN SYNC WITH LISTBASES IN bScreen! ** */
128 
136 
137 typedef struct Panel_Runtime {
138  /* Applied to Panel.ofsx, but saved separately so we can track changes between redraws. */
140 
141  char _pad[4];
142 
151 
152  /* Pointer to the panel's block. Useful when changes to panel #uiBlocks
153  * need some context from traversal of the panel "tree". */
154  struct uiBlock *block;
156 
158 typedef struct Panel {
159  struct Panel *next, *prev;
160 
162  struct PanelType *type;
164  struct uiLayout *layout;
165 
167  char panelname[64];
169  char drawname[64];
171  int ofsx, ofsy;
173  int sizex, sizey;
176  short labelofs;
178  char _pad[6];
182  void *activedata;
185 
188 
197 typedef enum uiPanelDataExpansion {
216 
233 /* region level tabs */
234 #
235 #
236 typedef struct PanelCategoryDyn {
238  char idname[64];
241 
242 /* region stack of active tabs */
243 typedef struct PanelCategoryStack {
245  char idname[64];
247 
248 /* uiList dynamic data... */
249 /* These two Lines with # tell makesdna this struct can be excluded. */
250 #
251 #
252 typedef struct uiListDyn {
254  int height;
259 
264 
265  /* Those are temp data used during drag-resize with GRIP button
266  * (they are in pixels, the meaningful data is the
267  * difference between resize_prev and resize)...
268  */
269  int resize;
271 
272  /* Filtering data. */
278 
279 typedef struct uiList { /* some list UI data need to be saved in file */
280  struct uiList *next, *prev;
281 
283  struct uiListType *type;
284 
286  char list_id[64];
287 
290  int flag;
291 
296 
297  /* Filtering data. */
299  char filter_byname[64];
302 
303  /* Custom sub-classes properties. */
305 
306  /* Dynamic data (runtime). */
309 
310 typedef struct TransformOrientation {
313  char name[64];
314  float mat[3][3];
315  char _pad[4];
317 
319 typedef struct uiPreview {
320  struct uiPreview *next, *prev;
321 
323  char preview_id[64];
324  short height;
325  char _pad1[6];
327 
328 typedef struct ScrGlobalAreaData {
329  /* Global areas have a non-dynamic size. That means, changing the window
330  * size doesn't affect their size at all. However, they can still be
331  * 'collapsed', by changing this value. Ignores DPI (ED_area_global_size_y
332  * and winx/winy don't) */
334  /* For global areas, this is the min and max size they can use depending on
335  * if they are 'collapsed' or not. */
338  short align;
339 
341  short flag;
342  char _pad[2];
344 
347 };
348 
349 typedef enum GlobalAreaAlign {
353 
354 typedef struct ScrArea_Runtime {
355  struct bToolRef *tool;
357  char _pad0[7];
359 
360 typedef struct ScrArea {
361  struct ScrArea *next, *prev;
362 
364  ScrVert *v1, *v2, *v3, *v4;
367 
370 
378  char spacetype;
382 
384  short winx, winy;
385 
387  char headertype DNA_DEPRECATED;
390  short flag;
396  char _pad[2];
397 
399  struct SpaceType *type;
400 
401  /* Non-NULL if this area is global. */
403 
404  /* A list of space links (editors) that were open in this area before. When
405  * changing the editor type, we try to reuse old editor data from this list.
406  * The first item is the active/visible one.
407  */
410  /* NOTE: This region list is the one from the active/visible editor (first item in
411  * spacedata list). Use SpaceLink.regionbase if it's inactive (but only then)!
412  */
417 
420 
423 
424 typedef struct ARegion_Runtime {
425  /* Panel category to use between 'layout' and 'draw'. */
426  const char *category;
427 
434 
435  /* The offset needed to not overlap with window scrollbars. Only used by HUD regions for now. */
438 
439 typedef struct ARegion {
440  struct ARegion *next, *prev;
441 
449  short winx, winy;
450 
452  short visible;
454  short regiontype;
456  short alignment;
458  short flag;
459 
464  short sizex, sizey;
465 
467  short do_draw;
471  short overlap;
474 
476  struct ARegionType *type;
477 
492 
498 
500  char *headerstr;
502  void *regiondata;
503 
506 
508 enum {
509  HEADER_NO_PULLDOWN = (1 << 0),
510 // AREA_FLAG_UNUSED_1 = (1 << 1),
511 // AREA_FLAG_UNUSED_2 = (1 << 2),
513  AREA_TEMP_INFO = (1 << 3), /* versioned to make slot reusable */
514 #endif
518  // AREA_FLAG_UNUSED_5 = (1 << 5),
519 
520  AREA_FLAG_UNUSED_6 = (1 << 6), /* cleared */
521 
529 };
530 
531 #define AREAGRID 4
532 #define AREAMINX 32
533 #define HEADER_PADDING_Y 6
534 #define HEADERY (20 + HEADER_PADDING_Y)
535 
537 enum {
540 };
541 
543 enum {
545  SCREENMAXIMIZED = 1, /* one editor taking over the screen */
546  SCREENFULL = 2, /* one editor taking over the screen with no bare-minimum UI elements */
547 };
548 
550 typedef enum eScreen_Redraws_Flag {
551  TIME_REGION = (1 << 0),
552  TIME_ALL_3D_WIN = (1 << 1),
553  TIME_ALL_ANIM_WIN = (1 << 2),
554  TIME_ALL_BUTS_WIN = (1 << 3),
555  // TIME_WITH_SEQ_AUDIO = (1 << 4), /* DEPRECATED */
556  TIME_SEQ = (1 << 5),
557  TIME_ALL_IMAGE_WIN = (1 << 6),
558  // TIME_CONTINUE_PHYSICS = (1 << 7), /* UNUSED */
559  TIME_NODES = (1 << 8),
560  TIME_CLIPS = (1 << 9),
561 
562  TIME_FOLLOW = (1 << 15),
564 
566 enum {
567  PNL_SELECT = (1 << 0),
568  PNL_UNUSED_1 = (1 << 1), /* Cleared */
569  PNL_CLOSED = (1 << 2),
570  /* PNL_TABBED = (1 << 3), */ /*UNUSED*/
571  /* PNL_OVERLAP = (1 << 4), */ /*UNUSED*/
572  PNL_PIN = (1 << 5),
573  PNL_POPOVER = (1 << 6),
576 };
577 
578 /* Fallback panel category (only for old scripts which need updating) */
579 #define PNL_CATEGORY_FALLBACK "Misc"
580 
582 enum {
586 };
587 
589 enum {
590  /* Scroll list to make active item visible. */
592 };
593 
594 /* Value (in number of items) we have to go below minimum shown items to enable auto size. */
595 #define UI_LIST_AUTO_SIZE_THRESHOLD 1
596 
597 /* uiList filter flags (dyn_data) */
598 /* WARNING! Those values are used by integer RNA too, which does not handle well values > INT_MAX.
599  * So please do not use 32nd bit here. */
600 enum {
601  UILST_FLT_ITEM = 1 << 30, /* This item has passed the filter process successfully. */
602 };
603 
605 enum {
606  UILST_FLT_SHOW = 1 << 0, /* Show filtering UI. */
607  UILST_FLT_EXCLUDE = UILST_FLT_ITEM, /* Exclude filtered items, *must* use this same value. */
608 };
609 
611 enum {
612  /* Plain values (only one is valid at a time, once masked with UILST_FLT_SORT_MASK. */
614  /* UILST_FLT_SORT_INDEX = 0, */ /* UNUSED */
616 
617  /* Bitflags affecting behavior of any kind of sorting. */
622 };
623 
624 #define UILST_FLT_SORT_MASK (((unsigned int)(UILST_FLT_SORT_REVERSE | UILST_FLT_SORT_LOCK)) - 1)
625 
626 /* regiontype, first two are the default set */
627 /* Do NOT change order, append on end. Types are hardcoded needed */
628 typedef enum eRegionType {
638  /* Region to navigate the main region from (RGN_TYPE_WINDOW). */
640  /* A place for buttons to trigger execution of something that was set up in other regions. */
644 
645 #define RGN_TYPE_LEN (RGN_TYPE_TOOL_HEADER + 1)
647 
648 /* use for function args */
649 #define RGN_TYPE_ANY -1
650 
651 /* Region supports panel tabs (categories). */
652 #define RGN_TYPE_HAS_CATEGORY_MASK (1 << RGN_TYPE_UI)
653 
654 /* Check for any kind of header region. */
655 #define RGN_TYPE_IS_HEADER_ANY(regiontype) \
656  (((1 << (regiontype)) & \
657  ((1 << RGN_TYPE_HEADER) | 1 << (RGN_TYPE_TOOL_HEADER) | (1 << RGN_TYPE_FOOTER))) != 0)
658 
660 enum {
670  /* Maximum 15. */
671 
672  /* Flags start here. */
674 };
675 
677 #define RGN_ALIGN_ENUM_FROM_MASK(align) ((align) & ((1 << 4) - 1))
678 #define RGN_ALIGN_FLAG_FROM_MASK(align) ((align) & ~((1 << 4) - 1))
679 
681 enum {
682  RGN_FLAG_HIDDEN = (1 << 0),
683  RGN_FLAG_TOO_SMALL = (1 << 1),
708 };
709 
711 enum {
712  /* Region must be fully redrawn. */
713  RGN_DRAW = 1,
714  /* Redraw only part of region, for sculpting and painting to get smoother
715  * stroke painting on heavy meshes. */
717  /* For outliner, to do faster redraw without rebuilding outliner tree.
718  * For 3D viewport, to display a new progressive render sample without
719  * while other buffers and overlays remain unchanged. */
721 
722  /* Set while region is being drawn. */
724  /* For popups, to refresh UI layout along with drawing. */
726 
727  /* Only editor overlays (currently gizmos only!) should be redrawn. */
729 };
730 
731 #ifdef __cplusplus
732 }
733 #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
@ PNL_SELECT
@ PNL_PIN
@ PNL_UNUSED_1
@ PNL_CLOSED
@ PNL_POPOVER
@ PNL_INSTANCED_LIST_ORDER_CHANGED
struct PanelCategoryDyn PanelCategoryDyn
struct PanelCategoryStack PanelCategoryStack
@ 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
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
@ UILST_LAYOUT_COMPACT
@ UILST_LAYOUT_DEFAULT
@ UILST_LAYOUT_GRID
struct uiListDyn uiListDyn
struct uiPreview uiPreview
GlobalAreaFlag
@ GLOBAL_AREA_IS_HIDDEN
@ UILST_FLT_ITEM
@ SCREENFULL
@ SCREENMAXIMIZED
@ SCREENNORMAL
@ UILST_FLT_EXCLUDE
@ UILST_FLT_SHOW
@ AREA_FLAG_ACTIVE_TOOL_UPDATE
@ AREA_FLAG_REGION_SIZE_UPDATE
@ AREA_FLAG_UNUSED_6
@ AREA_FLAG_STACKED_FULLSCREEN
@ AREA_FLAG_ACTIONZONES_UPDATE
@ HEADER_NO_PULLDOWN
struct uiList uiList
@ RGN_DRAW_NO_REBUILD
@ RGN_DRAW_PARTIAL
@ RGN_DRAWING
@ RGN_DRAW
@ RGN_REFRESH_UI
@ RGN_DRAW_EDITOR_OVERLAYS
struct bScreen bScreen
struct Panel_Runtime Panel_Runtime
@ 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
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
@ SCREEN_COLLAPSE_STATUSBAR
@ SCREEN_DEPRECATED
@ UILST_FLT_SORT_LOCK
@ UILST_FLT_SORT_ALPHA
@ UILST_FLT_SORT_REVERSE
@ UILST_SCROLL_TO_ACTIVE_ITEM
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
eRegionType
@ 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_TOOLS
@ RGN_TYPE_TOOL_PROPS
struct ScrArea_Runtime ScrArea_Runtime
struct ARegion ARegion
#define DNA_DEPRECATED_ALLOW
Definition: action.c:32
Scene scene
const char * category
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:273
struct PanelCategoryDyn * next
struct PanelCategoryDyn * prev
struct PanelCategoryStack * prev
struct PanelCategoryStack * next
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
int * items_filter_neworder
int * items_filter_flags
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