-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | DSL to generate HTML5 Canvas javascript.
--   
--   A simple DSL for writing HTML5 Canvas in haskell and converting it to
--   Javascript. By static we mean non-interactive, so the parts of the
--   Canvas API that need to query the browser for run time information
--   like `isPointInPath(x, y)` are not included. This turns out to be a
--   surprisingly small part of HTML5 Canvas.
@package static-canvas
@version 0.2.0.3


-- | Functions to create color styles.
module Graphics.Static.ColorNames
aliceblue :: Style
antiquewhite :: Style
aqua :: Style
aquamarine :: Style
azure :: Style
beige :: Style
bisque :: Style
black :: Style
blanchedalmond :: Style
blue :: Style
blueviolet :: Style
brown :: Style
burlywood :: Style
cadetblue :: Style
chartreuse :: Style
chocolate :: Style
coral :: Style
cornflowerblue :: Style
cornsilk :: Style
crimson :: Style
cyan :: Style
darkblue :: Style
darkcyan :: Style
darkgoldenrod :: Style
darkgray :: Style
darkgreen :: Style
darkgrey :: Style
darkkhaki :: Style
darkmagenta :: Style
darkolivegreen :: Style
darkorange :: Style
darkorchid :: Style
darkred :: Style
darksalmon :: Style
darkseagreen :: Style
darkslateblue :: Style
darkslategray :: Style
darkslategrey :: Style
darkturquoise :: Style
darkviolet :: Style
deeppink :: Style
deepskyblue :: Style
dimgray :: Style
dimgrey :: Style
dodgerblue :: Style
firebrick :: Style
floralwhite :: Style
forestgreen :: Style
fuchsia :: Style
gainsboro :: Style
ghostwhite :: Style
gold :: Style
goldenrod :: Style
gray :: Style
grey :: Style
green :: Style
greenyellow :: Style
honeydew :: Style
hotpink :: Style
indianred :: Style
indigo :: Style
ivory :: Style
khaki :: Style
lavender :: Style
lavenderblush :: Style
lawngreen :: Style
lemonchiffon :: Style
lightblue :: Style
lightcoral :: Style
lightcyan :: Style
lightgoldenrodyellow :: Style
lightgray :: Style
lightgreen :: Style
lightgrey :: Style
lightpink :: Style
lightsalmon :: Style
lightseagreen :: Style
lightskyblue :: Style
lightslategray :: Style
lightslategrey :: Style
lightsteelblue :: Style
lightyellow :: Style
lime :: Style
limegreen :: Style
linen :: Style
magenta :: Style
maroon :: Style
mediumaquamarine :: Style
mediumblue :: Style
mediumorchid :: Style
mediumpurple :: Style
mediumseagreen :: Style
mediumslateblue :: Style
mediumspringgreen :: Style
mediumturquoise :: Style
mediumvioletred :: Style
midnightblue :: Style
mintcream :: Style
mistyrose :: Style
moccasin :: Style
navajowhite :: Style
navy :: Style
oldlace :: Style
olive :: Style
olivedrab :: Style
orange :: Style
orangered :: Style
orchid :: Style
palegoldenrod :: Style
palegreen :: Style
paleturquoise :: Style
palevioletred :: Style
papayawhip :: Style
peachpuff :: Style
peru :: Style
pink :: Style
plum :: Style
powderblue :: Style
purple :: Style
red :: Style
rosybrown :: Style
royalblue :: Style
saddlebrown :: Style
salmon :: Style
sandybrown :: Style
seagreen :: Style
seashell :: Style
sienna :: Style
silver :: Style
skyblue :: Style
slateblue :: Style
slategray :: Style
slategrey :: Style
snow :: Style
springgreen :: Style
steelblue :: Style
tan :: Style
teal :: Style
thistle :: Style
tomato :: Style
turquoise :: Style
violet :: Style
wheat :: Style
white :: Style
whitesmoke :: Style
yellow :: Style
yellowgreen :: Style


-- | A small DSL for creating HTML5 Canvas with haskell.
--   
--   
--   <pre>
--   module Main where
--   
--   import Graphics.Static
--   import Graphics.Static.ColorNames
--   
--   text :: CanvasFree ()
--   text = do
--     font "italic 60pt Calibri"
--     lineWidth 6
--     strokeStyle blue
--     fillStyle goldenrod
--     textBaseline TextBaselineMiddle
--     strokeText "Hello" 25 100 
--     fillText "Hello static-canvas!" 25 100
--   
--   main :: IO ()
--   main = writeCanvasDoc "example.html" 650 300 text
--   </pre>
--   
--   The static-canvas API shadows the actual Javascript API, and thus the
--   best place to look for a more detailed definition of the canvas
--   functions including the definitions of it's aruments see
--   <a>http://www.w3.org/TR/2dcontext/</a>.
module Graphics.Static

-- | Evaluate a static-canvas program and return the javascript code in a
--   <a>Builder</a>. The first parameter should be a unique identifier to
--   avoid name clashes with other canvas elements in the html document.
evalScript :: Text -> CanvasFree a -> Builder

-- | Create a <a>Builder</a> representing a canvas script.
buildScript :: Int -> Int -> CanvasFree () -> Builder

-- | More general version of <a>buildScript</a>, that takes a unique
--   identifier as an additional parameter so that multiple canvas elements
--   can be included in the same html document.
buildScript' :: Int -> Int -> Text -> CanvasFree () -> Builder

-- | Create a <a>Builder</a> representing a canvas document.
buildDoc :: Int -> Int -> CanvasFree () -> Builder

-- | Write a canvas script element to a file.
writeCanvasScript :: FilePath -> Int -> Int -> CanvasFree () -> IO ()

-- | More general version of <a>writeCanvasScript</a>, that takes a unique
--   identifier as an additional parameter so that multiple canvas elements
--   can be included in the same html document.
writeCanvasScript' :: FilePath -> Int -> Int -> Text -> CanvasFree () -> IO ()

-- | Write a canvas document to a file.
writeCanvasDoc :: FilePath -> Int -> Int -> CanvasFree () -> IO ()
type CanvasFree = F Canvas
beginPath :: CanvasFree ()
closePath :: CanvasFree ()
fill :: CanvasFree ()
stroke :: CanvasFree ()
clip :: CanvasFree ()
moveTo :: Double -> Double -> CanvasFree ()
lineTo :: Double -> Double -> CanvasFree ()

-- | A quadratic bezier curve.
quadraticCurveTo :: Double -> Double -> Double -> Double -> CanvasFree ()

-- | Cubic Bezier curve.
bezierCurveTo :: Double -> Double -> Double -> Double -> Double -> Double -> CanvasFree ()
arcTo :: Double -> Double -> Double -> Double -> Double -> CanvasFree ()
arc :: Double -> Double -> Double -> Double -> Double -> Bool -> CanvasFree ()
rect :: Double -> Double -> Double -> Double -> CanvasFree ()

-- | Set the line width.
lineWidth :: Double -> CanvasFree ()
lineCap :: LineCapStyle -> CanvasFree ()
lineJoin :: LineJoinStyle -> CanvasFree ()
miterLimit :: Double -> CanvasFree ()
data LineCapStyle
LineCapButt :: LineCapStyle
LineCapRound :: LineCapStyle
LineCapSquare :: LineCapStyle
data LineJoinStyle
LineJoinMiter :: LineJoinStyle
LineJoinRound :: LineJoinStyle
LineJoinBevel :: LineJoinStyle
strokeStyle :: Style -> CanvasFree ()
fillStyle :: Style -> CanvasFree ()
shadowOffsetX :: Double -> CanvasFree ()
shadowOffsetY :: Double -> CanvasFree ()
shadowBlur :: Double -> CanvasFree ()
shadowColor :: Color -> CanvasFree ()
createLinearGradient :: Double -> Double -> Double -> Double -> CanvasFree Style
createRadialGradient :: Double -> Double -> Double -> Double -> Double -> Double -> CanvasFree Style
addColorStop :: Double -> Color -> Style -> CanvasFree ()
data Gradient
LG :: !Int -> Gradient
RG :: !Int -> Gradient
createPattern :: Int -> RepeatStyle -> CanvasFree Style

-- | For use with <tt>createPattern</tt>
data RepeatStyle
Repeat :: RepeatStyle
RepeatX :: RepeatStyle
RepeatY :: RepeatStyle
NoRepeat :: RepeatStyle
data Color
Hex :: Text -> Color
RGB :: !Int -> !Int -> !Int -> Color
RGBA :: !Int -> !Int -> !Int -> !Double -> Color
data Style
ColorStyle :: Color -> Style
GradientStyle :: Gradient -> Style
PatternStyle :: !Int -> Style
rgb :: Int -> Int -> Int -> Style
rgba :: Int -> Int -> Int -> Double -> Style
font :: Text -> CanvasFree ()
textAlign :: TextAlignStyle -> CanvasFree ()
textBaseline :: TextBaselineStyle -> CanvasFree ()
fillText :: Text -> Double -> Double -> CanvasFree ()
strokeText :: Text -> Double -> Double -> CanvasFree ()
data TextAlignStyle
TextAlignStart :: TextAlignStyle
TextAlignEnd :: TextAlignStyle
TextAlignCenter :: TextAlignStyle
TextAlignLeft :: TextAlignStyle
TextAlignRight :: TextAlignStyle
data TextBaselineStyle
TextBaselineTop :: TextBaselineStyle
TextBaselineHanging :: TextBaselineStyle
TextBaselineMiddle :: TextBaselineStyle
TextBaselineIdeographic :: TextBaselineStyle
TextBaselineBottom :: TextBaselineStyle
clearRect :: Double -> Double -> Double -> Double -> CanvasFree ()
fillRect :: Double -> Double -> Double -> Double -> CanvasFree ()
strokeRect :: Double -> Double -> Double -> Double -> CanvasFree ()

-- | Push the current state onto the stack.
save :: CanvasFree ()

-- | Pop the top state of the stack.
restore :: CanvasFree ()
scale :: Double -> Double -> CanvasFree ()
rotate :: Double -> CanvasFree ()
translate :: Double -> Double -> CanvasFree ()
transform :: Double -> Double -> Double -> Double -> Double -> Double -> CanvasFree ()
setTransform :: Double -> Double -> Double -> Double -> Double -> Double -> CanvasFree ()
drawImageAt :: Int -> Double -> Double -> CanvasFree ()
drawImageSize :: Int -> Double -> Double -> Double -> Double -> CanvasFree ()
drawImageCrop :: Int -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> CanvasFree ()
newImage :: Text -> CanvasFree Int

-- | Useful for commands that need to wait for an image to load before
--   being called. For example
--   
--   <pre>
--   image = do
--   img &lt;- newImage "http://www.staticcanvas.com/picture.png"
--   onImageLoad img (drawImageAt img 0 0)
--   </pre>
onImageLoad :: Int -> CanvasFree () -> CanvasFree ()
globalAlpha :: Double -> CanvasFree ()
globalCompositeOperation :: CompositeOperation -> CanvasFree ()
data CompositeOperation
SourceAtop :: CompositeOperation
SourceIn :: CompositeOperation
SourceOut :: CompositeOperation
SourceOver :: CompositeOperation
DestinationAtop :: CompositeOperation
DestinationIn :: CompositeOperation
DestinationOut :: CompositeOperation
DestinationOver :: CompositeOperation
Darker :: CompositeOperation
Xor :: CompositeOperation
Copy :: CompositeOperation
