    -- 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 Graphics.Rendering.Cairo.Internal.Drawing.Paths ( CPath(..), pathDestroy, pathToList )

    import Foreign
    import Foreign.C

    {-# LINE 23 "./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 ->
      mkPattern res >>= \res' ->
      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 ->
      mkPattern res >>= \res' ->
      return (res')
    {-# LINE 26 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    patternGetRGBA :: Pattern -> IO (Status, Double, Double, Double, Double)
    patternGetRGBA a1 =
      withPattern a1 $ \a1' ->
      alloca $ \a2' ->
      alloca $ \a3' ->
      alloca $ \a4' ->
      alloca $ \a5' ->
      patternGetRGBA'_ a1' a2' a3' a4' a5' >>= \res ->
      peekFloatConv a2'>>= \a2'' ->
      peekFloatConv a3'>>= \a3'' ->
      peekFloatConv a4'>>= \a4'' ->
      peekFloatConv a5'>>= \a5'' ->
      let {res' = cToEnum res} in
      return (res', a2'', a3'', a4'', a5'')
    {-# 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 ->
      mkPattern res >>= \res' ->
      return (res')
    {-# LINE 29 "./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 ->
      mkPattern res >>= \res' ->
      return (res')
    {-# LINE 30 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    patternAddColorStopRGB :: Pattern -> Double -> Double -> Double -> Double -> IO ()
    patternAddColorStopRGB a1 a2 a3 a4 a5 =
      withPattern a1 $ \a1' ->
      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 31 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    patternAddColorStopRGBA :: Pattern -> Double -> Double -> Double -> Double -> Double -> IO ()
    patternAddColorStopRGBA a1 a2 a3 a4 a5 a6 =
      withPattern a1 $ \a1' ->
      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 32 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    patternGetColorStopCount :: Pattern -> IO (Status, Int)
    patternGetColorStopCount a1 =
      withPattern a1 $ \a1' ->
      alloca $ \a2' ->
      patternGetColorStopCount'_ a1' a2' >>= \res ->
      peekIntConv a2'>>= \a2'' ->
      let {res' = cToEnum res} in
      return (res', a2'')
    {-# LINE 33 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    patternGetColorStopRGBA :: Pattern -> Int -> IO (Status, Double, Double, Double, Double, Double)
    patternGetColorStopRGBA a1 a2 =
      withPattern a1 $ \a1' ->
      let {a2' = cIntConv a2} in
      alloca $ \a3' ->
      alloca $ \a4' ->
      alloca $ \a5' ->
      alloca $ \a6' ->
      alloca $ \a7' ->
      patternGetColorStopRGBA'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
      peekFloatConv a3'>>= \a3'' ->
      peekFloatConv a4'>>= \a4'' ->
      peekFloatConv a5'>>= \a5'' ->
      peekFloatConv a6'>>= \a6'' ->
      peekFloatConv a7'>>= \a7'' ->
      let {res' = cToEnum res} in
      return (res', a3'', a4'', a5'', a6'', a7'')
    {-# LINE 34 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    patternGetLinearPoints :: Pattern -> IO (Status, Double, Double, Double, Double)
    patternGetLinearPoints a1 =
      withPattern a1 $ \a1' ->
      alloca $ \a2' ->
      alloca $ \a3' ->
      alloca $ \a4' ->
      alloca $ \a5' ->
      patternGetLinearPoints'_ a1' a2' a3' a4' a5' >>= \res ->
      peekFloatConv a2'>>= \a2'' ->
      peekFloatConv a3'>>= \a3'' ->
      peekFloatConv a4'>>= \a4'' ->
      peekFloatConv a5'>>= \a5'' ->
      let {res' = cToEnum res} in
      return (res', a2'', a3'', a4'', a5'')
    {-# LINE 35 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    patternGetRadialCircles :: Pattern -> IO (Status, Double, Double, Double, Double, Double, Double)
    patternGetRadialCircles a1 =
      withPattern a1 $ \a1' ->
      alloca $ \a2' ->
      alloca $ \a3' ->
      alloca $ \a4' ->
      alloca $ \a5' ->
      alloca $ \a6' ->
      alloca $ \a7' ->
      patternGetRadialCircles'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
      peekFloatConv a2'>>= \a2'' ->
      peekFloatConv a3'>>= \a3'' ->
      peekFloatConv a4'>>= \a4'' ->
      peekFloatConv a5'>>= \a5'' ->
      peekFloatConv a6'>>= \a6'' ->
      peekFloatConv a7'>>= \a7'' ->
      let {res' = cToEnum res} in
      return (res', a2'', a3'', a4'', a5'', a6'', a7'')
    {-# LINE 36 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}

    patternCreateForSurface :: Surface -> IO (Pattern)
    patternCreateForSurface a1 =
      withSurface a1 $ \a1' ->
      patternCreateForSurface'_ a1' >>= \res ->
      mkPattern res >>= \res' ->
      return (res')
    {-# LINE 38 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}

    patternStatus :: Pattern -> IO (Status)
    patternStatus a1 =
      withPattern a1 $ \a1' ->
      patternStatus'_ a1' >>= \res ->
      let {res' = cToEnum res} in
      return (res')
    {-# LINE 40 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    patternGetType :: Pattern -> IO (PatternType)
    patternGetType a1 =
      withPattern a1 $ \a1' ->
      patternGetType'_ a1' >>= \res ->
      let {res' = cToEnum res} in
      return (res')
    {-# LINE 41 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}

    patternSetExtend :: Pattern -> Extend -> IO ()
    patternSetExtend a1 a2 =
      withPattern a1 $ \a1' ->
      let {a2' = cFromEnum a2} in
      patternSetExtend'_ a1' a2' >>= \res ->
      return ()
    {-# LINE 43 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    patternGetExtend :: Pattern -> IO (Extend)
    patternGetExtend a1 =
      withPattern a1 $ \a1' ->
      patternGetExtend'_ a1' >>= \res ->
      let {res' = cToEnum res} in
      return (res')
    {-# LINE 44 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    patternSetFilter :: Pattern -> Filter -> IO ()
    patternSetFilter a1 a2 =
      withPattern a1 $ \a1' ->
      let {a2' = cFromEnum a2} in
      patternSetFilter'_ a1' a2' >>= \res ->
      return ()
    {-# LINE 45 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    patternGetFilter :: Pattern -> IO (Filter)
    patternGetFilter a1 =
      withPattern a1 $ \a1' ->
      patternGetFilter'_ a1' >>= \res ->
      let {res' = cToEnum res} in
      return (res')
    {-# LINE 46 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    patternSetMatrix :: Pattern -> Matrix -> IO ()
    patternSetMatrix a1 a2 =
      withPattern a1 $ \a1' ->
      with a2 $ \a2' ->
      patternSetMatrix'_ a1' a2' >>= \res ->
      return ()
    {-# LINE 47 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    patternGetMatrix :: Pattern -> IO (Matrix)
    patternGetMatrix a1 =
      withPattern a1 $ \a1' ->
      alloca $ \a2' ->
      patternGetMatrix'_ a1' a2' >>= \res ->
      peek a2'>>= \a2'' ->
      return (a2'')
    {-# LINE 48 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}

    -- support for mesh patterns / tensor product patches
    patternCreateMesh :: IO (Pattern)
    patternCreateMesh =
      patternCreateMesh'_ >>= \res ->
      mkPattern res >>= \res' ->
      return (res')
    {-# LINE 53 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    meshPatternBeginPatch :: Pattern -> IO ()
    meshPatternBeginPatch a1 =
      withPattern a1 $ \a1' ->
      meshPatternBeginPatch'_ a1' >>= \res ->
      return ()
    {-# LINE 54 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    meshPatternEndPatch :: Pattern -> IO ()
    meshPatternEndPatch a1 =
      withPattern a1 $ \a1' ->
      meshPatternEndPatch'_ a1' >>= \res ->
      return ()
    {-# LINE 55 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    meshPatternMoveTo :: Pattern -> Double -> Double -> IO ()
    meshPatternMoveTo a1 a2 a3 =
      withPattern a1 $ \a1' ->
      let {a2' = cFloatConv a2} in
      let {a3' = cFloatConv a3} in
      meshPatternMoveTo'_ a1' a2' a3' >>= \res ->
      return ()
    {-# LINE 56 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    meshPatternLineTo :: Pattern -> Double -> Double -> IO ()
    meshPatternLineTo a1 a2 a3 =
      withPattern a1 $ \a1' ->
      let {a2' = cFloatConv a2} in
      let {a3' = cFloatConv a3} in
      meshPatternLineTo'_ a1' a2' a3' >>= \res ->
      return ()
    {-# LINE 57 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    meshPatternCurveTo :: Pattern -> Double -> Double -> Double -> Double -> Double -> Double -> IO ()
    meshPatternCurveTo a1 a2 a3 a4 a5 a6 a7 =
      withPattern a1 $ \a1' ->
      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
      let {a7' = cFloatConv a7} in
      meshPatternCurveTo'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
      return ()
    {-# LINE 58 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    meshPatternSetControlPoint :: Pattern -> Int -> Double -> Double -> IO ()
    meshPatternSetControlPoint a1 a2 a3 a4 =
      withPattern a1 $ \a1' ->
      let {a2' = fromIntegral a2} in
      let {a3' = cFloatConv a3} in
      let {a4' = cFloatConv a4} in
      meshPatternSetControlPoint'_ a1' a2' a3' a4' >>= \res ->
      return ()
    {-# LINE 59 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    meshPatternSetCornerColorRGB :: Pattern -> Int -> Double -> Double -> Double -> IO ()
    meshPatternSetCornerColorRGB a1 a2 a3 a4 a5 =
      withPattern a1 $ \a1' ->
      let {a2' = fromIntegral a2} in
      let {a3' = cFloatConv a3} in
      let {a4' = cFloatConv a4} in
      let {a5' = cFloatConv a5} in
      meshPatternSetCornerColorRGB'_ a1' a2' a3' a4' a5' >>= \res ->
      return ()
    {-# LINE 60 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    meshPatternSetCornerColorRGBA :: Pattern -> Int -> Double -> Double -> Double -> Double -> IO ()
    meshPatternSetCornerColorRGBA a1 a2 a3 a4 a5 a6 =
      withPattern a1 $ \a1' ->
      let {a2' = fromIntegral a2} in
      let {a3' = cFloatConv a3} in
      let {a4' = cFloatConv a4} in
      let {a5' = cFloatConv a5} in
      let {a6' = cFloatConv a6} in
      meshPatternSetCornerColorRGBA'_ a1' a2' a3' a4' a5' a6' >>= \res ->
      return ()
    {-# LINE 61 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    meshPatternGetPatchCount :: Pattern -> IO (Status, Int)
    meshPatternGetPatchCount a1 =
      withPattern a1 $ \a1' ->
      alloca $ \a2' ->
      meshPatternGetPatchCount'_ a1' a2' >>= \res ->
      peekIntConv a2'>>= \a2'' ->
      let {res' = cToEnum res} in
      return (res', a2'')
    {-# LINE 62 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    meshPatternGetPathC :: Pattern -> Int -> IO (CPath)
    meshPatternGetPathC a1 a2 =
      withPattern a1 $ \a1' ->
      let {a2' = fromIntegral a2} in
      meshPatternGetPathC'_ a1' a2' >>= \res ->
      let {res' = CPath res} in
      return (res')
    {-# LINE 63 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    meshPatternGetControlPoint :: Pattern -> Int -> Int -> IO (Status, Double, Double)
    meshPatternGetControlPoint a1 a2 a3 =
      withPattern a1 $ \a1' ->
      let {a2' = fromIntegral a2} in
      let {a3' = fromIntegral a3} in
      alloca $ \a4' ->
      alloca $ \a5' ->
      meshPatternGetControlPoint'_ a1' a2' a3' a4' a5' >>= \res ->
      peekFloatConv a4'>>= \a4'' ->
      peekFloatConv a5'>>= \a5'' ->
      let {res' = cToEnum res} in
      return (res', a4'', a5'')
    {-# LINE 64 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}
    meshPatternGetCornerColorRGBA :: Pattern -> Int -> Int -> IO (Status, Double, Double, Double, Double)
    meshPatternGetCornerColorRGBA a1 a2 a3 =
      withPattern a1 $ \a1' ->
      let {a2' = fromIntegral a2} in
      let {a3' = fromIntegral a3} in
      alloca $ \a4' ->
      alloca $ \a5' ->
      alloca $ \a6' ->
      alloca $ \a7' ->
      meshPatternGetCornerColorRGBA'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
      peekFloatConv a4'>>= \a4'' ->
      peekFloatConv a5'>>= \a5'' ->
      peekFloatConv a6'>>= \a6'' ->
      peekFloatConv a7'>>= \a7'' ->
      let {res' = cToEnum res} in
      return (res', a4'', a5'', a6'', a7'')
    {-# LINE 65 "./Graphics/Rendering/Cairo/Internal/Drawing/Patterns.chs" #-}

    meshPatternGetPath :: Pattern -> Int -> IO [PathElement]
    meshPatternGetPath pat n = do
       path <- meshPatternGetPathC pat n
       xs   <- pathToList path
       pathDestroy path
       return xs

    convertPathElement :: Pattern -> PathElement -> IO ()
    convertPathElement pat (MoveTo x y)                = meshPatternMoveTo  pat x y
    convertPathElement pat (LineTo x y)                = meshPatternLineTo  pat x y
    convertPathElement pat (CurveTo x1 y1 x2 y2 x3 y3) = meshPatternCurveTo pat x1 y1 x2 y2 x3 y3
    convertPathElement  _  ClosePath                   = return ()

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_create_rgb"
      patternCreateRGB'_ :: (CDouble -> (CDouble -> (CDouble -> (IO (Ptr Pattern)))))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_create_rgba"
      patternCreateRGBA'_ :: (CDouble -> (CDouble -> (CDouble -> (CDouble -> (IO (Ptr Pattern))))))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_get_rgba"
      patternGetRGBA'_ :: ((Ptr Pattern) -> ((Ptr CDouble) -> ((Ptr CDouble) -> ((Ptr CDouble) -> ((Ptr CDouble) -> (IO CInt))))))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_create_linear"
      patternCreateLinear'_ :: (CDouble -> (CDouble -> (CDouble -> (CDouble -> (IO (Ptr Pattern))))))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_create_radial"
      patternCreateRadial'_ :: (CDouble -> (CDouble -> (CDouble -> (CDouble -> (CDouble -> (CDouble -> (IO (Ptr Pattern))))))))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_add_color_stop_rgb"
      patternAddColorStopRGB'_ :: ((Ptr Pattern) -> (CDouble -> (CDouble -> (CDouble -> (CDouble -> (IO ()))))))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_add_color_stop_rgba"
      patternAddColorStopRGBA'_ :: ((Ptr Pattern) -> (CDouble -> (CDouble -> (CDouble -> (CDouble -> (CDouble -> (IO ())))))))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_get_color_stop_count"
      patternGetColorStopCount'_ :: ((Ptr Pattern) -> ((Ptr CInt) -> (IO CInt)))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_get_color_stop_rgba"
      patternGetColorStopRGBA'_ :: ((Ptr Pattern) -> (CInt -> ((Ptr CDouble) -> ((Ptr CDouble) -> ((Ptr CDouble) -> ((Ptr CDouble) -> ((Ptr CDouble) -> (IO CInt))))))))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_get_linear_points"
      patternGetLinearPoints'_ :: ((Ptr Pattern) -> ((Ptr CDouble) -> ((Ptr CDouble) -> ((Ptr CDouble) -> ((Ptr CDouble) -> (IO CInt))))))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_get_radial_circles"
      patternGetRadialCircles'_ :: ((Ptr Pattern) -> ((Ptr CDouble) -> ((Ptr CDouble) -> ((Ptr CDouble) -> ((Ptr CDouble) -> ((Ptr CDouble) -> ((Ptr CDouble) -> (IO CInt))))))))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_create_for_surface"
      patternCreateForSurface'_ :: ((Ptr Surface) -> (IO (Ptr Pattern)))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_status"
      patternStatus'_ :: ((Ptr Pattern) -> (IO CInt))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_get_type"
      patternGetType'_ :: ((Ptr Pattern) -> (IO CInt))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_set_extend"
      patternSetExtend'_ :: ((Ptr Pattern) -> (CInt -> (IO ())))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_get_extend"
      patternGetExtend'_ :: ((Ptr Pattern) -> (IO CInt))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_set_filter"
      patternSetFilter'_ :: ((Ptr Pattern) -> (CInt -> (IO ())))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_get_filter"
      patternGetFilter'_ :: ((Ptr Pattern) -> (IO CInt))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_set_matrix"
      patternSetMatrix'_ :: ((Ptr Pattern) -> ((Ptr Matrix) -> (IO ())))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_get_matrix"
      patternGetMatrix'_ :: ((Ptr Pattern) -> ((Ptr Matrix) -> (IO ())))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_pattern_create_mesh"
      patternCreateMesh'_ :: (IO (Ptr Pattern))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_mesh_pattern_begin_patch"
      meshPatternBeginPatch'_ :: ((Ptr Pattern) -> (IO ()))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_mesh_pattern_end_patch"
      meshPatternEndPatch'_ :: ((Ptr Pattern) -> (IO ()))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_mesh_pattern_move_to"
      meshPatternMoveTo'_ :: ((Ptr Pattern) -> (CDouble -> (CDouble -> (IO ()))))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_mesh_pattern_line_to"
      meshPatternLineTo'_ :: ((Ptr Pattern) -> (CDouble -> (CDouble -> (IO ()))))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_mesh_pattern_curve_to"
      meshPatternCurveTo'_ :: ((Ptr Pattern) -> (CDouble -> (CDouble -> (CDouble -> (CDouble -> (CDouble -> (CDouble -> (IO ()))))))))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_mesh_pattern_set_control_point"
      meshPatternSetControlPoint'_ :: ((Ptr Pattern) -> (CUInt -> (CDouble -> (CDouble -> (IO ())))))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_mesh_pattern_set_corner_color_rgb"
      meshPatternSetCornerColorRGB'_ :: ((Ptr Pattern) -> (CUInt -> (CDouble -> (CDouble -> (CDouble -> (IO ()))))))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_mesh_pattern_set_corner_color_rgba"
      meshPatternSetCornerColorRGBA'_ :: ((Ptr Pattern) -> (CUInt -> (CDouble -> (CDouble -> (CDouble -> (CDouble -> (IO ())))))))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_mesh_pattern_get_patch_count"
      meshPatternGetPatchCount'_ :: ((Ptr Pattern) -> ((Ptr CUInt) -> (IO CInt)))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_mesh_pattern_get_path"
      meshPatternGetPathC'_ :: ((Ptr Pattern) -> (CUInt -> (IO (Ptr CPath))))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_mesh_pattern_get_control_point"
      meshPatternGetControlPoint'_ :: ((Ptr Pattern) -> (CUInt -> (CUInt -> ((Ptr CDouble) -> ((Ptr CDouble) -> (IO CInt))))))

    foreign import ccall safe "dist-ghc/build/Graphics/Rendering/Cairo/Internal/Drawing/Patterns.h cairo_mesh_pattern_get_corner_color_rgba"
      meshPatternGetCornerColorRGBA'_ :: ((Ptr Pattern) -> (CUInt -> (CUInt -> ((Ptr CDouble) -> ((Ptr CDouble) -> ((Ptr CDouble) -> ((Ptr CDouble) -> (IO CInt))))))))