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:
authorCampbell Barton <ideasman42@gmail.com>2019-05-03 06:04:37 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-05-03 06:04:37 +0300
commit70682d11b8a8b3bca327a309f2e1e8383b920387 (patch)
tree3de183e21e545da5df17e6afe0edf2561db0319b /source/blender/makesdna/DNA_screen_types.h
parenta01bcfa6366f893fbc8fdbf537d91ece4832ea03 (diff)
Cleanup: replace RGN_ALIGN_ENUM_MASK
This was only used once, other checks were masking out RGN_SPLIT_PREV which isn't future proof (if other flags are added). Add RGN_ALIGN_ENUM_FROM_MASK macro, use it everywhere we need to check the alignment enum.
Diffstat (limited to 'source/blender/makesdna/DNA_screen_types.h')
-rw-r--r--source/blender/makesdna/DNA_screen_types.h42
1 files changed, 25 insertions, 17 deletions
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index 411777333a9..e014de183e3 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -599,31 +599,39 @@ enum {
/* Region supports panel tabs (categories). */
#define RGN_TYPE_HAS_CATEGORY_MASK (1 << RGN_TYPE_UI)
-/* region alignment */
-#define RGN_ALIGN_NONE 0
-#define RGN_ALIGN_TOP 1
-#define RGN_ALIGN_BOTTOM 2
-#define RGN_ALIGN_LEFT 3
-#define RGN_ALIGN_RIGHT 4
-#define RGN_ALIGN_HSPLIT 5
-#define RGN_ALIGN_VSPLIT 6
-#define RGN_ALIGN_FLOAT 7
-#define RGN_ALIGN_QSPLIT 8
-#define RGN_ALIGN_ENUM_MASK 0x0F
-
-#define RGN_SPLIT_PREV 32
+/** #ARegion.alignment */
+enum {
+ RGN_ALIGN_NONE = 0,
+ RGN_ALIGN_TOP = 1,
+ RGN_ALIGN_BOTTOM = 2,
+ RGN_ALIGN_LEFT = 3,
+ RGN_ALIGN_RIGHT = 4,
+ RGN_ALIGN_HSPLIT = 5,
+ RGN_ALIGN_VSPLIT = 6,
+ RGN_ALIGN_FLOAT = 7,
+ RGN_ALIGN_QSPLIT = 8,
+ /* Maximum 15. */
+
+ /* Flags start here. */
+ RGN_SPLIT_PREV = 32,
+};
+
+/** Mask out flags so we can check the alignment. */
+#define RGN_ALIGN_ENUM_FROM_MASK(align) ((align) & ((1 << 4) - 1))
/** #ARegion.flag */
enum {
RGN_FLAG_HIDDEN = (1 << 0),
RGN_FLAG_TOO_SMALL = (1 << 1),
- /* Force delayed reinit of region size data, so that region size is calculated
+ /**
+ * Force delayed reinit of region size data, so that region size is calculated
* just big enough to show all its content (if enough space is available).
- * Note that only ED_region_header supports this right now. */
+ * Note that only ED_region_header supports this right now.
+ */
RGN_FLAG_DYNAMIC_SIZE = (1 << 2),
- /* Region data is NULL'd on read, never written. */
+ /** Region data is NULL'd on read, never written. */
RGN_FLAG_TEMP_REGIONDATA = (1 << 3),
- /* The region must either use its prefsizex/y or be hidden. */
+ /** The region must either use its prefsizex/y or be hidden. */
RGN_FLAG_PREFSIZE_OR_HIDDEN = (1 << 4),
/** Size has been clamped (floating regions only). */
RGN_FLAG_SIZE_CLAMP_X = (1 << 5),