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/editors | |
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/editors')
184 files changed, 2283 insertions, 2262 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index f47ed85f5bf..28f80994c4d 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -695,15 +695,15 @@ bool ANIM_remove_empty_action_from_animdata(struct AnimData *adt) /* poll callback for being in an Animation Editor channels list region */ static bool animedit_poll_channels_active(bContext *C) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); /* channels region test */ /* TODO: could enhance with actually testing if channels region? */ - if (ELEM(NULL, sa, CTX_wm_region(C))) { + if (ELEM(NULL, area, CTX_wm_region(C))) { return 0; } /* animation editor test */ - if (ELEM(sa->spacetype, SPACE_ACTION, SPACE_GRAPH, SPACE_NLA) == 0) { + if (ELEM(area->spacetype, SPACE_ACTION, SPACE_GRAPH, SPACE_NLA) == 0) { return 0; } @@ -713,21 +713,21 @@ static bool animedit_poll_channels_active(bContext *C) /* poll callback for Animation Editor channels list region + not in NLA-tweakmode for NLA */ static bool animedit_poll_channels_nla_tweakmode_off(bContext *C) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); Scene *scene = CTX_data_scene(C); /* channels region test */ /* TODO: could enhance with actually testing if channels region? */ - if (ELEM(NULL, sa, CTX_wm_region(C))) { + if (ELEM(NULL, area, CTX_wm_region(C))) { return 0; } /* animation editor test */ - if (ELEM(sa->spacetype, SPACE_ACTION, SPACE_GRAPH, SPACE_NLA) == 0) { + if (ELEM(area->spacetype, SPACE_ACTION, SPACE_GRAPH, SPACE_NLA) == 0) { return 0; } /* NLA TweakMode test */ - if (sa->spacetype == SPACE_NLA) { + if (area->spacetype == SPACE_NLA) { if ((scene == NULL) || (scene->flag & SCE_NLA_EDIT_ON)) { return 0; } @@ -1518,19 +1518,19 @@ static void ANIM_OT_channels_move(wmOperatorType *ot) static bool animchannels_grouping_poll(bContext *C) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); SpaceLink *sl; /* channels region test */ /* TODO: could enhance with actually testing if channels region? */ - if (ELEM(NULL, sa, CTX_wm_region(C))) { + if (ELEM(NULL, area, CTX_wm_region(C))) { return 0; } /* animation editor test - must be suitable modes only */ sl = CTX_wm_space_data(C); - switch (sa->spacetype) { + switch (area->spacetype) { /* supported... */ case SPACE_ACTION: { SpaceAction *saction = (SpaceAction *)sl; @@ -2353,16 +2353,16 @@ static void ANIM_OT_channels_clean_empty(wmOperatorType *ot) static bool animchannels_enable_poll(bContext *C) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); /* channels region test */ /* TODO: could enhance with actually testing if channels region? */ - if (ELEM(NULL, sa, CTX_wm_region(C))) { + if (ELEM(NULL, area, CTX_wm_region(C))) { return 0; } /* animation editor test - Action/Dopesheet/etc. and Graph only */ - if (ELEM(sa->spacetype, SPACE_ACTION, SPACE_GRAPH) == 0) { + if (ELEM(area->spacetype, SPACE_ACTION, SPACE_GRAPH) == 0) { return 0; } @@ -2431,14 +2431,14 @@ static void ANIM_OT_channels_fcurves_enable(wmOperatorType *ot) /* XXX: make this generic? */ static bool animchannels_find_poll(bContext *C) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); - if (sa == NULL) { + if (area == NULL) { return 0; } /* animation editor with dopesheet */ - return ELEM(sa->spacetype, SPACE_ACTION, SPACE_GRAPH, SPACE_NLA); + return ELEM(area->spacetype, SPACE_ACTION, SPACE_GRAPH, SPACE_NLA); } /* find_invoke() - Get initial channels */ diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index a09db0380e6..23c95f186d7 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -399,7 +399,7 @@ bool ANIM_animdata_context_getdata(bAnimContext *ac) bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac) { Main *bmain = CTX_data_main(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); SpaceLink *sl = CTX_wm_space_data(C); Scene *scene = CTX_data_scene(C); @@ -418,10 +418,10 @@ bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac) } ac->view_layer = CTX_data_view_layer(C); ac->obact = (ac->view_layer->basact) ? ac->view_layer->basact->object : NULL; - ac->sa = sa; + ac->area = area; ac->region = region; ac->sl = sl; - ac->spacetype = (sa) ? sa->spacetype : 0; + ac->spacetype = (area) ? area->spacetype : 0; ac->regiontype = (region) ? region->regiontype : 0; /* initialise default y-scale factor */ diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 27d38cf625a..93d2d99effb 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -74,12 +74,12 @@ /* ************* Marker API **************** */ /* helper function for getting the list of markers to work on */ -static ListBase *context_get_markers(Scene *scene, ScrArea *sa) +static ListBase *context_get_markers(Scene *scene, ScrArea *area) { /* local marker sets... */ - if (sa) { - if (sa->spacetype == SPACE_ACTION) { - SpaceAction *saction = (SpaceAction *)sa->spacedata.first; + if (area) { + if (area->spacetype == SPACE_ACTION) { + SpaceAction *saction = (SpaceAction *)area->spacedata.first; /* local markers can only be shown when there's only a single active action to grab them from * - flag only takes effect when there's an action, otherwise it can get too confusing? @@ -108,7 +108,7 @@ ListBase *ED_context_get_markers(const bContext *C) ListBase *ED_animcontext_get_markers(const bAnimContext *ac) { if (ac) { - return context_get_markers(ac->scene, ac->sa); + return context_get_markers(ac->scene, ac->area); } else { return NULL; @@ -234,35 +234,35 @@ void ED_markers_get_minmax(ListBase *markers, short sel, float *r_first, float * */ static bool ED_operator_markers_region_active(bContext *C) { - ScrArea *sa = CTX_wm_area(C); - if (sa == NULL) { + ScrArea *area = CTX_wm_area(C); + if (area == NULL) { return false; } - switch (sa->spacetype) { + switch (area->spacetype) { case SPACE_ACTION: { - SpaceAction *saction = sa->spacedata.first; + SpaceAction *saction = area->spacedata.first; if (saction->flag & SACTION_SHOW_MARKERS) { return true; } break; } case SPACE_GRAPH: { - SpaceGraph *sipo = sa->spacedata.first; + SpaceGraph *sipo = area->spacedata.first; if (sipo->mode != SIPO_MODE_DRIVERS && sipo->flag & SIPO_SHOW_MARKERS) { return true; } break; } case SPACE_NLA: { - SpaceNla *snla = sa->spacedata.first; + SpaceNla *snla = area->spacedata.first; if (snla->flag & SNLA_SHOW_MARKERS) { return true; } break; } case SPACE_SEQ: { - SpaceSeq *seq = sa->spacedata.first; + SpaceSeq *seq = area->spacedata.first; if (seq->flag & SEQ_SHOW_MARKERS) { return true; } diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 6b0d11802f4..7689d121a0c 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -61,7 +61,7 @@ /* Check if the operator can be run from the current context */ static bool change_frame_poll(bContext *C) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); /* XXX temp? prevent changes during render */ if (G.is_rendering) { @@ -71,11 +71,11 @@ static bool change_frame_poll(bContext *C) /* although it's only included in keymaps for regions using ED_KEYMAP_ANIMATION, * this shouldn't show up in 3D editor (or others without 2D timeline view) via search */ - if (sa) { - if (ELEM(sa->spacetype, SPACE_ACTION, SPACE_NLA, SPACE_SEQ, SPACE_CLIP)) { + if (area) { + if (ELEM(area->spacetype, SPACE_ACTION, SPACE_NLA, SPACE_SEQ, SPACE_CLIP)) { return true; } - else if (sa->spacetype == SPACE_GRAPH) { + else if (area->spacetype == SPACE_GRAPH) { /* NOTE: Graph Editor has special version which does some extra stuff. * No need to show the generic error message for that case though! */ @@ -151,10 +151,10 @@ static float frame_from_event(bContext *C, const wmEvent *event) static void change_frame_seq_preview_begin(bContext *C, const wmEvent *event) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); bScreen *screen = CTX_wm_screen(C); - if (sa && sa->spacetype == SPACE_SEQ) { - SpaceSeq *sseq = sa->spacedata.first; + if (area && area->spacetype == SPACE_SEQ) { + SpaceSeq *sseq = area->spacedata.first; if (ED_space_sequencer_check_show_strip(sseq)) { ED_sequencer_special_preview_set(C, event->mval); } @@ -282,7 +282,7 @@ static void ANIM_OT_change_frame(wmOperatorType *ot) static bool anim_set_end_frames_poll(bContext *C) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); /* XXX temp? prevent changes during render */ if (G.is_rendering) { @@ -292,8 +292,8 @@ static bool anim_set_end_frames_poll(bContext *C) /* although it's only included in keymaps for regions using ED_KEYMAP_ANIMATION, * this shouldn't show up in 3D editor (or others without 2D timeline view) via search */ - if (sa) { - if (ELEM(sa->spacetype, SPACE_ACTION, SPACE_GRAPH, SPACE_NLA, SPACE_SEQ, SPACE_CLIP)) { + if (area) { + if (ELEM(area->spacetype, SPACE_ACTION, SPACE_GRAPH, SPACE_NLA, SPACE_SEQ, SPACE_CLIP)) { return true; } } diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index c22f1e0642b..4c3a2a36e0a 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1793,11 +1793,11 @@ enum { */ static bool modify_key_op_poll(bContext *C) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); Scene *scene = CTX_data_scene(C); /* if no area or active scene */ - if (ELEM(NULL, sa, scene)) { + if (ELEM(NULL, area, scene)) { return false; } diff --git a/source/blender/editors/armature/armature_naming.c b/source/blender/editors/armature/armature_naming.c index d36e6100bcf..b2c3d951b34 100644 --- a/source/blender/editors/armature/armature_naming.c +++ b/source/blender/editors/armature/armature_naming.c @@ -362,11 +362,11 @@ void ED_armature_bone_rename(Main *bmain, { bScreen *screen; for (screen = bmain->screens.first; screen; screen = screen->id.next) { - ScrArea *sa; + ScrArea *area; /* add regions */ - for (sa = screen->areabase.first; sa; sa = sa->next) { + for (area = screen->areabase.first; area; area = area->next) { SpaceLink *sl; - for (sl = sa->spacedata.first; sl; sl = sl->next) { + for (sl = area->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { View3D *v3d = (View3D *)sl; if (v3d->ob_center && v3d->ob_center->data == arm) { diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c index 5c75e8f6187..b86da6374be 100644 --- a/source/blender/editors/armature/pose_edit.c +++ b/source/blender/editors/armature/pose_edit.c @@ -75,12 +75,12 @@ /* matches logic with ED_operator_posemode_context() */ Object *ED_pose_object_from_context(bContext *C) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); Object *ob; /* Since this call may also be used from the buttons window, * we need to check for where to get the object. */ - if (sa && sa->spacetype == SPACE_PROPERTIES) { + if (area && area->spacetype == SPACE_PROPERTIES) { ob = ED_object_context(C); } else { diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c index 455e7cb2733..aa57fb5844d 100644 --- a/source/blender/editors/armature/pose_lib.c +++ b/source/blender/editors/armature/pose_lib.c @@ -161,16 +161,16 @@ static TimeMarker *poselib_get_active_pose(bAction *act) /* XXX C can be zero */ static Object *get_poselib_object(bContext *C) { - ScrArea *sa; + ScrArea *area; /* sanity check */ if (C == NULL) { return NULL; } - sa = CTX_wm_area(C); + area = CTX_wm_area(C); - if (sa && (sa->spacetype == SPACE_PROPERTIES)) { + if (area && (area->spacetype == SPACE_PROPERTIES)) { return ED_object_context(C); } else { @@ -870,7 +870,7 @@ typedef struct tPoseLib_PreviewData { /** active scene. */ Scene *scene; /** active area. */ - ScrArea *sa; + ScrArea *area; /** RNA-Pointer to Object 'ob' .*/ PointerRNA rna_ptr; @@ -1171,7 +1171,7 @@ static void poselib_preview_apply(bContext *C, wmOperator *op) /* do header print - if interactively previewing */ if (pld->state == PL_PREVIEW_RUNNING) { if (pld->flag & PL_PREVIEW_SHOWORIGINAL) { - ED_area_status_text(pld->sa, TIP_("PoseLib Previewing Pose: [Showing Original Pose]")); + ED_area_status_text(pld->area, TIP_("PoseLib Previewing Pose: [Showing Original Pose]")); ED_workspace_status_text(C, TIP_("Use Tab to start previewing poses again")); } else if (pld->searchstr[0]) { @@ -1200,7 +1200,7 @@ static void poselib_preview_apply(bContext *C, wmOperator *op) "Current Pose - \"%s\""), tempstr, markern); - ED_area_status_text(pld->sa, pld->headerstr); + ED_area_status_text(pld->area, pld->headerstr); ED_workspace_status_text(C, TIP_("Use ScrollWheel or PageUp/Down to change pose")); } else { @@ -1208,7 +1208,7 @@ static void poselib_preview_apply(bContext *C, wmOperator *op) sizeof(pld->headerstr), TIP_("PoseLib Previewing Pose: \"%s\""), pld->marker->name); - ED_area_status_text(pld->sa, pld->headerstr); + ED_area_status_text(pld->area, pld->headerstr); ED_workspace_status_text(C, NULL); } } @@ -1631,7 +1631,7 @@ static void poselib_preview_init_data(bContext *C, wmOperator *op) pld->act = (ob) ? (ob->poselib) : NULL; pld->scene = CTX_data_scene(C); - pld->sa = CTX_wm_area(C); + pld->area = CTX_wm_area(C); /* get starting pose based on RNA-props for this operator */ if (pose_index == -1) { @@ -1702,7 +1702,7 @@ static void poselib_preview_cleanup(bContext *C, wmOperator *op) TimeMarker *marker = pld->marker; /* redraw the header so that it doesn't show any of our stuff anymore */ - ED_area_status_text(pld->sa, NULL); + ED_area_status_text(pld->area, NULL); ED_workspace_status_text(C, NULL); /* this signal does one recalc on pose, then unlocks, so ESC or edit will work */ diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c index 336d09f71b5..ae08aee3c47 100644 --- a/source/blender/editors/armature/pose_slide.c +++ b/source/blender/editors/armature/pose_slide.c @@ -86,7 +86,7 @@ typedef struct tPoseSlideOp { /** current scene */ Scene *scene; /** area that we're operating in (needed for modal()) */ - ScrArea *sa; + ScrArea *area; /** region that we're operating in (needed for modal()) */ ARegion *region; /** len of the PoseSlideObject array. */ @@ -197,7 +197,7 @@ static int pose_slide_init(bContext *C, wmOperator *op, ePoseSlide_Modes mode) /* get info from context */ pso->scene = CTX_data_scene(C); - pso->sa = CTX_wm_area(C); /* only really needed when doing modal() */ + pso->area = CTX_wm_area(C); /* only really needed when doing modal() */ pso->region = CTX_wm_region(C); /* only really needed when doing modal() */ pso->cframe = pso->scene->r.cfra; @@ -904,7 +904,7 @@ static void pose_slide_draw_status(tPoseSlideOp *pso) limits_str); } - ED_area_status_text(pso->sa, status_str); + ED_area_status_text(pso->area, status_str); } /* common code for invoke() methods */ @@ -1071,7 +1071,7 @@ static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event) case EVT_PADENTER: { if (event->val == KM_PRESS) { /* return to normal cursor and header status */ - ED_area_status_text(pso->sa, NULL); + ED_area_status_text(pso->area, NULL); WM_cursor_modal_restore(win); /* insert keyframes as required... */ @@ -1088,7 +1088,7 @@ static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event) case RIGHTMOUSE: { if (event->val == KM_PRESS) { /* return to normal cursor and header status */ - ED_area_status_text(pso->sa, NULL); + ED_area_status_text(pso->area, NULL); WM_cursor_modal_restore(win); /* reset transforms back to original state */ diff --git a/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c index 4049a3b9dcb..39e0712a511 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c @@ -372,9 +372,9 @@ static int gizmo_move_invoke(bContext *C, wmGizmo *gz, const wmEvent *event) WM_gizmo_calc_matrix_final(gz, inter->init.matrix_final); if (use_snap) { - ScrArea *sa = CTX_wm_area(C); - if (sa) { - switch (sa->spacetype) { + ScrArea *area = CTX_wm_area(C); + if (area) { + switch (area->spacetype) { case SPACE_VIEW3D: { inter->snap_context_v3d = ED_transform_snap_object_context_create_view3d( CTX_data_main(C), CTX_data_scene(C), 0, CTX_wm_region(C), CTX_wm_view3d(C)); diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c index 3e2c3b17241..26ba2661072 100644 --- a/source/blender/editors/gpencil/annotate_draw.c +++ b/source/blender/editors/gpencil/annotate_draw.c @@ -1013,7 +1013,7 @@ static void annotation_draw_data_all(Scene *scene, void ED_annotation_draw_2dimage(const bContext *C) { wmWindowManager *wm = CTX_wm_manager(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); Scene *scene = CTX_data_scene(C); @@ -1026,7 +1026,7 @@ void ED_annotation_draw_2dimage(const bContext *C) } /* calculate rect */ - switch (sa->spacetype) { + switch (area->spacetype) { case SPACE_IMAGE: /* image */ case SPACE_CLIP: /* clip */ { @@ -1075,7 +1075,7 @@ void ED_annotation_draw_2dimage(const bContext *C) } /* draw it! */ - annotation_draw_data_all(scene, gpd, offsx, offsy, sizex, sizey, CFRA, dflag, sa->spacetype); + annotation_draw_data_all(scene, gpd, offsx, offsy, sizex, sizey, CFRA, dflag, area->spacetype); } /** @@ -1088,13 +1088,13 @@ void ED_annotation_draw_2dimage(const bContext *C) void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d) { wmWindowManager *wm = CTX_wm_manager(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); Scene *scene = CTX_data_scene(C); int dflag = 0; /* check that we have grease-pencil stuff to draw */ - if (sa == NULL) { + if (area == NULL) { return; } bGPdata *gpd = ED_annotation_data_get_active(C); @@ -1105,7 +1105,7 @@ void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d) /* special hack for Image Editor */ /* FIXME: the opengl poly-strokes don't draw at right thickness when done this way, * so disabled. */ - if (ELEM(sa->spacetype, SPACE_IMAGE, SPACE_CLIP)) { + if (ELEM(area->spacetype, SPACE_IMAGE, SPACE_CLIP)) { dflag |= GP_DRAWDATA_IEDITHACK; } @@ -1118,7 +1118,7 @@ void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d) } annotation_draw_data_all( - scene, gpd, 0, 0, region->winx, region->winy, CFRA, dflag, sa->spacetype); + scene, gpd, 0, 0, region->winx, region->winy, CFRA, dflag, area->spacetype); /* draw status text (if in screen/pixel-space) */ if (!onlyv2d) { diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c index 53ada341cc9..cd4e161200d 100644 --- a/source/blender/editors/gpencil/annotate_paint.c +++ b/source/blender/editors/gpencil/annotate_paint.c @@ -114,7 +114,7 @@ typedef struct tGPsdata { /** window where painting originated. */ wmWindow *win; /** area where painting originated. */ - ScrArea *sa; + ScrArea *area; /** region where painting originated. */ ARegion *region; /** needed for GP_STROKE_2DSPACE. */ @@ -521,7 +521,7 @@ static short gp_stroke_addpoint(tGPsdata *p, const float mval[2], float pressure * so initialize depth buffer before converting coordinates */ if (gpencil_project_check(p)) { - View3D *v3d = p->sa->spacedata.first; + View3D *v3d = p->area->spacedata.first; view3d_region_operator_needs_opengl(p->win, p->region); ED_view3d_autodist_init(p->depsgraph, @@ -793,7 +793,7 @@ static bool gp_stroke_eraser_is_occluded(tGPsdata *p, const int x, const int y) { - if ((p->sa->spacetype == SPACE_VIEW3D) && (p->flags & GP_PAINTFLAG_V3D_ERASER_DEPTH)) { + if ((p->area->spacetype == SPACE_VIEW3D) && (p->flags & GP_PAINTFLAG_V3D_ERASER_DEPTH)) { RegionView3D *rv3d = p->region->regiondata; const int mval_i[2] = {x, y}; float mval_3d[3]; @@ -920,9 +920,9 @@ static void gp_stroke_doeraser(tGPsdata *p) rect.xmax = p->mval[0] + p->radius; rect.ymax = p->mval[1] + p->radius; - if (p->sa->spacetype == SPACE_VIEW3D) { + if (p->area->spacetype == SPACE_VIEW3D) { if (p->flags & GP_PAINTFLAG_V3D_ERASER_DEPTH) { - View3D *v3d = p->sa->spacedata.first; + View3D *v3d = p->area->spacedata.first; view3d_region_operator_needs_opengl(p->win, p->region); ED_view3d_autodist_init(p->depsgraph, p->region, v3d, 0); } @@ -936,7 +936,7 @@ static void gp_stroke_doeraser(tGPsdata *p) /* Not all strokes in the datablock may be valid in the current editor/context * (e.g. 2D space strokes in the 3D view, if the same datablock is shared) */ - if (ED_gpencil_stroke_can_use_direct(p->sa, gps)) { + if (ED_gpencil_stroke_can_use_direct(p->area, gps)) { gp_stroke_eraser_dostroke(p, gpf, gps, p->mval, p->radius, &rect); } } @@ -997,7 +997,7 @@ static bool gp_session_initdata(bContext *C, tGPsdata *p) * - must verify that region data is 3D-view (and not something else) */ /* CAUTION: If this is the "toolbar", then this will change on the first stroke */ - p->sa = curarea; + p->area = curarea; p->region = region; p->align_flag = &ts->annotate_v3d_align; @@ -1016,7 +1016,7 @@ static bool gp_session_initdata(bContext *C, tGPsdata *p) /* SpaceNode *snode = curarea->spacedata.first; */ /* set current area */ - p->sa = curarea; + p->area = curarea; p->region = region; p->v2d = ®ion->v2d; p->align_flag = &ts->gpencil_v2d_align; @@ -1026,7 +1026,7 @@ static bool gp_session_initdata(bContext *C, tGPsdata *p) SpaceSeq *sseq = curarea->spacedata.first; /* set current area */ - p->sa = curarea; + p->area = curarea; p->region = region; p->v2d = ®ion->v2d; p->align_flag = &ts->gpencil_seq_align; @@ -1045,7 +1045,7 @@ static bool gp_session_initdata(bContext *C, tGPsdata *p) /* SpaceImage *sima = curarea->spacedata.first; */ /* set the current area */ - p->sa = curarea; + p->area = curarea; p->region = region; p->v2d = ®ion->v2d; p->align_flag = &ts->gpencil_ima_align; @@ -1061,7 +1061,7 @@ static bool gp_session_initdata(bContext *C, tGPsdata *p) } /* set the current area */ - p->sa = curarea; + p->area = curarea; p->region = region; p->v2d = ®ion->v2d; p->align_flag = &ts->gpencil_v2d_align; @@ -1279,7 +1279,7 @@ static void gp_paint_initstroke(tGPsdata *p, eGPencil_PaintModes paintmode, Deps p->gpd->runtime.sbuffer_sflag |= GP_STROKE_ERASER; /* check if we should respect depth while erasing */ - if (p->sa->spacetype == SPACE_VIEW3D) { + if (p->area->spacetype == SPACE_VIEW3D) { if (p->gpl->flag & GP_LAYER_NO_XRAY) { p->flags |= GP_PAINTFLAG_V3D_ERASER_DEPTH; } @@ -1289,7 +1289,7 @@ static void gp_paint_initstroke(tGPsdata *p, eGPencil_PaintModes paintmode, Deps /* disable eraser flags - so that we can switch modes during a session */ p->gpd->runtime.sbuffer_sflag &= ~GP_STROKE_ERASER; - if (p->sa->spacetype == SPACE_VIEW3D) { + if (p->area->spacetype == SPACE_VIEW3D) { if (p->gpl->flag & GP_LAYER_NO_XRAY) { p->flags &= ~GP_PAINTFLAG_V3D_ERASER_DEPTH; } @@ -1302,8 +1302,8 @@ static void gp_paint_initstroke(tGPsdata *p, eGPencil_PaintModes paintmode, Deps /* when drawing in the camera view, in 2D space, set the subrect */ p->subrect = NULL; if ((*p->align_flag & GP_PROJECT_VIEWSPACE) == 0) { - if (p->sa->spacetype == SPACE_VIEW3D) { - View3D *v3d = p->sa->spacedata.first; + if (p->area->spacetype == SPACE_VIEW3D) { + View3D *v3d = p->area->spacedata.first; RegionView3D *rv3d = p->region->regiondata; /* for camera view set the subrect */ @@ -1320,7 +1320,7 @@ static void gp_paint_initstroke(tGPsdata *p, eGPencil_PaintModes paintmode, Deps p->gsc.gpd = p->gpd; p->gsc.gpl = p->gpl; - p->gsc.sa = p->sa; + p->gsc.area = p->area; p->gsc.region = p->region; p->gsc.v2d = p->v2d; @@ -1331,7 +1331,7 @@ static void gp_paint_initstroke(tGPsdata *p, eGPencil_PaintModes paintmode, Deps /* check if points will need to be made in view-aligned space */ if (*p->align_flag & GP_PROJECT_VIEWSPACE) { - switch (p->sa->spacetype) { + switch (p->area->spacetype) { case SPACE_VIEW3D: { p->gpd->runtime.sbuffer_sflag |= GP_STROKE_3DSPACE; break; @@ -1355,7 +1355,7 @@ static void gp_paint_strokeend(tGPsdata *p) * the conversions will project the values correctly... */ if (gpencil_project_check(p)) { - View3D *v3d = p->sa->spacedata.first; + View3D *v3d = p->area->spacedata.first; /* need to restore the original projection settings before packing up */ view3d_region_operator_needs_opengl(p->win, p->region); @@ -1931,10 +1931,10 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event } /* gpencil modal operator stores area, which can be removed while using it (like fullscreen) */ -static bool gpencil_area_exists(bContext *C, ScrArea *sa_test) +static bool gpencil_area_exists(bContext *C, ScrArea *area_test) { bScreen *sc = CTX_wm_screen(C); - return (BLI_findindex(&sc->areabase, sa_test) != -1); + return (BLI_findindex(&sc->areabase, area_test) != -1); } static tGPsdata *gpencil_stroke_begin(bContext *C, wmOperator *op) @@ -1944,7 +1944,7 @@ static tGPsdata *gpencil_stroke_begin(bContext *C, wmOperator *op) /* we must check that we're still within the area that we're set up to work from * otherwise we could crash (see bug #20586) */ - if (CTX_wm_area(C) != p->sa) { + if (CTX_wm_area(C) != p->area) { printf("\t\t\tGP - wrong area execution abort!\n"); p->status = GP_STATUS_ERROR; } @@ -2168,18 +2168,19 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) */ if ((p->region) && (p->region->regiontype == RGN_TYPE_TOOLS)) { /* Change to whatever region is now under the mouse */ - ARegion *current_region = BKE_area_find_region_xy(p->sa, RGN_TYPE_ANY, event->x, event->y); + ARegion *current_region = BKE_area_find_region_xy( + p->area, RGN_TYPE_ANY, event->x, event->y); if (G.debug & G_DEBUG) { - printf("found alternative region %p (old was %p) - at %d %d (sa: %d %d -> %d %d)\n", + printf("found alternative region %p (old was %p) - at %d %d (area: %d %d -> %d %d)\n", current_region, p->region, event->x, event->y, - p->sa->totrct.xmin, - p->sa->totrct.ymin, - p->sa->totrct.xmax, - p->sa->totrct.ymax); + p->area->totrct.xmin, + p->area->totrct.ymin, + p->area->totrct.xmax, + p->area->totrct.ymax); } if (current_region) { @@ -2314,7 +2315,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) } /* gpencil modal operator stores area, which can be removed while using it (like fullscreen) */ - if (0 == gpencil_area_exists(C, p->sa)) { + if (0 == gpencil_area_exists(C, p->area)) { estate = OPERATOR_CANCELLED; } else { diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c index 8470fcad9d7..28e632d2b82 100644 --- a/source/blender/editors/gpencil/gpencil_convert.c +++ b/source/blender/editors/gpencil/gpencil_convert.c @@ -1465,12 +1465,12 @@ static bool gp_convert_poll(bContext *C) bGPdata *gpd = (bGPdata *)ob->data; bGPDlayer *gpl = NULL; bGPDframe *gpf = NULL; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); /* only if the current view is 3D View, if there's valid data (i.e. at least one stroke!), * and if we are not in edit mode! */ - return ((sa && sa->spacetype == SPACE_VIEW3D) && (gpl = BKE_gpencil_layer_active_get(gpd)) && + return ((area && area->spacetype == SPACE_VIEW3D) && (gpl = BKE_gpencil_layer_active_get(gpd)) && (gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_USE_PREV)) && (gpf->strokes.first) && (!GPENCIL_ANY_EDIT_MODE(gpd))); } diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index a12f960c29e..1c93eed1cd6 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -240,10 +240,10 @@ static int gp_layer_add_exec(bContext *C, wmOperator *op) if ((ob != NULL) && (ob->type == OB_GPENCIL)) { gpd = (bGPdata *)ob->data; bGPDlayer *gpl = BKE_gpencil_layer_addnew(gpd, DATA_("GP_Layer"), true); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); /* In dopesheet add a new frame. */ - if ((gpl != NULL) && (sa->spacetype == SPACE_ACTION)) { + if ((gpl != NULL) && (area->spacetype == SPACE_ACTION)) { gpl->actframe = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_ADD_NEW); } } diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 8c31df02a11..14fd54bf287 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -1379,8 +1379,8 @@ void GPENCIL_OT_copy(wmOperatorType *ot) static bool gp_strokes_paste_poll(bContext *C) { - ScrArea *sa = CTX_wm_area(C); - if (!((sa != NULL) && (sa->spacetype == SPACE_VIEW3D))) { + ScrArea *area = CTX_wm_area(C); + if (!((area != NULL) && (area->spacetype == SPACE_VIEW3D))) { return false; } /* 1) Must have GP datablock to paste to @@ -2606,11 +2606,11 @@ void GPENCIL_OT_dissolve(wmOperatorType *ot) */ static bool gp_snap_poll(bContext *C) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); Object *ob = CTX_data_active_object(C); return (ob != NULL) && (ob->type == OB_GPENCIL) && - ((sa != NULL) && (sa->spacetype == SPACE_VIEW3D)); + ((area != NULL) && (area->spacetype == SPACE_VIEW3D)); } /* --------------------------------- */ @@ -3240,9 +3240,9 @@ static void gpencil_stroke_join_strokes(bGPDstroke *gps_a, } /* define start and end points of each stroke */ - float sa[3], sb[3], ea[3], eb[3]; + float area[3], sb[3], ea[3], eb[3]; pt = &gps_a->points[0]; - copy_v3_v3(sa, &pt->x); + copy_v3_v3(area, &pt->x); pt = &gps_a->points[gps_a->totpoints - 1]; copy_v3_v3(ea, &pt->x); @@ -4625,7 +4625,7 @@ static int gpencil_cutter_lasso_select(bContext *C, void *user_data) { bGPdata *gpd = ED_gpencil_data_get_active(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ToolSettings *ts = CTX_data_tool_settings(C); const float scale = ts->gp_sculpt.isect_threshold; @@ -4636,7 +4636,7 @@ static int gpencil_cutter_lasso_select(bContext *C, bool changed = false; /* sanity checks */ - if (sa == NULL) { + if (area == NULL) { BKE_report(op->reports, RPT_ERROR, "No active area"); return OPERATOR_CANCELLED; } @@ -4732,9 +4732,9 @@ static bool gpencil_cutter_poll(bContext *C) static int gpencil_cutter_exec(bContext *C, wmOperator *op) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); /* sanity checks */ - if (sa == NULL) { + if (area == NULL) { BKE_report(op->reports, RPT_ERROR, "No active area"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c index e56017d0bed..a3f6e10ccb0 100644 --- a/source/blender/editors/gpencil/gpencil_fill.c +++ b/source/blender/editors/gpencil/gpencil_fill.c @@ -92,7 +92,7 @@ typedef struct tGPDfill { /** current active gp object */ struct Object *ob; /** area where painting originated */ - struct ScrArea *sa; + struct ScrArea *area; /** region where painting originated */ struct RegionView3D *rv3d; /** view3 where painting originated */ @@ -1248,8 +1248,8 @@ static bool gpencil_fill_poll(bContext *C) Object *obact = CTX_data_active_object(C); if (ED_operator_regionactive(C)) { - ScrArea *sa = CTX_wm_area(C); - if (sa->spacetype == SPACE_VIEW3D) { + ScrArea *area = CTX_wm_area(C); + if (area->spacetype == SPACE_VIEW3D) { if ((obact == NULL) || (obact->type != OB_GPENCIL) || (obact->mode != OB_MODE_PAINT_GPENCIL)) { return false; @@ -1283,10 +1283,10 @@ static tGPDfill *gp_session_init_fill(bContext *C, wmOperator *UNUSED(op)) tgpf->bmain = CTX_data_main(C); tgpf->scene = CTX_data_scene(C); tgpf->ob = CTX_data_active_object(C); - tgpf->sa = CTX_wm_area(C); + tgpf->area = CTX_wm_area(C); tgpf->region = CTX_wm_region(C); tgpf->rv3d = tgpf->region->regiondata; - tgpf->v3d = tgpf->sa->spacedata.first; + tgpf->v3d = tgpf->area->spacedata.first; tgpf->depsgraph = CTX_data_ensure_evaluated_depsgraph(C); tgpf->win = CTX_wm_window(C); diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h index 61bca235d17..c5e5a0b79ef 100644 --- a/source/blender/editors/gpencil/gpencil_intern.h +++ b/source/blender/editors/gpencil/gpencil_intern.h @@ -116,7 +116,7 @@ typedef struct tGPDinterpolate { /** current scene from context */ struct Scene *scene; /** area where painting originated */ - struct ScrArea *sa; + struct ScrArea *area; /** region where painting originated */ struct ARegion *region; /** current GP datablock */ @@ -156,7 +156,7 @@ typedef struct tGPDprimitive { /** current evaluated gp object */ struct Object *ob_eval; /** area where painting originated */ - struct ScrArea *sa; + struct ScrArea *area; /** region where painting originated */ struct RegionView3D *rv3d; /** view3d where painting originated */ @@ -247,7 +247,7 @@ typedef struct GP_SpaceConversion { struct bGPdata *gpd; struct bGPDlayer *gpl; - struct ScrArea *sa; + struct ScrArea *area; struct ARegion *region; struct View2D *v2d; diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c index fef88007542..e6661e886b1 100644 --- a/source/blender/editors/gpencil/gpencil_interpolate.c +++ b/source/blender/editors/gpencil/gpencil_interpolate.c @@ -86,8 +86,8 @@ static bool gpencil_view3d_poll(bContext *C) bGPDlayer *gpl = CTX_data_active_gpencil_layer(C); /* only 3D view */ - ScrArea *sa = CTX_wm_area(C); - if (sa && sa->spacetype != SPACE_VIEW3D) { + ScrArea *area = CTX_wm_area(C); + if (area && area->spacetype != SPACE_VIEW3D) { return 0; } @@ -383,7 +383,7 @@ static void gpencil_interpolate_status_indicators(bContext *C, tGPDinterpolate * (int)((p->init_factor + p->shift) * 100.0f)); } - ED_area_status_text(p->sa, status_str); + ED_area_status_text(p->area, status_str); ED_workspace_status_text( C, TIP_("ESC/RMB to cancel, Enter/LMB to confirm, WHEEL/MOVE to adjust factor")); } @@ -410,7 +410,7 @@ static void gpencil_interpolate_exit(bContext *C, wmOperator *op) /* don't assume that operator data exists at all */ if (tgpi) { /* clear status message area */ - ED_area_status_text(tgpi->sa, NULL); + ED_area_status_text(tgpi->area, NULL); ED_workspace_status_text(C, NULL); /* Clear any temp stroke. */ @@ -445,7 +445,7 @@ static bool gp_interpolate_set_init_values(bContext *C, wmOperator *op, tGPDinte /* set current scene and window */ tgpi->depsgraph = CTX_data_ensure_evaluated_depsgraph(C); tgpi->scene = CTX_data_scene(C); - tgpi->sa = CTX_wm_area(C); + tgpi->area = CTX_wm_area(C); tgpi->region = CTX_wm_region(C); tgpi->flag = ts->gp_interpolate.flag; @@ -567,7 +567,7 @@ static int gpencil_interpolate_modal(bContext *C, wmOperator *op, const wmEvent case EVT_PADENTER: case EVT_RETKEY: { /* return to normal cursor and header status */ - ED_area_status_text(tgpi->sa, NULL); + ED_area_status_text(tgpi->area, NULL); ED_workspace_status_text(C, NULL); WM_cursor_modal_restore(win); @@ -602,7 +602,7 @@ static int gpencil_interpolate_modal(bContext *C, wmOperator *op, const wmEvent case EVT_ESCKEY: /* cancel */ case RIGHTMOUSE: { /* return to normal cursor and header status */ - ED_area_status_text(tgpi->sa, NULL); + ED_area_status_text(tgpi->area, NULL); ED_workspace_status_text(C, NULL); WM_cursor_modal_restore(win); diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c index 8b126912efc..0171a81f5eb 100644 --- a/source/blender/editors/gpencil/gpencil_ops.c +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -178,10 +178,10 @@ static bool gp_stroke_sculptmode_poll(bContext *C) { bGPdata *gpd = CTX_data_gpencil_data(C); Object *ob = CTX_data_active_object(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); /* if not gpencil object and not view3d, need sculpt keys if edit mode */ - if (sa->spacetype != SPACE_VIEW3D) { + if (area->spacetype != SPACE_VIEW3D) { return ((gpd) && (gpd->flag & GP_DATA_STROKE_EDITMODE)); } else { diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 1a169f9ec89..7f0d1029722 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -156,7 +156,7 @@ typedef struct tGPsdata { /** window where painting originated. */ wmWindow *win; /** area where painting originated. */ - ScrArea *sa; + ScrArea *area; /** region where painting originated. */ ARegion *region; /** needed for GP_STROKE_2DSPACE. */ @@ -297,9 +297,9 @@ static void gp_session_validatebuffer(tGPsdata *p); static bool gpencil_draw_poll(bContext *C) { if (ED_operator_regionactive(C)) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); /* 3D Viewport */ - if (sa->spacetype != SPACE_VIEW3D) { + if (area->spacetype != SPACE_VIEW3D) { return false; } @@ -812,7 +812,7 @@ static short gp_stroke_addpoint(tGPsdata *p, const float mval[2], float pressure pt->time = (float)(curtime - p->inittime); /* point uv (only 3d view) */ - if ((p->sa->spacetype == SPACE_VIEW3D) && (gpd->runtime.sbuffer_used > 0)) { + if ((p->area->spacetype == SPACE_VIEW3D) && (gpd->runtime.sbuffer_used > 0)) { tGPspoint *ptb = (tGPspoint *)gpd->runtime.sbuffer + gpd->runtime.sbuffer_used - 1; bGPDspoint spt, spt2; @@ -1242,7 +1242,7 @@ static bool gp_stroke_eraser_is_occluded(tGPsdata *p, gp_settings = eraser->gpencil_settings; } - if ((gp_settings != NULL) && (p->sa->spacetype == SPACE_VIEW3D) && + if ((gp_settings != NULL) && (p->area->spacetype == SPACE_VIEW3D) && (gp_settings->flag & GP_BRUSH_OCCLUDE_ERASER)) { RegionView3D *rv3d = p->region->regiondata; bGPDlayer *gpl = p->gpl; @@ -1593,9 +1593,9 @@ static void gp_stroke_doeraser(tGPsdata *p) rect.xmax = p->mval[0] + calc_radius; rect.ymax = p->mval[1] + calc_radius; - if (p->sa->spacetype == SPACE_VIEW3D) { + if (p->area->spacetype == SPACE_VIEW3D) { if ((gp_settings != NULL) && (gp_settings->flag & GP_BRUSH_OCCLUDE_ERASER)) { - View3D *v3d = p->sa->spacedata.first; + View3D *v3d = p->area->spacedata.first; view3d_region_operator_needs_opengl(p->win, p->region); ED_view3d_autodist_init(p->depsgraph, p->region, v3d, 0); } @@ -1633,7 +1633,7 @@ static void gp_stroke_doeraser(tGPsdata *p) /* Not all strokes in the datablock may be valid in the current editor/context * (e.g. 2D space strokes in the 3D view, if the same datablock is shared) */ - if (ED_gpencil_stroke_can_use_direct(p->sa, gps)) { + if (ED_gpencil_stroke_can_use_direct(p->area, gps)) { gp_stroke_eraser_dostroke(p, gpf, gps, p->mval, calc_radius, &rect); } } @@ -1816,7 +1816,7 @@ static bool gp_session_initdata(bContext *C, wmOperator *op, tGPsdata *p) * - must verify that region data is 3D-view (and not something else) */ /* CAUTION: If this is the "toolbar", then this will change on the first stroke */ - p->sa = curarea; + p->area = curarea; p->region = region; p->align_flag = &ts->gpencil_v3d_align; @@ -1831,7 +1831,7 @@ static bool gp_session_initdata(bContext *C, wmOperator *op, tGPsdata *p) } if ((!obact) || (obact->type != OB_GPENCIL)) { - View3D *v3d = p->sa->spacedata.first; + View3D *v3d = p->area->spacedata.first; /* if active object doesn't exist or isn't a GP Object, create one */ const float *cur = p->scene->cursor.location; @@ -2058,8 +2058,8 @@ static void gp_paint_initstroke(tGPsdata *p, eGPencil_PaintModes paintmode, Deps /* when drawing in the camera view, in 2D space, set the subrect */ p->subrect = NULL; if ((*p->align_flag & GP_PROJECT_VIEWSPACE) == 0) { - if (p->sa->spacetype == SPACE_VIEW3D) { - View3D *v3d = p->sa->spacedata.first; + if (p->area->spacetype == SPACE_VIEW3D) { + View3D *v3d = p->area->spacedata.first; RegionView3D *rv3d = p->region->regiondata; /* for camera view set the subrect */ @@ -2076,7 +2076,7 @@ static void gp_paint_initstroke(tGPsdata *p, eGPencil_PaintModes paintmode, Deps p->gsc.gpd = p->gpd; p->gsc.gpl = p->gpl; - p->gsc.sa = p->sa; + p->gsc.area = p->area; p->gsc.region = p->region; p->gsc.v2d = p->v2d; @@ -2087,7 +2087,7 @@ static void gp_paint_initstroke(tGPsdata *p, eGPencil_PaintModes paintmode, Deps /* check if points will need to be made in view-aligned space */ if (*p->align_flag & GP_PROJECT_VIEWSPACE) { - switch (p->sa->spacetype) { + switch (p->area->spacetype) { case SPACE_VIEW3D: { p->gpd->runtime.sbuffer_sflag |= GP_STROKE_3DSPACE; break; @@ -2112,7 +2112,7 @@ static void gp_paint_strokeend(tGPsdata *p) * the conversions will project the values correctly... */ if (gpencil_project_check(p)) { - View3D *v3d = p->sa->spacedata.first; + View3D *v3d = p->area->spacedata.first; /* need to restore the original projection settings before packing up */ view3d_region_operator_needs_opengl(p->win, p->region); @@ -2243,7 +2243,7 @@ static void gpencil_draw_exit(bContext *C, wmOperator *op) } /* restore cursor to indicate end of drawing */ - if (p->sa->spacetype != SPACE_VIEW3D) { + if (p->area->spacetype != SPACE_VIEW3D) { WM_cursor_modal_restore(CTX_wm_window(C)); } else { @@ -3096,10 +3096,10 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event } /* gpencil modal operator stores area, which can be removed while using it (like fullscreen) */ -static bool gpencil_area_exists(bContext *C, ScrArea *sa_test) +static bool gpencil_area_exists(bContext *C, ScrArea *area_test) { bScreen *sc = CTX_wm_screen(C); - return (BLI_findindex(&sc->areabase, sa_test) != -1); + return (BLI_findindex(&sc->areabase, area_test) != -1); } static tGPsdata *gpencil_stroke_begin(bContext *C, wmOperator *op) @@ -3109,7 +3109,7 @@ static tGPsdata *gpencil_stroke_begin(bContext *C, wmOperator *op) /* we must check that we're still within the area that we're set up to work from * otherwise we could crash (see bug #20586) */ - if (CTX_wm_area(C) != p->sa) { + if (CTX_wm_area(C) != p->area) { printf("\t\t\tGP - wrong area execution abort!\n"); p->status = GP_STATUS_ERROR; } @@ -3504,18 +3504,19 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) */ if ((p->region) && (p->region->regiontype == RGN_TYPE_TOOLS)) { /* Change to whatever region is now under the mouse */ - ARegion *current_region = BKE_area_find_region_xy(p->sa, RGN_TYPE_ANY, event->x, event->y); + ARegion *current_region = BKE_area_find_region_xy( + p->area, RGN_TYPE_ANY, event->x, event->y); if (G.debug & G_DEBUG) { - printf("found alternative region %p (old was %p) - at %d %d (sa: %d %d -> %d %d)\n", + printf("found alternative region %p (old was %p) - at %d %d (area: %d %d -> %d %d)\n", current_region, p->region, event->x, event->y, - p->sa->totrct.xmin, - p->sa->totrct.ymin, - p->sa->totrct.xmax, - p->sa->totrct.ymax); + p->area->totrct.xmin, + p->area->totrct.ymin, + p->area->totrct.xmax, + p->area->totrct.ymax); } if (current_region) { @@ -3660,7 +3661,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) } /* gpencil modal operator stores area, which can be removed while using it (like fullscreen) */ - if (0 == gpencil_area_exists(C, p->sa)) { + if (0 == gpencil_area_exists(C, p->area)) { estate = OPERATOR_CANCELLED; } else { diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c index dfd11484d22..11aeeba5a24 100644 --- a/source/blender/editors/gpencil/gpencil_primitive.c +++ b/source/blender/editors/gpencil/gpencil_primitive.c @@ -240,8 +240,8 @@ static void gp_primitive_update_cps(tGPDprimitive *tgpi) static bool gpencil_primitive_add_poll(bContext *C) { /* only 3D view */ - ScrArea *sa = CTX_wm_area(C); - if (sa && sa->spacetype != SPACE_VIEW3D) { + ScrArea *area = CTX_wm_area(C); + if (area && area->spacetype != SPACE_VIEW3D) { return 0; } @@ -1137,10 +1137,10 @@ static void gpencil_primitive_init(bContext *C, wmOperator *op) tgpi->scene = scene; tgpi->ob = CTX_data_active_object(C); tgpi->ob_eval = (Object *)DEG_get_evaluated_object(tgpi->depsgraph, tgpi->ob); - tgpi->sa = CTX_wm_area(C); + tgpi->area = CTX_wm_area(C); tgpi->region = CTX_wm_region(C); tgpi->rv3d = tgpi->region->regiondata; - tgpi->v3d = tgpi->sa->spacedata.first; + tgpi->v3d = tgpi->area->spacedata.first; tgpi->win = CTX_wm_window(C); /* save original type */ diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c b/source/blender/editors/gpencil/gpencil_sculpt_paint.c index 8f3fc5fa268..7b6054e4156 100644 --- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c +++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c @@ -91,7 +91,7 @@ typedef struct tGP_BrushEditData { Scene *scene; Object *object; - ScrArea *sa; + ScrArea *area; ARegion *region; /* Current GPencil datablock */ @@ -1181,7 +1181,7 @@ static bool gpsculpt_brush_init(bContext *C, wmOperator *op) gso->is_transformed = false; } - gso->sa = CTX_wm_area(C); + gso->area = CTX_wm_area(C); gso->region = CTX_wm_region(C); Paint *paint = &ts->gp_sculptpaint->paint; @@ -1307,8 +1307,8 @@ static void gpsculpt_brush_exit(bContext *C, wmOperator *op) /* poll callback for stroke sculpting operator(s) */ static bool gpsculpt_brush_poll(bContext *C) { - ScrArea *sa = CTX_wm_area(C); - if (sa && sa->spacetype != SPACE_VIEW3D) { + ScrArea *area = CTX_wm_area(C); + if (area && area->spacetype != SPACE_VIEW3D) { return false; } diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c index 97f0a578d9d..e25576f32aa 100644 --- a/source/blender/editors/gpencil/gpencil_select.c +++ b/source/blender/editors/gpencil/gpencil_select.c @@ -1015,7 +1015,7 @@ static int gpencil_circle_select_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); const int mx = RNA_int_get(op->ptr, "x"); const int my = RNA_int_get(op->ptr, "y"); @@ -1028,7 +1028,7 @@ static int gpencil_circle_select_exec(bContext *C, wmOperator *op) bool changed = false; /* sanity checks */ - if (sa == NULL) { + if (area == NULL) { BKE_report(op->reports, RPT_ERROR, "No active area"); return OPERATOR_CANCELLED; } @@ -1126,7 +1126,7 @@ static int gpencil_generic_select_exec(bContext *C, Object *ob = CTX_data_active_object(C); bGPdata *gpd = ED_gpencil_data_get_active(C); ToolSettings *ts = CTX_data_tool_settings(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); int selectmode; if (ob && ob->mode == OB_MODE_SCULPT_GPENCIL) { @@ -1153,7 +1153,7 @@ static int gpencil_generic_select_exec(bContext *C, bool changed = false; /* sanity checks */ - if (sa == NULL) { + if (area == NULL) { BKE_report(op->reports, RPT_ERROR, "No active area"); return OPERATOR_CANCELLED; } @@ -1416,7 +1416,7 @@ static void deselect_all_selected(bContext *C) static int gpencil_select_exec(bContext *C, wmOperator *op) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); Object *ob = CTX_data_active_object(C); bGPdata *gpd = ED_gpencil_data_get_active(C); ToolSettings *ts = CTX_data_tool_settings(C); @@ -1444,7 +1444,7 @@ static int gpencil_select_exec(bContext *C, wmOperator *op) int hit_distance = radius_squared; /* sanity checks */ - if (sa == NULL) { + if (area == NULL) { BKE_report(op->reports, RPT_ERROR, "No active area"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index e153c22b17f..0048811d53a 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -93,13 +93,13 @@ * and an RNA-pointer to trace back to whatever owns it, * when context info is not available. */ -bGPdata **ED_gpencil_data_get_pointers_direct(ScrArea *sa, Object *ob, PointerRNA *r_ptr) +bGPdata **ED_gpencil_data_get_pointers_direct(ScrArea *area, Object *ob, PointerRNA *r_ptr) { /* if there's an active area, check if the particular editor may * have defined any special Grease Pencil context for editing... */ - if (sa) { - switch (sa->spacetype) { + if (area) { + switch (area->spacetype) { case SPACE_PROPERTIES: /* properties */ case SPACE_INFO: /* header info */ case SPACE_TOPBAR: /* Topbar */ @@ -132,16 +132,16 @@ bGPdata **ED_gpencil_data_get_pointers_direct(ScrArea *sa, Object *ob, PointerRN * when context info is not available. */ bGPdata **ED_annotation_data_get_pointers_direct(ID *screen_id, - ScrArea *sa, + ScrArea *area, Scene *scene, PointerRNA *r_ptr) { /* If there's an active area, check if the particular editor may * have defined any special Grease Pencil context for editing. */ - if (sa) { - SpaceLink *sl = sa->spacedata.first; + if (area) { + SpaceLink *sl = area->spacedata.first; - switch (sa->spacetype) { + switch (area->spacetype) { case SPACE_PROPERTIES: /* properties */ case SPACE_INFO: /* header info */ { @@ -236,10 +236,10 @@ bGPdata **ED_annotation_data_get_pointers_direct(ID *screen_id, * and an RNA-pointer to trace back to whatever owns it. */ bGPdata **ED_gpencil_data_get_pointers(const bContext *C, PointerRNA *r_ptr) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); Object *ob = CTX_data_active_object(C); - return ED_gpencil_data_get_pointers_direct(sa, ob, r_ptr); + return ED_gpencil_data_get_pointers_direct(area, ob, r_ptr); } /* Get pointer to active Grease Pencil datablock, @@ -248,23 +248,23 @@ bGPdata **ED_annotation_data_get_pointers(const bContext *C, PointerRNA *r_ptr) { ID *screen_id = (ID *)CTX_wm_screen(C); Scene *scene = CTX_data_scene(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); - return ED_annotation_data_get_pointers_direct(screen_id, sa, scene, r_ptr); + return ED_annotation_data_get_pointers_direct(screen_id, area, scene, r_ptr); } /* -------------------------------------------------------- */ /* Get the active Grease Pencil datablock, when context is not available */ -bGPdata *ED_gpencil_data_get_active_direct(ScrArea *sa, Object *ob) +bGPdata *ED_gpencil_data_get_active_direct(ScrArea *area, Object *ob) { - bGPdata **gpd_ptr = ED_gpencil_data_get_pointers_direct(sa, ob, NULL); + bGPdata **gpd_ptr = ED_gpencil_data_get_pointers_direct(area, ob, NULL); return (gpd_ptr) ? *(gpd_ptr) : NULL; } /* Get the active Grease Pencil datablock, when context is not available */ -bGPdata *ED_annotation_data_get_active_direct(ID *screen_id, ScrArea *sa, Scene *scene) +bGPdata *ED_annotation_data_get_active_direct(ID *screen_id, ScrArea *area, Scene *scene) { - bGPdata **gpd_ptr = ED_annotation_data_get_pointers_direct(screen_id, sa, scene, NULL); + bGPdata **gpd_ptr = ED_annotation_data_get_pointers_direct(screen_id, area, scene, NULL); return (gpd_ptr) ? *(gpd_ptr) : NULL; } @@ -299,13 +299,13 @@ bGPdata *ED_annotation_data_get_active(const bContext *C) */ bGPdata *ED_gpencil_data_get_active_evaluated(const bContext *C) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Object *ob = CTX_data_active_object(C); Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); - return ED_gpencil_data_get_active_direct(sa, ob_eval); + return ED_gpencil_data_get_active_direct(area, ob_eval); } /* -------------------------------------------------------- */ @@ -513,25 +513,25 @@ bool gp_stroke_inside_circle(const float mval[2], int rad, int x0, int y0, int x /* Check whether given stroke can be edited given the supplied context */ /* TODO: do we need additional flags for screenspace vs dataspace? */ -bool ED_gpencil_stroke_can_use_direct(const ScrArea *sa, const bGPDstroke *gps) +bool ED_gpencil_stroke_can_use_direct(const ScrArea *area, const bGPDstroke *gps) { /* sanity check */ - if (ELEM(NULL, sa, gps)) { + if (ELEM(NULL, area, gps)) { return false; } /* filter stroke types by flags + spacetype */ if (gps->flag & GP_STROKE_3DSPACE) { /* 3D strokes - only in 3D view */ - return ((sa->spacetype == SPACE_VIEW3D) || (sa->spacetype == SPACE_PROPERTIES)); + return ((area->spacetype == SPACE_VIEW3D) || (area->spacetype == SPACE_PROPERTIES)); } else if (gps->flag & GP_STROKE_2DIMAGE) { /* Special "image" strokes - only in Image Editor */ - return (sa->spacetype == SPACE_IMAGE); + return (area->spacetype == SPACE_IMAGE); } else if (gps->flag & GP_STROKE_2DSPACE) { /* 2D strokes (dataspace) - for any 2D view (i.e. everything other than 3D view) */ - return (sa->spacetype != SPACE_VIEW3D); + return (area->spacetype != SPACE_VIEW3D); } else { /* view aligned - anything goes */ @@ -542,8 +542,8 @@ bool ED_gpencil_stroke_can_use_direct(const ScrArea *sa, const bGPDstroke *gps) /* Check whether given stroke can be edited in the current context */ bool ED_gpencil_stroke_can_use(const bContext *C, const bGPDstroke *gps) { - ScrArea *sa = CTX_wm_area(C); - return ED_gpencil_stroke_can_use_direct(sa, gps); + ScrArea *area = CTX_wm_area(C); + return ED_gpencil_stroke_can_use_direct(area, gps); } /* Check whether given stroke can be edited for the current color */ @@ -574,7 +574,7 @@ bool ED_gpencil_stroke_color_use(Object *ob, const bGPDlayer *gpl, const bGPDstr */ void gp_point_conversion_init(bContext *C, GP_SpaceConversion *r_gsc) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); /* zero out the storage (just in case) */ @@ -585,12 +585,12 @@ void gp_point_conversion_init(bContext *C, GP_SpaceConversion *r_gsc) r_gsc->scene = CTX_data_scene(C); r_gsc->ob = CTX_data_active_object(C); - r_gsc->sa = sa; + r_gsc->area = area; r_gsc->region = region; r_gsc->v2d = ®ion->v2d; /* init region-specific stuff */ - if (sa->spacetype == SPACE_VIEW3D) { + if (area->spacetype == SPACE_VIEW3D) { wmWindow *win = CTX_wm_window(C); Scene *scene = CTX_data_scene(C); struct Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -685,8 +685,8 @@ void gp_point_to_xy( int xyval[2]; /* sanity checks */ - BLI_assert(!(gps->flag & GP_STROKE_3DSPACE) || (gsc->sa->spacetype == SPACE_VIEW3D)); - BLI_assert(!(gps->flag & GP_STROKE_2DSPACE) || (gsc->sa->spacetype != SPACE_VIEW3D)); + BLI_assert(!(gps->flag & GP_STROKE_3DSPACE) || (gsc->area->spacetype == SPACE_VIEW3D)); + BLI_assert(!(gps->flag & GP_STROKE_2DSPACE) || (gsc->area->spacetype != SPACE_VIEW3D)); if (gps->flag & GP_STROKE_3DSPACE) { if (ED_view3d_project_int_global(region, &pt->x, xyval, V3D_PROJ_TEST_NOP) == @@ -743,8 +743,8 @@ void gp_point_to_xy_fl(const GP_SpaceConversion *gsc, float xyval[2]; /* sanity checks */ - BLI_assert(!(gps->flag & GP_STROKE_3DSPACE) || (gsc->sa->spacetype == SPACE_VIEW3D)); - BLI_assert(!(gps->flag & GP_STROKE_2DSPACE) || (gsc->sa->spacetype != SPACE_VIEW3D)); + BLI_assert(!(gps->flag & GP_STROKE_3DSPACE) || (gsc->area->spacetype == SPACE_VIEW3D)); + BLI_assert(!(gps->flag & GP_STROKE_2DSPACE) || (gsc->area->spacetype != SPACE_VIEW3D)); if (gps->flag & GP_STROKE_3DSPACE) { if (ED_view3d_project_float_global(region, &pt->x, xyval, V3D_PROJ_TEST_NOP) == @@ -802,7 +802,7 @@ void gp_point_3d_to_xy(const GP_SpaceConversion *gsc, float xyval[2]; /* sanity checks */ - BLI_assert((gsc->sa->spacetype == SPACE_VIEW3D)); + BLI_assert((gsc->area->spacetype == SPACE_VIEW3D)); if (flag & GP_STROKE_3DSPACE) { if (ED_view3d_project_float_global(region, pt, xyval, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) { @@ -1563,7 +1563,7 @@ void ED_gpencil_vgroup_deselect(bContext *C, Object *ob) static bool gp_check_cursor_region(bContext *C, int mval_i[2]) { ARegion *region = CTX_wm_region(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); Object *ob = CTX_data_active_object(C); if ((ob == NULL) || (!ELEM(ob->mode, @@ -1575,7 +1575,7 @@ static bool gp_check_cursor_region(bContext *C, int mval_i[2]) } /* TODO: add more spacetypes */ - if (!ELEM(sa->spacetype, SPACE_VIEW3D)) { + if (!ELEM(area->spacetype, SPACE_VIEW3D)) { return false; } if ((region) && (region->regiontype != RGN_TYPE_WINDOW)) { diff --git a/source/blender/editors/gpencil/gpencil_uv.c b/source/blender/editors/gpencil/gpencil_uv.c index 5f15a6f5411..114d916d1e2 100644 --- a/source/blender/editors/gpencil/gpencil_uv.c +++ b/source/blender/editors/gpencil/gpencil_uv.c @@ -92,9 +92,9 @@ static void gpencil_uv_transform_update_header(wmOperator *op, bContext *C) const char *str = TIP_("Confirm: Enter/LClick, Cancel: (Esc/RClick) %s"); char msg[UI_MAX_DRAW_STR]; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); - if (sa) { + if (area) { char flts_str[NUM_STR_REP_LEN * 2]; switch (mode) { case GP_UV_TRANSLATE: { @@ -120,7 +120,7 @@ static void gpencil_uv_transform_update_header(wmOperator *op, bContext *C) break; } BLI_snprintf(msg, sizeof(msg), str, flts_str, flts_str + NUM_STR_REP_LEN); - ED_area_status_text(sa, msg); + ED_area_status_text(area, msg); } } @@ -214,7 +214,7 @@ static bool gpencil_uv_transform_init(bContext *C, wmOperator *op, const bool is static void gpencil_uv_transform_exit(bContext *C, wmOperator *op) { GpUvData *opdata; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); opdata = op->customdata; @@ -226,8 +226,8 @@ static void gpencil_uv_transform_exit(bContext *C, wmOperator *op) WM_cursor_set(CTX_wm_window(C), WM_CURSOR_DEFAULT); - if (sa) { - ED_area_status_text(sa, NULL); + if (area) { + ED_area_status_text(area, NULL); } WM_main_add_notifier(NC_GEOM | ND_DATA, NULL); diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 7f4c3470020..fe249ce8bfe 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -74,13 +74,13 @@ typedef struct bAnimContext { /** editor->mode */ short mode; - /** sa->spacetype */ + /** area->spacetype */ short spacetype; /** active region -> type (channels or main) */ short regiontype; /** editor host */ - struct ScrArea *sa; + struct ScrArea *area; /** editor data */ struct SpaceLink *sl; /** region within editor */ @@ -840,7 +840,7 @@ void ED_animedit_unlink_action(struct bContext *C, bool force_delete); /* Drivers Editor - Utility to set up UI correctly */ -void ED_drivers_editor_init(struct bContext *C, struct ScrArea *sa); +void ED_drivers_editor_init(struct bContext *C, struct ScrArea *area); /* ************************************************ */ diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index 511e892f29a..d63353d3886 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -88,20 +88,20 @@ struct bGPdata *ED_gpencil_data_get_active(const struct bContext *C); struct bGPdata *ED_gpencil_data_get_active_evaluated(const struct bContext *C); /* Context independent (i.e. each required part is passed in instead) */ -struct bGPdata **ED_gpencil_data_get_pointers_direct(struct ScrArea *sa, +struct bGPdata **ED_gpencil_data_get_pointers_direct(struct ScrArea *area, struct Object *ob, struct PointerRNA *r_ptr); -struct bGPdata *ED_gpencil_data_get_active_direct(struct ScrArea *sa, struct Object *ob); +struct bGPdata *ED_gpencil_data_get_active_direct(struct ScrArea *area, struct Object *ob); struct bGPdata *ED_annotation_data_get_active(const struct bContext *C); struct bGPdata **ED_annotation_data_get_pointers(const struct bContext *C, struct PointerRNA *r_ptr); struct bGPdata **ED_annotation_data_get_pointers_direct(struct ID *screen_id, - struct ScrArea *sa, + struct ScrArea *area, struct Scene *scene, struct PointerRNA *r_ptr); struct bGPdata *ED_annotation_data_get_active_direct(struct ID *screen_id, - struct ScrArea *sa, + struct ScrArea *area, struct Scene *scene); bool ED_gpencil_data_owner_is_annotation(struct PointerRNA *owner_ptr); @@ -111,7 +111,7 @@ bool ED_gpencil_has_keyframe_v3d(struct Scene *scene, struct Object *ob, int cfr /* ----------- Stroke Editing Utilities ---------------- */ -bool ED_gpencil_stroke_can_use_direct(const struct ScrArea *sa, const struct bGPDstroke *gps); +bool ED_gpencil_stroke_can_use_direct(const struct ScrArea *area, const struct bGPDstroke *gps); bool ED_gpencil_stroke_can_use(const struct bContext *C, const struct bGPDstroke *gps); bool ED_gpencil_stroke_color_use(struct Object *ob, const struct bGPDlayer *gpl, diff --git a/source/blender/editors/include/ED_mask.h b/source/blender/editors/include/ED_mask.h index 7d314c0c462..5aafc0702da 100644 --- a/source/blender/editors/include/ED_mask.h +++ b/source/blender/editors/include/ED_mask.h @@ -43,22 +43,25 @@ void ED_keymap_mask(struct wmKeyConfig *keyconf); void ED_operatormacros_mask(void); /* mask_query.c */ -void ED_mask_get_size(struct ScrArea *sa, int *width, int *height); -void ED_mask_zoom(struct ScrArea *sa, struct ARegion *region, float *zoomx, float *zoomy); -void ED_mask_get_aspect(struct ScrArea *sa, struct ARegion *region, float *aspx, float *aspy); +void ED_mask_get_size(struct ScrArea *area, int *width, int *height); +void ED_mask_zoom(struct ScrArea *area, struct ARegion *region, float *zoomx, float *zoomy); +void ED_mask_get_aspect(struct ScrArea *area, struct ARegion *region, float *aspx, float *aspy); -void ED_mask_pixelspace_factor(struct ScrArea *sa, +void ED_mask_pixelspace_factor(struct ScrArea *area, struct ARegion *region, float *scalex, float *scaley); -void ED_mask_mouse_pos(struct ScrArea *sa, struct ARegion *region, const int mval[2], float co[2]); +void ED_mask_mouse_pos(struct ScrArea *area, + struct ARegion *region, + const int mval[2], + float co[2]); void ED_mask_point_pos( - struct ScrArea *sa, struct ARegion *region, float x, float y, float *xr, float *yr); + struct ScrArea *area, struct ARegion *region, float x, float y, float *xr, float *yr); void ED_mask_point_pos__reverse( - struct ScrArea *sa, struct ARegion *region, float x, float y, float *xr, float *yr); + struct ScrArea *area, struct ARegion *region, float x, float y, float *xr, float *yr); -void ED_mask_cursor_location_get(struct ScrArea *sa, float cursor[2]); +void ED_mask_cursor_location_get(struct ScrArea *area, float cursor[2]); bool ED_mask_selected_minmax(const struct bContext *C, float min[2], float max[2]); /* mask_draw.c */ diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h index ae2b4989069..7a1f64b61d4 100644 --- a/source/blender/editors/include/ED_node.h +++ b/source/blender/editors/include/ED_node.h @@ -86,8 +86,8 @@ void ED_node_sort(struct bNodeTree *ntree); float ED_node_grid_size(void); /* node_relationships.c */ -void ED_node_link_intersect_test(struct ScrArea *sa, int test); -void ED_node_link_insert(struct Main *bmain, struct ScrArea *sa); +void ED_node_link_intersect_test(struct ScrArea *area, int test); +void ED_node_link_insert(struct Main *bmain, struct ScrArea *area); /* node_edit.c */ void ED_node_set_tree_type(struct SpaceNode *snode, struct bNodeTreeType *typeinfo); diff --git a/source/blender/editors/include/ED_render.h b/source/blender/editors/include/ED_render.h index 0645b256a15..6db45a653b5 100644 --- a/source/blender/editors/include/ED_render.h +++ b/source/blender/editors/include/ED_render.h @@ -48,7 +48,7 @@ void ED_operatortypes_render(void); /* render_update.c */ void ED_render_engine_changed(struct Main *bmain); -void ED_render_engine_area_exit(struct Main *bmain, struct ScrArea *sa); +void ED_render_engine_area_exit(struct Main *bmain, struct ScrArea *area); void ED_render_view_layer_changed(struct Main *bmain, struct bScreen *sc); /* Callbacks handling data update events coming from depsgraph. */ diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 7430f491d91..62d4324d37e 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -63,14 +63,14 @@ struct wmWindowManager; /* regions */ void ED_region_do_listen(struct wmWindow *win, - struct ScrArea *sa, + struct ScrArea *area, struct ARegion *region, struct wmNotifier *note, const Scene *scene); void ED_region_do_layout(struct bContext *C, struct ARegion *region); void ED_region_do_draw(struct bContext *C, struct ARegion *region); void ED_region_exit(struct bContext *C, struct ARegion *region); -void ED_region_remove(struct bContext *C, struct ScrArea *sa, struct ARegion *region); +void ED_region_remove(struct bContext *C, struct ScrArea *area, struct ARegion *region); void ED_region_pixelspace(struct ARegion *region); void ED_region_update_rect(struct ARegion *region); void ED_region_floating_initialize(struct ARegion *region); @@ -104,14 +104,14 @@ void ED_region_header(const struct bContext *C, struct ARegion *region); void ED_region_header_layout(const struct bContext *C, struct ARegion *region); void ED_region_header_draw(const struct bContext *C, struct ARegion *region); -void ED_region_cursor_set(struct wmWindow *win, struct ScrArea *sa, struct ARegion *region); +void ED_region_cursor_set(struct wmWindow *win, struct ScrArea *area, struct ARegion *region); void ED_region_toggle_hidden(struct bContext *C, struct ARegion *region); void ED_region_visibility_change_update(struct bContext *C, - struct ScrArea *sa, + struct ScrArea *area, struct ARegion *region); /* screen_ops.c */ void ED_region_visibility_change_update_animated(struct bContext *C, - struct ScrArea *sa, + struct ScrArea *area, struct ARegion *region); void ED_region_info_draw(struct ARegion *region, @@ -146,14 +146,14 @@ void ED_area_do_mgs_subscribe_for_tool_header(const struct bContext *C, struct WorkSpace *workspace, struct Scene *scene, struct bScreen *screen, - struct ScrArea *sa, + struct ScrArea *area, struct ARegion *region, struct wmMsgBus *mbus); void ED_area_do_mgs_subscribe_for_tool_ui(const struct bContext *C, struct WorkSpace *workspace, struct Scene *scene, struct bScreen *screen, - struct ScrArea *sa, + struct ScrArea *area, struct ARegion *region, struct wmMsgBus *mbus); @@ -162,7 +162,7 @@ void ED_region_message_subscribe(struct bContext *C, struct WorkSpace *workspace, struct Scene *scene, struct bScreen *screen, - struct ScrArea *sa, + struct ScrArea *area, struct ARegion *region, struct wmMsgBus *mbus); @@ -171,21 +171,21 @@ void ED_spacetypes_keymap(struct wmKeyConfig *keyconf); int ED_area_header_switchbutton(const struct bContext *C, struct uiBlock *block, int yco); /* areas */ -void ED_area_initialize(struct wmWindowManager *wm, struct wmWindow *win, struct ScrArea *sa); -void ED_area_exit(struct bContext *C, struct ScrArea *sa); +void ED_area_initialize(struct wmWindowManager *wm, struct wmWindow *win, struct ScrArea *area); +void ED_area_exit(struct bContext *C, struct ScrArea *area); int ED_screen_area_active(const struct bContext *C); void ED_screen_global_areas_refresh(struct wmWindow *win); void ED_screen_global_areas_sync(struct wmWindow *win); -void ED_area_do_listen(struct wmWindow *win, ScrArea *sa, struct wmNotifier *note, Scene *scene); -void ED_area_tag_redraw(ScrArea *sa); -void ED_area_tag_redraw_no_rebuild(ScrArea *sa); -void ED_area_tag_redraw_regiontype(ScrArea *sa, int type); -void ED_area_tag_refresh(ScrArea *sa); -void ED_area_do_refresh(struct bContext *C, ScrArea *sa); -struct AZone *ED_area_azones_update(ScrArea *sa, const int mouse_xy[]); -void ED_area_status_text(ScrArea *sa, const char *str); -void ED_area_newspace(struct bContext *C, ScrArea *sa, int type, const bool skip_region_exit); -void ED_area_prevspace(struct bContext *C, ScrArea *sa); +void ED_area_do_listen(struct wmWindow *win, ScrArea *area, struct wmNotifier *note, Scene *scene); +void ED_area_tag_redraw(ScrArea *area); +void ED_area_tag_redraw_no_rebuild(ScrArea *area); +void ED_area_tag_redraw_regiontype(ScrArea *area, int type); +void ED_area_tag_refresh(ScrArea *area); +void ED_area_do_refresh(struct bContext *C, ScrArea *area); +struct AZone *ED_area_azones_update(ScrArea *area, const int mouse_xy[]); +void ED_area_status_text(ScrArea *area, const char *str); +void ED_area_newspace(struct bContext *C, ScrArea *area, int type, const bool skip_region_exit); +void ED_area_prevspace(struct bContext *C, ScrArea *area); void ED_area_swapspace(struct bContext *C, ScrArea *sa1, ScrArea *sa2); int ED_area_headersize(void); int ED_area_header_alignment_or_fallback(const ScrArea *area, int fallback); @@ -224,7 +224,7 @@ ScrArea *ED_screen_areas_iter_next(const bScreen *screen, const ScrArea *area); void ED_screens_initialize(struct Main *bmain, struct wmWindowManager *wm); void ED_screen_draw_edges(struct wmWindow *win); void ED_screen_draw_join_shape(struct ScrArea *sa1, struct ScrArea *sa2); -void ED_screen_draw_split_preview(struct ScrArea *sa, const int dir, const float fac); +void ED_screen_draw_split_preview(struct ScrArea *area, const int dir, const float fac); void ED_screen_refresh(struct wmWindowManager *wm, struct wmWindow *win); void ED_screen_ensure_updated(struct wmWindowManager *wm, struct wmWindow *win, @@ -236,13 +236,13 @@ void ED_screen_set_active_region(struct bContext *C, struct wmWindow *win, const void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen); void ED_screen_animation_timer(struct bContext *C, int redraws, int sync, int enable); void ED_screen_animation_timer_update(struct bScreen *screen, int redraws); -void ED_screen_restore_temp_type(struct bContext *C, ScrArea *sa); -ScrArea *ED_screen_full_newspace(struct bContext *C, ScrArea *sa, int type); -void ED_screen_full_prevspace(struct bContext *C, ScrArea *sa); -void ED_screen_full_restore(struct bContext *C, ScrArea *sa); +void ED_screen_restore_temp_type(struct bContext *C, ScrArea *area); +ScrArea *ED_screen_full_newspace(struct bContext *C, ScrArea *area, int type); +void ED_screen_full_prevspace(struct bContext *C, ScrArea *area); +void ED_screen_full_restore(struct bContext *C, ScrArea *area); struct ScrArea *ED_screen_state_toggle(struct bContext *C, struct wmWindow *win, - struct ScrArea *sa, + struct ScrArea *area, const short state); ScrArea *ED_screen_temp_space_open(struct bContext *C, const char *title, @@ -422,7 +422,7 @@ void ED_region_generic_tools_region_message_subscribe(const struct bContext *C, struct WorkSpace *workspace, struct Scene *scene, struct bScreen *screen, - struct ScrArea *sa, + struct ScrArea *area, struct ARegion *region, struct wmMsgBus *mbus); int ED_region_generic_tools_region_snap_size(const struct ARegion *region, int size, int axis); @@ -449,8 +449,8 @@ bool ED_region_contains_xy(const struct ARegion *region, const int event_xy[2]); /* interface_region_hud.c */ struct ARegionType *ED_area_type_hud(int space_type); -void ED_area_type_hud_clear(struct wmWindowManager *wm, ScrArea *sa_keep); -void ED_area_type_hud_ensure(struct bContext *C, struct ScrArea *sa); +void ED_area_type_hud_clear(struct wmWindowManager *wm, ScrArea *area_keep); +void ED_area_type_hud_ensure(struct bContext *C, struct ScrArea *area); /* default keymaps, bitflags (matches order of evaluation). */ enum { diff --git a/source/blender/editors/include/ED_util.h b/source/blender/editors/include/ED_util.h index 8b4829446c3..1f2706957a7 100644 --- a/source/blender/editors/include/ED_util.h +++ b/source/blender/editors/include/ED_util.h @@ -48,7 +48,7 @@ bool ED_editors_flush_edits_for_object(struct Main *bmain, struct Object *ob); bool ED_editors_flush_edits_ex(struct Main *bmain, bool for_render, bool check_needs_flush); bool ED_editors_flush_edits(struct Main *bmain); -void ED_spacedata_id_remap(struct ScrArea *sa, +void ED_spacedata_id_remap(struct ScrArea *area, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id); diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 86ad35cfa9f..668ca3c6437 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -561,7 +561,7 @@ struct RegionView3D *ED_view3d_context_rv3d(struct bContext *C); bool ED_view3d_context_user_region(struct bContext *C, struct View3D **r_v3d, struct ARegion **r_region); -bool ED_view3d_area_user_region(const struct ScrArea *sa, +bool ED_view3d_area_user_region(const struct ScrArea *area, const struct View3D *v3d, struct ARegion **r_region); bool ED_operator_rv3d_user_region_poll(struct bContext *C); @@ -600,7 +600,7 @@ void ED_view3d_draw_setup_view(const struct wmWindowManager *wm, struct Base *ED_view3d_give_base_under_cursor(struct bContext *C, const int mval[2]); struct Object *ED_view3d_give_object_under_cursor(struct bContext *C, const int mval[2]); bool ED_view3d_is_object_under_cursor(struct bContext *C, const int mval[2]); -void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *region, bool do_clip); +void ED_view3d_quadview_update(struct ScrArea *area, struct ARegion *region, bool do_clip); void ED_view3d_update_viewmat(struct Depsgraph *depsgraph, const struct Scene *scene, struct View3D *v3d, @@ -702,7 +702,7 @@ void ED_view3d_operator_properties_viewmat_get(struct wmOperator *op, /* render */ void ED_view3d_stop_render_preview(struct wmWindowManager *wm, struct ARegion *region); -void ED_view3d_shade_update(struct Main *bmain, struct View3D *v3d, struct ScrArea *sa); +void ED_view3d_shade_update(struct Main *bmain, struct View3D *v3d, struct ScrArea *area); #define XRAY_ALPHA(v3d) \ (((v3d)->shading.type == OB_WIRE) ? (v3d)->shading.xray_alpha_wire : (v3d)->shading.xray_alpha) diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 1fa6e5b12c1..e8d50886c8b 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -1650,14 +1650,14 @@ void UI_panels_end(const struct bContext *C, struct ARegion *region, int *r_x, i void UI_panels_draw(const struct bContext *C, struct ARegion *region); struct Panel *UI_panel_find_by_type(struct ListBase *lb, struct PanelType *pt); -struct Panel *UI_panel_begin(struct ScrArea *sa, +struct Panel *UI_panel_begin(struct ScrArea *area, struct ARegion *region, struct ListBase *lb, uiBlock *block, struct PanelType *pt, struct Panel *pa, bool *r_open); -void UI_panel_end(const struct ScrArea *sa, +void UI_panel_end(const struct ScrArea *area, const struct ARegion *region, uiBlock *block, int width, diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h index ff9719d4674..d4db1b14074 100644 --- a/source/blender/editors/include/UI_view2d.h +++ b/source/blender/editors/include/UI_view2d.h @@ -119,7 +119,7 @@ void UI_view2d_region_reinit(struct View2D *v2d, short type, int winx, int winy) void UI_view2d_curRect_validate(struct View2D *v2d); void UI_view2d_curRect_reset(struct View2D *v2d); -void UI_view2d_sync(struct bScreen *screen, struct ScrArea *sa, struct View2D *v2dcur, int flag); +void UI_view2d_sync(struct bScreen *screen, struct ScrArea *area, struct View2D *v2dcur, int flag); void UI_view2d_totRect_set(struct View2D *v2d, int width, int height); void UI_view2d_totRect_set_resize(struct View2D *v2d, int width, int height, bool resize); diff --git a/source/blender/editors/interface/interface_eyedropper.c b/source/blender/editors/interface/interface_eyedropper.c index 5fd1cef6451..817cb44db29 100644 --- a/source/blender/editors/interface/interface_eyedropper.c +++ b/source/blender/editors/interface/interface_eyedropper.c @@ -139,8 +139,8 @@ void eyedropper_draw_cursor_text(const struct bContext *C, const ARegion *region uiBut *eyedropper_get_property_button_under_mouse(bContext *C, const wmEvent *event) { bScreen *screen = CTX_wm_screen(C); - ScrArea *sa = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, event->x, event->y); - ARegion *region = BKE_area_find_region_xy(sa, RGN_TYPE_ANY, event->x, event->y); + ScrArea *area = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, event->x, event->y); + ARegion *region = BKE_area_find_region_xy(area, RGN_TYPE_ANY, event->x, event->y); uiBut *but = ui_but_find_mouse_over(region, event); diff --git a/source/blender/editors/interface/interface_eyedropper_color.c b/source/blender/editors/interface/interface_eyedropper_color.c index 372fd841bc1..7527a1e0662 100644 --- a/source/blender/editors/interface/interface_eyedropper_color.c +++ b/source/blender/editors/interface/interface_eyedropper_color.c @@ -137,15 +137,15 @@ void eyedropper_color_sample_fl(bContext *C, int mx, int my, float r_col[3]) /* we could use some clever */ Main *bmain = CTX_data_main(C); bScreen *screen = CTX_wm_screen(C); - ScrArea *sa = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, mx, my); + ScrArea *area = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, mx, my); const char *display_device = CTX_data_scene(C)->display_settings.display_device; struct ColorManagedDisplay *display = IMB_colormanagement_display_get_named(display_device); - if (sa) { - if (sa->spacetype == SPACE_IMAGE) { - ARegion *region = BKE_area_find_region_xy(sa, RGN_TYPE_WINDOW, mx, my); + if (area) { + if (area->spacetype == SPACE_IMAGE) { + ARegion *region = BKE_area_find_region_xy(area, RGN_TYPE_WINDOW, mx, my); if (region) { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; int mval[2] = {mx - region->winrct.xmin, my - region->winrct.ymin}; if (ED_space_image_color_sample(sima, region, mval, r_col)) { @@ -153,10 +153,10 @@ void eyedropper_color_sample_fl(bContext *C, int mx, int my, float r_col[3]) } } } - else if (sa->spacetype == SPACE_NODE) { - ARegion *region = BKE_area_find_region_xy(sa, RGN_TYPE_WINDOW, mx, my); + else if (area->spacetype == SPACE_NODE) { + ARegion *region = BKE_area_find_region_xy(area, RGN_TYPE_WINDOW, mx, my); if (region) { - SpaceNode *snode = sa->spacedata.first; + SpaceNode *snode = area->spacedata.first; int mval[2] = {mx - region->winrct.xmin, my - region->winrct.ymin}; if (ED_space_node_color_sample(bmain, snode, region, mval, r_col)) { @@ -164,10 +164,10 @@ void eyedropper_color_sample_fl(bContext *C, int mx, int my, float r_col[3]) } } } - else if (sa->spacetype == SPACE_CLIP) { - ARegion *region = BKE_area_find_region_xy(sa, RGN_TYPE_WINDOW, mx, my); + else if (area->spacetype == SPACE_CLIP) { + ARegion *region = BKE_area_find_region_xy(area, RGN_TYPE_WINDOW, mx, my); if (region) { - SpaceClip *sc = sa->spacedata.first; + SpaceClip *sc = area->spacedata.first; int mval[2] = {mx - region->winrct.xmin, my - region->winrct.ymin}; if (ED_space_clip_color_sample(sc, region, mval, r_col)) { diff --git a/source/blender/editors/interface/interface_eyedropper_datablock.c b/source/blender/editors/interface/interface_eyedropper_datablock.c index bf118481be2..d9c77c26941 100644 --- a/source/blender/editors/interface/interface_eyedropper_datablock.c +++ b/source/blender/editors/interface/interface_eyedropper_datablock.c @@ -152,27 +152,27 @@ static void datadropper_id_sample_pt(bContext *C, DataDropper *ddr, int mx, int { /* we could use some clever */ bScreen *screen = CTX_wm_screen(C); - ScrArea *sa = BKE_screen_find_area_xy(screen, -1, mx, my); + ScrArea *area = BKE_screen_find_area_xy(screen, -1, mx, my); ScrArea *area_prev = CTX_wm_area(C); ARegion *region_prev = CTX_wm_region(C); ddr->name[0] = '\0'; - if (sa) { - if (ELEM(sa->spacetype, SPACE_VIEW3D, SPACE_OUTLINER)) { - ARegion *region = BKE_area_find_region_xy(sa, RGN_TYPE_WINDOW, mx, my); + if (area) { + if (ELEM(area->spacetype, SPACE_VIEW3D, SPACE_OUTLINER)) { + ARegion *region = BKE_area_find_region_xy(area, RGN_TYPE_WINDOW, mx, my); if (region) { const int mval[2] = {mx - region->winrct.xmin, my - region->winrct.ymin}; Base *base; - CTX_wm_area_set(C, sa); + CTX_wm_area_set(C, area); CTX_wm_region_set(C, region); /* grr, always draw else we leave stale text */ ED_region_tag_redraw(region); - if (sa->spacetype == SPACE_VIEW3D) { + if (area->spacetype == SPACE_VIEW3D) { base = ED_view3d_give_base_under_cursor(C, mval); } else { @@ -250,11 +250,11 @@ static void datadropper_set_draw_callback_region(bContext *C, const int my) { bScreen *screen = CTX_wm_screen(C); - ScrArea *sa = BKE_screen_find_area_xy(screen, -1, mx, my); + ScrArea *area = BKE_screen_find_area_xy(screen, -1, mx, my); - if (sa) { + if (area) { /* If spacetype changed */ - if (sa->spacetype != ddr->cursor_area->spacetype) { + if (area->spacetype != ddr->cursor_area->spacetype) { /* Remove old callback */ ED_region_draw_cb_exit(ddr->art, ddr->draw_handle_pixel); @@ -263,9 +263,9 @@ static void datadropper_set_draw_callback_region(bContext *C, ED_region_tag_redraw(region); /* Set draw callback in new region */ - ARegionType *art = BKE_regiontype_from_id(sa->type, RGN_TYPE_WINDOW); + ARegionType *art = BKE_regiontype_from_id(area->type, RGN_TYPE_WINDOW); - ddr->cursor_area = sa; + ddr->cursor_area = area; ddr->art = art; ddr->draw_handle_pixel = ED_region_draw_cb_activate( art, datadropper_draw_cb, ddr, REGION_DRAW_POST_PIXEL); diff --git a/source/blender/editors/interface/interface_eyedropper_depth.c b/source/blender/editors/interface/interface_eyedropper_depth.c index 26a6109e8cf..907da917e75 100644 --- a/source/blender/editors/interface/interface_eyedropper_depth.c +++ b/source/blender/editors/interface/interface_eyedropper_depth.c @@ -156,7 +156,7 @@ static void depthdropper_depth_sample_pt( { /* we could use some clever */ bScreen *screen = CTX_wm_screen(C); - ScrArea *sa = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, mx, my); + ScrArea *area = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, mx, my); Scene *scene = CTX_data_scene(C); ScrArea *area_prev = CTX_wm_area(C); @@ -164,19 +164,19 @@ static void depthdropper_depth_sample_pt( ddr->name[0] = '\0'; - if (sa) { - if (sa->spacetype == SPACE_VIEW3D) { - ARegion *region = BKE_area_find_region_xy(sa, RGN_TYPE_WINDOW, mx, my); + if (area) { + if (area->spacetype == SPACE_VIEW3D) { + ARegion *region = BKE_area_find_region_xy(area, RGN_TYPE_WINDOW, mx, my); if (region) { struct Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); - View3D *v3d = sa->spacedata.first; + View3D *v3d = area->spacedata.first; RegionView3D *rv3d = region->regiondata; /* weak, we could pass in some reference point */ const float *view_co = v3d->camera ? v3d->camera->obmat[3] : rv3d->viewinv[3]; const int mval[2] = {mx - region->winrct.xmin, my - region->winrct.ymin}; float co[3]; - CTX_wm_area_set(C, sa); + CTX_wm_area_set(C, area); CTX_wm_region_set(C, region); /* grr, always draw else we leave stale text */ diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 075bd8af906..084eb943665 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -2015,8 +2015,8 @@ static int ui_id_brush_get_icon(const bContext *C, ID *id) Object *ob = CTX_data_active_object(C); const EnumPropertyItem *items = NULL; ePaintMode paint_mode = PAINT_MODE_INVALID; - ScrArea *sa = CTX_wm_area(C); - char space_type = sa->spacetype; + ScrArea *area = CTX_wm_area(C); + char space_type = area->spacetype; /* Fallback to 3D view. */ if (space_type == SPACE_PROPERTIES) { space_type = SPACE_VIEW3D; @@ -2041,8 +2041,8 @@ static int ui_id_brush_get_icon(const bContext *C, ID *id) } } else if (space_type == SPACE_IMAGE) { - if (sa->spacetype == space_type) { - const SpaceImage *sima = sa->spacedata.first; + if (area->spacetype == space_type) { + const SpaceImage *sima = area->spacedata.first; if (sima->mode == SI_MODE_PAINT) { paint_mode = PAINT_MODE_TEXTURE_2D; } diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index 5a4a549ea3e..ed5d02a5a03 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -1308,9 +1308,9 @@ static int editsource_text_edit(bContext *C, else { /* naughty!, find text area to set, not good behavior * but since this is a dev tool lets allow it - campbell */ - ScrArea *sa = BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_TEXT, 0); - if (sa) { - SpaceText *st = sa->spacedata.first; + ScrArea *area = BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_TEXT, 0); + if (area) { + SpaceText *st = area->spacedata.first; st->text = text; } else { diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index d57b4d444bd..04d1181a8a1 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -131,18 +131,18 @@ typedef enum eSpaceButtons_Align { BUT_AUTO = 2, } eSpaceButtons_Align; -static int panel_aligned(const ScrArea *sa, const ARegion *region) +static int panel_aligned(const ScrArea *area, const ARegion *region) { - if (sa->spacetype == SPACE_PROPERTIES && region->regiontype == RGN_TYPE_WINDOW) { + if (area->spacetype == SPACE_PROPERTIES && region->regiontype == RGN_TYPE_WINDOW) { return BUT_VERTICAL; } - else if (sa->spacetype == SPACE_USERPREF && region->regiontype == RGN_TYPE_WINDOW) { + else if (area->spacetype == SPACE_USERPREF && region->regiontype == RGN_TYPE_WINDOW) { return BUT_VERTICAL; } - else if (sa->spacetype == SPACE_FILE && region->regiontype == RGN_TYPE_CHANNELS) { + else if (area->spacetype == SPACE_FILE && region->regiontype == RGN_TYPE_CHANNELS) { return BUT_VERTICAL; } - else if (sa->spacetype == SPACE_IMAGE && region->regiontype == RGN_TYPE_PREVIEW) { + else if (area->spacetype == SPACE_IMAGE && region->regiontype == RGN_TYPE_PREVIEW) { return BUT_VERTICAL; } else if (ELEM(region->regiontype, @@ -196,21 +196,21 @@ static bool panel_active_animation_changed(ListBase *lb, Panel **pa_animation, b return false; } -static bool panels_need_realign(ScrArea *sa, ARegion *region, Panel **r_pa_animate) +static bool panels_need_realign(ScrArea *area, ARegion *region, Panel **r_pa_animate) { *r_pa_animate = NULL; - if (sa->spacetype == SPACE_PROPERTIES && region->regiontype == RGN_TYPE_WINDOW) { - SpaceProperties *sbuts = sa->spacedata.first; + if (area->spacetype == SPACE_PROPERTIES && region->regiontype == RGN_TYPE_WINDOW) { + SpaceProperties *sbuts = area->spacedata.first; if (sbuts->mainbo != sbuts->mainb) { return true; } } - else if (sa->spacetype == SPACE_IMAGE && region->regiontype == RGN_TYPE_PREVIEW) { + else if (area->spacetype == SPACE_IMAGE && region->regiontype == RGN_TYPE_PREVIEW) { return true; } - else if (sa->spacetype == SPACE_FILE && region->regiontype == RGN_TYPE_CHANNELS) { + else if (area->spacetype == SPACE_FILE && region->regiontype == RGN_TYPE_CHANNELS) { return true; } @@ -234,11 +234,11 @@ static bool panels_need_realign(ScrArea *sa, ARegion *region, Panel **r_pa_anima /****************************** panels ******************************/ -static void panels_collapse_all(ScrArea *sa, ARegion *region, const Panel *from_pa) +static void panels_collapse_all(ScrArea *area, ARegion *region, const Panel *from_pa) { const bool has_category_tabs = UI_panel_category_is_visible(region); const char *category = has_category_tabs ? UI_panel_category_active_get(region, false) : NULL; - const int flag = ((panel_aligned(sa, region) == BUT_HORIZONTAL) ? PNL_CLOSEDX : PNL_CLOSEDY); + const int flag = ((panel_aligned(area, region) == BUT_HORIZONTAL) ? PNL_CLOSEDX : PNL_CLOSEDY); const PanelType *from_pt = from_pa->type; Panel *pa; @@ -274,7 +274,7 @@ Panel *UI_panel_find_by_type(ListBase *lb, PanelType *pt) /** * \note \a pa should be return value from #UI_panel_find_by_type and can be NULL. */ -Panel *UI_panel_begin(ScrArea *sa, +Panel *UI_panel_begin(ScrArea *area, ARegion *region, ListBase *lb, uiBlock *block, @@ -286,7 +286,7 @@ Panel *UI_panel_begin(ScrArea *sa, const char *drawname = CTX_IFACE_(pt->translation_context, pt->label); const char *idname = pt->idname; const bool newpanel = (pa == NULL); - int align = panel_aligned(sa, region); + int align = panel_aligned(area, region); if (!newpanel) { pa->type = pt; @@ -385,7 +385,7 @@ static float panel_region_offset_x_get(const ARegion *region, int align) } void UI_panel_end( - const ScrArea *sa, const ARegion *region, uiBlock *block, int width, int height, bool open) + const ScrArea *area, const ARegion *region, uiBlock *block, int width, int height, bool open) { Panel *pa = block->panel; @@ -425,7 +425,7 @@ void UI_panel_end( pa->ofsy += old_sizey - pa->sizey; } - int align = panel_aligned(sa, region); + int align = panel_aligned(area, region); if (old_region_ofsx != panel_region_offset_x_get(region, align)) { pa->runtime_flag |= PNL_ANIM_ALIGN; } @@ -1021,13 +1021,13 @@ static void align_sub_panels(Panel *pa) /* this doesn't draw */ /* returns 1 when it did something */ -static bool uiAlignPanelStep(ScrArea *sa, ARegion *region, const float fac, const bool drag) +static bool uiAlignPanelStep(ScrArea *area, ARegion *region, const float fac, const bool drag) { Panel *pa; PanelSort *ps, *panelsort, *psnext; int a, tot = 0; bool done; - int align = panel_aligned(sa, region); + int align = panel_aligned(area, region); /* count active, not tabbed panels */ for (pa = region->panels.first; pa; pa = pa->next) { @@ -1135,10 +1135,10 @@ static bool uiAlignPanelStep(ScrArea *sa, ARegion *region, const float fac, cons return done; } -static void ui_panels_size(ScrArea *sa, ARegion *region, int *r_x, int *r_y) +static void ui_panels_size(ScrArea *area, ARegion *region, int *r_x, int *r_y) { Panel *pa; - int align = panel_aligned(sa, region); + int align = panel_aligned(area, region); int sizex = 0; int sizey = 0; @@ -1175,7 +1175,7 @@ static void ui_panels_size(ScrArea *sa, ARegion *region, int *r_x, int *r_y) static void ui_do_animate(const bContext *C, Panel *panel) { uiHandlePanelData *data = panel->activedata; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); float fac; @@ -1183,7 +1183,7 @@ static void ui_do_animate(const bContext *C, Panel *panel) fac = min_ff(sqrtf(fac), 1.0f); /* for max 1 second, interpolate positions */ - if (uiAlignPanelStep(sa, region, fac, false)) { + if (uiAlignPanelStep(area, region, fac, false)) { ED_region_tag_redraw(region); } else { @@ -1220,7 +1220,7 @@ void UI_panels_begin(const bContext *UNUSED(C), ARegion *region) /* only draws blocks with panels */ void UI_panels_end(const bContext *C, ARegion *region, int *r_x, int *r_y) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); uiBlock *block; Panel *pa, *firstpa; @@ -1232,12 +1232,12 @@ void UI_panels_end(const bContext *C, ARegion *region, int *r_x, int *r_y) } /* re-align, possibly with animation */ - if (panels_need_realign(sa, region, &pa)) { + if (panels_need_realign(area, region, &pa)) { if (pa) { panel_activate_state(C, pa, PANEL_STATE_ANIMATION); } else { - uiAlignPanelStep(sa, region, 1.0, false); + uiAlignPanelStep(area, region, 1.0, false); } } @@ -1256,7 +1256,7 @@ void UI_panels_end(const bContext *C, ARegion *region, int *r_x, int *r_y) } /* compute size taken up by panel */ - ui_panels_size(sa, region, r_x, r_y); + ui_panels_size(area, region, r_x, r_y); } void UI_panels_draw(const bContext *C, ARegion *region) @@ -1347,9 +1347,9 @@ static void check_panel_overlap(ARegion *region, Panel *panel) static void ui_do_drag(const bContext *C, const wmEvent *event, Panel *panel) { uiHandlePanelData *data = panel->activedata; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); - short align = panel_aligned(sa, region), dx = 0, dy = 0; + short align = panel_aligned(area, region), dx = 0, dy = 0; /* first clip for window, no dragging outside */ if (!BLI_rcti_isect_pt_v(®ion->winrct, &event->x)) { @@ -1381,7 +1381,7 @@ static void ui_do_drag(const bContext *C, const wmEvent *event, Panel *panel) check_panel_overlap(region, panel); if (align) { - uiAlignPanelStep(sa, region, 0.2, true); + uiAlignPanelStep(area, region, 0.2, true); } } @@ -1441,7 +1441,7 @@ static void ui_panel_drag_collapse(bContext *C, uiPanelDragCollapseHandle *dragcol_data, const int xy_dst[2]) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); uiBlock *block; Panel *pa; @@ -1451,7 +1451,7 @@ static void ui_panel_drag_collapse(bContext *C, float xy_b_block[2] = {UNPACK2(xy_dst)}; rctf rect = block->rect; int oldflag; - const bool is_horizontal = (panel_aligned(sa, region) == BUT_HORIZONTAL); + const bool is_horizontal = (panel_aligned(area, region) == BUT_HORIZONTAL); if ((pa = block->panel) == 0 || (pa->type && (pa->type->flag & PNL_NO_HEADER))) { continue; @@ -1553,7 +1553,7 @@ static void ui_panel_drag_collapse_handler_add(const bContext *C, const bool was static void ui_handle_panel_header( const bContext *C, uiBlock *block, int mx, int my, int event, short ctrl, short shift) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); #ifdef USE_PIN_HIDDEN const bool show_pin = UI_panel_category_is_visible(region) && @@ -1565,7 +1565,7 @@ static void ui_handle_panel_header( const bool is_subpanel = (block->panel->type && block->panel->type->parent); const bool show_drag = !is_subpanel; - int align = panel_aligned(sa, region), button = 0; + int align = panel_aligned(area, region), button = 0; rctf rect_drag, rect_pin; float rect_leftmost; @@ -1620,7 +1620,7 @@ static void ui_handle_panel_header( } else { /* collapse */ if (ctrl) { - panels_collapse_all(sa, region, block->panel); + panels_collapse_all(area, region, block->panel); /* reset the view - we don't want to display a view without content */ UI_view2d_offset(®ion->v2d, 0.0f, 1.0f); @@ -2400,7 +2400,7 @@ int ui_handler_panel_region(bContext *C, /*XXX 2.50*/ #if 0 if (block->handler) { - rem_blockhandler(sa, block->handler); + rem_blockhandler(area, block->handler); ED_region_tag_redraw(region); retval = WM_UI_HANDLER_BREAK; } @@ -2421,10 +2421,10 @@ int ui_handler_panel_region(bContext *C, } if (zoom) { - ScrArea *sa = CTX_wm_area(C); - SpaceLink *sl = sa->spacedata.first; + ScrArea *area = CTX_wm_area(C); + SpaceLink *sl = area->spacedata.first; - if (sa->spacetype != SPACE_PROPERTIES) { + if (area->spacetype != SPACE_PROPERTIES) { if (!(pa->control & UI_PNL_SCALE)) { if (event->type == PADPLUSKEY) { sl->blockscale += 0.1; @@ -2458,9 +2458,9 @@ static int ui_handler_panel(bContext *C, const wmEvent *event, void *userdata) /* verify if we can stop */ if (event->type == LEFTMOUSE && event->val == KM_RELEASE) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); - int align = panel_aligned(sa, region); + int align = panel_aligned(area, region); if (align) { panel_activate_state(C, panel, PANEL_STATE_ANIMATION); diff --git a/source/blender/editors/interface/interface_region_hud.c b/source/blender/editors/interface/interface_region_hud.c index e0fc7a3ee71..a7508894c54 100644 --- a/source/blender/editors/interface/interface_region_hud.c +++ b/source/blender/editors/interface/interface_region_hud.c @@ -74,8 +74,8 @@ static bool last_redo_poll(const bContext *C, short region_type) * operator call. Otherwise we would be polling the operator with the * wrong context. */ - ScrArea *sa = CTX_wm_area(C); - ARegion *region_op = (region_type != -1) ? BKE_area_find_region_type(sa, region_type) : NULL; + ScrArea *area = CTX_wm_area(C); + ARegion *region_op = (region_type != -1) ? BKE_area_find_region_type(area, region_type) : NULL; ARegion *region_prev = CTX_wm_region(C); CTX_wm_region_set((bContext *)C, region_op); @@ -103,8 +103,8 @@ static void hud_region_hide(ARegion *region) static bool hud_panel_operator_redo_poll(const bContext *C, PanelType *UNUSED(pt)) { - ScrArea *sa = CTX_wm_area(C); - ARegion *region = BKE_area_find_region_type(sa, RGN_TYPE_HUD); + ScrArea *area = CTX_wm_area(C); + ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_HUD); if (region != NULL) { struct HudRegionData *hrd = region->regiondata; if (hrd != NULL) { @@ -250,15 +250,15 @@ ARegionType *ED_area_type_hud(int space_type) return art; } -static ARegion *hud_region_add(ScrArea *sa) +static ARegion *hud_region_add(ScrArea *area) { ARegion *region = MEM_callocN(sizeof(ARegion), "area region"); - ARegion *region_win = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); + ARegion *region_win = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); if (region_win) { - BLI_insertlinkbefore(&sa->regionbase, region_win, region); + BLI_insertlinkbefore(&area->regionbase, region_win, region); } else { - BLI_addtail(&sa->regionbase, region); + BLI_addtail(&area->regionbase, region); } region->regiontype = RGN_TYPE_HUD; region->alignment = RGN_ALIGN_FLOAT; @@ -276,18 +276,18 @@ static ARegion *hud_region_add(ScrArea *sa) return region; } -void ED_area_type_hud_clear(wmWindowManager *wm, ScrArea *sa_keep) +void ED_area_type_hud_clear(wmWindowManager *wm, ScrArea *area_keep) { for (wmWindow *win = wm->windows.first; win; win = win->next) { bScreen *screen = WM_window_get_active_screen(win); - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - if (sa != sa_keep) { - for (ARegion *region = sa->regionbase.first; region; region = region->next) { + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + if (area != area_keep) { + for (ARegion *region = area->regionbase.first; region; region = region->next) { if (region->regiontype == RGN_TYPE_HUD) { if ((region->flag & RGN_FLAG_HIDDEN) == 0) { hud_region_hide(region); ED_region_tag_redraw(region); - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } } } @@ -296,17 +296,17 @@ void ED_area_type_hud_clear(wmWindowManager *wm, ScrArea *sa_keep) } } -void ED_area_type_hud_ensure(bContext *C, ScrArea *sa) +void ED_area_type_hud_ensure(bContext *C, ScrArea *area) { wmWindowManager *wm = CTX_wm_manager(C); - ED_area_type_hud_clear(wm, sa); + ED_area_type_hud_clear(wm, area); - ARegionType *art = BKE_regiontype_from_id(sa->type, RGN_TYPE_HUD); + ARegionType *art = BKE_regiontype_from_id(area->type, RGN_TYPE_HUD); if (art == NULL) { return; } - ARegion *region = BKE_area_find_region_type(sa, RGN_TYPE_HUD); + ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_HUD); if (region && (region->flag & RGN_FLAG_HIDDEN_BY_USER)) { /* The region is intentionally hidden by the user, don't show it. */ @@ -328,18 +328,18 @@ void ED_area_type_hud_ensure(bContext *C, ScrArea *sa) if (region == NULL) { init = true; - region = hud_region_add(sa); + region = hud_region_add(area); region->type = art; } /* Let 'ED_area_update_region_sizes' do the work of placing the region. * Otherwise we could set the 'region->winrct' & 'region->winx/winy' here. */ if (init) { - sa->flag |= AREA_FLAG_REGION_SIZE_UPDATE; + area->flag |= AREA_FLAG_REGION_SIZE_UPDATE; } else { if (region->flag & RGN_FLAG_HIDDEN) { - sa->flag |= AREA_FLAG_REGION_SIZE_UPDATE; + area->flag |= AREA_FLAG_REGION_SIZE_UPDATE; } region->flag &= ~RGN_FLAG_HIDDEN; } @@ -361,7 +361,7 @@ void ED_area_type_hud_ensure(bContext *C, ScrArea *sa) if (init) { /* This is needed or 'winrct' will be invalid. */ wmWindow *win = CTX_wm_window(C); - ED_area_update_region_sizes(wm, win, sa); + ED_area_update_region_sizes(wm, win, area); } ED_region_floating_initialize(region); diff --git a/source/blender/editors/interface/interface_region_menu_popup.c b/source/blender/editors/interface/interface_region_menu_popup.c index b3c10e8d6b8..dbec8e6d653 100644 --- a/source/blender/editors/interface/interface_region_menu_popup.c +++ b/source/blender/editors/interface/interface_region_menu_popup.c @@ -276,17 +276,17 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi else { /* for a header menu we set the direction automatic */ if (!pup->slideout && flip) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); - if (sa && region) { + if (area && region) { if (ELEM(region->regiontype, RGN_TYPE_HEADER, RGN_TYPE_TOOL_HEADER)) { - if (RGN_ALIGN_ENUM_FROM_MASK(ED_area_header_alignment(sa)) == RGN_ALIGN_BOTTOM) { + if (RGN_ALIGN_ENUM_FROM_MASK(ED_area_header_alignment(area)) == RGN_ALIGN_BOTTOM) { UI_block_direction_set(block, UI_DIR_UP); UI_block_order_flip(block); } } if (region->regiontype == RGN_TYPE_FOOTER) { - if (RGN_ALIGN_ENUM_FROM_MASK(ED_area_footer_alignment(sa)) == RGN_ALIGN_BOTTOM) { + if (RGN_ALIGN_ENUM_FROM_MASK(ED_area_footer_alignment(area)) == RGN_ALIGN_BOTTOM) { UI_block_direction_set(block, UI_DIR_UP); UI_block_order_flip(block); } diff --git a/source/blender/editors/interface/interface_region_popover.c b/source/blender/editors/interface/interface_region_popover.c index b889f1d6d01..0ad7e570e80 100644 --- a/source/blender/editors/interface/interface_region_popover.c +++ b/source/blender/editors/interface/interface_region_popover.c @@ -171,7 +171,7 @@ static uiBlock *ui_block_func_POPOVER(bContext *C, uiPopupBlockHandle *handle, v } if (!slideout) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); if (region && region->panels.first) { @@ -180,14 +180,14 @@ static uiBlock *ui_block_func_POPOVER(bContext *C, uiPopupBlockHandle *handle, v UI_block_direction_set(block, UI_DIR_UP | UI_DIR_CENTER_X); } /* Prefer popover from header to be positioned into the editor. */ - else if (sa && region) { + else if (area && region) { if (ELEM(region->regiontype, RGN_TYPE_HEADER, RGN_TYPE_TOOL_HEADER)) { - if (RGN_ALIGN_ENUM_FROM_MASK(ED_area_header_alignment(sa)) == RGN_ALIGN_BOTTOM) { + if (RGN_ALIGN_ENUM_FROM_MASK(ED_area_header_alignment(area)) == RGN_ALIGN_BOTTOM) { UI_block_direction_set(block, UI_DIR_UP | UI_DIR_CENTER_X); } } if (region->regiontype == RGN_TYPE_FOOTER) { - if (RGN_ALIGN_ENUM_FROM_MASK(ED_area_footer_alignment(sa)) == RGN_ALIGN_BOTTOM) { + if (RGN_ALIGN_ENUM_FROM_MASK(ED_area_footer_alignment(area)) == RGN_ALIGN_BOTTOM) { UI_block_direction_set(block, UI_DIR_UP | UI_DIR_CENTER_X); } } diff --git a/source/blender/editors/interface/interface_region_popup.c b/source/blender/editors/interface/interface_region_popup.c index 7e32a91d08d..e6381fd08e6 100644 --- a/source/blender/editors/interface/interface_region_popup.c +++ b/source/blender/editors/interface/interface_region_popup.c @@ -420,7 +420,7 @@ static void ui_block_region_draw(const bContext *C, ARegion *region) * Use to refresh centered popups on screen resizing (for splash). */ static void ui_block_region_popup_window_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -525,7 +525,7 @@ void ui_popup_block_scrolltest(uiBlock *block) static void ui_popup_block_remove(bContext *C, uiPopupBlockHandle *handle) { wmWindow *ctx_win = CTX_wm_window(C); - ScrArea *ctx_sa = CTX_wm_area(C); + ScrArea *ctx_area = CTX_wm_area(C); ARegion *ctx_region = CTX_wm_region(C); wmWindowManager *wm = CTX_wm_manager(C); @@ -550,7 +550,7 @@ static void ui_popup_block_remove(bContext *C, uiPopupBlockHandle *handle) /* Reset context (area and region were NULL'ed when chaning context window). */ CTX_wm_window_set(C, ctx_win); - CTX_wm_area_set(C, ctx_sa); + CTX_wm_area_set(C, ctx_area); CTX_wm_region_set(C, ctx_region); /* reset to region cursor (only if there's not another menu open) */ diff --git a/source/blender/editors/interface/interface_region_tooltip.c b/source/blender/editors/interface/interface_region_tooltip.c index cf8ff51eccf..61676ba43d6 100644 --- a/source/blender/editors/interface/interface_region_tooltip.c +++ b/source/blender/editors/interface/interface_region_tooltip.c @@ -393,15 +393,15 @@ static uiTooltipData *ui_tooltip_data_from_tool(bContext *C, uiBut *but, bool is bool has_valid_context = true; const char *has_valid_context_error = IFACE_("Unsupported context"); { - ScrArea *sa = CTX_wm_area(C); - if (sa == NULL) { + ScrArea *area = CTX_wm_area(C); + if (area == NULL) { has_valid_context = false; } else { PropertyRNA *prop = RNA_struct_find_property(but->opptr, "space_type"); if (RNA_property_is_set(but->opptr, prop)) { const int space_type_prop = RNA_property_enum_get(but->opptr, prop); - if (space_type_prop != sa->spacetype) { + if (space_type_prop != area->spacetype) { has_valid_context = false; } } diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index c750187d7a3..6bd956c87b0 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -6819,7 +6819,7 @@ static bool menu_items_from_ui_create_item_from_button(struct MenuSearch_Data *d */ static void menu_types_add_from_keymap_items(bContext *C, wmWindow *win, - ScrArea *sa, + ScrArea *area, ARegion *region, LinkNode **menuid_stack_p, GHash *menu_to_kmi, @@ -6828,7 +6828,7 @@ static void menu_types_add_from_keymap_items(bContext *C, wmWindowManager *wm = CTX_wm_manager(C); ListBase *handlers[] = { region ? ®ion->handlers : NULL, - sa ? &sa->handlers : NULL, + area ? &area->handlers : NULL, &win->handlers, }; @@ -6883,7 +6883,7 @@ static void menu_types_add_from_keymap_items(bContext *C, */ static struct MenuSearch_Data *menu_items_from_ui_create(bContext *C, wmWindow *win, - ScrArea *sa, + ScrArea *area, ARegion *region) { MemArena *memarena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, __func__); @@ -6941,8 +6941,8 @@ static struct MenuSearch_Data *menu_items_from_ui_create(bContext *C, case space_type: \ break - if (sa != NULL) { - switch (sa->spacetype) { + if (area != NULL) { + switch (area->spacetype) { SPACE_MENU_MAP(SPACE_VIEW3D, "VIEW3D_MT_editor_menus"); SPACE_MENU_MAP(SPACE_GRAPH, "GRAPH_MT_editor_menus"); SPACE_MENU_MAP(SPACE_OUTLINER, "OUTLINER_MT_editor_menus"); @@ -6958,13 +6958,13 @@ static struct MenuSearch_Data *menu_items_from_ui_create(bContext *C, SPACE_MENU_MAP(SPACE_CONSOLE, "CONSOLE_MT_editor_menus"); SPACE_MENU_MAP(SPACE_USERPREF, "USERPREF_MT_editor_menus"); SPACE_MENU_MAP(SPACE_CLIP, - (((const SpaceClip *)sa->spacedata.first)->mode == SC_MODE_TRACKING) ? + (((const SpaceClip *)area->spacedata.first)->mode == SC_MODE_TRACKING) ? "CLIP_MT_tracking_editor_menus" : "CLIP_MT_masking_editor_menus"); SPACE_MENU_NOP(SPACE_TOPBAR); SPACE_MENU_NOP(SPACE_STATUSBAR); default: - printf("Unknown space type '%d'\n", sa->spacetype); + printf("Unknown space type '%d'\n", area->spacetype); } } for (int i = 0; i < idname_array_len; i++) { @@ -7110,7 +7110,8 @@ static struct MenuSearch_Data *menu_items_from_ui_create(bContext *C, * so all menus are accessed from the header & top-bar before key shortcuts are expanded. */ if ((menu_stack == NULL) && (has_keymap_menu_items == false)) { has_keymap_menu_items = true; - menu_types_add_from_keymap_items(C, win, sa, region, &menu_stack, menu_to_kmi, menu_tagged); + menu_types_add_from_keymap_items( + C, win, area, region, &menu_stack, menu_to_kmi, menu_tagged); } } @@ -7299,9 +7300,9 @@ void UI_but_func_menu_search(uiBut *but) { bContext *C = but->block->evil_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); - struct MenuSearch_Data *data = menu_items_from_ui_create(C, win, sa, region); + struct MenuSearch_Data *data = menu_items_from_ui_create(C, win, area, region); UI_but_func_search_set(but, ui_searchbox_create_menu, menu_search_cb, @@ -7586,7 +7587,7 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C) { Main *bmain = CTX_data_main(C); wmWindowManager *wm = CTX_wm_manager(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); uiBlock *block; void *owner = NULL; int handle_event, icon = 0; @@ -7660,7 +7661,7 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C) * progress bar which is not being updated (bake jobs only need * to update NC_IMAGE context. */ - if (sa->spacetype != SPACE_NODE) { + if (area->spacetype != SPACE_NODE) { handle_event = B_STOPOTHER; icon = ICON_IMAGE; break; diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index adf0d6e372c..6fcce3a18e1 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -865,7 +865,6 @@ void UI_view2d_curRect_validate(View2D *v2d) * to make sure 'related' views stay in synchrony */ void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag) { - ScrArea *sa; ARegion *region; /* don't continue if no view syncing to be done */ @@ -900,8 +899,8 @@ void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag) /* check if doing whole screen syncing (i.e. time/horizontal) */ if ((v2dcur->flag & V2D_VIEWSYNC_SCREEN_TIME) && (screen)) { - for (sa = screen->areabase.first; sa; sa = sa->next) { - for (region = sa->regionbase.first; region; region = region->next) { + for (ScrArea *area_iter = screen->areabase.first; area_iter; area_iter = area_iter->next) { + for (region = area_iter->regionbase.first; region; region = region->next) { /* don't operate on self */ if (v2dcur != ®ion->v2d) { /* only if view has horizontal locks enabled */ @@ -1915,17 +1914,17 @@ View2D *UI_view2d_fromcontext(const bContext *C) /* same as above, but it returns regionwindow. Utility for pulldowns or buttons */ View2D *UI_view2d_fromcontext_rwin(const bContext *C) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); - if (sa == NULL) { + if (area == NULL) { return NULL; } if (region == NULL) { return NULL; } if (region->regiontype != RGN_TYPE_WINDOW) { - ARegion *region_win = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); + ARegion *region_win = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); return region_win ? &(region_win->v2d) : NULL; } return &(region->v2d); diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 2adf441514b..18e14798767 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -81,7 +81,7 @@ typedef struct v2dViewPanData { /** screen where view pan was initiated */ bScreen *sc; /** area where view pan was initiated */ - ScrArea *sa; + ScrArea *area; /** region where view pan was initiated */ ARegion *region; /** view2d we're operating in */ @@ -127,7 +127,7 @@ static int view_pan_init(bContext *C, wmOperator *op) /* set pointers to owners */ vpd->sc = CTX_wm_screen(C); - vpd->sa = CTX_wm_area(C); + vpd->area = CTX_wm_area(C); vpd->v2d = v2d; vpd->region = region; @@ -190,7 +190,7 @@ static void view_pan_apply_ex(bContext *C, v2dViewPanData *vpd, float dx, float /* request updates to be done... */ WM_event_add_mousemove(CTX_wm_window(C)); - UI_view2d_sync(vpd->sc, vpd->sa, v2d, V2D_LOCK_COPY); + UI_view2d_sync(vpd->sc, vpd->area, v2d, V2D_LOCK_COPY); } static void view_pan_apply(bContext *C, wmOperator *op) @@ -589,13 +589,13 @@ typedef struct v2dViewZoomData { */ static void view_zoom_axis_lock_defaults(bContext *C, bool r_do_zoom_xy[2]) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); r_do_zoom_xy[0] = true; r_do_zoom_xy[1] = true; /* default not to zoom the sequencer vertically */ - if (sa && sa->spacetype == SPACE_SEQ) { + if (area && area->spacetype == SPACE_SEQ) { ARegion *region = CTX_wm_region(C); if (region && region->regiontype == RGN_TYPE_WINDOW) { @@ -758,8 +758,8 @@ static void view_zoomstep_apply_ex( UI_view2d_curRect_validate(v2d); if (ED_region_snap_size_apply(region, snap_test)) { - ScrArea *sa = CTX_wm_area(C); - ED_area_tag_redraw(sa); + ScrArea *area = CTX_wm_area(C); + ED_area_tag_redraw(area); WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL); } @@ -1017,8 +1017,8 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op) UI_view2d_curRect_validate(v2d); if (ED_region_snap_size_apply(vzd->region, snap_test)) { - ScrArea *sa = CTX_wm_area(C); - ED_area_tag_redraw(sa); + ScrArea *area = CTX_wm_area(C); + ED_area_tag_redraw(area); WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL); } @@ -2211,8 +2211,8 @@ static int reset_exec(bContext *C, wmOperator *UNUSED(op)) UI_view2d_curRect_validate(v2d); if (ED_region_snap_size_apply(region, snap_test)) { - ScrArea *sa = CTX_wm_area(C); - ED_area_tag_redraw(sa); + ScrArea *area = CTX_wm_area(C); + ED_area_tag_redraw(area); WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL); } diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c index 9945383211a..767976b5ae6 100644 --- a/source/blender/editors/mask/mask_add.c +++ b/source/blender/editors/mask/mask_add.c @@ -444,11 +444,11 @@ static void mask_point_make_pixel_space(bContext *C, float point_normalized[2], float point_pixel[2]) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); float scalex, scaley; - ED_mask_pixelspace_factor(sa, region, &scalex, &scaley); + ED_mask_pixelspace_factor(area, region, &scalex, &scaley); point_pixel[0] = point_normalized[0] * scalex; point_pixel[1] = point_normalized[1] * scaley; @@ -556,12 +556,12 @@ static int add_vertex_exec(bContext *C, wmOperator *op) static int add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); float co[2]; - ED_mask_mouse_pos(sa, region, event->mval, co); + ED_mask_mouse_pos(area, region, event->mval, co); RNA_float_set_array(op->ptr, "location", co); @@ -648,12 +648,12 @@ static int add_feather_vertex_exec(bContext *C, wmOperator *op) static int add_feather_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); float co[2]; - ED_mask_mouse_pos(sa, region, event->mval, co); + ED_mask_mouse_pos(area, region, event->mval, co); RNA_float_set_array(op->ptr, "location", co); @@ -693,7 +693,7 @@ void MASK_OT_add_feather_vertex(wmOperatorType *ot) static int create_primitive_from_points( bContext *C, wmOperator *op, const float (*points)[2], int num_points, char handle_type) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); Mask *mask; MaskLayer *mask_layer; MaskSpline *new_spline; @@ -701,7 +701,7 @@ static int create_primitive_from_points( int i, width, height; int size = RNA_float_get(op->ptr, "size"); - ED_mask_get_size(sa, &width, &height); + ED_mask_get_size(area, &width, &height); scale = (float)size / max_ii(width, height); /* Get location in mask space. */ @@ -762,12 +762,12 @@ static int create_primitive_from_points( static int primitive_add_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); float cursor[2]; int width, height; - ED_mask_get_size(sa, &width, &height); - ED_mask_cursor_location_get(sa, cursor); + ED_mask_get_size(area, &width, &height); + ED_mask_cursor_location_get(area, cursor); cursor[0] *= width; cursor[1] *= height; diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c index 91c02408f95..88e9c7c3664 100644 --- a/source/blender/editors/mask/mask_draw.c +++ b/source/blender/editors/mask/mask_draw.c @@ -638,7 +638,7 @@ static void draw_mask_layers(const bContext *C, void ED_mask_draw(const bContext *C, const char draw_flag, const char draw_type) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); Mask *mask = CTX_data_edit_mask(C); int width, height; @@ -646,7 +646,7 @@ void ED_mask_draw(const bContext *C, const char draw_flag, const char draw_type) return; } - ED_mask_get_size(sa, &width, &height); + ED_mask_get_size(area, &width, &height); draw_mask_layers(C, mask, draw_flag, draw_type, width, height); } diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c index e696cc37bd3..663ae0097ad 100644 --- a/source/blender/editors/mask/mask_edit.c +++ b/source/blender/editors/mask/mask_edit.c @@ -44,9 +44,9 @@ bool ED_maskedit_poll(bContext *C) { - ScrArea *sa = CTX_wm_area(C); - if (sa) { - switch (sa->spacetype) { + ScrArea *area = CTX_wm_area(C); + if (area) { + switch (area->spacetype) { case SPACE_CLIP: return ED_space_clip_maskedit_poll(C); case SPACE_SEQ: @@ -60,9 +60,9 @@ bool ED_maskedit_poll(bContext *C) bool ED_maskedit_mask_poll(bContext *C) { - ScrArea *sa = CTX_wm_area(C); - if (sa) { - switch (sa->spacetype) { + ScrArea *area = CTX_wm_area(C); + if (area) { + switch (area->spacetype) { case SPACE_CLIP: return ED_space_clip_maskedit_mask_poll(C); case SPACE_SEQ: diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c index c4e3763dd94..a0ece69bf17 100644 --- a/source/blender/editors/mask/mask_ops.c +++ b/source/blender/editors/mask/mask_ops.c @@ -55,16 +55,16 @@ Mask *ED_mask_new(bContext *C, const char *name) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); Main *bmain = CTX_data_main(C); Mask *mask; mask = BKE_mask_new(bmain, name); - if (sa && sa->spacedata.first) { - switch (sa->spacetype) { + if (area && area->spacedata.first) { + switch (area->spacetype) { case SPACE_CLIP: { - SpaceClip *sc = sa->spacedata.first; + SpaceClip *sc = area->spacedata.first; ED_space_clip_set_mask(C, sc, mask); break; } @@ -73,7 +73,7 @@ Mask *ED_mask_new(bContext *C, const char *name) break; } case SPACE_IMAGE: { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; ED_space_image_set_mask(C, sima, mask); break; } @@ -260,7 +260,7 @@ static bool spline_under_mouse_get(const bContext *C, MaskSpline **r_mask_spline) { const float threshold = 19.0f; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); SpaceClip *sc = CTX_wm_space_clip(C); int width, height; float pixel_co[2]; @@ -270,7 +270,7 @@ static bool spline_under_mouse_get(const bContext *C, bool undistort = false; *r_mask_layer = NULL; *r_mask_spline = NULL; - ED_mask_get_size(sa, &width, &height); + ED_mask_get_size(area, &width, &height); pixel_co[0] = co[0] * width; pixel_co[1] = co[1] * height; if (sc != NULL) { @@ -420,7 +420,7 @@ static void check_sliding_handle_type(MaskSplinePoint *point, eMaskWhichHandle w static void *slide_point_customdata(bContext *C, wmOperator *op, const wmEvent *event) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); Mask *mask = CTX_data_edit_mask(C); @@ -435,8 +435,8 @@ static void *slide_point_customdata(bContext *C, wmOperator *op, const wmEvent * const float threshold = 19; eMaskWhichHandle which_handle; - ED_mask_mouse_pos(sa, region, event->mval, co); - ED_mask_get_size(sa, &width, &height); + ED_mask_mouse_pos(area, region, event->mval, co); + ED_mask_get_size(area, &width, &height); cv_point = ED_mask_point_find_nearest( C, mask, co, threshold, &cv_mask_layer, &cv_spline, &which_handle, &cv_score); @@ -534,7 +534,7 @@ static void *slide_point_customdata(bContext *C, wmOperator *op, const wmEvent * } customdata->which_handle = which_handle; - ED_mask_mouse_pos(sa, region, event->mval, customdata->prev_mouse_coord); + ED_mask_mouse_pos(area, region, event->mval, customdata->prev_mouse_coord); } return customdata; @@ -658,11 +658,11 @@ static int slide_point_modal(bContext *C, wmOperator *op, const wmEvent *event) ATTR_FALLTHROUGH; /* update CV position */ case MOUSEMOVE: { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); float delta[2]; - ED_mask_mouse_pos(sa, region, event->mval, co); + ED_mask_mouse_pos(area, region, event->mval, co); sub_v2_v2v2(delta, co, data->prev_mouse_coord); if (data->is_accurate) { mul_v2_fl(delta, 0.2f); diff --git a/source/blender/editors/mask/mask_query.c b/source/blender/editors/mask/mask_query.c index 6b1bb0a08e2..cf5997d8a18 100644 --- a/source/blender/editors/mask/mask_query.c +++ b/source/blender/editors/mask/mask_query.c @@ -61,7 +61,7 @@ bool ED_mask_find_nearest_diff_point(const bContext *C, float *r_u, float *r_score) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); MaskLayer *point_mask_layer; @@ -75,8 +75,8 @@ bool ED_mask_find_nearest_diff_point(const bContext *C, Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Mask *mask_eval = (Mask *)DEG_get_evaluated_id(depsgraph, &mask_orig->id); - ED_mask_get_size(sa, &width, &height); - ED_mask_pixelspace_factor(sa, region, &scalex, &scaley); + ED_mask_get_size(area, &width, &height); + ED_mask_pixelspace_factor(area, region, &scalex, &scaley); co[0] = normal_co[0] * scalex; co[1] = normal_co[1] * scaley; @@ -219,7 +219,7 @@ MaskSplinePoint *ED_mask_point_find_nearest(const bContext *C, eMaskWhichHandle *r_which_handle, float *r_score) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); MaskLayer *point_mask_layer = NULL; @@ -234,8 +234,8 @@ MaskSplinePoint *ED_mask_point_find_nearest(const bContext *C, Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Mask *mask_eval = (Mask *)DEG_get_evaluated_id(depsgraph, &mask_orig->id); - ED_mask_get_size(sa, &width, &height); - ED_mask_pixelspace_factor(sa, region, &scalex, &scaley); + ED_mask_get_size(area, &width, &height); + ED_mask_pixelspace_factor(area, region, &scalex, &scaley); co[0] = normal_co[0] * scalex; co[1] = normal_co[1] * scaley; @@ -374,7 +374,7 @@ bool ED_mask_feather_find_nearest(const bContext *C, MaskSplinePointUW **r_uw, float *r_score) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); MaskLayer *point_mask_layer = NULL; @@ -389,8 +389,8 @@ bool ED_mask_feather_find_nearest(const bContext *C, Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Mask *mask_eval = (Mask *)DEG_get_evaluated_id(depsgraph, &mask_orig->id); - ED_mask_get_size(sa, &width, &height); - ED_mask_pixelspace_factor(sa, region, &scalex, &scaley); + ED_mask_get_size(area, &width, &height); + ED_mask_pixelspace_factor(area, region, &scalex, &scaley); co[0] = normal_co[0] * scalex; co[1] = normal_co[1] * scaley; @@ -490,12 +490,12 @@ bool ED_mask_feather_find_nearest(const bContext *C, } /* takes event->mval */ -void ED_mask_mouse_pos(ScrArea *sa, ARegion *region, const int mval[2], float co[2]) +void ED_mask_mouse_pos(ScrArea *area, ARegion *region, const int mval[2], float co[2]) { - if (sa) { - switch (sa->spacetype) { + if (area) { + switch (area->spacetype) { case SPACE_CLIP: { - SpaceClip *sc = sa->spacedata.first; + SpaceClip *sc = area->spacedata.first; ED_clip_mouse_pos(sc, region, mval, co); BKE_mask_coord_from_movieclip(sc->clip, &sc->user, co, co); break; @@ -505,7 +505,7 @@ void ED_mask_mouse_pos(ScrArea *sa, ARegion *region, const int mval[2], float co break; } case SPACE_IMAGE: { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; ED_image_mouse_pos(sima, region, mval, co); BKE_mask_coord_from_image(sima->image, &sima->iuser, co, co); break; @@ -525,14 +525,14 @@ void ED_mask_mouse_pos(ScrArea *sa, ARegion *region, const int mval[2], float co /* input: x/y - mval space * output: xr/yr - mask point space */ -void ED_mask_point_pos(ScrArea *sa, ARegion *region, float x, float y, float *xr, float *yr) +void ED_mask_point_pos(ScrArea *area, ARegion *region, float x, float y, float *xr, float *yr) { float co[2]; - if (sa) { - switch (sa->spacetype) { + if (area) { + switch (area->spacetype) { case SPACE_CLIP: { - SpaceClip *sc = sa->spacedata.first; + SpaceClip *sc = area->spacedata.first; ED_clip_point_stable_pos(sc, region, x, y, &co[0], &co[1]); BKE_mask_coord_from_movieclip(sc->clip, &sc->user, co, co); break; @@ -541,7 +541,7 @@ void ED_mask_point_pos(ScrArea *sa, ARegion *region, float x, float y, float *xr zero_v2(co); /* MASKTODO */ break; case SPACE_IMAGE: { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; ED_image_point_pos(sima, region, x, y, &co[0], &co[1]); BKE_mask_coord_from_image(sima->image, &sima->iuser, co, co); break; @@ -563,14 +563,14 @@ void ED_mask_point_pos(ScrArea *sa, ARegion *region, float x, float y, float *xr } void ED_mask_point_pos__reverse( - ScrArea *sa, ARegion *region, float x, float y, float *xr, float *yr) + ScrArea *area, ARegion *region, float x, float y, float *xr, float *yr) { float co[2]; - if (sa) { - switch (sa->spacetype) { + if (area) { + switch (area->spacetype) { case SPACE_CLIP: { - SpaceClip *sc = sa->spacedata.first; + SpaceClip *sc = area->spacedata.first; co[0] = x; co[1] = y; BKE_mask_coord_to_movieclip(sc->clip, &sc->user, co, co); @@ -581,7 +581,7 @@ void ED_mask_point_pos__reverse( zero_v2(co); /* MASKTODO */ break; case SPACE_IMAGE: { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; co[0] = x; co[1] = y; BKE_mask_coord_to_image(sima->image, &sima->iuser, co, co); @@ -659,12 +659,12 @@ bool ED_mask_selected_minmax(const bContext *C, float min[2], float max[2]) /** \name Generic 2D View Queries * \{ */ -void ED_mask_get_size(ScrArea *sa, int *width, int *height) +void ED_mask_get_size(ScrArea *area, int *width, int *height) { - if (sa && sa->spacedata.first) { - switch (sa->spacetype) { + if (area && area->spacedata.first) { + switch (area->spacetype) { case SPACE_CLIP: { - SpaceClip *sc = sa->spacedata.first; + SpaceClip *sc = area->spacedata.first; ED_space_clip_get_size(sc, width, height); break; } @@ -675,7 +675,7 @@ void ED_mask_get_size(ScrArea *sa, int *width, int *height) break; } case SPACE_IMAGE: { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; ED_space_image_get_size(sima, width, height); break; } @@ -694,12 +694,12 @@ void ED_mask_get_size(ScrArea *sa, int *width, int *height) } } -void ED_mask_zoom(ScrArea *sa, ARegion *region, float *zoomx, float *zoomy) +void ED_mask_zoom(ScrArea *area, ARegion *region, float *zoomx, float *zoomy) { - if (sa && sa->spacedata.first) { - switch (sa->spacetype) { + if (area && area->spacedata.first) { + switch (area->spacetype) { case SPACE_CLIP: { - SpaceClip *sc = sa->spacedata.first; + SpaceClip *sc = area->spacedata.first; ED_space_clip_get_zoom(sc, region, zoomx, zoomy); break; } @@ -708,7 +708,7 @@ void ED_mask_zoom(ScrArea *sa, ARegion *region, float *zoomx, float *zoomy) break; } case SPACE_IMAGE: { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; ED_space_image_get_zoom(sima, region, zoomx, zoomy); break; } @@ -725,12 +725,12 @@ void ED_mask_zoom(ScrArea *sa, ARegion *region, float *zoomx, float *zoomy) } } -void ED_mask_get_aspect(ScrArea *sa, ARegion *UNUSED(region), float *aspx, float *aspy) +void ED_mask_get_aspect(ScrArea *area, ARegion *UNUSED(region), float *aspx, float *aspy) { - if (sa && sa->spacedata.first) { - switch (sa->spacetype) { + if (area && area->spacedata.first) { + switch (area->spacetype) { case SPACE_CLIP: { - SpaceClip *sc = sa->spacedata.first; + SpaceClip *sc = area->spacedata.first; ED_space_clip_get_aspect(sc, aspx, aspy); break; } @@ -739,7 +739,7 @@ void ED_mask_get_aspect(ScrArea *sa, ARegion *UNUSED(region), float *aspx, float break; } case SPACE_IMAGE: { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; ED_space_image_get_aspect(sima, aspx, aspy); break; } @@ -756,12 +756,12 @@ void ED_mask_get_aspect(ScrArea *sa, ARegion *UNUSED(region), float *aspx, float } } -void ED_mask_pixelspace_factor(ScrArea *sa, ARegion *region, float *scalex, float *scaley) +void ED_mask_pixelspace_factor(ScrArea *area, ARegion *region, float *scalex, float *scaley) { - if (sa && sa->spacedata.first) { - switch (sa->spacetype) { + if (area && area->spacedata.first) { + switch (area->spacetype) { case SPACE_CLIP: { - SpaceClip *sc = sa->spacedata.first; + SpaceClip *sc = area->spacedata.first; float aspx, aspy; UI_view2d_scale_get(®ion->v2d, scalex, scaley); @@ -776,7 +776,7 @@ void ED_mask_pixelspace_factor(ScrArea *sa, ARegion *region, float *scalex, floa break; } case SPACE_IMAGE: { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; float aspx, aspy; UI_view2d_scale_get(®ion->v2d, scalex, scaley); @@ -799,12 +799,12 @@ void ED_mask_pixelspace_factor(ScrArea *sa, ARegion *region, float *scalex, floa } } -void ED_mask_cursor_location_get(ScrArea *sa, float cursor[2]) +void ED_mask_cursor_location_get(ScrArea *area, float cursor[2]) { - if (sa) { - switch (sa->spacetype) { + if (area) { + switch (area->spacetype) { case SPACE_CLIP: { - SpaceClip *space_clip = sa->spacedata.first; + SpaceClip *space_clip = area->spacedata.first; copy_v2_v2(cursor, space_clip->cursor); break; } @@ -813,7 +813,7 @@ void ED_mask_cursor_location_get(ScrArea *sa, float cursor[2]) break; } case SPACE_IMAGE: { - SpaceImage *space_image = sa->spacedata.first; + SpaceImage *space_image = area->spacedata.first; copy_v2_v2(cursor, space_image->cursor); break; } diff --git a/source/blender/editors/mask/mask_select.c b/source/blender/editors/mask/mask_select.c index b21d20b360a..12d8a9005a9 100644 --- a/source/blender/editors/mask/mask_select.c +++ b/source/blender/editors/mask/mask_select.c @@ -385,12 +385,12 @@ static int select_exec(bContext *C, wmOperator *op) static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); float co[2]; - ED_mask_mouse_pos(sa, region, event->mval, co); + ED_mask_mouse_pos(area, region, event->mval, co); RNA_float_set_array(op->ptr, "location", co); @@ -435,7 +435,7 @@ void MASK_OT_select(wmOperatorType *ot) static int box_select_exec(bContext *C, wmOperator *op) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); Mask *mask = CTX_data_edit_mask(C); @@ -454,8 +454,8 @@ static int box_select_exec(bContext *C, wmOperator *op) /* get rectangle from operator */ WM_operator_properties_border_to_rcti(op, &rect); - ED_mask_point_pos(sa, region, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin); - ED_mask_point_pos(sa, region, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax); + ED_mask_point_pos(area, region, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin); + ED_mask_point_pos(area, region, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax); /* do actual selection */ for (MaskLayer *mask_layer = mask->masklayers.first; mask_layer; mask_layer = mask_layer->next) { @@ -525,7 +525,7 @@ static bool do_lasso_select_mask(bContext *C, short moves, const eSelectOp sel_op) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); Mask *mask = CTX_data_edit_mask(C); @@ -565,7 +565,7 @@ static bool do_lasso_select_mask(bContext *C, float screen_co[2]; /* point in screen coords */ - ED_mask_point_pos__reverse(sa, + ED_mask_point_pos__reverse(area, region, point_deform->bezt.vec[1][0], point_deform->bezt.vec[1][1], @@ -651,7 +651,7 @@ static int mask_spline_point_inside_ellipse(BezTriple *bezt, static int circle_select_exec(bContext *C, wmOperator *op) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); Mask *mask = CTX_data_edit_mask(C); @@ -667,14 +667,14 @@ static int circle_select_exec(bContext *C, wmOperator *op) const int radius = RNA_int_get(op->ptr, "radius"); /* compute ellipse and position in unified coordinates */ - ED_mask_get_size(sa, &width, &height); - ED_mask_zoom(sa, region, &zoomx, &zoomy); + ED_mask_get_size(area, &width, &height); + ED_mask_zoom(area, region, &zoomx, &zoomy); width = height = max_ii(width, height); ellipse[0] = width * zoomx / radius; ellipse[1] = height * zoomy / radius; - ED_mask_point_pos(sa, region, x, y, &offset[0], &offset[1]); + ED_mask_point_pos(area, region, x, y, &offset[0], &offset[1]); const eSelectOp sel_op = ED_select_op_modal(RNA_enum_get(op->ptr, "mode"), WM_gesture_is_modal_first(op->customdata)); @@ -748,7 +748,7 @@ void MASK_OT_select_circle(wmOperatorType *ot) static int mask_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); Mask *mask = CTX_data_edit_mask(C); @@ -760,7 +760,7 @@ static int mask_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmE const float threshold = 19; bool changed = false; - ED_mask_mouse_pos(sa, region, event->mval, co); + ED_mask_mouse_pos(area, region, event->mval, co); point = ED_mask_point_find_nearest(C, mask, co, threshold, &mask_layer, &spline, NULL, NULL); diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c index e91aaea91e0..e94412233ff 100644 --- a/source/blender/editors/mesh/editmesh_bevel.c +++ b/source/blender/editors/mesh/editmesh_bevel.c @@ -416,10 +416,10 @@ static bool edbm_bevel_calc(wmOperator *op) static void edbm_bevel_exit(bContext *C, wmOperator *op) { BevelData *opdata = op->customdata; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); - if (sa) { - ED_area_status_text(sa, NULL); + if (area) { + ED_area_status_text(area, NULL); } for (uint ob_index = 0; ob_index < opdata->ob_store_len; ob_index++) { diff --git a/source/blender/editors/mesh/editmesh_inset.c b/source/blender/editors/mesh/editmesh_inset.c index f2983f06da6..2eeada95eda 100644 --- a/source/blender/editors/mesh/editmesh_inset.c +++ b/source/blender/editors/mesh/editmesh_inset.c @@ -88,10 +88,10 @@ static void edbm_inset_update_header(wmOperator *op, bContext *C) "(%s)"); char msg[UI_MAX_DRAW_STR]; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); Scene *sce = CTX_data_scene(C); - if (sa) { + if (area) { char flts_str[NUM_STR_REP_LEN * 2]; if (hasNumInput(&opdata->num_input)) { outputNumInput(&opdata->num_input, flts_str, &sce->unit); @@ -111,7 +111,7 @@ static void edbm_inset_update_header(wmOperator *op, bContext *C) WM_bool_as_string(RNA_boolean_get(op->ptr, "use_boundary")), WM_bool_as_string(RNA_boolean_get(op->ptr, "use_individual"))); - ED_area_status_text(sa, msg); + ED_area_status_text(area, msg); } } @@ -189,7 +189,7 @@ static bool edbm_inset_init(bContext *C, wmOperator *op, const bool is_modal) static void edbm_inset_exit(bContext *C, wmOperator *op) { InsetData *opdata; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); opdata = op->customdata; @@ -206,8 +206,8 @@ static void edbm_inset_exit(bContext *C, wmOperator *op) G.moving = 0; } - if (sa) { - ED_area_status_text(sa, NULL); + if (area) { + ED_area_status_text(area, NULL); } MEM_SAFE_FREE(opdata->ob_store); diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index 481d5dfb9a5..b6838f5d7af 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -116,7 +116,7 @@ typedef struct BakeAPIRender { short *do_update; /* for redrawing */ - ScrArea *sa; + ScrArea *area; } BakeAPIRender; /* callbacks */ @@ -161,10 +161,10 @@ static int bake_break(void *UNUSED(rjv)) return 0; } -static void bake_update_image(ScrArea *sa, Image *image) +static void bake_update_image(ScrArea *area, Image *image) { - if (sa && sa->spacetype == SPACE_IMAGE) { /* in case the user changed while baking */ - SpaceImage *sima = sa->spacedata.first; + if (area && area->spacetype == SPACE_IMAGE) { /* in case the user changed while baking */ + SpaceImage *sima = area->spacedata.first; if (sima) { sima->image = image; } @@ -743,7 +743,7 @@ static int bake(Render *re, const int width, const int height, const char *identifier, - ScrArea *sa, + ScrArea *area, const char *uv_layer) { /* We build a depsgraph for the baking, @@ -1146,7 +1146,7 @@ static int bake(Render *re, is_noncolor); /* might be read by UI to set active image for display */ - bake_update_image(sa, bk_image->image); + bake_update_image(area, bk_image->image); if (!ok) { BKE_reportf(reports, @@ -1289,7 +1289,7 @@ static void bake_init_api_data(wmOperator *op, bContext *C, BakeAPIRender *bkr) bkr->main = CTX_data_main(C); bkr->view_layer = CTX_data_view_layer(C); bkr->scene = CTX_data_scene(C); - bkr->sa = sc ? BKE_screen_find_big_area(sc, SPACE_IMAGE, 10) : NULL; + bkr->area = sc ? BKE_screen_find_big_area(sc, SPACE_IMAGE, 10) : NULL; bkr->pass_type = RNA_enum_get(op->ptr, "type"); bkr->pass_filter = RNA_enum_get(op->ptr, "pass_filter"); @@ -1400,7 +1400,7 @@ static int bake_exec(bContext *C, wmOperator *op) bkr.width, bkr.height, bkr.identifier, - bkr.sa, + bkr.area, bkr.uv_layer); } else { @@ -1432,7 +1432,7 @@ static int bake_exec(bContext *C, wmOperator *op) bkr.width, bkr.height, bkr.identifier, - bkr.sa, + bkr.area, bkr.uv_layer); } } @@ -1501,7 +1501,7 @@ static void bake_startjob(void *bkv, short *UNUSED(stop), short *do_update, floa bkr->width, bkr->height, bkr->identifier, - bkr->sa, + bkr->area, bkr->uv_layer); } else { @@ -1533,7 +1533,7 @@ static void bake_startjob(void *bkv, short *UNUSED(stop), short *do_update, floa bkr->width, bkr->height, bkr->identifier, - bkr->sa, + bkr->area, bkr->uv_layer); if (bkr->result == OPERATOR_CANCELLED) { diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 8a40f65fc8a..75ae0299318 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -135,10 +135,10 @@ bool PE_hair_poll(bContext *C) bool PE_poll_view3d(bContext *C) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); - return (PE_poll(C) && (sa && sa->spacetype == SPACE_VIEW3D) && + return (PE_poll(C) && (area && area->spacetype == SPACE_VIEW3D) && (region && region->regiontype == RGN_TYPE_WINDOW)); } diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 8a8fd703845..3d87220979b 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -112,7 +112,7 @@ typedef struct RenderJob { ReportList *reports; int orig_layer; int last_layer; - ScrArea *sa; + ScrArea *area; ColorManagedViewSettings view_settings; ColorManagedDisplaySettings display_settings; bool supports_glsl_draw; @@ -543,24 +543,24 @@ static void render_progress_update(void *rjv, float progress) static void render_image_update_pass_and_layer(RenderJob *rj, RenderResult *rr, ImageUser *iuser) { wmWindowManager *wm; - ScrArea *first_sa = NULL, *matched_sa = NULL; + ScrArea *first_area = NULL, *matched_area = NULL; /* image window, compo node users */ - for (wm = rj->main->wm.first; wm && matched_sa == NULL; wm = wm->id.next) { /* only 1 wm */ + for (wm = rj->main->wm.first; wm && matched_area == NULL; wm = wm->id.next) { /* only 1 wm */ wmWindow *win; - for (win = wm->windows.first; win && matched_sa == NULL; win = win->next) { + for (win = wm->windows.first; win && matched_area == NULL; win = win->next) { const bScreen *screen = WM_window_get_active_screen(win); - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - if (sa->spacetype == SPACE_IMAGE) { - SpaceImage *sima = sa->spacedata.first; - // sa->spacedata might be empty when toggling fullscreen mode. + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + if (area->spacetype == SPACE_IMAGE) { + SpaceImage *sima = area->spacedata.first; + // area->spacedata might be empty when toggling fullscreen mode. if (sima != NULL && sima->image == rj->image) { - if (first_sa == NULL) { - first_sa = sa; + if (first_area == NULL) { + first_area = area; } - if (sa == rj->sa) { - matched_sa = sa; + if (area == rj->area) { + matched_area = area; break; } } @@ -569,12 +569,12 @@ static void render_image_update_pass_and_layer(RenderJob *rj, RenderResult *rr, } } - if (matched_sa == NULL) { - matched_sa = first_sa; + if (matched_area == NULL) { + matched_area = first_area; } - if (matched_sa) { - SpaceImage *sima = matched_sa->spacedata.first; + if (matched_area) { + SpaceImage *sima = matched_area->spacedata.first; RenderResult *main_rr = RE_AcquireResultRead(rj->re); /* TODO(sergey): is there faster way to get the layer index? */ @@ -689,10 +689,10 @@ static void render_image_restore_layer(RenderJob *rj) for (win = wm->windows.first; win; win = win->next) { const bScreen *screen = WM_window_get_active_screen(win); - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - if (sa == rj->sa) { - if (sa->spacetype == SPACE_IMAGE) { - SpaceImage *sima = sa->spacedata.first; + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + if (area == rj->area) { + if (area->spacetype == SPACE_IMAGE) { + SpaceImage *sima = area->spacedata.first; if (RE_HasSingleLayer(rj->re)) { /* For single layer renders keep the active layer @@ -748,7 +748,7 @@ static void render_endjob(void *rjv) WM_main_add_notifier(NC_NODE | NA_EDITED, rj->scene); } - if (rj->sa) { + if (rj->area) { render_image_restore_layer(rj); } @@ -920,7 +920,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even View3D *v3d = use_viewport ? CTX_wm_view3d(C) : NULL; struct Object *camera_override = v3d ? V3D_CAMERA_LOCAL(v3d) : NULL; const char *name; - ScrArea *sa; + ScrArea *area; /* Cannot do render if there is not this function. */ if (re_type->render == NULL) { @@ -970,7 +970,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even // store spare /* ensure at least 1 area shows result */ - sa = render_view_open(C, event->x, event->y, op->reports); + area = render_view_open(C, event->x, event->y, op->reports); /* job custom data */ rj = MEM_callocN(sizeof(RenderJob), "render job"); @@ -991,14 +991,14 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even rj->reports = op->reports; rj->orig_layer = 0; rj->last_layer = 0; - rj->sa = sa; + rj->area = area; rj->supports_glsl_draw = IMB_colormanagement_support_glsl_draw(&scene->view_settings); BKE_color_managed_display_settings_copy(&rj->display_settings, &scene->display_settings); BKE_color_managed_view_settings_copy(&rj->view_settings, &scene->view_settings); - if (sa) { - SpaceImage *sima = sa->spacedata.first; + if (area) { + SpaceImage *sima = area->spacedata.first; rj->orig_layer = sima->iuser.layer; } diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index fc22e3cd3e0..2c508472a9c 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -566,7 +566,7 @@ static Scene *preview_prepare_scene( /* new UI convention: draw is in pixel space already. */ /* uses UI_BTYPE_ROUNDBOX button in block to get the rect */ -static bool ed_preview_draw_rect(ScrArea *sa, int split, int first, rcti *rect, rcti *newrect) +static bool ed_preview_draw_rect(ScrArea *area, int split, int first, rcti *rect, rcti *newrect) { Render *re; RenderView *rv; @@ -578,10 +578,10 @@ static bool ed_preview_draw_rect(ScrArea *sa, int split, int first, rcti *rect, bool ok = false; if (!split || first) { - sprintf(name, "Preview %p", (void *)sa); + sprintf(name, "Preview %p", (void *)area); } else { - sprintf(name, "SecondPreview %p", (void *)sa); + sprintf(name, "SecondPreview %p", (void *)area); } if (split) { @@ -661,12 +661,12 @@ void ED_preview_draw(const bContext *C, void *idp, void *parentp, void *slotp, r { if (idp) { wmWindowManager *wm = CTX_wm_manager(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ID *id = (ID *)idp; ID *parent = (ID *)parentp; MTex *slot = (MTex *)slotp; SpaceProperties *sbuts = CTX_wm_space_properties(C); - ShaderPreview *sp = WM_jobs_customdata(wm, sa); + ShaderPreview *sp = WM_jobs_customdata(wm, area); rcti newrect; int ok; int newx = BLI_rcti_size_x(rect); @@ -678,11 +678,11 @@ void ED_preview_draw(const bContext *C, void *idp, void *parentp, void *slotp, r newrect.ymax = rect->ymin; if (parent) { - ok = ed_preview_draw_rect(sa, 1, 1, rect, &newrect); - ok &= ed_preview_draw_rect(sa, 1, 0, rect, &newrect); + ok = ed_preview_draw_rect(area, 1, 1, rect, &newrect); + ok &= ed_preview_draw_rect(area, 1, 0, rect, &newrect); } else { - ok = ed_preview_draw_rect(sa, 0, 0, rect, &newrect); + ok = ed_preview_draw_rect(area, 0, 0, rect, &newrect); } if (ok) { @@ -693,12 +693,12 @@ void ED_preview_draw(const bContext *C, void *idp, void *parentp, void *slotp, r * if no render result was found and no preview render job is running, * or if the job is running and the size of preview changed */ if ((sbuts != NULL && sbuts->preview) || - (!ok && !WM_jobs_test(wm, sa, WM_JOB_TYPE_RENDER_PREVIEW)) || + (!ok && !WM_jobs_test(wm, area, WM_JOB_TYPE_RENDER_PREVIEW)) || (sp && (abs(sp->sizex - newx) >= 2 || abs(sp->sizey - newy) > 2))) { if (sbuts != NULL) { sbuts->preview = 0; } - ED_preview_shader_job(C, sa, id, parent, slot, newx, newy, PR_BUTS_RENDER); + ED_preview_shader_job(C, area, id, parent, slot, newx, newy, PR_BUTS_RENDER); } } } diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index a0dfa54f8f5..99d9d585a30 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -100,15 +100,15 @@ */ static Object **object_array_for_shading(bContext *C, uint *r_objects_len) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); SpaceProperties *sbuts = NULL; View3D *v3d = NULL; - if (sa != NULL) { - if (sa->spacetype == SPACE_PROPERTIES) { - sbuts = sa->spacedata.first; + if (area != NULL) { + if (area->spacetype == SPACE_PROPERTIES) { + sbuts = area->spacedata.first; } - else if (sa->spacetype == SPACE_VIEW3D) { - v3d = sa->spacedata.first; + else if (area->spacetype == SPACE_VIEW3D) { + v3d = area->spacedata.first; } } diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c index d2bb53de06f..56b7e2a771d 100644 --- a/source/blender/editors/render/render_update.c +++ b/source/blender/editors/render/render_update.c @@ -106,17 +106,17 @@ void ED_render_scene_update(const DEGEditorUpdateContext *update_ctx, int update for (win = wm->windows.first; win; win = win->next) { bScreen *sc = WM_window_get_active_screen(win); - ScrArea *sa; + ScrArea *area; ARegion *region; CTX_wm_window_set(C, win); - for (sa = sc->areabase.first; sa; sa = sa->next) { - if (sa->spacetype != SPACE_VIEW3D) { + for (area = sc->areabase.first; area; area = area->next) { + if (area->spacetype != SPACE_VIEW3D) { continue; } - View3D *v3d = sa->spacedata.first; - for (region = sa->regionbase.first; region; region = region->next) { + View3D *v3d = area->spacedata.first; + for (region = area->regionbase.first; region; region = region->next) { if (region->regiontype != RGN_TYPE_WINDOW) { continue; } @@ -128,7 +128,7 @@ void ED_render_scene_update(const DEGEditorUpdateContext *update_ctx, int update if (engine && (updated || (engine->flag & RE_ENGINE_DO_UPDATE))) { CTX_wm_screen_set(C, sc); - CTX_wm_area_set(C, sa); + CTX_wm_area_set(C, area); CTX_wm_region_set(C, region); engine->flag &= ~RE_ENGINE_DO_UPDATE; @@ -146,7 +146,7 @@ void ED_render_scene_update(const DEGEditorUpdateContext *update_ctx, int update .scene = scene, .view_layer = view_layer, .region = region, - .v3d = (View3D *)sa->spacedata.first, + .v3d = (View3D *)area->spacedata.first, .engine_type = engine_type, })); } @@ -160,17 +160,17 @@ void ED_render_scene_update(const DEGEditorUpdateContext *update_ctx, int update recursive_check = false; } -void ED_render_engine_area_exit(Main *bmain, ScrArea *sa) +void ED_render_engine_area_exit(Main *bmain, ScrArea *area) { /* clear all render engines in this area */ ARegion *region; wmWindowManager *wm = bmain->wm.first; - if (sa->spacetype != SPACE_VIEW3D) { + if (area->spacetype != SPACE_VIEW3D) { return; } - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region->regiontype != RGN_TYPE_WINDOW || !(region->regiondata)) { continue; } @@ -182,8 +182,8 @@ void ED_render_engine_changed(Main *bmain) { /* on changing the render engine type, clear all running render engines */ for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) { - for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { - ED_render_engine_area_exit(bmain, sa); + for (ScrArea *area = sc->areabase.first; area; area = area->next) { + ED_render_engine_area_exit(bmain, area); } } RE_FreePersistentData(); @@ -206,8 +206,8 @@ void ED_render_engine_changed(Main *bmain) void ED_render_view_layer_changed(Main *bmain, bScreen *sc) { - for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { - ED_render_engine_area_exit(bmain, sa); + for (ScrArea *area = sc->areabase.first; area; area = area->next) { + ED_render_engine_area_exit(bmain, area); } } diff --git a/source/blender/editors/render/render_view.c b/source/blender/editors/render/render_view.c index a93ea343229..c0d35938787 100644 --- a/source/blender/editors/render/render_view.c +++ b/source/blender/editors/render/render_view.c @@ -57,22 +57,22 @@ static ScrArea *biggest_non_image_area(bContext *C) { bScreen *sc = CTX_wm_screen(C); - ScrArea *sa, *big = NULL; + ScrArea *area, *big = NULL; int size, maxsize = 0, bwmaxsize = 0; short foundwin = 0; - for (sa = sc->areabase.first; sa; sa = sa->next) { - if (sa->winx > 30 && sa->winy > 30) { - size = sa->winx * sa->winy; - if (!sa->full && sa->spacetype == SPACE_PROPERTIES) { + for (area = sc->areabase.first; area; area = area->next) { + if (area->winx > 30 && area->winy > 30) { + size = area->winx * area->winy; + if (!area->full && area->spacetype == SPACE_PROPERTIES) { if (foundwin == 0 && size > bwmaxsize) { bwmaxsize = size; - big = sa; + big = area; } } - else if (sa->spacetype != SPACE_IMAGE && size > maxsize) { + else if (area->spacetype != SPACE_IMAGE && size > maxsize) { maxsize = size; - big = sa; + big = area; foundwin = 1; } } @@ -84,7 +84,7 @@ static ScrArea *biggest_non_image_area(bContext *C) static ScrArea *find_area_showing_r_result(bContext *C, Scene *scene, wmWindow **win) { wmWindowManager *wm = CTX_wm_manager(C); - ScrArea *sa = NULL; + ScrArea *area = NULL; SpaceImage *sima; /* find an imagewindow showing render result */ @@ -92,40 +92,40 @@ static ScrArea *find_area_showing_r_result(bContext *C, Scene *scene, wmWindow * if (WM_window_get_active_scene(*win) == scene) { const bScreen *screen = WM_window_get_active_screen(*win); - for (sa = screen->areabase.first; sa; sa = sa->next) { - if (sa->spacetype == SPACE_IMAGE) { - sima = sa->spacedata.first; + for (area = screen->areabase.first; area; area = area->next) { + if (area->spacetype == SPACE_IMAGE) { + sima = area->spacedata.first; if (sima->image && sima->image->type == IMA_TYPE_R_RESULT) { break; } } } - if (sa) { + if (area) { break; } } } - return sa; + return area; } static ScrArea *find_area_image_empty(bContext *C) { bScreen *sc = CTX_wm_screen(C); - ScrArea *sa; + ScrArea *area; SpaceImage *sima; /* find an imagewindow showing render result */ - for (sa = sc->areabase.first; sa; sa = sa->next) { - if (sa->spacetype == SPACE_IMAGE) { - sima = sa->spacedata.first; + for (area = sc->areabase.first; area; area = area->next) { + if (area->spacetype == SPACE_IMAGE) { + sima = area->spacedata.first; if ((sima->mode == SI_MODE_VIEW) && !sima->image) { break; } } } - return sa; + return area; } /********************** open image editor for render *************************/ @@ -136,7 +136,7 @@ ScrArea *render_view_open(bContext *C, int mx, int my, ReportList *reports) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); wmWindow *win = NULL; - ScrArea *sa = NULL; + ScrArea *area = NULL; SpaceImage *sima; bool area_was_image = false; @@ -163,34 +163,34 @@ ScrArea *render_view_open(bContext *C, int mx, int my, ReportList *reports) return NULL; } - sa = CTX_wm_area(C); - if (BLI_listbase_is_single(&sa->spacedata) == false) { - sima = sa->spacedata.first; + area = CTX_wm_area(C); + if (BLI_listbase_is_single(&area->spacedata) == false) { + sima = area->spacedata.first; sima->flag |= SI_PREVSPACE; } } else if (U.render_display_type == USER_RENDER_DISPLAY_SCREEN) { - sa = CTX_wm_area(C); + area = CTX_wm_area(C); /* if the active screen is already in fullscreen mode, skip this and * unset the area, so that the fullscreen area is just changed later */ - if (sa && sa->full) { - sa = NULL; + if (area && area->full) { + area = NULL; } else { - if (sa && sa->spacetype == SPACE_IMAGE) { + if (area && area->spacetype == SPACE_IMAGE) { area_was_image = true; } /* this function returns with changed context */ - sa = ED_screen_full_newspace(C, sa, SPACE_IMAGE); + area = ED_screen_full_newspace(C, area, SPACE_IMAGE); } } - if (!sa) { - sa = find_area_showing_r_result(C, scene, &win); - if (sa == NULL) { - sa = find_area_image_empty(C); + if (!area) { + area = find_area_showing_r_result(C, scene, &win); + if (area == NULL) { + area = find_area_image_empty(C); } /* if area found in other window, we make that one show in front */ @@ -198,27 +198,27 @@ ScrArea *render_view_open(bContext *C, int mx, int my, ReportList *reports) wm_window_raise(win); } - if (sa == NULL) { + if (area == NULL) { /* find largest open non-image area */ - sa = biggest_non_image_area(C); - if (sa) { - ED_area_newspace(C, sa, SPACE_IMAGE, true); - sima = sa->spacedata.first; + area = biggest_non_image_area(C); + if (area) { + ED_area_newspace(C, area, SPACE_IMAGE, true); + sima = area->spacedata.first; /* makes ESC go back to prev space */ sima->flag |= SI_PREVSPACE; /* we already had a fullscreen here -> mark new space as a stacked fullscreen */ - if (sa->full) { - sa->flag |= AREA_FLAG_STACKED_FULLSCREEN; + if (area->full) { + area->flag |= AREA_FLAG_STACKED_FULLSCREEN; } } else { /* use any area of decent size */ - sa = BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_TYPE_ANY, 0); - if (sa->spacetype != SPACE_IMAGE) { - // XXX newspace(sa, SPACE_IMAGE); - sima = sa->spacedata.first; + area = BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_TYPE_ANY, 0); + if (area->spacetype != SPACE_IMAGE) { + // XXX newspace(area, SPACE_IMAGE); + sima = area->spacedata.first; /* makes ESC go back to prev space */ sima->flag |= SI_PREVSPACE; @@ -226,7 +226,7 @@ ScrArea *render_view_open(bContext *C, int mx, int my, ReportList *reports) } } } - sima = sa->spacedata.first; + sima = area->spacedata.first; sima->link_flag |= SPACE_FLAG_TYPE_TEMPORARY; /* get the correct image, and scale it */ @@ -234,7 +234,7 @@ ScrArea *render_view_open(bContext *C, int mx, int my, ReportList *reports) /* If we're rendering to full screen, set appropriate hints on image editor * so it can restore properly on pressing escape. */ - if (sa->full) { + if (area->full) { sima->flag |= SI_FULLWINDOW; /* Tell the image editor to revert to previous space in space list on close @@ -253,7 +253,7 @@ ScrArea *render_view_open(bContext *C, int mx, int my, ReportList *reports) old_sl->link_flag |= SPACE_FLAG_TYPE_WAS_ACTIVE; } - return sa; + return area; } /*************************** cancel render viewer **********************/ @@ -261,11 +261,11 @@ ScrArea *render_view_open(bContext *C, int mx, int my, ReportList *reports) static int render_view_cancel_exec(bContext *C, wmOperator *UNUSED(op)) { wmWindow *win = CTX_wm_window(C); - ScrArea *sa = CTX_wm_area(C); - SpaceImage *sima = sa->spacedata.first; + ScrArea *area = CTX_wm_area(C); + SpaceImage *sima = area->spacedata.first; /* ensure image editor fullscreen and area fullscreen states are in sync */ - if ((sima->flag & SI_FULLWINDOW) && !sa->full) { + if ((sima->flag & SI_FULLWINDOW) && !area->full) { sima->flag &= ~SI_FULLWINDOW; } @@ -275,17 +275,17 @@ static int render_view_cancel_exec(bContext *C, wmOperator *UNUSED(op)) if (sima->flag & SI_FULLWINDOW) { sima->flag &= ~SI_FULLWINDOW; - ED_screen_full_prevspace(C, sa); + ED_screen_full_prevspace(C, area); } else { - ED_area_prevspace(C, sa); + ED_area_prevspace(C, area); } return OPERATOR_FINISHED; } else if (sima->flag & SI_FULLWINDOW) { sima->flag &= ~SI_FULLWINDOW; - ED_screen_state_toggle(C, win, sa, SCREENMAXIMIZED); + ED_screen_state_toggle(C, win, area, SCREENMAXIMIZED); return OPERATOR_FINISHED; } else if (WM_window_is_temp_screen(win)) { @@ -320,7 +320,7 @@ static int render_view_show_invoke(bContext *C, wmOperator *op, const wmEvent *e } else { wmWindow *win, *winshow; - ScrArea *sa = find_area_showing_r_result(C, CTX_data_scene(C), &winshow); + ScrArea *area = find_area_showing_r_result(C, CTX_data_scene(C), &winshow); /* is there another window on current scene showing result? */ for (win = CTX_wm_manager(C)->windows.first; win; win = win->next) { @@ -335,20 +335,20 @@ static int render_view_show_invoke(bContext *C, wmOperator *op, const wmEvent *e } /* determine if render already shows */ - if (sa) { + if (area) { /* but don't close it when rendering */ if (G.is_rendering == false) { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; if (sima->flag & SI_PREVSPACE) { sima->flag &= ~SI_PREVSPACE; if (sima->flag & SI_FULLWINDOW) { sima->flag &= ~SI_FULLWINDOW; - ED_screen_full_prevspace(C, sa); + ED_screen_full_prevspace(C, area); } else { - ED_area_prevspace(C, sa); + ED_area_prevspace(C, area); } } } diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index efa98c358df..58e2bb8d037 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -146,7 +146,7 @@ void ED_region_pixelspace(ARegion *region) /* only exported for WM */ void ED_region_do_listen( - wmWindow *win, ScrArea *sa, ARegion *region, wmNotifier *note, const Scene *scene) + wmWindow *win, ScrArea *area, ARegion *region, wmNotifier *note, const Scene *scene) { /* generic notes first */ switch (note->category) { @@ -161,27 +161,27 @@ void ED_region_do_listen( } if (region->type && region->type->listener) { - region->type->listener(win, sa, region, note, scene); + region->type->listener(win, area, region, note, scene); } } /* only exported for WM */ -void ED_area_do_listen(wmWindow *win, ScrArea *sa, wmNotifier *note, Scene *scene) +void ED_area_do_listen(wmWindow *win, ScrArea *area, wmNotifier *note, Scene *scene) { /* no generic notes? */ - if (sa->type && sa->type->listener) { - sa->type->listener(win, sa, note, scene); + if (area->type && area->type->listener) { + area->type->listener(win, area, note, scene); } } /* only exported for WM */ -void ED_area_do_refresh(bContext *C, ScrArea *sa) +void ED_area_do_refresh(bContext *C, ScrArea *area) { /* no generic notes? */ - if (sa->type && sa->type->refresh) { - sa->type->refresh(C, sa); + if (area->type && area->type->refresh) { + area->type->refresh(C, area); } - sa->do_refresh = false; + area->do_refresh = false; } /** @@ -294,16 +294,16 @@ static void region_draw_azone_tab_arrow(AZone *az) draw_azone_arrow((float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, az->edge); } -static void area_azone_tag_update(ScrArea *sa) +static void area_azone_tag_update(ScrArea *area) { - sa->flag |= AREA_FLAG_ACTIONZONES_UPDATE; + area->flag |= AREA_FLAG_ACTIONZONES_UPDATE; } -static void region_draw_azones(ScrArea *sa, ARegion *region) +static void region_draw_azones(ScrArea *area, ARegion *region) { AZone *az; - if (!sa) { + if (!area) { return; } @@ -315,7 +315,7 @@ static void region_draw_azones(ScrArea *sa, ARegion *region) GPU_matrix_push(); GPU_matrix_translate_2f(-region->winrct.xmin, -region->winrct.ymin); - for (az = sa->actionzones.first; az; az = az->next) { + for (az = area->actionzones.first; az; az = az->next) { /* test if action zone is over this region */ rcti azrct; BLI_rcti_init(&azrct, az->x1, az->x2, az->y1, az->y2); @@ -339,7 +339,7 @@ static void region_draw_azones(ScrArea *sa, ARegion *region) } } if (!IS_EQF(az->alpha, 0.0f) && ELEM(az->type, AZONE_FULLSCREEN, AZONE_REGION_SCROLL)) { - area_azone_tag_update(sa); + area_azone_tag_update(area); } } @@ -348,9 +348,9 @@ static void region_draw_azones(ScrArea *sa, ARegion *region) GPU_blend(false); } -static void region_draw_status_text(ScrArea *sa, ARegion *region) +static void region_draw_status_text(ScrArea *area, ARegion *region) { - bool overlap = ED_region_is_overlap(sa->spacetype, region->regiontype); + bool overlap = ED_region_is_overlap(area->spacetype, region->regiontype); if (overlap) { GPU_clear_color(0.0, 0.0, 0.0, 0.0); @@ -421,8 +421,8 @@ void ED_area_do_msg_notify_tag_refresh( wmMsgSubscribeKey *UNUSED(msg_key), wmMsgSubscribeValue *msg_val) { - ScrArea *sa = msg_val->user_data; - ED_area_tag_refresh(sa); + ScrArea *area = msg_val->user_data; + ED_area_tag_refresh(area); } void ED_area_do_mgs_subscribe_for_tool_header( @@ -431,7 +431,7 @@ void ED_area_do_mgs_subscribe_for_tool_header( struct WorkSpace *workspace, struct Scene *UNUSED(scene), struct bScreen *UNUSED(screen), - struct ScrArea *UNUSED(sa), + struct ScrArea *UNUSED(area), struct ARegion *region, struct wmMsgBus *mbus) { @@ -451,7 +451,7 @@ void ED_area_do_mgs_subscribe_for_tool_ui( struct WorkSpace *workspace, struct Scene *UNUSED(scene), struct bScreen *UNUSED(screen), - struct ScrArea *UNUSED(sa), + struct ScrArea *UNUSED(area), struct ARegion *region, struct wmMsgBus *mbus) { @@ -483,20 +483,20 @@ static bool area_is_pseudo_minimized(const ScrArea *area) void ED_region_do_layout(bContext *C, ARegion *region) { /* This is optional, only needed for dynamically sized regions. */ - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegionType *at = region->type; if (!at->layout) { return; } - if (at->do_lock || (sa && area_is_pseudo_minimized(sa))) { + if (at->do_lock || (area && area_is_pseudo_minimized(area))) { return; } region->do_draw |= RGN_DRAWING; - UI_SetTheme(sa ? sa->spacetype : 0, at->regionid); + UI_SetTheme(area ? area->spacetype : 0, at->regionid); at->layout(C, region); } @@ -504,7 +504,7 @@ void ED_region_do_layout(bContext *C, ARegion *region) void ED_region_do_draw(bContext *C, ARegion *region) { wmWindow *win = CTX_wm_window(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegionType *at = region->type; /* see BKE_spacedata_draw_locks() */ @@ -519,16 +519,16 @@ void ED_region_do_draw(bContext *C, ARegion *region) wmOrtho2_region_pixelspace(region); - UI_SetTheme(sa ? sa->spacetype : 0, at->regionid); + UI_SetTheme(area ? area->spacetype : 0, at->regionid); - if (sa && area_is_pseudo_minimized(sa)) { + if (area && area_is_pseudo_minimized(area)) { UI_ThemeClearColor(TH_EDITOR_OUTLINE); glClear(GL_COLOR_BUFFER_BIT); return; } /* optional header info instead? */ else if (region->headerstr) { - region_draw_status_text(sa, region); + region_draw_status_text(area, region); } else if (at->draw) { at->draw(C, region); @@ -540,7 +540,7 @@ void ED_region_do_draw(bContext *C, ARegion *region) ED_region_draw_cb_draw(C, region, REGION_DRAW_POST_PIXEL); - region_draw_azones(sa, region); + region_draw_azones(area, region); /* for debugging unneeded area redraws and partial redraw */ if (G.debug_value == 888) { @@ -562,11 +562,11 @@ void ED_region_do_draw(bContext *C, ARegion *region) UI_blocklist_free_inactive(C, ®ion->uiblocks); - if (sa) { + if (area) { const bScreen *screen = WM_window_get_active_screen(win); /* Only region emboss for top-bar */ - if ((screen->state != SCREENFULL) && ED_area_is_global(sa)) { + if ((screen->state != SCREENFULL) && ED_area_is_global(area)) { region_draw_emboss(region, ®ion->winrct, (REGION_EMBOSS_LEFT | REGION_EMBOSS_RIGHT)); } else if ((region->regiontype == RGN_TYPE_WINDOW) && (region->alignment == RGN_ALIGN_QSPLIT)) { @@ -604,7 +604,7 @@ void ED_region_do_draw(bContext *C, ARegion *region) */ if (ELEM( region->regiontype, RGN_TYPE_WINDOW, RGN_TYPE_CHANNELS, RGN_TYPE_UI, RGN_TYPE_TOOLS)) { - SpaceLink *sl = sa->spacedata.first; + SpaceLink *sl = area->spacedata.first; PointerRNA ptr; RNA_pointer_create(&screen->id, &RNA_Space, sl, &ptr); @@ -618,7 +618,7 @@ void ED_region_do_draw(bContext *C, ARegion *region) WM_msg_subscribe_rna(mbus, &ptr, NULL, &msg_sub_value_region_tag_redraw, __func__); } - ED_region_message_subscribe(C, workspace, scene, screen, sa, region, mbus); + ED_region_message_subscribe(C, workspace, scene, screen, area, region, mbus); } } @@ -705,34 +705,34 @@ void ED_region_tag_redraw_partial(ARegion *region, const rcti *rct, bool rebuild } } -void ED_area_tag_redraw(ScrArea *sa) +void ED_area_tag_redraw(ScrArea *area) { ARegion *region; - if (sa) { - for (region = sa->regionbase.first; region; region = region->next) { + if (area) { + for (region = area->regionbase.first; region; region = region->next) { ED_region_tag_redraw(region); } } } -void ED_area_tag_redraw_no_rebuild(ScrArea *sa) +void ED_area_tag_redraw_no_rebuild(ScrArea *area) { ARegion *region; - if (sa) { - for (region = sa->regionbase.first; region; region = region->next) { + if (area) { + for (region = area->regionbase.first; region; region = region->next) { ED_region_tag_redraw_no_rebuild(region); } } } -void ED_area_tag_redraw_regiontype(ScrArea *sa, int regiontype) +void ED_area_tag_redraw_regiontype(ScrArea *area, int regiontype) { ARegion *region; - if (sa) { - for (region = sa->regionbase.first; region; region = region->next) { + if (area) { + for (region = area->regionbase.first; region; region = region->next) { if (region->regiontype == regiontype) { ED_region_tag_redraw(region); } @@ -740,26 +740,26 @@ void ED_area_tag_redraw_regiontype(ScrArea *sa, int regiontype) } } -void ED_area_tag_refresh(ScrArea *sa) +void ED_area_tag_refresh(ScrArea *area) { - if (sa) { - sa->do_refresh = true; + if (area) { + area->do_refresh = true; } } /* *************************************************************** */ /* use NULL to disable it */ -void ED_area_status_text(ScrArea *sa, const char *str) +void ED_area_status_text(ScrArea *area, const char *str) { ARegion *region; /* happens when running transform operators in background mode */ - if (sa == NULL) { + if (area == NULL) { return; } - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region->regiontype == RGN_TYPE_HEADER) { if (str) { if (region->headerstr == NULL) { @@ -799,9 +799,9 @@ void ED_workspace_status_text(bContext *C, const char *str) } /* Redraw status bar. */ - for (ScrArea *sa = win->global_areas.areabase.first; sa; sa = sa->next) { - if (sa->spacetype == SPACE_STATUSBAR) { - ED_area_tag_redraw(sa); + for (ScrArea *area = win->global_areas.areabase.first; area; area = area->next) { + if (area->spacetype == SPACE_STATUSBAR) { + ED_area_tag_redraw(area); break; } } @@ -809,12 +809,12 @@ void ED_workspace_status_text(bContext *C, const char *str) /* ************************************************************ */ -static void area_azone_initialize(wmWindow *win, const bScreen *screen, ScrArea *sa) +static void area_azone_initialize(wmWindow *win, const bScreen *screen, ScrArea *area) { AZone *az; /* reinitialize entirely, regions and fullscreen add azones too */ - BLI_freelistN(&sa->actionzones); + BLI_freelistN(&area->actionzones); if (screen->state != SCREENNORMAL) { return; @@ -824,7 +824,7 @@ static void area_azone_initialize(wmWindow *win, const bScreen *screen, ScrArea return; } - if (ED_area_is_global(sa)) { + if (ED_area_is_global(area)) { return; } @@ -834,25 +834,25 @@ static void area_azone_initialize(wmWindow *win, const bScreen *screen, ScrArea const float coords[4][4] = { /* Bottom-left. */ - {sa->totrct.xmin - U.pixelsize, - sa->totrct.ymin - U.pixelsize, - sa->totrct.xmin + AZONESPOTW, - sa->totrct.ymin + AZONESPOTH}, + {area->totrct.xmin - U.pixelsize, + area->totrct.ymin - U.pixelsize, + area->totrct.xmin + AZONESPOTW, + area->totrct.ymin + AZONESPOTH}, /* Bottom-right. */ - {sa->totrct.xmax - AZONESPOTW, - sa->totrct.ymin - U.pixelsize, - sa->totrct.xmax + U.pixelsize, - sa->totrct.ymin + AZONESPOTH}, + {area->totrct.xmax - AZONESPOTW, + area->totrct.ymin - U.pixelsize, + area->totrct.xmax + U.pixelsize, + area->totrct.ymin + AZONESPOTH}, /* Top-left. */ - {sa->totrct.xmin - U.pixelsize, - sa->totrct.ymax - AZONESPOTH, - sa->totrct.xmin + AZONESPOTW, - sa->totrct.ymax + U.pixelsize}, + {area->totrct.xmin - U.pixelsize, + area->totrct.ymax - AZONESPOTH, + area->totrct.xmin + AZONESPOTW, + area->totrct.ymax + U.pixelsize}, /* Top-right. */ - {sa->totrct.xmax - AZONESPOTW, - sa->totrct.ymax - AZONESPOTH, - sa->totrct.xmax + U.pixelsize, - sa->totrct.ymax + U.pixelsize}, + {area->totrct.xmax - AZONESPOTW, + area->totrct.ymax - AZONESPOTH, + area->totrct.xmax + U.pixelsize, + area->totrct.ymax + U.pixelsize}, }; for (int i = 0; i < 4; i++) { @@ -869,7 +869,7 @@ static void area_azone_initialize(wmWindow *win, const bScreen *screen, ScrArea /* set area action zones */ az = (AZone *)MEM_callocN(sizeof(AZone), "actionzone"); - BLI_addtail(&(sa->actionzones), az); + BLI_addtail(&(area->actionzones), az); az->type = AZONE_AREA; az->x1 = coords[i][0]; az->y1 = coords[i][1]; @@ -879,16 +879,16 @@ static void area_azone_initialize(wmWindow *win, const bScreen *screen, ScrArea } } -static void fullscreen_azone_initialize(ScrArea *sa, ARegion *region) +static void fullscreen_azone_initialize(ScrArea *area, ARegion *region) { AZone *az; - if (ED_area_is_global(sa) || (region->regiontype != RGN_TYPE_WINDOW)) { + if (ED_area_is_global(area) || (region->regiontype != RGN_TYPE_WINDOW)) { return; } az = (AZone *)MEM_callocN(sizeof(AZone), "fullscreen action zone"); - BLI_addtail(&(sa->actionzones), az); + BLI_addtail(&(area->actionzones), az); az->type = AZONE_FULLSCREEN; az->region = region; az->alpha = 0.0f; @@ -942,7 +942,7 @@ static void region_azone_edge(AZone *az, ARegion *region) } /* region already made zero sized, in shape of edge */ -static void region_azone_tab_plus(ScrArea *sa, AZone *az, ARegion *region) +static void region_azone_tab_plus(ScrArea *area, AZone *az, ARegion *region) { AZone *azt; int tot = 0, add; @@ -952,7 +952,7 @@ static void region_azone_tab_plus(ScrArea *sa, AZone *az, ARegion *region) const float tab_size_x = 0.7f * U.widget_unit; const float tab_size_y = 0.4f * U.widget_unit; - for (azt = sa->actionzones.first; azt; azt = azt->next) { + for (azt = area->actionzones.first; azt; azt = azt->next) { if (azt->edge == az->edge) { tot++; } @@ -960,7 +960,7 @@ static void region_azone_tab_plus(ScrArea *sa, AZone *az, ARegion *region) switch (az->edge) { case AE_TOP_TO_BOTTOMRIGHT: - add = (region->winrct.ymax == sa->totrct.ymin) ? 1 : 0; + add = (region->winrct.ymax == area->totrct.ymin) ? 1 : 0; az->x1 = region->winrct.xmax - ((edge_offset + 1.0f) * tab_size_x); az->y1 = region->winrct.ymax - add; az->x2 = region->winrct.xmax - (edge_offset * tab_size_x); @@ -1003,7 +1003,7 @@ static bool region_azone_edge_poll(const ARegion *region, const bool is_fullscre return true; } -static void region_azone_edge_initialize(ScrArea *sa, +static void region_azone_edge_initialize(ScrArea *area, ARegion *region, AZEdge edge, const bool is_fullscreen) @@ -1016,27 +1016,27 @@ static void region_azone_edge_initialize(ScrArea *sa, } az = (AZone *)MEM_callocN(sizeof(AZone), "actionzone"); - BLI_addtail(&(sa->actionzones), az); + BLI_addtail(&(area->actionzones), az); az->type = AZONE_REGION; az->region = region; az->edge = edge; if (is_hidden) { - region_azone_tab_plus(sa, az, region); + region_azone_tab_plus(area, az, region); } else { region_azone_edge(az, region); } } -static void region_azone_scrollbar_initialize(ScrArea *sa, +static void region_azone_scrollbar_initialize(ScrArea *area, ARegion *region, AZScrollDirection direction) { rcti scroller_vert = (direction == AZ_SCROLL_VERT) ? region->v2d.vert : region->v2d.hor; AZone *az = MEM_callocN(sizeof(*az), __func__); - BLI_addtail(&sa->actionzones, az); + BLI_addtail(&area->actionzones, az); az->type = AZONE_REGION_SCROLL; az->region = region; az->direction = direction; @@ -1057,21 +1057,21 @@ static void region_azone_scrollbar_initialize(ScrArea *sa, BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2); } -static void region_azones_scrollbars_initialize(ScrArea *sa, ARegion *region) +static void region_azones_scrollbars_initialize(ScrArea *area, ARegion *region) { const View2D *v2d = ®ion->v2d; if ((v2d->scroll & V2D_SCROLL_VERTICAL) && ((v2d->scroll & V2D_SCROLL_VERTICAL_HANDLES) == 0)) { - region_azone_scrollbar_initialize(sa, region, AZ_SCROLL_VERT); + region_azone_scrollbar_initialize(area, region, AZ_SCROLL_VERT); } if ((v2d->scroll & V2D_SCROLL_HORIZONTAL) && ((v2d->scroll & V2D_SCROLL_HORIZONTAL_HANDLES) == 0)) { - region_azone_scrollbar_initialize(sa, region, AZ_SCROLL_HOR); + region_azone_scrollbar_initialize(area, region, AZ_SCROLL_HOR); } } /* *************************************************************** */ -static void region_azones_add_edge(ScrArea *sa, +static void region_azones_add_edge(ScrArea *area, ARegion *region, const int alignment, const bool is_fullscreen) @@ -1079,20 +1079,20 @@ static void region_azones_add_edge(ScrArea *sa, /* edge code (t b l r) is along which area edge azone will be drawn */ if (alignment == RGN_ALIGN_TOP) { - region_azone_edge_initialize(sa, region, AE_BOTTOM_TO_TOPLEFT, is_fullscreen); + region_azone_edge_initialize(area, region, AE_BOTTOM_TO_TOPLEFT, is_fullscreen); } else if (alignment == RGN_ALIGN_BOTTOM) { - region_azone_edge_initialize(sa, region, AE_TOP_TO_BOTTOMRIGHT, is_fullscreen); + region_azone_edge_initialize(area, region, AE_TOP_TO_BOTTOMRIGHT, is_fullscreen); } else if (alignment == RGN_ALIGN_RIGHT) { - region_azone_edge_initialize(sa, region, AE_LEFT_TO_TOPRIGHT, is_fullscreen); + region_azone_edge_initialize(area, region, AE_LEFT_TO_TOPRIGHT, is_fullscreen); } else if (alignment == RGN_ALIGN_LEFT) { - region_azone_edge_initialize(sa, region, AE_RIGHT_TO_TOPLEFT, is_fullscreen); + region_azone_edge_initialize(area, region, AE_RIGHT_TO_TOPLEFT, is_fullscreen); } } -static void region_azones_add(const bScreen *screen, ScrArea *sa, ARegion *region) +static void region_azones_add(const bScreen *screen, ScrArea *area, ARegion *region) { const bool is_fullscreen = screen->state == SCREENFULL; @@ -1102,20 +1102,20 @@ static void region_azones_add(const bScreen *screen, ScrArea *sa, ARegion *regio return; } - region_azones_add_edge(sa, region, RGN_ALIGN_ENUM_FROM_MASK(region->alignment), is_fullscreen); + region_azones_add_edge(area, region, RGN_ALIGN_ENUM_FROM_MASK(region->alignment), is_fullscreen); /* For a split region also continue the azone edge from the next region if this region is aligned * with the next */ if ((region->alignment & RGN_SPLIT_PREV) && region->prev) { region_azones_add_edge( - sa, region, RGN_ALIGN_ENUM_FROM_MASK(region->prev->alignment), is_fullscreen); + area, region, RGN_ALIGN_ENUM_FROM_MASK(region->prev->alignment), is_fullscreen); } if (is_fullscreen) { - fullscreen_azone_initialize(sa, region); + fullscreen_azone_initialize(area, region); } - region_azones_scrollbars_initialize(sa, region); + region_azones_scrollbars_initialize(area, region); } /* dir is direction to check, not the splitting edge direction! */ @@ -1133,7 +1133,7 @@ static int rct_fits(const rcti *rect, char dir, int size) /* region should be overlapping */ /* function checks if some overlapping region was defined before - on same place */ -static void region_overlap_fix(ScrArea *sa, ARegion *region) +static void region_overlap_fix(ScrArea *area, ARegion *region) { ARegion *ar1; const int align = RGN_ALIGN_ENUM_FROM_MASK(region->alignment); @@ -1168,7 +1168,7 @@ static void region_overlap_fix(ScrArea *sa, ARegion *region) /* translate or close */ if (ar1) { if (align1 == RGN_ALIGN_LEFT) { - if (region->winrct.xmax + ar1->winx > sa->winx - U.widget_unit) { + if (region->winrct.xmax + ar1->winx > area->winx - U.widget_unit) { region->flag |= RGN_FLAG_TOO_SMALL; return; } @@ -1235,7 +1235,7 @@ bool ED_region_is_overlap(int spacetype, int regiontype) } static void region_rect_recursive( - ScrArea *sa, ARegion *region, rcti *remainder, rcti *overlap_remainder, int quad) + ScrArea *area, ARegion *region, rcti *remainder, rcti *overlap_remainder, int quad) { rcti *remainder_prev = remainder; @@ -1259,7 +1259,7 @@ static void region_rect_recursive( int alignment = RGN_ALIGN_ENUM_FROM_MASK(region->alignment); /* set here, assuming userpref switching forces to call this again */ - region->overlap = ED_region_is_overlap(sa->spacetype, region->regiontype); + region->overlap = ED_region_is_overlap(area->spacetype, region->regiontype); /* clear state flags first */ region->flag &= ~(RGN_FLAG_TOO_SMALL | RGN_FLAG_SIZE_CLAMP_X | RGN_FLAG_SIZE_CLAMP_Y); @@ -1300,7 +1300,7 @@ static void region_rect_recursive( else if (region->regiontype == RGN_TYPE_FOOTER) { prefsizey = ED_area_footersize(); } - else if (ED_area_is_global(sa)) { + else if (ED_area_is_global(area)) { prefsizey = ED_region_global_size_y(); } else { @@ -1501,7 +1501,7 @@ static void region_rect_recursive( /* exception for multiple overlapping regions on same spot */ if (region->overlap && (alignment != RGN_ALIGN_FLOAT)) { - region_overlap_fix(sa, region); + region_overlap_fix(area, region); } /* set winrect for azones */ @@ -1548,7 +1548,7 @@ static void region_rect_recursive( BLI_assert(BLI_rcti_is_valid(®ion->winrct)); - region_rect_recursive(sa, region->next, remainder, overlap_remainder, quad); + region_rect_recursive(area, region->next, remainder, overlap_remainder, quad); /* Tag for redraw if size changes. */ if (region->winx != prev_winx || region->winy != prev_winy) { @@ -1559,42 +1559,42 @@ static void region_rect_recursive( memset(®ion->runtime.visible_rect, 0, sizeof(region->runtime.visible_rect)); } -static void area_calc_totrct(ScrArea *sa, const rcti *window_rect) +static void area_calc_totrct(ScrArea *area, const rcti *window_rect) { short px = (short)U.pixelsize; - sa->totrct.xmin = sa->v1->vec.x; - sa->totrct.xmax = sa->v4->vec.x; - sa->totrct.ymin = sa->v1->vec.y; - sa->totrct.ymax = sa->v2->vec.y; + area->totrct.xmin = area->v1->vec.x; + area->totrct.xmax = area->v4->vec.x; + area->totrct.ymin = area->v1->vec.y; + area->totrct.ymax = area->v2->vec.y; /* scale down totrct by 1 pixel on all sides not matching window borders */ - if (sa->totrct.xmin > window_rect->xmin) { - sa->totrct.xmin += px; + if (area->totrct.xmin > window_rect->xmin) { + area->totrct.xmin += px; } - if (sa->totrct.xmax < (window_rect->xmax - 1)) { - sa->totrct.xmax -= px; + if (area->totrct.xmax < (window_rect->xmax - 1)) { + area->totrct.xmax -= px; } - if (sa->totrct.ymin > window_rect->ymin) { - sa->totrct.ymin += px; + if (area->totrct.ymin > window_rect->ymin) { + area->totrct.ymin += px; } - if (sa->totrct.ymax < (window_rect->ymax - 1)) { - sa->totrct.ymax -= px; + if (area->totrct.ymax < (window_rect->ymax - 1)) { + area->totrct.ymax -= px; } /* Although the following asserts are correct they lead to a very unstable Blender. * And the asserts would fail even in 2.7x * (they were added in 2.8x as part of the top-bar commit). * For more details see T54864. */ #if 0 - BLI_assert(sa->totrct.xmin >= 0); - BLI_assert(sa->totrct.xmax >= 0); - BLI_assert(sa->totrct.ymin >= 0); - BLI_assert(sa->totrct.ymax >= 0); + BLI_assert(area->totrct.xmin >= 0); + BLI_assert(area->totrct.xmax >= 0); + BLI_assert(area->totrct.ymin >= 0); + BLI_assert(area->totrct.ymax >= 0); #endif /* for speedup */ - sa->winx = BLI_rcti_size_x(&sa->totrct) + 1; - sa->winy = BLI_rcti_size_y(&sa->totrct) + 1; + area->winx = BLI_rcti_size_x(&area->totrct) + 1; + area->winy = BLI_rcti_size_y(&area->totrct) + 1; } /* used for area initialize below */ @@ -1617,12 +1617,12 @@ static bool event_in_markers_region(const ARegion *region, const wmEvent *event) } /** - * \param region: Region, may be NULL when adding handlers for \a sa. + * \param region: Region, may be NULL when adding handlers for \a area. */ static void ed_default_handlers( - wmWindowManager *wm, ScrArea *sa, ARegion *region, ListBase *handlers, int flag) + wmWindowManager *wm, ScrArea *area, ARegion *region, ListBase *handlers, int flag) { - BLI_assert(region ? (®ion->handlers == handlers) : (&sa->handlers == handlers)); + BLI_assert(region ? (®ion->handlers == handlers) : (&area->handlers == handlers)); /* note, add-handler checks if it already exists */ @@ -1641,7 +1641,7 @@ static void ed_default_handlers( BLI_assert(®ion->handlers == handlers); if (region->gizmo_map == NULL) { region->gizmo_map = WM_gizmomap_new_from_type( - &(const struct wmGizmoMapType_Params){sa->spacetype, region->type->regionid}); + &(const struct wmGizmoMapType_Params){area->spacetype, region->type->regionid}); } WM_gizmomap_add_handlers(region, region->gizmo_map); } @@ -1668,9 +1668,9 @@ static void ed_default_handlers( } if (flag & ED_KEYMAP_TOOL) { WM_event_add_keymap_handler_dynamic( - ®ion->handlers, WM_event_get_keymap_from_toolsystem_fallback, sa); + ®ion->handlers, WM_event_get_keymap_from_toolsystem_fallback, area); WM_event_add_keymap_handler_dynamic( - ®ion->handlers, WM_event_get_keymap_from_toolsystem, sa); + ®ion->handlers, WM_event_get_keymap_from_toolsystem, area); } if (flag & ED_KEYMAP_FRAMES) { /* frame changing/jumping (for all spaces) */ @@ -1841,7 +1841,7 @@ void ED_area_update_region_sizes(wmWindowManager *wm, wmWindow *win, ScrArea *ar } /* called in screen_refresh, or screens_init, also area size changes */ -void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa) +void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *area) { WorkSpace *workspace = WM_window_get_active_workspace(win); const bScreen *screen = BKE_workspace_active_screen_get(win->workspace_hook); @@ -1850,49 +1850,49 @@ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa) rcti rect, overlap_rect; rcti window_rect; - if (ED_area_is_global(sa) && (sa->global->flag & GLOBAL_AREA_IS_HIDDEN)) { + if (ED_area_is_global(area) && (area->global->flag & GLOBAL_AREA_IS_HIDDEN)) { return; } WM_window_rect_calc(win, &window_rect); /* set typedefinitions */ - sa->type = BKE_spacetype_from_id(sa->spacetype); + area->type = BKE_spacetype_from_id(area->spacetype); - if (sa->type == NULL) { - sa->spacetype = SPACE_VIEW3D; - sa->type = BKE_spacetype_from_id(sa->spacetype); + if (area->type == NULL) { + area->spacetype = SPACE_VIEW3D; + area->type = BKE_spacetype_from_id(area->spacetype); } - for (region = sa->regionbase.first; region; region = region->next) { - region->type = BKE_regiontype_from_id_or_first(sa->type, region->regiontype); + for (region = area->regionbase.first; region; region = region->next) { + region->type = BKE_regiontype_from_id_or_first(area->type, region->regiontype); } /* area sizes */ - area_calc_totrct(sa, &window_rect); + area_calc_totrct(area, &window_rect); /* region rect sizes */ - rect = sa->totrct; + rect = area->totrct; overlap_rect = rect; - region_rect_recursive(sa, sa->regionbase.first, &rect, &overlap_rect, 0); - sa->flag &= ~AREA_FLAG_REGION_SIZE_UPDATE; + region_rect_recursive(area, area->regionbase.first, &rect, &overlap_rect, 0); + area->flag &= ~AREA_FLAG_REGION_SIZE_UPDATE; /* default area handlers */ - ed_default_handlers(wm, sa, NULL, &sa->handlers, sa->type->keymapflag); + ed_default_handlers(wm, area, NULL, &area->handlers, area->type->keymapflag); /* checks spacedata, adds own handlers */ - if (sa->type->init) { - sa->type->init(wm, sa); + if (area->type->init) { + area->type->init(wm, area); } /* clear all azones, add the area triangle widgets */ - area_azone_initialize(win, screen, sa); + area_azone_initialize(win, screen, area); /* region windows, default and own handlers */ - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { region_subwindow(region); if (region->visible) { /* default region handlers */ - ed_default_handlers(wm, sa, region, ®ion->handlers, region->type->keymapflag); + ed_default_handlers(wm, area, region, ®ion->handlers, region->type->keymapflag); /* own handlers */ if (region->type->init) { region->type->init(wm, region); @@ -1904,18 +1904,18 @@ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa) } /* Some AZones use View2D data which is only updated in region init, so call that first! */ - region_azones_add(screen, sa, region); + region_azones_add(screen, area, region); } /* Avoid re-initializing tools while resizing the window. */ if ((G.moving & G_TRANSFORM_WM) == 0) { - if ((1 << sa->spacetype) & WM_TOOLSYSTEM_SPACE_MASK) { - WM_toolsystem_refresh_screen_area(workspace, view_layer, sa); - sa->flag |= AREA_FLAG_ACTIVE_TOOL_UPDATE; + if ((1 << area->spacetype) & WM_TOOLSYSTEM_SPACE_MASK) { + WM_toolsystem_refresh_screen_area(workspace, view_layer, area); + area->flag |= AREA_FLAG_ACTIVE_TOOL_UPDATE; } else { - sa->runtime.tool = NULL; - sa->runtime.is_tool_set = true; + area->runtime.tool = NULL; + area->runtime.is_tool_set = true; } } } @@ -1948,19 +1948,19 @@ void ED_region_floating_initialize(ARegion *region) region_update_rect(region); } -void ED_region_cursor_set(wmWindow *win, ScrArea *sa, ARegion *region) +void ED_region_cursor_set(wmWindow *win, ScrArea *area, ARegion *region) { if (region != NULL) { if ((region->gizmo_map != NULL) && WM_gizmomap_cursor_set(region->gizmo_map, win)) { return; } - if (sa && region->type && region->type->cursor) { - region->type->cursor(win, sa, region); + if (area && region->type && region->type->cursor) { + region->type->cursor(win, area, region); return; } } - if (WM_cursor_set_from_tool(win, sa, region)) { + if (WM_cursor_set_from_tool(win, area, region)) { return; } @@ -1968,29 +1968,29 @@ void ED_region_cursor_set(wmWindow *win, ScrArea *sa, ARegion *region) } /* for use after changing visibility of regions */ -void ED_region_visibility_change_update(bContext *C, ScrArea *sa, ARegion *region) +void ED_region_visibility_change_update(bContext *C, ScrArea *area, ARegion *region) { if (region->flag & RGN_FLAG_HIDDEN) { WM_event_remove_handlers(C, ®ion->handlers); } - ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa); - ED_area_tag_redraw(sa); + ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), area); + ED_area_tag_redraw(area); } /* for quick toggle, can skip fades */ void region_toggle_hidden(bContext *C, ARegion *region, const bool do_fade) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); region->flag ^= RGN_FLAG_HIDDEN; if (do_fade && region->overlap) { /* starts a timer, and in end calls the stuff below itself (region_sblend_invoke()) */ - ED_region_visibility_change_update_animated(C, sa, region); + ED_region_visibility_change_update_animated(C, area, region); } else { - ED_region_visibility_change_update(C, sa, region); + ED_region_visibility_change_update(C, area, region); } } @@ -2003,48 +2003,48 @@ void ED_region_toggle_hidden(bContext *C, ARegion *region) /** * we swap spaces for fullscreen to keep all allocated data area vertices were set */ -void ED_area_data_copy(ScrArea *sa_dst, ScrArea *sa_src, const bool do_free) +void ED_area_data_copy(ScrArea *area_dst, ScrArea *area_src, const bool do_free) { SpaceType *st; ARegion *region; - const char spacetype = sa_dst->spacetype; + const char spacetype = area_dst->spacetype; const short flag_copy = HEADER_NO_PULLDOWN; - sa_dst->spacetype = sa_src->spacetype; - sa_dst->type = sa_src->type; + area_dst->spacetype = area_src->spacetype; + area_dst->type = area_src->type; - sa_dst->flag = (sa_dst->flag & ~flag_copy) | (sa_src->flag & flag_copy); + area_dst->flag = (area_dst->flag & ~flag_copy) | (area_src->flag & flag_copy); /* area */ if (do_free) { - BKE_spacedata_freelist(&sa_dst->spacedata); + BKE_spacedata_freelist(&area_dst->spacedata); } - BKE_spacedata_copylist(&sa_dst->spacedata, &sa_src->spacedata); + BKE_spacedata_copylist(&area_dst->spacedata, &area_src->spacedata); /* Note; SPACE_EMPTY is possible on new screens */ /* regions */ if (do_free) { st = BKE_spacetype_from_id(spacetype); - for (region = sa_dst->regionbase.first; region; region = region->next) { + for (region = area_dst->regionbase.first; region; region = region->next) { BKE_area_region_free(st, region); } - BLI_freelistN(&sa_dst->regionbase); + BLI_freelistN(&area_dst->regionbase); } - st = BKE_spacetype_from_id(sa_src->spacetype); - for (region = sa_src->regionbase.first; region; region = region->next) { + st = BKE_spacetype_from_id(area_src->spacetype); + for (region = area_src->regionbase.first; region; region = region->next) { ARegion *newar = BKE_area_region_copy(st, region); - BLI_addtail(&sa_dst->regionbase, newar); + BLI_addtail(&area_dst->regionbase, newar); } } -void ED_area_data_swap(ScrArea *sa_dst, ScrArea *sa_src) +void ED_area_data_swap(ScrArea *area_dst, ScrArea *area_src) { - SWAP(char, sa_dst->spacetype, sa_src->spacetype); - SWAP(SpaceType *, sa_dst->type, sa_src->type); + SWAP(char, area_dst->spacetype, area_src->spacetype); + SWAP(SpaceType *, area_dst->type, area_src->type); - SWAP(ListBase, sa_dst->spacedata, sa_src->spacedata); - SWAP(ListBase, sa_dst->regionbase, sa_src->regionbase); + SWAP(ListBase, area_dst->spacedata, area_src->spacedata); + SWAP(ListBase, area_dst->regionbase, area_src->regionbase); } /* *********** Space switching code *********** */ @@ -2078,16 +2078,16 @@ void ED_area_swapspace(bContext *C, ScrArea *sa1, ScrArea *sa2) /** * \param skip_region_exit: Skip calling area exit callback. Set for opening temp spaces. */ -void ED_area_newspace(bContext *C, ScrArea *sa, int type, const bool skip_region_exit) +void ED_area_newspace(bContext *C, ScrArea *area, int type, const bool skip_region_exit) { wmWindow *win = CTX_wm_window(C); - if (sa->spacetype != type) { + if (area->spacetype != type) { SpaceType *st; - SpaceLink *slold = sa->spacedata.first; + SpaceLink *slold = area->spacedata.first; SpaceLink *sl; - /* store sa->type->exit callback */ - void *sa_exit = sa->type ? sa->type->exit : NULL; + /* store area->type->exit callback */ + void *area_exit = area->type ? area->type->exit : NULL; /* When the user switches between space-types from the type-selector, * changing the header-type is jarring (especially when using Ctrl-MouseWheel). * @@ -2098,34 +2098,34 @@ void ED_area_newspace(bContext *C, ScrArea *sa, int type, const bool skip_region * the space type defaults to in this case instead * (needed for preferences to have space-type on bottom). */ - int header_alignment = ED_area_header_alignment_or_fallback(sa, -1); + int header_alignment = ED_area_header_alignment_or_fallback(area, -1); const bool sync_header_alignment = ((header_alignment != -1) && ((slold->link_flag & SPACE_FLAG_TYPE_TEMPORARY) == 0)); /* in some cases (opening temp space) we don't want to * call area exit callback, so we temporarily unset it */ - if (skip_region_exit && sa->type) { - sa->type->exit = NULL; + if (skip_region_exit && area->type) { + area->type->exit = NULL; } - ED_area_exit(C, sa); + ED_area_exit(C, area); /* restore old area exit callback */ - if (skip_region_exit && sa->type) { - sa->type->exit = sa_exit; + if (skip_region_exit && area->type) { + area->type->exit = area_exit; } st = BKE_spacetype_from_id(type); - sa->spacetype = type; - sa->type = st; + area->spacetype = type; + area->type = st; /* If st->new may be called, don't use context until then. The - * sa->type->context() callback has changed but data may be invalid + * area->type->context() callback has changed but data may be invalid * (e.g. with properties editor) until space-data is properly created */ /* check previously stored space */ - for (sl = sa->spacedata.first; sl; sl = sl->next) { + for (sl = area->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == type) { break; } @@ -2134,7 +2134,7 @@ void ED_area_newspace(bContext *C, ScrArea *sa, int type, const bool skip_region /* old spacedata... happened during work on 2.50, remove */ if (sl && BLI_listbase_is_empty(&sl->regionbase)) { st->free(sl); - BLI_freelinkN(&sa->spacedata, sl); + BLI_freelinkN(&area->spacedata, sl); if (slold == sl) { slold = NULL; } @@ -2143,8 +2143,8 @@ void ED_area_newspace(bContext *C, ScrArea *sa, int type, const bool skip_region if (sl) { /* swap regions */ - slold->regionbase = sa->regionbase; - sa->regionbase = sl->regionbase; + slold->regionbase = area->regionbase; + area->regionbase = sl->regionbase; BLI_listbase_clear(&sl->regionbase); /* SPACE_FLAG_TYPE_WAS_ACTIVE is only used to go back to a previously active space that is * overlapped by temporary ones. It's now properly activated, so the flag should be cleared @@ -2152,22 +2152,22 @@ void ED_area_newspace(bContext *C, ScrArea *sa, int type, const bool skip_region sl->link_flag &= ~SPACE_FLAG_TYPE_WAS_ACTIVE; /* put in front of list */ - BLI_remlink(&sa->spacedata, sl); - BLI_addhead(&sa->spacedata, sl); + BLI_remlink(&area->spacedata, sl); + BLI_addhead(&area->spacedata, sl); } else { /* new space */ if (st) { /* Don't get scene from context here which may depend on space-data. */ Scene *scene = WM_window_get_active_scene(win); - sl = st->new (sa, scene); - BLI_addhead(&sa->spacedata, sl); + sl = st->new (area, scene); + BLI_addhead(&area->spacedata, sl); /* swap regions */ if (slold) { - slold->regionbase = sa->regionbase; + slold->regionbase = area->regionbase; } - sa->regionbase = sl->regionbase; + area->regionbase = sl->regionbase; BLI_listbase_clear(&sl->regionbase); } } @@ -2176,7 +2176,7 @@ void ED_area_newspace(bContext *C, ScrArea *sa, int type, const bool skip_region if (sync_header_alignment) { /* Spaces with footer. */ if (st->spaceid == SPACE_TEXT) { - for (ARegion *region = sa->regionbase.first; region; region = region->next) { + for (ARegion *region = area->regionbase.first; region; region = region->next) { if (ELEM(region->regiontype, RGN_TYPE_HEADER, RGN_TYPE_TOOL_HEADER)) { region->alignment = header_alignment; } @@ -2189,7 +2189,7 @@ void ED_area_newspace(bContext *C, ScrArea *sa, int type, const bool skip_region } } else { - for (ARegion *region = sa->regionbase.first; region; region = region->next) { + for (ARegion *region = area->regionbase.first; region; region = region->next) { if (ELEM(region->regiontype, RGN_TYPE_HEADER, RGN_TYPE_TOOL_HEADER)) { region->alignment = header_alignment; break; @@ -2198,24 +2198,24 @@ void ED_area_newspace(bContext *C, ScrArea *sa, int type, const bool skip_region } } - ED_area_initialize(CTX_wm_manager(C), win, sa); + ED_area_initialize(CTX_wm_manager(C), win, area); /* tell WM to refresh, cursor types etc */ WM_event_add_mousemove(win); /* send space change notifier */ - WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CHANGED, sa); + WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CHANGED, area); - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } /* also redraw when re-used */ - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } -static SpaceLink *area_get_prevspace(ScrArea *sa) +static SpaceLink *area_get_prevspace(ScrArea *area) { - SpaceLink *sl = sa->spacedata.first; + SpaceLink *sl = area->spacedata.first; /* First toggle to the next temporary space in the list. */ for (SpaceLink *sl_iter = sl->next; sl_iter; sl_iter = sl_iter->next) { @@ -2235,13 +2235,13 @@ static SpaceLink *area_get_prevspace(ScrArea *sa) return sl->next; } -void ED_area_prevspace(bContext *C, ScrArea *sa) +void ED_area_prevspace(bContext *C, ScrArea *area) { - SpaceLink *sl = sa->spacedata.first; - SpaceLink *prevspace = sl ? area_get_prevspace(sa) : NULL; + SpaceLink *sl = area->spacedata.first; + SpaceLink *prevspace = sl ? area_get_prevspace(area) : NULL; if (prevspace) { - ED_area_newspace(C, sa, prevspace->spacetype, false); + ED_area_newspace(C, area, prevspace->spacetype, false); /* We've exited the space, so it can't be considered temporary anymore. */ sl->link_flag &= ~SPACE_FLAG_TYPE_TEMPORARY; } @@ -2251,23 +2251,23 @@ void ED_area_prevspace(bContext *C, ScrArea *sa) } /* If this is a stacked fullscreen, changing to previous area exits it (meaning we're still in a * fullscreen, but not in a stacked one). */ - sa->flag &= ~AREA_FLAG_STACKED_FULLSCREEN; + area->flag &= ~AREA_FLAG_STACKED_FULLSCREEN; - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); /* send space change notifier */ - WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CHANGED, sa); + WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CHANGED, area); } /* returns offset for next button in header */ int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); bScreen *scr = CTX_wm_screen(C); PointerRNA areaptr; int xco = 0.4 * U.widget_unit; - RNA_pointer_create(&(scr->id), &RNA_Area, sa, &areaptr); + RNA_pointer_create(&(scr->id), &RNA_Area, area, &areaptr); uiDefButR(block, UI_BTYPE_MENU, @@ -2342,7 +2342,7 @@ BLI_INLINE bool streq_array_any(const char *s, const char *arr[]) } static void ed_panel_draw(const bContext *C, - ScrArea *sa, + ScrArea *area, ARegion *region, ListBase *lb, PanelType *pt, @@ -2357,7 +2357,7 @@ static void ed_panel_draw(const bContext *C, uiBlock *block = UI_block_begin(C, region, pt->idname, UI_EMBOSS); bool open; - panel = UI_panel_begin(sa, region, lb, block, pt, panel, &open); + panel = UI_panel_begin(area, region, lb, block, pt, panel, &open); /* bad fixed values */ int xco, yco, h = 0; @@ -2445,12 +2445,12 @@ static void ed_panel_draw(const bContext *C, Panel *child_panel = UI_panel_find_by_type(&panel->children, child_pt); if (child_pt->draw && (!child_pt->poll || child_pt->poll(C, child_pt))) { - ed_panel_draw(C, sa, region, &panel->children, child_pt, child_panel, w, em, vertical); + ed_panel_draw(C, area, region, &panel->children, child_pt, child_panel, w, em, vertical); } } } - UI_panel_end(sa, region, block, w, h, open); + UI_panel_end(area, region, block, w, h, open); } /** @@ -2499,7 +2499,7 @@ void ED_region_panels_layout_ex(const bContext *C, region->runtime.category = NULL; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); View2D *v2d = ®ion->v2d; int x, y, w, em; @@ -2508,7 +2508,7 @@ void ED_region_panels_layout_ex(const bContext *C, bool use_category_tabs = (category_override == NULL) && ((((1 << region->regiontype) & RGN_TYPE_HAS_CATEGORY_MASK) || (region->regiontype == RGN_TYPE_TOOLS && - sa->spacetype == SPACE_CLIP))); + area->spacetype == SPACE_CLIP))); /* offset panels for small vertical tab area */ const char *category = NULL; const int category_tabs_width = UI_PANEL_CATEGORY_MARGIN_WIDTH; @@ -2584,7 +2584,7 @@ void ED_region_panels_layout_ex(const bContext *C, } } - ed_panel_draw(C, sa, region, ®ion->panels, pt, panel, w, em, vertical); + ed_panel_draw(C, area, region, ®ion->panels, pt, panel, w, em, vertical); } /* align panels and return size */ @@ -2605,7 +2605,7 @@ void ED_region_panels_layout_ex(const bContext *C, if ((region->sizex != size_dyn[0]) || (region->sizey != size_dyn[1])) { region->sizex = size_dyn[0]; region->sizey = size_dyn[1]; - sa->flag |= AREA_FLAG_REGION_SIZE_UPDATE; + area->flag |= AREA_FLAG_REGION_SIZE_UPDATE; } y = fabsf(region->sizey * UI_DPI_FAC - 1); } @@ -2799,10 +2799,10 @@ void ED_region_header_layout(const bContext *C, ARegion *region) if (region_layout_based && (region->sizex != new_sizex)) { /* region size is layout based and needs to be updated */ - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); region->sizex = new_sizex; - sa->flag |= AREA_FLAG_REGION_SIZE_UPDATE; + area->flag |= AREA_FLAG_REGION_SIZE_UPDATE; } UI_block_end(C, block); @@ -3575,7 +3575,7 @@ void ED_region_message_subscribe(bContext *C, struct WorkSpace *workspace, struct Scene *scene, struct bScreen *screen, - struct ScrArea *sa, + struct ScrArea *area, struct ARegion *region, struct wmMsgBus *mbus) { @@ -3588,7 +3588,7 @@ void ED_region_message_subscribe(bContext *C, } if (region->type->message_subscribe != NULL) { - region->type->message_subscribe(C, workspace, scene, screen, sa, region, mbus); + region->type->message_subscribe(C, workspace, scene, screen, area, region, mbus); } } diff --git a/source/blender/editors/screen/area_utils.c b/source/blender/editors/screen/area_utils.c index cacd6b1edd7..075759f1120 100644 --- a/source/blender/editors/screen/area_utils.c +++ b/source/blender/editors/screen/area_utils.c @@ -46,7 +46,7 @@ void ED_region_generic_tools_region_message_subscribe(const struct bContext *UNU struct WorkSpace *UNUSED(workspace), struct Scene *UNUSED(scene), struct bScreen *UNUSED(screen), - struct ScrArea *UNUSED(sa), + struct ScrArea *UNUSED(area), struct ARegion *region, struct wmMsgBus *mbus) { diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index 5ae1a89ba9b..778a3740622 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -114,7 +114,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult wmWindow *win = CTX_wm_window(C); View3D *v3d = CTX_wm_view3d(C); /* This may be NULL in a lot of cases. */ bScreen *sc = CTX_wm_screen(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); Scene *scene = WM_window_get_active_scene(win); ViewLayer *view_layer = WM_window_get_active_view_layer(win); Object *obact = (view_layer && view_layer->basact) ? view_layer->basact->object : NULL; @@ -533,7 +533,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult * That causes the get_active function to fail when called from context. * For that reason, we end up using an alternative where we pass everything in! */ - bGPdata *gpd = ED_gpencil_data_get_active_direct(sa, obact); + bGPdata *gpd = ED_gpencil_data_get_active_direct(area, obact); if (gpd) { CTX_data_id_pointer_set(result, &gpd->id); @@ -547,7 +547,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult PointerRNA ptr; /* get pointer to Grease Pencil Data */ - gpd_ptr = ED_gpencil_data_get_pointers_direct(sa, obact, &ptr); + gpd_ptr = ED_gpencil_data_get_pointers_direct(area, obact, &ptr); if (gpd_ptr) { CTX_data_pointer_set(result, ptr.owner_id, ptr.type, ptr.data); @@ -555,7 +555,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } } else if (CTX_data_equals(member, "annotation_data")) { - bGPdata *gpd = ED_annotation_data_get_active_direct((ID *)sc, sa, scene); + bGPdata *gpd = ED_annotation_data_get_active_direct((ID *)sc, area, scene); if (gpd) { CTX_data_id_pointer_set(result, &gpd->id); @@ -568,7 +568,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult PointerRNA ptr; /* Get pointer to Grease Pencil Data. */ - gpd_ptr = ED_annotation_data_get_pointers_direct((ID *)sc, sa, scene, &ptr); + gpd_ptr = ED_annotation_data_get_pointers_direct((ID *)sc, area, scene, &ptr); if (gpd_ptr) { CTX_data_pointer_set(result, ptr.owner_id, ptr.type, ptr.data); @@ -576,7 +576,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } } else if (CTX_data_equals(member, "active_gpencil_layer")) { - bGPdata *gpd = ED_gpencil_data_get_active_direct(sa, obact); + bGPdata *gpd = ED_gpencil_data_get_active_direct(area, obact); if (gpd) { bGPDlayer *gpl = BKE_gpencil_layer_active_get(gpd); @@ -588,7 +588,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } } else if (CTX_data_equals(member, "active_annotation_layer")) { - bGPdata *gpd = ED_annotation_data_get_active_direct((ID *)sc, sa, scene); + bGPdata *gpd = ED_annotation_data_get_active_direct((ID *)sc, area, scene); if (gpd) { bGPDlayer *gpl = BKE_gpencil_layer_active_get(gpd); @@ -600,7 +600,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } } else if (CTX_data_equals(member, "active_gpencil_frame")) { - bGPdata *gpd = ED_gpencil_data_get_active_direct(sa, obact); + bGPdata *gpd = ED_gpencil_data_get_active_direct(area, obact); if (gpd) { bGPDlayer *gpl = BKE_gpencil_layer_active_get(gpd); @@ -612,7 +612,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } } else if (CTX_data_equals(member, "visible_gpencil_layers")) { - bGPdata *gpd = ED_gpencil_data_get_active_direct(sa, obact); + bGPdata *gpd = ED_gpencil_data_get_active_direct(area, obact); if (gpd) { bGPDlayer *gpl; @@ -627,7 +627,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } } else if (CTX_data_equals(member, "editable_gpencil_layers")) { - bGPdata *gpd = ED_gpencil_data_get_active_direct(sa, obact); + bGPdata *gpd = ED_gpencil_data_get_active_direct(area, obact); if (gpd) { bGPDlayer *gpl; @@ -642,7 +642,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } } else if (CTX_data_equals(member, "editable_gpencil_strokes")) { - bGPdata *gpd = ED_gpencil_data_get_active_direct(sa, obact); + bGPdata *gpd = ED_gpencil_data_get_active_direct(area, obact); const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd); if (gpd) { @@ -660,7 +660,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult for (gpf = init_gpf; gpf; gpf = gpf->next) { if ((gpf == gpl->actframe) || ((gpf->flag & GP_FRAME_SELECT) && (is_multiedit))) { for (gps = gpf->strokes.first; gps; gps = gps->next) { - if (ED_gpencil_stroke_can_use_direct(sa, gps)) { + if (ED_gpencil_stroke_can_use_direct(area, gps)) { /* check if the color is editable */ if (ED_gpencil_stroke_color_use(obact, gpl, gps) == false) { continue; diff --git a/source/blender/editors/screen/screen_draw.c b/source/blender/editors/screen/screen_draw.c index dbc7609722c..c1b6df07129 100644 --- a/source/blender/editors/screen/screen_draw.c +++ b/source/blender/editors/screen/screen_draw.c @@ -41,10 +41,10 @@ * Draw horizontal shape visualizing future joining * (left as well right direction of future joining). */ -static void draw_horizontal_join_shape(ScrArea *sa, char dir, uint pos) +static void draw_horizontal_join_shape(ScrArea *area, char dir, uint pos) { - const float width = screen_geom_area_width(sa) - 1; - const float height = screen_geom_area_height(sa) - 1; + const float width = screen_geom_area_width(area) - 1; + const float height = screen_geom_area_height(area) - 1; vec2f points[10]; short i; float w, h; @@ -58,43 +58,43 @@ static void draw_horizontal_join_shape(ScrArea *sa, char dir, uint pos) w = width / 4; } - points[0].x = sa->v1->vec.x; - points[0].y = sa->v1->vec.y + height / 2; + points[0].x = area->v1->vec.x; + points[0].y = area->v1->vec.y + height / 2; - points[1].x = sa->v1->vec.x; - points[1].y = sa->v1->vec.y; + points[1].x = area->v1->vec.x; + points[1].y = area->v1->vec.y; - points[2].x = sa->v4->vec.x - w; - points[2].y = sa->v4->vec.y; + points[2].x = area->v4->vec.x - w; + points[2].y = area->v4->vec.y; - points[3].x = sa->v4->vec.x - w; - points[3].y = sa->v4->vec.y + height / 2 - 2 * h; + points[3].x = area->v4->vec.x - w; + points[3].y = area->v4->vec.y + height / 2 - 2 * h; - points[4].x = sa->v4->vec.x - 2 * w; - points[4].y = sa->v4->vec.y + height / 2; + points[4].x = area->v4->vec.x - 2 * w; + points[4].y = area->v4->vec.y + height / 2; - points[5].x = sa->v4->vec.x - w; - points[5].y = sa->v4->vec.y + height / 2 + 2 * h; + points[5].x = area->v4->vec.x - w; + points[5].y = area->v4->vec.y + height / 2 + 2 * h; - points[6].x = sa->v3->vec.x - w; - points[6].y = sa->v3->vec.y; + points[6].x = area->v3->vec.x - w; + points[6].y = area->v3->vec.y; - points[7].x = sa->v2->vec.x; - points[7].y = sa->v2->vec.y; + points[7].x = area->v2->vec.x; + points[7].y = area->v2->vec.y; - points[8].x = sa->v4->vec.x; - points[8].y = sa->v4->vec.y + height / 2 - h; + points[8].x = area->v4->vec.x; + points[8].y = area->v4->vec.y + height / 2 - h; - points[9].x = sa->v4->vec.x; - points[9].y = sa->v4->vec.y + height / 2 + h; + points[9].x = area->v4->vec.x; + points[9].y = area->v4->vec.y + height / 2 + h; if (dir == 'l') { /* when direction is left, then we flip direction of arrow */ - float cx = sa->v1->vec.x + width; + float cx = area->v1->vec.x + width; for (i = 0; i < 10; i++) { points[i].x -= cx; points[i].x = -points[i].x; - points[i].x += sa->v1->vec.x; + points[i].x += area->v1->vec.x; } } @@ -122,10 +122,10 @@ static void draw_horizontal_join_shape(ScrArea *sa, char dir, uint pos) /** * Draw vertical shape visualizing future joining (up/down direction). */ -static void draw_vertical_join_shape(ScrArea *sa, char dir, uint pos) +static void draw_vertical_join_shape(ScrArea *area, char dir, uint pos) { - const float width = screen_geom_area_width(sa) - 1; - const float height = screen_geom_area_height(sa) - 1; + const float width = screen_geom_area_width(area) - 1; + const float height = screen_geom_area_height(area) - 1; vec2f points[10]; short i; float w, h; @@ -139,43 +139,43 @@ static void draw_vertical_join_shape(ScrArea *sa, char dir, uint pos) w = width / 8; } - points[0].x = sa->v1->vec.x + width / 2; - points[0].y = sa->v3->vec.y; + points[0].x = area->v1->vec.x + width / 2; + points[0].y = area->v3->vec.y; - points[1].x = sa->v2->vec.x; - points[1].y = sa->v2->vec.y; + points[1].x = area->v2->vec.x; + points[1].y = area->v2->vec.y; - points[2].x = sa->v1->vec.x; - points[2].y = sa->v1->vec.y + h; + points[2].x = area->v1->vec.x; + points[2].y = area->v1->vec.y + h; - points[3].x = sa->v1->vec.x + width / 2 - 2 * w; - points[3].y = sa->v1->vec.y + h; + points[3].x = area->v1->vec.x + width / 2 - 2 * w; + points[3].y = area->v1->vec.y + h; - points[4].x = sa->v1->vec.x + width / 2; - points[4].y = sa->v1->vec.y + 2 * h; + points[4].x = area->v1->vec.x + width / 2; + points[4].y = area->v1->vec.y + 2 * h; - points[5].x = sa->v1->vec.x + width / 2 + 2 * w; - points[5].y = sa->v1->vec.y + h; + points[5].x = area->v1->vec.x + width / 2 + 2 * w; + points[5].y = area->v1->vec.y + h; - points[6].x = sa->v4->vec.x; - points[6].y = sa->v4->vec.y + h; + points[6].x = area->v4->vec.x; + points[6].y = area->v4->vec.y + h; - points[7].x = sa->v3->vec.x; - points[7].y = sa->v3->vec.y; + points[7].x = area->v3->vec.x; + points[7].y = area->v3->vec.y; - points[8].x = sa->v1->vec.x + width / 2 - w; - points[8].y = sa->v1->vec.y; + points[8].x = area->v1->vec.x + width / 2 - w; + points[8].y = area->v1->vec.y; - points[9].x = sa->v1->vec.x + width / 2 + w; - points[9].y = sa->v1->vec.y; + points[9].x = area->v1->vec.x + width / 2 + w; + points[9].y = area->v1->vec.y; if (dir == 'u') { /* when direction is up, then we flip direction of arrow */ - float cy = sa->v1->vec.y + height; + float cy = area->v1->vec.y + height; for (i = 0; i < 10; i++) { points[i].y -= cy; points[i].y = -points[i].y; - points[i].y += sa->v1->vec.y; + points[i].y += area->v1->vec.y; } } @@ -203,13 +203,13 @@ static void draw_vertical_join_shape(ScrArea *sa, char dir, uint pos) /** * Draw join shape due to direction of joining. */ -static void draw_join_shape(ScrArea *sa, char dir, uint pos) +static void draw_join_shape(ScrArea *area, char dir, uint pos) { if (dir == 'u' || dir == 'd') { - draw_vertical_join_shape(sa, dir, pos); + draw_vertical_join_shape(area, dir, pos); } else { - draw_horizontal_join_shape(sa, dir, pos); + draw_horizontal_join_shape(area, dir, pos); } } @@ -294,26 +294,26 @@ static GPUBatch *batch_screen_edges_get(int *corner_len) /** * Draw screen area darker with arrow (visualization of future joining). */ -static void scrarea_draw_shape_dark(ScrArea *sa, char dir, uint pos) +static void scrarea_draw_shape_dark(ScrArea *area, char dir, uint pos) { GPU_blend_set_func_separate( GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); immUniformColor4ub(0, 0, 0, 50); - draw_join_shape(sa, dir, pos); + draw_join_shape(area, dir, pos); } /** * Draw screen area lighter with arrow shape ("eraser" of previous dark shape). */ -static void scrarea_draw_shape_light(ScrArea *sa, char UNUSED(dir), uint pos) +static void scrarea_draw_shape_light(ScrArea *area, char UNUSED(dir), uint pos) { GPU_blend_set_func(GPU_DST_COLOR, GPU_SRC_ALPHA); /* value 181 was hardly computed: 181~105 */ immUniformColor4ub(255, 255, 255, 50); - /* draw_join_shape(sa, dir); */ + /* draw_join_shape(area, dir); */ - immRectf(pos, sa->v1->vec.x, sa->v1->vec.y, sa->v3->vec.x, sa->v3->vec.y); + immRectf(pos, area->v1->vec.x, area->v1->vec.y, area->v3->vec.x, area->v3->vec.y); } static void drawscredge_area_draw( @@ -350,12 +350,12 @@ static void drawscredge_area_draw( /** * \brief Screen edges drawing. */ -static void drawscredge_area(ScrArea *sa, int sizex, int sizey, float edge_thickness) +static void drawscredge_area(ScrArea *area, int sizex, int sizey, float edge_thickness) { - short x1 = sa->v1->vec.x; - short y1 = sa->v1->vec.y; - short x2 = sa->v3->vec.x; - short y2 = sa->v3->vec.y; + short x1 = area->v1->vec.x; + short y1 = area->v1->vec.y; + short x2 = area->v3->vec.x; + short y2 = area->v3->vec.y; drawscredge_area_draw(sizex, sizey, x1, y1, x2, y2, edge_thickness); } @@ -381,13 +381,13 @@ void ED_screen_draw_edges(wmWindow *win) float col[4], corner_scale, edge_thickness; int verts_per_corner = 0; - ScrArea *sa; + ScrArea *area; rcti scissor_rect; BLI_rcti_init_minmax(&scissor_rect); - for (sa = screen->areabase.first; sa; sa = sa->next) { - BLI_rcti_do_minmax_v(&scissor_rect, (int[2]){sa->v1->vec.x, sa->v1->vec.y}); - BLI_rcti_do_minmax_v(&scissor_rect, (int[2]){sa->v3->vec.x, sa->v3->vec.y}); + for (area = screen->areabase.first; area; area = area->next) { + BLI_rcti_do_minmax_v(&scissor_rect, (int[2]){area->v1->vec.x, area->v1->vec.y}); + BLI_rcti_do_minmax_v(&scissor_rect, (int[2]){area->v3->vec.x, area->v3->vec.y}); } if (GPU_type_matches(GPU_DEVICE_INTEL_UHD, GPU_OS_UNIX, GPU_DRIVER_ANY)) { @@ -422,8 +422,8 @@ void ED_screen_draw_edges(wmWindow *win) GPU_batch_uniform_1f(batch, "scale", corner_scale); GPU_batch_uniform_4fv(batch, "color", col); - for (sa = screen->areabase.first; sa; sa = sa->next) { - drawscredge_area(sa, winsize_x, winsize_y, edge_thickness); + for (area = screen->areabase.first; area; area = area->next) { + drawscredge_area(area, winsize_x, winsize_y, edge_thickness); } GPU_blend(false); @@ -480,7 +480,7 @@ void ED_screen_draw_join_shape(ScrArea *sa1, ScrArea *sa2) immUnbindProgram(); } -void ED_screen_draw_split_preview(ScrArea *sa, const int dir, const float fac) +void ED_screen_draw_split_preview(ScrArea *area, const int dir, const float fac) { uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -495,10 +495,10 @@ void ED_screen_draw_split_preview(ScrArea *sa, const int dir, const float fac) immBegin(GPU_PRIM_LINES, 2); if (dir == 'h') { - const float y = (1 - fac) * sa->totrct.ymin + fac * sa->totrct.ymax; + const float y = (1 - fac) * area->totrct.ymin + fac * area->totrct.ymax; - immVertex2f(pos, sa->totrct.xmin, y); - immVertex2f(pos, sa->totrct.xmax, y); + immVertex2f(pos, area->totrct.xmin, y); + immVertex2f(pos, area->totrct.xmax, y); immEnd(); @@ -506,17 +506,17 @@ void ED_screen_draw_split_preview(ScrArea *sa, const int dir, const float fac) immBegin(GPU_PRIM_LINES, 2); - immVertex2f(pos, sa->totrct.xmin, y + 1); - immVertex2f(pos, sa->totrct.xmax, y + 1); + immVertex2f(pos, area->totrct.xmin, y + 1); + immVertex2f(pos, area->totrct.xmax, y + 1); immEnd(); } else { BLI_assert(dir == 'v'); - const float x = (1 - fac) * sa->totrct.xmin + fac * sa->totrct.xmax; + const float x = (1 - fac) * area->totrct.xmin + fac * area->totrct.xmax; - immVertex2f(pos, x, sa->totrct.ymin); - immVertex2f(pos, x, sa->totrct.ymax); + immVertex2f(pos, x, area->totrct.ymin); + immVertex2f(pos, x, area->totrct.ymax); immEnd(); @@ -524,8 +524,8 @@ void ED_screen_draw_split_preview(ScrArea *sa, const int dir, const float fac) immBegin(GPU_PRIM_LINES, 2); - immVertex2f(pos, x + 1, sa->totrct.ymin); - immVertex2f(pos, x + 1, sa->totrct.ymax); + immVertex2f(pos, x + 1, area->totrct.ymin); + immVertex2f(pos, x + 1, area->totrct.ymax); immEnd(); } @@ -547,9 +547,9 @@ static void screen_preview_scale_get( { float max_x = 0, max_y = 0; - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - max_x = MAX2(max_x, sa->totrct.xmax); - max_y = MAX2(max_y, sa->totrct.ymax); + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + max_x = MAX2(max_x, area->totrct.xmax); + max_y = MAX2(max_y, area->totrct.ymax); } r_scale[0] = (size_x * asp[0]) / max_x; r_scale[1] = (size_y * asp[1]) / max_y; @@ -566,12 +566,12 @@ static void screen_preview_draw_areas(const bScreen *screen, immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(col); - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { + for (ScrArea *area = screen->areabase.first; area; area = area->next) { rctf rect = { - .xmin = sa->totrct.xmin * scale[0] + ofs_h, - .xmax = sa->totrct.xmax * scale[0] - ofs_h, - .ymin = sa->totrct.ymin * scale[1] + ofs_h, - .ymax = sa->totrct.ymax * scale[1] - ofs_h, + .xmin = area->totrct.xmin * scale[0] + ofs_h, + .xmax = area->totrct.xmax * scale[0] - ofs_h, + .ymin = area->totrct.ymin * scale[1] + ofs_h, + .ymax = area->totrct.ymax * scale[1] - ofs_h, }; immBegin(GPU_PRIM_TRI_FAN, 4); diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 01a30f7d6a4..11a12452ce3 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -70,17 +70,17 @@ static ScrArea *screen_addarea_ex(ScrAreaMap *area_map, ScrVert *bottom_right, short spacetype) { - ScrArea *sa = MEM_callocN(sizeof(ScrArea), "addscrarea"); + ScrArea *area = MEM_callocN(sizeof(ScrArea), "addscrarea"); - sa->v1 = bottom_left; - sa->v2 = top_left; - sa->v3 = top_right; - sa->v4 = bottom_right; - sa->spacetype = spacetype; + area->v1 = bottom_left; + area->v2 = top_left; + area->v3 = top_right; + area->v4 = bottom_right; + area->spacetype = spacetype; - BLI_addtail(&area_map->areabase, sa); + BLI_addtail(&area_map->areabase, area); - return sa; + return area; } static ScrArea *screen_addarea(bScreen *sc, ScrVert *left_bottom, @@ -93,31 +93,32 @@ static ScrArea *screen_addarea(bScreen *sc, AREAMAP_FROM_SCREEN(sc), left_bottom, left_top, right_top, right_bottom, spacetype); } -static void screen_delarea(bContext *C, bScreen *sc, ScrArea *sa) +static void screen_delarea(bContext *C, bScreen *sc, ScrArea *area) { - ED_area_exit(C, sa); + ED_area_exit(C, area); - BKE_screen_area_free(sa); + BKE_screen_area_free(area); - BLI_remlink(&sc->areabase, sa); - MEM_freeN(sa); + BLI_remlink(&sc->areabase, area); + MEM_freeN(area); } -ScrArea *area_split(const wmWindow *win, bScreen *sc, ScrArea *sa, char dir, float fac, int merge) +ScrArea *area_split( + const wmWindow *win, bScreen *sc, ScrArea *area, char dir, float fac, int merge) { ScrArea *newa = NULL; ScrVert *sv1, *sv2; short split; rcti window_rect; - if (sa == NULL) { + if (area == NULL) { return NULL; } WM_window_rect_calc(win, &window_rect); - split = screen_geom_find_area_split_point(sa, &window_rect, dir, fac); + split = screen_geom_find_area_split_point(area, &window_rect, dir, fac); if (split == 0) { return NULL; } @@ -128,65 +129,65 @@ ScrArea *area_split(const wmWindow *win, bScreen *sc, ScrArea *sa, char dir, flo if (dir == 'h') { /* new vertices */ - sv1 = screen_geom_vertex_add(sc, sa->v1->vec.x, split); - sv2 = screen_geom_vertex_add(sc, sa->v4->vec.x, split); + sv1 = screen_geom_vertex_add(sc, area->v1->vec.x, split); + sv2 = screen_geom_vertex_add(sc, area->v4->vec.x, split); /* new edges */ - screen_geom_edge_add(sc, sa->v1, sv1); - screen_geom_edge_add(sc, sv1, sa->v2); - screen_geom_edge_add(sc, sa->v3, sv2); - screen_geom_edge_add(sc, sv2, sa->v4); + screen_geom_edge_add(sc, area->v1, sv1); + screen_geom_edge_add(sc, sv1, area->v2); + screen_geom_edge_add(sc, area->v3, sv2); + screen_geom_edge_add(sc, sv2, area->v4); screen_geom_edge_add(sc, sv1, sv2); if (fac > 0.5f) { /* new areas: top */ - newa = screen_addarea(sc, sv1, sa->v2, sa->v3, sv2, sa->spacetype); + newa = screen_addarea(sc, sv1, area->v2, area->v3, sv2, area->spacetype); /* area below */ - sa->v2 = sv1; - sa->v3 = sv2; + area->v2 = sv1; + area->v3 = sv2; } else { /* new areas: bottom */ - newa = screen_addarea(sc, sa->v1, sv1, sv2, sa->v4, sa->spacetype); + newa = screen_addarea(sc, area->v1, sv1, sv2, area->v4, area->spacetype); /* area above */ - sa->v1 = sv1; - sa->v4 = sv2; + area->v1 = sv1; + area->v4 = sv2; } - ED_area_data_copy(newa, sa, true); + ED_area_data_copy(newa, area, true); } else { /* new vertices */ - sv1 = screen_geom_vertex_add(sc, split, sa->v1->vec.y); - sv2 = screen_geom_vertex_add(sc, split, sa->v2->vec.y); + sv1 = screen_geom_vertex_add(sc, split, area->v1->vec.y); + sv2 = screen_geom_vertex_add(sc, split, area->v2->vec.y); /* new edges */ - screen_geom_edge_add(sc, sa->v1, sv1); - screen_geom_edge_add(sc, sv1, sa->v4); - screen_geom_edge_add(sc, sa->v2, sv2); - screen_geom_edge_add(sc, sv2, sa->v3); + screen_geom_edge_add(sc, area->v1, sv1); + screen_geom_edge_add(sc, sv1, area->v4); + screen_geom_edge_add(sc, area->v2, sv2); + screen_geom_edge_add(sc, sv2, area->v3); screen_geom_edge_add(sc, sv1, sv2); if (fac > 0.5f) { /* new areas: right */ - newa = screen_addarea(sc, sv1, sv2, sa->v3, sa->v4, sa->spacetype); + newa = screen_addarea(sc, sv1, sv2, area->v3, area->v4, area->spacetype); /* area left */ - sa->v3 = sv2; - sa->v4 = sv1; + area->v3 = sv2; + area->v4 = sv1; } else { /* new areas: left */ - newa = screen_addarea(sc, sa->v1, sa->v2, sv2, sv1, sa->spacetype); + newa = screen_addarea(sc, area->v1, area->v2, sv2, sv1, area->spacetype); /* area right */ - sa->v1 = sv1; - sa->v2 = sv2; + area->v1 = sv1; + area->v2 = sv2; } - ED_area_data_copy(newa, sa, true); + ED_area_data_copy(newa, area, true); } /* remove double vertices en edges */ @@ -231,7 +232,7 @@ void screen_data_copy(bScreen *to, bScreen *from) { ScrVert *s1, *s2; ScrEdge *se; - ScrArea *sa, *saf; + ScrArea *area, *saf; /* free contents of 'to', is from blenkernel screen.c */ BKE_screen_free(to); @@ -255,18 +256,18 @@ void screen_data_copy(bScreen *to, bScreen *from) } saf = from->areabase.first; - for (sa = to->areabase.first; sa; sa = sa->next, saf = saf->next) { - sa->v1 = sa->v1->newv; - sa->v2 = sa->v2->newv; - sa->v3 = sa->v3->newv; - sa->v4 = sa->v4->newv; + for (area = to->areabase.first; area; area = area->next, saf = saf->next) { + area->v1 = area->v1->newv; + area->v2 = area->v2->newv; + area->v3 = area->v3->newv; + area->v4 = area->v4->newv; - BLI_listbase_clear(&sa->spacedata); - BLI_listbase_clear(&sa->regionbase); - BLI_listbase_clear(&sa->actionzones); - BLI_listbase_clear(&sa->handlers); + BLI_listbase_clear(&area->spacedata); + BLI_listbase_clear(&area->regionbase); + BLI_listbase_clear(&area->actionzones); + BLI_listbase_clear(&area->handlers); - ED_area_data_copy(sa, saf, true); + ED_area_data_copy(area, saf, true); } /* put at zero (needed?) */ @@ -285,19 +286,19 @@ void screen_new_activate_prepare(const wmWindow *win, bScreen *screen_new) screen_new->do_draw = true; } -/* with sa as center, sb is located at: 0=W, 1=N, 2=E, 3=S */ +/* with area as center, sb is located at: 0=W, 1=N, 2=E, 3=S */ /* -1 = not valid check */ /* used with join operator */ -int area_getorientation(ScrArea *sa, ScrArea *sb) +int area_getorientation(ScrArea *area, ScrArea *sb) { - if (sa == NULL || sb == NULL) { + if (area == NULL || sb == NULL) { return -1; } - ScrVert *saBL = sa->v1; - ScrVert *saTL = sa->v2; - ScrVert *saTR = sa->v3; - ScrVert *saBR = sa->v4; + ScrVert *saBL = area->v1; + ScrVert *saTL = area->v2; + ScrVert *saTR = area->v3; + ScrVert *saBR = area->v4; ScrVert *sbBL = sb->v1; ScrVert *sbTL = sb->v2; @@ -306,25 +307,26 @@ int area_getorientation(ScrArea *sa, ScrArea *sb) int tolerance = U.pixelsize * 4; - if (saBL->vec.x == sbBR->vec.x && saTL->vec.x == sbTR->vec.x) { /* sa to right of sb = W */ + if (saBL->vec.x == sbBR->vec.x && saTL->vec.x == sbTR->vec.x) { /* area to right of sb = W */ if ((abs(saBL->vec.y - sbBR->vec.y) <= tolerance) && (abs(saTL->vec.y - sbTR->vec.y) <= tolerance)) { return 0; } } - else if (saTL->vec.y == sbBL->vec.y && saTR->vec.y == sbBR->vec.y) { /* sa to bottom of sb = N */ + else if (saTL->vec.y == sbBL->vec.y && + saTR->vec.y == sbBR->vec.y) { /* area to bottom of sb = N */ if ((abs(saTL->vec.x - sbBL->vec.x) <= tolerance) && (abs(saTR->vec.x - sbBR->vec.x) <= tolerance)) { return 1; } } - else if (saTR->vec.x == sbTL->vec.x && saBR->vec.x == sbBL->vec.x) { /* sa to left of sb = E */ + else if (saTR->vec.x == sbTL->vec.x && saBR->vec.x == sbBL->vec.x) { /* area to left of sb = E */ if ((abs(saTR->vec.y - sbTL->vec.y) <= tolerance) && (abs(saBR->vec.y - sbBL->vec.y) <= tolerance)) { return 2; } } - else if (saBL->vec.y == sbTL->vec.y && saBR->vec.y == sbTR->vec.y) { /* sa on top of sb = S*/ + else if (saBL->vec.y == sbTL->vec.y && saBR->vec.y == sbTR->vec.y) { /* area on top of sb = S*/ if ((abs(saBL->vec.x - sbTL->vec.x) <= tolerance) && (abs(saBR->vec.x - sbTR->vec.x) <= tolerance)) { return 3; @@ -398,12 +400,12 @@ int screen_area_join(bContext *C, bScreen *scr, ScrArea *sa1, ScrArea *sa2) /* ****************** EXPORTED API TO OTHER MODULES *************************** */ /* screen sets cursor based on active region */ -static void region_cursor_set_ex(wmWindow *win, ScrArea *sa, ARegion *region, bool swin_changed) +static void region_cursor_set_ex(wmWindow *win, ScrArea *area, ARegion *region, bool swin_changed) { BLI_assert(WM_window_get_active_screen(win)->active_region == region); if (win->tag_cursor_refresh || swin_changed || (region->type && region->type->event_cursor)) { win->tag_cursor_refresh = false; - ED_region_cursor_set(win, sa, region); + ED_region_cursor_set(win, area, region); } } @@ -411,11 +413,11 @@ static void region_cursor_set(wmWindow *win, bool swin_changed) { 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) { + for (ARegion *region = area->regionbase.first; region; region = region->next) { if (region == screen->active_region) { - region_cursor_set_ex(win, sa, region, swin_changed); + region_cursor_set_ex(win, area, region, swin_changed); return; } } @@ -522,11 +524,11 @@ void ED_screen_ensure_updated(wmWindowManager *wm, wmWindow *win, bScreen *scree * Utility to exit and free an area-region. Screen level regions (menus/popups) need to be treated * slightly differently, see #ui_region_temp_remove(). */ -void ED_region_remove(bContext *C, ScrArea *sa, ARegion *region) +void ED_region_remove(bContext *C, ScrArea *area, ARegion *region) { ED_region_exit(C, region); - BKE_area_region_free(sa->type, region); - BLI_freelinkN(&sa->regionbase, region); + BKE_area_region_free(area->type, region); + BLI_freelinkN(&area->regionbase, region); } /* *********** exit calls are for closing running stuff ******** */ @@ -562,25 +564,25 @@ void ED_region_exit(bContext *C, ARegion *region) CTX_wm_region_set(C, prevar); } -void ED_area_exit(bContext *C, ScrArea *sa) +void ED_area_exit(bContext *C, ScrArea *area) { wmWindowManager *wm = CTX_wm_manager(C); wmWindow *win = CTX_wm_window(C); ScrArea *prevsa = CTX_wm_area(C); ARegion *region; - if (sa->type && sa->type->exit) { - sa->type->exit(wm, sa); + if (area->type && area->type->exit) { + area->type->exit(wm, area); } - CTX_wm_area_set(C, sa); + CTX_wm_area_set(C, area); - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { ED_region_exit(C, region); } - WM_event_remove_handlers(C, &sa->handlers); - WM_event_modal_handler_area_replace(win, sa, NULL); + WM_event_remove_handlers(C, &area->handlers); + WM_event_modal_handler_area_replace(win, area, NULL); CTX_wm_area_set(C, prevsa); } @@ -608,12 +610,12 @@ void ED_screen_exit(bContext *C, wmWindow *window, bScreen *screen) for (ARegion *region = screen->regionbase.first; region; region = region->next) { ED_region_exit(C, region); } - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - ED_area_exit(C, sa); + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + ED_area_exit(C, area); } /* Don't use ED_screen_areas_iter here, it skips hidden areas. */ - for (ScrArea *sa = window->global_areas.areabase.first; sa; sa = sa->next) { - ED_area_exit(C, sa); + for (ScrArea *area = window->global_areas.areabase.first; area; area = area->next) { + ED_area_exit(C, area); } /* mark it available for use for other windows */ @@ -636,15 +638,15 @@ static void screen_cursor_set(wmWindow *win, const int xy[2]) { const bScreen *screen = WM_window_get_active_screen(win); AZone *az = NULL; - ScrArea *sa; + ScrArea *area; - for (sa = screen->areabase.first; sa; sa = sa->next) { - if ((az = ED_area_actionzone_find_xy(sa, xy))) { + for (area = screen->areabase.first; area; area = area->next) { + if ((az = ED_area_actionzone_find_xy(area, xy))) { break; } } - if (sa) { + if (area) { if (az->type == AZONE_AREA) { WM_cursor_set(win, WM_CURSOR_EDIT); } @@ -685,7 +687,7 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2]) return; } - ScrArea *sa = NULL; + ScrArea *area = NULL; ARegion *region; ARegion *region_prev = scr->active_region; @@ -694,15 +696,15 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2]) if (xy[0] > area_iter->totrct.xmin && xy[0] < area_iter->totrct.xmax) { if (xy[1] > area_iter->totrct.ymin && xy[1] < area_iter->totrct.ymax) { if (ED_area_azones_update(area_iter, xy) == NULL) { - sa = area_iter; + area = area_iter; break; } } } } - if (sa) { + if (area) { /* Make overlap active when mouse over. */ - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (ED_region_contains_xy(region, xy)) { scr->active_region = region; break; @@ -758,7 +760,7 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2]) } else { /* Notifier invokes freeing the buttons... causing a bit too much redraws. */ - region_cursor_set_ex(win, sa, scr->active_region, region_prev != scr->active_region); + region_cursor_set_ex(win, area, scr->active_region, region_prev != scr->active_region); if (region_prev != scr->active_region) { /* This used to be a notifier, but needs to be done immediate @@ -775,17 +777,17 @@ int ED_screen_area_active(const bContext *C) { wmWindow *win = CTX_wm_window(C); bScreen *sc = CTX_wm_screen(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); - if (win && sc && sa) { - AZone *az = ED_area_actionzone_find_xy(sa, &win->eventstate->x); + if (win && sc && area) { + AZone *az = ED_area_actionzone_find_xy(area, &win->eventstate->x); ARegion *region; if (az && az->type == AZONE_REGION) { return 1; } - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region == sc->active_region) { return 1; } @@ -815,16 +817,16 @@ static ScrArea *screen_area_create_with_geometry(ScrAreaMap *area_map, return screen_addarea_ex(area_map, bottom_left, top_left, top_right, bottom_right, spacetype); } -static void screen_area_set_geometry_rect(ScrArea *sa, const rcti *rect) +static void screen_area_set_geometry_rect(ScrArea *area, const rcti *rect) { - sa->v1->vec.x = rect->xmin; - sa->v1->vec.y = rect->ymin; - sa->v2->vec.x = rect->xmin; - sa->v2->vec.y = rect->ymax; - sa->v3->vec.x = rect->xmax; - sa->v3->vec.y = rect->ymax; - sa->v4->vec.x = rect->xmax; - sa->v4->vec.y = rect->ymin; + area->v1->vec.x = rect->xmin; + area->v1->vec.y = rect->ymin; + area->v2->vec.x = rect->xmin; + area->v2->vec.y = rect->ymax; + area->v3->vec.x = rect->xmax; + area->v3->vec.y = rect->ymax; + area->v4->vec.x = rect->xmax; + area->v4->vec.y = rect->ymin; } static void screen_global_area_refresh(wmWindow *win, @@ -943,8 +945,8 @@ static bScreen *screen_fullscreen_find_associated_normal_screen(const Main *bmai for (bScreen *screen_iter = bmain->screens.first; screen_iter; screen_iter = screen_iter->id.next) { if ((screen_iter != screen) && ELEM(screen_iter->state, SCREENMAXIMIZED, SCREENFULL)) { - ScrArea *sa = screen_iter->areabase.first; - if (sa && sa->full == screen) { + ScrArea *area = screen_iter->areabase.first; + if (area && area->full == screen) { return screen_iter; } } @@ -976,8 +978,8 @@ bScreen *screen_change_prepare( wmTimer *wt = screen_old->animtimer; /* remove handlers referencing areas in old screen */ - for (ScrArea *sa = screen_old->areabase.first; sa; sa = sa->next) { - WM_event_remove_area_handler(&win->modalhandlers, sa); + for (ScrArea *area = screen_old->areabase.first; area; area = area->next) { + WM_event_remove_area_handler(&win->modalhandlers, area); } /* we put timer to sleep, so screen_exit has to think there's no timer */ @@ -1042,7 +1044,10 @@ bool ED_screen_change(bContext *C, bScreen *sc) return false; } -static void screen_set_3dview_camera(Scene *scene, ViewLayer *view_layer, ScrArea *sa, View3D *v3d) +static void screen_set_3dview_camera(Scene *scene, + ViewLayer *view_layer, + ScrArea *area, + View3D *v3d) { /* fix any cameras that are used in the 3d view but not in the scene */ BKE_screen_view3d_sync(v3d, scene); @@ -1055,8 +1060,8 @@ static void screen_set_3dview_camera(Scene *scene, ViewLayer *view_layer, ScrAre ListBase *regionbase; /* regionbase is in different place depending if space is active */ - if (v3d == sa->spacedata.first) { - regionbase = &sa->regionbase; + if (v3d == area->spacedata.first) { + regionbase = &area->regionbase; } else { regionbase = &v3d->regionbase; @@ -1104,28 +1109,28 @@ void ED_screen_scene_change(bContext *C, wmWindow *win, Scene *scene) /* Update 3D view cameras. */ const bScreen *screen = WM_window_get_active_screen(win); - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { View3D *v3d = (View3D *)sl; - screen_set_3dview_camera(scene, view_layer, sa, v3d); + screen_set_3dview_camera(scene, view_layer, area, v3d); } } } } -ScrArea *ED_screen_full_newspace(bContext *C, ScrArea *sa, int type) +ScrArea *ED_screen_full_newspace(bContext *C, ScrArea *area, int type) { wmWindow *win = CTX_wm_window(C); ScrArea *newsa = NULL; SpaceLink *newsl; - if (!sa || sa->full == NULL) { - newsa = ED_screen_state_toggle(C, win, sa, SCREENMAXIMIZED); + if (!area || area->full == NULL) { + newsa = ED_screen_state_toggle(C, win, area, SCREENMAXIMIZED); } if (!newsa) { - newsa = sa; + newsa = area; } BLI_assert(newsa); @@ -1144,40 +1149,40 @@ ScrArea *ED_screen_full_newspace(bContext *C, ScrArea *sa, int type) /** * \a was_prev_temp for the case previous space was a temporary fullscreen as well */ -void ED_screen_full_prevspace(bContext *C, ScrArea *sa) +void ED_screen_full_prevspace(bContext *C, ScrArea *area) { - BLI_assert(sa->full); + BLI_assert(area->full); - if (sa->flag & AREA_FLAG_STACKED_FULLSCREEN) { + if (area->flag & AREA_FLAG_STACKED_FULLSCREEN) { /* stacked fullscreen -> only go back to previous area and don't toggle out of fullscreen */ - ED_area_prevspace(C, sa); + ED_area_prevspace(C, area); } else { - ED_screen_restore_temp_type(C, sa); + ED_screen_restore_temp_type(C, area); } } -void ED_screen_restore_temp_type(bContext *C, ScrArea *sa) +void ED_screen_restore_temp_type(bContext *C, ScrArea *area) { - SpaceLink *sl = sa->spacedata.first; + SpaceLink *sl = area->spacedata.first; /* In case nether functions below run. */ - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); if (sl->link_flag & SPACE_FLAG_TYPE_TEMPORARY) { - ED_area_prevspace(C, sa); + ED_area_prevspace(C, area); } - if (sa->full) { - ED_screen_state_toggle(C, CTX_wm_window(C), sa, SCREENMAXIMIZED); + if (area->full) { + ED_screen_state_toggle(C, CTX_wm_window(C), area, SCREENMAXIMIZED); } } /* restore a screen / area back to default operation, after temp fullscreen modes */ -void ED_screen_full_restore(bContext *C, ScrArea *sa) +void ED_screen_full_restore(bContext *C, ScrArea *area) { wmWindow *win = CTX_wm_window(C); - SpaceLink *sl = sa->spacedata.first; + SpaceLink *sl = area->spacedata.first; bScreen *screen = CTX_wm_screen(C); short state = (screen ? screen->state : SCREENMAXIMIZED); @@ -1186,25 +1191,25 @@ void ED_screen_full_restore(bContext *C, ScrArea *sa) if (sl->next) { if (sl->link_flag & SPACE_FLAG_TYPE_TEMPORARY) { - ED_screen_full_prevspace(C, sa); + ED_screen_full_prevspace(C, area); } else { - ED_screen_state_toggle(C, win, sa, state); + ED_screen_state_toggle(C, win, area, state); } - /* warning: 'sa' may be freed */ + /* warning: 'area' may be freed */ } /* otherwise just tile the area again */ else { - ED_screen_state_toggle(C, win, sa, state); + ED_screen_state_toggle(C, win, area, state); } } /** * this function toggles: if area is maximized/full then the parent will be restored * - * \warning \a sa may be freed. + * \warning \a area may be freed. */ -ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const short state) +ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *area, const short state) { Main *bmain = CTX_data_main(C); wmWindowManager *wm = CTX_wm_manager(C); @@ -1212,11 +1217,11 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const s bScreen *sc, *oldscreen; ARegion *region; - if (sa) { + if (area) { /* ensure we don't have a button active anymore, can crash when * switching screens with tooltip open because region and tooltip * are no longer in the same screen */ - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { UI_blocklist_free(C, ®ion->uiblocks); if (region->regiontimer) { @@ -1226,14 +1231,14 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const s } /* prevent hanging status prints */ - ED_area_status_text(sa, NULL); + ED_area_status_text(area, NULL); ED_workspace_status_text(C, NULL); } - if (sa && sa->full) { + if (area && area->full) { WorkSpaceLayout *layout_old = WM_window_get_active_layout(win); /* restoring back to SCREENNORMAL */ - sc = sa->full; /* the old screen to restore */ + sc = area->full; /* the old screen to restore */ oldscreen = WM_window_get_active_screen(win); /* the one disappearing */ BLI_assert(BKE_workspace_layout_screen_get(layout_old) != sc); @@ -1254,7 +1259,7 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const s old->full = NULL; } - sa->full = NULL; + area->full = NULL; if (fullsa == NULL) { if (G.debug & G_DEBUG) { @@ -1270,12 +1275,12 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const s glob_area->global->flag &= ~GLOBAL_AREA_IS_HIDDEN; } /* restore the old side panels/header visibility */ - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { region->flag = region->flagfullscreen; } } - ED_area_data_swap(fullsa, sa); + ED_area_data_swap(fullsa, area); /* animtimer back */ sc->animtimer = oldscreen->animtimer; @@ -1318,15 +1323,15 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const s /* use random area when we have no active one, e.g. when the * mouse is outside of the window and we open a file browser */ - if (!sa || sa->global) { - sa = oldscreen->areabase.first; + if (!area || area->global) { + area = oldscreen->areabase.first; } newa = (ScrArea *)sc->areabase.first; /* copy area */ - ED_area_data_swap(newa, sa); - newa->flag = sa->flag; /* mostly for AREA_FLAG_WASFULLSCREEN */ + ED_area_data_swap(newa, area); + newa->flag = area->flag; /* mostly for AREA_FLAG_WASFULLSCREEN */ if (state == SCREENFULL) { /* temporarily hide global areas */ @@ -1351,7 +1356,7 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const s } } - sa->full = oldscreen; + area->full = oldscreen; newa->full = oldscreen; ED_screen_change(C, sc); @@ -1381,35 +1386,35 @@ ScrArea *ED_screen_temp_space_open(bContext *C, int display_type, bool dialog) { - ScrArea *sa = NULL; + ScrArea *area = NULL; switch (display_type) { case USER_TEMP_SPACE_DISPLAY_WINDOW: if (WM_window_open_temp(C, title, x, y, sizex, sizey, (int)space_type, dialog)) { - sa = CTX_wm_area(C); + area = CTX_wm_area(C); } break; case USER_TEMP_SPACE_DISPLAY_FULLSCREEN: { - ScrArea *ctx_sa = CTX_wm_area(C); + ScrArea *ctx_area = CTX_wm_area(C); - if (ctx_sa != NULL && ctx_sa->full) { - sa = ctx_sa; - ED_area_newspace(C, ctx_sa, space_type, true); - sa->flag |= AREA_FLAG_STACKED_FULLSCREEN; - ((SpaceLink *)sa->spacedata.first)->link_flag |= SPACE_FLAG_TYPE_TEMPORARY; + if (ctx_area != NULL && ctx_area->full) { + area = ctx_area; + ED_area_newspace(C, ctx_area, space_type, true); + area->flag |= AREA_FLAG_STACKED_FULLSCREEN; + ((SpaceLink *)area->spacedata.first)->link_flag |= SPACE_FLAG_TYPE_TEMPORARY; } - else if (ctx_sa != NULL && ctx_sa->spacetype == space_type) { - sa = ED_screen_state_toggle(C, CTX_wm_window(C), ctx_sa, SCREENMAXIMIZED); + else if (ctx_area != NULL && ctx_area->spacetype == space_type) { + area = ED_screen_state_toggle(C, CTX_wm_window(C), ctx_area, SCREENMAXIMIZED); } else { - sa = ED_screen_full_newspace(C, ctx_sa, (int)space_type); - ((SpaceLink *)sa->spacedata.first)->link_flag |= SPACE_FLAG_TYPE_TEMPORARY; + area = ED_screen_full_newspace(C, ctx_area, (int)space_type); + ((SpaceLink *)area->spacedata.first)->link_flag |= SPACE_FLAG_TYPE_TEMPORARY; } break; } } - return sa; + return area; } /* update frame rate info for viewport drawing */ @@ -1487,12 +1492,12 @@ void ED_screen_animation_timer(bContext *C, int redraws, int sync, int enable) sad->flag |= (enable < 0) ? ANIMPLAY_FLAG_REVERSE : 0; sad->flag |= (sync == 0) ? ANIMPLAY_FLAG_NO_SYNC : (sync == 1) ? ANIMPLAY_FLAG_SYNC : 0; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); char spacetype = -1; - if (sa) { - spacetype = sa->spacetype; + if (area) { + spacetype = area->spacetype; } sad->from_anim_edit = (ELEM(spacetype, SPACE_GRAPH, SPACE_ACTION, SPACE_NLA)); @@ -1508,13 +1513,13 @@ void ED_screen_animation_timer(bContext *C, int redraws, int sync, int enable) static ARegion *time_top_left_3dwindow(bScreen *screen) { ARegion *aret = NULL; - ScrArea *sa; + ScrArea *area; int min = 10000; - for (sa = screen->areabase.first; sa; sa = sa->next) { - if (sa->spacetype == SPACE_VIEW3D) { + for (area = screen->areabase.first; area; area = area->next) { + if (area->spacetype == SPACE_VIEW3D) { ARegion *region; - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region->regiontype == RGN_TYPE_WINDOW) { if (region->winrct.xmin - region->winrct.ymin < min) { aret = region; @@ -1573,11 +1578,11 @@ void ED_update_for_newframe(Main *bmain, Depsgraph *depsgraph) */ bool ED_screen_stereo3d_required(const bScreen *screen, const Scene *scene) { - ScrArea *sa; + ScrArea *area; const bool is_multiview = (scene->r.scemode & R_MULTIVIEW) != 0; - for (sa = screen->areabase.first; sa; sa = sa->next) { - switch (sa->spacetype) { + for (area = screen->areabase.first; area; area = area->next) { + switch (area->spacetype) { case SPACE_VIEW3D: { View3D *v3d; @@ -1585,10 +1590,10 @@ bool ED_screen_stereo3d_required(const bScreen *screen, const Scene *scene) continue; } - v3d = sa->spacedata.first; + v3d = area->spacedata.first; if (v3d->camera && v3d->stereo3d_camera == STEREO_3D_ID) { ARegion *region; - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region->regiondata && region->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3d = region->regiondata; if (rv3d->persp == RV3D_CAMOB) { @@ -1604,7 +1609,7 @@ bool ED_screen_stereo3d_required(const bScreen *screen, const Scene *scene) /* images should always show in stereo, even if * the file doesn't have views enabled */ - sima = sa->spacedata.first; + sima = area->spacedata.first; if (sima->image && BKE_image_is_stereo(sima->image) && (sima->iuser.flag & IMA_SHOW_STEREO)) { return true; @@ -1618,7 +1623,7 @@ bool ED_screen_stereo3d_required(const bScreen *screen, const Scene *scene) continue; } - snode = sa->spacedata.first; + snode = area->spacedata.first; if ((snode->flag & SNODE_BACKDRAW) && ED_node_is_compositor(snode)) { return true; } @@ -1631,7 +1636,7 @@ bool ED_screen_stereo3d_required(const bScreen *screen, const Scene *scene) continue; } - sseq = sa->spacedata.first; + sseq = area->spacedata.first; if (ELEM(sseq->view, SEQ_VIEW_PREVIEW, SEQ_VIEW_SEQUENCE_PREVIEW)) { return true; } @@ -1675,16 +1680,16 @@ ScrArea *ED_screen_area_find_with_spacedata(const bScreen *screen, const bool only_visible) { if (only_visible) { - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - if (sa->spacedata.first == sl) { - return sa; + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + if (area->spacedata.first == sl) { + return area; } } } else { - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - if (BLI_findindex(&sa->spacedata, sl) != -1) { - return sa; + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + if (BLI_findindex(&area->spacedata, sl) != -1) { + return area; } } } diff --git a/source/blender/editors/screen/screen_geometry.c b/source/blender/editors/screen/screen_geometry.c index 25855382307..9169bf37116 100644 --- a/source/blender/editors/screen/screen_geometry.c +++ b/source/blender/editors/screen/screen_geometry.c @@ -163,7 +163,6 @@ void screen_geom_vertices_scale(const wmWindow *win, bScreen *sc) const int screen_size_x = BLI_rcti_size_x(&screen_rect); const int screen_size_y = BLI_rcti_size_y(&screen_rect); ScrVert *sv = NULL; - ScrArea *sa; int screen_size_x_prev, screen_size_y_prev; float min[2], max[2]; @@ -199,19 +198,19 @@ void screen_geom_vertices_scale(const wmWindow *win, bScreen *sc) if (facy > 1) { /* Keep timeline small in video edit workspace. */ - for (sa = sc->areabase.first; sa; sa = sa->next) { - if (sa->spacetype == SPACE_ACTION && sa->v1->vec.y == screen_rect.ymin && - screen_geom_area_height(sa) <= headery * facy + 1) { - ScrEdge *se = BKE_screen_find_edge(sc, sa->v2, sa->v3); + for (ScrArea *area = sc->areabase.first; area; area = area->next) { + if (area->spacetype == SPACE_ACTION && area->v1->vec.y == screen_rect.ymin && + screen_geom_area_height(area) <= headery * facy + 1) { + ScrEdge *se = BKE_screen_find_edge(sc, area->v2, area->v3); if (se) { - const int yval = sa->v1->vec.y + headery - 1; + const int yval = area->v1->vec.y + headery - 1; screen_geom_select_connected_edge(win, se); /* all selected vertices get the right offset */ for (sv = sc->vertbase.first; sv; sv = sv->next) { /* if is a collapsed area */ - if (sv != sa->v1 && sv != sa->v4) { + if (sv != area->v1 && sv != area->v4) { if (sv->flag) { sv->vec.y = yval; } @@ -223,19 +222,19 @@ void screen_geom_vertices_scale(const wmWindow *win, bScreen *sc) } if (facy < 1) { /* make each window at least ED_area_headersize() high */ - for (sa = sc->areabase.first; sa; sa = sa->next) { - if (screen_geom_area_height(sa) < headery) { + for (ScrArea *area = sc->areabase.first; area; area = area->next) { + if (screen_geom_area_height(area) < headery) { /* lower edge */ - ScrEdge *se = BKE_screen_find_edge(sc, sa->v4, sa->v1); - if (se && sa->v1 != sa->v2) { - const int yval = sa->v2->vec.y - headery + 1; + ScrEdge *se = BKE_screen_find_edge(sc, area->v4, area->v1); + if (se && area->v1 != area->v2) { + const int yval = area->v2->vec.y - headery + 1; screen_geom_select_connected_edge(win, se); /* all selected vertices get the right offset */ for (sv = sc->vertbase.first; sv; sv = sv->next) { /* if is not a collapsed area */ - if (sv != sa->v2 && sv != sa->v3) { + if (sv != area->v2 && sv != area->v3) { if (sv->flag) { sv->vec.y = yval; } @@ -284,14 +283,14 @@ void screen_geom_vertices_scale(const wmWindow *win, bScreen *sc) /** * \return 0 if no split is possible, otherwise the screen-coordinate at which to split. */ -short screen_geom_find_area_split_point(const ScrArea *sa, +short screen_geom_find_area_split_point(const ScrArea *area, const rcti *window_rect, char dir, float fac) { short x, y; - const int cur_area_width = screen_geom_area_width(sa); - const int cur_area_height = screen_geom_area_height(sa); + const int cur_area_width = screen_geom_area_width(area); + const int cur_area_height = screen_geom_area_height(area); const short area_min_x = AREAMINX; const short area_min_y = ED_area_headersize(); int area_min; @@ -308,43 +307,43 @@ short screen_geom_find_area_split_point(const ScrArea *sa, CLAMP(fac, 0.0f, 1.0f); if (dir == 'h') { - y = sa->v1->vec.y + round_fl_to_short(fac * cur_area_height); + y = area->v1->vec.y + round_fl_to_short(fac * cur_area_height); area_min = area_min_y; - if (sa->v1->vec.y > window_rect->ymin) { + if (area->v1->vec.y > window_rect->ymin) { area_min += U.pixelsize; } - if (sa->v2->vec.y < (window_rect->ymax - 1)) { + if (area->v2->vec.y < (window_rect->ymax - 1)) { area_min += U.pixelsize; } - if (y - sa->v1->vec.y < area_min) { - y = sa->v1->vec.y + area_min; + if (y - area->v1->vec.y < area_min) { + y = area->v1->vec.y + area_min; } - else if (sa->v2->vec.y - y < area_min) { - y = sa->v2->vec.y - area_min; + else if (area->v2->vec.y - y < area_min) { + y = area->v2->vec.y - area_min; } return y; } else { - x = sa->v1->vec.x + round_fl_to_short(fac * cur_area_width); + x = area->v1->vec.x + round_fl_to_short(fac * cur_area_width); area_min = area_min_x; - if (sa->v1->vec.x > window_rect->xmin) { + if (area->v1->vec.x > window_rect->xmin) { area_min += U.pixelsize; } - if (sa->v4->vec.x < (window_rect->xmax - 1)) { + if (area->v4->vec.x < (window_rect->xmax - 1)) { area_min += U.pixelsize; } - if (x - sa->v1->vec.x < area_min) { - x = sa->v1->vec.x + area_min; + if (x - area->v1->vec.x < area_min) { + x = area->v1->vec.x + area_min; } - else if (sa->v4->vec.x - x < area_min) { - x = sa->v4->vec.x - area_min; + else if (area->v4->vec.x - x < area_min) { + x = area->v4->vec.x - area_min; } return x; diff --git a/source/blender/editors/screen/screen_intern.h b/source/blender/editors/screen/screen_intern.h index e1a75e51cf2..af57d95c086 100644 --- a/source/blender/editors/screen/screen_intern.h +++ b/source/blender/editors/screen/screen_intern.h @@ -36,7 +36,7 @@ struct bContextDataResult; #define AZONEFADEOUT (6.5f * U.widget_unit) /* when we start seeing the azone */ /* area.c */ -void ED_area_data_copy(ScrArea *sa_dst, ScrArea *sa_src, const bool do_free); +void ED_area_data_copy(ScrArea *area_dst, ScrArea *area_src, const bool do_free); void ED_area_data_swap(ScrArea *sa1, ScrArea *sa2); void region_toggle_hidden(struct bContext *C, ARegion *region, const bool do_fade); @@ -50,11 +50,12 @@ bScreen *screen_change_prepare(bScreen *screen_old, struct Main *bmain, struct bContext *C, wmWindow *win); -ScrArea *area_split(const wmWindow *win, bScreen *sc, ScrArea *sa, char dir, float fac, int merge); +ScrArea *area_split( + const wmWindow *win, bScreen *sc, ScrArea *area, char dir, float fac, int merge); int screen_area_join(struct bContext *C, bScreen *scr, ScrArea *sa1, ScrArea *sa2); -int area_getorientation(ScrArea *sa, ScrArea *sb); +int area_getorientation(ScrArea *area, ScrArea *sb); -struct AZone *ED_area_actionzone_find_xy(ScrArea *sa, const int xy[2]); +struct AZone *ED_area_actionzone_find_xy(ScrArea *area, const int xy[2]); /* screen_geometry.c */ int screen_geom_area_height(const ScrArea *area); @@ -73,7 +74,7 @@ ScrEdge *screen_geom_find_active_scredge(const wmWindow *win, const int mx, const int my); void screen_geom_vertices_scale(const wmWindow *win, bScreen *sc); -short screen_geom_find_area_split_point(const ScrArea *sa, +short screen_geom_find_area_split_point(const ScrArea *area, const rcti *window_rect, char dir, float fac); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 5eb676cd25c..2e4734e75a5 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -590,20 +590,20 @@ bool ED_operator_editmball(bContext *C) bool ED_operator_mask(bContext *C) { - ScrArea *sa = CTX_wm_area(C); - if (sa && sa->spacedata.first) { - switch (sa->spacetype) { + ScrArea *area = CTX_wm_area(C); + if (area && area->spacedata.first) { + switch (area->spacetype) { case SPACE_CLIP: { - SpaceClip *sc = sa->spacedata.first; + SpaceClip *sc = area->spacedata.first; return ED_space_clip_check_show_maskedit(sc); } case SPACE_SEQ: { - SpaceSeq *sseq = sa->spacedata.first; + SpaceSeq *sseq = area->spacedata.first; Scene *scene = CTX_data_scene(C); return ED_space_sequencer_check_show_maskedit(sseq, scene); } case SPACE_IMAGE: { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; ViewLayer *view_layer = CTX_data_view_layer(C); return ED_space_image_check_show_maskedit(sima, view_layer); } @@ -681,8 +681,8 @@ static bool actionzone_area_poll(bContext *C) const int *xy = &win->eventstate->x; AZone *az; - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - for (az = sa->actionzones.first; az; az = az->next) { + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + for (az = area->actionzones.first; az; az = az->next) { if (BLI_rcti_isect_pt_v(&az->rect, xy)) { return 1; } @@ -743,11 +743,11 @@ static bool azone_clipped_rect_calc(const AZone *az, rcti *r_rect_clip) return false; } -static AZone *area_actionzone_refresh_xy(ScrArea *sa, const int xy[2], const bool test_only) +static AZone *area_actionzone_refresh_xy(ScrArea *area, const int xy[2], const bool test_only) { AZone *az = NULL; - for (az = sa->actionzones.first; az; az = az->next) { + for (az = area->actionzones.first; az; az = az->next) { rcti az_rect_clip; if (BLI_rcti_isect_pt_v(&az->rect, xy) && /* Check clipping if this is clipped */ @@ -798,7 +798,7 @@ static AZone *area_actionzone_refresh_xy(ScrArea *sa, const int xy[2], const boo } /* XXX force redraw to show/hide the action zone */ - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; } } @@ -868,18 +868,18 @@ static AZone *area_actionzone_refresh_xy(ScrArea *sa, const int xy[2], const boo else if (!test_only && !IS_EQF(az->alpha, 0.0f)) { if (az->type == AZONE_FULLSCREEN) { az->alpha = 0.0f; - sa->flag &= ~AREA_FLAG_ACTIONZONES_UPDATE; - ED_area_tag_redraw_no_rebuild(sa); + area->flag &= ~AREA_FLAG_ACTIONZONES_UPDATE; + ED_area_tag_redraw_no_rebuild(area); } else if (az->type == AZONE_REGION_SCROLL) { if (az->direction == AZ_SCROLL_VERT) { az->alpha = az->region->v2d.alpha_vert = 0; - sa->flag &= ~AREA_FLAG_ACTIONZONES_UPDATE; + area->flag &= ~AREA_FLAG_ACTIONZONES_UPDATE; ED_region_tag_redraw_no_rebuild(az->region); } else if (az->direction == AZ_SCROLL_HOR) { az->alpha = az->region->v2d.alpha_hor = 0; - sa->flag &= ~AREA_FLAG_ACTIONZONES_UPDATE; + area->flag &= ~AREA_FLAG_ACTIONZONES_UPDATE; ED_region_tag_redraw_no_rebuild(az->region); } else { @@ -895,8 +895,8 @@ static AZone *area_actionzone_refresh_xy(ScrArea *sa, const int xy[2], const boo /* Finds an action-zone by position in entire screen so azones can overlap. */ static AZone *screen_actionzone_find_xy(bScreen *sc, const int xy[2]) { - for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { - AZone *az = area_actionzone_refresh_xy(sa, xy, true); + for (ScrArea *area = sc->areabase.first; area; area = area->next) { + AZone *az = area_actionzone_refresh_xy(area, xy, true); if (az != NULL) { return az; } @@ -917,14 +917,14 @@ static ScrArea *screen_actionzone_area(bScreen *sc, const AZone *az) return NULL; } -AZone *ED_area_actionzone_find_xy(ScrArea *sa, const int xy[2]) +AZone *ED_area_actionzone_find_xy(ScrArea *area, const int xy[2]) { - return area_actionzone_refresh_xy(sa, xy, true); + return area_actionzone_refresh_xy(area, xy, true); } -AZone *ED_area_azones_update(ScrArea *sa, const int xy[2]) +AZone *ED_area_azones_update(ScrArea *area, const int xy[2]) { - return area_actionzone_refresh_xy(sa, xy, false); + return area_actionzone_refresh_xy(area, xy, false); } static void actionzone_exit(wmOperator *op) @@ -1327,12 +1327,12 @@ static int area_dupli_invoke(bContext *C, wmOperator *op, const wmEvent *event) WorkSpaceLayout *layout_old = WM_window_get_active_layout(win); WorkSpaceLayout *layout_new; bScreen *newsc; - ScrArea *sa; + ScrArea *area; rcti rect; win = CTX_wm_window(C); scene = CTX_data_scene(C); - sa = CTX_wm_area(C); + area = CTX_wm_area(C); /* XXX hrmf! */ if (event->type == EVT_ACTIONZONE_AREA) { @@ -1342,11 +1342,11 @@ static int area_dupli_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_PASS_THROUGH; } - sa = sad->sa1; + area = sad->sa1; } /* adds window to WM */ - rect = sa->totrct; + rect = area->totrct; BLI_rcti_translate(&rect, win->posx, win->posy); rect.xmax = rect.xmin + BLI_rcti_size_x(&rect) / U.pixelsize; rect.ymax = rect.ymin + BLI_rcti_size_y(&rect) / U.pixelsize; @@ -1371,7 +1371,7 @@ static int area_dupli_invoke(bContext *C, wmOperator *op, const wmEvent *event) WM_window_set_active_layout(newwin, workspace, layout_new); /* copy area to new screen */ - ED_area_data_copy((ScrArea *)newsc->areabase.first, sa, true); + ED_area_data_copy((ScrArea *)newsc->areabase.first, area, true); ED_area_tag_redraw((ScrArea *)newsc->areabase.first); @@ -1507,25 +1507,25 @@ static void area_move_set_limits( WM_window_rect_calc(win, &window_rect); - for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { + for (ScrArea *area = sc->areabase.first; area; area = area->next) { if (dir == 'h') { int y1; areamin = areaminy; - if (sa->v1->vec.y > window_rect.ymin) { + if (area->v1->vec.y > window_rect.ymin) { areamin += U.pixelsize; } - if (sa->v2->vec.y < (window_rect.ymax - 1)) { + if (area->v2->vec.y < (window_rect.ymax - 1)) { areamin += U.pixelsize; } - y1 = screen_geom_area_height(sa) - areamin; + y1 = screen_geom_area_height(area) - areamin; /* if top or down edge selected, test height */ - if (sa->v1->editflag && sa->v4->editflag) { + if (area->v1->editflag && area->v4->editflag) { *bigger = min_ii(*bigger, y1); } - else if (sa->v2->editflag && sa->v3->editflag) { + else if (area->v2->editflag && area->v3->editflag) { *smaller = min_ii(*smaller, y1); } } @@ -1533,20 +1533,20 @@ static void area_move_set_limits( int x1; areamin = AREAMINX; - if (sa->v1->vec.x > window_rect.xmin) { + if (area->v1->vec.x > window_rect.xmin) { areamin += U.pixelsize; } - if (sa->v4->vec.x < (window_rect.xmax - 1)) { + if (area->v4->vec.x < (window_rect.xmax - 1)) { areamin += U.pixelsize; } - x1 = screen_geom_area_width(sa) - areamin; + x1 = screen_geom_area_width(area) - areamin; /* if left or right edge selected, test width */ - if (sa->v1->editflag && sa->v2->editflag) { + if (area->v1->editflag && area->v2->editflag) { *bigger = min_ii(*bigger, x1); } - else if (sa->v3->editflag && sa->v4->editflag) { + else if (area->v3->editflag && area->v4->editflag) { *smaller = min_ii(*smaller, x1); } } @@ -1737,29 +1737,29 @@ static void area_move_apply_do(const bContext *C, /* only redraw if we actually moved a screen vert, for AREAGRID */ if (doredraw) { bool redraw_all = false; - ED_screen_areas_iter(win, sc, sa) + ED_screen_areas_iter(win, sc, area) { - if (sa->v1->editflag || sa->v2->editflag || sa->v3->editflag || sa->v4->editflag) { - if (ED_area_is_global(sa)) { + if (area->v1->editflag || area->v2->editflag || area->v3->editflag || area->v4->editflag) { + if (ED_area_is_global(area)) { /* Snap to minimum or maximum for global areas. */ - int height = round_fl_to_int(screen_geom_area_height(sa) / UI_DPI_FAC); - if (abs(height - sa->global->size_min) < abs(height - sa->global->size_max)) { - sa->global->cur_fixed_height = sa->global->size_min; + int height = round_fl_to_int(screen_geom_area_height(area) / UI_DPI_FAC); + if (abs(height - area->global->size_min) < abs(height - area->global->size_max)) { + area->global->cur_fixed_height = area->global->size_min; } else { - sa->global->cur_fixed_height = sa->global->size_max; + area->global->cur_fixed_height = area->global->size_max; } sc->do_refresh = true; redraw_all = true; } - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } } if (redraw_all) { - ED_screen_areas_iter(win, sc, sa) + ED_screen_areas_iter(win, sc, area) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } } @@ -1984,13 +1984,13 @@ static int area_split_menu_init(bContext *C, wmOperator *op) /* generic init, no UI stuff here, assumes active area */ static int area_split_init(bContext *C, wmOperator *op) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); sAreaSplitData *sd; int areaminy = ED_area_headersize(); int dir; /* required context */ - if (sa == NULL) { + if (area == NULL) { return 0; } @@ -1998,10 +1998,10 @@ static int area_split_init(bContext *C, wmOperator *op) dir = RNA_enum_get(op->ptr, "direction"); /* minimal size */ - if (dir == 'v' && sa->winx < 2 * AREAMINX) { + if (dir == 'v' && area->winx < 2 * AREAMINX) { return 0; } - if (dir == 'h' && sa->winy < 2 * areaminy) { + if (dir == 'h' && area->winy < 2 * areaminy) { return 0; } @@ -2009,42 +2009,42 @@ static int area_split_init(bContext *C, wmOperator *op) sd = (sAreaSplitData *)MEM_callocN(sizeof(sAreaSplitData), "op_area_split"); op->customdata = sd; - sd->sarea = sa; + sd->sarea = area; if (dir == 'v') { - sd->origmin = sa->v1->vec.x; - sd->origsize = sa->v4->vec.x - sd->origmin; + sd->origmin = area->v1->vec.x; + sd->origsize = area->v4->vec.x - sd->origmin; } else { - sd->origmin = sa->v1->vec.y; - sd->origsize = sa->v2->vec.y - sd->origmin; + sd->origmin = area->v1->vec.y; + sd->origsize = area->v2->vec.y - sd->origmin; } return 1; } -/* with sa as center, sb is located at: 0=W, 1=N, 2=E, 3=S */ +/* with area as center, sb is located at: 0=W, 1=N, 2=E, 3=S */ /* used with split operator */ -static ScrEdge *area_findsharededge(bScreen *screen, ScrArea *sa, ScrArea *sb) +static ScrEdge *area_findsharededge(bScreen *screen, ScrArea *area, ScrArea *sb) { - ScrVert *sav1 = sa->v1; - ScrVert *sav2 = sa->v2; - ScrVert *sav3 = sa->v3; - ScrVert *sav4 = sa->v4; + ScrVert *sav1 = area->v1; + ScrVert *sav2 = area->v2; + ScrVert *sav3 = area->v3; + ScrVert *sav4 = area->v4; ScrVert *sbv1 = sb->v1; ScrVert *sbv2 = sb->v2; ScrVert *sbv3 = sb->v3; ScrVert *sbv4 = sb->v4; - if (sav1 == sbv4 && sav2 == sbv3) { /* sa to right of sb = W */ + if (sav1 == sbv4 && sav2 == sbv3) { /* area to right of sb = W */ return BKE_screen_find_edge(screen, sav1, sav2); } - else if (sav2 == sbv1 && sav3 == sbv4) { /* sa to bottom of sb = N */ + else if (sav2 == sbv1 && sav3 == sbv4) { /* area to bottom of sb = N */ return BKE_screen_find_edge(screen, sav2, sav3); } - else if (sav3 == sbv2 && sav4 == sbv1) { /* sa to left of sb = E */ + else if (sav3 == sbv2 && sav4 == sbv1) { /* area to left of sb = E */ return BKE_screen_find_edge(screen, sav3, sav4); } - else if (sav1 == sbv2 && sav4 == sbv3) { /* sa on top of sb = S*/ + else if (sav1 == sbv2 && sav4 == sbv3) { /* area on top of sb = S*/ return BKE_screen_find_edge(screen, sav1, sav4); } @@ -2198,18 +2198,18 @@ static int area_split_invoke(bContext *C, wmOperator *op, const wmEvent *event) } } else if (RNA_property_is_set(op->ptr, prop_dir)) { - ScrArea *sa = CTX_wm_area(C); - if (sa == NULL) { + ScrArea *area = CTX_wm_area(C); + if (area == NULL) { return OPERATOR_CANCELLED; } dir = RNA_property_enum_get(op->ptr, prop_dir); if (dir == 'h') { RNA_property_float_set( - op->ptr, prop_factor, ((float)(event->x - sa->v1->vec.x)) / (float)sa->winx); + op->ptr, prop_factor, ((float)(event->x - area->v1->vec.x)) / (float)area->winx); } else { RNA_property_float_set( - op->ptr, prop_factor, ((float)(event->y - sa->v1->vec.y)) / (float)sa->winy); + op->ptr, prop_factor, ((float)(event->y - area->v1->vec.y)) / (float)area->winy); } if (!area_split_init(C, op)) { @@ -2389,18 +2389,18 @@ static int area_split_modal(bContext *C, wmOperator *op, const wmEvent *event) sd->sarea = BKE_screen_find_area_xy(CTX_wm_screen(C), SPACE_TYPE_ANY, event->x, event->y); if (sd->sarea) { - ScrArea *sa = sd->sarea; + ScrArea *area = sd->sarea; if (dir == 'v') { - sd->origmin = sa->v1->vec.x; - sd->origsize = sa->v4->vec.x - sd->origmin; + sd->origmin = area->v1->vec.x; + sd->origsize = area->v4->vec.x - sd->origmin; } else { - sd->origmin = sa->v1->vec.y; - sd->origsize = sa->v2->vec.y - sd->origmin; + sd->origmin = area->v1->vec.y; + sd->origsize = area->v2->vec.y - sd->origmin; } if (sd->do_snap) { - sa->v1->editflag = sa->v2->editflag = sa->v3->editflag = sa->v4->editflag = 1; + area->v1->editflag = area->v2->editflag = area->v3->editflag = area->v4->editflag = 1; const int snap_loc = area_snap_calc_location(CTX_wm_screen(C), SNAP_FRACTION_AND_ADJACENT, @@ -2410,7 +2410,7 @@ static int area_split_modal(bContext *C, wmOperator *op, const wmEvent *event) sd->origmin + sd->origsize, -sd->origmin); - sa->v1->editflag = sa->v2->editflag = sa->v3->editflag = sa->v4->editflag = 0; + area->v1->editflag = area->v2->editflag = area->v3->editflag = area->v4->editflag = 0; sd->delta = snap_loc - sd->origval; } @@ -2465,7 +2465,7 @@ static void SCREEN_OT_area_split(wmOperatorType *ot) typedef struct RegionMoveData { AZone *az; ARegion *region; - ScrArea *sa; + ScrArea *area; int bigger, smaller, origval; int origx, origy; int maxsize; @@ -2473,7 +2473,7 @@ typedef struct RegionMoveData { } RegionMoveData; -static int area_max_regionsize(ScrArea *sa, ARegion *scalear, AZEdge edge) +static int area_max_regionsize(ScrArea *area, ARegion *scalear, AZEdge edge) { int dist; @@ -2492,15 +2492,15 @@ static int area_max_regionsize(ScrArea *sa, ARegion *scalear, AZEdge edge) } else { if (edge == AE_RIGHT_TO_TOPLEFT || edge == AE_LEFT_TO_TOPRIGHT) { - dist = BLI_rcti_size_x(&sa->totrct); + dist = BLI_rcti_size_x(&area->totrct); } else { /* AE_BOTTOM_TO_TOPLEFT, AE_TOP_TO_BOTTOMRIGHT */ - dist = BLI_rcti_size_y(&sa->totrct); + dist = BLI_rcti_size_y(&area->totrct); } /* subtractwidth of regions on opposite side * prevents dragging regions into other opposite regions */ - for (ARegion *region = sa->regionbase.first; region; region = region->next) { + for (ARegion *region = area->regionbase.first; region; region = region->next) { if (region == scalear) { continue; } @@ -2574,11 +2574,11 @@ static int region_scale_invoke(bContext *C, wmOperator *op, const wmEvent *event else { rmd->region = az->region; } - rmd->sa = sad->sa1; + rmd->area = sad->sa1; rmd->edge = az->edge; rmd->origx = event->x; rmd->origy = event->y; - rmd->maxsize = area_max_regionsize(rmd->sa, rmd->region, rmd->edge); + rmd->maxsize = area_max_regionsize(rmd->area, rmd->region, rmd->edge); /* if not set we do now, otherwise it uses type */ if (rmd->region->sizex == 0) { @@ -2641,7 +2641,7 @@ static void region_scale_toggle_hidden(bContext *C, RegionMoveData *rmd) if ((rmd->region->flag & RGN_FLAG_HIDDEN) == 0) { if (rmd->region->regiontype == RGN_TYPE_HEADER) { - ARegion *region_tool_header = BKE_area_find_region_type(rmd->sa, RGN_TYPE_TOOL_HEADER); + ARegion *region_tool_header = BKE_area_find_region_type(rmd->area, RGN_TYPE_TOOL_HEADER); if (region_tool_header != NULL) { if ((region_tool_header->flag & RGN_FLAG_HIDDEN_BY_USER) == 0 && (region_tool_header->flag & RGN_FLAG_HIDDEN) != 0) { @@ -2732,7 +2732,7 @@ static int region_scale_modal(bContext *C, wmOperator *op, const wmEvent *event) rmd->region->sizey = rmd->origval; } } - ED_area_tag_redraw(rmd->sa); + ED_area_tag_redraw(rmd->area); WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL); break; @@ -2747,7 +2747,7 @@ static int region_scale_modal(bContext *C, wmOperator *op, const wmEvent *event) region_scale_validate_size(rmd); } - ED_area_tag_redraw(rmd->sa); + ED_area_tag_redraw(rmd->area); WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL); } @@ -2800,13 +2800,13 @@ static void areas_do_frame_follow(bContext *C, bool middle) for (wmWindow *window = wm->windows.first; window; window = window->next) { const bScreen *screen = WM_window_get_active_screen(window); - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - for (ARegion *region = sa->regionbase.first; region; region = region->next) { + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + for (ARegion *region = area->regionbase.first; region; region = region->next) { /* do follow here if editor type supports it */ if ((scr->redraws_flag & TIME_FOLLOW)) { if ((region->regiontype == RGN_TYPE_WINDOW && - ELEM(sa->spacetype, SPACE_SEQ, SPACE_GRAPH, SPACE_ACTION, SPACE_NLA)) || - (sa->spacetype == SPACE_CLIP && region->regiontype == RGN_TYPE_PREVIEW)) { + ELEM(area->spacetype, SPACE_SEQ, SPACE_GRAPH, SPACE_ACTION, SPACE_NLA)) || + (area->spacetype == SPACE_CLIP && region->regiontype == RGN_TYPE_PREVIEW)) { float w = BLI_rctf_size_x(®ion->v2d.cur); if (middle) { @@ -3155,32 +3155,32 @@ static void SCREEN_OT_screen_set(wmOperatorType *ot) static int screen_maximize_area_exec(bContext *C, wmOperator *op) { bScreen *screen = CTX_wm_screen(C); - ScrArea *sa = NULL; + ScrArea *area = NULL; const bool hide_panels = RNA_boolean_get(op->ptr, "use_hide_panels"); /* search current screen for 'fullscreen' areas */ /* prevents restoring info header, when mouse is over it */ - for (sa = screen->areabase.first; sa; sa = sa->next) { - if (sa->full) { + for (area = screen->areabase.first; area; area = area->next) { + if (area->full) { break; } } - if (sa == NULL) { - sa = CTX_wm_area(C); + if (area == NULL) { + area = CTX_wm_area(C); } if (hide_panels) { if (!ELEM(screen->state, SCREENNORMAL, SCREENFULL)) { return OPERATOR_CANCELLED; } - ED_screen_state_toggle(C, CTX_wm_window(C), sa, SCREENFULL); + ED_screen_state_toggle(C, CTX_wm_window(C), area, SCREENFULL); } else { if (!ELEM(screen->state, SCREENNORMAL, SCREENMAXIMIZED)) { return OPERATOR_CANCELLED; } - ED_screen_state_toggle(C, CTX_wm_window(C), sa, SCREENMAXIMIZED); + ED_screen_state_toggle(C, CTX_wm_window(C), area, SCREENMAXIMIZED); } return OPERATOR_FINISHED; @@ -3396,24 +3396,24 @@ static int area_join_modal(bContext *C, wmOperator *op, const wmEvent *event) switch (event->type) { case MOUSEMOVE: { - ScrArea *sa = BKE_screen_find_area_xy(sc, SPACE_TYPE_ANY, event->x, event->y); + ScrArea *area = BKE_screen_find_area_xy(sc, SPACE_TYPE_ANY, event->x, event->y); int dir = -1; - if (sa) { - if (jd->sa1 != sa) { - dir = area_getorientation(jd->sa1, sa); + if (area) { + if (jd->sa1 != area) { + dir = area_getorientation(jd->sa1, area); if (dir != -1) { - jd->sa2 = sa; + jd->sa2 = area; } else { /* we are not bordering on the previously selected area * we check if area has common border with the one marked for removal * in this case we can swap areas. */ - dir = area_getorientation(sa, jd->sa2); + dir = area_getorientation(area, jd->sa2); if (dir != -1) { jd->sa1 = jd->sa2; - jd->sa2 = sa; + jd->sa2 = area; } else { jd->sa2 = NULL; @@ -3426,16 +3426,16 @@ static int area_join_modal(bContext *C, wmOperator *op, const wmEvent *event) * we swap the areas if possible to allow user to choose */ if (jd->sa2 != NULL) { jd->sa1 = jd->sa2; - jd->sa2 = sa; + jd->sa2 = area; dir = area_getorientation(jd->sa1, jd->sa2); if (dir == -1) { printf("oops, didn't expect that!\n"); } } else { - dir = area_getorientation(jd->sa1, sa); + dir = area_getorientation(jd->sa1, area); if (dir != -1) { - jd->sa2 = sa; + jd->sa2 = area; } } WM_event_add_notifier(C, NC_WINDOW, NULL); @@ -3612,18 +3612,18 @@ static int spacedata_cleanup_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); bScreen *screen; - ScrArea *sa; + ScrArea *area; int tot = 0; for (screen = bmain->screens.first; screen; screen = screen->id.next) { - for (sa = screen->areabase.first; sa; sa = sa->next) { - if (sa->spacedata.first != sa->spacedata.last) { - SpaceLink *sl = sa->spacedata.first; - - BLI_remlink(&sa->spacedata, sl); - tot += BLI_listbase_count(&sa->spacedata); - BKE_spacedata_freelist(&sa->spacedata); - BLI_addtail(&sa->spacedata, sl); + for (area = screen->areabase.first; area; area = area->next) { + if (area->spacedata.first != area->spacedata.last) { + SpaceLink *sl = area->spacedata.first; + + BLI_remlink(&area->spacedata, sl); + tot += BLI_listbase_count(&area->spacedata); + BKE_spacedata_freelist(&area->spacedata); + BLI_addtail(&area->spacedata, sl); } } } @@ -3809,7 +3809,7 @@ static void view3d_localview_update_rv3d(struct RegionView3D *rv3d) } static void region_quadview_init_rv3d( - ScrArea *sa, ARegion *region, const char viewlock, const char view, const char persp) + ScrArea *area, ARegion *region, const char viewlock, const char view, const char persp) { RegionView3D *rv3d = region->regiondata; @@ -3826,7 +3826,7 @@ static void region_quadview_init_rv3d( ED_view3d_lock(rv3d); view3d_localview_update_rv3d(rv3d); if ((viewlock & RV3D_BOXCLIP) && (persp == RV3D_ORTHO)) { - ED_view3d_quadview_update(sa, region, true); + ED_view3d_quadview_update(area, region, true); } } @@ -3841,13 +3841,13 @@ static int region_quadview_exec(bContext *C, wmOperator *op) } else if (region->alignment == RGN_ALIGN_QSPLIT) { /* Exit quad-view */ - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *arn; /* keep current region */ region->alignment = 0; - if (sa->spacetype == SPACE_VIEW3D) { + if (area->spacetype == SPACE_VIEW3D) { ARegion *region_iter; RegionView3D *rv3d = region->regiondata; @@ -3869,7 +3869,7 @@ static int region_quadview_exec(bContext *C, wmOperator *op) rv3d->rflag &= ~RV3D_CLIPPING; /* Accumulate locks, in case they're mixed. */ - for (region_iter = sa->regionbase.first; region_iter; region_iter = region_iter->next) { + 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; @@ -3877,13 +3877,13 @@ static int region_quadview_exec(bContext *C, wmOperator *op) } } - for (region = sa->regionbase.first; region; region = arn) { + for (region = area->regionbase.first; region; region = arn) { arn = region->next; if (region->alignment == RGN_ALIGN_QSPLIT) { - ED_region_remove(C, sa, region); + ED_region_remove(C, area, region); } } - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL); } else if (region->next) { @@ -3891,20 +3891,20 @@ static int region_quadview_exec(bContext *C, wmOperator *op) } else { /* Enter quad-view */ - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *newar; int count; region->alignment = RGN_ALIGN_QSPLIT; for (count = 0; count < 3; count++) { - newar = BKE_area_region_copy(sa->type, region); - BLI_addtail(&sa->regionbase, newar); + newar = BKE_area_region_copy(area->type, region); + BLI_addtail(&area->regionbase, newar); } /* lock views and set them */ - if (sa->spacetype == SPACE_VIEW3D) { - View3D *v3d = sa->spacedata.first; + if (area->spacetype == SPACE_VIEW3D) { + View3D *v3d = area->spacedata.first; int index_qsplit = 0; /* run ED_view3d_lock() so the correct 'rv3d->viewquat' is set, @@ -3919,13 +3919,13 @@ static int region_quadview_exec(bContext *C, wmOperator *op) RV3D_LOCK_ROTATION; region_quadview_init_rv3d( - sa, region, viewlock, ED_view3d_lock_view_from_index(index_qsplit++), RV3D_ORTHO); - region_quadview_init_rv3d(sa, + area, region, viewlock, ED_view3d_lock_view_from_index(index_qsplit++), RV3D_ORTHO); + region_quadview_init_rv3d(area, (region = region->next), viewlock, ED_view3d_lock_view_from_index(index_qsplit++), RV3D_ORTHO); - region_quadview_init_rv3d(sa, + region_quadview_init_rv3d(area, (region = region->next), viewlock, ED_view3d_lock_view_from_index(index_qsplit++), @@ -3933,16 +3933,16 @@ static int region_quadview_exec(bContext *C, wmOperator *op) /* forcing camera is distracting */ #if 0 if (v3d->camera) { - region_quadview_init_rv3d(sa, (region = region->next), 0, RV3D_VIEW_CAMERA, RV3D_CAMOB); + region_quadview_init_rv3d(area, (region = region->next), 0, RV3D_VIEW_CAMERA, RV3D_CAMOB); } else { - region_quadview_init_rv3d(sa, (region = region->next), 0, RV3D_VIEW_USER, RV3D_PERSP); + region_quadview_init_rv3d(area, (region = region->next), 0, RV3D_VIEW_USER, RV3D_PERSP); } #else (void)v3d; #endif } - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL); } @@ -4091,11 +4091,11 @@ static void SCREEN_OT_region_flip(wmOperatorType *ot) /* show/hide header text menus */ static int header_toggle_menus_exec(bContext *C, wmOperator *UNUSED(op)) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); - sa->flag = sa->flag ^ HEADER_NO_PULLDOWN; + area->flag = area->flag ^ HEADER_NO_PULLDOWN; - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL); return OPERATOR_FINISHED; @@ -4122,42 +4122,42 @@ static void SCREEN_OT_header_toggle_menus(wmOperatorType *ot) static bool screen_region_context_menu_poll(bContext *C) { - ScrArea *sa = CTX_wm_area(C); - return (sa && sa->spacetype != SPACE_STATUSBAR); + ScrArea *area = CTX_wm_area(C); + return (area && area->spacetype != SPACE_STATUSBAR); } void ED_screens_header_tools_menu_create(bContext *C, uiLayout *layout, void *UNUSED(arg)) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); const char *but_flip_str = (RGN_ALIGN_ENUM_FROM_MASK(region->alignment) == RGN_ALIGN_TOP) ? IFACE_("Flip to Bottom") : IFACE_("Flip to Top"); { PointerRNA ptr; - RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_Space, sa->spacedata.first, &ptr); - if (!ELEM(sa->spacetype, SPACE_TOPBAR)) { + RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_Space, area->spacedata.first, &ptr); + if (!ELEM(area->spacetype, SPACE_TOPBAR)) { uiItemR(layout, &ptr, "show_region_header", 0, IFACE_("Show Header"), ICON_NONE); } - ARegion *region_header = BKE_area_find_region_type(sa, RGN_TYPE_HEADER); + ARegion *region_header = BKE_area_find_region_type(area, RGN_TYPE_HEADER); uiLayout *col = uiLayoutColumn(layout, 0); uiLayoutSetActive(col, (region_header->flag & RGN_FLAG_HIDDEN) == 0); - if (BKE_area_find_region_type(sa, RGN_TYPE_TOOL_HEADER)) { + if (BKE_area_find_region_type(area, RGN_TYPE_TOOL_HEADER)) { uiItemR(col, &ptr, "show_region_tool_header", 0, IFACE_("Show Tool Settings"), ICON_NONE); } uiItemO(col, IFACE_("Show Menus"), - (sa->flag & HEADER_NO_PULLDOWN) ? ICON_CHECKBOX_DEHLT : ICON_CHECKBOX_HLT, + (area->flag & HEADER_NO_PULLDOWN) ? ICON_CHECKBOX_DEHLT : ICON_CHECKBOX_HLT, "SCREEN_OT_header_toggle_menus"); } /* default is WM_OP_INVOKE_REGION_WIN, which we don't want here. */ uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_DEFAULT); - if (!ELEM(sa->spacetype, SPACE_TOPBAR)) { + if (!ELEM(area->spacetype, SPACE_TOPBAR)) { uiItemS(layout); uiItemO(layout, but_flip_str, ICON_NONE, "SCREEN_OT_region_flip"); @@ -4165,24 +4165,24 @@ void ED_screens_header_tools_menu_create(bContext *C, uiLayout *layout, void *UN /* File browser should be fullscreen all the time, top-bar should * never be. But other regions can be maximized/restored. */ - if (!ELEM(sa->spacetype, SPACE_FILE, SPACE_TOPBAR)) { + if (!ELEM(area->spacetype, SPACE_FILE, SPACE_TOPBAR)) { uiItemS(layout); - const char *but_str = sa->full ? IFACE_("Tile Area") : IFACE_("Maximize Area"); + const char *but_str = area->full ? IFACE_("Tile Area") : IFACE_("Maximize Area"); uiItemO(layout, but_str, ICON_NONE, "SCREEN_OT_screen_full_area"); } } void ED_screens_footer_tools_menu_create(bContext *C, uiLayout *layout, void *UNUSED(arg)) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); const char *but_flip_str = (RGN_ALIGN_ENUM_FROM_MASK(region->alignment) == RGN_ALIGN_TOP) ? IFACE_("Flip to Bottom") : IFACE_("Flip to Top"); { PointerRNA ptr; - RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_Space, sa->spacedata.first, &ptr); + RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_Space, area->spacedata.first, &ptr); uiItemR(layout, &ptr, "show_region_footer", 0, IFACE_("Show Footer"), ICON_NONE); } @@ -4193,10 +4193,10 @@ void ED_screens_footer_tools_menu_create(bContext *C, uiLayout *layout, void *UN /* File browser should be fullscreen all the time, top-bar should * never be. But other regions can be maximized/restored... */ - if (!ELEM(sa->spacetype, SPACE_FILE, SPACE_TOPBAR)) { + if (!ELEM(area->spacetype, SPACE_FILE, SPACE_TOPBAR)) { uiItemS(layout); - const char *but_str = sa->full ? IFACE_("Tile Area") : IFACE_("Maximize Area"); + const char *but_str = area->full ? IFACE_("Tile Area") : IFACE_("Maximize Area"); uiItemO(layout, but_str, ICON_NONE, "SCREEN_OT_screen_full_area"); } } @@ -4383,7 +4383,7 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), const wmEv ScreenAnimData *sad = wt->customdata; wmWindowManager *wm = CTX_wm_manager(C); wmWindow *window; - ScrArea *sa; + ScrArea *area; int sync; float time; @@ -4514,15 +4514,15 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), const wmEv for (window = wm->windows.first; window; window = window->next) { const bScreen *win_screen = WM_window_get_active_screen(window); - for (sa = win_screen->areabase.first; sa; sa = sa->next) { + for (area = win_screen->areabase.first; area; area = area->next) { ARegion *region; - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { bool redraw = false; if (region == sad->region) { redraw = true; } else if (match_region_with_redraws( - sa->spacetype, region->regiontype, sad->redraws, sad->from_anim_edit)) { + area->spacetype, region->regiontype, sad->redraws, sad->from_anim_edit)) { redraw = true; } @@ -4531,8 +4531,8 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), const wmEv /* do follow here if editor type supports it */ if ((sad->redraws & TIME_FOLLOW)) { if ((region->regiontype == RGN_TYPE_WINDOW && - ELEM(sa->spacetype, SPACE_SEQ, SPACE_GRAPH, SPACE_ACTION, SPACE_NLA)) || - (sa->spacetype == SPACE_CLIP && region->regiontype == RGN_TYPE_PREVIEW)) { + ELEM(area->spacetype, SPACE_SEQ, SPACE_GRAPH, SPACE_ACTION, SPACE_NLA)) || + (area->spacetype == SPACE_CLIP && region->regiontype == RGN_TYPE_PREVIEW)) { float w = BLI_rctf_size_x(®ion->v2d.cur); if (scene->r.cfra < region->v2d.cur.xmin) { region->v2d.cur.xmax = scene->r.cfra; @@ -4803,20 +4803,20 @@ static void SCREEN_OT_box_select(wmOperatorType *ot) static int fullscreen_back_exec(bContext *C, wmOperator *op) { bScreen *screen = CTX_wm_screen(C); - ScrArea *sa = NULL; + ScrArea *area = NULL; /* search current screen for 'fullscreen' areas */ - for (sa = screen->areabase.first; sa; sa = sa->next) { - if (sa->full) { + for (area = screen->areabase.first; area; area = area->next) { + if (area->full) { break; } } - if (!sa) { + if (!area) { BKE_report(op->reports, RPT_ERROR, "No fullscreen areas were found"); return OPERATOR_CANCELLED; } - ED_screen_full_prevspace(C, sa); + ED_screen_full_prevspace(C, area); return OPERATOR_FINISHED; } @@ -5069,7 +5069,7 @@ static void SCREEN_OT_delete(wmOperatorType *ot) * \{ */ typedef struct RegionAlphaInfo { - ScrArea *sa; + ScrArea *area; ARegion *region, *child_region; /* other region */ int hidden; } RegionAlphaInfo; @@ -5120,10 +5120,10 @@ static void region_blend_end(bContext *C, ARegion *region, const bool is_running else { if (rgi->hidden) { rgi->region->flag |= rgi->hidden; - ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), rgi->sa); + ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), rgi->area); } /* area decoration needs redraw in end */ - ED_area_tag_redraw(rgi->sa); + ED_area_tag_redraw(rgi->area); } WM_event_remove_timer(CTX_wm_manager(C), NULL, region->regiontimer); /* frees rgi */ region->regiontimer = NULL; @@ -5131,7 +5131,7 @@ static void region_blend_end(bContext *C, ARegion *region, const bool is_running /** * \note Assumes that \a region itself is not a split version from previous region. */ -void ED_region_visibility_change_update_animated(bContext *C, ScrArea *sa, ARegion *region) +void ED_region_visibility_change_update_animated(bContext *C, ScrArea *area, ARegion *region) { wmWindowManager *wm = CTX_wm_manager(C); wmWindow *win = CTX_wm_window(C); @@ -5145,13 +5145,13 @@ void ED_region_visibility_change_update_animated(bContext *C, ScrArea *sa, ARegi rgi = MEM_callocN(sizeof(RegionAlphaInfo), "RegionAlphaInfo"); rgi->hidden = region->flag & RGN_FLAG_HIDDEN; - rgi->sa = sa; + rgi->area = area; rgi->region = region; region->flag &= ~RGN_FLAG_HIDDEN; /* blend in, reinitialize regions because it got unhidden */ if (rgi->hidden == 0) { - ED_area_initialize(wm, win, sa); + ED_area_initialize(wm, win, area); } else { WM_event_remove_handlers(C, ®ion->handlers); @@ -5220,8 +5220,8 @@ static void SCREEN_OT_region_blend(wmOperatorType *ot) static bool space_type_set_or_cycle_poll(bContext *C) { - ScrArea *sa = CTX_wm_area(C); - return (sa && !ELEM(sa->spacetype, SPACE_TOPBAR, SPACE_STATUSBAR)); + ScrArea *area = CTX_wm_area(C); + return (area && !ELEM(area->spacetype, SPACE_TOPBAR, SPACE_STATUSBAR)); } static int space_type_set_or_cycle_exec(bContext *C, wmOperator *op) @@ -5229,12 +5229,12 @@ static int space_type_set_or_cycle_exec(bContext *C, wmOperator *op) const int space_type = RNA_enum_get(op->ptr, "space_type"); PointerRNA ptr; - ScrArea *sa = CTX_wm_area(C); - RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_Area, sa, &ptr); + ScrArea *area = CTX_wm_area(C); + RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_Area, area, &ptr); PropertyRNA *prop_type = RNA_struct_find_property(&ptr, "type"); PropertyRNA *prop_ui_type = RNA_struct_find_property(&ptr, "ui_type"); - if (sa->spacetype != space_type) { + if (area->spacetype != space_type) { /* Set the type. */ RNA_property_enum_set(&ptr, prop_type, space_type); RNA_property_update(C, &ptr, prop_type); @@ -5293,25 +5293,25 @@ static const EnumPropertyItem space_context_cycle_direction[] = { static bool space_context_cycle_poll(bContext *C) { - ScrArea *sa = CTX_wm_area(C); - /* sa might be NULL if called out of window bounds */ - return (sa && ELEM(sa->spacetype, SPACE_PROPERTIES, SPACE_USERPREF)); + ScrArea *area = CTX_wm_area(C); + /* area might be NULL if called out of window bounds */ + return (area && ELEM(area->spacetype, SPACE_PROPERTIES, SPACE_USERPREF)); } /** * Helper to get the correct RNA pointer/property pair for changing - * the display context of active space type in \a sa. + * the display context of active space type in \a area. */ static void context_cycle_prop_get(bScreen *screen, - const ScrArea *sa, + const ScrArea *area, PointerRNA *r_ptr, PropertyRNA **r_prop) { const char *propname; - switch (sa->spacetype) { + switch (area->spacetype) { case SPACE_PROPERTIES: - RNA_pointer_create(&screen->id, &RNA_SpaceProperties, sa->spacedata.first, r_ptr); + RNA_pointer_create(&screen->id, &RNA_SpaceProperties, area->spacedata.first, r_ptr); propname = "context"; break; case SPACE_USERPREF: diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 89b83b3518a..83ded5b3503 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -76,13 +76,13 @@ static int screenshot_data_create(bContext *C, wmOperator *op) if (dumprect) { ScreenshotData *scd = MEM_callocN(sizeof(ScreenshotData), "screenshot"); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); scd->dumpsx = dumprect_size[0]; scd->dumpsy = dumprect_size[1]; scd->dumprect = dumprect; - if (sa) { - scd->crop = sa->totrct; + if (area) { + scd->crop = area->totrct; } BKE_imformat_defaults(&scd->im_format); diff --git a/source/blender/editors/screen/workspace_layout_edit.c b/source/blender/editors/screen/workspace_layout_edit.c index 276e36b97dc..1e85a6e256f 100644 --- a/source/blender/editors/screen/workspace_layout_edit.c +++ b/source/blender/editors/screen/workspace_layout_edit.c @@ -172,9 +172,9 @@ bool ED_workspace_layout_cycle(WorkSpace *workspace, const short direction, bCon WorkSpaceLayout *old_layout = BKE_workspace_active_layout_get(win->workspace_hook); WorkSpaceLayout *new_layout; const bScreen *old_screen = BKE_workspace_layout_screen_get(old_layout); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); - if (old_screen->temp || (sa && sa->full && sa->full->temp)) { + if (old_screen->temp || (area && area->full && area->full->temp)) { return false; } @@ -188,9 +188,9 @@ bool ED_workspace_layout_cycle(WorkSpace *workspace, const short direction, bCon if (new_layout && (old_layout != new_layout)) { bScreen *new_screen = BKE_workspace_layout_screen_get(new_layout); - if (sa && sa->full) { + if (area && area->full) { /* return to previous state before switching screens */ - ED_screen_full_restore(C, sa); /* may free screen of old_layout */ + ED_screen_full_restore(C, area); /* may free screen of old_layout */ } ED_screen_change(C, new_screen); diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index cbb0ce84156..58a85fdff25 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -764,9 +764,9 @@ void PAINT_OT_image_paint(wmOperatorType *ot) bool get_imapaint_zoom(bContext *C, float *zoomx, float *zoomy) { - ScrArea *sa = CTX_wm_area(C); - if (sa && sa->spacetype == SPACE_IMAGE) { - SpaceImage *sima = sa->spacedata.first; + ScrArea *area = CTX_wm_area(C); + if (area && area->spacetype == SPACE_IMAGE) { + SpaceImage *sima = area->spacedata.first; if (sima->mode == SI_MODE_PAINT) { ARegion *region = CTX_wm_region(C); ED_space_image_get_zoom(sima, region, zoomx, zoomy); @@ -811,9 +811,9 @@ void ED_space_image_paint_update(Main *bmain, wmWindowManager *wm, Scene *scene) for (wmWindow *win = wm->windows.first; win; win = win->next) { bScreen *screen = WM_window_get_active_screen(win); - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - if (sa->spacetype == SPACE_IMAGE) { - if (((SpaceImage *)sa->spacedata.first)->mode == SI_MODE_PAINT) { + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + if (area->spacetype == SPACE_IMAGE) { + if (((SpaceImage *)area->spacedata.first)->mode == SI_MODE_PAINT) { enabled = true; } } @@ -949,9 +949,9 @@ typedef struct { static void sample_color_update_header(SampleColorData *data, bContext *C) { char msg[UI_MAX_DRAW_STR]; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); - if (sa) { + if (area) { BLI_snprintf(msg, sizeof(msg), TIP_("Sample color for %s"), @@ -1184,10 +1184,10 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op) if (ima) { for (sc = bmain->screens.first; sc; sc = sc->id.next) { - ScrArea *sa; - for (sa = sc->areabase.first; sa; sa = sa->next) { + ScrArea *area; + for (area = sc->areabase.first; area; area = area->next) { SpaceLink *sl; - for (sl = sa->spacedata.first; sl; sl = sl->next) { + for (sl = area->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_IMAGE) { SpaceImage *sima = (SpaceImage *)sl; diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 6494e53e182..0b99806109a 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -6224,13 +6224,13 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op) int maxsize; char err_out[256] = "unknown"; - ScrArea *sa = BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_VIEW3D, 0); - if (!sa) { + ScrArea *area = BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_VIEW3D, 0); + if (!area) { BKE_report(op->reports, RPT_ERROR, "No 3D viewport found to create image from"); return OPERATOR_CANCELLED; } - ARegion *region = BKE_area_find_region_active_win(sa); + ARegion *region = BKE_area_find_region_active_win(area); if (!region) { BKE_report(op->reports, RPT_ERROR, "No 3D viewport found to create image from"); return OPERATOR_CANCELLED; @@ -6250,7 +6250,7 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op) /* Create a copy of the overlays where they are all turned off, except the * texture paint overlay opacity */ - View3D *v3d = sa->spacedata.first; + View3D *v3d = area->spacedata.first; View3D v3d_copy = *v3d; v3d_copy.gridflag = 0; v3d_copy.flag2 = 0; diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 935b9ef9506..e7bc75be45d 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -1597,13 +1597,14 @@ bool paint_poll(bContext *C) { Paint *p = BKE_paint_get_active_from_context(C); Object *ob = CTX_data_active_object(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); - if (p && ob && BKE_paint_brush(p) && (sa && ELEM(sa->spacetype, SPACE_VIEW3D, SPACE_IMAGE)) && + if (p && ob && BKE_paint_brush(p) && + (area && ELEM(area->spacetype, SPACE_VIEW3D, SPACE_IMAGE)) && (region && region->regiontype == RGN_TYPE_WINDOW)) { /* Check the current tool is a brush. */ - bToolRef *tref = sa->runtime.tool; + bToolRef *tref = area->runtime.tool; if (tref && tref->runtime && tref->runtime->data_block[0]) { return true; } diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 8934f4d9668..d050a39ce68 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -214,8 +214,8 @@ bool vertex_paint_mode_poll(bContext *C) static bool vertex_paint_poll_ex(bContext *C, bool check_tool) { if (vertex_paint_mode_poll(C) && BKE_paint_brush(&CTX_data_tool_settings(C)->vpaint->paint)) { - ScrArea *sa = CTX_wm_area(C); - if (sa && sa->spacetype == SPACE_VIEW3D) { + ScrArea *area = CTX_wm_area(C); + if (area && area->spacetype == SPACE_VIEW3D) { ARegion *region = CTX_wm_region(C); if (region->regiontype == RGN_TYPE_WINDOW) { if (!check_tool || WM_toolsystem_active_tool_is_brush(C)) { @@ -247,11 +247,11 @@ bool weight_paint_mode_poll(bContext *C) static bool weight_paint_poll_ex(bContext *C, bool check_tool) { Object *ob = CTX_data_active_object(C); - ScrArea *sa; + ScrArea *area; if ((ob != NULL) && (ob->mode & OB_MODE_WEIGHT_PAINT) && (BKE_paint_brush(&CTX_data_tool_settings(C)->wpaint->paint) != NULL) && - (sa = CTX_wm_area(C)) && (sa->spacetype == SPACE_VIEW3D)) { + (area = CTX_wm_area(C)) && (area->spacetype == SPACE_VIEW3D)) { ARegion *region = CTX_wm_region(C); if (ELEM(region->regiontype, RGN_TYPE_WINDOW, RGN_TYPE_HUD)) { if (!check_tool || WM_toolsystem_active_tool_is_brush(C)) { diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index db138bb907d..d30dce666c4 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -7973,8 +7973,8 @@ static void sculpt_flush_update_done(const bContext *C, Object *ob, SculptUpdate for (wmWindow *win = wm->windows.first; win; win = win->next) { bScreen *screen = WM_window_get_active_screen(win); - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - SpaceLink *sl = sa->spacedata.first; + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + SpaceLink *sl = area->spacedata.first; if (sl->spacetype == SPACE_VIEW3D) { View3D *v3d = (View3D *)sl; if (v3d != current_v3d) { @@ -7984,7 +7984,7 @@ static void sculpt_flush_update_done(const bContext *C, Object *ob, SculptUpdate /* Tag all 3D viewports for redraw now that we are done. Others * viewports did not get a full redraw, and anti-aliasing for the * current viewport was deactivated. */ - for (ARegion *region = sa->regionbase.first; region; region = region->next) { + for (ARegion *region = area->regionbase.first; region; region = region->next) { if (region->regiontype == RGN_TYPE_WINDOW) { ED_region_tag_redraw(region); } @@ -9267,16 +9267,16 @@ static int sample_detail(bContext *C, int mx, int my, int mode) { /* Find 3D view to pick from. */ bScreen *screen = CTX_wm_screen(C); - ScrArea *sa = BKE_screen_find_area_xy(screen, SPACE_VIEW3D, mx, my); - ARegion *region = (sa) ? BKE_area_find_region_xy(sa, RGN_TYPE_WINDOW, mx, my) : NULL; + ScrArea *area = BKE_screen_find_area_xy(screen, SPACE_VIEW3D, mx, my); + ARegion *region = (area) ? BKE_area_find_region_xy(area, RGN_TYPE_WINDOW, mx, my) : NULL; if (region == NULL) { return OPERATOR_CANCELLED; } /* Set context to 3D view. */ - ScrArea *prev_sa = CTX_wm_area(C); + ScrArea *prev_area = CTX_wm_area(C); ARegion *prev_region = CTX_wm_region(C); - CTX_wm_area_set(C, sa); + CTX_wm_area_set(C, area); CTX_wm_region_set(C, region); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -9294,7 +9294,7 @@ static int sample_detail(bContext *C, int mx, int my, int mode) switch (mode) { case SAMPLE_DETAIL_DYNTOPO: if (BKE_pbvh_type(ss->pbvh) != PBVH_BMESH) { - CTX_wm_area_set(C, prev_sa); + CTX_wm_area_set(C, prev_area); CTX_wm_region_set(C, prev_region); return OPERATOR_CANCELLED; } @@ -9302,7 +9302,7 @@ static int sample_detail(bContext *C, int mx, int my, int mode) break; case SAMPLE_DETAIL_VOXEL: if (BKE_pbvh_type(ss->pbvh) != PBVH_FACES) { - CTX_wm_area_set(C, prev_sa); + CTX_wm_area_set(C, prev_area); CTX_wm_region_set(C, prev_region); return OPERATOR_CANCELLED; } @@ -9311,7 +9311,7 @@ static int sample_detail(bContext *C, int mx, int my, int mode) } /* Restore context. */ - CTX_wm_area_set(C, prev_sa); + CTX_wm_area_set(C, prev_area); CTX_wm_region_set(C, prev_region); return OPERATOR_FINISHED; diff --git a/source/blender/editors/space_action/action_data.c b/source/blender/editors/space_action/action_data.c index 6c2cee4042b..beb5d6637ea 100644 --- a/source/blender/editors/space_action/action_data.c +++ b/source/blender/editors/space_action/action_data.c @@ -100,7 +100,7 @@ AnimData *ED_actedit_animdata_from_context(bContext *C) /* Create new action */ static bAction *action_create_new(bContext *C, bAction *oldact) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); bAction *action; /* create action - the way to do this depends on whether we've got an @@ -124,8 +124,8 @@ static bAction *action_create_new(bContext *C, bAction *oldact) id_us_min(&action->id); /* set ID-Root type */ - if (sa->spacetype == SPACE_ACTION) { - SpaceAction *saction = (SpaceAction *)sa->spacedata.first; + if (area->spacetype == SPACE_ACTION) { + SpaceAction *saction = (SpaceAction *)area->spacedata.first; if (saction->mode == SACTCONT_SHAPEKEY) { action->idroot = ID_KE; @@ -550,7 +550,7 @@ void ACTION_OT_stash_and_create(wmOperatorType *ot) void ED_animedit_unlink_action( bContext *C, ID *id, AnimData *adt, bAction *act, ReportList *reports, bool force_delete) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); /* If the old action only has a single user (that it's about to lose), * warn user about it @@ -609,13 +609,13 @@ void ED_animedit_unlink_action( BKE_nla_tweakmode_exit(adt); /* Flush this to the Action Editor (if that's where this change was initiated) */ - if (sa->spacetype == SPACE_ACTION) { + if (area->spacetype == SPACE_ACTION) { actedit_change_action(C, NULL); } } else { /* Unlink normally - Setting it to NULL should be enough to get the old one unlinked */ - if (sa->spacetype == SPACE_ACTION) { + if (area->spacetype == SPACE_ACTION) { /* clear action editor -> action */ actedit_change_action(C, NULL); } diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 7abbd2966a3..605d239133a 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -81,7 +81,7 @@ void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *region) v2d->tot.ymin = -height; /* need to do a view-sync here, so that the keys area doesn't jump around (it must copy this) */ - UI_view2d_sync(NULL, ac->sa, v2d, V2D_LOCK_COPY); + UI_view2d_sync(NULL, ac->area, v2d, V2D_LOCK_COPY); /* loop through channels, and set up drawing depending on their type */ { /* first pass: just the standard GL-drawing for backdrop + text */ diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 64c81797bb4..f3304a48cac 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -60,7 +60,7 @@ /* ******************** default callbacks for action space ***************** */ -static SpaceLink *action_new(const ScrArea *sa, const Scene *scene) +static SpaceLink *action_new(const ScrArea *area, const Scene *scene) { SpaceAction *saction; ARegion *region; @@ -113,7 +113,7 @@ static SpaceLink *action_new(const ScrArea *sa, const Scene *scene) region->regiontype = RGN_TYPE_WINDOW; region->v2d.tot.xmin = (float)(SFRA - 10); - region->v2d.tot.ymin = (float)(-sa->winy) / 3.0f; + region->v2d.tot.ymin = (float)(-area->winy) / 3.0f; region->v2d.tot.xmax = (float)(EFRA + 10); region->v2d.tot.ymax = 0.0f; @@ -144,9 +144,9 @@ static void action_free(SpaceLink *UNUSED(sl)) } /* spacetype; init callback */ -static void action_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa) +static void action_init(struct wmWindowManager *UNUSED(wm), ScrArea *area) { - SpaceAction *saction = sa->spacedata.first; + SpaceAction *saction = area->spacedata.first; saction->runtime.flag |= SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC; } @@ -301,7 +301,7 @@ static void action_header_region_draw(const bContext *C, ARegion *region) } static void action_channel_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -355,12 +355,12 @@ static void saction_channel_region_message_subscribe(const struct bContext *UNUS struct WorkSpace *UNUSED(workspace), struct Scene *UNUSED(scene), struct bScreen *screen, - struct ScrArea *sa, + struct ScrArea *area, struct ARegion *region, struct wmMsgBus *mbus) { PointerRNA ptr; - RNA_pointer_create(&screen->id, &RNA_SpaceDopeSheetEditor, sa->spacedata.first, &ptr); + RNA_pointer_create(&screen->id, &RNA_SpaceDopeSheetEditor, area->spacedata.first, &ptr); wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { .owner = region, @@ -397,7 +397,7 @@ static void saction_channel_region_message_subscribe(const struct bContext *UNUS } static void action_main_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -459,12 +459,12 @@ static void saction_main_region_message_subscribe(const struct bContext *C, struct WorkSpace *workspace, struct Scene *scene, struct bScreen *screen, - struct ScrArea *sa, + struct ScrArea *area, struct ARegion *region, struct wmMsgBus *mbus) { PointerRNA ptr; - RNA_pointer_create(&screen->id, &RNA_SpaceDopeSheetEditor, sa->spacedata.first, &ptr); + RNA_pointer_create(&screen->id, &RNA_SpaceDopeSheetEditor, area->spacedata.first, &ptr); wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { .owner = region, @@ -497,16 +497,16 @@ static void saction_main_region_message_subscribe(const struct bContext *C, } /* Now run the general "channels region" one - since channels and main should be in sync */ - saction_channel_region_message_subscribe(C, workspace, scene, screen, sa, region, mbus); + saction_channel_region_message_subscribe(C, workspace, scene, screen, area, region, mbus); } /* editor level listener */ static void action_listener(wmWindow *UNUSED(win), - ScrArea *sa, + ScrArea *area, wmNotifier *wmn, Scene *UNUSED(scene)) { - SpaceAction *saction = (SpaceAction *)sa->spacedata.first; + SpaceAction *saction = (SpaceAction *)area->spacedata.first; /* context changes */ switch (wmn->category) { @@ -514,11 +514,11 @@ static void action_listener(wmWindow *UNUSED(win), /* only handle these events in GPencil mode for performance considerations */ if (saction->mode == SACTCONT_GPENCIL) { if (wmn->action == NA_EDITED) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } else if (wmn->action == NA_SELECTED) { saction->runtime.flag |= SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC; - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } } break; @@ -526,7 +526,7 @@ static void action_listener(wmWindow *UNUSED(win), /* for NLA tweakmode enter/exit, need complete refresh */ if (wmn->data == ND_NLA_ACTCHANGE) { saction->runtime.flag |= SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC; - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } /* autocolor only really needs to change when channels are added/removed, * or previously hidden stuff appears @@ -534,14 +534,14 @@ static void action_listener(wmWindow *UNUSED(win), */ else if (((wmn->data == ND_KEYFRAME) && ELEM(wmn->action, NA_ADDED, NA_REMOVED)) || ((wmn->data == ND_ANIMCHAN) && (wmn->action != NA_SELECTED))) { - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } /* for simple edits to the curve data though (or just plain selections), * a simple redraw should work * (see T39851 for an example of how this can go wrong) */ else { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } break; case NC_SCENE: @@ -549,7 +549,7 @@ static void action_listener(wmWindow *UNUSED(win), case ND_SEQUENCER: if (wmn->action == NA_SELECTED) { saction->runtime.flag |= SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC; - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } break; case ND_OB_ACTIVE: @@ -557,13 +557,13 @@ static void action_listener(wmWindow *UNUSED(win), /* Selection changed, so force refresh to flush * (needs flag set to do syncing). */ saction->runtime.flag |= SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC; - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); break; case ND_RENDER_RESULT: - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; case ND_FRAME_RANGE: - for (ARegion *region = sa->regionbase.first; region; region = region->next) { + for (ARegion *region = area->regionbase.first; region; region = region->next) { if (region->regiontype == RGN_TYPE_WINDOW) { Scene *scene = wmn->reference; region->v2d.tot.xmin = (float)(SFRA - 4); @@ -575,7 +575,7 @@ static void action_listener(wmWindow *UNUSED(win), default: if (saction->mode != SACTCONT_TIMELINE) { /* Just redrawing the view will do. */ - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } break; } @@ -586,7 +586,7 @@ static void action_listener(wmWindow *UNUSED(win), * (needs flag set to do syncing). */ case ND_BONE_ACTIVE: saction->runtime.flag |= SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC; - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); break; case ND_TRANSFORM: /* moving object shouldn't need to redraw action */ @@ -596,12 +596,12 @@ static void action_listener(wmWindow *UNUSED(win), case ND_PARTICLE: /* only needed in timeline mode */ if (saction->mode == SACTCONT_TIMELINE) { - ED_area_tag_refresh(sa); - ED_area_tag_redraw(sa); + ED_area_tag_refresh(area); + ED_area_tag_redraw(area); } break; default: /* just redrawing the view will do */ - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; } break; @@ -609,11 +609,11 @@ static void action_listener(wmWindow *UNUSED(win), if (saction->mode == SACTCONT_MASK) { switch (wmn->data) { case ND_DATA: - ED_area_tag_refresh(sa); - ED_area_tag_redraw(sa); + ED_area_tag_refresh(area); + ED_area_tag_redraw(area); break; default: /* just redrawing the view will do */ - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; } } @@ -622,33 +622,33 @@ static void action_listener(wmWindow *UNUSED(win), if (wmn->action == NA_SELECTED) { /* selection changed, so force refresh to flush (needs flag set to do syncing) */ saction->runtime.flag |= SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC; - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } break; case NC_SPACE: switch (wmn->data) { case ND_SPACE_DOPESHEET: - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; case ND_SPACE_TIME: - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; case ND_SPACE_CHANGED: saction->runtime.flag |= SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC; - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); break; } break; case NC_WINDOW: if (saction->runtime.flag & SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC) { /* force redraw/refresh after undo/redo - [#28962] */ - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } break; case NC_WM: switch (wmn->data) { case ND_FILEREAD: - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); break; } break; @@ -656,12 +656,12 @@ static void action_listener(wmWindow *UNUSED(win), } static void action_header_region_listener(wmWindow *UNUSED(win), - ScrArea *sa, + ScrArea *area, ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) { - SpaceAction *saction = (SpaceAction *)sa->spacedata.first; + SpaceAction *saction = (SpaceAction *)area->spacedata.first; /* context changes */ switch (wmn->category) { @@ -733,7 +733,7 @@ static void action_buttons_area_draw(const bContext *C, ARegion *region) } static void action_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -769,9 +769,9 @@ static void action_region_listener(wmWindow *UNUSED(win), } } -static void action_refresh(const bContext *C, ScrArea *sa) +static void action_refresh(const bContext *C, ScrArea *area) { - SpaceAction *saction = (SpaceAction *)sa->spacedata.first; + SpaceAction *saction = (SpaceAction *)area->spacedata.first; /* Update the state of the animchannels in response to changes from the data they represent * NOTE: the temp flag is used to indicate when this needs to be done, @@ -789,8 +789,8 @@ static void action_refresh(const bContext *C, ScrArea *sa) * - Regions (such as header) need to be manually tagged for redraw too * or else they don't update [#28962] */ - ED_area_tag_redraw(sa); - for (region = sa->regionbase.first; region; region = region->next) { + ED_area_tag_redraw(area); + for (region = area->regionbase.first; region; region = region->next) { ED_region_tag_redraw(region); } } @@ -799,7 +799,7 @@ static void action_refresh(const bContext *C, ScrArea *sa) // XXX re-sizing y-extents of tot should go here? } -static void action_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID *new_id) +static void action_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_id, ID *new_id) { SpaceAction *sact = (SpaceAction *)slink; @@ -820,15 +820,15 @@ static void action_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, I * The previous non-timeline mode is stored so switching back to the * dope-sheet doesn't always reset the sub-mode. */ -static int action_space_subtype_get(ScrArea *sa) +static int action_space_subtype_get(ScrArea *area) { - SpaceAction *sact = sa->spacedata.first; + SpaceAction *sact = area->spacedata.first; return sact->mode == SACTCONT_TIMELINE ? SACTCONT_TIMELINE : SACTCONT_DOPESHEET; } -static void action_space_subtype_set(ScrArea *sa, int value) +static void action_space_subtype_set(ScrArea *area, int value) { - SpaceAction *sact = sa->spacedata.first; + SpaceAction *sact = area->spacedata.first; if (value == SACTCONT_TIMELINE) { if (sact->mode != SACTCONT_TIMELINE) { sact->mode_prev = sact->mode; diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index 44d64bd750a..f81aaeb0ee4 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -279,7 +279,7 @@ void ED_region_draw_cb_draw(const bContext *C, ARegion *region, int type) void ED_spacetype_xxx(void); /* allocate and init some vars */ -static SpaceLink *xxx_new(const ScrArea *UNUSED(sa), const Scene *UNUSED(scene)) +static SpaceLink *xxx_new(const ScrArea *UNUSED(area), const Scene *UNUSED(scene)) { return NULL; } @@ -290,7 +290,7 @@ static void xxx_free(SpaceLink *UNUSED(sl)) } /* spacetype; init callback for usage, should be redoable */ -static void xxx_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) +static void xxx_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area)) { /* link area to SpaceXXX struct */ diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 2fd54db667b..c8488fc13a4 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -110,7 +110,7 @@ static void buttons_free(SpaceLink *sl) } /* spacetype; init callback */ -static void buttons_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) +static void buttons_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area)) { } @@ -219,7 +219,7 @@ static void buttons_main_region_layout(const bContext *C, ARegion *region) } static void buttons_main_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -274,11 +274,11 @@ static void buttons_header_region_message_subscribe(const bContext *UNUSED(C), WorkSpace *UNUSED(workspace), Scene *UNUSED(scene), bScreen *UNUSED(screen), - ScrArea *sa, + ScrArea *area, ARegion *region, struct wmMsgBus *mbus) { - SpaceProperties *sbuts = sa->spacedata.first; + SpaceProperties *sbuts = area->spacedata.first; wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { .owner = region, .user_data = region, @@ -326,7 +326,7 @@ static void buttons_navigation_bar_region_message_subscribe(const bContext *UNUS WorkSpace *UNUSED(workspace), Scene *UNUSED(scene), bScreen *UNUSED(screen), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, struct wmMsgBus *mbus) { @@ -341,96 +341,96 @@ static void buttons_navigation_bar_region_message_subscribe(const bContext *UNUS /* draw a certain button set only if properties area is currently * showing that button set, to reduce unnecessary drawing. */ -static void buttons_area_redraw(ScrArea *sa, short buttons) +static void buttons_area_redraw(ScrArea *area, short buttons) { - SpaceProperties *sbuts = sa->spacedata.first; + SpaceProperties *sbuts = area->spacedata.first; /* if the area's current button set is equal to the one to redraw */ if (sbuts->mainb == buttons) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } } /* reused! */ static void buttons_area_listener(wmWindow *UNUSED(win), - ScrArea *sa, + ScrArea *area, wmNotifier *wmn, Scene *UNUSED(scene)) { - SpaceProperties *sbuts = sa->spacedata.first; + SpaceProperties *sbuts = area->spacedata.first; /* context changes */ switch (wmn->category) { case NC_SCENE: switch (wmn->data) { case ND_RENDER_OPTIONS: - buttons_area_redraw(sa, BCONTEXT_RENDER); - buttons_area_redraw(sa, BCONTEXT_OUTPUT); - buttons_area_redraw(sa, BCONTEXT_VIEW_LAYER); + buttons_area_redraw(area, BCONTEXT_RENDER); + buttons_area_redraw(area, BCONTEXT_OUTPUT); + buttons_area_redraw(area, BCONTEXT_VIEW_LAYER); break; case ND_WORLD: - buttons_area_redraw(sa, BCONTEXT_WORLD); + buttons_area_redraw(area, BCONTEXT_WORLD); sbuts->preview = 1; break; case ND_FRAME: /* any buttons area can have animated properties so redraw all */ - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); sbuts->preview = 1; break; case ND_OB_ACTIVE: - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); sbuts->preview = 1; break; case ND_KEYINGSET: - buttons_area_redraw(sa, BCONTEXT_SCENE); + buttons_area_redraw(area, BCONTEXT_SCENE); break; case ND_RENDER_RESULT: break; case ND_MODE: case ND_LAYER: default: - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; } break; case NC_OBJECT: switch (wmn->data) { case ND_TRANSFORM: - buttons_area_redraw(sa, BCONTEXT_OBJECT); - buttons_area_redraw(sa, BCONTEXT_DATA); /* autotexpace flag */ + buttons_area_redraw(area, BCONTEXT_OBJECT); + buttons_area_redraw(area, BCONTEXT_DATA); /* autotexpace flag */ break; case ND_POSE: case ND_BONE_ACTIVE: case ND_BONE_SELECT: - buttons_area_redraw(sa, BCONTEXT_BONE); - buttons_area_redraw(sa, BCONTEXT_BONE_CONSTRAINT); - buttons_area_redraw(sa, BCONTEXT_DATA); + buttons_area_redraw(area, BCONTEXT_BONE); + buttons_area_redraw(area, BCONTEXT_BONE_CONSTRAINT); + buttons_area_redraw(area, BCONTEXT_DATA); break; case ND_MODIFIER: if (wmn->action == NA_RENAME) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } else { - buttons_area_redraw(sa, BCONTEXT_MODIFIER); + buttons_area_redraw(area, BCONTEXT_MODIFIER); } - buttons_area_redraw(sa, BCONTEXT_PHYSICS); + buttons_area_redraw(area, BCONTEXT_PHYSICS); break; case ND_CONSTRAINT: - buttons_area_redraw(sa, BCONTEXT_CONSTRAINT); - buttons_area_redraw(sa, BCONTEXT_BONE_CONSTRAINT); + buttons_area_redraw(area, BCONTEXT_CONSTRAINT); + buttons_area_redraw(area, BCONTEXT_BONE_CONSTRAINT); break; case ND_PARTICLE: if (wmn->action == NA_EDITED) { - buttons_area_redraw(sa, BCONTEXT_PARTICLE); + buttons_area_redraw(area, BCONTEXT_PARTICLE); } sbuts->preview = 1; break; case ND_DRAW: - buttons_area_redraw(sa, BCONTEXT_OBJECT); - buttons_area_redraw(sa, BCONTEXT_DATA); - buttons_area_redraw(sa, BCONTEXT_PHYSICS); + buttons_area_redraw(area, BCONTEXT_OBJECT); + buttons_area_redraw(area, BCONTEXT_DATA); + buttons_area_redraw(area, BCONTEXT_PHYSICS); /* Needed to refresh context path when changing active particle system index. */ - buttons_area_redraw(sa, BCONTEXT_PARTICLE); + buttons_area_redraw(area, BCONTEXT_PARTICLE); break; case ND_SHADING: case ND_SHADING_DRAW: @@ -441,7 +441,7 @@ static void buttons_area_listener(wmWindow *UNUSED(win), break; default: /* Not all object RNA props have a ND_ notifier (yet) */ - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; } break; @@ -450,12 +450,12 @@ static void buttons_area_listener(wmWindow *UNUSED(win), case ND_SELECT: case ND_DATA: case ND_VERTEX_GROUP: - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; } break; case NC_MATERIAL: - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); switch (wmn->data) { case ND_SHADING: case ND_SHADING_DRAW: @@ -468,43 +468,43 @@ static void buttons_area_listener(wmWindow *UNUSED(win), } break; case NC_WORLD: - buttons_area_redraw(sa, BCONTEXT_WORLD); + buttons_area_redraw(area, BCONTEXT_WORLD); sbuts->preview = 1; break; case NC_LAMP: - buttons_area_redraw(sa, BCONTEXT_DATA); + buttons_area_redraw(area, BCONTEXT_DATA); sbuts->preview = 1; break; case NC_GROUP: - buttons_area_redraw(sa, BCONTEXT_OBJECT); + buttons_area_redraw(area, BCONTEXT_OBJECT); break; case NC_BRUSH: - buttons_area_redraw(sa, BCONTEXT_TEXTURE); - buttons_area_redraw(sa, BCONTEXT_TOOL); + buttons_area_redraw(area, BCONTEXT_TEXTURE); + buttons_area_redraw(area, BCONTEXT_TOOL); sbuts->preview = 1; break; case NC_TEXTURE: case NC_IMAGE: if (wmn->action != NA_PAINTING) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); sbuts->preview = 1; } break; case NC_SPACE: if (wmn->data == ND_SPACE_PROPERTIES) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } break; case NC_ID: if (wmn->action == NA_RENAME) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } break; case NC_ANIMATION: switch (wmn->data) { case ND_KEYFRAME: if (ELEM(wmn->action, NA_EDITED, NA_ADDED, NA_REMOVED)) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } break; } @@ -513,14 +513,14 @@ static void buttons_area_listener(wmWindow *UNUSED(win), switch (wmn->data) { case ND_DATA: if (ELEM(wmn->action, NA_EDITED, NA_ADDED, NA_REMOVED, NA_SELECTED)) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } break; } break; case NC_NODE: if (wmn->action == NA_SELECTED) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); /* new active node, update texture preview */ if (sbuts->mainb == BCONTEXT_TEXTURE) { sbuts->preview = 1; @@ -530,24 +530,24 @@ static void buttons_area_listener(wmWindow *UNUSED(win), /* Listener for preview render, when doing an global undo. */ case NC_WM: if (wmn->data == ND_UNDO) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); sbuts->preview = 1; } break; #ifdef WITH_FREESTYLE case NC_LINESTYLE: - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); sbuts->preview = 1; break; #endif } if (wmn->data == ND_KEYS) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } } -static void buttons_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID *new_id) +static void buttons_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_id, ID *new_id) { SpaceProperties *sbuts = (SpaceProperties *)slink; diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c index aef6781ec47..84ab5e6524b 100644 --- a/source/blender/editors/space_clip/clip_dopesheet_draw.c +++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c @@ -292,7 +292,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *region, Scene *scene) void clip_draw_dopesheet_channels(const bContext *C, ARegion *region) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); SpaceClip *sc = CTX_wm_space_clip(C); View2D *v2d = ®ion->v2d; MovieClip *clip = ED_space_clip_get_clip(sc); @@ -316,7 +316,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *region) /* need to do a view-sync here, so that the keys area doesn't jump around * (it must copy this) */ - UI_view2d_sync(NULL, sa, v2d, V2D_LOCK_COPY); + UI_view2d_sync(NULL, area, v2d, V2D_LOCK_COPY); /* loop through channels, and set up drawing depending on their type * first pass: just the standard GL-drawing for backdrop + text diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index 62d4a6ae4f0..e174acdea02 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -313,9 +313,9 @@ void ED_clip_update_frame(const Main *mainp, int cfra) for (wmWindow *win = wm->windows.first; win; win = win->next) { bScreen *screen = WM_window_get_active_screen(win); - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - if (sa->spacetype == SPACE_CLIP) { - SpaceClip *sc = sa->spacedata.first; + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + if (area->spacetype == SPACE_CLIP) { + SpaceClip *sc = area->spacedata.first; sc->scopes.ok = false; diff --git a/source/blender/editors/space_clip/clip_intern.h b/source/blender/editors/space_clip/clip_intern.h index 4dc8d367f2b..27493bb5ccd 100644 --- a/source/blender/editors/space_clip/clip_intern.h +++ b/source/blender/editors/space_clip/clip_intern.h @@ -112,7 +112,7 @@ void CLIP_OT_cursor_set(struct wmOperatorType *ot); void CLIP_OT_lock_selection_toggle(struct wmOperatorType *ot); /* clip_toolbar.c */ -struct ARegion *ED_clip_has_properties_region(struct ScrArea *sa); +struct ARegion *ED_clip_has_properties_region(struct ScrArea *area); /* clip_utils.c */ diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 79050fb4797..48bc885405d 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -1533,7 +1533,7 @@ static int clip_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op)) wmJob *wm_job; ProxyJob *pj; Scene *scene = CTX_data_scene(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -1570,7 +1570,7 @@ static int clip_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op)) G.is_break = false; WM_jobs_start(CTX_wm_manager(C), wm_job); - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_clip/clip_toolbar.c b/source/blender/editors/space_clip/clip_toolbar.c index 1e3911863fc..b02f3fe16f6 100644 --- a/source/blender/editors/space_clip/clip_toolbar.c +++ b/source/blender/editors/space_clip/clip_toolbar.c @@ -53,17 +53,17 @@ /************************** properties ******************************/ -ARegion *ED_clip_has_properties_region(ScrArea *sa) +ARegion *ED_clip_has_properties_region(ScrArea *area) { ARegion *region, *arnew; - region = BKE_area_find_region_type(sa, RGN_TYPE_UI); + region = BKE_area_find_region_type(area, RGN_TYPE_UI); if (region) { return region; } /* add subdiv level; after header */ - region = BKE_area_find_region_type(sa, RGN_TYPE_HEADER); + region = BKE_area_find_region_type(area, RGN_TYPE_HEADER); /* is error! */ if (region == NULL) { @@ -72,7 +72,7 @@ ARegion *ED_clip_has_properties_region(ScrArea *sa) arnew = MEM_callocN(sizeof(ARegion), "clip properties region"); - BLI_insertlinkafter(&sa->regionbase, region, arnew); + BLI_insertlinkafter(&area->regionbase, region, arnew); arnew->regiontype = RGN_TYPE_UI; arnew->alignment = RGN_ALIGN_RIGHT; diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index 82fb429d36c..a68e06951f7 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -71,7 +71,7 @@ #include "clip_intern.h" /* own include */ static void init_preview_region(const Scene *scene, - const ScrArea *sa, + const ScrArea *area, const SpaceClip *sc, ARegion *region) { @@ -81,8 +81,8 @@ static void init_preview_region(const Scene *scene, if (sc->view == SC_VIEW_DOPESHEET) { region->v2d.tot.xmin = -10.0f; - region->v2d.tot.ymin = (float)(-sa->winy) / 3.0f; - region->v2d.tot.xmax = (float)(sa->winx); + region->v2d.tot.ymin = (float)(-area->winy) / 3.0f; + region->v2d.tot.xmax = (float)(area->winx); region->v2d.tot.ymax = 0.0f; region->v2d.cur = region->v2d.tot; @@ -133,32 +133,32 @@ static void init_preview_region(const Scene *scene, static void reinit_preview_region(const bContext *C, ARegion *region) { Scene *scene = CTX_data_scene(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); SpaceClip *sc = CTX_wm_space_clip(C); if (sc->view == SC_VIEW_DOPESHEET) { if ((region->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) == 0) { - init_preview_region(scene, sa, sc, region); + init_preview_region(scene, area, sc, region); } } else { if (region->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) { - init_preview_region(scene, sa, sc, region); + init_preview_region(scene, area, sc, region); } } } -static ARegion *ED_clip_has_preview_region(const bContext *C, ScrArea *sa) +static ARegion *ED_clip_has_preview_region(const bContext *C, ScrArea *area) { ARegion *region, *arnew; - region = BKE_area_find_region_type(sa, RGN_TYPE_PREVIEW); + region = BKE_area_find_region_type(area, RGN_TYPE_PREVIEW); if (region) { return region; } /* add subdiv level; after header */ - region = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); + region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); /* is error! */ if (region == NULL) { @@ -167,23 +167,23 @@ static ARegion *ED_clip_has_preview_region(const bContext *C, ScrArea *sa) arnew = MEM_callocN(sizeof(ARegion), "clip preview region"); - BLI_insertlinkbefore(&sa->regionbase, region, arnew); - init_preview_region(CTX_data_scene(C), sa, CTX_wm_space_clip(C), arnew); + BLI_insertlinkbefore(&area->regionbase, region, arnew); + init_preview_region(CTX_data_scene(C), area, CTX_wm_space_clip(C), arnew); return arnew; } -static ARegion *ED_clip_has_channels_region(ScrArea *sa) +static ARegion *ED_clip_has_channels_region(ScrArea *area) { ARegion *region, *arnew; - region = BKE_area_find_region_type(sa, RGN_TYPE_CHANNELS); + region = BKE_area_find_region_type(area, RGN_TYPE_CHANNELS); if (region) { return region; } /* add subdiv level; after header */ - region = BKE_area_find_region_type(sa, RGN_TYPE_PREVIEW); + region = BKE_area_find_region_type(area, RGN_TYPE_PREVIEW); /* is error! */ if (region == NULL) { @@ -192,7 +192,7 @@ static ARegion *ED_clip_has_channels_region(ScrArea *sa) arnew = MEM_callocN(sizeof(ARegion), "clip channels region"); - BLI_insertlinkbefore(&sa->regionbase, region, arnew); + BLI_insertlinkbefore(&area->regionbase, region, arnew); arnew->regiontype = RGN_TYPE_CHANNELS; arnew->alignment = RGN_ALIGN_LEFT; @@ -202,9 +202,9 @@ static ARegion *ED_clip_has_channels_region(ScrArea *sa) return arnew; } -static void clip_scopes_tag_refresh(ScrArea *sa) +static void clip_scopes_tag_refresh(ScrArea *area) { - SpaceClip *sc = (SpaceClip *)sa->spacedata.first; + SpaceClip *sc = (SpaceClip *)area->spacedata.first; ARegion *region; if (sc->mode != SC_MODE_TRACKING) { @@ -212,7 +212,7 @@ static void clip_scopes_tag_refresh(ScrArea *sa) } /* only while properties are visible */ - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region->regiontype == RGN_TYPE_UI && region->flag & RGN_FLAG_HIDDEN) { return; } @@ -221,24 +221,24 @@ static void clip_scopes_tag_refresh(ScrArea *sa) sc->scopes.ok = false; } -static void clip_scopes_check_gpencil_change(ScrArea *sa) +static void clip_scopes_check_gpencil_change(ScrArea *area) { - SpaceClip *sc = (SpaceClip *)sa->spacedata.first; + SpaceClip *sc = (SpaceClip *)area->spacedata.first; if (sc->gpencil_src == SC_GPENCIL_SRC_TRACK) { - clip_scopes_tag_refresh(sa); + clip_scopes_tag_refresh(area); } } -static void clip_area_sync_frame_from_scene(ScrArea *sa, Scene *scene) +static void clip_area_sync_frame_from_scene(ScrArea *area, Scene *scene) { - SpaceClip *space_clip = (SpaceClip *)sa->spacedata.first; + SpaceClip *space_clip = (SpaceClip *)area->spacedata.first; BKE_movieclip_user_set_frame(&space_clip->user, scene->r.cfra); } /* ******************** default callbacks for clip space ***************** */ -static SpaceLink *clip_new(const ScrArea *sa, const Scene *scene) +static SpaceLink *clip_new(const ScrArea *area, const Scene *scene) { ARegion *region; SpaceClip *sc; @@ -287,7 +287,7 @@ static SpaceLink *clip_new(const ScrArea *sa, const Scene *scene) region = MEM_callocN(sizeof(ARegion), "preview for clip"); BLI_addtail(&sc->regionbase, region); - init_preview_region(scene, sa, sc, region); + init_preview_region(scene, area, sc, region); /* main region */ region = MEM_callocN(sizeof(ARegion), "main region for clip"); @@ -315,12 +315,12 @@ static void clip_free(SpaceLink *sl) } /* spacetype; init callback */ -static void clip_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa) +static void clip_init(struct wmWindowManager *UNUSED(wm), ScrArea *area) { ListBase *lb = WM_dropboxmap_find("Clip", SPACE_CLIP, 0); /* add drop boxes */ - WM_event_add_dropbox_handler(&sa->handlers, lb); + WM_event_add_dropbox_handler(&area->handlers, lb); } static SpaceLink *clip_duplicate(SpaceLink *sl) @@ -335,18 +335,18 @@ static SpaceLink *clip_duplicate(SpaceLink *sl) return (SpaceLink *)scn; } -static void clip_listener(wmWindow *UNUSED(win), ScrArea *sa, wmNotifier *wmn, Scene *scene) +static void clip_listener(wmWindow *UNUSED(win), ScrArea *area, wmNotifier *wmn, Scene *scene) { /* context changes */ switch (wmn->category) { case NC_SCENE: switch (wmn->data) { case ND_FRAME: - clip_scopes_tag_refresh(sa); + clip_scopes_tag_refresh(area); ATTR_FALLTHROUGH; case ND_FRAME_RANGE: - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; } break; @@ -354,8 +354,8 @@ static void clip_listener(wmWindow *UNUSED(win), ScrArea *sa, wmNotifier *wmn, S switch (wmn->data) { case ND_DISPLAY: case ND_SELECT: - clip_scopes_tag_refresh(sa); - ED_area_tag_redraw(sa); + clip_scopes_tag_refresh(area); + ED_area_tag_redraw(area); break; } switch (wmn->action) { @@ -365,8 +365,8 @@ static void clip_listener(wmWindow *UNUSED(win), ScrArea *sa, wmNotifier *wmn, S /* fall-through */ case NA_SELECTED: - clip_scopes_tag_refresh(sa); - ED_area_tag_redraw(sa); + clip_scopes_tag_refresh(area); + ED_area_tag_redraw(area); break; } break; @@ -375,56 +375,56 @@ static void clip_listener(wmWindow *UNUSED(win), ScrArea *sa, wmNotifier *wmn, S case ND_SELECT: case ND_DATA: case ND_DRAW: - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; } switch (wmn->action) { case NA_SELECTED: - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; case NA_EDITED: - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; } break; case NC_GEOM: switch (wmn->data) { case ND_SELECT: - clip_scopes_tag_refresh(sa); - ED_area_tag_redraw(sa); + clip_scopes_tag_refresh(area); + ED_area_tag_redraw(area); break; } break; case NC_SCREEN: switch (wmn->data) { case ND_ANIMPLAY: - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; case ND_LAYOUTSET: - clip_area_sync_frame_from_scene(sa, scene); + clip_area_sync_frame_from_scene(area, scene); break; } break; case NC_SPACE: if (wmn->data == ND_SPACE_CLIP) { - clip_scopes_tag_refresh(sa); - ED_area_tag_redraw(sa); + clip_scopes_tag_refresh(area); + ED_area_tag_redraw(area); } break; case NC_GPENCIL: if (wmn->action == NA_EDITED) { - clip_scopes_check_gpencil_change(sa); - ED_area_tag_redraw(sa); + clip_scopes_check_gpencil_change(area); + ED_area_tag_redraw(area); } else if (wmn->data & ND_GPENCIL_EDITMODE) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } break; case NC_WM: switch (wmn->data) { case ND_FILEREAD: case ND_UNDO: - clip_area_sync_frame_from_scene(sa, scene); + clip_area_sync_frame_from_scene(area, scene); break; } break; @@ -639,17 +639,17 @@ static void clip_dropboxes(void) WM_dropbox_add(lb, "CLIP_OT_open", clip_drop_poll, clip_drop_copy); } -static void clip_refresh(const bContext *C, ScrArea *sa) +static void clip_refresh(const bContext *C, ScrArea *area) { wmWindowManager *wm = CTX_wm_manager(C); wmWindow *window = CTX_wm_window(C); Scene *scene = CTX_data_scene(C); - SpaceClip *sc = (SpaceClip *)sa->spacedata.first; - ARegion *region_main = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); - ARegion *region_tools = BKE_area_find_region_type(sa, RGN_TYPE_TOOLS); - ARegion *region_preview = ED_clip_has_preview_region(C, sa); - ARegion *region_properties = ED_clip_has_properties_region(sa); - ARegion *region_channels = ED_clip_has_channels_region(sa); + SpaceClip *sc = (SpaceClip *)area->spacedata.first; + ARegion *region_main = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); + ARegion *region_tools = BKE_area_find_region_type(area, RGN_TYPE_TOOLS); + ARegion *region_preview = ED_clip_has_preview_region(C, area); + ARegion *region_properties = ED_clip_has_properties_region(area); + ARegion *region_channels = ED_clip_has_channels_region(area); bool main_visible = false, preview_visible = false, tools_visible = false; bool properties_visible = false, channels_visible = false; bool view_changed = false; @@ -805,8 +805,8 @@ static void clip_refresh(const bContext *C, ScrArea *sa) } if (view_changed) { - ED_area_initialize(wm, window, sa); - ED_area_tag_redraw(sa); + ED_area_initialize(wm, window, area); + ED_area_tag_redraw(area); } BKE_movieclip_user_set_frame(&sc->user, scene->r.cfra); @@ -946,9 +946,9 @@ static void clip_main_region_draw(const bContext *C, ARegion *region) if (sc->mode == SC_MODE_MASKEDIT) { Mask *mask = CTX_data_edit_mask(C); if (mask && clip) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); int mask_width, mask_height; - ED_mask_get_size(sa, &mask_width, &mask_height); + ED_mask_get_size(area, &mask_width, &mask_height); ED_mask_draw_region(CTX_data_expect_evaluated_depsgraph(C), mask, region, @@ -1001,7 +1001,7 @@ static void clip_main_region_draw(const bContext *C, ARegion *region) } static void clip_main_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -1145,7 +1145,7 @@ static void clip_preview_region_draw(const bContext *C, ARegion *region) } static void clip_preview_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *UNUSED(region), wmNotifier *UNUSED(wmn), const Scene *UNUSED(scene)) @@ -1191,7 +1191,7 @@ static void clip_channels_region_draw(const bContext *C, ARegion *region) } static void clip_channels_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *UNUSED(region), wmNotifier *UNUSED(wmn), const Scene *UNUSED(scene)) @@ -1212,7 +1212,7 @@ static void clip_header_region_draw(const bContext *C, ARegion *region) } static void clip_header_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -1255,7 +1255,7 @@ static void clip_tools_region_draw(const bContext *C, ARegion *region) /****************** tool properties region ******************/ static void clip_props_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -1308,7 +1308,7 @@ static void clip_properties_region_draw(const bContext *C, ARegion *region) } static void clip_properties_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -1330,7 +1330,7 @@ static void clip_properties_region_listener(wmWindow *UNUSED(win), /********************* registration ********************/ -static void clip_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID *new_id) +static void clip_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_id, ID *new_id) { SpaceClip *sclip = (SpaceClip *)slink; diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index 58d6fb425b0..981e056fa63 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -353,10 +353,10 @@ static int console_move_exec(bContext *C, wmOperator *op) } if (done) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); console_scroll_bottom(region); } @@ -860,7 +860,7 @@ static int console_history_append_exec(bContext *C, wmOperator *op) { SpaceConsole *sc = CTX_wm_space_console(C); ARegion *region = CTX_wm_region(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ConsoleLine *ci = console_history_verify(C); /* own this text in the new line, don't free */ char *str = RNA_string_get_alloc(op->ptr, "text", NULL, 0); @@ -885,7 +885,7 @@ static int console_history_append_exec(bContext *C, wmOperator *op) console_select_offset(sc, ci->len - prev_len); console_line_cursor_set(ci, cursor); - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); /* when calling render modally this can be NULL when calling: * bpy.ops.render.render('INVOKE_DEFAULT') */ diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index 66aa92275b4..d8c097cad37 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -98,7 +98,7 @@ static void console_free(SpaceLink *sl) } /* spacetype; init callback */ -static void console_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) +static void console_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area)) { } @@ -146,7 +146,7 @@ static void console_main_region_init(wmWindowManager *wm, ARegion *region) } /* same as 'text_cursor' */ -static void console_cursor(wmWindow *win, ScrArea *UNUSED(sa), ARegion *region) +static void console_cursor(wmWindow *win, ScrArea *UNUSED(area), ARegion *region) { int wmcursor = WM_CURSOR_TEXT_EDIT; const wmEvent *event = win->eventstate; @@ -278,19 +278,19 @@ static void console_header_region_draw(const bContext *C, ARegion *region) } static void console_main_region_listener(wmWindow *UNUSED(win), - ScrArea *sa, + ScrArea *area, ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) { - // SpaceInfo *sinfo = sa->spacedata.first; + // SpaceInfo *sinfo = area->spacedata.first; /* context changes */ switch (wmn->category) { case NC_SPACE: { if (wmn->data == ND_SPACE_CONSOLE) { if (wmn->action == NA_EDITED) { - if ((wmn->reference && sa) && (wmn->reference == sa->spacedata.first)) { + if ((wmn->reference && area) && (wmn->reference == area->spacedata.first)) { /* we've modified the geometry (font size), re-calculate rect */ console_textview_update_rect(wmn->reference, region); ED_region_tag_redraw(region); diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 8c963e32046..7cce243696d 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -851,7 +851,7 @@ void FILE_OT_select_walk(wmOperatorType *ot) static int file_select_all_exec(bContext *C, wmOperator *op) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); SpaceFile *sfile = CTX_wm_space_file(C); FileSelection sel; const int numfiles = filelist_files_ensure(sfile->files); @@ -900,7 +900,7 @@ static int file_select_all_exec(bContext *C, wmOperator *op) file_draw_check(C); WM_event_add_mousemove(CTX_wm_window(C)); - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); return OPERATOR_FINISHED; } @@ -975,7 +975,7 @@ void FILE_OT_select_bookmark(wmOperatorType *ot) static int bookmark_add_exec(bContext *C, wmOperator *UNUSED(op)) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); SpaceFile *sfile = CTX_wm_space_file(C); struct FSMenu *fsmenu = ED_fsmenu_get(); struct FileSelectParams *params = ED_fileselect_get_params(sfile); @@ -992,8 +992,8 @@ static int bookmark_add_exec(bContext *C, wmOperator *UNUSED(op)) fsmenu_write_file(fsmenu, name); } - ED_area_tag_refresh(sa); - ED_area_tag_redraw(sa); + ED_area_tag_refresh(area); + ED_area_tag_redraw(area); return OPERATOR_FINISHED; } @@ -1017,7 +1017,7 @@ void FILE_OT_bookmark_add(wmOperatorType *ot) static int bookmark_delete_exec(bContext *C, wmOperator *op) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); SpaceFile *sfile = CTX_wm_space_file(C); struct FSMenu *fsmenu = ED_fsmenu_get(); int nentries = ED_fsmenu_get_nentries(fsmenu, FS_CATEGORY_BOOKMARKS); @@ -1041,8 +1041,8 @@ static int bookmark_delete_exec(bContext *C, wmOperator *op) BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE); fsmenu_write_file(fsmenu, name); - ED_area_tag_refresh(sa); - ED_area_tag_redraw(sa); + ED_area_tag_refresh(area); + ED_area_tag_redraw(area); } } @@ -1075,7 +1075,7 @@ void FILE_OT_bookmark_delete(wmOperatorType *ot) static int bookmark_cleanup_exec(bContext *C, wmOperator *UNUSED(op)) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); struct FSMenu *fsmenu = ED_fsmenu_get(); struct FSMenuEntry *fsme_next, *fsme = ED_fsmenu_get_category(fsmenu, FS_CATEGORY_BOOKMARKS); int index; @@ -1102,8 +1102,8 @@ static int bookmark_cleanup_exec(bContext *C, wmOperator *UNUSED(op)) BLENDER_BOOKMARK_FILE); fsmenu_write_file(fsmenu, name); fsmenu_refresh_bookmarks_status(CTX_wm_manager(C), fsmenu); - ED_area_tag_refresh(sa); - ED_area_tag_redraw(sa); + ED_area_tag_refresh(area); + ED_area_tag_redraw(area); } return OPERATOR_FINISHED; @@ -1138,7 +1138,7 @@ enum { static int bookmark_move_exec(bContext *C, wmOperator *op) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); SpaceFile *sfile = CTX_wm_space_file(C); struct FSMenu *fsmenu = ED_fsmenu_get(); struct FSMenuEntry *fsmentry = ED_fsmenu_get_category(fsmenu, FS_CATEGORY_BOOKMARKS); @@ -1187,7 +1187,7 @@ static int bookmark_move_exec(bContext *C, wmOperator *op) BLENDER_BOOKMARK_FILE); fsmenu_write_file(fsmenu, fname); - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); return OPERATOR_FINISHED; } @@ -1228,7 +1228,7 @@ void FILE_OT_bookmark_move(wmOperatorType *ot) static int reset_recent_exec(bContext *C, wmOperator *UNUSED(op)) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); char name[FILE_MAX]; struct FSMenu *fsmenu = ED_fsmenu_get(); @@ -1240,7 +1240,7 @@ static int reset_recent_exec(bContext *C, wmOperator *UNUSED(op)) BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE); fsmenu_write_file(fsmenu, name); - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); return OPERATOR_FINISHED; } @@ -1867,7 +1867,7 @@ void FILE_OT_next(struct wmOperatorType *ot) /* only meant for timer usage */ static int file_smoothscroll_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); SpaceFile *sfile = CTX_wm_space_file(C); ARegion *region, *region_ctx = CTX_wm_region(C); const bool is_horizontal = (sfile->layout->flag & FILE_LAYOUT_HOR) != 0; @@ -1911,7 +1911,7 @@ static int file_smoothscroll_invoke(bContext *C, wmOperator *UNUSED(op), const w } /* we need the correct area for scrolling */ - region = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); + region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); if (!region || region->regiontype != RGN_TYPE_WINDOW) { WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), sfile->smoothscroll_timer); sfile->smoothscroll_timer = NULL; @@ -2521,12 +2521,12 @@ static void filenum_newname(char *name, size_t name_size, int add) static int file_filenum_exec(bContext *C, wmOperator *op) { SpaceFile *sfile = CTX_wm_space_file(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); int inc = RNA_int_get(op->ptr, "increment"); if (sfile->params && (inc != 0)) { filenum_newname(sfile->params->file, sizeof(sfile->params->file), inc); - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); file_draw_check(C); // WM_event_add_notifier(C, NC_WINDOW, NULL); } @@ -2576,12 +2576,12 @@ static void file_rename_state_activate(SpaceFile *sfile, int file_idx, bool requ static int file_rename_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); SpaceFile *sfile = (SpaceFile *)CTX_wm_space_data(C); if (sfile->params) { file_rename_state_activate(sfile, sfile->params->active_file, true); - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } return OPERATOR_FINISHED; @@ -2589,12 +2589,12 @@ static int file_rename_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent static int file_rename_exec(bContext *C, wmOperator *UNUSED(op)) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); SpaceFile *sfile = (SpaceFile *)CTX_wm_space_data(C); if (sfile->params) { file_rename_state_activate(sfile, sfile->params->highlight_file, false); - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } return OPERATOR_FINISHED; @@ -2708,8 +2708,8 @@ void FILE_OT_delete(struct wmOperatorType *ot) static int file_start_filter_exec(bContext *C, wmOperator *UNUSED(op)) { - ScrArea *sa = CTX_wm_area(C); - ARegion *region = BKE_area_find_region_type(sa, RGN_TYPE_UI); + ScrArea *area = CTX_wm_area(C); + ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_UI); SpaceFile *sf = CTX_wm_space_file(C); UI_textbutton_activate_rna(C, region, sf->params, "filter_search"); diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 59383626972..21b705cbb44 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -55,16 +55,16 @@ #include "filelist.h" #include "fsmenu.h" -static ARegion *file_execute_region_ensure(ScrArea *sa, ARegion *region_prev) +static ARegion *file_execute_region_ensure(ScrArea *area, ARegion *region_prev) { ARegion *region; - if ((region = BKE_area_find_region_type(sa, RGN_TYPE_EXECUTE)) != NULL) { + if ((region = BKE_area_find_region_type(area, RGN_TYPE_EXECUTE)) != NULL) { return region; } region = MEM_callocN(sizeof(ARegion), "execute region for file"); - BLI_insertlinkafter(&sa->regionbase, region_prev, region); + BLI_insertlinkafter(&area->regionbase, region_prev, region); region->regiontype = RGN_TYPE_EXECUTE; region->alignment = RGN_ALIGN_BOTTOM; region->flag = RGN_FLAG_DYNAMIC_SIZE; @@ -72,17 +72,17 @@ static ARegion *file_execute_region_ensure(ScrArea *sa, ARegion *region_prev) return region; } -static ARegion *file_tool_props_region_ensure(ScrArea *sa, ARegion *region_prev) +static ARegion *file_tool_props_region_ensure(ScrArea *area, ARegion *region_prev) { ARegion *region; - if ((region = BKE_area_find_region_type(sa, RGN_TYPE_TOOL_PROPS)) != NULL) { + if ((region = BKE_area_find_region_type(area, RGN_TYPE_TOOL_PROPS)) != NULL) { return region; } /* add subdiv level; after execute region */ region = MEM_callocN(sizeof(ARegion), "tool props for file"); - BLI_insertlinkafter(&sa->regionbase, region_prev, region); + BLI_insertlinkafter(&area->regionbase, region_prev, region); region->regiontype = RGN_TYPE_TOOL_PROPS; region->alignment = RGN_ALIGN_RIGHT; @@ -173,18 +173,18 @@ static void file_free(SpaceLink *sl) } /* spacetype; init callback, area size changes, screen set, etc */ -static void file_init(wmWindowManager *UNUSED(wm), ScrArea *sa) +static void file_init(wmWindowManager *UNUSED(wm), ScrArea *area) { - SpaceFile *sfile = (SpaceFile *)sa->spacedata.first; + SpaceFile *sfile = (SpaceFile *)area->spacedata.first; if (sfile->layout) { sfile->layout->dirty = true; } } -static void file_exit(wmWindowManager *wm, ScrArea *sa) +static void file_exit(wmWindowManager *wm, ScrArea *area) { - SpaceFile *sfile = (SpaceFile *)sa->spacedata.first; + SpaceFile *sfile = (SpaceFile *)area->spacedata.first; if (sfile->previews_timer) { WM_event_remove_timer_notifier(wm, NULL, sfile->previews_timer); @@ -228,19 +228,19 @@ static SpaceLink *file_duplicate(SpaceLink *sl) static void file_ensure_valid_region_state(bContext *C, wmWindowManager *wm, wmWindow *win, - ScrArea *sa, + ScrArea *area, SpaceFile *sfile, FileSelectParams *params) { - ARegion *region_ui = BKE_area_find_region_type(sa, RGN_TYPE_UI); - ARegion *region_props = BKE_area_find_region_type(sa, RGN_TYPE_TOOL_PROPS); - ARegion *region_execute = BKE_area_find_region_type(sa, RGN_TYPE_EXECUTE); + ARegion *region_ui = BKE_area_find_region_type(area, RGN_TYPE_UI); + ARegion *region_props = BKE_area_find_region_type(area, RGN_TYPE_TOOL_PROPS); + ARegion *region_execute = BKE_area_find_region_type(area, RGN_TYPE_EXECUTE); bool needs_init = false; /* To avoid multiple ED_area_initialize() calls. */ /* If there's an file-operation, ensure we have the option and execute region */ if (sfile->op && (region_props == NULL)) { - region_execute = file_execute_region_ensure(sa, region_ui); - region_props = file_tool_props_region_ensure(sa, region_execute); + region_execute = file_execute_region_ensure(area, region_ui); + region_props = file_tool_props_region_ensure(area, region_execute); if (params->flag & FILE_HIDE_TOOL_PROPS) { region_props->flag |= RGN_FLAG_HIDDEN; @@ -255,17 +255,17 @@ static void file_ensure_valid_region_state(bContext *C, else if ((sfile->op == NULL) && (region_props != NULL)) { BLI_assert(region_execute != NULL); - ED_region_remove(C, sa, region_props); - ED_region_remove(C, sa, region_execute); + ED_region_remove(C, area, region_props); + ED_region_remove(C, area, region_execute); needs_init = true; } if (needs_init) { - ED_area_initialize(wm, win, sa); + ED_area_initialize(wm, win, area); } } -static void file_refresh(const bContext *C, ScrArea *sa) +static void file_refresh(const bContext *C, ScrArea *area) { wmWindowManager *wm = CTX_wm_manager(C); wmWindow *win = CTX_wm_window(C); @@ -333,34 +333,34 @@ static void file_refresh(const bContext *C, ScrArea *sa) sfile->layout->dirty = true; } - /* Might be called with NULL sa, see file_main_region_draw() below. */ - if (sa) { - file_ensure_valid_region_state((bContext *)C, wm, win, sa, sfile, params); + /* Might be called with NULL area, see file_main_region_draw() below. */ + if (area) { + file_ensure_valid_region_state((bContext *)C, wm, win, area, sfile, params); } - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } static void file_listener(wmWindow *UNUSED(win), - ScrArea *sa, + ScrArea *area, wmNotifier *wmn, Scene *UNUSED(scene)) { - SpaceFile *sfile = (SpaceFile *)sa->spacedata.first; + SpaceFile *sfile = (SpaceFile *)area->spacedata.first; /* context changes */ switch (wmn->category) { case NC_SPACE: switch (wmn->data) { case ND_SPACE_FILE_LIST: - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); break; case ND_SPACE_FILE_PARAMS: - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); break; case ND_SPACE_FILE_PREVIEW: if (sfile->files && filelist_cache_previews_update(sfile->files)) { - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } break; } @@ -384,7 +384,7 @@ static void file_main_region_init(wmWindowManager *wm, ARegion *region) } static void file_main_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -408,18 +408,18 @@ static void file_main_region_message_subscribe(const struct bContext *UNUSED(C), struct WorkSpace *UNUSED(workspace), struct Scene *UNUSED(scene), struct bScreen *screen, - struct ScrArea *sa, + struct ScrArea *area, struct ARegion *region, struct wmMsgBus *mbus) { - SpaceFile *sfile = sa->spacedata.first; + SpaceFile *sfile = area->spacedata.first; FileSelectParams *params = ED_fileselect_get_params(sfile); /* This is a bit odd that a region owns the subscriber for an area, * keep for now since all subscribers for WM are regions. * May be worth re-visiting later. */ wmMsgSubscribeValue msg_sub_value_area_tag_refresh = { .owner = region, - .user_data = sa, + .user_data = area, .notify = ED_area_do_msg_notify_tag_refresh, }; @@ -575,7 +575,7 @@ static void file_tools_region_draw(const bContext *C, ARegion *region) } static void file_tools_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *UNUSED(region), wmNotifier *UNUSED(wmn), const Scene *UNUSED(scene)) @@ -643,7 +643,7 @@ static void file_execution_region_draw(const bContext *C, ARegion *region) } static void file_ui_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 6096c27fc8c..08053dba4d9 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1336,7 +1336,7 @@ static void decimate_graph_keys(bAnimContext *ac, float remove_ratio, float erro typedef struct tDecimateGraphOp { bAnimContext ac; Scene *scene; - ScrArea *sa; + ScrArea *area; ARegion *region; /** A 0-1 value for determining how much we should decimate. */ @@ -1409,7 +1409,7 @@ static void decimate_exit(bContext *C, wmOperator *op) return; } - ScrArea *sa = dgo->sa; + ScrArea *area = dgo->area; LinkData *link; for (link = dgo->bezt_arr_list.first; link != NULL; link = link->next) { @@ -1423,7 +1423,7 @@ static void decimate_exit(bContext *C, wmOperator *op) /* Return to normal cursor and header status. */ WM_cursor_modal_restore(win); - ED_area_status_text(sa, NULL); + ED_area_status_text(area, NULL); /* cleanup */ op->customdata = NULL; @@ -1450,7 +1450,7 @@ static void decimate_draw_status_header(wmOperator *op, tDecimateGraphOp *dgo) status_str, sizeof(status_str), "%s: %d %%", mode_str, (int)(percentage * 100.0f)); } - ED_area_status_text(dgo->sa, status_str); + ED_area_status_text(dgo->area, status_str); } /* Calculate percentage based on position of mouse (we only use x-axis for now. @@ -1482,7 +1482,7 @@ static int graphkeys_decimate_invoke(bContext *C, wmOperator *op, const wmEvent dgo->percentage_prop = RNA_struct_find_property(op->ptr, "remove_ratio"); dgo->scene = CTX_data_scene(C); - dgo->sa = CTX_wm_area(C); + dgo->area = CTX_wm_area(C); dgo->region = CTX_wm_region(C); /* initialise percentage so that it will have the correct value before the first mouse move. */ @@ -3623,10 +3623,10 @@ static int graph_driver_delete_invalid_exec(bContext *C, wmOperator *op) static bool graph_driver_delete_invalid_poll(bContext *C) { bAnimContext ac; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); /* firstly, check if in Graph Editor */ - if ((sa == NULL) || (sa->spacetype != SPACE_GRAPH)) { + if ((area == NULL) || (area->spacetype != SPACE_GRAPH)) { return 0; } diff --git a/source/blender/editors/space_graph/graph_utils.c b/source/blender/editors/space_graph/graph_utils.c index 34c1958734d..575cba07f04 100644 --- a/source/blender/editors/space_graph/graph_utils.c +++ b/source/blender/editors/space_graph/graph_utils.c @@ -54,32 +54,32 @@ /* Set up UI configuration for Drivers Editor */ /* NOTE: Currently called from windowmanager * (new drivers editor window) and RNA (mode switching) */ -void ED_drivers_editor_init(bContext *C, ScrArea *sa) +void ED_drivers_editor_init(bContext *C, ScrArea *area) { - SpaceGraph *sipo = (SpaceGraph *)sa->spacedata.first; + SpaceGraph *sipo = (SpaceGraph *)area->spacedata.first; /* Set mode */ sipo->mode = SIPO_MODE_DRIVERS; /* Show Properties Region (or else the settings can't be edited) */ - ARegion *region_props = BKE_area_find_region_type(sa, RGN_TYPE_UI); + ARegion *region_props = BKE_area_find_region_type(area, RGN_TYPE_UI); if (region_props) { UI_panel_category_active_set(region_props, "Drivers"); region_props->flag &= ~RGN_FLAG_HIDDEN; /* XXX: Adjust width of this too? */ - ED_region_visibility_change_update(C, sa, region_props); + ED_region_visibility_change_update(C, area, region_props); } else { - printf("%s: Couldn't find properties region for Drivers Editor - %p\n", __func__, sa); + printf("%s: Couldn't find properties region for Drivers Editor - %p\n", __func__, area); } /* Adjust framing in graph region */ /* TODO: Have a way of not resetting this every time? * (e.g. So that switching back and forth between editors doesn't keep jumping?) */ - ARegion *region_main = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); + ARegion *region_main = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); if (region_main) { /* XXX: Ideally we recenter based on the range instead... */ region_main->v2d.tot.xmin = -2.0f; @@ -135,14 +135,14 @@ bool graphop_visible_keyframes_poll(bContext *C) bAnimContext ac; bAnimListElem *ale; ListBase anim_data = {NULL, NULL}; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); size_t items; int filter; short found = 0; /* firstly, check if in Graph Editor */ // TODO: also check for region? - if ((sa == NULL) || (sa->spacetype != SPACE_GRAPH)) { + if ((area == NULL) || (area->spacetype != SPACE_GRAPH)) { return 0; } @@ -188,14 +188,14 @@ bool graphop_editable_keyframes_poll(bContext *C) bAnimContext ac; bAnimListElem *ale; ListBase anim_data = {NULL, NULL}; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); size_t items; int filter; short found = 0; /* firstly, check if in Graph Editor */ // TODO: also check for region? - if ((sa == NULL) || (sa->spacetype != SPACE_GRAPH)) { + if ((area == NULL) || (area->spacetype != SPACE_GRAPH)) { return 0; } @@ -241,12 +241,12 @@ bool graphop_active_fcurve_poll(bContext *C) { bAnimContext ac; bAnimListElem *ale; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); bool has_fcurve = 0; /* firstly, check if in Graph Editor */ // TODO: also check for region? - if ((sa == NULL) || (sa->spacetype != SPACE_GRAPH)) { + if ((area == NULL) || (area->spacetype != SPACE_GRAPH)) { return 0; } @@ -293,13 +293,13 @@ bool graphop_selected_fcurve_poll(bContext *C) { bAnimContext ac; ListBase anim_data = {NULL, NULL}; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); size_t items; int filter; /* firstly, check if in Graph Editor */ // TODO: also check for region? - if ((sa == NULL) || (sa->spacetype != SPACE_GRAPH)) { + if ((area == NULL) || (area->spacetype != SPACE_GRAPH)) { return 0; } diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 05edfccd6a8..bd82b8ecf2e 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -64,7 +64,7 @@ /* ******************** default callbacks for ipo space ***************** */ -static SpaceLink *graph_new(const ScrArea *UNUSED(sa), const Scene *scene) +static SpaceLink *graph_new(const ScrArea *UNUSED(area), const Scene *scene) { ARegion *region; SpaceGraph *sipo; @@ -150,9 +150,9 @@ static void graph_free(SpaceLink *sl) } /* spacetype; init callback */ -static void graph_init(struct wmWindowManager *wm, ScrArea *sa) +static void graph_init(struct wmWindowManager *wm, ScrArea *area) { - SpaceGraph *sipo = (SpaceGraph *)sa->spacedata.first; + SpaceGraph *sipo = (SpaceGraph *)area->spacedata.first; /* init dopesheet data if non-existent (i.e. for old files) */ if (sipo->ads == NULL) { @@ -165,7 +165,7 @@ static void graph_init(struct wmWindowManager *wm, ScrArea *sa) * as this is run on each region resize; setting this here will cause selection * state to be lost on area/region resizing. [#35744] */ - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } static SpaceLink *graph_duplicate(SpaceLink *sl) @@ -413,7 +413,7 @@ static void graph_buttons_region_draw(const bContext *C, ARegion *region) } static void graph_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -483,12 +483,12 @@ static void graph_region_message_subscribe(const struct bContext *UNUSED(C), struct WorkSpace *UNUSED(workspace), struct Scene *scene, struct bScreen *screen, - struct ScrArea *sa, + struct ScrArea *area, struct ARegion *region, struct wmMsgBus *mbus) { PointerRNA ptr; - RNA_pointer_create(&screen->id, &RNA_SpaceGraphEditor, sa->spacedata.first, &ptr); + RNA_pointer_create(&screen->id, &RNA_SpaceGraphEditor, area->spacedata.first, &ptr); wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { .owner = region, @@ -556,11 +556,11 @@ static void graph_region_message_subscribe(const struct bContext *UNUSED(C), /* editor level listener */ static void graph_listener(wmWindow *UNUSED(win), - ScrArea *sa, + ScrArea *area, wmNotifier *wmn, Scene *UNUSED(scene)) { - SpaceGraph *sipo = (SpaceGraph *)sa->spacedata.first; + SpaceGraph *sipo = (SpaceGraph *)area->spacedata.first; /* context changes */ switch (wmn->category) { @@ -568,10 +568,10 @@ static void graph_listener(wmWindow *UNUSED(win), /* for selection changes of animation data, we can just redraw... * otherwise autocolor might need to be done again */ if (ELEM(wmn->data, ND_KEYFRAME, ND_ANIMCHAN) && (wmn->action == NA_SELECTED)) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } else { - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } break; case NC_SCENE: @@ -580,11 +580,11 @@ static void graph_listener(wmWindow *UNUSED(win), * (needs flag set to do syncing). */ case ND_OB_SELECT: sipo->runtime.flag |= SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC; - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); break; default: /* just redrawing the view will do */ - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; } break; @@ -594,13 +594,13 @@ static void graph_listener(wmWindow *UNUSED(win), * (needs flag set to do syncing). */ case ND_BONE_ACTIVE: sipo->runtime.flag |= SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC; - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); break; case ND_TRANSFORM: break; /*do nothing*/ default: /* just redrawing the view will do */ - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; } break; @@ -608,26 +608,26 @@ static void graph_listener(wmWindow *UNUSED(win), if (wmn->action == NA_SELECTED) { /* selection changed, so force refresh to flush (needs flag set to do syncing) */ sipo->runtime.flag |= SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC; - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } break; case NC_SPACE: if (wmn->data == ND_SPACE_GRAPH) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } break; case NC_WINDOW: if (sipo->runtime.flag & (SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC | SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC_COLOR)) { /* force redraw/refresh after undo/redo - prevents "black curve" problem */ - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } break; // XXX: restore the case below if not enough updates occur... // default: // if (wmn->data == ND_KEYS) - // ED_area_tag_redraw(sa); + // ED_area_tag_redraw(area); } } @@ -754,9 +754,9 @@ static void graph_refresh_fcurve_colors(const bContext *C) ANIM_animdata_freelist(&anim_data); } -static void graph_refresh(const bContext *C, ScrArea *sa) +static void graph_refresh(const bContext *C, ScrArea *area) { - SpaceGraph *sipo = (SpaceGraph *)sa->spacedata.first; + SpaceGraph *sipo = (SpaceGraph *)area->spacedata.first; /* updates to data needed depends on Graph Editor mode... */ switch (sipo->mode) { @@ -780,7 +780,7 @@ static void graph_refresh(const bContext *C, ScrArea *sa) if (sipo->runtime.flag & SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC) { ANIM_sync_animchannels_to_data(C); sipo->runtime.flag &= ~SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC; - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } /* We could check 'SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC_COLOR', but color is recalculated anyway. */ @@ -789,7 +789,7 @@ static void graph_refresh(const bContext *C, ScrArea *sa) #if 0 /* Done below. */ graph_refresh_fcurve_colors(C); #endif - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } sipo->runtime.flag &= ~(SIPO_RUNTIME_FLAG_TWEAK_HANDLES_LEFT | @@ -799,7 +799,7 @@ static void graph_refresh(const bContext *C, ScrArea *sa) graph_refresh_fcurve_colors(C); } -static void graph_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID *new_id) +static void graph_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_id, ID *new_id) { SpaceGraph *sgraph = (SpaceGraph *)slink; @@ -813,15 +813,15 @@ static void graph_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID } } -static int graph_space_subtype_get(ScrArea *sa) +static int graph_space_subtype_get(ScrArea *area) { - SpaceGraph *sgraph = sa->spacedata.first; + SpaceGraph *sgraph = area->spacedata.first; return sgraph->mode; } -static void graph_space_subtype_set(ScrArea *sa, int value) +static void graph_space_subtype_set(ScrArea *area, int value) { - SpaceGraph *sgraph = sa->spacedata.first; + SpaceGraph *sgraph = area->spacedata.first; sgraph->mode = value; } diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index c0b1efe0b73..38f67623c99 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1291,7 +1291,7 @@ static Image *image_open_single(Main *bmain, static int image_open_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); Scene *scene = CTX_data_scene(C); Object *obedit = CTX_data_edit_object(C); ImageUser *iuser = NULL; @@ -1345,8 +1345,8 @@ static int image_open_exec(bContext *C, wmOperator *op) if (iod->iuser) { iuser = iod->iuser; } - else if (sa && sa->spacetype == SPACE_IMAGE) { - SpaceImage *sima = sa->spacedata.first; + else if (area && area->spacetype == SPACE_IMAGE) { + SpaceImage *sima = area->spacedata.first; ED_space_image_set(bmain, sima, obedit, ima, false); iuser = &sima->iuser; } @@ -3409,13 +3409,13 @@ static void image_sample_apply(bContext *C, wmOperator *op, const wmEvent *event // XXX node curve integration .. #if 0 { - ScrArea *sa, *cur = curarea; + ScrArea *area, *cur = curarea; node_curvemap_sample(fp); /* sends global to node editor */ - for (sa = G.curscreen->areabase.first; sa; sa = sa->next) { - if (sa->spacetype == SPACE_NODE) { - areawinset(sa->win); - scrarea_do_windraw(sa); + for (area = G.curscreen->areabase.first; area; area = area->next) { + if (area->spacetype == SPACE_NODE) { + areawinset(area->win); + scrarea_do_windraw(area); } } node_curvemap_sample(NULL); /* clears global in node editor */ diff --git a/source/blender/editors/space_image/image_undo.c b/source/blender/editors/space_image/image_undo.c index 8f9f4189c8a..5f81c19290b 100644 --- a/source/blender/editors/space_image/image_undo.c +++ b/source/blender/editors/space_image/image_undo.c @@ -733,9 +733,9 @@ static bool image_undosys_poll(bContext *C) { Object *obact = CTX_data_active_object(C); - ScrArea *sa = CTX_wm_area(C); - if (sa && (sa->spacetype == SPACE_IMAGE)) { - SpaceImage *sima = (SpaceImage *)sa->spacedata.first; + ScrArea *area = CTX_wm_area(C); + if (area && (area->spacetype == SPACE_IMAGE)) { + SpaceImage *sima = (SpaceImage *)area->spacedata.first; if ((obact && (obact->mode & OB_MODE_TEXTURE_PAINT)) || (sima->mode == SI_MODE_PAINT)) { return true; } diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 12a1dce3a5f..af94b5b6e21 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -83,13 +83,13 @@ /**************************** common state *****************************/ -static void image_scopes_tag_refresh(ScrArea *sa) +static void image_scopes_tag_refresh(ScrArea *area) { - SpaceImage *sima = (SpaceImage *)sa->spacedata.first; + SpaceImage *sima = (SpaceImage *)area->spacedata.first; ARegion *region; /* only while histogram is visible */ - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region->regiontype == RGN_TYPE_TOOL_PROPS && region->flag & RGN_FLAG_HIDDEN) { return; } @@ -186,12 +186,12 @@ static void image_free(SpaceLink *sl) } /* spacetype; init callback, add handlers */ -static void image_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa) +static void image_init(struct wmWindowManager *UNUSED(wm), ScrArea *area) { ListBase *lb = WM_dropboxmap_find("Image", SPACE_IMAGE, 0); /* add drop boxes */ - WM_event_add_dropbox_handler(&sa->handlers, lb); + WM_event_add_dropbox_handler(&area->handlers, lb); } static SpaceLink *image_duplicate(SpaceLink *sl) @@ -298,10 +298,10 @@ static void image_dropboxes(void) * \note take care not to get into feedback loop here, * calling composite job causes viewer to refresh. */ -static void image_refresh(const bContext *C, ScrArea *sa) +static void image_refresh(const bContext *C, ScrArea *area) { Scene *scene = CTX_data_scene(C); - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; Image *ima; ima = ED_space_image(sima); @@ -318,53 +318,53 @@ static void image_refresh(const bContext *C, ScrArea *sa) } } -static void image_listener(wmWindow *win, ScrArea *sa, wmNotifier *wmn, Scene *UNUSED(scene)) +static void image_listener(wmWindow *win, ScrArea *area, wmNotifier *wmn, Scene *UNUSED(scene)) { - SpaceImage *sima = (SpaceImage *)sa->spacedata.first; + SpaceImage *sima = (SpaceImage *)area->spacedata.first; /* context changes */ switch (wmn->category) { case NC_WINDOW: /* notifier comes from editing color space */ - image_scopes_tag_refresh(sa); - ED_area_tag_redraw(sa); + image_scopes_tag_refresh(area); + ED_area_tag_redraw(area); break; case NC_SCENE: switch (wmn->data) { case ND_FRAME: - image_scopes_tag_refresh(sa); - ED_area_tag_refresh(sa); - ED_area_tag_redraw(sa); + image_scopes_tag_refresh(area); + ED_area_tag_refresh(area); + ED_area_tag_redraw(area); break; case ND_MODE: if (wmn->subtype == NS_EDITMODE_MESH) { - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; case ND_RENDER_RESULT: case ND_RENDER_OPTIONS: case ND_COMPO_RESULT: if (ED_space_image_show_render(sima)) { - image_scopes_tag_refresh(sa); + image_scopes_tag_refresh(area); } - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; } break; case NC_IMAGE: if (wmn->reference == sima->image || !wmn->reference) { if (wmn->action != NA_PAINTING) { - image_scopes_tag_refresh(sa); - ED_area_tag_refresh(sa); - ED_area_tag_redraw(sa); + image_scopes_tag_refresh(area); + ED_area_tag_refresh(area); + ED_area_tag_redraw(area); } } break; case NC_SPACE: if (wmn->data == ND_SPACE_IMAGE) { - image_scopes_tag_refresh(sa); - ED_area_tag_redraw(sa); + image_scopes_tag_refresh(area); + ED_area_tag_redraw(area); } break; case NC_MASK: { @@ -374,23 +374,23 @@ static void image_listener(wmWindow *win, ScrArea *sa, wmNotifier *wmn, Scene *U if (sima->mode == SI_MODE_MASK) { switch (wmn->data) { case ND_SELECT: - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; case ND_DATA: case ND_DRAW: /* causes node-recalc */ - ED_area_tag_redraw(sa); - ED_area_tag_refresh(sa); + ED_area_tag_redraw(area); + ED_area_tag_refresh(area); break; } switch (wmn->action) { case NA_SELECTED: - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; case NA_EDITED: /* causes node-recalc */ - ED_area_tag_redraw(sa); - ED_area_tag_refresh(sa); + ED_area_tag_redraw(area); + ED_area_tag_refresh(area); break; } } @@ -400,9 +400,9 @@ static void image_listener(wmWindow *win, ScrArea *sa, wmNotifier *wmn, Scene *U switch (wmn->data) { case ND_DATA: case ND_SELECT: - image_scopes_tag_refresh(sa); - ED_area_tag_refresh(sa); - ED_area_tag_redraw(sa); + image_scopes_tag_refresh(area); + ED_area_tag_refresh(area); + ED_area_tag_redraw(area); break; } break; @@ -415,8 +415,8 @@ static void image_listener(wmWindow *win, ScrArea *sa, wmNotifier *wmn, Scene *U Object *ob = OBACT(view_layer); if (ob && (ob == wmn->reference) && (ob->mode & OB_MODE_EDIT)) { if (sima->lock && (sima->flag & SI_DRAWSHADOW)) { - ED_area_tag_refresh(sa); - ED_area_tag_redraw(sa); + ED_area_tag_refresh(area); + ED_area_tag_redraw(area); } } break; @@ -427,14 +427,14 @@ static void image_listener(wmWindow *win, ScrArea *sa, wmNotifier *wmn, Scene *U } case NC_ID: { if (wmn->action == NA_RENAME) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } break; } case NC_WM: if (wmn->data == ND_UNDO) { - ED_area_tag_redraw(sa); - ED_area_tag_refresh(sa); + ED_area_tag_redraw(area); + ED_area_tag_refresh(area); } break; } @@ -756,7 +756,7 @@ static void image_main_region_draw(const bContext *C, ARegion *region) } static void image_main_region_listener(wmWindow *UNUSED(win), - ScrArea *sa, + ScrArea *area, ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -784,7 +784,7 @@ static void image_main_region_listener(wmWindow *UNUSED(win), break; case NC_MATERIAL: if (wmn->data == ND_SHADING_LINKS) { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; if (sima->iuser.scene && (sima->iuser.scene->toolsettings->uv_flag & UV_SHOW_SAME_IMAGE)) { ED_region_tag_redraw(region); @@ -873,7 +873,7 @@ static void image_buttons_region_draw(const bContext *C, ARegion *region) } static void image_buttons_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -936,7 +936,7 @@ static void image_tools_region_draw(const bContext *C, ARegion *region) } static void image_tools_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -984,8 +984,8 @@ static void image_header_region_init(wmWindowManager *UNUSED(wm), ARegion *regio static void image_header_region_draw(const bContext *C, ARegion *region) { - ScrArea *sa = CTX_wm_area(C); - SpaceImage *sima = sa->spacedata.first; + ScrArea *area = CTX_wm_area(C); + SpaceImage *sima = area->spacedata.first; image_user_refresh_scene(C, sima); @@ -993,7 +993,7 @@ static void image_header_region_draw(const bContext *C, ARegion *region) } static void image_header_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -1024,7 +1024,7 @@ static void image_header_region_listener(wmWindow *UNUSED(win), } } -static void image_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID *new_id) +static void image_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_id, ID *new_id) { SpaceImage *simg = (SpaceImage *)slink; @@ -1054,15 +1054,15 @@ static void image_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID * The previous non-uv-edit mode is stored so switching back to the * image doesn't always reset the sub-mode. */ -static int image_space_subtype_get(ScrArea *sa) +static int image_space_subtype_get(ScrArea *area) { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; return sima->mode == SI_MODE_UV ? SI_MODE_UV : SI_MODE_VIEW; } -static void image_space_subtype_set(ScrArea *sa, int value) +static void image_space_subtype_set(ScrArea *area, int value) { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; if (value == SI_MODE_UV) { if (sima->mode != SI_MODE_UV) { sima->mode_prev = sima->mode; diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index 58ce3316c4b..04df0f0d4f0 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -97,7 +97,7 @@ static void info_free(SpaceLink *UNUSED(sl)) } /* spacetype; init callback */ -static void info_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) +static void info_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area)) { } @@ -209,12 +209,12 @@ static void info_header_region_draw(const bContext *C, ARegion *region) } static void info_main_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) { - // SpaceInfo *sinfo = sa->spacedata.first; + // SpaceInfo *sinfo = area->spacedata.first; /* context changes */ switch (wmn->category) { @@ -228,7 +228,7 @@ static void info_main_region_listener(wmWindow *UNUSED(win), } static void info_header_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -267,7 +267,7 @@ static void info_header_region_message_subscribe(const bContext *UNUSED(C), WorkSpace *UNUSED(workspace), Scene *UNUSED(scene), bScreen *UNUSED(screen), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, struct wmMsgBus *mbus) { diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index d3c93f6a5b6..5a59ba6b553 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -828,7 +828,7 @@ void draw_nla_channel_list(const bContext *C, bAnimContext *ac, ARegion *region) /* need to do a view-sync here, so that the keys area doesn't jump around * (it must copy this) */ - UI_view2d_sync(NULL, ac->sa, v2d, V2D_LOCK_COPY); + UI_view2d_sync(NULL, ac->area, v2d, V2D_LOCK_COPY); /* draw channels */ { /* first pass: just the standard GL-drawing for backdrop + text */ diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 2427001657a..5b949911158 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -1506,7 +1506,7 @@ static int nlaedit_swap_exec(bContext *C, wmOperator *op) NlaTrack *nlt = (NlaTrack *)ale->data; NlaStrip *strip, *stripN = NULL; - NlaStrip *sa = NULL, *sb = NULL; + NlaStrip *area = NULL, *sb = NULL; /* make temporary metastrips so that entire islands of selections can be moved around */ BKE_nlastrips_make_metas(&nlt->strips, 1); @@ -1533,9 +1533,9 @@ static int nlaedit_swap_exec(bContext *C, wmOperator *op) if (strip->flag & NLASTRIP_FLAG_SELECT) { /* first or second strip? */ - if (sa == NULL) { + if (area == NULL) { /* store as first */ - sa = strip; + area = strip; } else if (sb == NULL) { /* store as second */ @@ -1556,7 +1556,7 @@ static int nlaedit_swap_exec(bContext *C, wmOperator *op) "Too many clusters of strips selected in NLA Track (%s): needs exactly 2 to be selected", nlt->name); } - else if (sa == NULL) { + else if (area == NULL) { /* no warning as this is just a common case, * and it may get annoying when doing multiple tracks */ } @@ -1573,24 +1573,24 @@ static int nlaedit_swap_exec(bContext *C, wmOperator *op) /* remove these strips from the track, * so that we can test if they can fit in the proposed places */ - BLI_remlink(&nlt->strips, sa); + BLI_remlink(&nlt->strips, area); BLI_remlink(&nlt->strips, sb); /* calculate new extents for strips */ /* a --> b */ nsa[0] = sb->start; - nsa[1] = sb->start + (sa->end - sa->start); + nsa[1] = sb->start + (area->end - area->start); /* b --> a */ - nsb[0] = sa->start; - nsb[1] = sa->start + (sb->end - sb->start); + nsb[0] = area->start; + nsb[1] = area->start + (sb->end - sb->start); /* check if the track has room for the strips to be swapped */ if (BKE_nlastrips_has_space(&nlt->strips, nsa[0], nsa[1]) && BKE_nlastrips_has_space(&nlt->strips, nsb[0], nsb[1])) { /* set new extents for strips then */ - sa->start = nsa[0]; - sa->end = nsa[1]; - BKE_nlameta_flush_transforms(sa); + area->start = nsa[0]; + area->end = nsa[1]; + BKE_nlameta_flush_transforms(area); sb->start = nsb[0]; sb->end = nsb[1]; @@ -1598,7 +1598,7 @@ static int nlaedit_swap_exec(bContext *C, wmOperator *op) } else { /* not enough room to swap, so show message */ - if ((sa->flag & NLASTRIP_FLAG_TEMP_META) || (sb->flag & NLASTRIP_FLAG_TEMP_META)) { + if ((area->flag & NLASTRIP_FLAG_TEMP_META) || (sb->flag & NLASTRIP_FLAG_TEMP_META)) { BKE_report( op->reports, RPT_WARNING, @@ -1609,13 +1609,13 @@ static int nlaedit_swap_exec(bContext *C, wmOperator *op) RPT_WARNING, "Cannot swap '%s' and '%s' as one or both will not be able to fit in their " "new places", - sa->name, + area->name, sb->name); } } /* add strips back to track now */ - BKE_nlatrack_add_strip(nlt, sa); + BKE_nlatrack_add_strip(nlt, area); BKE_nlatrack_add_strip(nlt, sb); } diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index c4e1431ee26..f060693d9f4 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -57,7 +57,7 @@ /* ******************** default callbacks for nla space ***************** */ -static SpaceLink *nla_new(const ScrArea *sa, const Scene *scene) +static SpaceLink *nla_new(const ScrArea *area, const Scene *scene) { ARegion *region; SpaceNla *snla; @@ -105,7 +105,7 @@ static SpaceLink *nla_new(const ScrArea *sa, const Scene *scene) region->regiontype = RGN_TYPE_WINDOW; region->v2d.tot.xmin = (float)(SFRA - 10); - region->v2d.tot.ymin = (float)(-sa->winy) / 3.0f; + region->v2d.tot.ymin = (float)(-area->winy) / 3.0f; region->v2d.tot.xmax = (float)(EFRA + 10); region->v2d.tot.ymax = 0.0f; @@ -141,9 +141,9 @@ static void nla_free(SpaceLink *sl) } /* spacetype; init callback */ -static void nla_init(struct wmWindowManager *wm, ScrArea *sa) +static void nla_init(struct wmWindowManager *wm, ScrArea *area) { - SpaceNla *snla = (SpaceNla *)sa->spacedata.first; + SpaceNla *snla = (SpaceNla *)area->spacedata.first; /* init dopesheet data if non-existent (i.e. for old files) */ if (snla->ads == NULL) { @@ -151,7 +151,7 @@ static void nla_init(struct wmWindowManager *wm, ScrArea *sa) snla->ads->source = (ID *)WM_window_get_active_scene(wm->winactive); } - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } static SpaceLink *nla_duplicate(SpaceLink *sl) @@ -325,7 +325,7 @@ static void nla_buttons_region_draw(const bContext *C, ARegion *region) } static void nla_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -365,7 +365,7 @@ static void nla_region_listener(wmWindow *UNUSED(win), } static void nla_main_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -427,12 +427,12 @@ static void nla_main_region_message_subscribe(const struct bContext *UNUSED(C), struct WorkSpace *UNUSED(workspace), struct Scene *scene, struct bScreen *screen, - struct ScrArea *sa, + struct ScrArea *area, struct ARegion *region, struct wmMsgBus *mbus) { PointerRNA ptr; - RNA_pointer_create(&screen->id, &RNA_SpaceNLA, sa->spacedata.first, &ptr); + RNA_pointer_create(&screen->id, &RNA_SpaceNLA, area->spacedata.first, &ptr); wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { .owner = region, @@ -466,7 +466,7 @@ static void nla_main_region_message_subscribe(const struct bContext *UNUSED(C), } static void nla_channel_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -512,12 +512,12 @@ static void nla_channel_region_message_subscribe(const struct bContext *UNUSED(C struct WorkSpace *UNUSED(workspace), struct Scene *UNUSED(scene), struct bScreen *screen, - struct ScrArea *sa, + struct ScrArea *area, struct ARegion *region, struct wmMsgBus *mbus) { PointerRNA ptr; - RNA_pointer_create(&screen->id, &RNA_SpaceNLA, sa->spacedata.first, &ptr); + RNA_pointer_create(&screen->id, &RNA_SpaceNLA, area->spacedata.first, &ptr); wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { .owner = region, @@ -543,24 +543,27 @@ static void nla_channel_region_message_subscribe(const struct bContext *UNUSED(C } /* editor level listener */ -static void nla_listener(wmWindow *UNUSED(win), ScrArea *sa, wmNotifier *wmn, Scene *UNUSED(scene)) +static void nla_listener(wmWindow *UNUSED(win), + ScrArea *area, + wmNotifier *wmn, + Scene *UNUSED(scene)) { /* context changes */ switch (wmn->category) { case NC_ANIMATION: // TODO: filter specific types of changes? - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); break; case NC_SCENE: #if 0 switch (wmn->data) { case ND_OB_ACTIVE: case ND_OB_SELECT: - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); break; } #endif - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); break; case NC_OBJECT: switch (wmn->data) { @@ -568,19 +571,19 @@ static void nla_listener(wmWindow *UNUSED(win), ScrArea *sa, wmNotifier *wmn, Sc /* do nothing */ break; default: - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); break; } break; case NC_SPACE: if (wmn->data == ND_SPACE_NLA) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } break; } } -static void nla_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID *new_id) +static void nla_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_id, ID *new_id) { SpaceNla *snla = (SpaceNla *)slink; diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index e50f5a818aa..0e100080a11 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -128,11 +128,11 @@ static int compo_get_recalc_flags(const bContext *C) for (win = wm->windows.first; win; win = win->next) { const bScreen *sc = WM_window_get_active_screen(win); - ScrArea *sa; + ScrArea *area; - for (sa = sc->areabase.first; sa; sa = sa->next) { - if (sa->spacetype == SPACE_IMAGE) { - SpaceImage *sima = sa->spacedata.first; + for (area = sc->areabase.first; area; area = area->next) { + if (area->spacetype == SPACE_IMAGE) { + SpaceImage *sima = area->spacedata.first; if (sima->image) { if (sima->image->type == IMA_TYPE_R_RESULT) { recalc_flags |= COM_RECALC_COMPOSITE; @@ -142,8 +142,8 @@ static int compo_get_recalc_flags(const bContext *C) } } } - else if (sa->spacetype == SPACE_NODE) { - SpaceNode *snode = sa->spacedata.first; + else if (area->spacetype == SPACE_NODE) { + SpaceNode *snode = area->spacedata.first; if (snode->flag & SNODE_BACKDRAW) { recalc_flags |= COM_RECALC_VIEWER; } diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c index 5dc98a3905a..8dfa99ca126 100644 --- a/source/blender/editors/space_node/node_relationships.c +++ b/source/blender/editors/space_node/node_relationships.c @@ -1446,9 +1446,12 @@ void NODE_OT_detach(wmOperatorType *ot) /* ********************* automatic node insert on dragging ******************* */ /* prevent duplicate testing code below */ -static bool ed_node_link_conditions(ScrArea *sa, bool test, SpaceNode **r_snode, bNode **r_select) +static bool ed_node_link_conditions(ScrArea *area, + bool test, + SpaceNode **r_snode, + bNode **r_select) { - SpaceNode *snode = sa ? sa->spacedata.first : NULL; + SpaceNode *snode = area ? area->spacedata.first : NULL; bNode *node, *select = NULL; bNodeLink *link; @@ -1456,7 +1459,7 @@ static bool ed_node_link_conditions(ScrArea *sa, bool test, SpaceNode **r_snode, *r_select = NULL; /* no unlucky accidents */ - if (sa == NULL || sa->spacetype != SPACE_NODE) { + if (area == NULL || area->spacetype != SPACE_NODE) { return false; } @@ -1501,14 +1504,14 @@ static bool ed_node_link_conditions(ScrArea *sa, bool test, SpaceNode **r_snode, } /* test == 0, clear all intersect flags */ -void ED_node_link_intersect_test(ScrArea *sa, int test) +void ED_node_link_intersect_test(ScrArea *area, int test) { bNode *select; SpaceNode *snode; bNodeLink *link, *selink = NULL; float dist_best = FLT_MAX; - if (!ed_node_link_conditions(sa, test, &snode, &select)) { + if (!ed_node_link_conditions(area, test, &snode, &select)) { return; } @@ -1919,14 +1922,14 @@ void NODE_OT_insert_offset(wmOperatorType *ot) } /* assumes link with NODE_LINKFLAG_HILITE set */ -void ED_node_link_insert(Main *bmain, ScrArea *sa) +void ED_node_link_insert(Main *bmain, ScrArea *area) { bNode *node, *select; SpaceNode *snode; bNodeLink *link; bNodeSocket *sockto; - if (!ed_node_link_conditions(sa, true, &snode, &select)) { + if (!ed_node_link_conditions(area, true, &snode, &select)) { return; } diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 32007d5b971..d682cab7293 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -328,17 +328,17 @@ static void node_free(SpaceLink *sl) } /* spacetype; init callback */ -static void node_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) +static void node_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area)) { } static void node_area_listener(wmWindow *UNUSED(win), - ScrArea *sa, + ScrArea *area, wmNotifier *wmn, Scene *UNUSED(scene)) { /* note, ED_area_tag_refresh will re-execute compositor */ - SpaceNode *snode = sa->spacedata.first; + SpaceNode *snode = area->spacedata.first; /* shaderfrom is only used for new shading nodes, otherwise all shaders are from objects */ short shader_type = snode->shaderfrom; @@ -347,32 +347,32 @@ static void node_area_listener(wmWindow *UNUSED(win), case NC_SCENE: switch (wmn->data) { case ND_NODES: { - ARegion *region = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); + ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); bNodeTreePath *path = snode->treepath.last; /* shift view to node tree center */ if (region && path) { UI_view2d_center_set(®ion->v2d, path->view_center[0], path->view_center[1]); } - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); break; } case ND_FRAME: - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); break; case ND_COMPO_RESULT: - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; case ND_TRANSFORM_DONE: if (ED_node_is_compositor(snode)) { if (snode->flag & SNODE_AUTO_RENDER) { snode->recalc = 1; - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } } break; case ND_LAYER_CONTENT: - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); break; } break; @@ -381,13 +381,13 @@ static void node_area_listener(wmWindow *UNUSED(win), case NC_MATERIAL: if (ED_node_is_shader(snode)) { if (wmn->data == ND_SHADING) { - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } else if (wmn->data == ND_SHADING_DRAW) { - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } else if (wmn->data == ND_SHADING_LINKS) { - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } else if (wmn->action == NA_ADDED && snode->edittree) { nodeSetActiveID(snode->edittree, ID_MA, wmn->reference); @@ -397,49 +397,49 @@ static void node_area_listener(wmWindow *UNUSED(win), case NC_TEXTURE: if (ED_node_is_shader(snode) || ED_node_is_texture(snode)) { if (wmn->data == ND_NODES) { - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } } break; case NC_WORLD: if (ED_node_is_shader(snode) && shader_type == SNODE_SHADER_WORLD) { - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } break; case NC_OBJECT: if (ED_node_is_shader(snode)) { if (wmn->data == ND_OB_SHADING) { - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } } break; case NC_SPACE: if (wmn->data == ND_SPACE_NODE) { - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } else if (wmn->data == ND_SPACE_NODE_VIEW) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } break; case NC_NODE: if (wmn->action == NA_EDITED) { - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } else if (wmn->action == NA_SELECTED) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } break; case NC_SCREEN: switch (wmn->data) { case ND_ANIMPLAY: - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); break; } break; case NC_MASK: if (wmn->action == NA_EDITED) { if (snode->nodetree && snode->nodetree->type == NTREE_COMPOSIT) { - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } } break; @@ -451,7 +451,7 @@ static void node_area_listener(wmWindow *UNUSED(win), * scenes so really this is just to know if the images is used in the compo else * painting on images could become very slow when the compositor is open. */ if (nodeUpdateID(snode->nodetree, wmn->reference)) { - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } } } @@ -461,7 +461,7 @@ static void node_area_listener(wmWindow *UNUSED(win), if (wmn->action == NA_EDITED) { if (ED_node_is_compositor(snode)) { if (nodeUpdateID(snode->nodetree, wmn->reference)) { - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } } } @@ -469,26 +469,26 @@ static void node_area_listener(wmWindow *UNUSED(win), case NC_LINESTYLE: if (ED_node_is_shader(snode) && shader_type == SNODE_SHADER_LINESTYLE) { - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } break; case NC_WM: if (wmn->data == ND_UNDO) { - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); } break; case NC_GPENCIL: if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } break; } } -static void node_area_refresh(const struct bContext *C, ScrArea *sa) +static void node_area_refresh(const struct bContext *C, ScrArea *area) { /* default now: refresh node is starting preview */ - SpaceNode *snode = sa->spacedata.first; + SpaceNode *snode = area->spacedata.first; snode_set_context(C); @@ -497,19 +497,19 @@ static void node_area_refresh(const struct bContext *C, ScrArea *sa) if (GS(snode->id->name) == ID_MA) { Material *ma = (Material *)snode->id; if (ma->use_nodes) { - ED_preview_shader_job(C, sa, snode->id, NULL, NULL, 100, 100, PR_NODE_RENDER); + ED_preview_shader_job(C, area, snode->id, NULL, NULL, 100, 100, PR_NODE_RENDER); } } else if (GS(snode->id->name) == ID_LA) { Light *la = (Light *)snode->id; if (la->use_nodes) { - ED_preview_shader_job(C, sa, snode->id, NULL, NULL, 100, 100, PR_NODE_RENDER); + ED_preview_shader_job(C, area, snode->id, NULL, NULL, 100, 100, PR_NODE_RENDER); } } else if (GS(snode->id->name) == ID_WO) { World *wo = (World *)snode->id; if (wo->use_nodes) { - ED_preview_shader_job(C, sa, snode->id, NULL, NULL, 100, 100, PR_NODE_RENDER); + ED_preview_shader_job(C, area, snode->id, NULL, NULL, 100, 100, PR_NODE_RENDER); } } } @@ -529,7 +529,7 @@ static void node_area_refresh(const struct bContext *C, ScrArea *sa) else if (snode->nodetree->type == NTREE_TEXTURE) { Tex *tex = (Tex *)snode->id; if (tex->use_nodes) { - ED_preview_shader_job(C, sa, snode->id, NULL, NULL, 100, 100, PR_NODE_RENDER); + ED_preview_shader_job(C, area, snode->id, NULL, NULL, 100, 100, PR_NODE_RENDER); } } } @@ -585,9 +585,9 @@ static void node_toolbar_region_draw(const bContext *C, ARegion *region) ED_region_panels(C, region); } -static void node_cursor(wmWindow *win, ScrArea *sa, ARegion *region) +static void node_cursor(wmWindow *win, ScrArea *area, ARegion *region) { - SpaceNode *snode = sa->spacedata.first; + SpaceNode *snode = area->spacedata.first; /* convert mouse coordinates to v2d space */ UI_view2d_region_to_view(®ion->v2d, @@ -702,7 +702,7 @@ static void node_header_region_draw(const bContext *C, ARegion *region) /* used for header + main region */ static void node_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -851,7 +851,7 @@ static void node_widgets(void) WM_gizmogrouptype_append_and_link(gzmap_type, NODE_GGT_backdrop_corner_pin); } -static void node_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID *new_id) +static void node_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_id, ID *new_id) { SpaceNode *snode = (SpaceNode *)slink; @@ -922,15 +922,15 @@ static void node_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID } } -static int node_space_subtype_get(ScrArea *sa) +static int node_space_subtype_get(ScrArea *area) { - SpaceNode *snode = sa->spacedata.first; + SpaceNode *snode = area->spacedata.first; return rna_node_tree_idname_to_enum(snode->tree_idname); } -static void node_space_subtype_set(ScrArea *sa, int value) +static void node_space_subtype_set(ScrArea *area, int value) { - SpaceNode *snode = sa->spacedata.first; + SpaceNode *snode = area->spacedata.first; ED_node_set_tree_type(snode, rna_node_tree_type_from_enum(value)); } diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 57bf34f1e18..e4e8e2a1542 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -1675,8 +1675,8 @@ void OUTLINER_OT_show_hierarchy(wmOperatorType *ot) /* specialized poll callback for these operators to work in Datablocks view only */ static bool ed_operator_outliner_datablocks_active(bContext *C) { - ScrArea *sa = CTX_wm_area(C); - if ((sa) && (sa->spacetype == SPACE_OUTLINER)) { + ScrArea *area = CTX_wm_area(C); + if ((area) && (area->spacetype == SPACE_OUTLINER)) { SpaceOutliner *so = CTX_wm_space_outliner(C); return (so->outlinevis == SO_DATA_API); } @@ -2179,8 +2179,8 @@ void OUTLINER_OT_keyingset_remove_selected(wmOperatorType *ot) static bool ed_operator_outliner_id_orphans_active(bContext *C) { - ScrArea *sa = CTX_wm_area(C); - if (sa != NULL && sa->spacetype == SPACE_OUTLINER) { + ScrArea *area = CTX_wm_area(C); + if (area != NULL && area->spacetype == SPACE_OUTLINER) { SpaceOutliner *so = CTX_wm_space_outliner(C); return (so->outlinevis == SO_ID_ORPHANS); } @@ -2249,7 +2249,7 @@ static int outliner_orphans_purge_invoke(bContext *C, wmOperator *op, const wmEv static int outliner_orphans_purge_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); SpaceOutliner *soops = CTX_wm_space_outliner(C); int num_tagged[INDEX_ID_MAX] = {0}; @@ -2276,7 +2276,7 @@ static int outliner_orphans_purge_exec(bContext *C, wmOperator *op) * outliner several mouse events can be handled in one cycle without * handling notifiers/redraw which leads to deleting the same object twice. * cleanup tree here to prevent such cases. */ - if ((sa != NULL) && (sa->spacetype == SPACE_OUTLINER)) { + if ((area != NULL) && (area->spacetype == SPACE_OUTLINER)) { outliner_cleanup_tree(soops); } diff --git a/source/blender/editors/space_outliner/outliner_sync.c b/source/blender/editors/space_outliner/outliner_sync.c index 745a527cc15..10075a8df58 100644 --- a/source/blender/editors/space_outliner/outliner_sync.c +++ b/source/blender/editors/space_outliner/outliner_sync.c @@ -95,8 +95,8 @@ void ED_outliner_select_sync_flag_outliners(const bContext *C) wmWindowManager *wm = CTX_wm_manager(C); 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) { + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_OUTLINER) { SpaceOutliner *soutliner = (SpaceOutliner *)sl; diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index cfeaf8aa897..9450136b6a6 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -106,7 +106,7 @@ static void outliner_main_region_free(ARegion *UNUSED(region)) } static void outliner_main_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -241,11 +241,11 @@ static void outliner_main_region_message_subscribe(const struct bContext *UNUSED struct WorkSpace *UNUSED(workspace), struct Scene *UNUSED(scene), struct bScreen *UNUSED(screen), - struct ScrArea *sa, + struct ScrArea *area, struct ARegion *region, struct wmMsgBus *mbus) { - SpaceOutliner *soops = sa->spacedata.first; + SpaceOutliner *soops = area->spacedata.first; wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { .owner = region, .user_data = region, @@ -275,7 +275,7 @@ static void outliner_header_region_free(ARegion *UNUSED(region)) } static void outliner_header_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -341,7 +341,7 @@ static void outliner_free(SpaceLink *sl) } /* spacetype; init callback */ -static void outliner_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) +static void outliner_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area)) { } @@ -360,7 +360,7 @@ static SpaceLink *outliner_duplicate(SpaceLink *sl) return (SpaceLink *)soutlinern; } -static void outliner_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID *new_id) +static void outliner_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_id, ID *new_id) { SpaceOutliner *so = (SpaceOutliner *)slink; @@ -393,12 +393,12 @@ static void outliner_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, } } -static void outliner_deactivate(struct ScrArea *sa) +static void outliner_deactivate(struct ScrArea *area) { /* Remove hover highlights */ - SpaceOutliner *soops = sa->spacedata.first; + SpaceOutliner *soops = area->spacedata.first; outliner_flag_set(&soops->tree, TSE_HIGHLIGHTED, false); - ED_region_tag_redraw(BKE_area_find_region_type(sa, RGN_TYPE_WINDOW)); + ED_region_tag_redraw(BKE_area_find_region_type(area, RGN_TYPE_WINDOW)); } /* only called once, from space_api/spacetypes.c */ diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c index d872facd488..343f35421a4 100644 --- a/source/blender/editors/space_script/space_script.c +++ b/source/blender/editors/space_script/space_script.c @@ -94,7 +94,7 @@ static void script_free(SpaceLink *sl) } /* spacetype; init callback */ -static void script_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) +static void script_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area)) { } @@ -160,7 +160,7 @@ static void script_header_region_draw(const bContext *C, ARegion *region) } static void script_main_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *UNUSED(region), wmNotifier *UNUSED(wmn), const Scene *UNUSED(scene)) diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 29d8f213d7e..7eb08387bd6 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -185,7 +185,7 @@ static void seq_proxy_build_job(const bContext *C, ReportList *reports) struct Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); Scene *scene = CTX_data_scene(C); Editing *ed = BKE_sequencer_editing_get(scene, false); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); Sequence *seq; GSet *file_list; @@ -233,7 +233,7 @@ static void seq_proxy_build_job(const bContext *C, ReportList *reports) WM_jobs_start(CTX_wm_manager(C), wm_job); } - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } /* ********************************************************************** */ @@ -1631,11 +1631,11 @@ static int sequencer_slip_exec(bContext *C, wmOperator *op) } } -static void sequencer_slip_update_header(Scene *scene, ScrArea *sa, SlipData *data, int offset) +static void sequencer_slip_update_header(Scene *scene, ScrArea *area, SlipData *data, int offset) { char msg[UI_MAX_DRAW_STR]; - if (sa) { + if (area) { if (hasNumInput(&data->num_input)) { char num_str[NUM_STR_REP_LEN]; outputNumInput(&data->num_input, num_str, &scene->unit); @@ -1646,7 +1646,7 @@ static void sequencer_slip_update_header(Scene *scene, ScrArea *sa, SlipData *da } } - ED_area_status_text(sa, msg); + ED_area_status_text(area, msg); } static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *event) @@ -1654,7 +1654,7 @@ static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *even Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); SlipData *data = (SlipData *)op->customdata; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); const bool has_numInput = hasNumInput(&data->num_input); bool handled = true; @@ -1663,7 +1663,7 @@ static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *even float offset; applyNumInput(&data->num_input, &offset); - sequencer_slip_update_header(scene, sa, data, (int)offset); + sequencer_slip_update_header(scene, area, data, (int)offset); RNA_int_set(op->ptr, "offset", offset); @@ -1695,7 +1695,7 @@ static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *even UI_view2d_region_to_view(v2d, mouse_x, 0, &mouseloc[0], &mouseloc[1]); offset = mouseloc[0] - data->init_mouseloc[0]; - sequencer_slip_update_header(scene, sa, data, offset); + sequencer_slip_update_header(scene, area, data, offset); RNA_int_set(op->ptr, "offset", offset); @@ -1714,8 +1714,8 @@ static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *even MEM_freeN(data->ts); MEM_freeN(data); op->customdata = NULL; - if (sa) { - ED_area_status_text(sa, NULL); + if (area) { + ED_area_status_text(area, NULL); } DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); @@ -1747,8 +1747,8 @@ static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *even BKE_sequencer_free_imbuf(scene, &ed->seqbase, false); - if (sa) { - ED_area_status_text(sa, NULL); + if (area) { + ED_area_status_text(area, NULL); } return OPERATOR_CANCELLED; @@ -1777,7 +1777,7 @@ static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *even float offset; applyNumInput(&data->num_input, &offset); - sequencer_slip_update_header(scene, sa, data, (int)offset); + sequencer_slip_update_header(scene, area, data, (int)offset); RNA_int_set(op->ptr, "offset", offset); diff --git a/source/blender/editors/space_sequencer/sequencer_preview.c b/source/blender/editors/space_sequencer/sequencer_preview.c index 7c8a5ff5981..d50047c4839 100644 --- a/source/blender/editors/space_sequencer/sequencer_preview.c +++ b/source/blender/editors/space_sequencer/sequencer_preview.c @@ -130,7 +130,7 @@ void sequencer_preview_add_sound(const bContext *C, Sequence *seq) /* first, get the preview job, if it exists */ wmJob *wm_job; PreviewJob *pj; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); PreviewJobAudio *audiojob = MEM_callocN(sizeof(PreviewJobAudio), "preview_audio"); wm_job = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), @@ -167,5 +167,5 @@ void sequencer_preview_add_sound(const bContext *C, Sequence *seq) WM_jobs_start(CTX_wm_manager(C), wm_job); } - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index 2cd3f624455..73aa8e1be35 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -61,20 +61,20 @@ /**************************** common state *****************************/ -static void sequencer_scopes_tag_refresh(ScrArea *sa) +static void sequencer_scopes_tag_refresh(ScrArea *area) { - SpaceSeq *sseq = (SpaceSeq *)sa->spacedata.first; + SpaceSeq *sseq = (SpaceSeq *)area->spacedata.first; sseq->scopes.reference_ibuf = NULL; } /* ******************** manage regions ********************* */ -static ARegion *sequencer_find_region(ScrArea *sa, short type) +static ARegion *sequencer_find_region(ScrArea *area, short type) { ARegion *region = NULL; - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region->regiontype == type) { return region; } @@ -85,7 +85,7 @@ static ARegion *sequencer_find_region(ScrArea *sa, short type) /* ******************** default callbacks for sequencer space ***************** */ -static SpaceLink *sequencer_new(const ScrArea *UNUSED(sa), const Scene *scene) +static SpaceLink *sequencer_new(const ScrArea *UNUSED(area), const Scene *scene) { ARegion *region; SpaceSeq *sseq; @@ -214,17 +214,17 @@ static void sequencer_free(SpaceLink *sl) } /* spacetype; init callback */ -static void sequencer_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) +static void sequencer_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area)) { } -static void sequencer_refresh(const bContext *C, ScrArea *sa) +static void sequencer_refresh(const bContext *C, ScrArea *area) { wmWindowManager *wm = CTX_wm_manager(C); wmWindow *window = CTX_wm_window(C); - SpaceSeq *sseq = (SpaceSeq *)sa->spacedata.first; - ARegion *region_main = sequencer_find_region(sa, RGN_TYPE_WINDOW); - ARegion *region_preview = sequencer_find_region(sa, RGN_TYPE_PREVIEW); + SpaceSeq *sseq = (SpaceSeq *)area->spacedata.first; + ARegion *region_main = sequencer_find_region(area, RGN_TYPE_WINDOW); + ARegion *region_preview = sequencer_find_region(area, RGN_TYPE_PREVIEW); bool view_changed = false; switch (sseq->view) { @@ -274,7 +274,7 @@ static void sequencer_refresh(const bContext *C, ScrArea *sa) case SEQ_VIEW_SEQUENCE_PREVIEW: if (region_main && region_preview) { /* Get available height (without DPI correction). */ - const float height = (sa->winy - ED_area_headersize()) / UI_DPI_FAC; + const float height = (area->winy - ED_area_headersize()) / UI_DPI_FAC; /* We reuse hidden region's size, allows to find same layout as before if we just switch * between one 'full window' view and the combined one. This gets lost if we switch to both @@ -312,8 +312,8 @@ static void sequencer_refresh(const bContext *C, ScrArea *sa) } if (view_changed) { - ED_area_initialize(wm, window, sa); - ED_area_tag_redraw(sa); + ED_area_initialize(wm, window, area); + ED_area_tag_redraw(area); } } @@ -330,7 +330,7 @@ static SpaceLink *sequencer_duplicate(SpaceLink *sl) } static void sequencer_listener(wmWindow *UNUSED(win), - ScrArea *sa, + ScrArea *area, wmNotifier *wmn, Scene *UNUSED(scene)) { @@ -340,19 +340,19 @@ static void sequencer_listener(wmWindow *UNUSED(win), switch (wmn->data) { case ND_FRAME: case ND_SEQUENCER: - sequencer_scopes_tag_refresh(sa); + sequencer_scopes_tag_refresh(area); break; } break; case NC_WINDOW: case NC_SPACE: if (wmn->data == ND_SPACE_SEQUENCER) { - sequencer_scopes_tag_refresh(sa); + sequencer_scopes_tag_refresh(area); } break; case NC_GPENCIL: if (wmn->data & ND_GPENCIL_EDITMODE) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } break; } @@ -522,7 +522,7 @@ static void sequencer_main_region_draw(const bContext *C, ARegion *region) } static void sequencer_main_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -570,7 +570,7 @@ static void sequencer_main_region_message_subscribe(const struct bContext *UNUSE struct WorkSpace *UNUSED(workspace), struct Scene *scene, struct bScreen *UNUSED(screen), - struct ScrArea *UNUSED(sa), + struct ScrArea *UNUSED(area), struct ARegion *region, struct wmMsgBus *mbus) { @@ -675,8 +675,8 @@ static void sequencer_preview_region_init(wmWindowManager *wm, ARegion *region) static void sequencer_preview_region_draw(const bContext *C, ARegion *region) { - ScrArea *sa = CTX_wm_area(C); - SpaceSeq *sseq = sa->spacedata.first; + ScrArea *area = CTX_wm_area(C); + SpaceSeq *sseq = area->spacedata.first; Scene *scene = CTX_data_scene(C); wmWindowManager *wm = CTX_wm_manager(C); const bool draw_overlay = (scene->ed && (scene->ed->over_flag & SEQ_EDIT_OVERLAY_SHOW)); @@ -717,7 +717,7 @@ static void sequencer_preview_region_draw(const bContext *C, ARegion *region) } static void sequencer_preview_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -787,7 +787,7 @@ static void sequencer_buttons_region_draw(const bContext *C, ARegion *region) } static void sequencer_buttons_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -820,7 +820,7 @@ static void sequencer_buttons_region_listener(wmWindow *UNUSED(win), } } -static void sequencer_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID *new_id) +static void sequencer_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_id, ID *new_id) { SpaceSeq *sseq = (SpaceSeq *)slink; diff --git a/source/blender/editors/space_statusbar/space_statusbar.c b/source/blender/editors/space_statusbar/space_statusbar.c index 1efb18403de..34d7f8b0216 100644 --- a/source/blender/editors/space_statusbar/space_statusbar.c +++ b/source/blender/editors/space_statusbar/space_statusbar.c @@ -65,7 +65,7 @@ static void statusbar_free(SpaceLink *UNUSED(sl)) } /* spacetype; init callback */ -static void statusbar_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) +static void statusbar_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area)) { } @@ -96,7 +96,7 @@ static void statusbar_keymap(struct wmKeyConfig *UNUSED(keyconf)) } static void statusbar_header_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -135,7 +135,7 @@ static void statusbar_header_region_message_subscribe(const bContext *UNUSED(C), WorkSpace *UNUSED(workspace), Scene *UNUSED(scene), bScreen *UNUSED(screen), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, struct wmMsgBus *mbus) { diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index d5379a4e76d..76d61193ce0 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -107,7 +107,7 @@ static void text_free(SpaceLink *sl) } /* spacetype; init callback */ -static void text_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) +static void text_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area)) { } @@ -123,11 +123,11 @@ static SpaceLink *text_duplicate(SpaceLink *sl) } static void text_listener(wmWindow *UNUSED(win), - ScrArea *sa, + ScrArea *area, wmNotifier *wmn, Scene *UNUSED(scene)) { - SpaceText *st = sa->spacedata.first; + SpaceText *st = area->spacedata.first; /* context changes */ switch (wmn->category) { @@ -141,14 +141,14 @@ static void text_listener(wmWindow *UNUSED(win), switch (wmn->data) { case ND_DISPLAY: - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; case ND_CURSOR: if (st->text && st->text == wmn->reference) { - text_scroll_to_cursor__area(st, sa, true); + text_scroll_to_cursor__area(st, area, true); } - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; } @@ -159,15 +159,15 @@ static void text_listener(wmWindow *UNUSED(win), text_update_edited(st->text); } - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); ATTR_FALLTHROUGH; /* fall down to tag redraw */ case NA_ADDED: case NA_REMOVED: - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); break; case NA_SELECTED: if (st->text && st->text == wmn->reference) { - text_scroll_to_cursor__area(st, sa, true); + text_scroll_to_cursor__area(st, area, true); } break; @@ -176,7 +176,7 @@ static void text_listener(wmWindow *UNUSED(win), break; case NC_SPACE: if (wmn->data == ND_SPACE_TEXT) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } break; } @@ -309,9 +309,9 @@ static void text_main_region_draw(const bContext *C, ARegion *region) /* scrollers? */ } -static void text_cursor(wmWindow *win, ScrArea *sa, ARegion *region) +static void text_cursor(wmWindow *win, ScrArea *area, ARegion *region) { - SpaceText *st = sa->spacedata.first; + SpaceText *st = area->spacedata.first; int wmcursor = WM_CURSOR_TEXT_EDIT; if (st->text && BLI_rcti_isect_pt(&st->runtime.scroll_region_handle, @@ -413,14 +413,14 @@ static void text_properties_region_draw(const bContext *C, ARegion *region) if (st->flags & ST_FIND_ACTIVATE) { if (UI_textbutton_activate_rna(C, region, st, "find_text")) { /* if the panel was already open we need to do another redraw */ - ScrArea *sa = CTX_wm_area(C); - WM_event_add_notifier(C, NC_SPACE | ND_SPACE_TEXT, sa); + ScrArea *area = CTX_wm_area(C); + WM_event_add_notifier(C, NC_SPACE | ND_SPACE_TEXT, area); } st->flags &= ~ST_FIND_ACTIVATE; } } -static void text_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID *new_id) +static void text_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_id, ID *new_id) { SpaceText *stext = (SpaceText *)slink; diff --git a/source/blender/editors/space_text/text_autocomplete.c b/source/blender/editors/space_text/text_autocomplete.c index cb1861d8726..1f034bdbd09 100644 --- a/source/blender/editors/space_text/text_autocomplete.c +++ b/source/blender/editors/space_text/text_autocomplete.c @@ -335,8 +335,8 @@ static int doc_scroll = 0; static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *event) { SpaceText *st = CTX_wm_space_text(C); - ScrArea *sa = CTX_wm_area(C); - ARegion *region = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); + ScrArea *area = CTX_wm_area(C); + ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); int draw = 0, tools = 0, swallow = 0, scroll = 1; Text *text = CTX_data_edit_text(C); @@ -577,7 +577,7 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e } if (draw) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } // if (swallow) { diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 777b6b1ef1d..a0339b35c57 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -1812,7 +1812,7 @@ void text_scroll_to_cursor(SpaceText *st, ARegion *region, const bool center) } /* takes an area instead of a region, use for listeners */ -void text_scroll_to_cursor__area(SpaceText *st, ScrArea *sa, const bool center) +void text_scroll_to_cursor__area(SpaceText *st, ScrArea *area, const bool center) { ARegion *region; @@ -1820,7 +1820,7 @@ void text_scroll_to_cursor__area(SpaceText *st, ScrArea *sa, const bool center) return; } - region = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); + region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); if (region) { text_scroll_to_cursor(st, region, center); @@ -1829,10 +1829,10 @@ void text_scroll_to_cursor__area(SpaceText *st, ScrArea *sa, const bool center) void text_update_cursor_moved(bContext *C) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); SpaceText *st = CTX_wm_space_text(C); - text_scroll_to_cursor__area(st, sa, true); + text_scroll_to_cursor__area(st, area, true); } /** diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c index da39ba3c5ad..c4052fcef84 100644 --- a/source/blender/editors/space_text/text_header.c +++ b/source/blender/editors/space_text/text_header.c @@ -42,17 +42,17 @@ /************************** properties ******************************/ -static ARegion *text_has_properties_region(ScrArea *sa) +static ARegion *text_has_properties_region(ScrArea *area) { ARegion *region, *arnew; - region = BKE_area_find_region_type(sa, RGN_TYPE_UI); + region = BKE_area_find_region_type(area, RGN_TYPE_UI); if (region) { return region; } /* add subdiv level; after header */ - region = BKE_area_find_region_type(sa, RGN_TYPE_HEADER); + region = BKE_area_find_region_type(area, RGN_TYPE_HEADER); /* is error! */ if (region == NULL) { @@ -61,7 +61,7 @@ static ARegion *text_has_properties_region(ScrArea *sa) arnew = MEM_callocN(sizeof(ARegion), "properties region"); - BLI_insertlinkafter(&sa->regionbase, region, arnew); + BLI_insertlinkafter(&area->regionbase, region, arnew); arnew->regiontype = RGN_TYPE_UI; arnew->alignment = RGN_ALIGN_LEFT; @@ -77,8 +77,8 @@ static bool text_properties_poll(bContext *C) static int text_text_search_exec(bContext *C, wmOperator *UNUSED(op)) { - ScrArea *sa = CTX_wm_area(C); - ARegion *region = text_has_properties_region(sa); + ScrArea *area = CTX_wm_area(C); + ARegion *region = text_has_properties_region(area); SpaceText *st = CTX_wm_space_text(C); if (region) { diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h index 5ad6a554188..d5114d8f6b5 100644 --- a/source/blender/editors/space_text/text_intern.h +++ b/source/blender/editors/space_text/text_intern.h @@ -41,7 +41,7 @@ void text_update_line_edited(struct TextLine *line); void text_update_edited(struct Text *text); void text_update_character_width(struct SpaceText *st); void text_scroll_to_cursor(struct SpaceText *st, struct ARegion *region, const bool center); -void text_scroll_to_cursor__area(struct SpaceText *st, struct ScrArea *sa, const bool center); +void text_scroll_to_cursor__area(struct SpaceText *st, struct ScrArea *area, const bool center); void text_update_cursor_moved(struct bContext *C); /* Padding around line numbers in character widths. */ diff --git a/source/blender/editors/space_topbar/space_topbar.c b/source/blender/editors/space_topbar/space_topbar.c index cacf956aa84..d06c567988d 100644 --- a/source/blender/editors/space_topbar/space_topbar.c +++ b/source/blender/editors/space_topbar/space_topbar.c @@ -84,7 +84,7 @@ static void topbar_free(SpaceLink *UNUSED(sl)) } /* spacetype; init callback */ -static void topbar_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) +static void topbar_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area)) { } @@ -130,7 +130,7 @@ static void topbar_header_region_init(wmWindowManager *UNUSED(wm), ARegion *regi } static void topbar_main_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -161,7 +161,7 @@ static void topbar_main_region_listener(wmWindow *UNUSED(win), } static void topbar_header_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -195,7 +195,7 @@ static void topbar_header_region_message_subscribe(const struct bContext *UNUSED struct WorkSpace *workspace, struct Scene *UNUSED(scene), struct bScreen *UNUSED(screen), - struct ScrArea *UNUSED(sa), + struct ScrArea *UNUSED(area), struct ARegion *region, struct wmMsgBus *mbus) { diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c index d3bea4598ff..9eae722d5c8 100644 --- a/source/blender/editors/space_userpref/space_userpref.c +++ b/source/blender/editors/space_userpref/space_userpref.c @@ -97,7 +97,7 @@ static void userpref_free(SpaceLink *UNUSED(sl)) } /* spacetype; init callback */ -static void userpref_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) +static void userpref_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area)) { } @@ -185,7 +185,7 @@ static void userpref_execute_region_init(wmWindowManager *wm, ARegion *region) } static void userpref_main_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *UNUSED(region), wmNotifier *UNUSED(wmn), const Scene *UNUSED(scene)) @@ -194,7 +194,7 @@ static void userpref_main_region_listener(wmWindow *UNUSED(win), } static void userpref_header_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *UNUSED(region), wmNotifier *UNUSED(wmn), const Scene *UNUSED(scene)) @@ -209,7 +209,7 @@ static void userpref_header_listener(wmWindow *UNUSED(win), } static void userpref_navigation_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *UNUSED(region), wmNotifier *UNUSED(wmn), const Scene *UNUSED(scene)) @@ -218,7 +218,7 @@ static void userpref_navigation_region_listener(wmWindow *UNUSED(win), } static void userpref_execute_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *UNUSED(region), wmNotifier *UNUSED(wmn), const Scene *UNUSED(scene)) diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index e5f1de7d5eb..75717213cb1 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -88,9 +88,9 @@ RegionView3D *ED_view3d_context_rv3d(bContext *C) RegionView3D *rv3d = CTX_wm_region_view3d(C); if (rv3d == NULL) { - ScrArea *sa = CTX_wm_area(C); - if (sa && sa->spacetype == SPACE_VIEW3D) { - ARegion *region = BKE_area_find_region_active_win(sa); + ScrArea *area = CTX_wm_area(C); + if (area && area->spacetype == SPACE_VIEW3D) { + ARegion *region = BKE_area_find_region_active_win(area); if (region) { rv3d = region->regiondata; } @@ -103,14 +103,14 @@ RegionView3D *ED_view3d_context_rv3d(bContext *C) * so return that, the caller can then access the region->regiondata */ bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_region) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); *r_v3d = NULL; *r_region = NULL; - if (sa && sa->spacetype == SPACE_VIEW3D) { + if (area && area->spacetype == SPACE_VIEW3D) { ARegion *region = CTX_wm_region(C); - View3D *v3d = (View3D *)sa->spacedata.first; + View3D *v3d = (View3D *)area->spacedata.first; if (region) { RegionView3D *rv3d; @@ -121,7 +121,7 @@ bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_regi return true; } else { - if (ED_view3d_area_user_region(sa, v3d, r_region)) { + if (ED_view3d_area_user_region(area, v3d, r_region)) { *r_v3d = v3d; return true; } @@ -136,12 +136,13 @@ bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_regi * Similar to #ED_view3d_context_user_region() but does not use context. Always performs a lookup. * Also works if \a v3d is not the active space. */ -bool ED_view3d_area_user_region(const ScrArea *sa, const View3D *v3d, ARegion **r_region) +bool ED_view3d_area_user_region(const ScrArea *area, const View3D *v3d, ARegion **r_region) { RegionView3D *rv3d = NULL; ARegion *region_unlock_user = NULL; ARegion *region_unlock = NULL; - const ListBase *region_list = (v3d == sa->spacedata.first) ? &sa->regionbase : &v3d->regionbase; + const ListBase *region_list = (v3d == area->spacedata.first) ? &area->regionbase : + &v3d->regionbase; BLI_assert(v3d->spacetype == SPACE_VIEW3D); @@ -239,14 +240,14 @@ void ED_view3d_stop_render_preview(wmWindowManager *wm, ARegion *region) } } -void ED_view3d_shade_update(Main *bmain, View3D *v3d, ScrArea *sa) +void ED_view3d_shade_update(Main *bmain, View3D *v3d, ScrArea *area) { wmWindowManager *wm = bmain->wm.first; if (v3d->shading.type != OB_RENDER) { ARegion *region; - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if ((region->regiontype == RGN_TYPE_WINDOW) && region->regiondata) { ED_view3d_stop_render_preview(wm, region); break; @@ -257,7 +258,7 @@ void ED_view3d_shade_update(Main *bmain, View3D *v3d, ScrArea *sa) /* ******************** default callbacks for view3d space ***************** */ -static SpaceLink *view3d_new(const ScrArea *UNUSED(sa), const Scene *scene) +static SpaceLink *view3d_new(const ScrArea *UNUSED(area), const Scene *scene) { ARegion *region; View3D *v3d; @@ -336,7 +337,7 @@ static void view3d_free(SpaceLink *sl) } /* spacetype; init callback */ -static void view3d_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) +static void view3d_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area)) { } @@ -732,9 +733,9 @@ static void *view3d_main_region_duplicate(void *poin) } static void view3d_main_region_listener( - wmWindow *UNUSED(win), ScrArea *sa, ARegion *region, wmNotifier *wmn, const Scene *scene) + wmWindow *UNUSED(win), ScrArea *area, ARegion *region, wmNotifier *wmn, const Scene *scene) { - View3D *v3d = sa->spacedata.first; + View3D *v3d = area->spacedata.first; RegionView3D *rv3d = region->regiondata; wmGizmoMap *gzmap = region->gizmo_map; @@ -927,7 +928,7 @@ static void view3d_main_region_listener( } break; case NC_LIGHTPROBE: - ED_area_tag_refresh(sa); + ED_area_tag_refresh(area); break; case NC_IMAGE: /* this could be more fine grained checks if we had @@ -992,7 +993,7 @@ static void view3d_main_region_message_subscribe(const struct bContext *C, struct WorkSpace *UNUSED(workspace), struct Scene *UNUSED(scene), struct bScreen *UNUSED(screen), - struct ScrArea *sa, + struct ScrArea *area, struct ARegion *region, struct wmMsgBus *mbus) { @@ -1070,7 +1071,7 @@ static void view3d_main_region_message_subscribe(const struct bContext *C, { wmMsgSubscribeValue msg_sub_value_region_tag_refresh = { .owner = region, - .user_data = sa, + .user_data = area, .notify = WM_toolsystem_do_msg_notify_tag_refresh, }; WM_msg_subscribe_rna_anon_prop(mbus, Object, mode, &msg_sub_value_region_tag_refresh); @@ -1078,9 +1079,9 @@ static void view3d_main_region_message_subscribe(const struct bContext *C, } } -static void view3d_main_region_cursor(wmWindow *win, ScrArea *sa, ARegion *region) +static void view3d_main_region_cursor(wmWindow *win, ScrArea *area, ARegion *region) { - if (!WM_cursor_set_from_tool(win, sa, region)) { + if (!WM_cursor_set_from_tool(win, area, region)) { WM_cursor_set(win, WM_CURSOR_DEFAULT); } } @@ -1101,7 +1102,7 @@ static void view3d_header_region_draw(const bContext *C, ARegion *region) } static void view3d_header_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -1174,7 +1175,7 @@ static void view3d_header_region_message_subscribe(const struct bContext *UNUSED struct WorkSpace *UNUSED(workspace), struct Scene *UNUSED(scene), struct bScreen *UNUSED(screen), - struct ScrArea *UNUSED(sa), + struct ScrArea *UNUSED(area), struct ARegion *region, struct wmMsgBus *mbus) { @@ -1318,7 +1319,7 @@ static void view3d_buttons_region_layout(const bContext *C, ARegion *region) } static void view3d_buttons_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(sa), + ScrArea *UNUSED(area), ARegion *region, wmNotifier *wmn, const Scene *UNUSED(scene)) @@ -1441,11 +1442,11 @@ static void view3d_tools_region_draw(const bContext *C, ARegion *region) /* area (not region) level listener */ static void space_view3d_listener(wmWindow *UNUSED(win), - ScrArea *sa, + ScrArea *area, struct wmNotifier *wmn, Scene *UNUSED(scene)) { - View3D *v3d = sa->spacedata.first; + View3D *v3d = area->spacedata.first; /* context changes */ switch (wmn->category) { @@ -1453,7 +1454,7 @@ static void space_view3d_listener(wmWindow *UNUSED(win), switch (wmn->data) { case ND_WORLD: if (v3d->flag2 & V3D_HIDE_OVERLAYS) { - ED_area_tag_redraw_regiontype(sa, RGN_TYPE_WINDOW); + ED_area_tag_redraw_regiontype(area, RGN_TYPE_WINDOW); } break; } @@ -1463,7 +1464,7 @@ static void space_view3d_listener(wmWindow *UNUSED(win), case ND_WORLD_DRAW: case ND_WORLD: if (v3d->shading.background_type == V3D_SHADING_BACKGROUND_WORLD) { - ED_area_tag_redraw_regiontype(sa, RGN_TYPE_WINDOW); + ED_area_tag_redraw_regiontype(area, RGN_TYPE_WINDOW); } break; } @@ -1472,7 +1473,7 @@ static void space_view3d_listener(wmWindow *UNUSED(win), switch (wmn->data) { case ND_NODES: if (v3d->shading.type == OB_TEXTURE) { - ED_area_tag_redraw_regiontype(sa, RGN_TYPE_WINDOW); + ED_area_tag_redraw_regiontype(area, RGN_TYPE_WINDOW); } break; } @@ -1480,7 +1481,7 @@ static void space_view3d_listener(wmWindow *UNUSED(win), } } -static void space_view3d_refresh(const bContext *C, ScrArea *UNUSED(sa)) +static void space_view3d_refresh(const bContext *C, ScrArea *UNUSED(area)) { Scene *scene = CTX_data_scene(C); LightCache *lcache = scene->eevee.light_cache_data; @@ -1538,7 +1539,7 @@ static int view3d_context(const bContext *C, const char *member, bContextDataRes return -1; /* found but not available */ } -static void view3d_id_remap(ScrArea *sa, SpaceLink *slink, ID *old_id, ID *new_id) +static void view3d_id_remap(ScrArea *area, SpaceLink *slink, ID *old_id, ID *new_id) { View3D *v3d; ARegion *region; @@ -1553,8 +1554,8 @@ static void view3d_id_remap(ScrArea *sa, SpaceLink *slink, ID *old_id, ID *new_i v3d->camera = (Object *)new_id; if (!new_id) { /* 3D view might be inactive, in that case needs to use slink->regionbase */ - ListBase *regionbase = (slink == sa->spacedata.first) ? &sa->regionbase : - &slink->regionbase; + ListBase *regionbase = (slink == area->spacedata.first) ? &area->regionbase : + &slink->regionbase; for (region = regionbase->first; region; region = region->next) { if (region->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3d = is_local ? ((RegionView3D *)region->regiondata)->localvd : diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 694cb7ee7d4..699ad40da9c 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2396,9 +2396,9 @@ void ED_view3d_screen_datamask(const bContext *C, CustomData_MeshMasks_update(r_cddata_masks, &CD_MASK_BAREMESH); /* Check if we need tfaces & mcols due to view mode. */ - for (const ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - if (sa->spacetype == SPACE_VIEW3D) { - ED_view3d_datamask(C, scene, sa->spacedata.first, r_cddata_masks); + for (const ScrArea *area = screen->areabase.first; area; area = area->next) { + if (area->spacetype == SPACE_VIEW3D) { + ED_view3d_datamask(C, scene, area->spacedata.first, r_cddata_masks); } } } diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 09be73c87d1..0a30336aed8 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -175,7 +175,7 @@ typedef struct ViewOpsData { /** Context pointers (assigned by #viewops_data_alloc). */ Main *bmain; Scene *scene; - ScrArea *sa; + ScrArea *area; ARegion *region; View3D *v3d; RegionView3D *rv3d; @@ -277,9 +277,9 @@ static void viewops_data_alloc(bContext *C, wmOperator *op) vod->bmain = CTX_data_main(C); vod->depsgraph = CTX_data_ensure_evaluated_depsgraph(C); vod->scene = CTX_data_scene(C); - vod->sa = CTX_wm_area(C); + vod->area = CTX_wm_area(C); vod->region = CTX_wm_region(C); - vod->v3d = vod->sa->spacedata.first; + vod->v3d = vod->area->spacedata.first; vod->rv3d = vod->region->regiondata; } @@ -1120,7 +1120,7 @@ static float view3d_ndof_pan_speed_calc(RegionView3D *rv3d) * often `!rv3d->is_persp` since it doesn't make sense to dolly in ortho. */ static void view3d_ndof_pan_zoom(const struct wmNDOFMotionData *ndof, - ScrArea *sa, + ScrArea *area, ARegion *region, const bool has_translate, const bool has_zoom) @@ -1161,7 +1161,7 @@ static void view3d_ndof_pan_zoom(const struct wmNDOFMotionData *ndof, /* all callers must check */ if (has_translate) { - BLI_assert(ED_view3d_offset_lock_check((View3D *)sa->spacedata.first, rv3d) == false); + BLI_assert(ED_view3d_offset_lock_check((View3D *)area->spacedata.first, rv3d) == false); } } @@ -1178,18 +1178,18 @@ static void view3d_ndof_pan_zoom(const struct wmNDOFMotionData *ndof, sub_v3_v3(rv3d->ofs, pan_vec); if (RV3D_LOCK_FLAGS(rv3d) & RV3D_BOXVIEW) { - view3d_boxview_sync(sa, region); + view3d_boxview_sync(area, region); } } } static void view3d_ndof_orbit(const struct wmNDOFMotionData *ndof, - ScrArea *sa, + ScrArea *area, ARegion *region, ViewOpsData *vod, const bool apply_dyn_ofs) { - View3D *v3d = sa->spacedata.first; + View3D *v3d = area->spacedata.first; RegionView3D *rv3d = region->regiondata; float view_inv[4]; @@ -1422,12 +1422,12 @@ static int ndof_orbit_invoke(bContext *C, wmOperator *op, const wmEvent *event) const bool has_zoom = (ndof->tvec[2] != 0.0f) && !rv3d->is_persp; if (has_translate || has_zoom) { - view3d_ndof_pan_zoom(ndof, vod->sa, vod->region, has_translate, has_zoom); + view3d_ndof_pan_zoom(ndof, vod->area, vod->region, has_translate, has_zoom); xform_flag |= HAS_TRANSLATE; } if (has_rotation) { - view3d_ndof_orbit(ndof, vod->sa, vod->region, vod, true); + view3d_ndof_orbit(ndof, vod->area, vod->region, vod, true); xform_flag |= HAS_ROTATE; } } @@ -1505,7 +1505,7 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *ev const bool has_zoom = (ndof->tvec[2] != 0.0f) && ED_view3d_offset_lock_check(v3d, rv3d); if (has_translate || has_zoom) { - view3d_ndof_pan_zoom(ndof, vod->sa, vod->region, has_translate, true); + view3d_ndof_pan_zoom(ndof, vod->area, vod->region, has_translate, true); xform_flag |= HAS_TRANSLATE; } } @@ -1535,7 +1535,7 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *ev if (!is_orbit_around_pivot) { ED_view3d_distance_set(rv3d, 0.0f); } - view3d_ndof_orbit(ndof, vod->sa, vod->region, vod, is_orbit_around_pivot); + view3d_ndof_orbit(ndof, vod->area, vod->region, vod, is_orbit_around_pivot); xform_flag |= HAS_ROTATE; if (!is_orbit_around_pivot) { ED_view3d_distance_set(rv3d, dist_backup); @@ -1543,7 +1543,7 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *ev } if (has_translate || has_zoom) { - view3d_ndof_pan_zoom(ndof, vod->sa, vod->region, has_translate, has_zoom); + view3d_ndof_pan_zoom(ndof, vod->area, vod->region, has_translate, has_zoom); xform_flag |= HAS_TRANSLATE; } } @@ -1607,11 +1607,11 @@ static int ndof_pan_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *e ED_view3d_camera_lock_init_ex(depsgraph, v3d, rv3d, false); if (ndof->progress != P_FINISHING) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); if (has_translate || has_zoom) { - view3d_ndof_pan_zoom(ndof, sa, region, has_translate, has_zoom); + view3d_ndof_pan_zoom(ndof, area, region, has_translate, has_zoom); xform_flag |= HAS_TRANSLATE; } } @@ -1751,7 +1751,7 @@ static void viewmove_apply(ViewOpsData *vod, int x, int y) add_v3_v3(vod->rv3d->ofs, dvec); if (RV3D_LOCK_FLAGS(vod->rv3d) & RV3D_BOXVIEW) { - view3d_boxview_sync(vod->sa, vod->region); + view3d_boxview_sync(vod->area, vod->region); } } @@ -2189,7 +2189,7 @@ static void viewzoom_apply_3d(ViewOpsData *vod, CLAMP(vod->rv3d->dist, dist_range[0], dist_range[1]); if (RV3D_LOCK_FLAGS(vod->rv3d) & RV3D_BOXVIEW) { - view3d_boxview_sync(vod->sa, vod->region); + view3d_boxview_sync(vod->area, vod->region); } ED_view3d_camera_lock_sync(vod->depsgraph, vod->v3d, vod->rv3d); @@ -2280,7 +2280,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); View3D *v3d; RegionView3D *rv3d; - ScrArea *sa; + ScrArea *area; ARegion *region; bool use_cam_zoom; float dist_range[2]; @@ -2291,15 +2291,15 @@ static int viewzoom_exec(bContext *C, wmOperator *op) if (op->customdata) { ViewOpsData *vod = op->customdata; - sa = vod->sa; + area = vod->area; region = vod->region; } else { - sa = CTX_wm_area(C); + area = CTX_wm_area(C); region = CTX_wm_region(C); } - v3d = sa->spacedata.first; + v3d = area->spacedata.first; rv3d = region->regiondata; use_cam_zoom = (rv3d->persp == RV3D_CAMOB) && @@ -2342,7 +2342,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op) } if (RV3D_LOCK_FLAGS(rv3d) & RV3D_BOXVIEW) { - view3d_boxview_sync(sa, region); + view3d_boxview_sync(area, region); } ED_view3d_depth_tag_update(rv3d); @@ -2538,7 +2538,7 @@ static void viewdolly_apply(ViewOpsData *vod, const int xy[2], const short zoom_ } if (RV3D_LOCK_FLAGS(vod->rv3d) & RV3D_BOXVIEW) { - view3d_boxview_sync(vod->sa, vod->region); + view3d_boxview_sync(vod->area, vod->region); } ED_view3d_camera_lock_sync(vod->depsgraph, vod->v3d, vod->rv3d); @@ -2603,7 +2603,7 @@ static int viewdolly_exec(bContext *C, wmOperator *op) { View3D *v3d; RegionView3D *rv3d; - ScrArea *sa; + ScrArea *area; ARegion *region; float mousevec[3]; @@ -2612,18 +2612,18 @@ static int viewdolly_exec(bContext *C, wmOperator *op) if (op->customdata) { ViewOpsData *vod = op->customdata; - sa = vod->sa; + area = vod->area; region = vod->region; copy_v3_v3(mousevec, vod->init.mousevec); } else { - sa = CTX_wm_area(C); + area = CTX_wm_area(C); region = CTX_wm_region(C); negate_v3_v3(mousevec, ((RegionView3D *)region->regiondata)->viewinv[2]); normalize_v3(mousevec); } - v3d = sa->spacedata.first; + v3d = area->spacedata.first; rv3d = region->regiondata; const bool use_cursor_init = RNA_boolean_get(op->ptr, "use_cursor_init"); @@ -2636,7 +2636,7 @@ static int viewdolly_exec(bContext *C, wmOperator *op) view_dolly_to_vector_3d(region, rv3d->ofs, mousevec, delta < 0 ? 0.2f : 1.8f); if (RV3D_LOCK_FLAGS(rv3d) & RV3D_BOXVIEW) { - view3d_boxview_sync(sa, region); + view3d_boxview_sync(area, region); } ED_view3d_depth_tag_update(rv3d); @@ -2886,9 +2886,9 @@ static void view3d_from_minmax_multi(bContext *C, const bool ok_dist, const int smooth_viewtx) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region; - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3d = region->regiondata; /* when using all regions, don't jump out of camera view, @@ -4376,7 +4376,7 @@ static void viewroll_apply(ViewOpsData *vod, int x, int UNUSED(y)) } if (RV3D_LOCK_FLAGS(vod->rv3d) & RV3D_BOXVIEW) { - view3d_boxview_sync(vod->sa, vod->region); + view3d_boxview_sync(vod->area, vod->region); } ED_view3d_camera_lock_sync(vod->depsgraph, vod->v3d, vod->rv3d); @@ -5279,7 +5279,7 @@ static int toggle_shading_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); View3D *v3d = CTX_wm_view3d(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); int type = RNA_enum_get(op->ptr, "type"); if (type == OB_SOLID) { @@ -5307,7 +5307,7 @@ static int toggle_shading_exec(bContext *C, wmOperator *op) } } - ED_view3d_shade_update(bmain, v3d, sa); + ED_view3d_shade_update(bmain, v3d, area); WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d); return OPERATOR_FINISHED; @@ -5340,7 +5340,7 @@ void VIEW3D_OT_toggle_shading(wmOperatorType *ot) static int toggle_xray_exec(bContext *C, wmOperator *op) { View3D *v3d = CTX_wm_view3d(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); Object *obact = CTX_data_active_object(C); if (obact && ((obact->mode & OB_MODE_POSE) || @@ -5362,7 +5362,7 @@ static int toggle_xray_exec(bContext *C, wmOperator *op) } } - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c index 4b194d6687d..e4863c0cdeb 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c @@ -110,7 +110,7 @@ typedef struct RulerInfo { /* wm state */ wmWindow *win; - ScrArea *sa; + ScrArea *area; ARegion *region; /* re-assigned every modal update */ /* Track changes in state. */ @@ -299,7 +299,7 @@ static void ruler_state_set(bContext *C, RulerInfo *ruler_info, int state) static void view3d_ruler_item_project(RulerInfo *ruler_info, float r_co[3], const int xy[2]) { - ED_view3d_win_to_3d_int(ruler_info->sa->spacedata.first, ruler_info->region, r_co, xy, r_co); + ED_view3d_win_to_3d_int(ruler_info->area->spacedata.first, ruler_info->region, r_co, xy, r_co); } /* use for mousemove events */ @@ -323,7 +323,7 @@ static bool view3d_ruler_item_mousemove(struct Depsgraph *depsgraph, view3d_ruler_item_project(ruler_info, co, mval); if (do_thickness && inter->co_index != 1) { // Scene *scene = CTX_data_scene(C); - // View3D *v3d = ruler_info->sa->spacedata.first; + // View3D *v3d = ruler_info->area->spacedata.first; const float mval_fl[2] = {UNPACK2(mval)}; float ray_normal[3]; float ray_start[3]; @@ -1064,10 +1064,10 @@ static void WIDGETGROUP_ruler_setup(const bContext *C, wmGizmoGroup *gzgroup) } wmWindow *win = CTX_wm_window(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); ruler_info->win = win; - ruler_info->sa = sa; + ruler_info->area = area; ruler_info->region = region; gzgroup->customdata = ruler_info; diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 57989680705..be0084d8869 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -105,7 +105,7 @@ static void do_view3d_header_buttons(bContext *C, void *UNUSED(arg), int event) wmWindow *win = CTX_wm_window(C); const int ctrl = win->eventstate->ctrl, shift = win->eventstate->shift; - /* watch it: if sa->win does not exist, check that when calling direct drawing routines */ + /* watch it: if area->win does not exist, check that when calling direct drawing routines */ switch (event) { case B_SEL_VERT: diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 610c40c37eb..c16131c8317 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -91,8 +91,8 @@ void VIEW3D_OT_zoom_border(struct wmOperatorType *ot); void VIEW3D_OT_toggle_shading(struct wmOperatorType *ot); void VIEW3D_OT_toggle_xray(struct wmOperatorType *ot); -void view3d_boxview_copy(struct ScrArea *sa, struct ARegion *region); -void view3d_boxview_sync(struct ScrArea *sa, struct ARegion *region); +void view3d_boxview_copy(struct ScrArea *area, struct ARegion *region); +void view3d_boxview_sync(struct ScrArea *area, struct ARegion *region); void view3d_orbit_apply_dyn_ofs(float r_ofs[3], const float ofs_old[3], @@ -181,7 +181,7 @@ typedef struct V3D_SmoothParams { void ED_view3d_smooth_view_ex(const struct Depsgraph *depsgraph, struct wmWindowManager *wm, struct wmWindow *win, - struct ScrArea *sa, + struct ScrArea *area, struct View3D *v3d, struct ARegion *region, const int smooth_viewtx, diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index b8dbd277fbc..cd7db2ff23a 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1226,7 +1226,7 @@ static bool do_lasso_select_paintface(ViewContext *vc, #if 0 static void do_lasso_select_node(int mcords[][2], short moves, const eSelectOp sel_op) { - SpaceNode *snode = sa->spacedata.first; + SpaceNode *snode = area->spacedata.first; bNode *node; rcti rect; diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c index 5db26e26f0b..acbd4b85ece 100644 --- a/source/blender/editors/space_view3d/view3d_utils.c +++ b/source/blender/editors/space_view3d/view3d_utils.c @@ -229,25 +229,25 @@ void ED_view3d_polygon_offset(const RegionView3D *rv3d, const float dist) bool ED_view3d_context_activate(bContext *C) { bScreen *sc = CTX_wm_screen(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region; - /* sa can be NULL when called from python */ - if (sa == NULL || sa->spacetype != SPACE_VIEW3D) { - sa = BKE_screen_find_big_area(sc, SPACE_VIEW3D, 0); + /* area can be NULL when called from python */ + if (area == NULL || area->spacetype != SPACE_VIEW3D) { + area = BKE_screen_find_big_area(sc, SPACE_VIEW3D, 0); } - if (sa == NULL) { + if (area == NULL) { return false; } - region = BKE_area_find_region_active_win(sa); + region = BKE_area_find_region_active_win(area); if (region == NULL) { return false; } /* bad context switch .. */ - CTX_wm_area_set(C, sa); + CTX_wm_area_set(C, area); CTX_wm_region_set(C, region); return true; @@ -666,7 +666,7 @@ bool ED_view3d_camera_lock_autokey(View3D *v3d, * Use with quad-split so each view is clipped by the bounds of each view axis. * \{ */ -static void view3d_boxview_clip(ScrArea *sa) +static void view3d_boxview_clip(ScrArea *area) { ARegion *region; BoundBox *bb = MEM_callocN(sizeof(BoundBox), "clipbb"); @@ -675,7 +675,7 @@ static void view3d_boxview_clip(ScrArea *sa) int val; /* create bounding box */ - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3d = region->regiondata; @@ -747,7 +747,7 @@ static void view3d_boxview_clip(ScrArea *sa) } /* create bounding box */ - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3d = region->regiondata; @@ -812,13 +812,13 @@ static void view3d_boxview_sync_axis(RegionView3D *rv3d_dst, RegionView3D *rv3d_ } /* sync center/zoom view of region to others, for view transforms */ -void view3d_boxview_sync(ScrArea *sa, ARegion *region) +void view3d_boxview_sync(ScrArea *area, ARegion *region) { ARegion *artest; RegionView3D *rv3d = region->regiondata; short clip = 0; - for (artest = sa->regionbase.first; artest; artest = artest->next) { + for (artest = area->regionbase.first; artest; artest = artest->next) { if (artest != region && artest->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3dtest = artest->regiondata; @@ -833,18 +833,18 @@ void view3d_boxview_sync(ScrArea *sa, ARegion *region) } if (clip) { - view3d_boxview_clip(sa); + view3d_boxview_clip(area); } } /* for home, center etc */ -void view3d_boxview_copy(ScrArea *sa, ARegion *region) +void view3d_boxview_copy(ScrArea *area, ARegion *region) { ARegion *artest; RegionView3D *rv3d = region->regiondata; bool clip = false; - for (artest = sa->regionbase.first; artest; artest = artest->next) { + for (artest = area->regionbase.first; artest; artest = artest->next) { if (artest != region && artest->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3dtest = artest->regiondata; @@ -859,12 +859,12 @@ void view3d_boxview_copy(ScrArea *sa, ARegion *region) } if (clip) { - view3d_boxview_clip(sa); + view3d_boxview_clip(area); } } /* 'clip' is used to know if our clip setting has changed */ -void ED_view3d_quadview_update(ScrArea *sa, ARegion *region, bool do_clip) +void ED_view3d_quadview_update(ScrArea *area, ARegion *region, bool do_clip) { ARegion *region_sync = NULL; RegionView3D *rv3d = region->regiondata; @@ -900,13 +900,13 @@ void ED_view3d_quadview_update(ScrArea *sa, ARegion *region, bool do_clip) } if (RV3D_LOCK_FLAGS(rv3d) & RV3D_BOXVIEW) { - view3d_boxview_sync(sa, region_sync ? region_sync : sa->regionbase.last); + view3d_boxview_sync(area, region_sync ? region_sync : area->regionbase.last); } /* ensure locked regions have an axis, locked user views don't make much sense */ if (viewlock & RV3D_LOCK_ROTATION) { int index_qsplit = 0; - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region->alignment == RGN_ALIGN_QSPLIT) { rv3d = region->regiondata; if (rv3d->viewlock) { @@ -922,7 +922,7 @@ void ED_view3d_quadview_update(ScrArea *sa, ARegion *region, bool do_clip) } } - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); } /** \} */ diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 3dc5b3025aa..71a4c2e0780 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -128,7 +128,7 @@ void ED_view3d_smooth_view_ex( const Depsgraph *depsgraph, wmWindowManager *wm, wmWindow *win, - ScrArea *sa, + ScrArea *area, View3D *v3d, ARegion *region, const int smooth_viewtx, @@ -293,7 +293,7 @@ void ED_view3d_smooth_view_ex( } if (RV3D_LOCK_FLAGS(rv3d) & RV3D_BOXVIEW) { - view3d_boxview_copy(sa, region); + view3d_boxview_copy(area, region); } ED_region_tag_redraw(region); @@ -309,9 +309,9 @@ void ED_view3d_smooth_view(bContext *C, const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); wmWindowManager *wm = CTX_wm_manager(C); wmWindow *win = CTX_wm_window(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); - ED_view3d_smooth_view_ex(depsgraph, wm, win, sa, v3d, region, smooth_viewtx, sview); + ED_view3d_smooth_view_ex(depsgraph, wm, win, area, v3d, region, smooth_viewtx, sview); } /* only meant for timer usage */ @@ -1200,7 +1200,7 @@ finally: static uint free_localview_bit(Main *bmain) { - ScrArea *sa; + ScrArea *area; bScreen *sc; ushort local_view_bits = 0; @@ -1208,8 +1208,8 @@ static uint free_localview_bit(Main *bmain) /* sometimes we loose a localview: when an area is closed */ /* check all areas: which localviews are in use? */ for (sc = bmain->screens.first; sc; sc = sc->id.next) { - for (sa = sc->areabase.first; sa; sa = sa->next) { - SpaceLink *sl = sa->spacedata.first; + for (area = sc->areabase.first; area; area = area->next) { + SpaceLink *sl = area->spacedata.first; for (; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { View3D *v3d = (View3D *)sl; @@ -1235,12 +1235,12 @@ static bool view3d_localview_init(const Depsgraph *depsgraph, wmWindow *win, Main *bmain, ViewLayer *view_layer, - ScrArea *sa, + ScrArea *area, const bool frame_selected, const int smooth_viewtx, ReportList *reports) { - View3D *v3d = sa->spacedata.first; + View3D *v3d = area->spacedata.first; Base *base; float min[3], max[3], box[3]; float size = 0.0f; @@ -1302,7 +1302,7 @@ static bool view3d_localview_init(const Depsgraph *depsgraph, memcpy(v3d->localvd, v3d, sizeof(View3D)); v3d->local_view_uuid = local_view_bit; - for (region = sa->regionbase.first; region; region = region->next) { + for (region = area->regionbase.first; region; region = region->next) { if (region->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3d = region->regiondata; bool ok_dist = true; @@ -1343,7 +1343,7 @@ static bool view3d_localview_init(const Depsgraph *depsgraph, ED_view3d_smooth_view_ex(depsgraph, wm, win, - sa, + area, v3d, region, smooth_viewtx, @@ -1365,11 +1365,11 @@ static void view3d_localview_exit(const Depsgraph *depsgraph, wmWindowManager *wm, wmWindow *win, ViewLayer *view_layer, - ScrArea *sa, + ScrArea *area, const bool frame_selected, const int smooth_viewtx) { - View3D *v3d = sa->spacedata.first; + View3D *v3d = area->spacedata.first; if (v3d->localvd == NULL) { return; @@ -1390,7 +1390,7 @@ static void view3d_localview_exit(const Depsgraph *depsgraph, MEM_freeN(v3d->localvd); v3d->localvd = NULL; - for (ARegion *region = sa->regionbase.first; region; region = region->next) { + for (ARegion *region = area->regionbase.first; region; region = region->next) { if (region->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3d = region->regiondata; @@ -1411,7 +1411,7 @@ static void view3d_localview_exit(const Depsgraph *depsgraph, ED_view3d_smooth_view_ex(depsgraph, wm, win, - sa, + area, v3d, region, smooth_viewtx, @@ -1439,23 +1439,23 @@ static int localview_exec(bContext *C, wmOperator *op) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); View3D *v3d = CTX_wm_view3d(C); bool frame_selected = RNA_boolean_get(op->ptr, "frame_selected"); bool changed; if (v3d->localvd) { - view3d_localview_exit(depsgraph, wm, win, view_layer, sa, frame_selected, smooth_viewtx); + view3d_localview_exit(depsgraph, wm, win, view_layer, area, frame_selected, smooth_viewtx); changed = true; } else { changed = view3d_localview_init( - depsgraph, wm, win, bmain, view_layer, sa, frame_selected, smooth_viewtx, op->reports); + depsgraph, wm, win, bmain, view_layer, area, frame_selected, smooth_viewtx, op->reports); } if (changed) { DEG_id_type_tag(bmain, ID_OB); - ED_area_tag_redraw(sa); + ED_area_tag_redraw(area); /* Unselected objects become selected when exiting. */ if (v3d->localvd == NULL) { @@ -1558,15 +1558,15 @@ void VIEW3D_OT_localview_remove_from(wmOperatorType *ot) static uint free_localcollection_bit(Main *bmain, ushort local_collections_uuid, bool *r_reset) { - ScrArea *sa; + ScrArea *area; bScreen *sc; ushort local_view_bits = 0; /* Check all areas: which localviews are in use? */ for (sc = bmain->screens.first; sc; sc = sc->id.next) { - for (sa = sc->areabase.first; sa; sa = sa->next) { - SpaceLink *sl = sa->spacedata.first; + for (area = sc->areabase.first; area; area = area->next) { + SpaceLink *sl = area->spacedata.first; for (; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { View3D *v3d = (View3D *)sl; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 965df86acc0..c48c86bd423 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -110,7 +110,7 @@ void setTransformViewAspect(TransInfo *t, float r_aspect[3]) copy_v3_fl(r_aspect, 1.0f); if (t->spacetype == SPACE_IMAGE) { - SpaceImage *sima = t->sa->spacedata.first; + SpaceImage *sima = t->area->spacedata.first; if (t->options & CTX_MASK) { ED_space_image_get_aspect(sima, &r_aspect[0], &r_aspect[1]); @@ -123,7 +123,7 @@ void setTransformViewAspect(TransInfo *t, float r_aspect[3]) } } else if (t->spacetype == SPACE_CLIP) { - SpaceClip *sclip = t->sa->spacedata.first; + SpaceClip *sclip = t->area->spacedata.first; if (t->options & CTX_MOVIECLIP) { ED_space_clip_get_aspect_dimension_aware(sclip, &r_aspect[0], &r_aspect[1]); @@ -234,7 +234,7 @@ void projectIntViewEx(TransInfo *t, const float vec[3], int adr[2], const eV3DPr } } else if (t->spacetype == SPACE_IMAGE) { - SpaceImage *sima = t->sa->spacedata.first; + SpaceImage *sima = t->area->spacedata.first; if (t->options & CTX_MASK) { float v[2]; @@ -265,7 +265,7 @@ void projectIntViewEx(TransInfo *t, const float vec[3], int adr[2], const eV3DPr else if (t->spacetype == SPACE_ACTION) { int out[2] = {0, 0}; #if 0 - SpaceAction *sact = t->sa->spacedata.first; + SpaceAction *sact = t->area->spacedata.first; if (sact->flag & SACTION_DRAWTIME) { //vec[0] = vec[0]/((t->scene->r.frs_sec / t->scene->r.frs_sec_base)); @@ -296,7 +296,7 @@ void projectIntViewEx(TransInfo *t, const float vec[3], int adr[2], const eV3DPr adr[1] = out[1]; } else if (t->spacetype == SPACE_CLIP) { - SpaceClip *sc = t->sa->spacedata.first; + SpaceClip *sc = t->area->spacedata.first; if (t->options & CTX_MASK) { MovieClip *clip = ED_space_clip_get_clip(sc); @@ -377,7 +377,7 @@ void applyAspectRatio(TransInfo *t, float vec[2]) { if ((t->spacetype == SPACE_IMAGE) && (t->mode == TFM_TRANSLATION) && !(t->options & CTX_PAINT_CURVE)) { - SpaceImage *sima = t->sa->spacedata.first; + SpaceImage *sima = t->area->spacedata.first; if ((sima->flag & SI_COORDFLOATS) == 0) { int width, height; @@ -401,7 +401,7 @@ void applyAspectRatio(TransInfo *t, float vec[2]) void removeAspectRatio(TransInfo *t, float vec[2]) { if ((t->spacetype == SPACE_IMAGE) && (t->mode == TFM_TRANSLATION)) { - SpaceImage *sima = t->sa->spacedata.first; + SpaceImage *sima = t->area->spacedata.first; if ((sima->flag & SI_COORDFLOATS) == 0) { int width, height; @@ -453,18 +453,18 @@ static void viewRedrawForce(const bContext *C, TransInfo *t) } } else if (t->spacetype == SPACE_ACTION) { - // SpaceAction *saction = (SpaceAction *)t->sa->spacedata.first; + // SpaceAction *saction = (SpaceAction *)t->area->spacedata.first; WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); } else if (t->spacetype == SPACE_GRAPH) { - // SpaceGraph *sipo = (SpaceGraph *)t->sa->spacedata.first; + // SpaceGraph *sipo = (SpaceGraph *)t->area->spacedata.first; WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); } else if (t->spacetype == SPACE_NLA) { WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); } else if (t->spacetype == SPACE_NODE) { - // ED_area_tag_redraw(t->sa); + // ED_area_tag_redraw(t->area); WM_event_add_notifier(C, NC_SPACE | ND_SPACE_NODE_VIEW, NULL); } else if (t->spacetype == SPACE_SEQ) { @@ -483,21 +483,21 @@ static void viewRedrawForce(const bContext *C, TransInfo *t) WM_paint_cursor_tag_redraw(window, t->region); } else if (t->flag & T_CURSOR) { - ED_area_tag_redraw(t->sa); + ED_area_tag_redraw(t->area); } else { // XXX how to deal with lock? - SpaceImage *sima = (SpaceImage *)t->sa->spacedata.first; + SpaceImage *sima = (SpaceImage *)t->area->spacedata.first; if (sima->lock) { WM_event_add_notifier(C, NC_GEOM | ND_DATA, OBEDIT_FROM_VIEW_LAYER(t->view_layer)->data); } else { - ED_area_tag_redraw(t->sa); + ED_area_tag_redraw(t->area); } } } else if (t->spacetype == SPACE_CLIP) { - SpaceClip *sc = (SpaceClip *)t->sa->spacedata.first; + SpaceClip *sc = (SpaceClip *)t->area->spacedata.first; if (ED_space_clip_check_show_trackedit(sc)) { MovieClip *clip = ED_space_clip_get_clip(sc); @@ -517,7 +517,7 @@ static void viewRedrawForce(const bContext *C, TransInfo *t) static void viewRedrawPost(bContext *C, TransInfo *t) { - ED_area_status_text(t->sa, NULL); + ED_area_status_text(t->area, NULL); if (t->spacetype == SPACE_VIEW3D) { /* if autokeying is enabled, send notifiers that keyframes were added */ @@ -1160,9 +1160,9 @@ int transformEvent(TransInfo *t, const wmEvent *event) break; case TFM_MODAL_INSERTOFS_TOGGLE_DIR: if (t->spacetype == SPACE_NODE) { - SpaceNode *snode = (SpaceNode *)t->sa->spacedata.first; + SpaceNode *snode = (SpaceNode *)t->area->spacedata.first; - BLI_assert(t->sa->spacetype == t->spacetype); + BLI_assert(t->area->spacetype == t->spacetype); if (snode->insert_ofs_dir == SNODE_INSERTOFS_DIR_RIGHT) { snode->insert_ofs_dir = SNODE_INSERTOFS_DIR_LEFT; @@ -1521,9 +1521,9 @@ static bool transinfo_show_overlay(const struct bContext *C, TransInfo *t, ARegi ok = true; } else { - ScrArea *sa = CTX_wm_area(C); - if (sa->spacetype == SPACE_VIEW3D) { - View3D *v3d = sa->spacedata.first; + ScrArea *area = CTX_wm_area(C); + if (area->spacetype == SPACE_VIEW3D) { + View3D *v3d = area->spacedata.first; if ((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) { ok = true; } @@ -1870,7 +1870,7 @@ static void initSnapSpatial(TransInfo *t, float r_snap[3]) RegionView3D *rv3d = t->region->regiondata; if (rv3d) { - View3D *v3d = t->sa->spacedata.first; + View3D *v3d = t->area->spacedata.first; r_snap[0] = 0.0f; r_snap[1] = ED_view3d_grid_view_scale(t->scene, v3d, rv3d, NULL) * 1.0f; r_snap[2] = r_snap[1] * 0.1f; diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index a2c8caba0f5..9e225b842f1 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -581,7 +581,7 @@ typedef struct TransInfo { void *view; /** Only valid (non null) during an operator called function. */ struct bContext *context; - struct ScrArea *sa; + struct ScrArea *area; struct ARegion *region; struct Depsgraph *depsgraph; struct Scene *scene; diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 4b6932d977d..cdff9fdf750 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -171,7 +171,7 @@ static void postConstraintChecks(TransInfo *t, float vec[3], float pvec[3]) static void viewAxisCorrectCenter(const TransInfo *t, float t_con_center[3]) { if (t->spacetype == SPACE_VIEW3D) { - // View3D *v3d = t->sa->spacedata.first; + // View3D *v3d = t->area->spacedata.first; const float min_dist = 1.0f; /* v3d->clip_start; */ float dir[3]; float l; diff --git a/source/blender/editors/transform/transform_convert.c b/source/blender/editors/transform/transform_convert.c index 665a279bdbe..af3cba65dda 100644 --- a/source/blender/editors/transform/transform_convert.c +++ b/source/blender/editors/transform/transform_convert.c @@ -1309,7 +1309,7 @@ static void beztmap_to_data(TransInfo *t, FCurve *fcu, BeztMap *bezms, int totve */ void remake_graph_transdata(TransInfo *t, ListBase *anim_data) { - SpaceGraph *sipo = (SpaceGraph *)t->sa->spacedata.first; + SpaceGraph *sipo = (SpaceGraph *)t->area->spacedata.first; bAnimListElem *ale; const bool use_handle = (sipo->flag & SIPO_NOHANDLES) == 0; @@ -1749,7 +1749,7 @@ bool motionpath_need_update_pose(Scene *scene, Object *ob) static void special_aftertrans_update__movieclip(bContext *C, TransInfo *t) { - SpaceClip *sc = t->sa->spacedata.first; + SpaceClip *sc = t->area->spacedata.first; MovieClip *clip = ED_space_clip_get_clip(sc); ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(&clip->tracking); const int framenr = ED_space_clip_get_clip_frame_number(sc); @@ -1791,11 +1791,11 @@ static void special_aftertrans_update__mask(bContext *C, TransInfo *t) Mask *mask = NULL; if (t->spacetype == SPACE_CLIP) { - SpaceClip *sc = t->sa->spacedata.first; + SpaceClip *sc = t->area->spacedata.first; mask = ED_space_clip_get_mask(sc); } else if (t->spacetype == SPACE_IMAGE) { - SpaceImage *sima = t->sa->spacedata.first; + SpaceImage *sima = t->area->spacedata.first; mask = ED_space_image_get_mask(sima); } else { @@ -1826,7 +1826,7 @@ static void special_aftertrans_update__node(bContext *C, TransInfo *t) if (canceled && t->remove_on_cancel) { /* remove selected nodes on cancel */ - SpaceNode *snode = (SpaceNode *)t->sa->spacedata.first; + SpaceNode *snode = (SpaceNode *)t->area->spacedata.first; bNodeTree *ntree = snode->edittree; if (ntree) { bNode *node, *node_next; @@ -1949,7 +1949,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) /* freeSeqData in transform_conversions.c does this * keep here so the else at the end wont run... */ - SpaceSeq *sseq = (SpaceSeq *)t->sa->spacedata.first; + SpaceSeq *sseq = (SpaceSeq *)t->area->spacedata.first; /* Marker transform, not especially nice but we may want to move markers * at the same time as strips in the Video Sequencer. */ @@ -1975,16 +1975,16 @@ void special_aftertrans_update(bContext *C, TransInfo *t) } } else if (t->spacetype == SPACE_NODE) { - SpaceNode *snode = (SpaceNode *)t->sa->spacedata.first; + SpaceNode *snode = (SpaceNode *)t->area->spacedata.first; special_aftertrans_update__node(C, t); if (canceled == 0) { ED_node_post_apply_transform(C, snode->edittree); - ED_node_link_insert(bmain, t->sa); + ED_node_link_insert(bmain, t->area); } /* clear link line */ - ED_node_link_intersect_test(t->sa, 0); + ED_node_link_intersect_test(t->area, 0); } else if (t->spacetype == SPACE_CLIP) { if (t->options & CTX_MOVIECLIP) { @@ -1995,7 +1995,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) } } else if (t->spacetype == SPACE_ACTION) { - SpaceAction *saction = (SpaceAction *)t->sa->spacedata.first; + SpaceAction *saction = (SpaceAction *)t->area->spacedata.first; bAnimContext ac; /* initialize relevant anim-context 'context' data */ @@ -2159,7 +2159,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) saction->flag &= ~SACTION_MOVING; } else if (t->spacetype == SPACE_GRAPH) { - SpaceGraph *sipo = (SpaceGraph *)t->sa->spacedata.first; + SpaceGraph *sipo = (SpaceGraph *)t->area->spacedata.first; bAnimContext ac; const bool use_handle = (sipo->flag & SIPO_NOHANDLES) == 0; diff --git a/source/blender/editors/transform/transform_convert_cursor.c b/source/blender/editors/transform/transform_convert_cursor.c index 621f9dd63e2..e6a972bfc7c 100644 --- a/source/blender/editors/transform/transform_convert_cursor.c +++ b/source/blender/editors/transform/transform_convert_cursor.c @@ -44,7 +44,7 @@ void createTransCursor_image(TransInfo *t) { TransData *td; - SpaceImage *sima = t->sa->spacedata.first; + SpaceImage *sima = t->area->spacedata.first; float *cursor_location = sima->cursor; { diff --git a/source/blender/editors/transform/transform_convert_graph.c b/source/blender/editors/transform/transform_convert_graph.c index 95a385a5a50..5c2391d8dd0 100644 --- a/source/blender/editors/transform/transform_convert_graph.c +++ b/source/blender/editors/transform/transform_convert_graph.c @@ -167,7 +167,7 @@ static void graph_bezt_get_transform_selection(const TransInfo *t, bool *r_key, bool *r_right_handle) { - SpaceGraph *sipo = (SpaceGraph *)t->sa->spacedata.first; + SpaceGraph *sipo = (SpaceGraph *)t->area->spacedata.first; bool key = (bezt->f2 & SELECT) != 0; bool left = use_handle ? ((bezt->f1 & SELECT) != 0) : key; bool right = use_handle ? ((bezt->f3 & SELECT) != 0) : key; @@ -224,7 +224,7 @@ static void graph_key_shortest_dist( */ void createTransGraphEditData(bContext *C, TransInfo *t) { - SpaceGraph *sipo = (SpaceGraph *)t->sa->spacedata.first; + SpaceGraph *sipo = (SpaceGraph *)t->area->spacedata.first; Scene *scene = t->scene; ARegion *region = t->region; View2D *v2d = ®ion->v2d; @@ -642,7 +642,7 @@ void createTransGraphEditData(bContext *C, TransInfo *t) */ void flushTransGraphData(TransInfo *t) { - SpaceGraph *sipo = (SpaceGraph *)t->sa->spacedata.first; + SpaceGraph *sipo = (SpaceGraph *)t->area->spacedata.first; TransData *td; TransData2D *td2d; TransDataGraph *tdg; diff --git a/source/blender/editors/transform/transform_convert_mask.c b/source/blender/editors/transform/transform_convert_mask.c index 65244a09b73..6c743da3e65 100644 --- a/source/blender/editors/transform/transform_convert_mask.c +++ b/source/blender/editors/transform/transform_convert_mask.c @@ -280,7 +280,7 @@ void createTransMaskingData(bContext *C, TransInfo *t) } if (t->spacetype == SPACE_CLIP) { - SpaceClip *sc = t->sa->spacedata.first; + SpaceClip *sc = t->area->spacedata.first; MovieClip *clip = ED_space_clip_get_clip(sc); if (!clip) { return; @@ -333,7 +333,7 @@ void createTransMaskingData(bContext *C, TransInfo *t) return; } - ED_mask_get_aspect(t->sa, t->region, &asp[0], &asp[1]); + ED_mask_get_aspect(t->area, t->region, &asp[0], &asp[1]); tc->data_len = (is_prop_edit) ? count : countsel; td = tc->data = MEM_callocN(tc->data_len * sizeof(TransData), "TransObData(Mask Editing)"); @@ -409,7 +409,7 @@ void flushTransMasking(TransInfo *t) TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); - ED_mask_get_aspect(t->sa, t->region, &asp[0], &asp[1]); + ED_mask_get_aspect(t->area, t->region, &asp[0], &asp[1]); inv[0] = 1.0f / asp[0]; inv[1] = 1.0f / asp[1]; diff --git a/source/blender/editors/transform/transform_convert_mesh.c b/source/blender/editors/transform/transform_convert_mesh.c index 29a74be8e2b..22bba9544cd 100644 --- a/source/blender/editors/transform/transform_convert_mesh.c +++ b/source/blender/editors/transform/transform_convert_mesh.c @@ -1608,7 +1608,7 @@ void createTransUVs(bContext *C, TransInfo *t) void flushTransUVs(TransInfo *t) { - SpaceImage *sima = t->sa->spacedata.first; + SpaceImage *sima = t->area->spacedata.first; const bool use_pixel_snap = ((sima->pixel_snap_mode != SI_PIXEL_SNAP_DISABLED) && (t->state != TRANS_CANCEL)); diff --git a/source/blender/editors/transform/transform_convert_node.c b/source/blender/editors/transform/transform_convert_node.c index ee4aa053444..d783bfdf40e 100644 --- a/source/blender/editors/transform/transform_convert_node.c +++ b/source/blender/editors/transform/transform_convert_node.c @@ -109,7 +109,7 @@ void createTransNodeData(bContext *UNUSED(C), TransInfo *t) const float dpi_fac = UI_DPI_FAC; TransData *td; TransData2D *td2d; - SpaceNode *snode = t->sa->spacedata.first; + SpaceNode *snode = t->area->spacedata.first; bNode *node; TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); @@ -188,7 +188,7 @@ void flushTransNodes(TransInfo *t) /* handle intersection with noodles */ if (tc->data_len == 1) { - ED_node_link_intersect_test(t->sa, 1); + ED_node_link_intersect_test(t->area, 1); } } } diff --git a/source/blender/editors/transform/transform_convert_sequencer.c b/source/blender/editors/transform/transform_convert_sequencer.c index f2d0f4dfc43..a722f17db22 100644 --- a/source/blender/editors/transform/transform_convert_sequencer.c +++ b/source/blender/editors/transform/transform_convert_sequencer.c @@ -379,7 +379,7 @@ static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *c } if (overlap) { - const bool use_sync_markers = (((SpaceSeq *)t->sa->spacedata.first)->flag & + const bool use_sync_markers = (((SpaceSeq *)t->area->spacedata.first)->flag & SEQ_MARKER_TRANS) != 0; ListBase *markers = &t->scene->markers; diff --git a/source/blender/editors/transform/transform_convert_tracking.c b/source/blender/editors/transform/transform_convert_tracking.c index a8bde661342..6704567a76b 100644 --- a/source/blender/editors/transform/transform_convert_tracking.c +++ b/source/blender/editors/transform/transform_convert_tracking.c @@ -549,7 +549,7 @@ void createTransTrackingData(bContext *C, TransInfo *t) void cancelTransTracking(TransInfo *t) { TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); - SpaceClip *sc = t->sa->spacedata.first; + SpaceClip *sc = t->area->spacedata.first; int i, framenr = ED_space_clip_get_clip_frame_number(sc); TransDataTracking *tdt_array = tc->custom.type.data; diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 11b4600466c..6306e388f3f 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -356,7 +356,7 @@ static bool fcu_test_selected(FCurve *fcu) static void recalcData_actedit(TransInfo *t) { ViewLayer *view_layer = t->view_layer; - SpaceAction *saction = (SpaceAction *)t->sa->spacedata.first; + SpaceAction *saction = (SpaceAction *)t->area->spacedata.first; bAnimContext ac = {NULL}; ListBase anim_data = {NULL, NULL}; @@ -369,10 +369,10 @@ static void recalcData_actedit(TransInfo *t) ac.scene = t->scene; ac.view_layer = t->view_layer; ac.obact = OBACT(view_layer); - ac.sa = t->sa; + ac.area = t->area; ac.region = t->region; - ac.sl = (t->sa) ? t->sa->spacedata.first : NULL; - ac.spacetype = (t->sa) ? t->sa->spacetype : 0; + ac.sl = (t->area) ? t->area->spacedata.first : NULL; + ac.spacetype = (t->area) ? t->area->spacetype : 0; ac.regiontype = (t->region) ? t->region->regiontype : 0; ANIM_animdata_context_getdata(&ac); @@ -406,7 +406,7 @@ static void recalcData_actedit(TransInfo *t) /* helper for recalcData() - for Graph Editor transforms */ static void recalcData_graphedit(TransInfo *t) { - SpaceGraph *sipo = (SpaceGraph *)t->sa->spacedata.first; + SpaceGraph *sipo = (SpaceGraph *)t->area->spacedata.first; ViewLayer *view_layer = t->view_layer; ListBase anim_data = {NULL, NULL}; @@ -422,10 +422,10 @@ static void recalcData_graphedit(TransInfo *t) ac.scene = t->scene; ac.view_layer = t->view_layer; ac.obact = OBACT(view_layer); - ac.sa = t->sa; + ac.area = t->area; ac.region = t->region; - ac.sl = (t->sa) ? t->sa->spacedata.first : NULL; - ac.spacetype = (t->sa) ? t->sa->spacetype : 0; + ac.sl = (t->area) ? t->area->spacedata.first : NULL; + ac.spacetype = (t->area) ? t->area->spacetype : 0; ac.regiontype = (t->region) ? t->region->regiontype : 0; ANIM_animdata_context_getdata(&ac); @@ -474,7 +474,7 @@ static void recalcData_graphedit(TransInfo *t) /* helper for recalcData() - for NLA Editor transforms */ static void recalcData_nla(TransInfo *t) { - SpaceNla *snla = (SpaceNla *)t->sa->spacedata.first; + SpaceNla *snla = (SpaceNla *)t->area->spacedata.first; Scene *scene = t->scene; double secf = FPS; int i; @@ -718,7 +718,7 @@ static void recalcData_image(TransInfo *t) flushTransPaintCurve(t); } else if ((t->flag & T_EDIT) && t->obedit_type == OB_MESH) { - SpaceImage *sima = t->sa->spacedata.first; + SpaceImage *sima = t->area->spacedata.first; flushTransUVs(t); if (sima->flag & SI_LIVE_UNWRAP) { @@ -736,7 +736,7 @@ static void recalcData_image(TransInfo *t) /* helper for recalcData() - for Movie Clip transforms */ static void recalcData_spaceclip(TransInfo *t) { - SpaceClip *sc = t->sa->spacedata.first; + SpaceClip *sc = t->area->spacedata.first; if (ED_space_clip_check_show_trackedit(sc)) { MovieClip *clip = ED_space_clip_get_clip(sc); @@ -1375,7 +1375,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve const eObjectMode object_mode = obact ? obact->mode : OB_MODE_OBJECT; ToolSettings *ts = CTX_data_tool_settings(C); ARegion *region = CTX_wm_region(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); bGPdata *gpd = CTX_data_gpencil_data(C); PropertyRNA *prop; @@ -1383,7 +1383,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve t->depsgraph = CTX_data_depsgraph_pointer(C); t->scene = sce; t->view_layer = view_layer; - t->sa = sa; + t->area = area; t->region = region; t->settings = ts; t->reports = op ? op->reports : NULL; @@ -1465,17 +1465,17 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve } /* Assign the space type, some exceptions for running in different mode */ - if (sa == NULL) { + if (area == NULL) { /* background mode */ t->spacetype = SPACE_EMPTY; } - else if ((region == NULL) && (sa->spacetype == SPACE_VIEW3D)) { + else if ((region == NULL) && (area->spacetype == SPACE_VIEW3D)) { /* running in the text editor */ t->spacetype = SPACE_EMPTY; } else { /* normal operation */ - t->spacetype = sa->spacetype; + t->spacetype = area->spacetype; } /* handle T_ALT_TRANSFORM initialization, we may use for different operators */ @@ -1491,7 +1491,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve } if (t->spacetype == SPACE_VIEW3D) { - View3D *v3d = sa->spacedata.first; + View3D *v3d = area->spacedata.first; bScreen *animscreen = ED_screen_animation_playing(CTX_wm_manager(C)); t->view = v3d; @@ -1564,7 +1564,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve } } else if (t->spacetype == SPACE_IMAGE) { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; // XXX for now, get View2D from the active region t->view = ®ion->v2d; t->around = sima->around; @@ -1589,12 +1589,12 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve t->around = V3D_AROUND_CENTER_BOUNDS; } else if (t->spacetype == SPACE_GRAPH) { - SpaceGraph *sipo = sa->spacedata.first; + SpaceGraph *sipo = area->spacedata.first; t->view = ®ion->v2d; t->around = sipo->around; } else if (t->spacetype == SPACE_CLIP) { - SpaceClip *sclip = sa->spacedata.first; + SpaceClip *sclip = area->spacedata.first; t->view = ®ion->v2d; t->around = sclip->around; @@ -1876,14 +1876,14 @@ void postTrans(bContext *C, TransInfo *t) /* pass */ } else { - SpaceImage *sima = t->sa->spacedata.first; + SpaceImage *sima = t->area->spacedata.first; if (sima->flag & SI_LIVE_UNWRAP) { ED_uvedit_live_unwrap_end(t->state == TRANS_CANCEL); } } } else if (t->spacetype == SPACE_VIEW3D) { - View3D *v3d = t->sa->spacedata.first; + View3D *v3d = t->area->spacedata.first; /* restore gizmo */ if (t->flag & T_MODAL) { v3d->gizmo_flag = t->gizmo_flag; @@ -2023,11 +2023,11 @@ void calculateCenterCursor2D(TransInfo *t, float r_center[2]) const float *cursor = NULL; if (t->spacetype == SPACE_IMAGE) { - SpaceImage *sima = (SpaceImage *)t->sa->spacedata.first; + SpaceImage *sima = (SpaceImage *)t->area->spacedata.first; cursor = sima->cursor; } else if (t->spacetype == SPACE_CLIP) { - SpaceClip *space_clip = (SpaceClip *)t->sa->spacedata.first; + SpaceClip *space_clip = (SpaceClip *)t->area->spacedata.first; cursor = space_clip->cursor; } @@ -2036,11 +2036,11 @@ void calculateCenterCursor2D(TransInfo *t, float r_center[2]) float co[2]; if (t->spacetype == SPACE_IMAGE) { - SpaceImage *sima = (SpaceImage *)t->sa->spacedata.first; + SpaceImage *sima = (SpaceImage *)t->area->spacedata.first; BKE_mask_coord_from_image(sima->image, &sima->iuser, co, cursor); } else if (t->spacetype == SPACE_CLIP) { - SpaceClip *space_clip = (SpaceClip *)t->sa->spacedata.first; + SpaceClip *space_clip = (SpaceClip *)t->area->spacedata.first; BKE_mask_coord_from_movieclip(space_clip->clip, &space_clip->user, co, cursor); } else { @@ -2065,7 +2065,7 @@ void calculateCenterCursor2D(TransInfo *t, float r_center[2]) void calculateCenterCursorGraph2D(TransInfo *t, float r_center[2]) { - SpaceGraph *sipo = (SpaceGraph *)t->sa->spacedata.first; + SpaceGraph *sipo = (SpaceGraph *)t->area->spacedata.first; Scene *scene = t->scene; /* cursor is combination of current frame, and graph-editor cursor value */ diff --git a/source/blender/editors/transform/transform_gizmo_2d.c b/source/blender/editors/transform/transform_gizmo_2d.c index e85b9f0bee1..50317d8b395 100644 --- a/source/blender/editors/transform/transform_gizmo_2d.c +++ b/source/blender/editors/transform/transform_gizmo_2d.c @@ -68,10 +68,10 @@ static bool gizmo2d_generic_poll(const bContext *C, wmGizmoGroupType *gzgt) return false; } - ScrArea *sa = CTX_wm_area(C); - switch (sa->spacetype) { + ScrArea *area = CTX_wm_area(C); + switch (area->spacetype) { case SPACE_IMAGE: { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; Object *obedit = CTX_data_edit_object(C); if (!ED_space_image_show_uvedit(sima, obedit)) { return false; @@ -86,7 +86,7 @@ static void gizmo2d_pivot_point_message_subscribe(struct wmGizmoGroup *gzgroup, struct wmMsgBus *mbus, /* Additional args. */ bScreen *screen, - ScrArea *sa, + ScrArea *area, ARegion *region) { wmMsgSubscribeValue msg_sub_value_gz_tag_refresh = { @@ -95,9 +95,9 @@ static void gizmo2d_pivot_point_message_subscribe(struct wmGizmoGroup *gzgroup, .notify = WM_gizmo_do_msg_notify_tag_refresh, }; - switch (sa->spacetype) { + switch (area->spacetype) { case SPACE_IMAGE: { - SpaceImage *sima = sa->spacedata.first; + SpaceImage *sima = area->spacedata.first; PointerRNA ptr; RNA_pointer_create(&screen->id, &RNA_SpaceImageEditor, sima, &ptr); { @@ -214,10 +214,10 @@ static bool gizmo2d_calc_bounds(const bContext *C, float *r_center, float *r_min r_max = max_buf; } - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); bool changed = false; - if (sa->spacetype == SPACE_IMAGE) { - SpaceImage *sima = sa->spacedata.first; + if (area->spacetype == SPACE_IMAGE) { + SpaceImage *sima = area->spacedata.first; Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); Image *ima = ED_space_image(sima); @@ -241,11 +241,11 @@ static bool gizmo2d_calc_bounds(const bContext *C, float *r_center, float *r_min static bool gizmo2d_calc_center(const bContext *C, float r_center[2]) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); bool has_select = false; zero_v2(r_center); - if (sa->spacetype == SPACE_IMAGE) { - SpaceImage *sima = sa->spacedata.first; + if (area->spacetype == SPACE_IMAGE) { + SpaceImage *sima = area->spacedata.first; Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); ED_uvedit_center_from_pivot_ex(sima, scene, view_layer, r_center, sima->around, &has_select); @@ -509,9 +509,9 @@ static void gizmo2d_xform_no_cage_message_subscribe(const struct bContext *C, struct wmMsgBus *mbus) { bScreen *screen = CTX_wm_screen(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); - gizmo2d_pivot_point_message_subscribe(gzgroup, mbus, screen, sa, region); + gizmo2d_pivot_point_message_subscribe(gzgroup, mbus, screen, area, region); } void ED_widgetgroup_gizmo2d_xform_callbacks_set(wmGizmoGroupType *gzgt) @@ -671,9 +671,9 @@ static void gizmo2d_resize_message_subscribe(const struct bContext *C, struct wmMsgBus *mbus) { bScreen *screen = CTX_wm_screen(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); - gizmo2d_pivot_point_message_subscribe(gzgroup, mbus, screen, sa, region); + gizmo2d_pivot_point_message_subscribe(gzgroup, mbus, screen, area, region); } void ED_widgetgroup_gizmo2d_resize_callbacks_set(wmGizmoGroupType *gzgt) @@ -791,9 +791,9 @@ static void gizmo2d_rotate_message_subscribe(const struct bContext *C, struct wmMsgBus *mbus) { bScreen *screen = CTX_wm_screen(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); - gizmo2d_pivot_point_message_subscribe(gzgroup, mbus, screen, sa, region); + gizmo2d_pivot_point_message_subscribe(gzgroup, mbus, screen, area, region); } void ED_widgetgroup_gizmo2d_rotate_callbacks_set(wmGizmoGroupType *gzgt) diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c index de7b2ec02de..6af1989a509 100644 --- a/source/blender/editors/transform/transform_gizmo_3d.c +++ b/source/blender/editors/transform/transform_gizmo_3d.c @@ -734,14 +734,14 @@ int ED_transform_calc_gizmo_stats(const bContext *C, const struct TransformCalcParams *params, struct TransformBounds *tbounds) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); Scene *scene = CTX_data_scene(C); /* TODO(sergey): This function is used from operator's modal() and from gizmo's refresh(). * Is it fine to possibly evaluate dependency graph here? */ Depsgraph *depsgraph = CTX_data_expect_evaluated_depsgraph(C); ViewLayer *view_layer = CTX_data_view_layer(C); - View3D *v3d = sa->spacedata.first; + View3D *v3d = area->spacedata.first; Object *obedit = CTX_data_edit_object(C); RegionView3D *rv3d = region->regiondata; Base *base; @@ -1244,7 +1244,7 @@ static void gizmo_xform_message_subscribe(wmGizmoGroup *gzgroup, struct wmMsgBus *mbus, Scene *scene, bScreen *screen, - ScrArea *sa, + ScrArea *area, ARegion *region, const void *type_fn) { @@ -1334,7 +1334,7 @@ static void gizmo_xform_message_subscribe(wmGizmoGroup *gzgroup, } PointerRNA view3d_ptr; - RNA_pointer_create(&screen->id, &RNA_SpaceView3D, sa->spacedata.first, &view3d_ptr); + RNA_pointer_create(&screen->id, &RNA_SpaceView3D, area->spacedata.first, &view3d_ptr); if (type_fn == VIEW3D_GGT_xform_gizmo) { GizmoGroup *ggd = gzgroup->customdata; @@ -1701,8 +1701,8 @@ static void WIDGETGROUP_gizmo_setup(const bContext *C, wmGizmoGroup *gzgroup) gzgroup->customdata = ggd; { - ScrArea *sa = CTX_wm_area(C); - const bToolRef *tref = sa->runtime.tool; + ScrArea *area = CTX_wm_area(C); + const bToolRef *tref = area->runtime.tool; ggd->twtype = 0; if (tref && STREQ(tref->idname, "builtin.move")) { @@ -1737,8 +1737,8 @@ static void WIDGETGROUP_gizmo_refresh(const bContext *C, wmGizmoGroup *gzgroup) { GizmoGroup *ggd = gzgroup->customdata; Scene *scene = CTX_data_scene(C); - ScrArea *sa = CTX_wm_area(C); - View3D *v3d = sa->spacedata.first; + ScrArea *area = CTX_wm_area(C); + View3D *v3d = area->spacedata.first; ARegion *region = CTX_wm_region(C); RegionView3D *rv3d = region->regiondata; struct TransformBounds tbounds; @@ -1844,17 +1844,18 @@ static void WIDGETGROUP_gizmo_message_subscribe(const bContext *C, { Scene *scene = CTX_data_scene(C); bScreen *screen = CTX_wm_screen(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); - gizmo_xform_message_subscribe(gzgroup, mbus, scene, screen, sa, region, VIEW3D_GGT_xform_gizmo); + gizmo_xform_message_subscribe( + gzgroup, mbus, scene, screen, area, region, VIEW3D_GGT_xform_gizmo); } static void WIDGETGROUP_gizmo_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup) { GizmoGroup *ggd = gzgroup->customdata; - // 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; RegionView3D *rv3d = region->regiondata; float viewinv_m3[3][3]; copy_m3_m4(viewinv_m3, rv3d->viewinv); @@ -1997,13 +1998,13 @@ static bool WIDGETGROUP_gizmo_poll_generic(View3D *v3d) static bool WIDGETGROUP_gizmo_poll_context(const struct bContext *C, struct wmGizmoGroupType *UNUSED(gzgt)) { - ScrArea *sa = CTX_wm_area(C); - View3D *v3d = sa->spacedata.first; + ScrArea *area = CTX_wm_area(C); + View3D *v3d = area->spacedata.first; if (!WIDGETGROUP_gizmo_poll_generic(v3d)) { return false; } - const bToolRef *tref = sa->runtime.tool; + const bToolRef *tref = area->runtime.tool; if (v3d->gizmo_flag & V3D_GIZMO_HIDE_CONTEXT) { return false; } @@ -2025,8 +2026,8 @@ static bool WIDGETGROUP_gizmo_poll_tool(const struct bContext *C, struct wmGizmo return false; } - ScrArea *sa = CTX_wm_area(C); - View3D *v3d = sa->spacedata.first; + ScrArea *area = CTX_wm_area(C); + View3D *v3d = area->spacedata.first; if (!WIDGETGROUP_gizmo_poll_generic(v3d)) { return false; } @@ -2247,9 +2248,9 @@ static void WIDGETGROUP_xform_cage_message_subscribe(const bContext *C, { Scene *scene = CTX_data_scene(C); bScreen *screen = CTX_wm_screen(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); - gizmo_xform_message_subscribe(gzgroup, mbus, scene, screen, sa, region, VIEW3D_GGT_xform_cage); + gizmo_xform_message_subscribe(gzgroup, mbus, scene, screen, area, region, VIEW3D_GGT_xform_cage); } static void WIDGETGROUP_xform_cage_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup) @@ -2460,9 +2461,10 @@ static void WIDGETGROUP_xform_shear_message_subscribe(const bContext *C, { Scene *scene = CTX_data_scene(C); bScreen *screen = CTX_wm_screen(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); - gizmo_xform_message_subscribe(gzgroup, mbus, scene, screen, sa, region, VIEW3D_GGT_xform_shear); + gizmo_xform_message_subscribe( + gzgroup, mbus, scene, screen, area, region, VIEW3D_GGT_xform_shear); } static void WIDGETGROUP_xform_shear_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup) diff --git a/source/blender/editors/transform/transform_mode.c b/source/blender/editors/transform/transform_mode.c index 31aae4f5b05..a2b3a891031 100644 --- a/source/blender/editors/transform/transform_mode.c +++ b/source/blender/editors/transform/transform_mode.c @@ -1028,21 +1028,21 @@ short getAnimEdit_SnapMode(TransInfo *t) short autosnap = SACTSNAP_OFF; if (t->spacetype == SPACE_ACTION) { - SpaceAction *saction = (SpaceAction *)t->sa->spacedata.first; + SpaceAction *saction = (SpaceAction *)t->area->spacedata.first; if (saction) { autosnap = saction->autosnap; } } else if (t->spacetype == SPACE_GRAPH) { - SpaceGraph *sipo = (SpaceGraph *)t->sa->spacedata.first; + SpaceGraph *sipo = (SpaceGraph *)t->area->spacedata.first; if (sipo) { autosnap = sipo->autosnap; } } else if (t->spacetype == SPACE_NLA) { - SpaceNla *snla = (SpaceNla *)t->sa->spacedata.first; + SpaceNla *snla = (SpaceNla *)t->area->spacedata.first; if (snla) { autosnap = snla->autosnap; diff --git a/source/blender/editors/transform/transform_mode_align.c b/source/blender/editors/transform/transform_mode_align.c index fbd5e87f034..9bce793809b 100644 --- a/source/blender/editors/transform/transform_mode_align.c +++ b/source/blender/editors/transform/transform_mode_align.c @@ -82,7 +82,7 @@ static void applyAlign(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, TIP_("Align")); + ED_area_status_text(t->area, TIP_("Align")); } void initAlign(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_baketime.c b/source/blender/editors/transform/transform_mode_baketime.c index 0feaa27d4ce..bb8fd0df13d 100644 --- a/source/blender/editors/transform/transform_mode_baketime.c +++ b/source/blender/editors/transform/transform_mode_baketime.c @@ -119,7 +119,7 @@ static void applyBakeTime(TransInfo *t, const int mval[2]) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initBakeTime(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_bbone_resize.c b/source/blender/editors/transform/transform_mode_bbone_resize.c index 1a32a550cb0..c81049ac379 100644 --- a/source/blender/editors/transform/transform_mode_bbone_resize.c +++ b/source/blender/editors/transform/transform_mode_bbone_resize.c @@ -155,7 +155,7 @@ static void applyBoneSize(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initBoneSize(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_bend.c b/source/blender/editors/transform/transform_mode_bend.c index bf80673fbb4..721d226050a 100644 --- a/source/blender/editors/transform/transform_mode_bend.c +++ b/source/blender/editors/transform/transform_mode_bend.c @@ -246,7 +246,7 @@ static void Bend(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initBend(TransInfo *t) @@ -289,7 +289,8 @@ void initBend(TransInfo *t) curs = t->scene->cursor.location; copy_v3_v3(data->warp_sta, curs); - ED_view3d_win_to_3d((View3D *)t->sa->spacedata.first, t->region, curs, mval_fl, data->warp_end); + ED_view3d_win_to_3d( + (View3D *)t->area->spacedata.first, t->region, curs, mval_fl, data->warp_end); copy_v3_v3(data->warp_nor, t->viewinv[2]); normalize_v3(data->warp_nor); diff --git a/source/blender/editors/transform/transform_mode_boneenvelope.c b/source/blender/editors/transform/transform_mode_boneenvelope.c index 0886d4e01ef..aa20a5ade95 100644 --- a/source/blender/editors/transform/transform_mode_boneenvelope.c +++ b/source/blender/editors/transform/transform_mode_boneenvelope.c @@ -95,7 +95,7 @@ static void applyBoneEnvelope(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initBoneEnvelope(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_boneroll.c b/source/blender/editors/transform/transform_mode_boneroll.c index 8e9d680f269..0564a946148 100644 --- a/source/blender/editors/transform/transform_mode_boneroll.c +++ b/source/blender/editors/transform/transform_mode_boneroll.c @@ -89,7 +89,7 @@ static void applyBoneRoll(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initBoneRoll(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_curveshrinkfatten.c b/source/blender/editors/transform/transform_mode_curveshrinkfatten.c index 6ccb0e757c3..057f13ac068 100644 --- a/source/blender/editors/transform/transform_mode_curveshrinkfatten.c +++ b/source/blender/editors/transform/transform_mode_curveshrinkfatten.c @@ -94,7 +94,7 @@ static void applyCurveShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initCurveShrinkFatten(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_edge_bevelweight.c b/source/blender/editors/transform/transform_mode_edge_bevelweight.c index 15a9e7384b1..5db7895232c 100644 --- a/source/blender/editors/transform/transform_mode_edge_bevelweight.c +++ b/source/blender/editors/transform/transform_mode_edge_bevelweight.c @@ -105,7 +105,7 @@ static void applyBevelWeight(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initBevelWeight(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_edge_crease.c b/source/blender/editors/transform/transform_mode_edge_crease.c index 8865721bc7e..4a92a57fef6 100644 --- a/source/blender/editors/transform/transform_mode_edge_crease.c +++ b/source/blender/editors/transform/transform_mode_edge_crease.c @@ -109,7 +109,7 @@ static void applyCrease(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initCrease(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_edge_rotate_normal.c b/source/blender/editors/transform/transform_mode_edge_rotate_normal.c index 69cd909cff9..18149a09f20 100644 --- a/source/blender/editors/transform/transform_mode_edge_rotate_normal.c +++ b/source/blender/editors/transform/transform_mode_edge_rotate_normal.c @@ -121,7 +121,7 @@ static void applyNormalRotation(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initNormalRotation(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_edge_seq_slide.c b/source/blender/editors/transform/transform_mode_edge_seq_slide.c index e23e5c188c8..ee91459dcdd 100644 --- a/source/blender/editors/transform/transform_mode_edge_seq_slide.c +++ b/source/blender/editors/transform/transform_mode_edge_seq_slide.c @@ -120,7 +120,7 @@ static void applySeqSlide(TransInfo *t, const int mval[2]) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initSeqSlide(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_edge_slide.c b/source/blender/editors/transform/transform_mode_edge_slide.c index b54e6afc9a1..5613a782529 100644 --- a/source/blender/editors/transform/transform_mode_edge_slide.c +++ b/source/blender/editors/transform/transform_mode_edge_slide.c @@ -334,7 +334,7 @@ static void calcEdgeSlide_mval_range(TransInfo *t, if (t->spacetype == SPACE_VIEW3D) { /* background mode support */ - v3d = t->sa ? t->sa->spacedata.first : NULL; + v3d = t->area ? t->area->spacedata.first : NULL; rv3d = t->region ? t->region->regiondata : NULL; } @@ -858,7 +858,7 @@ static bool createEdgeSlideVerts_double_side(TransInfo *t, TransDataContainer *t /* use for visibility checks */ if (t->spacetype == SPACE_VIEW3D) { - v3d = t->sa ? t->sa->spacedata.first : NULL; + v3d = t->area ? t->area->spacedata.first : NULL; rv3d = t->region ? t->region->regiondata : NULL; use_occlude_geometry = (v3d && TRANS_DATA_CONTAINER_FIRST_OK(t)->obedit->dt > OB_WIRE && !XRAY_ENABLED(v3d)); @@ -899,7 +899,7 @@ static bool createEdgeSlideVerts_single_side(TransInfo *t, TransDataContainer *t if (t->spacetype == SPACE_VIEW3D) { /* background mode support */ - v3d = t->sa ? t->sa->spacedata.first : NULL; + v3d = t->area ? t->area->spacedata.first : NULL; rv3d = t->region ? t->region->regiondata : NULL; } @@ -1043,7 +1043,7 @@ static bool createEdgeSlideVerts_single_side(TransInfo *t, TransDataContainer *t /* use for visibility checks */ if (t->spacetype == SPACE_VIEW3D) { - v3d = t->sa ? t->sa->spacedata.first : NULL; + v3d = t->area ? t->area->spacedata.first : NULL; rv3d = t->region ? t->region->regiondata : NULL; use_occlude_geometry = (v3d && TRANS_DATA_CONTAINER_FIRST_OK(t)->obedit->dt > OB_WIRE && !XRAY_ENABLED(v3d)); @@ -1417,7 +1417,7 @@ static void applyEdgeSlide(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initEdgeSlide_ex( diff --git a/source/blender/editors/transform/transform_mode_gpopacity.c b/source/blender/editors/transform/transform_mode_gpopacity.c index 460e2b41da8..267d297a31c 100644 --- a/source/blender/editors/transform/transform_mode_gpopacity.c +++ b/source/blender/editors/transform/transform_mode_gpopacity.c @@ -90,7 +90,7 @@ static void applyGPOpacity(TransInfo *t, const int UNUSED(mval[2])) } } - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initGPOpacity(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_gpshrinkfatten.c b/source/blender/editors/transform/transform_mode_gpshrinkfatten.c index edb353b343d..7c49d107703 100644 --- a/source/blender/editors/transform/transform_mode_gpshrinkfatten.c +++ b/source/blender/editors/transform/transform_mode_gpshrinkfatten.c @@ -92,7 +92,7 @@ static void applyGPShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) } } - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initGPShrinkFatten(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_maskshrinkfatten.c b/source/blender/editors/transform/transform_mode_maskshrinkfatten.c index b6719067f5b..e42439920db 100644 --- a/source/blender/editors/transform/transform_mode_maskshrinkfatten.c +++ b/source/blender/editors/transform/transform_mode_maskshrinkfatten.c @@ -124,7 +124,7 @@ static void applyMaskShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initMaskShrinkFatten(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_mirror.c b/source/blender/editors/transform/transform_mode_mirror.c index 2f305989f82..dae17374481 100644 --- a/source/blender/editors/transform/transform_mode_mirror.c +++ b/source/blender/editors/transform/transform_mode_mirror.c @@ -83,7 +83,7 @@ static void applyMirror(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } else { size[0] = size[1] = size[2] = 1; @@ -108,10 +108,10 @@ static void applyMirror(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); if (t->flag & T_2D_EDIT) { - ED_area_status_text(t->sa, TIP_("Select a mirror axis (X, Y)")); + ED_area_status_text(t->area, TIP_("Select a mirror axis (X, Y)")); } else { - ED_area_status_text(t->sa, TIP_("Select a mirror axis (X, Y, Z)")); + ED_area_status_text(t->area, TIP_("Select a mirror axis (X, Y, Z)")); } } } diff --git a/source/blender/editors/transform/transform_mode_push_pull.c b/source/blender/editors/transform/transform_mode_push_pull.c index 890fc820cd5..6eb038ea9b0 100644 --- a/source/blender/editors/transform/transform_mode_push_pull.c +++ b/source/blender/editors/transform/transform_mode_push_pull.c @@ -114,7 +114,7 @@ static void applyPushPull(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initPushPull(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_resize.c b/source/blender/editors/transform/transform_mode_resize.c index 59f2ab5c294..00644b9bfdc 100644 --- a/source/blender/editors/transform/transform_mode_resize.c +++ b/source/blender/editors/transform/transform_mode_resize.c @@ -131,7 +131,7 @@ static void applyResize(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initResize(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_rotate.c b/source/blender/editors/transform/transform_mode_rotate.c index bea039194d0..6c2b3dc77d2 100644 --- a/source/blender/editors/transform/transform_mode_rotate.c +++ b/source/blender/editors/transform/transform_mode_rotate.c @@ -169,7 +169,7 @@ static void applyRotation(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initRotation(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_shear.c b/source/blender/editors/transform/transform_mode_shear.c index 8b7dc12f41b..ba79f5f3c7b 100644 --- a/source/blender/editors/transform/transform_mode_shear.c +++ b/source/blender/editors/transform/transform_mode_shear.c @@ -217,7 +217,7 @@ static void applyShear(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initShear(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_shrink_fatten.c b/source/blender/editors/transform/transform_mode_shrink_fatten.c index e24e63f445c..ed082e86b6d 100644 --- a/source/blender/editors/transform/transform_mode_shrink_fatten.c +++ b/source/blender/editors/transform/transform_mode_shrink_fatten.c @@ -115,7 +115,7 @@ static void applyShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initShrinkFatten(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_skin_resize.c b/source/blender/editors/transform/transform_mode_skin_resize.c index 23ba9a07f3e..b53dbb55c62 100644 --- a/source/blender/editors/transform/transform_mode_skin_resize.c +++ b/source/blender/editors/transform/transform_mode_skin_resize.c @@ -102,7 +102,7 @@ static void applySkinResize(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initSkinResize(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_tilt.c b/source/blender/editors/transform/transform_mode_tilt.c index 9ae0cfdf805..2f56f4bd162 100644 --- a/source/blender/editors/transform/transform_mode_tilt.c +++ b/source/blender/editors/transform/transform_mode_tilt.c @@ -93,7 +93,7 @@ static void applyTilt(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initTilt(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_timescale.c b/source/blender/editors/transform/transform_mode_timescale.c index b75ef4da0f2..ce46cc36276 100644 --- a/source/blender/editors/transform/transform_mode_timescale.c +++ b/source/blender/editors/transform/transform_mode_timescale.c @@ -109,7 +109,7 @@ static void applyTimeScale(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initTimeScale(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_timeslide.c b/source/blender/editors/transform/transform_mode_timeslide.c index fce526873f1..43e14a26930 100644 --- a/source/blender/editors/transform/transform_mode_timeslide.c +++ b/source/blender/editors/transform/transform_mode_timeslide.c @@ -82,7 +82,7 @@ static void applyTimeSlideValue(TransInfo *t, float sval, float cval) /* set value for drawing black line */ if (t->spacetype == SPACE_ACTION) { - SpaceAction *saction = (SpaceAction *)t->sa->spacedata.first; + SpaceAction *saction = (SpaceAction *)t->area->spacedata.first; saction->timeslide = cval; } @@ -160,14 +160,14 @@ static void applyTimeSlide(TransInfo *t, const int mval[2]) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initTimeSlide(TransInfo *t) { /* this tool is only really available in the Action Editor... */ if (t->spacetype == SPACE_ACTION) { - SpaceAction *saction = (SpaceAction *)t->sa->spacedata.first; + SpaceAction *saction = (SpaceAction *)t->area->spacedata.first; /* set flag for drawing stuff */ saction->flag |= SACTION_MOVING; diff --git a/source/blender/editors/transform/transform_mode_timetranslate.c b/source/blender/editors/transform/transform_mode_timetranslate.c index 494609cafb0..c514df497bc 100644 --- a/source/blender/editors/transform/transform_mode_timetranslate.c +++ b/source/blender/editors/transform/transform_mode_timetranslate.c @@ -136,7 +136,7 @@ static void applyTimeTranslate(TransInfo *t, const int mval[2]) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initTimeTranslate(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_tosphere.c b/source/blender/editors/transform/transform_mode_tosphere.c index 5a3b138823c..841ccf41365 100644 --- a/source/blender/editors/transform/transform_mode_tosphere.c +++ b/source/blender/editors/transform/transform_mode_tosphere.c @@ -101,7 +101,7 @@ static void applyToSphere(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initToSphere(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_trackball.c b/source/blender/editors/transform/transform_mode_trackball.c index 758ee3b9cae..c6e0b205204 100644 --- a/source/blender/editors/transform/transform_mode_trackball.c +++ b/source/blender/editors/transform/transform_mode_trackball.c @@ -143,7 +143,7 @@ static void applyTrackball(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initTrackball(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_translate.c b/source/blender/editors/transform/transform_mode_translate.c index aef5a999d18..0a7d8bd90d3 100644 --- a/source/blender/editors/transform/transform_mode_translate.c +++ b/source/blender/editors/transform/transform_mode_translate.c @@ -191,7 +191,7 @@ static void headerTranslation(TransInfo *t, const float vec[3], char str[UI_MAX_ } if (t->spacetype == SPACE_NODE) { - SpaceNode *snode = (SpaceNode *)t->sa->spacedata.first; + SpaceNode *snode = (SpaceNode *)t->area->spacedata.first; if ((snode->flag & SNODE_SKIP_INSOFFSET) == 0) { const char *str_old = BLI_strdup(str); @@ -370,7 +370,7 @@ static void applyTranslation(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initTranslation(TransInfo *t) diff --git a/source/blender/editors/transform/transform_mode_vert_slide.c b/source/blender/editors/transform/transform_mode_vert_slide.c index 2325c4d1d26..7bee48337f9 100644 --- a/source/blender/editors/transform/transform_mode_vert_slide.c +++ b/source/blender/editors/transform/transform_mode_vert_slide.c @@ -602,7 +602,7 @@ static void applyVertSlide(TransInfo *t, const int UNUSED(mval[2])) recalcData(t); - ED_area_status_text(t->sa, str); + ED_area_status_text(t->area, str); } void initVertSlide_ex(TransInfo *t, bool use_even, bool flipped, bool use_clamp) diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 7e56b34af2f..31b85cdf3a8 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -893,8 +893,8 @@ static bool transform_shear_poll(bContext *C) return false; } - ScrArea *sa = CTX_wm_area(C); - return sa && !ELEM(sa->spacetype, SPACE_ACTION); + ScrArea *area = CTX_wm_area(C); + return area && !ELEM(area->spacetype, SPACE_ACTION); } static void TRANSFORM_OT_shear(struct wmOperatorType *ot) diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index dffe52745e4..cb4446deb99 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -1106,7 +1106,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec)) } else if (t->spacetype == SPACE_IMAGE && t->obedit_type == OB_MESH) { if (t->tsnap.mode & SCE_SNAP_MODE_VERTEX) { - Image *ima = ED_space_image(t->sa->spacedata.first); + Image *ima = ED_space_image(t->area->spacedata.first); float co[2]; UI_view2d_region_to_view(&t->region->v2d, t->mval[0], t->mval[1], &co[0], &co[1]); @@ -1581,7 +1581,7 @@ bool snapNodesTransform( TransInfo *t, const int mval[2], float r_loc[2], float *r_dist_px, char *r_node_border) { return snapNodes(t->settings, - t->sa->spacedata.first, + t->area->spacedata.first, t->region, mval, t->tsnap.modeSelect, @@ -1716,7 +1716,7 @@ static void applyGridIncrement( if (t->spacetype == SPACE_GRAPH) { View2D *v2d = &t->region->v2d; Scene *scene = t->scene; - SpaceGraph *sipo = t->sa->spacedata.first; + SpaceGraph *sipo = t->area->spacedata.first; asp_local[0] = UI_view2d_grid_resolution_x__frames_or_seconds( v2d, scene, sipo->flag & SIPO_DRAWTIME); asp_local[1] = UI_view2d_grid_resolution_y__values(v2d); diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c index 9db957f8031..39ecbad1807 100644 --- a/source/blender/editors/undo/ed_undo.c +++ b/source/blender/editors/undo/ed_undo.c @@ -119,7 +119,7 @@ static int ed_undo_step_impl( CLOG_INFO(&LOG, 1, "name='%s', step=%d", undoname, step); wmWindowManager *wm = CTX_wm_manager(C); Scene *scene = CTX_data_scene(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); /* undo during jobs are running can easily lead to freeing data using by jobs, * or they can just lead to freezing job in some other cases */ @@ -138,7 +138,7 @@ static int ed_undo_step_impl( if (ED_gpencil_session_active()) { return ED_undo_gpencil_step(C, step, undoname); } - if (sa && (sa->spacetype == SPACE_VIEW3D)) { + if (area && (area->spacetype == SPACE_VIEW3D)) { Object *obact = CTX_data_active_object(C); if (obact && (obact->type == OB_GPENCIL)) { ED_gpencil_toggle_brush_cursor(C, false, NULL); @@ -195,7 +195,7 @@ static int ed_undo_step_impl( } /* Set special modes for grease pencil */ - if (sa && (sa->spacetype == SPACE_VIEW3D)) { + if (area && (area->spacetype == SPACE_VIEW3D)) { Object *obact = CTX_data_active_object(C); if (obact && (obact->type == OB_GPENCIL)) { /* set cursor */ diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index b88fcf5a328..358b3edde6b 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -472,12 +472,12 @@ void ED_region_draw_mouse_line_cb(const bContext *C, ARegion *region, void *arg_ * * \param new_id: may be NULL to unlink \a old_id. */ -void ED_spacedata_id_remap(struct ScrArea *sa, struct SpaceLink *sl, ID *old_id, ID *new_id) +void ED_spacedata_id_remap(struct ScrArea *area, struct SpaceLink *sl, ID *old_id, ID *new_id) { SpaceType *st = BKE_spacetype_from_id(sl->spacetype); if (st && st->id_remap) { - st->id_remap(sa, sl, old_id, new_id); + st->id_remap(area, sl, old_id, new_id); } } diff --git a/source/blender/editors/util/gizmo_utils.c b/source/blender/editors/util/gizmo_utils.c index 85a7cc94ae3..08e7b3a9a0a 100644 --- a/source/blender/editors/util/gizmo_utils.c +++ b/source/blender/editors/util/gizmo_utils.c @@ -59,9 +59,9 @@ bool ED_gizmo_poll_or_unlink_delayed_from_tool_ex(const bContext *C, { bToolRef_Runtime *tref_rt = WM_toolsystem_runtime_from_context((bContext *)C); if ((tref_rt == NULL) || !STREQ(gzgt_idname, tref_rt->gizmo_group)) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); wmGizmoMapType *gzmap_type = WM_gizmomaptype_ensure(&gzgt->gzmap_params); - WM_gizmo_group_unlink_delayed_ptr_from_space(gzgt, gzmap_type, sa); + WM_gizmo_group_unlink_delayed_ptr_from_space(gzgt, gzmap_type, area); if (gzgt->users == 0) { WM_gizmo_group_type_unlink_delayed_ptr(gzgt); } diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index 7f05eba7c72..3a4f12acf9c 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -299,9 +299,9 @@ static void stitch_update_header(StitchStateContainer *ssc, bContext *C) "shift select vertices"); char msg[UI_MAX_DRAW_STR]; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); - if (sa) { + if (area) { BLI_snprintf(msg, sizeof(msg), str, @@ -2438,7 +2438,7 @@ static void stitch_exit(bContext *C, wmOperator *op, int finished) { Scene *scene = CTX_data_scene(C); SpaceImage *sima = CTX_wm_space_image(C); - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); StitchStateContainer *ssc = (StitchStateContainer *)op->customdata; @@ -2492,7 +2492,7 @@ static void stitch_exit(bContext *C, wmOperator *op, int finished) MEM_freeN(objs_selection_count); } - if (sa) { + if (area) { ED_workspace_status_text(C, NULL); } diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 8ded2c16be8..c4dcaaaa8b2 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -708,7 +708,7 @@ static bool minimize_stretch_init(bContext *C, wmOperator *op) static void minimize_stretch_iteration(bContext *C, wmOperator *op, bool interactive) { MinStretch *ms = op->customdata; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); const Scene *scene = CTX_data_scene(C); ToolSettings *ts = scene->toolsettings; const bool synced_selection = (ts->uv_flag & UV_SYNC_SELECTION) != 0; @@ -724,9 +724,9 @@ static void minimize_stretch_iteration(bContext *C, wmOperator *op, bool interac param_flush(ms->handle); - if (sa) { + if (area) { BLI_snprintf(str, sizeof(str), TIP_("Minimize Stretch. Blend %.2f"), ms->blend); - ED_area_status_text(sa, str); + ED_area_status_text(area, str); ED_workspace_status_text(C, TIP_("Press + and -, or scroll wheel to set blending")); } @@ -749,12 +749,12 @@ static void minimize_stretch_iteration(bContext *C, wmOperator *op, bool interac static void minimize_stretch_exit(bContext *C, wmOperator *op, bool cancel) { MinStretch *ms = op->customdata; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); const Scene *scene = CTX_data_scene(C); ToolSettings *ts = scene->toolsettings; const bool synced_selection = (ts->uv_flag & UV_SYNC_SELECTION) != 0; - ED_area_status_text(sa, NULL); + ED_area_status_text(area, NULL); ED_workspace_status_text(C, NULL); if (ms->timer) { |