#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Ggit.Structs.RebaseOperation
(
RebaseOperation(..) ,
noRebaseOperation ,
#if ENABLE_OVERLOADING
RebaseOperationGetExecMethodInfo ,
#endif
rebaseOperationGetExec ,
#if ENABLE_OVERLOADING
RebaseOperationGetIdMethodInfo ,
#endif
rebaseOperationGetId ,
#if ENABLE_OVERLOADING
RebaseOperationGetOperationTypeMethodInfo,
#endif
rebaseOperationGetOperationType ,
#if ENABLE_OVERLOADING
RebaseOperationRefMethodInfo ,
#endif
rebaseOperationRef ,
#if 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.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)
foreign import ccall "ggit_rebase_operation_get_type" c_ggit_rebase_operation_get_type ::
IO GType
instance BoxedObject RebaseOperation where
boxedType _ = c_ggit_rebase_operation_get_type
noRebaseOperation :: Maybe RebaseOperation
noRebaseOperation = Nothing
#if 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 = liftIO $ do
rebaseOperation' <- unsafeManagedPtrGetPtr rebaseOperation
result <- ggit_rebase_operation_get_exec rebaseOperation'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- cstringToText result'
return result''
touchManagedPtr rebaseOperation
return maybeResult
#if 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 = liftIO $ do
rebaseOperation' <- unsafeManagedPtrGetPtr rebaseOperation
result <- ggit_rebase_operation_get_id rebaseOperation'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (wrapBoxed Ggit.OId.OId) result'
return result''
touchManagedPtr rebaseOperation
return maybeResult
#if 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 = liftIO $ do
rebaseOperation' <- unsafeManagedPtrGetPtr rebaseOperation
result <- ggit_rebase_operation_get_operation_type rebaseOperation'
let result' = (toEnum . fromIntegral) result
touchManagedPtr rebaseOperation
return result'
#if 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 = liftIO $ do
rebaseOperation' <- unsafeManagedPtrGetPtr rebaseOperation
result <- ggit_rebase_operation_ref rebaseOperation'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newBoxed RebaseOperation) result'
return result''
touchManagedPtr rebaseOperation
return maybeResult
#if 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 = liftIO $ do
rebaseOperation' <- unsafeManagedPtrGetPtr rebaseOperation
ggit_rebase_operation_unref rebaseOperation'
touchManagedPtr rebaseOperation
return ()
#if ENABLE_OVERLOADING
data RebaseOperationUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo RebaseOperationUnrefMethodInfo RebaseOperation signature where
overloadedMethod _ = rebaseOperationUnref
#endif
#if 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 (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif