#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Ggit.Structs.BlameHunk
(
BlameHunk(..) ,
noBlameHunk ,
#if ENABLE_OVERLOADING
BlameHunkGetFinalCommitIdMethodInfo ,
#endif
blameHunkGetFinalCommitId ,
#if ENABLE_OVERLOADING
BlameHunkGetFinalSignatureMethodInfo ,
#endif
blameHunkGetFinalSignature ,
#if ENABLE_OVERLOADING
BlameHunkGetFinalStartLineNumberMethodInfo,
#endif
blameHunkGetFinalStartLineNumber ,
#if ENABLE_OVERLOADING
BlameHunkGetLinesInHunkMethodInfo ,
#endif
blameHunkGetLinesInHunk ,
#if ENABLE_OVERLOADING
BlameHunkGetOrigCommitIdMethodInfo ,
#endif
blameHunkGetOrigCommitId ,
#if ENABLE_OVERLOADING
BlameHunkGetOrigPathMethodInfo ,
#endif
blameHunkGetOrigPath ,
#if ENABLE_OVERLOADING
BlameHunkGetOrigSignatureMethodInfo ,
#endif
blameHunkGetOrigSignature ,
#if ENABLE_OVERLOADING
BlameHunkGetOrigStartLineNumberMethodInfo,
#endif
blameHunkGetOrigStartLineNumber ,
#if ENABLE_OVERLOADING
BlameHunkIsBoundaryMethodInfo ,
#endif
blameHunkIsBoundary ,
#if ENABLE_OVERLOADING
BlameHunkRefMethodInfo ,
#endif
blameHunkRef ,
#if ENABLE_OVERLOADING
BlameHunkUnrefMethodInfo ,
#endif
blameHunkUnref ,
) 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.Ggit.Objects.Signature as Ggit.Signature
import {-# SOURCE #-} qualified GI.Ggit.Structs.OId as Ggit.OId
newtype BlameHunk = BlameHunk (ManagedPtr BlameHunk)
foreign import ccall "ggit_blame_hunk_get_type" c_ggit_blame_hunk_get_type ::
IO GType
instance BoxedObject BlameHunk where
boxedType _ = c_ggit_blame_hunk_get_type
noBlameHunk :: Maybe BlameHunk
noBlameHunk = Nothing
#if ENABLE_OVERLOADING
instance O.HasAttributeList BlameHunk
type instance O.AttributeList BlameHunk = BlameHunkAttributeList
type BlameHunkAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "ggit_blame_hunk_get_final_commit_id" ggit_blame_hunk_get_final_commit_id ::
Ptr BlameHunk ->
IO (Ptr Ggit.OId.OId)
blameHunkGetFinalCommitId ::
(B.CallStack.HasCallStack, MonadIO m) =>
BlameHunk
-> m (Maybe Ggit.OId.OId)
blameHunkGetFinalCommitId blameHunk = liftIO $ do
blameHunk' <- unsafeManagedPtrGetPtr blameHunk
result <- ggit_blame_hunk_get_final_commit_id blameHunk'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newBoxed Ggit.OId.OId) result'
return result''
touchManagedPtr blameHunk
return maybeResult
#if ENABLE_OVERLOADING
data BlameHunkGetFinalCommitIdMethodInfo
instance (signature ~ (m (Maybe Ggit.OId.OId)), MonadIO m) => O.MethodInfo BlameHunkGetFinalCommitIdMethodInfo BlameHunk signature where
overloadedMethod _ = blameHunkGetFinalCommitId
#endif
foreign import ccall "ggit_blame_hunk_get_final_signature" ggit_blame_hunk_get_final_signature ::
Ptr BlameHunk ->
IO (Ptr Ggit.Signature.Signature)
blameHunkGetFinalSignature ::
(B.CallStack.HasCallStack, MonadIO m) =>
BlameHunk
-> m (Maybe Ggit.Signature.Signature)
blameHunkGetFinalSignature blameHunk = liftIO $ do
blameHunk' <- unsafeManagedPtrGetPtr blameHunk
result <- ggit_blame_hunk_get_final_signature blameHunk'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject Ggit.Signature.Signature) result'
return result''
touchManagedPtr blameHunk
return maybeResult
#if ENABLE_OVERLOADING
data BlameHunkGetFinalSignatureMethodInfo
instance (signature ~ (m (Maybe Ggit.Signature.Signature)), MonadIO m) => O.MethodInfo BlameHunkGetFinalSignatureMethodInfo BlameHunk signature where
overloadedMethod _ = blameHunkGetFinalSignature
#endif
foreign import ccall "ggit_blame_hunk_get_final_start_line_number" ggit_blame_hunk_get_final_start_line_number ::
Ptr BlameHunk ->
IO Word16
blameHunkGetFinalStartLineNumber ::
(B.CallStack.HasCallStack, MonadIO m) =>
BlameHunk
-> m Word16
blameHunkGetFinalStartLineNumber blameHunk = liftIO $ do
blameHunk' <- unsafeManagedPtrGetPtr blameHunk
result <- ggit_blame_hunk_get_final_start_line_number blameHunk'
touchManagedPtr blameHunk
return result
#if ENABLE_OVERLOADING
data BlameHunkGetFinalStartLineNumberMethodInfo
instance (signature ~ (m Word16), MonadIO m) => O.MethodInfo BlameHunkGetFinalStartLineNumberMethodInfo BlameHunk signature where
overloadedMethod _ = blameHunkGetFinalStartLineNumber
#endif
foreign import ccall "ggit_blame_hunk_get_lines_in_hunk" ggit_blame_hunk_get_lines_in_hunk ::
Ptr BlameHunk ->
IO Word16
blameHunkGetLinesInHunk ::
(B.CallStack.HasCallStack, MonadIO m) =>
BlameHunk
-> m Word16
blameHunkGetLinesInHunk blameHunk = liftIO $ do
blameHunk' <- unsafeManagedPtrGetPtr blameHunk
result <- ggit_blame_hunk_get_lines_in_hunk blameHunk'
touchManagedPtr blameHunk
return result
#if ENABLE_OVERLOADING
data BlameHunkGetLinesInHunkMethodInfo
instance (signature ~ (m Word16), MonadIO m) => O.MethodInfo BlameHunkGetLinesInHunkMethodInfo BlameHunk signature where
overloadedMethod _ = blameHunkGetLinesInHunk
#endif
foreign import ccall "ggit_blame_hunk_get_orig_commit_id" ggit_blame_hunk_get_orig_commit_id ::
Ptr BlameHunk ->
IO (Ptr Ggit.OId.OId)
blameHunkGetOrigCommitId ::
(B.CallStack.HasCallStack, MonadIO m) =>
BlameHunk
-> m (Maybe Ggit.OId.OId)
blameHunkGetOrigCommitId blameHunk = liftIO $ do
blameHunk' <- unsafeManagedPtrGetPtr blameHunk
result <- ggit_blame_hunk_get_orig_commit_id blameHunk'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newBoxed Ggit.OId.OId) result'
return result''
touchManagedPtr blameHunk
return maybeResult
#if ENABLE_OVERLOADING
data BlameHunkGetOrigCommitIdMethodInfo
instance (signature ~ (m (Maybe Ggit.OId.OId)), MonadIO m) => O.MethodInfo BlameHunkGetOrigCommitIdMethodInfo BlameHunk signature where
overloadedMethod _ = blameHunkGetOrigCommitId
#endif
foreign import ccall "ggit_blame_hunk_get_orig_path" ggit_blame_hunk_get_orig_path ::
Ptr BlameHunk ->
IO CString
blameHunkGetOrigPath ::
(B.CallStack.HasCallStack, MonadIO m) =>
BlameHunk
-> m (Maybe T.Text)
blameHunkGetOrigPath blameHunk = liftIO $ do
blameHunk' <- unsafeManagedPtrGetPtr blameHunk
result <- ggit_blame_hunk_get_orig_path blameHunk'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- cstringToText result'
return result''
touchManagedPtr blameHunk
return maybeResult
#if ENABLE_OVERLOADING
data BlameHunkGetOrigPathMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m) => O.MethodInfo BlameHunkGetOrigPathMethodInfo BlameHunk signature where
overloadedMethod _ = blameHunkGetOrigPath
#endif
foreign import ccall "ggit_blame_hunk_get_orig_signature" ggit_blame_hunk_get_orig_signature ::
Ptr BlameHunk ->
IO (Ptr Ggit.Signature.Signature)
blameHunkGetOrigSignature ::
(B.CallStack.HasCallStack, MonadIO m) =>
BlameHunk
-> m (Maybe Ggit.Signature.Signature)
blameHunkGetOrigSignature blameHunk = liftIO $ do
blameHunk' <- unsafeManagedPtrGetPtr blameHunk
result <- ggit_blame_hunk_get_orig_signature blameHunk'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject Ggit.Signature.Signature) result'
return result''
touchManagedPtr blameHunk
return maybeResult
#if ENABLE_OVERLOADING
data BlameHunkGetOrigSignatureMethodInfo
instance (signature ~ (m (Maybe Ggit.Signature.Signature)), MonadIO m) => O.MethodInfo BlameHunkGetOrigSignatureMethodInfo BlameHunk signature where
overloadedMethod _ = blameHunkGetOrigSignature
#endif
foreign import ccall "ggit_blame_hunk_get_orig_start_line_number" ggit_blame_hunk_get_orig_start_line_number ::
Ptr BlameHunk ->
IO Word16
blameHunkGetOrigStartLineNumber ::
(B.CallStack.HasCallStack, MonadIO m) =>
BlameHunk
-> m Word16
blameHunkGetOrigStartLineNumber blameHunk = liftIO $ do
blameHunk' <- unsafeManagedPtrGetPtr blameHunk
result <- ggit_blame_hunk_get_orig_start_line_number blameHunk'
touchManagedPtr blameHunk
return result
#if ENABLE_OVERLOADING
data BlameHunkGetOrigStartLineNumberMethodInfo
instance (signature ~ (m Word16), MonadIO m) => O.MethodInfo BlameHunkGetOrigStartLineNumberMethodInfo BlameHunk signature where
overloadedMethod _ = blameHunkGetOrigStartLineNumber
#endif
foreign import ccall "ggit_blame_hunk_is_boundary" ggit_blame_hunk_is_boundary ::
Ptr BlameHunk ->
IO CInt
blameHunkIsBoundary ::
(B.CallStack.HasCallStack, MonadIO m) =>
BlameHunk
-> m Bool
blameHunkIsBoundary blameHunk = liftIO $ do
blameHunk' <- unsafeManagedPtrGetPtr blameHunk
result <- ggit_blame_hunk_is_boundary blameHunk'
let result' = (/= 0) result
touchManagedPtr blameHunk
return result'
#if ENABLE_OVERLOADING
data BlameHunkIsBoundaryMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo BlameHunkIsBoundaryMethodInfo BlameHunk signature where
overloadedMethod _ = blameHunkIsBoundary
#endif
foreign import ccall "ggit_blame_hunk_ref" ggit_blame_hunk_ref ::
Ptr BlameHunk ->
IO (Ptr BlameHunk)
blameHunkRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
BlameHunk
-> m (Maybe BlameHunk)
blameHunkRef blameHunk = liftIO $ do
blameHunk' <- unsafeManagedPtrGetPtr blameHunk
result <- ggit_blame_hunk_ref blameHunk'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newBoxed BlameHunk) result'
return result''
touchManagedPtr blameHunk
return maybeResult
#if ENABLE_OVERLOADING
data BlameHunkRefMethodInfo
instance (signature ~ (m (Maybe BlameHunk)), MonadIO m) => O.MethodInfo BlameHunkRefMethodInfo BlameHunk signature where
overloadedMethod _ = blameHunkRef
#endif
foreign import ccall "ggit_blame_hunk_unref" ggit_blame_hunk_unref ::
Ptr BlameHunk ->
IO ()
blameHunkUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
BlameHunk
-> m ()
blameHunkUnref blameHunk = liftIO $ do
blameHunk' <- unsafeManagedPtrGetPtr blameHunk
ggit_blame_hunk_unref blameHunk'
touchManagedPtr blameHunk
return ()
#if ENABLE_OVERLOADING
data BlameHunkUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo BlameHunkUnrefMethodInfo BlameHunk signature where
overloadedMethod _ = blameHunkUnref
#endif
#if ENABLE_OVERLOADING
type family ResolveBlameHunkMethod (t :: Symbol) (o :: *) :: * where
ResolveBlameHunkMethod "isBoundary" o = BlameHunkIsBoundaryMethodInfo
ResolveBlameHunkMethod "ref" o = BlameHunkRefMethodInfo
ResolveBlameHunkMethod "unref" o = BlameHunkUnrefMethodInfo
ResolveBlameHunkMethod "getFinalCommitId" o = BlameHunkGetFinalCommitIdMethodInfo
ResolveBlameHunkMethod "getFinalSignature" o = BlameHunkGetFinalSignatureMethodInfo
ResolveBlameHunkMethod "getFinalStartLineNumber" o = BlameHunkGetFinalStartLineNumberMethodInfo
ResolveBlameHunkMethod "getLinesInHunk" o = BlameHunkGetLinesInHunkMethodInfo
ResolveBlameHunkMethod "getOrigCommitId" o = BlameHunkGetOrigCommitIdMethodInfo
ResolveBlameHunkMethod "getOrigPath" o = BlameHunkGetOrigPathMethodInfo
ResolveBlameHunkMethod "getOrigSignature" o = BlameHunkGetOrigSignatureMethodInfo
ResolveBlameHunkMethod "getOrigStartLineNumber" o = BlameHunkGetOrigStartLineNumberMethodInfo
ResolveBlameHunkMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveBlameHunkMethod t BlameHunk, O.MethodInfo info BlameHunk p) => OL.IsLabel t (BlameHunk -> 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