module Graphics.UI.SDL.Primitives
( pixel
, hLine
, vLine
, rectangle
, circle
, box
, roundedBox
, line
, aaLine
, arc
, aaCircle
, filledCircle
, ellipse
, aaEllipse
, filledEllipse
, pie
, filledPie
, trigon
, filledTrigon
, aaTrigon
, polygon
, texturedPolygon
, filledPolygon
, aaPolygon
, bezier
) where
import Foreign as Foreign hiding (new)
import Foreign.C
import Graphics.UI.SDL.General
import Graphics.UI.SDL.Types
import Graphics.UI.SDL.Color
import Graphics.UI.SDL.Utilities (Enum(..), intToBool, toBitmask, fromCInt, toCInt)
foreign import ccall unsafe "pixelColor" gfxPixelColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Word32 -> IO CInt
pixel :: Surface -> Int16 -> Int16 -> Pixel -> IO Bool
pixel :: Surface -> Int16 -> Int16 -> Pixel -> IO Bool
pixel surface :: Surface
surface x :: Int16
x y :: Int16
y (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool (-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct -> Int16 -> Int16 -> Word32 -> IO CInt
gfxPixelColor Ptr SurfaceStruct
ptr Int16
x Int16
y Word32
w)
foreign import ccall unsafe "hlineColor" gfxHLineColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
hLine :: Surface -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
hLine :: Surface -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
hLine surface :: Surface
surface x1 :: Int16
x1 x2 :: Int16
x2 y :: Int16
y (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool (-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
gfxHLineColor Ptr SurfaceStruct
ptr Int16
x1 Int16
x2 Int16
y Word32
w)
foreign import ccall unsafe "vlineColor" gfxVLineColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
vLine :: Surface -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
vLine :: Surface -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
vLine surface :: Surface
surface x :: Int16
x y1 :: Int16
y1 y2 :: Int16
y2 (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool (-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
gfxVLineColor Ptr SurfaceStruct
ptr Int16
x Int16
y1 Int16
y2 Word32
w)
foreign import ccall unsafe "rectangleColor" gfxRectangleColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
rectangle :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
rectangle :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
rectangle surface :: Surface
surface x1 :: Int16
x1 y1 :: Int16
y1 x2 :: Int16
x2 y2 :: Int16
y2 (Pixel c :: Word32
c) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool (-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
gfxRectangleColor Ptr SurfaceStruct
ptr (Int16 -> Int16
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int16
x1) (Int16 -> Int16
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int16
y1) (Int16 -> Int16
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int16
x2) (Int16 -> Int16
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int16
y2) Word32
c)
foreign import ccall unsafe "boxColor" gfxBoxColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
box :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
box :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
box surface :: Surface
surface x1 :: Int16
x1 y1 :: Int16
y1 x2 :: Int16
x2 y2 :: Int16
y2 (Pixel c :: Word32
c) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool (-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
gfxBoxColor Ptr SurfaceStruct
ptr (Int16 -> Int16
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int16
x1) (Int16 -> Int16
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int16
y1) (Int16 -> Int16
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int16
x2) (Int16 -> Int16
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int16
y2) Word32
c)
foreign import ccall unsafe "roundedBoxColor" gfxRoundedBoxColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
roundedBox :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
roundedBox :: Surface
-> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
roundedBox surface :: Surface
surface x1 :: Int16
x1 y1 :: Int16
y1 x2 :: Int16
x2 y2 :: Int16
y2 rad :: Int16
rad (Pixel c :: Word32
c) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool (-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
gfxRoundedBoxColor Ptr SurfaceStruct
ptr (Int16 -> Int16
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int16
x1) (Int16 -> Int16
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int16
y1) (Int16 -> Int16
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int16
x2) (Int16 -> Int16
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int16
x2) Int16
rad Word32
c)
foreign import ccall unsafe "lineColor" gfxLineColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
line :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
line :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
line surface :: Surface
surface x :: Int16
x y :: Int16
y x' :: Int16
x' y' :: Int16
y' (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool (-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
gfxLineColor Ptr SurfaceStruct
ptr Int16
x Int16
y Int16
x' Int16
y' Word32
w)
foreign import ccall unsafe "aalineColor" gfxAALineColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
aaLine :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
aaLine :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
aaLine surface :: Surface
surface x :: Int16
x y :: Int16
y x' :: Int16
x' y' :: Int16
y' (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool (-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
gfxAALineColor Ptr SurfaceStruct
ptr Int16
x Int16
y Int16
x' Int16
y' Word32
w)
foreign import ccall unsafe "circleColor" gfxCircleColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
circle :: Surface -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
circle :: Surface -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
circle surface :: Surface
surface x :: Int16
x y :: Int16
y r :: Int16
r (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool (-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
gfxCircleColor Ptr SurfaceStruct
ptr Int16
x Int16
y Int16
r Word32
w)
foreign import ccall unsafe "arcColor" gfxArcColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
arc :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
arc :: Surface
-> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
arc surface :: Surface
surface x :: Int16
x y :: Int16
y r :: Int16
r s :: Int16
s e :: Int16
e (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool (-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
gfxArcColor Ptr SurfaceStruct
ptr Int16
x Int16
y Int16
r Int16
s Int16
e Word32
w)
foreign import ccall unsafe "aacircleColor" gfxAACircleColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
aaCircle :: Surface -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
aaCircle :: Surface -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
aaCircle surface :: Surface
surface x :: Int16
x y :: Int16
y r :: Int16
r (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool (-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
gfxAACircleColor Ptr SurfaceStruct
ptr Int16
x Int16
y Int16
r Word32
w)
foreign import ccall unsafe "filledCircleColor" gfxFilledCircleColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
filledCircle :: Surface -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
filledCircle :: Surface -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
filledCircle surface :: Surface
surface x :: Int16
x y :: Int16
y r :: Int16
r (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool (-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
gfxFilledCircleColor Ptr SurfaceStruct
ptr Int16
x Int16
y Int16
r Word32
w)
foreign import ccall unsafe "ellipseColor" gfxEllipseColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
ellipse :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
ellipse :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
ellipse surface :: Surface
surface x :: Int16
x y :: Int16
y rx :: Int16
rx ry :: Int16
ry (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool (-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
gfxEllipseColor Ptr SurfaceStruct
ptr Int16
x Int16
y Int16
rx Int16
ry Word32
w)
foreign import ccall unsafe "aaellipseColor" gfxAAEllipseColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
aaEllipse :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
aaEllipse :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
aaEllipse surface :: Surface
surface x :: Int16
x y :: Int16
y rx :: Int16
rx ry :: Int16
ry (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool (-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
gfxAAEllipseColor Ptr SurfaceStruct
ptr Int16
x Int16
y Int16
rx Int16
ry Word32
w)
foreign import ccall unsafe "filledEllipseColor" gfxFilledEllipseColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
filledEllipse :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
filledEllipse :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
filledEllipse surface :: Surface
surface x :: Int16
x y :: Int16
y rx :: Int16
rx ry :: Int16
ry (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool (-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
gfxFilledEllipseColor Ptr SurfaceStruct
ptr Int16
x Int16
y Int16
rx Int16
ry Word32
w)
foreign import ccall unsafe "pieColor" gfxPieColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
pie :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
pie :: Surface
-> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
pie surface :: Surface
surface x :: Int16
x y :: Int16
y r :: Int16
r s :: Int16
s e :: Int16
e (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool (-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
gfxPieColor Ptr SurfaceStruct
ptr Int16
x Int16
y Int16
r Int16
s Int16
e Word32
w)
foreign import ccall unsafe "filledPieColor" gfxFilledPieColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
filledPie :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
filledPie :: Surface
-> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
filledPie surface :: Surface
surface x :: Int16
x y :: Int16
y r :: Int16
r s :: Int16
s e :: Int16
e (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool (-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
gfxFilledPieColor Ptr SurfaceStruct
ptr Int16
x Int16
y Int16
r Int16
s Int16
e Word32
w)
foreign import ccall unsafe "trigonColor" gfxTrigonColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
trigon :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
trigon :: Surface
-> Int16
-> Int16
-> Int16
-> Int16
-> Int16
-> Int16
-> Pixel
-> IO Bool
trigon surface :: Surface
surface x1 :: Int16
x1 y1 :: Int16
y1 x2 :: Int16
x2 y2 :: Int16
y2 x3 :: Int16
x3 y3 :: Int16
y3 (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool(-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Int16
-> Int16
-> Int16
-> Int16
-> Int16
-> Int16
-> Word32
-> IO CInt
gfxTrigonColor Ptr SurfaceStruct
ptr Int16
x1 Int16
y1 Int16
x2 Int16
y2 Int16
x3 Int16
y3 Word32
w)
foreign import ccall unsafe "aatrigonColor" gfxAATrigonColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
aaTrigon :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
aaTrigon :: Surface
-> Int16
-> Int16
-> Int16
-> Int16
-> Int16
-> Int16
-> Pixel
-> IO Bool
aaTrigon surface :: Surface
surface x1 :: Int16
x1 y1 :: Int16
y1 x2 :: Int16
x2 y2 :: Int16
y2 x3 :: Int16
x3 y3 :: Int16
y3 (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool(-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Int16
-> Int16
-> Int16
-> Int16
-> Int16
-> Int16
-> Word32
-> IO CInt
gfxAATrigonColor Ptr SurfaceStruct
ptr Int16
x1 Int16
y1 Int16
x2 Int16
y2 Int16
x3 Int16
y3 Word32
w)
foreign import ccall unsafe "filledTrigonColor" gfxFilledTrigonColor :: Ptr SurfaceStruct -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Word32 -> IO CInt
filledTrigon :: Surface -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Pixel -> IO Bool
filledTrigon :: Surface
-> Int16
-> Int16
-> Int16
-> Int16
-> Int16
-> Int16
-> Pixel
-> IO Bool
filledTrigon surface :: Surface
surface x1 :: Int16
x1 y1 :: Int16
y1 x2 :: Int16
x2 y2 :: Int16
y2 x3 :: Int16
x3 y3 :: Int16
y3 (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Int -> IO Int -> IO Bool
intToBool(-1) ((CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Int16
-> Int16
-> Int16
-> Int16
-> Int16
-> Int16
-> Word32
-> IO CInt
gfxFilledTrigonColor Ptr SurfaceStruct
ptr Int16
x1 Int16
y1 Int16
x2 Int16
y2 Int16
x3 Int16
y3 Word32
w)
foreign import ccall unsafe "polygonColor" gfxPolygonColor :: Ptr SurfaceStruct -> Ptr Int16 -> Ptr Int16 -> Int -> Word32 -> IO CInt
polygon :: Surface -> [(Int16, Int16)] -> Pixel -> IO Bool
polygon :: Surface -> [(Int16, Int16)] -> Pixel -> IO Bool
polygon surface :: Surface
surface list :: [(Int16, Int16)]
list (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
[Int16] -> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b
withArray (((Int16, Int16) -> Int16) -> [(Int16, Int16)] -> [Int16]
forall a b. (a -> b) -> [a] -> [b]
map (Int16, Int16) -> Int16
forall a b. (a, b) -> a
fst [(Int16, Int16)]
list) ((Ptr Int16 -> IO Bool) -> IO Bool)
-> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \xs :: Ptr Int16
xs ->
[Int16] -> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b
withArray (((Int16, Int16) -> Int16) -> [(Int16, Int16)] -> [Int16]
forall a b. (a -> b) -> [a] -> [b]
map (Int16, Int16) -> Int16
forall a b. (a, b) -> b
snd [(Int16, Int16)]
list) ((Ptr Int16 -> IO Bool) -> IO Bool)
-> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ys :: Ptr Int16
ys ->
Int -> IO Int -> IO Bool
intToBool (-1) (IO Int -> IO Bool) -> IO Int -> IO Bool
forall a b. (a -> b) -> a -> b
$ (CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Ptr Int16 -> Ptr Int16 -> Int -> Word32 -> IO CInt
gfxPolygonColor Ptr SurfaceStruct
ptr Ptr Int16
xs Ptr Int16
ys ([(Int16, Int16)] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [(Int16, Int16)]
list) Word32
w
foreign import ccall unsafe "aapolygonColor" gfxAAPolygonColor :: Ptr SurfaceStruct -> Ptr Int16 -> Ptr Int16 -> Int -> Word32 -> IO CInt
aaPolygon :: Surface -> [(Int16, Int16)] -> Pixel -> IO Bool
aaPolygon :: Surface -> [(Int16, Int16)] -> Pixel -> IO Bool
aaPolygon surface :: Surface
surface list :: [(Int16, Int16)]
list (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
[Int16] -> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b
withArray (((Int16, Int16) -> Int16) -> [(Int16, Int16)] -> [Int16]
forall a b. (a -> b) -> [a] -> [b]
map (Int16, Int16) -> Int16
forall a b. (a, b) -> a
fst [(Int16, Int16)]
list) ((Ptr Int16 -> IO Bool) -> IO Bool)
-> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \xs :: Ptr Int16
xs ->
[Int16] -> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b
withArray (((Int16, Int16) -> Int16) -> [(Int16, Int16)] -> [Int16]
forall a b. (a -> b) -> [a] -> [b]
map (Int16, Int16) -> Int16
forall a b. (a, b) -> b
snd [(Int16, Int16)]
list) ((Ptr Int16 -> IO Bool) -> IO Bool)
-> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ys :: Ptr Int16
ys ->
Int -> IO Int -> IO Bool
intToBool (-1) (IO Int -> IO Bool) -> IO Int -> IO Bool
forall a b. (a -> b) -> a -> b
$ (CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Ptr Int16 -> Ptr Int16 -> Int -> Word32 -> IO CInt
gfxAAPolygonColor Ptr SurfaceStruct
ptr Ptr Int16
xs Ptr Int16
ys ([(Int16, Int16)] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [(Int16, Int16)]
list) Word32
w
foreign import ccall unsafe "filledPolygonColor" gfxFilledPolygonColor :: Ptr SurfaceStruct -> Ptr Int16 -> Ptr Int16 -> Int -> Word32 -> IO CInt
filledPolygon :: Surface -> [(Int16, Int16)] -> Pixel -> IO Bool
filledPolygon :: Surface -> [(Int16, Int16)] -> Pixel -> IO Bool
filledPolygon surface :: Surface
surface list :: [(Int16, Int16)]
list (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
[Int16] -> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b
withArray (((Int16, Int16) -> Int16) -> [(Int16, Int16)] -> [Int16]
forall a b. (a -> b) -> [a] -> [b]
map (Int16, Int16) -> Int16
forall a b. (a, b) -> a
fst [(Int16, Int16)]
list) ((Ptr Int16 -> IO Bool) -> IO Bool)
-> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \xs :: Ptr Int16
xs ->
[Int16] -> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b
withArray (((Int16, Int16) -> Int16) -> [(Int16, Int16)] -> [Int16]
forall a b. (a -> b) -> [a] -> [b]
map (Int16, Int16) -> Int16
forall a b. (a, b) -> b
snd [(Int16, Int16)]
list) ((Ptr Int16 -> IO Bool) -> IO Bool)
-> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ys :: Ptr Int16
ys ->
Int -> IO Int -> IO Bool
intToBool (-1) (IO Int -> IO Bool) -> IO Int -> IO Bool
forall a b. (a -> b) -> a -> b
$ (CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Ptr Int16 -> Ptr Int16 -> Int -> Word32 -> IO CInt
gfxFilledPolygonColor Ptr SurfaceStruct
ptr Ptr Int16
xs Ptr Int16
ys ([(Int16, Int16)] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [(Int16, Int16)]
list) Word32
w
foreign import ccall unsafe "texturedPolygon" gfxTexturedPolygon :: Ptr SurfaceStruct -> Ptr Int16 -> Ptr Int16 -> Int -> Ptr SurfaceStruct -> Int -> Int -> IO CInt
texturedPolygon :: Surface -> [(Int16, Int16)] -> Surface -> Int -> Int -> IO Bool
texturedPolygon :: Surface -> [(Int16, Int16)] -> Surface -> Int -> Int -> IO Bool
texturedPolygon surface :: Surface
surface list :: [(Int16, Int16)]
list texture :: Surface
texture dx :: Int
dx dy :: Int
dy = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
texture ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \txt :: Ptr SurfaceStruct
txt ->
[Int16] -> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b
withArray (((Int16, Int16) -> Int16) -> [(Int16, Int16)] -> [Int16]
forall a b. (a -> b) -> [a] -> [b]
map (Int16, Int16) -> Int16
forall a b. (a, b) -> a
fst [(Int16, Int16)]
list) ((Ptr Int16 -> IO Bool) -> IO Bool)
-> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \xs :: Ptr Int16
xs ->
[Int16] -> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b
withArray (((Int16, Int16) -> Int16) -> [(Int16, Int16)] -> [Int16]
forall a b. (a -> b) -> [a] -> [b]
map (Int16, Int16) -> Int16
forall a b. (a, b) -> b
snd [(Int16, Int16)]
list) ((Ptr Int16 -> IO Bool) -> IO Bool)
-> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ys :: Ptr Int16
ys ->
Int -> IO Int -> IO Bool
intToBool (-1) (IO Int -> IO Bool) -> IO Int -> IO Bool
forall a b. (a -> b) -> a -> b
$ (CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Ptr Int16
-> Ptr Int16
-> Int
-> Ptr SurfaceStruct
-> Int
-> Int
-> IO CInt
gfxTexturedPolygon Ptr SurfaceStruct
ptr Ptr Int16
xs Ptr Int16
ys ([(Int16, Int16)] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [(Int16, Int16)]
list) Ptr SurfaceStruct
txt Int
dx Int
dy
foreign import ccall unsafe "bezierColor" gfxBezierColor :: Ptr SurfaceStruct -> Ptr Int16 -> Ptr Int16 -> Int -> Int -> Word32 -> IO CInt
bezier :: Surface -> [(Int16, Int16)] -> Int -> Pixel -> IO Bool
bezier :: Surface -> [(Int16, Int16)] -> Int -> Pixel -> IO Bool
bezier surface :: Surface
surface list :: [(Int16, Int16)]
list steps :: Int
steps (Pixel w :: Word32
w) = Surface -> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Surface
surface ((Ptr SurfaceStruct -> IO Bool) -> IO Bool)
-> (Ptr SurfaceStruct -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr SurfaceStruct
ptr ->
[Int16] -> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b
withArray (((Int16, Int16) -> Int16) -> [(Int16, Int16)] -> [Int16]
forall a b. (a -> b) -> [a] -> [b]
map (Int16, Int16) -> Int16
forall a b. (a, b) -> a
fst [(Int16, Int16)]
list) ((Ptr Int16 -> IO Bool) -> IO Bool)
-> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \xs :: Ptr Int16
xs ->
[Int16] -> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b
withArray (((Int16, Int16) -> Int16) -> [(Int16, Int16)] -> [Int16]
forall a b. (a -> b) -> [a] -> [b]
map (Int16, Int16) -> Int16
forall a b. (a, b) -> b
snd [(Int16, Int16)]
list) ((Ptr Int16 -> IO Bool) -> IO Bool)
-> (Ptr Int16 -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \ys :: Ptr Int16
ys ->
Int -> IO Int -> IO Bool
intToBool (-1) (IO Int -> IO Bool) -> IO Int -> IO Bool
forall a b. (a -> b) -> a -> b
$ (CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> Int
forall a. Num a => CInt -> a
fromCInt (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceStruct
-> Ptr Int16 -> Ptr Int16 -> Int -> Int -> Word32 -> IO CInt
gfxBezierColor Ptr SurfaceStruct
ptr Ptr Int16
xs Ptr Int16
ys ([(Int16, Int16)] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [(Int16, Int16)]
list) Int
steps Word32
w