summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/jogamp')
-rw-r--r--src/java/com/jogamp/gluegen/JavaCallbackEmitter.java2
-rw-r--r--src/java/com/jogamp/gluegen/JavaConfiguration.java10
-rw-r--r--src/java/com/jogamp/gluegen/JavaEmitter.java70
3 files changed, 51 insertions, 31 deletions
diff --git a/src/java/com/jogamp/gluegen/JavaCallbackEmitter.java b/src/java/com/jogamp/gluegen/JavaCallbackEmitter.java
index 01ffe8f..3359c1c 100644
--- a/src/java/com/jogamp/gluegen/JavaCallbackEmitter.java
+++ b/src/java/com/jogamp/gluegen/JavaCallbackEmitter.java
@@ -348,6 +348,8 @@ public final class JavaCallbackEmitter {
}
private final void emitJavaKeyClass(final CodeUnit unit) {
+ if( cfg.shouldIgnoreInInterface(KeyClassName) ) return;
+
emitJavaBriefAPIDoc(unit, "", "", "", "for ");
unit.emitln(" public static class "+KeyClassName+" {");
binding.forEachParameter( ( final int idx, final int consumedCount, final Type cType, final JavaType jType, final String name ) -> {
diff --git a/src/java/com/jogamp/gluegen/JavaConfiguration.java b/src/java/com/jogamp/gluegen/JavaConfiguration.java
index 107b8c3..870b708 100644
--- a/src/java/com/jogamp/gluegen/JavaConfiguration.java
+++ b/src/java/com/jogamp/gluegen/JavaConfiguration.java
@@ -1808,23 +1808,33 @@ public class JavaConfiguration {
final Set<String> parsedEnumNames = parser.getParsedEnumNames();
final Set<String> parsedFuncNames = parser.getParsedFunctionNames();
+ final Set<String> parsedInnerInterfaces = parser.getParsedInnerInterfacesNames();
+ final Set<String> parsedInnerClasses = parser.getParsedInnerClassesNames();
if(forInterface) {
if(onlyList) {
extendedIntfSymbolsOnly.addAll(parsedEnumNames);
extendedIntfSymbolsOnly.addAll(parsedFuncNames);
+ extendedIntfSymbolsOnly.addAll(parsedInnerInterfaces);
+ extendedIntfSymbolsOnly.addAll(parsedInnerClasses);
} else {
extendedIntfSymbolsIgnore.addAll(parsedEnumNames);
extendedIntfSymbolsIgnore.addAll(parsedFuncNames);
+ extendedIntfSymbolsIgnore.addAll(parsedInnerInterfaces);
+ extendedIntfSymbolsIgnore.addAll(parsedInnerClasses);
}
}
if(forImplementation) {
if(onlyList) {
extendedImplSymbolsOnly.addAll(parsedEnumNames);
extendedImplSymbolsOnly.addAll(parsedFuncNames);
+ extendedImplSymbolsOnly.addAll(parsedInnerInterfaces);
+ extendedImplSymbolsOnly.addAll(parsedInnerClasses);
} else {
extendedImplSymbolsIgnore.addAll(parsedEnumNames);
extendedImplSymbolsIgnore.addAll(parsedFuncNames);
+ extendedImplSymbolsIgnore.addAll(parsedInnerInterfaces);
+ extendedImplSymbolsIgnore.addAll(parsedInnerClasses);
}
}
}
diff --git a/src/java/com/jogamp/gluegen/JavaEmitter.java b/src/java/com/jogamp/gluegen/JavaEmitter.java
index 0936536..6e79b6c 100644
--- a/src/java/com/jogamp/gluegen/JavaEmitter.java
+++ b/src/java/com/jogamp/gluegen/JavaEmitter.java
@@ -1494,11 +1494,17 @@ public class JavaEmitter implements GlueEmitter {
LOG.log(INFO, "JavaCallbackInfo: Reusing {0} -> {1}", jcbd.setFuncName, jcbi0);
} else {
final StringBuilder cbMethodSignature = new StringBuilder();
- javaUnit.emitln(" /** JavaCallback interface: "+jcbd.cbFuncTypeName+" -> "+funcType.toString(jcbd.cbFuncTypeName, false, true)+" */");
- javaUnit.emitln(" public static interface "+cbSimpleClazzName+" {");
- final List<MethodBinding> mbs = generateFunctionInterfaceCode(javaUnit, funcSym, jcbd, cbMethodSignature);
- javaUnit.emitln(" }");
- javaUnit.emitln();
+ final List<MethodBinding> mbs;
+ if( !cfg.shouldIgnoreInInterface(jcbd.cbFuncTypeName) ) {
+ javaUnit.emitln(" /** JavaCallback interface: "+jcbd.cbFuncTypeName+" -> "+funcType.toString(jcbd.cbFuncTypeName, false, true)+" */");
+ javaUnit.emitln(" public static interface "+cbSimpleClazzName+" {");
+ mbs = generateFunctionInterfaceCode(javaUnit, funcSym, jcbd, cbMethodSignature);
+ javaUnit.emitln(" }");
+ javaUnit.emitln();
+ } else {
+ LOG.log(WARNING, "JavaCallbackInfo: Java Configuration indicate current JavaCallback must be ignored so assume JavaCallback meet presents requirements of {0}", jcbd.setFuncName);
+ mbs = generateFunctionInterfaceCode(null, funcSym, jcbd, cbMethodSignature);
+ }
if( 1 != mbs.size() ) {
throw new UnsupportedOperationException("Multiple bindings generated where only 1 is allowed for func "+funcType.toString(jcbd.cbFuncTypeName, false, true));
}
@@ -1508,9 +1514,9 @@ public class JavaEmitter implements GlueEmitter {
cbFuncBinding.getJavaReturnType()+", func "+funcType.toString(jcbd.cbFuncTypeName, false, true));
}
final JavaCallbackInfo jcbi1 = new JavaCallbackInfo(jcbd.cbFuncTypeName, cbSimpleClazzName, cbFQClazzName, cbMethodSignature.toString(),
- funcType, cbFuncBinding, jcbd.cbFuncUserParamIdx, jcbd.cbFuncKeyIndices,
- jcbd.setFuncName, jcbd.setFuncUserParamIdx, jcbd.setFuncKeyIndices,
- jcbd.userParamClassName, jcbd.customKeyClassName);
+ funcType, cbFuncBinding, jcbd.cbFuncUserParamIdx, jcbd.cbFuncKeyIndices,
+ jcbd.setFuncName, jcbd.setFuncUserParamIdx, jcbd.setFuncKeyIndices,
+ jcbd.userParamClassName, jcbd.customKeyClassName);
cfg.setFuncToJavaCallbackMap.put(jcbd.setFuncName, jcbi1);
javaCallbackInterfaceMap.put(cbFQClazzName, jcbi1);
LOG.log(INFO, "JavaCallbackInfo: Added {0} -> {1}", jcbd.setFuncName, jcbi1);
@@ -1556,29 +1562,31 @@ public class JavaEmitter implements GlueEmitter {
final boolean useNIOOnly = true;
final boolean useNIODirectOnly = true;
- for (final MethodBinding binding : bindings) {
- // Emit public Java entry point for calling this function pointer
- final JavaMethodBindingEmitter emitter = new JavaMethodBindingEmitter(binding,
- javaUnit,
- cfg.runtimeExceptionType(),
- cfg.unsupportedExceptionType(),
- false, // emitBody
- cfg.tagNativeBinding(),
- false, // eraseBufferAndArrayTypes
- useNIOOnly,
- useNIODirectOnly,
- false, // forDirectBufferImplementation
- false, // forIndirectBufferAndArrayImplementation
- true, // isUnimplemented
- true, // isInterface
- false, // isNativeMethod
- false, // isPrivateNativeMethod
- cfg) {
- @Override
- protected String getBaseIndentString() { return " "; }
- };
- emitter.addModifier(JavaMethodBindingEmitter.PUBLIC);
- emitter.emit();
+ if( null != javaUnit) {
+ for (final MethodBinding binding : bindings) {
+ // Emit public Java entry point for calling this function pointer
+ final JavaMethodBindingEmitter emitter = new JavaMethodBindingEmitter(binding,
+ javaUnit,
+ cfg.runtimeExceptionType(),
+ cfg.unsupportedExceptionType(),
+ false, // emitBody
+ cfg.tagNativeBinding(),
+ false, // eraseBufferAndArrayTypes
+ useNIOOnly,
+ useNIODirectOnly,
+ false, // forDirectBufferImplementation
+ false, // forIndirectBufferAndArrayImplementation
+ true, // isUnimplemented
+ true, // isInterface
+ false, // isNativeMethod
+ false, // isPrivateNativeMethod
+ cfg) {
+ @Override
+ protected String getBaseIndentString() { return " "; }
+ };
+ emitter.addModifier(JavaMethodBindingEmitter.PUBLIC);
+ emitter.emit();
+ }
}
return bindings;
}