{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Ggit.Structs.RebaseOperation
(
RebaseOperation(..) ,
noRebaseOperation ,
#if defined(ENABLE_OVERLOADING)
ResolveRebaseOperationMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
RebaseOperationGetExecMethodInfo ,
#endif
rebaseOperationGetExec ,
#if defined(ENABLE_OVERLOADING)
RebaseOperationGetIdMethodInfo ,
#endif
rebaseOperationGetId ,
#if defined(ENABLE_OVERLOADING)
RebaseOperationGetOperationTypeMethodInfo,
#endif
rebaseOperationGetOperationType ,
#if defined(ENABLE_OVERLOADING)
RebaseOperationRefMethodInfo ,
#endif
rebaseOperationRef ,
#if defined(ENABLE_OVERLOADING)
RebaseOperationUnrefMethodInfo ,
#endif
rebaseOperationUnref ,
) 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 {-# SOURCE #-} qualified GI.Ggit.Enums as Ggit.Enums
import {-# SOURCE #-} qualified GI.Ggit.Structs.OId as Ggit.OId
newtype RebaseOperation = RebaseOperation (ManagedPtr RebaseOperation)
deriving (RebaseOperation -> RebaseOperation -> Bool
(RebaseOperation -> RebaseOperation -> Bool)
-> (RebaseOperation -> RebaseOperation -> Bool)
-> Eq RebaseOperation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RebaseOperation -> RebaseOperation -> Bool
$c/= :: RebaseOperation -> RebaseOperation -> Bool
== :: RebaseOperation -> RebaseOperation -> Bool
$c== :: RebaseOperation -> RebaseOperation -> Bool
Eq)
foreign import ccall "ggit_rebase_operation_get_type" c_ggit_rebase_operation_get_type ::
IO GType
instance BoxedObject RebaseOperation where
boxedType :: RebaseOperation -> IO GType
boxedType _ = IO GType
c_ggit_rebase_operation_get_type
instance B.GValue.IsGValue RebaseOperation where
toGValue :: RebaseOperation -> IO GValue
toGValue o :: RebaseOperation
o = do
GType
gtype <- IO GType
c_ggit_rebase_operation_get_type
RebaseOperation -> (Ptr RebaseOperation -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr RebaseOperation
o (GType
-> (GValue -> Ptr RebaseOperation -> IO ())
-> Ptr RebaseOperation
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr RebaseOperation -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
fromGValue :: GValue -> IO RebaseOperation
fromGValue gv :: GValue
gv = do
Ptr RebaseOperation
ptr <- GValue -> IO (Ptr RebaseOperation)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr RebaseOperation)
(ManagedPtr RebaseOperation -> RebaseOperation)
-> Ptr RebaseOperation -> IO RebaseOperation
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr RebaseOperation -> RebaseOperation
RebaseOperation Ptr RebaseOperation
ptr
noRebaseOperation :: Maybe RebaseOperation
noRebaseOperation :: Maybe RebaseOperation
noRebaseOperation = Maybe RebaseOperation
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList RebaseOperation
type instance O.AttributeList RebaseOperation = RebaseOperationAttributeList
type RebaseOperationAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "ggit_rebase_operation_get_exec" ggit_rebase_operation_get_exec ::
Ptr RebaseOperation ->
IO CString
rebaseOperationGetExec ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOperation
-> m (Maybe T.Text)
rebaseOperationGetExec :: RebaseOperation -> m (Maybe Text)
rebaseOperationGetExec rebaseOperation :: RebaseOperation
rebaseOperation = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr RebaseOperation
rebaseOperation' <- RebaseOperation -> IO (Ptr RebaseOperation)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RebaseOperation
rebaseOperation
CString
result <- Ptr RebaseOperation -> IO CString
ggit_rebase_operation_get_exec Ptr RebaseOperation
rebaseOperation'
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \result' :: CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
RebaseOperation -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RebaseOperation
rebaseOperation
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data RebaseOperationGetExecMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m) => O.MethodInfo RebaseOperationGetExecMethodInfo RebaseOperation signature where
overloadedMethod = rebaseOperationGetExec
#endif
foreign import ccall "ggit_rebase_operation_get_id" ggit_rebase_operation_get_id ::
Ptr RebaseOperation ->
IO (Ptr Ggit.OId.OId)
rebaseOperationGetId ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOperation
-> m (Maybe Ggit.OId.OId)
rebaseOperationGetId :: RebaseOperation -> m (Maybe OId)
rebaseOperationGetId rebaseOperation :: RebaseOperation
rebaseOperation = IO (Maybe OId) -> m (Maybe OId)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe OId) -> m (Maybe OId))
-> IO (Maybe OId) -> m (Maybe OId)
forall a b. (a -> b) -> a -> b
$ do
Ptr RebaseOperation
rebaseOperation' <- RebaseOperation -> IO (Ptr RebaseOperation)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RebaseOperation
rebaseOperation
Ptr OId
result <- Ptr RebaseOperation -> IO (Ptr OId)
ggit_rebase_operation_get_id Ptr RebaseOperation
rebaseOperation'
Maybe OId
maybeResult <- Ptr OId -> (Ptr OId -> IO OId) -> IO (Maybe OId)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr OId
result ((Ptr OId -> IO OId) -> IO (Maybe OId))
-> (Ptr OId -> IO OId) -> IO (Maybe OId)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr OId
result' -> do
OId
result'' <- ((ManagedPtr OId -> OId) -> Ptr OId -> IO OId
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr OId -> OId
Ggit.OId.OId) Ptr OId
result'
OId -> IO OId
forall (m :: * -> *) a. Monad m => a -> m a
return OId
result''
RebaseOperation -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RebaseOperation
rebaseOperation
Maybe OId -> IO (Maybe OId)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe OId
maybeResult
#if defined(ENABLE_OVERLOADING)
data RebaseOperationGetIdMethodInfo
instance (signature ~ (m (Maybe Ggit.OId.OId)), MonadIO m) => O.MethodInfo RebaseOperationGetIdMethodInfo RebaseOperation signature where
overloadedMethod = rebaseOperationGetId
#endif
foreign import ccall "ggit_rebase_operation_get_operation_type" ggit_rebase_operation_get_operation_type ::
Ptr RebaseOperation ->
IO CUInt
rebaseOperationGetOperationType ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOperation
-> m Ggit.Enums.RebaseOperationType
rebaseOperationGetOperationType :: RebaseOperation -> m RebaseOperationType
rebaseOperationGetOperationType rebaseOperation :: RebaseOperation
rebaseOperation = IO RebaseOperationType -> m RebaseOperationType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RebaseOperationType -> m RebaseOperationType)
-> IO RebaseOperationType -> m RebaseOperationType
forall a b. (a -> b) -> a -> b
$ do
Ptr RebaseOperation
rebaseOperation' <- RebaseOperation -> IO (Ptr RebaseOperation)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RebaseOperation
rebaseOperation
CUInt
result <- Ptr RebaseOperation -> IO CUInt
ggit_rebase_operation_get_operation_type Ptr RebaseOperation
rebaseOperation'
let result' :: RebaseOperationType
result' = (Int -> RebaseOperationType
forall a. Enum a => Int -> a
toEnum (Int -> RebaseOperationType)
-> (CUInt -> Int) -> CUInt -> RebaseOperationType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
RebaseOperation -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RebaseOperation
rebaseOperation
RebaseOperationType -> IO RebaseOperationType
forall (m :: * -> *) a. Monad m => a -> m a
return RebaseOperationType
result'
#if defined(ENABLE_OVERLOADING)
data RebaseOperationGetOperationTypeMethodInfo
instance (signature ~ (m Ggit.Enums.RebaseOperationType), MonadIO m) => O.MethodInfo RebaseOperationGetOperationTypeMethodInfo RebaseOperation signature where
overloadedMethod = rebaseOperationGetOperationType
#endif
foreign import ccall "ggit_rebase_operation_ref" ggit_rebase_operation_ref ::
Ptr RebaseOperation ->
IO (Ptr RebaseOperation)
rebaseOperationRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOperation
-> m (Maybe RebaseOperation)
rebaseOperationRef :: RebaseOperation -> m (Maybe RebaseOperation)
rebaseOperationRef rebaseOperation :: RebaseOperation
rebaseOperation = IO (Maybe RebaseOperation) -> m (Maybe RebaseOperation)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe RebaseOperation) -> m (Maybe RebaseOperation))
-> IO (Maybe RebaseOperation) -> m (Maybe RebaseOperation)
forall a b. (a -> b) -> a -> b
$ do
Ptr RebaseOperation
rebaseOperation' <- RebaseOperation -> IO (Ptr RebaseOperation)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RebaseOperation
rebaseOperation
Ptr RebaseOperation
result <- Ptr RebaseOperation -> IO (Ptr RebaseOperation)
ggit_rebase_operation_ref Ptr RebaseOperation
rebaseOperation'
Maybe RebaseOperation
maybeResult <- Ptr RebaseOperation
-> (Ptr RebaseOperation -> IO RebaseOperation)
-> IO (Maybe RebaseOperation)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr RebaseOperation
result ((Ptr RebaseOperation -> IO RebaseOperation)
-> IO (Maybe RebaseOperation))
-> (Ptr RebaseOperation -> IO RebaseOperation)
-> IO (Maybe RebaseOperation)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr RebaseOperation
result' -> do
RebaseOperation
result'' <- ((ManagedPtr RebaseOperation -> RebaseOperation)
-> Ptr RebaseOperation -> IO RebaseOperation
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr RebaseOperation -> RebaseOperation
RebaseOperation) Ptr RebaseOperation
result'
RebaseOperation -> IO RebaseOperation
forall (m :: * -> *) a. Monad m => a -> m a
return RebaseOperation
result''
RebaseOperation -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RebaseOperation
rebaseOperation
Maybe RebaseOperation -> IO (Maybe RebaseOperation)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe RebaseOperation
maybeResult
#if defined(ENABLE_OVERLOADING)
data RebaseOperationRefMethodInfo
instance (signature ~ (m (Maybe RebaseOperation)), MonadIO m) => O.MethodInfo RebaseOperationRefMethodInfo RebaseOperation signature where
overloadedMethod = rebaseOperationRef
#endif
foreign import ccall "ggit_rebase_operation_unref" ggit_rebase_operation_unref ::
Ptr RebaseOperation ->
IO ()
rebaseOperationUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOperation
-> m ()
rebaseOperationUnref :: RebaseOperation -> m ()
rebaseOperationUnref rebaseOperation :: RebaseOperation
rebaseOperation = 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 RebaseOperation
rebaseOperation' <- RebaseOperation -> IO (Ptr RebaseOperation)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RebaseOperation
rebaseOperation
Ptr RebaseOperation -> IO ()
ggit_rebase_operation_unref Ptr RebaseOperation
rebaseOperation'
RebaseOperation -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RebaseOperation
rebaseOperation
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RebaseOperationUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo RebaseOperationUnrefMethodInfo RebaseOperation signature where
overloadedMethod = rebaseOperationUnref
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveRebaseOperationMethod (t :: Symbol) (o :: *) :: * where
ResolveRebaseOperationMethod "ref" o = RebaseOperationRefMethodInfo
ResolveRebaseOperationMethod "unref" o = RebaseOperationUnrefMethodInfo
ResolveRebaseOperationMethod "getExec" o = RebaseOperationGetExecMethodInfo
ResolveRebaseOperationMethod "getId" o = RebaseOperationGetIdMethodInfo
ResolveRebaseOperationMethod "getOperationType" o = RebaseOperationGetOperationTypeMethodInfo
ResolveRebaseOperationMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveRebaseOperationMethod t RebaseOperation, O.MethodInfo info RebaseOperation p) => OL.IsLabel t (RebaseOperation -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif