    -- 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/Surfaces/Surface.chs" #-}
    -----------------------------------------------------------------------------
    -- |
    -- Module      :  GI.Cairo.Render.Internal.Surfaces.Surface
    -- Copyright   :  (c) Paolo Martini 2005
    -- License     :  BSD-style (see doc/COPYRIGHT)
    --
    -- Maintainer  :  p.martini@neuralnoise.com
    -- Stability   :  experimental
    -- Portability :  portable
    --
    -- Base class for surfaces.
    -----------------------------------------------------------------------------

    module GI.Cairo.Render.Internal.Surfaces.Surface where
    import qualified Foreign.C.Types as C2HSImp

    import GI.Cairo.Render.Types
    {-# LINE 18 "./GI/Cairo/Render/Internal/Surfaces/Surface.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/Surfaces/Surface.chs" #-}

    surfaceCreateSimilar :: (Surface) -> (Content) -> (Int) -> (Int) -> IO ((Surface))
    surfaceCreateSimilar :: Surface -> Content -> Int -> Int -> IO Surface
    surfaceCreateSimilar Surface
    a1 Content
    a2 Int
    a3 Int
    a4 =
      Surface -> (Ptr Surface -> IO Surface) -> IO Surface
    forall {b}. Surface -> (Ptr Surface -> IO b) -> IO b
    withSurface Surface
    a1 ((Ptr Surface -> IO Surface) -> IO Surface)
    -> (Ptr Surface -> IO Surface) -> IO Surface
    forall a b. (a -> b) -> a -> b
    $ \Ptr Surface
    a1' ->
      let {a2' :: CInt
    a2' = Content -> CInt
    forall e i. (Enum e, Integral i) => e -> i
    cFromEnum a2} in
      let {a3' = fromIntegral a3} in
      let {a4' = fromIntegral a4} in
      surfaceCreateSimilar'_ a1' a2' a3' a4' >>= \res ->
      mkSurface res >>= \res' ->
      return (res')

    {-# LINE 28 "./GI/Cairo/Render/Internal/Surfaces/Surface.chs" #-}

    surfaceDestroy :: (Surface) -> IO ()
    surfaceDestroy a1 =
      withSurface a1 $ \a1' ->
      surfaceDestroy'_ a1' >>
      return ()

    {-# LINE 29 "./GI/Cairo/Render/Internal/Surfaces/Surface.chs" #-}

    surfaceFinish :: (Surface) -> IO ()
    surfaceFinish a1 =
      withSurface a1 $ \a1' ->
      surfaceFinish'_ a1' >>
      return ()

    {-# LINE 30 "./GI/Cairo/Render/Internal/Surfaces/Surface.chs" #-}

    surfaceFlush :: (Surface) -> IO ()
    surfaceFlush a1 =
      withSurface a1 $ \a1' ->
      surfaceFlush'_ a1' >>
      return ()

    {-# LINE 31 "./GI/Cairo/Render/Internal/Surfaces/Surface.chs" #-}

    surfaceGetFontOptions :: (Surface) -> (FontOptions) -> IO ()
    surfaceGetFontOptions a1 a2 =
      withSurface a1 $ \a1' ->
      withFontOptions a2 $ \a2' ->
      surfaceGetFontOptions'_ a1' a2' >>
      return ()

    {-# LINE 32 "./GI/Cairo/Render/Internal/Surfaces/Surface.chs" #-}

    surfaceGetContent :: (Surface) -> IO ((Content))
    surfaceGetContent a1 =
      withSurface a1 $ \a1' ->
      surfaceGetContent'_ a1' >>= \res ->
      let {res' = cToEnum res} in
      return (res')

    {-# LINE 33 "./GI/Cairo/Render/Internal/Surfaces/Surface.chs" #-}

    surfaceMarkDirty :: (Surface) -> IO ()
    surfaceMarkDirty a1 =
      withSurface a1 $ \a1' ->
      surfaceMarkDirty'_ a1' >>
      return ()

    {-# LINE 34 "./GI/Cairo/Render/Internal/Surfaces/Surface.chs" #-}

    surfaceMarkDirtyRectangle :: (Surface) -> (Int) -> (Int) -> (Int) -> (Int) -> IO ()
    surfaceMarkDirtyRectangle a1 a2 a3 a4 a5 =
      withSurface a1 $ \a1' ->
      let {a2' = fromIntegral a2} in
      let {a3' = fromIntegral a3} in
      let {a4' = fromIntegral a4} in
      let {a5' = fromIntegral a5} in
      surfaceMarkDirtyRectangle'_ a1' a2' a3' a4' a5' >>
      return ()

    {-# LINE 35 "./GI/Cairo/Render/Internal/Surfaces/Surface.chs" #-}

    surfaceReference :: (Surface) -> IO ()
    surfaceReference a1 =
      withSurface a1 $ \a1' ->
      surfaceReference'_ a1' >>
      return ()

    {-# LINE 36 "./GI/Cairo/Render/Internal/Surfaces/Surface.chs" #-}

    surfaceSetDeviceOffset :: (Surface) -> (Double) -> (Double) -> IO ()
    surfaceSetDeviceOffset a1 a2 a3 =
      withSurface a1 $ \a1' ->
      let {a2' = realToFrac a2} in
      let {a3' = realToFrac a3} in
      surfaceSetDeviceOffset'_ a1' a2' a3' >>
      return ()

    {-# LINE 37 "./GI/Cairo/Render/Internal/Surfaces/Surface.chs" #-}

    surfaceStatus :: (Surface) -> IO ((Status))
    surfaceStatus a1 =
      withSurface a1 $ \a1' ->
      surfaceStatus'_ a1' >>= \res ->
      let {res' = cToEnum res} in
      return (res')

    {-# LINE 38 "./GI/Cairo/Render/Internal/Surfaces/Surface.chs" #-}

    foreign import ccall safe "GI/Cairo/Render/Internal/Surfaces/Surface.chs.h cairo_surface_create_similar"
      surfaceCreateSimilar'_ :: ((SurfacePtr) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO (SurfacePtr))))))

    foreign import ccall safe "GI/Cairo/Render/Internal/Surfaces/Surface.chs.h cairo_surface_destroy"
      surfaceDestroy'_ :: ((SurfacePtr) -> (IO ()))

    foreign import ccall safe "GI/Cairo/Render/Internal/Surfaces/Surface.chs.h cairo_surface_finish"
      surfaceFinish'_ :: ((SurfacePtr) -> (IO ()))

    foreign import ccall safe "GI/Cairo/Render/Internal/Surfaces/Surface.chs.h cairo_surface_flush"
      surfaceFlush'_ :: ((SurfacePtr) -> (IO ()))

    foreign import ccall safe "GI/Cairo/Render/Internal/Surfaces/Surface.chs.h cairo_surface_get_font_options"
      surfaceGetFontOptions'_ :: ((SurfacePtr) -> ((FontOptionsPtr) -> (IO ())))

    foreign import ccall safe "GI/Cairo/Render/Internal/Surfaces/Surface.chs.h cairo_surface_get_content"
      surfaceGetContent'_ :: ((SurfacePtr) -> (IO C2HSImp.CInt))

    foreign import ccall safe "GI/Cairo/Render/Internal/Surfaces/Surface.chs.h cairo_surface_mark_dirty"
      surfaceMarkDirty'_ :: ((SurfacePtr) -> (IO ()))

    foreign import ccall safe "GI/Cairo/Render/Internal/Surfaces/Surface.chs.h cairo_surface_mark_dirty_rectangle"
      surfaceMarkDirtyRectangle'_ :: ((SurfacePtr) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO ()))))))

    foreign import ccall safe "GI/Cairo/Render/Internal/Surfaces/Surface.chs.h cairo_surface_reference"
      surfaceReference'_ :: ((SurfacePtr) -> (IO (SurfacePtr)))

    foreign import ccall safe "GI/Cairo/Render/Internal/Surfaces/Surface.chs.h cairo_surface_set_device_offset"
      surfaceSetDeviceOffset'_ :: ((SurfacePtr) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO ()))))

    foreign import ccall safe "GI/Cairo/Render/Internal/Surfaces/Surface.chs.h cairo_surface_status"
      surfaceStatus'_ :: ((SurfacePtr) -> (IO C2HSImp.CInt))