Struct animate::InputDevice [−][src]
pub struct InputDevice(_, _);
Implementations
impl InputDevice
[src]
impl InputDevice
[src]pub fn get_associated_device(&self) -> Option<InputDevice>
[src]
Retrieves a pointer to the InputDevice
that has been
associated to self
.
If the InputDevice:device-mode
property of self
is
set to InputMode::Master
, this function will return
None
.
Returns
a InputDevice
, or None
pub fn get_axis(&self, index_: u32) -> InputAxis
[src]
Retrieves the type of axis on self
at the given index.
index_
the index of the axis
Returns
the axis type
pub fn get_device_id(&self) -> i32
[src]
pub fn get_device_mode(&self) -> InputMode
[src]
pub fn get_device_name(&self) -> Option<GString>
[src]
Retrieves the name of the self
Returns
the name of the device, or None
. The returned string
is owned by the InputDevice
and should never be modified
or freed
pub fn get_device_type(&self) -> InputDeviceType
[src]
pub fn get_enabled(&self) -> bool
[src]
pub fn get_grabbed_actor(&self) -> Option<Actor>
[src]
Retrieves a pointer to the Actor
currently grabbing all
the events coming from self
.
Returns
a Actor
, or None
pub fn get_has_cursor(&self) -> bool
[src]
Retrieves whether self
has a pointer that follows the
device motion.
Returns
true
if the device has a cursor
pub fn get_key(&self, index_: u32) -> Option<(u32, ModifierType)>
[src]
Retrieves the key set using InputDevice::set_key
index_
the index of the key
keyval
return location for the keyval at index_
modifiers
return location for the modifiers at index_
Returns
true
if a key was set at the given index
pub fn get_modifier_state(&self) -> ModifierType
[src]
Retrieves the current modifiers state of the device, as seen by the last event processed.
Returns
the last known modifier state
pub fn get_n_axes(&self) -> u32
[src]
pub fn get_n_keys(&self) -> u32
[src]
pub fn get_pointer_actor(&self) -> Option<Actor>
[src]
pub fn get_pointer_stage(&self) -> Option<Stage>
[src]
pub fn get_product_id(&self) -> Option<GString>
[src]
pub fn get_slave_devices(&self) -> Vec<InputDevice>ⓘ
[src]
Retrieves the slave devices attached to self
.
Returns
a
list of InputDevice
, or None
. The contents of the list are
owned by the device. Use glib::List::free
when done
pub fn get_vendor_id(&self) -> Option<GString>
[src]
pub fn grab<P: IsA<Actor>>(&self, actor: &P)
[src]
Acquires a grab on actor
for the given self
.
Any event coming from self
will be delivered to actor
, bypassing
the usual event delivery mechanism, until the grab is released by
calling InputDevice::ungrab
.
The grab is client-side: even if the windowing system used by the backend has the concept of “device grabs”, it will not use them.
Only InputDevice
of types InputDeviceType::PointerDevice
and
InputDeviceType::KeyboardDevice
can hold a grab.
actor
a Actor
pub fn sequence_get_grabbed_actor(
&self,
sequence: &mut EventSequence
) -> Option<Actor>
[src]
&self,
sequence: &mut EventSequence
) -> Option<Actor>
Retrieves a pointer to the Actor
currently grabbing the
touch events coming from self
given the sequence
.
sequence
a EventSequence
Returns
a Actor
, or None
pub fn sequence_grab<P: IsA<Actor>>(
&self,
sequence: &mut EventSequence,
actor: &P
)
[src]
&self,
sequence: &mut EventSequence,
actor: &P
)
Acquires a grab on actor
for the given self
and the given touch
sequence
.
Any touch event coming from self
and from sequence
will be
delivered to actor
, bypassing the usual event delivery mechanism,
until the grab is released by calling
InputDevice::sequence_ungrab
.
The grab is client-side: even if the windowing system used by the backend has the concept of “device grabs”, it will not use them.
sequence
a EventSequence
actor
a Actor
pub fn sequence_ungrab(&self, sequence: &mut EventSequence)
[src]
pub fn set_enabled(&self, enabled: bool)
[src]
Enables or disables a InputDevice
.
Only devices with a InputDevice:device-mode
property set
to InputMode::Slave
or InputMode::Floating
can
be disabled.
enabled
true
to enable the self
pub fn set_key(&self, index_: u32, keyval: u32, modifiers: ModifierType)
[src]
Sets the keyval and modifiers at the given index_
for self
.
will use the keyval and modifiers set when filling out an event coming from the same input device.
index_
the index of the key
keyval
the keyval
modifiers
a bitmask of modifiers
pub fn ungrab(&self)
[src]
Releases the grab on the self
, if one is in place.
pub fn update_from_event(&self, event: &mut Event, update_stage: bool)
[src]
Forcibly updates the state of the self
using a Event
This function should never be used by applications: it is meant for integration with embedding toolkits, like clutter-gtk
Embedding toolkits that disable the event collection inside
need to use this function to update the state of input devices depending
on a Event
that they are going to submit to the event handling code
in it though do_event
. Since the input devices hold the state
that is going to be used to fill in fields like the ButtonEvent
click count, or to emit synthesized events like EventType::Enter
and
EventType::Leave
, it is necessary for embedding toolkits to also be
responsible of updating the input device state.
For instance, this might be the code to translate an embedding toolkit
native motion notification into a MotionEvent
and ask
to process it:
Event c_event;
translate_native_event_to_clutter (native_event, &c_event);
do_event (&c_event);
Before letting do_event
process the event, it is necessary to call
InputDevice::update_from_event
:
Event c_event;
DeviceManager *manager;
InputDevice *device;
translate_native_event_to_clutter (native_event, &c_event);
// get the device manager
manager = device_manager_get_default ();
// use the default Core Pointer that backends register by default
device = device_manager_get_core_device (manager, %POINTER_DEVICE);
// update the state of the input device
input_device_update_from_event (device, &c_event, FALSE);
do_event (&c_event);
The update_stage
boolean argument should be used when the input device
enters and leaves a Stage
; it will use the Stage
field
of the passed event
to update the stage associated to the input device.
event
a Event
update_stage
whether to update the Stage
of the self
using the stage of the event
pub fn get_property_backend(&self) -> Option<Backend>
[src]
The Backend
that created the device.
pub fn get_property_device_manager(&self) -> Option<DeviceManager>
[src]
The DeviceManager
instance which owns the device
pub fn get_property_id(&self) -> i32
[src]
The unique identifier of the device
pub fn get_property_name(&self) -> Option<GString>
[src]
The name of the device
pub fn connect_property_enabled_notify<F: Fn(&InputDevice) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
pub fn connect_property_n_axes_notify<F: Fn(&InputDevice) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
Trait Implementations
impl Clone for InputDevice
[src]
impl Clone for InputDevice
[src]fn clone(&self) -> InputDevice
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Eq for InputDevice
[src]
impl Eq for InputDevice
[src]impl Hash for InputDevice
[src]
impl Hash for InputDevice
[src]impl Ord for InputDevice
[src]
impl Ord for InputDevice
[src]impl<T: ObjectType> PartialEq<T> for InputDevice
[src]
impl<T: ObjectType> PartialEq<T> for InputDevice
[src]impl<T: ObjectType> PartialOrd<T> for InputDevice
[src]
impl<T: ObjectType> PartialOrd<T> for InputDevice
[src]impl StaticType for InputDevice
[src]
impl StaticType for InputDevice
[src]fn static_type() -> Type
[src]
Auto Trait Implementations
impl RefUnwindSafe for InputDevice
impl RefUnwindSafe for InputDevice
impl !Send for InputDevice
impl !Send for InputDevice
impl !Sync for InputDevice
impl !Sync for InputDevice
impl Unpin for InputDevice
impl Unpin for InputDevice
impl UnwindSafe for InputDevice
impl UnwindSafe for InputDevice
Blanket Implementations
impl<Super, Sub> CanDowncast<Sub> for Super where
Sub: IsA<Super>,
Super: IsA<Super>,
[src]
impl<Super, Sub> CanDowncast<Sub> for Super where
Sub: IsA<Super>,
Super: IsA<Super>,
[src]impl<T> Cast for T where
T: ObjectType,
[src]
impl<T> Cast for T where
T: ObjectType,
[src]pub fn upcast<T>(self) -> T where
Self: IsA<T>,
T: ObjectType,
[src]
Self: IsA<T>,
T: ObjectType,
pub fn upcast_ref<T>(&self) -> &T where
Self: IsA<T>,
T: ObjectType,
[src]
Self: IsA<T>,
T: ObjectType,
pub fn downcast<T>(self) -> Result<T, Self> where
Self: CanDowncast<T>,
T: ObjectType,
[src]
Self: CanDowncast<T>,
T: ObjectType,
pub fn downcast_ref<T>(&self) -> Option<&T> where
Self: CanDowncast<T>,
T: ObjectType,
[src]
Self: CanDowncast<T>,
T: ObjectType,
pub fn dynamic_cast<T>(self) -> Result<T, Self> where
T: ObjectType,
[src]
T: ObjectType,
pub fn dynamic_cast_ref<T>(&self) -> Option<&T> where
T: ObjectType,
[src]
T: ObjectType,
pub unsafe fn unsafe_cast<T>(self) -> T where
T: ObjectType,
[src]
T: ObjectType,
pub unsafe fn unsafe_cast_ref<T>(&self) -> &T where
T: ObjectType,
[src]
T: ObjectType,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
[src]
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
[src]pub fn into_color(self) -> To
[src]
impl<T> ObjectExt for T where
T: ObjectType,
[src]
impl<T> ObjectExt for T where
T: ObjectType,
[src]pub fn is<U>(&self) -> bool where
U: StaticType,
[src]
U: StaticType,
pub fn get_type(&self) -> Type
[src]
pub fn get_object_class(&self) -> &ObjectClass
[src]
pub fn set_properties(
&self,
property_values: &[(&str, &dyn ToValue)]
) -> Result<(), BoolError>
[src]
&self,
property_values: &[(&str, &dyn ToValue)]
) -> Result<(), BoolError>
pub fn set_property<'a, N>(
&self,
property_name: N,
value: &dyn ToValue
) -> Result<(), BoolError> where
N: Into<&'a str>,
[src]
&self,
property_name: N,
value: &dyn ToValue
) -> Result<(), BoolError> where
N: Into<&'a str>,
pub fn get_property<'a, N>(&self, property_name: N) -> Result<Value, BoolError> where
N: Into<&'a str>,
[src]
N: Into<&'a str>,
pub unsafe fn set_qdata<QD>(&self, key: Quark, value: QD) where
QD: 'static,
[src]
QD: 'static,
pub unsafe fn get_qdata<QD>(&self, key: Quark) -> Option<&QD> where
QD: 'static,
[src]
QD: 'static,
pub unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD> where
QD: 'static,
[src]
QD: 'static,
pub unsafe fn set_data<QD>(&self, key: &str, value: QD) where
QD: 'static,
[src]
QD: 'static,
pub unsafe fn get_data<QD>(&self, key: &str) -> Option<&QD> where
QD: 'static,
[src]
QD: 'static,
pub unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD> where
QD: 'static,
[src]
QD: 'static,
pub fn block_signal(&self, handler_id: &SignalHandlerId)
[src]
pub fn unblock_signal(&self, handler_id: &SignalHandlerId)
[src]
pub fn stop_signal_emission(&self, signal_name: &str)
[src]
pub fn disconnect(&self, handler_id: SignalHandlerId)
[src]
pub fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId where
F: 'static + Fn(&T, &ParamSpec) + Send + Sync,
[src]
F: 'static + Fn(&T, &ParamSpec) + Send + Sync,
pub unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: Fn(&T, &ParamSpec),
[src]
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: Fn(&T, &ParamSpec),
pub fn notify<'a, N>(&self, property_name: N) where
N: Into<&'a str>,
[src]
N: Into<&'a str>,
pub fn notify_by_pspec(&self, pspec: &ParamSpec)
[src]
pub fn has_property<'a, N>(&self, property_name: N, type_: Option<Type>) -> bool where
N: Into<&'a str>,
[src]
N: Into<&'a str>,
pub fn get_property_type<'a, N>(&self, property_name: N) -> Option<Type> where
N: Into<&'a str>,
[src]
N: Into<&'a str>,
pub fn find_property<'a, N>(&self, property_name: N) -> Option<ParamSpec> where
N: Into<&'a str>,
[src]
N: Into<&'a str>,
pub fn list_properties(&self) -> Vec<ParamSpec, Global>ⓘ
[src]
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>,
[src]
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
N: Into<&'a str>,
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>,
[src]
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + 'static,
N: Into<&'a str>,
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>,
[src]
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value>,
N: Into<&'a str>,
pub fn emit<'a, N>(
&self,
signal_name: N,
args: &[&dyn ToValue]
) -> Result<Option<Value>, BoolError> where
N: Into<&'a str>,
[src]
&self,
signal_name: N,
args: &[&dyn ToValue]
) -> Result<Option<Value>, BoolError> where
N: Into<&'a str>,
pub fn downgrade(&self) -> WeakRef<T>
[src]
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>,
[src]
&'a self,
source_property: N,
target: &'a O,
target_property: M
) -> BindingBuilder<'a> where
O: ObjectType,
M: Into<&'a str>,
N: Into<&'a str>,
pub fn ref_count(&self) -> u32
[src]
impl<T> ToSendValue for T where
T: SetValue + Send + ToValue + ?Sized,
[src]
impl<T> ToSendValue for T where
T: SetValue + Send + ToValue + ?Sized,
[src]pub fn to_send_value(&self) -> SendValue
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,