gi-ggit-1.0.4: GI/Ggit/Structs/RebaseOptions.hs
{- |
Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License : LGPL-2.1
Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc)
Represents the options used when rebasing.
-}
#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Ggit.Structs.RebaseOptions
(
-- * Exported types
RebaseOptions(..) ,
noRebaseOptions ,
-- * Methods
-- ** copy #method:copy#
#if ENABLE_OVERLOADING
RebaseOptionsCopyMethodInfo ,
#endif
rebaseOptionsCopy ,
-- ** free #method:free#
#if ENABLE_OVERLOADING
RebaseOptionsFreeMethodInfo ,
#endif
rebaseOptionsFree ,
-- ** getCheckoutOptions #method:getCheckoutOptions#
#if ENABLE_OVERLOADING
RebaseOptionsGetCheckoutOptionsMethodInfo,
#endif
rebaseOptionsGetCheckoutOptions ,
-- ** getQuiet #method:getQuiet#
#if ENABLE_OVERLOADING
RebaseOptionsGetQuietMethodInfo ,
#endif
rebaseOptionsGetQuiet ,
-- ** getRewriteNotesRef #method:getRewriteNotesRef#
#if ENABLE_OVERLOADING
RebaseOptionsGetRewriteNotesRefMethodInfo,
#endif
rebaseOptionsGetRewriteNotesRef ,
-- ** new #method:new#
rebaseOptionsNew ,
-- ** setCheckoutOptions #method:setCheckoutOptions#
#if ENABLE_OVERLOADING
RebaseOptionsSetCheckoutOptionsMethodInfo,
#endif
rebaseOptionsSetCheckoutOptions ,
-- ** setQuiet #method:setQuiet#
#if ENABLE_OVERLOADING
RebaseOptionsSetQuietMethodInfo ,
#endif
rebaseOptionsSetQuiet ,
-- ** setRewriteNotesRef #method:setRewriteNotesRef#
#if 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.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
-- | Memory-managed wrapper type.
newtype RebaseOptions = RebaseOptions (ManagedPtr RebaseOptions)
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
-- | A convenience alias for `Nothing` :: `Maybe` `RebaseOptions`.
noRebaseOptions :: Maybe RebaseOptions
noRebaseOptions = Nothing
#if ENABLE_OVERLOADING
instance O.HasAttributeList RebaseOptions
type instance O.AttributeList RebaseOptions = RebaseOptionsAttributeList
type RebaseOptionsAttributeList = ('[ ] :: [(Symbol, *)])
#endif
-- method RebaseOptions::new
-- method type : Constructor
-- Args : []
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Ggit", name = "RebaseOptions"}))
-- throws : False
-- Skip return : False
foreign import ccall "ggit_rebase_options_new" ggit_rebase_options_new ::
IO (Ptr RebaseOptions)
{- |
Creates a new 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'.
-}
rebaseOptionsNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m RebaseOptions
{- ^ __Returns:__ a newly allocated 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'. -}
rebaseOptionsNew = liftIO $ do
result <- ggit_rebase_options_new
checkUnexpectedReturnNULL "rebaseOptionsNew" result
result' <- (wrapBoxed RebaseOptions) result
return result'
#if ENABLE_OVERLOADING
#endif
-- method RebaseOptions::copy
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rebase_options", argType = TInterface (Name {namespace = "Ggit", name = "RebaseOptions"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GgitRebaseOptions.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Ggit", name = "RebaseOptions"}))
-- throws : False
-- Skip return : False
foreign import ccall "ggit_rebase_options_copy" ggit_rebase_options_copy ::
Ptr RebaseOptions -> -- rebase_options : TInterface (Name {namespace = "Ggit", name = "RebaseOptions"})
IO (Ptr RebaseOptions)
{- |
Copies /@rebaseOptions@/ into a newly allocated 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'.
-}
rebaseOptionsCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOptions
{- ^ /@rebaseOptions@/: a 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'. -}
-> m (Maybe RebaseOptions)
{- ^ __Returns:__ a newly allocated 'GI.Ggit.Structs.RebaseOptions.RebaseOptions' or 'Nothing'. -}
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 ENABLE_OVERLOADING
data RebaseOptionsCopyMethodInfo
instance (signature ~ (m (Maybe RebaseOptions)), MonadIO m) => O.MethodInfo RebaseOptionsCopyMethodInfo RebaseOptions signature where
overloadedMethod _ = rebaseOptionsCopy
#endif
-- method RebaseOptions::free
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rebase_options", argType = TInterface (Name {namespace = "Ggit", name = "RebaseOptions"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GgitRebaseOptions.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "ggit_rebase_options_free" ggit_rebase_options_free ::
Ptr RebaseOptions -> -- rebase_options : TInterface (Name {namespace = "Ggit", name = "RebaseOptions"})
IO ()
{- |
Frees /@rebaseOptions@/.
-}
rebaseOptionsFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOptions
{- ^ /@rebaseOptions@/: a 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'. -}
-> m ()
rebaseOptionsFree rebaseOptions = liftIO $ do
rebaseOptions' <- unsafeManagedPtrGetPtr rebaseOptions
ggit_rebase_options_free rebaseOptions'
touchManagedPtr rebaseOptions
return ()
#if ENABLE_OVERLOADING
data RebaseOptionsFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo RebaseOptionsFreeMethodInfo RebaseOptions signature where
overloadedMethod _ = rebaseOptionsFree
#endif
-- method RebaseOptions::get_checkout_options
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rebase_options", argType = TInterface (Name {namespace = "Ggit", name = "RebaseOptions"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GgitRebaseOptions.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Ggit", name = "CheckoutOptions"}))
-- throws : False
-- Skip return : False
foreign import ccall "ggit_rebase_options_get_checkout_options" ggit_rebase_options_get_checkout_options ::
Ptr RebaseOptions -> -- rebase_options : TInterface (Name {namespace = "Ggit", name = "RebaseOptions"})
IO (Ptr Ggit.CheckoutOptions.CheckoutOptions)
{- |
Get the checkout options object or 'Nothing' if not set.
-}
rebaseOptionsGetCheckoutOptions ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOptions
{- ^ /@rebaseOptions@/: a 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'. -}
-> m (Maybe Ggit.CheckoutOptions.CheckoutOptions)
{- ^ __Returns:__ the checkout options or 'Nothing'. -}
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 ENABLE_OVERLOADING
data RebaseOptionsGetCheckoutOptionsMethodInfo
instance (signature ~ (m (Maybe Ggit.CheckoutOptions.CheckoutOptions)), MonadIO m) => O.MethodInfo RebaseOptionsGetCheckoutOptionsMethodInfo RebaseOptions signature where
overloadedMethod _ = rebaseOptionsGetCheckoutOptions
#endif
-- method RebaseOptions::get_quiet
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rebase_options", argType = TInterface (Name {namespace = "Ggit", name = "RebaseOptions"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GgitRebaseOptions.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False
foreign import ccall "ggit_rebase_options_get_quiet" ggit_rebase_options_get_quiet ::
Ptr RebaseOptions -> -- rebase_options : TInterface (Name {namespace = "Ggit", name = "RebaseOptions"})
IO CInt
{- |
Gets whether you want a quiet rebase experience.
-}
rebaseOptionsGetQuiet ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOptions
{- ^ /@rebaseOptions@/: a 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'. -}
-> m Bool
{- ^ __Returns:__ returns whether you want a quiet rebase experience. -}
rebaseOptionsGetQuiet rebaseOptions = liftIO $ do
rebaseOptions' <- unsafeManagedPtrGetPtr rebaseOptions
result <- ggit_rebase_options_get_quiet rebaseOptions'
let result' = (/= 0) result
touchManagedPtr rebaseOptions
return result'
#if ENABLE_OVERLOADING
data RebaseOptionsGetQuietMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo RebaseOptionsGetQuietMethodInfo RebaseOptions signature where
overloadedMethod _ = rebaseOptionsGetQuiet
#endif
-- method RebaseOptions::get_rewrite_notes_ref
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rebase_options", argType = TInterface (Name {namespace = "Ggit", name = "RebaseOptions"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GgitRebaseOptions.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False
foreign import ccall "ggit_rebase_options_get_rewrite_notes_ref" ggit_rebase_options_get_rewrite_notes_ref ::
Ptr RebaseOptions -> -- rebase_options : TInterface (Name {namespace = "Ggit", name = "RebaseOptions"})
IO CString
{- |
Gets the the name of the notes reference used to rewrite notes for rebased
commits when finishing the rebase or 'Nothing' if not set.
-}
rebaseOptionsGetRewriteNotesRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOptions
{- ^ /@rebaseOptions@/: a 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'. -}
-> m (Maybe T.Text)
{- ^ __Returns:__ the name of the notes reference or 'Nothing'. -}
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 ENABLE_OVERLOADING
data RebaseOptionsGetRewriteNotesRefMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m) => O.MethodInfo RebaseOptionsGetRewriteNotesRefMethodInfo RebaseOptions signature where
overloadedMethod _ = rebaseOptionsGetRewriteNotesRef
#endif
-- method RebaseOptions::set_checkout_options
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rebase_options", argType = TInterface (Name {namespace = "Ggit", name = "RebaseOptions"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "checkout_options", argType = TInterface (Name {namespace = "Ggit", name = "CheckoutOptions"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "ggit_rebase_options_set_checkout_options" ggit_rebase_options_set_checkout_options ::
Ptr RebaseOptions -> -- rebase_options : TInterface (Name {namespace = "Ggit", name = "RebaseOptions"})
Ptr Ggit.CheckoutOptions.CheckoutOptions -> -- checkout_options : TInterface (Name {namespace = "Ggit", name = "CheckoutOptions"})
IO ()
{- |
/No description available in the introspection data./
-}
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 ENABLE_OVERLOADING
data RebaseOptionsSetCheckoutOptionsMethodInfo
instance (signature ~ (a -> m ()), MonadIO m, Ggit.CheckoutOptions.IsCheckoutOptions a) => O.MethodInfo RebaseOptionsSetCheckoutOptionsMethodInfo RebaseOptions signature where
overloadedMethod _ = rebaseOptionsSetCheckoutOptions
#endif
-- method RebaseOptions::set_quiet
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rebase_options", argType = TInterface (Name {namespace = "Ggit", name = "RebaseOptions"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GgitRebaseOptions.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "quiet", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "whether you want a quiet rebase experience.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "ggit_rebase_options_set_quiet" ggit_rebase_options_set_quiet ::
Ptr RebaseOptions -> -- rebase_options : TInterface (Name {namespace = "Ggit", name = "RebaseOptions"})
CInt -> -- quiet : TBasicType TBoolean
IO ()
{- |
Used by @/ggit_rebase_init()/@, this will instruct other clients working
on this rebase that you want a quiet rebase experience, which they
may choose to provide in an application-specific manner. This has no
effect upon libgit2-glib directly, but is provided for interoperability
between Git tools.
-}
rebaseOptionsSetQuiet ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOptions
{- ^ /@rebaseOptions@/: a 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'. -}
-> Bool
{- ^ /@quiet@/: whether you want a quiet rebase experience. -}
-> 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 ENABLE_OVERLOADING
data RebaseOptionsSetQuietMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m) => O.MethodInfo RebaseOptionsSetQuietMethodInfo RebaseOptions signature where
overloadedMethod _ = rebaseOptionsSetQuiet
#endif
-- method RebaseOptions::set_rewrite_notes_ref
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "rebase_options", argType = TInterface (Name {namespace = "Ggit", name = "RebaseOptions"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GgitRebaseOptions.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "rewrite_notes_ref", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the name of the notes reference.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "ggit_rebase_options_set_rewrite_notes_ref" ggit_rebase_options_set_rewrite_notes_ref ::
Ptr RebaseOptions -> -- rebase_options : TInterface (Name {namespace = "Ggit", name = "RebaseOptions"})
CString -> -- rewrite_notes_ref : TBasicType TUTF8
IO ()
{- |
Used by 'GI.Ggit.Objects.Rebase.rebaseFinish', this is the name of the notes reference
used to rewrite notes for rebased commits when finishing the rebase;
if 'Nothing', the contents of the configuration option @notes.rewriteRef@
is examined, unless the configuration option @notes.rewrite.rebase@
is set to false. If @notes.rewriteRef@ is also 'Nothing', notes will
not be rewritten.
-}
rebaseOptionsSetRewriteNotesRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
RebaseOptions
{- ^ /@rebaseOptions@/: a 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'. -}
-> T.Text
{- ^ /@rewriteNotesRef@/: the name of the notes reference. -}
-> 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 ENABLE_OVERLOADING
data RebaseOptionsSetRewriteNotesRefMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m) => O.MethodInfo RebaseOptionsSetRewriteNotesRefMethodInfo RebaseOptions signature where
overloadedMethod _ = rebaseOptionsSetRewriteNotesRef
#endif
#if 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 (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif