diff options
Diffstat (limited to 'src/java')
3 files changed, 28 insertions, 8 deletions
diff --git a/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java b/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java index 0032b61..4a0b201 100644 --- a/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java +++ b/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java @@ -134,6 +134,8 @@ public class JavaMethodBindingEmitter extends FunctionEmitter public final MethodBinding getBinding() { return binding; } public boolean isForImplementingMethodCall() { return forImplementingMethodCall; } + public boolean isForDirectBufferImplementation() { return forDirectBufferImplementation; } + public boolean isForIndirectBufferAndArrayImplementation() { return forIndirectBufferAndArrayImplementation; } public String getName() { return binding.getRenamedMethodName(); @@ -193,6 +195,16 @@ public class JavaMethodBindingEmitter extends FunctionEmitter this.forImplementingMethodCall = impl; } + /** Accessor for subclasses. */ + public void setForDirectBufferImplementation(boolean direct) { + this.forDirectBufferImplementation = direct; + } + + /** Accessor for subclasses. */ + public void setForIndirectBufferAndArrayImplementation(boolean indirect) { + this.forIndirectBufferAndArrayImplementation = indirect; + } + protected void emitReturnType(PrintWriter writer) { writer.print(getReturnTypeString(false)); @@ -432,7 +444,7 @@ public class JavaMethodBindingEmitter extends FunctionEmitter writer.print(getImplMethodName(direct)); writer.print("("); emitCallArguments(binding, writer, direct); - writer.print(");"); + writer.print(")"); } @@ -481,9 +493,11 @@ public class JavaMethodBindingEmitter extends FunctionEmitter // Only one call being made in this body, going to indirect // buffer / array entry point emitCall(binding, writer, false); + writer.print(";"); writer.println(); } else { emitCall(binding, writer, true); + writer.print(";"); } if (binding.signatureCanUseIndirectNIO() && !directNIOOnly) { @@ -501,6 +515,7 @@ public class JavaMethodBindingEmitter extends FunctionEmitter } } emitCall(binding, writer, false); + writer.print(";"); writer.println(); writer.println(" }"); } else { @@ -556,8 +571,6 @@ public class JavaMethodBindingEmitter extends FunctionEmitter writer.print(getArgumentName(i)); writer.print(".getBuffer())"); } - needComma = true; - ++numArgsEmitted; if (type.isNIOBuffer()) { if (direct) { writer.print(", BufferFactory.getDirectBufferByteOffset(" + getArgumentName(i) + ")"); @@ -589,6 +602,9 @@ public class JavaMethodBindingEmitter extends FunctionEmitter } writer.print(offsetArgName(i)); } + + needComma = true; + ++numArgsEmitted; } return numArgsEmitted; } diff --git a/src/java/com/sun/gluegen/opengl/GLJavaMethodBindingEmitter.java b/src/java/com/sun/gluegen/opengl/GLJavaMethodBindingEmitter.java index ce7f311..8512f38 100755 --- a/src/java/com/sun/gluegen/opengl/GLJavaMethodBindingEmitter.java +++ b/src/java/com/sun/gluegen/opengl/GLJavaMethodBindingEmitter.java @@ -50,7 +50,7 @@ import com.sun.gluegen.procaddress.*; Pixel Buffer Object variants. */ public class GLJavaMethodBindingEmitter extends ProcAddressJavaMethodBindingEmitter { - private boolean bufferObjectVariant; + protected boolean bufferObjectVariant; public GLJavaMethodBindingEmitter(JavaMethodBindingEmitter methodToWrap, boolean callThroughProcAddress, @@ -72,6 +72,10 @@ public class GLJavaMethodBindingEmitter extends ProcAddressJavaMethodBindingEmit this.bufferObjectVariant = bufferObjectVariant; } + public GLJavaMethodBindingEmitter(GLJavaMethodBindingEmitter methodToWrap) { + this(methodToWrap, methodToWrap.bufferObjectVariant); + } + protected String getArgumentName(int i) { String name = super.getArgumentName(i); diff --git a/src/java/com/sun/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java b/src/java/com/sun/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java index 9750e71..7900d67 100755 --- a/src/java/com/sun/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java +++ b/src/java/com/sun/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java @@ -51,10 +51,10 @@ public class ProcAddressJavaMethodBindingEmitter extends JavaMethodBindingEmitte private final CommentEmitter commentEmitterForWrappedMethod = new WrappedMethodCommentEmitter(); - private boolean callThroughProcAddress; - private String getProcAddressTableExpr; - private boolean changeNameAndArguments; - private ProcAddressEmitter emitter; + protected boolean callThroughProcAddress; + protected String getProcAddressTableExpr; + protected boolean changeNameAndArguments; + protected ProcAddressEmitter emitter; public ProcAddressJavaMethodBindingEmitter(JavaMethodBindingEmitter methodToWrap, boolean callThroughProcAddress, |