{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gsk.Structs.RoundedRect
(
RoundedRect(..) ,
newZeroRoundedRect ,
#if defined(ENABLE_OVERLOADING)
ResolveRoundedRectMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
RoundedRectContainsPointMethodInfo ,
#endif
roundedRectContainsPoint ,
#if defined(ENABLE_OVERLOADING)
RoundedRectContainsRectMethodInfo ,
#endif
roundedRectContainsRect ,
#if defined(ENABLE_OVERLOADING)
RoundedRectInitMethodInfo ,
#endif
roundedRectInit ,
#if defined(ENABLE_OVERLOADING)
RoundedRectInitCopyMethodInfo ,
#endif
roundedRectInitCopy ,
#if defined(ENABLE_OVERLOADING)
RoundedRectInitFromRectMethodInfo ,
#endif
roundedRectInitFromRect ,
#if defined(ENABLE_OVERLOADING)
RoundedRectIntersectsRectMethodInfo ,
#endif
roundedRectIntersectsRect ,
#if defined(ENABLE_OVERLOADING)
RoundedRectIsRectilinearMethodInfo ,
#endif
roundedRectIsRectilinear ,
#if defined(ENABLE_OVERLOADING)
RoundedRectNormalizeMethodInfo ,
#endif
roundedRectNormalize ,
#if defined(ENABLE_OVERLOADING)
RoundedRectOffsetMethodInfo ,
#endif
roundedRectOffset ,
#if defined(ENABLE_OVERLOADING)
RoundedRectShrinkMethodInfo ,
#endif
roundedRectShrink ,
getRoundedRectBounds ,
#if defined(ENABLE_OVERLOADING)
roundedRect_bounds ,
#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.BasicTypes as B.Types
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 Control.Monad.IO.Class as MIO
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 qualified GI.Graphene.Structs.Point as Graphene.Point
import qualified GI.Graphene.Structs.Rect as Graphene.Rect
import qualified GI.Graphene.Structs.Size as Graphene.Size
newtype RoundedRect = RoundedRect (SP.ManagedPtr RoundedRect)
deriving (RoundedRect -> RoundedRect -> Bool
(RoundedRect -> RoundedRect -> Bool)
-> (RoundedRect -> RoundedRect -> Bool) -> Eq RoundedRect
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RoundedRect -> RoundedRect -> Bool
$c/= :: RoundedRect -> RoundedRect -> Bool
== :: RoundedRect -> RoundedRect -> Bool
$c== :: RoundedRect -> RoundedRect -> Bool
Eq)
instance SP.ManagedPtrNewtype RoundedRect where
toManagedPtr :: RoundedRect -> ManagedPtr RoundedRect
toManagedPtr (RoundedRect ManagedPtr RoundedRect
p) = ManagedPtr RoundedRect
p
instance BoxedPtr RoundedRect where
boxedPtrCopy :: RoundedRect -> IO RoundedRect
boxedPtrCopy = \RoundedRect
p -> RoundedRect
-> (Ptr RoundedRect -> IO RoundedRect) -> IO RoundedRect
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr RoundedRect
p (Int -> Ptr RoundedRect -> IO (Ptr RoundedRect)
forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
copyBytes Int
48 (Ptr RoundedRect -> IO (Ptr RoundedRect))
-> (Ptr RoundedRect -> IO RoundedRect)
-> Ptr RoundedRect
-> IO RoundedRect
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> (ManagedPtr RoundedRect -> RoundedRect)
-> Ptr RoundedRect -> IO RoundedRect
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.wrapPtr ManagedPtr RoundedRect -> RoundedRect
RoundedRect)
boxedPtrFree :: RoundedRect -> IO ()
boxedPtrFree = \RoundedRect
x -> RoundedRect -> (Ptr RoundedRect -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
SP.withManagedPtr RoundedRect
x Ptr RoundedRect -> IO ()
forall a. Ptr a -> IO ()
SP.freeMem
instance CallocPtr RoundedRect where
boxedPtrCalloc :: IO (Ptr RoundedRect)
boxedPtrCalloc = Int -> IO (Ptr RoundedRect)
forall a. Int -> IO (Ptr a)
callocBytes Int
48
newZeroRoundedRect :: MonadIO m => m RoundedRect
newZeroRoundedRect :: m RoundedRect
newZeroRoundedRect = IO RoundedRect -> m RoundedRect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RoundedRect -> m RoundedRect)
-> IO RoundedRect -> m RoundedRect
forall a b. (a -> b) -> a -> b
$ IO (Ptr RoundedRect)
forall a. CallocPtr a => IO (Ptr a)
boxedPtrCalloc IO (Ptr RoundedRect)
-> (Ptr RoundedRect -> IO RoundedRect) -> IO RoundedRect
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr RoundedRect -> RoundedRect)
-> Ptr RoundedRect -> IO RoundedRect
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr RoundedRect -> RoundedRect
RoundedRect
instance tag ~ 'AttrSet => Constructible RoundedRect tag where
new :: (ManagedPtr RoundedRect -> RoundedRect)
-> [AttrOp RoundedRect tag] -> m RoundedRect
new ManagedPtr RoundedRect -> RoundedRect
_ [AttrOp RoundedRect tag]
attrs = do
RoundedRect
o <- m RoundedRect
forall (m :: * -> *). MonadIO m => m RoundedRect
newZeroRoundedRect
RoundedRect -> [AttrOp RoundedRect 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set RoundedRect
o [AttrOp RoundedRect tag]
[AttrOp RoundedRect 'AttrSet]
attrs
RoundedRect -> m RoundedRect
forall (m :: * -> *) a. Monad m => a -> m a
return RoundedRect
o
getRoundedRectBounds :: MonadIO m => RoundedRect -> m Graphene.Rect.Rect
getRoundedRectBounds :: RoundedRect -> m Rect
getRoundedRectBounds RoundedRect
s = 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
$ RoundedRect -> (Ptr RoundedRect -> IO Rect) -> IO Rect
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RoundedRect
s ((Ptr RoundedRect -> IO Rect) -> IO Rect)
-> (Ptr RoundedRect -> IO Rect) -> IO Rect
forall a b. (a -> b) -> a -> b
$ \Ptr RoundedRect
ptr -> do
let val :: Ptr Rect
val = Ptr RoundedRect
ptr Ptr RoundedRect -> Int -> Ptr Rect
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Graphene.Rect.Rect)
Rect
val' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Rect -> Rect
Graphene.Rect.Rect) Ptr Rect
val
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
val'
#if defined(ENABLE_OVERLOADING)
data RoundedRectBoundsFieldInfo
instance AttrInfo RoundedRectBoundsFieldInfo where
type AttrBaseTypeConstraint RoundedRectBoundsFieldInfo = (~) RoundedRect
type AttrAllowedOps RoundedRectBoundsFieldInfo = '[ 'AttrGet]
type AttrSetTypeConstraint RoundedRectBoundsFieldInfo = (~) (Ptr Graphene.Rect.Rect)
type AttrTransferTypeConstraint RoundedRectBoundsFieldInfo = (~)(Ptr Graphene.Rect.Rect)
type AttrTransferType RoundedRectBoundsFieldInfo = (Ptr Graphene.Rect.Rect)
type AttrGetType RoundedRectBoundsFieldInfo = Graphene.Rect.Rect
type AttrLabel RoundedRectBoundsFieldInfo = "bounds"
type AttrOrigin RoundedRectBoundsFieldInfo = RoundedRect
attrGet = getRoundedRectBounds
attrSet = undefined
attrConstruct = undefined
attrClear = undefined
attrTransfer = undefined
roundedRect_bounds :: AttrLabelProxy "bounds"
roundedRect_bounds = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList RoundedRect
type instance O.AttributeList RoundedRect = RoundedRectAttributeList
type RoundedRectAttributeList = ('[ '("bounds", RoundedRectBoundsFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gsk_rounded_rect_contains_point" gsk_rounded_rect_contains_point ::
Ptr RoundedRect ->
Ptr Graphene.Point.Point ->
IO CInt
roundedRectContainsPoint ::
(B.CallStack.HasCallStack, MonadIO m) =>
RoundedRect
-> Graphene.Point.Point
-> m Bool
roundedRectContainsPoint :: RoundedRect -> Point -> m Bool
roundedRectContainsPoint RoundedRect
self Point
point = 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 RoundedRect
self' <- RoundedRect -> IO (Ptr RoundedRect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RoundedRect
self
Ptr Point
point' <- Point -> IO (Ptr Point)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point
point
CInt
result <- Ptr RoundedRect -> Ptr Point -> IO CInt
gsk_rounded_rect_contains_point Ptr RoundedRect
self' Ptr Point
point'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
RoundedRect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RoundedRect
self
Point -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point
point
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data RoundedRectContainsPointMethodInfo
instance (signature ~ (Graphene.Point.Point -> m Bool), MonadIO m) => O.MethodInfo RoundedRectContainsPointMethodInfo RoundedRect signature where
overloadedMethod = roundedRectContainsPoint
#endif
foreign import ccall "gsk_rounded_rect_contains_rect" gsk_rounded_rect_contains_rect ::
Ptr RoundedRect ->
Ptr Graphene.Rect.Rect ->
IO CInt
roundedRectContainsRect ::
(B.CallStack.HasCallStack, MonadIO m) =>
RoundedRect
-> Graphene.Rect.Rect
-> m Bool
roundedRectContainsRect :: RoundedRect -> Rect -> m Bool
roundedRectContainsRect RoundedRect
self Rect
rect = 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 RoundedRect
self' <- RoundedRect -> IO (Ptr RoundedRect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RoundedRect
self
Ptr Rect
rect' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
rect
CInt
result <- Ptr RoundedRect -> Ptr Rect -> IO CInt
gsk_rounded_rect_contains_rect Ptr RoundedRect
self' Ptr Rect
rect'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
RoundedRect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RoundedRect
self
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
rect
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data RoundedRectContainsRectMethodInfo
instance (signature ~ (Graphene.Rect.Rect -> m Bool), MonadIO m) => O.MethodInfo RoundedRectContainsRectMethodInfo RoundedRect signature where
overloadedMethod = roundedRectContainsRect
#endif
foreign import ccall "gsk_rounded_rect_init" gsk_rounded_rect_init ::
Ptr RoundedRect ->
Ptr Graphene.Rect.Rect ->
Ptr Graphene.Size.Size ->
Ptr Graphene.Size.Size ->
Ptr Graphene.Size.Size ->
Ptr Graphene.Size.Size ->
IO (Ptr RoundedRect)
roundedRectInit ::
(B.CallStack.HasCallStack, MonadIO m) =>
RoundedRect
-> Graphene.Rect.Rect
-> Graphene.Size.Size
-> Graphene.Size.Size
-> Graphene.Size.Size
-> Graphene.Size.Size
-> m RoundedRect
roundedRectInit :: RoundedRect
-> Rect -> Size -> Size -> Size -> Size -> m RoundedRect
roundedRectInit RoundedRect
self Rect
bounds Size
topLeft Size
topRight Size
bottomRight Size
bottomLeft = IO RoundedRect -> m RoundedRect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RoundedRect -> m RoundedRect)
-> IO RoundedRect -> m RoundedRect
forall a b. (a -> b) -> a -> b
$ do
Ptr RoundedRect
self' <- RoundedRect -> IO (Ptr RoundedRect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RoundedRect
self
Ptr Rect
bounds' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
bounds
Ptr Size
topLeft' <- Size -> IO (Ptr Size)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Size
topLeft
Ptr Size
topRight' <- Size -> IO (Ptr Size)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Size
topRight
Ptr Size
bottomRight' <- Size -> IO (Ptr Size)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Size
bottomRight
Ptr Size
bottomLeft' <- Size -> IO (Ptr Size)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Size
bottomLeft
Ptr RoundedRect
result <- Ptr RoundedRect
-> Ptr Rect
-> Ptr Size
-> Ptr Size
-> Ptr Size
-> Ptr Size
-> IO (Ptr RoundedRect)
gsk_rounded_rect_init Ptr RoundedRect
self' Ptr Rect
bounds' Ptr Size
topLeft' Ptr Size
topRight' Ptr Size
bottomRight' Ptr Size
bottomLeft'
Text -> Ptr RoundedRect -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"roundedRectInit" Ptr RoundedRect
result
RoundedRect
result' <- ((ManagedPtr RoundedRect -> RoundedRect)
-> Ptr RoundedRect -> IO RoundedRect
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr RoundedRect -> RoundedRect
RoundedRect) Ptr RoundedRect
result
RoundedRect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RoundedRect
self
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
bounds
Size -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Size
topLeft
Size -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Size
topRight
Size -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Size
bottomRight
Size -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Size
bottomLeft
RoundedRect -> IO RoundedRect
forall (m :: * -> *) a. Monad m => a -> m a
return RoundedRect
result'
#if defined(ENABLE_OVERLOADING)
data RoundedRectInitMethodInfo
instance (signature ~ (Graphene.Rect.Rect -> Graphene.Size.Size -> Graphene.Size.Size -> Graphene.Size.Size -> Graphene.Size.Size -> m RoundedRect), MonadIO m) => O.MethodInfo RoundedRectInitMethodInfo RoundedRect signature where
overloadedMethod = roundedRectInit
#endif
foreign import ccall "gsk_rounded_rect_init_copy" gsk_rounded_rect_init_copy ::
Ptr RoundedRect ->
Ptr RoundedRect ->
IO (Ptr RoundedRect)
roundedRectInitCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
RoundedRect
-> RoundedRect
-> m RoundedRect
roundedRectInitCopy :: RoundedRect -> RoundedRect -> m RoundedRect
roundedRectInitCopy RoundedRect
self RoundedRect
src = IO RoundedRect -> m RoundedRect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RoundedRect -> m RoundedRect)
-> IO RoundedRect -> m RoundedRect
forall a b. (a -> b) -> a -> b
$ do
Ptr RoundedRect
self' <- RoundedRect -> IO (Ptr RoundedRect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RoundedRect
self
Ptr RoundedRect
src' <- RoundedRect -> IO (Ptr RoundedRect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RoundedRect
src
Ptr RoundedRect
result <- Ptr RoundedRect -> Ptr RoundedRect -> IO (Ptr RoundedRect)
gsk_rounded_rect_init_copy Ptr RoundedRect
self' Ptr RoundedRect
src'
Text -> Ptr RoundedRect -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"roundedRectInitCopy" Ptr RoundedRect
result
RoundedRect
result' <- ((ManagedPtr RoundedRect -> RoundedRect)
-> Ptr RoundedRect -> IO RoundedRect
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr RoundedRect -> RoundedRect
RoundedRect) Ptr RoundedRect
result
RoundedRect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RoundedRect
self
RoundedRect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RoundedRect
src
RoundedRect -> IO RoundedRect
forall (m :: * -> *) a. Monad m => a -> m a
return RoundedRect
result'
#if defined(ENABLE_OVERLOADING)
data RoundedRectInitCopyMethodInfo
instance (signature ~ (RoundedRect -> m RoundedRect), MonadIO m) => O.MethodInfo RoundedRectInitCopyMethodInfo RoundedRect signature where
overloadedMethod = roundedRectInitCopy
#endif
foreign import ccall "gsk_rounded_rect_init_from_rect" gsk_rounded_rect_init_from_rect ::
Ptr RoundedRect ->
Ptr Graphene.Rect.Rect ->
CFloat ->
IO (Ptr RoundedRect)
roundedRectInitFromRect ::
(B.CallStack.HasCallStack, MonadIO m) =>
RoundedRect
-> Graphene.Rect.Rect
-> Float
-> m RoundedRect
roundedRectInitFromRect :: RoundedRect -> Rect -> Float -> m RoundedRect
roundedRectInitFromRect RoundedRect
self Rect
bounds Float
radius = IO RoundedRect -> m RoundedRect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RoundedRect -> m RoundedRect)
-> IO RoundedRect -> m RoundedRect
forall a b. (a -> b) -> a -> b
$ do
Ptr RoundedRect
self' <- RoundedRect -> IO (Ptr RoundedRect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RoundedRect
self
Ptr Rect
bounds' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
bounds
let radius' :: CFloat
radius' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
radius
Ptr RoundedRect
result <- Ptr RoundedRect -> Ptr Rect -> CFloat -> IO (Ptr RoundedRect)
gsk_rounded_rect_init_from_rect Ptr RoundedRect
self' Ptr Rect
bounds' CFloat
radius'
Text -> Ptr RoundedRect -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"roundedRectInitFromRect" Ptr RoundedRect
result
RoundedRect
result' <- ((ManagedPtr RoundedRect -> RoundedRect)
-> Ptr RoundedRect -> IO RoundedRect
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr RoundedRect -> RoundedRect
RoundedRect) Ptr RoundedRect
result
RoundedRect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RoundedRect
self
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
bounds
RoundedRect -> IO RoundedRect
forall (m :: * -> *) a. Monad m => a -> m a
return RoundedRect
result'
#if defined(ENABLE_OVERLOADING)
data RoundedRectInitFromRectMethodInfo
instance (signature ~ (Graphene.Rect.Rect -> Float -> m RoundedRect), MonadIO m) => O.MethodInfo RoundedRectInitFromRectMethodInfo RoundedRect signature where
overloadedMethod = roundedRectInitFromRect
#endif
foreign import ccall "gsk_rounded_rect_intersects_rect" gsk_rounded_rect_intersects_rect ::
Ptr RoundedRect ->
Ptr Graphene.Rect.Rect ->
IO CInt
roundedRectIntersectsRect ::
(B.CallStack.HasCallStack, MonadIO m) =>
RoundedRect
-> Graphene.Rect.Rect
-> m Bool
roundedRectIntersectsRect :: RoundedRect -> Rect -> m Bool
roundedRectIntersectsRect RoundedRect
self Rect
rect = 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 RoundedRect
self' <- RoundedRect -> IO (Ptr RoundedRect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RoundedRect
self
Ptr Rect
rect' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
rect
CInt
result <- Ptr RoundedRect -> Ptr Rect -> IO CInt
gsk_rounded_rect_intersects_rect Ptr RoundedRect
self' Ptr Rect
rect'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
RoundedRect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RoundedRect
self
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
rect
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data RoundedRectIntersectsRectMethodInfo
instance (signature ~ (Graphene.Rect.Rect -> m Bool), MonadIO m) => O.MethodInfo RoundedRectIntersectsRectMethodInfo RoundedRect signature where
overloadedMethod = roundedRectIntersectsRect
#endif
foreign import ccall "gsk_rounded_rect_is_rectilinear" gsk_rounded_rect_is_rectilinear ::
Ptr RoundedRect ->
IO CInt
roundedRectIsRectilinear ::
(B.CallStack.HasCallStack, MonadIO m) =>
RoundedRect
-> m Bool
roundedRectIsRectilinear :: RoundedRect -> m Bool
roundedRectIsRectilinear RoundedRect
self = 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 RoundedRect
self' <- RoundedRect -> IO (Ptr RoundedRect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RoundedRect
self
CInt
result <- Ptr RoundedRect -> IO CInt
gsk_rounded_rect_is_rectilinear Ptr RoundedRect
self'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
RoundedRect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RoundedRect
self
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data RoundedRectIsRectilinearMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo RoundedRectIsRectilinearMethodInfo RoundedRect signature where
overloadedMethod = roundedRectIsRectilinear
#endif
foreign import ccall "gsk_rounded_rect_normalize" gsk_rounded_rect_normalize ::
Ptr RoundedRect ->
IO (Ptr RoundedRect)
roundedRectNormalize ::
(B.CallStack.HasCallStack, MonadIO m) =>
RoundedRect
-> m RoundedRect
roundedRectNormalize :: RoundedRect -> m RoundedRect
roundedRectNormalize RoundedRect
self = IO RoundedRect -> m RoundedRect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RoundedRect -> m RoundedRect)
-> IO RoundedRect -> m RoundedRect
forall a b. (a -> b) -> a -> b
$ do
Ptr RoundedRect
self' <- RoundedRect -> IO (Ptr RoundedRect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RoundedRect
self
Ptr RoundedRect
result <- Ptr RoundedRect -> IO (Ptr RoundedRect)
gsk_rounded_rect_normalize Ptr RoundedRect
self'
Text -> Ptr RoundedRect -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"roundedRectNormalize" Ptr RoundedRect
result
RoundedRect
result' <- ((ManagedPtr RoundedRect -> RoundedRect)
-> Ptr RoundedRect -> IO RoundedRect
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr RoundedRect -> RoundedRect
RoundedRect) Ptr RoundedRect
result
RoundedRect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RoundedRect
self
RoundedRect -> IO RoundedRect
forall (m :: * -> *) a. Monad m => a -> m a
return RoundedRect
result'
#if defined(ENABLE_OVERLOADING)
data RoundedRectNormalizeMethodInfo
instance (signature ~ (m RoundedRect), MonadIO m) => O.MethodInfo RoundedRectNormalizeMethodInfo RoundedRect signature where
overloadedMethod = roundedRectNormalize
#endif
foreign import ccall "gsk_rounded_rect_offset" gsk_rounded_rect_offset ::
Ptr RoundedRect ->
CFloat ->
CFloat ->
IO (Ptr RoundedRect)
roundedRectOffset ::
(B.CallStack.HasCallStack, MonadIO m) =>
RoundedRect
-> Float
-> Float
-> m RoundedRect
roundedRectOffset :: RoundedRect -> Float -> Float -> m RoundedRect
roundedRectOffset RoundedRect
self Float
dx Float
dy = IO RoundedRect -> m RoundedRect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RoundedRect -> m RoundedRect)
-> IO RoundedRect -> m RoundedRect
forall a b. (a -> b) -> a -> b
$ do
Ptr RoundedRect
self' <- RoundedRect -> IO (Ptr RoundedRect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RoundedRect
self
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 RoundedRect
result <- Ptr RoundedRect -> CFloat -> CFloat -> IO (Ptr RoundedRect)
gsk_rounded_rect_offset Ptr RoundedRect
self' CFloat
dx' CFloat
dy'
Text -> Ptr RoundedRect -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"roundedRectOffset" Ptr RoundedRect
result
RoundedRect
result' <- ((ManagedPtr RoundedRect -> RoundedRect)
-> Ptr RoundedRect -> IO RoundedRect
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr RoundedRect -> RoundedRect
RoundedRect) Ptr RoundedRect
result
RoundedRect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RoundedRect
self
RoundedRect -> IO RoundedRect
forall (m :: * -> *) a. Monad m => a -> m a
return RoundedRect
result'
#if defined(ENABLE_OVERLOADING)
data RoundedRectOffsetMethodInfo
instance (signature ~ (Float -> Float -> m RoundedRect), MonadIO m) => O.MethodInfo RoundedRectOffsetMethodInfo RoundedRect signature where
overloadedMethod = roundedRectOffset
#endif
foreign import ccall "gsk_rounded_rect_shrink" gsk_rounded_rect_shrink ::
Ptr RoundedRect ->
CFloat ->
CFloat ->
CFloat ->
CFloat ->
IO (Ptr RoundedRect)
roundedRectShrink ::
(B.CallStack.HasCallStack, MonadIO m) =>
RoundedRect
-> Float
-> Float
-> Float
-> Float
-> m RoundedRect
roundedRectShrink :: RoundedRect -> Float -> Float -> Float -> Float -> m RoundedRect
roundedRectShrink RoundedRect
self Float
top Float
right Float
bottom Float
left = IO RoundedRect -> m RoundedRect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RoundedRect -> m RoundedRect)
-> IO RoundedRect -> m RoundedRect
forall a b. (a -> b) -> a -> b
$ do
Ptr RoundedRect
self' <- RoundedRect -> IO (Ptr RoundedRect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RoundedRect
self
let top' :: CFloat
top' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
top
let right' :: CFloat
right' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
right
let bottom' :: CFloat
bottom' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
bottom
let left' :: CFloat
left' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
left
Ptr RoundedRect
result <- Ptr RoundedRect
-> CFloat -> CFloat -> CFloat -> CFloat -> IO (Ptr RoundedRect)
gsk_rounded_rect_shrink Ptr RoundedRect
self' CFloat
top' CFloat
right' CFloat
bottom' CFloat
left'
Text -> Ptr RoundedRect -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"roundedRectShrink" Ptr RoundedRect
result
RoundedRect
result' <- ((ManagedPtr RoundedRect -> RoundedRect)
-> Ptr RoundedRect -> IO RoundedRect
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr RoundedRect -> RoundedRect
RoundedRect) Ptr RoundedRect
result
RoundedRect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RoundedRect
self
RoundedRect -> IO RoundedRect
forall (m :: * -> *) a. Monad m => a -> m a
return RoundedRect
result'
#if defined(ENABLE_OVERLOADING)
data RoundedRectShrinkMethodInfo
instance (signature ~ (Float -> Float -> Float -> Float -> m RoundedRect), MonadIO m) => O.MethodInfo RoundedRectShrinkMethodInfo RoundedRect signature where
overloadedMethod = roundedRectShrink
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveRoundedRectMethod (t :: Symbol) (o :: *) :: * where
ResolveRoundedRectMethod "containsPoint" o = RoundedRectContainsPointMethodInfo
ResolveRoundedRectMethod "containsRect" o = RoundedRectContainsRectMethodInfo
ResolveRoundedRectMethod "init" o = RoundedRectInitMethodInfo
ResolveRoundedRectMethod "initCopy" o = RoundedRectInitCopyMethodInfo
ResolveRoundedRectMethod "initFromRect" o = RoundedRectInitFromRectMethodInfo
ResolveRoundedRectMethod "intersectsRect" o = RoundedRectIntersectsRectMethodInfo
ResolveRoundedRectMethod "isRectilinear" o = RoundedRectIsRectilinearMethodInfo
ResolveRoundedRectMethod "normalize" o = RoundedRectNormalizeMethodInfo
ResolveRoundedRectMethod "offset" o = RoundedRectOffsetMethodInfo
ResolveRoundedRectMethod "shrink" o = RoundedRectShrinkMethodInfo
ResolveRoundedRectMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveRoundedRectMethod t RoundedRect, O.MethodInfo info RoundedRect p) => OL.IsLabel t (RoundedRect -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif