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 Summary
Modifier and TypeMethodDescriptionrun(String str, @Nullable MemorySegment data) The type of functions which are used to translate user-visible strings, for output.default MemorySegmenttoCallback(Arena arena) Creates a native function pointer to theupcall(MemorySegment, MemorySegment)method.default MemorySegmentupcall(MemorySegment str, MemorySegment data) Theupcallmethod is called from native code.
-
Method Details
-
run
The type of functions which are used to translate user-visible strings, for output.- Parameters:
str- the untranslated stringdata- 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
Theupcallmethod is called from native code. The parameters are marshaled andrun(String, MemorySegment)is executed. -
toCallback
Creates a native function pointer to theupcall(MemorySegment, MemorySegment)method.- Specified by:
toCallbackin interfaceFunctionPointer- Parameters:
arena- the arena in which the function pointer is allocated- Returns:
- the native function pointer
-