{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- The t'GI.GLib.Structs.SequenceIter.SequenceIter' struct is an opaque data type representing an
-- iterator pointing into a t'GI.GLib.Structs.Sequence.Sequence'.

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.GLib.Structs.SequenceIter
    ( 

-- * Exported types
    SequenceIter(..)                        ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [compare]("GI.GLib.Structs.SequenceIter#g:method:compare"), [isBegin]("GI.GLib.Structs.SequenceIter#g:method:isBegin"), [isEnd]("GI.GLib.Structs.SequenceIter#g:method:isEnd"), [move]("GI.GLib.Structs.SequenceIter#g:method:move"), [next]("GI.GLib.Structs.SequenceIter#g:method:next"), [prev]("GI.GLib.Structs.SequenceIter#g:method:prev").
-- 
-- ==== Getters
-- [getPosition]("GI.GLib.Structs.SequenceIter#g:method:getPosition"), [getSequence]("GI.GLib.Structs.SequenceIter#g:method:getSequence").
-- 
-- ==== Setters
-- /None/.

#if defined(ENABLE_OVERLOADING)
    ResolveSequenceIterMethod               ,
#endif

-- ** compare #method:compare#

#if defined(ENABLE_OVERLOADING)
    SequenceIterCompareMethodInfo           ,
#endif
    sequenceIterCompare                     ,


-- ** getPosition #method:getPosition#

#if defined(ENABLE_OVERLOADING)
    SequenceIterGetPositionMethodInfo       ,
#endif
    sequenceIterGetPosition                 ,


-- ** getSequence #method:getSequence#

#if defined(ENABLE_OVERLOADING)
    SequenceIterGetSequenceMethodInfo       ,
#endif
    sequenceIterGetSequence                 ,


-- ** isBegin #method:isBegin#

#if defined(ENABLE_OVERLOADING)
    SequenceIterIsBeginMethodInfo           ,
#endif
    sequenceIterIsBegin                     ,


-- ** isEnd #method:isEnd#

#if defined(ENABLE_OVERLOADING)
    SequenceIterIsEndMethodInfo             ,
#endif
    sequenceIterIsEnd                       ,


-- ** move #method:move#

#if defined(ENABLE_OVERLOADING)
    SequenceIterMoveMethodInfo              ,
#endif
    sequenceIterMove                        ,


-- ** next #method:next#

#if defined(ENABLE_OVERLOADING)
    SequenceIterNextMethodInfo              ,
#endif
    sequenceIterNext                        ,


-- ** prev #method:prev#

#if defined(ENABLE_OVERLOADING)
    SequenceIterPrevMethodInfo              ,
#endif
    sequenceIterPrev                        ,




    ) 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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
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 Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
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 GHC.Records as R

import {-# SOURCE #-} qualified GI.GLib.Structs.Sequence as GLib.Sequence

-- | Memory-managed wrapper type.
newtype SequenceIter = SequenceIter (SP.ManagedPtr SequenceIter)
    deriving (SequenceIter -> SequenceIter -> Bool
(SequenceIter -> SequenceIter -> Bool)
-> (SequenceIter -> SequenceIter -> Bool) -> Eq SequenceIter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SequenceIter -> SequenceIter -> Bool
$c/= :: SequenceIter -> SequenceIter -> Bool
== :: SequenceIter -> SequenceIter -> Bool
$c== :: SequenceIter -> SequenceIter -> Bool
Eq)

instance SP.ManagedPtrNewtype SequenceIter where
    toManagedPtr :: SequenceIter -> ManagedPtr SequenceIter
toManagedPtr (SequenceIter ManagedPtr SequenceIter
p) = ManagedPtr SequenceIter
p

-- XXX Wrapping a foreign struct/union with no known destructor or size, leak?
instance BoxedPtr SequenceIter where
    boxedPtrCopy :: SequenceIter -> IO SequenceIter
boxedPtrCopy = SequenceIter -> IO SequenceIter
forall (m :: * -> *) a. Monad m => a -> m a
return
    boxedPtrFree :: SequenceIter -> IO ()
boxedPtrFree = \SequenceIter
_x -> () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SequenceIter
type instance O.AttributeList SequenceIter = SequenceIterAttributeList
type SequenceIterAttributeList = ('[ ] :: [(Symbol, *)])
#endif

-- method SequenceIter::compare
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "a"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "SequenceIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GSequenceIter" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "b"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "SequenceIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GSequenceIter" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "g_sequence_iter_compare" g_sequence_iter_compare :: 
    Ptr SequenceIter ->                     -- a : TInterface (Name {namespace = "GLib", name = "SequenceIter"})
    Ptr SequenceIter ->                     -- b : TInterface (Name {namespace = "GLib", name = "SequenceIter"})
    IO Int32

-- | Returns a negative number if /@a@/ comes before /@b@/, 0 if they are equal,
-- and a positive number if /@a@/ comes after /@b@/.
-- 
-- The /@a@/ and /@b@/ iterators must point into the same sequence.
-- 
-- /Since: 2.14/
sequenceIterCompare ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SequenceIter
    -- ^ /@a@/: a t'GI.GLib.Structs.SequenceIter.SequenceIter'
    -> SequenceIter
    -- ^ /@b@/: a t'GI.GLib.Structs.SequenceIter.SequenceIter'
    -> m Int32
    -- ^ __Returns:__ a negative number if /@a@/ comes before /@b@/, 0 if they are
    --     equal, and a positive number if /@a@/ comes after /@b@/
sequenceIterCompare :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SequenceIter -> SequenceIter -> m Int32
sequenceIterCompare SequenceIter
a SequenceIter
b = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr SequenceIter
a' <- SequenceIter -> IO (Ptr SequenceIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SequenceIter
a
    Ptr SequenceIter
b' <- SequenceIter -> IO (Ptr SequenceIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SequenceIter
b
    Int32
result <- Ptr SequenceIter -> Ptr SequenceIter -> IO Int32
g_sequence_iter_compare Ptr SequenceIter
a' Ptr SequenceIter
b'
    SequenceIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SequenceIter
a
    SequenceIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SequenceIter
b
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data SequenceIterCompareMethodInfo
instance (signature ~ (SequenceIter -> m Int32), MonadIO m) => O.OverloadedMethod SequenceIterCompareMethodInfo SequenceIter signature where
    overloadedMethod = sequenceIterCompare

instance O.OverloadedMethodInfo SequenceIterCompareMethodInfo SequenceIter where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GLib.Structs.SequenceIter.sequenceIterCompare",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-SequenceIter.html#v:sequenceIterCompare"
        })


#endif

-- method SequenceIter::get_position
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "SequenceIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GSequenceIter" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "g_sequence_iter_get_position" g_sequence_iter_get_position :: 
    Ptr SequenceIter ->                     -- iter : TInterface (Name {namespace = "GLib", name = "SequenceIter"})
    IO Int32

-- | Returns the position of /@iter@/
-- 
-- /Since: 2.14/
sequenceIterGetPosition ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SequenceIter
    -- ^ /@iter@/: a t'GI.GLib.Structs.SequenceIter.SequenceIter'
    -> m Int32
    -- ^ __Returns:__ the position of /@iter@/
sequenceIterGetPosition :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SequenceIter -> m Int32
sequenceIterGetPosition SequenceIter
iter = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr SequenceIter
iter' <- SequenceIter -> IO (Ptr SequenceIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SequenceIter
iter
    Int32
result <- Ptr SequenceIter -> IO Int32
g_sequence_iter_get_position Ptr SequenceIter
iter'
    SequenceIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SequenceIter
iter
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data SequenceIterGetPositionMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.OverloadedMethod SequenceIterGetPositionMethodInfo SequenceIter signature where
    overloadedMethod = sequenceIterGetPosition

instance O.OverloadedMethodInfo SequenceIterGetPositionMethodInfo SequenceIter where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GLib.Structs.SequenceIter.sequenceIterGetPosition",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-SequenceIter.html#v:sequenceIterGetPosition"
        })


#endif

-- method SequenceIter::get_sequence
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "SequenceIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GSequenceIter" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "Sequence" })
-- throws : False
-- Skip return : False

foreign import ccall "g_sequence_iter_get_sequence" g_sequence_iter_get_sequence :: 
    Ptr SequenceIter ->                     -- iter : TInterface (Name {namespace = "GLib", name = "SequenceIter"})
    IO (Ptr GLib.Sequence.Sequence)

-- | Returns the t'GI.GLib.Structs.Sequence.Sequence' that /@iter@/ points into.
-- 
-- /Since: 2.14/
sequenceIterGetSequence ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SequenceIter
    -- ^ /@iter@/: a t'GI.GLib.Structs.SequenceIter.SequenceIter'
    -> m GLib.Sequence.Sequence
    -- ^ __Returns:__ the t'GI.GLib.Structs.Sequence.Sequence' that /@iter@/ points into
sequenceIterGetSequence :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SequenceIter -> m Sequence
sequenceIterGetSequence SequenceIter
iter = IO Sequence -> m Sequence
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Sequence -> m Sequence) -> IO Sequence -> m Sequence
forall a b. (a -> b) -> a -> b
$ do
    Ptr SequenceIter
iter' <- SequenceIter -> IO (Ptr SequenceIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SequenceIter
iter
    Ptr Sequence
result <- Ptr SequenceIter -> IO (Ptr Sequence)
g_sequence_iter_get_sequence Ptr SequenceIter
iter'
    Text -> Ptr Sequence -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sequenceIterGetSequence" Ptr Sequence
result
    Sequence
result' <- ((ManagedPtr Sequence -> Sequence) -> Ptr Sequence -> IO Sequence
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Sequence -> Sequence
GLib.Sequence.Sequence) Ptr Sequence
result
    SequenceIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SequenceIter
iter
    Sequence -> IO Sequence
forall (m :: * -> *) a. Monad m => a -> m a
return Sequence
result'

#if defined(ENABLE_OVERLOADING)
data SequenceIterGetSequenceMethodInfo
instance (signature ~ (m GLib.Sequence.Sequence), MonadIO m) => O.OverloadedMethod SequenceIterGetSequenceMethodInfo SequenceIter signature where
    overloadedMethod = sequenceIterGetSequence

instance O.OverloadedMethodInfo SequenceIterGetSequenceMethodInfo SequenceIter where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GLib.Structs.SequenceIter.sequenceIterGetSequence",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-SequenceIter.html#v:sequenceIterGetSequence"
        })


#endif

-- method SequenceIter::is_begin
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "SequenceIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GSequenceIter" , 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 "g_sequence_iter_is_begin" g_sequence_iter_is_begin :: 
    Ptr SequenceIter ->                     -- iter : TInterface (Name {namespace = "GLib", name = "SequenceIter"})
    IO CInt

-- | Returns whether /@iter@/ is the begin iterator
-- 
-- /Since: 2.14/
sequenceIterIsBegin ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SequenceIter
    -- ^ /@iter@/: a t'GI.GLib.Structs.SequenceIter.SequenceIter'
    -> m Bool
    -- ^ __Returns:__ whether /@iter@/ is the begin iterator
sequenceIterIsBegin :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SequenceIter -> m Bool
sequenceIterIsBegin SequenceIter
iter = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr SequenceIter
iter' <- SequenceIter -> IO (Ptr SequenceIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SequenceIter
iter
    CInt
result <- Ptr SequenceIter -> IO CInt
g_sequence_iter_is_begin Ptr SequenceIter
iter'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    SequenceIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SequenceIter
iter
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SequenceIterIsBeginMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod SequenceIterIsBeginMethodInfo SequenceIter signature where
    overloadedMethod = sequenceIterIsBegin

instance O.OverloadedMethodInfo SequenceIterIsBeginMethodInfo SequenceIter where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GLib.Structs.SequenceIter.sequenceIterIsBegin",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-SequenceIter.html#v:sequenceIterIsBegin"
        })


#endif

-- method SequenceIter::is_end
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "SequenceIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GSequenceIter" , 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 "g_sequence_iter_is_end" g_sequence_iter_is_end :: 
    Ptr SequenceIter ->                     -- iter : TInterface (Name {namespace = "GLib", name = "SequenceIter"})
    IO CInt

-- | Returns whether /@iter@/ is the end iterator
-- 
-- /Since: 2.14/
sequenceIterIsEnd ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SequenceIter
    -- ^ /@iter@/: a t'GI.GLib.Structs.SequenceIter.SequenceIter'
    -> m Bool
    -- ^ __Returns:__ Whether /@iter@/ is the end iterator
sequenceIterIsEnd :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SequenceIter -> m Bool
sequenceIterIsEnd SequenceIter
iter = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr SequenceIter
iter' <- SequenceIter -> IO (Ptr SequenceIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SequenceIter
iter
    CInt
result <- Ptr SequenceIter -> IO CInt
g_sequence_iter_is_end Ptr SequenceIter
iter'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    SequenceIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SequenceIter
iter
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SequenceIterIsEndMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod SequenceIterIsEndMethodInfo SequenceIter signature where
    overloadedMethod = sequenceIterIsEnd

instance O.OverloadedMethodInfo SequenceIterIsEndMethodInfo SequenceIter where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GLib.Structs.SequenceIter.sequenceIterIsEnd",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-SequenceIter.html#v:sequenceIterIsEnd"
        })


#endif

-- method SequenceIter::move
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "SequenceIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GSequenceIter" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "delta"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "A positive or negative number indicating how many positions away\n   from @iter the returned #GSequenceIter will be"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "GLib" , name = "SequenceIter" })
-- throws : False
-- Skip return : False

foreign import ccall "g_sequence_iter_move" g_sequence_iter_move :: 
    Ptr SequenceIter ->                     -- iter : TInterface (Name {namespace = "GLib", name = "SequenceIter"})
    Int32 ->                                -- delta : TBasicType TInt
    IO (Ptr SequenceIter)

-- | Returns the t'GI.GLib.Structs.SequenceIter.SequenceIter' which is /@delta@/ positions away from /@iter@/.
-- If /@iter@/ is closer than -/@delta@/ positions to the beginning of the sequence,
-- the begin iterator is returned. If /@iter@/ is closer than /@delta@/ positions
-- to the end of the sequence, the end iterator is returned.
-- 
-- /Since: 2.14/
sequenceIterMove ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SequenceIter
    -- ^ /@iter@/: a t'GI.GLib.Structs.SequenceIter.SequenceIter'
    -> Int32
    -- ^ /@delta@/: A positive or negative number indicating how many positions away
    --    from /@iter@/ the returned t'GI.GLib.Structs.SequenceIter.SequenceIter' will be
    -> m SequenceIter
    -- ^ __Returns:__ a t'GI.GLib.Structs.SequenceIter.SequenceIter' which is /@delta@/ positions away from /@iter@/
sequenceIterMove :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SequenceIter -> Int32 -> m SequenceIter
sequenceIterMove SequenceIter
iter Int32
delta = IO SequenceIter -> m SequenceIter
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SequenceIter -> m SequenceIter)
-> IO SequenceIter -> m SequenceIter
forall a b. (a -> b) -> a -> b
$ do
    Ptr SequenceIter
iter' <- SequenceIter -> IO (Ptr SequenceIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SequenceIter
iter
    Ptr SequenceIter
result <- Ptr SequenceIter -> Int32 -> IO (Ptr SequenceIter)
g_sequence_iter_move Ptr SequenceIter
iter' Int32
delta
    Text -> Ptr SequenceIter -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sequenceIterMove" Ptr SequenceIter
result
    SequenceIter
result' <- ((ManagedPtr SequenceIter -> SequenceIter)
-> Ptr SequenceIter -> IO SequenceIter
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr SequenceIter -> SequenceIter
SequenceIter) Ptr SequenceIter
result
    SequenceIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SequenceIter
iter
    SequenceIter -> IO SequenceIter
forall (m :: * -> *) a. Monad m => a -> m a
return SequenceIter
result'

#if defined(ENABLE_OVERLOADING)
data SequenceIterMoveMethodInfo
instance (signature ~ (Int32 -> m SequenceIter), MonadIO m) => O.OverloadedMethod SequenceIterMoveMethodInfo SequenceIter signature where
    overloadedMethod = sequenceIterMove

instance O.OverloadedMethodInfo SequenceIterMoveMethodInfo SequenceIter where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GLib.Structs.SequenceIter.sequenceIterMove",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-SequenceIter.html#v:sequenceIterMove"
        })


#endif

-- method SequenceIter::next
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "SequenceIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GSequenceIter" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "GLib" , name = "SequenceIter" })
-- throws : False
-- Skip return : False

foreign import ccall "g_sequence_iter_next" g_sequence_iter_next :: 
    Ptr SequenceIter ->                     -- iter : TInterface (Name {namespace = "GLib", name = "SequenceIter"})
    IO (Ptr SequenceIter)

-- | Returns an iterator pointing to the next position after /@iter@/.
-- If /@iter@/ is the end iterator, the end iterator is returned.
-- 
-- /Since: 2.14/
sequenceIterNext ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SequenceIter
    -- ^ /@iter@/: a t'GI.GLib.Structs.SequenceIter.SequenceIter'
    -> m SequenceIter
    -- ^ __Returns:__ a t'GI.GLib.Structs.SequenceIter.SequenceIter' pointing to the next position after /@iter@/
sequenceIterNext :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SequenceIter -> m SequenceIter
sequenceIterNext SequenceIter
iter = IO SequenceIter -> m SequenceIter
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SequenceIter -> m SequenceIter)
-> IO SequenceIter -> m SequenceIter
forall a b. (a -> b) -> a -> b
$ do
    Ptr SequenceIter
iter' <- SequenceIter -> IO (Ptr SequenceIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SequenceIter
iter
    Ptr SequenceIter
result <- Ptr SequenceIter -> IO (Ptr SequenceIter)
g_sequence_iter_next Ptr SequenceIter
iter'
    Text -> Ptr SequenceIter -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sequenceIterNext" Ptr SequenceIter
result
    SequenceIter
result' <- ((ManagedPtr SequenceIter -> SequenceIter)
-> Ptr SequenceIter -> IO SequenceIter
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr SequenceIter -> SequenceIter
SequenceIter) Ptr SequenceIter
result
    SequenceIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SequenceIter
iter
    SequenceIter -> IO SequenceIter
forall (m :: * -> *) a. Monad m => a -> m a
return SequenceIter
result'

#if defined(ENABLE_OVERLOADING)
data SequenceIterNextMethodInfo
instance (signature ~ (m SequenceIter), MonadIO m) => O.OverloadedMethod SequenceIterNextMethodInfo SequenceIter signature where
    overloadedMethod = sequenceIterNext

instance O.OverloadedMethodInfo SequenceIterNextMethodInfo SequenceIter where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GLib.Structs.SequenceIter.sequenceIterNext",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-SequenceIter.html#v:sequenceIterNext"
        })


#endif

-- method SequenceIter::prev
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "SequenceIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GSequenceIter" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "GLib" , name = "SequenceIter" })
-- throws : False
-- Skip return : False

foreign import ccall "g_sequence_iter_prev" g_sequence_iter_prev :: 
    Ptr SequenceIter ->                     -- iter : TInterface (Name {namespace = "GLib", name = "SequenceIter"})
    IO (Ptr SequenceIter)

-- | Returns an iterator pointing to the previous position before /@iter@/.
-- If /@iter@/ is the begin iterator, the begin iterator is returned.
-- 
-- /Since: 2.14/
sequenceIterPrev ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SequenceIter
    -- ^ /@iter@/: a t'GI.GLib.Structs.SequenceIter.SequenceIter'
    -> m SequenceIter
    -- ^ __Returns:__ a t'GI.GLib.Structs.SequenceIter.SequenceIter' pointing to the previous position
    --     before /@iter@/
sequenceIterPrev :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SequenceIter -> m SequenceIter
sequenceIterPrev SequenceIter
iter = IO SequenceIter -> m SequenceIter
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SequenceIter -> m SequenceIter)
-> IO SequenceIter -> m SequenceIter
forall a b. (a -> b) -> a -> b
$ do
    Ptr SequenceIter
iter' <- SequenceIter -> IO (Ptr SequenceIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SequenceIter
iter
    Ptr SequenceIter
result <- Ptr SequenceIter -> IO (Ptr SequenceIter)
g_sequence_iter_prev Ptr SequenceIter
iter'
    Text -> Ptr SequenceIter -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sequenceIterPrev" Ptr SequenceIter
result
    SequenceIter
result' <- ((ManagedPtr SequenceIter -> SequenceIter)
-> Ptr SequenceIter -> IO SequenceIter
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr SequenceIter -> SequenceIter
SequenceIter) Ptr SequenceIter
result
    SequenceIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SequenceIter
iter
    SequenceIter -> IO SequenceIter
forall (m :: * -> *) a. Monad m => a -> m a
return SequenceIter
result'

#if defined(ENABLE_OVERLOADING)
data SequenceIterPrevMethodInfo
instance (signature ~ (m SequenceIter), MonadIO m) => O.OverloadedMethod SequenceIterPrevMethodInfo SequenceIter signature where
    overloadedMethod = sequenceIterPrev

instance O.OverloadedMethodInfo SequenceIterPrevMethodInfo SequenceIter where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GLib.Structs.SequenceIter.sequenceIterPrev",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-SequenceIter.html#v:sequenceIterPrev"
        })


#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveSequenceIterMethod (t :: Symbol) (o :: *) :: * where
    ResolveSequenceIterMethod "compare" o = SequenceIterCompareMethodInfo
    ResolveSequenceIterMethod "isBegin" o = SequenceIterIsBeginMethodInfo
    ResolveSequenceIterMethod "isEnd" o = SequenceIterIsEndMethodInfo
    ResolveSequenceIterMethod "move" o = SequenceIterMoveMethodInfo
    ResolveSequenceIterMethod "next" o = SequenceIterNextMethodInfo
    ResolveSequenceIterMethod "prev" o = SequenceIterPrevMethodInfo
    ResolveSequenceIterMethod "getPosition" o = SequenceIterGetPositionMethodInfo
    ResolveSequenceIterMethod "getSequence" o = SequenceIterGetSequenceMethodInfo
    ResolveSequenceIterMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveSequenceIterMethod t SequenceIter, O.OverloadedMethod info SequenceIter p) => OL.IsLabel t (SequenceIter -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveSequenceIterMethod t SequenceIter, O.OverloadedMethod info SequenceIter p, R.HasField t SequenceIter p) => R.HasField t SequenceIter p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveSequenceIterMethod t SequenceIter, O.OverloadedMethodInfo info SequenceIter) => OL.IsLabel t (O.MethodProxy info SequenceIter) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif