Interface TranslateFunc

All Superinterfaces:
FunctionPointer
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface @Generated("org.javagi.JavaGI") public interface TranslateFunc extends FunctionPointer

Functional interface declaration of the TranslateFunc callback.

See Also:
  • Method Details

    • run

      String run(String str, @Nullable MemorySegment data)
      The type of functions which are used to translate user-visible strings, for output.
      Parameters:
      str - the untranslated string
      data - user data specified when installing the function, e.g. in g_option_group_set_translate_func()
      Returns:
      a translation of the string for the current locale. The returned string is owned by GLib and must not be freed.
    • upcall

      default MemorySegment upcall(MemorySegment str, MemorySegment data)
      The upcall method is called from native code. The parameters are marshaled and run(String, MemorySegment) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(MemorySegment, MemorySegment) method.
      Specified by:
      toCallback in interface FunctionPointer
      Parameters:
      arena - the arena in which the function pointer is allocated
      Returns:
      the native function pointer