{-# LINE 1 "src/Graphics/UI/FLTK/LowLevel/XPMImage.chs" #-}
{-# LANGUAGE CPP, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Graphics.UI.FLTK.LowLevel.XPMImage
(
xpmImageNew
)
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
xpmImageNew' :: (CString) -> IO ((Ptr ()))
xpmImageNew' a1 =
(flip ($)) a1 $ \a1' ->
xpmImageNew''_ 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/XPMImage.chs" #-}
xpmImageNew :: T.Text -> IO (Either UnknownError (Ref XPMImage))
xpmImageNew filename' = do
ptr <- withText filename' xpmImageNew'
ref' <- (toRef ptr :: IO (Ref XPMImage))
checkImage ref'
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/XPMImage.chs.h Fl_XPM_Image_New"
xpmImageNew''_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> (IO (C2HSImp.Ptr ())))