Top Description Fields Methods
org.lwjgl.system

public Interface CallbackI

extends Pointer
Known Direct Subinterfaces
org.lwjgl.system.macosx.CGEventTapCallBackI, org.lwjgl.system.macosx.EnumerationMutationHandlerI, org.lwjgl.system.windows.WindowProcI
Imports
org.lwjgl.system.libffi.*

Interface for dynamically created native functions that call into Java code (upcalls).

Pointers to such functions can be passed to native APIs as callbacks.

Field Summary

Inherited from org.lwjgl.system.Pointer:
BITS32BITS64CLONG_SHIFTCLONG_SIZEPOINTER_SHIFTPOINTER_SIZE

Method Summary

Modifier and TypeMethod and Description
public default long
address()

Implements org.lwjgl.system.Pointer.address.

Returns the raw pointer address as a long value.
public void
callback(long
a pointer to the memory used for the function's return value.

If the function is declared as returning void, then this value is garbage and should not be used.

Otherwise, the callback must fill the object to which this points, following the same special promotion behavior as LibFFI#ffi_call. That is, in most cases, ret points to an object of exactly the size of the type specified when CIF was constructed. However, integral types narrower than the system register size are widened. In these cases your program may assume that ret points to an ffi_arg object.

ret
,
long
a vector of pointers to memory holding the arguments to the function
args
)

The Java method that will be called from native code when the native callback function is invoked.

public FFICIF

Returns:

the CIF structure for this callback function
getCallInterface
()

Returns the libffi Call Interface for this callback function.

Method Detail

addressback to summary
public default long address()

Implements org.lwjgl.system.Pointer.address.

Doc from org.lwjgl.system.Pointer.address.

Returns the raw pointer address as a long value.

Returns:long

the pointer address

Annotations
@Override
callbackback to summary
public void callback(long ret, long args)

The Java method that will be called from native code when the native callback function is invoked.

Parameters
ret:long

a pointer to the memory used for the function's return value.

If the function is declared as returning void, then this value is garbage and should not be used.

Otherwise, the callback must fill the object to which this points, following the same special promotion behavior as LibFFI#ffi_call. That is, in most cases, ret points to an object of exactly the size of the type specified when CIF was constructed. However, integral types narrower than the system register size are widened. In these cases your program may assume that ret points to an ffi_arg object.

args:long

a vector of pointers to memory holding the arguments to the function

getCallInterfaceback to summary
public FFICIF getCallInterface()

Returns the libffi Call Interface for this callback function. [INTERNAL API]

Returns:FFICIF

the CIF structure for this callback function