diff options
Diffstat (limited to 'src/lib/elementary/efl_ui_dnd.eo')
-rw-r--r-- | src/lib/elementary/efl_ui_dnd.eo | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_dnd.eo b/src/lib/elementary/efl_ui_dnd.eo new file mode 100644 index 0000000000..7c903c88cb --- /dev/null +++ b/src/lib/elementary/efl_ui_dnd.eo @@ -0,0 +1,63 @@ +import efl_ui_dnd_types; + +mixin 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.Selection_Format; [[The data format]] + @in data: Eina.Slice; [[The drag data]] + @in action: Efl.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.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 targert. + 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.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.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.Selection_Data; [[called when the drag object dropped on this object]] + } +} |