Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-04-03 14:25:03 +0300
committerJulian Eisel <julian@blender.org>2020-04-03 14:34:50 +0300
commit905c0269f302e8e0e7a27dda8d5256fdcd06ce60 (patch)
tree1c720d4f0069879d5b4c0c9ea8db867106920d4f /source/blender/editors/animation
parent1a69384e76e2b1ab11c87a582eb2cdf26386ac59 (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/animation')
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c32
-rw-r--r--source/blender/editors/animation/anim_filter.c6
-rw-r--r--source/blender/editors/animation/anim_markers.c24
-rw-r--r--source/blender/editors/animation/anim_ops.c20
-rw-r--r--source/blender/editors/animation/keyframing.c4
5 files changed, 43 insertions, 43 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;
}