pub struct ZwpTabletPadGroupV2 { /* private fields */ }
Expand description

a set of buttons, rings and strips

A pad group describes a distinct (sub)set of buttons, rings and strips present in the tablet. The criteria of this grouping is usually positional, eg. if a tablet has buttons on the left and right side, 2 groups will be presented. The physical arrangement of groups is undisclosed and may change on the fly.

Pad groups will announce their features during pad initialization. Between the corresponding wp_tablet_pad.group event and wp_tablet_pad_group.done, the pad group will announce the buttons, rings and strips contained in it, plus the number of supported modes.

Modes are a mechanism to allow multiple groups of actions for every element in the pad group. The number of groups and available modes in each is persistent across device plugs. The current mode is user-switchable, it will be announced through the wp_tablet_pad_group.mode_switch event both whenever it is switched, and after wp_tablet_pad.enter.

The current mode logically applies to all elements in the pad group, although it is at clients’ discretion whether to actually perform different actions, and/or issue the respective .set_feedback requests to notify the compositor. See the wp_tablet_pad_group.mode_switch event for more details.

See also the Request enum for this interface.

Implementations§

source§

impl ZwpTabletPadGroupV2

source

pub fn buttons(&self, buttons: Vec<u8>)

buttons announced

Sent on wp_tablet_pad_group initialization to announce the available buttons in the group. Button indices start at 0, a button may only be in one group at a time.

This event is first sent in the initial burst of events before the wp_tablet_pad_group.done event.

Some buttons are reserved by the compositor. These buttons may not be assigned to any wp_tablet_pad_group. Compositors may broadcast this event in the case of changes to the mapping of these reserved buttons. If the compositor happens to reserve all buttons in a group, this event will be sent with an empty array.

source

pub fn ring(&self, ring: &ZwpTabletPadRingV2)

ring announced

Sent on wp_tablet_pad_group initialization to announce available rings. One event is sent for each ring available on this pad group.

This event is sent in the initial burst of events before the wp_tablet_pad_group.done event.

source

pub fn strip(&self, strip: &ZwpTabletPadStripV2)

strip announced

Sent on wp_tablet_pad initialization to announce available strips. One event is sent for each strip available on this pad group.

This event is sent in the initial burst of events before the wp_tablet_pad_group.done event.

source

pub fn modes(&self, modes: u32)

mode-switch ability announced

Sent on wp_tablet_pad_group initialization to announce that the pad group may switch between modes. A client may use a mode to store a specific configuration for buttons, rings and strips and use the wl_tablet_pad_group.mode_switch event to toggle between these configurations. Mode indices start at 0.

Switching modes is compositor-dependent. See the wp_tablet_pad_group.mode_switch event for more details.

This event is sent in the initial burst of events before the wp_tablet_pad_group.done event. This event is only sent when more than more than one mode is available.

source

pub fn done(&self)

tablet group description events sequence complete

This event is sent immediately to signal the end of the initial burst of descriptive events. A client may consider the static description of the tablet to be complete and finalize initialization of the tablet group.

source

pub fn mode_switch(&self, time: u32, serial: u32, mode: u32)

mode switch event

Notification that the mode was switched.

A mode applies to all buttons, rings and strips in a group simultaneously, but a client is not required to assign different actions for each mode. For example, a client may have mode-specific button mappings but map the ring to vertical scrolling in all modes. Mode indices start at 0.

Switching modes is compositor-dependent. The compositor may provide visual cues to the client about the mode, e.g. by toggling LEDs on the tablet device. Mode-switching may be software-controlled or controlled by one or more physical buttons. For example, on a Wacom Intuos Pro, the button inside the ring may be assigned to switch between modes.

The compositor will also send this event after wp_tablet_pad.enter on each group in order to notify of the current mode. Groups that only feature one mode will use mode=0 when emitting this event.

If a button action in the new mode differs from the action in the previous mode, the client should immediately issue a wp_tablet_pad.set_feedback request for each changed button.

If a ring or strip action in the new mode differs from the action in the previous mode, the client should immediately issue a wp_tablet_ring.set_feedback or wp_tablet_strip.set_feedback request for each changed ring or strip.

Trait Implementations§

source§

impl Borrow<ObjectId> for ZwpTabletPadGroupV2

source§

fn borrow(&self) -> &ObjectId

Immutably borrows from an owned value. Read more
source§

impl Clone for ZwpTabletPadGroupV2

source§

fn clone(&self) -> ZwpTabletPadGroupV2

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ZwpTabletPadGroupV2

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for ZwpTabletPadGroupV2

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<Weak<ZwpTabletPadGroupV2>> for ZwpTabletPadGroupV2

source§

fn eq(&self, other: &Weak<ZwpTabletPadGroupV2>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for ZwpTabletPadGroupV2

source§

fn eq(&self, other: &ZwpTabletPadGroupV2) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Resource for ZwpTabletPadGroupV2

§

type Request = Request

The request enum for this interface
§

type Event<'event> = Event<'event>

The event enum for this interface
source§

fn interface() -> &'static Interface

The interface description
source§

fn id(&self) -> ObjectId

The ID of this object
source§

fn version(&self) -> u32

The version of this object
source§

fn data<U: 'static>(&self) -> Option<&U>

Access the user-data associated with this object
source§

fn object_data(&self) -> Option<&Arc<dyn Any + Send + Sync>>

Access the raw data associated with this object. Read more
source§

fn handle(&self) -> &WeakHandle

Access the backend handle associated with this object
source§

fn from_id(conn: &DisplayHandle, id: ObjectId) -> Result<Self, InvalidId>

Create an object resource from its ID Read more
source§

fn send_event(&self, evt: Self::Event<'_>) -> Result<(), InvalidId>

Send an event to this object
source§

fn parse_request( conn: &DisplayHandle, msg: Message<ObjectId, OwnedFd> ) -> Result<(Self, Self::Request), DispatchError>

Parse a event for this object Read more
source§

fn write_event<'a>( &self, conn: &DisplayHandle, msg: Self::Event<'a> ) -> Result<Message<ObjectId, BorrowedFd<'a>>, InvalidId>

Serialize an event for this object Read more
source§

fn client(&self) -> Option<Client>

The client owning this object Read more
source§

fn is_alive(&self) -> bool

Checks if the Wayland object associated with this proxy is still alive
source§

fn post_error(&self, code: impl Into<u32>, error: impl Into<String>)

Trigger a protocol error on this object Read more
source§

fn downgrade(&self) -> Weak<Self>

Creates a weak handle to this object Read more
source§

impl Eq for ZwpTabletPadGroupV2

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.