aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen/JavaConfiguration.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/jogamp/gluegen/JavaConfiguration.java')
-rw-r--r--src/java/com/jogamp/gluegen/JavaConfiguration.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/java/com/jogamp/gluegen/JavaConfiguration.java b/src/java/com/jogamp/gluegen/JavaConfiguration.java
index f5242b8..95e1480 100644
--- a/src/java/com/jogamp/gluegen/JavaConfiguration.java
+++ b/src/java/com/jogamp/gluegen/JavaConfiguration.java
@@ -2423,6 +2423,8 @@ public class JavaConfiguration {
final String cbFuncUserParamName;
final Type cbFuncUserParamType;
+ final boolean cbUserParamIsDefined;
+
final String setFuncName;
final List<Integer> setFuncKeyIndices;
final int setFuncUserParamIdx;
@@ -2442,7 +2444,8 @@ public class JavaConfiguration {
this.staticCBMethodSignature = staticCBMethodSignature;
this.cbFuncType = cbFuncType;
this.cbFuncBinding = cbFuncBinding;
- {
+ this.cbUserParamIsDefined = setFuncUserParamIdx >= 0;
+ if( cbUserParamIsDefined ) {
int paramIdx = -2;
Type paramType = null;
String paramName = null;
@@ -2456,10 +2459,14 @@ public class JavaConfiguration {
}
}
this.cbFuncUserParamIdx = paramIdx;
- this.cbFuncKeyIndices = cbFuncKeyIndices;
this.cbFuncUserParamName = paramName;
this.cbFuncUserParamType = paramType;
+ } else {
+ this.cbFuncUserParamIdx = -1;
+ this.cbFuncUserParamName = null;
+ this.cbFuncUserParamType = null;
}
+ this.cbFuncKeyIndices = cbFuncKeyIndices;
this.setFuncName = setFuncName;
this.setFuncKeyIndices = setFuncKeyIndices;
this.setFuncUserParamIdx = setFuncUserParamIdx;
@@ -2499,9 +2506,9 @@ public class JavaConfiguration {
@Override
public String toString() {
- return String.format("JavaCallbackInfo[cbFunc[%s%s, userParam[idx %d, '%s', %s, keys %s], set[%s(ok %b, cbIdx %d, upIdx %d, keys %s], Class[UserParam '%s', Key '%s'], %s]",
+ return String.format("JavaCallbackInfo[cbFunc[%s%s, userParam[defined %b, idx %d, '%s', %s, keys %s], set[%s(ok %b, cbIdx %d, upIdx %d, keys %s], Class[UserParam '%s', Key '%s'], %s]",
cbFuncTypeName, staticCBMethodSignature,
- cbFuncUserParamIdx, cbFuncUserParamName, cbFuncUserParamType.getSignature(null).toString(), cbFuncKeyIndices.toString(),
+ cbUserParamIsDefined, cbFuncUserParamIdx, cbFuncUserParamName, cbUserParamIsDefined ? cbFuncUserParamType.getSignature(null).toString() : null, cbFuncKeyIndices.toString(),
setFuncName, setFuncProcessed, setFuncCBParamIdx, setFuncUserParamIdx,
setFuncKeyIndices.toString(), userParamClassName, customKeyClassName,
cbFuncType.toString(cbFuncTypeName, false, true));
@@ -2511,4 +2518,10 @@ public class JavaConfiguration {
/* pp */ final Map<String, JavaCallbackInfo> setFuncToJavaCallbackMap = new HashMap<String, JavaCallbackInfo>();
final Set<String> emittedJavaCallbackUserParamClasses = new HashSet<String>();
+ /** Returns true if a method binding requires specific java callback code */
+ final boolean requiresJavaCallbackCode(final String bindingName) {
+ final JavaCallbackInfo jcbi = setFuncToJavaCallbackMap.get(bindingName);
+ return null != jcbi && !jcbi.cbUserParamIsDefined;
+ }
+
}