{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- A 2D plane that extends infinitely in a 3D volume.
-- 
-- The contents of the @graphene_plane_t@ are private, and should not be
-- modified directly.
-- 
-- /Since: 1.2/

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Graphene.Structs.Plane
    ( 

-- * Exported types
    Plane(..)                               ,
    newZeroPlane                            ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [distance]("GI.Graphene.Structs.Plane#g:method:distance"), [equal]("GI.Graphene.Structs.Plane#g:method:equal"), [free]("GI.Graphene.Structs.Plane#g:method:free"), [init]("GI.Graphene.Structs.Plane#g:method:init"), [initFromPlane]("GI.Graphene.Structs.Plane#g:method:initFromPlane"), [initFromPoint]("GI.Graphene.Structs.Plane#g:method:initFromPoint"), [initFromPoints]("GI.Graphene.Structs.Plane#g:method:initFromPoints"), [initFromVec4]("GI.Graphene.Structs.Plane#g:method:initFromVec4"), [negate]("GI.Graphene.Structs.Plane#g:method:negate"), [normalize]("GI.Graphene.Structs.Plane#g:method:normalize"), [transform]("GI.Graphene.Structs.Plane#g:method:transform").
-- 
-- ==== Getters
-- [getConstant]("GI.Graphene.Structs.Plane#g:method:getConstant"), [getNormal]("GI.Graphene.Structs.Plane#g:method:getNormal").
-- 
-- ==== Setters
-- /None/.

#if defined(ENABLE_OVERLOADING)
    ResolvePlaneMethod                      ,
#endif

-- ** alloc #method:alloc#

    planeAlloc                              ,


-- ** distance #method:distance#

#if defined(ENABLE_OVERLOADING)
    PlaneDistanceMethodInfo                 ,
#endif
    planeDistance                           ,


-- ** equal #method:equal#

#if defined(ENABLE_OVERLOADING)
    PlaneEqualMethodInfo                    ,
#endif
    planeEqual                              ,


-- ** free #method:free#

#if defined(ENABLE_OVERLOADING)
    PlaneFreeMethodInfo                     ,
#endif
    planeFree                               ,


-- ** getConstant #method:getConstant#

#if defined(ENABLE_OVERLOADING)
    PlaneGetConstantMethodInfo              ,
#endif
    planeGetConstant                        ,


-- ** getNormal #method:getNormal#

#if defined(ENABLE_OVERLOADING)
    PlaneGetNormalMethodInfo                ,
#endif
    planeGetNormal                          ,


-- ** init #method:init#

#if defined(ENABLE_OVERLOADING)
    PlaneInitMethodInfo                     ,
#endif
    planeInit                               ,


-- ** initFromPlane #method:initFromPlane#

#if defined(ENABLE_OVERLOADING)
    PlaneInitFromPlaneMethodInfo            ,
#endif
    planeInitFromPlane                      ,


-- ** initFromPoint #method:initFromPoint#

#if defined(ENABLE_OVERLOADING)
    PlaneInitFromPointMethodInfo            ,
#endif
    planeInitFromPoint                      ,


-- ** initFromPoints #method:initFromPoints#

#if defined(ENABLE_OVERLOADING)
    PlaneInitFromPointsMethodInfo           ,
#endif
    planeInitFromPoints                     ,


-- ** initFromVec4 #method:initFromVec4#

#if defined(ENABLE_OVERLOADING)
    PlaneInitFromVec4MethodInfo             ,
#endif
    planeInitFromVec4                       ,


-- ** negate #method:negate#

#if defined(ENABLE_OVERLOADING)
    PlaneNegateMethodInfo                   ,
#endif
    planeNegate                             ,


-- ** normalize #method:normalize#

#if defined(ENABLE_OVERLOADING)
    PlaneNormalizeMethodInfo                ,
#endif
    planeNormalize                          ,


-- ** transform #method:transform#

#if defined(ENABLE_OVERLOADING)
    PlaneTransformMethodInfo                ,
#endif
    planeTransform                          ,




    ) 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.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.Matrix as Graphene.Matrix
import {-# SOURCE #-} qualified GI.Graphene.Structs.Point3D as Graphene.Point3D
import {-# SOURCE #-} qualified GI.Graphene.Structs.Vec3 as Graphene.Vec3
import {-# SOURCE #-} qualified GI.Graphene.Structs.Vec4 as Graphene.Vec4

-- | Memory-managed wrapper type.
newtype Plane = Plane (SP.ManagedPtr Plane)
    deriving (Plane -> Plane -> Bool
(Plane -> Plane -> Bool) -> (Plane -> Plane -> Bool) -> Eq Plane
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Plane -> Plane -> Bool
$c/= :: Plane -> Plane -> Bool
== :: Plane -> Plane -> Bool
$c== :: Plane -> Plane -> Bool
Eq)

instance SP.ManagedPtrNewtype Plane where
    toManagedPtr :: Plane -> ManagedPtr Plane
toManagedPtr (Plane ManagedPtr Plane
p) = ManagedPtr Plane
p

foreign import ccall "graphene_plane_get_type" c_graphene_plane_get_type :: 
    IO GType

type instance O.ParentTypes Plane = '[]
instance O.HasParentTypes Plane

instance B.Types.TypedObject Plane where
    glibType :: IO GType
glibType = IO GType
c_graphene_plane_get_type

instance B.Types.GBoxed Plane

-- | Convert 'Plane' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe Plane) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_graphene_plane_get_type
    gvalueSet_ :: Ptr GValue -> Maybe Plane -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Plane
P.Nothing = Ptr GValue -> Ptr Plane -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr Plane
forall a. Ptr a
FP.nullPtr :: FP.Ptr Plane)
    gvalueSet_ Ptr GValue
gv (P.Just Plane
obj) = Plane -> (Ptr Plane -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Plane
obj (Ptr GValue -> Ptr Plane -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe Plane)
gvalueGet_ Ptr GValue
gv = do
        Ptr Plane
ptr <- Ptr GValue -> IO (Ptr Plane)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr Plane)
        if Ptr Plane
ptr Ptr Plane -> Ptr Plane -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Plane
forall a. Ptr a
FP.nullPtr
        then Plane -> Maybe Plane
forall a. a -> Maybe a
P.Just (Plane -> Maybe Plane) -> IO Plane -> IO (Maybe Plane)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Plane -> Plane) -> Ptr Plane -> IO Plane
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr Plane -> Plane
Plane Ptr Plane
ptr
        else Maybe Plane -> IO (Maybe Plane)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Plane
forall a. Maybe a
P.Nothing
        
    

-- | Construct a `Plane` struct initialized to zero.
newZeroPlane :: MonadIO m => m Plane
newZeroPlane :: forall (m :: * -> *). MonadIO m => m Plane
newZeroPlane = IO Plane -> m Plane
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Plane -> m Plane) -> IO Plane -> m Plane
forall a b. (a -> b) -> a -> b
$ Int -> IO (Ptr Plane)
forall a. GBoxed a => Int -> IO (Ptr a)
callocBoxedBytes Int
20 IO (Ptr Plane) -> (Ptr Plane -> IO Plane) -> IO Plane
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr Plane -> Plane) -> Ptr Plane -> IO Plane
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Plane -> Plane
Plane

instance tag ~ 'AttrSet => Constructible Plane tag where
    new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr Plane -> Plane) -> [AttrOp Plane tag] -> m Plane
new ManagedPtr Plane -> Plane
_ [AttrOp Plane tag]
attrs = do
        Plane
o <- m Plane
forall (m :: * -> *). MonadIO m => m Plane
newZeroPlane
        Plane -> [AttrOp Plane 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set Plane
o [AttrOp Plane tag]
[AttrOp Plane 'AttrSet]
attrs
        Plane -> m Plane
forall (m :: * -> *) a. Monad m => a -> m a
return Plane
o



#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Plane
type instance O.AttributeList Plane = PlaneAttributeList
type PlaneAttributeList = ('[ ] :: [(Symbol, *)])
#endif

-- method Plane::alloc
-- method type : Constructor
-- Args: []
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Graphene" , name = "Plane" })
-- throws : False
-- Skip return : False

foreign import ccall "graphene_plane_alloc" graphene_plane_alloc :: 
    IO (Ptr Plane)

-- | Allocates a new t'GI.Graphene.Structs.Plane.Plane' structure.
-- 
-- The contents of the returned structure are undefined.
-- 
-- /Since: 1.2/
planeAlloc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Plane
    -- ^ __Returns:__ the newly allocated t'GI.Graphene.Structs.Plane.Plane'.
    --   Use 'GI.Graphene.Structs.Plane.planeFree' to free the resources allocated by
    --   this function
planeAlloc :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Plane
planeAlloc  = IO Plane -> m Plane
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Plane -> m Plane) -> IO Plane -> m Plane
forall a b. (a -> b) -> a -> b
$ do
    Ptr Plane
result <- IO (Ptr Plane)
graphene_plane_alloc
    Text -> Ptr Plane -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"planeAlloc" Ptr Plane
result
    Plane
result' <- ((ManagedPtr Plane -> Plane) -> Ptr Plane -> IO Plane
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Plane -> Plane
Plane) Ptr Plane
result
    Plane -> IO Plane
forall (m :: * -> *) a. Monad m => a -> m a
return Plane
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method Plane::distance
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "p"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Plane" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_plane_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "point"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Point3D" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_point3d_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TFloat)
-- throws : False
-- Skip return : False

foreign import ccall "graphene_plane_distance" graphene_plane_distance :: 
    Ptr Plane ->                            -- p : TInterface (Name {namespace = "Graphene", name = "Plane"})
    Ptr Graphene.Point3D.Point3D ->         -- point : TInterface (Name {namespace = "Graphene", name = "Point3D"})
    IO CFloat

-- | Computes the distance of /@point@/ from a t'GI.Graphene.Structs.Plane.Plane'.
-- 
-- /Since: 1.2/
planeDistance ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Plane
    -- ^ /@p@/: a t'GI.Graphene.Structs.Plane.Plane'
    -> Graphene.Point3D.Point3D
    -- ^ /@point@/: a t'GI.Graphene.Structs.Point3D.Point3D'
    -> m Float
    -- ^ __Returns:__ the distance of the given t'GI.Graphene.Structs.Point3D.Point3D' from the plane
planeDistance :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Plane -> Point3D -> m Float
planeDistance Plane
p Point3D
point = 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 Plane
p' <- Plane -> IO (Ptr Plane)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Plane
p
    Ptr Point3D
point' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
point
    CFloat
result <- Ptr Plane -> Ptr Point3D -> IO CFloat
graphene_plane_distance Ptr Plane
p' Ptr Point3D
point'
    let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
    Plane -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Plane
p
    Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
point
    Float -> IO Float
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'

#if defined(ENABLE_OVERLOADING)
data PlaneDistanceMethodInfo
instance (signature ~ (Graphene.Point3D.Point3D -> m Float), MonadIO m) => O.OverloadedMethod PlaneDistanceMethodInfo Plane signature where
    overloadedMethod = planeDistance

instance O.OverloadedMethodInfo PlaneDistanceMethodInfo Plane where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Plane.planeDistance",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.4/docs/GI-Graphene-Structs-Plane.html#v:planeDistance"
        })


#endif

-- method Plane::equal
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "a"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Plane" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_plane_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "b"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Plane" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_plane_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "graphene_plane_equal" graphene_plane_equal :: 
    Ptr Plane ->                            -- a : TInterface (Name {namespace = "Graphene", name = "Plane"})
    Ptr Plane ->                            -- b : TInterface (Name {namespace = "Graphene", name = "Plane"})
    IO CInt

-- | Checks whether the two given t'GI.Graphene.Structs.Plane.Plane' are equal.
-- 
-- /Since: 1.2/
planeEqual ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Plane
    -- ^ /@a@/: a t'GI.Graphene.Structs.Plane.Plane'
    -> Plane
    -- ^ /@b@/: a t'GI.Graphene.Structs.Plane.Plane'
    -> m Bool
    -- ^ __Returns:__ @true@ if the given planes are equal
planeEqual :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Plane -> Plane -> m Bool
planeEqual Plane
a Plane
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 Plane
a' <- Plane -> IO (Ptr Plane)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Plane
a
    Ptr Plane
b' <- Plane -> IO (Ptr Plane)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Plane
b
    CInt
result <- Ptr Plane -> Ptr Plane -> IO CInt
graphene_plane_equal Ptr Plane
a' Ptr Plane
b'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Plane -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Plane
a
    Plane -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Plane
b
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data PlaneEqualMethodInfo
instance (signature ~ (Plane -> m Bool), MonadIO m) => O.OverloadedMethod PlaneEqualMethodInfo Plane signature where
    overloadedMethod = planeEqual

instance O.OverloadedMethodInfo PlaneEqualMethodInfo Plane where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Plane.planeEqual",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.4/docs/GI-Graphene-Structs-Plane.html#v:planeEqual"
        })


#endif

-- method Plane::free
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "p"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Plane" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_plane_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "graphene_plane_free" graphene_plane_free :: 
    Ptr Plane ->                            -- p : TInterface (Name {namespace = "Graphene", name = "Plane"})
    IO ()

-- | Frees the resources allocated by 'GI.Graphene.Structs.Plane.planeAlloc'.
-- 
-- /Since: 1.2/
planeFree ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Plane
    -- ^ /@p@/: a t'GI.Graphene.Structs.Plane.Plane'
    -> m ()
planeFree :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Plane -> m ()
planeFree Plane
p = 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 Plane
p' <- Plane -> IO (Ptr Plane)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Plane
p
    Ptr Plane -> IO ()
graphene_plane_free Ptr Plane
p'
    Plane -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Plane
p
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data PlaneFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod PlaneFreeMethodInfo Plane signature where
    overloadedMethod = planeFree

instance O.OverloadedMethodInfo PlaneFreeMethodInfo Plane where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Plane.planeFree",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.4/docs/GI-Graphene-Structs-Plane.html#v:planeFree"
        })


#endif

-- method Plane::get_constant
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "p"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Plane" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_plane_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TFloat)
-- throws : False
-- Skip return : False

foreign import ccall "graphene_plane_get_constant" graphene_plane_get_constant :: 
    Ptr Plane ->                            -- p : TInterface (Name {namespace = "Graphene", name = "Plane"})
    IO CFloat

-- | Retrieves the distance along the normal vector of the
-- given t'GI.Graphene.Structs.Plane.Plane' from the origin.
-- 
-- /Since: 1.2/
planeGetConstant ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Plane
    -- ^ /@p@/: a t'GI.Graphene.Structs.Plane.Plane'
    -> m Float
    -- ^ __Returns:__ the constant value of the plane
planeGetConstant :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Plane -> m Float
planeGetConstant Plane
p = 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 Plane
p' <- Plane -> IO (Ptr Plane)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Plane
p
    CFloat
result <- Ptr Plane -> IO CFloat
graphene_plane_get_constant Ptr Plane
p'
    let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
    Plane -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Plane
p
    Float -> IO Float
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'

#if defined(ENABLE_OVERLOADING)
data PlaneGetConstantMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.OverloadedMethod PlaneGetConstantMethodInfo Plane signature where
    overloadedMethod = planeGetConstant

instance O.OverloadedMethodInfo PlaneGetConstantMethodInfo Plane where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Plane.planeGetConstant",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.4/docs/GI-Graphene-Structs-Plane.html#v:planeGetConstant"
        })


#endif

-- method Plane::get_normal
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "p"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Plane" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_plane_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "normal"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Vec3" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the normal vector"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "graphene_plane_get_normal" graphene_plane_get_normal :: 
    Ptr Plane ->                            -- p : TInterface (Name {namespace = "Graphene", name = "Plane"})
    Ptr Graphene.Vec3.Vec3 ->               -- normal : TInterface (Name {namespace = "Graphene", name = "Vec3"})
    IO ()

-- | Retrieves the normal vector pointing towards the origin of the
-- given t'GI.Graphene.Structs.Plane.Plane'.
-- 
-- /Since: 1.2/
planeGetNormal ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Plane
    -- ^ /@p@/: a t'GI.Graphene.Structs.Plane.Plane'
    -> m (Graphene.Vec3.Vec3)
planeGetNormal :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Plane -> m Vec3
planeGetNormal Plane
p = IO Vec3 -> m Vec3
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 Plane
p' <- Plane -> IO (Ptr Plane)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Plane
p
    Ptr Vec3
normal <- Int -> IO (Ptr Vec3)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Graphene.Vec3.Vec3)
    Ptr Plane -> Ptr Vec3 -> IO ()
graphene_plane_get_normal Ptr Plane
p' Ptr Vec3
normal
    Vec3
normal' <- ((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
normal
    Plane -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Plane
p
    Vec3 -> IO Vec3
forall (m :: * -> *) a. Monad m => a -> m a
return Vec3
normal'

#if defined(ENABLE_OVERLOADING)
data PlaneGetNormalMethodInfo
instance (signature ~ (m (Graphene.Vec3.Vec3)), MonadIO m) => O.OverloadedMethod PlaneGetNormalMethodInfo Plane signature where
    overloadedMethod = planeGetNormal

instance O.OverloadedMethodInfo PlaneGetNormalMethodInfo Plane where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Plane.planeGetNormal",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.4/docs/GI-Graphene-Structs-Plane.html#v:planeGetNormal"
        })


#endif

-- method Plane::init
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "p"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Plane" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #graphene_plane_t to initialize"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "normal"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Vec3" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a unit length normal vector defining the plane\n  pointing towards the origin; if unset, we use the X axis by default"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "constant"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the distance from the origin to the plane along the\n  normal vector; the sign determines the half-space occupied by the\n  plane"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Graphene" , name = "Plane" })
-- throws : False
-- Skip return : False

foreign import ccall "graphene_plane_init" graphene_plane_init :: 
    Ptr Plane ->                            -- p : TInterface (Name {namespace = "Graphene", name = "Plane"})
    Ptr Graphene.Vec3.Vec3 ->               -- normal : TInterface (Name {namespace = "Graphene", name = "Vec3"})
    CFloat ->                               -- constant : TBasicType TFloat
    IO (Ptr Plane)

-- | Initializes the given t'GI.Graphene.Structs.Plane.Plane' using the given /@normal@/ vector
-- and /@constant@/ values.
-- 
-- /Since: 1.2/
planeInit ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Plane
    -- ^ /@p@/: the t'GI.Graphene.Structs.Plane.Plane' to initialize
    -> Maybe (Graphene.Vec3.Vec3)
    -- ^ /@normal@/: a unit length normal vector defining the plane
    --   pointing towards the origin; if unset, we use the X axis by default
    -> Float
    -- ^ /@constant@/: the distance from the origin to the plane along the
    --   normal vector; the sign determines the half-space occupied by the
    --   plane
    -> m Plane
    -- ^ __Returns:__ the initialized plane
planeInit :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Plane -> Maybe Vec3 -> Float -> m Plane
planeInit Plane
p Maybe Vec3
normal Float
constant = IO Plane -> m Plane
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Plane -> m Plane) -> IO Plane -> m Plane
forall a b. (a -> b) -> a -> b
$ do
    Ptr Plane
p' <- Plane -> IO (Ptr Plane)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Plane
p
    Ptr Vec3
maybeNormal <- case Maybe Vec3
normal of
        Maybe Vec3
Nothing -> Ptr Vec3 -> IO (Ptr Vec3)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Vec3
forall a. Ptr a
nullPtr
        Just Vec3
jNormal -> do
            Ptr Vec3
jNormal' <- Vec3 -> IO (Ptr Vec3)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec3
jNormal
            Ptr Vec3 -> IO (Ptr Vec3)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Vec3
jNormal'
    let constant' :: CFloat
constant' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
constant
    Ptr Plane
result <- Ptr Plane -> Ptr Vec3 -> CFloat -> IO (Ptr Plane)
graphene_plane_init Ptr Plane
p' Ptr Vec3
maybeNormal CFloat
constant'
    Text -> Ptr Plane -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"planeInit" Ptr Plane
result
    Plane
result' <- ((ManagedPtr Plane -> Plane) -> Ptr Plane -> IO Plane
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Plane -> Plane
Plane) Ptr Plane
result
    Plane -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Plane
p
    Maybe Vec3 -> (Vec3 -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Vec3
normal Vec3 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Plane -> IO Plane
forall (m :: * -> *) a. Monad m => a -> m a
return Plane
result'

#if defined(ENABLE_OVERLOADING)
data PlaneInitMethodInfo
instance (signature ~ (Maybe (Graphene.Vec3.Vec3) -> Float -> m Plane), MonadIO m) => O.OverloadedMethod PlaneInitMethodInfo Plane signature where
    overloadedMethod = planeInit

instance O.OverloadedMethodInfo PlaneInitMethodInfo Plane where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Plane.planeInit",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.4/docs/GI-Graphene-Structs-Plane.html#v:planeInit"
        })


#endif

-- method Plane::init_from_plane
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "p"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Plane" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #graphene_plane_t to initialize"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "src"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Plane" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_plane_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Graphene" , name = "Plane" })
-- throws : False
-- Skip return : False

foreign import ccall "graphene_plane_init_from_plane" graphene_plane_init_from_plane :: 
    Ptr Plane ->                            -- p : TInterface (Name {namespace = "Graphene", name = "Plane"})
    Ptr Plane ->                            -- src : TInterface (Name {namespace = "Graphene", name = "Plane"})
    IO (Ptr Plane)

-- | Initializes the given t'GI.Graphene.Structs.Plane.Plane' using the normal
-- vector and constant of another t'GI.Graphene.Structs.Plane.Plane'.
-- 
-- /Since: 1.2/
planeInitFromPlane ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Plane
    -- ^ /@p@/: the t'GI.Graphene.Structs.Plane.Plane' to initialize
    -> Plane
    -- ^ /@src@/: a t'GI.Graphene.Structs.Plane.Plane'
    -> m Plane
    -- ^ __Returns:__ the initialized plane
planeInitFromPlane :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Plane -> Plane -> m Plane
planeInitFromPlane Plane
p Plane
src = IO Plane -> m Plane
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Plane -> m Plane) -> IO Plane -> m Plane
forall a b. (a -> b) -> a -> b
$ do
    Ptr Plane
p' <- Plane -> IO (Ptr Plane)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Plane
p
    Ptr Plane
src' <- Plane -> IO (Ptr Plane)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Plane
src
    Ptr Plane
result <- Ptr Plane -> Ptr Plane -> IO (Ptr Plane)
graphene_plane_init_from_plane Ptr Plane
p' Ptr Plane
src'
    Text -> Ptr Plane -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"planeInitFromPlane" Ptr Plane
result
    Plane
result' <- ((ManagedPtr Plane -> Plane) -> Ptr Plane -> IO Plane
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Plane -> Plane
Plane) Ptr Plane
result
    Plane -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Plane
p
    Plane -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Plane
src
    Plane -> IO Plane
forall (m :: * -> *) a. Monad m => a -> m a
return Plane
result'

#if defined(ENABLE_OVERLOADING)
data PlaneInitFromPlaneMethodInfo
instance (signature ~ (Plane -> m Plane), MonadIO m) => O.OverloadedMethod PlaneInitFromPlaneMethodInfo Plane signature where
    overloadedMethod = planeInitFromPlane

instance O.OverloadedMethodInfo PlaneInitFromPlaneMethodInfo Plane where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Plane.planeInitFromPlane",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.4/docs/GI-Graphene-Structs-Plane.html#v:planeInitFromPlane"
        })


#endif

-- method Plane::init_from_point
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "p"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Plane" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #graphene_plane_t to initialize"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "normal"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Vec3" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a normal vector defining the plane pointing towards the origin"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "point"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Point3D" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_point3d_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Graphene" , name = "Plane" })
-- throws : False
-- Skip return : False

foreign import ccall "graphene_plane_init_from_point" graphene_plane_init_from_point :: 
    Ptr Plane ->                            -- p : TInterface (Name {namespace = "Graphene", name = "Plane"})
    Ptr Graphene.Vec3.Vec3 ->               -- normal : TInterface (Name {namespace = "Graphene", name = "Vec3"})
    Ptr Graphene.Point3D.Point3D ->         -- point : TInterface (Name {namespace = "Graphene", name = "Point3D"})
    IO (Ptr Plane)

-- | Initializes the given t'GI.Graphene.Structs.Plane.Plane' using the given normal vector
-- and an arbitrary co-planar point.
-- 
-- /Since: 1.2/
planeInitFromPoint ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Plane
    -- ^ /@p@/: the t'GI.Graphene.Structs.Plane.Plane' to initialize
    -> Graphene.Vec3.Vec3
    -- ^ /@normal@/: a normal vector defining the plane pointing towards the origin
    -> Graphene.Point3D.Point3D
    -- ^ /@point@/: a t'GI.Graphene.Structs.Point3D.Point3D'
    -> m Plane
    -- ^ __Returns:__ the initialized plane
planeInitFromPoint :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Plane -> Vec3 -> Point3D -> m Plane
planeInitFromPoint Plane
p Vec3
normal Point3D
point = IO Plane -> m Plane
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Plane -> m Plane) -> IO Plane -> m Plane
forall a b. (a -> b) -> a -> b
$ do
    Ptr Plane
p' <- Plane -> IO (Ptr Plane)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Plane
p
    Ptr Vec3
normal' <- Vec3 -> IO (Ptr Vec3)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec3
normal
    Ptr Point3D
point' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
point
    Ptr Plane
result <- Ptr Plane -> Ptr Vec3 -> Ptr Point3D -> IO (Ptr Plane)
graphene_plane_init_from_point Ptr Plane
p' Ptr Vec3
normal' Ptr Point3D
point'
    Text -> Ptr Plane -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"planeInitFromPoint" Ptr Plane
result
    Plane
result' <- ((ManagedPtr Plane -> Plane) -> Ptr Plane -> IO Plane
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Plane -> Plane
Plane) Ptr Plane
result
    Plane -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Plane
p
    Vec3 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec3
normal
    Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
point
    Plane -> IO Plane
forall (m :: * -> *) a. Monad m => a -> m a
return Plane
result'

#if defined(ENABLE_OVERLOADING)
data PlaneInitFromPointMethodInfo
instance (signature ~ (Graphene.Vec3.Vec3 -> Graphene.Point3D.Point3D -> m Plane), MonadIO m) => O.OverloadedMethod PlaneInitFromPointMethodInfo Plane signature where
    overloadedMethod = planeInitFromPoint

instance O.OverloadedMethodInfo PlaneInitFromPointMethodInfo Plane where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Plane.planeInitFromPoint",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.4/docs/GI-Graphene-Structs-Plane.html#v:planeInitFromPoint"
        })


#endif

-- method Plane::init_from_points
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "p"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Plane" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #graphene_plane_t to initialize"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "a"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Point3D" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_point3d_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "b"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Point3D" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_point3d_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "c"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Point3D" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_point3d_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Graphene" , name = "Plane" })
-- throws : False
-- Skip return : False

foreign import ccall "graphene_plane_init_from_points" graphene_plane_init_from_points :: 
    Ptr Plane ->                            -- p : TInterface (Name {namespace = "Graphene", name = "Plane"})
    Ptr Graphene.Point3D.Point3D ->         -- a : TInterface (Name {namespace = "Graphene", name = "Point3D"})
    Ptr Graphene.Point3D.Point3D ->         -- b : TInterface (Name {namespace = "Graphene", name = "Point3D"})
    Ptr Graphene.Point3D.Point3D ->         -- c : TInterface (Name {namespace = "Graphene", name = "Point3D"})
    IO (Ptr Plane)

-- | Initializes the given t'GI.Graphene.Structs.Plane.Plane' using the 3 provided co-planar
-- points.
-- 
-- The winding order is counter-clockwise, and determines which direction
-- the normal vector will point.
-- 
-- /Since: 1.2/
planeInitFromPoints ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Plane
    -- ^ /@p@/: the t'GI.Graphene.Structs.Plane.Plane' to initialize
    -> Graphene.Point3D.Point3D
    -- ^ /@a@/: a t'GI.Graphene.Structs.Point3D.Point3D'
    -> Graphene.Point3D.Point3D
    -- ^ /@b@/: a t'GI.Graphene.Structs.Point3D.Point3D'
    -> Graphene.Point3D.Point3D
    -- ^ /@c@/: a t'GI.Graphene.Structs.Point3D.Point3D'
    -> m Plane
    -- ^ __Returns:__ the initialized plane
planeInitFromPoints :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Plane -> Point3D -> Point3D -> Point3D -> m Plane
planeInitFromPoints Plane
p Point3D
a Point3D
b Point3D
c = IO Plane -> m Plane
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Plane -> m Plane) -> IO Plane -> m Plane
forall a b. (a -> b) -> a -> b
$ do
    Ptr Plane
p' <- Plane -> IO (Ptr Plane)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Plane
p
    Ptr Point3D
a' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
a
    Ptr Point3D
b' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
b
    Ptr Point3D
c' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
c
    Ptr Plane
result <- Ptr Plane
-> Ptr Point3D -> Ptr Point3D -> Ptr Point3D -> IO (Ptr Plane)
graphene_plane_init_from_points Ptr Plane
p' Ptr Point3D
a' Ptr Point3D
b' Ptr Point3D
c'
    Text -> Ptr Plane -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"planeInitFromPoints" Ptr Plane
result
    Plane
result' <- ((ManagedPtr Plane -> Plane) -> Ptr Plane -> IO Plane
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Plane -> Plane
Plane) Ptr Plane
result
    Plane -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Plane
p
    Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
a
    Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
b
    Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
c
    Plane -> IO Plane
forall (m :: * -> *) a. Monad m => a -> m a
return Plane
result'

#if defined(ENABLE_OVERLOADING)
data PlaneInitFromPointsMethodInfo
instance (signature ~ (Graphene.Point3D.Point3D -> Graphene.Point3D.Point3D -> Graphene.Point3D.Point3D -> m Plane), MonadIO m) => O.OverloadedMethod PlaneInitFromPointsMethodInfo Plane signature where
    overloadedMethod = planeInitFromPoints

instance O.OverloadedMethodInfo PlaneInitFromPointsMethodInfo Plane where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Plane.planeInitFromPoints",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.4/docs/GI-Graphene-Structs-Plane.html#v:planeInitFromPoints"
        })


#endif

-- method Plane::init_from_vec4
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "p"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Plane" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #graphene_plane_t to initialize"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "src"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Vec4" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a #graphene_vec4_t containing the normal vector in its first\n  three components, and the distance in its fourth component"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Graphene" , name = "Plane" })
-- throws : False
-- Skip return : False

foreign import ccall "graphene_plane_init_from_vec4" graphene_plane_init_from_vec4 :: 
    Ptr Plane ->                            -- p : TInterface (Name {namespace = "Graphene", name = "Plane"})
    Ptr Graphene.Vec4.Vec4 ->               -- src : TInterface (Name {namespace = "Graphene", name = "Vec4"})
    IO (Ptr Plane)

-- | Initializes the given t'GI.Graphene.Structs.Plane.Plane' using the components of
-- the given t'GI.Graphene.Structs.Vec4.Vec4' vector.
-- 
-- /Since: 1.2/
planeInitFromVec4 ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Plane
    -- ^ /@p@/: the t'GI.Graphene.Structs.Plane.Plane' to initialize
    -> Graphene.Vec4.Vec4
    -- ^ /@src@/: a t'GI.Graphene.Structs.Vec4.Vec4' containing the normal vector in its first
    --   three components, and the distance in its fourth component
    -> m Plane
    -- ^ __Returns:__ the initialized plane
planeInitFromVec4 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Plane -> Vec4 -> m Plane
planeInitFromVec4 Plane
p Vec4
src = IO Plane -> m Plane
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Plane -> m Plane) -> IO Plane -> m Plane
forall a b. (a -> b) -> a -> b
$ do
    Ptr Plane
p' <- Plane -> IO (Ptr Plane)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Plane
p
    Ptr Vec4
src' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
src
    Ptr Plane
result <- Ptr Plane -> Ptr Vec4 -> IO (Ptr Plane)
graphene_plane_init_from_vec4 Ptr Plane
p' Ptr Vec4
src'
    Text -> Ptr Plane -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"planeInitFromVec4" Ptr Plane
result
    Plane
result' <- ((ManagedPtr Plane -> Plane) -> Ptr Plane -> IO Plane
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Plane -> Plane
Plane) Ptr Plane
result
    Plane -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Plane
p
    Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
src
    Plane -> IO Plane
forall (m :: * -> *) a. Monad m => a -> m a
return Plane
result'

#if defined(ENABLE_OVERLOADING)
data PlaneInitFromVec4MethodInfo
instance (signature ~ (Graphene.Vec4.Vec4 -> m Plane), MonadIO m) => O.OverloadedMethod PlaneInitFromVec4MethodInfo Plane signature where
    overloadedMethod = planeInitFromVec4

instance O.OverloadedMethodInfo PlaneInitFromVec4MethodInfo Plane where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Plane.planeInitFromVec4",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.4/docs/GI-Graphene-Structs-Plane.html#v:planeInitFromVec4"
        })


#endif

-- method Plane::negate
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "p"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Plane" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_plane_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "res"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Plane" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the negated plane"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "graphene_plane_negate" graphene_plane_negate :: 
    Ptr Plane ->                            -- p : TInterface (Name {namespace = "Graphene", name = "Plane"})
    Ptr Plane ->                            -- res : TInterface (Name {namespace = "Graphene", name = "Plane"})
    IO ()

-- | Negates the normal vector and constant of a t'GI.Graphene.Structs.Plane.Plane', effectively
-- mirroring the plane across the origin.
-- 
-- /Since: 1.2/
planeNegate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Plane
    -- ^ /@p@/: a t'GI.Graphene.Structs.Plane.Plane'
    -> m (Plane)
planeNegate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Plane -> m Plane
planeNegate Plane
p = IO Plane -> m Plane
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Plane -> m Plane) -> IO Plane -> m Plane
forall a b. (a -> b) -> a -> b
$ do
    Ptr Plane
p' <- Plane -> IO (Ptr Plane)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Plane
p
    Ptr Plane
res <- Int -> IO (Ptr Plane)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
20 :: IO (Ptr Plane)
    Ptr Plane -> Ptr Plane -> IO ()
graphene_plane_negate Ptr Plane
p' Ptr Plane
res
    Plane
res' <- ((ManagedPtr Plane -> Plane) -> Ptr Plane -> IO Plane
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Plane -> Plane
Plane) Ptr Plane
res
    Plane -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Plane
p
    Plane -> IO Plane
forall (m :: * -> *) a. Monad m => a -> m a
return Plane
res'

#if defined(ENABLE_OVERLOADING)
data PlaneNegateMethodInfo
instance (signature ~ (m (Plane)), MonadIO m) => O.OverloadedMethod PlaneNegateMethodInfo Plane signature where
    overloadedMethod = planeNegate

instance O.OverloadedMethodInfo PlaneNegateMethodInfo Plane where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Plane.planeNegate",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.4/docs/GI-Graphene-Structs-Plane.html#v:planeNegate"
        })


#endif

-- method Plane::normalize
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "p"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Plane" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_plane_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "res"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Plane" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the normalized plane"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "graphene_plane_normalize" graphene_plane_normalize :: 
    Ptr Plane ->                            -- p : TInterface (Name {namespace = "Graphene", name = "Plane"})
    Ptr Plane ->                            -- res : TInterface (Name {namespace = "Graphene", name = "Plane"})
    IO ()

-- | Normalizes the vector of the given t'GI.Graphene.Structs.Plane.Plane',
-- and adjusts the constant accordingly.
-- 
-- /Since: 1.2/
planeNormalize ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Plane
    -- ^ /@p@/: a t'GI.Graphene.Structs.Plane.Plane'
    -> m (Plane)
planeNormalize :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Plane -> m Plane
planeNormalize Plane
p = IO Plane -> m Plane
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Plane -> m Plane) -> IO Plane -> m Plane
forall a b. (a -> b) -> a -> b
$ do
    Ptr Plane
p' <- Plane -> IO (Ptr Plane)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Plane
p
    Ptr Plane
res <- Int -> IO (Ptr Plane)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
20 :: IO (Ptr Plane)
    Ptr Plane -> Ptr Plane -> IO ()
graphene_plane_normalize Ptr Plane
p' Ptr Plane
res
    Plane
res' <- ((ManagedPtr Plane -> Plane) -> Ptr Plane -> IO Plane
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Plane -> Plane
Plane) Ptr Plane
res
    Plane -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Plane
p
    Plane -> IO Plane
forall (m :: * -> *) a. Monad m => a -> m a
return Plane
res'

#if defined(ENABLE_OVERLOADING)
data PlaneNormalizeMethodInfo
instance (signature ~ (m (Plane)), MonadIO m) => O.OverloadedMethod PlaneNormalizeMethodInfo Plane signature where
    overloadedMethod = planeNormalize

instance O.OverloadedMethodInfo PlaneNormalizeMethodInfo Plane where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Plane.planeNormalize",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.4/docs/GI-Graphene-Structs-Plane.html#v:planeNormalize"
        })


#endif

-- method Plane::transform
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "p"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Plane" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_plane_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "matrix"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Matrix" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_matrix_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "normal_matrix"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Matrix" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_matrix_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "res"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Plane" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the transformed plane"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "graphene_plane_transform" graphene_plane_transform :: 
    Ptr Plane ->                            -- p : TInterface (Name {namespace = "Graphene", name = "Plane"})
    Ptr Graphene.Matrix.Matrix ->           -- matrix : TInterface (Name {namespace = "Graphene", name = "Matrix"})
    Ptr Graphene.Matrix.Matrix ->           -- normal_matrix : TInterface (Name {namespace = "Graphene", name = "Matrix"})
    Ptr Plane ->                            -- res : TInterface (Name {namespace = "Graphene", name = "Plane"})
    IO ()

-- | Transforms a t'GI.Graphene.Structs.Plane.Plane' /@p@/ using the given /@matrix@/
-- and /@normalMatrix@/.
-- 
-- If /@normalMatrix@/ is 'P.Nothing', a transformation matrix for the plane
-- normal will be computed from /@matrix@/. If you are transforming
-- multiple planes using the same /@matrix@/ it\'s recommended to compute
-- the normal matrix beforehand to avoid incurring in the cost of
-- recomputing it every time.
-- 
-- /Since: 1.10/
planeTransform ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Plane
    -- ^ /@p@/: a t'GI.Graphene.Structs.Plane.Plane'
    -> Graphene.Matrix.Matrix
    -- ^ /@matrix@/: a t'GI.Graphene.Structs.Matrix.Matrix'
    -> Maybe (Graphene.Matrix.Matrix)
    -- ^ /@normalMatrix@/: a t'GI.Graphene.Structs.Matrix.Matrix'
    -> m (Plane)
planeTransform :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Plane -> Matrix -> Maybe Matrix -> m Plane
planeTransform Plane
p Matrix
matrix Maybe Matrix
normalMatrix = IO Plane -> m Plane
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Plane -> m Plane) -> IO Plane -> m Plane
forall a b. (a -> b) -> a -> b
$ do
    Ptr Plane
p' <- Plane -> IO (Ptr Plane)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Plane
p
    Ptr Matrix
matrix' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
matrix
    Ptr Matrix
maybeNormalMatrix <- case Maybe Matrix
normalMatrix of
        Maybe Matrix
Nothing -> Ptr Matrix -> IO (Ptr Matrix)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Matrix
forall a. Ptr a
nullPtr
        Just Matrix
jNormalMatrix -> do
            Ptr Matrix
jNormalMatrix' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
jNormalMatrix
            Ptr Matrix -> IO (Ptr Matrix)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Matrix
jNormalMatrix'
    Ptr Plane
res <- Int -> IO (Ptr Plane)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
20 :: IO (Ptr Plane)
    Ptr Plane -> Ptr Matrix -> Ptr Matrix -> Ptr Plane -> IO ()
graphene_plane_transform Ptr Plane
p' Ptr Matrix
matrix' Ptr Matrix
maybeNormalMatrix Ptr Plane
res
    Plane
res' <- ((ManagedPtr Plane -> Plane) -> Ptr Plane -> IO Plane
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Plane -> Plane
Plane) Ptr Plane
res
    Plane -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Plane
p
    Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
matrix
    Maybe Matrix -> (Matrix -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Matrix
normalMatrix Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Plane -> IO Plane
forall (m :: * -> *) a. Monad m => a -> m a
return Plane
res'

#if defined(ENABLE_OVERLOADING)
data PlaneTransformMethodInfo
instance (signature ~ (Graphene.Matrix.Matrix -> Maybe (Graphene.Matrix.Matrix) -> m (Plane)), MonadIO m) => O.OverloadedMethod PlaneTransformMethodInfo Plane signature where
    overloadedMethod = planeTransform

instance O.OverloadedMethodInfo PlaneTransformMethodInfo Plane where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Plane.planeTransform",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.4/docs/GI-Graphene-Structs-Plane.html#v:planeTransform"
        })


#endif

#if defined(ENABLE_OVERLOADING)
type family ResolvePlaneMethod (t :: Symbol) (o :: *) :: * where
    ResolvePlaneMethod "distance" o = PlaneDistanceMethodInfo
    ResolvePlaneMethod "equal" o = PlaneEqualMethodInfo
    ResolvePlaneMethod "free" o = PlaneFreeMethodInfo
    ResolvePlaneMethod "init" o = PlaneInitMethodInfo
    ResolvePlaneMethod "initFromPlane" o = PlaneInitFromPlaneMethodInfo
    ResolvePlaneMethod "initFromPoint" o = PlaneInitFromPointMethodInfo
    ResolvePlaneMethod "initFromPoints" o = PlaneInitFromPointsMethodInfo
    ResolvePlaneMethod "initFromVec4" o = PlaneInitFromVec4MethodInfo
    ResolvePlaneMethod "negate" o = PlaneNegateMethodInfo
    ResolvePlaneMethod "normalize" o = PlaneNormalizeMethodInfo
    ResolvePlaneMethod "transform" o = PlaneTransformMethodInfo
    ResolvePlaneMethod "getConstant" o = PlaneGetConstantMethodInfo
    ResolvePlaneMethod "getNormal" o = PlaneGetNormalMethodInfo
    ResolvePlaneMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolvePlaneMethod t Plane, O.OverloadedMethod info Plane p) => OL.IsLabel t (Plane -> 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 ~ ResolvePlaneMethod t Plane, O.OverloadedMethod info Plane p, R.HasField t Plane p) => R.HasField t Plane p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolvePlaneMethod t Plane, O.OverloadedMethodInfo info Plane) => OL.IsLabel t (O.MethodProxy info Plane) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif