Struct wlc::Positioner
[−]
[src]
#[repr(C)]pub struct Positioner;
A Positioner of a View
managed by Wlc
Methods
impl Positioner
[src]
fn anchor(&self) -> Flags
Get the anchor of the Positioner
The anchor defines a set of edges for the anchor rectangle. These are used to derive an anchor point that the child view will be positioned relative to. If two orthogonal edges are specified (e.g. 'top' and 'left'), then the anchor point will be the intersection of the edges (e.g. the top left position of the rectangle); 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.
fn anchor_rect(&self) -> Geometry
Get the anchor rect of the Positioner
Specify the anchor rectangle within the parent's view that the child will be placed relative to. The rectangle is relative to the window geometry. The rectangle will be at least 1x1 large.
fn constraint_adjustment(&self) -> Flags
Get the constraint adjustments of the Positioner
The constraint adjustment value defines ways the compositor will adjust the position of the surface, if the unadjusted position would result in the surface being partly constrained.
Whether a surface is considered 'constrained' is left to the compositor to determine. For example, the surface may be partly outside the compositor's defined 'work area', thus necessitating the child surface's position be adjusted until it is entirely inside the work area.
The adjustments can be combined, according to a defined precedence: 1) Flip, 2) Slide, 3) Resize.
fn gravity(&self) -> Flags
Get the gravity of the Positioner
Defines in what direction a View
should be positioned, relative to
the anchor point of the parent View
.
If two orthogonal gravities are specified (e.g. 'bottom' and 'right'),
then the child surface will be placed in the specified direction;
otherwise, the child surface will be centered over the anchor point on
any axis that had no gravity specified.
fn offset(&self) -> Point
Get the offset of the Positioner
Specify the surface position offset relative to the position of the
anchor on the anchor rectangle and the anchor on the View
.
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
fn size(&self) -> Size
Get the size of the Positioner
Expected size of the child View