1 package androidx.compose.ui.layout
2 
3 /**
4  * Interface holding the size and alignment lines of the measured layout, as well as the children
5  * positioning logic. [placeChildren] is the function used for positioning children.
6  * [Placeable.placeAt] should be called on children inside [placeChildren]. The alignment lines can
7  * be used by the parent layouts to decide layout, and can be queried using the [Placeable.get]
8  * operator. Note that alignment lines will be inherited by parent layouts, such that indirect
9  * parents will be able to query them as well.
10  */
11 interface MeasureResult {
12     /** The measured width of the layout, in pixels. */
13     val width: Int
14 
15     /** The measured height of the layout, in pixels. */
16     val height: Int
17 
18     /**
19      * Alignment lines that can be used by parents to align this layout. This only includes the
20      * alignment lines of this layout and not children.
21      */
22     val alignmentLines: Map<AlignmentLine, Int>
23 
24     /**
25      * An optional lambda function used to create [Ruler]s for child layout. This may be
26      * reevealuated when the layout's position moves.
27      */
28     val rulers: (RulerScope.() -> Unit)?
29         get() = null
30 
31     /**
32      * A method used to place children of this layout. It may also be used to measure children that
33      * were not needed for determining the size of this layout.
34      */
placeChildrennull35     fun placeChildren()
36 }
37