Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Eicher <dan@eu.phorio.us>2012-06-14 08:57:42 +0400
committerDan Eicher <dan@eu.phorio.us>2012-06-14 08:57:42 +0400
commitcae6873bc69ab8590ca6f4d2bbf2eb3d189ab13a (patch)
tree598b9c8a2042f025d879f7cad04d0082571f16f0 /source/blender/editors/space_sequencer/space_sequencer.c
parentfac417a3baf132e7d04540e1fbdefe7d3a1fa17b (diff)
Sequencer Drag & Drop -- disallow dropping on sequences for the current drop_poll functions
Diffstat (limited to 'source/blender/editors/space_sequencer/space_sequencer.c')
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index dbfc554007a..b8bf764fabc 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -325,27 +325,43 @@ static void sequencer_main_area_draw(const bContext *C, ARegion *ar)
/* ************* dropboxes ************* */
-static int image_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
+static int image_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
{
+ ARegion *ar = CTX_wm_region(C);
+ Scene *scene = CTX_data_scene(C);
+ int hand;
+
if (drag->type == WM_DRAG_PATH)
if (ELEM(drag->icon, ICON_FILE_IMAGE, ICON_FILE_BLANK)) /* rule might not work? */
- return 1;
+ if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL)
+ return 1;
+
return 0;
}
-static int movie_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
+static int movie_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
{
+ ARegion *ar = CTX_wm_region(C);
+ Scene *scene = CTX_data_scene(C);
+ int hand;
+
if (drag->type == WM_DRAG_PATH)
if (ELEM3(drag->icon, 0, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */
- return 1;
+ if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL)
+ return 1;
return 0;
}
-static int sound_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
+static int sound_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
{
+ ARegion *ar = CTX_wm_region(C);
+ Scene *scene = CTX_data_scene(C);
+ int hand;
+
if (drag->type == WM_DRAG_PATH)
if (ELEM(drag->icon, ICON_FILE_SOUND, ICON_FILE_BLANK)) /* rule might not work? */
- return 1;
+ if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL)
+ return 1;
return 0;
}