pub trait SeatExt: IsA<Seat> + 'static {
// Provided methods
fn capabilities(&self) -> SeatCapabilities { ... }
fn display(&self) -> Option<Display> { ... }
fn keyboard(&self) -> Option<Device> { ... }
fn pointer(&self) -> Option<Device> { ... }
fn slaves(&self, capabilities: SeatCapabilities) -> Vec<Device> { ... }
fn grab(
&self,
window: &Window,
capabilities: SeatCapabilities,
owner_events: bool,
cursor: Option<&Cursor>,
event: Option<&Event>,
prepare_func: Option<&mut dyn FnMut(&Seat, &Window)>,
) -> GrabStatus { ... }
fn ungrab(&self) { ... }
fn connect_device_added<F: Fn(&Self, &Device) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_device_removed<F: Fn(&Self, &Device) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_tool_added<F: Fn(&Self, &DeviceTool) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_tool_removed<F: Fn(&Self, &DeviceTool) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}Provided Methods§
Sourcefn capabilities(&self) -> SeatCapabilities
fn capabilities(&self) -> SeatCapabilities
Sourcefn slaves(&self, capabilities: SeatCapabilities) -> Vec<Device>
fn slaves(&self, capabilities: SeatCapabilities) -> Vec<Device>
Sourcefn grab(
&self,
window: &Window,
capabilities: SeatCapabilities,
owner_events: bool,
cursor: Option<&Cursor>,
event: Option<&Event>,
prepare_func: Option<&mut dyn FnMut(&Seat, &Window)>,
) -> GrabStatus
fn grab( &self, window: &Window, capabilities: SeatCapabilities, owner_events: bool, cursor: Option<&Cursor>, event: Option<&Event>, prepare_func: Option<&mut dyn FnMut(&Seat, &Window)>, ) -> GrabStatus
Grabs the seat so that all events corresponding to the given capabilities
are passed to this application until the seat is ungrabbed with ungrab(),
or the window becomes hidden. This overrides any previous grab on the
seat by this client.
As a rule of thumb, if a grab is desired over SeatCapabilities::POINTER,
all other “pointing” capabilities (eg. SeatCapabilities::TOUCH) should
be grabbed too, so the user is able to interact with all of those while
the grab holds, you should thus use SeatCapabilities::ALL_POINTING most
commonly.
Grabs are used for operations which need complete control over the events corresponding to the given capabilities. For example in GTK+ this is used for Drag and Drop operations, popup menus and such.
Note that if the event mask of a Window has selected both button press
and button release events, or touch begin and touch end, then a press event
will cause an automatic grab until the button is released, equivalent to a
grab on the window with owner_events set to true. This is done because most
applications expect to receive paired press and release events.
If you set up anything at the time you take the grab that needs to be
cleaned up when the grab ends, you should handle the EventGrabBroken
events that are emitted when the grab ends unvoluntarily.
§window
the Window which will own the grab
§capabilities
capabilities that will be grabbed
§owner_events
if false then all device events are reported with respect to
window and are only reported if selected by event_mask. If
true then pointer events for this application are reported
as normal, but pointer events outside this application are
reported with respect to window and only if selected by
event_mask. In either mode, unreported events are discarded.
§cursor
the cursor to display while the grab is active. If
this is None then the normal cursors are used for
window and its descendants, and the cursor for window is used
elsewhere.
§event
the event that is triggering the grab, or None if none
is available.
§prepare_func
function to
prepare the window to be grabbed, it can be None if window is
visible before this call.
§prepare_func_data
user data to pass to prepare_func
§Returns
GrabStatus::Success if the grab was successful.
Sourcefn connect_device_added<F: Fn(&Self, &Device) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_device_added<F: Fn(&Self, &Device) + 'static>( &self, f: F, ) -> SignalHandlerId
Sourcefn connect_device_removed<F: Fn(&Self, &Device) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_device_removed<F: Fn(&Self, &Device) + 'static>( &self, f: F, ) -> SignalHandlerId
Sourcefn connect_tool_added<F: Fn(&Self, &DeviceTool) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_tool_added<F: Fn(&Self, &DeviceTool) + 'static>( &self, f: F, ) -> SignalHandlerId
The ::tool-added signal is emitted whenever a new tool
is made known to the seat. The tool may later be assigned
to a device (i.e. on proximity with a tablet). The device
will emit the tool-changed signal accordingly.
A same tool may be used by several devices.
§tool
the new DeviceTool known to the seat
Sourcefn connect_tool_removed<F: Fn(&Self, &DeviceTool) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_tool_removed<F: Fn(&Self, &DeviceTool) + 'static>( &self, f: F, ) -> SignalHandlerId
This signal is emitted whenever a tool is no longer known
to this seat.
§tool
the just removed DeviceTool
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".