#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Atk.Objects.RelationSet
(
RelationSet(..) ,
IsRelationSet ,
toRelationSet ,
noRelationSet ,
#if ENABLE_OVERLOADING
RelationSetAddMethodInfo ,
#endif
relationSetAdd ,
#if ENABLE_OVERLOADING
RelationSetAddRelationByTypeMethodInfo ,
#endif
relationSetAddRelationByType ,
#if ENABLE_OVERLOADING
RelationSetContainsMethodInfo ,
#endif
relationSetContains ,
#if ENABLE_OVERLOADING
RelationSetContainsTargetMethodInfo ,
#endif
relationSetContainsTarget ,
#if ENABLE_OVERLOADING
RelationSetGetNRelationsMethodInfo ,
#endif
relationSetGetNRelations ,
#if ENABLE_OVERLOADING
RelationSetGetRelationMethodInfo ,
#endif
relationSetGetRelation ,
#if ENABLE_OVERLOADING
RelationSetGetRelationByTypeMethodInfo ,
#endif
relationSetGetRelationByType ,
relationSetNew ,
#if ENABLE_OVERLOADING
RelationSetRemoveMethodInfo ,
#endif
relationSetRemove ,
) 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.ManagedPtr as B.ManagedPtr
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.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 {-# SOURCE #-} qualified GI.Atk.Enums as Atk.Enums
import {-# SOURCE #-} qualified GI.Atk.Objects.Object as Atk.Object
import {-# SOURCE #-} qualified GI.Atk.Objects.Relation as Atk.Relation
import qualified GI.GObject.Objects.Object as GObject.Object
newtype RelationSet = RelationSet (ManagedPtr RelationSet)
foreign import ccall "atk_relation_set_get_type"
c_atk_relation_set_get_type :: IO GType
instance GObject RelationSet where
gobjectType = c_atk_relation_set_get_type
class (GObject o, O.IsDescendantOf RelationSet o) => IsRelationSet o
instance (GObject o, O.IsDescendantOf RelationSet o) => IsRelationSet o
instance O.HasParentTypes RelationSet
type instance O.ParentTypes RelationSet = '[GObject.Object.Object]
toRelationSet :: (MonadIO m, IsRelationSet o) => o -> m RelationSet
toRelationSet = liftIO . unsafeCastTo RelationSet
noRelationSet :: Maybe RelationSet
noRelationSet = Nothing
#if ENABLE_OVERLOADING
type family ResolveRelationSetMethod (t :: Symbol) (o :: *) :: * where
ResolveRelationSetMethod "add" o = RelationSetAddMethodInfo
ResolveRelationSetMethod "addRelationByType" o = RelationSetAddRelationByTypeMethodInfo
ResolveRelationSetMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveRelationSetMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveRelationSetMethod "contains" o = RelationSetContainsMethodInfo
ResolveRelationSetMethod "containsTarget" o = RelationSetContainsTargetMethodInfo
ResolveRelationSetMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveRelationSetMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveRelationSetMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveRelationSetMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveRelationSetMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveRelationSetMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveRelationSetMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveRelationSetMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveRelationSetMethod "remove" o = RelationSetRemoveMethodInfo
ResolveRelationSetMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveRelationSetMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveRelationSetMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveRelationSetMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveRelationSetMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveRelationSetMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveRelationSetMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveRelationSetMethod "getNRelations" o = RelationSetGetNRelationsMethodInfo
ResolveRelationSetMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveRelationSetMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveRelationSetMethod "getRelation" o = RelationSetGetRelationMethodInfo
ResolveRelationSetMethod "getRelationByType" o = RelationSetGetRelationByTypeMethodInfo
ResolveRelationSetMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveRelationSetMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveRelationSetMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveRelationSetMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveRelationSetMethod t RelationSet, O.MethodInfo info RelationSet p) => OL.IsLabel t (RelationSet -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList RelationSet
type instance O.AttributeList RelationSet = RelationSetAttributeList
type RelationSetAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList RelationSet = RelationSetSignalList
type RelationSetSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "atk_relation_set_new" atk_relation_set_new ::
IO (Ptr RelationSet)
relationSetNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m RelationSet
relationSetNew = liftIO $ do
result <- atk_relation_set_new
checkUnexpectedReturnNULL "relationSetNew" result
result' <- (wrapObject RelationSet) result
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "atk_relation_set_add" atk_relation_set_add ::
Ptr RelationSet ->
Ptr Atk.Relation.Relation ->
IO ()
relationSetAdd ::
(B.CallStack.HasCallStack, MonadIO m, IsRelationSet a, Atk.Relation.IsRelation b) =>
a
-> b
-> m ()
relationSetAdd set relation = liftIO $ do
set' <- unsafeManagedPtrCastPtr set
relation' <- unsafeManagedPtrCastPtr relation
atk_relation_set_add set' relation'
touchManagedPtr set
touchManagedPtr relation
return ()
#if ENABLE_OVERLOADING
data RelationSetAddMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsRelationSet a, Atk.Relation.IsRelation b) => O.MethodInfo RelationSetAddMethodInfo a signature where
overloadedMethod _ = relationSetAdd
#endif
foreign import ccall "atk_relation_set_add_relation_by_type" atk_relation_set_add_relation_by_type ::
Ptr RelationSet ->
CUInt ->
Ptr Atk.Object.Object ->
IO ()
relationSetAddRelationByType ::
(B.CallStack.HasCallStack, MonadIO m, IsRelationSet a, Atk.Object.IsObject b) =>
a
-> Atk.Enums.RelationType
-> b
-> m ()
relationSetAddRelationByType set relationship target = liftIO $ do
set' <- unsafeManagedPtrCastPtr set
let relationship' = (fromIntegral . fromEnum) relationship
target' <- unsafeManagedPtrCastPtr target
atk_relation_set_add_relation_by_type set' relationship' target'
touchManagedPtr set
touchManagedPtr target
return ()
#if ENABLE_OVERLOADING
data RelationSetAddRelationByTypeMethodInfo
instance (signature ~ (Atk.Enums.RelationType -> b -> m ()), MonadIO m, IsRelationSet a, Atk.Object.IsObject b) => O.MethodInfo RelationSetAddRelationByTypeMethodInfo a signature where
overloadedMethod _ = relationSetAddRelationByType
#endif
foreign import ccall "atk_relation_set_contains" atk_relation_set_contains ::
Ptr RelationSet ->
CUInt ->
IO CInt
relationSetContains ::
(B.CallStack.HasCallStack, MonadIO m, IsRelationSet a) =>
a
-> Atk.Enums.RelationType
-> m Bool
relationSetContains set relationship = liftIO $ do
set' <- unsafeManagedPtrCastPtr set
let relationship' = (fromIntegral . fromEnum) relationship
result <- atk_relation_set_contains set' relationship'
let result' = (/= 0) result
touchManagedPtr set
return result'
#if ENABLE_OVERLOADING
data RelationSetContainsMethodInfo
instance (signature ~ (Atk.Enums.RelationType -> m Bool), MonadIO m, IsRelationSet a) => O.MethodInfo RelationSetContainsMethodInfo a signature where
overloadedMethod _ = relationSetContains
#endif
foreign import ccall "atk_relation_set_contains_target" atk_relation_set_contains_target ::
Ptr RelationSet ->
CUInt ->
Ptr Atk.Object.Object ->
IO CInt
relationSetContainsTarget ::
(B.CallStack.HasCallStack, MonadIO m, IsRelationSet a, Atk.Object.IsObject b) =>
a
-> Atk.Enums.RelationType
-> b
-> m Bool
relationSetContainsTarget set relationship target = liftIO $ do
set' <- unsafeManagedPtrCastPtr set
let relationship' = (fromIntegral . fromEnum) relationship
target' <- unsafeManagedPtrCastPtr target
result <- atk_relation_set_contains_target set' relationship' target'
let result' = (/= 0) result
touchManagedPtr set
touchManagedPtr target
return result'
#if ENABLE_OVERLOADING
data RelationSetContainsTargetMethodInfo
instance (signature ~ (Atk.Enums.RelationType -> b -> m Bool), MonadIO m, IsRelationSet a, Atk.Object.IsObject b) => O.MethodInfo RelationSetContainsTargetMethodInfo a signature where
overloadedMethod _ = relationSetContainsTarget
#endif
foreign import ccall "atk_relation_set_get_n_relations" atk_relation_set_get_n_relations ::
Ptr RelationSet ->
IO Int32
relationSetGetNRelations ::
(B.CallStack.HasCallStack, MonadIO m, IsRelationSet a) =>
a
-> m Int32
relationSetGetNRelations set = liftIO $ do
set' <- unsafeManagedPtrCastPtr set
result <- atk_relation_set_get_n_relations set'
touchManagedPtr set
return result
#if ENABLE_OVERLOADING
data RelationSetGetNRelationsMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsRelationSet a) => O.MethodInfo RelationSetGetNRelationsMethodInfo a signature where
overloadedMethod _ = relationSetGetNRelations
#endif
foreign import ccall "atk_relation_set_get_relation" atk_relation_set_get_relation ::
Ptr RelationSet ->
Int32 ->
IO (Ptr Atk.Relation.Relation)
relationSetGetRelation ::
(B.CallStack.HasCallStack, MonadIO m, IsRelationSet a) =>
a
-> Int32
-> m Atk.Relation.Relation
relationSetGetRelation set i = liftIO $ do
set' <- unsafeManagedPtrCastPtr set
result <- atk_relation_set_get_relation set' i
checkUnexpectedReturnNULL "relationSetGetRelation" result
result' <- (newObject Atk.Relation.Relation) result
touchManagedPtr set
return result'
#if ENABLE_OVERLOADING
data RelationSetGetRelationMethodInfo
instance (signature ~ (Int32 -> m Atk.Relation.Relation), MonadIO m, IsRelationSet a) => O.MethodInfo RelationSetGetRelationMethodInfo a signature where
overloadedMethod _ = relationSetGetRelation
#endif
foreign import ccall "atk_relation_set_get_relation_by_type" atk_relation_set_get_relation_by_type ::
Ptr RelationSet ->
CUInt ->
IO (Ptr Atk.Relation.Relation)
relationSetGetRelationByType ::
(B.CallStack.HasCallStack, MonadIO m, IsRelationSet a) =>
a
-> Atk.Enums.RelationType
-> m Atk.Relation.Relation
relationSetGetRelationByType set relationship = liftIO $ do
set' <- unsafeManagedPtrCastPtr set
let relationship' = (fromIntegral . fromEnum) relationship
result <- atk_relation_set_get_relation_by_type set' relationship'
checkUnexpectedReturnNULL "relationSetGetRelationByType" result
result' <- (newObject Atk.Relation.Relation) result
touchManagedPtr set
return result'
#if ENABLE_OVERLOADING
data RelationSetGetRelationByTypeMethodInfo
instance (signature ~ (Atk.Enums.RelationType -> m Atk.Relation.Relation), MonadIO m, IsRelationSet a) => O.MethodInfo RelationSetGetRelationByTypeMethodInfo a signature where
overloadedMethod _ = relationSetGetRelationByType
#endif
foreign import ccall "atk_relation_set_remove" atk_relation_set_remove ::
Ptr RelationSet ->
Ptr Atk.Relation.Relation ->
IO ()
relationSetRemove ::
(B.CallStack.HasCallStack, MonadIO m, IsRelationSet a, Atk.Relation.IsRelation b) =>
a
-> b
-> m ()
relationSetRemove set relation = liftIO $ do
set' <- unsafeManagedPtrCastPtr set
relation' <- unsafeManagedPtrCastPtr relation
atk_relation_set_remove set' relation'
touchManagedPtr set
touchManagedPtr relation
return ()
#if ENABLE_OVERLOADING
data RelationSetRemoveMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsRelationSet a, Atk.Relation.IsRelation b) => O.MethodInfo RelationSetRemoveMethodInfo a signature where
overloadedMethod _ = relationSetRemove
#endif