EZwgl reserves five special convertion targets:
They are global atoms set by EZwgl at the initialization time. Encoders/decoders registered to these targets are treated as setup/clean up procedures for DnD.EZ_DND_DRAG_INIT_ATOM, EZ_DND_DRAG_START_ATOM, EZ_DND_DRAG_FINISH_ATOM, EZ_DND_DROP_START_ATOM, EZ_DND_DROP_FINISH_ATOM
Encoder for target EZ_DND_DRAG_INIT_ATOM
is the
drag initialization encoder. This encoder and its callback
are invoked when the user press-and-move the DnD mouse
button over a drag source. The encoder behaves like
a callback. Its main purpose is to setup a drag icon.
It should not do any conversions as the encoded message
will never be used.
Encoder for target EZ_DND_DRAG_START_ATOM
is the
drag setup encoder. This encoder is invoked when the drag
is droped at a drop site. The encoded message will be the
first message sent to the drop site, along with a list
of targets the source converts. Drag setup actions
are in the following order.
void EZ_DnDGetDragConversionTargets(Atom **targets_ret, int **ntargets_ret, unsigned int **action_tag)
The setup encoder and its callback are free to modify the list of targets. For example, the callback may popup a dialogue, ask the user for some infomation and select one or more targets based on the response.
Encoder for target EZ_DND_DRAG_FINISH_ATOM
is the
drag cleanup encoder. This encoder is invoked whenever
a DnD transaction is deemed complete, success or not. The
encoded message is never used.
Decoder for target EZ_DND_DROP_START_ATOM
is the
the drop setup decoder. It is invoked right after the drop
site has received the initial drag setup message (list of targets
plus possiblly a short message) from the drag
source. The order of actions at the setup time are:
The decoder and its callback are free to modify this list.void EZ_DnDGetMatchedConversionTargets(Atom **targets_ret, int **ntargets_ret, unsigned int **action_tag_ret)
Encoder for target EZ_DND_DROP_FINISH_ATOM
is the
drop cleanup decoder. This decoder is invoked whenever
a DnD transaction is deemed complete, success or not.