{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE Strict #-}
module Monomer.Graphics.Types where
import Data.ByteString (ByteString)
import Data.Default
import Data.String (IsString(..))
import Data.Text (Text)
import Data.Sequence (Seq)
import GHC.Generics
import qualified Data.ByteString as BS
import qualified Data.Sequence as Seq
import qualified Data.Text as T
import Monomer.Common
data Winding
= CW
| CCW
deriving (Winding -> Winding -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Winding -> Winding -> Bool
$c/= :: Winding -> Winding -> Bool
== :: Winding -> Winding -> Bool
$c== :: Winding -> Winding -> Bool
Eq, Int -> Winding -> ShowS
[Winding] -> ShowS
Winding -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Winding] -> ShowS
$cshowList :: [Winding] -> ShowS
show :: Winding -> String
$cshow :: Winding -> String
showsPrec :: Int -> Winding -> ShowS
$cshowsPrec :: Int -> Winding -> ShowS
Show, forall x. Rep Winding x -> Winding
forall x. Winding -> Rep Winding x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Winding x -> Winding
$cfrom :: forall x. Winding -> Rep Winding x
Generic)
data Color = Color {
Color -> Int
_colorR :: {-# UNPACK #-} !Int,
Color -> Int
_colorG :: {-# UNPACK #-} !Int,
Color -> Int
_colorB :: {-# UNPACK #-} !Int,
Color -> Double
_colorA :: {-# UNPACK #-} !Double
} deriving (Color -> Color -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Color -> Color -> Bool
$c/= :: Color -> Color -> Bool
== :: Color -> Color -> Bool
$c== :: Color -> Color -> Bool
Eq, Int -> Color -> ShowS
[Color] -> ShowS
Color -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Color] -> ShowS
$cshowList :: [Color] -> ShowS
show :: Color -> String
$cshow :: Color -> String
showsPrec :: Int -> Color -> ShowS
$cshowsPrec :: Int -> Color -> ShowS
Show, Eq Color
Color -> Color -> Bool
Color -> Color -> Ordering
Color -> Color -> Color
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Color -> Color -> Color
$cmin :: Color -> Color -> Color
max :: Color -> Color -> Color
$cmax :: Color -> Color -> Color
>= :: Color -> Color -> Bool
$c>= :: Color -> Color -> Bool
> :: Color -> Color -> Bool
$c> :: Color -> Color -> Bool
<= :: Color -> Color -> Bool
$c<= :: Color -> Color -> Bool
< :: Color -> Color -> Bool
$c< :: Color -> Color -> Bool
compare :: Color -> Color -> Ordering
$ccompare :: Color -> Color -> Ordering
Ord, forall x. Rep Color x -> Color
forall x. Color -> Rep Color x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Color x -> Color
$cfrom :: forall x. Color -> Rep Color x
Generic)
instance Default Color where
def :: Color
def = Int -> Int -> Int -> Double -> Color
Color Int
255 Int
255 Int
255 Double
1.0
data FontDef
= FontDefFile
{ FontDef -> Text
_fntFontName :: !Text
, FontDef -> Text
_fntFontPath :: !Text
}
| FontDefMem
{ _fntFontName :: !Text
, FontDef -> ByteString
_fntFontBytes :: !ByteString
}
deriving (FontDef -> FontDef -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FontDef -> FontDef -> Bool
$c/= :: FontDef -> FontDef -> Bool
== :: FontDef -> FontDef -> Bool
$c== :: FontDef -> FontDef -> Bool
Eq, Int -> FontDef -> ShowS
[FontDef] -> ShowS
FontDef -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FontDef] -> ShowS
$cshowList :: [FontDef] -> ShowS
show :: FontDef -> String
$cshow :: FontDef -> String
showsPrec :: Int -> FontDef -> ShowS
$cshowsPrec :: Int -> FontDef -> ShowS
Show, forall x. Rep FontDef x -> FontDef
forall x. FontDef -> Rep FontDef x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FontDef x -> FontDef
$cfrom :: forall x. FontDef -> Rep FontDef x
Generic)
newtype Font
= Font { Font -> Text
unFont :: Text }
deriving (Font -> Font -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Font -> Font -> Bool
$c/= :: Font -> Font -> Bool
== :: Font -> Font -> Bool
$c== :: Font -> Font -> Bool
Eq, Int -> Font -> ShowS
[Font] -> ShowS
Font -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Font] -> ShowS
$cshowList :: [Font] -> ShowS
show :: Font -> String
$cshow :: Font -> String
showsPrec :: Int -> Font -> ShowS
$cshowsPrec :: Int -> Font -> ShowS
Show, forall x. Rep Font x -> Font
forall x. Font -> Rep Font x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Font x -> Font
$cfrom :: forall x. Font -> Rep Font x
Generic)
instance IsString Font where
fromString :: String -> Font
fromString String
s = Text -> Font
Font (String -> Text
T.pack String
s)
instance Default Font where
def :: Font
def = Text -> Font
Font Text
"Regular"
newtype FontSize
= FontSize { FontSize -> Double
unFontSize :: Double }
deriving (FontSize -> FontSize -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FontSize -> FontSize -> Bool
$c/= :: FontSize -> FontSize -> Bool
== :: FontSize -> FontSize -> Bool
$c== :: FontSize -> FontSize -> Bool
Eq, Int -> FontSize -> ShowS
[FontSize] -> ShowS
FontSize -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FontSize] -> ShowS
$cshowList :: [FontSize] -> ShowS
show :: FontSize -> String
$cshow :: FontSize -> String
showsPrec :: Int -> FontSize -> ShowS
$cshowsPrec :: Int -> FontSize -> ShowS
Show, forall x. Rep FontSize x -> FontSize
forall x. FontSize -> Rep FontSize x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FontSize x -> FontSize
$cfrom :: forall x. FontSize -> Rep FontSize x
Generic)
instance Default FontSize where
def :: FontSize
def = Double -> FontSize
FontSize Double
32
newtype FontSpace
= FontSpace { FontSpace -> Double
unFontSpace :: Double }
deriving (FontSpace -> FontSpace -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FontSpace -> FontSpace -> Bool
$c/= :: FontSpace -> FontSpace -> Bool
== :: FontSpace -> FontSpace -> Bool
$c== :: FontSpace -> FontSpace -> Bool
Eq, Int -> FontSpace -> ShowS
[FontSpace] -> ShowS
FontSpace -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FontSpace] -> ShowS
$cshowList :: [FontSpace] -> ShowS
show :: FontSpace -> String
$cshow :: FontSpace -> String
showsPrec :: Int -> FontSpace -> ShowS
$cshowsPrec :: Int -> FontSpace -> ShowS
Show, forall x. Rep FontSpace x -> FontSpace
forall x. FontSpace -> Rep FontSpace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FontSpace x -> FontSpace
$cfrom :: forall x. FontSpace -> Rep FontSpace x
Generic)
instance Default FontSpace where
def :: FontSpace
def = Double -> FontSpace
FontSpace Double
0
data RectSide
= SideLeft
| SideRight
| SideTop
| SideBottom
deriving (RectSide -> RectSide -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RectSide -> RectSide -> Bool
$c/= :: RectSide -> RectSide -> Bool
== :: RectSide -> RectSide -> Bool
$c== :: RectSide -> RectSide -> Bool
Eq, Int -> RectSide -> ShowS
[RectSide] -> ShowS
RectSide -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RectSide] -> ShowS
$cshowList :: [RectSide] -> ShowS
show :: RectSide -> String
$cshow :: RectSide -> String
showsPrec :: Int -> RectSide -> ShowS
$cshowsPrec :: Int -> RectSide -> ShowS
Show)
data RectCorner
= CornerTL
| CornerTR
| CornerBR
| CornerBL
deriving (RectCorner -> RectCorner -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RectCorner -> RectCorner -> Bool
$c/= :: RectCorner -> RectCorner -> Bool
== :: RectCorner -> RectCorner -> Bool
$c== :: RectCorner -> RectCorner -> Bool
Eq, Int -> RectCorner -> ShowS
[RectCorner] -> ShowS
RectCorner -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RectCorner] -> ShowS
$cshowList :: [RectCorner] -> ShowS
show :: RectCorner -> String
$cshow :: RectCorner -> String
showsPrec :: Int -> RectCorner -> ShowS
$cshowsPrec :: Int -> RectCorner -> ShowS
Show)
data AlignH
= ALeft
| ACenter
| ARight
deriving (AlignH -> AlignH -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AlignH -> AlignH -> Bool
$c/= :: AlignH -> AlignH -> Bool
== :: AlignH -> AlignH -> Bool
$c== :: AlignH -> AlignH -> Bool
Eq, Int -> AlignH -> ShowS
[AlignH] -> ShowS
AlignH -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AlignH] -> ShowS
$cshowList :: [AlignH] -> ShowS
show :: AlignH -> String
$cshow :: AlignH -> String
showsPrec :: Int -> AlignH -> ShowS
$cshowsPrec :: Int -> AlignH -> ShowS
Show, forall x. Rep AlignH x -> AlignH
forall x. AlignH -> Rep AlignH x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AlignH x -> AlignH
$cfrom :: forall x. AlignH -> Rep AlignH x
Generic)
instance Default AlignH where
def :: AlignH
def = AlignH
ACenter
data AlignV
= ATop
| AMiddle
| ABottom
deriving (AlignV -> AlignV -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AlignV -> AlignV -> Bool
$c/= :: AlignV -> AlignV -> Bool
== :: AlignV -> AlignV -> Bool
$c== :: AlignV -> AlignV -> Bool
Eq, Int -> AlignV -> ShowS
[AlignV] -> ShowS
AlignV -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AlignV] -> ShowS
$cshowList :: [AlignV] -> ShowS
show :: AlignV -> String
$cshow :: AlignV -> String
showsPrec :: Int -> AlignV -> ShowS
$cshowsPrec :: Int -> AlignV -> ShowS
Show, forall x. Rep AlignV x -> AlignV
forall x. AlignV -> Rep AlignV x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AlignV x -> AlignV
$cfrom :: forall x. AlignV -> Rep AlignV x
Generic)
instance Default AlignV where
def :: AlignV
def = AlignV
AMiddle
data AlignTH
= ATLeft
| ATCenter
| ATRight
deriving (AlignTH -> AlignTH -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AlignTH -> AlignTH -> Bool
$c/= :: AlignTH -> AlignTH -> Bool
== :: AlignTH -> AlignTH -> Bool
$c== :: AlignTH -> AlignTH -> Bool
Eq, Int -> AlignTH -> ShowS
[AlignTH] -> ShowS
AlignTH -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AlignTH] -> ShowS
$cshowList :: [AlignTH] -> ShowS
show :: AlignTH -> String
$cshow :: AlignTH -> String
showsPrec :: Int -> AlignTH -> ShowS
$cshowsPrec :: Int -> AlignTH -> ShowS
Show, forall x. Rep AlignTH x -> AlignTH
forall x. AlignTH -> Rep AlignTH x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AlignTH x -> AlignTH
$cfrom :: forall x. AlignTH -> Rep AlignTH x
Generic)
instance Default AlignTH where
def :: AlignTH
def = AlignTH
ATCenter
data AlignTV
= ATTop
| ATMiddle
| ATAscender
| ATLowerX
| ATBottom
| ATBaseline
deriving (AlignTV -> AlignTV -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AlignTV -> AlignTV -> Bool
$c/= :: AlignTV -> AlignTV -> Bool
== :: AlignTV -> AlignTV -> Bool
$c== :: AlignTV -> AlignTV -> Bool
Eq, Int -> AlignTV -> ShowS
[AlignTV] -> ShowS
AlignTV -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AlignTV] -> ShowS
$cshowList :: [AlignTV] -> ShowS
show :: AlignTV -> String
$cshow :: AlignTV -> String
showsPrec :: Int -> AlignTV -> ShowS
$cshowsPrec :: Int -> AlignTV -> ShowS
Show, forall x. Rep AlignTV x -> AlignTV
forall x. AlignTV -> Rep AlignTV x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AlignTV x -> AlignTV
$cfrom :: forall x. AlignTV -> Rep AlignTV x
Generic)
instance Default AlignTV where
def :: AlignTV
def = AlignTV
ATLowerX
data GlyphPos = GlyphPos {
GlyphPos -> Char
_glpGlyph :: {-# UNPACK #-} !Char,
GlyphPos -> Double
_glpX :: {-# UNPACK #-} !Double,
GlyphPos -> Double
_glpXMin :: {-# UNPACK #-} !Double,
GlyphPos -> Double
_glpXMax :: {-# UNPACK #-} !Double,
GlyphPos -> Double
_glpYMin :: {-# UNPACK #-} !Double,
GlyphPos -> Double
_glpYMax :: {-# UNPACK #-} !Double,
GlyphPos -> Double
_glpW :: {-# UNPACK #-} !Double,
GlyphPos -> Double
_glpH :: {-# UNPACK #-} !Double
} deriving (GlyphPos -> GlyphPos -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GlyphPos -> GlyphPos -> Bool
$c/= :: GlyphPos -> GlyphPos -> Bool
== :: GlyphPos -> GlyphPos -> Bool
$c== :: GlyphPos -> GlyphPos -> Bool
Eq, Int -> GlyphPos -> ShowS
[GlyphPos] -> ShowS
GlyphPos -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GlyphPos] -> ShowS
$cshowList :: [GlyphPos] -> ShowS
show :: GlyphPos -> String
$cshow :: GlyphPos -> String
showsPrec :: Int -> GlyphPos -> ShowS
$cshowsPrec :: Int -> GlyphPos -> ShowS
Show, forall x. Rep GlyphPos x -> GlyphPos
forall x. GlyphPos -> Rep GlyphPos x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GlyphPos x -> GlyphPos
$cfrom :: forall x. GlyphPos -> Rep GlyphPos x
Generic)
instance Default GlyphPos where
def :: GlyphPos
def = GlyphPos {
_glpGlyph :: Char
_glpGlyph = Char
' ',
_glpX :: Double
_glpX = Double
0,
_glpXMin :: Double
_glpXMin = Double
0,
_glpXMax :: Double
_glpXMax = Double
0,
_glpYMin :: Double
_glpYMin = Double
0,
_glpYMax :: Double
_glpYMax = Double
0,
_glpW :: Double
_glpW = Double
0,
_glpH :: Double
_glpH = Double
0
}
data TextMode
= SingleLine
| MultiLine
deriving (TextMode -> TextMode -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TextMode -> TextMode -> Bool
$c/= :: TextMode -> TextMode -> Bool
== :: TextMode -> TextMode -> Bool
$c== :: TextMode -> TextMode -> Bool
Eq, Int -> TextMode -> ShowS
[TextMode] -> ShowS
TextMode -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TextMode] -> ShowS
$cshowList :: [TextMode] -> ShowS
show :: TextMode -> String
$cshow :: TextMode -> String
showsPrec :: Int -> TextMode -> ShowS
$cshowsPrec :: Int -> TextMode -> ShowS
Show, forall x. Rep TextMode x -> TextMode
forall x. TextMode -> Rep TextMode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TextMode x -> TextMode
$cfrom :: forall x. TextMode -> Rep TextMode x
Generic)
data TextTrim
= TrimSpaces
| KeepSpaces
deriving (TextTrim -> TextTrim -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TextTrim -> TextTrim -> Bool
$c/= :: TextTrim -> TextTrim -> Bool
== :: TextTrim -> TextTrim -> Bool
$c== :: TextTrim -> TextTrim -> Bool
Eq, Int -> TextTrim -> ShowS
[TextTrim] -> ShowS
TextTrim -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TextTrim] -> ShowS
$cshowList :: [TextTrim] -> ShowS
show :: TextTrim -> String
$cshow :: TextTrim -> String
showsPrec :: Int -> TextTrim -> ShowS
$cshowsPrec :: Int -> TextTrim -> ShowS
Show, forall x. Rep TextTrim x -> TextTrim
forall x. TextTrim -> Rep TextTrim x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TextTrim x -> TextTrim
$cfrom :: forall x. TextTrim -> Rep TextTrim x
Generic)
data TextOverflow
= Ellipsis
| ClipText
deriving (TextOverflow -> TextOverflow -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TextOverflow -> TextOverflow -> Bool
$c/= :: TextOverflow -> TextOverflow -> Bool
== :: TextOverflow -> TextOverflow -> Bool
$c== :: TextOverflow -> TextOverflow -> Bool
Eq, Int -> TextOverflow -> ShowS
[TextOverflow] -> ShowS
TextOverflow -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TextOverflow] -> ShowS
$cshowList :: [TextOverflow] -> ShowS
show :: TextOverflow -> String
$cshow :: TextOverflow -> String
showsPrec :: Int -> TextOverflow -> ShowS
$cshowsPrec :: Int -> TextOverflow -> ShowS
Show)
data TextMetrics = TextMetrics {
TextMetrics -> Double
_txmAsc :: {-# UNPACK #-} !Double,
TextMetrics -> Double
_txmDesc :: {-# UNPACK #-} !Double,
TextMetrics -> Double
_txmLineH :: {-# UNPACK #-} !Double,
TextMetrics -> Double
_txmLowerX :: {-# UNPACK #-} !Double
} deriving (TextMetrics -> TextMetrics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TextMetrics -> TextMetrics -> Bool
$c/= :: TextMetrics -> TextMetrics -> Bool
== :: TextMetrics -> TextMetrics -> Bool
$c== :: TextMetrics -> TextMetrics -> Bool
Eq, Int -> TextMetrics -> ShowS
[TextMetrics] -> ShowS
TextMetrics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TextMetrics] -> ShowS
$cshowList :: [TextMetrics] -> ShowS
show :: TextMetrics -> String
$cshow :: TextMetrics -> String
showsPrec :: Int -> TextMetrics -> ShowS
$cshowsPrec :: Int -> TextMetrics -> ShowS
Show, forall x. Rep TextMetrics x -> TextMetrics
forall x. TextMetrics -> Rep TextMetrics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TextMetrics x -> TextMetrics
$cfrom :: forall x. TextMetrics -> Rep TextMetrics x
Generic)
instance Default TextMetrics where
def :: TextMetrics
def = TextMetrics {
_txmAsc :: Double
_txmAsc = Double
0,
_txmDesc :: Double
_txmDesc = Double
0,
_txmLineH :: Double
_txmLineH = Double
0,
_txmLowerX :: Double
_txmLowerX = Double
0
}
data TextLine = TextLine {
TextLine -> Font
_tlFont :: !Font,
TextLine -> FontSize
_tlFontSize :: !FontSize,
TextLine -> FontSpace
_tlFontSpaceH :: !FontSpace,
TextLine -> FontSpace
_tlFontSpaceV :: !FontSpace,
TextLine -> TextMetrics
_tlMetrics :: !TextMetrics,
TextLine -> Text
_tlText :: !Text,
TextLine -> Size
_tlSize :: !Size,
TextLine -> Rect
_tlRect :: !Rect,
TextLine -> Seq GlyphPos
_tlGlyphs :: !(Seq GlyphPos)
} deriving (TextLine -> TextLine -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TextLine -> TextLine -> Bool
$c/= :: TextLine -> TextLine -> Bool
== :: TextLine -> TextLine -> Bool
$c== :: TextLine -> TextLine -> Bool
Eq, Int -> TextLine -> ShowS
[TextLine] -> ShowS
TextLine -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TextLine] -> ShowS
$cshowList :: [TextLine] -> ShowS
show :: TextLine -> String
$cshow :: TextLine -> String
showsPrec :: Int -> TextLine -> ShowS
$cshowsPrec :: Int -> TextLine -> ShowS
Show, forall x. Rep TextLine x -> TextLine
forall x. TextLine -> Rep TextLine x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TextLine x -> TextLine
$cfrom :: forall x. TextLine -> Rep TextLine x
Generic)
instance Default TextLine where
def :: TextLine
def = TextLine {
_tlFont :: Font
_tlFont = forall a. Default a => a
def,
_tlFontSize :: FontSize
_tlFontSize = forall a. Default a => a
def,
_tlFontSpaceH :: FontSpace
_tlFontSpaceH = forall a. Default a => a
def,
_tlFontSpaceV :: FontSpace
_tlFontSpaceV = forall a. Default a => a
def,
_tlMetrics :: TextMetrics
_tlMetrics = forall a. Default a => a
def,
_tlText :: Text
_tlText = Text
"",
_tlSize :: Size
_tlSize = forall a. Default a => a
def,
_tlRect :: Rect
_tlRect = forall a. Default a => a
def,
_tlGlyphs :: Seq GlyphPos
_tlGlyphs = forall a. Seq a
Seq.empty
}
data ImageFlag
= ImageNearest
| ImageRepeatX
| ImageRepeatY
deriving (ImageFlag -> ImageFlag -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageFlag -> ImageFlag -> Bool
$c/= :: ImageFlag -> ImageFlag -> Bool
== :: ImageFlag -> ImageFlag -> Bool
$c== :: ImageFlag -> ImageFlag -> Bool
Eq, Int -> ImageFlag -> ShowS
[ImageFlag] -> ShowS
ImageFlag -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImageFlag] -> ShowS
$cshowList :: [ImageFlag] -> ShowS
show :: ImageFlag -> String
$cshow :: ImageFlag -> String
showsPrec :: Int -> ImageFlag -> ShowS
$cshowsPrec :: Int -> ImageFlag -> ShowS
Show, forall x. Rep ImageFlag x -> ImageFlag
forall x. ImageFlag -> Rep ImageFlag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImageFlag x -> ImageFlag
$cfrom :: forall x. ImageFlag -> Rep ImageFlag x
Generic)
data ImageDef = ImageDef {
ImageDef -> Text
_idfName :: Text,
ImageDef -> Size
_idfSize :: Size,
ImageDef -> ByteString
_idfImgData :: BS.ByteString,
ImageDef -> [ImageFlag]
_idfFlags :: [ImageFlag]
} deriving (ImageDef -> ImageDef -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageDef -> ImageDef -> Bool
$c/= :: ImageDef -> ImageDef -> Bool
== :: ImageDef -> ImageDef -> Bool
$c== :: ImageDef -> ImageDef -> Bool
Eq, Int -> ImageDef -> ShowS
[ImageDef] -> ShowS
ImageDef -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImageDef] -> ShowS
$cshowList :: [ImageDef] -> ShowS
show :: ImageDef -> String
$cshow :: ImageDef -> String
showsPrec :: Int -> ImageDef -> ShowS
$cshowsPrec :: Int -> ImageDef -> ShowS
Show, forall x. Rep ImageDef x -> ImageDef
forall x. ImageDef -> Rep ImageDef x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImageDef x -> ImageDef
$cfrom :: forall x. ImageDef -> Rep ImageDef x
Generic)
data FontManager = FontManager {
FontManager -> Font -> FontSize -> TextMetrics
computeTextMetrics :: Font -> FontSize -> TextMetrics,
FontManager -> Double -> Font -> FontSize -> TextMetrics
computeTextMetrics_ :: Double -> Font -> FontSize -> TextMetrics,
FontManager -> Font -> FontSize -> FontSpace -> Text -> Size
computeTextSize :: Font -> FontSize -> FontSpace -> Text -> Size,
FontManager
-> Double -> Font -> FontSize -> FontSpace -> Text -> Size
computeTextSize_ :: Double -> Font -> FontSize -> FontSpace -> Text -> Size,
FontManager
-> Font -> FontSize -> FontSpace -> Text -> Seq GlyphPos
computeGlyphsPos :: Font -> FontSize -> FontSpace -> Text -> Seq GlyphPos,
FontManager
-> Double -> Font -> FontSize -> FontSpace -> Text -> Seq GlyphPos
computeGlyphsPos_ :: Double -> Font -> FontSize -> FontSpace -> Text -> Seq GlyphPos
}
data Renderer = Renderer {
Renderer -> Double -> Double -> IO ()
beginFrame :: Double -> Double -> IO (),
Renderer -> IO ()
endFrame :: IO (),
Renderer -> IO ()
beginPath :: IO (),
Renderer -> IO ()
closePath :: IO (),
Renderer -> IO ()
saveContext :: IO (),
Renderer -> IO ()
restoreContext :: IO (),
Renderer -> IO () -> IO ()
createOverlay :: IO () -> IO (),
Renderer -> IO ()
renderOverlays :: IO (),
Renderer -> IO () -> IO ()
createRawTask :: IO () -> IO (),
Renderer -> IO ()
renderRawTasks :: IO (),
Renderer -> IO () -> IO ()
createRawOverlay :: IO () -> IO (),
Renderer -> IO ()
renderRawOverlays :: IO (),
Renderer -> Rect -> IO ()
intersectScissor :: Rect -> IO (),
Renderer -> Point -> IO ()
setTranslation :: Point -> IO (),
Renderer -> Point -> IO ()
setScale :: Point -> IO (),
Renderer -> Double -> IO ()
setRotation :: Double -> IO (),
Renderer -> Double -> IO ()
setGlobalAlpha :: Double -> IO (),
Renderer -> Winding -> IO ()
setPathWinding :: Winding -> IO (),
Renderer -> IO ()
stroke :: IO (),
Renderer -> Double -> IO ()
setStrokeWidth :: Double -> IO (),
Renderer -> Color -> IO ()
setStrokeColor :: Color -> IO (),
Renderer -> Point -> Point -> Color -> Color -> IO ()
setStrokeLinearGradient :: Point -> Point -> Color -> Color -> IO (),
Renderer -> Point -> Double -> Double -> Color -> Color -> IO ()
setStrokeRadialGradient :: Point -> Double -> Double -> Color -> Color -> IO (),
Renderer -> Rect -> Double -> Double -> Color -> Color -> IO ()
setStrokeBoxGradient :: Rect -> Double -> Double -> Color -> Color -> IO (),
Renderer -> Text -> Point -> Size -> Double -> Double -> IO ()
setStrokeImagePattern :: Text -> Point -> Size -> Double -> Double -> IO (),
Renderer -> IO ()
fill :: IO (),
Renderer -> Color -> IO ()
setFillColor :: Color -> IO (),
Renderer -> Point -> Point -> Color -> Color -> IO ()
setFillLinearGradient :: Point -> Point -> Color -> Color -> IO (),
Renderer -> Point -> Double -> Double -> Color -> Color -> IO ()
setFillRadialGradient :: Point -> Double -> Double -> Color -> Color -> IO (),
Renderer -> Rect -> Double -> Double -> Color -> Color -> IO ()
setFillBoxGradient :: Rect -> Double -> Double -> Color -> Color -> IO (),
Renderer -> Text -> Point -> Size -> Double -> Double -> IO ()
setFillImagePattern :: Text -> Point -> Size -> Double -> Double -> IO (),
Renderer -> Point -> IO ()
moveTo :: Point -> IO (),
Renderer -> Point -> Point -> IO ()
renderLine :: Point -> Point -> IO (),
Renderer -> Point -> IO ()
renderLineTo :: Point -> IO (),
Renderer -> Rect -> IO ()
renderRect :: Rect -> IO (),
Renderer -> Rect -> Double -> Double -> Double -> Double -> IO ()
renderRoundedRect :: Rect -> Double -> Double -> Double -> Double -> IO (),
Renderer -> Point -> Double -> Double -> Double -> Winding -> IO ()
renderArc :: Point -> Double -> Double -> Double -> Winding -> IO (),
Renderer -> Point -> Point -> IO ()
renderQuadTo :: Point -> Point -> IO (),
Renderer -> Rect -> IO ()
renderEllipse :: Rect -> IO (),
Renderer -> Point -> Font -> FontSize -> FontSpace -> Text -> IO ()
renderText :: Point -> Font -> FontSize -> FontSpace -> Text -> IO (),
Renderer -> Text -> IO (Maybe ImageDef)
getImage :: Text -> IO (Maybe ImageDef),
Renderer -> Text -> Size -> ByteString -> [ImageFlag] -> IO ()
addImage :: Text -> Size -> ByteString -> [ImageFlag] -> IO (),
Renderer -> Text -> Size -> ByteString -> IO ()
updateImage :: Text -> Size -> ByteString -> IO (),
Renderer -> Text -> IO ()
deleteImage :: Text -> IO ()
}