[][src]Trait smithay_client_toolkit::data_device::DataDeviceHandling

pub trait DataDeviceHandling {
    fn set_callback<F: FnMut(WlSeat, DndEvent<'_>, DispatchData<'_>) + 'static>(
        &mut self,
        callback: F
    ) -> Result<(), ()>;
fn with_device<F: FnOnce(&DataDevice)>(
        &self,
        seat: &WlSeat,
        f: F
    ) -> Result<(), ()>; }

An interface trait to forward the data device handler capability

You need to implement this trait for your environment struct, by delegating it to its DataDeviceHandler field in order to get the associated methods on your Environment.

Required methods

fn set_callback<F: FnMut(WlSeat, DndEvent<'_>, DispatchData<'_>) + 'static>(
    &mut self,
    callback: F
) -> Result<(), ()>

Set the global drag'n'drop callback

Returns an error if the wl_data_device_manager global is missing.

fn with_device<F: FnOnce(&DataDevice)>(
    &self,
    seat: &WlSeat,
    f: F
) -> Result<(), ()>

Access the data device associated with a seat

Returns an error if the seat is not found (for example if it has since been removed by the server) or if the wl_data_device_manager global is missing.

Loading content...

Implementors

impl DataDeviceHandling for DataDeviceHandler[src]

Loading content...