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:
authorTon Roosendaal <ton@blender.org>2010-05-06 20:06:57 +0400
committerTon Roosendaal <ton@blender.org>2010-05-06 20:06:57 +0400
commit2016bb77b783499977e378f5f8fb36636d9d68fa (patch)
tree2a70de54b8d7ecda74aa9b7873848839d795d280 /source/blender/windowmanager/intern/wm_window.c
parent58ca3086d33bb16064b8892e9e6f3172961123d5 (diff)
Part 1 of making external drop events work. Have to move work to another system,
that's why this first step. :)
Diffstat (limited to 'source/blender/windowmanager/intern/wm_window.c')
-rw-r--r--source/blender/windowmanager/intern/wm_window.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 150e6db35cb..9bff2af9ac5 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -740,6 +740,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
case GHOST_kEventDraggingDropDone:
{
wmEvent event= *(win->eventstate); /* copy last state, like mouse coords */
+ GHOST_TEventDragnDropData *ddd= GHOST_GetEventData(evt);
/* make blender drop event with custom data pointing to wm drags */
event.type= EVT_DROP;
@@ -750,8 +751,17 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
/* add drag data to wm for paths: */
/* need icon type, some dropboxes check for that... see filesel code for this */
- // WM_event_start_drag(C, icon, WM_DRAG_PATH, void *poin, 0.0);
- /* void poin should point to string, it makes a copy */
+
+ if(ddd->dataType == GHOST_kDragnDropTypeFilenames) {
+ GHOST_TStringArray *stra= ddd->data;
+ int a;
+
+ for(a=0; a<stra->count; a++) {
+ printf("drop file %s\n", stra->strings[a]);
+ WM_event_start_drag(C, 0, WM_DRAG_PATH, stra->strings[a], 0.0);
+ /* void poin should point to string, it makes a copy */
+ }
+ }
wm_event_add(win, &event);