gi-atk-0.2.16.12: GI/Atk/Structs/Rectangle.hs
{- |
Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
A data structure for holding a rectangle. Those coordinates are
relative to the component top-level parent.
-}
module GI.Atk.Structs.Rectangle
(
-- * Exported types
Rectangle(..) ,
noRectangle ,
-- * Properties
-- ** Height
rectangleReadHeight ,
-- ** Width
rectangleReadWidth ,
-- ** X
rectangleReadX ,
-- ** Y
rectangleReadY ,
) where
import Prelude ()
import Data.GI.Base.ShortPrelude
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import GI.Atk.Types
import GI.Atk.Callbacks
newtype Rectangle = Rectangle (ForeignPtr Rectangle)
foreign import ccall "atk_rectangle_get_type" c_atk_rectangle_get_type ::
IO GType
instance BoxedObject Rectangle where
boxedType _ = c_atk_rectangle_get_type
noRectangle :: Maybe Rectangle
noRectangle = Nothing
rectangleReadX :: Rectangle -> IO Int32
rectangleReadX s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO Int32
return val
rectangleReadY :: Rectangle -> IO Int32
rectangleReadY s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 4) :: IO Int32
return val
rectangleReadWidth :: Rectangle -> IO Int32
rectangleReadWidth s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO Int32
return val
rectangleReadHeight :: Rectangle -> IO Int32
rectangleReadHeight s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 12) :: IO Int32
return val