{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Clutter.Structs.PathNode
(
PathNode(..) ,
newZeroPathNode ,
#if defined(ENABLE_OVERLOADING)
ResolvePathNodeMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
PathNodeCopyMethodInfo ,
#endif
pathNodeCopy ,
#if defined(ENABLE_OVERLOADING)
PathNodeEqualMethodInfo ,
#endif
pathNodeEqual ,
#if defined(ENABLE_OVERLOADING)
PathNodeFreeMethodInfo ,
#endif
pathNodeFree ,
getPathNodeType ,
#if defined(ENABLE_OVERLOADING)
pathNode_type ,
#endif
setPathNodeType ,
) 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.Clutter.Enums as Clutter.Enums
newtype PathNode = PathNode (SP.ManagedPtr PathNode)
deriving (PathNode -> PathNode -> Bool
(PathNode -> PathNode -> Bool)
-> (PathNode -> PathNode -> Bool) -> Eq PathNode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PathNode -> PathNode -> Bool
== :: PathNode -> PathNode -> Bool
$c/= :: PathNode -> PathNode -> Bool
/= :: PathNode -> PathNode -> Bool
Eq)
instance SP.ManagedPtrNewtype PathNode where
toManagedPtr :: PathNode -> ManagedPtr PathNode
toManagedPtr (PathNode ManagedPtr PathNode
p) = ManagedPtr PathNode
p
foreign import ccall "clutter_path_node_get_type" c_clutter_path_node_get_type ::
IO GType
type instance O.ParentTypes PathNode = '[]
instance O.HasParentTypes PathNode
instance B.Types.TypedObject PathNode where
glibType :: IO GType
glibType = IO GType
c_clutter_path_node_get_type
instance B.Types.GBoxed PathNode
instance B.GValue.IsGValue (Maybe PathNode) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_clutter_path_node_get_type
gvalueSet_ :: Ptr GValue -> Maybe PathNode -> IO ()
gvalueSet_ Ptr GValue
gv Maybe PathNode
P.Nothing = Ptr GValue -> Ptr PathNode -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr PathNode
forall a. Ptr a
FP.nullPtr :: FP.Ptr PathNode)
gvalueSet_ Ptr GValue
gv (P.Just PathNode
obj) = PathNode -> (Ptr PathNode -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr PathNode
obj (Ptr GValue -> Ptr PathNode -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe PathNode)
gvalueGet_ Ptr GValue
gv = do
Ptr PathNode
ptr <- Ptr GValue -> IO (Ptr PathNode)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr PathNode)
if Ptr PathNode
ptr Ptr PathNode -> Ptr PathNode -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr PathNode
forall a. Ptr a
FP.nullPtr
then PathNode -> Maybe PathNode
forall a. a -> Maybe a
P.Just (PathNode -> Maybe PathNode) -> IO PathNode -> IO (Maybe PathNode)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr PathNode -> PathNode) -> Ptr PathNode -> IO PathNode
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr PathNode -> PathNode
PathNode Ptr PathNode
ptr
else Maybe PathNode -> IO (Maybe PathNode)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe PathNode
forall a. Maybe a
P.Nothing
newZeroPathNode :: MonadIO m => m PathNode
newZeroPathNode :: forall (m :: * -> *). MonadIO m => m PathNode
newZeroPathNode = IO PathNode -> m PathNode
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PathNode -> m PathNode) -> IO PathNode -> m PathNode
forall a b. (a -> b) -> a -> b
$ Int -> IO (Ptr PathNode)
forall a. GBoxed a => Int -> IO (Ptr a)
callocBoxedBytes Int
28 IO (Ptr PathNode) -> (Ptr PathNode -> IO PathNode) -> IO PathNode
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr PathNode -> PathNode) -> Ptr PathNode -> IO PathNode
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr PathNode -> PathNode
PathNode
instance tag ~ 'AttrSet => Constructible PathNode tag where
new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr PathNode -> PathNode)
-> [AttrOp PathNode tag] -> m PathNode
new ManagedPtr PathNode -> PathNode
_ [AttrOp PathNode tag]
attrs = do
PathNode
o <- m PathNode
forall (m :: * -> *). MonadIO m => m PathNode
newZeroPathNode
PathNode -> [AttrOp PathNode 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set PathNode
o [AttrOp PathNode tag]
[AttrOp PathNode 'AttrSet]
attrs
PathNode -> m PathNode
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return PathNode
o
getPathNodeType :: MonadIO m => PathNode -> m Clutter.Enums.PathNodeType
getPathNodeType :: forall (m :: * -> *). MonadIO m => PathNode -> m PathNodeType
getPathNodeType PathNode
s = IO PathNodeType -> m PathNodeType
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PathNodeType -> m PathNodeType)
-> IO PathNodeType -> m PathNodeType
forall a b. (a -> b) -> a -> b
$ PathNode -> (Ptr PathNode -> IO PathNodeType) -> IO PathNodeType
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr PathNode
s ((Ptr PathNode -> IO PathNodeType) -> IO PathNodeType)
-> (Ptr PathNode -> IO PathNodeType) -> IO PathNodeType
forall a b. (a -> b) -> a -> b
$ \Ptr PathNode
ptr -> do
CUInt
val <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek (Ptr PathNode
ptr Ptr PathNode -> Int -> Ptr CUInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO CUInt
let val' :: PathNodeType
val' = (Int -> PathNodeType
forall a. Enum a => Int -> a
toEnum (Int -> PathNodeType) -> (CUInt -> Int) -> CUInt -> PathNodeType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
val
PathNodeType -> IO PathNodeType
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return PathNodeType
val'
setPathNodeType :: MonadIO m => PathNode -> Clutter.Enums.PathNodeType -> m ()
setPathNodeType :: forall (m :: * -> *). MonadIO m => PathNode -> PathNodeType -> m ()
setPathNodeType PathNode
s PathNodeType
val = 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
$ PathNode -> (Ptr PathNode -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr PathNode
s ((Ptr PathNode -> IO ()) -> IO ())
-> (Ptr PathNode -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr PathNode
ptr -> do
let val' :: CUInt
val' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (PathNodeType -> Int) -> PathNodeType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PathNodeType -> Int
forall a. Enum a => a -> Int
fromEnum) PathNodeType
val
Ptr CUInt -> CUInt -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr PathNode
ptr Ptr PathNode -> Int -> Ptr CUInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CUInt
val' :: CUInt)
#if defined(ENABLE_OVERLOADING)
data PathNodeTypeFieldInfo
instance AttrInfo PathNodeTypeFieldInfo where
type AttrBaseTypeConstraint PathNodeTypeFieldInfo = (~) PathNode
type AttrAllowedOps PathNodeTypeFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint PathNodeTypeFieldInfo = (~) Clutter.Enums.PathNodeType
type AttrTransferTypeConstraint PathNodeTypeFieldInfo = (~)Clutter.Enums.PathNodeType
type AttrTransferType PathNodeTypeFieldInfo = Clutter.Enums.PathNodeType
type AttrGetType PathNodeTypeFieldInfo = Clutter.Enums.PathNodeType
type AttrLabel PathNodeTypeFieldInfo = "type"
type AttrOrigin PathNodeTypeFieldInfo = PathNode
attrGet = getPathNodeType
attrSet = setPathNodeType
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Structs.PathNode.type"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.3/docs/GI-Clutter-Structs-PathNode.html#g:attr:type"
})
pathNode_type :: AttrLabelProxy "type"
pathNode_type = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList PathNode
type instance O.AttributeList PathNode = PathNodeAttributeList
type PathNodeAttributeList = ('[ '("type", PathNodeTypeFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "clutter_path_node_copy" clutter_path_node_copy ::
Ptr PathNode ->
IO (Ptr PathNode)
pathNodeCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
PathNode
-> m PathNode
pathNodeCopy :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
PathNode -> m PathNode
pathNodeCopy PathNode
node = IO PathNode -> m PathNode
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PathNode -> m PathNode) -> IO PathNode -> m PathNode
forall a b. (a -> b) -> a -> b
$ do
Ptr PathNode
node' <- PathNode -> IO (Ptr PathNode)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PathNode
node
Ptr PathNode
result <- Ptr PathNode -> IO (Ptr PathNode)
clutter_path_node_copy Ptr PathNode
node'
Text -> Ptr PathNode -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pathNodeCopy" Ptr PathNode
result
PathNode
result' <- ((ManagedPtr PathNode -> PathNode) -> Ptr PathNode -> IO PathNode
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr PathNode -> PathNode
PathNode) Ptr PathNode
result
PathNode -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PathNode
node
PathNode -> IO PathNode
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return PathNode
result'
#if defined(ENABLE_OVERLOADING)
data PathNodeCopyMethodInfo
instance (signature ~ (m PathNode), MonadIO m) => O.OverloadedMethod PathNodeCopyMethodInfo PathNode signature where
overloadedMethod = pathNodeCopy
instance O.OverloadedMethodInfo PathNodeCopyMethodInfo PathNode where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Structs.PathNode.pathNodeCopy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.3/docs/GI-Clutter-Structs-PathNode.html#v:pathNodeCopy"
})
#endif
foreign import ccall "clutter_path_node_equal" clutter_path_node_equal ::
Ptr PathNode ->
Ptr PathNode ->
IO CInt
pathNodeEqual ::
(B.CallStack.HasCallStack, MonadIO m) =>
PathNode
-> PathNode
-> m Bool
pathNodeEqual :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
PathNode -> PathNode -> m Bool
pathNodeEqual PathNode
nodeA PathNode
nodeB = 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 PathNode
nodeA' <- PathNode -> IO (Ptr PathNode)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PathNode
nodeA
Ptr PathNode
nodeB' <- PathNode -> IO (Ptr PathNode)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PathNode
nodeB
CInt
result <- Ptr PathNode -> Ptr PathNode -> IO CInt
clutter_path_node_equal Ptr PathNode
nodeA' Ptr PathNode
nodeB'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
PathNode -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PathNode
nodeA
PathNode -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PathNode
nodeB
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data PathNodeEqualMethodInfo
instance (signature ~ (PathNode -> m Bool), MonadIO m) => O.OverloadedMethod PathNodeEqualMethodInfo PathNode signature where
overloadedMethod = pathNodeEqual
instance O.OverloadedMethodInfo PathNodeEqualMethodInfo PathNode where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Structs.PathNode.pathNodeEqual",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.3/docs/GI-Clutter-Structs-PathNode.html#v:pathNodeEqual"
})
#endif
foreign import ccall "clutter_path_node_free" clutter_path_node_free ::
Ptr PathNode ->
IO ()
pathNodeFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
PathNode
-> m ()
pathNodeFree :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PathNode -> m ()
pathNodeFree PathNode
node = 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 PathNode
node' <- PathNode -> IO (Ptr PathNode)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PathNode
node
Ptr PathNode -> IO ()
clutter_path_node_free Ptr PathNode
node'
PathNode -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PathNode
node
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PathNodeFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod PathNodeFreeMethodInfo PathNode signature where
overloadedMethod = pathNodeFree
instance O.OverloadedMethodInfo PathNodeFreeMethodInfo PathNode where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Clutter.Structs.PathNode.pathNodeFree",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.3/docs/GI-Clutter-Structs-PathNode.html#v:pathNodeFree"
})
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolvePathNodeMethod (t :: Symbol) (o :: *) :: * where
ResolvePathNodeMethod "copy" o = PathNodeCopyMethodInfo
ResolvePathNodeMethod "equal" o = PathNodeEqualMethodInfo
ResolvePathNodeMethod "free" o = PathNodeFreeMethodInfo
ResolvePathNodeMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolvePathNodeMethod t PathNode, O.OverloadedMethod info PathNode p) => OL.IsLabel t (PathNode -> 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 ~ ResolvePathNodeMethod t PathNode, O.OverloadedMethod info PathNode p, R.HasField t PathNode p) => R.HasField t PathNode p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolvePathNodeMethod t PathNode, O.OverloadedMethodInfo info PathNode) => OL.IsLabel t (O.MethodProxy info PathNode) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif