Blender V5.0
GHOST_EventDragnDrop Class Reference

#include <GHOST_EventDragnDrop.hh>

Inherits GHOST_Event.

Public Member Functions

 GHOST_EventDragnDrop (uint64_t time, GHOST_TEventType type, GHOST_TDragnDropTypes dataType, GHOST_IWindow *window, int x, int y, GHOST_TDragnDropDataPtr data)
 ~GHOST_EventDragnDrop () override
Public Member Functions inherited from GHOST_Event
 GHOST_Event (uint64_t msec, GHOST_TEventType type, GHOST_IWindow *window)
GHOST_TEventType getType () const override
uint64_t getTime () const override
GHOST_IWindowgetWindow () const override
GHOST_TEventDataPtr getData () const override
Public Member Functions inherited from GHOST_IEvent
virtual ~GHOST_IEvent ()=default

Protected Attributes

GHOST_TEventDragnDropData dragn_drop_event_data_
Protected Attributes inherited from GHOST_Event
GHOST_TEventType type_
uint64_t time_
GHOST_IWindowwindow_
GHOST_TEventDataPtr data_ = nullptr

Detailed Description

Drag & drop event

The dragging sequence is performed in four phases:

  • Start sequence (GHOST_kEventDraggingEntered) that tells a drag & 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 & 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 & 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:

Definition at line 46 of file GHOST_EventDragnDrop.hh.

Constructor & Destructor Documentation

◆ GHOST_EventDragnDrop()

GHOST_EventDragnDrop::GHOST_EventDragnDrop ( uint64_t time,
GHOST_TEventType type,
GHOST_TDragnDropTypes dataType,
GHOST_IWindow * window,
int x,
int y,
GHOST_TDragnDropDataPtr data )
inline

Constructor.

Parameters
timeThe time this event was generated.
typeThe type of this event.
dataTypeThe type of the drop candidate object.
windowThe window where the event occurred.
xThe x-coordinate of the location the cursor was at the time of the event.
yThe y-coordinate of the location the cursor was at the time of the event.
dataThe "content" dropped in the window.

Definition at line 58 of file GHOST_EventDragnDrop.hh.

References data, GHOST_Event::data_, dragn_drop_event_data_, GHOST_Event::GHOST_Event(), x, and y.

◆ ~GHOST_EventDragnDrop()

Member Data Documentation

◆ dragn_drop_event_data_

GHOST_TEventDragnDropData GHOST_EventDragnDrop::dragn_drop_event_data_
protected

The x,y-coordinates of the cursor position.

Definition at line 108 of file GHOST_EventDragnDrop.hh.

Referenced by GHOST_EventDragnDrop(), and ~GHOST_EventDragnDrop().


The documentation for this class was generated from the following file: