diff options
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/image_buttons.c | 54 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_edit.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 58 | ||||
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 22 |
4 files changed, 70 insertions, 70 deletions
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index f88cdaf6713..97a8e9b59d0 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -179,7 +179,7 @@ void image_preview_event(int event) ntreeCompositTagGenerators(G.scene->nodetree); - G.is_break = FALSE; + G.is_break = false; G.scene->nodetree->timecursor = set_timecursor; G.scene->nodetree->test_break = blender_test_break; @@ -509,7 +509,7 @@ static void uiblock_layer_pass_buttons(uiLayout *layout, RenderResult *rr, Image const char *fake_name; const char *display_name; - uiLayoutRow(layout, TRUE); + uiLayoutRow(layout, true); /* layer menu is 1/3 larger than pass */ wmenu1 = (2 * w) / 5; @@ -561,7 +561,7 @@ static void uiblock_layer_pass_arrow_buttons(uiLayout *layout, RenderResult *rr, uiBut *but; const float dpi_fac = UI_DPI_FAC; - row = uiLayoutRow(layout, TRUE); + row = uiLayoutRow(layout, true); if (rr == NULL || iuser == NULL) return; @@ -706,13 +706,13 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char uiItemR(layout, &imaptr, "source", 0, NULL, ICON_NONE); if (ima->source != IMA_SRC_GENERATED) { - row = uiLayoutRow(layout, TRUE); + row = uiLayoutRow(layout, true); if (ima->packedfile) uiItemO(row, "", ICON_PACKAGE, "image.unpack"); else uiItemO(row, "", ICON_UGLYPACKAGE, "image.pack"); - row = uiLayoutRow(row, TRUE); + row = uiLayoutRow(row, true); uiLayoutSetEnabled(row, ima->packedfile == NULL); uiItemR(row, &imaptr, "filepath", 0, "", ICON_NONE); uiItemO(row, "", ICON_FILE_REFRESH, "image.reload"); @@ -742,7 +742,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char } } - col = uiLayoutColumn(layout, FALSE); + col = uiLayoutColumn(layout, false); uiTemplateColorspaceSettings(col, &imaptr, "colorspace_settings"); uiItemR(col, &imaptr, "use_view_as_render", 0, NULL, ICON_NONE); @@ -761,29 +761,29 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char } if (has_alpha) { - col = uiLayoutColumn(layout, FALSE); + col = uiLayoutColumn(layout, false); uiItemR(col, &imaptr, "use_alpha", 0, NULL, ICON_NONE); uiItemR(col, &imaptr, "alpha_mode", 0, "Alpha", ICON_NONE); } uiItemS(layout); - split = uiLayoutSplit(layout, 0.0f, FALSE); + split = uiLayoutSplit(layout, 0.0f, false); - col = uiLayoutColumn(split, FALSE); + col = uiLayoutColumn(split, false); /* XXX Why only display fields_per_frame only for video image types? * And why allow fields for non-video image types at all??? */ if (BKE_image_is_animated(ima)) { - uiLayout *subsplit = uiLayoutSplit(col, 0.0f, FALSE); - uiLayout *subcol = uiLayoutColumn(subsplit, FALSE); + uiLayout *subsplit = uiLayoutSplit(col, 0.0f, false); + uiLayout *subcol = uiLayoutColumn(subsplit, false); uiItemR(subcol, &imaptr, "use_fields", 0, NULL, ICON_NONE); - subcol = uiLayoutColumn(subsplit, FALSE); + subcol = uiLayoutColumn(subsplit, false); uiLayoutSetActive(subcol, RNA_boolean_get(&imaptr, "use_fields")); uiItemR(subcol, userptr, "fields_per_frame", 0, IFACE_("Fields"), ICON_NONE); } else uiItemR(col, &imaptr, "use_fields", 0, NULL, ICON_NONE); - row = uiLayoutRow(col, FALSE); + row = uiLayoutRow(col, false); uiLayoutSetActive(row, RNA_boolean_get(&imaptr, "use_fields")); uiItemR(row, &imaptr, "field_order", UI_ITEM_R_EXPAND, NULL, ICON_NONE); } @@ -792,24 +792,24 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char if (BKE_image_is_animated(ima)) { uiItemS(layout); - split = uiLayoutSplit(layout, 0.0f, FALSE); + split = uiLayoutSplit(layout, 0.0f, false); - col = uiLayoutColumn(split, FALSE); + col = uiLayoutColumn(split, false); BLI_snprintf(str, sizeof(str), IFACE_("(%d) Frames"), iuser->framenr); uiItemR(col, userptr, "frame_duration", 0, str, ICON_NONE); uiItemR(col, userptr, "frame_start", 0, IFACE_("Start"), ICON_NONE); uiItemR(col, userptr, "frame_offset", 0, NULL, ICON_NONE); - col = uiLayoutColumn(split, FALSE); + col = uiLayoutColumn(split, false); uiItemO(col, NULL, ICON_NONE, "IMAGE_OT_match_movie_length"); uiItemR(col, userptr, "use_auto_refresh", 0, NULL, ICON_NONE); uiItemR(col, userptr, "use_cyclic", 0, NULL, ICON_NONE); } else if (ima->source == IMA_SRC_GENERATED) { - split = uiLayoutSplit(layout, 0.0f, FALSE); + split = uiLayoutSplit(layout, 0.0f, false); - col = uiLayoutColumn(split, TRUE); + col = uiLayoutColumn(split, true); uiItemR(col, &imaptr, "generated_width", 0, "X", ICON_NONE); uiItemR(col, &imaptr, "generated_height", 0, "Y", ICON_NONE); @@ -839,14 +839,14 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr, int color_man const bool is_render_out = (id && GS(id->name) == ID_SCE); uiLayout *col, *row, *split, *sub; - int show_preview = FALSE; + int show_preview = false; - col = uiLayoutColumn(layout, FALSE); + col = uiLayoutColumn(layout, false); - split = uiLayoutSplit(col, 0.5f, FALSE); + split = uiLayoutSplit(col, 0.5f, false); uiItemR(split, imfptr, "file_format", 0, "", ICON_NONE); - sub = uiLayoutRow(split, FALSE); + sub = uiLayoutRow(split, false); uiItemR(sub, imfptr, "color_mode", UI_ITEM_R_EXPAND, IFACE_("Color"), ICON_NONE); /* only display depth setting if multiple depths can be used */ @@ -859,7 +859,7 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr, int color_man R_IMF_CHAN_DEPTH_24, R_IMF_CHAN_DEPTH_32)) == 0) { - row = uiLayoutRow(col, FALSE); + row = uiLayoutRow(col, false); uiItemL(row, IFACE_("Color Depth:"), ICON_NONE); uiItemR(row, imfptr, "color_depth", UI_ITEM_R_EXPAND, NULL, ICON_NONE); @@ -877,20 +877,20 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr, int color_man uiItemR(col, imfptr, "exr_codec", 0, NULL, ICON_NONE); } - row = uiLayoutRow(col, FALSE); + row = uiLayoutRow(col, false); if (BKE_imtype_supports_zbuf(imf->imtype)) { uiItemR(row, imfptr, "use_zbuffer", 0, NULL, ICON_NONE); } if (is_render_out && (imf->imtype == R_IMF_IMTYPE_OPENEXR)) { - show_preview = TRUE; + show_preview = true; uiItemR(row, imfptr, "use_preview", 0, NULL, ICON_NONE); } if (imf->imtype == R_IMF_IMTYPE_JP2) { uiItemR(col, imfptr, "jpeg2k_codec", 0, NULL, ICON_NONE); - row = uiLayoutRow(col, FALSE); + row = uiLayoutRow(col, false); uiItemR(row, imfptr, "use_jpeg2k_cinema_preset", 0, NULL, ICON_NONE); uiItemR(row, imfptr, "use_jpeg2k_cinema_48", 0, NULL, ICON_NONE); @@ -920,7 +920,7 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr, int color_man prop = RNA_struct_find_property(imfptr, "display_settings"); display_settings_ptr = RNA_property_pointer_get(imfptr, prop); - col = uiLayoutColumn(layout, FALSE); + col = uiLayoutColumn(layout, false); uiItemL(col, IFACE_("Color Management"), ICON_NONE); uiItemR(col, &display_settings_ptr, "display_device", 0, NULL, ICON_NONE); diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c index 9b9c13a1d4f..deabcfa85f4 100644 --- a/source/blender/editors/space_image/image_edit.c +++ b/source/blender/editors/space_image/image_edit.c @@ -345,7 +345,7 @@ bool ED_space_image_check_show_maskedit(Scene *scene, SpaceImage *sima) /* check editmode - this is reserved for UV editing */ Object *ob = OBACT; if (ob && ob->mode & OB_MODE_EDIT && ED_space_image_show_uvedit(sima, ob)) { - return FALSE; + return false; } return (sima->mode == SI_MODE_MASK); @@ -360,7 +360,7 @@ int ED_space_image_maskedit_poll(bContext *C) return ED_space_image_check_show_maskedit(scene, sima); } - return FALSE; + return false; } int ED_space_image_maskedit_mask_poll(bContext *C) @@ -370,6 +370,6 @@ int ED_space_image_maskedit_mask_poll(bContext *C) return sima->mask_info.mask != NULL; } - return FALSE; + return false; } diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 90e308ecfa2..93cb1acaa8b 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -156,7 +156,7 @@ static int space_image_file_exists_poll(bContext *C) SpaceImage *sima = CTX_wm_space_image(C); ImBuf *ibuf; void *lock; - int ret = FALSE; + int ret = false; char name[FILE_MAX]; ibuf = ED_space_image_acquire_buffer(sima, &lock); @@ -164,14 +164,14 @@ static int space_image_file_exists_poll(bContext *C) BLI_strncpy(name, ibuf->name, FILE_MAX); BLI_path_abs(name, bmain->name); - if (BLI_exists(name) == FALSE) { + if (BLI_exists(name) == false) { CTX_wm_operator_poll_msg_set(C, "image file not found"); } else if (!BLI_file_is_writable(name)) { CTX_wm_operator_poll_msg_set(C, "image path can't be written to"); } else { - ret = TRUE; + ret = true; } } ED_space_image_release_buffer(sima, ibuf, lock); @@ -223,16 +223,16 @@ static int image_sample_poll(bContext *C) if (obedit) { if (ED_space_image_show_uvedit(sima, obedit) && (toolsettings->use_uv_sculpt)) - return FALSE; + return false; } else if (sima->mode != SI_MODE_VIEW) { - return FALSE; + return false; } return space_image_main_area_poll(C); } else { - return FALSE; + return false; } } /********************** view pan operator *********************/ @@ -1459,11 +1459,11 @@ static void save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI if (ibuf) { ImBuf *colormanaged_ibuf; const char *relbase = ID_BLEND_PATH(CTX_data_main(C), &ima->id); - const short relative = (RNA_struct_find_property(op->ptr, "relative_path") && RNA_boolean_get(op->ptr, "relative_path")); - const short save_copy = (RNA_struct_find_property(op->ptr, "copy") && RNA_boolean_get(op->ptr, "copy")); + const bool relative = (RNA_struct_find_property(op->ptr, "relative_path") && RNA_boolean_get(op->ptr, "relative_path")); + const bool save_copy = (RNA_struct_find_property(op->ptr, "copy") && RNA_boolean_get(op->ptr, "copy")); const bool save_as_render = (RNA_struct_find_property(op->ptr, "save_as_render") && RNA_boolean_get(op->ptr, "save_as_render")); ImageFormatData *imf = &simopts->im_format; - short ok = FALSE; + bool ok = false; /* old global to ensure a 2nd save goes to same dir */ BLI_strncpy(G.ima, simopts->filepath, sizeof(G.ima)); @@ -1494,7 +1494,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI RenderResult *rr = BKE_image_acquire_renderresult(scene, ima); if (rr) { RE_WriteRenderResult(op->reports, rr, simopts->filepath, simopts->im_format.exr_codec); - ok = TRUE; + ok = true; } else { BKE_report(op->reports, RPT_ERROR, "Did not write, no Multilayer Image"); @@ -1503,7 +1503,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI } else { if (BKE_imbuf_write_as(colormanaged_ibuf, simopts->filepath, &simopts->im_format, save_copy)) { - ok = TRUE; + ok = true; } } @@ -1593,7 +1593,7 @@ static int image_save_as_exec(bContext *C, wmOperator *op) save_image_options_from_op(&simopts, op); - save_image_doit(C, sima, op, &simopts, TRUE); + save_image_doit(C, sima, op, &simopts, true); image_save_as_free(op); return OPERATOR_FINISHED; @@ -1625,7 +1625,7 @@ static int image_save_as_invoke(bContext *C, wmOperator *op, const wmEvent *UNUS /* enable save_copy by default for render results */ if (ELEM(ima->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE) && !RNA_struct_property_is_set(op->ptr, "copy")) { - RNA_boolean_set(op->ptr, "copy", TRUE); + RNA_boolean_set(op->ptr, "copy", true); } RNA_boolean_set(op->ptr, "save_as_render", save_as_render); @@ -1663,7 +1663,7 @@ static void image_save_as_draw(bContext *UNUSED(C), wmOperator *op) /* image template */ RNA_pointer_create(NULL, &RNA_ImageFormatSettings, imf, &ptr); - uiTemplateImageSettings(layout, &ptr, FALSE); + uiTemplateImageSettings(layout, &ptr, false); /* main draw call */ RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr); @@ -1680,12 +1680,12 @@ static int image_save_as_poll(bContext *C) if (ima->source == IMA_SRC_VIEWER) { CTX_wm_operator_poll_msg_set(C, "can't save image while rendering"); - return FALSE; + return false; } } - return TRUE; + return true; } - return FALSE; + return false; } void IMAGE_OT_save_as(wmOperatorType *ot) @@ -1730,7 +1730,7 @@ static int image_save_exec(bContext *C, wmOperator *op) save_image_options_from_op(&simopts, op); if (BLI_exists(simopts.filepath) && BLI_file_is_writable(simopts.filepath)) { - save_image_doit(C, sima, op, &simopts, FALSE); + save_image_doit(C, sima, op, &simopts, false); } else { BKE_reportf(op->reports, RPT_ERROR, "Cannot save image, path '%s' is not writable", simopts.filepath); @@ -2018,10 +2018,10 @@ static int image_invert_exec(bContext *C, wmOperator *op) bool support_undo = ((sima != NULL) && (sima->mode == SI_MODE_PAINT)); /* flags indicate if this channel should be inverted */ - const short r = RNA_boolean_get(op->ptr, "invert_r"); - const short g = RNA_boolean_get(op->ptr, "invert_g"); - const short b = RNA_boolean_get(op->ptr, "invert_b"); - const short a = RNA_boolean_get(op->ptr, "invert_a"); + const bool r = RNA_boolean_get(op->ptr, "invert_r"); + const bool g = RNA_boolean_get(op->ptr, "invert_g"); + const bool b = RNA_boolean_get(op->ptr, "invert_b"); + const bool a = RNA_boolean_get(op->ptr, "invert_a"); int i; @@ -2330,7 +2330,7 @@ bool ED_space_image_color_sample(SpaceImage *sima, ARegion *ar, int mval[2], flo if (ibuf == NULL) { ED_space_image_release_buffer(sima, ibuf, lock); - return FALSE; + return false; } UI_view2d_region_to_view(&ar->v2d, mval[0], mval[1], &fx, &fy); @@ -2346,12 +2346,12 @@ bool ED_space_image_color_sample(SpaceImage *sima, ARegion *ar, int mval[2], flo 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; } } @@ -2397,7 +2397,7 @@ static void image_sample_apply(bContext *C, wmOperator *op, const wmEvent *event info->zp = NULL; info->zfp = NULL; - info->use_default_view = (image->flag & IMA_VIEW_AS_RENDER) ? FALSE : TRUE; + info->use_default_view = (image->flag & IMA_VIEW_AS_RENDER) ? false : true; if (ibuf->rect) { cp = (unsigned char *)(ibuf->rect + y * ibuf->x + x); @@ -2417,7 +2417,7 @@ static void image_sample_apply(bContext *C, wmOperator *op, const wmEvent *event copy_v4_v4(info->linearcol, info->colf); IMB_colormanagement_colorspace_to_scene_linear_v4(info->linearcol, false, ibuf->rect_colorspace); - info->color_manage = TRUE; + info->color_manage = true; } if (ibuf->rect_float) { fp = (ibuf->rect_float + (ibuf->channels) * (y * ibuf->x + x)); @@ -2430,7 +2430,7 @@ static void image_sample_apply(bContext *C, wmOperator *op, const wmEvent *event copy_v4_v4(info->linearcol, info->colf); - info->color_manage = TRUE; + info->color_manage = true; } if (ibuf->zbuf) { @@ -2827,7 +2827,7 @@ static int image_cycle_render_slot_exec(bContext *C, wmOperator *op) { Image *ima = CTX_data_edit_image(C); int a, slot, cur = ima->render_slot; - const short use_reverse = RNA_boolean_get(op->ptr, "reverse"); + const bool use_reverse = RNA_boolean_get(op->ptr, "reverse"); for (a = 1; a < IMA_MAX_RENDER_SLOT; a++) { slot = (cur + (use_reverse ? -a : a)) % IMA_MAX_RENDER_SLOT; diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 14fd486c546..1224ade8337 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -153,10 +153,10 @@ static SpaceLink *image_new(const bContext *UNUSED(C)) simage = MEM_callocN(sizeof(SpaceImage), "initimage"); simage->spacetype = SPACE_IMAGE; simage->zoom = 1.0f; - simage->lock = TRUE; + simage->lock = true; simage->flag = SI_SHOW_GPENCIL | SI_USE_ALPHA; - simage->iuser.ok = TRUE; + simage->iuser.ok = true; simage->iuser.fie_ima = 2; simage->iuser.frames = 100; @@ -274,14 +274,14 @@ static void image_keymap(struct wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "IMAGE_OT_toolshelf", TKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "IMAGE_OT_cycle_render_slot", JKEY, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "IMAGE_OT_cycle_render_slot", JKEY, KM_PRESS, KM_ALT, 0)->ptr, "reverse", TRUE); + RNA_boolean_set(WM_keymap_add_item(keymap, "IMAGE_OT_cycle_render_slot", JKEY, KM_PRESS, KM_ALT, 0)->ptr, "reverse", true); keymap = WM_keymap_find(keyconf, "Image", SPACE_IMAGE, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_all", HOMEKEY, KM_PRESS, 0, 0); kmi = WM_keymap_add_item(keymap, "IMAGE_OT_view_all", FKEY, KM_PRESS, 0, 0); - RNA_boolean_set(kmi->ptr, "fit_view", TRUE); + RNA_boolean_set(kmi->ptr, "fit_view", true); WM_keymap_add_item(keymap, "IMAGE_OT_view_selected", PADPERIOD, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_pan", MIDDLEMOUSE, KM_PRESS, 0, 0); @@ -319,7 +319,7 @@ static void image_keymap(struct wmKeyConfig *keyconf) /* toggle editmode is handy to have while UV unwrapping */ kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "mode", OB_MODE_EDIT); - RNA_boolean_set(kmi->ptr, "toggle", TRUE); + RNA_boolean_set(kmi->ptr, "toggle", true); /* fast switch to render slots */ for (i = 0; i < MAX2(IMA_MAX_RENDER_SLOT, 9); i++) { @@ -395,8 +395,8 @@ static void image_refresh(const bContext *C, ScrArea *sa) else if (obedit && obedit->type == OB_MESH) { Mesh *me = (Mesh *)obedit->data; struct BMEditMesh *em = me->edit_btmesh; - int sloppy = TRUE; /* partially selected face is ok */ - int selected = !(scene->toolsettings->uv_flag & UV_SYNC_SELECTION); /* only selected active face? */ + bool sloppy = true; /* partially selected face is ok */ + bool selected = !(scene->toolsettings->uv_flag & UV_SYNC_SELECTION); /* only selected active face? */ if (BKE_scene_use_new_shading_nodes(scene)) { /* new shading system does not alter image */ @@ -550,7 +550,7 @@ static int image_context(const bContext *C, const char *member, bContextDataResu if (mask) { CTX_data_id_pointer_set(result, &mask->id); } - return TRUE; + return true; } return 0; } @@ -697,7 +697,7 @@ static void image_main_area_draw(const bContext *C, ARegion *ar) if (sima->flag & SI_SHOW_GPENCIL) { /* Grease Pencil too (in addition to UV's) */ - draw_image_grease_pencil((bContext *)C, TRUE); + draw_image_grease_pencil((bContext *)C, true); } /* sample line */ @@ -707,7 +707,7 @@ static void image_main_area_draw(const bContext *C, ARegion *ar) if (sima->flag & SI_SHOW_GPENCIL) { /* draw Grease Pencil - screen space only */ - draw_image_grease_pencil((bContext *)C, FALSE); + draw_image_grease_pencil((bContext *)C, false); } if (mask) { @@ -736,7 +736,7 @@ static void image_main_area_draw(const bContext *C, ARegion *ar) sima->mask_info.overlay_mode, width, height, aspx, aspy, - TRUE, FALSE, + true, false, NULL, C); ED_mask_draw_frames(mask, ar, CFRA, mask->sfra, mask->efra); |