wayland::server::data_device_t(3)
π wayland::server::data_device_t β the data transfer device, bestie edition π
okay so this is wayland::server::data_device_t(3) from Wayland++ β literally the manual page for your new favorite little data transfer device. it's a long one so buckle up, we're doing part 1 πΈ
π NAME π
wayland::server::data_device_t β data transfer device. that's it, that's the whole vibe. π
β¨ SYNOPSIS β¨
#include <wayland-server-protocol.hpp>
π«Ά Public Member Functions
std::function< void(data_source_t, surface_t, surface_t, uint32_t)> & on_start_drag ()β start drag-and-drop operation. the moment.std::function< void(data_source_t, uint32_t)> & on_set_selection ()β copy data to the selection.std::function< void()> & on_release ()β destroy data device.void data_offer (bool post=true)β introduce a newwl_data_offer. iconic entrance.void enter (uint32_t serial, surface_t const &surface, double x, double y, data_offer_t const &id, bool post=true)β initiate drag-and-drop session.void leave (bool post=true)β end drag-and-drop session. bye bestie πvoid motion (uint32_t time, double x, double y, bool post=true)β drag-and-drop session motion.void drop (bool post=true)β end drag-and-drop session successfully. slay.void selection (data_offer_t const &id, bool post=true)β advertise new selection.void post_role (std::string const &msg)β Post error: givenwl_surfacehas another role.bool proxy_has_object () constβ Check whether this wrapper actually wraps an object.void post_no_memory () constuint32_t get_id () constclient_t get_client () constunsigned int get_version () conststd::string get_class ()
π¦ Static Public Attributes
static constexpr std::uint32_t data_offer_since_version = 1β Minimum protocol version required for thedata_offerfunction.static constexpr std::uint32_t enter_since_version = 1β Minimum protocol version required for theenterfunction.static constexpr std::uint32_t leave_since_version = 1β Minimum protocol version required for theleavefunction.static constexpr std::uint32_t motion_since_version = 1β Minimum protocol version required for themotionfunction.static constexpr std::uint32_t drop_since_version = 1β Minimum protocol version required for thedropfunction.static constexpr std::uint32_t selection_since_version = 1β Minimum protocol version required for theselectionfunction.
π Detailed Description π
data transfer device β¨
so there is one wl_data_device per seat which can be obtained from the global wl_data_device_manager singleton. that's the plug, iykyk π
a wl_data_device provides access to inter-client data transfer mechanisms such as copy-and-paste and drag-and-drop. literally the whole social life of the compositor, no cap π
Definition at line 1334 of file wayland-server-protocol.hpp.
π Member Function Documentation π
π void data_device_t::data_offer (bool post = true)
introduce a new wl_data_offer β giving main character energy.
Returns the new data_offer object π
okay so 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. it's giving "hi here's what i can do" β¨
Definition at line 2096 of file wayland-server-protocol.cpp.
π₯ void data_device_t::drop (bool post = true)
end drag-and-drop session successfully. the event is sent when a drag-and-drop operation is ended because the implicit grab is removed. she ATE.
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 2116 of file wayland-server-protocol.cpp.
π¦ void data_device_t::enter (uint32_t serial, surface_t const & surface, double x, double y, data_offer_t const & id, bool post = true)
initiate drag-and-drop session β¨
Parameters
serialβ serial number of the enter eventsurfaceβ client surface enteredxβ surface-localxcoordinateyβ surface-localycoordinateidβ 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. it's giving "you're in my territory now" π
Definition at line 2101 of file wayland-server-protocol.cpp.
β std::string wayland::server::resource_t::get_class () [inherited]
Retrieve the interface name (class) of a resource object.
Returns Interface name of the resource object.
[inherited] β meaning she's from wayland::server::resource_t, not your homegirl. still iconic though.
πΈ client_t wayland::server::resource_t::get_client () const [inherited]
Get the associated client
Returns the client that owns the resource.
π uint32_t wayland::server::resource_t::get_id () const [inherited]
Get the internal ID of the resource
Returns the internal ID of the resource
π§ unsigned int wayland::server::resource_t::get_version () const [inherited]
Get interface version
Returns Interface version this resource has been constructed with.
π void data_device_t::leave (bool post = true)
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. like, required required, bestie β not optional π
Definition at line 2106 of file wayland-server-protocol.cpp.
π void data_device_t::motion (uint32_t time, double x, double y, bool post = true)
drag-and-drop session motion π
Parameters
timeβ timestamp with millisecond granularityxβ surface-localxcoordinateyβ surface-localycoordinate
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. tracking them moves, respectful king π
Definition at line 2111 of file wayland-server-protocol.cpp.
π«Ά std::function< void()> & data_device_t::on_release ()
destroy data device. this request destroys the data device.
Definition at line 2090 of file wayland-server-protocol.cpp.
π std::function< void(data_source_t, uint32_t)> & data_device_t::on_set_selection ()
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. bye clipboard, it was real π«‘
Definition at line 2084 of file wayland-server-protocol.cpp.
π std::function< void(data_source_t, surface_t, surface_t, uint32_t)> & data_device_t::on_start_drag ()
start drag-and-drop operation β the main event, honestly.
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 iconwl_surfaceare cleared, andwl_surface.set_input_regionis ignored until thewl_surfaceis no longer used as the icon surface. when the use as an icon ends, the current and pending input regions become undefined, and thewl_surfaceis unmapped.
Definition at line 2078 of file wayland-server-protocol.cpp.
π void wayland::server::resource_t::post_no_memory () const [inherited]
Post "not enough memory" error to the client π
if the compositor has not enough memory to fulfill a certail request of the client, this function can be called to notify the client of this circumstance. (yes, "certail" β that's how the original spells it, girlboss typo and all, celebrating it fr fr π)
π void data_device_t::post_role (std::string const & msg)
Post error: given wl_surface has another role. π¨
Definition at line 2126 of file wayland-server-protocol.cpp.
β bool wayland::server::resource_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. vibe check complete β¨
πΈ void data_device_t::selection (data_offer_t const & id, bool post = true)
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. no cap, that's a must π«Ά
Definition at line 2121 of file wayland-server-protocol.cpp.
part 1 done bestie, more follows ππ¦π
πΈ MEMBER DATA DOCUMENTATION πΈ
okay bestie, these are the static constants, and honestly the whole vibe here is "same energy, different function" π
Every single one of them is a std::uint32_t, every single one is [static] and [constexpr], and every single one is literally just 1 β which like, fair, they're all protocol-v1 girlies π
data_offer_since_versionβstd::uint32_t,[static],[constexpr], value1. This is the minimum protocol version required for thedata_offerfunction. Defined at line 1435 of filewayland-server-protocol.hpp. πdrop_since_versionβstd::uint32_t,[static],[constexpr], value1. Minimum protocol version required for thedropfunction. Defined at line 1507 of filewayland-server-protocol.hpp. π¦enter_since_versionβstd::uint32_t,[static],[constexpr], value1. Minimum protocol version required for theenterfunction. Defined at line 1454 of filewayland-server-protocol.hpp. β¨leave_since_versionβstd::uint32_t,[static],[constexpr], value1. Minimum protocol version required for theleavefunction. Defined at line 1467 of filewayland-server-protocol.hpp. πΈmotion_since_versionβstd::uint32_t,[static],[constexpr], value1. Minimum protocol version required for themotionfunction. Defined at line 1484 of filewayland-server-protocol.hpp. π«selection_since_versionβstd::uint32_t,[static],[constexpr], value1. Minimum protocol version required for theselectionfunction. Defined at line 1530 of filewayland-server-protocol.hpp. π₯
so yeah, they're all 1, all constexpr, all static, and they all live in wayland-server-protocol.hpp β just at different line numbers, which is the only plot twist in this entire section π
π AUTHOR π
Generated automatically by Doxygen for Wayland++ from the source code. no cap, a robot wrote this, not a human, and honestly? it ate π€π
and that's a wrap on wayland::server::data_device_t(3), bestie!! π«Ά this whole thing is Version 1.0.1 and it's dated Fri Mar 27 2026 at 13-something o'clock π β go forth and slay your Wayland server, mwah ππ§ββοΈ
π¦ 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