wayland::data_device_t(3)
πΈ NAME πΈ
okay bestie, this is wayland::data_device_t(3) from the Wayland++ manual β the data transfer device page, and it's already giving main-character energy π
β¨
β¨ SYNOPSIS β¨
#include <wayland-client-protocol.hpp>
It inherits from wayland::proxy_t, so it's got that proxy_t DNA π§¬
π Public Types π
enum class wrapper_type { standard, display, foreign, proxy_wrapper }β the wrapper type enum, and yes, those are the four values, periodt π
π Public Member Functions π
void start_drag (data_source_t const &source, surface_t const &origin, surface_t const &icon, uint32_t serial)β start drag-and-drop operation; this one kicks off the whole drag-and-drop moment π«Άvoid set_selection (data_source_t const &source, uint32_t serial)β copy data to the selection β¨void release ()β destroy data device πbool can_release () constβ Check whether thereleasefunction is available with the currently bound version of the protocol.std::function< void(data_offer_t)> & on_data_offer ()β introduce a newwl_data_offerπstd::function< void(uint32_t, surface_t, double, double, data_offer_t)> & on_enter ()β initiate drag-and-drop session πstd::function< void()> & on_leave ()β end drag-and-drop session πstd::function< void(uint32_t, double, double)> & on_motion ()β drag-and-drop session motion π¦std::function< void()> & on_drop ()β end drag-and-drop session successfully πstd::function< void(data_offer_t)> & on_selection ()β advertise new selection βuint32_t get_id () constβ Get the id of a proxy object.std::string get_class () constβ Get the interface name (class) of a proxy object.uint32_t get_version () constβ Get the protocol object version of a proxy object.wrapper_type get_wrapper_type () constβ Get the type of a proxy object.void set_queue (event_queue_t queue)β Assign a proxy to an event queue.wl_proxy * c_ptr () constβ Get a pointer to the underlying C struct.bool proxy_has_object () constβ Check whether this wrapper actually wraps an object.operator bool () constβ Check whether this wrapper actually wraps an object.bool operator== (const proxy_t &right) constβ Check whether two wrappers refer to the same object.bool operator!= (const proxy_t &right) constβ Check whether two wrappers refer to different objects.void proxy_release ()β Release the wrapped object (if any), making this an empty wrapper.
π¦ Static Public Attributes π¦
static constexpr std::uint32_t start_drag_since_version = 1β Minimum protocol version required for thestart_dragfunction.static constexpr std::uint32_t set_selection_since_version = 1β Minimum protocol version required for theset_selectionfunction.static constexpr std::uint32_t release_since_version = 2β Minimum protocol version required for thereleasefunction.
π Detailed Description π
data transfer device β that's the whole vibe.
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. No cap, it's literally the data-transfer bestie πβ¨
Definition at line 1203 of file wayland-client-protocol.hpp.
π Member Enumeration Documentation π
π
enum class wayland::proxy_t::wrapper_type [strong], [inherited]
Underlying wl_proxy type and properties of a proxy_t that affect construction, destruction, and event handling. This one is inherited, iykyk π§
πΈ Enumerator πΈ
standardβ C pointer is a standard type compatible withwl_proxy*. Events are dispatched and it is destructed when theproxy_tis destructed. User data is set.displayβ C pointer is awl_display*. No events are dispatched,wl_display_disconnectis called when theproxy_tis destructed. User data is set.foreignβ C pointer is a standard type compatible withwl_proxy*, but another library owns it and it should not be touched in a way that could affect the operation of the other library. No events are dispatched,wl_proxy_destroyis not called when theproxy_tis destructed, user data is not touched. Consequently, there is no reference counting for theproxy_t. Lifetime of such wrappers should preferably be short to minimize the chance that the owning library decides to destroy thewl_proxy. bestie, do not mess withforeignlike that πproxy_wrapperβ C pointer is awl_proxy*that was constructed withwl_proxy_create_wrapper. No events are dispatched,wl_proxy_wrapper_destroyis called when theproxy_tis destroyed. Reference counting is active. A reference to theproxy_tcreating this proxy wrapper is held to extend its lifetime until after the proxy wrapper is destroyed.
Definition at line 117 of file wayland-client.hpp.
π MEMBER FUNCTION DOCUMENTATION π
Okay bestie, function-by-function timeβgrab a snack and let's go π
wl_proxy * wayland::proxy_t::c_ptr () const [inherited]
Get a pointer to the underlying C struct.
Returns: The underlying wl_proxy wrapped by this proxy_t if it exists, otherwise an exception is thrown.
bool data_device_t::can_release () const
Check whether the release function is available with the currently bound version of the protocol.
Definition at line 2288 of file wayland-client-protocol.cpp.
std::string wayland::proxy_t::get_class () const [inherited]
Get the interface name (class) of a proxy object.
Returns: The interface name of the object associated with the proxy.
uint32_t wayland::proxy_t::get_id () const [inherited]
Get the id of a proxy object.
Returns: The id of the object associated with the proxy.
uint32_t wayland::proxy_t::get_version () const [inherited]
Get the protocol object version of a proxy object. Gets the protocol object version of a proxy object, or 0 if the proxy was created with unversioned API.
A returned value of 0 means that no version information is available, so the caller must make safe assumptions about the object's real version.
display_t will always return version 0.
Returns: The protocol object version of the proxy or 0.
wrapper_type wayland::proxy_t::get_wrapper_type () const [inline], [inherited]
Get the type of a proxy object.
Definition at line 303 of file wayland-client.hpp.
std::function< void(data_offer_t)> & data_device_t::on_data_offer ()
Introduce a new wl_data_offer π
Parameters:
idβ the newdata_offerobject
The 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.
Definition at line 2294 of file wayland-client-protocol.cpp.
std::function< void()> & data_device_t::on_drop ()
End drag-and-drop session successfully. The 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.
Definition at line 2314 of file wayland-client-protocol.cpp.
std::function< void(uint32_t, surface_t, double, double, data_offer_t)> & data_device_t::on_enter ()
Initiate drag-and-drop session β¨
Parameters:
serialβ serial number of the enter eventsurfaceβ client surface enteredxβ surface-local x coordinateyβ surface-local y coordinateidβ sourcedata_offerobject
This 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.
Definition at line 2299 of file wayland-client-protocol.cpp.
std::function< void()> & data_device_t::on_leave ()
End drag-and-drop session. This 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.
Definition at line 2304 of file wayland-client-protocol.cpp.
std::function< void(uint32_t, double, double)> & data_device_t::on_motion ()
Drag-and-drop session motion π¦
Parameters:
timeβ timestamp with millisecond granularityxβ surface-local x coordinateyβ surface-local y coordinate
This 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.
Definition at line 2309 of file wayland-client-protocol.cpp.
std::function< void(data_offer_t)> & data_device_t::on_selection ()
Advertise new selection π
Parameters:
idβ selectiondata_offerobject
The 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.
Definition at line 2319 of file wayland-client-protocol.cpp.
wayland::proxy_t::operator bool () const [inherited]
Check whether this wrapper actually wraps an object.
Returns: true if there is an underlying object, false if this wrapper is empty.
bool wayland::proxy_t::operator!= (const proxy_t & right) const [inherited]
Check whether two wrappers refer to different objects.
bool wayland::proxy_t::operator== (const proxy_t & right) const [inherited]
Check whether two wrappers refer to the same object.
bool wayland::proxy_t::proxy_has_object () const [inherited]
Check whether this wrapper actually wraps an object.
Returns: true if there is an underlying object, false if this wrapper is empty.
void wayland::proxy_t::proxy_release () [inherited]
Release the wrapped object (if any), making this an empty wrapper. Note that display_t instances cannot be released this way. Attempts to do so are ignored.
Examples: foreign_display.cpp.
void data_device_t::release ()
Destroy data device. This request destroys the data device.
Definition at line 2283 of file wayland-client-protocol.cpp.
void wayland::proxy_t::set_queue (event_queue_t queue) [inherited]
Assign a proxy to an event queue.
Parameters:
queueβ The event queue that will handle this proxy
Assign proxy to event queue. Events coming from proxy will be queued in queue instead of the display's main queue.
See also: display_t::dispatch_queue().
Examples: proxy_wrapper.cpp.
void data_device_t::set_selection (data_source_t const & source, uint32_t serial)
Copy data to the selection π
Parameters:
sourceβ data source for the selectionserialβ serial number of the event that triggered this request
This request asks the compositor to set the selection to the data from the source on behalf of the client.
To unset the selection, set the source to NULL.
Definition at line 2277 of file wayland-client-protocol.cpp.
void data_device_t::start_drag (data_source_t const & source, surface_t const & origin, surface_t const & icon, uint32_t serial)
Start drag-and-drop operation π₯
Parameters:
sourceβ data source for the eventual transferoriginβ surface where the drag originatesiconβ drag-and-drop icon surfaceserialβ serial number of the implicit grab on the origin
This request asks the compositor to start a drag-and-drop operation on behalf of the client.
The source argument is the data source that provides the data for the eventual data transfer. If source is NULL, enter, leave and motion events are sent only to the client that initiated the drag and the client is expected to handle the data passing internally. If source is destroyed, the drag-and-drop session will be cancelled.
The origin surface is the surface where the drag originates and the client must have an active implicit grab that matches the serial.
The icon surface is an optional (can be NULL) surface that provides an icon to be moved around with the cursor. Initially, the top-left corner of the icon surface is placed at the cursor hotspot, but subsequent wl_surface.attach request can move the relative position. Attach requests must be confirmed with wl_surface.commit as usual. The icon surface is given the role of a drag-and-drop icon. If the icon surface already has another role, it raises a protocol error.
The current and pending input regions of the icon wl_surface are cleared, and wl_surface.set_input_region is ignored until the wl_surface is no longer used as the icon surface. When the use as an icon ends, the current and pending input regions become undefined, and the wl_surface is unmapped.
Definition at line 2271 of file wayland-client-protocol.cpp.
πΈ MEMBER DATA DOCUMENTATION πΈ
std::uint32_t wayland::data_device_t::release_since_version = 2 [static], [constexpr]
Minimum protocol version required for the release function.
Definition at line 1298 of file wayland-client-protocol.hpp.
std::uint32_t wayland::data_device_t::set_selection_since_version = 1 [static], [constexpr]
Minimum protocol version required for the set_selection function.
Definition at line 1287 of file wayland-client-protocol.hpp.
std::uint32_t wayland::data_device_t::start_drag_since_version = 1 [static], [constexpr]
Minimum protocol version required for the start_drag function.
Definition at line 1271 of file wayland-client-protocol.hpp.
π«Ά AUTHOR π«Ά
Generated automatically by Doxygen for Wayland++ from the source code.
Version 1.0.1, dated Fri Mar 27 2026 13:15:00 β that's the official receipt, bestie, auto-generated and everything πβ¨ Go forth and Wayland responsibly π¦
π¦ where this page comes from
- ubuntu stonking: waylandpp-dev 1.0.1-2 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms