[][src]Struct smithay_client_toolkit::data_device::DataDevice

pub struct DataDevice { /* fields omitted */ }

Handle to support data exchange on a given seat

This type provides you with functionality to send and receive data through drag'n'drop or copy/paste actions. It is associated with a seat upon creation.

Methods

impl DataDevice[src]

pub fn init_for_seat<Impl>(
    manager: &Proxy<WlDataDeviceManager>,
    seat: &Proxy<WlSeat>,
    implem: Impl
) -> DataDevice where
    Impl: FnMut(DndEvent<'a>) + Send + 'static, 
[src]

Create the DataDevice helper for this seat.

You need to provide an implementation that will handle drag'n'drop events.

pub unsafe fn init_for_seat_nonsend<Impl>(
    manager: &Proxy<WlDataDeviceManager>,
    seat: &Proxy<WlSeat>,
    implem: Impl,
    token: &QueueToken
) -> DataDevice where
    Impl: FnMut(DndEvent<'a>) + Send + 'static, 
[src]

Create the DataDevice helper for this seat.

Same as init_for_seat(), but allows the implementation to not be send.

unsafety: unsafe for the same reasons as NewProxy::implement_nonsend.

pub fn start_drag(
    &self,
    origin: &Proxy<WlSurface>,
    source: Option<DataSource>,
    actions: DndAction,
    icon: Option<&Proxy<WlSurface>>,
    serial: u32
)
[src]

Start a drag'n'drop offer

You need to specify the origin surface, as well a serial associated to an implicit grab on this surface (for example received by a pointer click).

An optional DataSource can be provided. If it is None, this drag'n'drop will be considered as internal to your application, and other applications will not be notified of it. You are then responsible for acting accordingly on drop.

You also need to specify which possible drag'n'drop actions are associated to this drag (copy, move, or ask), the final action will be chosen by the target and/or compositor.

You can finally provide a surface that will be used as an icon associated with this drag'n'drop for user visibility.

pub fn set_selection(&self, source: &Option<DataSource>, serial: u32)[src]

Provide a data source as the new content for the selection

Correspond to traditional copy/paste behavior. Setting the source to None will clear the selection.

pub fn with_selection<F, T>(&self, f: F) -> T where
    F: FnOnce(Option<&DataOffer>) -> T, 
[src]

Access the DataOffer currently associated with the selection buffer

Trait Implementations

impl Drop for DataDevice[src]

Auto Trait Implementations

impl Send for DataDevice

impl Sync for DataDevice

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]