gi-cairo-0.1.14.13: GI/Cairo/Structs/RectangleInt.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)
-}
module GI.Cairo.Structs.RectangleInt
(
-- * Exported types
RectangleInt(..) ,
newZeroRectangleInt ,
noRectangleInt ,
-- * Properties
-- ** Height
rectangleIntReadHeight ,
-- ** Width
rectangleIntReadWidth ,
-- ** X
rectangleIntReadX ,
-- ** Y
rectangleIntReadY ,
) 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.Cairo.Types
import GI.Cairo.Callbacks
newtype RectangleInt = RectangleInt (ForeignPtr RectangleInt)
foreign import ccall "cairo_gobject_rectangle_int_get_type" c_cairo_gobject_rectangle_int_get_type ::
IO GType
instance BoxedObject RectangleInt where
boxedType _ = c_cairo_gobject_rectangle_int_get_type
-- | Construct a `RectangleInt` struct initialized to zero.
newZeroRectangleInt :: MonadIO m => m RectangleInt
newZeroRectangleInt = liftIO $ callocBoxedBytes 16 >>= wrapBoxed RectangleInt
noRectangleInt :: Maybe RectangleInt
noRectangleInt = Nothing
rectangleIntReadX :: RectangleInt -> IO Int32
rectangleIntReadX s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO Int32
return val
rectangleIntReadY :: RectangleInt -> IO Int32
rectangleIntReadY s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 4) :: IO Int32
return val
rectangleIntReadWidth :: RectangleInt -> IO Int32
rectangleIntReadWidth s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO Int32
return val
rectangleIntReadHeight :: RectangleInt -> IO Int32
rectangleIntReadHeight s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 12) :: IO Int32
return val
type family ResolveRectangleIntMethod (t :: Symbol) (o :: *) :: * where
ResolveRectangleIntMethod l o = MethodResolutionFailed l o
instance (info ~ ResolveRectangleIntMethod t RectangleInt, MethodInfo info RectangleInt p) => IsLabelProxy t (RectangleInt -> p) where
fromLabelProxy _ = overloadedMethod (MethodProxy :: MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveRectangleIntMethod t RectangleInt, MethodInfo info RectangleInt p) => IsLabel t (RectangleInt -> p) where
fromLabel _ = overloadedMethod (MethodProxy :: MethodProxy info)
#endif