diff options
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_cursors.c | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_dragdrop.c | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_draw.c | 102 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 184 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 8 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_keymap.c | 14 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operator_utils.c | 8 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 43 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_toolsystem.c | 100 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_tooltip.c | 12 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 8 |
11 files changed, 244 insertions, 243 deletions
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index aa80064fae7..58ca3bf1b95 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -183,13 +183,13 @@ void WM_cursor_set(wmWindow *win, int curs) } } -bool WM_cursor_set_from_tool(struct wmWindow *win, const ScrArea *sa, const ARegion *region) +bool WM_cursor_set_from_tool(struct wmWindow *win, const ScrArea *area, const ARegion *region) { if (region && (region->regiontype != RGN_TYPE_WINDOW)) { return false; } - bToolRef_Runtime *tref_rt = (sa && sa->runtime.tool) ? sa->runtime.tool->runtime : NULL; + bToolRef_Runtime *tref_rt = (area && area->runtime.tool) ? area->runtime.tool->runtime : NULL; if (tref_rt && tref_rt->cursor != WM_CURSOR_DEFAULT) { if (win->modalcursor == 0) { WM_cursor_set(win, tref_rt->cursor); diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c index 6fcd757eba2..44c8e8cd61e 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.c +++ b/source/blender/windowmanager/intern/wm_dragdrop.c @@ -222,7 +222,7 @@ static const char *dropbox_active(bContext *C, static const char *wm_dropbox_active(bContext *C, wmDrag *drag, const wmEvent *event) { wmWindow *win = CTX_wm_window(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); const char *name; @@ -231,7 +231,7 @@ static const char *wm_dropbox_active(bContext *C, wmDrag *drag, const wmEvent *e return name; } - name = dropbox_active(C, &sa->handlers, drag, event); + name = dropbox_active(C, &area->handlers, drag, event); if (name) { return name; } diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index b8bee118e3e..bd255458ba8 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -77,7 +77,7 @@ /** \name Draw Paint Cursor * \{ */ -static void wm_paintcursor_draw(bContext *C, ScrArea *sa, ARegion *region) +static void wm_paintcursor_draw(bContext *C, ScrArea *area, ARegion *region) { wmWindowManager *wm = CTX_wm_manager(C); wmWindow *win = CTX_wm_window(C); @@ -87,7 +87,7 @@ static void wm_paintcursor_draw(bContext *C, ScrArea *sa, ARegion *region) if (region->visible && region == screen->active_region) { for (pc = wm->paintcursors.first; pc; pc = pc->next) { - if ((pc->space_type != SPACE_TYPE_ANY) && (sa->spacetype != pc->space_type)) { + if ((pc->space_type != SPACE_TYPE_ANY) && (area->spacetype != pc->space_type)) { continue; } @@ -125,7 +125,7 @@ static void wm_paintcursor_draw(bContext *C, ScrArea *sa, ARegion *region) * \{ */ static bool wm_draw_region_stereo_set(Main *bmain, - ScrArea *sa, + ScrArea *area, ARegion *region, eStereoViews sview) { @@ -135,10 +135,10 @@ static bool wm_draw_region_stereo_set(Main *bmain, return false; } - switch (sa->spacetype) { + switch (area->spacetype) { case SPACE_IMAGE: { if (region->regiontype == RGN_TYPE_WINDOW) { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; sima->iuser.multiview_eye = sview; return true; } @@ -146,7 +146,7 @@ static bool wm_draw_region_stereo_set(Main *bmain, } case SPACE_VIEW3D: { if (region->regiontype == RGN_TYPE_WINDOW) { - View3D *v3d = sa->spacedata.first; + View3D *v3d = area->spacedata.first; if (v3d->camera && v3d->camera->type == OB_CAMERA) { RegionView3D *rv3d = region->regiondata; RenderEngine *engine = rv3d->render_engine; @@ -167,7 +167,7 @@ static bool wm_draw_region_stereo_set(Main *bmain, } case SPACE_NODE: { if (region->regiontype == RGN_TYPE_WINDOW) { - SpaceNode *snode = sa->spacedata.first; + SpaceNode *snode = area->spacedata.first; if ((snode->flag & SNODE_BACKDRAW) && ED_node_is_compositor(snode)) { Image *ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node"); ima->eye = sview; @@ -177,7 +177,7 @@ static bool wm_draw_region_stereo_set(Main *bmain, break; } case SPACE_SEQ: { - SpaceSeq *sseq = sa->spacedata.first; + SpaceSeq *sseq = area->spacedata.first; sseq->multiview_eye = sview; if (region->regiontype == RGN_TYPE_PREVIEW) { @@ -192,15 +192,15 @@ static bool wm_draw_region_stereo_set(Main *bmain, return false; } -static void wm_area_mark_invalid_backbuf(ScrArea *sa) +static void wm_area_mark_invalid_backbuf(ScrArea *area) { - if (sa->spacetype == SPACE_VIEW3D) { - ((View3D *)sa->spacedata.first)->flag |= V3D_INVALID_BACKBUF; + if (area->spacetype == SPACE_VIEW3D) { + ((View3D *)area->spacedata.first)->flag |= V3D_INVALID_BACKBUF; } } static void wm_region_test_gizmo_do_draw(bContext *C, - ScrArea *sa, + ScrArea *area, ARegion *region, bool tag_redraw) { @@ -212,10 +212,10 @@ static void wm_region_test_gizmo_do_draw(bContext *C, for (wmGizmoGroup *gzgroup = WM_gizmomap_group_list(gzmap)->first; gzgroup; gzgroup = gzgroup->next) { if (tag_redraw && (gzgroup->type->flag & WM_GIZMOGROUPTYPE_VR_REDRAWS)) { - ScrArea *ctx_sa = CTX_wm_area(C); + ScrArea *ctx_area = CTX_wm_area(C); ARegion *ctx_region = CTX_wm_region(C); - CTX_wm_area_set(C, sa); + CTX_wm_area_set(C, area); CTX_wm_region_set(C, region); if (WM_gizmo_group_type_poll(C, gzgroup->type)) { @@ -223,7 +223,7 @@ static void wm_region_test_gizmo_do_draw(bContext *C, } /* Reset. */ - CTX_wm_area_set(C, ctx_sa); + CTX_wm_area_set(C, ctx_area); CTX_wm_region_set(C, ctx_region); } @@ -240,17 +240,17 @@ static void wm_region_test_gizmo_do_draw(bContext *C, static void wm_region_test_render_do_draw(const Scene *scene, struct Depsgraph *depsgraph, - ScrArea *sa, + ScrArea *area, ARegion *region) { /* tag region for redraw from render engine preview running inside of it */ - if (sa->spacetype == SPACE_VIEW3D && region->regiontype == RGN_TYPE_WINDOW) { + if (area->spacetype == SPACE_VIEW3D && region->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3d = region->regiondata; RenderEngine *engine = rv3d->render_engine; GPUViewport *viewport = WM_draw_region_get_viewport(region); if (engine && (engine->flag & RE_ENGINE_DO_DRAW)) { - View3D *v3d = sa->spacedata.first; + View3D *v3d = area->spacedata.first; rcti border_rect; /* do partial redraw when possible */ @@ -287,9 +287,9 @@ static bool wm_region_use_viewport_by_type(short space_type, short region_type) return (ELEM(space_type, SPACE_VIEW3D, SPACE_IMAGE) && region_type == RGN_TYPE_WINDOW); } -static bool wm_region_use_viewport(ScrArea *sa, ARegion *region) +static bool wm_region_use_viewport(ScrArea *area, ARegion *region) { - return wm_region_use_viewport_by_type(sa->spacetype, region->regiontype); + return wm_region_use_viewport_by_type(area->spacetype, region->regiontype); } /** \} */ @@ -619,12 +619,12 @@ static void wm_draw_window_offscreen(bContext *C, wmWindow *win, bool stereo) bScreen *screen = WM_window_get_active_screen(win); /* Draw screen areas into own frame buffer. */ - ED_screen_areas_iter(win, screen, sa) + ED_screen_areas_iter(win, screen, area) { - CTX_wm_area_set(C, sa); + CTX_wm_area_set(C, area); /* Compute UI layouts for dynamically size regions. */ - for (ARegion *region = sa->regionbase.first; region; region = region->next) { + for (ARegion *region = area->regionbase.first; region; region = region->next) { /* Dynamic region may have been flagged as too small because their size on init is 0. * ARegion.visible is false then, as expected. The layout should still be created then, so * the region size can be updated (it may turn out to be not too small then). */ @@ -640,22 +640,22 @@ static void wm_draw_window_offscreen(bContext *C, wmWindow *win, bool stereo) } } - ED_area_update_region_sizes(wm, win, sa); + ED_area_update_region_sizes(wm, win, area); - if (sa->flag & AREA_FLAG_ACTIVE_TOOL_UPDATE) { - if ((1 << sa->spacetype) & WM_TOOLSYSTEM_SPACE_MASK) { - WM_toolsystem_update_from_context(C, CTX_wm_workspace(C), CTX_data_view_layer(C), sa); + if (area->flag & AREA_FLAG_ACTIVE_TOOL_UPDATE) { + if ((1 << area->spacetype) & WM_TOOLSYSTEM_SPACE_MASK) { + WM_toolsystem_update_from_context(C, CTX_wm_workspace(C), CTX_data_view_layer(C), area); } - sa->flag &= ~AREA_FLAG_ACTIVE_TOOL_UPDATE; + area->flag &= ~AREA_FLAG_ACTIVE_TOOL_UPDATE; } /* Then do actual drawing of regions. */ - for (ARegion *region = sa->regionbase.first; region; region = region->next) { + for (ARegion *region = area->regionbase.first; region; region = region->next) { if (region->visible && region->do_draw) { CTX_wm_region_set(C, region); - bool use_viewport = wm_region_use_viewport(sa, region); + bool use_viewport = wm_region_use_viewport(area, region); - if (stereo && wm_draw_region_stereo_set(bmain, sa, region, STEREO_LEFT_ID)) { + if (stereo && wm_draw_region_stereo_set(bmain, area, region, STEREO_LEFT_ID)) { wm_draw_region_buffer_create(region, true, use_viewport); for (int view = 0; view < 2; view++) { @@ -665,7 +665,7 @@ static void wm_draw_window_offscreen(bContext *C, wmWindow *win, bool stereo) } else { sview = STEREO_RIGHT_ID; - wm_draw_region_stereo_set(bmain, sa, region, sview); + wm_draw_region_stereo_set(bmain, area, region, sview); } wm_draw_region_bind(region, view); @@ -689,7 +689,7 @@ static void wm_draw_window_offscreen(bContext *C, wmWindow *win, bool stereo) } } - wm_area_mark_invalid_backbuf(sa); + wm_area_mark_invalid_backbuf(area); CTX_wm_area_set(C, NULL); } @@ -735,9 +735,9 @@ static void wm_draw_window_onscreen(bContext *C, wmWindow *win, int view) #endif /* Blit non-overlapping area regions. */ - ED_screen_areas_iter(win, screen, sa) + ED_screen_areas_iter(win, screen, area) { - for (ARegion *region = sa->regionbase.first; region; region = region->next) { + for (ARegion *region = area->regionbase.first; region; region = region->next) { if (region->visible && region->overlap == false) { /* Blit from offscreen buffer. */ wm_draw_region_blit(region, view); @@ -747,15 +747,15 @@ static void wm_draw_window_onscreen(bContext *C, wmWindow *win, int view) /* Draw paint cursors. */ if (wm->paintcursors.first) { - ED_screen_areas_iter(win, screen, sa) + ED_screen_areas_iter(win, screen, area) { - for (ARegion *region = sa->regionbase.first; region; region = region->next) { + for (ARegion *region = area->regionbase.first; region; region = region->next) { if (region->visible && region == screen->active_region) { - CTX_wm_area_set(C, sa); + CTX_wm_area_set(C, area); CTX_wm_region_set(C, region); /* make region ready for draw, scissor, pixelspace */ - wm_paintcursor_draw(C, sa, region); + wm_paintcursor_draw(C, area, region); CTX_wm_region_set(C, NULL); CTX_wm_area_set(C, NULL); @@ -767,9 +767,9 @@ static void wm_draw_window_onscreen(bContext *C, wmWindow *win, int view) } /* Blend in overlapping area regions */ - ED_screen_areas_iter(win, screen, sa) + ED_screen_areas_iter(win, screen, area) { - for (ARegion *region = sa->regionbase.first; region; region = region->next) { + for (ARegion *region = area->regionbase.first; region; region = region->next) { if (region->visible && region->overlap) { wm_draw_region_blend(region, 0, true); } @@ -908,13 +908,13 @@ static bool wm_draw_update_test_window(Main *bmain, bContext *C, wmWindow *win) } } - ED_screen_areas_iter(win, screen, sa) + ED_screen_areas_iter(win, screen, area) { - for (region = sa->regionbase.first; region; region = region->next) { - wm_region_test_gizmo_do_draw(C, sa, region, true); - wm_region_test_render_do_draw(scene, depsgraph, sa, region); + for (region = area->regionbase.first; region; region = region->next) { + wm_region_test_gizmo_do_draw(C, area, region, true); + wm_region_test_render_do_draw(scene, depsgraph, area, region); #ifdef WITH_XR_OPENXR - wm_region_test_xr_do_draw(wm, sa, region); + wm_region_test_xr_do_draw(wm, area, region); #endif if (region->visible && region->do_draw) { @@ -956,10 +956,10 @@ static void wm_draw_update_clear_window(bContext *C, wmWindow *win) { bScreen *screen = WM_window_get_active_screen(win); - ED_screen_areas_iter(win, screen, sa) + ED_screen_areas_iter(win, screen, area) { - for (ARegion *region = sa->regionbase.first; region; region = region->next) { - wm_region_test_gizmo_do_draw(C, sa, region, false); + for (ARegion *region = area->regionbase.first; region; region = region->next) { + wm_region_test_gizmo_do_draw(C, area, region, false); } } @@ -1037,10 +1037,10 @@ void WM_draw_region_free(ARegion *region) region->visible = 0; } -void wm_draw_region_test(bContext *C, ScrArea *sa, ARegion *region) +void wm_draw_region_test(bContext *C, ScrArea *area, ARegion *region) { /* Function for redraw timer benchmark. */ - bool use_viewport = wm_region_use_viewport(sa, region); + bool use_viewport = wm_region_use_viewport(area, region); wm_draw_region_buffer_create(region, false, use_viewport); wm_draw_region_bind(region, 0); ED_region_do_draw(C, region); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 8d7155b5ea8..6a9627decb7 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -288,13 +288,13 @@ void WM_main_remap_editor_id_reference(ID *old_id, ID *new_id) bScreen *sc; for (sc = bmain->screens.first; sc; sc = sc->id.next) { - ScrArea *sa; + ScrArea *area; - for (sa = sc->areabase.first; sa; sa = sa->next) { + for (area = sc->areabase.first; area; area = area->next) { SpaceLink *sl; - for (sl = sa->spacedata.first; sl; sl = sl->next) { - ED_spacedata_id_remap(sa, sl, old_id, new_id); + for (sl = area->spacedata.first; sl; sl = sl->next) { + ED_spacedata_id_remap(area, sl, old_id, new_id); } } } @@ -371,13 +371,13 @@ void wm_event_do_refresh_wm_and_depsgraph(bContext *C) /* cached: editor refresh callbacks now, they get context */ for (wmWindow *win = wm->windows.first; win; win = win->next) { const bScreen *screen = WM_window_get_active_screen(win); - ScrArea *sa; + ScrArea *area; CTX_wm_window_set(C, win); - for (sa = screen->areabase.first; sa; sa = sa->next) { - if (sa->do_refresh) { - CTX_wm_area_set(C, sa); - ED_area_do_refresh(C, sa); + for (area = screen->areabase.first; area; area = area->next) { + if (area->do_refresh) { + CTX_wm_area_set(C, area); + ED_area_do_refresh(C, area); } } } @@ -524,11 +524,11 @@ void wm_event_do_notifiers(bContext *C) ED_region_do_listen(win, NULL, region, note, scene); } - ED_screen_areas_iter(win, screen, sa) + ED_screen_areas_iter(win, screen, area) { - ED_area_do_listen(win, sa, note, scene); - for (region = sa->regionbase.first; region; region = region->next) { - ED_region_do_listen(win, sa, region, note, scene); + ED_area_do_listen(win, area, note, scene); + for (region = area->regionbase.first; region; region = region->next) { + ED_region_do_listen(win, area, region, note, scene); } } } @@ -822,11 +822,11 @@ bool WM_operator_check_ui_empty(wmOperatorType *ot) */ void WM_operator_region_active_win_set(bContext *C) { - ScrArea *sa = CTX_wm_area(C); - if (sa) { + ScrArea *area = CTX_wm_area(C); + if (area) { ARegion *region = CTX_wm_region(C); if (region && region->regiontype == RGN_TYPE_WINDOW) { - sa->region_active_win = BLI_findindex(&sa->regionbase, region); + area->region_active_win = BLI_findindex(&area->regionbase, region); } } } @@ -948,9 +948,9 @@ static void wm_operator_finished(bContext *C, wmOperator *op, const bool repeat, if (hud_status != NOP) { if (hud_status == SET) { - ScrArea *sa = CTX_wm_area(C); - if (sa) { - ED_area_type_hud_ensure(C, sa); + ScrArea *area = CTX_wm_area(C); + if (area) { + ED_area_type_hud_ensure(C, area); } } else if (hud_status == CLEAR) { @@ -1335,7 +1335,7 @@ static int wm_operator_invoke(bContext *C, if (wrap) { const rcti *winrect = NULL; ARegion *region = CTX_wm_region(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); /* Wrap only in X for header. */ if (region && @@ -1347,8 +1347,8 @@ static int wm_operator_invoke(bContext *C, BLI_rcti_isect_pt_v(®ion->winrct, &event->x)) { winrect = ®ion->winrct; } - else if (sa && BLI_rcti_isect_pt_v(&sa->totrct, &event->x)) { - winrect = &sa->totrct; + else if (area && BLI_rcti_isect_pt_v(&area->totrct, &event->x)) { + winrect = &area->totrct; } if (winrect) { @@ -1653,17 +1653,17 @@ static void wm_handler_op_context(bContext *C, wmEventHandler_Op *handler, const CTX_wm_area_set(C, NULL); } else { - ScrArea *sa = NULL; + ScrArea *area = NULL; - ED_screen_areas_iter(win, screen, sa_iter) + ED_screen_areas_iter(win, screen, area_iter) { - if (sa_iter == handler->context.area) { - sa = sa_iter; + if (area_iter == handler->context.area) { + area = area_iter; 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 */ if (handler->op == NULL) { @@ -1675,10 +1675,10 @@ static void wm_handler_op_context(bContext *C, wmEventHandler_Op *handler, const else { ARegion *region; wmOperator *op = handler->op ? (handler->op->opm ? handler->op->opm : handler->op) : NULL; - CTX_wm_area_set(C, sa); + CTX_wm_area_set(C, area); if (op && (op->flag & OP_IS_MODAL_CURSOR_REGION)) { - region = BKE_area_find_region_xy(sa, handler->context.region_type, event->x, event->y); + region = BKE_area_find_region_xy(area, handler->context.region_type, event->x, event->y); if (region) { handler->context.region = region; } @@ -1688,7 +1688,7 @@ static void wm_handler_op_context(bContext *C, wmEventHandler_Op *handler, const } if (region == NULL) { - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region == handler->context.region) { break; } @@ -2216,19 +2216,19 @@ static int wm_handler_fileselect_do(bContext *C, } else { wmWindow *temp_win; - ScrArea *ctx_sa = CTX_wm_area(C); + ScrArea *ctx_area = CTX_wm_area(C); for (temp_win = wm->windows.first; temp_win; temp_win = temp_win->next) { bScreen *screen = WM_window_get_active_screen(temp_win); - ScrArea *file_sa = screen->areabase.first; + ScrArea *file_area = screen->areabase.first; - if (screen->temp && (file_sa->spacetype == SPACE_FILE)) { + if (screen->temp && (file_area->spacetype == SPACE_FILE)) { int win_size[2]; bool is_maximized; ED_fileselect_window_params_get(temp_win, win_size, &is_maximized); - ED_fileselect_params_to_userdef(file_sa->spacedata.first, win_size, is_maximized); + ED_fileselect_params_to_userdef(file_area->spacedata.first, win_size, is_maximized); - if (BLI_listbase_is_single(&file_sa->spacedata)) { + if (BLI_listbase_is_single(&file_area->spacedata)) { BLI_assert(ctx_win != temp_win); wm_window_close(C, wm, temp_win); @@ -2244,20 +2244,20 @@ static int wm_handler_fileselect_do(bContext *C, handler->context.win = NULL; } } - else if (file_sa->full) { - ED_screen_full_prevspace(C, file_sa); + else if (file_area->full) { + ED_screen_full_prevspace(C, file_area); } else { - ED_area_prevspace(C, file_sa); + ED_area_prevspace(C, file_area); } break; } } - if (!temp_win && ctx_sa->full) { - ED_fileselect_params_to_userdef(ctx_sa->spacedata.first, NULL, false); - ED_screen_full_prevspace(C, ctx_sa); + if (!temp_win && ctx_area->full) { + ED_fileselect_params_to_userdef(ctx_area->spacedata.first, NULL, false); + ED_screen_full_prevspace(C, ctx_area); } } @@ -2988,10 +2988,10 @@ static ScrArea *area_event_inside(bContext *C, const int xy[2]) bScreen *screen = CTX_wm_screen(C); if (screen) { - ED_screen_areas_iter(win, screen, sa) + ED_screen_areas_iter(win, screen, area) { - if (BLI_rcti_isect_pt_v(&sa->totrct, xy)) { - return sa; + if (BLI_rcti_isect_pt_v(&area->totrct, xy)) { + return area; } } } @@ -3041,14 +3041,14 @@ static void wm_paintcursor_test(bContext *C, const wmEvent *event) /* if previous position was not in current region, we have to set a temp new context */ if (region == NULL || !BLI_rcti_isect_pt_v(®ion->winrct, &event->prevx)) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); CTX_wm_area_set(C, area_event_inside(C, &event->prevx)); CTX_wm_region_set(C, region_event_inside(C, &event->prevx)); wm_paintcursor_tag(C, wm->paintcursors.first, CTX_wm_region(C)); - CTX_wm_area_set(C, sa); + CTX_wm_area_set(C, area); CTX_wm_region_set(C, region); } } @@ -3266,7 +3266,7 @@ void wm_event_do_handlers(bContext *C) } #endif - ED_screen_areas_iter(win, screen, sa) + ED_screen_areas_iter(win, screen, area) { /* after restoring a screen from SCREENMAXIMIZED we have to wait * with the screen handling till the region coordinates are updated */ @@ -3277,15 +3277,15 @@ void wm_event_do_handlers(bContext *C) } /* update azones if needed - done here because it needs to be independent from redraws */ - if (sa->flag & AREA_FLAG_ACTIONZONES_UPDATE) { - ED_area_azones_update(sa, &event->x); + if (area->flag & AREA_FLAG_ACTIONZONES_UPDATE) { + ED_area_azones_update(area, &event->x); } - if (wm_event_inside_rect(event, &sa->totrct)) { - CTX_wm_area_set(C, sa); + if (wm_event_inside_rect(event, &area->totrct)) { + CTX_wm_area_set(C, area); if ((action & WM_HANDLER_BREAK) == 0) { - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (wm_event_inside_region(event, region)) { CTX_wm_region_set(C, region); @@ -3319,7 +3319,7 @@ void wm_event_do_handlers(bContext *C) if ((action & WM_HANDLER_BREAK) == 0) { wm_region_mouse_co(C, event); /* only invalidates event->mval in this case */ - action |= wm_handlers_do(C, event, &sa->handlers); + action |= wm_handlers_do(C, event, &area->handlers); } CTX_wm_area_set(C, NULL); @@ -3437,13 +3437,13 @@ void WM_event_add_fileselect(bContext *C, wmOperator *op) bool cancel_handler = true; /* find the area with the file selector for this handler */ - ED_screen_areas_iter(win, screen, sa) + ED_screen_areas_iter(win, screen, area) { - if (sa->spacetype == SPACE_FILE) { - SpaceFile *sfile = sa->spacedata.first; + if (area->spacetype == SPACE_FILE) { + SpaceFile *sfile = area->spacedata.first; if (sfile->op == handler->op) { - CTX_wm_area_set(C, sa); + CTX_wm_area_set(C, area); wm_handler_fileselect_do(C, &win->modalhandlers, handler, EVT_FILESELECT_CANCEL); cancel_handler = false; break; @@ -3604,9 +3604,9 @@ wmEventHandler_Keymap *WM_event_add_keymap_handler(ListBase *handlers, wmKeyMap wmKeyMap *WM_event_get_keymap_from_toolsystem_fallback(wmWindowManager *wm, wmEventHandler_Keymap *handler) { - ScrArea *sa = handler->dynamic.user_data; + ScrArea *area = handler->dynamic.user_data; handler->keymap_tool = NULL; - bToolRef_Runtime *tref_rt = sa->runtime.tool ? sa->runtime.tool->runtime : NULL; + bToolRef_Runtime *tref_rt = area->runtime.tool ? area->runtime.tool->runtime : NULL; if (tref_rt && tref_rt->keymap_fallback[0]) { const char *keymap_id = NULL; @@ -3614,7 +3614,7 @@ wmKeyMap *WM_event_get_keymap_from_toolsystem_fallback(wmWindowManager *wm, if (tref_rt->gizmo_group[0] != '\0' && tref_rt->keymap_fallback[0] != '\n') { wmGizmoMap *gzmap = NULL; wmGizmoGroup *gzgroup = NULL; - for (ARegion *region = sa->regionbase.first; region; region = region->next) { + for (ARegion *region = area->regionbase.first; region; region = region->next) { if (region->gizmo_map != NULL) { gzmap = region->gizmo_map; gzgroup = WM_gizmomap_group_find(gzmap, tref_rt->gizmo_group); @@ -3638,15 +3638,15 @@ wmKeyMap *WM_event_get_keymap_from_toolsystem_fallback(wmWindowManager *wm, if (keymap_id && keymap_id[0]) { wmKeyMap *km = WM_keymap_list_find_spaceid_or_empty( - &wm->userconf->keymaps, keymap_id, sa->spacetype, RGN_TYPE_WINDOW); + &wm->userconf->keymaps, keymap_id, area->spacetype, RGN_TYPE_WINDOW); /* We shouldn't use keymaps from unrelated spaces. */ if (km != NULL) { - handler->keymap_tool = sa->runtime.tool; + handler->keymap_tool = area->runtime.tool; return km; } else { printf( - "Keymap: '%s' not found for tool '%s'\n", tref_rt->keymap, sa->runtime.tool->idname); + "Keymap: '%s' not found for tool '%s'\n", tref_rt->keymap, area->runtime.tool->idname); } } } @@ -3655,22 +3655,22 @@ wmKeyMap *WM_event_get_keymap_from_toolsystem_fallback(wmWindowManager *wm, wmKeyMap *WM_event_get_keymap_from_toolsystem(wmWindowManager *wm, wmEventHandler_Keymap *handler) { - ScrArea *sa = handler->dynamic.user_data; + ScrArea *area = handler->dynamic.user_data; handler->keymap_tool = NULL; - bToolRef_Runtime *tref_rt = sa->runtime.tool ? sa->runtime.tool->runtime : NULL; + bToolRef_Runtime *tref_rt = area->runtime.tool ? area->runtime.tool->runtime : NULL; if (tref_rt && tref_rt->keymap[0]) { const char *keymap_id = tref_rt->keymap; { wmKeyMap *km = WM_keymap_list_find_spaceid_or_empty( - &wm->userconf->keymaps, keymap_id, sa->spacetype, RGN_TYPE_WINDOW); + &wm->userconf->keymaps, keymap_id, area->spacetype, RGN_TYPE_WINDOW); /* We shouldn't use keymaps from unrelated spaces. */ if (km != NULL) { - handler->keymap_tool = sa->runtime.tool; + handler->keymap_tool = area->runtime.tool; return km; } else { printf( - "Keymap: '%s' not found for tool '%s'\n", tref_rt->keymap, sa->runtime.tool->idname); + "Keymap: '%s' not found for tool '%s'\n", tref_rt->keymap, area->runtime.tool->idname); } } } @@ -4880,30 +4880,30 @@ ScrArea *WM_window_status_area_find(wmWindow *win, bScreen *screen) if (screen->state == SCREENFULL) { return NULL; } - ScrArea *sa_statusbar = NULL; - for (ScrArea *sa = win->global_areas.areabase.first; sa; sa = sa->next) { - if (sa->spacetype == SPACE_STATUSBAR) { - sa_statusbar = sa; + ScrArea *area_statusbar = NULL; + for (ScrArea *area = win->global_areas.areabase.first; area; area = area->next) { + if (area->spacetype == SPACE_STATUSBAR) { + area_statusbar = area; break; } } - return sa_statusbar; + return area_statusbar; } void WM_window_status_area_tag_redraw(wmWindow *win) { bScreen *sc = WM_window_get_active_screen(win); - ScrArea *sa = WM_window_status_area_find(win, sc); - if (sa != NULL) { - ED_area_tag_redraw(sa); + ScrArea *area = WM_window_status_area_find(win, sc); + if (area != NULL) { + ED_area_tag_redraw(area); } } void WM_window_cursor_keymap_status_refresh(bContext *C, wmWindow *win) { bScreen *screen = WM_window_get_active_screen(win); - ScrArea *sa_statusbar = WM_window_status_area_find(win, screen); - if (sa_statusbar == NULL) { + ScrArea *area_statusbar = WM_window_status_area_find(win, screen); + if (area_statusbar == NULL) { MEM_SAFE_FREE(win->cursor_keymap_status); return; } @@ -4930,20 +4930,20 @@ void WM_window_cursor_keymap_status_refresh(bContext *C, wmWindow *win) return; } - ScrArea *sa = NULL; - ED_screen_areas_iter(win, screen, sa_iter) + ScrArea *area = NULL; + ED_screen_areas_iter(win, screen, area_iter) { - if (BLI_findindex(&sa_iter->regionbase, region) != -1) { - sa = sa_iter; + if (BLI_findindex(&area_iter->regionbase, region) != -1) { + area = area_iter; break; } } - if (sa == NULL) { + if (area == NULL) { return; } /* Keep as-is. */ - if (ELEM(sa->spacetype, SPACE_STATUSBAR, SPACE_TOPBAR)) { + if (ELEM(area->spacetype, SPACE_STATUSBAR, SPACE_TOPBAR)) { return; } if (ELEM(region->regiontype, @@ -4956,23 +4956,23 @@ void WM_window_cursor_keymap_status_refresh(bContext *C, wmWindow *win) } /* Fallback to window. */ if (ELEM(region->regiontype, RGN_TYPE_TOOLS, RGN_TYPE_TOOL_PROPS)) { - region = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); + region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); } /* Detect changes to the state. */ { bToolRef *tref = NULL; if ((region->regiontype == RGN_TYPE_WINDOW) && - ((1 << sa->spacetype) & WM_TOOLSYSTEM_SPACE_MASK)) { + ((1 << area->spacetype) & WM_TOOLSYSTEM_SPACE_MASK)) { ViewLayer *view_layer = WM_window_get_active_view_layer(win); WorkSpace *workspace = WM_window_get_active_workspace(win); const bToolKey tkey = { - .space_type = sa->spacetype, - .mode = WM_toolsystem_mode_from_spacetype(view_layer, sa, sa->spacetype), + .space_type = area->spacetype, + .mode = WM_toolsystem_mode_from_spacetype(view_layer, area, area->spacetype), }; tref = WM_toolsystem_ref_find(workspace, &tkey); } - wm_event_cursor_store(&cd->state, win->eventstate, sa->spacetype, region->regiontype, tref); + wm_event_cursor_store(&cd->state, win->eventstate, area->spacetype, region->regiontype, tref); if (memcmp(&cd->state, &cd_prev.state, sizeof(cd->state)) == 0) { return; } @@ -5004,12 +5004,12 @@ void WM_window_cursor_keymap_status_refresh(bContext *C, wmWindow *win) } CTX_wm_window_set(C, win); - CTX_wm_area_set(C, sa); + CTX_wm_area_set(C, area); CTX_wm_region_set(C, region); ListBase *handlers[] = { ®ion->handlers, - &sa->handlers, + &area->handlers, &win->handlers, }; @@ -5039,7 +5039,7 @@ void WM_window_cursor_keymap_status_refresh(bContext *C, wmWindow *win) } if (memcmp(&cd_prev.text, &cd->text, sizeof(cd_prev.text)) != 0) { - ED_area_tag_redraw(sa_statusbar); + ED_area_tag_redraw(area_statusbar); } CTX_wm_window_set(C, NULL); diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index fa59bad7a6b..3c8b6b1c9d4 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -1219,7 +1219,7 @@ static ImBuf *blend_file_thumb(const bContext *C, char err_out[256] = "unknown"; /* screen if no camera found */ - ScrArea *sa = NULL; + ScrArea *area = NULL; ARegion *region = NULL; View3D *v3d = NULL; @@ -1235,10 +1235,10 @@ static ImBuf *blend_file_thumb(const bContext *C, } if ((scene->camera == NULL) && (screen != NULL)) { - sa = BKE_screen_find_big_area(screen, SPACE_VIEW3D, 0); - region = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); + area = BKE_screen_find_big_area(screen, SPACE_VIEW3D, 0); + region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); if (region) { - v3d = sa->spacedata.first; + v3d = area->spacedata.first; } } diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 890aeb71e1a..97a73d9dbfa 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -1449,7 +1449,7 @@ static wmKeyMapItem *wm_keymap_item_find_props(const bContext *C, wmKeyMap **r_keymap) { wmWindow *win = CTX_wm_window(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); wmKeyMapItem *found = NULL; @@ -1463,16 +1463,16 @@ static wmKeyMapItem *wm_keymap_item_find_props(const bContext *C, } } - if (sa && found == NULL) { + if (area && found == NULL) { found = wm_keymap_item_find_handlers( - C, &sa->handlers, opname, opcontext, properties, is_strict, params, r_keymap); + C, &area->handlers, opname, opcontext, properties, is_strict, params, r_keymap); } if (found == NULL) { if (ELEM(opcontext, WM_OP_EXEC_REGION_WIN, WM_OP_INVOKE_REGION_WIN)) { - if (sa) { + if (area) { if (!(region && region->regiontype == RGN_TYPE_WINDOW)) { - region = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); + region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); } if (region) { @@ -1483,7 +1483,7 @@ static wmKeyMapItem *wm_keymap_item_find_props(const bContext *C, } else if (ELEM(opcontext, WM_OP_EXEC_REGION_CHANNELS, WM_OP_INVOKE_REGION_CHANNELS)) { if (!(region && region->regiontype == RGN_TYPE_CHANNELS)) { - region = BKE_area_find_region_type(sa, RGN_TYPE_CHANNELS); + region = BKE_area_find_region_type(area, RGN_TYPE_CHANNELS); } if (region) { @@ -1493,7 +1493,7 @@ static wmKeyMapItem *wm_keymap_item_find_props(const bContext *C, } else if (ELEM(opcontext, WM_OP_EXEC_REGION_PREVIEW, WM_OP_INVOKE_REGION_PREVIEW)) { if (!(region && region->regiontype == RGN_TYPE_PREVIEW)) { - region = BKE_area_find_region_type(sa, RGN_TYPE_PREVIEW); + region = BKE_area_find_region_type(area, RGN_TYPE_PREVIEW); } if (region) { diff --git a/source/blender/windowmanager/intern/wm_operator_utils.c b/source/blender/windowmanager/intern/wm_operator_utils.c index 4a786329e1a..81b597f7484 100644 --- a/source/blender/windowmanager/intern/wm_operator_utils.c +++ b/source/blender/windowmanager/intern/wm_operator_utils.c @@ -62,7 +62,7 @@ typedef struct ValueInteraction { float range[2]; struct { - ScrArea *sa; + ScrArea *area; ARegion *region; } context_vars; } ValueInteraction; @@ -74,7 +74,7 @@ static void interactive_value_init(bContext *C, const float range[2]) { - inter->context_vars.sa = CTX_wm_area(C); + inter->context_vars.area = CTX_wm_area(C); inter->context_vars.region = CTX_wm_region(C); inter->init.mval[0] = event->mval[0]; @@ -97,7 +97,7 @@ static void interactive_value_init_from_property( static void interactive_value_exit(ValueInteraction *inter) { - ED_area_status_text(inter->context_vars.sa, NULL); + ED_area_status_text(inter->context_vars.area, NULL); } static bool interactive_value_update(ValueInteraction *inter, @@ -128,7 +128,7 @@ static bool interactive_value_update(ValueInteraction *inter, /* set the property for the operator and call its modal function */ char str[64]; SNPRINTF(str, "%.4f", value_final); - ED_area_status_text(inter->context_vars.sa, str); + ED_area_status_text(inter->context_vars.area, str); } inter->prev.prop_value = value_final; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 4a4e373d15e..9a376390096 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1767,13 +1767,13 @@ static int wm_search_menu_invoke(bContext *C, wmOperator *op, const wmEvent *eve /* Exception for launching via spacebar */ if (event->type == EVT_SPACEKEY) { bool ok = true; - ScrArea *sa = CTX_wm_area(C); - if (sa) { - if (sa->spacetype == SPACE_CONSOLE) { + ScrArea *area = CTX_wm_area(C); + if (area) { + if (area->spacetype == SPACE_CONSOLE) { /* So we can use the shortcut in the console. */ ok = false; } - else if (sa->spacetype == SPACE_TEXT) { + else if (area->spacetype == SPACE_TEXT) { /* So we can use the spacebar in the text editor. */ ok = false; } @@ -2135,7 +2135,7 @@ static void radial_control_update_header(wmOperator *op, bContext *C) { RadialControl *rc = op->customdata; char msg[UI_MAX_DRAW_STR]; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); Scene *scene = CTX_data_scene(C); if (hasNumInput(&rc->num_input)) { @@ -2172,7 +2172,7 @@ static void radial_control_update_header(wmOperator *op, bContext *C) } } - ED_area_status_text(sa, msg); + ED_area_status_text(area, msg); } static void radial_control_set_initial_mouse(RadialControl *rc, const wmEvent *event) @@ -2788,14 +2788,14 @@ static void radial_control_cancel(bContext *C, wmOperator *op) { RadialControl *rc = op->customdata; wmWindowManager *wm = CTX_wm_manager(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); if (rc->dial) { MEM_freeN(rc->dial); rc->dial = NULL; } - ED_area_status_text(sa, NULL); + ED_area_status_text(area, NULL); WM_paint_cursor_end(wm, rc->cursor); @@ -3139,11 +3139,11 @@ static void WM_OT_radial_control(wmOperatorType *ot) static void redraw_timer_window_swap(bContext *C) { wmWindow *win = CTX_wm_window(C); - ScrArea *sa; + ScrArea *area; CTX_wm_menu_set(C, NULL); - for (sa = CTX_wm_screen(C)->areabase.first; sa; sa = sa->next) { - ED_area_tag_redraw(sa); + for (area = CTX_wm_screen(C)->areabase.first; area; area = area->next) { + ED_area_tag_redraw(area); } wm_draw_update(C); @@ -3176,14 +3176,14 @@ static void redraw_timer_step(bContext *C, Scene *scene, struct Depsgraph *depsgraph, wmWindow *win, - ScrArea *sa, + ScrArea *area, ARegion *region, const int type, const int cfra) { if (type == eRTDrawRegion) { if (region) { - wm_draw_region_test(C, sa, region); + wm_draw_region_test(C, area, region); } } else if (type == eRTDrawRegionSwap) { @@ -3196,25 +3196,26 @@ static void redraw_timer_step(bContext *C, } else if (type == eRTDrawWindow) { bScreen *screen = WM_window_get_active_screen(win); - ScrArea *sa_iter; + ScrArea *area_iter; CTX_wm_menu_set(C, NULL); - for (sa_iter = screen->areabase.first; sa_iter; sa_iter = sa_iter->next) { + for (area_iter = screen->areabase.first; area_iter; area_iter = area_iter->next) { ARegion *region_iter; - CTX_wm_area_set(C, sa_iter); + CTX_wm_area_set(C, area_iter); - for (region_iter = sa_iter->regionbase.first; region_iter; region_iter = region_iter->next) { + for (region_iter = area_iter->regionbase.first; region_iter; + region_iter = region_iter->next) { if (region_iter->visible) { CTX_wm_region_set(C, region_iter); - wm_draw_region_test(C, sa_iter, region_iter); + wm_draw_region_test(C, area_iter, region_iter); } } } CTX_wm_window_set(C, win); /* XXX context manipulation warning! */ - CTX_wm_area_set(C, sa); + CTX_wm_area_set(C, area); CTX_wm_region_set(C, region); } else if (type == eRTDrawWindowSwap) { @@ -3250,7 +3251,7 @@ static int redraw_timer_exec(bContext *C, wmOperator *op) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); wmWindow *win = CTX_wm_window(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); wmWindowManager *wm = CTX_wm_manager(C); double time_start, time_delta; @@ -3272,7 +3273,7 @@ static int redraw_timer_exec(bContext *C, wmOperator *op) wm_window_make_drawable(wm, win); for (a = 0; a < iter; a++) { - redraw_timer_step(C, bmain, scene, depsgraph, win, sa, region, type, cfra); + redraw_timer_step(C, bmain, scene, depsgraph, win, area, region, type, cfra); iter_steps += 1; if (time_limit != 0.0) { diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index 1abef2ec173..f1928819c26 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -72,18 +72,18 @@ struct bToolRef *WM_toolsystem_ref_from_context(struct bContext *C) { WorkSpace *workspace = CTX_wm_workspace(C); ViewLayer *view_layer = CTX_data_view_layer(C); - ScrArea *sa = CTX_wm_area(C); - if ((sa == NULL) || ((1 << sa->spacetype) & WM_TOOLSYSTEM_SPACE_MASK) == 0) { + ScrArea *area = CTX_wm_area(C); + if ((area == NULL) || ((1 << area->spacetype) & WM_TOOLSYSTEM_SPACE_MASK) == 0) { return NULL; } const bToolKey tkey = { - .space_type = sa->spacetype, - .mode = WM_toolsystem_mode_from_spacetype(view_layer, sa, sa->spacetype), + .space_type = area->spacetype, + .mode = WM_toolsystem_mode_from_spacetype(view_layer, area, area->spacetype), }; bToolRef *tref = WM_toolsystem_ref_find(workspace, &tkey); - /* We could return 'sa->runtime.tool' in this case. */ - if (sa->runtime.is_tool_set) { - BLI_assert(tref == sa->runtime.tool); + /* We could return 'area->runtime.tool' in this case. */ + if (area->runtime.is_tool_set) { + BLI_assert(tref == area->runtime.tool); } return tref; } @@ -279,15 +279,15 @@ void WM_toolsystem_reinit_all(struct bContext *C, wmWindow *win) { bScreen *screen = WM_window_get_active_screen(win); ViewLayer *view_layer = WM_window_get_active_view_layer(win); - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - if (((1 << sa->spacetype) & WM_TOOLSYSTEM_SPACE_MASK) == 0) { + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + if (((1 << area->spacetype) & WM_TOOLSYSTEM_SPACE_MASK) == 0) { continue; } WorkSpace *workspace = WM_window_get_active_workspace(win); const bToolKey tkey = { - .space_type = sa->spacetype, - .mode = WM_toolsystem_mode_from_spacetype(view_layer, sa, sa->spacetype), + .space_type = area->spacetype, + .mode = WM_toolsystem_mode_from_spacetype(view_layer, area, area->spacetype), }; bToolRef *tref = WM_toolsystem_ref_find(workspace, &tkey); if (tref) { @@ -450,12 +450,12 @@ static bool toolsystem_key_ensure_check(const bToolKey *tkey) return false; } -int WM_toolsystem_mode_from_spacetype(ViewLayer *view_layer, ScrArea *sa, int spacetype) +int WM_toolsystem_mode_from_spacetype(ViewLayer *view_layer, ScrArea *area, int spacetype) { int mode = -1; switch (spacetype) { case SPACE_VIEW3D: { - /* 'sa' may be NULL in this case. */ + /* 'area' may be NULL in this case. */ Object *obact = OBACT(view_layer); if (obact != NULL) { Object *obedit = OBEDIT_FROM_OBACT(obact); @@ -467,7 +467,7 @@ int WM_toolsystem_mode_from_spacetype(ViewLayer *view_layer, ScrArea *sa, int sp break; } case SPACE_IMAGE: { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; mode = sima->mode; break; } @@ -476,7 +476,7 @@ int WM_toolsystem_mode_from_spacetype(ViewLayer *view_layer, ScrArea *sa, int sp break; } case SPACE_SEQ: { - SpaceSeq *sseq = sa->spacedata.first; + SpaceSeq *sseq = area->spacedata.first; mode = sseq->view; break; } @@ -484,14 +484,14 @@ int WM_toolsystem_mode_from_spacetype(ViewLayer *view_layer, ScrArea *sa, int sp return mode; } -bool WM_toolsystem_key_from_context(ViewLayer *view_layer, ScrArea *sa, bToolKey *tkey) +bool WM_toolsystem_key_from_context(ViewLayer *view_layer, ScrArea *area, bToolKey *tkey) { int space_type = SPACE_EMPTY; int mode = -1; - if (sa != NULL) { - space_type = sa->spacetype; - mode = WM_toolsystem_mode_from_spacetype(view_layer, sa, space_type); + if (area != NULL) { + space_type = area->spacetype; + mode = WM_toolsystem_mode_from_spacetype(view_layer, area, space_type); } if (mode != -1) { @@ -520,18 +520,18 @@ void WM_toolsystem_refresh_active(bContext *C) ViewLayer *view_layer = WM_window_get_active_view_layer(win); /* Could skip loop for modes that don't depend on space type. */ int space_type_mask_handled = 0; - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { + for (ScrArea *area = screen->areabase.first; area; area = area->next) { /* Don't change the space type of the active tool, only update it's mode. */ - const int space_type_mask = (1 << sa->spacetype); + const int space_type_mask = (1 << area->spacetype); if ((space_type_mask & WM_TOOLSYSTEM_SPACE_MASK) && ((space_type_mask_handled & space_type_mask) == 0)) { space_type_mask_handled |= space_type_mask; const bToolKey tkey = { - .space_type = sa->spacetype, - .mode = WM_toolsystem_mode_from_spacetype(view_layer, sa, sa->spacetype), + .space_type = area->spacetype, + .mode = WM_toolsystem_mode_from_spacetype(view_layer, area, area->spacetype), }; bToolRef *tref = WM_toolsystem_ref_find(workspace, &tkey); - if (tref != sa->runtime.tool) { + if (tref != area->runtime.tool) { toolsystem_reinit_ensure_toolref(C, workspace, &tkey, NULL); } } @@ -554,15 +554,15 @@ void WM_toolsystem_refresh_active(bContext *C) } } -void WM_toolsystem_refresh_screen_area(WorkSpace *workspace, ViewLayer *view_layer, ScrArea *sa) +void WM_toolsystem_refresh_screen_area(WorkSpace *workspace, ViewLayer *view_layer, ScrArea *area) { - sa->runtime.tool = NULL; - sa->runtime.is_tool_set = true; - const int mode = WM_toolsystem_mode_from_spacetype(view_layer, sa, sa->spacetype); + area->runtime.tool = NULL; + area->runtime.is_tool_set = true; + const int mode = WM_toolsystem_mode_from_spacetype(view_layer, area, area->spacetype); for (bToolRef *tref = workspace->tools.first; tref; tref = tref->next) { - if (tref->space_type == sa->spacetype) { + if (tref->space_type == area->spacetype) { if (tref->mode == mode) { - sa->runtime.tool = tref; + area->runtime.tool = tref; break; } } @@ -581,11 +581,11 @@ void WM_toolsystem_refresh_screen_all(Main *bmain) } bScreen *screen = WM_window_get_active_screen(win); ViewLayer *view_layer = WM_window_get_active_view_layer(win); - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - sa->runtime.tool = NULL; - sa->runtime.is_tool_set = true; - if (space_type_has_tools[sa->spacetype]) { - WM_toolsystem_refresh_screen_area(workspace, view_layer, sa); + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + area->runtime.tool = NULL; + area->runtime.is_tool_set = true; + if (space_type_has_tools[area->spacetype]) { + WM_toolsystem_refresh_screen_area(workspace, view_layer, area); } } } @@ -602,12 +602,12 @@ static void toolsystem_refresh_screen_from_active_tool(Main *bmain, if (workspace == WM_window_get_active_workspace(win)) { bScreen *screen = WM_window_get_active_screen(win); ViewLayer *view_layer = WM_window_get_active_view_layer(win); - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - if (sa->spacetype == tref->space_type) { - int mode = WM_toolsystem_mode_from_spacetype(view_layer, sa, sa->spacetype); + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + if (area->spacetype == tref->space_type) { + int mode = WM_toolsystem_mode_from_spacetype(view_layer, area, area->spacetype); if (mode == tref->mode) { - sa->runtime.tool = tref; - sa->runtime.is_tool_set = true; + area->runtime.tool = tref; + area->runtime.is_tool_set = true; } } } @@ -649,9 +649,9 @@ bToolRef *WM_toolsystem_ref_set_by_id_ex( bToolRef *WM_toolsystem_ref_set_by_id(bContext *C, const char *name) { ViewLayer *view_layer = CTX_data_view_layer(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); bToolKey tkey; - if (WM_toolsystem_key_from_context(view_layer, sa, &tkey)) { + if (WM_toolsystem_key_from_context(view_layer, area, &tkey)) { WorkSpace *workspace = CTX_wm_workspace(C); return WM_toolsystem_ref_set_by_id_ex(C, workspace, &tkey, name, false); } @@ -782,11 +782,11 @@ void WM_toolsystem_update_from_context_view3d(bContext *C) void WM_toolsystem_update_from_context(bContext *C, WorkSpace *workspace, ViewLayer *view_layer, - ScrArea *sa) + ScrArea *area) { const bToolKey tkey = { - .space_type = sa->spacetype, - .mode = WM_toolsystem_mode_from_spacetype(view_layer, sa, sa->spacetype), + .space_type = area->spacetype, + .mode = WM_toolsystem_mode_from_spacetype(view_layer, area, area->spacetype), }; if (toolsystem_key_ensure_check(&tkey)) { toolsystem_reinit_ensure_toolref(C, workspace, &tkey, NULL); @@ -807,13 +807,13 @@ void WM_toolsystem_do_msg_notify_tag_refresh(bContext *C, wmMsgSubscribeKey *UNUSED(msg_key), wmMsgSubscribeValue *msg_val) { - ScrArea *sa = msg_val->user_data; + ScrArea *area = msg_val->user_data; Main *bmain = CTX_data_main(C); wmWindow *win = ((wmWindowManager *)bmain->wm.first)->windows.first; if (win->next != NULL) { do { bScreen *screen = WM_window_get_active_screen(win); - if (BLI_findindex(&screen->areabase, sa) != -1) { + if (BLI_findindex(&screen->areabase, area) != -1) { break; } } while ((win = win->next)); @@ -823,11 +823,11 @@ void WM_toolsystem_do_msg_notify_tag_refresh(bContext *C, ViewLayer *view_layer = WM_window_get_active_view_layer(win); const bToolKey tkey = { - .space_type = sa->spacetype, - .mode = WM_toolsystem_mode_from_spacetype(view_layer, sa, sa->spacetype), + .space_type = area->spacetype, + .mode = WM_toolsystem_mode_from_spacetype(view_layer, area, area->spacetype), }; WM_toolsystem_refresh(C, workspace, &tkey); - WM_toolsystem_refresh_screen_area(workspace, view_layer, sa); + WM_toolsystem_refresh_screen_area(workspace, view_layer, area); } IDProperty *WM_toolsystem_ref_properties_ensure_idprops(bToolRef *tref) diff --git a/source/blender/windowmanager/intern/wm_tooltip.c b/source/blender/windowmanager/intern/wm_tooltip.c index 4d64acefca4..a9f0e01cfb5 100644 --- a/source/blender/windowmanager/intern/wm_tooltip.c +++ b/source/blender/windowmanager/intern/wm_tooltip.c @@ -43,7 +43,7 @@ double WM_tooltip_time_closed(void) } void WM_tooltip_immediate_init( - bContext *C, wmWindow *win, ScrArea *sa, ARegion *region, wmTooltipInitFn init) + bContext *C, wmWindow *win, ScrArea *area, ARegion *region, wmTooltipInitFn init) { WM_tooltip_timer_clear(C, win); @@ -51,14 +51,14 @@ void WM_tooltip_immediate_init( if (screen->tool_tip == NULL) { screen->tool_tip = MEM_callocN(sizeof(*screen->tool_tip), __func__); } - screen->tool_tip->area_from = sa; + screen->tool_tip->area_from = area; screen->tool_tip->region_from = region; screen->tool_tip->init = init; WM_tooltip_init(C, win); } void WM_tooltip_timer_init_ex( - bContext *C, wmWindow *win, ScrArea *sa, ARegion *region, wmTooltipInitFn init, double delay) + bContext *C, wmWindow *win, ScrArea *area, ARegion *region, wmTooltipInitFn init, double delay) { WM_tooltip_timer_clear(C, win); @@ -67,16 +67,16 @@ void WM_tooltip_timer_init_ex( if (screen->tool_tip == NULL) { screen->tool_tip = MEM_callocN(sizeof(*screen->tool_tip), __func__); } - screen->tool_tip->area_from = sa; + screen->tool_tip->area_from = area; screen->tool_tip->region_from = region; screen->tool_tip->timer = WM_event_add_timer(wm, win, TIMER, delay); screen->tool_tip->init = init; } void WM_tooltip_timer_init( - bContext *C, wmWindow *win, ScrArea *sa, ARegion *region, wmTooltipInitFn init) + bContext *C, wmWindow *win, ScrArea *area, ARegion *region, wmTooltipInitFn init) { - WM_tooltip_timer_init_ex(C, win, sa, region, init, UI_TOOLTIP_DELAY); + WM_tooltip_timer_init_ex(C, win, area, region, init, UI_TOOLTIP_DELAY); } void WM_tooltip_timer_clear(bContext *C, wmWindow *win) diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index c29fd24d4cd..694b3176f50 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -854,7 +854,7 @@ wmWindow *WM_window_open_temp(bContext *C, wmWindow *win_prev = CTX_wm_window(C); wmWindow *win; bScreen *screen; - ScrArea *sa; + ScrArea *area; Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -932,10 +932,10 @@ wmWindow *WM_window_open_temp(bContext *C, */ /* ensure it shows the right spacetype editor */ - sa = screen->areabase.first; - CTX_wm_area_set(C, sa); + area = screen->areabase.first; + CTX_wm_area_set(C, area); - ED_area_newspace(C, sa, space_type, false); + ED_area_newspace(C, area, space_type, false); ED_screen_change(C, screen); ED_screen_refresh(wm, win); /* test scale */ |