{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GLib.Structs.Relation
(
Relation(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveRelationMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
RelationCountMethodInfo ,
#endif
relationCount ,
#if defined(ENABLE_OVERLOADING)
RelationDeleteMethodInfo ,
#endif
relationDelete ,
#if defined(ENABLE_OVERLOADING)
RelationDestroyMethodInfo ,
#endif
relationDestroy ,
#if defined(ENABLE_OVERLOADING)
RelationPrintMethodInfo ,
#endif
relationPrint ,
) 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.Kind as DK
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 qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
#else
#endif
newtype Relation = Relation (SP.ManagedPtr Relation)
deriving (Relation -> Relation -> Bool
(Relation -> Relation -> Bool)
-> (Relation -> Relation -> Bool) -> Eq Relation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Relation -> Relation -> Bool
== :: Relation -> Relation -> Bool
$c/= :: Relation -> Relation -> Bool
/= :: Relation -> Relation -> Bool
Eq)
instance SP.ManagedPtrNewtype Relation where
toManagedPtr :: Relation -> ManagedPtr Relation
toManagedPtr (Relation ManagedPtr Relation
p) = ManagedPtr Relation
p
instance BoxedPtr Relation where
boxedPtrCopy :: Relation -> IO Relation
boxedPtrCopy = Relation -> IO Relation
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return
boxedPtrFree :: Relation -> IO ()
boxedPtrFree = \Relation
_x -> () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Relation
type instance O.AttributeList Relation = RelationAttributeList
type RelationAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "g_relation_count" g_relation_count ::
Ptr Relation ->
Ptr () ->
Int32 ->
IO Int32
{-# DEPRECATED relationCount ["(Since version 2.26)","Rarely used API"] #-}
relationCount ::
(B.CallStack.HasCallStack, MonadIO m) =>
Relation
-> Ptr ()
-> Int32
-> m Int32
relationCount :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Relation -> Ptr () -> Int32 -> m Int32
relationCount Relation
relation Ptr ()
key Int32
field = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr Relation
relation' <- Relation -> IO (Ptr Relation)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Relation
relation
Int32
result <- Ptr Relation -> Ptr () -> Int32 -> IO Int32
g_relation_count Ptr Relation
relation' Ptr ()
key Int32
field
Relation -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Relation
relation
Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data RelationCountMethodInfo
instance (signature ~ (Ptr () -> Int32 -> m Int32), MonadIO m) => O.OverloadedMethod RelationCountMethodInfo Relation signature where
overloadedMethod = relationCount
instance O.OverloadedMethodInfo RelationCountMethodInfo Relation where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Relation.relationCount",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Relation.html#v:relationCount"
})
#endif
foreign import ccall "g_relation_delete" g_relation_delete ::
Ptr Relation ->
Ptr () ->
Int32 ->
IO Int32
{-# DEPRECATED relationDelete ["(Since version 2.26)","Rarely used API"] #-}
relationDelete ::
(B.CallStack.HasCallStack, MonadIO m) =>
Relation
-> Ptr ()
-> Int32
-> m Int32
relationDelete :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Relation -> Ptr () -> Int32 -> m Int32
relationDelete Relation
relation Ptr ()
key Int32
field = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr Relation
relation' <- Relation -> IO (Ptr Relation)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Relation
relation
Int32
result <- Ptr Relation -> Ptr () -> Int32 -> IO Int32
g_relation_delete Ptr Relation
relation' Ptr ()
key Int32
field
Relation -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Relation
relation
Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data RelationDeleteMethodInfo
instance (signature ~ (Ptr () -> Int32 -> m Int32), MonadIO m) => O.OverloadedMethod RelationDeleteMethodInfo Relation signature where
overloadedMethod = relationDelete
instance O.OverloadedMethodInfo RelationDeleteMethodInfo Relation where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Relation.relationDelete",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Relation.html#v:relationDelete"
})
#endif
foreign import ccall "g_relation_destroy" g_relation_destroy ::
Ptr Relation ->
IO ()
{-# DEPRECATED relationDestroy ["(Since version 2.26)","Rarely used API"] #-}
relationDestroy ::
(B.CallStack.HasCallStack, MonadIO m) =>
Relation
-> m ()
relationDestroy :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Relation -> m ()
relationDestroy Relation
relation = 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 Relation
relation' <- Relation -> IO (Ptr Relation)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Relation
relation
Ptr Relation -> IO ()
g_relation_destroy Ptr Relation
relation'
Relation -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Relation
relation
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RelationDestroyMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod RelationDestroyMethodInfo Relation signature where
overloadedMethod = relationDestroy
instance O.OverloadedMethodInfo RelationDestroyMethodInfo Relation where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Relation.relationDestroy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Relation.html#v:relationDestroy"
})
#endif
foreign import ccall "g_relation_print" g_relation_print ::
Ptr Relation ->
IO ()
{-# DEPRECATED relationPrint ["(Since version 2.26)","Rarely used API"] #-}
relationPrint ::
(B.CallStack.HasCallStack, MonadIO m) =>
Relation
-> m ()
relationPrint :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Relation -> m ()
relationPrint Relation
relation = 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 Relation
relation' <- Relation -> IO (Ptr Relation)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Relation
relation
Ptr Relation -> IO ()
g_relation_print Ptr Relation
relation'
Relation -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Relation
relation
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RelationPrintMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod RelationPrintMethodInfo Relation signature where
overloadedMethod = relationPrint
instance O.OverloadedMethodInfo RelationPrintMethodInfo Relation where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Relation.relationPrint",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Relation.html#v:relationPrint"
})
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveRelationMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveRelationMethod "count" o = RelationCountMethodInfo
ResolveRelationMethod "delete" o = RelationDeleteMethodInfo
ResolveRelationMethod "destroy" o = RelationDestroyMethodInfo
ResolveRelationMethod "print" o = RelationPrintMethodInfo
ResolveRelationMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveRelationMethod t Relation, O.OverloadedMethod info Relation p) => OL.IsLabel t (Relation -> 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 ~ ResolveRelationMethod t Relation, O.OverloadedMethod info Relation p, R.HasField t Relation p) => R.HasField t Relation p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveRelationMethod t Relation, O.OverloadedMethodInfo info Relation) => OL.IsLabel t (O.MethodProxy info Relation) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif