#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Ggit.Objects.CloneOptions
(
CloneOptions(..) ,
IsCloneOptions ,
toCloneOptions ,
noCloneOptions ,
#if ENABLE_OVERLOADING
CloneOptionsGetCheckoutBranchMethodInfo ,
#endif
cloneOptionsGetCheckoutBranch ,
#if ENABLE_OVERLOADING
CloneOptionsGetFetchOptionsMethodInfo ,
#endif
cloneOptionsGetFetchOptions ,
#if ENABLE_OVERLOADING
CloneOptionsGetIsBareMethodInfo ,
#endif
cloneOptionsGetIsBare ,
#if ENABLE_OVERLOADING
CloneOptionsGetLocalMethodInfo ,
#endif
cloneOptionsGetLocal ,
cloneOptionsNew ,
#if ENABLE_OVERLOADING
CloneOptionsSetCheckoutBranchMethodInfo ,
#endif
cloneOptionsSetCheckoutBranch ,
#if ENABLE_OVERLOADING
CloneOptionsSetFetchOptionsMethodInfo ,
#endif
cloneOptionsSetFetchOptions ,
#if ENABLE_OVERLOADING
CloneOptionsSetIsBareMethodInfo ,
#endif
cloneOptionsSetIsBare ,
#if ENABLE_OVERLOADING
CloneOptionsSetLocalMethodInfo ,
#endif
cloneOptionsSetLocal ,
) 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 qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Ggit.Enums as Ggit.Enums
import {-# SOURCE #-} qualified GI.Ggit.Structs.FetchOptions as Ggit.FetchOptions
newtype CloneOptions = CloneOptions (ManagedPtr CloneOptions)
foreign import ccall "ggit_clone_options_get_type"
c_ggit_clone_options_get_type :: IO GType
instance GObject CloneOptions where
gobjectType = c_ggit_clone_options_get_type
class (GObject o, O.IsDescendantOf CloneOptions o) => IsCloneOptions o
instance (GObject o, O.IsDescendantOf CloneOptions o) => IsCloneOptions o
instance O.HasParentTypes CloneOptions
type instance O.ParentTypes CloneOptions = '[GObject.Object.Object]
toCloneOptions :: (MonadIO m, IsCloneOptions o) => o -> m CloneOptions
toCloneOptions = liftIO . unsafeCastTo CloneOptions
noCloneOptions :: Maybe CloneOptions
noCloneOptions = Nothing
#if ENABLE_OVERLOADING
type family ResolveCloneOptionsMethod (t :: Symbol) (o :: *) :: * where
ResolveCloneOptionsMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveCloneOptionsMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveCloneOptionsMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveCloneOptionsMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveCloneOptionsMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveCloneOptionsMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveCloneOptionsMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveCloneOptionsMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveCloneOptionsMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveCloneOptionsMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveCloneOptionsMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveCloneOptionsMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveCloneOptionsMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveCloneOptionsMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveCloneOptionsMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveCloneOptionsMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveCloneOptionsMethod "getCheckoutBranch" o = CloneOptionsGetCheckoutBranchMethodInfo
ResolveCloneOptionsMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveCloneOptionsMethod "getFetchOptions" o = CloneOptionsGetFetchOptionsMethodInfo
ResolveCloneOptionsMethod "getIsBare" o = CloneOptionsGetIsBareMethodInfo
ResolveCloneOptionsMethod "getLocal" o = CloneOptionsGetLocalMethodInfo
ResolveCloneOptionsMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveCloneOptionsMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveCloneOptionsMethod "setCheckoutBranch" o = CloneOptionsSetCheckoutBranchMethodInfo
ResolveCloneOptionsMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveCloneOptionsMethod "setFetchOptions" o = CloneOptionsSetFetchOptionsMethodInfo
ResolveCloneOptionsMethod "setIsBare" o = CloneOptionsSetIsBareMethodInfo
ResolveCloneOptionsMethod "setLocal" o = CloneOptionsSetLocalMethodInfo
ResolveCloneOptionsMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveCloneOptionsMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveCloneOptionsMethod t CloneOptions, O.MethodInfo info CloneOptions p) => OL.IsLabel t (CloneOptions -> 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
#if ENABLE_OVERLOADING
instance O.HasAttributeList CloneOptions
type instance O.AttributeList CloneOptions = CloneOptionsAttributeList
type CloneOptionsAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList CloneOptions = CloneOptionsSignalList
type CloneOptionsSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "ggit_clone_options_new" ggit_clone_options_new ::
IO (Ptr CloneOptions)
cloneOptionsNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m CloneOptions
cloneOptionsNew = liftIO $ do
result <- ggit_clone_options_new
checkUnexpectedReturnNULL "cloneOptionsNew" result
result' <- (wrapObject CloneOptions) result
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "ggit_clone_options_get_checkout_branch" ggit_clone_options_get_checkout_branch ::
Ptr CloneOptions ->
IO CString
cloneOptionsGetCheckoutBranch ::
(B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
a
-> m T.Text
cloneOptionsGetCheckoutBranch options = liftIO $ do
options' <- unsafeManagedPtrCastPtr options
result <- ggit_clone_options_get_checkout_branch options'
checkUnexpectedReturnNULL "cloneOptionsGetCheckoutBranch" result
result' <- cstringToText result
touchManagedPtr options
return result'
#if ENABLE_OVERLOADING
data CloneOptionsGetCheckoutBranchMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsCloneOptions a) => O.MethodInfo CloneOptionsGetCheckoutBranchMethodInfo a signature where
overloadedMethod _ = cloneOptionsGetCheckoutBranch
#endif
foreign import ccall "ggit_clone_options_get_fetch_options" ggit_clone_options_get_fetch_options ::
Ptr CloneOptions ->
IO (Ptr Ggit.FetchOptions.FetchOptions)
cloneOptionsGetFetchOptions ::
(B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
a
-> m Ggit.FetchOptions.FetchOptions
cloneOptionsGetFetchOptions options = liftIO $ do
options' <- unsafeManagedPtrCastPtr options
result <- ggit_clone_options_get_fetch_options options'
checkUnexpectedReturnNULL "cloneOptionsGetFetchOptions" result
result' <- (newBoxed Ggit.FetchOptions.FetchOptions) result
touchManagedPtr options
return result'
#if ENABLE_OVERLOADING
data CloneOptionsGetFetchOptionsMethodInfo
instance (signature ~ (m Ggit.FetchOptions.FetchOptions), MonadIO m, IsCloneOptions a) => O.MethodInfo CloneOptionsGetFetchOptionsMethodInfo a signature where
overloadedMethod _ = cloneOptionsGetFetchOptions
#endif
foreign import ccall "ggit_clone_options_get_is_bare" ggit_clone_options_get_is_bare ::
Ptr CloneOptions ->
IO CInt
cloneOptionsGetIsBare ::
(B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
a
-> m Bool
cloneOptionsGetIsBare options = liftIO $ do
options' <- unsafeManagedPtrCastPtr options
result <- ggit_clone_options_get_is_bare options'
let result' = (/= 0) result
touchManagedPtr options
return result'
#if ENABLE_OVERLOADING
data CloneOptionsGetIsBareMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsCloneOptions a) => O.MethodInfo CloneOptionsGetIsBareMethodInfo a signature where
overloadedMethod _ = cloneOptionsGetIsBare
#endif
foreign import ccall "ggit_clone_options_get_local" ggit_clone_options_get_local ::
Ptr CloneOptions ->
IO CUInt
cloneOptionsGetLocal ::
(B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
a
-> m Ggit.Enums.CloneLocal
cloneOptionsGetLocal options = liftIO $ do
options' <- unsafeManagedPtrCastPtr options
result <- ggit_clone_options_get_local options'
let result' = (toEnum . fromIntegral) result
touchManagedPtr options
return result'
#if ENABLE_OVERLOADING
data CloneOptionsGetLocalMethodInfo
instance (signature ~ (m Ggit.Enums.CloneLocal), MonadIO m, IsCloneOptions a) => O.MethodInfo CloneOptionsGetLocalMethodInfo a signature where
overloadedMethod _ = cloneOptionsGetLocal
#endif
foreign import ccall "ggit_clone_options_set_checkout_branch" ggit_clone_options_set_checkout_branch ::
Ptr CloneOptions ->
CString ->
IO ()
cloneOptionsSetCheckoutBranch ::
(B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
a
-> Maybe (T.Text)
-> m ()
cloneOptionsSetCheckoutBranch options checkoutBranch = liftIO $ do
options' <- unsafeManagedPtrCastPtr options
maybeCheckoutBranch <- case checkoutBranch of
Nothing -> return nullPtr
Just jCheckoutBranch -> do
jCheckoutBranch' <- textToCString jCheckoutBranch
return jCheckoutBranch'
ggit_clone_options_set_checkout_branch options' maybeCheckoutBranch
touchManagedPtr options
freeMem maybeCheckoutBranch
return ()
#if ENABLE_OVERLOADING
data CloneOptionsSetCheckoutBranchMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsCloneOptions a) => O.MethodInfo CloneOptionsSetCheckoutBranchMethodInfo a signature where
overloadedMethod _ = cloneOptionsSetCheckoutBranch
#endif
foreign import ccall "ggit_clone_options_set_fetch_options" ggit_clone_options_set_fetch_options ::
Ptr CloneOptions ->
Ptr Ggit.FetchOptions.FetchOptions ->
IO ()
cloneOptionsSetFetchOptions ::
(B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
a
-> Maybe (Ggit.FetchOptions.FetchOptions)
-> m ()
cloneOptionsSetFetchOptions options fetchOptions = liftIO $ do
options' <- unsafeManagedPtrCastPtr options
maybeFetchOptions <- case fetchOptions of
Nothing -> return nullPtr
Just jFetchOptions -> do
jFetchOptions' <- unsafeManagedPtrGetPtr jFetchOptions
return jFetchOptions'
ggit_clone_options_set_fetch_options options' maybeFetchOptions
touchManagedPtr options
whenJust fetchOptions touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data CloneOptionsSetFetchOptionsMethodInfo
instance (signature ~ (Maybe (Ggit.FetchOptions.FetchOptions) -> m ()), MonadIO m, IsCloneOptions a) => O.MethodInfo CloneOptionsSetFetchOptionsMethodInfo a signature where
overloadedMethod _ = cloneOptionsSetFetchOptions
#endif
foreign import ccall "ggit_clone_options_set_is_bare" ggit_clone_options_set_is_bare ::
Ptr CloneOptions ->
CInt ->
IO ()
cloneOptionsSetIsBare ::
(B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
a
-> Bool
-> m ()
cloneOptionsSetIsBare options bare = liftIO $ do
options' <- unsafeManagedPtrCastPtr options
let bare' = (fromIntegral . fromEnum) bare
ggit_clone_options_set_is_bare options' bare'
touchManagedPtr options
return ()
#if ENABLE_OVERLOADING
data CloneOptionsSetIsBareMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsCloneOptions a) => O.MethodInfo CloneOptionsSetIsBareMethodInfo a signature where
overloadedMethod _ = cloneOptionsSetIsBare
#endif
foreign import ccall "ggit_clone_options_set_local" ggit_clone_options_set_local ::
Ptr CloneOptions ->
CUInt ->
IO ()
cloneOptionsSetLocal ::
(B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
a
-> Ggit.Enums.CloneLocal
-> m ()
cloneOptionsSetLocal options local = liftIO $ do
options' <- unsafeManagedPtrCastPtr options
let local' = (fromIntegral . fromEnum) local
ggit_clone_options_set_local options' local'
touchManagedPtr options
return ()
#if ENABLE_OVERLOADING
data CloneOptionsSetLocalMethodInfo
instance (signature ~ (Ggit.Enums.CloneLocal -> m ()), MonadIO m, IsCloneOptions a) => O.MethodInfo CloneOptionsSetLocalMethodInfo a signature where
overloadedMethod _ = cloneOptionsSetLocal
#endif