module Bindings.WLC.Geometry where
import Foreign.Ptr (Ptr,FunPtr,plusPtr)
import Foreign.Ptr (wordPtrToPtr,castPtrToFunPtr)
import Foreign.Storable
import Foreign.C.Types
import Foreign.C.String (CString,CStringLen,CWString,CWStringLen)
import Foreign.Marshal.Alloc (alloca)
import Foreign.Marshal.Array (peekArray,pokeArray)
import Data.Int
import Data.Word
import Foreign.C.Types
data C'wlc_point = C'wlc_point{
c'wlc_point'x :: CInt,
c'wlc_point'y :: CInt
} deriving (Eq,Show)
p'wlc_point'x p = plusPtr p 0
p'wlc_point'x :: Ptr (C'wlc_point) -> Ptr (CInt)
p'wlc_point'y p = plusPtr p 4
p'wlc_point'y :: Ptr (C'wlc_point) -> Ptr (CInt)
instance Storable C'wlc_point where
sizeOf _ = 8
alignment _ = 4
peek p = do
v0 <- peekByteOff p 0
v1 <- peekByteOff p 4
return $ C'wlc_point v0 v1
poke p (C'wlc_point v0 v1) = do
pokeByteOff p 0 v0
pokeByteOff p 4 v1
return ()
data C'wlc_size = C'wlc_size{
c'wlc_size'w :: CUInt,
c'wlc_size'h :: CUInt
} deriving (Eq,Show)
p'wlc_size'w p = plusPtr p 0
p'wlc_size'w :: Ptr (C'wlc_size) -> Ptr (CUInt)
p'wlc_size'h p = plusPtr p 4
p'wlc_size'h :: Ptr (C'wlc_size) -> Ptr (CUInt)
instance Storable C'wlc_size where
sizeOf _ = 8
alignment _ = 4
peek p = do
v0 <- peekByteOff p 0
v1 <- peekByteOff p 4
return $ C'wlc_size v0 v1
poke p (C'wlc_size v0 v1) = do
pokeByteOff p 0 v0
pokeByteOff p 4 v1
return ()
data C'wlc_geometry = C'wlc_geometry{
c'wlc_geometry'origin :: C'wlc_point,
c'wlc_geometry'size :: C'wlc_size
} deriving (Eq,Show)
p'wlc_geometry'origin p = plusPtr p 0
p'wlc_geometry'origin :: Ptr (C'wlc_geometry) -> Ptr (C'wlc_point)
p'wlc_geometry'size p = plusPtr p 8
p'wlc_geometry'size :: Ptr (C'wlc_geometry) -> Ptr (C'wlc_size)
instance Storable C'wlc_geometry where
sizeOf _ = 16
alignment _ = 4
peek p = do
v0 <- peekByteOff p 0
v1 <- peekByteOff p 8
return $ C'wlc_geometry v0 v1
poke p (C'wlc_geometry v0 v1) = do
pokeByteOff p 0 v0
pokeByteOff p 8 v1
return ()