Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_file/space_file.c
| Show First 20 Lines • Show All 809 Lines • ▼ Show 20 Lines | case NC_SPACE: | ||||
| case ND_SPACE_FILE_LIST: | case ND_SPACE_FILE_LIST: | ||||
| ED_region_tag_redraw(region); | ED_region_tag_redraw(region); | ||||
| break; | break; | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| static bool filepath_drop_poll(bContext *C, | static bool filepath_drop_poll(bContext *C, wmDrag *drag, const wmEvent *UNUSED(event)) | ||||
| wmDrag *drag, | |||||
| const wmEvent *UNUSED(event), | |||||
| const char **UNUSED(r_tooltip)) | |||||
| { | { | ||||
| if (drag->type == WM_DRAG_PATH) { | if (drag->type == WM_DRAG_PATH) { | ||||
| SpaceFile *sfile = CTX_wm_space_file(C); | SpaceFile *sfile = CTX_wm_space_file(C); | ||||
| if (sfile) { | if (sfile) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| static void filepath_drop_copy(wmDrag *drag, wmDropBox *drop) | static void filepath_drop_copy(wmDrag *drag, wmDropBox *drop) | ||||
| { | { | ||||
| RNA_string_set(drop->ptr, "filepath", drag->path); | RNA_string_set(drop->ptr, "filepath", drag->path); | ||||
| } | } | ||||
| /* region dropbox definition */ | /* region dropbox definition */ | ||||
| static void file_dropboxes(void) | static void file_dropboxes(void) | ||||
| { | { | ||||
| ListBase *lb = WM_dropboxmap_find("Window", SPACE_EMPTY, RGN_TYPE_WINDOW); | ListBase *lb = WM_dropboxmap_find("Window", SPACE_EMPTY, RGN_TYPE_WINDOW); | ||||
| WM_dropbox_add(lb, "FILE_OT_filepath_drop", filepath_drop_poll, filepath_drop_copy, NULL); | WM_dropbox_add(lb, "FILE_OT_filepath_drop", filepath_drop_poll, filepath_drop_copy, NULL, NULL); | ||||
| } | } | ||||
| static int file_space_subtype_get(ScrArea *area) | static int file_space_subtype_get(ScrArea *area) | ||||
| { | { | ||||
| SpaceFile *sfile = area->spacedata.first; | SpaceFile *sfile = area->spacedata.first; | ||||
| return sfile->browse_mode; | return sfile->browse_mode; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 218 Lines • Show Last 20 Lines | |||||