diff options
author | Julian Eisel <julian@blender.org> | 2020-04-03 14:25:03 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-04-03 14:34:50 +0300 |
commit | 905c0269f302e8e0e7a27dda8d5256fdcd06ce60 (patch) | |
tree | 1c720d4f0069879d5b4c0c9ea8db867106920d4f /source/blender/windowmanager/gizmo/intern | |
parent | 1a69384e76e2b1ab11c87a582eb2cdf26386ac59 (diff) |
Cleanup: Rename ScrArea variables from sa to area
Follow up of b2ee1770d4c3 and 10c2254d412d, part of T74432.
Now the area and region naming conventions should be less confusing.
Mostly a careful batch rename but had to do few smaller fixes.
Also ran clang-format on affected files.
Diffstat (limited to 'source/blender/windowmanager/gizmo/intern')
3 files changed, 29 insertions, 28 deletions
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c index b7fecb31f96..6be85539113 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c @@ -299,9 +299,9 @@ void WM_gizmo_group_remove_by_tool(bContext *C, { wmGizmoMapType *gzmap_type = WM_gizmomaptype_find(&gzgt->gzmap_params); for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) { - for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { - if (sa->runtime.tool == tref) { - for (ARegion *region = sa->regionbase.first; region; region = region->next) { + for (ScrArea *area = sc->areabase.first; area; area = area->next) { + if (area->runtime.tool == tref) { + for (ARegion *region = area->regionbase.first; region; region = region->next) { wmGizmoMap *gzmap = region->gizmo_map; if (gzmap && gzmap->type == gzmap_type) { wmGizmoGroup *gzgroup, *gzgroup_next; @@ -909,9 +909,9 @@ void WM_gizmomaptype_group_init_runtime(const Main *bmain, /* now create a gizmo for all existing areas */ for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) { - for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { - for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { - ListBase *lb = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; + for (ScrArea *area = sc->areabase.first; area; area = area->next) { + for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { + ListBase *lb = (sl == area->spacedata.first) ? &area->regionbase : &sl->regionbase; for (ARegion *region = lb->first; region; region = region->next) { wmGizmoMap *gzmap = region->gizmo_map; if (gzmap && gzmap->type == gzmap_type) { @@ -964,9 +964,9 @@ void WM_gizmomaptype_group_unlink(bContext *C, { /* Free instances. */ for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) { - for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { - for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { - ListBase *lb = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; + for (ScrArea *area = sc->areabase.first; area; area = area->next) { + for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { + ListBase *lb = (sl == area->spacedata.first) ? &area->regionbase : &sl->regionbase; for (ARegion *region = lb->first; region; region = region->next) { wmGizmoMap *gzmap = region->gizmo_map; if (gzmap && gzmap->type == gzmap_type) { @@ -1132,9 +1132,9 @@ void WM_gizmo_group_type_unlink_delayed(const char *idname) void WM_gizmo_group_unlink_delayed_ptr_from_space(wmGizmoGroupType *gzgt, wmGizmoMapType *gzmap_type, - ScrArea *sa) + ScrArea *area) { - for (ARegion *region = sa->regionbase.first; region; region = region->next) { + for (ARegion *region = area->regionbase.first; region; region = region->next) { wmGizmoMap *gzmap = region->gizmo_map; if (gzmap && gzmap->type == gzmap_type) { for (wmGizmoGroup *gzgroup = gzmap->groups.first; gzgroup; gzgroup = gzgroup->next) { diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c index 286afe42158..ae7475c3661 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c @@ -577,9 +577,9 @@ static int gizmo_find_intersected_3d_intern(wmGizmo **visible_gizmos, const int hotspot) { const wmWindowManager *wm = CTX_wm_manager(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); - View3D *v3d = sa->spacedata.first; + View3D *v3d = area->spacedata.first; Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); rcti rect; /* Almost certainly overkill, but allow for many custom gizmos. */ @@ -966,22 +966,22 @@ void wm_gizmomap_handler_context_op(bContext *C, wmEventHandler_Op *handler) bScreen *screen = CTX_wm_screen(C); if (screen) { - ScrArea *sa; + ScrArea *area; - for (sa = screen->areabase.first; sa; sa = sa->next) { - if (sa == handler->context.area) { + for (area = screen->areabase.first; area; area = area->next) { + if (area == handler->context.area) { break; } } - if (sa == NULL) { + if (area == NULL) { /* when changing screen layouts with running modal handlers (like render display), this * is not an error to print */ printf("internal error: modal gizmo-map handler has invalid area\n"); } else { ARegion *region; - CTX_wm_area_set(C, sa); - for (region = sa->regionbase.first; region; region = region->next) { + CTX_wm_area_set(C, area); + for (region = area->regionbase.first; region; region = region->next) { if (region == handler->context.region) { break; } @@ -1373,9 +1373,10 @@ void WM_gizmoconfig_update(struct Main *bmain) if (wm_gzmap_type_update_flag & WM_GIZMOTYPE_GLOBAL_UPDATE_REMOVE) { for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { - ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { + ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase : + &sl->regionbase; for (ARegion *region = regionbase->first; region; region = region->next) { wmGizmoMap *gzmap = region->gizmo_map; if (gzmap != NULL && gzmap->tag_remove_group) { @@ -1410,9 +1411,9 @@ void WM_gizmoconfig_update(struct Main *bmain) void WM_reinit_gizmomap_all(Main *bmain) { for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { - ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { + ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase : &sl->regionbase; for (ARegion *region = regionbase->first; region; region = region->next) { wmGizmoMap *gzmap = region->gizmo_map; if ((gzmap != NULL) && (gzmap->is_init == false)) { diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_type.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_type.c index 93f3a04978f..61334e4b8d7 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_type.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_type.c @@ -135,9 +135,9 @@ static void gizmotype_unlink(bContext *C, Main *bmain, wmGizmoType *gzt) { /* Free instances. */ for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) { - for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { - for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { - ListBase *lb = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; + for (ScrArea *area = sc->areabase.first; area; area = area->next) { + for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { + ListBase *lb = (sl == area->spacedata.first) ? &area->regionbase : &sl->regionbase; for (ARegion *region = lb->first; region; region = region->next) { wmGizmoMap *gzmap = region->gizmo_map; if (gzmap) { |