diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-26 13:16:47 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-26 13:16:47 +0300 |
commit | ce3b78c73a7ccc16fdccf7decedb5d1578dfdf0a (patch) | |
tree | 87f1a9c41ebe6f74806f1ae76206f1d328c85700 /source/blender/editors/space_sequencer/space_sequencer.c | |
parent | 5279d118c2ddee0e6fef66aaf78452c1b302dd42 (diff) |
Cleanup: style, use braces for editor/spaces
Diffstat (limited to 'source/blender/editors/space_sequencer/space_sequencer.c')
-rw-r--r-- | source/blender/editors/space_sequencer/space_sequencer.c | 99 |
1 files changed, 67 insertions, 32 deletions
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index dec70c4bf43..561d603ab08 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -74,13 +74,17 @@ ARegion *sequencer_has_buttons_region(ScrArea *sa) ARegion *ar, *arnew; ar = BKE_area_find_region_type(sa, RGN_TYPE_UI); - if (ar) return ar; + if (ar) { + return ar; + } /* add subdiv level; after header */ ar = BKE_area_find_region_type(sa, RGN_TYPE_HEADER); /* is error! */ - if (ar == NULL) return NULL; + if (ar == NULL) { + return NULL; + } arnew = MEM_callocN(sizeof(ARegion), "buttons for sequencer"); @@ -97,9 +101,11 @@ static ARegion *sequencer_find_region(ScrArea *sa, short type) { ARegion *ar = NULL; - for (ar = sa->regionbase.first; ar; ar = ar->next) - if (ar->regiontype == type) + for (ar = sa->regionbase.first; ar; ar = ar->next) { + if (ar->regiontype == type) { return ar; + } + } return ar; } @@ -199,20 +205,25 @@ static void sequencer_free(SpaceLink *sl) // XXX if (sseq->gpd) BKE_gpencil_free(sseq->gpd); - if (scopes->zebra_ibuf) + if (scopes->zebra_ibuf) { IMB_freeImBuf(scopes->zebra_ibuf); + } - if (scopes->waveform_ibuf) + if (scopes->waveform_ibuf) { IMB_freeImBuf(scopes->waveform_ibuf); + } - if (scopes->sep_waveform_ibuf) + if (scopes->sep_waveform_ibuf) { IMB_freeImBuf(scopes->sep_waveform_ibuf); + } - if (scopes->vector_ibuf) + if (scopes->vector_ibuf) { IMB_freeImBuf(scopes->vector_ibuf); + } - if (scopes->histogram_ibuf) + if (scopes->histogram_ibuf) { IMB_freeImBuf(scopes->histogram_ibuf); + } } @@ -347,12 +358,14 @@ static void sequencer_listener( break; case NC_WINDOW: case NC_SPACE: - if (wmn->data == ND_SPACE_SEQUENCER) + if (wmn->data == ND_SPACE_SEQUENCER) { sequencer_scopes_tag_refresh(sa); + } break; case NC_GPENCIL: - if (wmn->data & ND_GPENCIL_EDITMODE) + if (wmn->data & ND_GPENCIL_EDITMODE) { ED_area_tag_redraw(sa); + } break; } } @@ -365,10 +378,13 @@ static bool image_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event, con Scene *scene = CTX_data_scene(C); int hand; - if (drag->type == WM_DRAG_PATH) - if (ELEM(drag->icon, ICON_FILE_IMAGE, ICON_FILE_BLANK)) /* rule might not work? */ - if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL) + if (drag->type == WM_DRAG_PATH) { + if (ELEM(drag->icon, ICON_FILE_IMAGE, ICON_FILE_BLANK)) { /* rule might not work? */ + if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL) { return 1; + } + } + } return 0; } @@ -379,10 +395,13 @@ static bool movie_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event, con Scene *scene = CTX_data_scene(C); int hand; - if (drag->type == WM_DRAG_PATH) - if (ELEM(drag->icon, 0, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */ - if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL) + if (drag->type == WM_DRAG_PATH) { + if (ELEM(drag->icon, 0, ICON_FILE_MOVIE, ICON_FILE_BLANK)) { /* rule might not work? */ + if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL) { return 1; + } + } + } return 0; } @@ -392,18 +411,22 @@ static bool sound_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event, con Scene *scene = CTX_data_scene(C); int hand; - if (drag->type == WM_DRAG_PATH) - if (ELEM(drag->icon, ICON_FILE_SOUND, ICON_FILE_BLANK)) /* rule might not work? */ - if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL) + if (drag->type == WM_DRAG_PATH) { + if (ELEM(drag->icon, ICON_FILE_SOUND, ICON_FILE_BLANK)) { /* rule might not work? */ + if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL) { return 1; + } + } + } return 0; } static void sequencer_drop_copy(wmDrag *drag, wmDropBox *drop) { /* copy drag path to properties */ - if (RNA_struct_find_property(drop->ptr, "filepath")) + if (RNA_struct_find_property(drop->ptr, "filepath")) { RNA_string_set(drop->ptr, "filepath", drag->path); + } if (RNA_struct_find_property(drop->ptr, "directory")) { PointerRNA itemptr; @@ -514,16 +537,19 @@ static void sequencer_main_region_listener( } break; case NC_SPACE: - if (wmn->data == ND_SPACE_SEQUENCER) + if (wmn->data == ND_SPACE_SEQUENCER) { ED_region_tag_redraw(ar); + } break; case NC_ID: - if (wmn->action == NA_RENAME) + if (wmn->action == NA_RENAME) { ED_region_tag_redraw(ar); + } break; case NC_SCREEN: - if (ELEM(wmn->data, ND_ANIMPLAY)) + if (ELEM(wmn->data, ND_ANIMPLAY)) { ED_region_tag_redraw(ar); + } break; } } @@ -627,21 +653,27 @@ static void sequencer_preview_region_draw(const bContext *C, ARegion *ar) (sseq->mainb == SEQ_DRAW_IMG_IMBUF)); /* XXX temp fix for wrong setting in sseq->mainb */ - if (sseq->mainb == SEQ_DRAW_SEQUENCE) sseq->mainb = SEQ_DRAW_IMG_IMBUF; + if (sseq->mainb == SEQ_DRAW_SEQUENCE) { + sseq->mainb = SEQ_DRAW_IMG_IMBUF; + } - if (!show_split || sseq->overlay_type != SEQ_DRAW_OVERLAY_REFERENCE) + if (!show_split || sseq->overlay_type != SEQ_DRAW_OVERLAY_REFERENCE) { sequencer_draw_preview(C, scene, ar, sseq, scene->r.cfra, 0, false, false); + } if (show_split && sseq->overlay_type != SEQ_DRAW_OVERLAY_CURRENT) { int over_cfra; - if (scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS) + if (scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS) { over_cfra = scene->ed->over_cfra; - else + } + else { over_cfra = scene->r.cfra + scene->ed->over_ofs; + } - if (over_cfra != scene->r.cfra || sseq->overlay_type != SEQ_DRAW_OVERLAY_RECT) + if (over_cfra != scene->r.cfra || sseq->overlay_type != SEQ_DRAW_OVERLAY_RECT) { sequencer_draw_preview(C, scene, ar, sseq, scene->r.cfra, over_cfra - scene->r.cfra, true, false); + } } if ((U.uiflag & USER_SHOW_FPS) && ED_screen_animation_no_scrub(wm)) { @@ -685,8 +717,9 @@ static void sequencer_preview_region_listener( } break; case NC_SPACE: - if (wmn->data == ND_SPACE_SEQUENCER) + if (wmn->data == ND_SPACE_SEQUENCER) { ED_region_tag_redraw(ar); + } break; case NC_ID: switch (wmn->data) { @@ -741,12 +774,14 @@ static void sequencer_buttons_region_listener( } break; case NC_SPACE: - if (wmn->data == ND_SPACE_SEQUENCER) + if (wmn->data == ND_SPACE_SEQUENCER) { ED_region_tag_redraw(ar); + } break; case NC_ID: - if (wmn->action == NA_RENAME) + if (wmn->action == NA_RENAME) { ED_region_tag_redraw(ar); + } break; } } |