Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_image/image_buttons.c
| Show First 20 Lines • Show All 865 Lines • ▼ Show 20 Lines | void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, PointerRNA *userptr, int compact, int multiview) | ||||
| cb = MEM_callocN(sizeof(RNAUpdateCb), "RNAUpdateCb"); | cb = MEM_callocN(sizeof(RNAUpdateCb), "RNAUpdateCb"); | ||||
| cb->ptr = *ptr; | cb->ptr = *ptr; | ||||
| cb->prop = prop; | cb->prop = prop; | ||||
| cb->iuser = iuser; | cb->iuser = iuser; | ||||
| uiLayoutSetContextPointer(layout, "edit_image", &imaptr); | uiLayoutSetContextPointer(layout, "edit_image", &imaptr); | ||||
| uiLayoutSetContextPointer(layout, "edit_image_user", userptr); | uiLayoutSetContextPointer(layout, "edit_image_user", userptr); | ||||
| if (!compact) | if (!compact) { | ||||
| uiTemplateID(layout, C, ptr, propname, ima ? NULL : "IMAGE_OT_new", "IMAGE_OT_open", NULL); | uiTemplateID( | ||||
| layout, C, ptr, propname, | |||||
| ima ? NULL : "IMAGE_OT_new", "IMAGE_OT_open", NULL, UI_TEMPLATE_ID_FILTER_NONE); | |||||
| } | |||||
| if (ima) { | if (ima) { | ||||
| UI_block_funcN_set(block, rna_update_cb, MEM_dupallocN(cb), NULL); | UI_block_funcN_set(block, rna_update_cb, MEM_dupallocN(cb), NULL); | ||||
| if (ima->source == IMA_SRC_VIEWER) { | if (ima->source == IMA_SRC_VIEWER) { | ||||
| ImBuf *ibuf = BKE_image_acquire_ibuf(ima, iuser, &lock); | ImBuf *ibuf = BKE_image_acquire_ibuf(ima, iuser, &lock); | ||||
| image_info(scene, iuser, ima, ibuf, str, MAX_IMAGE_INFO_LEN); | image_info(scene, iuser, ima, ibuf, str, MAX_IMAGE_INFO_LEN); | ||||
| BKE_image_release_ibuf(ima, ibuf, lock); | BKE_image_release_ibuf(ima, ibuf, lock); | ||||
| ▲ Show 20 Lines • Show All 464 Lines • Show Last 20 Lines | |||||