Class MenuAttributeIter

All Implemented Interfaces:
Proxy
Direct Known Subclasses:
MenuAttributeIter.MenuAttributeIter$Impl

@Generated("org.javagi.JavaGI") public abstract class MenuAttributeIter extends GObject
GMenuAttributeIter is an opaque structure type. You must access it using the functions below.
Since:
2.32
  • Constructor Details

    • MenuAttributeIter

      public MenuAttributeIter(MemorySegment address)
      Create a MenuAttributeIter instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • MenuAttributeIter

      public MenuAttributeIter()
      Create a new MenuAttributeIter.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the MenuAttributeIter class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected MenuAttributeIter asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class GObject
      Returns:
      the instance as if it were its parent type
    • getName

      public String getName()

      Gets the name of the attribute at the current iterator position, as a string.

      The iterator is not advanced.

      Returns:
      the name of the attribute
      Since:
      2.32
    • getNext

      public boolean getNext(@Nullable Out<String> outName, @Nullable Out<Variant> value)

      This function combines g_menu_attribute_iter_next() with g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value().

      First the iterator is advanced to the next (possibly first) attribute. If that fails, then false is returned and there are no other effects.

      If successful, name and value are set to the name and value of the attribute that has just been advanced to. At this point, g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value() will return the same values again.

      The value returned in name remains valid for as long as the iterator remains at the current position. The value returned in value must be unreffed using g_variant_unref() when it is no longer in use.

      Parameters:
      outName - the type of the attribute
      value - the attribute value
      Returns:
      true on success, or false if there is no additional attribute
      Since:
      2.32
    • getValue

      public Variant getValue()

      Gets the value of the attribute at the current iterator position.

      The iterator is not advanced.

      Returns:
      the value of the current attribute
      Since:
      2.32
    • next

      public boolean next()

      Attempts to advance the iterator to the next (possibly first) attribute.

      true is returned on success, or false if there are no more attributes.

      You must call this function when you first acquire the iterator to advance it to the first attribute (and determine if the first attribute exists at all).

      Returns:
      true on success, or false when there are no more attributes
      Since:
      2.32