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


{-# LINE 1 "src/Graphics/UI/FLTK/LowLevel/CopySurface.chs" #-}
{-# LANGUAGE CPP, ExistentialQuantification, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts, ScopedTypeVariables, UndecidableInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Graphics.UI.FLTK.LowLevel.CopySurface
       (
         copySurfaceNew
         -- * Hierarchy
         --
         -- $hierarchy

         -- * CopySurface
         --
         -- $functions
       )
where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.Ptr as C2HSImp





import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)
import Graphics.UI.FLTK.LowLevel.Fl_Types
import Graphics.UI.FLTK.LowLevel.Utils
import Graphics.UI.FLTK.LowLevel.Hierarchy
import Graphics.UI.FLTK.LowLevel.Dispatch

copySurfaceNew' :: (Int) -> (Int) -> IO ((Ptr ()))
copySurfaceNew' a1 a2 =
  let {a1' = fromIntegral a1} in
  let {a2' = fromIntegral a2} in
  copySurfaceNew''_ a1' a2' >>= \res ->
  let {res' = id res} in
  return (res')

{-# LINE 24 "src/Graphics/UI/FLTK/LowLevel/CopySurface.chs" #-}

copySurfaceNew :: Size -> IO (Ref CopySurface)
copySurfaceNew (Size (Width w') (Height h')) = copySurfaceNew' w' h' >>= toRef

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

{-# LINE 28 "src/Graphics/UI/FLTK/LowLevel/CopySurface.chs" #-}

instance (impl ~ (IO ())) => Op (Destroy ()) CopySurface orig impl where
  runOp _ _ copy_surface = withRef copy_surface $ \copy_surfacePtr -> copySurfaceDestroy' copy_surfacePtr

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

{-# LINE 32 "src/Graphics/UI/FLTK/LowLevel/CopySurface.chs" #-}

instance (impl ~ ( IO ())) => Op (SetCurrent ()) CopySurface orig impl where
  runOp _ _ copy_surface = withRef copy_surface $ \copy_surfacePtr -> setCurrent' copy_surfacePtr

draw' :: (Ptr ()) -> (Ptr ()) -> (Int) -> (Int) -> IO ()
draw' a1 a2 a3 a4 =
  let {a1' = id a1} in
  let {a2' = id a2} in
  let {a3' = fromIntegral a3} in
  let {a4' = fromIntegral a4} in
  draw''_ a1' a2' a3' a4' >>
  return ()

{-# LINE 36 "src/Graphics/UI/FLTK/LowLevel/CopySurface.chs" #-}

instance (Parent a WidgetBase, impl ~ ( Ref a  -> Position -> IO ())) => Op (Draw ()) CopySurface orig impl where
  runOp _ _ copy_surface widget (Position (X delta_x) (Y delta_y)) = withRef copy_surface $ \copy_surfacePtr -> withRef widget $ \widgetPtr -> draw' copy_surfacePtr widgetPtr delta_x delta_y

-- $functions
--
-- @
-- destroy :: 'Ref' 'CopySurface' -> 'IO' ()
--
-- draw:: ('Parent' a 'Widget') => 'Ref' 'CopySurface' -> 'Ref' a -> 'Position' -> 'IO' ()
--
-- setCurrent :: 'Ref' 'CopySurface' -> 'IO' ()
-- @

-- $hierarchy
-- @
-- "Graphics.UI.FLTK.LowLevel.CopySurface"
-- @

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/CopySurface.chs.h Fl_Copy_Surface_New"
  copySurfaceNew''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (IO (C2HSImp.Ptr ()))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/CopySurface.chs.h Fl_Copy_Surface_Destroy"
  copySurfaceDestroy''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/CopySurface.chs.h Fl_Copy_Surface_set_current"
  setCurrent''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/CopySurface.chs.h Fl_Copy_Surface_draw"
  draw''_ :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO ())))))