{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Graphene.Structs.Rect
(
Rect(..) ,
newZeroRect ,
noRect ,
#if defined(ENABLE_OVERLOADING)
ResolveRectMethod ,
#endif
rectAlloc ,
#if defined(ENABLE_OVERLOADING)
RectContainsPointMethodInfo ,
#endif
rectContainsPoint ,
#if defined(ENABLE_OVERLOADING)
RectContainsRectMethodInfo ,
#endif
rectContainsRect ,
#if defined(ENABLE_OVERLOADING)
RectEqualMethodInfo ,
#endif
rectEqual ,
#if defined(ENABLE_OVERLOADING)
RectExpandMethodInfo ,
#endif
rectExpand ,
#if defined(ENABLE_OVERLOADING)
RectFreeMethodInfo ,
#endif
rectFree ,
#if defined(ENABLE_OVERLOADING)
RectGetAreaMethodInfo ,
#endif
rectGetArea ,
#if defined(ENABLE_OVERLOADING)
RectGetBottomLeftMethodInfo ,
#endif
rectGetBottomLeft ,
#if defined(ENABLE_OVERLOADING)
RectGetBottomRightMethodInfo ,
#endif
rectGetBottomRight ,
#if defined(ENABLE_OVERLOADING)
RectGetCenterMethodInfo ,
#endif
rectGetCenter ,
#if defined(ENABLE_OVERLOADING)
RectGetHeightMethodInfo ,
#endif
rectGetHeight ,
#if defined(ENABLE_OVERLOADING)
RectGetTopLeftMethodInfo ,
#endif
rectGetTopLeft ,
#if defined(ENABLE_OVERLOADING)
RectGetTopRightMethodInfo ,
#endif
rectGetTopRight ,
#if defined(ENABLE_OVERLOADING)
RectGetWidthMethodInfo ,
#endif
rectGetWidth ,
#if defined(ENABLE_OVERLOADING)
RectGetXMethodInfo ,
#endif
rectGetX ,
#if defined(ENABLE_OVERLOADING)
RectGetYMethodInfo ,
#endif
rectGetY ,
#if defined(ENABLE_OVERLOADING)
RectInitMethodInfo ,
#endif
rectInit ,
#if defined(ENABLE_OVERLOADING)
RectInitFromRectMethodInfo ,
#endif
rectInitFromRect ,
#if defined(ENABLE_OVERLOADING)
RectInsetMethodInfo ,
#endif
rectInset ,
#if defined(ENABLE_OVERLOADING)
RectInsetRMethodInfo ,
#endif
rectInsetR ,
#if defined(ENABLE_OVERLOADING)
RectInterpolateMethodInfo ,
#endif
rectInterpolate ,
#if defined(ENABLE_OVERLOADING)
RectIntersectionMethodInfo ,
#endif
rectIntersection ,
#if defined(ENABLE_OVERLOADING)
RectNormalizeMethodInfo ,
#endif
rectNormalize ,
#if defined(ENABLE_OVERLOADING)
RectNormalizeRMethodInfo ,
#endif
rectNormalizeR ,
#if defined(ENABLE_OVERLOADING)
RectOffsetMethodInfo ,
#endif
rectOffset ,
#if defined(ENABLE_OVERLOADING)
RectOffsetRMethodInfo ,
#endif
rectOffsetR ,
#if defined(ENABLE_OVERLOADING)
RectRoundMethodInfo ,
#endif
rectRound ,
#if defined(ENABLE_OVERLOADING)
RectRoundExtentsMethodInfo ,
#endif
rectRoundExtents ,
#if defined(ENABLE_OVERLOADING)
RectRoundToPixelMethodInfo ,
#endif
rectRoundToPixel ,
#if defined(ENABLE_OVERLOADING)
RectScaleMethodInfo ,
#endif
rectScale ,
#if defined(ENABLE_OVERLOADING)
RectUnionMethodInfo ,
#endif
rectUnion ,
rectZero ,
getRectOrigin ,
#if defined(ENABLE_OVERLOADING)
rect_origin ,
#endif
getRectSize ,
#if defined(ENABLE_OVERLOADING)
rect_size ,
#endif
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import {-# SOURCE #-} qualified GI.Graphene.Structs.Point as Graphene.Point
import {-# SOURCE #-} qualified GI.Graphene.Structs.Size as Graphene.Size
newtype Rect = Rect (ManagedPtr Rect)
deriving (Rect -> Rect -> Bool
(Rect -> Rect -> Bool) -> (Rect -> Rect -> Bool) -> Eq Rect
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Rect -> Rect -> Bool
$c/= :: Rect -> Rect -> Bool
== :: Rect -> Rect -> Bool
$c== :: Rect -> Rect -> Bool
Eq)
foreign import ccall "graphene_rect_get_type" c_graphene_rect_get_type ::
IO GType
instance BoxedObject Rect where
boxedType :: Rect -> IO GType
boxedType _ = IO GType
c_graphene_rect_get_type
instance B.GValue.IsGValue Rect where
toGValue :: Rect -> IO GValue
toGValue o :: Rect
o = do
GType
gtype <- IO GType
c_graphene_rect_get_type
Rect -> (Ptr Rect -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Rect
o (GType -> (GValue -> Ptr Rect -> IO ()) -> Ptr Rect -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Rect -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
fromGValue :: GValue -> IO Rect
fromGValue gv :: GValue
gv = do
Ptr Rect
ptr <- GValue -> IO (Ptr Rect)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr Rect)
(ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr Rect -> Rect
Rect Ptr Rect
ptr
newZeroRect :: MonadIO m => m Rect
newZeroRect :: m Rect
newZeroRect = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ Int -> IO (Ptr Rect)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 16 IO (Ptr Rect) -> (Ptr Rect -> IO Rect) -> IO Rect
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rect -> Rect
Rect
instance tag ~ 'AttrSet => Constructible Rect tag where
new :: (ManagedPtr Rect -> Rect) -> [AttrOp Rect tag] -> m Rect
new _ attrs :: [AttrOp Rect tag]
attrs = do
Rect
o <- m Rect
forall (m :: * -> *). MonadIO m => m Rect
newZeroRect
Rect -> [AttrOp Rect 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set Rect
o [AttrOp Rect tag]
[AttrOp Rect 'AttrSet]
attrs
Rect -> m Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
o
noRect :: Maybe Rect
noRect :: Maybe Rect
noRect = Maybe Rect
forall a. Maybe a
Nothing
getRectOrigin :: MonadIO m => Rect -> m Graphene.Point.Point
getRectOrigin :: Rect -> m Point
getRectOrigin s :: Rect
s = IO Point -> m Point
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point -> m Point) -> IO Point -> m Point
forall a b. (a -> b) -> a -> b
$ Rect -> (Ptr Rect -> IO Point) -> IO Point
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Rect
s ((Ptr Rect -> IO Point) -> IO Point)
-> (Ptr Rect -> IO Point) -> IO Point
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr Rect
ptr -> do
let val :: Ptr Point
val = Ptr Rect
ptr Ptr Rect -> Int -> Ptr Point
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: (Ptr Graphene.Point.Point)
Point
val' <- ((ManagedPtr Point -> Point) -> Ptr Point -> IO Point
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Point -> Point
Graphene.Point.Point) Ptr Point
val
Point -> IO Point
forall (m :: * -> *) a. Monad m => a -> m a
return Point
val'
#if defined(ENABLE_OVERLOADING)
data RectOriginFieldInfo
instance AttrInfo RectOriginFieldInfo where
type AttrBaseTypeConstraint RectOriginFieldInfo = (~) Rect
type AttrAllowedOps RectOriginFieldInfo = '[ 'AttrGet]
type AttrSetTypeConstraint RectOriginFieldInfo = (~) (Ptr Graphene.Point.Point)
type AttrTransferTypeConstraint RectOriginFieldInfo = (~)(Ptr Graphene.Point.Point)
type AttrTransferType RectOriginFieldInfo = (Ptr Graphene.Point.Point)
type AttrGetType RectOriginFieldInfo = Graphene.Point.Point
type AttrLabel RectOriginFieldInfo = "origin"
type AttrOrigin RectOriginFieldInfo = Rect
attrGet = getRectOrigin
attrSet = undefined
attrConstruct = undefined
attrClear = undefined
attrTransfer = undefined
rect_origin :: AttrLabelProxy "origin"
rect_origin = AttrLabelProxy
#endif
getRectSize :: MonadIO m => Rect -> m Graphene.Size.Size
getRectSize :: Rect -> m Size
getRectSize s :: Rect
s = IO Size -> m Size
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Size -> m Size) -> IO Size -> m Size
forall a b. (a -> b) -> a -> b
$ Rect -> (Ptr Rect -> IO Size) -> IO Size
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Rect
s ((Ptr Rect -> IO Size) -> IO Size)
-> (Ptr Rect -> IO Size) -> IO Size
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr Rect
ptr -> do
let val :: Ptr Size
val = Ptr Rect
ptr Ptr Rect -> Int -> Ptr Size
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: (Ptr Graphene.Size.Size)
Size
val' <- ((ManagedPtr Size -> Size) -> Ptr Size -> IO Size
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Size -> Size
Graphene.Size.Size) Ptr Size
val
Size -> IO Size
forall (m :: * -> *) a. Monad m => a -> m a
return Size
val'
#if defined(ENABLE_OVERLOADING)
data RectSizeFieldInfo
instance AttrInfo RectSizeFieldInfo where
type AttrBaseTypeConstraint RectSizeFieldInfo = (~) Rect
type AttrAllowedOps RectSizeFieldInfo = '[ 'AttrGet]
type AttrSetTypeConstraint RectSizeFieldInfo = (~) (Ptr Graphene.Size.Size)
type AttrTransferTypeConstraint RectSizeFieldInfo = (~)(Ptr Graphene.Size.Size)
type AttrTransferType RectSizeFieldInfo = (Ptr Graphene.Size.Size)
type AttrGetType RectSizeFieldInfo = Graphene.Size.Size
type AttrLabel RectSizeFieldInfo = "size"
type AttrOrigin RectSizeFieldInfo = Rect
attrGet = getRectSize
attrSet = undefined
attrConstruct = undefined
attrClear = undefined
attrTransfer = undefined
rect_size :: AttrLabelProxy "size"
rect_size = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Rect
type instance O.AttributeList Rect = RectAttributeList
type RectAttributeList = ('[ '("origin", RectOriginFieldInfo), '("size", RectSizeFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "graphene_rect_contains_point" graphene_rect_contains_point ::
Ptr Rect ->
Ptr Graphene.Point.Point ->
IO CInt
rectContainsPoint ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> Graphene.Point.Point
-> m Bool
rectContainsPoint :: Rect -> Point -> m Bool
rectContainsPoint r :: Rect
r p :: Point
p = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Point
p' <- Point -> IO (Ptr Point)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point
p
CInt
result <- Ptr Rect -> Ptr Point -> IO CInt
graphene_rect_contains_point Ptr Rect
r' Ptr Point
p'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Point -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point
p
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data RectContainsPointMethodInfo
instance (signature ~ (Graphene.Point.Point -> m Bool), MonadIO m) => O.MethodInfo RectContainsPointMethodInfo Rect signature where
overloadedMethod = rectContainsPoint
#endif
foreign import ccall "graphene_rect_contains_rect" graphene_rect_contains_rect ::
Ptr Rect ->
Ptr Rect ->
IO CInt
rectContainsRect ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> Rect
-> m Bool
rectContainsRect :: Rect -> Rect -> m Bool
rectContainsRect a :: Rect
a b :: Rect
b = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
a' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
a
Ptr Rect
b' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
b
CInt
result <- Ptr Rect -> Ptr Rect -> IO CInt
graphene_rect_contains_rect Ptr Rect
a' Ptr Rect
b'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
a
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
b
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data RectContainsRectMethodInfo
instance (signature ~ (Rect -> m Bool), MonadIO m) => O.MethodInfo RectContainsRectMethodInfo Rect signature where
overloadedMethod = rectContainsRect
#endif
foreign import ccall "graphene_rect_equal" graphene_rect_equal ::
Ptr Rect ->
Ptr Rect ->
IO CInt
rectEqual ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> Rect
-> m Bool
rectEqual :: Rect -> Rect -> m Bool
rectEqual a :: Rect
a b :: Rect
b = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
a' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
a
Ptr Rect
b' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
b
CInt
result <- Ptr Rect -> Ptr Rect -> IO CInt
graphene_rect_equal Ptr Rect
a' Ptr Rect
b'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
a
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
b
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data RectEqualMethodInfo
instance (signature ~ (Rect -> m Bool), MonadIO m) => O.MethodInfo RectEqualMethodInfo Rect signature where
overloadedMethod = rectEqual
#endif
foreign import ccall "graphene_rect_expand" graphene_rect_expand ::
Ptr Rect ->
Ptr Graphene.Point.Point ->
Ptr Rect ->
IO ()
rectExpand ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> Graphene.Point.Point
-> m (Rect)
rectExpand :: Rect -> Point -> m Rect
rectExpand r :: Rect
r p :: Point
p = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Point
p' <- Point -> IO (Ptr Point)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point
p
Ptr Rect
res <- Int -> IO (Ptr Rect)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 16 :: IO (Ptr Rect)
Ptr Rect -> Ptr Point -> Ptr Rect -> IO ()
graphene_rect_expand Ptr Rect
r' Ptr Point
p' Ptr Rect
res
Rect
res' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rect -> Rect
Rect) Ptr Rect
res
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Point -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point
p
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
res'
#if defined(ENABLE_OVERLOADING)
data RectExpandMethodInfo
instance (signature ~ (Graphene.Point.Point -> m (Rect)), MonadIO m) => O.MethodInfo RectExpandMethodInfo Rect signature where
overloadedMethod = rectExpand
#endif
foreign import ccall "graphene_rect_free" graphene_rect_free ::
Ptr Rect ->
IO ()
rectFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> m ()
rectFree :: Rect -> m ()
rectFree r :: Rect
r = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Rect -> IO ()
graphene_rect_free Ptr Rect
r'
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RectFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo RectFreeMethodInfo Rect signature where
overloadedMethod = rectFree
#endif
foreign import ccall "graphene_rect_get_area" graphene_rect_get_area ::
Ptr Rect ->
IO CFloat
rectGetArea ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> m Float
rectGetArea :: Rect -> m Float
rectGetArea r :: Rect
r = IO Float -> m Float
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
CFloat
result <- Ptr Rect -> IO CFloat
graphene_rect_get_area Ptr Rect
r'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Float -> IO Float
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data RectGetAreaMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.MethodInfo RectGetAreaMethodInfo Rect signature where
overloadedMethod = rectGetArea
#endif
foreign import ccall "graphene_rect_get_bottom_left" graphene_rect_get_bottom_left ::
Ptr Rect ->
Ptr Graphene.Point.Point ->
IO ()
rectGetBottomLeft ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> m (Graphene.Point.Point)
rectGetBottomLeft :: Rect -> m Point
rectGetBottomLeft r :: Rect
r = IO Point -> m Point
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point -> m Point) -> IO Point -> m Point
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Point
p <- Int -> IO (Ptr Point)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 8 :: IO (Ptr Graphene.Point.Point)
Ptr Rect -> Ptr Point -> IO ()
graphene_rect_get_bottom_left Ptr Rect
r' Ptr Point
p
Point
p' <- ((ManagedPtr Point -> Point) -> Ptr Point -> IO Point
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point -> Point
Graphene.Point.Point) Ptr Point
p
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Point -> IO Point
forall (m :: * -> *) a. Monad m => a -> m a
return Point
p'
#if defined(ENABLE_OVERLOADING)
data RectGetBottomLeftMethodInfo
instance (signature ~ (m (Graphene.Point.Point)), MonadIO m) => O.MethodInfo RectGetBottomLeftMethodInfo Rect signature where
overloadedMethod = rectGetBottomLeft
#endif
foreign import ccall "graphene_rect_get_bottom_right" graphene_rect_get_bottom_right ::
Ptr Rect ->
Ptr Graphene.Point.Point ->
IO ()
rectGetBottomRight ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> m (Graphene.Point.Point)
rectGetBottomRight :: Rect -> m Point
rectGetBottomRight r :: Rect
r = IO Point -> m Point
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point -> m Point) -> IO Point -> m Point
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Point
p <- Int -> IO (Ptr Point)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 8 :: IO (Ptr Graphene.Point.Point)
Ptr Rect -> Ptr Point -> IO ()
graphene_rect_get_bottom_right Ptr Rect
r' Ptr Point
p
Point
p' <- ((ManagedPtr Point -> Point) -> Ptr Point -> IO Point
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point -> Point
Graphene.Point.Point) Ptr Point
p
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Point -> IO Point
forall (m :: * -> *) a. Monad m => a -> m a
return Point
p'
#if defined(ENABLE_OVERLOADING)
data RectGetBottomRightMethodInfo
instance (signature ~ (m (Graphene.Point.Point)), MonadIO m) => O.MethodInfo RectGetBottomRightMethodInfo Rect signature where
overloadedMethod = rectGetBottomRight
#endif
foreign import ccall "graphene_rect_get_center" graphene_rect_get_center ::
Ptr Rect ->
Ptr Graphene.Point.Point ->
IO ()
rectGetCenter ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> m (Graphene.Point.Point)
rectGetCenter :: Rect -> m Point
rectGetCenter r :: Rect
r = IO Point -> m Point
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point -> m Point) -> IO Point -> m Point
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Point
p <- Int -> IO (Ptr Point)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 8 :: IO (Ptr Graphene.Point.Point)
Ptr Rect -> Ptr Point -> IO ()
graphene_rect_get_center Ptr Rect
r' Ptr Point
p
Point
p' <- ((ManagedPtr Point -> Point) -> Ptr Point -> IO Point
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point -> Point
Graphene.Point.Point) Ptr Point
p
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Point -> IO Point
forall (m :: * -> *) a. Monad m => a -> m a
return Point
p'
#if defined(ENABLE_OVERLOADING)
data RectGetCenterMethodInfo
instance (signature ~ (m (Graphene.Point.Point)), MonadIO m) => O.MethodInfo RectGetCenterMethodInfo Rect signature where
overloadedMethod = rectGetCenter
#endif
foreign import ccall "graphene_rect_get_height" graphene_rect_get_height ::
Ptr Rect ->
IO CFloat
rectGetHeight ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> m Float
rectGetHeight :: Rect -> m Float
rectGetHeight r :: Rect
r = IO Float -> m Float
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
CFloat
result <- Ptr Rect -> IO CFloat
graphene_rect_get_height Ptr Rect
r'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Float -> IO Float
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data RectGetHeightMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.MethodInfo RectGetHeightMethodInfo Rect signature where
overloadedMethod = rectGetHeight
#endif
foreign import ccall "graphene_rect_get_top_left" graphene_rect_get_top_left ::
Ptr Rect ->
Ptr Graphene.Point.Point ->
IO ()
rectGetTopLeft ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> m (Graphene.Point.Point)
rectGetTopLeft :: Rect -> m Point
rectGetTopLeft r :: Rect
r = IO Point -> m Point
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point -> m Point) -> IO Point -> m Point
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Point
p <- Int -> IO (Ptr Point)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 8 :: IO (Ptr Graphene.Point.Point)
Ptr Rect -> Ptr Point -> IO ()
graphene_rect_get_top_left Ptr Rect
r' Ptr Point
p
Point
p' <- ((ManagedPtr Point -> Point) -> Ptr Point -> IO Point
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point -> Point
Graphene.Point.Point) Ptr Point
p
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Point -> IO Point
forall (m :: * -> *) a. Monad m => a -> m a
return Point
p'
#if defined(ENABLE_OVERLOADING)
data RectGetTopLeftMethodInfo
instance (signature ~ (m (Graphene.Point.Point)), MonadIO m) => O.MethodInfo RectGetTopLeftMethodInfo Rect signature where
overloadedMethod = rectGetTopLeft
#endif
foreign import ccall "graphene_rect_get_top_right" graphene_rect_get_top_right ::
Ptr Rect ->
Ptr Graphene.Point.Point ->
IO ()
rectGetTopRight ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> m (Graphene.Point.Point)
rectGetTopRight :: Rect -> m Point
rectGetTopRight r :: Rect
r = IO Point -> m Point
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point -> m Point) -> IO Point -> m Point
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Point
p <- Int -> IO (Ptr Point)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 8 :: IO (Ptr Graphene.Point.Point)
Ptr Rect -> Ptr Point -> IO ()
graphene_rect_get_top_right Ptr Rect
r' Ptr Point
p
Point
p' <- ((ManagedPtr Point -> Point) -> Ptr Point -> IO Point
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point -> Point
Graphene.Point.Point) Ptr Point
p
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Point -> IO Point
forall (m :: * -> *) a. Monad m => a -> m a
return Point
p'
#if defined(ENABLE_OVERLOADING)
data RectGetTopRightMethodInfo
instance (signature ~ (m (Graphene.Point.Point)), MonadIO m) => O.MethodInfo RectGetTopRightMethodInfo Rect signature where
overloadedMethod = rectGetTopRight
#endif
foreign import ccall "graphene_rect_get_width" graphene_rect_get_width ::
Ptr Rect ->
IO CFloat
rectGetWidth ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> m Float
rectGetWidth :: Rect -> m Float
rectGetWidth r :: Rect
r = IO Float -> m Float
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
CFloat
result <- Ptr Rect -> IO CFloat
graphene_rect_get_width Ptr Rect
r'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Float -> IO Float
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data RectGetWidthMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.MethodInfo RectGetWidthMethodInfo Rect signature where
overloadedMethod = rectGetWidth
#endif
foreign import ccall "graphene_rect_get_x" graphene_rect_get_x ::
Ptr Rect ->
IO CFloat
rectGetX ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> m Float
rectGetX :: Rect -> m Float
rectGetX r :: Rect
r = IO Float -> m Float
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
CFloat
result <- Ptr Rect -> IO CFloat
graphene_rect_get_x Ptr Rect
r'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Float -> IO Float
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data RectGetXMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.MethodInfo RectGetXMethodInfo Rect signature where
overloadedMethod = rectGetX
#endif
foreign import ccall "graphene_rect_get_y" graphene_rect_get_y ::
Ptr Rect ->
IO CFloat
rectGetY ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> m Float
rectGetY :: Rect -> m Float
rectGetY r :: Rect
r = IO Float -> m Float
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
CFloat
result <- Ptr Rect -> IO CFloat
graphene_rect_get_y Ptr Rect
r'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Float -> IO Float
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data RectGetYMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.MethodInfo RectGetYMethodInfo Rect signature where
overloadedMethod = rectGetY
#endif
foreign import ccall "graphene_rect_init" graphene_rect_init ::
Ptr Rect ->
CFloat ->
CFloat ->
CFloat ->
CFloat ->
IO (Ptr Rect)
rectInit ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> Float
-> Float
-> Float
-> Float
-> m Rect
rectInit :: Rect -> Float -> Float -> Float -> Float -> m Rect
rectInit r :: Rect
r x :: Float
x y :: Float
y width :: Float
width height :: Float
height = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
let x' :: CFloat
x' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
x
let y' :: CFloat
y' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
y
let width' :: CFloat
width' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
width
let height' :: CFloat
height' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
height
Ptr Rect
result <- Ptr Rect -> CFloat -> CFloat -> CFloat -> CFloat -> IO (Ptr Rect)
graphene_rect_init Ptr Rect
r' CFloat
x' CFloat
y' CFloat
width' CFloat
height'
Text -> Ptr Rect -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "rectInit" Ptr Rect
result
Rect
result' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Rect -> Rect
Rect) Ptr Rect
result
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
result'
#if defined(ENABLE_OVERLOADING)
data RectInitMethodInfo
instance (signature ~ (Float -> Float -> Float -> Float -> m Rect), MonadIO m) => O.MethodInfo RectInitMethodInfo Rect signature where
overloadedMethod = rectInit
#endif
foreign import ccall "graphene_rect_init_from_rect" graphene_rect_init_from_rect ::
Ptr Rect ->
Ptr Rect ->
IO (Ptr Rect)
rectInitFromRect ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> Rect
-> m Rect
rectInitFromRect :: Rect -> Rect -> m Rect
rectInitFromRect r :: Rect
r src :: Rect
src = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Rect
src' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
src
Ptr Rect
result <- Ptr Rect -> Ptr Rect -> IO (Ptr Rect)
graphene_rect_init_from_rect Ptr Rect
r' Ptr Rect
src'
Text -> Ptr Rect -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "rectInitFromRect" Ptr Rect
result
Rect
result' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Rect -> Rect
Rect) Ptr Rect
result
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
src
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
result'
#if defined(ENABLE_OVERLOADING)
data RectInitFromRectMethodInfo
instance (signature ~ (Rect -> m Rect), MonadIO m) => O.MethodInfo RectInitFromRectMethodInfo Rect signature where
overloadedMethod = rectInitFromRect
#endif
foreign import ccall "graphene_rect_inset" graphene_rect_inset ::
Ptr Rect ->
CFloat ->
CFloat ->
IO (Ptr Rect)
rectInset ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> Float
-> Float
-> m Rect
rectInset :: Rect -> Float -> Float -> m Rect
rectInset r :: Rect
r dX :: Float
dX dY :: Float
dY = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
let dX' :: CFloat
dX' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
dX
let dY' :: CFloat
dY' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
dY
Ptr Rect
result <- Ptr Rect -> CFloat -> CFloat -> IO (Ptr Rect)
graphene_rect_inset Ptr Rect
r' CFloat
dX' CFloat
dY'
Text -> Ptr Rect -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "rectInset" Ptr Rect
result
Rect
result' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Rect -> Rect
Rect) Ptr Rect
result
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
result'
#if defined(ENABLE_OVERLOADING)
data RectInsetMethodInfo
instance (signature ~ (Float -> Float -> m Rect), MonadIO m) => O.MethodInfo RectInsetMethodInfo Rect signature where
overloadedMethod = rectInset
#endif
foreign import ccall "graphene_rect_inset_r" graphene_rect_inset_r ::
Ptr Rect ->
CFloat ->
CFloat ->
Ptr Rect ->
IO ()
rectInsetR ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> Float
-> Float
-> m (Rect)
rectInsetR :: Rect -> Float -> Float -> m Rect
rectInsetR r :: Rect
r dX :: Float
dX dY :: Float
dY = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
let dX' :: CFloat
dX' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
dX
let dY' :: CFloat
dY' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
dY
Ptr Rect
res <- Int -> IO (Ptr Rect)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 16 :: IO (Ptr Rect)
Ptr Rect -> CFloat -> CFloat -> Ptr Rect -> IO ()
graphene_rect_inset_r Ptr Rect
r' CFloat
dX' CFloat
dY' Ptr Rect
res
Rect
res' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rect -> Rect
Rect) Ptr Rect
res
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
res'
#if defined(ENABLE_OVERLOADING)
data RectInsetRMethodInfo
instance (signature ~ (Float -> Float -> m (Rect)), MonadIO m) => O.MethodInfo RectInsetRMethodInfo Rect signature where
overloadedMethod = rectInsetR
#endif
foreign import ccall "graphene_rect_interpolate" graphene_rect_interpolate ::
Ptr Rect ->
Ptr Rect ->
CDouble ->
Ptr Rect ->
IO ()
rectInterpolate ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> Rect
-> Double
-> m (Rect)
rectInterpolate :: Rect -> Rect -> Double -> m Rect
rectInterpolate a :: Rect
a b :: Rect
b factor :: Double
factor = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
a' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
a
Ptr Rect
b' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
b
let factor' :: CDouble
factor' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
factor
Ptr Rect
res <- Int -> IO (Ptr Rect)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 16 :: IO (Ptr Rect)
Ptr Rect -> Ptr Rect -> CDouble -> Ptr Rect -> IO ()
graphene_rect_interpolate Ptr Rect
a' Ptr Rect
b' CDouble
factor' Ptr Rect
res
Rect
res' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rect -> Rect
Rect) Ptr Rect
res
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
a
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
b
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
res'
#if defined(ENABLE_OVERLOADING)
data RectInterpolateMethodInfo
instance (signature ~ (Rect -> Double -> m (Rect)), MonadIO m) => O.MethodInfo RectInterpolateMethodInfo Rect signature where
overloadedMethod = rectInterpolate
#endif
foreign import ccall "graphene_rect_intersection" graphene_rect_intersection ::
Ptr Rect ->
Ptr Rect ->
Ptr Rect ->
IO CInt
rectIntersection ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> Rect
-> m ((Bool, Rect))
rectIntersection :: Rect -> Rect -> m (Bool, Rect)
rectIntersection a :: Rect
a b :: Rect
b = IO (Bool, Rect) -> m (Bool, Rect)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Rect) -> m (Bool, Rect))
-> IO (Bool, Rect) -> m (Bool, Rect)
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
a' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
a
Ptr Rect
b' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
b
Ptr Rect
res <- Int -> IO (Ptr Rect)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 16 :: IO (Ptr Rect)
CInt
result <- Ptr Rect -> Ptr Rect -> Ptr Rect -> IO CInt
graphene_rect_intersection Ptr Rect
a' Ptr Rect
b' Ptr Rect
res
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Rect
res' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rect -> Rect
Rect) Ptr Rect
res
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
a
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
b
(Bool, Rect) -> IO (Bool, Rect)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Rect
res')
#if defined(ENABLE_OVERLOADING)
data RectIntersectionMethodInfo
instance (signature ~ (Rect -> m ((Bool, Rect))), MonadIO m) => O.MethodInfo RectIntersectionMethodInfo Rect signature where
overloadedMethod = rectIntersection
#endif
foreign import ccall "graphene_rect_normalize" graphene_rect_normalize ::
Ptr Rect ->
IO (Ptr Rect)
rectNormalize ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> m Rect
rectNormalize :: Rect -> m Rect
rectNormalize r :: Rect
r = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Rect
result <- Ptr Rect -> IO (Ptr Rect)
graphene_rect_normalize Ptr Rect
r'
Text -> Ptr Rect -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "rectNormalize" Ptr Rect
result
Rect
result' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Rect -> Rect
Rect) Ptr Rect
result
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
result'
#if defined(ENABLE_OVERLOADING)
data RectNormalizeMethodInfo
instance (signature ~ (m Rect), MonadIO m) => O.MethodInfo RectNormalizeMethodInfo Rect signature where
overloadedMethod = rectNormalize
#endif
foreign import ccall "graphene_rect_normalize_r" graphene_rect_normalize_r ::
Ptr Rect ->
Ptr Rect ->
IO ()
rectNormalizeR ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> m (Rect)
rectNormalizeR :: Rect -> m Rect
rectNormalizeR r :: Rect
r = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Rect
res <- Int -> IO (Ptr Rect)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 16 :: IO (Ptr Rect)
Ptr Rect -> Ptr Rect -> IO ()
graphene_rect_normalize_r Ptr Rect
r' Ptr Rect
res
Rect
res' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rect -> Rect
Rect) Ptr Rect
res
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
res'
#if defined(ENABLE_OVERLOADING)
data RectNormalizeRMethodInfo
instance (signature ~ (m (Rect)), MonadIO m) => O.MethodInfo RectNormalizeRMethodInfo Rect signature where
overloadedMethod = rectNormalizeR
#endif
foreign import ccall "graphene_rect_offset" graphene_rect_offset ::
Ptr Rect ->
CFloat ->
CFloat ->
IO (Ptr Rect)
rectOffset ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> Float
-> Float
-> m Rect
rectOffset :: Rect -> Float -> Float -> m Rect
rectOffset r :: Rect
r dX :: Float
dX dY :: Float
dY = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
let dX' :: CFloat
dX' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
dX
let dY' :: CFloat
dY' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
dY
Ptr Rect
result <- Ptr Rect -> CFloat -> CFloat -> IO (Ptr Rect)
graphene_rect_offset Ptr Rect
r' CFloat
dX' CFloat
dY'
Text -> Ptr Rect -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "rectOffset" Ptr Rect
result
Rect
result' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Rect -> Rect
Rect) Ptr Rect
result
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
result'
#if defined(ENABLE_OVERLOADING)
data RectOffsetMethodInfo
instance (signature ~ (Float -> Float -> m Rect), MonadIO m) => O.MethodInfo RectOffsetMethodInfo Rect signature where
overloadedMethod = rectOffset
#endif
foreign import ccall "graphene_rect_offset_r" graphene_rect_offset_r ::
Ptr Rect ->
CFloat ->
CFloat ->
Ptr Rect ->
IO ()
rectOffsetR ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> Float
-> Float
-> m (Rect)
rectOffsetR :: Rect -> Float -> Float -> m Rect
rectOffsetR r :: Rect
r dX :: Float
dX dY :: Float
dY = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
let dX' :: CFloat
dX' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
dX
let dY' :: CFloat
dY' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
dY
Ptr Rect
res <- Int -> IO (Ptr Rect)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 16 :: IO (Ptr Rect)
Ptr Rect -> CFloat -> CFloat -> Ptr Rect -> IO ()
graphene_rect_offset_r Ptr Rect
r' CFloat
dX' CFloat
dY' Ptr Rect
res
Rect
res' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rect -> Rect
Rect) Ptr Rect
res
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
res'
#if defined(ENABLE_OVERLOADING)
data RectOffsetRMethodInfo
instance (signature ~ (Float -> Float -> m (Rect)), MonadIO m) => O.MethodInfo RectOffsetRMethodInfo Rect signature where
overloadedMethod = rectOffsetR
#endif
foreign import ccall "graphene_rect_round" graphene_rect_round ::
Ptr Rect ->
Ptr Rect ->
IO ()
{-# DEPRECATED rectRound ["(Since version 1.10)","Use 'GI.Graphene.Structs.Rect.rectRoundExtents' instead"] #-}
rectRound ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> m (Rect)
rectRound :: Rect -> m Rect
rectRound r :: Rect
r = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Rect
res <- Int -> IO (Ptr Rect)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 16 :: IO (Ptr Rect)
Ptr Rect -> Ptr Rect -> IO ()
graphene_rect_round Ptr Rect
r' Ptr Rect
res
Rect
res' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rect -> Rect
Rect) Ptr Rect
res
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
res'
#if defined(ENABLE_OVERLOADING)
data RectRoundMethodInfo
instance (signature ~ (m (Rect)), MonadIO m) => O.MethodInfo RectRoundMethodInfo Rect signature where
overloadedMethod = rectRound
#endif
foreign import ccall "graphene_rect_round_extents" graphene_rect_round_extents ::
Ptr Rect ->
Ptr Rect ->
IO ()
rectRoundExtents ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> m (Rect)
rectRoundExtents :: Rect -> m Rect
rectRoundExtents r :: Rect
r = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Rect
res <- Int -> IO (Ptr Rect)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 16 :: IO (Ptr Rect)
Ptr Rect -> Ptr Rect -> IO ()
graphene_rect_round_extents Ptr Rect
r' Ptr Rect
res
Rect
res' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rect -> Rect
Rect) Ptr Rect
res
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
res'
#if defined(ENABLE_OVERLOADING)
data RectRoundExtentsMethodInfo
instance (signature ~ (m (Rect)), MonadIO m) => O.MethodInfo RectRoundExtentsMethodInfo Rect signature where
overloadedMethod = rectRoundExtents
#endif
foreign import ccall "graphene_rect_round_to_pixel" graphene_rect_round_to_pixel ::
Ptr Rect ->
IO (Ptr Rect)
{-# DEPRECATED rectRoundToPixel ["(Since version 1.4)","Use 'GI.Graphene.Structs.Rect.rectRound' instead"] #-}
rectRoundToPixel ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> m Rect
rectRoundToPixel :: Rect -> m Rect
rectRoundToPixel r :: Rect
r = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
Ptr Rect
result <- Ptr Rect -> IO (Ptr Rect)
graphene_rect_round_to_pixel Ptr Rect
r'
Text -> Ptr Rect -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "rectRoundToPixel" Ptr Rect
result
Rect
result' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Rect -> Rect
Rect) Ptr Rect
result
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
result'
#if defined(ENABLE_OVERLOADING)
data RectRoundToPixelMethodInfo
instance (signature ~ (m Rect), MonadIO m) => O.MethodInfo RectRoundToPixelMethodInfo Rect signature where
overloadedMethod = rectRoundToPixel
#endif
foreign import ccall "graphene_rect_scale" graphene_rect_scale ::
Ptr Rect ->
CFloat ->
CFloat ->
Ptr Rect ->
IO ()
rectScale ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> Float
-> Float
-> m (Rect)
rectScale :: Rect -> Float -> Float -> m Rect
rectScale r :: Rect
r sH :: Float
sH sV :: Float
sV = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
r' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
r
let sH' :: CFloat
sH' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
sH
let sV' :: CFloat
sV' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
sV
Ptr Rect
res <- Int -> IO (Ptr Rect)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 16 :: IO (Ptr Rect)
Ptr Rect -> CFloat -> CFloat -> Ptr Rect -> IO ()
graphene_rect_scale Ptr Rect
r' CFloat
sH' CFloat
sV' Ptr Rect
res
Rect
res' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rect -> Rect
Rect) Ptr Rect
res
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
r
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
res'
#if defined(ENABLE_OVERLOADING)
data RectScaleMethodInfo
instance (signature ~ (Float -> Float -> m (Rect)), MonadIO m) => O.MethodInfo RectScaleMethodInfo Rect signature where
overloadedMethod = rectScale
#endif
foreign import ccall "graphene_rect_union" graphene_rect_union ::
Ptr Rect ->
Ptr Rect ->
Ptr Rect ->
IO ()
rectUnion ::
(B.CallStack.HasCallStack, MonadIO m) =>
Rect
-> Rect
-> m (Rect)
rectUnion :: Rect -> Rect -> m Rect
rectUnion a :: Rect
a b :: Rect
b = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
a' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
a
Ptr Rect
b' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
b
Ptr Rect
res <- Int -> IO (Ptr Rect)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 16 :: IO (Ptr Rect)
Ptr Rect -> Ptr Rect -> Ptr Rect -> IO ()
graphene_rect_union Ptr Rect
a' Ptr Rect
b' Ptr Rect
res
Rect
res' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rect -> Rect
Rect) Ptr Rect
res
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
a
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
b
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
res'
#if defined(ENABLE_OVERLOADING)
data RectUnionMethodInfo
instance (signature ~ (Rect -> m (Rect)), MonadIO m) => O.MethodInfo RectUnionMethodInfo Rect signature where
overloadedMethod = rectUnion
#endif
foreign import ccall "graphene_rect_alloc" graphene_rect_alloc ::
IO (Ptr Rect)
rectAlloc ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Rect
rectAlloc :: m Rect
rectAlloc = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
result <- IO (Ptr Rect)
graphene_rect_alloc
Text -> Ptr Rect -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "rectAlloc" Ptr Rect
result
Rect
result' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rect -> Rect
Rect) Ptr Rect
result
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "graphene_rect_zero" graphene_rect_zero ::
IO (Ptr Rect)
rectZero ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Rect
rectZero :: m Rect
rectZero = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
result <- IO (Ptr Rect)
graphene_rect_zero
Text -> Ptr Rect -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "rectZero" Ptr Rect
result
Rect
result' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Rect -> Rect
Rect) Ptr Rect
result
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
result'
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveRectMethod (t :: Symbol) (o :: *) :: * where
ResolveRectMethod "containsPoint" o = RectContainsPointMethodInfo
ResolveRectMethod "containsRect" o = RectContainsRectMethodInfo
ResolveRectMethod "equal" o = RectEqualMethodInfo
ResolveRectMethod "expand" o = RectExpandMethodInfo
ResolveRectMethod "free" o = RectFreeMethodInfo
ResolveRectMethod "init" o = RectInitMethodInfo
ResolveRectMethod "initFromRect" o = RectInitFromRectMethodInfo
ResolveRectMethod "inset" o = RectInsetMethodInfo
ResolveRectMethod "insetR" o = RectInsetRMethodInfo
ResolveRectMethod "interpolate" o = RectInterpolateMethodInfo
ResolveRectMethod "intersection" o = RectIntersectionMethodInfo
ResolveRectMethod "normalize" o = RectNormalizeMethodInfo
ResolveRectMethod "normalizeR" o = RectNormalizeRMethodInfo
ResolveRectMethod "offset" o = RectOffsetMethodInfo
ResolveRectMethod "offsetR" o = RectOffsetRMethodInfo
ResolveRectMethod "round" o = RectRoundMethodInfo
ResolveRectMethod "roundExtents" o = RectRoundExtentsMethodInfo
ResolveRectMethod "roundToPixel" o = RectRoundToPixelMethodInfo
ResolveRectMethod "scale" o = RectScaleMethodInfo
ResolveRectMethod "union" o = RectUnionMethodInfo
ResolveRectMethod "getArea" o = RectGetAreaMethodInfo
ResolveRectMethod "getBottomLeft" o = RectGetBottomLeftMethodInfo
ResolveRectMethod "getBottomRight" o = RectGetBottomRightMethodInfo
ResolveRectMethod "getCenter" o = RectGetCenterMethodInfo
ResolveRectMethod "getHeight" o = RectGetHeightMethodInfo
ResolveRectMethod "getTopLeft" o = RectGetTopLeftMethodInfo
ResolveRectMethod "getTopRight" o = RectGetTopRightMethodInfo
ResolveRectMethod "getWidth" o = RectGetWidthMethodInfo
ResolveRectMethod "getX" o = RectGetXMethodInfo
ResolveRectMethod "getY" o = RectGetYMethodInfo
ResolveRectMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveRectMethod t Rect, O.MethodInfo info Rect p) => OL.IsLabel t (Rect -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif