From 1fe9721d7be50e19e68cd8a8ec85f0adbb1c68e4 Mon Sep 17 00:00:00 2001 From: Jaro Date: Fri, 5 May 2023 19:54:55 +0200 Subject: [PATCH] Define ResolvedBox. --- balkon.cabal | 1 + .../Text/ParagraphLayout/Internal/ResolvedBox.hs | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/Data/Text/ParagraphLayout/Internal/ResolvedBox.hs diff --git a/balkon.cabal b/balkon.cabal index ef2aebd..e00d01f 100644 --- a/balkon.cabal +++ b/balkon.cabal @@ -117,6 +117,7 @@ library balkon-internal Data.Text.ParagraphLayout.Internal.Plain.Paragraph, Data.Text.ParagraphLayout.Internal.Plain.ParagraphLayout, Data.Text.ParagraphLayout.Internal.Rect, + Data.Text.ParagraphLayout.Internal.ResolvedBox, Data.Text.ParagraphLayout.Internal.ResolvedSpan, Data.Text.ParagraphLayout.Internal.Rich, Data.Text.ParagraphLayout.Internal.Rich.Paragraph, diff --git a/src/Data/Text/ParagraphLayout/Internal/ResolvedBox.hs b/src/Data/Text/ParagraphLayout/Internal/ResolvedBox.hs new file mode 100644 index 0000000..e579f48 --- /dev/null +++ b/src/Data/Text/ParagraphLayout/Internal/ResolvedBox.hs @@ -0,0 +1,15 @@ +module Data.Text.ParagraphLayout.Internal.ResolvedBox (ResolvedBox (..)) +where + +import Data.Text.ParagraphLayout.Internal.BoxOptions + +-- | Internal structure describing an inline box. +-- May be shared by multiple fragments. +data ResolvedBox d = ResolvedBox + { boxUserData :: d + , boxIndex :: Int + , boxOptions :: BoxOptions + } + +instance Eq (ResolvedBox d) where + a == b = boxIndex a == boxIndex b -- 2.30.2