Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data LayoutItem m n x
- = LayoutFlow x (PaddedBox m n) [LayoutItem m n x]
- | LayoutGrid x (Grid m n) [GridItem] [LayoutItem m n x]
- | LayoutInline x (Paragraph (UserData m n x)) PageOptions
- | LayoutInline' x (ParagraphLayout (UserData m n x)) PageOptions
- | LayoutConst x (PaddedBox m n) [LayoutItem m n x]
- | LayoutSpan (FragmentTree (UserData m n x))
- | LayoutFlex x (Flex (LayoutItem m n x) m)
- type UserData m n x = ((Font', Int), Either (PaddedBox m n) (LayoutItem m n x), x)
- layoutGetBox :: (Zero m, Zero n, CastDouble m, CastDouble n) => LayoutItem m n x -> PaddedBox m n
- layoutGetChilds :: (CastDouble b, CastDouble n, Eq b, Eq n, Eq x, Zero b, Zero n) => LayoutItem b n x -> [LayoutItem b n x]
- layoutGetInner :: LayoutItem m n x -> x
- boxMinWidth :: (Zero y, CastDouble y, NFData y) => Maybe Double -> LayoutItem y Length x -> LayoutItem y Length x
- boxMaxWidth :: (CastDouble y, Zero y, NFData y) => PaddedBox a Double -> LayoutItem y Length x -> LayoutItem y Length x
- boxNatWidth :: (Zero y, CastDouble y, NFData y) => Maybe Double -> LayoutItem y Length x -> LayoutItem y Length x
- boxWidth :: (Zero y, CastDouble y, NFData y) => PaddedBox b Double -> LayoutItem y Length x -> LayoutItem y Double x
- boxNatHeight :: Double -> LayoutItem Length Double x -> LayoutItem Length Double x
- boxMinHeight :: Double -> LayoutItem Length Double x -> LayoutItem Length Double x
- boxMaxHeight :: PaddedBox Double Double -> LayoutItem Length Double x -> LayoutItem Length Double x
- boxHeight :: PaddedBox Double Double -> LayoutItem Length Double x -> LayoutItem Double Double x
- boxSplit :: PropertyParser x => Double -> Double -> LayoutItem Double Double x -> (LayoutItem Double Double x, Maybe (LayoutItem Double Double x))
- boxPaginate :: PropertyParser x => Double -> LayoutItem Double Double x -> [LayoutItem Double Double x]
- boxPosition :: (PropertyParser x, Eq x) => (Double, Double) -> LayoutItem Double Double x -> LayoutItem Double Double ((Double, Double), x)
- boxLayout :: (PropertyParser x, Eq x) => PaddedBox Double Double -> LayoutItem Length Length x -> Bool -> [LayoutItem Double Double ((Double, Double), x)]
- glyphs :: FragmentTree x -> [(GlyphInfo, GlyphPos)]
- codepoints :: FragmentTree x -> [Word32]
- fragmentFont :: FragmentTree (a, b, c) -> a
- glyphsPerFont :: (CastDouble x, CastDouble y, Eq x, Eq y, Eq z, Zero x, Zero y) => LayoutItem x y z -> Map (Pattern, Double) IntSet
Documentation
data LayoutItem m n x Source #
A tree of different layout algorithms. More to come...
LayoutFlow x (PaddedBox m n) [LayoutItem m n x] | A block element. With margins, borders, & padding. |
LayoutGrid x (Grid m n) [GridItem] [LayoutItem m n x] | A grid or table element. |
LayoutInline x (Paragraph (UserData m n x)) PageOptions | Some richtext. (Balkón holds children) |
LayoutInline' x (ParagraphLayout (UserData m n x)) PageOptions | Results laying out richtext, has fixed width.
Generated from |
LayoutConst x (PaddedBox m n) [LayoutItem m n x] | A branch with constant bounding box.
Generated from |
LayoutSpan (FragmentTree (UserData m n x)) | Children of a |
LayoutFlex x (Flex (LayoutItem m n x) m) |
Instances
(Show n, Show m, Show x) => Show (LayoutItem m n x) Source # | |
Defined in Graphics.Layout showsPrec :: Int -> LayoutItem m n x -> ShowS # show :: LayoutItem m n x -> String # showList :: [LayoutItem m n x] -> ShowS # | |
(PropertyParser x, Zero m, Zero n) => Default (UserData m n x) Source # | |
Defined in Graphics.Layout.CSS | |
(Zero m, CastDouble m, NFData m, Zero n, CastDouble n, NFData n) => NFData (LayoutItem m n x) Source # | |
Defined in Graphics.Layout rnf :: LayoutItem m n x -> () # | |
(Eq n, Eq m, Eq x) => Eq (LayoutItem m n x) Source # | |
Defined in Graphics.Layout (==) :: LayoutItem m n x -> LayoutItem m n x -> Bool # (/=) :: LayoutItem m n x -> LayoutItem m n x -> Bool # |
type UserData m n x = ((Font', Int), Either (PaddedBox m n) (LayoutItem m n x), x) Source #
Additional data routed through Balkon.
layoutGetBox :: (Zero m, Zero n, CastDouble m, CastDouble n) => LayoutItem m n x -> PaddedBox m n Source #
Retrieve the surrounding box for a layout item.
layoutGetChilds :: (CastDouble b, CastDouble n, Eq b, Eq n, Eq x, Zero b, Zero n) => LayoutItem b n x -> [LayoutItem b n x] Source #
Retrieve the subtree under a node.
layoutGetInner :: LayoutItem m n x -> x Source #
Retrieve the caller-specified data attached to a layout node.
boxMinWidth :: (Zero y, CastDouble y, NFData y) => Maybe Double -> LayoutItem y Length x -> LayoutItem y Length x Source #
Update a (sub)tree to compute & cache minimum legible sizes.
boxMaxWidth :: (CastDouble y, Zero y, NFData y) => PaddedBox a Double -> LayoutItem y Length x -> LayoutItem y Length x Source #
Update a (sub)tree to compute & cache maximum legible width.
boxNatWidth :: (Zero y, CastDouble y, NFData y) => Maybe Double -> LayoutItem y Length x -> LayoutItem y Length x Source #
Update a (sub)tree to compute & cache ideal width.
boxWidth :: (Zero y, CastDouble y, NFData y) => PaddedBox b Double -> LayoutItem y Length x -> LayoutItem y Double x Source #
Update a (sub)tree to compute & cache final width.
boxNatHeight :: Double -> LayoutItem Length Double x -> LayoutItem Length Double x Source #
Update a (sub)tree to compute & cache ideal legible height.
boxMinHeight :: Double -> LayoutItem Length Double x -> LayoutItem Length Double x Source #
Update a (sub)tree to compute & cache minimum legible height.
boxMaxHeight :: PaddedBox Double Double -> LayoutItem Length Double x -> LayoutItem Length Double x Source #
Update a subtree to compute & cache maximum legible height.
boxHeight :: PaddedBox Double Double -> LayoutItem Length Double x -> LayoutItem Double Double x Source #
Update a (sub)tree to compute & cache final height.
boxSplit :: PropertyParser x => Double -> Double -> LayoutItem Double Double x -> (LayoutItem Double Double x, Maybe (LayoutItem Double Double x)) Source #
Split a (sub)tree to fit within max-height. May take full page height into account.
boxPaginate :: PropertyParser x => Double -> LayoutItem Double Double x -> [LayoutItem Double Double x] Source #
Generate a list of pages from a node, splitting subtrees where necessary.
boxPosition :: (PropertyParser x, Eq x) => (Double, Double) -> LayoutItem Double Double x -> LayoutItem Double Double ((Double, Double), x) Source #
Compute position of all nodes in the (sub)tree relative to a base coordinate.
boxLayout :: (PropertyParser x, Eq x) => PaddedBox Double Double -> LayoutItem Length Length x -> Bool -> [LayoutItem Double Double ((Double, Double), x)] Source #
Compute sizes & position information for all nodes in the (sub)tree.
glyphs :: FragmentTree x -> [(GlyphInfo, GlyphPos)] Source #
Retrieve Harfbuzz data out of the tree extracted from Balkón.
codepoints :: FragmentTree x -> [Word32] Source #
Retrieve the Unicode codepoints out of the tree extracted from Balkón.
fragmentFont :: FragmentTree (a, b, c) -> a Source #
Retrieve the font associated with inline layout.
glyphsPerFont :: (CastDouble x, CastDouble y, Eq x, Eq y, Eq z, Zero x, Zero y) => LayoutItem x y z -> Map (Pattern, Double) IntSet Source #
Compute a mapping from a layout tree indicating which glyphs for which fonts are required. Useful for assembling glyph atlases.
Orphan instances
Show PageOptions Source # | |
showsPrec :: Int -> PageOptions -> ShowS # show :: PageOptions -> String # showList :: [PageOptions] -> ShowS # | |
Eq PageOptions Source # | |
(==) :: PageOptions -> PageOptions -> Bool # (/=) :: PageOptions -> PageOptions -> Bool # | |
Show (Paragraph x) Source # | |
Eq (Paragraph x) Source # | |