Enum Class MemoryMode

java.lang.Object
java.lang.Enum<MemoryMode>
org.freedesktop.harfbuzz.MemoryMode
All Implemented Interfaces:
Serializable, Comparable<MemoryMode>, Constable, Enumeration

@Generated("org.javagi.JavaGI") public enum MemoryMode extends Enum<MemoryMode> implements Enumeration

Data type holding the memory modes available to client programs.

Regarding these various memory-modes:

  • In no case shall the HarfBuzz client modify memory that is passed to HarfBuzz in a blob. If there is any such possibility, HBMEMORYMODEDUPLICATE should be used such that HarfBuzz makes a copy immediately,

  • Use HBMEMORYMODEREADONLY otherwise, unless you really really really know what you are doing,

  • HBMEMORYMODEWRITABLE is appropriate if you really made a copy of data solely for the purpose of passing to HarfBuzz and doing that just once (no reuse!),

  • If the font is mmap()ed, it's okay to use HBMEMORYMODEREADONLYMAYMAKEWRITABLE, however, using that mode correctly is very tricky. Use HBMEMORYMODEREADONLY instead.

  • Enum Constant Details

    • DUPLICATE

      public static final MemoryMode DUPLICATE
      HarfBuzz immediately makes a copy of the data.
    • READONLY

      public static final MemoryMode READONLY
      HarfBuzz client will never modify the data, and HarfBuzz will never modify the data.
    • WRITABLE

      public static final MemoryMode WRITABLE
      HarfBuzz client made a copy of the data solely for HarfBuzz, so HarfBuzz may modify the data.
    • READONLY_MAY_MAKE_WRITABLE

      public static final MemoryMode READONLY_MAY_MAKE_WRITABLE
      See above
  • Method Details

    • values

      public static MemoryMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MemoryMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static MemoryMode of(int value)
      Create a new MemoryMode for the provided value
      Parameters:
      value - the enum value
      Returns:
      the enum for the provided value
    • getValue

      public int getValue()
      Get the numeric value of this enum
      Specified by:
      getValue in interface Enumeration
      Returns:
      the enum value
    • of

      public static MemoryMode of(MemorySegment address)
      Create a new MemoryMode for the value in the provided memory address.
      Parameters:
      address - the memory address holding a enum value
      Returns:
      the enum for the value in the provided memory address
    • getType

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