Interface WlDataDeviceEventsV2
- All Superinterfaces:
WlDataDeviceEvents
- All Known Subinterfaces:
WlDataDeviceEventsV3
There is one wl_data_device per seat which can be obtained from the global wl_data_device_manager singleton.
A wl_data_device provides access to inter-client data transfer mechanisms such as copy-and-paste and drag-and-drop.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
dataOffer
(WlDataDeviceProxy emitter, WlDataOfferProxy id) introduce a new wl_data_offervoid
drop
(WlDataDeviceProxy emitter) end drag-and-drop session successfullyvoid
enter
(WlDataDeviceProxy emitter, int serial, WlSurfaceProxy surface, Fixed x, Fixed y, WlDataOfferProxy id) initiate drag-and-drop sessionvoid
leave
(WlDataDeviceProxy emitter) end drag-and-drop sessionvoid
motion
(WlDataDeviceProxy emitter, int time, Fixed x, Fixed y) drag-and-drop session motionvoid
selection
(WlDataDeviceProxy emitter, WlDataOfferProxy id) advertise new selection
-
Field Details
-
VERSION
static final int VERSION- See Also:
-
-
Method Details
-
dataOffer
introduce a new wl_data_offerThe data_offer event introduces a new wl_data_offer object, which will subsequently be used in either the data_device.enter event (for drag-and-drop) or the data_device.selection event (for selections). Immediately following the data_device.data_offer event, the new data_offer object will send out data_offer.offer events to describe the mime types it offers.
- Specified by:
dataOffer
in interfaceWlDataDeviceEvents
- Parameters:
emitter
- The protocol object that emitted the event.id
- the new data_offer object
-
enter
void enter(WlDataDeviceProxy emitter, int serial, @Nonnull WlSurfaceProxy surface, @Nonnull Fixed x, @Nonnull Fixed y, @Nullable WlDataOfferProxy id) initiate drag-and-drop sessionThis event is sent when an active drag-and-drop pointer enters a surface owned by the client. The position of the pointer at enter time is provided by the x and y arguments, in surface-local coordinates.
- Specified by:
enter
in interfaceWlDataDeviceEvents
- Parameters:
emitter
- The protocol object that emitted the event.serial
- serial number of the enter eventsurface
- client surface enteredx
- surface-local x coordinatey
- surface-local y coordinateid
- source data_offer object
-
leave
end drag-and-drop sessionThis event is sent when the drag-and-drop pointer leaves the surface and the session ends. The client must destroy the wl_data_offer introduced at enter time at this point.
- Specified by:
leave
in interfaceWlDataDeviceEvents
- Parameters:
emitter
- The protocol object that emitted the event.
-
motion
drag-and-drop session motionThis event is sent when the drag-and-drop pointer moves within the currently focused surface. The new position of the pointer is provided by the x and y arguments, in surface-local coordinates.
- Specified by:
motion
in interfaceWlDataDeviceEvents
- Parameters:
emitter
- The protocol object that emitted the event.time
- timestamp with millisecond granularityx
- surface-local x coordinatey
- surface-local y coordinate
-
drop
end drag-and-drop session successfullyThe event is sent when a drag-and-drop operation is ended because the implicit grab is removed.
The drag-and-drop destination is expected to honor the last action received through wl_data_offer.action, if the resulting action is "copy" or "move", the destination can still perform wl_data_offer.receive requests, and is expected to end all transfers with a wl_data_offer.finish request.
If the resulting action is "ask", the action will not be considered final. The drag-and-drop destination is expected to perform one last wl_data_offer.set_actions request, or wl_data_offer.destroy in order to cancel the operation.
- Specified by:
drop
in interfaceWlDataDeviceEvents
- Parameters:
emitter
- The protocol object that emitted the event.
-
selection
advertise new selectionThe selection event is sent out to notify the client of a new wl_data_offer for the selection for this device. The data_device.data_offer and the data_offer.offer events are sent out immediately before this event to introduce the data offer object. The selection event is sent to a client immediately before receiving keyboard focus and when a new selection is set while the client has keyboard focus. The data_offer is valid until a new data_offer or NULL is received or until the client loses keyboard focus. Switching surface with keyboard focus within the same client doesn't mean a new selection will be sent. The client must destroy the previous selection data_offer, if any, upon receiving this event.
- Specified by:
selection
in interfaceWlDataDeviceEvents
- Parameters:
emitter
- The protocol object that emitted the event.id
- selection data_offer object
-