{-# LINE 1 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
{-# LANGUAGE CPP, FlexibleContexts #-}
module Graphics.UI.FLTK.LowLevel.Gl
(
glStart,
glFinish,
glHeight,
glDescent,
glColor,
glRect,
glRectf,
glFont,
glWidth,
glWidthChars,
glWidthChar,
glDraw,
glDrawChars,
glDrawAt,
glDrawCharsAt,
glDrawInBox,
glMeasure,
glDrawImage
)
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.Fl_Enumerations
import Graphics.UI.FLTK.LowLevel.Utils
import qualified Data.Text as T
glStart :: IO ()
glStart =
glStart'_ >>
return ()
{-# LINE 31 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
glFinish :: IO ()
glFinish =
glFinish'_ >>
return ()
{-# LINE 32 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
glHeight :: IO ()
glHeight =
glHeight'_ >>
return ()
{-# LINE 33 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
glDescent :: IO ()
glDescent =
glDescent'_ >>
return ()
{-# LINE 34 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
glColor :: (Color) -> IO ()
glColor a1 =
let {a1' = cFromColor a1} in
glColor'_ a1' >>
return ()
{-# LINE 36 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
flcGlRect' :: (Int) -> (Int) -> (Int) -> (Int) -> IO ()
flcGlRect' a1 a2 a3 a4 =
let {a1' = fromIntegral a1} in
let {a2' = fromIntegral a2} in
let {a3' = fromIntegral a3} in
let {a4' = fromIntegral a4} in
flcGlRect''_ a1' a2' a3' a4' >>
return ()
{-# LINE 38 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
glRect :: Rectangle -> IO ()
glRect rectangle = let (x_pos', y_pos', width', height') = fromRectangle rectangle in flcGlRect' x_pos' y_pos' width' height'
flcGlRectf' :: (Int) -> (Int) -> (Int) -> (Int) -> IO ()
flcGlRectf' a1 a2 a3 a4 =
let {a1' = fromIntegral a1} in
let {a2' = fromIntegral a2} in
let {a3' = fromIntegral a3} in
let {a4' = fromIntegral a4} in
flcGlRectf''_ a1' a2' a3' a4' >>
return ()
{-# LINE 42 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
glRectf :: Rectangle -> IO ()
glRectf rectangle = let (x_pos', y_pos', width', height') = fromRectangle rectangle in flcGlRectf' x_pos' y_pos' width' height'
flcGlFont' :: (Font) -> (CInt) -> IO ()
flcGlFont' a1 a2 =
let {a1' = cFromFont a1} in
let {a2' = fromIntegral a2} in
flcGlFont''_ a1' a2' >>
return ()
{-# LINE 45 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
glFont :: Font -> FontSize -> IO ()
glFont fontid (FontSize size) = flcGlFont' fontid size
flcGlWidth' :: (CString) -> IO ((Double))
flcGlWidth' a1 =
(flip ($)) a1 $ \a1' ->
flcGlWidth''_ a1' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 49 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
glWidth :: T.Text -> IO (Double)
glWidth str = withText str flcGlWidth'
flcGlWidthWithN' :: (CString) -> (Int) -> IO ((Double))
flcGlWidthWithN' a1 a2 =
(flip ($)) a1 $ \a1' ->
let {a2' = fromIntegral a2} in
flcGlWidthWithN''_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 53 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
glWidthChars :: T.Text -> Int -> IO (Double)
glWidthChars str n = withText str (\s -> flcGlWidthWithN' s n)
flcGlWidthWithUcharStr' :: (Char) -> IO ((Double))
flcGlWidthWithUcharStr' a1 =
let {a1' = castCharToCUChar a1} in
flcGlWidthWithUcharStr''_ a1' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 57 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
glWidthChar :: Char -> IO (Double)
glWidthChar str = flcGlWidthWithUcharStr' str
flcGlDraw' :: (CString) -> IO ()
flcGlDraw' a1 =
(flip ($)) a1 $ \a1' ->
flcGlDraw''_ a1' >>
return ()
{-# LINE 61 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
glDraw :: T.Text -> IO ()
glDraw str = withText str flcGlDraw'
flcGlDrawWithN' :: (CString) -> (Int) -> IO ()
flcGlDrawWithN' a1 a2 =
(flip ($)) a1 $ \a1' ->
let {a2' = fromIntegral a2} in
flcGlDrawWithN''_ a1' a2' >>
return ()
{-# LINE 65 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
glDrawChars :: T.Text -> Int -> IO ()
glDrawChars str n = withText str (\s -> flcGlDrawWithN' s n)
flcGlDrawWithXy' :: (CString) -> (Float) -> (Float) -> IO ()
flcGlDrawWithXy' a1 a2 a3 =
(flip ($)) a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
flcGlDrawWithXy''_ a1' a2' a3' >>
return ()
{-# LINE 69 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
glDrawAt :: T.Text -> Float -> Float -> IO ()
glDrawAt str x y = withText str (\s -> flcGlDrawWithXy' s x y)
flcGlDrawWithNxy' :: (CString) -> (Int) -> (Float) -> (Float) -> IO ()
flcGlDrawWithNxy' a1 a2 a3 a4 =
(flip ($)) a1 $ \a1' ->
let {a2' = fromIntegral a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
flcGlDrawWithNxy''_ a1' a2' a3' a4' >>
return ()
{-# LINE 73 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
glDrawCharsAt :: T.Text -> Int -> Float -> Float -> IO ()
glDrawCharsAt str n x y = withText str (\s -> flcGlDrawWithNxy' s n x y)
flcGlDrawWithXywhAlign' :: (CString) -> (Int) -> (Int) -> (Int) -> (Int) -> (AlignType) -> IO ()
flcGlDrawWithXywhAlign' a1 a2 a3 a4 a5 a6 =
(flip ($)) a1 $ \a1' ->
let {a2' = fromIntegral a2} in
let {a3' = fromIntegral a3} in
let {a4' = fromIntegral a4} in
let {a5' = fromIntegral a5} in
let {a6' = cFromEnum a6} in
flcGlDrawWithXywhAlign''_ a1' a2' a3' a4' a5' a6' >>
return ()
{-# LINE 77 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
glDrawInBox :: T.Text -> Rectangle -> AlignType -> IO ()
glDrawInBox str rectangle align = let (x_pos', y_pos', width', height') = fromRectangle rectangle in withText str (\s -> flcGlDrawWithXywhAlign' s x_pos' y_pos' width' height' align)
flcGlMeasure' :: (CString) -> (Int) -> (Int) -> IO ()
flcGlMeasure' a1 a2 a3 =
(flip ($)) a1 $ \a1' ->
let {a2' = fromIntegral a2} in
let {a3' = fromIntegral a3} in
flcGlMeasure''_ a1' a2' a3' >>
return ()
{-# LINE 81 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
glMeasure :: T.Text -> Position -> IO ()
glMeasure str (Position (X x_pos') (Y y_pos')) = withText str (\s -> flcGlMeasure' s x_pos' y_pos')
flcGlDrawImageWithDLd' :: (Ptr CUChar) -> (Int) -> (Int) -> (Int) -> (Int) -> (Int) -> (Int) -> IO ()
flcGlDrawImageWithDLd' a1 a2 a3 a4 a5 a6 a7 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
let {a3' = fromIntegral a3} in
let {a4' = fromIntegral a4} in
let {a5' = fromIntegral a5} in
let {a6' = fromIntegral a6} in
let {a7' = fromIntegral a7} in
flcGlDrawImageWithDLd''_ a1' a2' a3' a4' a5' a6' a7' >>
return ()
{-# LINE 85 "src/Graphics/UI/FLTK/LowLevel/Gl.chs" #-}
glDrawImage :: BitmapHs -> Position -> Maybe Depth -> Maybe LineSize -> IO ()
glDrawImage bitmap' (Position (X x_pos') (Y y_pos')) depth' linesize' =
let d = maybe 0 (\(Depth d') -> d') depth'
l = maybe 0 (\(LineSize l') -> l') linesize'
in
withBitmap bitmap' $ \ptr width' height' -> flcGlDrawImageWithDLd' (castPtr ptr) x_pos' y_pos' width' height' d l
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Gl.chs.h flc_gl_start"
glStart'_ :: (IO ())
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Gl.chs.h flc_gl_finish"
glFinish'_ :: (IO ())
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Gl.chs.h flc_gl_height"
glHeight'_ :: (IO C2HSImp.CInt)
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Gl.chs.h flc_gl_descent"
glDescent'_ :: (IO C2HSImp.CInt)
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Gl.chs.h flc_gl_color"
glColor'_ :: (C2HSImp.CUInt -> (IO ()))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Gl.chs.h flc_gl_rect"
flcGlRect''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO ())))))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Gl.chs.h flc_gl_rectf"
flcGlRectf''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO ())))))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Gl.chs.h flc_gl_font"
flcGlFont''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (IO ())))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Gl.chs.h flc_gl_width"
flcGlWidth''_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> (IO C2HSImp.CDouble))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Gl.chs.h flc_gl_width_with_n"
flcGlWidthWithN''_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> (C2HSImp.CInt -> (IO C2HSImp.CDouble)))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Gl.chs.h flc_gl_width_with_uchar_str"
flcGlWidthWithUcharStr''_ :: (C2HSImp.CUChar -> (IO C2HSImp.CDouble))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Gl.chs.h flc_gl_draw"
flcGlDraw''_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> (IO ()))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Gl.chs.h flc_gl_draw_with_n"
flcGlDrawWithN''_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> (C2HSImp.CInt -> (IO ())))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Gl.chs.h flc_gl_draw_with_xy"
flcGlDrawWithXy''_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (IO ()))))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Gl.chs.h flc_gl_draw_with_nxy"
flcGlDrawWithNxy''_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> (C2HSImp.CInt -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (IO ())))))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Gl.chs.h flc_gl_draw_with_xywh_align"
flcGlDrawWithXywhAlign''_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (IO ())))))))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Gl.chs.h flc_gl_measure"
flcGlMeasure''_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO ()))))
foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Gl.chs.h flc_gl_draw_image_with_d_ld"
flcGlDrawImageWithDLd''_ :: ((C2HSImp.Ptr C2HSImp.CUChar) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO ()))))))))