Struct XxInputPopupPositionerV1
pub struct XxInputPopupPositionerV1 { /* private fields */ }wayland and Linux only.Expand description
input method popup positioner
The input_popup_positioner provides a collection of rules for the placement of an input method popup surface relative to the cursor. Rules can be defined to ensure the text input area remains within the visible area’s borders, and to specify how the popup changes its position, such as sliding along an axis, or flipping around a rectangle. These positioner-created rules are constrained by the requirement that a popup must intersect with or be at least partially adjacent to the surface containing the text input.
See the various requests for details about possible rules.
A newly created positioner has the following state:
- 0 surface width
- 0 surface height
- anchor at the center (“none”)
- gravity towards the center (“none”)
- constraints adjustment set to none
- offset at x = 0, y = 0
- not reactive
Upon receiving a request taking the positioner as an argument, the compositor makes a copy of the rules specified by the input_popup_positioner. Thus, after the request is complete the input_popup_positioner object can be destroyed or reused; further changes to the object will have no effect on previous usages.
For an input_popup_positioner object to be considered complete, its state must contain a non-zero width and height. Passing an incomplete input_popup_positioner object when positioning a surface raises an invalid_positioner error.
This interface has no events.
Implementations§
§impl XxInputPopupPositionerV1
impl XxInputPopupPositionerV1
pub fn destroy(&self)
pub fn destroy(&self)
destroy the input_popup_positioner object
Notify the compositor that the positioner will no longer be used.
pub fn set_size(&self, width: u32, height: u32)
pub fn set_size(&self, width: u32, height: u32)
set the size of the to-be positioned rectangle
Set the size of the surface that is to be positioned with the positioner object. The size is in surface-local coordinates and corresponds to the window geometry. See xdg_surface.set_window_geometry.
If any dimension is set to zero, the invalid_input error is raised.
pub fn set_anchor(&self, anchor: Anchor)
pub fn set_anchor(&self, anchor: Anchor)
set anchor rectangle anchor
Defines the anchor point for the anchor rectangle. The specified anchor is used to derive an anchor point that the popup surface will be positioned relative to. If a corner anchor is set (e.g. ‘top_left’ or ‘bottom_right’), the anchor point will be at the specified corner; otherwise, the derived anchor point will be centered on the specified edge, or in the center of the anchor rectangle if no edge is specified.
pub fn set_gravity(&self, gravity: Gravity)
pub fn set_gravity(&self, gravity: Gravity)
set surface gravity
Defines in what direction the surface should be positioned, relative to the anchor point of the anchor rectangle. If a corner gravity is specified (e.g. ‘bottom_right’ or ‘top_left’), then the surface will be placed towards the specified gravity; otherwise, the child surface will be centered over the anchor point on any axis that had no gravity specified. If the gravity is not in the ‘gravity’ enum, an invalid_input error is raised.
pub fn set_constraint_adjustment(
&self,
constraint_adjustment: ConstraintAdjustment,
)
pub fn set_constraint_adjustment( &self, constraint_adjustment: ConstraintAdjustment, )
set the adjustment to be done when constrained
Specify how the popup should be positioned if the originally intended position caused the surface to be constrained, meaning at least partially outside positioning boundaries set by the compositor. The adjustment is set by constructing a bitmask describing the adjustment to be made when the surface is constrained on that axis.
If no bit for one axis is set, the compositor will assume that the child surface should not change its position on that axis when constrained.
If more than one bit for one axis is set, the order of how adjustments are applied is specified in the corresponding adjustment descriptions.
The default adjustment is none.
pub fn set_offset(&self, x: i32, y: i32)
pub fn set_offset(&self, x: i32, y: i32)
set surface position offset
Specify the surface position offset relative to the position of the anchor on the anchor rectangle and the anchor on the surface. For example if the anchor of the anchor rectangle is at (x, y), the surface has the gravity bottom|right, and the offset is (ox, oy), the calculated surface position will be (x + ox, y + oy). The offset position of the surface is the one used for constraint testing. See set_constraint_adjustment.
An example use case is placing a popup menu on top of a user interface element, while aligning the user interface element of the parent surface with some user interface element placed somewhere in the popup surface.
pub fn set_reactive(&self)
pub fn set_reactive(&self)
continuously reconstrain the surface
When set reactive, the surface is reconstrained if the conditions used for constraining changed, e.g. the window containing the text input moved.
Whenever the conditions change and the popup gets reconstrained, a configure sequence is sent with updated geometry.
Trait Implementations§
§impl Borrow<ObjectId> for XxInputPopupPositionerV1
impl Borrow<ObjectId> for XxInputPopupPositionerV1
§impl Clone for XxInputPopupPositionerV1
impl Clone for XxInputPopupPositionerV1
§fn clone(&self) -> XxInputPopupPositionerV1
fn clone(&self) -> XxInputPopupPositionerV1
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for XxInputPopupPositionerV1
impl Debug for XxInputPopupPositionerV1
§impl<D> Dispatch<XxInputPopupPositionerV1, PositionerData, D> for PopupPositioner
impl<D> Dispatch<XxInputPopupPositionerV1, PositionerData, D> for PopupPositioner
§fn event(
_data: &mut D,
_manager: &XxInputPopupPositionerV1,
_event: Event,
_: &PositionerData,
_conn: &Connection,
_qh: &QueueHandle<D>,
)
fn event( _data: &mut D, _manager: &XxInputPopupPositionerV1, _event: Event, _: &PositionerData, _conn: &Connection, _qh: &QueueHandle<D>, )
§fn event_created_child(
opcode: u16,
_qhandle: &QueueHandle<State>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData>
§impl Hash for XxInputPopupPositionerV1
impl Hash for XxInputPopupPositionerV1
§impl PartialEq for XxInputPopupPositionerV1
impl PartialEq for XxInputPopupPositionerV1
§impl Proxy for XxInputPopupPositionerV1
impl Proxy for XxInputPopupPositionerV1
§fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
§fn backend(&self) -> &WeakBackend
fn backend(&self) -> &WeakBackend
§fn send_request(
&self,
req: <XxInputPopupPositionerV1 as Proxy>::Request<'_>,
) -> Result<(), InvalidId>
fn send_request( &self, req: <XxInputPopupPositionerV1 as Proxy>::Request<'_>, ) -> Result<(), InvalidId>
§fn send_constructor<I>(
&self,
req: <XxInputPopupPositionerV1 as Proxy>::Request<'_>,
data: Arc<dyn ObjectData>,
) -> Result<I, InvalidId>where
I: Proxy,
fn send_constructor<I>(
&self,
req: <XxInputPopupPositionerV1 as Proxy>::Request<'_>,
data: Arc<dyn ObjectData>,
) -> Result<I, InvalidId>where
I: Proxy,
§fn from_id(
conn: &Connection,
id: ObjectId,
) -> Result<XxInputPopupPositionerV1, InvalidId>
fn from_id( conn: &Connection, id: ObjectId, ) -> Result<XxInputPopupPositionerV1, InvalidId>
§fn inert(backend: WeakBackend) -> XxInputPopupPositionerV1
fn inert(backend: WeakBackend) -> XxInputPopupPositionerV1
§fn parse_event(
conn: &Connection,
msg: Message<ObjectId, OwnedFd>,
) -> Result<(XxInputPopupPositionerV1, <XxInputPopupPositionerV1 as Proxy>::Event), DispatchError>
fn parse_event( conn: &Connection, msg: Message<ObjectId, OwnedFd>, ) -> Result<(XxInputPopupPositionerV1, <XxInputPopupPositionerV1 as Proxy>::Event), DispatchError>
§fn write_request<'a>(
&self,
conn: &Connection,
msg: <XxInputPopupPositionerV1 as Proxy>::Request<'a>,
) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
fn write_request<'a>( &self, conn: &Connection, msg: <XxInputPopupPositionerV1 as Proxy>::Request<'a>, ) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
impl Eq for XxInputPopupPositionerV1
Auto Trait Implementations§
impl Freeze for XxInputPopupPositionerV1
impl !RefUnwindSafe for XxInputPopupPositionerV1
impl Send for XxInputPopupPositionerV1
impl Sync for XxInputPopupPositionerV1
impl Unpin for XxInputPopupPositionerV1
impl !UnwindSafe for XxInputPopupPositionerV1
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
§impl<T> AnyEq for T
impl<T> AnyEq for T
§impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
Source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle.Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other into Self, while performing the appropriate scaling,
rounding and clamping.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
T.§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Source§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self into T, while performing the appropriate scaling,
rounding and clamping.Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds error is returned which contains
the unclamped color. Read more