pub struct BindingPool(/* private fields */);
Implementations§
Source§impl BindingPool
impl BindingPool
Sourcepub fn new(name: &str) -> BindingPool
pub fn new(name: &str) -> BindingPool
Creates a new BindingPool
that can be used to store
key bindings for an actor. The name
must be a unique identifier
for the binding pool, so that BindingPool::find
will
be able to return the correct binding pool.
§name
the name of the binding pool
§Returns
the newly created binding pool with the given
name. Use gobject::ObjectExt::unref
when done.
Sourcepub fn activate<P: IsA<Object>>(
&self,
key_val: u32,
modifiers: ModifierType,
gobject: &P,
) -> bool
pub fn activate<P: IsA<Object>>( &self, key_val: u32, modifiers: ModifierType, gobject: &P, ) -> bool
Activates the callback associated to the action that is
bound to the key_val
and modifiers
pair.
The callback has the following signature:
void (* callback) (GObject *gobject,
const gchar *action_name,
guint key_val,
ClutterModifierType modifiers,
gpointer user_data);
Where the gobject::Object
instance is gobject
and the user data
is the one passed when installing the action with
BindingPool::install_action
.
If the action bound to the key_val
, modifiers
pair has been
blocked using BindingPool::block_action
, the callback
will not be invoked, and this function will return false
.
§key_val
the key symbol
§modifiers
bitmask for the modifiers
§gobject
a gobject::Object
§Returns
true
if an action was found and was activated
Sourcepub fn block_action(&self, action_name: &str)
pub fn block_action(&self, action_name: &str)
Sourcepub fn find_action(
&self,
key_val: u32,
modifiers: ModifierType,
) -> Option<GString>
pub fn find_action( &self, key_val: u32, modifiers: ModifierType, ) -> Option<GString>
Sourcepub fn install_closure(
&self,
action_name: &str,
key_val: u32,
modifiers: ModifierType,
closure: &Closure,
)
pub fn install_closure( &self, action_name: &str, key_val: u32, modifiers: ModifierType, closure: &Closure, )
A gobject::Closure
variant of BindingPool::install_action
.
Installs a new action inside a BindingPool
. The action
is bound to key_val
and modifiers
.
The same action name can be used for multiple key_val
, modifiers
pairs.
When an action has been activated using BindingPool::activate
the passed closure
will be invoked.
Actions can be blocked with BindingPool::block_action
and then unblocked using BindingPool::unblock_action
.
§action_name
the name of the action
§key_val
key symbol
§modifiers
bitmask of modifiers
§closure
a gobject::Closure
Sourcepub fn override_closure(
&self,
key_val: u32,
modifiers: ModifierType,
closure: &Closure,
)
pub fn override_closure( &self, key_val: u32, modifiers: ModifierType, closure: &Closure, )
A gobject::Closure
variant of BindingPool::override_action
.
Allows overriding the action for key_val
and modifiers
inside a
BindingPool
. See BindingPool::install_closure
.
When an action has been activated using BindingPool::activate
the passed callback
will be invoked (with data
).
Actions can be blocked with BindingPool::block_action
and then unblocked using BindingPool::unblock_action
.
§key_val
key symbol
§modifiers
bitmask of modifiers
§closure
a gobject::Closure
Sourcepub fn remove_action(&self, key_val: u32, modifiers: ModifierType)
pub fn remove_action(&self, key_val: u32, modifiers: ModifierType)
Sourcepub fn unblock_action(&self, action_name: &str)
pub fn unblock_action(&self, action_name: &str)
Unblockes all the actions with name action_name
inside self
.
Unblocking an action does not cause the callback bound to it to
be invoked in case BindingPool::activate
was called on
an action previously blocked with BindingPool::block_action
.
§action_name
an action name
Sourcepub fn get_property_name(&self) -> Option<GString>
pub fn get_property_name(&self) -> Option<GString>
The unique name of the BindingPool
.
Trait Implementations§
Source§impl Clone for BindingPool
impl Clone for BindingPool
Source§fn clone(&self) -> BindingPool
fn clone(&self) -> BindingPool
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for BindingPool
impl Debug for BindingPool
Source§impl Display for BindingPool
impl Display for BindingPool
Source§impl Hash for BindingPool
impl Hash for BindingPool
Source§impl Ord for BindingPool
impl Ord for BindingPool
Source§fn cmp(&self, other: &BindingPool) -> Ordering
fn cmp(&self, other: &BindingPool) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<T: ObjectType> PartialEq<T> for BindingPool
impl<T: ObjectType> PartialEq<T> for BindingPool
Source§impl<T: ObjectType> PartialOrd<T> for BindingPool
impl<T: ObjectType> PartialOrd<T> for BindingPool
Source§impl StaticType for BindingPool
impl StaticType for BindingPool
Source§fn static_type() -> Type
fn static_type() -> Type
Self
.impl Eq for BindingPool
Auto Trait Implementations§
impl Freeze for BindingPool
impl RefUnwindSafe for BindingPool
impl !Send for BindingPool
impl !Sync for BindingPool
impl Unpin for BindingPool
impl UnwindSafe for BindingPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Cast for Twhere
T: ObjectType,
impl<T> Cast for Twhere
T: ObjectType,
Source§fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
T
. Read moreSource§fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
T
. Read moreSource§fn 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>,
T
. Read moreSource§fn 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>,
T
. Read moreSource§fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
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 moreSource§fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
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 moreSource§unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
T
unconditionally. Read moreSource§unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
&T
unconditionally. Read moreSource§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> ObjectExt for Twhere
T: ObjectType,
impl<T> ObjectExt for Twhere
T: ObjectType,
Source§fn is<U>(&self) -> boolwhere
U: StaticType,
fn is<U>(&self) -> boolwhere
U: StaticType,
true
if the object is an instance of (can be cast to) T
.