{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Ggit.Objects.CommitParents
(
CommitParents(..) ,
IsCommitParents ,
toCommitParents ,
noCommitParents ,
#if defined(ENABLE_OVERLOADING)
ResolveCommitParentsMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
CommitParentsGetMethodInfo ,
#endif
commitParentsGet ,
#if defined(ENABLE_OVERLOADING)
CommitParentsGetIdMethodInfo ,
#endif
commitParentsGetId ,
#if defined(ENABLE_OVERLOADING)
CommitParentsGetSizeMethodInfo ,
#endif
commitParentsGetSize ,
commitParentsNew ,
#if defined(ENABLE_OVERLOADING)
CommitParentsCommitPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
commitParentsCommit ,
#endif
constructCommitParentsCommit ,
getCommitParentsCommit ,
#if defined(ENABLE_OVERLOADING)
CommitParentsSizePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
commitParentsSize ,
#endif
getCommitParentsSize ,
) 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.GI.Base.Signals as B.Signals
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 GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Ggit.Objects.Commit as Ggit.Commit
import {-# SOURCE #-} qualified GI.Ggit.Structs.OId as Ggit.OId
newtype CommitParents = CommitParents (ManagedPtr CommitParents)
deriving (Eq)
foreign import ccall "ggit_commit_parents_get_type"
c_ggit_commit_parents_get_type :: IO GType
instance GObject CommitParents where
gobjectType = c_ggit_commit_parents_get_type
instance B.GValue.IsGValue CommitParents where
toGValue o = do
gtype <- c_ggit_commit_parents_get_type
B.ManagedPtr.withManagedPtr o (B.GValue.buildGValue gtype B.GValue.set_object)
fromGValue gv = do
ptr <- B.GValue.get_object gv :: IO (Ptr CommitParents)
B.ManagedPtr.newObject CommitParents ptr
class (GObject o, O.IsDescendantOf CommitParents o) => IsCommitParents o
instance (GObject o, O.IsDescendantOf CommitParents o) => IsCommitParents o
instance O.HasParentTypes CommitParents
type instance O.ParentTypes CommitParents = '[GObject.Object.Object]
toCommitParents :: (MonadIO m, IsCommitParents o) => o -> m CommitParents
toCommitParents = liftIO . unsafeCastTo CommitParents
noCommitParents :: Maybe CommitParents
noCommitParents = Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveCommitParentsMethod (t :: Symbol) (o :: *) :: * where
ResolveCommitParentsMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveCommitParentsMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveCommitParentsMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveCommitParentsMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveCommitParentsMethod "get" o = CommitParentsGetMethodInfo
ResolveCommitParentsMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveCommitParentsMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveCommitParentsMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveCommitParentsMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveCommitParentsMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveCommitParentsMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveCommitParentsMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveCommitParentsMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveCommitParentsMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveCommitParentsMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveCommitParentsMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveCommitParentsMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveCommitParentsMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveCommitParentsMethod "getId" o = CommitParentsGetIdMethodInfo
ResolveCommitParentsMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveCommitParentsMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveCommitParentsMethod "getSize" o = CommitParentsGetSizeMethodInfo
ResolveCommitParentsMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveCommitParentsMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveCommitParentsMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveCommitParentsMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveCommitParentsMethod t CommitParents, O.MethodInfo info CommitParents p) => OL.IsLabel t (CommitParents -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
getCommitParentsCommit :: (MonadIO m, IsCommitParents o) => o -> m (Maybe Ggit.Commit.Commit)
getCommitParentsCommit obj = liftIO $ B.Properties.getObjectPropertyObject obj "commit" Ggit.Commit.Commit
constructCommitParentsCommit :: (IsCommitParents o, Ggit.Commit.IsCommit a) => a -> IO (GValueConstruct o)
constructCommitParentsCommit val = B.Properties.constructObjectPropertyObject "commit" (Just val)
#if defined(ENABLE_OVERLOADING)
data CommitParentsCommitPropertyInfo
instance AttrInfo CommitParentsCommitPropertyInfo where
type AttrAllowedOps CommitParentsCommitPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint CommitParentsCommitPropertyInfo = IsCommitParents
type AttrSetTypeConstraint CommitParentsCommitPropertyInfo = Ggit.Commit.IsCommit
type AttrTransferTypeConstraint CommitParentsCommitPropertyInfo = Ggit.Commit.IsCommit
type AttrTransferType CommitParentsCommitPropertyInfo = Ggit.Commit.Commit
type AttrGetType CommitParentsCommitPropertyInfo = (Maybe Ggit.Commit.Commit)
type AttrLabel CommitParentsCommitPropertyInfo = "commit"
type AttrOrigin CommitParentsCommitPropertyInfo = CommitParents
attrGet = getCommitParentsCommit
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Ggit.Commit.Commit v
attrConstruct = constructCommitParentsCommit
attrClear = undefined
#endif
getCommitParentsSize :: (MonadIO m, IsCommitParents o) => o -> m Word32
getCommitParentsSize obj = liftIO $ B.Properties.getObjectPropertyUInt32 obj "size"
#if defined(ENABLE_OVERLOADING)
data CommitParentsSizePropertyInfo
instance AttrInfo CommitParentsSizePropertyInfo where
type AttrAllowedOps CommitParentsSizePropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint CommitParentsSizePropertyInfo = IsCommitParents
type AttrSetTypeConstraint CommitParentsSizePropertyInfo = (~) ()
type AttrTransferTypeConstraint CommitParentsSizePropertyInfo = (~) ()
type AttrTransferType CommitParentsSizePropertyInfo = ()
type AttrGetType CommitParentsSizePropertyInfo = Word32
type AttrLabel CommitParentsSizePropertyInfo = "size"
type AttrOrigin CommitParentsSizePropertyInfo = CommitParents
attrGet = getCommitParentsSize
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList CommitParents
type instance O.AttributeList CommitParents = CommitParentsAttributeList
type CommitParentsAttributeList = ('[ '("commit", CommitParentsCommitPropertyInfo), '("size", CommitParentsSizePropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
commitParentsCommit :: AttrLabelProxy "commit"
commitParentsCommit = AttrLabelProxy
commitParentsSize :: AttrLabelProxy "size"
commitParentsSize = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList CommitParents = CommitParentsSignalList
type CommitParentsSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "ggit_commit_parents_new" ggit_commit_parents_new ::
Ptr Ggit.Commit.Commit ->
IO (Ptr CommitParents)
commitParentsNew ::
(B.CallStack.HasCallStack, MonadIO m, Ggit.Commit.IsCommit a) =>
a
-> m CommitParents
commitParentsNew commit = liftIO $ do
commit' <- unsafeManagedPtrCastPtr commit
result <- ggit_commit_parents_new commit'
checkUnexpectedReturnNULL "commitParentsNew" result
result' <- (wrapObject CommitParents) result
touchManagedPtr commit
return result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ggit_commit_parents_get" ggit_commit_parents_get ::
Ptr CommitParents ->
Word32 ->
IO (Ptr Ggit.Commit.Commit)
commitParentsGet ::
(B.CallStack.HasCallStack, MonadIO m, IsCommitParents a) =>
a
-> Word32
-> m (Maybe Ggit.Commit.Commit)
commitParentsGet parents idx = liftIO $ do
parents' <- unsafeManagedPtrCastPtr parents
result <- ggit_commit_parents_get parents' idx
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (wrapObject Ggit.Commit.Commit) result'
return result''
touchManagedPtr parents
return maybeResult
#if defined(ENABLE_OVERLOADING)
data CommitParentsGetMethodInfo
instance (signature ~ (Word32 -> m (Maybe Ggit.Commit.Commit)), MonadIO m, IsCommitParents a) => O.MethodInfo CommitParentsGetMethodInfo a signature where
overloadedMethod = commitParentsGet
#endif
foreign import ccall "ggit_commit_parents_get_id" ggit_commit_parents_get_id ::
Ptr CommitParents ->
Word32 ->
IO (Ptr Ggit.OId.OId)
commitParentsGetId ::
(B.CallStack.HasCallStack, MonadIO m, IsCommitParents a) =>
a
-> Word32
-> m (Maybe Ggit.OId.OId)
commitParentsGetId parents idx = liftIO $ do
parents' <- unsafeManagedPtrCastPtr parents
result <- ggit_commit_parents_get_id parents' idx
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (wrapBoxed Ggit.OId.OId) result'
return result''
touchManagedPtr parents
return maybeResult
#if defined(ENABLE_OVERLOADING)
data CommitParentsGetIdMethodInfo
instance (signature ~ (Word32 -> m (Maybe Ggit.OId.OId)), MonadIO m, IsCommitParents a) => O.MethodInfo CommitParentsGetIdMethodInfo a signature where
overloadedMethod = commitParentsGetId
#endif
foreign import ccall "ggit_commit_parents_get_size" ggit_commit_parents_get_size ::
Ptr CommitParents ->
IO Word32
commitParentsGetSize ::
(B.CallStack.HasCallStack, MonadIO m, IsCommitParents a) =>
a
-> m Word32
commitParentsGetSize parents = liftIO $ do
parents' <- unsafeManagedPtrCastPtr parents
result <- ggit_commit_parents_get_size parents'
touchManagedPtr parents
return result
#if defined(ENABLE_OVERLOADING)
data CommitParentsGetSizeMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsCommitParents a) => O.MethodInfo CommitParentsGetSizeMethodInfo a signature where
overloadedMethod = commitParentsGetSize
#endif