cattrap-0.3.0.0: Lays out boxes according to the CSS Box Model.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Graphics.Layout.Inline

Description

Sizes inline text & extracts positioned children, wraps Balkón for the actual logic.

Synopsis

Documentation

paragraphMap :: (b -> b') -> Paragraph (a, b, c) -> Paragraph (a, b', c) Source #

Apply an operation to the 2nd field of the paragraph's userdata, for it's entire subtree.

layoutMap :: (b -> b') -> ParagraphLayout (a, b, c) -> ParagraphLayout (a, b', c) Source #

Apply an operation to the 2nd field of a laid-out paragraph's userdata, for it's entire subtree.

treeMap :: (b -> b') -> FragmentTree (a, b, c) -> FragmentTree (a, b', c) Source #

Apply an operation to the 2nd field of the tree extracted from a laid-out paragraph, for all nodes.

inlineMin :: (CastDouble x, CastDouble y) => Paragraph (a, PaddedBox x y, c) -> Size x y Source #

Compute minimum width & height for some richtext.

inlineSize :: (CastDouble x, CastDouble y) => Paragraph (a, PaddedBox x y, c) -> Size x y Source #

Compute width & height of some richtext at configured width.

inlineChildren :: (CastDouble x, CastDouble y, Eq x, Eq y, Eq a, Eq c) => Paragraph (a, PaddedBox x y, c) -> [FragmentTree (a, PaddedBox x y, c)] Source #

Retrieve children out of some richtext, associating given userdata with them.

layoutSize :: (CastDouble x, CastDouble y) => ParagraphLayout a -> Size x y Source #

Retrieve a laid-out paragraph's rect & convert to CatTrap types.

layoutChildren :: Eq a => ParagraphLayout a -> [FragmentTree a] Source #

Retrieve a laid-out paragraph's children & associate with given userdata.

treeBox :: (CastDouble m, CastDouble n) => FragmentTree (a, PaddedBox m n, c) -> PaddedBox m n Source #

Compute the paddedbox for a subtree.

treeInner :: FragmentTree (a, b, c) -> c Source #

data FragmentTree x Source #

Constructors

Branch (AncestorBox x) [FragmentTree x] 
Leaf (Fragment x)