Cleanup: move panel runtime data out of dna header
This commit is contained in:
parent
c393d2a4d9
commit
613a0ad651
|
@ -339,6 +339,29 @@ enum {
|
|||
PANEL_TYPE_NO_SEARCH = (1 << 7),
|
||||
};
|
||||
|
||||
typedef struct Panel_Runtime {
|
||||
/* Applied to Panel.ofsx, but saved separately so we can track changes between redraws. */
|
||||
int region_ofsx;
|
||||
|
||||
char _pad[4];
|
||||
|
||||
/**
|
||||
* Pointer for storing which data the panel corresponds to.
|
||||
* Useful when there can be multiple instances of the same panel type.
|
||||
*
|
||||
* \note A panel and its sub-panels share the same custom data pointer.
|
||||
* This avoids freeing the same pointer twice when panels are removed.
|
||||
*/
|
||||
struct PointerRNA *custom_data_ptr;
|
||||
|
||||
/* Pointer to the panel's block. Useful when changes to panel #uiBlocks
|
||||
* need some context from traversal of the panel "tree". */
|
||||
struct uiBlock *block;
|
||||
|
||||
/* Non-owning pointer. The context is stored in the block. */
|
||||
struct bContextStore *context;
|
||||
} Panel_Runtime;
|
||||
|
||||
/* #uiList types. */
|
||||
|
||||
/** Draw an item in the `ui_list`. */
|
||||
|
|
|
@ -31,6 +31,7 @@ struct uiList;
|
|||
struct wmDrawBuffer;
|
||||
struct wmTimer;
|
||||
struct wmTooltipState;
|
||||
struct Panel_Runtime;
|
||||
|
||||
/* TODO: Doing this is quite ugly :)
|
||||
* Once the top-bar is merged bScreen should be refactored to use ScrAreaMap. */
|
||||
|
@ -120,29 +121,6 @@ typedef struct ScrAreaMap {
|
|||
ListBase areabase;
|
||||
} ScrAreaMap;
|
||||
|
||||
typedef struct Panel_Runtime {
|
||||
/* Applied to Panel.ofsx, but saved separately so we can track changes between redraws. */
|
||||
int region_ofsx;
|
||||
|
||||
char _pad[4];
|
||||
|
||||
/**
|
||||
* Pointer for storing which data the panel corresponds to.
|
||||
* Useful when there can be multiple instances of the same panel type.
|
||||
*
|
||||
* \note A panel and its sub-panels share the same custom data pointer.
|
||||
* This avoids freeing the same pointer twice when panels are removed.
|
||||
*/
|
||||
struct PointerRNA *custom_data_ptr;
|
||||
|
||||
/* Pointer to the panel's block. Useful when changes to panel #uiBlocks
|
||||
* need some context from traversal of the panel "tree". */
|
||||
struct uiBlock *block;
|
||||
|
||||
/* Non-owning pointer. The context is stored in the block. */
|
||||
struct bContextStore *context;
|
||||
} Panel_Runtime;
|
||||
|
||||
/** The part from uiBlock that needs saved in file. */
|
||||
typedef struct Panel {
|
||||
struct Panel *next, *prev;
|
||||
|
@ -172,7 +150,7 @@ typedef struct Panel {
|
|||
/** Sub panels. */
|
||||
ListBase children;
|
||||
|
||||
Panel_Runtime *runtime;
|
||||
struct Panel_Runtime *runtime;
|
||||
} Panel;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue