{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Ggit.Structs.RebaseOptions
(
RebaseOptions(..) ,
noRebaseOptions ,
#if defined(ENABLE_OVERLOADING)
ResolveRebaseOptionsMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
RebaseOptionsCopyMethodInfo ,
#endif
rebaseOptionsCopy ,
#if defined(ENABLE_OVERLOADING)
RebaseOptionsFreeMethodInfo ,
#endif
rebaseOptionsFree ,
#if defined(ENABLE_OVERLOADING)
RebaseOptionsGetCheckoutOptionsMethodInfo,
#endif
rebaseOptionsGetCheckoutOptions ,
#if defined(ENABLE_OVERLOADING)
RebaseOptionsGetQuietMethodInfo ,
#endif
rebaseOptionsGetQuiet ,
#if defined(ENABLE_OVERLOADING)
RebaseOptionsGetRewriteNotesRefMethodInfo,
#endif
rebaseOptionsGetRewriteNotesRef ,
rebaseOptionsNew ,
#if defined(ENABLE_OVERLOADING)
RebaseOptionsSetCheckoutOptionsMethodInfo,
#endif
rebaseOptionsSetCheckoutOptions ,
#if defined(ENABLE_OVERLOADING)
RebaseOptionsSetQuietMethodInfo ,
#endif
rebaseOptionsSetQuiet ,
#if defined(ENABLE_OVERLOADING)
RebaseOptionsSetRewriteNotesRefMethodInfo,
#endif
rebaseOptionsSetRewriteNotesRef ,
) 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.Objects.CheckoutOptions as Ggit.CheckoutOptions
newtype RebaseOptions = RebaseOptions (ManagedPtr RebaseOptions)
deriving (Eq)
foreign import ccall "ggit_rebase_options_get_type" c_ggit_rebase_options_get_type ::
IO GType
instance BoxedObject RebaseOptions where
boxedType _ = c_ggit_rebase_options_get_type
instance B.GValue.IsGValue RebaseOptions where
toGValue o = do
gtype <- c_ggit_rebase_options_get_type
B.ManagedPtr.withManagedPtr o (B.GValue.buildGValue gtype B.GValue.set_boxed)
fromGValue gv = do
ptr <- B.GValue.get_boxed gv :: IO (Ptr RebaseOptions)
B.ManagedPtr.newBoxed RebaseOptions ptr
noRebaseOptions :: Maybe RebaseOptions
noRebaseOptions = Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList RebaseOptions
type instance O.AttributeList RebaseOptions = RebaseOptionsAttributeList
type RebaseOptionsAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "ggit_rebase_options_new" ggit_rebase_options_new ::
IO (Ptr RebaseOptions)
rebaseOptionsNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m RebaseOptions
rebaseOptionsNew = liftIO $ do
result <- ggit_rebase_options_new
checkUnexpectedReturnNULL "rebaseOptionsNew" result
result' <- (wrapBoxed RebaseOptions) result
return result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ggit_rebase_options_copy" ggit_rebase_options_copy ::
Ptr RebaseOptions ->
IO (Ptr RebaseOptions)
rebaseOptionsCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOptions
-> m (Maybe RebaseOptions)
rebaseOptionsCopy rebaseOptions = liftIO $ do
rebaseOptions' <- unsafeManagedPtrGetPtr rebaseOptions
result <- ggit_rebase_options_copy rebaseOptions'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (wrapBoxed RebaseOptions) result'
return result''
touchManagedPtr rebaseOptions
return maybeResult
#if defined(ENABLE_OVERLOADING)
data RebaseOptionsCopyMethodInfo
instance (signature ~ (m (Maybe RebaseOptions)), MonadIO m) => O.MethodInfo RebaseOptionsCopyMethodInfo RebaseOptions signature where
overloadedMethod = rebaseOptionsCopy
#endif
foreign import ccall "ggit_rebase_options_free" ggit_rebase_options_free ::
Ptr RebaseOptions ->
IO ()
rebaseOptionsFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOptions
-> m ()
rebaseOptionsFree rebaseOptions = liftIO $ do
rebaseOptions' <- unsafeManagedPtrGetPtr rebaseOptions
ggit_rebase_options_free rebaseOptions'
touchManagedPtr rebaseOptions
return ()
#if defined(ENABLE_OVERLOADING)
data RebaseOptionsFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo RebaseOptionsFreeMethodInfo RebaseOptions signature where
overloadedMethod = rebaseOptionsFree
#endif
foreign import ccall "ggit_rebase_options_get_checkout_options" ggit_rebase_options_get_checkout_options ::
Ptr RebaseOptions ->
IO (Ptr Ggit.CheckoutOptions.CheckoutOptions)
rebaseOptionsGetCheckoutOptions ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOptions
-> m (Maybe Ggit.CheckoutOptions.CheckoutOptions)
rebaseOptionsGetCheckoutOptions rebaseOptions = liftIO $ do
rebaseOptions' <- unsafeManagedPtrGetPtr rebaseOptions
result <- ggit_rebase_options_get_checkout_options rebaseOptions'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject Ggit.CheckoutOptions.CheckoutOptions) result'
return result''
touchManagedPtr rebaseOptions
return maybeResult
#if defined(ENABLE_OVERLOADING)
data RebaseOptionsGetCheckoutOptionsMethodInfo
instance (signature ~ (m (Maybe Ggit.CheckoutOptions.CheckoutOptions)), MonadIO m) => O.MethodInfo RebaseOptionsGetCheckoutOptionsMethodInfo RebaseOptions signature where
overloadedMethod = rebaseOptionsGetCheckoutOptions
#endif
foreign import ccall "ggit_rebase_options_get_quiet" ggit_rebase_options_get_quiet ::
Ptr RebaseOptions ->
IO CInt
rebaseOptionsGetQuiet ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOptions
-> m Bool
rebaseOptionsGetQuiet rebaseOptions = liftIO $ do
rebaseOptions' <- unsafeManagedPtrGetPtr rebaseOptions
result <- ggit_rebase_options_get_quiet rebaseOptions'
let result' = (/= 0) result
touchManagedPtr rebaseOptions
return result'
#if defined(ENABLE_OVERLOADING)
data RebaseOptionsGetQuietMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo RebaseOptionsGetQuietMethodInfo RebaseOptions signature where
overloadedMethod = rebaseOptionsGetQuiet
#endif
foreign import ccall "ggit_rebase_options_get_rewrite_notes_ref" ggit_rebase_options_get_rewrite_notes_ref ::
Ptr RebaseOptions ->
IO CString
rebaseOptionsGetRewriteNotesRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOptions
-> m (Maybe T.Text)
rebaseOptionsGetRewriteNotesRef rebaseOptions = liftIO $ do
rebaseOptions' <- unsafeManagedPtrGetPtr rebaseOptions
result <- ggit_rebase_options_get_rewrite_notes_ref rebaseOptions'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- cstringToText result'
return result''
touchManagedPtr rebaseOptions
return maybeResult
#if defined(ENABLE_OVERLOADING)
data RebaseOptionsGetRewriteNotesRefMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m) => O.MethodInfo RebaseOptionsGetRewriteNotesRefMethodInfo RebaseOptions signature where
overloadedMethod = rebaseOptionsGetRewriteNotesRef
#endif
foreign import ccall "ggit_rebase_options_set_checkout_options" ggit_rebase_options_set_checkout_options ::
Ptr RebaseOptions ->
Ptr Ggit.CheckoutOptions.CheckoutOptions ->
IO ()
rebaseOptionsSetCheckoutOptions ::
(B.CallStack.HasCallStack, MonadIO m, Ggit.CheckoutOptions.IsCheckoutOptions a) =>
RebaseOptions
-> a
-> m ()
rebaseOptionsSetCheckoutOptions rebaseOptions checkoutOptions = liftIO $ do
rebaseOptions' <- unsafeManagedPtrGetPtr rebaseOptions
checkoutOptions' <- unsafeManagedPtrCastPtr checkoutOptions
ggit_rebase_options_set_checkout_options rebaseOptions' checkoutOptions'
touchManagedPtr rebaseOptions
touchManagedPtr checkoutOptions
return ()
#if defined(ENABLE_OVERLOADING)
data RebaseOptionsSetCheckoutOptionsMethodInfo
instance (signature ~ (a -> m ()), MonadIO m, Ggit.CheckoutOptions.IsCheckoutOptions a) => O.MethodInfo RebaseOptionsSetCheckoutOptionsMethodInfo RebaseOptions signature where
overloadedMethod = rebaseOptionsSetCheckoutOptions
#endif
foreign import ccall "ggit_rebase_options_set_quiet" ggit_rebase_options_set_quiet ::
Ptr RebaseOptions ->
CInt ->
IO ()
rebaseOptionsSetQuiet ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOptions
-> Bool
-> m ()
rebaseOptionsSetQuiet rebaseOptions quiet = liftIO $ do
rebaseOptions' <- unsafeManagedPtrGetPtr rebaseOptions
let quiet' = (fromIntegral . fromEnum) quiet
ggit_rebase_options_set_quiet rebaseOptions' quiet'
touchManagedPtr rebaseOptions
return ()
#if defined(ENABLE_OVERLOADING)
data RebaseOptionsSetQuietMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m) => O.MethodInfo RebaseOptionsSetQuietMethodInfo RebaseOptions signature where
overloadedMethod = rebaseOptionsSetQuiet
#endif
foreign import ccall "ggit_rebase_options_set_rewrite_notes_ref" ggit_rebase_options_set_rewrite_notes_ref ::
Ptr RebaseOptions ->
CString ->
IO ()
rebaseOptionsSetRewriteNotesRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOptions
-> T.Text
-> m ()
rebaseOptionsSetRewriteNotesRef rebaseOptions rewriteNotesRef = liftIO $ do
rebaseOptions' <- unsafeManagedPtrGetPtr rebaseOptions
rewriteNotesRef' <- textToCString rewriteNotesRef
ggit_rebase_options_set_rewrite_notes_ref rebaseOptions' rewriteNotesRef'
touchManagedPtr rebaseOptions
freeMem rewriteNotesRef'
return ()
#if defined(ENABLE_OVERLOADING)
data RebaseOptionsSetRewriteNotesRefMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m) => O.MethodInfo RebaseOptionsSetRewriteNotesRefMethodInfo RebaseOptions signature where
overloadedMethod = rebaseOptionsSetRewriteNotesRef
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveRebaseOptionsMethod (t :: Symbol) (o :: *) :: * where
ResolveRebaseOptionsMethod "copy" o = RebaseOptionsCopyMethodInfo
ResolveRebaseOptionsMethod "free" o = RebaseOptionsFreeMethodInfo
ResolveRebaseOptionsMethod "getCheckoutOptions" o = RebaseOptionsGetCheckoutOptionsMethodInfo
ResolveRebaseOptionsMethod "getQuiet" o = RebaseOptionsGetQuietMethodInfo
ResolveRebaseOptionsMethod "getRewriteNotesRef" o = RebaseOptionsGetRewriteNotesRefMethodInfo
ResolveRebaseOptionsMethod "setCheckoutOptions" o = RebaseOptionsSetCheckoutOptionsMethodInfo
ResolveRebaseOptionsMethod "setQuiet" o = RebaseOptionsSetQuietMethodInfo
ResolveRebaseOptionsMethod "setRewriteNotesRef" o = RebaseOptionsSetRewriteNotesRefMethodInfo
ResolveRebaseOptionsMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveRebaseOptionsMethod t RebaseOptions, O.MethodInfo info RebaseOptions p) => OL.IsLabel t (RebaseOptions -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif