Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_image/space_image.c
| Show First 20 Lines • Show All 247 Lines • ▼ Show 20 Lines | |||||
| static void image_keymap(struct wmKeyConfig *keyconf) | static void image_keymap(struct wmKeyConfig *keyconf) | ||||
| { | { | ||||
| WM_keymap_ensure(keyconf, "Image Generic", SPACE_IMAGE, 0); | WM_keymap_ensure(keyconf, "Image Generic", SPACE_IMAGE, 0); | ||||
| WM_keymap_ensure(keyconf, "Image", SPACE_IMAGE, 0); | WM_keymap_ensure(keyconf, "Image", SPACE_IMAGE, 0); | ||||
| } | } | ||||
| /* dropboxes */ | /* dropboxes */ | ||||
| static bool image_drop_poll(bContext *C, | static bool image_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) | ||||
| wmDrag *drag, | |||||
| const wmEvent *event, | |||||
| const char **UNUSED(r_tooltip)) | |||||
| { | { | ||||
| ScrArea *area = CTX_wm_area(C); | ScrArea *area = CTX_wm_area(C); | ||||
| if (ED_region_overlap_isect_any_xy(area, &event->x)) { | if (ED_region_overlap_isect_any_xy(area, &event->x)) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| if (drag->type == WM_DRAG_PATH) { | if (drag->type == WM_DRAG_PATH) { | ||||
| /* rule might not work? */ | /* rule might not work? */ | ||||
| if (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE, ICON_FILE_BLANK)) { | if (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE, ICON_FILE_BLANK)) { | ||||
| Show All 9 Lines | static void image_drop_copy(wmDrag *drag, wmDropBox *drop) | ||||
| RNA_string_set(drop->ptr, "filepath", drag->path); | RNA_string_set(drop->ptr, "filepath", drag->path); | ||||
| } | } | ||||
| /* area+region dropbox definition */ | /* area+region dropbox definition */ | ||||
| static void image_dropboxes(void) | static void image_dropboxes(void) | ||||
| { | { | ||||
| ListBase *lb = WM_dropboxmap_find("Image", SPACE_IMAGE, 0); | ListBase *lb = WM_dropboxmap_find("Image", SPACE_IMAGE, 0); | ||||
| WM_dropbox_add(lb, "IMAGE_OT_open", image_drop_poll, image_drop_copy, NULL); | WM_dropbox_add(lb, "IMAGE_OT_open", image_drop_poll, image_drop_copy, NULL, NULL); | ||||
| } | } | ||||
| /** | /** | ||||
| * \note take care not to get into feedback loop here, | * \note take care not to get into feedback loop here, | ||||
| * calling composite job causes viewer to refresh. | * calling composite job causes viewer to refresh. | ||||
| */ | */ | ||||
| static void image_refresh(const bContext *C, ScrArea *area) | static void image_refresh(const bContext *C, ScrArea *area) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 842 Lines • Show Last 20 Lines | |||||