style cleanup: follow style guide for formatting of if/for/while loops, and else...
[blender.git] / source / blender / editors / space_clip / space_clip.c
index 96c348fb6e2cb353f21bf621effd4222179b56cd..ca66248682ccf170be2867b0c165553b5d35991b 100644 (file)
@@ -101,14 +101,14 @@ static ARegion *clip_has_preview_region(const bContext *C, ScrArea *sa)
        ARegion *ar, *arnew;
 
        ar= BKE_area_find_region_type(sa, RGN_TYPE_PREVIEW);
-       if(ar)
+       if (ar)
                return ar;
 
        /* add subdiv level; after header */
        ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
 
        /* is error! */
-       if(ar==NULL)
+       if (ar==NULL)
                return NULL;
 
        arnew= MEM_callocN(sizeof(ARegion), "clip preview region");
@@ -124,7 +124,7 @@ static void clip_scopes_tag_refresh(ScrArea *sa)
        SpaceClip *sc= (SpaceClip *)sa->spacedata.first;
        ARegion *ar;
 
-       if(sc->mode!=SC_MODE_TRACKING)
+       if (sc->mode!=SC_MODE_TRACKING)
                return;
 
        /* only while proeprties are visible */
@@ -141,7 +141,7 @@ static void clip_stabilization_tag_refresh(ScrArea *sa)
        SpaceClip *sc= (SpaceClip *)sa->spacedata.first;
        MovieClip *clip= ED_space_clip(sc);
 
-       if(clip) {
+       if (clip) {
                MovieTrackingStabilization *stab= &clip->tracking.stabilization;
 
                stab->ok= 0;
@@ -212,7 +212,7 @@ static void clip_free(SpaceLink *sl)
 
        sc->clip= NULL;
 
-       if(sc->scopes.track_preview)
+       if (sc->scopes.track_preview)
                IMB_freeImBuf(sc->scopes.track_preview);
 }
 
@@ -278,12 +278,12 @@ static void clip_listener(ScrArea *sa, wmNotifier *wmn)
                        }
                        break;
                 case NC_SCREEN:
-                       if(wmn->data==ND_ANIMPLAY) {
+                       if (wmn->data==ND_ANIMPLAY) {
                                ED_area_tag_redraw(sa);
                        }
                        break;
                case NC_SPACE:
-                       if(wmn->data==ND_SPACE_CLIP) {
+                       if (wmn->data==ND_SPACE_CLIP) {
                                clip_scopes_tag_refresh(sa);
                                clip_stabilization_tag_refresh(sa);
                                ED_area_tag_redraw(sa);
@@ -617,11 +617,11 @@ static int clip_context(const bContext *C, const char *member, bContextDataResul
 {
        SpaceClip *sc= CTX_wm_space_clip(C);
 
-       if(CTX_data_dir(member)) {
+       if (CTX_data_dir(member)) {
                CTX_data_dir_set(result, clip_context_dir);
                return 1;
        }
-       else if(CTX_data_equals(member, "edit_movieclip")) {
+       else if (CTX_data_equals(member, "edit_movieclip")) {
                CTX_data_id_pointer_set(result, &sc->clip->id);
                return 1;
        }
@@ -684,7 +684,7 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
                        break;
        }
 
-       if(view_changed) {
+       if (view_changed) {
                ED_area_initialize(wm, window, sa);
                ED_area_tag_redraw(sa);
        }
@@ -706,7 +706,7 @@ static void movieclip_main_area_set_view2d(SpaceClip *sc, ARegion *ar)
        w= width;
        h= height;
 
-       if(clip)
+       if (clip)
                h*= clip->aspy/clip->aspx/clip->tracking.camera.pixel_aspect;
 
        winx= ar->winrct.xmax - ar->winrct.xmin + 1;
@@ -767,22 +767,22 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar)
 
        /* if tracking is in progress, we should synchronize framenr from clipuser
         * so latest tracked frame would be shown */
-       if(clip && clip->tracking_context)
+       if (clip && clip->tracking_context)
                BKE_tracking_sync_user(&sc->user, clip->tracking_context);
 
-       if(sc->flag&SC_LOCK_SELECTION) {
+       if (sc->flag&SC_LOCK_SELECTION) {
                ImBuf *tmpibuf= NULL;
 
-               if(clip && clip->tracking.stabilization.flag&TRACKING_2D_STABILIZATION) {
+               if (clip && clip->tracking.stabilization.flag&TRACKING_2D_STABILIZATION) {
                        tmpibuf= ED_space_clip_get_stable_buffer(sc, NULL, NULL, NULL);
                }
 
-               if(ED_clip_view_selection(sc, ar, 0)) {
+               if (ED_clip_view_selection(sc, ar, 0)) {
                        sc->xof+= sc->xlockof;
                        sc->yof+= sc->ylockof;
                }
 
-               if(tmpibuf)
+               if (tmpibuf)
                        IMB_freeImBuf(tmpibuf);
        }
 
@@ -840,7 +840,7 @@ static void clip_preview_area_draw(const bContext *C, ARegion *ar)
        Scene *scene= CTX_data_scene(C);
        short unitx= V2D_UNIT_FRAMESCALE, unity= V2D_UNIT_VALUES;
 
-       if(sc->flag & SC_LOCK_TIMECURSOR)
+       if (sc->flag & SC_LOCK_TIMECURSOR)
                ED_clip_graph_center_current_frame(scene, ar);
 
        /* clear and setup matrix */
@@ -898,19 +898,19 @@ static void clip_props_area_listener(ARegion *ar, wmNotifier *wmn)
        /* context changes */
        switch(wmn->category) {
                case NC_WM:
-                       if(wmn->data == ND_HISTORY)
+                       if (wmn->data == ND_HISTORY)
                                ED_region_tag_redraw(ar);
                        break;
                case NC_SCENE:
-                       if(wmn->data == ND_MODE)
+                       if (wmn->data == ND_MODE)
                                ED_region_tag_redraw(ar);
                        break;
                case NC_SPACE:
-                       if(wmn->data == ND_SPACE_CLIP)
+                       if (wmn->data == ND_SPACE_CLIP)
                                ED_region_tag_redraw(ar);
                        break;
                case NC_SCREEN:
-                       if(wmn->data == ND_GPENCIL)
+                       if (wmn->data == ND_GPENCIL)
                                ED_region_tag_redraw(ar);
                        break;
        }
@@ -947,7 +947,7 @@ static void clip_properties_area_listener(ARegion *ar, wmNotifier *wmn)
                                ED_region_tag_redraw(ar);
                        break;
                case NC_BRUSH:
-                       if(wmn->action==NA_EDITED)
+                       if (wmn->action==NA_EDITED)
                                ED_region_tag_redraw(ar);
                        break;
        }