-- GENERATED by C->Haskell Compiler, version 0.28.1 Switcheroo, 1 April 2016 (Haskell)
-- Edit the ORIGNAL .chs file instead!


{-# 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
     -- * Hierarchy
     --
     -- $hierarchy

    )
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' :: (T.Text) -> IO ((Ptr ()))
bmpImageNew' a1 =
  let {a1' = unsafeToCString a1} in 
  bmpImageNew''_ a1' >>= \res ->
  let {res' = id res} in
  return (res')

{-# LINE 21 "src/Graphics/UI/FLTK/LowLevel/BMPImage.chs" #-}

bmpImageNew :: T.Text -> IO (Either UnknownError (Ref BMPImage))
bmpImageNew filename' = do
  ptr <- bmpImageNew' filename'
  ref' <- (toRef ptr :: IO (Ref BMPImage))
  checkImage ref'

-- $hierarchy
-- @
-- "Graphics.UI.FLTK.LowLevel.Image"
--  |
--  v
-- "Graphics.UI.FLTK.LowLevel.RGBImage"
--  |
--  v
-- "Graphics.UI.FLTK.LowLevel.BMPImage"
-- @

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/BMPImage.chs.h Fl_BMP_Image_New"
  bmpImageNew''_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> (IO (C2HSImp.Ptr ())))