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 <campbell@blender.org>2022-04-12 04:59:25 +0300
committerCampbell Barton <campbell@blender.org>2022-04-12 04:59:25 +0300
commit2451d7d57ed354aa3721153af417f06b2cebeec0 (patch)
treedc6ff0850383ffbb5b7663ef5ca0aeb4fa14a1e4 /source/blender/editors
parent6f1ad5f5e77ca5b5c257db97798e9a2087c9defd (diff)
Cleanup: use _NUM suffix for space/region type ranges
- Replace SPACE_TYPE_LAST with SPACE_TYPE_NUM (adding 1). - Rename RGN_TYPE_LEN to RGN_TYPE_NUM This makes it possible to tag space-type/region-type combinations with `bool tag[SPACE_TYPE_NUM][RGN_TYPE_NUM]` which reads more clearly than `bool tag[SPACE_TYPE_LAST + 1][RGN_TYPE_LEN]`.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/screen/area.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 30bf23e0987..ad815f0d998 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -2176,12 +2176,12 @@ struct RegionTypeAlignInfo {
* Needed for detecting which header displays the space-type switcher.
*/
bool hidden;
- } by_type[RGN_TYPE_LEN];
+ } by_type[RGN_TYPE_NUM];
};
static void region_align_info_from_area(ScrArea *area, struct RegionTypeAlignInfo *r_align_info)
{
- for (int index = 0; index < RGN_TYPE_LEN; index++) {
+ for (int index = 0; index < RGN_TYPE_NUM; index++) {
r_align_info->by_type[index].alignment = -1;
/* Default to true, when it doesn't exist - it's effectively hidden. */
r_align_info->by_type[index].hidden = true;
@@ -2189,7 +2189,7 @@ static void region_align_info_from_area(ScrArea *area, struct RegionTypeAlignInf
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
const int index = region->regiontype;
- if ((uint)index < RGN_TYPE_LEN) {
+ if ((uint)index < RGN_TYPE_NUM) {
r_align_info->by_type[index].alignment = RGN_ALIGN_ENUM_FROM_MASK(region->alignment);
r_align_info->by_type[index].hidden = (region->flag & RGN_FLAG_HIDDEN) != 0;
}
@@ -2252,7 +2252,7 @@ static short region_alignment_from_header_and_tool_header_state(
static void region_align_info_to_area_for_headers(
const struct RegionTypeAlignInfo *region_align_info_src,
const struct RegionTypeAlignInfo *region_align_info_dst,
- ARegion *region_by_type[RGN_TYPE_LEN])
+ ARegion *region_by_type[RGN_TYPE_NUM])
{
/* Abbreviate access. */
const short header_alignment_src = region_align_info_src->by_type[RGN_TYPE_HEADER].alignment;
@@ -2365,12 +2365,12 @@ static void region_align_info_to_area_for_headers(
}
static void region_align_info_to_area(
- ScrArea *area, const struct RegionTypeAlignInfo region_align_info_src[RGN_TYPE_LEN])
+ ScrArea *area, const struct RegionTypeAlignInfo region_align_info_src[RGN_TYPE_NUM])
{
- ARegion *region_by_type[RGN_TYPE_LEN] = {NULL};
+ ARegion *region_by_type[RGN_TYPE_NUM] = {NULL};
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
const int index = region->regiontype;
- if ((uint)index < RGN_TYPE_LEN) {
+ if ((uint)index < RGN_TYPE_NUM) {
region_by_type[index] = region;
}
}
@@ -2437,7 +2437,7 @@ void ED_area_newspace(bContext *C, ScrArea *area, int type, const bool skip_regi
*/
bool sync_header_alignment = false;
- struct RegionTypeAlignInfo region_align_info[RGN_TYPE_LEN];
+ struct RegionTypeAlignInfo region_align_info[RGN_TYPE_NUM];
if ((slold != NULL) && (slold->link_flag & SPACE_FLAG_TYPE_TEMPORARY) == 0) {
region_align_info_from_area(area, region_align_info);
sync_header_alignment = true;