{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Graphene.Structs.Box
(
Box(..) ,
newZeroBox ,
#if defined(ENABLE_OVERLOADING)
ResolveBoxMethod ,
#endif
boxAlloc ,
#if defined(ENABLE_OVERLOADING)
BoxContainsBoxMethodInfo ,
#endif
boxContainsBox ,
#if defined(ENABLE_OVERLOADING)
BoxContainsPointMethodInfo ,
#endif
boxContainsPoint ,
boxEmpty ,
#if defined(ENABLE_OVERLOADING)
BoxEqualMethodInfo ,
#endif
boxEqual ,
#if defined(ENABLE_OVERLOADING)
BoxExpandMethodInfo ,
#endif
boxExpand ,
#if defined(ENABLE_OVERLOADING)
BoxExpandScalarMethodInfo ,
#endif
boxExpandScalar ,
#if defined(ENABLE_OVERLOADING)
BoxExpandVec3MethodInfo ,
#endif
boxExpandVec3 ,
#if defined(ENABLE_OVERLOADING)
BoxFreeMethodInfo ,
#endif
boxFree ,
#if defined(ENABLE_OVERLOADING)
BoxGetBoundingSphereMethodInfo ,
#endif
boxGetBoundingSphere ,
#if defined(ENABLE_OVERLOADING)
BoxGetCenterMethodInfo ,
#endif
boxGetCenter ,
#if defined(ENABLE_OVERLOADING)
BoxGetDepthMethodInfo ,
#endif
boxGetDepth ,
#if defined(ENABLE_OVERLOADING)
BoxGetHeightMethodInfo ,
#endif
boxGetHeight ,
#if defined(ENABLE_OVERLOADING)
BoxGetMaxMethodInfo ,
#endif
boxGetMax ,
#if defined(ENABLE_OVERLOADING)
BoxGetMinMethodInfo ,
#endif
boxGetMin ,
#if defined(ENABLE_OVERLOADING)
BoxGetSizeMethodInfo ,
#endif
boxGetSize ,
#if defined(ENABLE_OVERLOADING)
BoxGetWidthMethodInfo ,
#endif
boxGetWidth ,
boxInfinite ,
#if defined(ENABLE_OVERLOADING)
BoxInitMethodInfo ,
#endif
boxInit ,
#if defined(ENABLE_OVERLOADING)
BoxInitFromBoxMethodInfo ,
#endif
boxInitFromBox ,
#if defined(ENABLE_OVERLOADING)
BoxInitFromPointsMethodInfo ,
#endif
boxInitFromPoints ,
#if defined(ENABLE_OVERLOADING)
BoxInitFromVec3MethodInfo ,
#endif
boxInitFromVec3 ,
#if defined(ENABLE_OVERLOADING)
BoxInitFromVectorsMethodInfo ,
#endif
boxInitFromVectors ,
#if defined(ENABLE_OVERLOADING)
BoxIntersectionMethodInfo ,
#endif
boxIntersection ,
boxMinusOne ,
boxOne ,
boxOneMinusOne ,
#if defined(ENABLE_OVERLOADING)
BoxUnionMethodInfo ,
#endif
boxUnion ,
boxZero ,
) 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.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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.Coerce as Coerce
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 GHC.Records as R
import {-# SOURCE #-} qualified GI.Graphene.Structs.Point3D as Graphene.Point3D
import {-# SOURCE #-} qualified GI.Graphene.Structs.Sphere as Graphene.Sphere
import {-# SOURCE #-} qualified GI.Graphene.Structs.Vec3 as Graphene.Vec3
newtype Box = Box (SP.ManagedPtr Box)
deriving (Box -> Box -> Bool
(Box -> Box -> Bool) -> (Box -> Box -> Bool) -> Eq Box
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Box -> Box -> Bool
== :: Box -> Box -> Bool
$c/= :: Box -> Box -> Bool
/= :: Box -> Box -> Bool
Eq)
instance SP.ManagedPtrNewtype Box where
toManagedPtr :: Box -> ManagedPtr Box
toManagedPtr (Box ManagedPtr Box
p) = ManagedPtr Box
p
foreign import ccall "graphene_box_get_type" c_graphene_box_get_type ::
IO GType
type instance O.ParentTypes Box = '[]
instance O.HasParentTypes Box
instance B.Types.TypedObject Box where
glibType :: IO GType
glibType = IO GType
c_graphene_box_get_type
instance B.Types.GBoxed Box
instance B.GValue.IsGValue (Maybe Box) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_graphene_box_get_type
gvalueSet_ :: Ptr GValue -> Maybe Box -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Box
P.Nothing = Ptr GValue -> Ptr Box -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr Box
forall a. Ptr a
FP.nullPtr :: FP.Ptr Box)
gvalueSet_ Ptr GValue
gv (P.Just Box
obj) = Box -> (Ptr Box -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Box
obj (Ptr GValue -> Ptr Box -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Box)
gvalueGet_ Ptr GValue
gv = do
Ptr Box
ptr <- Ptr GValue -> IO (Ptr Box)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr Box)
if Ptr Box
ptr Ptr Box -> Ptr Box -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Box
forall a. Ptr a
FP.nullPtr
then Box -> Maybe Box
forall a. a -> Maybe a
P.Just (Box -> Maybe Box) -> IO Box -> IO (Maybe Box)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr Box -> Box
Box Ptr Box
ptr
else Maybe Box -> IO (Maybe Box)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Box
forall a. Maybe a
P.Nothing
newZeroBox :: MonadIO m => m Box
newZeroBox :: forall (m :: * -> *). MonadIO m => m Box
newZeroBox = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ Int -> IO (Ptr Box)
forall a. GBoxed a => Int -> IO (Ptr a)
callocBoxedBytes Int
32 IO (Ptr Box) -> (Ptr Box -> IO Box) -> IO Box
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Box -> Box
Box
instance tag ~ 'AttrSet => Constructible Box tag where
new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr Box -> Box) -> [AttrOp Box tag] -> m Box
new ManagedPtr Box -> Box
_ [AttrOp Box tag]
attrs = do
Box
o <- m Box
forall (m :: * -> *). MonadIO m => m Box
newZeroBox
Box -> [AttrOp Box 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set Box
o [AttrOp Box tag]
[AttrOp Box 'AttrSet]
attrs
Box -> m Box
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
o
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Box
type instance O.AttributeList Box = BoxAttributeList
type BoxAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "graphene_box_alloc" graphene_box_alloc ::
IO (Ptr Box)
boxAlloc ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Box
boxAlloc :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Box
boxAlloc = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
result <- IO (Ptr Box)
graphene_box_alloc
Text -> Ptr Box -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"boxAlloc" Ptr Box
result
Box
result' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Box -> Box
Box) Ptr Box
result
Box -> IO Box
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "graphene_box_contains_box" graphene_box_contains_box ::
Ptr Box ->
Ptr Box ->
IO CInt
boxContainsBox ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> Box
-> m Bool
boxContainsBox :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Box -> Box -> m Bool
boxContainsBox Box
a Box
b = IO Bool -> m Bool
forall a. IO a -> m a
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 Box
a' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
a
Ptr Box
b' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
b
CInt
result <- Ptr Box -> Ptr Box -> IO CInt
graphene_box_contains_box Ptr Box
a' Ptr Box
b'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
a
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
b
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BoxContainsBoxMethodInfo
instance (signature ~ (Box -> m Bool), MonadIO m) => O.OverloadedMethod BoxContainsBoxMethodInfo Box signature where
overloadedMethod = boxContainsBox
instance O.OverloadedMethodInfo BoxContainsBoxMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxContainsBox",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxContainsBox"
})
#endif
foreign import ccall "graphene_box_contains_point" graphene_box_contains_point ::
Ptr Box ->
Ptr Graphene.Point3D.Point3D ->
IO CInt
boxContainsPoint ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> Graphene.Point3D.Point3D
-> m Bool
boxContainsPoint :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Box -> Point3D -> m Bool
boxContainsPoint Box
box Point3D
point = IO Bool -> m Bool
forall a. IO a -> m a
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 Box
box' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
box
Ptr Point3D
point' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
point
CInt
result <- Ptr Box -> Ptr Point3D -> IO CInt
graphene_box_contains_point Ptr Box
box' Ptr Point3D
point'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
box
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
point
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BoxContainsPointMethodInfo
instance (signature ~ (Graphene.Point3D.Point3D -> m Bool), MonadIO m) => O.OverloadedMethod BoxContainsPointMethodInfo Box signature where
overloadedMethod = boxContainsPoint
instance O.OverloadedMethodInfo BoxContainsPointMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxContainsPoint",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxContainsPoint"
})
#endif
foreign import ccall "graphene_box_equal" graphene_box_equal ::
Ptr Box ->
Ptr Box ->
IO CInt
boxEqual ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> Box
-> m Bool
boxEqual :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Box -> Box -> m Bool
boxEqual Box
a Box
b = IO Bool -> m Bool
forall a. IO a -> m a
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 Box
a' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
a
Ptr Box
b' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
b
CInt
result <- Ptr Box -> Ptr Box -> IO CInt
graphene_box_equal Ptr Box
a' Ptr Box
b'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
a
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
b
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BoxEqualMethodInfo
instance (signature ~ (Box -> m Bool), MonadIO m) => O.OverloadedMethod BoxEqualMethodInfo Box signature where
overloadedMethod = boxEqual
instance O.OverloadedMethodInfo BoxEqualMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxEqual",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxEqual"
})
#endif
foreign import ccall "graphene_box_expand" graphene_box_expand ::
Ptr Box ->
Ptr Graphene.Point3D.Point3D ->
Ptr Box ->
IO ()
boxExpand ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> Graphene.Point3D.Point3D
-> m (Box)
boxExpand :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Box -> Point3D -> m Box
boxExpand Box
box Point3D
point = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
box' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
box
Ptr Point3D
point' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
point
Ptr Box
res <- Int -> IO (Ptr Box)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr Box)
Ptr Box -> Ptr Point3D -> Ptr Box -> IO ()
graphene_box_expand Ptr Box
box' Ptr Point3D
point' Ptr Box
res
Box
res' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Box -> Box
Box) Ptr Box
res
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
box
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
point
Box -> IO Box
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
res'
#if defined(ENABLE_OVERLOADING)
data BoxExpandMethodInfo
instance (signature ~ (Graphene.Point3D.Point3D -> m (Box)), MonadIO m) => O.OverloadedMethod BoxExpandMethodInfo Box signature where
overloadedMethod = boxExpand
instance O.OverloadedMethodInfo BoxExpandMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxExpand",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxExpand"
})
#endif
foreign import ccall "graphene_box_expand_scalar" graphene_box_expand_scalar ::
Ptr Box ->
CFloat ->
Ptr Box ->
IO ()
boxExpandScalar ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> Float
-> m (Box)
boxExpandScalar :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Box -> Float -> m Box
boxExpandScalar Box
box Float
scalar = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
box' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
box
let scalar' :: CFloat
scalar' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
scalar
Ptr Box
res <- Int -> IO (Ptr Box)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr Box)
Ptr Box -> CFloat -> Ptr Box -> IO ()
graphene_box_expand_scalar Ptr Box
box' CFloat
scalar' Ptr Box
res
Box
res' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Box -> Box
Box) Ptr Box
res
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
box
Box -> IO Box
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
res'
#if defined(ENABLE_OVERLOADING)
data BoxExpandScalarMethodInfo
instance (signature ~ (Float -> m (Box)), MonadIO m) => O.OverloadedMethod BoxExpandScalarMethodInfo Box signature where
overloadedMethod = boxExpandScalar
instance O.OverloadedMethodInfo BoxExpandScalarMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxExpandScalar",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxExpandScalar"
})
#endif
foreign import ccall "graphene_box_expand_vec3" graphene_box_expand_vec3 ::
Ptr Box ->
Ptr Graphene.Vec3.Vec3 ->
Ptr Box ->
IO ()
boxExpandVec3 ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> Graphene.Vec3.Vec3
-> m (Box)
boxExpandVec3 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Box -> Vec3 -> m Box
boxExpandVec3 Box
box Vec3
vec = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
box' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
box
Ptr Vec3
vec' <- Vec3 -> IO (Ptr Vec3)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec3
vec
Ptr Box
res <- Int -> IO (Ptr Box)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr Box)
Ptr Box -> Ptr Vec3 -> Ptr Box -> IO ()
graphene_box_expand_vec3 Ptr Box
box' Ptr Vec3
vec' Ptr Box
res
Box
res' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Box -> Box
Box) Ptr Box
res
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
box
Vec3 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec3
vec
Box -> IO Box
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
res'
#if defined(ENABLE_OVERLOADING)
data BoxExpandVec3MethodInfo
instance (signature ~ (Graphene.Vec3.Vec3 -> m (Box)), MonadIO m) => O.OverloadedMethod BoxExpandVec3MethodInfo Box signature where
overloadedMethod = boxExpandVec3
instance O.OverloadedMethodInfo BoxExpandVec3MethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxExpandVec3",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxExpandVec3"
})
#endif
foreign import ccall "graphene_box_free" graphene_box_free ::
Ptr Box ->
IO ()
boxFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> m ()
boxFree :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Box -> m ()
boxFree Box
box = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
box' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
box
Ptr Box -> IO ()
graphene_box_free Ptr Box
box'
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
box
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BoxFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod BoxFreeMethodInfo Box signature where
overloadedMethod = boxFree
instance O.OverloadedMethodInfo BoxFreeMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxFree",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxFree"
})
#endif
foreign import ccall "graphene_box_get_bounding_sphere" graphene_box_get_bounding_sphere ::
Ptr Box ->
Ptr Graphene.Sphere.Sphere ->
IO ()
boxGetBoundingSphere ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> m (Graphene.Sphere.Sphere)
boxGetBoundingSphere :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Box -> m Sphere
boxGetBoundingSphere Box
box = IO Sphere -> m Sphere
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Sphere -> m Sphere) -> IO Sphere -> m Sphere
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
box' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
box
Ptr Sphere
sphere <- Int -> IO (Ptr Sphere)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
20 :: IO (Ptr Graphene.Sphere.Sphere)
Ptr Box -> Ptr Sphere -> IO ()
graphene_box_get_bounding_sphere Ptr Box
box' Ptr Sphere
sphere
Sphere
sphere' <- ((ManagedPtr Sphere -> Sphere) -> Ptr Sphere -> IO Sphere
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Sphere -> Sphere
Graphene.Sphere.Sphere) Ptr Sphere
sphere
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
box
Sphere -> IO Sphere
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Sphere
sphere'
#if defined(ENABLE_OVERLOADING)
data BoxGetBoundingSphereMethodInfo
instance (signature ~ (m (Graphene.Sphere.Sphere)), MonadIO m) => O.OverloadedMethod BoxGetBoundingSphereMethodInfo Box signature where
overloadedMethod = boxGetBoundingSphere
instance O.OverloadedMethodInfo BoxGetBoundingSphereMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxGetBoundingSphere",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxGetBoundingSphere"
})
#endif
foreign import ccall "graphene_box_get_center" graphene_box_get_center ::
Ptr Box ->
Ptr Graphene.Point3D.Point3D ->
IO ()
boxGetCenter ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> m (Graphene.Point3D.Point3D)
boxGetCenter :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Box -> m Point3D
boxGetCenter Box
box = IO Point3D -> m Point3D
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point3D -> m Point3D) -> IO Point3D -> m Point3D
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
box' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
box
Ptr Point3D
center <- Int -> IO (Ptr Point3D)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
12 :: IO (Ptr Graphene.Point3D.Point3D)
Ptr Box -> Ptr Point3D -> IO ()
graphene_box_get_center Ptr Box
box' Ptr Point3D
center
Point3D
center' <- ((ManagedPtr Point3D -> Point3D) -> Ptr Point3D -> IO Point3D
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point3D -> Point3D
Graphene.Point3D.Point3D) Ptr Point3D
center
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
box
Point3D -> IO Point3D
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point3D
center'
#if defined(ENABLE_OVERLOADING)
data BoxGetCenterMethodInfo
instance (signature ~ (m (Graphene.Point3D.Point3D)), MonadIO m) => O.OverloadedMethod BoxGetCenterMethodInfo Box signature where
overloadedMethod = boxGetCenter
instance O.OverloadedMethodInfo BoxGetCenterMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxGetCenter",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxGetCenter"
})
#endif
foreign import ccall "graphene_box_get_depth" graphene_box_get_depth ::
Ptr Box ->
IO CFloat
boxGetDepth ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> m Float
boxGetDepth :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Box -> m Float
boxGetDepth Box
box = IO Float -> m Float
forall a. IO a -> m a
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 Box
box' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
box
CFloat
result <- Ptr Box -> IO CFloat
graphene_box_get_depth Ptr Box
box'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
box
Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data BoxGetDepthMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.OverloadedMethod BoxGetDepthMethodInfo Box signature where
overloadedMethod = boxGetDepth
instance O.OverloadedMethodInfo BoxGetDepthMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxGetDepth",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxGetDepth"
})
#endif
foreign import ccall "graphene_box_get_height" graphene_box_get_height ::
Ptr Box ->
IO CFloat
boxGetHeight ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> m Float
boxGetHeight :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Box -> m Float
boxGetHeight Box
box = IO Float -> m Float
forall a. IO a -> m a
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 Box
box' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
box
CFloat
result <- Ptr Box -> IO CFloat
graphene_box_get_height Ptr Box
box'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
box
Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data BoxGetHeightMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.OverloadedMethod BoxGetHeightMethodInfo Box signature where
overloadedMethod = boxGetHeight
instance O.OverloadedMethodInfo BoxGetHeightMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxGetHeight",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxGetHeight"
})
#endif
foreign import ccall "graphene_box_get_max" graphene_box_get_max ::
Ptr Box ->
Ptr Graphene.Point3D.Point3D ->
IO ()
boxGetMax ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> m (Graphene.Point3D.Point3D)
boxGetMax :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Box -> m Point3D
boxGetMax Box
box = IO Point3D -> m Point3D
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point3D -> m Point3D) -> IO Point3D -> m Point3D
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
box' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
box
Ptr Point3D
max <- Int -> IO (Ptr Point3D)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
12 :: IO (Ptr Graphene.Point3D.Point3D)
Ptr Box -> Ptr Point3D -> IO ()
graphene_box_get_max Ptr Box
box' Ptr Point3D
max
Point3D
max' <- ((ManagedPtr Point3D -> Point3D) -> Ptr Point3D -> IO Point3D
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point3D -> Point3D
Graphene.Point3D.Point3D) Ptr Point3D
max
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
box
Point3D -> IO Point3D
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point3D
max'
#if defined(ENABLE_OVERLOADING)
data BoxGetMaxMethodInfo
instance (signature ~ (m (Graphene.Point3D.Point3D)), MonadIO m) => O.OverloadedMethod BoxGetMaxMethodInfo Box signature where
overloadedMethod = boxGetMax
instance O.OverloadedMethodInfo BoxGetMaxMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxGetMax",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxGetMax"
})
#endif
foreign import ccall "graphene_box_get_min" graphene_box_get_min ::
Ptr Box ->
Ptr Graphene.Point3D.Point3D ->
IO ()
boxGetMin ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> m (Graphene.Point3D.Point3D)
boxGetMin :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Box -> m Point3D
boxGetMin Box
box = IO Point3D -> m Point3D
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point3D -> m Point3D) -> IO Point3D -> m Point3D
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
box' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
box
Ptr Point3D
min <- Int -> IO (Ptr Point3D)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
12 :: IO (Ptr Graphene.Point3D.Point3D)
Ptr Box -> Ptr Point3D -> IO ()
graphene_box_get_min Ptr Box
box' Ptr Point3D
min
Point3D
min' <- ((ManagedPtr Point3D -> Point3D) -> Ptr Point3D -> IO Point3D
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point3D -> Point3D
Graphene.Point3D.Point3D) Ptr Point3D
min
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
box
Point3D -> IO Point3D
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point3D
min'
#if defined(ENABLE_OVERLOADING)
data BoxGetMinMethodInfo
instance (signature ~ (m (Graphene.Point3D.Point3D)), MonadIO m) => O.OverloadedMethod BoxGetMinMethodInfo Box signature where
overloadedMethod = boxGetMin
instance O.OverloadedMethodInfo BoxGetMinMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxGetMin",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxGetMin"
})
#endif
foreign import ccall "graphene_box_get_size" graphene_box_get_size ::
Ptr Box ->
Ptr Graphene.Vec3.Vec3 ->
IO ()
boxGetSize ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> m (Graphene.Vec3.Vec3)
boxGetSize :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Box -> m Vec3
boxGetSize Box
box = IO Vec3 -> m Vec3
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec3 -> m Vec3) -> IO Vec3 -> m Vec3
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
box' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
box
Ptr Vec3
size <- Int -> IO (Ptr Vec3)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Graphene.Vec3.Vec3)
Ptr Box -> Ptr Vec3 -> IO ()
graphene_box_get_size Ptr Box
box' Ptr Vec3
size
Vec3
size' <- ((ManagedPtr Vec3 -> Vec3) -> Ptr Vec3 -> IO Vec3
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec3 -> Vec3
Graphene.Vec3.Vec3) Ptr Vec3
size
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
box
Vec3 -> IO Vec3
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Vec3
size'
#if defined(ENABLE_OVERLOADING)
data BoxGetSizeMethodInfo
instance (signature ~ (m (Graphene.Vec3.Vec3)), MonadIO m) => O.OverloadedMethod BoxGetSizeMethodInfo Box signature where
overloadedMethod = boxGetSize
instance O.OverloadedMethodInfo BoxGetSizeMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxGetSize",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxGetSize"
})
#endif
foreign import ccall "graphene_box_get_width" graphene_box_get_width ::
Ptr Box ->
IO CFloat
boxGetWidth ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> m Float
boxGetWidth :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Box -> m Float
boxGetWidth Box
box = IO Float -> m Float
forall a. IO a -> m a
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 Box
box' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
box
CFloat
result <- Ptr Box -> IO CFloat
graphene_box_get_width Ptr Box
box'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
box
Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data BoxGetWidthMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.OverloadedMethod BoxGetWidthMethodInfo Box signature where
overloadedMethod = boxGetWidth
instance O.OverloadedMethodInfo BoxGetWidthMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxGetWidth",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxGetWidth"
})
#endif
foreign import ccall "graphene_box_init" graphene_box_init ::
Ptr Box ->
Ptr Graphene.Point3D.Point3D ->
Ptr Graphene.Point3D.Point3D ->
IO (Ptr Box)
boxInit ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> Maybe (Graphene.Point3D.Point3D)
-> Maybe (Graphene.Point3D.Point3D)
-> m Box
boxInit :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Box -> Maybe Point3D -> Maybe Point3D -> m Box
boxInit Box
box Maybe Point3D
min Maybe Point3D
max = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
box' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
box
Ptr Point3D
maybeMin <- case Maybe Point3D
min of
Maybe Point3D
Nothing -> Ptr Point3D -> IO (Ptr Point3D)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Point3D
forall a. Ptr a
nullPtr
Just Point3D
jMin -> do
Ptr Point3D
jMin' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
jMin
Ptr Point3D -> IO (Ptr Point3D)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Point3D
jMin'
Ptr Point3D
maybeMax <- case Maybe Point3D
max of
Maybe Point3D
Nothing -> Ptr Point3D -> IO (Ptr Point3D)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Point3D
forall a. Ptr a
nullPtr
Just Point3D
jMax -> do
Ptr Point3D
jMax' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
jMax
Ptr Point3D -> IO (Ptr Point3D)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Point3D
jMax'
Ptr Box
result <- Ptr Box -> Ptr Point3D -> Ptr Point3D -> IO (Ptr Box)
graphene_box_init Ptr Box
box' Ptr Point3D
maybeMin Ptr Point3D
maybeMax
Text -> Ptr Box -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"boxInit" Ptr Box
result
Box
result' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Box -> Box
Box) Ptr Box
result
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
box
Maybe Point3D -> (Point3D -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Point3D
min Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe Point3D -> (Point3D -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Point3D
max Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Box -> IO Box
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
result'
#if defined(ENABLE_OVERLOADING)
data BoxInitMethodInfo
instance (signature ~ (Maybe (Graphene.Point3D.Point3D) -> Maybe (Graphene.Point3D.Point3D) -> m Box), MonadIO m) => O.OverloadedMethod BoxInitMethodInfo Box signature where
overloadedMethod = boxInit
instance O.OverloadedMethodInfo BoxInitMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxInit",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxInit"
})
#endif
foreign import ccall "graphene_box_init_from_box" graphene_box_init_from_box ::
Ptr Box ->
Ptr Box ->
IO (Ptr Box)
boxInitFromBox ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> Box
-> m Box
boxInitFromBox :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Box -> Box -> m Box
boxInitFromBox Box
box Box
src = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
box' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
box
Ptr Box
src' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
src
Ptr Box
result <- Ptr Box -> Ptr Box -> IO (Ptr Box)
graphene_box_init_from_box Ptr Box
box' Ptr Box
src'
Text -> Ptr Box -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"boxInitFromBox" Ptr Box
result
Box
result' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Box -> Box
Box) Ptr Box
result
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
box
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
src
Box -> IO Box
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
result'
#if defined(ENABLE_OVERLOADING)
data BoxInitFromBoxMethodInfo
instance (signature ~ (Box -> m Box), MonadIO m) => O.OverloadedMethod BoxInitFromBoxMethodInfo Box signature where
overloadedMethod = boxInitFromBox
instance O.OverloadedMethodInfo BoxInitFromBoxMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxInitFromBox",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxInitFromBox"
})
#endif
foreign import ccall "graphene_box_init_from_points" graphene_box_init_from_points ::
Ptr Box ->
Word32 ->
Ptr Graphene.Point3D.Point3D ->
IO (Ptr Box)
boxInitFromPoints ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> [Graphene.Point3D.Point3D]
-> m Box
boxInitFromPoints :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Box -> [Point3D] -> m Box
boxInitFromPoints Box
box [Point3D]
points = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ do
let nPoints :: Word32
nPoints = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [Point3D] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Point3D]
points
Ptr Box
box' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
box
[Ptr Point3D]
points' <- (Point3D -> IO (Ptr Point3D)) -> [Point3D] -> IO [Ptr Point3D]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [Point3D]
points
Ptr Point3D
points'' <- Int -> [Ptr Point3D] -> IO (Ptr Point3D)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
12 [Ptr Point3D]
points'
Ptr Box
result <- Ptr Box -> Word32 -> Ptr Point3D -> IO (Ptr Box)
graphene_box_init_from_points Ptr Box
box' Word32
nPoints Ptr Point3D
points''
Text -> Ptr Box -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"boxInitFromPoints" Ptr Box
result
Box
result' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Box -> Box
Box) Ptr Box
result
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
box
(Point3D -> IO ()) -> [Point3D] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [Point3D]
points
Ptr Point3D -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Point3D
points''
Box -> IO Box
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
result'
#if defined(ENABLE_OVERLOADING)
data BoxInitFromPointsMethodInfo
instance (signature ~ ([Graphene.Point3D.Point3D] -> m Box), MonadIO m) => O.OverloadedMethod BoxInitFromPointsMethodInfo Box signature where
overloadedMethod = boxInitFromPoints
instance O.OverloadedMethodInfo BoxInitFromPointsMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxInitFromPoints",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxInitFromPoints"
})
#endif
foreign import ccall "graphene_box_init_from_vec3" graphene_box_init_from_vec3 ::
Ptr Box ->
Ptr Graphene.Vec3.Vec3 ->
Ptr Graphene.Vec3.Vec3 ->
IO (Ptr Box)
boxInitFromVec3 ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> Maybe (Graphene.Vec3.Vec3)
-> Maybe (Graphene.Vec3.Vec3)
-> m Box
boxInitFromVec3 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Box -> Maybe Vec3 -> Maybe Vec3 -> m Box
boxInitFromVec3 Box
box Maybe Vec3
min Maybe Vec3
max = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
box' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
box
Ptr Vec3
maybeMin <- case Maybe Vec3
min of
Maybe Vec3
Nothing -> Ptr Vec3 -> IO (Ptr Vec3)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Vec3
forall a. Ptr a
nullPtr
Just Vec3
jMin -> do
Ptr Vec3
jMin' <- Vec3 -> IO (Ptr Vec3)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec3
jMin
Ptr Vec3 -> IO (Ptr Vec3)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Vec3
jMin'
Ptr Vec3
maybeMax <- case Maybe Vec3
max of
Maybe Vec3
Nothing -> Ptr Vec3 -> IO (Ptr Vec3)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Vec3
forall a. Ptr a
nullPtr
Just Vec3
jMax -> do
Ptr Vec3
jMax' <- Vec3 -> IO (Ptr Vec3)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec3
jMax
Ptr Vec3 -> IO (Ptr Vec3)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Vec3
jMax'
Ptr Box
result <- Ptr Box -> Ptr Vec3 -> Ptr Vec3 -> IO (Ptr Box)
graphene_box_init_from_vec3 Ptr Box
box' Ptr Vec3
maybeMin Ptr Vec3
maybeMax
Text -> Ptr Box -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"boxInitFromVec3" Ptr Box
result
Box
result' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Box -> Box
Box) Ptr Box
result
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
box
Maybe Vec3 -> (Vec3 -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Vec3
min Vec3 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe Vec3 -> (Vec3 -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Vec3
max Vec3 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Box -> IO Box
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
result'
#if defined(ENABLE_OVERLOADING)
data BoxInitFromVec3MethodInfo
instance (signature ~ (Maybe (Graphene.Vec3.Vec3) -> Maybe (Graphene.Vec3.Vec3) -> m Box), MonadIO m) => O.OverloadedMethod BoxInitFromVec3MethodInfo Box signature where
overloadedMethod = boxInitFromVec3
instance O.OverloadedMethodInfo BoxInitFromVec3MethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxInitFromVec3",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxInitFromVec3"
})
#endif
foreign import ccall "graphene_box_init_from_vectors" graphene_box_init_from_vectors ::
Ptr Box ->
Word32 ->
Ptr Graphene.Vec3.Vec3 ->
IO (Ptr Box)
boxInitFromVectors ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> [Graphene.Vec3.Vec3]
-> m Box
boxInitFromVectors :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Box -> [Vec3] -> m Box
boxInitFromVectors Box
box [Vec3]
vectors = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ do
let nVectors :: Word32
nVectors = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [Vec3] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Vec3]
vectors
Ptr Box
box' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
box
[Ptr Vec3]
vectors' <- (Vec3 -> IO (Ptr Vec3)) -> [Vec3] -> IO [Ptr Vec3]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM Vec3 -> IO (Ptr Vec3)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [Vec3]
vectors
Ptr Vec3
vectors'' <- Int -> [Ptr Vec3] -> IO (Ptr Vec3)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
16 [Ptr Vec3]
vectors'
Ptr Box
result <- Ptr Box -> Word32 -> Ptr Vec3 -> IO (Ptr Box)
graphene_box_init_from_vectors Ptr Box
box' Word32
nVectors Ptr Vec3
vectors''
Text -> Ptr Box -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"boxInitFromVectors" Ptr Box
result
Box
result' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Box -> Box
Box) Ptr Box
result
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
box
(Vec3 -> IO ()) -> [Vec3] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ Vec3 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [Vec3]
vectors
Ptr Vec3 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Vec3
vectors''
Box -> IO Box
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
result'
#if defined(ENABLE_OVERLOADING)
data BoxInitFromVectorsMethodInfo
instance (signature ~ ([Graphene.Vec3.Vec3] -> m Box), MonadIO m) => O.OverloadedMethod BoxInitFromVectorsMethodInfo Box signature where
overloadedMethod = boxInitFromVectors
instance O.OverloadedMethodInfo BoxInitFromVectorsMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxInitFromVectors",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxInitFromVectors"
})
#endif
foreign import ccall "graphene_box_intersection" graphene_box_intersection ::
Ptr Box ->
Ptr Box ->
Ptr Box ->
IO CInt
boxIntersection ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> Box
-> m ((Bool, Box))
boxIntersection :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Box -> Box -> m (Bool, Box)
boxIntersection Box
a Box
b = IO (Bool, Box) -> m (Bool, Box)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Box) -> m (Bool, Box))
-> IO (Bool, Box) -> m (Bool, Box)
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
a' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
a
Ptr Box
b' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
b
Ptr Box
res <- Int -> IO (Ptr Box)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr Box)
CInt
result <- Ptr Box -> Ptr Box -> Ptr Box -> IO CInt
graphene_box_intersection Ptr Box
a' Ptr Box
b' Ptr Box
res
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Box
res' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Box -> Box
Box) Ptr Box
res
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
a
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
b
(Bool, Box) -> IO (Bool, Box)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Box
res')
#if defined(ENABLE_OVERLOADING)
data BoxIntersectionMethodInfo
instance (signature ~ (Box -> m ((Bool, Box))), MonadIO m) => O.OverloadedMethod BoxIntersectionMethodInfo Box signature where
overloadedMethod = boxIntersection
instance O.OverloadedMethodInfo BoxIntersectionMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxIntersection",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxIntersection"
})
#endif
foreign import ccall "graphene_box_union" graphene_box_union ::
Ptr Box ->
Ptr Box ->
Ptr Box ->
IO ()
boxUnion ::
(B.CallStack.HasCallStack, MonadIO m) =>
Box
-> Box
-> m (Box)
boxUnion :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Box -> Box -> m Box
boxUnion Box
a Box
b = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
a' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
a
Ptr Box
b' <- Box -> IO (Ptr Box)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Box
b
Ptr Box
res <- Int -> IO (Ptr Box)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr Box)
Ptr Box -> Ptr Box -> Ptr Box -> IO ()
graphene_box_union Ptr Box
a' Ptr Box
b' Ptr Box
res
Box
res' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Box -> Box
Box) Ptr Box
res
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
a
Box -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Box
b
Box -> IO Box
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
res'
#if defined(ENABLE_OVERLOADING)
data BoxUnionMethodInfo
instance (signature ~ (Box -> m (Box)), MonadIO m) => O.OverloadedMethod BoxUnionMethodInfo Box signature where
overloadedMethod = boxUnion
instance O.OverloadedMethodInfo BoxUnionMethodInfo Box where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Box.boxUnion",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Box.html#v:boxUnion"
})
#endif
foreign import ccall "graphene_box_empty" graphene_box_empty ::
IO (Ptr Box)
boxEmpty ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Box
boxEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Box
boxEmpty = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
result <- IO (Ptr Box)
graphene_box_empty
Text -> Ptr Box -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"boxEmpty" Ptr Box
result
Box
result' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Box -> Box
Box) Ptr Box
result
Box -> IO Box
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "graphene_box_infinite" graphene_box_infinite ::
IO (Ptr Box)
boxInfinite ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Box
boxInfinite :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Box
boxInfinite = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
result <- IO (Ptr Box)
graphene_box_infinite
Text -> Ptr Box -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"boxInfinite" Ptr Box
result
Box
result' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Box -> Box
Box) Ptr Box
result
Box -> IO Box
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "graphene_box_minus_one" graphene_box_minus_one ::
IO (Ptr Box)
boxMinusOne ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Box
boxMinusOne :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Box
boxMinusOne = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
result <- IO (Ptr Box)
graphene_box_minus_one
Text -> Ptr Box -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"boxMinusOne" Ptr Box
result
Box
result' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Box -> Box
Box) Ptr Box
result
Box -> IO Box
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "graphene_box_one" graphene_box_one ::
IO (Ptr Box)
boxOne ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Box
boxOne :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Box
boxOne = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
result <- IO (Ptr Box)
graphene_box_one
Text -> Ptr Box -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"boxOne" Ptr Box
result
Box
result' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Box -> Box
Box) Ptr Box
result
Box -> IO Box
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "graphene_box_one_minus_one" graphene_box_one_minus_one ::
IO (Ptr Box)
boxOneMinusOne ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Box
boxOneMinusOne :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Box
boxOneMinusOne = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
result <- IO (Ptr Box)
graphene_box_one_minus_one
Text -> Ptr Box -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"boxOneMinusOne" Ptr Box
result
Box
result' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Box -> Box
Box) Ptr Box
result
Box -> IO Box
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "graphene_box_zero" graphene_box_zero ::
IO (Ptr Box)
boxZero ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Box
boxZero :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Box
boxZero = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ do
Ptr Box
result <- IO (Ptr Box)
graphene_box_zero
Text -> Ptr Box -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"boxZero" Ptr Box
result
Box
result' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Box -> Box
Box) Ptr Box
result
Box -> IO Box
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
result'
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveBoxMethod (t :: Symbol) (o :: *) :: * where
ResolveBoxMethod "containsBox" o = BoxContainsBoxMethodInfo
ResolveBoxMethod "containsPoint" o = BoxContainsPointMethodInfo
ResolveBoxMethod "equal" o = BoxEqualMethodInfo
ResolveBoxMethod "expand" o = BoxExpandMethodInfo
ResolveBoxMethod "expandScalar" o = BoxExpandScalarMethodInfo
ResolveBoxMethod "expandVec3" o = BoxExpandVec3MethodInfo
ResolveBoxMethod "free" o = BoxFreeMethodInfo
ResolveBoxMethod "init" o = BoxInitMethodInfo
ResolveBoxMethod "initFromBox" o = BoxInitFromBoxMethodInfo
ResolveBoxMethod "initFromPoints" o = BoxInitFromPointsMethodInfo
ResolveBoxMethod "initFromVec3" o = BoxInitFromVec3MethodInfo
ResolveBoxMethod "initFromVectors" o = BoxInitFromVectorsMethodInfo
ResolveBoxMethod "intersection" o = BoxIntersectionMethodInfo
ResolveBoxMethod "union" o = BoxUnionMethodInfo
ResolveBoxMethod "getBoundingSphere" o = BoxGetBoundingSphereMethodInfo
ResolveBoxMethod "getCenter" o = BoxGetCenterMethodInfo
ResolveBoxMethod "getDepth" o = BoxGetDepthMethodInfo
ResolveBoxMethod "getHeight" o = BoxGetHeightMethodInfo
ResolveBoxMethod "getMax" o = BoxGetMaxMethodInfo
ResolveBoxMethod "getMin" o = BoxGetMinMethodInfo
ResolveBoxMethod "getSize" o = BoxGetSizeMethodInfo
ResolveBoxMethod "getWidth" o = BoxGetWidthMethodInfo
ResolveBoxMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveBoxMethod t Box, O.OverloadedMethod info Box p) => OL.IsLabel t (Box -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveBoxMethod t Box, O.OverloadedMethod info Box p, R.HasField t Box p) => R.HasField t Box p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveBoxMethod t Box, O.OverloadedMethodInfo info Box) => OL.IsLabel t (O.MethodProxy info Box) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif