Blender V2.61 - r43446
|
#include <GHOST_EventDragnDrop.h>
Public Member Functions | |
GHOST_EventDragnDrop (GHOST_TUns64 time, GHOST_TEventType type, GHOST_TDragnDropTypes dataType, GHOST_IWindow *window, int x, int y, GHOST_TEventDataPtr data) | |
~GHOST_EventDragnDrop () | |
Protected Attributes | |
GHOST_TEventDragnDropData | m_dragnDropEventData |
Drag & drop event
The dragging sequence is performed in four phases:
Start sequence (GHOST_kEventDraggingEntered) that tells a drag'n'drop operation has started. Already gives the object data type, and the entering mouse location
Update mouse position (GHOST_kEventDraggingUpdated) sent upon each mouse move until the drag'n'drop operation stops, to give the updated mouse position. Useful to highlight a potential destination, and update the status (through GHOST_setAcceptDragOperation) telling if the object can be dropped at the current cursor position.
Abort drag'n'drop sequence (GHOST_kEventDraggingExited) sent when the user moved the mouse outside the window.
Send the dropped data (GHOST_kEventDraggingDropDone)
Outside of the normal sequence, dropped data can be sent (GHOST_kEventDraggingDropOnIcon). This can happen when the user drops an object on the application icon. (Also used in OSX to pass the filename of the document the user doubled-clicked in the finder)
Note that the mouse positions are given in Blender coordinates (y=0 at bottom)
Currently supported object types : UTF-8 string array of strings representing filenames (GHOST_TStringArray) bitmap ImBuf
Definition at line 70 of file GHOST_EventDragnDrop.h.
GHOST_EventDragnDrop::GHOST_EventDragnDrop | ( | GHOST_TUns64 | time, |
GHOST_TEventType | type, | ||
GHOST_TDragnDropTypes | dataType, | ||
GHOST_IWindow * | window, | ||
int | x, | ||
int | y, | ||
GHOST_TEventDataPtr | data | ||
) | [inline] |
Constructor.
time | The time this event was generated. |
type | The type of this event. |
dataType | The type of the drop candidate object |
window | The window where the event occurred |
x | The x-coordinate of the location the cursor was at at the time of the event. |
y | The y-coordinate of the location the cursor was at at the time of the event. |
data | The "content" dropped in the window |
Definition at line 83 of file GHOST_EventDragnDrop.h.
References GHOST_TEventDragnDropData::data, data, GHOST_TEventDragnDropData::dataType, GHOST_Event::m_data, m_dragnDropEventData, GHOST_TEventDragnDropData::x, and GHOST_TEventDragnDropData::y.
GHOST_EventDragnDrop::~GHOST_EventDragnDrop | ( | ) | [inline] |
Definition at line 97 of file GHOST_EventDragnDrop.h.
References GHOST_TStringArray::count, GHOST_TEventDragnDropData::data, GHOST_TEventDragnDropData::dataType, addon::engine::free(), GHOST_kDragnDropTypeBitmap, GHOST_kDragnDropTypeFilenames, GHOST_kDragnDropTypeString, i, IMB_freeImBuf(), m_dragnDropEventData, NULL, and GHOST_TStringArray::strings.
The x,y-coordinates of the cursor position.
Definition at line 131 of file GHOST_EventDragnDrop.h.
Referenced by GHOST_EventDragnDrop(), and ~GHOST_EventDragnDrop().