Package org.lwjgl.system.dyncall
Class DynCallback
- java.lang.Object
-
- org.lwjgl.system.dyncall.DynCallback
-
public class DynCallback extends java.lang.ObjectNative bindings to \"dyncall_callback.h\".The dyncallback dyncall library has an interface to create callback objects, that can be passed to functions as callback arguments. In other words, a pointer to the callback object can be "called", directly. The callback handler then allows iterating dynamically over the arguments once called back.
-
-
Field Summary
Fields Modifier and Type Field and Description static charDCB_SIGCHAR_CC_ELLIPSIS
DCB_SIGCHAR_CC_FASTCALL_GNU
DCB_SIGCHAR_CC_FASTCALL_MS
DCB_SIGCHAR_CC_PREFIX
DCB_SIGCHAR_CC_STDCALL
DCB_SIGCHAR_CC_THISCALL_MSCallback signatures.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static intdcbArgBool(long args)Returns the nextboolargument.static bytedcbArgChar(long args)Returns the nextcharargument.static doubledcbArgDouble(long args)Returns the nextdoubleargument.static floatdcbArgFloat(long args)Returns the nextfloatargument.static intdcbArgInt(long args)Returns the nextintargument.static intdcbArgLong(long args)Returns the nextlongargument.static longdcbArgLongLong(long args)Returns the nextlong longargument.static longdcbArgPointer(long args)Returns the nextpointerargument.static shortdcbArgShort(long args)Returns the nextshortargument.static bytedcbArgUChar(long args)Returns the nextunsigned charargument.static intdcbArgUInt(long args)Returns the nextunsigned intargument.static intdcbArgULong(long args)Returns the nextunsigned longargument.static longdcbArgULongLong(long args)Returns the nextunsigned long longargument.static shortdcbArgUShort(long args)Returns the nextunsigned shortargument.static voiddcbFreeCallback(long pcb)Destroys and frees the callback object.static longdcbGetUserData(long pcb)Returns a pointer to theuserdatapassed to the callback object on creation or initialization.static voiddcbInitCallback(long pcb, java.nio.ByteBuffer signature, long handler, long userdata)(Re)initializes a callback object.static voiddcbInitCallback(long pcb, java.lang.CharSequence signature, long handler, long userdata)(Re)initializes a callback object.static longdcbNewCallback(java.nio.ByteBuffer signature, long funcptr, long userdata)Creates and initializes a newCallbackobject.static longdcbNewCallback(java.lang.CharSequence signature, long funcptr, long userdata)Creates and initializes a newCallbackobject.
-
-
-
Method Detail
-
dcbNewCallback
public static long dcbNewCallback(java.nio.ByteBuffer signature, long funcptr, long userdata) public static long dcbNewCallback(java.lang.CharSequence signature, long funcptr, long userdata)Creates and initializes a newCallbackobject.Use
FreeCallbackto destroy theCallbackobject.- Parameters:
signature- the function signature of the function to mimicfuncptr- a pointer to a callback handleruserdata- a pointer to custom data that might be useful in the handler
-
dcbInitCallback
public static void dcbInitCallback(long pcb, java.nio.ByteBuffer signature, long handler, long userdata) public static void dcbInitCallback(long pcb, java.lang.CharSequence signature, long handler, long userdata)(Re)initializes a callback object.- Parameters:
pcb- the callback objectsignature- the function signature of the function to mimichandler- a pointer to a callback handleruserdata- a pointer to custom data that might be useful in the handler
-
dcbFreeCallback
public static void dcbFreeCallback(long pcb)
Destroys and frees the callback object.- Parameters:
pcb- the callback object
-
dcbGetUserData
public static long dcbGetUserData(long pcb)
Returns a pointer to theuserdatapassed to the callback object on creation or initialization.- Parameters:
pcb- the callback object
-
dcbArgBool
public static int dcbArgBool(long args)
Returns the nextboolargument.- Parameters:
args- the function arguments
-
dcbArgChar
public static byte dcbArgChar(long args)
Returns the nextcharargument.- Parameters:
args- the function arguments
-
dcbArgShort
public static short dcbArgShort(long args)
Returns the nextshortargument.- Parameters:
args- the function arguments
-
dcbArgInt
public static int dcbArgInt(long args)
Returns the nextintargument.- Parameters:
args- the function arguments
-
dcbArgLong
public static int dcbArgLong(long args)
Returns the nextlongargument.- Parameters:
args- the function arguments
-
dcbArgLongLong
public static long dcbArgLongLong(long args)
Returns the nextlong longargument.- Parameters:
args- the function arguments
-
dcbArgUChar
public static byte dcbArgUChar(long args)
Returns the nextunsigned charargument.- Parameters:
args- the function arguments
-
dcbArgUShort
public static short dcbArgUShort(long args)
Returns the nextunsigned shortargument.- Parameters:
args- the function arguments
-
dcbArgUInt
public static int dcbArgUInt(long args)
Returns the nextunsigned intargument.- Parameters:
args- the function arguments
-
dcbArgULong
public static int dcbArgULong(long args)
Returns the nextunsigned longargument.- Parameters:
args- the function arguments
-
dcbArgULongLong
public static long dcbArgULongLong(long args)
Returns the nextunsigned long longargument.- Parameters:
args- the function arguments
-
dcbArgFloat
public static float dcbArgFloat(long args)
Returns the nextfloatargument.- Parameters:
args- the function arguments
-
dcbArgDouble
public static double dcbArgDouble(long args)
Returns the nextdoubleargument.- Parameters:
args- the function arguments
-
dcbArgPointer
public static long dcbArgPointer(long args)
Returns the nextpointerargument.- Parameters:
args- the function arguments
-
-