-- GENERATED by C->Haskell Compiler, version 0.13.13 (gtk2hs branch) "Bin IO", 27 May 2012 (Haskell)
-- Edit the ORIGNAL .chs file instead!


{-# LINE 1 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  Graphics.Rendering.Cairo.Internal.Drawing.Patterns
-- Copyright   :  (c) Paolo Martini 2005
-- License     :  BSD-style (see cairo/COPYRIGHT)
--
-- Maintainer  :  p.martini@neuralnoise.com
-- Stability   :  experimental
-- Portability :  portable
--
-- Gradients and filtered sources.
-----------------------------------------------------------------------------

module Graphics.Rendering.Cairo.Internal.Drawing.Patterns where

import Graphics.Rendering.Cairo.Types
{-# LINE 16 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}

import Foreign
import Foreign.C


{-# LINE 21 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}

patternAddColorStopRGB :: Pattern -> Double -> Double -> Double -> Double -> IO ()
patternAddColorStopRGB a1 a2 a3 a4 a5 =
  let {a1' = unPattern a1} in 
  let {a2' = cFloatConv a2} in 
  let {a3' = cFloatConv a3} in 
  let {a4' = cFloatConv a4} in 
  let {a5' = cFloatConv a5} in 
  patternAddColorStopRGB'_ a1' a2' a3' a4' a5' >>= \res ->
  return ()
{-# LINE 23 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
patternAddColorStopRGBA :: Pattern -> Double -> Double -> Double -> Double -> Double -> IO ()
patternAddColorStopRGBA a1 a2 a3 a4 a5 a6 =
  let {a1' = unPattern a1} in 
  let {a2' = cFloatConv a2} in 
  let {a3' = cFloatConv a3} in 
  let {a4' = cFloatConv a4} in 
  let {a5' = cFloatConv a5} in 
  let {a6' = cFloatConv a6} in 
  patternAddColorStopRGBA'_ a1' a2' a3' a4' a5' a6' >>= \res ->
  return ()
{-# LINE 24 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
patternCreateRGB :: Double -> Double -> Double -> IO (Pattern)
patternCreateRGB a1 a2 a3 =
  let {a1' = cFloatConv a1} in 
  let {a2' = cFloatConv a2} in 
  let {a3' = cFloatConv a3} in 
  patternCreateRGB'_ a1' a2' a3' >>= \res ->
  let {res' = Pattern res} in
  return (res')
{-# LINE 25 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
patternCreateRGBA :: Double -> Double -> Double -> Double -> IO (Pattern)
patternCreateRGBA a1 a2 a3 a4 =
  let {a1' = cFloatConv a1} in 
  let {a2' = cFloatConv a2} in 
  let {a3' = cFloatConv a3} in 
  let {a4' = cFloatConv a4} in 
  patternCreateRGBA'_ a1' a2' a3' a4' >>= \res ->
  let {res' = Pattern res} in
  return (res')
{-# LINE 26 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
patternCreateForSurface :: Surface -> IO (Pattern)
patternCreateForSurface a1 =
  withSurface a1 $ \a1' -> 
  patternCreateForSurface'_ a1' >>= \res ->
  let {res' = Pattern res} in
  return (res')
{-# LINE 27 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
patternCreateLinear :: Double -> Double -> Double -> Double -> IO (Pattern)
patternCreateLinear a1 a2 a3 a4 =
  let {a1' = cFloatConv a1} in 
  let {a2' = cFloatConv a2} in 
  let {a3' = cFloatConv a3} in 
  let {a4' = cFloatConv a4} in 
  patternCreateLinear'_ a1' a2' a3' a4' >>= \res ->
  let {res' = Pattern res} in
  return (res')
{-# LINE 28 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
patternCreateRadial :: Double -> Double -> Double -> Double -> Double -> Double -> IO (Pattern)
patternCreateRadial a1 a2 a3 a4 a5 a6 =
  let {a1' = cFloatConv a1} in 
  let {a2' = cFloatConv a2} in 
  let {a3' = cFloatConv a3} in 
  let {a4' = cFloatConv a4} in 
  let {a5' = cFloatConv a5} in 
  let {a6' = cFloatConv a6} in 
  patternCreateRadial'_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = Pattern res} in
  return (res')
{-# LINE 29 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
patternDestroy :: Pattern -> IO ()
patternDestroy a1 =
  let {a1' = unPattern a1} in 
  patternDestroy'_ a1' >>= \res ->
  return ()
{-# LINE 30 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
patternReference :: Pattern -> IO (Pattern)
patternReference a1 =
  let {a1' = unPattern a1} in 
  patternReference'_ a1' >>= \res ->
  let {res' = Pattern res} in
  return (res')
{-# LINE 31 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
patternStatus :: Pattern -> IO (Status)
patternStatus a1 =
  let {a1' = unPattern a1} in 
  patternStatus'_ a1' >>= \res ->
  let {res' = cToEnum res} in
  return (res')
{-# LINE 32 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
patternSetExtend :: Pattern -> Extend -> IO ()
patternSetExtend a1 a2 =
  let {a1' = unPattern a1} in 
  let {a2' = cFromEnum a2} in 
  patternSetExtend'_ a1' a2' >>= \res ->
  return ()
{-# LINE 33 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
patternGetExtend :: Pattern -> IO (Extend)
patternGetExtend a1 =
  let {a1' = unPattern a1} in 
  patternGetExtend'_ a1' >>= \res ->
  let {res' = cToEnum res} in
  return (res')
{-# LINE 34 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
patternSetFilter :: Pattern -> Filter -> IO ()
patternSetFilter a1 a2 =
  let {a1' = unPattern a1} in 
  let {a2' = cFromEnum a2} in 
  patternSetFilter'_ a1' a2' >>= \res ->
  return ()
{-# LINE 35 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
patternGetFilter :: Pattern -> IO (Filter)
patternGetFilter a1 =
  let {a1' = unPattern a1} in 
  patternGetFilter'_ a1' >>= \res ->
  let {res' = cToEnum res} in
  return (res')
{-# LINE 36 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
patternSetMatrix :: Pattern -> Matrix -> IO ()
patternSetMatrix a1 a2 =
  let {a1' = unPattern a1} in 
  with a2 $ \a2' -> 
  patternSetMatrix'_ a1' a2' >>= \res ->
  return ()
{-# LINE 37 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
patternGetMatrix :: Pattern -> IO (Matrix)
patternGetMatrix a1 =
  let {a1' = unPattern a1} in 
  alloca $ \a2' -> 
  patternGetMatrix'_ a1' a2' >>= \res ->
  peek a2'>>= \a2'' -> 
  return (a2'')
{-# LINE 38 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}

foreign import ccall safe "cairo_pattern_add_color_stop_rgb"
  patternAddColorStopRGB'_ :: ((Ptr Pattern) -> (CDouble -> (CDouble -> (CDouble -> (CDouble -> (IO ()))))))

foreign import ccall safe "cairo_pattern_add_color_stop_rgba"
  patternAddColorStopRGBA'_ :: ((Ptr Pattern) -> (CDouble -> (CDouble -> (CDouble -> (CDouble -> (CDouble -> (IO ())))))))

foreign import ccall safe "cairo_pattern_create_rgb"
  patternCreateRGB'_ :: (CDouble -> (CDouble -> (CDouble -> (IO (Ptr Pattern)))))

foreign import ccall safe "cairo_pattern_create_rgba"
  patternCreateRGBA'_ :: (CDouble -> (CDouble -> (CDouble -> (CDouble -> (IO (Ptr Pattern))))))

foreign import ccall safe "cairo_pattern_create_for_surface"
  patternCreateForSurface'_ :: ((Ptr Surface) -> (IO (Ptr Pattern)))

foreign import ccall safe "cairo_pattern_create_linear"
  patternCreateLinear'_ :: (CDouble -> (CDouble -> (CDouble -> (CDouble -> (IO (Ptr Pattern))))))

foreign import ccall safe "cairo_pattern_create_radial"
  patternCreateRadial'_ :: (CDouble -> (CDouble -> (CDouble -> (CDouble -> (CDouble -> (CDouble -> (IO (Ptr Pattern))))))))

foreign import ccall safe "cairo_pattern_destroy"
  patternDestroy'_ :: ((Ptr Pattern) -> (IO ()))

foreign import ccall safe "cairo_pattern_reference"
  patternReference'_ :: ((Ptr Pattern) -> (IO (Ptr Pattern)))

foreign import ccall safe "cairo_pattern_status"
  patternStatus'_ :: ((Ptr Pattern) -> (IO CInt))

foreign import ccall safe "cairo_pattern_set_extend"
  patternSetExtend'_ :: ((Ptr Pattern) -> (CInt -> (IO ())))

foreign import ccall safe "cairo_pattern_get_extend"
  patternGetExtend'_ :: ((Ptr Pattern) -> (IO CInt))

foreign import ccall safe "cairo_pattern_set_filter"
  patternSetFilter'_ :: ((Ptr Pattern) -> (CInt -> (IO ())))

foreign import ccall safe "cairo_pattern_get_filter"
  patternGetFilter'_ :: ((Ptr Pattern) -> (IO CInt))

foreign import ccall safe "cairo_pattern_set_matrix"
  patternSetMatrix'_ :: ((Ptr Pattern) -> ((Ptr Matrix) -> (IO ())))

foreign import ccall safe "cairo_pattern_get_matrix"
  patternGetMatrix'_ :: ((Ptr Pattern) -> ((Ptr Matrix) -> (IO ())))