Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2020-10-30 03:34:29 +0300
committerHans Goudey <h.goudey@me.com>2020-10-30 03:34:29 +0300
commit6250a8725ed6a2d9d85f4d313e9931c2fe4a8de3 (patch)
tree97ae3dec80e6a7c2c49295587682bd53bf71eecc /source/blender/makesdna
parent81a0fffb2d2ccb40320bec418267b0c105db19a4 (diff)
Cleanup: Use an enum to set instanced panel expansion
This commit uses an enum to access expansion for specific panels for each modifier, constraint, etc. Even though these values are quite simple, this can help make the code more explicit when the ui_expand_flag is accessed directly. Also update comments about this bitfield to make them consistent.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h2
-rw-r--r--source/blender/makesdna/DNA_gpencil_modifier_types.h1
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h2
-rw-r--r--source/blender/makesdna/DNA_screen_types.h28
-rw-r--r--source/blender/makesdna/DNA_shader_fx_types.h2
5 files changed, 32 insertions, 3 deletions
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index c95e5376670..93a67602047 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -60,7 +60,7 @@ typedef struct bConstraint {
/** Constraint name, MAX_NAME. */
char name[64];
- /* Flag for panel and subpanel closed / open state in the UI. */
+ /* An "expand" bit for each of the constraint's (sub)panels (uiPanelDataExpansion). */
short ui_expand_flag;
/** Amount of influence exherted by constraint (0.0-1.0). */
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h
index 1a83120cae9..7107e131eda 100644
--- a/source/blender/makesdna/DNA_gpencil_modifier_types.h
+++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h
@@ -74,6 +74,7 @@ typedef struct GpencilModifierData {
int type, mode;
char _pad0[4];
short flag;
+ /* An "expand" bit for each of the modifier's (sub)panels (uiPanelDataExpansion). */
short ui_expand_flag;
/** MAX_NAME. */
char name[64];
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 6750d5f2cbd..232fca062fa 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -121,7 +121,7 @@ typedef struct ModifierData {
int type, mode;
char _pad0[4];
short flag;
- /* An "expand" bit for each of the modifier's (sub)panels. */
+ /* An "expand" bit for each of the modifier's (sub)panels (uiPanelDataExpansion). */
short ui_expand_flag;
/** MAX_NAME. */
char name[64];
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index f0ff02d3668..d2360d700d2 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -184,6 +184,34 @@ typedef struct Panel {
} Panel;
/**
+ * Used for passing expansion between instanced panel data and the panels themselves.
+ * There are 16 defines because the expansion data is typically stored in a short.
+ *
+ * \note Expansion for instanced panels is stored in depth first order. For example, the value of
+ * UI_SUBPANEL_DATA_EXPAND_2 correspond to mean the expansion of the second subpanel or the first
+ * subpanel's first subpanel.
+ */
+typedef enum uiPanelDataExpansion {
+ UI_PANEL_DATA_EXPAND_ROOT = (1 << 0),
+ UI_SUBPANEL_DATA_EXPAND_1 = (1 << 1),
+ UI_SUBPANEL_DATA_EXPAND_2 = (1 << 2),
+ UI_SUBPANEL_DATA_EXPAND_3 = (1 << 3),
+ UI_SUBPANEL_DATA_EXPAND_4 = (1 << 4),
+ UI_SUBPANEL_DATA_EXPAND_5 = (1 << 5),
+ UI_SUBPANEL_DATA_EXPAND_6 = (1 << 6),
+ UI_SUBPANEL_DATA_EXPAND_7 = (1 << 7),
+ UI_SUBPANEL_DATA_EXPAND_8 = (1 << 8),
+ UI_SUBPANEL_DATA_EXPAND_9 = (1 << 9),
+ UI_SUBPANEL_DATA_EXPAND_10 = (1 << 10),
+ UI_SUBPANEL_DATA_EXPAND_11 = (1 << 11),
+ UI_SUBPANEL_DATA_EXPAND_12 = (1 << 12),
+ UI_SUBPANEL_DATA_EXPAND_13 = (1 << 13),
+ UI_SUBPANEL_DATA_EXPAND_14 = (1 << 14),
+ UI_SUBPANEL_DATA_EXPAND_15 = (1 << 15),
+ UI_SUBPANEL_DATA_EXPAND_16 = (1 << 16),
+} uiPanelDataExpansion;
+
+/**
* Notes on Panel Categories:
*
* - #ARegion.panels_category (#PanelCategoryDyn)
diff --git a/source/blender/makesdna/DNA_shader_fx_types.h b/source/blender/makesdna/DNA_shader_fx_types.h
index 5567d65b6db..07ccac5ba29 100644
--- a/source/blender/makesdna/DNA_shader_fx_types.h
+++ b/source/blender/makesdna/DNA_shader_fx_types.h
@@ -65,7 +65,7 @@ typedef struct ShaderFxData {
int type, mode;
char _pad0[4];
short flag;
- /* Expansion for shader effect panels and sub-panels. */
+ /* An "expand" bit for each of the constraint's (sub)panels (uiPanelDataExpansion). */
short ui_expand_flag;
/** MAX_NAME. */
char name[64];