Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
An opaque, stack-allocated struct for iterating
over the elements of a Bitset
. Before a GtkBitsetIter
can be used, it needs to be initialized with
bitsetIterInitFirst
, bitsetIterInitLast
or bitsetIterInitAt
.
Synopsis
- newtype BitsetIter = BitsetIter (ManagedPtr BitsetIter)
- newZeroBitsetIter :: MonadIO m => m BitsetIter
- bitsetIterGetValue :: (HasCallStack, MonadIO m) => BitsetIter -> m Word32
- bitsetIterInitAt :: (HasCallStack, MonadIO m) => Bitset -> Word32 -> m (Bool, BitsetIter, Word32)
- bitsetIterInitFirst :: (HasCallStack, MonadIO m) => Bitset -> m (Bool, BitsetIter, Word32)
- bitsetIterInitLast :: (HasCallStack, MonadIO m) => Bitset -> m (Bool, BitsetIter, Word32)
- bitsetIterIsValid :: (HasCallStack, MonadIO m) => BitsetIter -> m Bool
- bitsetIterNext :: (HasCallStack, MonadIO m) => BitsetIter -> m (Bool, Word32)
- bitsetIterPrevious :: (HasCallStack, MonadIO m) => BitsetIter -> m (Bool, Word32)
Exported types
newtype BitsetIter Source #
Memory-managed wrapper type.
BitsetIter (ManagedPtr BitsetIter) |
Instances
Eq BitsetIter Source # | |
Defined in GI.Gtk.Structs.BitsetIter (==) :: BitsetIter -> BitsetIter -> Bool # (/=) :: BitsetIter -> BitsetIter -> Bool # | |
BoxedPtr BitsetIter Source # | |
Defined in GI.Gtk.Structs.BitsetIter boxedPtrCopy :: BitsetIter -> IO BitsetIter boxedPtrFree :: BitsetIter -> IO () | |
CallocPtr BitsetIter Source # | |
Defined in GI.Gtk.Structs.BitsetIter boxedPtrCalloc :: IO (Ptr BitsetIter) | |
ManagedPtrNewtype BitsetIter Source # | |
Defined in GI.Gtk.Structs.BitsetIter toManagedPtr :: BitsetIter -> ManagedPtr BitsetIter | |
tag ~ 'AttrSet => Constructible BitsetIter tag Source # | |
Defined in GI.Gtk.Structs.BitsetIter new :: MonadIO m => (ManagedPtr BitsetIter -> BitsetIter) -> [AttrOp BitsetIter tag] -> m BitsetIter |
newZeroBitsetIter :: MonadIO m => m BitsetIter Source #
Construct a BitsetIter
struct initialized to zero.
Methods
Click to display all available methods, including inherited ones
getValue
:: (HasCallStack, MonadIO m) | |
=> BitsetIter |
|
-> m Word32 | Returns: The current value pointer to by |
Gets the current value that iter
points to.
If iter
is not valid and bitsetIterIsValid
returns
False
, this function returns 0.
initAt
:: (HasCallStack, MonadIO m) | |
=> Bitset |
|
-> Word32 |
|
-> m (Bool, BitsetIter, Word32) | Returns: |
Initializes iter
to point to target
. If target
is not found, finds
the next value after it. If no value >= target
exists in set
, this
function returns False
.
initFirst
:: (HasCallStack, MonadIO m) | |
=> Bitset |
|
-> m (Bool, BitsetIter, Word32) | Returns: |
Initializes an iterator for set
and points it to the first
value in set
. If set
is empty, False
is returned and value
is set to G_MAXUINT
.
initLast
:: (HasCallStack, MonadIO m) | |
=> Bitset |
|
-> m (Bool, BitsetIter, Word32) | Returns: |
Initializes an iterator for set
and points it to the last
value in set
. If set
is empty, False
is returned.
isValid
:: (HasCallStack, MonadIO m) | |
=> BitsetIter |
|
-> m Bool | Returns: |
Checks if iter
points to a valid value.
next
:: (HasCallStack, MonadIO m) | |
=> BitsetIter |
|
-> m (Bool, Word32) | Returns: |
Moves iter
to the next value in the set. If it was already
pointing to the last value in the set, False
is returned and
iter
is invalidated.
previous
:: (HasCallStack, MonadIO m) | |
=> BitsetIter |
|
-> m (Bool, Word32) | Returns: |
Moves iter
to the previous value in the set. If it was already
pointing to the first value in the set, False
is returned and
iter
is invalidated.