dear-imgui-2.3.1: Haskell bindings for Dear ImGui.
Safe HaskellSafe-Inferred
LanguageHaskell2010

DearImGui.Raw.DragDrop

Synopsis

Source

beginSource :: MonadIO m => ImGuiDragDropFlags -> m Bool Source #

Call after submitting an item which may be dragged.

When this return True, you can call setPayload + endDragDropSource.

setPayload :: MonadIO m => CString -> Ptr a -> CSize -> ImGuiCond -> m Bool Source #

Type is a user defined string of maximum 32 characters.

Strings starting with '_' are reserved for dear imgui internal types. Data is copied and held by imgui. Returns True when payload has been accepted.

endSource :: MonadIO m => m () Source #

Only call if beginSource returns True!

Target

beginTarget :: MonadIO m => m Bool Source #

Call after submitting an item that may receive a payload.

If this returns True, you can call acceptPayload + endTarget.

acceptPayload :: MonadIO m => CString -> ImGuiDragDropFlags -> m (Maybe Payload) Source #

Accept contents of a given type.

If ImGuiDragDropFlags_AcceptBeforeDelivery is set you can peek into the payload before the mouse button is released.

endTarget :: MonadIO m => m () Source #

Only call if beginTarget returns true!

Payload object

newtype Payload Source #

DragDrop payload data handle

Wraps ImGuiPayload*.

Constructors

Payload (Ptr ImGuiPayload) 

Instances

Instances details
Show Payload Source # 
Instance details

Defined in DearImGui.Raw.DragDrop

Eq Payload Source # 
Instance details

Defined in DearImGui.Raw.DragDrop

Methods

(==) :: Payload -> Payload -> Bool #

(/=) :: Payload -> Payload -> Bool #

getData :: MonadIO m => Payload -> m (Ptr ()) Source #

Direct access

getPayload :: MonadIO m => m (Maybe Payload) Source #

Peek directly into the current payload from anywhere.

Returns NULL when drag and drop is finished or inactive. Use isDataType to test for the payload type.

clear :: MonadIO m => Payload -> m () Source #

Clear the DearImGui copy of payload data.

Gets called on endTarget right after delivery.