package wayland

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Constraint adjustments.

The constraint adjustment value define 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.

type t = int32
val none : int32

Don't move the child surface when constrained.

Don't alter the surface position even if it is constrained on some axis, for example partially outside the edge of an output.

val slide_x : int32

Move along the x axis until unconstrained.

Slide the surface along the x axis until it is no longer constrained.

First try to slide towards the direction of the gravity on the x axis until either the edge in the opposite direction of the gravity is unconstrained or the edge in the direction of the gravity is constrained.

Then try to slide towards the opposite direction of the gravity on the x axis until either the edge in the direction of the gravity is unconstrained or the edge in the opposite direction of the gravity is constrained.

val slide_y : int32

Move along the y axis until unconstrained.

Slide the surface along the y axis until it is no longer constrained.

First try to slide towards the direction of the gravity on the y axis until either the edge in the opposite direction of the gravity is unconstrained or the edge in the direction of the gravity is constrained.

Then try to slide towards the opposite direction of the gravity on the y axis until either the edge in the direction of the gravity is unconstrained or the edge in the opposite direction of the gravity is constrained.

val flip_x : int32

Invert the anchor and gravity on the x axis.

Invert the anchor and gravity on the x axis if the surface is constrained on the x axis. For example, if the left edge of the surface is constrained, the gravity is 'left' and the anchor is 'left', change the gravity to 'right' and the anchor to 'right'.

If the adjusted position also ends up being constrained, the resulting position of the flip_x adjustment will be the one before the adjustment.

val flip_y : int32

Invert the anchor and gravity on the y axis.

Invert the anchor and gravity on the y axis if the surface is constrained on the y axis. For example, if the bottom edge of the surface is constrained, the gravity is 'bottom' and the anchor is 'bottom', change the gravity to 'top' and the anchor to 'top'.

The adjusted position is calculated given the original anchor rectangle and offset, but with the new flipped anchor and gravity values.

If the adjusted position also ends up being constrained, the resulting position of the flip_y adjustment will be the one before the adjustment.

val resize_x : int32

Horizontally resize the surface.

Resize the surface horizontally so that it is completely unconstrained.

val resize_y : int32

Vertically resize the surface.

Resize the surface vertically so that it is completely unconstrained.

val to_int32 : 'a -> 'a
val of_int32 : 'a -> 'a
OCaml

Innovation. Community. Security.