    -- GENERATED by C->Haskell Compiler, version 0.28.8 Switcheroo, 25 November 2017 (Haskell)
    -- Edit the ORIGNAL .chs file instead!

    {-# LINE 1 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}
    -----------------------------------------------------------------------------
    -- |
    -- Module      :  GI.Cairo.Render.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 GI.Cairo.Render.Internal.Drawing.Patterns where
    import qualified Foreign.C.Types as C2HSImp

    import GI.Cairo.Render.Types
    {-# LINE 18 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}

    import Foreign
    import Foreign.C
    import qualified Foreign.C.Types as C2HSImp
    import qualified Foreign.Ptr as C2HSImp
    import qualified Foreign.Storable as C2HSImp

    {-# LINE 26 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}

    patternAddColorStopRGB :: (Pattern) -> (Double) -> (Double) -> (Double) -> (Double) -> IO ()
    patternAddColorStopRGB :: Pattern -> Double -> Double -> Double -> Double -> IO ()
    patternAddColorStopRGB Pattern
    a1 Double
    a2 Double
    a3 Double
    a4 a5 =
      let {a1' = id a1} in
      let {a2' = realToFrac a2} in
      let {a3' = realToFrac a3} in
      let {a4' = realToFrac a4} in
      let {a5' = realToFrac a5} in
      patternAddColorStopRGB'_ a1' a2' a3' a4' a5' >>
      return ()

    {-# LINE 28 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}

    patternAddColorStopRGBA :: (Pattern) -> (Double) -> (Double) -> (Double) -> (Double) -> (Double) -> IO ()
    patternAddColorStopRGBA a1 a2 a3 a4 a5 a6 =
      let {a1' = id a1} in
      let {a2' = realToFrac a2} in
      let {a3' = realToFrac a3} in
      let {a4' = realToFrac a4} in
      let {a5' = realToFrac a5} in
      let {a6' = realToFrac a6} in
      patternAddColorStopRGBA'_ a1' a2' a3' a4' a5' a6' >>
      return ()

    {-# LINE 29 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}

    patternCreateRGB :: (Double) -> (Double) -> (Double) -> IO ((Pattern))
    patternCreateRGB a1 a2 a3 =
      let {a1' = realToFrac a1} in
      let {a2' = realToFrac a2} in
      let {a3' = realToFrac a3} in
      patternCreateRGB'_ a1' a2' a3' >>= \res ->
      let {res' = id res} in
      return (res')

    {-# LINE 30 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}

    patternCreateRGBA :: (Double) -> (Double) -> (Double) -> (Double) -> IO ((Pattern))
    patternCreateRGBA a1 a2 a3 a4 =
      let {a1' = realToFrac a1} in
      let {a2' = realToFrac a2} in
      let {a3' = realToFrac a3} in
      let {a4' = realToFrac a4} in
      patternCreateRGBA'_ a1' a2' a3' a4' >>= \res ->
      let {res' = id res} in
      return (res')

    {-# LINE 31 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}

    patternCreateForSurface :: (Surface) -> IO ((Pattern))
    patternCreateForSurface a1 =
      withSurface a1 $ \a1' ->
      patternCreateForSurface'_ a1' >>= \res ->
      let {res' = id res} in
      return (res')

    {-# LINE 32 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}

    patternCreateLinear :: (Double) -> (Double) -> (Double) -> (Double) -> IO ((Pattern))
    patternCreateLinear a1 a2 a3 a4 =
      let {a1' = realToFrac a1} in
      let {a2' = realToFrac a2} in
      let {a3' = realToFrac a3} in
      let {a4' = realToFrac a4} in
      patternCreateLinear'_ a1' a2' a3' a4' >>= \res ->
      let {res' = id res} in
      return (res')

    {-# LINE 33 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}

    patternCreateRadial :: (Double) -> (Double) -> (Double) -> (Double) -> (Double) -> (Double) -> IO ((Pattern))
    patternCreateRadial a1 a2 a3 a4 a5 a6 =
      let {a1' = realToFrac a1} in
      let {a2' = realToFrac a2} in
      let {a3' = realToFrac a3} in
      let {a4' = realToFrac a4} in
      let {a5' = realToFrac a5} in
      let {a6' = realToFrac a6} in
      patternCreateRadial'_ a1' a2' a3' a4' a5' a6' >>= \res ->
      let {res' = id res} in
      return (res')

    {-# LINE 34 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}

    patternDestroy :: (Pattern) -> IO ()
    patternDestroy a1 =
      let {a1' = id a1} in
      patternDestroy'_ a1' >>
      return ()

    {-# LINE 35 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}

    patternReference :: (Pattern) -> IO ((Pattern))
    patternReference a1 =
      let {a1' = id a1} in
      patternReference'_ a1' >>= \res ->
      let {res' = id res} in
      return (res')

    {-# LINE 36 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}

    patternStatus :: (Pattern) -> IO ((Status))
    patternStatus a1 =
      let {a1' = id a1} in
      patternStatus'_ a1' >>= \res ->
      let {res' = cToEnum res} in
      return (res')

    {-# LINE 37 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}

    patternSetExtend :: (Pattern) -> (Extend) -> IO ()
    patternSetExtend a1 a2 =
      let {a1' = id a1} in
      let {a2' = cFromEnum a2} in
      patternSetExtend'_ a1' a2' >>
      return ()

    {-# LINE 38 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}

    patternGetExtend :: (Pattern) -> IO ((Extend))
    patternGetExtend a1 =
      let {a1' = id a1} in
      patternGetExtend'_ a1' >>= \res ->
      let {res' = cToEnum res} in
      return (res')

    {-# LINE 39 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}

    patternSetFilter :: (Pattern) -> (Filter) -> IO ()
    patternSetFilter a1 a2 =
      let {a1' = id a1} in
      let {a2' = cFromEnum a2} in
      patternSetFilter'_ a1' a2' >>
      return ()

    {-# LINE 40 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}

    patternGetFilter :: (Pattern) -> IO ((Filter))
    patternGetFilter a1 =
      let {a1' = id a1} in
      patternGetFilter'_ a1' >>= \res ->
      let {res' = cToEnum res} in
      return (res')

    {-# LINE 41 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}

    patternSetMatrix :: (Pattern) -> (Matrix) -> IO ()
    patternSetMatrix a1 a2 =
      let {a1' = id a1} in
      with a2 $ \a2' ->
      patternSetMatrix'_ a1' a2' >>
      return ()

    {-# LINE 42 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}

    patternGetMatrix :: (Pattern) -> IO ((Matrix))
    patternGetMatrix a1 =
      let {a1' = id a1} in
      alloca $ \a2' ->
      patternGetMatrix'_ a1' a2' >>
      peek  a2'>>= \a2'' ->
      return (a2'')

    {-# LINE 43 "./GI/Cairo/Render/Internal/Drawing/Patterns.chs" #-}

    foreign import ccall safe "GI/Cairo/Render/Internal/Drawing/Patterns.chs.h cairo_pattern_add_color_stop_rgb"
      patternAddColorStopRGB'_ :: ((Pattern) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO ()))))))

    foreign import ccall safe "GI/Cairo/Render/Internal/Drawing/Patterns.chs.h cairo_pattern_add_color_stop_rgba"
      patternAddColorStopRGBA'_ :: ((Pattern) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO ())))))))

    foreign import ccall safe "GI/Cairo/Render/Internal/Drawing/Patterns.chs.h cairo_pattern_create_rgb"
      patternCreateRGB'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO (Pattern)))))

    foreign import ccall safe "GI/Cairo/Render/Internal/Drawing/Patterns.chs.h cairo_pattern_create_rgba"
      patternCreateRGBA'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO (Pattern))))))

    foreign import ccall safe "GI/Cairo/Render/Internal/Drawing/Patterns.chs.h cairo_pattern_create_for_surface"
      patternCreateForSurface'_ :: ((SurfacePtr) -> (IO (Pattern)))

    foreign import ccall safe "GI/Cairo/Render/Internal/Drawing/Patterns.chs.h cairo_pattern_create_linear"
      patternCreateLinear'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO (Pattern))))))

    foreign import ccall safe "GI/Cairo/Render/Internal/Drawing/Patterns.chs.h cairo_pattern_create_radial"
      patternCreateRadial'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO (Pattern))))))))

    foreign import ccall safe "GI/Cairo/Render/Internal/Drawing/Patterns.chs.h cairo_pattern_destroy"
      patternDestroy'_ :: ((Pattern) -> (IO ()))

    foreign import ccall safe "GI/Cairo/Render/Internal/Drawing/Patterns.chs.h cairo_pattern_reference"
      patternReference'_ :: ((Pattern) -> (IO (Pattern)))

    foreign import ccall safe "GI/Cairo/Render/Internal/Drawing/Patterns.chs.h cairo_pattern_status"
      patternStatus'_ :: ((Pattern) -> (IO C2HSImp.CInt))

    foreign import ccall safe "GI/Cairo/Render/Internal/Drawing/Patterns.chs.h cairo_pattern_set_extend"
      patternSetExtend'_ :: ((Pattern) -> (C2HSImp.CInt -> (IO ())))

    foreign import ccall safe "GI/Cairo/Render/Internal/Drawing/Patterns.chs.h cairo_pattern_get_extend"
      patternGetExtend'_ :: ((Pattern) -> (IO C2HSImp.CInt))

    foreign import ccall safe "GI/Cairo/Render/Internal/Drawing/Patterns.chs.h cairo_pattern_set_filter"
      patternSetFilter'_ :: ((Pattern) -> (C2HSImp.CInt -> (IO ())))

    foreign import ccall safe "GI/Cairo/Render/Internal/Drawing/Patterns.chs.h cairo_pattern_get_filter"
      patternGetFilter'_ :: ((Pattern) -> (IO C2HSImp.CInt))

    foreign import ccall safe "GI/Cairo/Render/Internal/Drawing/Patterns.chs.h cairo_pattern_set_matrix"
      patternSetMatrix'_ :: ((Pattern) -> ((MatrixPtr) -> (IO ())))

    foreign import ccall safe "GI/Cairo/Render/Internal/Drawing/Patterns.chs.h cairo_pattern_get_matrix"
      patternGetMatrix'_ :: ((Pattern) -> ((MatrixPtr) -> (IO ())))