Struct gdk::Seat [−][src]
pub struct Seat(_);
Expand description
The Seat
object represents a collection of input devices
that belong to a user.
This is an Abstract Base Class, you cannot instantiate it.
Implementations
This is supported on crate feature v3_20
only.
v3_20
only.This is supported on crate feature v3_20
only.
v3_20
only.This is supported on crate feature v3_20
only.
v3_20
only.This is supported on crate feature v3_20
only.
v3_20
only.This is supported on crate feature v3_20
only.
v3_20
only.Returns the slave devices that match the given capabilities.
capabilities
capabilities to get devices for
Returns
A list of GdkDevices
.
The list must be freed with g_list_free()
, the elements are owned
by GDK and must not be freed.
pub 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
This is supported on crate feature v3_20
only.
pub 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
v3_20
only.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.
This is supported on crate feature v3_20
only.
v3_20
only.Releases a grab added through grab()
.
This is supported on crate feature v3_20
only.
v3_20
only.pub fn connect_device_removed<F: Fn(&Self, &Device) + 'static>(
&self,
f: F
) -> SignalHandlerId
This is supported on crate feature v3_20
only.
pub fn connect_device_removed<F: Fn(&Self, &Device) + 'static>(
&self,
f: F
) -> SignalHandlerId
v3_20
only.pub fn connect_tool_added<F: Fn(&Self, &DeviceTool) + 'static>(
&self,
f: F
) -> SignalHandlerId
This is supported on crate features v3_20
and v3_22
only.
pub fn connect_tool_added<F: Fn(&Self, &DeviceTool) + 'static>(
&self,
f: F
) -> SignalHandlerId
v3_20
and v3_22
only.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 signal::Device::tool-changed
signal accordingly.
A same tool may be used by several devices.
tool
the new DeviceTool
known to the seat
pub fn connect_tool_removed<F: Fn(&Self, &DeviceTool) + 'static>(
&self,
f: F
) -> SignalHandlerId
This is supported on crate features v3_20
and v3_22
only.
pub fn connect_tool_removed<F: Fn(&Self, &DeviceTool) + 'static>(
&self,
f: F
) -> SignalHandlerId
v3_20
and v3_22
only.This signal is emitted whenever a tool is no longer known
to this seat
.
tool
the just removed DeviceTool
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Returns the type identifier of Self
.
Auto Trait Implementations
impl RefUnwindSafe for Seat
impl UnwindSafe for Seat
Blanket Implementations
Mutably borrows from an owned value. Read more
Upcasts an object to a superclass or interface T
. Read more
Upcasts an object to a reference of its superclass or interface T
. Read more
Tries to downcast to a subclass or interface implementor T
. Read more
Tries to downcast to a reference of its subclass or interface implementor T
. Read more
Tries to cast to an object of type T
. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while downcast
and upcast
will do many checks at compile-time already. Read more
Tries to cast to reference to an object of type T
. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while downcast
and upcast
will do many checks at compile-time already. Read more
Casts to T
unconditionally. Read more
Casts to &T
unconditionally. Read more
Returns true
if the object is an instance of (can be cast to) T
.
pub fn set_properties_from_value(
&self,
property_values: &[(&str, Value)]
) -> Result<(), BoolError>
pub fn set_property<'a, N, V>(
&self,
property_name: N,
value: V
) -> Result<(), BoolError> where
N: Into<&'a str>,
V: ToValue,
pub fn set_property_from_value<'a, N>(
&self,
property_name: N,
value: &Value
) -> Result<(), BoolError> where
N: Into<&'a str>,
Safety Read more
Safety Read more
Safety Read more
Safety Read more
pub fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId where
F: 'static + Fn(&T, &ParamSpec) + Send + Sync,
pub fn connect_notify_local<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: 'static + Fn(&T, &ParamSpec),
pub unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: Fn(&T, &ParamSpec),
pub fn has_property<'a, N>(&self, property_name: N, type_: Option<Type>) -> bool where
N: Into<&'a str>,
pub fn find_property<'a, N>(&self, property_name: N) -> Option<ParamSpec> where
N: Into<&'a str>,
pub fn connect<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
N: Into<&'a str>,
Same as connect
but takes a SignalId
instead of a signal name.
pub fn connect_local<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + 'static,
N: Into<&'a str>,
Same as connect_local
but takes a SignalId
instead of a signal name.
pub unsafe fn connect_unsafe<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value>,
N: Into<&'a str>,
Same as connect_unsafe
but takes a SignalId
instead of a signal name.
Emit signal by signal id.
Emit signal with details by signal id.
Emit signal by it’s name.
pub fn bind_property<'a, O, N, M>(
&'a self,
source_property: N,
target: &'a O,
target_property: M
) -> BindingBuilder<'a> where
O: ObjectType,
M: Into<&'a str>,
N: Into<&'a str>,
Same as emit
but takes Value
for the arguments.
Same as emit_by_name
but takes Value
for the arguments.
Returns a SendValue
clone of self
.
impl<'a, T, C> FromValueOptional<'a> for T where
C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError>,
T: FromValue<'a, Checker = C>,