{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GLib.Structs.TreeNode
(
TreeNode(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveTreeNodeMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
TreeNodeKeyMethodInfo ,
#endif
treeNodeKey ,
#if defined(ENABLE_OVERLOADING)
TreeNodeNextMethodInfo ,
#endif
treeNodeNext ,
#if defined(ENABLE_OVERLOADING)
TreeNodePreviousMethodInfo ,
#endif
treeNodePrevious ,
#if defined(ENABLE_OVERLOADING)
TreeNodeValueMethodInfo ,
#endif
treeNodeValue ,
) 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
newtype TreeNode = TreeNode (SP.ManagedPtr TreeNode)
deriving (TreeNode -> TreeNode -> Bool
(TreeNode -> TreeNode -> Bool)
-> (TreeNode -> TreeNode -> Bool) -> Eq TreeNode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TreeNode -> TreeNode -> Bool
$c/= :: TreeNode -> TreeNode -> Bool
== :: TreeNode -> TreeNode -> Bool
$c== :: TreeNode -> TreeNode -> Bool
Eq)
instance SP.ManagedPtrNewtype TreeNode where
toManagedPtr :: TreeNode -> ManagedPtr TreeNode
toManagedPtr (TreeNode ManagedPtr TreeNode
p) = ManagedPtr TreeNode
p
instance BoxedPtr TreeNode where
boxedPtrCopy :: TreeNode -> IO TreeNode
boxedPtrCopy = TreeNode -> IO TreeNode
forall (m :: * -> *) a. Monad m => a -> m a
return
boxedPtrFree :: TreeNode -> IO ()
boxedPtrFree = \TreeNode
_x -> () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList TreeNode
type instance O.AttributeList TreeNode = TreeNodeAttributeList
type TreeNodeAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "g_tree_node_key" g_tree_node_key ::
Ptr TreeNode ->
IO (Ptr ())
treeNodeKey ::
(B.CallStack.HasCallStack, MonadIO m) =>
TreeNode
-> m (Ptr ())
treeNodeKey :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TreeNode -> m (Ptr ())
treeNodeKey TreeNode
node = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeNode
node' <- TreeNode -> IO (Ptr TreeNode)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeNode
node
Ptr ()
result <- Ptr TreeNode -> IO (Ptr ())
g_tree_node_key Ptr TreeNode
node'
TreeNode -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreeNode
node
Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result
#if defined(ENABLE_OVERLOADING)
data TreeNodeKeyMethodInfo
instance (signature ~ (m (Ptr ())), MonadIO m) => O.OverloadedMethod TreeNodeKeyMethodInfo TreeNode signature where
overloadedMethod = treeNodeKey
instance O.OverloadedMethodInfo TreeNodeKeyMethodInfo TreeNode where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.TreeNode.treeNodeKey",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-TreeNode.html#v:treeNodeKey"
})
#endif
foreign import ccall "g_tree_node_next" g_tree_node_next ::
Ptr TreeNode ->
IO (Ptr TreeNode)
treeNodeNext ::
(B.CallStack.HasCallStack, MonadIO m) =>
TreeNode
-> m (Maybe TreeNode)
treeNodeNext :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TreeNode -> m (Maybe TreeNode)
treeNodeNext TreeNode
node = IO (Maybe TreeNode) -> m (Maybe TreeNode)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe TreeNode) -> m (Maybe TreeNode))
-> IO (Maybe TreeNode) -> m (Maybe TreeNode)
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeNode
node' <- TreeNode -> IO (Ptr TreeNode)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeNode
node
Ptr TreeNode
result <- Ptr TreeNode -> IO (Ptr TreeNode)
g_tree_node_next Ptr TreeNode
node'
Maybe TreeNode
maybeResult <- Ptr TreeNode
-> (Ptr TreeNode -> IO TreeNode) -> IO (Maybe TreeNode)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr TreeNode
result ((Ptr TreeNode -> IO TreeNode) -> IO (Maybe TreeNode))
-> (Ptr TreeNode -> IO TreeNode) -> IO (Maybe TreeNode)
forall a b. (a -> b) -> a -> b
$ \Ptr TreeNode
result' -> do
TreeNode
result'' <- ((ManagedPtr TreeNode -> TreeNode) -> Ptr TreeNode -> IO TreeNode
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr TreeNode -> TreeNode
TreeNode) Ptr TreeNode
result'
TreeNode -> IO TreeNode
forall (m :: * -> *) a. Monad m => a -> m a
return TreeNode
result''
TreeNode -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreeNode
node
Maybe TreeNode -> IO (Maybe TreeNode)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe TreeNode
maybeResult
#if defined(ENABLE_OVERLOADING)
data TreeNodeNextMethodInfo
instance (signature ~ (m (Maybe TreeNode)), MonadIO m) => O.OverloadedMethod TreeNodeNextMethodInfo TreeNode signature where
overloadedMethod = treeNodeNext
instance O.OverloadedMethodInfo TreeNodeNextMethodInfo TreeNode where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.TreeNode.treeNodeNext",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-TreeNode.html#v:treeNodeNext"
})
#endif
foreign import ccall "g_tree_node_previous" g_tree_node_previous ::
Ptr TreeNode ->
IO (Ptr TreeNode)
treeNodePrevious ::
(B.CallStack.HasCallStack, MonadIO m) =>
TreeNode
-> m (Maybe TreeNode)
treeNodePrevious :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TreeNode -> m (Maybe TreeNode)
treeNodePrevious TreeNode
node = IO (Maybe TreeNode) -> m (Maybe TreeNode)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe TreeNode) -> m (Maybe TreeNode))
-> IO (Maybe TreeNode) -> m (Maybe TreeNode)
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeNode
node' <- TreeNode -> IO (Ptr TreeNode)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeNode
node
Ptr TreeNode
result <- Ptr TreeNode -> IO (Ptr TreeNode)
g_tree_node_previous Ptr TreeNode
node'
Maybe TreeNode
maybeResult <- Ptr TreeNode
-> (Ptr TreeNode -> IO TreeNode) -> IO (Maybe TreeNode)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr TreeNode
result ((Ptr TreeNode -> IO TreeNode) -> IO (Maybe TreeNode))
-> (Ptr TreeNode -> IO TreeNode) -> IO (Maybe TreeNode)
forall a b. (a -> b) -> a -> b
$ \Ptr TreeNode
result' -> do
TreeNode
result'' <- ((ManagedPtr TreeNode -> TreeNode) -> Ptr TreeNode -> IO TreeNode
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr TreeNode -> TreeNode
TreeNode) Ptr TreeNode
result'
TreeNode -> IO TreeNode
forall (m :: * -> *) a. Monad m => a -> m a
return TreeNode
result''
TreeNode -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreeNode
node
Maybe TreeNode -> IO (Maybe TreeNode)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe TreeNode
maybeResult
#if defined(ENABLE_OVERLOADING)
data TreeNodePreviousMethodInfo
instance (signature ~ (m (Maybe TreeNode)), MonadIO m) => O.OverloadedMethod TreeNodePreviousMethodInfo TreeNode signature where
overloadedMethod = treeNodePrevious
instance O.OverloadedMethodInfo TreeNodePreviousMethodInfo TreeNode where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.TreeNode.treeNodePrevious",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-TreeNode.html#v:treeNodePrevious"
})
#endif
foreign import ccall "g_tree_node_value" g_tree_node_value ::
Ptr TreeNode ->
IO (Ptr ())
treeNodeValue ::
(B.CallStack.HasCallStack, MonadIO m) =>
TreeNode
-> m (Ptr ())
treeNodeValue :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TreeNode -> m (Ptr ())
treeNodeValue TreeNode
node = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeNode
node' <- TreeNode -> IO (Ptr TreeNode)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeNode
node
Ptr ()
result <- Ptr TreeNode -> IO (Ptr ())
g_tree_node_value Ptr TreeNode
node'
TreeNode -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreeNode
node
Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result
#if defined(ENABLE_OVERLOADING)
data TreeNodeValueMethodInfo
instance (signature ~ (m (Ptr ())), MonadIO m) => O.OverloadedMethod TreeNodeValueMethodInfo TreeNode signature where
overloadedMethod = treeNodeValue
instance O.OverloadedMethodInfo TreeNodeValueMethodInfo TreeNode where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.TreeNode.treeNodeValue",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-TreeNode.html#v:treeNodeValue"
})
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveTreeNodeMethod (t :: Symbol) (o :: *) :: * where
ResolveTreeNodeMethod "key" o = TreeNodeKeyMethodInfo
ResolveTreeNodeMethod "next" o = TreeNodeNextMethodInfo
ResolveTreeNodeMethod "previous" o = TreeNodePreviousMethodInfo
ResolveTreeNodeMethod "value" o = TreeNodeValueMethodInfo
ResolveTreeNodeMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTreeNodeMethod t TreeNode, O.OverloadedMethod info TreeNode p) => OL.IsLabel t (TreeNode -> 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 ~ ResolveTreeNodeMethod t TreeNode, O.OverloadedMethod info TreeNode p, R.HasField t TreeNode p) => R.HasField t TreeNode p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveTreeNodeMethod t TreeNode, O.OverloadedMethodInfo info TreeNode) => OL.IsLabel t (O.MethodProxy info TreeNode) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif