{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GLib.Structs.SequenceIter
(
SequenceIter(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveSequenceIterMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
SequenceIterCompareMethodInfo ,
#endif
sequenceIterCompare ,
#if defined(ENABLE_OVERLOADING)
SequenceIterGetPositionMethodInfo ,
#endif
sequenceIterGetPosition ,
#if defined(ENABLE_OVERLOADING)
SequenceIterGetSequenceMethodInfo ,
#endif
sequenceIterGetSequence ,
#if defined(ENABLE_OVERLOADING)
SequenceIterIsBeginMethodInfo ,
#endif
sequenceIterIsBegin ,
#if defined(ENABLE_OVERLOADING)
SequenceIterIsEndMethodInfo ,
#endif
sequenceIterIsEnd ,
#if defined(ENABLE_OVERLOADING)
SequenceIterMoveMethodInfo ,
#endif
sequenceIterMove ,
#if defined(ENABLE_OVERLOADING)
SequenceIterNextMethodInfo ,
#endif
sequenceIterNext ,
#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.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.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.GLib.Structs.Sequence as GLib.Sequence
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
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
foreign import ccall "g_sequence_iter_compare" g_sequence_iter_compare ::
Ptr SequenceIter ->
Ptr SequenceIter ->
IO Int32
sequenceIterCompare ::
(B.CallStack.HasCallStack, MonadIO m) =>
SequenceIter
-> SequenceIter
-> m Int32
sequenceIterCompare :: 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.MethodInfo SequenceIterCompareMethodInfo SequenceIter signature where
overloadedMethod = sequenceIterCompare
#endif
foreign import ccall "g_sequence_iter_get_position" g_sequence_iter_get_position ::
Ptr SequenceIter ->
IO Int32
sequenceIterGetPosition ::
(B.CallStack.HasCallStack, MonadIO m) =>
SequenceIter
-> m Int32
sequenceIterGetPosition :: 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.MethodInfo SequenceIterGetPositionMethodInfo SequenceIter signature where
overloadedMethod = sequenceIterGetPosition
#endif
foreign import ccall "g_sequence_iter_get_sequence" g_sequence_iter_get_sequence ::
Ptr SequenceIter ->
IO (Ptr GLib.Sequence.Sequence)
sequenceIterGetSequence ::
(B.CallStack.HasCallStack, MonadIO m) =>
SequenceIter
-> m GLib.Sequence.Sequence
sequenceIterGetSequence :: 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.MethodInfo SequenceIterGetSequenceMethodInfo SequenceIter signature where
overloadedMethod = sequenceIterGetSequence
#endif
foreign import ccall "g_sequence_iter_is_begin" g_sequence_iter_is_begin ::
Ptr SequenceIter ->
IO CInt
sequenceIterIsBegin ::
(B.CallStack.HasCallStack, MonadIO m) =>
SequenceIter
-> m Bool
sequenceIterIsBegin :: 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.MethodInfo SequenceIterIsBeginMethodInfo SequenceIter signature where
overloadedMethod = sequenceIterIsBegin
#endif
foreign import ccall "g_sequence_iter_is_end" g_sequence_iter_is_end ::
Ptr SequenceIter ->
IO CInt
sequenceIterIsEnd ::
(B.CallStack.HasCallStack, MonadIO m) =>
SequenceIter
-> m Bool
sequenceIterIsEnd :: 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.MethodInfo SequenceIterIsEndMethodInfo SequenceIter signature where
overloadedMethod = sequenceIterIsEnd
#endif
foreign import ccall "g_sequence_iter_move" g_sequence_iter_move ::
Ptr SequenceIter ->
Int32 ->
IO (Ptr SequenceIter)
sequenceIterMove ::
(B.CallStack.HasCallStack, MonadIO m) =>
SequenceIter
-> Int32
-> m SequenceIter
sequenceIterMove :: 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.MethodInfo SequenceIterMoveMethodInfo SequenceIter signature where
overloadedMethod = sequenceIterMove
#endif
foreign import ccall "g_sequence_iter_next" g_sequence_iter_next ::
Ptr SequenceIter ->
IO (Ptr SequenceIter)
sequenceIterNext ::
(B.CallStack.HasCallStack, MonadIO m) =>
SequenceIter
-> m SequenceIter
sequenceIterNext :: 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.MethodInfo SequenceIterNextMethodInfo SequenceIter signature where
overloadedMethod = sequenceIterNext
#endif
foreign import ccall "g_sequence_iter_prev" g_sequence_iter_prev ::
Ptr SequenceIter ->
IO (Ptr SequenceIter)
sequenceIterPrev ::
(B.CallStack.HasCallStack, MonadIO m) =>
SequenceIter
-> m SequenceIter
sequenceIterPrev :: 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.MethodInfo SequenceIterPrevMethodInfo SequenceIter signature where
overloadedMethod = 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.MethodInfo 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
#endif