diff options
author | Sven Gothel <[email protected]> | 2023-07-01 19:23:14 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-07-01 19:23:14 +0200 |
commit | df0895828e957d97f38510da36eade7a60691d96 (patch) | |
tree | 061d73226f0e4bfc204ab200001931a544696fed /src/java/com/jogamp/gluegen | |
parent | 8766fcfdce4dd864fe6764b063a0f9a4b17327c1 (diff) |
GlueGen JavaCallback: Use `SetCallback-KeyClass` if manually specified, even if no keys are defined!
Diffstat (limited to 'src/java/com/jogamp/gluegen')
-rw-r--r-- | src/java/com/jogamp/gluegen/JavaMethodBindingEmitter.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/java/com/jogamp/gluegen/JavaMethodBindingEmitter.java b/src/java/com/jogamp/gluegen/JavaMethodBindingEmitter.java index 985056d..1737ba1 100644 --- a/src/java/com/jogamp/gluegen/JavaMethodBindingEmitter.java +++ b/src/java/com/jogamp/gluegen/JavaMethodBindingEmitter.java @@ -600,15 +600,17 @@ public class JavaMethodBindingEmitter extends FunctionEmitter { final String lockInstanceName = lowIfaceName+"Lock"; final String dataMapInstanceName = lowIfaceName+"DataMap"; final String dataInstanceName = lowIfaceName+"Data"; - final boolean useDataMap = javaCallback.setFuncKeyIndices.size() > 0; final boolean customKeyClass; final String KeyClassName; + final boolean useDataMap; if( null != javaCallback.setFuncKeyClassName ) { customKeyClass = true;; KeyClassName = javaCallback.setFuncKeyClassName; + useDataMap = true; } else { customKeyClass = false; KeyClassName = CodeGenUtils.capitalizeString(capIfaceName+"Key"); + useDataMap = javaCallback.setFuncKeyIndices.size() > 0; } final String DataClassName = CodeGenUtils.capitalizeString( javaCallback.cbFuncTypeName+"Data" ); final String fqUsrParamClassName = cfg.packageName()+"."+cfg.className()+"."+DataClassName; @@ -943,12 +945,14 @@ public class JavaMethodBindingEmitter extends FunctionEmitter { final String funcArgName = binding.getArgumentName(javaCallback.setFuncCBParamIdx); final String userParamArgName = binding.getArgumentName(javaCallback.setFuncUserParamIdx); final String DataClassName = CodeGenUtils.capitalizeString( javaCallback.cbFuncTypeName+"Data" ); - final boolean useDataMap = javaCallback.setFuncKeyIndices.size() > 0; final String KeyClassName; + final boolean useDataMap; if( null != javaCallback.setFuncKeyClassName ) { KeyClassName = javaCallback.setFuncKeyClassName; + useDataMap = true; } else { KeyClassName = CodeGenUtils.capitalizeString(capIfaceName+"Key"); + useDataMap = javaCallback.setFuncKeyIndices.size() > 0; } if( DEBUG_JAVACALLBACK ) { unit.emitln(" System.err.println(\"ZZZ returned nativeUserParam 0x\"+Long.toHexString(nativeUserParam[0]));"); |