Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_sequencer/space_sequencer.c
| Show First 20 Lines • Show All 358 Lines • ▼ Show 20 Lines | case NC_GPENCIL: | ||||
| ED_area_tag_redraw(area); | ED_area_tag_redraw(area); | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| /* ************* 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)) | |||||
| { | { | ||||
| ARegion *region = CTX_wm_region(C); | ARegion *region = CTX_wm_region(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| int hand; | int hand; | ||||
| if (drag->type == WM_DRAG_PATH) { | if (drag->type == WM_DRAG_PATH) { | ||||
| if (ELEM(drag->icon, ICON_FILE_IMAGE, ICON_FILE_BLANK)) { /* Rule might not work? */ | if (ELEM(drag->icon, ICON_FILE_IMAGE, ICON_FILE_BLANK)) { /* Rule might not work? */ | ||||
| if (find_nearest_seq(scene, ®ion->v2d, &hand, event->mval) == NULL) { | if (find_nearest_seq(scene, ®ion->v2d, &hand, event->mval) == NULL) { | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| static bool movie_drop_poll(bContext *C, | static bool movie_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) | ||||
| wmDrag *drag, | |||||
| const wmEvent *event, | |||||
| const char **UNUSED(r_tooltip)) | |||||
| { | { | ||||
| ARegion *region = CTX_wm_region(C); | ARegion *region = CTX_wm_region(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| int hand; | int hand; | ||||
| if (drag->type == WM_DRAG_PATH) { | if (drag->type == WM_DRAG_PATH) { | ||||
| if (ELEM(drag->icon, 0, ICON_FILE_MOVIE, ICON_FILE_BLANK)) { /* Rule might not work? */ | if (ELEM(drag->icon, 0, ICON_FILE_MOVIE, ICON_FILE_BLANK)) { /* Rule might not work? */ | ||||
| if (find_nearest_seq(scene, ®ion->v2d, &hand, event->mval) == NULL) { | if (find_nearest_seq(scene, ®ion->v2d, &hand, event->mval) == NULL) { | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| static bool sound_drop_poll(bContext *C, | static bool sound_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) | ||||
| wmDrag *drag, | |||||
| const wmEvent *event, | |||||
| const char **UNUSED(r_tooltip)) | |||||
| { | { | ||||
| ARegion *region = CTX_wm_region(C); | ARegion *region = CTX_wm_region(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| int hand; | int hand; | ||||
| if (drag->type == WM_DRAG_PATH) { | if (drag->type == WM_DRAG_PATH) { | ||||
| if (ELEM(drag->icon, ICON_FILE_SOUND, ICON_FILE_BLANK)) { /* Rule might not work? */ | if (ELEM(drag->icon, ICON_FILE_SOUND, ICON_FILE_BLANK)) { /* Rule might not work? */ | ||||
| if (find_nearest_seq(scene, ®ion->v2d, &hand, event->mval) == NULL) { | if (find_nearest_seq(scene, ®ion->v2d, &hand, event->mval) == NULL) { | ||||
| Show All 25 Lines | static void sequencer_drop_copy(wmDrag *drag, wmDropBox *drop) | ||||
| } | } | ||||
| } | } | ||||
| /* This region dropbox definition. */ | /* This region dropbox definition. */ | ||||
| static void sequencer_dropboxes(void) | static void sequencer_dropboxes(void) | ||||
| { | { | ||||
| ListBase *lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW); | ListBase *lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW); | ||||
| WM_dropbox_add(lb, "SEQUENCER_OT_image_strip_add", image_drop_poll, sequencer_drop_copy, NULL); | WM_dropbox_add( | ||||
| WM_dropbox_add(lb, "SEQUENCER_OT_movie_strip_add", movie_drop_poll, sequencer_drop_copy, NULL); | lb, "SEQUENCER_OT_image_strip_add", image_drop_poll, sequencer_drop_copy, NULL, NULL); | ||||
| WM_dropbox_add(lb, "SEQUENCER_OT_sound_strip_add", sound_drop_poll, sequencer_drop_copy, NULL); | WM_dropbox_add( | ||||
| lb, "SEQUENCER_OT_movie_strip_add", movie_drop_poll, sequencer_drop_copy, NULL, NULL); | |||||
| WM_dropbox_add( | |||||
| lb, "SEQUENCER_OT_sound_strip_add", sound_drop_poll, sequencer_drop_copy, NULL, NULL); | |||||
| } | } | ||||
| /* ************* end drop *********** */ | /* ************* end drop *********** */ | ||||
| /* DO NOT make this static, this hides the symbol and breaks API generation script. */ | /* DO NOT make this static, this hides the symbol and breaks API generation script. */ | ||||
| extern const char *sequencer_context_dir[]; /* Quiet warning. */ | extern const char *sequencer_context_dir[]; /* Quiet warning. */ | ||||
| const char *sequencer_context_dir[] = {"edit_mask", NULL}; | const char *sequencer_context_dir[] = {"edit_mask", NULL}; | ||||
| ▲ Show 20 Lines • Show All 505 Lines • Show Last 20 Lines | |||||