@Override public Struct convertCallback(FunctionSignature functionSignature, Signatures signatures, Identifier callerLibraryName) { Struct decl = super.convertCallback(functionSignature, signatures, callerLibraryName); if (decl != null) { decl.setParents(Arrays.asList((SimpleTypeRef) (FunctionSignature.Type.ObjCBlock.equals(functionSignature.getType()) ? result.config.runtime.typeRef(JNAeratorConfig.Runtime.Ann.ObjCBlock) : (SimpleTypeRef) typeRef(ident(result.config.runtime.callbackClass, expr(typeRef(decl.getTag().clone()))))))); //addCallingConventionAnnotation(functionSignature.getFunction(), decl); } return decl; }
@Override public Struct convertCallback(FunctionSignature functionSignature, Signatures signatures, Identifier callerLibraryName) { Struct decl = super.convertCallback(functionSignature, signatures, callerLibraryName); if (decl != null) { decl.setParents(Arrays.asList((SimpleTypeRef) (FunctionSignature.Type.ObjCBlock.equals(functionSignature.getType()) ? result.config.runtime.typeRef(JNAeratorConfig.Runtime.Ann.ObjCBlock) : (SimpleTypeRef) typeRef(ident(result.config.runtime.callbackClass, expr(typeRef(decl.getTag().clone()))))))); //addCallingConventionAnnotation(functionSignature.getFunction(), decl); } return decl; }
public void visitFunctionSignature(FunctionSignature e) { if (e.getFunction() == null) { return; } assert e.getFunction().getBody() == null; modifiersStringPrefix(e); append(e.getFunction().getValueType()).space(e.getFunction().getValueType() != null); if (e.getParentElement() instanceof TypeRef.Pointer) { append("("); modifiersStringPrefix(e.getFunction()); switch (e.getType()) { case CFunction: append("*"); break; case ObjCBlock: append("^"); break; } append(e.getFunction().getName()); append(")"); } else { append(e.getFunction().getName()); } append("("); implode(e.getFunction().getArgs(), ", "); append(")"); append(e.getModifiers().isEmpty() ? "" : " "); implode(e.getModifiers(), " "); }