Enum wayland_client::protocol::wl_data_device::Event
source · [−]#[non_exhaustive]
pub enum Event {
DataOffer {
id: Main<WlDataOffer>,
},
Enter {
serial: u32,
surface: WlSurface,
x: f64,
y: f64,
id: Option<WlDataOffer>,
},
Leave,
Motion {
time: u32,
x: f64,
y: f64,
},
Drop,
Selection {
id: Option<WlDataOffer>,
},
}
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
DataOffer
Fields
id: Main<WlDataOffer>
introduce a new wl_data_offer
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.
Enter
initiate drag-and-drop session
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.
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.
Motion
drag-and-drop session motion
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.
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.
Selection
Fields
id: Option<WlDataOffer>
advertise new selection
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.
Trait Implementations
sourceimpl MessageGroup for Event
impl MessageGroup for Event
sourceconst MESSAGES: &'static [MessageDesc] = _
const MESSAGES: &'static [MessageDesc] = _
Wire representation of this MessageGroup
type Map = ProxyMap
type Map = ProxyMap
The wrapper type for ObjectMap allowing the mapping of Object and NewId arguments to the object map during parsing. Read more
sourcefn is_destructor(&self) -> bool
fn is_destructor(&self) -> bool
Whether this message is a destructor Read more
sourcefn child<Meta: ObjectMetadata>(
opcode: u16,
version: u32,
meta: &Meta
) -> Option<Object<Meta>>
fn child<Meta: ObjectMetadata>(
opcode: u16,
version: u32,
meta: &Meta
) -> Option<Object<Meta>>
Retrieve the child Object
associated with this message if any
sourcefn from_raw(msg: Message, map: &mut Self::Map) -> Result<Self, ()>
fn from_raw(msg: Message, map: &mut Self::Map) -> Result<Self, ()>
Construct a message from its raw representation
sourceunsafe fn from_raw_c(
obj: *mut c_void,
opcode: u32,
args: *const wl_argument
) -> Result<Event, ()>
unsafe fn from_raw_c(
obj: *mut c_void,
opcode: u32,
args: *const wl_argument
) -> Result<Event, ()>
Construct a message of this group from its C representation Read more
sourcefn as_raw_c_in<F, T>(self, f: F) -> T where
F: FnOnce(u32, &mut [wl_argument]) -> T,
fn as_raw_c_in<F, T>(self, f: F) -> T where
F: FnOnce(u32, &mut [wl_argument]) -> T,
Build a C representation of this message Read more
Auto Trait Implementations
impl !RefUnwindSafe for Event
impl !Send for Event
impl !Sync for Event
impl Unpin for Event
impl !UnwindSafe for Event
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more