Code cleanup: use boolean instead of int for space_clip
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 5 Sep 2013 13:37:53 +0000 (13:37 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 5 Sep 2013 13:37:53 +0000 (13:37 +0000)
source/blender/editors/include/ED_clip.h
source/blender/editors/space_clip/clip_buttons.c
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_clip/clip_editor.c
source/blender/editors/space_clip/clip_graph_draw.c
source/blender/editors/space_clip/clip_graph_ops.c
source/blender/editors/space_clip/clip_ops.c
source/blender/editors/space_clip/clip_utils.c
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/space_clip/tracking_select.c

index 541956136bded52fcf2f5ba86f18ec0ce630ab6b..27e62928f1bd9c84e8c979288af1e9f0d4063044 100644 (file)
@@ -63,18 +63,18 @@ int ED_space_clip_get_clip_frame_number(struct SpaceClip *sc);
 struct ImBuf *ED_space_clip_get_buffer(struct SpaceClip *sc);
 struct ImBuf *ED_space_clip_get_stable_buffer(struct SpaceClip *sc, float loc[2], float *scale, float *angle);
 
-int ED_space_clip_color_sample(struct SpaceClip *sc, struct ARegion *ar, int mval[2], float r_col[3]);
+bool ED_space_clip_color_sample(struct SpaceClip *sc, struct ARegion *ar, int mval[2], float r_col[3]);
 
 void ED_clip_update_frame(const struct Main *mainp, int cfra);
-int ED_clip_view_selection(const struct bContext *C, struct ARegion *ar, int fit);
+bool ED_clip_view_selection(const struct bContext *C, struct ARegion *ar, bool fit);
 
 void ED_clip_point_undistorted_pos(struct SpaceClip *sc, const float co[2], float r_co[2]);
 void ED_clip_point_stable_pos(struct SpaceClip *sc, struct ARegion *ar, float x, float y, float *xr, float *yr);
 void ED_clip_point_stable_pos__reverse(struct SpaceClip *sc, struct ARegion *ar, const float co[2], float r_co[2]);
 void ED_clip_mouse_pos(struct SpaceClip *sc, struct ARegion *ar, const int mval[2], float co[2]);
 
-int ED_space_clip_check_show_trackedit(struct SpaceClip *sc);
-int ED_space_clip_check_show_maskedit(struct SpaceClip *sc);
+bool ED_space_clip_check_show_trackedit(struct SpaceClip *sc);
+bool ED_space_clip_check_show_maskedit(struct SpaceClip *sc);
 
 struct MovieClip *ED_space_clip_get_clip(struct SpaceClip *sc);
 void ED_space_clip_set_clip(struct bContext *C, struct bScreen *screen, struct SpaceClip *sc, struct MovieClip *clip);
index 18248f4775be8eeec1ede5ab1fc80ad815b3e610..50bb8a0e061d118f8af80b1fb03793d1a8fa99ac 100644 (file)
@@ -238,7 +238,8 @@ static void marker_block_handler(bContext *C, void *arg_cb, int event)
 {
        MarkerUpdateCb *cb = (MarkerUpdateCb *) arg_cb;
        MovieTrackingMarker *marker;
-       int width, height, ok = FALSE;
+       int width, height;
+       bool ok = false;
 
        BKE_movieclip_get_size(cb->clip, cb->user, &width, &height);
 
@@ -252,7 +253,7 @@ static void marker_block_handler(bContext *C, void *arg_cb, int event)
                DAG_id_tag_update(&cb->clip->id, 0);
                WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 
-               ok = TRUE;
+               ok = true;
        }
        else if (event == B_MARKER_PAT_DIM) {
                float dim[2], pat_dim[2], pat_min[2], pat_max[2];
@@ -276,7 +277,7 @@ static void marker_block_handler(bContext *C, void *arg_cb, int event)
 
                BKE_tracking_marker_clamp(cb->marker, CLAMP_PAT_DIM);
 
-               ok = TRUE;
+               ok = true;
        }
        else if (event == B_MARKER_SEARCH_POS) {
                float delta[2], side[2];
@@ -292,7 +293,7 @@ static void marker_block_handler(bContext *C, void *arg_cb, int event)
 
                BKE_tracking_marker_clamp(cb->marker, CLAMP_SEARCH_POS);
 
-               ok = TRUE;
+               ok = true;
        }
        else if (event == B_MARKER_SEARCH_DIM) {
                float dim[2], search_dim[2];
@@ -313,12 +314,12 @@ static void marker_block_handler(bContext *C, void *arg_cb, int event)
 
                BKE_tracking_marker_clamp(cb->marker, CLAMP_SEARCH_DIM);
 
-               ok = TRUE;
+               ok = true;
        }
        else if (event == B_MARKER_FLAG) {
                marker->flag = cb->marker_flag;
 
-               ok = TRUE;
+               ok = true;
        }
        else if (event == B_MARKER_OFFSET) {
                float offset[2], delta[2];
@@ -337,7 +338,7 @@ static void marker_block_handler(bContext *C, void *arg_cb, int event)
                DAG_id_tag_update(&cb->clip->id, 0);
                WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 
-               ok = TRUE;
+               ok = true;
        }
 
        if (ok)
index a28b75489eb3ea1d61a526efbda42714195a4f1b..4f3f81e38dc22700cdf72294d8558c68e538c1f2 100644 (file)
@@ -497,7 +497,7 @@ static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieT
                                 float marker_pos[2], int width, int height)
 {
        int tiny = sc->flag & SC_SHOW_TINY_MARKER;
-       int show_search = FALSE;
+       bool show_search = false;
        float px[2];
 
        UI_ThemeColor(TH_MARKER_OUTLINE);
@@ -560,8 +560,8 @@ static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieT
                glEnd();
        }
 
-       show_search = TRACK_VIEW_SELECTED(sc, track) &&
-                     ((marker->flag & MARKER_DISABLED) == 0 || (sc->flag & SC_SHOW_MARKER_PATTERN) == 0);
+       show_search = (TRACK_VIEW_SELECTED(sc, track) &&
+                      ((marker->flag & MARKER_DISABLED) == 0 || (sc->flag & SC_SHOW_MARKER_PATTERN) == 0)) != 0;
        if (sc->flag & SC_SHOW_MARKER_SEARCH && show_search) {
                glBegin(GL_LINE_LOOP);
                glVertex2f(marker->search_min[0], marker->search_min[1]);
@@ -600,7 +600,7 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
                               float marker_pos[2], int width, int height, int act, int sel)
 {
        int tiny = sc->flag & SC_SHOW_TINY_MARKER;
-       int show_search = 0;
+       bool show_search = false;
        float col[3], scol[3], px[2];
 
        track_colors(track, act, col, scol);
@@ -715,8 +715,8 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
        }
 
        /* search */
-       show_search = TRACK_VIEW_SELECTED(sc, track) &&
-                     ((marker->flag & MARKER_DISABLED) == 0 || (sc->flag & SC_SHOW_MARKER_PATTERN) == 0);
+       show_search = (TRACK_VIEW_SELECTED(sc, track) &&
+                      ((marker->flag & MARKER_DISABLED) == 0 || (sc->flag & SC_SHOW_MARKER_PATTERN) == 0)) != 0;
        if ((track->search_flag & SELECT) == sel && (sc->flag & SC_SHOW_MARKER_SEARCH) && show_search) {
                if (track->flag & TRACK_LOCKED) {
                        if (act)
index 08d0af817a834f7f095f2f26e1f131ecae28419a..0d64a3ce59494f7269b0bf50dff8e4b3e5f2ad00 100644 (file)
@@ -262,15 +262,15 @@ ImBuf *ED_space_clip_get_stable_buffer(SpaceClip *sc, float loc[2], float *scale
 
 /* returns color in SRGB */
 /* matching ED_space_image_color_sample() */
-int ED_space_clip_color_sample(SpaceClip *sc, ARegion *ar, int mval[2], float r_col[3])
+bool ED_space_clip_color_sample(SpaceClip *sc, ARegion *ar, int mval[2], float r_col[3])
 {
        ImBuf *ibuf;
        float fx, fy, co[2];
-       int ret = FALSE;
+       bool ret = false;
 
        ibuf = ED_space_clip_get_buffer(sc);
        if (!ibuf) {
-               return FALSE;
+               return false;
        }
 
        /* map the mouse coords to the backdrop image space */
@@ -290,12 +290,12 @@ int ED_space_clip_color_sample(SpaceClip *sc, ARegion *ar, int mval[2], float r_
                if (ibuf->rect_float) {
                        fp = (ibuf->rect_float + (ibuf->channels) * (y * ibuf->x + x));
                        linearrgb_to_srgb_v3_v3(r_col, fp);
-                       ret = TRUE;
+                       ret = true;
                }
                else if (ibuf->rect) {
                        cp = (unsigned char *)(ibuf->rect + y * ibuf->x + x);
                        rgb_uchar_to_float(r_col, cp);
-                       ret = TRUE;
+                       ret = true;
                }
        }
 
@@ -325,11 +325,12 @@ void ED_clip_update_frame(const Main *mainp, int cfra)
        }
 }
 
-static int selected_boundbox(SpaceClip *sc, float min[2], float max[2])
+static bool selected_boundbox(SpaceClip *sc, float min[2], float max[2])
 {
        MovieClip *clip = ED_space_clip_get_clip(sc);
        MovieTrackingTrack *track;
-       int width, height, ok = FALSE;
+       int width, height;
+       bool ok = false;
        ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking);
        int framenr = ED_space_clip_get_clip_frame_number(sc);
 
@@ -362,7 +363,7 @@ static int selected_boundbox(SpaceClip *sc, float min[2], float max[2])
 
                                minmax_v2v2_v2(min, max, pos);
 
-                               ok = TRUE;
+                               ok = true;
                        }
                }
 
@@ -372,7 +373,7 @@ static int selected_boundbox(SpaceClip *sc, float min[2], float max[2])
        return ok;
 }
 
-int ED_clip_view_selection(const bContext *C, ARegion *ar, int fit)
+bool ED_clip_view_selection(const bContext *C, ARegion *ar, bool fit)
 {
        SpaceClip *sc = CTX_wm_space_clip(C);
        int w, h, frame_width, frame_height;
@@ -381,10 +382,10 @@ int ED_clip_view_selection(const bContext *C, ARegion *ar, int fit)
        ED_space_clip_get_size(sc, &frame_width, &frame_height);
 
        if ((frame_width == 0) || (frame_height == 0) || (sc->clip == NULL))
-               return FALSE;
+               return false;
 
        if (!selected_boundbox(sc, min, max))
-               return FALSE;
+               return false;
 
        /* center view */
        clip_view_center_to_point(sc, (max[0] + min[0]) / (2 * frame_width),
@@ -412,7 +413,7 @@ int ED_clip_view_selection(const bContext *C, ARegion *ar, int fit)
                        sc->zoom = newzoom;
        }
 
-       return TRUE;
+       return true;
 }
 
 void ED_clip_point_undistorted_pos(SpaceClip *sc, const float co[2], float r_co[2])
@@ -500,22 +501,22 @@ void ED_clip_mouse_pos(SpaceClip *sc, ARegion *ar, const int mval[2], float co[2
        ED_clip_point_stable_pos(sc, ar, mval[0], mval[1], &co[0], &co[1]);
 }
 
-int ED_space_clip_check_show_trackedit(SpaceClip *sc)
+bool ED_space_clip_check_show_trackedit(SpaceClip *sc)
 {
        if (sc) {
                return ELEM3(sc->mode, SC_MODE_TRACKING, SC_MODE_RECONSTRUCTION, SC_MODE_DISTORTION);
        }
 
-       return FALSE;
+       return false;
 }
 
-int ED_space_clip_check_show_maskedit(SpaceClip *sc)
+bool ED_space_clip_check_show_maskedit(SpaceClip *sc)
 {
        if (sc) {
                return sc->mode == SC_MODE_MASKEDIT;
        }
 
-       return FALSE;
+       return false;
 }
 
 /* ******** clip editing functions ******** */
index 973200dc340afc96b2f567d10fd14a2487f5369b..173d65ee4fcad9de8ebcaf9306d29a089c552bd6 100644 (file)
@@ -126,7 +126,7 @@ static void tracking_segment_end_cb(void *UNUSED(userdata))
 static void tracking_segment_knot_cb(void *userdata, MovieTrackingTrack *track,
                                      MovieTrackingMarker *marker, int coord, int scene_framenr, float val)
 {
-       struct { MovieTrackingTrack *act_track; int sel; float xscale, yscale, hsize; } *data = userdata;
+       struct { MovieTrackingTrack *act_track; bool sel; float xscale, yscale, hsize; } *data = userdata;
        int sel = 0, sel_flag;
 
        if (track != data->act_track)
@@ -151,7 +151,7 @@ static void draw_tracks_curves(View2D *v2d, SpaceClip *sc)
        MovieTracking *tracking = &clip->tracking;
        MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
        int width, height;
-       struct { MovieTrackingTrack *act_track; int sel; float xscale, yscale, hsize; } userdata;
+       struct { MovieTrackingTrack *act_track; bool sel; float xscale, yscale, hsize; } userdata;
 
        BKE_movieclip_get_size(clip, &sc->user, &width, &height);
 
@@ -160,7 +160,7 @@ static void draw_tracks_curves(View2D *v2d, SpaceClip *sc)
 
        /* non-selected knot handles */
        userdata.hsize = UI_GetThemeValuef(TH_HANDLE_VERTEX_SIZE);
-       userdata.sel = FALSE;
+       userdata.sel = false;
        userdata.act_track = act_track;
        UI_view2d_getscale(v2d, &userdata.xscale, &userdata.yscale);
        clip_graph_tracking_values_iterate(sc, sc->flag & SC_SHOW_GRAPH_SEL_ONLY, sc->flag & SC_SHOW_GRAPH_HIDDEN,
index 1053418fd6f97e6d79d6e42fbb7f26b4ea4b19ed..393f92f5af552b2ec394a781cfca8c40a92b2e6e 100644 (file)
@@ -96,8 +96,8 @@ static void toggle_selection_cb(void *userdata, MovieTrackingMarker *marker)
 /******************** mouse select operator ********************/
 
 typedef struct {
-       int coord,          /* coordinate index of found entuty (0 = X-axis, 1 = Y-axis) */
-           has_prev;       /* if there's valid coordinate of previous point of curve segment */
+       int coord;          /* coordinate index of found entuty (0 = X-axis, 1 = Y-axis) */
+       bool has_prev;      /* if there's valid coordinate of previous point of curve segment */
 
        float min_dist,     /* minimal distance between mouse and currently found entuty */
              mouse_co[2],  /* mouse coordinate */
@@ -134,7 +134,7 @@ static void find_nearest_tracking_segment_end_cb(void *userdata)
 {
        MouseSelectUserData *data = userdata;
 
-       data->has_prev = FALSE;
+       data->has_prev = false;
 }
 
 static void find_nearest_tracking_knot_cb(void *userdata, MovieTrackingTrack *track,
@@ -163,7 +163,7 @@ static void mouse_select_init_data(MouseSelectUserData *userdata, float *co)
        copy_v2_v2(userdata->mouse_co, co);
 }
 
-static int mouse_select_knot(bContext *C, float co[2], int extend)
+static bool mouse_select_knot(bContext *C, float co[2], bool extend)
 {
        SpaceClip *sc = CTX_wm_space_clip(C);
        MovieClip *clip = ED_space_clip_get_clip(sc);
@@ -200,15 +200,15 @@ static int mouse_select_knot(bContext *C, float co[2], int extend)
                                else
                                        userdata.marker->flag |= MARKER_GRAPH_SEL_Y;
 
-                               return TRUE;
+                               return true;
                        }
                }
        }
 
-       return FALSE;
+       return false;
 }
 
-static int mouse_select_curve(bContext *C, float co[2], int extend)
+static bool mouse_select_curve(bContext *C, float co[2], bool extend)
 {
        SpaceClip *sc = CTX_wm_space_clip(C);
        MovieClip *clip = ED_space_clip_get_clip(sc);
@@ -242,15 +242,15 @@ static int mouse_select_curve(bContext *C, float co[2], int extend)
                                                    toggle_selection_cb);
                }
 
-               return TRUE;
+               return true;
        }
 
-       return FALSE;
+       return false;
 }
 
-static int mouse_select(bContext *C, float co[2], int extend)
+static int mouse_select(bContext *C, float co[2], bool extend)
 {
-       int sel = FALSE;
+       bool sel = false;
 
        /* first try to select knot on selected curves */
        sel = mouse_select_knot(C, co, extend);
@@ -269,7 +269,7 @@ static int mouse_select(bContext *C, float co[2], int extend)
 static int select_exec(bContext *C, wmOperator *op)
 {
        float co[2];
-       int extend = RNA_boolean_get(op->ptr, "extend");
+       bool extend = RNA_boolean_get(op->ptr, "extend");
 
        RNA_float_get_array(op->ptr, "location", co);
 
@@ -313,7 +313,8 @@ void CLIP_OT_graph_select(wmOperatorType *ot)
 
 typedef struct BorderSelectuserData {
        rctf rect;
-       int change, mode, extend;
+       int mode;
+       bool change, extend;
 } BorderSelectuserData;
 
 static void border_select_cb(void *userdata, MovieTrackingTrack *UNUSED(track),
@@ -362,7 +363,7 @@ static int border_select_graph_exec(bContext *C, wmOperator *op)
        UI_view2d_region_to_view(&ar->v2d, rect.xmin, rect.ymin, &userdata.rect.xmin, &userdata.rect.ymin);
        UI_view2d_region_to_view(&ar->v2d, rect.xmax, rect.ymax, &userdata.rect.xmax, &userdata.rect.ymax);
 
-       userdata.change = FALSE;
+       userdata.change = false;
        userdata.mode = RNA_int_get(op->ptr, "gesture_mode");
        userdata.extend = RNA_boolean_get(op->ptr, "extend");
 
index dca8f985f45bb9e96f69e59a5b56e9f20d874f59..f96a0e71dfc9383d66c3525af00625c77fd5fcc8 100644 (file)
@@ -181,7 +181,7 @@ static int open_exec(bContext *C, wmOperator *op)
                PointerRNA fileptr;
                PropertyRNA *prop;
                char dir_only[FILE_MAX], file_only[FILE_MAX];
-               int relative = RNA_boolean_get(op->ptr, "relative_path");
+               bool relative = RNA_boolean_get(op->ptr, "relative_path");
 
                RNA_string_get(op->ptr, "directory", dir_only);
                if (relative)
@@ -353,7 +353,7 @@ static void view_pan_init(bContext *C, wmOperator *op, const wmEvent *event)
        WM_event_add_modal_handler(C, op);
 }
 
-static void view_pan_exit(bContext *C, wmOperator *op, int cancel)
+static void view_pan_exit(bContext *C, wmOperator *op, bool cancel)
 {
        ViewPanData *vpd = op->customdata;
 
@@ -502,7 +502,7 @@ static void view_zoom_init(bContext *C, wmOperator *op, const wmEvent *event)
        WM_event_add_modal_handler(C, op);
 }
 
-static void view_zoom_exit(bContext *C, wmOperator *op, int cancel)
+static void view_zoom_exit(bContext *C, wmOperator *op, bool cancel)
 {
        SpaceClip *sc = CTX_wm_space_clip(C);
        ViewZoomData *vpd = op->customdata;
@@ -736,7 +736,7 @@ static int view_all_exec(bContext *C, wmOperator *op)
        ARegion *ar;
        int w, h, width, height;
        float aspx, aspy;
-       int fit_view = RNA_boolean_get(op->ptr, "fit_view");
+       bool fit_view = RNA_boolean_get(op->ptr, "fit_view");
        float zoomx, zoomy;
 
        /* retrieve state */
@@ -946,7 +946,8 @@ typedef struct ProxyBuildJob {
        Scene *scene;
        struct Main *main;
        MovieClip *clip;
-       int clip_flag, stop;
+       int clip_flag;
+       bool stop;
        struct IndexBuildContext *index_context;
 } ProxyJob;
 
@@ -1126,10 +1127,10 @@ static void *do_proxy_thread(void *data_v)
                ibuf = IMB_ibImageFromMemory(mem, size, IB_rect | IB_multilayer | IB_alphamode_detect, NULL, "proxy frame");
 
                BKE_movieclip_build_proxy_frame_for_ibuf(data->clip, ibuf, NULL, cfra,
-                                                        data->build_sizes, data->build_count, FALSE);
+                                                        data->build_sizes, data->build_count, false);
 
                BKE_movieclip_build_proxy_frame_for_ibuf(data->clip, ibuf, data->distortion, cfra,
-                                                        data->build_undistort_sizes, data->build_undistort_count, TRUE);
+                                                        data->build_undistort_sizes, data->build_undistort_count, true);
 
                IMB_freeImBuf(ibuf);
 
index 72a3cb98a6a1ffa8205d34ff6b6b4ca0aa9896a8..635aa388541fb1315063a768dbee14fb974cc822 100644 (file)
@@ -76,7 +76,8 @@ void clip_graph_tracking_values_iterate_track(
        BKE_movieclip_get_size(clip, &sc->user, &width, &height);
 
        for (coord = 0; coord < 2; coord++) {
-               int i, open = FALSE, prevfra = 0;
+               int i, prevfra = 0;
+               bool open = false;
                float prevval = 0.0f;
 
                for (i = 0; i < track->markersnr; i++) {
@@ -88,7 +89,7 @@ void clip_graph_tracking_values_iterate_track(
                                        if (segment_end)
                                                segment_end(userdata);
 
-                                       open = FALSE;
+                                       open = false;
                                }
 
                                continue;
@@ -98,7 +99,7 @@ void clip_graph_tracking_values_iterate_track(
                                if (segment_start)
                                        segment_start(userdata, track, coord);
 
-                               open = TRUE;
+                               open = true;
                                prevval = marker->pos[coord];
                        }
 
@@ -184,7 +185,7 @@ void clip_delete_track(bContext *C, MovieClip *clip, MovieTrackingTrack *track)
        ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
        ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(tracking);
 
-       int has_bundle = FALSE, update_stab = FALSE;
+       bool has_bundle = false, update_stab = false;
 
        if (track == act_track)
                tracking->act_track = NULL;
@@ -192,19 +193,19 @@ void clip_delete_track(bContext *C, MovieClip *clip, MovieTrackingTrack *track)
        if (track == stab->rot_track) {
                stab->rot_track = NULL;
 
-               update_stab = TRUE;
+               update_stab = true;
        }
 
        /* handle reconstruction display in 3d viewport */
        if (track->flag & TRACK_HAS_BUNDLE)
-               has_bundle = TRUE;
+               has_bundle = true;
 
        /* Make sure no plane will use freed track */
        for (plane_track = plane_tracks_base->first;
             plane_track;
             plane_track = next_plane_track)
        {
-               bool found  = false;
+               bool found = false;
                int i;
 
                next_plane_track = plane_track->next;
index feb35f869d6ec4ee0feb0376378c36d0e525f6db..8ecf9635af91a72e3b5eef9e68bd5f520a705057 100644 (file)
@@ -859,36 +859,36 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
        ARegion *ar_preview = ED_clip_has_preview_region(C, sa);
        ARegion *ar_properties = ED_clip_has_properties_region(sa);
        ARegion *ar_channels = ED_clip_has_channels_region(sa);
-       int main_visible = FALSE, preview_visible = FALSE, tools_visible = FALSE;
-       int tool_props_visible = FALSE, properties_visible = FALSE, channels_visible = FALSE;
-       int view_changed = FALSE;
+       bool main_visible = false, preview_visible = false, tools_visible = false;
+       bool tool_props_visible = false, properties_visible = false, channels_visible = false;
+       bool view_changed = false;
 
        switch (sc->view) {
                case SC_VIEW_CLIP:
-                       main_visible = TRUE;
-                       preview_visible = FALSE;
-                       tools_visible = TRUE;
-                       tool_props_visible = TRUE;
-                       properties_visible = TRUE;
-                       channels_visible = FALSE;
+                       main_visible = true;
+                       preview_visible = false;
+                       tools_visible = true;
+                       tool_props_visible = true;
+                       properties_visible = true;
+                       channels_visible = false;
                        break;
                case SC_VIEW_GRAPH:
-                       main_visible = FALSE;
-                       preview_visible = TRUE;
-                       tools_visible = FALSE;
-                       tool_props_visible = FALSE;
-                       properties_visible = FALSE;
-                       channels_visible = FALSE;
+                       main_visible = false;
+                       preview_visible = true;
+                       tools_visible = false;
+                       tool_props_visible = false;
+                       properties_visible = false;
+                       channels_visible = false;
 
                        reinit_preview_region(C, ar_preview);
                        break;
                case SC_VIEW_DOPESHEET:
-                       main_visible = FALSE;
-                       preview_visible = TRUE;
-                       tools_visible = FALSE;
-                       tool_props_visible = FALSE;
-                       properties_visible = FALSE;
-                       channels_visible = TRUE;
+                       main_visible = false;
+                       preview_visible = true;
+                       tools_visible = false;
+                       tool_props_visible = false;
+                       properties_visible = false;
+                       channels_visible = true;
 
                        reinit_preview_region(C, ar_preview);
                        break;
@@ -898,12 +898,12 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
                if (ar_main && (ar_main->flag & RGN_FLAG_HIDDEN)) {
                        ar_main->flag &= ~RGN_FLAG_HIDDEN;
                        ar_main->v2d.flag &= ~V2D_IS_INITIALISED;
-                       view_changed = TRUE;
+                       view_changed = true;
                }
 
                if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) {
                        ar_main->alignment = RGN_ALIGN_NONE;
-                       view_changed = TRUE;
+                       view_changed = true;
                }
        }
        else {
@@ -911,11 +911,11 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
                        ar_main->flag |= RGN_FLAG_HIDDEN;
                        ar_main->v2d.flag &= ~V2D_IS_INITIALISED;
                        WM_event_remove_handlers((bContext *)C, &ar_main->handlers);
-                       view_changed = TRUE;
+                       view_changed = true;
                }
                if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) {
                        ar_main->alignment = RGN_ALIGN_NONE;
-                       view_changed = TRUE;
+                       view_changed = true;
                }
        }
 
@@ -923,11 +923,11 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
                if (ar_properties && (ar_properties->flag & RGN_FLAG_HIDDEN)) {
                        ar_properties->flag &= ~RGN_FLAG_HIDDEN;
                        ar_properties->v2d.flag &= ~V2D_IS_INITIALISED;
-                       view_changed = TRUE;
+                       view_changed = true;
                }
                if (ar_properties && ar_properties->alignment != RGN_ALIGN_RIGHT) {
                        ar_properties->alignment = RGN_ALIGN_RIGHT;
-                       view_changed = TRUE;
+                       view_changed = true;
                }
        }
        else {
@@ -935,11 +935,11 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
                        ar_properties->flag |= RGN_FLAG_HIDDEN;
                        ar_properties->v2d.flag &= ~V2D_IS_INITIALISED;
                        WM_event_remove_handlers((bContext *)C, &ar_properties->handlers);
-                       view_changed = TRUE;
+                       view_changed = true;
                }
                if (ar_properties && ar_properties->alignment != RGN_ALIGN_NONE) {
                        ar_properties->alignment = RGN_ALIGN_NONE;
-                       view_changed = TRUE;
+                       view_changed = true;
                }
        }
 
@@ -947,11 +947,11 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
                if (ar_tools && (ar_tools->flag & RGN_FLAG_HIDDEN)) {
                        ar_tools->flag &= ~RGN_FLAG_HIDDEN;
                        ar_tools->v2d.flag &= ~V2D_IS_INITIALISED;
-                       view_changed = TRUE;
+                       view_changed = true;
                }
                if (ar_tools && ar_tools->alignment != RGN_ALIGN_LEFT) {
                        ar_tools->alignment = RGN_ALIGN_LEFT;
-                       view_changed = TRUE;
+                       view_changed = true;
                }
        }
        else {
@@ -959,11 +959,11 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
                        ar_tools->flag |= RGN_FLAG_HIDDEN;
                        ar_tools->v2d.flag &= ~V2D_IS_INITIALISED;
                        WM_event_remove_handlers((bContext *)C, &ar_tools->handlers);
-                       view_changed = TRUE;
+                       view_changed = true;
                }
                if (ar_tools && ar_tools->alignment != RGN_ALIGN_NONE) {
                        ar_tools->alignment = RGN_ALIGN_NONE;
-                       view_changed = TRUE;
+                       view_changed = true;
                }
        }
 
@@ -971,11 +971,11 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
                if (ar_tool_props && (ar_tool_props->flag & RGN_FLAG_HIDDEN)) {
                        ar_tool_props->flag &= ~RGN_FLAG_HIDDEN;
                        ar_tool_props->v2d.flag &= ~V2D_IS_INITIALISED;
-                       view_changed = TRUE;
+                       view_changed = true;
                }
                if (ar_tool_props && (ar_tool_props->alignment != (RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV))) {
                        ar_tool_props->alignment = RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV;
-                       view_changed = TRUE;
+                       view_changed = true;
                }
        }
        else {
@@ -983,11 +983,11 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
                        ar_tool_props->flag |= RGN_FLAG_HIDDEN;
                        ar_tool_props->v2d.flag &= ~V2D_IS_INITIALISED;
                        WM_event_remove_handlers((bContext *)C, &ar_tool_props->handlers);
-                       view_changed = TRUE;
+                       view_changed = true;
                }
                if (ar_tool_props && ar_tool_props->alignment != RGN_ALIGN_NONE) {
                        ar_tool_props->alignment = RGN_ALIGN_NONE;
-                       view_changed = TRUE;
+                       view_changed = true;
                }
        }
 
@@ -996,11 +996,11 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
                        ar_preview->flag &= ~RGN_FLAG_HIDDEN;
                        ar_preview->v2d.flag &= ~V2D_IS_INITIALISED;
                        ar_preview->v2d.cur = ar_preview->v2d.tot;
-                       view_changed = TRUE;
+                       view_changed = true;
                }
                if (ar_preview && ar_preview->alignment != RGN_ALIGN_NONE) {
                        ar_preview->alignment = RGN_ALIGN_NONE;
-                       view_changed = TRUE;
+                       view_changed = true;
                }
        }
        else {
@@ -1008,11 +1008,11 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
                        ar_preview->flag |= RGN_FLAG_HIDDEN;
                        ar_preview->v2d.flag &= ~V2D_IS_INITIALISED;
                        WM_event_remove_handlers((bContext *)C, &ar_preview->handlers);
-                       view_changed = TRUE;
+                       view_changed = true;
                }
                if (ar_preview && ar_preview->alignment != RGN_ALIGN_NONE) {
                        ar_preview->alignment = RGN_ALIGN_NONE;
-                       view_changed = TRUE;
+                       view_changed = true;
                }
        }
 
@@ -1020,11 +1020,11 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
                if (ar_channels && (ar_channels->flag & RGN_FLAG_HIDDEN)) {
                        ar_channels->flag &= ~RGN_FLAG_HIDDEN;
                        ar_channels->v2d.flag &= ~V2D_IS_INITIALISED;
-                       view_changed = TRUE;
+                       view_changed = true;
                }
                if (ar_channels && ar_channels->alignment != RGN_ALIGN_LEFT) {
                        ar_channels->alignment = RGN_ALIGN_LEFT;
-                       view_changed = TRUE;
+                       view_changed = true;
                }
        }
        else {
@@ -1032,11 +1032,11 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
                        ar_channels->flag |= RGN_FLAG_HIDDEN;
                        ar_channels->v2d.flag &= ~V2D_IS_INITIALISED;
                        WM_event_remove_handlers((bContext *)C, &ar_channels->handlers);
-                       view_changed = TRUE;
+                       view_changed = true;
                }
                if (ar_channels && ar_channels->alignment != RGN_ALIGN_NONE) {
                        ar_channels->alignment = RGN_ALIGN_NONE;
-                       view_changed = TRUE;
+                       view_changed = true;
                }
        }
 
@@ -1185,7 +1185,7 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar)
 
        if (sc->flag & SC_SHOW_GPENCIL) {
                /* Grease Pencil */
-               clip_draw_grease_pencil((bContext *)C, TRUE);
+               clip_draw_grease_pencil((bContext *)C, true);
        }
 
        /* reset view matrix */
@@ -1193,7 +1193,7 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar)
 
        if (sc->flag & SC_SHOW_GPENCIL) {
                /* draw Grease Pencil - screen space only */
-               clip_draw_grease_pencil((bContext *)C, FALSE);
+               clip_draw_grease_pencil((bContext *)C, false);
        }
 }
 
index e14fc8ad399b4ff4fc9d3f463243771771fb0cb1..8106befcab83c6b887f0cd7675c488127d71952a 100644 (file)
@@ -593,14 +593,14 @@ static int mouse_on_tilt(SpaceClip *sc, MovieTrackingMarker *marker, float co[2]
        return mouse_on_slide_zone(sc, marker, TRACK_AREA_PAT, co, slider, 0.0f, width, height);
 }
 
-static int slide_check_corners(float (*corners)[2])
+static bool slide_check_corners(float (*corners)[2])
 {
        int i, next, prev;
        float cross = 0.0f;
        float p[2] = {0.0f, 0.0f};
 
        if (!isect_point_quad_v2(p, corners[0], corners[1], corners[2], corners[3]))
-               return FALSE;
+               return false;
 
        for (i = 0; i < 4; i++) {
                float v1[2], v2[2], cur_cross;
@@ -618,12 +618,12 @@ static int slide_check_corners(float (*corners)[2])
                                cross = cur_cross;
                        }
                        else if (cross * cur_cross < 0.0f) {
-                               return FALSE;
+                               return false;
                        }
                }
        }
 
-       return TRUE;
+       return true;
 }
 
 static void hide_cursor(bContext *C)
@@ -664,25 +664,25 @@ MovieTrackingTrack *tracking_marker_check_slide(bContext *C, const wmEvent *even
        while (track) {
                if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED) == 0) {
                        MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
-                       int ok = FALSE;
+                       bool ok = false;
 
                        if ((marker->flag & MARKER_DISABLED) == 0) {
                                if (mouse_on_offset(sc, track, marker, co, width, height)) {
                                        area = TRACK_AREA_POINT;
                                        action = SLIDE_ACTION_POS;
-                                       ok = TRUE;
+                                       ok = true;
                                }
 
                                if (!ok && (sc->flag & SC_SHOW_MARKER_SEARCH)) {
                                        if (mouse_on_corner(sc, marker, TRACK_AREA_SEARCH, co, 1, 0.0f, width, height)) {
                                                area = TRACK_AREA_SEARCH;
                                                action = SLIDE_ACTION_OFFSET;
-                                               ok = TRUE;
+                                               ok = true;
                                        }
                                        else if (mouse_on_corner(sc, marker, TRACK_AREA_SEARCH, co, 0, 0.0f, width, height)) {
                                                area = TRACK_AREA_SEARCH;
                                                action = SLIDE_ACTION_SIZE;
-                                               ok = TRUE;
+                                               ok = true;
                                        }
                                }
 
@@ -693,7 +693,7 @@ MovieTrackingTrack *tracking_marker_check_slide(bContext *C, const wmEvent *even
                                                area = TRACK_AREA_PAT;
                                                action = SLIDE_ACTION_POS;
                                                corner = current_corner;
-                                               ok = TRUE;
+                                               ok = true;
                                        }
                                        else {
 #if 0
@@ -702,18 +702,18 @@ MovieTrackingTrack *tracking_marker_check_slide(bContext *C, const wmEvent *even
                                                if (mouse_on_corner(sc, marker, TRACK_AREA_PAT, co, 1, 12.0f, width, height)) {
                                                        area = TRACK_AREA_PAT;
                                                        action = SLIDE_ACTION_OFFSET;
-                                                       ok = TRUE;
+                                                       ok = true;
                                                }
                                                if (!ok && mouse_on_corner(sc, marker, TRACK_AREA_PAT, co, 0, 12.0f, width, height)) {
                                                        area = TRACK_AREA_PAT;
                                                        action = SLIDE_ACTION_SIZE;
-                                                       ok = TRUE;
+                                                       ok = true;
                                                }
 #endif
                                                if (!ok && mouse_on_tilt(sc, marker, co, width, height)) {
                                                        area = TRACK_AREA_PAT;
                                                        action = SLIDE_ACTION_TILT_SIZE;
-                                                       ok = TRUE;
+                                                       ok = true;
                                                }
                                        }
                                }
@@ -1145,18 +1145,18 @@ static void track_init_markers(SpaceClip *sc, MovieClip *clip, int *frames_limit
        *frames_limit_r = frames_limit;
 }
 
-static int track_markers_check_direction(int backwards, int curfra, int efra)
+static bool track_markers_check_direction(int backwards, int curfra, int efra)
 {
        if (backwards) {
                if (curfra < efra)
-                       return FALSE;
+                       return false;
        }
        else {
                if (curfra > efra)
-                       return FALSE;
+                       return false;
        }
 
-       return TRUE;
+       return true;
 }
 
 static int track_markers_initjob(bContext *C, TrackMarkersJob *tmj, int backwards)
@@ -1960,7 +1960,7 @@ static int count_selected_bundles(bContext *C)
 static void object_solver_inverted_matrix(Scene *scene, Object *ob, float invmat[4][4])
 {
        bConstraint *con;
-       int found = FALSE;
+       bool found = false;
 
        for (con = ob->constraints.first; con; con = con->next) {
                bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con);
@@ -1979,7 +1979,7 @@ static void object_solver_inverted_matrix(Scene *scene, Object *ob, float invmat
 
                        mul_m4_m4m4(invmat, invmat, data->invmat);
 
-                       found = TRUE;
+                       found = true;
                }
        }
 
@@ -2099,7 +2099,7 @@ static void set_axis(Scene *scene,  Object *ob, MovieClip *clip, MovieTrackingOb
 {
        Object *camera = get_camera_with_movieclip(scene, clip);
        int is_camera = tracking_object->flag & TRACKING_OBJECT_CAMERA;
-       int flip = FALSE;
+       bool flip = false;
        float mat[4][4], vec[3], obmat[4][4], dvec[3];
 
        BKE_object_to_mat4(ob, obmat);
@@ -2127,7 +2127,7 @@ static void set_axis(Scene *scene,  Object *ob, MovieClip *clip, MovieTrackingOb
 
        if (axis == 'X') {
                if (fabsf(dvec[1]) < 1e-3f) {
-                       flip = TRUE;
+                       flip = true;
 
                        mat[0][0] = -1.0f; mat[0][1] = 0.0f; mat[0][2] = 0.0f;
                        mat[1][0] = 0.0f; mat[1][1] = -1.0f; mat[1][2] = 0.0f;
@@ -2151,7 +2151,7 @@ static void set_axis(Scene *scene,  Object *ob, MovieClip *clip, MovieTrackingOb
        }
        else {
                if (fabsf(dvec[0]) < 1e-3f) {
-                       flip = TRUE;
+                       flip = true;
 
                        mat[0][0] = -1.0f; mat[0][1] = 0.0f; mat[0][2] = 0.0f;
                        mat[1][0] = 0.0f; mat[1][1] = -1.0f; mat[1][2] = 0.0f;
index 6e4d10173fb2af20b78a90e5e9f3213142b65081..7cb5f9b5dc0a6069b154fb8a7d39ca8cc5ac5391 100644 (file)
@@ -461,7 +461,8 @@ static int border_select_exec(bContext *C, wmOperator *op)
        ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(tracking);
        rcti rect;
        rctf rectf;
-       int change = FALSE, mode, extend;
+       bool change = false;
+       int mode, extend;
        int framenr = ED_space_clip_get_clip_frame_number(sc);
 
        /* get rectangle from operator */
@@ -490,7 +491,7 @@ static int border_select_exec(bContext *C, wmOperator *op)
                                        BKE_tracking_track_flag_clear(track, TRACK_AREA_ALL, SELECT);
                                }
 
-                               change = TRUE;
+                               change = true;
                        }
                }
 
@@ -520,7 +521,7 @@ static int border_select_exec(bContext *C, wmOperator *op)
                                }
                        }
 
-                       change = TRUE;
+                       change = true;
                }
        }
 
@@ -569,7 +570,7 @@ static int do_lasso_select_marker(bContext *C, const int mcords[][2], const shor
        ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
        ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(tracking);
        rcti rect;
-       int change = FALSE;
+       bool change = false;
        int framenr = ED_space_clip_get_clip_frame_number(sc);
 
        /* get rectangle from operator */
@@ -596,7 +597,7 @@ static int do_lasso_select_marker(bContext *C, const int mcords[][2], const shor
                                                BKE_tracking_track_flag_clear(track, TRACK_AREA_ALL, SELECT);
                                }
 
-                               change = TRUE;
+                               change = true;
                        }
                }
 
@@ -630,7 +631,7 @@ static int do_lasso_select_marker(bContext *C, const int mcords[][2], const shor
                                }
                        }
 
-                       change = TRUE;
+                       change = true;
                }
        }
 
@@ -713,7 +714,8 @@ static int circle_select_exec(bContext *C, wmOperator *op)
        MovieTrackingPlaneTrack *plane_track;
        ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
        ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(tracking);
-       int x, y, radius, width, height, mode, change = FALSE;
+       int x, y, radius, width, height, mode;
+       bool change = false;
        float zoomx, zoomy, offset[2], ellipse[2];
        int framenr = ED_space_clip_get_clip_frame_number(sc);
 
@@ -745,7 +747,7 @@ static int circle_select_exec(bContext *C, wmOperator *op)
                                else
                                        BKE_tracking_track_flag_clear(track, TRACK_AREA_ALL, SELECT);
 
-                               change = TRUE;
+                               change = true;
                        }
                }
 
@@ -772,7 +774,7 @@ static int circle_select_exec(bContext *C, wmOperator *op)
                                }
                        }
 
-                       change = TRUE;
+                       change = true;
                }
        }
 
@@ -824,7 +826,7 @@ static int select_all_exec(bContext *C, wmOperator *op)
        ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(tracking);
        int action = RNA_enum_get(op->ptr, "action");
        int framenr = ED_space_clip_get_clip_frame_number(sc);
-       int has_selection = FALSE;
+       bool has_selection = false;
 
        if (action == SEL_TOGGLE) {
                action = SEL_SELECT;
@@ -877,7 +879,7 @@ static int select_all_exec(bContext *C, wmOperator *op)
                }
 
                if (TRACK_VIEW_SELECTED(sc, track))
-                       has_selection = TRUE;
+                       has_selection = true;
        }
 
        for (plane_track = plane_tracks_base->first;
@@ -899,7 +901,7 @@ static int select_all_exec(bContext *C, wmOperator *op)
                }
 
                if (plane_track->flag & SELECT) {
-                       has_selection = TRUE;
+                       has_selection = true;
                }
        }
 
@@ -945,7 +947,7 @@ static int select_groped_exec(bContext *C, wmOperator *op)
 
        track = tracksbase->first;
        while (track) {
-               int ok = FALSE;
+               bool ok = false;
 
                marker = BKE_tracking_marker_get(track, framenr);