From b88e51dd55c62bdc160f33f9b2ae1727a892560a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 2 Jul 2018 11:47:00 +0200 Subject: Cleanup: use bool for poll functions --- source/blender/editors/space_image/image_edit.c | 4 ++-- source/blender/editors/space_image/image_intern.h | 2 +- source/blender/editors/space_image/image_ops.c | 26 +++++++++++------------ source/blender/editors/space_image/space_image.c | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) (limited to 'source/blender/editors/space_image') diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c index 886f4377e10..5eaefcc9bb2 100644 --- a/source/blender/editors/space_image/image_edit.c +++ b/source/blender/editors/space_image/image_edit.c @@ -386,7 +386,7 @@ bool ED_space_image_check_show_maskedit(Scene *scene, SpaceImage *sima) return (sima->mode == SI_MODE_MASK); } -int ED_space_image_maskedit_poll(bContext *C) +bool ED_space_image_maskedit_poll(bContext *C) { SpaceImage *sima = CTX_wm_space_image(C); @@ -413,7 +413,7 @@ bool ED_space_image_paint_curve(const bContext *C) } -int ED_space_image_maskedit_mask_poll(bContext *C) +bool ED_space_image_maskedit_mask_poll(bContext *C) { if (ED_space_image_maskedit_poll(C)) { SpaceImage *sima = CTX_wm_space_image(C); diff --git a/source/blender/editors/space_image/image_intern.h b/source/blender/editors/space_image/image_intern.h index f56915fd287..f7fec4ed396 100644 --- a/source/blender/editors/space_image/image_intern.h +++ b/source/blender/editors/space_image/image_intern.h @@ -54,7 +54,7 @@ void draw_image_grease_pencil(struct bContext *C, bool onlyv2d); void draw_image_sample_line(struct SpaceImage *sima); /* image_ops.c */ -int space_image_main_region_poll(struct bContext *C); +bool space_image_main_region_poll(struct bContext *C); void IMAGE_OT_view_all(struct wmOperatorType *ot); void IMAGE_OT_view_pan(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index a441dedc57a..d9f66ef175a 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -179,13 +179,13 @@ static void sima_zoom_set_from_bounds(SpaceImage *sima, ARegion *ar, const rctf } #if 0 // currently unused -static int image_poll(bContext *C) +static bool image_poll(bContext *C) { return (CTX_data_edit_image(C) != NULL); } #endif -static int space_image_buffer_exists_poll(bContext *C) +static bool space_image_buffer_exists_poll(bContext *C) { SpaceImage *sima = CTX_wm_space_image(C); if (sima && ED_space_image_has_buffer(sima)) { @@ -194,7 +194,7 @@ static int space_image_buffer_exists_poll(bContext *C) return false; } -static int image_not_packed_poll(bContext *C) +static bool image_not_packed_poll(bContext *C) { SpaceImage *sima = CTX_wm_space_image(C); @@ -213,7 +213,7 @@ static bool imbuf_format_writeable(const ImBuf *ibuf) return (BKE_image_imtype_to_ftype(im_format.imtype, &options_dummy) == ibuf->ftype); } -static int space_image_file_exists_poll(bContext *C) +static bool space_image_file_exists_poll(bContext *C) { if (space_image_buffer_exists_poll(C)) { Main *bmain = CTX_data_main(C); @@ -249,7 +249,7 @@ static int space_image_file_exists_poll(bContext *C) } #if 0 /* UNUSED */ -static int space_image_poll(bContext *C) +static bool space_image_poll(bContext *C) { SpaceImage *sima = CTX_wm_space_image(C); if (sima && sima->image) { @@ -259,7 +259,7 @@ static int space_image_poll(bContext *C) } #endif -int space_image_main_region_poll(bContext *C) +bool space_image_main_region_poll(bContext *C) { SpaceImage *sima = CTX_wm_space_image(C); /* XXX ARegion *ar = CTX_wm_region(C); */ @@ -271,7 +271,7 @@ int space_image_main_region_poll(bContext *C) } /* For IMAGE_OT_curves_point_set to avoid sampling when in uv smooth mode or editmode */ -static int space_image_main_area_not_uv_brush_poll(bContext *C) +static bool space_image_main_area_not_uv_brush_poll(bContext *C) { SpaceImage *sima = CTX_wm_space_image(C); Scene *scene = CTX_data_scene(C); @@ -283,7 +283,7 @@ static int space_image_main_area_not_uv_brush_poll(bContext *C) return 0; } -static int image_sample_poll(bContext *C) +static bool image_sample_poll(bContext *C) { SpaceImage *sima = CTX_wm_space_image(C); if (sima) { @@ -830,7 +830,7 @@ static int image_view_selected_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static int image_view_selected_poll(bContext *C) +static bool image_view_selected_poll(bContext *C) { return (space_image_main_region_poll(C) && (ED_operator_uvedit(C) || ED_operator_mask(C))); } @@ -2152,7 +2152,7 @@ static void image_save_as_draw(bContext *UNUSED(C), wmOperator *op) uiTemplateImageFormatViews(layout, &imf_ptr, op->ptr); } -static int image_save_as_poll(bContext *C) +static bool image_save_as_poll(bContext *C) { if (space_image_buffer_exists_poll(C)) { if (G.is_rendering) { @@ -2596,7 +2596,7 @@ void IMAGE_OT_new(wmOperatorType *ot) /********************* invert operators *********************/ -static int image_invert_poll(bContext *C) +static bool image_invert_poll(bContext *C) { Image *ima = CTX_data_edit_image(C); @@ -3440,7 +3440,7 @@ void IMAGE_OT_record_composite(wmOperatorType *ot) /********************* cycle render slot operator *********************/ -static int image_cycle_render_slot_poll(bContext *C) +static bool image_cycle_render_slot_poll(bContext *C) { Image *ima = CTX_data_edit_image(C); @@ -3484,7 +3484,7 @@ void IMAGE_OT_cycle_render_slot(wmOperatorType *ot) /********************** change frame operator *********************/ -static int change_frame_poll(bContext *C) +static bool change_frame_poll(bContext *C) { /* prevent changes during render */ if (G.is_rendering) diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 3cca13ea7dd..b9c0ca66778 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -374,7 +374,7 @@ static void image_keymap(struct wmKeyConfig *keyconf) } /* dropboxes */ -static int image_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) +static bool image_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { if (drag->type == WM_DRAG_PATH) if (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */ -- cgit v1.2.3