Maintainer | diagrams-discuss@googlegroups.com |
---|---|
Safe Haskell | None |
This module contains the internal implementation guts of the diagrams cairo backend. If you want to see how the cairo backend works under the hood, you are in the right place (try clicking on the "Source" links). (Guts under the hood, what an awful mixed metaphor.) If you know what you are doing and really want access to the internals of the implementation, you are also in the right place. Otherwise, you should have no need of this module; import Diagrams.Backend.Cairo.CmdLine or Diagrams.Backend.Cairo instead.
The one exception is that this module may have to be imported
sometimes to work around an apparent bug in certain versions of
GHC, which results in a "not in scope" error for CairoOptions
.
- data Cairo = Cairo
- data OutputType
- = PNG
- | PS
- | SVG
- | RenderOnly
- type RenderM a = StateT () Render a
- save :: RenderM ()
- restore :: RenderM ()
- renderC :: (Renderable a Cairo, V a ~ R2) => a -> RenderM ()
- cairoMiscStyle :: Style v -> RenderM ()
- fromFontSlant :: FontSlant -> FontSlant
- fromFontWeight :: FontWeight -> FontWeight
- cairoStrokeStyle :: Style v -> Render ()
- setSource :: Color c => c -> Style v -> Render ()
- cairoTransf :: T2 -> Render ()
- fromLineCap :: LineCap -> LineCap
- fromLineJoin :: LineJoin -> LineJoin
- fromFillRule :: FillRule -> FillRule
Documentation
This data declaration is simply used as a token to distinguish
the cairo backend: (1) when calling functions where the type
inference engine would otherwise have know way to know which
backend you wanted to use, and (2) as an argument to the
Backend
and Renderable
type classes.
data OutputType Source
Output types supported by cairo, including four different file types (PNG, PS, PDF, SVG). If you want to output directly to GTK windows, see the diagrams-gtk package.
PNG | Portable Network Graphics output. |
PS | PostScript output |
Portable Document Format output. | |
SVG | Scalable Vector Graphics output. |
RenderOnly | Don't output any file; the returned |
type RenderM a = StateT () Render aSource
The custom monad in which intermediate drawing options take
place; Render
is cairo's own rendering
monad. At one point RenderM
really did use StateT
, but then
the state got taken out... but the StateT
remains, now with a
zen-like state of type unit, "just in case". Think of it as a
good luck charm.
cairoMiscStyle :: Style v -> RenderM ()Source
Handle "miscellaneous" style attributes (clip, font stuff, fill color and fill rule).
cairoStrokeStyle :: Style v -> Render ()Source
Handle style attributes having to do with stroke.
cairoTransf :: T2 -> Render ()Source
Multiply the current transformation matrix by the given 2D transformation.
fromLineCap :: LineCap -> LineCapSource