-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Xournal file renderer -- -- Rendering library using cairo for xournal file format @package xournal-render @version 0.4 module Graphics.Xournal.Render.Type data AlterList a b Empty :: AlterList a b (:-) :: a -> AlterList b a -> AlterList a b newtype NotHitted a NotHitted :: [a] -> NotHitted a unNotHitted :: NotHitted a -> [a] newtype Hitted a Hitted :: [a] -> Hitted a unHitted :: Hitted a -> [a] type StrokeHitted = AlterList (NotHitted StrokeBBox) (Hitted StrokeBBox) fmapAL :: (a -> c) -> (b -> d) -> AlterList a b -> AlterList c d getA :: AlterList a b -> [a] getB :: AlterList a b -> [b] interleave :: (a -> c) -> (b -> c) -> AlterList a b -> [c] type TAlterHitted a = AlterList [a] (Hitted a) newtype TEitherAlterHitted a TEitherAlterHitted :: Either [a] (TAlterHitted a) -> TEitherAlterHitted a unTEitherAlterHitted :: TEitherAlterHitted a -> Either [a] (TAlterHitted a) type TLayerSelect a = GLayer TEitherAlterHitted (StrokeTypeFromLayer a) type TLayerSelectBuf a = GLayerBuf (BufTypeFromLayer a) TEitherAlterHitted (StrokeTypeFromLayer a) data TLayerSelectInPage s a TLayerSelectInPage :: TLayerSelect a -> s a -> TLayerSelectInPage s a gselectedlayer :: TLayerSelectInPage s a -> TLayerSelect a gotherlayers :: TLayerSelectInPage s a -> s a data TLayerSelectInPageBuf s a TLayerSelectInPageBuf :: TLayerSelectBuf a -> s a -> TLayerSelectInPageBuf s a gselectedlayerbuf :: TLayerSelectInPageBuf s a -> TLayerSelectBuf a gotherlayersbuf :: TLayerSelectInPageBuf s a -> s a type TTempPageSelect = GPage Background (TLayerSelectInPage []) TLayerBBox type TTempXournalSelect = GSelect (IntMap TPageBBoxMap) (Maybe (Int, TTempPageSelect)) instance (Show a, Show b) => Show (AlterList a b) instance Show a => Show (NotHitted a) instance Show a => Show (Hitted a) module Graphics.Xournal.Render.HitTest hitTestBBoxPoint :: BBox -> (Double, Double) -> Bool hitTestLineLine :: ((Double, Double), (Double, Double)) -> ((Double, Double), (Double, Double)) -> Bool hitTestLineStroke :: ((Double, Double), (Double, Double)) -> Stroke -> Bool mkHitTestAL :: (StrokeBBox -> Bool) -> [StrokeBBox] -> AlterList (NotHitted StrokeBBox) (Hitted StrokeBBox) mkHitTestALState :: (StrokeBBox -> Bool) -> [StrokeBBox] -> State Bool (AlterList (NotHitted StrokeBBox) (Hitted StrokeBBox)) mkHitTestBBox :: ((Double, Double), (Double, Double)) -> [StrokeBBox] -> AlterList (NotHitted StrokeBBox) (Hitted StrokeBBox) mkHitTestBBoxBBox :: BBox -> [StrokeBBox] -> AlterList (NotHitted StrokeBBox) (Hitted StrokeBBox) mkHitTestInsideBBox :: BBox -> [StrokeBBox] -> AlterList (NotHitted StrokeBBox) (Hitted StrokeBBox) hitTestInsideBBox :: BBox -> BBox -> Bool hitTestBBoxBBox :: BBox -> BBox -> Bool mkHitTestStroke :: ((Double, Double), (Double, Double)) -> [StrokeBBox] -> State Bool (AlterList (NotHitted StrokeBBox) (Hitted StrokeBBox)) hitTestStrokes :: ((Double, Double), (Double, Double)) -> AlterList (NotHitted StrokeBBox) (Hitted StrokeBBox) -> State Bool (AlterList (NotHitted StrokeBBox) StrokeHitted) elimHitted :: AlterList (NotHitted StrokeBBox) (Hitted StrokeBBox) -> State (Maybe BBox) [StrokeBBox] merge :: Maybe BBox -> Maybe BBox -> Maybe BBox getTotalBBox :: [StrokeBBox] -> Maybe BBox module Graphics.Xournal.Render.Simple drawOneStroke :: Stroke -> Render () drawOneStrokeCurve :: [Pair Double Double] -> Render () -- | general background drawing (including pdf file) cairoDrawBackground :: Page -> Render () cairoDrawPdfBkg :: Dimension -> Maybe ByteString -> Maybe ByteString -> Int -> Render () cairoDrawBkg :: Dimension -> Background -> Render () cairoDrawRuling :: Double -> Double -> ByteString -> Render () cairoDrawPage :: Page -> Render () module Graphics.Xournal.Render.BBox clipBBox :: Maybe BBox -> Render () clearBBox :: Maybe BBox -> Render () cairoOneStrokeBBoxOnly :: StrokeBBox -> Render () cairoDrawPageBBoxOnly :: TPageBBoxMap -> Render () cairoDrawLayerBBoxOnly :: TLayerBBox -> Render () inflate :: BBox -> Double -> BBox cairoDrawPageBBox :: Maybe BBox -> TPageBBoxMap -> Render () cairoDrawLayerBBox :: Maybe BBox -> TLayerBBox -> Render () cairoDrawBackgroundBBox :: Maybe BBox -> Dimension -> Background -> Render () cairoDrawRulingBBox :: BBox -> Double -> Double -> ByteString -> Render () module Graphics.Xournal.Render.Generic class Renderable a cairoRender :: Renderable a => a -> Render () cairoLayer :: (Renderable a, Foldable s) => GLayer s a -> Render () cairoPage :: (Renderable (b, Dimension), Renderable a, Foldable s) => GPage b s a -> Render () class RenderOptionable a where { type family RenderOption a :: *; } cairoRenderOption :: RenderOptionable a => RenderOption a -> a -> Render () data StrokeBBoxOption DrawFull :: StrokeBBoxOption DrawBoxOnly :: StrokeBBoxOption cairoOptionLayer :: (RenderOptionable a, Foldable s) => RenderOption a -> GLayer s a -> Render () cairoOptionPage :: (RenderOptionable (b, Dimension), RenderOptionable a, Foldable s) => (RenderOption (b, Dimension), RenderOption a) -> GPage b s a -> Render () instance (RenderOptionable (b, Dimension), RenderOptionable a, Foldable s) => RenderOptionable (GPage b s a) instance (RenderOptionable a, Foldable s) => RenderOptionable (GLayer s a) instance RenderOptionable StrokeBBox instance RenderOptionable Stroke instance RenderOptionable (Background, Dimension) instance (Renderable (b, Dimension), Renderable a, Foldable s) => Renderable (GPage b s a) instance (Renderable a, Foldable s) => Renderable (GLayer s a) instance Renderable StrokeBBox instance Renderable Stroke instance Renderable (Background, Dimension) module Graphics.Xournal.Render.PDFBackground data Context Context :: ByteString -> ByteString -> Maybe () -> Context ctxt_domain :: Context -> ByteString ctxt_filename :: Context -> ByteString ctxt_doc :: Context -> Maybe () data BackgroundPDFDrawable BkgPDFSolid :: ByteString -> ByteString -> Maybe Surface -> BackgroundPDFDrawable bkgpdf_color :: BackgroundPDFDrawable -> ByteString bkgpdf_style :: BackgroundPDFDrawable -> ByteString bkgpdf_cairosurface :: BackgroundPDFDrawable -> Maybe Surface BkgPDFPDF :: Maybe ByteString -> Maybe ByteString -> Int -> Maybe () -> Maybe Surface -> BackgroundPDFDrawable bkgpdf_domain :: BackgroundPDFDrawable -> Maybe ByteString bkgpdf_filename :: BackgroundPDFDrawable -> Maybe ByteString bkgpdf_pageno :: BackgroundPDFDrawable -> Int bkgpdf_popplerpage :: BackgroundPDFDrawable -> Maybe () bkgpdf_cairosurface :: BackgroundPDFDrawable -> Maybe Surface data BkgPDFOption DrawBkgPDF :: BkgPDFOption DrawWhite :: BkgPDFOption DrawBuffer :: BkgPDFOption DrawPDFInBBox :: (Maybe BBox) -> BkgPDFOption bkgFromBkgPDF :: BackgroundPDFDrawable -> Background bkgPDFFromBkg :: Background -> BackgroundPDFDrawable cairoRenderBackgroundPDFDrawable :: (BackgroundPDFDrawable, Dimension) -> Render () instance RenderOptionable (BackgroundPDFDrawable, Dimension) instance Renderable (BackgroundPDFDrawable, Dimension) module Graphics.Xournal.Render.BBoxMapPDF type TPageBBoxMapPDF = TPageBBoxMapBkg BackgroundPDFDrawable type TXournalBBoxMapPDF = TXournalBBoxMapBkg BackgroundPDFDrawable type TTempPageSelectPDF = GPage BackgroundPDFDrawable (TLayerSelectInPage []) TLayerBBox type TTempXournalSelectPDF = GSelect (IntMap TPageBBoxMapPDF) (Maybe (Int, TTempPageSelectPDF)) tlayerBBoxFromTLayerSelect :: TLayerSelect TLayerBBox -> TLayerBBox tlayerbufFromTLayerSelectBuf :: TLayerSelectBuf (TLayerBBoxBuf b) -> (TLayerBBoxBuf b) tpageBBoxMapPDFFromTTempPageSelectPDF :: TTempPageSelectPDF -> TPageBBoxMapPDF tpageBBoxMapPDFBufFromTTempPageSelectPDFBuf :: TTempPageSelectPDFBuf -> TPageBBoxMapPDFBuf ttempPageSelectPDFFromTPageBBoxMapPDF :: TPageBBoxMapPDF -> TTempPageSelectPDF ttempPageSelectPDFBufFromTPageBBoxMapPDFBuf :: TPageBBoxMapPDFBuf -> TTempPageSelectPDFBuf mkTXournalBBoxMapPDF :: Xournal -> IO TXournalBBoxMapPDF mkAllTPageBBoxMapPDF :: [Page] -> IO [TPageBBoxMapPDF] mkPagePDF :: Page -> StateT (Maybe Context) IO TPageBBoxMapPDF mkBkgPDF :: Dimension -> Background -> StateT (Maybe Context) IO BackgroundPDFDrawable newtype LyBuf LyBuf :: Maybe Surface -> LyBuf mbuffer :: LyBuf -> Maybe Surface type TPageBBoxMapPDFBuf = TPageBBoxMapBkgBuf BackgroundPDFDrawable LyBuf type TXournalBBoxMapPDFBuf = TXournalBBoxMapBkgBuf BackgroundPDFDrawable LyBuf type TTempPageSelectPDFBuf = GPage BackgroundPDFDrawable (TLayerSelectInPageBuf []) (TLayerBBoxBuf LyBuf) type TTempXournalSelectPDFBuf = GSelect (IntMap TPageBBoxMapPDFBuf) (Maybe (Int, TTempPageSelectPDFBuf)) mkTLayerBBoxBufFromNoBuf :: Dimension -> TLayerBBox -> IO (TLayerBBoxBuf LyBuf) updateLayerBuf :: Maybe BBox -> TLayerBBoxBuf LyBuf -> IO (TLayerBBoxBuf LyBuf) mkTPageBBoxMapPDFBufFromNoBuf :: TPageBBoxMapPDF -> IO TPageBBoxMapPDFBuf mkTXournalBBoxMapPDFBufFromNoBuf :: TXournalBBoxMapPDF -> IO TXournalBBoxMapPDFBuf resetPageBuffers :: TPageBBoxMapPDFBuf -> IO TPageBBoxMapPDFBuf resetXournalBuffers :: TXournalBBoxMapPDFBuf -> IO TXournalBBoxMapPDFBuf tlayerBBoxFromTLayerBBoxBuf :: TLayerBBoxBuf a -> TLayerBBox tpageBBoxMapPDFFromTPageBBoxMapPDFBuf :: TPageBBoxMapPDFBuf -> TPageBBoxMapPDF newtype InBBox a InBBox :: a -> InBBox a data InBBoxOption InBBoxOption :: (Maybe BBox) -> InBBoxOption -- | page within a bbox. not implemented bbox part. cairoDrawPageBBoxPDF :: Maybe BBox -> TPageBBoxMapPDF -> Render () cairoDrawLayerBBoxBuf :: Maybe BBox -> TLayerBBoxBuf LyBuf -> Render () instance RenderOptionable (InBBox TPageBBoxMapPDFBuf) instance RenderOptionable (InBBox (TLayerBBoxBuf LyBuf)) instance RenderOptionable (InBBox TPageBBoxMapPDF) instance RenderOptionable (InBBox TLayerBBox) instance GCast TPageBBoxMapPDFBuf TPageBBoxMapPDF instance GCast (TLayerBBoxBuf a) TLayerBBox instance GCast TPageBBoxMapPDFBuf TTempPageSelectPDFBuf instance GCast TPageBBoxMapPDF TTempPageSelectPDF instance GCast TTempPageSelectPDFBuf TPageBBoxMapPDFBuf instance GCast TTempPageSelectPDF TPageBBoxMapPDF instance GBackgroundable BackgroundPDFDrawable