gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Structs.BitsetIter

Contents

- Exported types
- Methods
  - getValue
  - initAt
  - initFirst
  - initLast
  - isValid
  - next
  - previous

Description

Iterates over the elements of a `Bitset`.

@GtkBitSetIter is an opaque, stack-allocated struct.

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.

Constructors

BitsetIter (ManagedPtr BitsetIter) |

#### Instances

Instances details

Eq BitsetIter Source # |
Instance details Defined in GI.Gtk.Structs.BitsetIter Methods (==) :: BitsetIter -> BitsetIter -> Bool Source # (/=) :: BitsetIter -> BitsetIter -> Bool Source #
GBoxed BitsetIter Source # |
Instance details Defined in GI.Gtk.Structs.BitsetIter
ManagedPtrNewtype BitsetIter Source # |
Instance details Defined in GI.Gtk.Structs.BitsetIter Methods toManagedPtr :: BitsetIter -> ManagedPtr BitsetIter Source #
TypedObject BitsetIter Source # |
Instance details Defined in GI.Gtk.Structs.BitsetIter Methods glibType :: IO GType Source #
HasParentTypes BitsetIter Source # |
Instance details Defined in GI.Gtk.Structs.BitsetIter
tag ~ 'AttrSet => Constructible BitsetIter tag Source # |
Instance details Defined in GI.Gtk.Structs.BitsetIter Methods new :: MonadIO m => (ManagedPtr BitsetIter -> BitsetIter) -> [AttrOp BitsetIter tag] -> m BitsetIter Source #
IsGValue (Maybe BitsetIter) Source # | Convert `BitsetIter` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Structs.BitsetIter Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe BitsetIter -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe BitsetIter) Source #
type ParentTypes BitsetIter Source # |
Instance details Defined in GI.Gtk.Structs.BitsetIter type ParentTypes BitsetIter = '[] :: [Type]

newZeroBitsetIter :: MonadIO m => m BitsetIter Source #

Construct a `BitsetIter` struct initialized to zero.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

isValid, next, previous.

#### Getters

getValue.

#### Setters

None.

## getValue

bitsetIterGetValue Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> BitsetIter | `iter`: a `GtkBitsetIter`
-> m Word32 | Returns: The current value pointer to by `iter`

Gets the current value that `iter` points to.

If `iter` is not valid and `bitsetIterIsValid` returns `False`, this function returns 0.

## initAt

bitsetIterInitAt Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Bitset | `set`: a `GtkBitset`
-> Word32 | `target`: target value to start iterating at
-> m (Bool, BitsetIter, Word32) | Returns: `True` if a value was found.

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

bitsetIterInitFirst Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Bitset | `set`: a `GtkBitset`
-> m (Bool, BitsetIter, Word32) | Returns: `True` if `set` isn't empty.

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

bitsetIterInitLast Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Bitset | `set`: a `GtkBitset`
-> m (Bool, BitsetIter, Word32) | Returns: `True` if `set` isn't empty.

Initializes an iterator for `set` and points it to the last value in `set`.

If `set` is empty, `False` is returned.

## isValid

bitsetIterIsValid Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> BitsetIter | `iter`: a `GtkBitsetIter`
-> m Bool | Returns: `True` if `iter` points to a valid value

Checks if `iter` points to a valid value.

## next

bitsetIterNext Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> BitsetIter | `iter`: a pointer to a valid `GtkBitsetIter`
-> m (Bool, Word32) | Returns: `True` if a next value existed

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

bitsetIterPrevious Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> BitsetIter | `iter`: a pointer to a valid `GtkBitsetIter`
-> m (Bool, Word32) | Returns: `True` if a previous value existed

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.