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-08-20 16:34:09 +0300
committerHans Goudey <h.goudey@me.com>2020-08-20 16:34:09 +0300
commitf9697543e43b74074727a89f9dc1bc9717536c46 (patch)
treed3d3b4c90b497f4fe3ae950f8122caaad044ab60 /source/blender/editors/screen/screen_ops.c
parent52f40bcff21b285b7eaa21aaa9c6c7b9d6fa8669 (diff)
Revert "Cleanup: Use LISTBASE_FOREACH in editors screen directory"
This reverts commit 52f40bcff21b285b7eaa21aaa9c6c7b9d6fa8669. Apologies for the noise. I caught a problem with this that I hadn't before. I will commit later after thorough testing.
Diffstat (limited to 'source/blender/editors/screen/screen_ops.c')
-rw-r--r--source/blender/editors/screen/screen_ops.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index b39b0ca7db6..b002b23a7f3 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -692,9 +692,10 @@ static bool actionzone_area_poll(bContext *C)
if (screen && win && win->eventstate) {
const int *xy = &win->eventstate->x;
+ AZone *az;
LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
- LISTBASE_FOREACH (AZone *, az, &area->actionzones) {
+ for (az = area->actionzones.first; az; az = az->next) {
if (BLI_rcti_isect_pt_v(&az->rect, xy)) {
return 1;
}
@@ -3067,12 +3068,13 @@ static void SCREEN_OT_keyframe_jump(wmOperatorType *ot)
static int marker_jump_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
+ TimeMarker *marker;
int closest = CFRA;
const bool next = RNA_boolean_get(op->ptr, "next");
bool found = false;
/* find matching marker in the right direction */
- LISTBASE_FOREACH (TimeMarker *, marker, &scene->markers) {
+ for (marker = scene->markers.first; marker; marker = marker->next) {
if (next) {
if ((marker->frame > CFRA) && (!found || closest > marker->frame)) {
closest = marker->frame;
@@ -3168,9 +3170,8 @@ static int screen_maximize_area_exec(bContext *C, wmOperator *op)
/* search current screen for 'fullscreen' areas */
/* prevents restoring info header, when mouse is over it */
- LISTBASE_FOREACH (ScrArea *, area_iter, &screen->areabase) {
- if (area_iter->full) {
- area = area_iter;
+ for (area = screen->areabase.first; area; area = area->next) {
+ if (area->full) {
break;
}
}
@@ -3618,10 +3619,12 @@ static void SCREEN_OT_area_options(wmOperatorType *ot)
static int spacedata_cleanup_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
+ bScreen *screen;
+ ScrArea *area;
int tot = 0;
- LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
- LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
+ for (screen = bmain->screens.first; screen; screen = screen->id.next) {
+ for (area = screen->areabase.first; area; area = area->next) {
if (area->spacedata.first != area->spacedata.last) {
SpaceLink *sl = area->spacedata.first;
@@ -3851,6 +3854,7 @@ static int region_quadview_exec(bContext *C, wmOperator *op)
region->alignment = 0;
if (area->spacetype == SPACE_VIEW3D) {
+ ARegion *region_iter;
RegionView3D *rv3d = region->regiondata;
/* if this is a locked view, use settings from 'User' view */
@@ -3874,7 +3878,7 @@ static int region_quadview_exec(bContext *C, wmOperator *op)
rv3d->rflag |= RV3D_GPULIGHT_UPDATE;
/* Accumulate locks, in case they're mixed. */
- LISTBASE_FOREACH (ARegion *, region_iter, &area->regionbase) {
+ for (region_iter = area->regionbase.first; region_iter; region_iter = region_iter->next) {
if (region_iter->regiontype == RGN_TYPE_WINDOW) {
RegionView3D *rv3d_iter = region_iter->regiondata;
rv3d->viewlock_quad |= rv3d_iter->viewlock;
@@ -4437,6 +4441,8 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), const wmEv
wmTimer *wt = screen->animtimer;
ScreenAnimData *sad = wt->customdata;
wmWindowManager *wm = CTX_wm_manager(C);
+ wmWindow *window;
+ ScrArea *area;
int sync;
double time;
@@ -4582,11 +4588,12 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), const wmEv
ED_update_for_newframe(bmain, depsgraph);
}
- LISTBASE_FOREACH (wmWindow *, window, &wm->windows) {
+ for (window = wm->windows.first; window; window = window->next) {
const bScreen *win_screen = WM_window_get_active_screen(window);
- LISTBASE_FOREACH (ScrArea *, area, &win_screen->areabase) {
- LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
+ for (area = win_screen->areabase.first; area; area = area->next) {
+ ARegion *region;
+ for (region = area->regionbase.first; region; region = region->next) {
bool redraw = false;
if (region == sad->region) {
redraw = true;
@@ -4860,9 +4867,8 @@ static int fullscreen_back_exec(bContext *C, wmOperator *op)
ScrArea *area = NULL;
/* search current screen for 'fullscreen' areas */
- LISTBASE_FOREACH (ScrArea *, area_iter, &screen->areabase) {
+ for (area = screen->areabase.first; area; area = area->next) {
if (area->full) {
- area = area_iter;
break;
}
}