#[repr(transparent)]pub struct Device { /* private fields */ }
Expand description
The Device
object represents a single input device, such
as a keyboard, a mouse, a touchpad, etc.
See the DeviceManager
documentation for more information
about the various kinds of master and slave devices, and their
relationships.
This is an Abstract Base Class, you cannot instantiate it.
Implementations
sourceimpl Device
impl Device
sourcepub fn associated_device(&self) -> Option<Device>
pub fn associated_device(&self) -> Option<Device>
Returns the associated device to self
, if self
is of type
DeviceType::Master
, it will return the paired pointer or
keyboard.
If self
is of type DeviceType::Slave
, it will return
the master device to which self
is attached to.
If self
is of type DeviceType::Floating
, None
will be
returned, as there is no associated device.
Returns
The associated device, or
None
sourcepub fn axes(&self) -> AxisFlags
Available on crate feature v3_22
only.
pub fn axes(&self) -> AxisFlags
v3_22
only.Returns the axes currently available on the device.
sourcepub fn device_type(&self) -> DeviceType
pub fn device_type(&self) -> DeviceType
sourcepub fn has_cursor(&self) -> bool
pub fn has_cursor(&self) -> bool
sourcepub fn last_event_window(&self) -> Option<Window>
pub fn last_event_window(&self) -> Option<Window>
Gets information about which window the given pointer device is in, based on events
that have been received so far from the display server. If another application
has a pointer grab, or this application has a grab with owner_events = false
,
None
may be returned even if the pointer is physically over one of this
application’s windows.
Returns
the last window the device
sourcepub fn position(&self) -> (Screen, i32, i32)
pub fn position(&self) -> (Screen, i32, i32)
Gets the current location of self
. As a slave device
coordinates are those of its master pointer, This function
may not be called on devices of type DeviceType::Slave
,
unless there is an ongoing grab on them, see grab()
.
Returns
screen
location to store the Screen
the self
is on, or None
.
x
location to store root window X coordinate of self
, or None
.
y
location to store root window Y coordinate of self
, or None
.
sourcepub fn position_double(&self) -> (Screen, f64, f64)
pub fn position_double(&self) -> (Screen, f64, f64)
Gets the current location of self
in double precision. As a slave device’s
coordinates are those of its master pointer, this function
may not be called on devices of type DeviceType::Slave
,
unless there is an ongoing grab on them. See grab()
.
Returns
screen
location to store the Screen
the self
is on, or None
.
x
location to store root window X coordinate of self
, or None
.
y
location to store root window Y coordinate of self
, or None
.
sourcepub fn product_id(&self) -> Option<GString>
pub fn product_id(&self) -> Option<GString>
Returns the product ID of this device, or None
if this information couldn’t
be obtained. This ID is retrieved from the device, and is thus constant for
it. See vendor_id()
for more information.
Returns
the product ID, or None
sourcepub fn source(&self) -> InputSource
pub fn source(&self) -> InputSource
sourcepub fn vendor_id(&self) -> Option<GString>
pub fn vendor_id(&self) -> Option<GString>
Returns the vendor ID of this device, or None
if this information couldn’t
be obtained. This ID is retrieved from the device, and is thus constant for
it.
This function, together with product_id()
, can be used to eg.
compose GSettings
paths to store settings for this device.
⚠️ The following code is in C ⚠️
static GSettings *
get_device_settings (GdkDevice *device)
{
const gchar *vendor, *product;
GSettings *settings;
GdkDevice *device;
gchar *path;
vendor = gdk_device_get_vendor_id (device);
product = gdk_device_get_product_id (device);
path = g_strdup_printf ("/org/example/app/devices/%s:%s/", vendor, product);
settings = g_settings_new_with_path (DEVICE_SCHEMA, path);
g_free (path);
return settings;
}
Returns
the vendor ID, or None
sourcepub fn window_at_position(&self) -> (Option<Window>, i32, i32)
pub fn window_at_position(&self) -> (Option<Window>, i32, i32)
Obtains the window underneath self
, returning the location of the device in win_x
and win_y
. Returns
None
if the window tree under self
is not known to GDK (for example, belongs to another application).
As a slave device coordinates are those of its master pointer, This
function may not be called on devices of type DeviceType::Slave
,
unless there is an ongoing grab on them, see grab()
.
Returns
the Window
under the
device position, or None
.
win_x
return location for the X coordinate of the device location,
relative to the window origin, or None
.
win_y
return location for the Y coordinate of the device location,
relative to the window origin, or None
.
sourcepub fn window_at_position_double(&self) -> (Option<Window>, f64, f64)
pub fn window_at_position_double(&self) -> (Option<Window>, f64, f64)
Obtains the window underneath self
, returning the location of the device in win_x
and win_y
in
double precision. Returns None
if the window tree under self
is not known to GDK (for example,
belongs to another application).
As a slave device coordinates are those of its master pointer, This
function may not be called on devices of type DeviceType::Slave
,
unless there is an ongoing grab on them, see grab()
.
Returns
the Window
under the
device position, or None
.
win_x
return location for the X coordinate of the device location,
relative to the window origin, or None
.
win_y
return location for the Y coordinate of the device location,
relative to the window origin, or None
.
sourcepub fn grab(
&self,
window: &Window,
grab_ownership: GrabOwnership,
owner_events: bool,
event_mask: EventMask,
cursor: Option<&Cursor>,
time_: u32
) -> GrabStatus
pub fn grab(
&self,
window: &Window,
grab_ownership: GrabOwnership,
owner_events: bool,
event_mask: EventMask,
cursor: Option<&Cursor>,
time_: u32
) -> GrabStatus
Grabs the device so that all events coming from this device are passed to
this application until the device is ungrabbed with ungrab()
,
or the window becomes unviewable. This overrides any previous grab on the device
by this client.
Note that self
and window
need to be on the same display.
Device grabs are used for operations which need complete control over the given device events (either pointer or keyboard). For example in GTK+ this is used for Drag and Drop operations, popup menus and such.
Note that if the event mask of an X window has selected both button press
and button release events, then a button press event will cause an automatic
pointer grab until the button is released. X does this automatically since
most applications expect to receive button press and release events in pairs.
It is equivalent to a pointer grab on the window with owner_events
set to
true
.
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.
Deprecated since 3.20
Use Seat::grab()
instead.
window
the Window
which will own the grab (the grab window)
grab_ownership
specifies the grab ownership.
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.
event_mask
specifies the event mask, which is used in accordance with
owner_events
.
cursor
the cursor to display while the grab is active if the device is
a pointer. If this is None
then the normal cursors are used for
window
and its descendants, and the cursor for window
is used
elsewhere.
time_
the timestamp of the event which led to this pointer grab. This
usually comes from the GdkEvent
struct, though GDK_CURRENT_TIME
can be used if the time isn’t known.
Returns
GrabStatus::Success
if the grab was successful.
sourcepub fn list_axes(&self) -> Vec<Atom>
pub fn list_axes(&self) -> Vec<Atom>
Returns a GList
of GdkAtoms
, containing the labels for
the axes that self
currently has.
Returns
A GList
of GdkAtoms
, free with g_list_free()
.
sourcepub fn list_slave_devices(&self) -> Vec<Device>
pub fn list_slave_devices(&self) -> Vec<Device>
If the device if of type DeviceType::Master
, it will return
the list of slave devices attached to it, otherwise it will return
None
Returns
the list of slave devices, or None
. The list must be
freed with g_list_free()
, the contents of the list are
owned by GTK+ and should not be freed.
sourcepub fn set_axis_use(&self, index_: u32, use_: AxisUse)
pub fn set_axis_use(&self, index_: u32, use_: AxisUse)
sourcepub fn set_key(&self, index_: u32, keyval: u32, modifiers: ModifierType)
pub fn set_key(&self, index_: u32, keyval: u32, modifiers: ModifierType)
sourcepub fn set_mode(&self, mode: InputMode) -> bool
pub fn set_mode(&self, mode: InputMode) -> bool
Sets a the mode of an input device. The mode controls if the device is active and whether the device’s range is mapped to the entire screen or to a single window.
Note: This is only meaningful for floating devices, master devices (and slaves connected to these) drive the pointer cursor, which is not limited by the input mode.
mode
the input mode.
Returns
true
if the mode was successfully changed.
sourcepub fn ungrab(&self, time_: u32)
pub fn ungrab(&self, time_: u32)
Release any grab on self
.
Deprecated since 3.20
Use Seat::ungrab()
instead.
time_
a timestap (e.g. GDK_CURRENT_TIME
).
sourcepub fn warp(&self, screen: &Screen, x: i32, y: i32)
pub fn warp(&self, screen: &Screen, x: i32, y: i32)
Warps self
in display
to the point x
,y
on
the screen screen
, unless the device is confined
to a window by a grab, in which case it will be moved
as far as allowed by the grab. Warping the pointer
creates events as if the user had moved the mouse
instantaneously to the destination.
Note that the pointer should normally be under the
control of the user. This function was added to cover
some rare use cases like keyboard navigation support
for the color picker in the GtkColorSelectionDialog
.
screen
the screen to warp self
to.
x
the X coordinate of the destination.
y
the Y coordinate of the destination.
sourcepub fn device_manager(&self) -> Option<DeviceManager>
pub fn device_manager(&self) -> Option<DeviceManager>
The DeviceManager
the Device
pertains to.
pub fn input_mode(&self) -> InputMode
pub fn set_input_mode(&self, input_mode: InputMode)
sourcepub fn input_source(&self) -> InputSource
pub fn input_source(&self) -> InputSource
Source type for the device.
sourcepub fn num_touches(&self) -> u32
Available on crate feature v3_20
only.
pub fn num_touches(&self) -> u32
v3_20
only.The maximal number of concurrent touches on a touch device. Will be 0 if the device is not a touch device or if the number of touches is unknown.
sourcepub fn set_seat(&self, seat: Option<&Seat>)
Available on crate feature v3_20
only.
pub fn set_seat(&self, seat: Option<&Seat>)
v3_20
only.Seat
of this device.
pub fn tool(&self) -> Option<DeviceTool>
v3_22
only.sourcepub fn type_(&self) -> DeviceType
pub fn type_(&self) -> DeviceType
Device role in the device manager.
sourcepub fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
pub fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
The ::changed signal is emitted either when the Device
has changed the number of either axes or keys. For example
In X this will normally happen when the slave device routing
events through the master device changes (for example, user
switches from the USB mouse to a tablet), in that case the
master device will change to reflect the new slave device
axes and keys.
sourcepub fn connect_tool_changed<F: Fn(&Self, &DeviceTool) + 'static>(
&self,
f: F
) -> SignalHandlerId
Available on crate feature v3_22
only.
pub fn connect_tool_changed<F: Fn(&Self, &DeviceTool) + 'static>(
&self,
f: F
) -> SignalHandlerId
v3_22
only.The ::tool-changed signal is emitted on pen/eraser
GdkDevices
whenever tools enter or leave proximity.
tool
The new current tool
pub fn connect_associated_device_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
pub fn connect_axes_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
v3_22
only.pub fn connect_input_mode_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
pub fn connect_n_axes_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
pub fn connect_seat_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
v3_20
only.pub fn connect_tool_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
v3_22
only.pub fn connect_type_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
sourceimpl Device
impl Device
pub fn is_axis(&self, axes: &mut [f64], use_: AxisUse, value: &mut f64) -> bool
sourcepub fn history<P: IsA<Window>>(
&self,
window: &P,
start: u32,
stop: u32
) -> Vec<TimeCoord>
pub fn history<P: IsA<Window>>(
&self,
window: &P,
start: u32,
stop: u32
) -> Vec<TimeCoord>
Obtains the motion history for a pointer device; given a starting and
ending timestamp, return all events in the motion history for
the device in the given range of time. Some windowing systems
do not support motion history, in which case, false
will
be returned. (This is not distinguishable from the case where
motion history is supported and no events were found.)
Note that there is also Window::set_event_compression()
to get
more motion events delivered directly, independent of the windowing
system.
window
the window with respect to which which the event coordinates will be reported
start
starting timestamp for range of events to return
stop
ending timestamp for the range of events to return
Returns
true
if the windowing system supports motion history and
at least one event was found.
events
location to store a newly-allocated array of TimeCoord
, or
None
Trait Implementations
sourceimpl Ord for Device
impl Ord for Device
sourceimpl ParentClassIs for Device
impl ParentClassIs for Device
sourceimpl<OT: ObjectType> PartialEq<OT> for Device
impl<OT: ObjectType> PartialEq<OT> for Device
sourceimpl<OT: ObjectType> PartialOrd<OT> for Device
impl<OT: ObjectType> PartialOrd<OT> for Device
sourcefn partial_cmp(&self, other: &OT) -> Option<Ordering>
fn partial_cmp(&self, other: &OT) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl StaticType for Device
impl StaticType for Device
sourcefn static_type() -> Type
fn static_type() -> Type
Returns the type identifier of Self
.
impl Eq for Device
impl IsA<Device> for DevicePad
v3_22
only.Auto Trait Implementations
impl RefUnwindSafe for Device
impl !Send for Device
impl !Sync for Device
impl Unpin for Device
impl UnwindSafe for Device
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Cast for T where
T: ObjectType,
impl<T> Cast for T where
T: ObjectType,
sourcefn upcast<T>(self) -> T where
T: ObjectType,
Self: IsA<T>,
fn upcast<T>(self) -> T where
T: ObjectType,
Self: IsA<T>,
Upcasts an object to a superclass or interface T
. Read more
sourcefn upcast_ref<T>(&self) -> &T where
T: ObjectType,
Self: IsA<T>,
fn upcast_ref<T>(&self) -> &T where
T: ObjectType,
Self: IsA<T>,
Upcasts an object to a reference of its superclass or interface T
. Read more
sourcefn downcast<T>(self) -> Result<T, Self> where
T: ObjectType,
Self: CanDowncast<T>,
fn downcast<T>(self) -> Result<T, Self> where
T: ObjectType,
Self: CanDowncast<T>,
Tries to downcast to a subclass or interface implementor T
. Read more
sourcefn downcast_ref<T>(&self) -> Option<&T> where
T: ObjectType,
Self: CanDowncast<T>,
fn downcast_ref<T>(&self) -> Option<&T> where
T: ObjectType,
Self: CanDowncast<T>,
Tries to downcast to a reference of its subclass or interface implementor T
. Read more
sourcefn dynamic_cast<T>(self) -> Result<T, Self> where
T: ObjectType,
fn dynamic_cast<T>(self) -> Result<T, Self> where
T: ObjectType,
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
sourcefn dynamic_cast_ref<T>(&self) -> Option<&T> where
T: ObjectType,
fn dynamic_cast_ref<T>(&self) -> Option<&T> where
T: ObjectType,
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
sourceunsafe fn unsafe_cast<T>(self) -> T where
T: ObjectType,
unsafe fn unsafe_cast<T>(self) -> T where
T: ObjectType,
Casts to T
unconditionally. Read more
sourceunsafe fn unsafe_cast_ref<T>(&self) -> &T where
T: ObjectType,
unsafe fn unsafe_cast_ref<T>(&self) -> &T where
T: ObjectType,
Casts to &T
unconditionally. Read more
sourceimpl<U> IsSubclassableExt for U where
U: IsClass + ParentClassIs,
impl<U> IsSubclassableExt for U where
U: IsClass + ParentClassIs,
fn parent_class_init<T>(class: &mut Class<U>) where
T: ObjectSubclass,
<U as ParentClassIs>::Parent: IsSubclassable<T>,
fn parent_instance_init<T>(instance: &mut InitializingObject<T>) where
T: ObjectSubclass,
<U as ParentClassIs>::Parent: IsSubclassable<T>,
sourceimpl<T> ObjectExt for T where
T: ObjectType,
impl<T> ObjectExt for T where
T: ObjectType,
sourcefn is<U>(&self) -> bool where
U: StaticType,
fn is<U>(&self) -> bool where
U: StaticType,
Returns true
if the object is an instance of (can be cast to) T
.
sourcefn object_class(&self) -> &Class<Object>
fn object_class(&self) -> &Class<Object>
Returns the ObjectClass
of the object. Read more
sourcefn class_of<U>(&self) -> Option<&Class<U>> where
U: IsClass,
fn class_of<U>(&self) -> Option<&Class<U>> where
U: IsClass,
Returns the class of the object in the given type T
. Read more
sourcefn interface<U>(&self) -> Option<InterfaceRef<'_, U>> where
U: IsInterface,
fn interface<U>(&self) -> Option<InterfaceRef<'_, U>> where
U: IsInterface,
Returns the interface T
of the object. Read more
sourcefn try_set_property<V>(
&self,
property_name: &str,
value: V
) -> Result<(), BoolError> where
V: ToValue,
fn try_set_property<V>(
&self,
property_name: &str,
value: V
) -> Result<(), BoolError> where
V: ToValue,
Similar to Self::set_property
but fails instead of panicking.
sourcefn set_property<V>(&self, property_name: &str, value: V) where
V: ToValue,
fn set_property<V>(&self, property_name: &str, value: V) where
V: ToValue,
Sets the property property_name
of the object to value value
. Read more
sourcefn try_set_property_from_value(
&self,
property_name: &str,
value: &Value
) -> Result<(), BoolError>
fn try_set_property_from_value(
&self,
property_name: &str,
value: &Value
) -> Result<(), BoolError>
Similar to Self::set_property
but fails instead of panicking.
sourcefn set_property_from_value(&self, property_name: &str, value: &Value)
fn set_property_from_value(&self, property_name: &str, value: &Value)
Sets the property property_name
of the object to value value
. Read more
sourcefn try_set_properties(
&self,
property_values: &[(&str, &dyn ToValue)]
) -> Result<(), BoolError>
fn try_set_properties(
&self,
property_values: &[(&str, &dyn ToValue)]
) -> Result<(), BoolError>
Similar to Self::set_properties
but fails instead of panicking.
sourcefn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
Sets multiple properties of the object at once. Read more
sourcefn try_set_properties_from_value(
&self,
property_values: &[(&str, Value)]
) -> Result<(), BoolError>
fn try_set_properties_from_value(
&self,
property_values: &[(&str, Value)]
) -> Result<(), BoolError>
Similar to Self::set_properties_from_value
but fails instead of panicking.
sourcefn set_properties_from_value(&self, property_values: &[(&str, Value)])
fn set_properties_from_value(&self, property_values: &[(&str, Value)])
Sets multiple properties of the object at once. Read more
sourcefn try_property<V>(&self, property_name: &str) -> Result<V, BoolError> where
V: 'static + for<'b> FromValue<'b>,
fn try_property<V>(&self, property_name: &str) -> Result<V, BoolError> where
V: 'static + for<'b> FromValue<'b>,
Similar to Self::property
but fails instead of panicking.
sourcefn property<V>(&self, property_name: &str) -> V where
V: 'static + for<'b> FromValue<'b>,
fn property<V>(&self, property_name: &str) -> V where
V: 'static + for<'b> FromValue<'b>,
Gets the property property_name
of the object and cast it to the type V. Read more
sourcefn try_property_value(&self, property_name: &str) -> Result<Value, BoolError>
fn try_property_value(&self, property_name: &str) -> Result<Value, BoolError>
Similar to Self::property_value
but fails instead of panicking.
sourcefn property_value(&self, property_name: &str) -> Value
fn property_value(&self, property_name: &str) -> Value
Gets the property property_name
of the object. Read more
sourcefn has_property(&self, property_name: &str, type_: Option<Type>) -> bool
fn has_property(&self, property_name: &str, type_: Option<Type>) -> bool
Check if the object has a property property_name
of the given type_
. Read more
sourcefn property_type(&self, property_name: &str) -> Option<Type>
fn property_type(&self, property_name: &str) -> Option<Type>
Get the type of the property property_name
of this object. Read more
sourcefn find_property(&self, property_name: &str) -> Option<ParamSpec>
fn find_property(&self, property_name: &str) -> Option<ParamSpec>
Get the ParamSpec
of the property property_name
of this object.
sourcefn list_properties(&self) -> PtrSlice<ParamSpec>
fn list_properties(&self) -> PtrSlice<ParamSpec>
Return all ParamSpec
of the properties of this object.
sourcefn freeze_notify(&self) -> PropertyNotificationFreezeGuard
fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
Freeze all property notifications until the return guard object is dropped. Read more
sourceunsafe fn set_qdata<QD>(&self, key: Quark, value: QD) where
QD: 'static,
unsafe fn set_qdata<QD>(&self, key: Quark, value: QD) where
QD: 'static,
Set arbitrary data on this object with the given key
. Read more
sourceunsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>> where
QD: 'static,
unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>> where
QD: 'static,
Return previously set arbitrary data of this object with the given key
. Read more
sourceunsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD> where
QD: 'static,
unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD> where
QD: 'static,
Retrieve previously set arbitrary data of this object with the given key
. Read more
sourceunsafe fn set_data<QD>(&self, key: &str, value: QD) where
QD: 'static,
unsafe fn set_data<QD>(&self, key: &str, value: QD) where
QD: 'static,
Set arbitrary data on this object with the given key
. Read more
sourceunsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>> where
QD: 'static,
unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>> where
QD: 'static,
Return previously set arbitrary data of this object with the given key
. Read more
sourceunsafe fn steal_data<QD>(&self, key: &str) -> Option<QD> where
QD: 'static,
unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD> where
QD: 'static,
Retrieve previously set arbitrary data of this object with the given key
. Read more
sourcefn block_signal(&self, handler_id: &SignalHandlerId)
fn block_signal(&self, handler_id: &SignalHandlerId)
Block a given signal handler. Read more
sourcefn unblock_signal(&self, handler_id: &SignalHandlerId)
fn unblock_signal(&self, handler_id: &SignalHandlerId)
Unblock a given signal handler.
sourcefn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
Stop emission of the currently emitted signal.
sourcefn stop_signal_emission_by_name(&self, signal_name: &str)
fn stop_signal_emission_by_name(&self, signal_name: &str)
Stop emission of the currently emitted signal by the (possibly detailed) signal name.
sourcefn try_connect<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: 'static + Fn(&[Value]) -> Option<Value> + Send + Sync,
fn try_connect<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: 'static + Fn(&[Value]) -> Option<Value> + Send + Sync,
Similar to Self::connect
but fails instead of panicking.
sourcefn connect<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> SignalHandlerId where
F: 'static + Fn(&[Value]) -> Option<Value> + Send + Sync,
fn connect<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> SignalHandlerId where
F: 'static + Fn(&[Value]) -> Option<Value> + Send + Sync,
Connect to the signal signal_name
on this object. Read more
sourcefn try_connect_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: 'static + Fn(&[Value]) -> Option<Value> + Send + Sync,
fn try_connect_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: 'static + Fn(&[Value]) -> Option<Value> + Send + Sync,
Similar to Self::connect_id
but fails instead of panicking.
sourcefn connect_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> SignalHandlerId where
F: 'static + Fn(&[Value]) -> Option<Value> + Send + Sync,
fn connect_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> SignalHandlerId where
F: 'static + Fn(&[Value]) -> Option<Value> + Send + Sync,
Connect to the signal signal_id
on this object. Read more
sourcefn try_connect_local<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: 'static + Fn(&[Value]) -> Option<Value>,
fn try_connect_local<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: 'static + Fn(&[Value]) -> Option<Value>,
Similar to Self::connect_local
but fails instead of panicking.
sourcefn connect_local<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> SignalHandlerId where
F: 'static + Fn(&[Value]) -> Option<Value>,
fn connect_local<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> SignalHandlerId where
F: 'static + Fn(&[Value]) -> Option<Value>,
Connect to the signal signal_name
on this object. Read more
sourcefn try_connect_local_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: 'static + Fn(&[Value]) -> Option<Value>,
fn try_connect_local_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: 'static + Fn(&[Value]) -> Option<Value>,
Similar to Self::connect_local_id
but fails instead of panicking.
sourcefn connect_local_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> SignalHandlerId where
F: 'static + Fn(&[Value]) -> Option<Value>,
fn connect_local_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> SignalHandlerId where
F: 'static + Fn(&[Value]) -> Option<Value>,
Connect to the signal signal_id
on this object. Read more
sourceunsafe fn try_connect_unsafe<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value>,
unsafe fn try_connect_unsafe<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value>,
Similar to Self::connect_unsafe
but fails instead of panicking.
sourceunsafe fn connect_unsafe<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> SignalHandlerId where
F: Fn(&[Value]) -> Option<Value>,
unsafe fn connect_unsafe<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> SignalHandlerId where
F: Fn(&[Value]) -> Option<Value>,
Connect to the signal signal_name
on this object. Read more
sourceunsafe fn try_connect_unsafe_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value>,
unsafe fn try_connect_unsafe_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value>,
Similar to Self::connect_unsafe_id
but fails instead of panicking.
sourcefn try_connect_closure(
&self,
signal_name: &str,
after: bool,
closure: RustClosure
) -> Result<SignalHandlerId, BoolError>
fn try_connect_closure(
&self,
signal_name: &str,
after: bool,
closure: RustClosure
) -> Result<SignalHandlerId, BoolError>
Similar to Self::connect_closure
but fails instead of panicking.
sourcefn connect_closure(
&self,
signal_name: &str,
after: bool,
closure: RustClosure
) -> SignalHandlerId
fn connect_closure(
&self,
signal_name: &str,
after: bool,
closure: RustClosure
) -> SignalHandlerId
Connect a closure to the signal signal_name
on this object. Read more
sourcefn try_connect_closure_id(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
closure: RustClosure
) -> Result<SignalHandlerId, BoolError>
fn try_connect_closure_id(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
closure: RustClosure
) -> Result<SignalHandlerId, BoolError>
Similar to Self::connect_closure_id
but fails instead of panicking.
sourcefn connect_closure_id(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
closure: RustClosure
) -> SignalHandlerId
fn connect_closure_id(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
closure: RustClosure
) -> SignalHandlerId
Connect a closure to the signal signal_id
on this object. Read more
sourcefn watch_closure(&self, closure: &impl AsRef<Closure>)
fn watch_closure(&self, closure: &impl AsRef<Closure>)
Limits the lifetime of closure
to the lifetime of the object. When
the object’s reference count drops to zero, the closure will be
invalidated. An invalidated closure will ignore any calls to
Closure::invoke
. Read more
sourceunsafe fn connect_unsafe_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> SignalHandlerId where
F: Fn(&[Value]) -> Option<Value>,
unsafe fn connect_unsafe_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> SignalHandlerId where
F: Fn(&[Value]) -> Option<Value>,
Connect to the signal signal_id
on this object. Read more
sourcefn try_emit<R>(
&self,
signal_id: SignalId,
args: &[&dyn ToValue]
) -> Result<R, BoolError> where
R: TryFromClosureReturnValue,
fn try_emit<R>(
&self,
signal_id: SignalId,
args: &[&dyn ToValue]
) -> Result<R, BoolError> where
R: TryFromClosureReturnValue,
Similar to Self::emit
but fails instead of panicking.
sourcefn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> R where
R: TryFromClosureReturnValue,
fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> R where
R: TryFromClosureReturnValue,
Emit signal by signal id. Read more
sourcefn try_emit_with_values(
&self,
signal_id: SignalId,
args: &[Value]
) -> Result<Option<Value>, BoolError>
fn try_emit_with_values(
&self,
signal_id: SignalId,
args: &[Value]
) -> Result<Option<Value>, BoolError>
Similar to Self::emit_with_values
but fails instead of panicking.
sourcefn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>
fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>
Same as Self::emit
but takes Value
for the arguments.
sourcefn try_emit_by_name<R>(
&self,
signal_name: &str,
args: &[&dyn ToValue]
) -> Result<R, BoolError> where
R: TryFromClosureReturnValue,
fn try_emit_by_name<R>(
&self,
signal_name: &str,
args: &[&dyn ToValue]
) -> Result<R, BoolError> where
R: TryFromClosureReturnValue,
Similar to Self::emit_by_name
but fails instead of panicking.
sourcefn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> R where
R: TryFromClosureReturnValue,
fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> R where
R: TryFromClosureReturnValue,
Emit signal by its name. Read more
sourcefn try_emit_by_name_with_values(
&self,
signal_name: &str,
args: &[Value]
) -> Result<Option<Value>, BoolError>
fn try_emit_by_name_with_values(
&self,
signal_name: &str,
args: &[Value]
) -> Result<Option<Value>, BoolError>
Similar to Self::emit_by_name_with_values
but fails instead of panicking.
sourcefn emit_by_name_with_values(
&self,
signal_name: &str,
args: &[Value]
) -> Option<Value>
fn emit_by_name_with_values(
&self,
signal_name: &str,
args: &[Value]
) -> Option<Value>
Emit signal by its name. Read more
sourcefn try_emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue]
) -> Result<R, BoolError> where
R: TryFromClosureReturnValue,
fn try_emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue]
) -> Result<R, BoolError> where
R: TryFromClosureReturnValue,
Similar to Self::emit_with_details
but fails instead of panicking.
sourcefn emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue]
) -> R where
R: TryFromClosureReturnValue,
fn emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue]
) -> R where
R: TryFromClosureReturnValue,
Emit signal by signal id with details. Read more
sourcefn try_emit_with_details_and_values(
&self,
signal_id: SignalId,
details: Quark,
args: &[Value]
) -> Result<Option<Value>, BoolError>
fn try_emit_with_details_and_values(
&self,
signal_id: SignalId,
details: Quark,
args: &[Value]
) -> Result<Option<Value>, BoolError>
Similar to Self::emit_with_details_and_values
but fails instead of panicking.
sourcefn emit_with_details_and_values(
&self,
signal_id: SignalId,
details: Quark,
args: &[Value]
) -> Option<Value>
fn emit_with_details_and_values(
&self,
signal_id: SignalId,
details: Quark,
args: &[Value]
) -> Option<Value>
Emit signal by signal id with details. Read more
sourcefn disconnect(&self, handler_id: SignalHandlerId)
fn disconnect(&self, handler_id: SignalHandlerId)
Disconnect a previously connected signal handler.
sourcefn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId where
F: 'static + Fn(&T, &ParamSpec) + Send + Sync,
fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId where
F: 'static + Fn(&T, &ParamSpec) + Send + Sync,
Connect to the notify
signal of the object. Read more
sourcefn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId where
F: 'static + Fn(&T, &ParamSpec),
fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId where
F: 'static + Fn(&T, &ParamSpec),
Connect to the notify
signal of the object. Read more
sourceunsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: Fn(&T, &ParamSpec),
unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: Fn(&T, &ParamSpec),
Connect to the notify
signal of the object. Read more
sourcefn notify(&self, property_name: &str)
fn notify(&self, property_name: &str)
Notify that the given property has changed its value. Read more
sourcefn notify_by_pspec(&self, pspec: &ParamSpec)
fn notify_by_pspec(&self, pspec: &ParamSpec)
Notify that the given property has changed its value. Read more
sourcefn bind_property<O>(
&'a self,
source_property: &'a str,
target: &'a O,
target_property: &'a str
) -> BindingBuilder<'a> where
O: ObjectType,
fn bind_property<O>(
&'a self,
source_property: &'a str,
target: &'a O,
target_property: &'a str
) -> BindingBuilder<'a> where
O: ObjectType,
Bind property source_property
on this object to the target_property
on the target
object. Read more
sourceimpl<T> StaticTypeExt for T where
T: StaticType,
impl<T> StaticTypeExt for T where
T: StaticType,
sourcefn ensure_type()
fn ensure_type()
Ensures that the type has been registered with the type system.
sourceimpl<T> ToClosureReturnValue for T where
T: ToValue,
impl<T> ToClosureReturnValue for T where
T: ToValue,
fn to_closure_return_value(&self) -> Option<Value>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more