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


{-# LINE 1 "src/Graphics/UI/Font/LoadCWrapper.chs" #-}
{-# LANGUAGE CPP #-}
module Graphics.UI.Font.LoadCWrapper
  (
    loadFont
  , unloadFont
  )
where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.Ptr as C2HSImp


import Foreign.C.String
import Control.Applicative
import Foreign.C.Types

loadFont' :: (CString) -> IO ((CInt))
loadFont' a1 =
  (flip ($)) a1 $ \a1' ->
  loadFont''_ a1' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 12 "src/Graphics/UI/Font/LoadCWrapper.chs" #-}

loadFont :: CString -> IO (Either String ())
loadFont pathPtr = do
  res <- loadFont' pathPtr
  case res of
    0 -> return (Left "")
    _ -> return (Right ())
unloadFont :: (CString) -> IO ()
unloadFont a1 =
  (flip ($)) a1 $ \a1' ->
  unloadFont'_ a1' >>
  return ()

{-# LINE 19 "src/Graphics/UI/Font/LoadCWrapper.chs" #-}


foreign import ccall safe "Graphics/UI/Font/LoadCWrapper.chs.h load_private_font"
  loadFont''_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> (IO C2HSImp.CInt))

foreign import ccall safe "Graphics/UI/Font/LoadCWrapper.chs.h unload_private_font"
  unloadFont'_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> (IO ()))