{-# LINE 1 "src/Graphics/UI/FLTK/LowLevel/BMPImage.chs" #-}
{-# LANGUAGE CPP, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Graphics.UI.FLTK.LowLevel.BMPImage
(
bmpImageNew
)
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.RGBImage
import qualified Data.Text as T
bmpImageNew' :: (CString) -> IO ((Ptr ()))
bmpImageNew' a1 =
(flip ($)) a1 $ \a1' ->
bmpImageNew''_ a1' >>= \res ->
let {res' = forall a. a -> a
id Ptr ()
res} in
Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr ()
res')
{-# LINE 21 "src/Graphics/UI/FLTK/LowLevel/BMPImage.chs" #-}
bmpImageNew :: T.Text -> IO (Either UnknownError (Ref BMPImage))
bmpImageNew filename' = do
ptr <- withText filename' bmpImageNew'
ref' <- (toRef ptr :: IO (Ref BMPImage))
checkImage ref'
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/BMPImage.chs.h Fl_BMP_Image_New"
bmpImageNew''_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> (IO (C2HSImp.Ptr ())))