#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Ggit.Structs.DiffBinary
(
DiffBinary(..) ,
noDiffBinary ,
#if ENABLE_OVERLOADING
DiffBinaryGetNewFileMethodInfo ,
#endif
diffBinaryGetNewFile ,
#if ENABLE_OVERLOADING
DiffBinaryGetOldFileMethodInfo ,
#endif
diffBinaryGetOldFile ,
#if ENABLE_OVERLOADING
DiffBinaryRefMethodInfo ,
#endif
diffBinaryRef ,
#if ENABLE_OVERLOADING
DiffBinaryUnrefMethodInfo ,
#endif
diffBinaryUnref ,
) 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.Structs.DiffBinaryFile as Ggit.DiffBinaryFile
newtype DiffBinary = DiffBinary (ManagedPtr DiffBinary)
foreign import ccall "ggit_diff_binary_get_type" c_ggit_diff_binary_get_type ::
IO GType
instance BoxedObject DiffBinary where
boxedType _ = c_ggit_diff_binary_get_type
noDiffBinary :: Maybe DiffBinary
noDiffBinary = Nothing
#if ENABLE_OVERLOADING
instance O.HasAttributeList DiffBinary
type instance O.AttributeList DiffBinary = DiffBinaryAttributeList
type DiffBinaryAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "ggit_diff_binary_get_new_file" ggit_diff_binary_get_new_file ::
Ptr DiffBinary ->
IO (Ptr Ggit.DiffBinaryFile.DiffBinaryFile)
diffBinaryGetNewFile ::
(B.CallStack.HasCallStack, MonadIO m) =>
DiffBinary
-> m (Maybe Ggit.DiffBinaryFile.DiffBinaryFile)
diffBinaryGetNewFile binary = liftIO $ do
binary' <- unsafeManagedPtrGetPtr binary
result <- ggit_diff_binary_get_new_file binary'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newBoxed Ggit.DiffBinaryFile.DiffBinaryFile) result'
return result''
touchManagedPtr binary
return maybeResult
#if ENABLE_OVERLOADING
data DiffBinaryGetNewFileMethodInfo
instance (signature ~ (m (Maybe Ggit.DiffBinaryFile.DiffBinaryFile)), MonadIO m) => O.MethodInfo DiffBinaryGetNewFileMethodInfo DiffBinary signature where
overloadedMethod _ = diffBinaryGetNewFile
#endif
foreign import ccall "ggit_diff_binary_get_old_file" ggit_diff_binary_get_old_file ::
Ptr DiffBinary ->
IO (Ptr Ggit.DiffBinaryFile.DiffBinaryFile)
diffBinaryGetOldFile ::
(B.CallStack.HasCallStack, MonadIO m) =>
DiffBinary
-> m (Maybe Ggit.DiffBinaryFile.DiffBinaryFile)
diffBinaryGetOldFile binary = liftIO $ do
binary' <- unsafeManagedPtrGetPtr binary
result <- ggit_diff_binary_get_old_file binary'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newBoxed Ggit.DiffBinaryFile.DiffBinaryFile) result'
return result''
touchManagedPtr binary
return maybeResult
#if ENABLE_OVERLOADING
data DiffBinaryGetOldFileMethodInfo
instance (signature ~ (m (Maybe Ggit.DiffBinaryFile.DiffBinaryFile)), MonadIO m) => O.MethodInfo DiffBinaryGetOldFileMethodInfo DiffBinary signature where
overloadedMethod _ = diffBinaryGetOldFile
#endif
foreign import ccall "ggit_diff_binary_ref" ggit_diff_binary_ref ::
Ptr DiffBinary ->
IO (Ptr DiffBinary)
diffBinaryRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
DiffBinary
-> m (Maybe DiffBinary)
diffBinaryRef binary = liftIO $ do
binary' <- unsafeManagedPtrGetPtr binary
result <- ggit_diff_binary_ref binary'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newBoxed DiffBinary) result'
return result''
touchManagedPtr binary
return maybeResult
#if ENABLE_OVERLOADING
data DiffBinaryRefMethodInfo
instance (signature ~ (m (Maybe DiffBinary)), MonadIO m) => O.MethodInfo DiffBinaryRefMethodInfo DiffBinary signature where
overloadedMethod _ = diffBinaryRef
#endif
foreign import ccall "ggit_diff_binary_unref" ggit_diff_binary_unref ::
Ptr DiffBinary ->
IO ()
diffBinaryUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
DiffBinary
-> m ()
diffBinaryUnref binary = liftIO $ do
binary' <- unsafeManagedPtrGetPtr binary
ggit_diff_binary_unref binary'
touchManagedPtr binary
return ()
#if ENABLE_OVERLOADING
data DiffBinaryUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo DiffBinaryUnrefMethodInfo DiffBinary signature where
overloadedMethod _ = diffBinaryUnref
#endif
#if ENABLE_OVERLOADING
type family ResolveDiffBinaryMethod (t :: Symbol) (o :: *) :: * where
ResolveDiffBinaryMethod "ref" o = DiffBinaryRefMethodInfo
ResolveDiffBinaryMethod "unref" o = DiffBinaryUnrefMethodInfo
ResolveDiffBinaryMethod "getNewFile" o = DiffBinaryGetNewFileMethodInfo
ResolveDiffBinaryMethod "getOldFile" o = DiffBinaryGetOldFileMethodInfo
ResolveDiffBinaryMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDiffBinaryMethod t DiffBinary, O.MethodInfo info DiffBinary p) => OL.IsLabel t (DiffBinary -> 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