Struct smithay_clipboard::state::State

source ·
pub struct State {
Show 14 fields pub primary_selection_manager_state: Option<PrimarySelectionManagerState>, pub data_device_manager_state: Option<DataDeviceManagerState>, pub reply_tx: Sender<Result<String>>, pub exit: bool, registry_state: RegistryState, seat_state: SeatState, seats: HashMap<ObjectId, ClipboardSeatState>, latest_seat: Option<ObjectId>, loop_handle: LoopHandle<'static, Self>, queue_handle: QueueHandle<Self>, primary_sources: Vec<PrimarySelectionSource>, primary_selection_content: Rc<[u8]>, data_sources: Vec<CopyPasteSource>, data_selection_content: Rc<[u8]>,
}

Fields§

§primary_selection_manager_state: Option<PrimarySelectionManagerState>§data_device_manager_state: Option<DataDeviceManagerState>§reply_tx: Sender<Result<String>>§exit: bool§registry_state: RegistryState§seat_state: SeatState§seats: HashMap<ObjectId, ClipboardSeatState>§latest_seat: Option<ObjectId>

The latest seat which got an event.

§loop_handle: LoopHandle<'static, Self>§queue_handle: QueueHandle<Self>§primary_sources: Vec<PrimarySelectionSource>§primary_selection_content: Rc<[u8]>§data_sources: Vec<CopyPasteSource>§data_selection_content: Rc<[u8]>

Implementations§

source§

impl State

source

pub fn new( globals: &GlobalList, queue_handle: &QueueHandle<Self>, loop_handle: LoopHandle<'static, Self>, reply_tx: Sender<Result<String>>, ) -> Option<Self>

source

pub fn store_selection( &mut self, ty: SelectionTarget, contents: String, ) -> Option<()>

Store selection for the given target.

Selection source is only created when Some(()) is returned.

source

pub fn load_selection(&mut self, ty: SelectionTarget) -> Result<()>

Load selection for the given target.

source

fn send_request( &mut self, ty: SelectionTarget, write_pipe: WritePipe, mime: String, )

Trait Implementations§

source§

impl DataDeviceHandler for State

source§

fn enter( &mut self, _: &Connection, _: &QueueHandle<Self>, _: &WlDataDevice, _: f64, _: f64, _: &WlSurface, )

The data device pointer has entered a surface at the provided location
source§

fn leave(&mut self, _: &Connection, _: &QueueHandle<Self>, _: &WlDataDevice)

The drag and drop pointer has left the surface and the session ends. The offer will be destroyed unless it was previously dropped. In the case of a dropped offer, the client must destroy it manually after it is finished.
source§

fn motion( &mut self, _: &Connection, _: &QueueHandle<Self>, _: &WlDataDevice, _: f64, _: f64, )

Drag and Drop motion.
source§

fn drop_performed( &mut self, _: &Connection, _: &QueueHandle<Self>, _: &WlDataDevice, )

Drop performed. After the next data offer action event, data may be able to be received, unless the action is “ask”.
source§

fn selection(&mut self, _: &Connection, _: &QueueHandle<Self>, _: &WlDataDevice)

Advertises a new selection.
source§

impl DataOfferHandler for State

source§

fn source_actions( &mut self, _: &Connection, _: &QueueHandle<Self>, _: &mut DragOffer, _: DndAction, )

Called to advertise the available DnD Actions as set by the source.
source§

fn selected_action( &mut self, _: &Connection, _: &QueueHandle<Self>, _: &mut DragOffer, _: DndAction, )

Called to advertise the action selected by the compositor after matching the source/destination side actions. Only one action or none will be selected in the actions sent by the compositor. This may be called multiple times during a DnD operation. The most recent DndAction is the only valid one. Read more
source§

impl DataSourceHandler for State

source§

fn send_request( &mut self, _: &Connection, _: &QueueHandle<Self>, _: &WlDataSource, mime: String, write_pipe: WritePipe, )

The client has requested the data for this source to be sent. Send the data, then close the fd.
source§

fn cancelled( &mut self, _: &Connection, _: &QueueHandle<Self>, deleted: &WlDataSource, )

The data source is no longer valid Cleanup & destroy this resource
source§

fn accept_mime( &mut self, _: &Connection, _: &QueueHandle<Self>, _: &WlDataSource, _: Option<String>, )

This may be called multiple times, once for each accepted mime type from the destination, if any.
source§

fn dnd_dropped( &mut self, _: &Connection, _: &QueueHandle<Self>, _: &WlDataSource, )

A drop was performed. The data source will be used and should not be destroyed yet
source§

fn action( &mut self, _: &Connection, _: &QueueHandle<Self>, _: &WlDataSource, _: DndAction, )

An action was selected by the compositor.
source§

fn dnd_finished( &mut self, _: &Connection, _: &QueueHandle<Self>, _: &WlDataSource, )

The drag and drop finished. The data source may be destroyed.
source§

impl Dispatch<WlDataDevice, DataDeviceData> for State

source§

fn event( state: &mut Self, proxy: &WlDataDevice, event: <WlDataDevice as Proxy>::Event, data: &DataDeviceData, conn: &Connection, qhandle: &QueueHandle<Self>, )

Called when an event from the server is processed Read more
source§

fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl Dispatch<WlDataDeviceManager, GlobalData> for State

source§

fn event( state: &mut Self, proxy: &WlDataDeviceManager, event: <WlDataDeviceManager as Proxy>::Event, data: &GlobalData, conn: &Connection, qhandle: &QueueHandle<Self>, )

Called when an event from the server is processed Read more
source§

fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl Dispatch<WlDataOffer, DataOfferData> for State

source§

fn event( state: &mut Self, proxy: &WlDataOffer, event: <WlDataOffer as Proxy>::Event, data: &DataOfferData, conn: &Connection, qhandle: &QueueHandle<Self>, )

Called when an event from the server is processed Read more
source§

fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl Dispatch<WlDataSource, DataSourceData> for State

source§

fn event( state: &mut Self, proxy: &WlDataSource, event: <WlDataSource as Proxy>::Event, data: &DataSourceData, conn: &Connection, qhandle: &QueueHandle<Self>, )

Called when an event from the server is processed Read more
source§

fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl Dispatch<WlKeyboard, ObjectId> for State

source§

fn event( state: &mut State, _: &WlKeyboard, event: <WlKeyboard as Proxy>::Event, data: &ObjectId, _: &Connection, _: &QueueHandle<State>, )

Called when an event from the server is processed Read more
source§

fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl Dispatch<WlPointer, PointerData> for State

source§

fn event( state: &mut Self, proxy: &WlPointer, event: <WlPointer as Proxy>::Event, data: &PointerData, conn: &Connection, qhandle: &QueueHandle<Self>, )

Called when an event from the server is processed Read more
source§

fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl Dispatch<WlRegistry, GlobalListContents> for State

source§

fn event( state: &mut Self, proxy: &WlRegistry, event: <WlRegistry as Proxy>::Event, data: &GlobalListContents, conn: &Connection, qhandle: &QueueHandle<Self>, )

Called when an event from the server is processed Read more
source§

fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl Dispatch<WlSeat, SeatData> for State

source§

fn event( state: &mut Self, proxy: &WlSeat, event: <WlSeat as Proxy>::Event, data: &SeatData, conn: &Connection, qhandle: &QueueHandle<Self>, )

Called when an event from the server is processed Read more
source§

fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl Dispatch<WpCursorShapeDeviceV1, GlobalData> for State

source§

fn event( state: &mut Self, proxy: &WpCursorShapeDeviceV1, event: <WpCursorShapeDeviceV1 as Proxy>::Event, data: &GlobalData, conn: &Connection, qhandle: &QueueHandle<Self>, )

Called when an event from the server is processed Read more
source§

fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl Dispatch<WpCursorShapeManagerV1, GlobalData> for State

source§

fn event( state: &mut Self, proxy: &WpCursorShapeManagerV1, event: <WpCursorShapeManagerV1 as Proxy>::Event, data: &GlobalData, conn: &Connection, qhandle: &QueueHandle<Self>, )

Called when an event from the server is processed Read more
source§

fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl Dispatch<ZwpPrimarySelectionDeviceManagerV1, GlobalData> for State

source§

fn event( state: &mut Self, proxy: &ZwpPrimarySelectionDeviceManagerV1, event: <ZwpPrimarySelectionDeviceManagerV1 as Proxy>::Event, data: &GlobalData, conn: &Connection, qhandle: &QueueHandle<Self>, )

Called when an event from the server is processed Read more
source§

fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl Dispatch<ZwpPrimarySelectionDeviceV1, PrimarySelectionDeviceData> for State

source§

fn event( state: &mut Self, proxy: &ZwpPrimarySelectionDeviceV1, event: <ZwpPrimarySelectionDeviceV1 as Proxy>::Event, data: &PrimarySelectionDeviceData, conn: &Connection, qhandle: &QueueHandle<Self>, )

Called when an event from the server is processed Read more
source§

fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl Dispatch<ZwpPrimarySelectionOfferV1, PrimarySelectionOfferData> for State

source§

fn event( state: &mut Self, proxy: &ZwpPrimarySelectionOfferV1, event: <ZwpPrimarySelectionOfferV1 as Proxy>::Event, data: &PrimarySelectionOfferData, conn: &Connection, qhandle: &QueueHandle<Self>, )

Called when an event from the server is processed Read more
source§

fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl Dispatch<ZwpPrimarySelectionSourceV1, GlobalData> for State

source§

fn event( state: &mut Self, proxy: &ZwpPrimarySelectionSourceV1, event: <ZwpPrimarySelectionSourceV1 as Proxy>::Event, data: &GlobalData, conn: &Connection, qhandle: &QueueHandle<Self>, )

Called when an event from the server is processed Read more
source§

fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl PointerHandler for State

source§

fn pointer_frame( &mut self, _: &Connection, _: &QueueHandle<Self>, pointer: &WlPointer, events: &[PointerEvent], )

One or more pointer events are available. Read more
source§

impl PrimarySelectionDeviceHandler for State

source§

fn selection( &mut self, _: &Connection, _: &QueueHandle<Self>, _: &ZwpPrimarySelectionDeviceV1, )

The new selection is received. Read more
source§

impl PrimarySelectionSourceHandler for State

source§

fn send_request( &mut self, _: &Connection, _: &QueueHandle<Self>, _: &ZwpPrimarySelectionSourceV1, mime: String, write_pipe: WritePipe, )

The client has requested the data for this source to be sent. Send the data, then close the fd.
source§

fn cancelled( &mut self, _: &Connection, _: &QueueHandle<Self>, deleted: &ZwpPrimarySelectionSourceV1, )

The data source is no longer valid Cleanup & destroy this resource
source§

impl ProvidesRegistryState for State

source§

fn runtime_add_global( &mut self, conn: &Connection, qh: &QueueHandle<Self>, name: u32, interface: &str, version: u32, )

Called when a new global has been advertised by the compositor. Read more
source§

fn runtime_remove_global( &mut self, conn: &Connection, qh: &QueueHandle<Self>, name: u32, interface: &str, )

Called when a global has been destroyed by the compositor.
source§

fn registry(&mut self) -> &mut RegistryState

Returns a mutable reference to the registry state.
source§

impl SeatHandler for State

source§

fn seat_state(&mut self) -> &mut SeatState

source§

fn new_seat(&mut self, _: &Connection, _: &QueueHandle<Self>, seat: WlSeat)

A new seat has been created. Read more
source§

fn new_capability( &mut self, _: &Connection, qh: &QueueHandle<Self>, seat: WlSeat, capability: Capability, )

A new capability is available on the seat. Read more
source§

fn remove_capability( &mut self, _: &Connection, _: &QueueHandle<Self>, seat: WlSeat, capability: Capability, )

A capability has been removed from the seat. Read more
source§

fn remove_seat(&mut self, _: &Connection, _: &QueueHandle<Self>, seat: WlSeat)

A seat has been removed. Read more

Auto Trait Implementations§

§

impl Freeze for State

§

impl !RefUnwindSafe for State

§

impl !Send for State

§

impl !Sync for State

§

impl Unpin for State

§

impl !UnwindSafe for State

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

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.
source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
source§

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.
source§

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.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more