{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Ggit.Structs.DiffBinary
(
DiffBinary(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveDiffBinaryMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DiffBinaryGetNewFileMethodInfo ,
#endif
diffBinaryGetNewFile ,
#if defined(ENABLE_OVERLOADING)
DiffBinaryGetOldFileMethodInfo ,
#endif
diffBinaryGetOldFile ,
#if defined(ENABLE_OVERLOADING)
DiffBinaryRefMethodInfo ,
#endif
diffBinaryRef ,
#if defined(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.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.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.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 {-# SOURCE #-} qualified GI.Ggit.Structs.DiffBinaryFile as Ggit.DiffBinaryFile
newtype DiffBinary = DiffBinary (SP.ManagedPtr DiffBinary)
deriving (DiffBinary -> DiffBinary -> Bool
(DiffBinary -> DiffBinary -> Bool)
-> (DiffBinary -> DiffBinary -> Bool) -> Eq DiffBinary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DiffBinary -> DiffBinary -> Bool
$c/= :: DiffBinary -> DiffBinary -> Bool
== :: DiffBinary -> DiffBinary -> Bool
$c== :: DiffBinary -> DiffBinary -> Bool
Eq)
instance SP.ManagedPtrNewtype DiffBinary where
toManagedPtr :: DiffBinary -> ManagedPtr DiffBinary
toManagedPtr (DiffBinary ManagedPtr DiffBinary
p) = ManagedPtr DiffBinary
p
foreign import ccall "ggit_diff_binary_get_type" c_ggit_diff_binary_get_type ::
IO GType
type instance O.ParentTypes DiffBinary = '[]
instance O.HasParentTypes DiffBinary
instance B.Types.TypedObject DiffBinary where
glibType :: IO GType
glibType = IO GType
c_ggit_diff_binary_get_type
instance B.Types.GBoxed DiffBinary
instance B.GValue.IsGValue (Maybe DiffBinary) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ggit_diff_binary_get_type
gvalueSet_ :: Ptr GValue -> Maybe DiffBinary -> IO ()
gvalueSet_ Ptr GValue
gv Maybe DiffBinary
P.Nothing = Ptr GValue -> Ptr DiffBinary -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr DiffBinary
forall a. Ptr a
FP.nullPtr :: FP.Ptr DiffBinary)
gvalueSet_ Ptr GValue
gv (P.Just DiffBinary
obj) = DiffBinary -> (Ptr DiffBinary -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DiffBinary
obj (Ptr GValue -> Ptr DiffBinary -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe DiffBinary)
gvalueGet_ Ptr GValue
gv = do
Ptr DiffBinary
ptr <- Ptr GValue -> IO (Ptr DiffBinary)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr DiffBinary)
if Ptr DiffBinary
ptr Ptr DiffBinary -> Ptr DiffBinary -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr DiffBinary
forall a. Ptr a
FP.nullPtr
then DiffBinary -> Maybe DiffBinary
forall a. a -> Maybe a
P.Just (DiffBinary -> Maybe DiffBinary)
-> IO DiffBinary -> IO (Maybe DiffBinary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr DiffBinary -> DiffBinary)
-> Ptr DiffBinary -> IO DiffBinary
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr DiffBinary -> DiffBinary
DiffBinary Ptr DiffBinary
ptr
else Maybe DiffBinary -> IO (Maybe DiffBinary)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe DiffBinary
forall a. Maybe a
P.Nothing
#if defined(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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
DiffBinary -> m (Maybe DiffBinaryFile)
diffBinaryGetNewFile DiffBinary
binary = IO (Maybe DiffBinaryFile) -> m (Maybe DiffBinaryFile)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe DiffBinaryFile) -> m (Maybe DiffBinaryFile))
-> IO (Maybe DiffBinaryFile) -> m (Maybe DiffBinaryFile)
forall a b. (a -> b) -> a -> b
$ do
Ptr DiffBinary
binary' <- DiffBinary -> IO (Ptr DiffBinary)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DiffBinary
binary
Ptr DiffBinaryFile
result <- Ptr DiffBinary -> IO (Ptr DiffBinaryFile)
ggit_diff_binary_get_new_file Ptr DiffBinary
binary'
Maybe DiffBinaryFile
maybeResult <- Ptr DiffBinaryFile
-> (Ptr DiffBinaryFile -> IO DiffBinaryFile)
-> IO (Maybe DiffBinaryFile)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr DiffBinaryFile
result ((Ptr DiffBinaryFile -> IO DiffBinaryFile)
-> IO (Maybe DiffBinaryFile))
-> (Ptr DiffBinaryFile -> IO DiffBinaryFile)
-> IO (Maybe DiffBinaryFile)
forall a b. (a -> b) -> a -> b
$ \Ptr DiffBinaryFile
result' -> do
DiffBinaryFile
result'' <- ((ManagedPtr DiffBinaryFile -> DiffBinaryFile)
-> Ptr DiffBinaryFile -> IO DiffBinaryFile
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr DiffBinaryFile -> DiffBinaryFile
Ggit.DiffBinaryFile.DiffBinaryFile) Ptr DiffBinaryFile
result'
DiffBinaryFile -> IO DiffBinaryFile
forall (m :: * -> *) a. Monad m => a -> m a
return DiffBinaryFile
result''
DiffBinary -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DiffBinary
binary
Maybe DiffBinaryFile -> IO (Maybe DiffBinaryFile)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe DiffBinaryFile
maybeResult
#if defined(ENABLE_OVERLOADING)
data DiffBinaryGetNewFileMethodInfo
instance (signature ~ (m (Maybe Ggit.DiffBinaryFile.DiffBinaryFile)), MonadIO m) => O.OverloadedMethod DiffBinaryGetNewFileMethodInfo DiffBinary signature where
overloadedMethod = diffBinaryGetNewFile
instance O.OverloadedMethodInfo DiffBinaryGetNewFileMethodInfo DiffBinary where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Ggit.Structs.DiffBinary.diffBinaryGetNewFile",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ggit-1.0.11/docs/GI-Ggit-Structs-DiffBinary.html#v: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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
DiffBinary -> m (Maybe DiffBinaryFile)
diffBinaryGetOldFile DiffBinary
binary = IO (Maybe DiffBinaryFile) -> m (Maybe DiffBinaryFile)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe DiffBinaryFile) -> m (Maybe DiffBinaryFile))
-> IO (Maybe DiffBinaryFile) -> m (Maybe DiffBinaryFile)
forall a b. (a -> b) -> a -> b
$ do
Ptr DiffBinary
binary' <- DiffBinary -> IO (Ptr DiffBinary)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DiffBinary
binary
Ptr DiffBinaryFile
result <- Ptr DiffBinary -> IO (Ptr DiffBinaryFile)
ggit_diff_binary_get_old_file Ptr DiffBinary
binary'
Maybe DiffBinaryFile
maybeResult <- Ptr DiffBinaryFile
-> (Ptr DiffBinaryFile -> IO DiffBinaryFile)
-> IO (Maybe DiffBinaryFile)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr DiffBinaryFile
result ((Ptr DiffBinaryFile -> IO DiffBinaryFile)
-> IO (Maybe DiffBinaryFile))
-> (Ptr DiffBinaryFile -> IO DiffBinaryFile)
-> IO (Maybe DiffBinaryFile)
forall a b. (a -> b) -> a -> b
$ \Ptr DiffBinaryFile
result' -> do
DiffBinaryFile
result'' <- ((ManagedPtr DiffBinaryFile -> DiffBinaryFile)
-> Ptr DiffBinaryFile -> IO DiffBinaryFile
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr DiffBinaryFile -> DiffBinaryFile
Ggit.DiffBinaryFile.DiffBinaryFile) Ptr DiffBinaryFile
result'
DiffBinaryFile -> IO DiffBinaryFile
forall (m :: * -> *) a. Monad m => a -> m a
return DiffBinaryFile
result''
DiffBinary -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DiffBinary
binary
Maybe DiffBinaryFile -> IO (Maybe DiffBinaryFile)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe DiffBinaryFile
maybeResult
#if defined(ENABLE_OVERLOADING)
data DiffBinaryGetOldFileMethodInfo
instance (signature ~ (m (Maybe Ggit.DiffBinaryFile.DiffBinaryFile)), MonadIO m) => O.OverloadedMethod DiffBinaryGetOldFileMethodInfo DiffBinary signature where
overloadedMethod = diffBinaryGetOldFile
instance O.OverloadedMethodInfo DiffBinaryGetOldFileMethodInfo DiffBinary where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Ggit.Structs.DiffBinary.diffBinaryGetOldFile",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ggit-1.0.11/docs/GI-Ggit-Structs-DiffBinary.html#v: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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
DiffBinary -> m (Maybe DiffBinary)
diffBinaryRef DiffBinary
binary = IO (Maybe DiffBinary) -> m (Maybe DiffBinary)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe DiffBinary) -> m (Maybe DiffBinary))
-> IO (Maybe DiffBinary) -> m (Maybe DiffBinary)
forall a b. (a -> b) -> a -> b
$ do
Ptr DiffBinary
binary' <- DiffBinary -> IO (Ptr DiffBinary)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DiffBinary
binary
Ptr DiffBinary
result <- Ptr DiffBinary -> IO (Ptr DiffBinary)
ggit_diff_binary_ref Ptr DiffBinary
binary'
Maybe DiffBinary
maybeResult <- Ptr DiffBinary
-> (Ptr DiffBinary -> IO DiffBinary) -> IO (Maybe DiffBinary)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr DiffBinary
result ((Ptr DiffBinary -> IO DiffBinary) -> IO (Maybe DiffBinary))
-> (Ptr DiffBinary -> IO DiffBinary) -> IO (Maybe DiffBinary)
forall a b. (a -> b) -> a -> b
$ \Ptr DiffBinary
result' -> do
DiffBinary
result'' <- ((ManagedPtr DiffBinary -> DiffBinary)
-> Ptr DiffBinary -> IO DiffBinary
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr DiffBinary -> DiffBinary
DiffBinary) Ptr DiffBinary
result'
DiffBinary -> IO DiffBinary
forall (m :: * -> *) a. Monad m => a -> m a
return DiffBinary
result''
DiffBinary -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DiffBinary
binary
Maybe DiffBinary -> IO (Maybe DiffBinary)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe DiffBinary
maybeResult
#if defined(ENABLE_OVERLOADING)
data DiffBinaryRefMethodInfo
instance (signature ~ (m (Maybe DiffBinary)), MonadIO m) => O.OverloadedMethod DiffBinaryRefMethodInfo DiffBinary signature where
overloadedMethod = diffBinaryRef
instance O.OverloadedMethodInfo DiffBinaryRefMethodInfo DiffBinary where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Ggit.Structs.DiffBinary.diffBinaryRef",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ggit-1.0.11/docs/GI-Ggit-Structs-DiffBinary.html#v: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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
DiffBinary -> m ()
diffBinaryUnref DiffBinary
binary = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr DiffBinary
binary' <- DiffBinary -> IO (Ptr DiffBinary)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DiffBinary
binary
Ptr DiffBinary -> IO ()
ggit_diff_binary_unref Ptr DiffBinary
binary'
DiffBinary -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DiffBinary
binary
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DiffBinaryUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod DiffBinaryUnrefMethodInfo DiffBinary signature where
overloadedMethod = diffBinaryUnref
instance O.OverloadedMethodInfo DiffBinaryUnrefMethodInfo DiffBinary where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Ggit.Structs.DiffBinary.diffBinaryUnref",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ggit-1.0.11/docs/GI-Ggit-Structs-DiffBinary.html#v:diffBinaryUnref"
})
#endif
#if defined(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.OverloadedMethod info DiffBinary p) => OL.IsLabel t (DiffBinary -> 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 ~ ResolveDiffBinaryMethod t DiffBinary, O.OverloadedMethod info DiffBinary p, R.HasField t DiffBinary p) => R.HasField t DiffBinary p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveDiffBinaryMethod t DiffBinary, O.OverloadedMethodInfo info DiffBinary) => OL.IsLabel t (O.MethodProxy info DiffBinary) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif