diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-02-17 20:58:09 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-02-17 20:58:09 +0400 |
commit | e8a1daaf9bda8f03723879d76557278b9a025c0a (patch) | |
tree | cc67b46ef3a957c893df7e288354f126823d4d5e /intern/ghost/intern/GHOST_SystemX11.cpp | |
parent | 7c15fb4f2c710a15e0ae7bd758f1cf74a4e97e36 (diff) |
Drag-n-drop support on Linux
This commit implements drag-n-drop support from external applications into Blender.
Used xdnd implementation from Paul Sheer.
Diffstat (limited to 'intern/ghost/intern/GHOST_SystemX11.cpp')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemX11.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index 22c16009591..7261770771a 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -42,6 +42,8 @@ #include "GHOST_EventButton.h" #include "GHOST_EventWheel.h" #include "GHOST_DisplayManagerX11.h" +#include "GHOST_DropTargetX11.h" +#include "GHOST_EventDragnDrop.h" #ifdef WITH_INPUT_NDOF #include "GHOST_NDOFManagerX11.h" #endif @@ -709,8 +711,12 @@ GHOST_SystemX11::processEvent(XEvent *xe) } } } else { - /* Unknown client message, ignore */ + /* try to handle drag event (if there's no such events, GHOST_HandleClientMessage will return zero) */ + if (window->getDropTarget()->GHOST_HandleClientMessage(xe) == false) { + /* Unknown client message, ignore */ + } } + break; } @@ -1478,3 +1484,17 @@ void GHOST_SystemX11::putClipboard(GHOST_TInt8 *buffer, bool selection) const fprintf(stderr, "failed to own primary\n"); } } + +GHOST_TSuccess GHOST_SystemX11::pushDragDropEvent(GHOST_TEventType eventType, + GHOST_TDragnDropTypes draggedObjectType, + GHOST_IWindow* window, + int mouseX, int mouseY, + void* data) +{ + GHOST_SystemX11* system = ((GHOST_SystemX11*)getSystem()); + return system->pushEvent(new GHOST_EventDragnDrop(system->getMilliSeconds(), + eventType, + draggedObjectType, + window,mouseX,mouseY,data) + ); +} |