pub struct Buttons(/* private fields */);Expand description
Which of the non-primary buttons a node’s on_button claims:
Buttons::SECONDARY, Buttons::MIDDLE and
Buttons::OTHER (every button past the named three), or-ed together.
A node declaring on_button claims Buttons::ALL unless it says
otherwise. The primary button is never in it: that one presses, drags
and clicks for every node.
The C ABI’s spelling is the same bits (KuiSpec.buttons: 1 secondary,
2 middle, 4 other), a zeroed field meaning all three; the schema’s is
the names, "secondary middle".
Implementations§
Source§impl Buttons
impl Buttons
Sourcepub const SECONDARY: Self
pub const SECONDARY: Self
The context-menu button. Claimed, its press is the owner’s
button event instead of a contextmenu event or the stock menu.
pub const MIDDLE: Self
pub const ALL: Self
Sourcepub fn contains(self, button: MouseButton) -> bool
pub fn contains(self, button: MouseButton) -> bool
Whether button is in the set. The primary button never is.
Sourcepub fn from_bits(bits: u32) -> Self
pub fn from_bits(bits: u32) -> Self
From Buttons::bits; unknown bits are ignored. Zero is
Buttons::NONE here: it is the C binding that reads a zeroed
field as all three, being a field the host never set.
Sourcepub fn parse(names: &str) -> Self
pub fn parse(names: &str) -> Self
From the schema’s spelling: names separated by spaces or commas —
"middle", "secondary middle", "secondary, middle, other". A
word that is none of the three is skipped, so a string of none of
them claims nothing: a typo never takes the secondary button away
from a context menu.
Trait Implementations§
Source§impl BitOrAssign for Buttons
impl BitOrAssign for Buttons
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|= operation. Read moreimpl Copy for Buttons
impl Eq for Buttons
impl StructuralPartialEq for Buttons
Auto Trait Implementations§
impl Freeze for Buttons
impl RefUnwindSafe for Buttons
impl Send for Buttons
impl Sync for Buttons
impl Unpin for Buttons
impl UnsafeUnpin for Buttons
impl UnwindSafe for Buttons
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.