efl/src/lib/elementary/efl_ui_dnd.eo

64 lines
2.4 KiB
Plaintext

import efl_ui_dnd_types;
mixin @beta Efl.Ui.Dnd {
data: null;
methods {
drag_start {
[[Start a drag and drop process at the drag side.
During dragging, there are three events emitted as belows:
- EFL_UI_DND_EVENT_DRAG_POS
- EFL_UI_DND_EVENT_DRAG_ACCEPT
- EFL_UI_DND_EVENT_DRAG_DONE
]]
params {
@in format: Efl.Ui.Selection_Format; [[The data format]]
@in data: Eina.Slice; [[The drag data]]
@in action: Efl.Ui.Selection_Action; [[Action when data is transferred]]
@in icon_func: Efl.Dnd.Drag_Icon_Create; [[Function pointer to create icon]]
@in seat: uint; [[Specified seat for multiple seats case.]]
}
}
drag_action_set {
[[Set the action for the drag]]
params {
@in action: Efl.Ui.Selection_Action; [[Drag action]]
@in seat: uint; [[Specified seat for multiple seats case.]]
}
}
drag_cancel {
[[Cancel the on-going drag]]
params {
@in seat: uint; [[Specified seat for multiple seats case.]]
}
}
drop_target_add {
[[Make the current object as drop target.
There are four events emitted:
- EFL_UI_DND_EVENT_DRAG_ENTER
- EFL_UI_DND_EVENT_DRAG_LEAVE
- EFL_UI_DND_EVENT_DRAG_POS
- EFL_UI_DND_EVENT_DRAG_DROP.]]
params {
@in format: Efl.Ui.Selection_Format; [[Accepted data format]]
@in seat: uint; [[Specified seat for multiple seats case.]]
}
}
drop_target_del {
[[Delete the dropable status from object]]
params {
@in format: Efl.Ui.Selection_Format; [[Accepted data format]]
@in seat: uint; [[Specified seat for multiple seats case.]]
}
}
}
events {
/* FIXME: This is not very future-proof. Better return a struct. */
drag,accept: ptr(bool); [[accept drag data]]
drag,done: void; [[drag is done (mouse up)]]
drag,enter: void; [[called when the drag object enters this object]]
drag,leave: void; [[called when the drag object leaves this object]]
drag,pos: Efl.Dnd.Drag_Pos; [[called when the drag object changes drag position]]
drag,drop: Efl.Ui.Selection_Data; [[called when the drag object dropped on this object]]
}
}