aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/sun
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-03-06 01:09:25 +0000
committerKenneth Russel <[email protected]>2006-03-06 01:09:25 +0000
commit7669b88d5ea5d46e0d83632fb2afdcc75f4f5abc (patch)
tree8525ecb63a705c65b8dad26e7c07f9b0bf9d76e8 /src/java/com/sun
parent2acecde6ab32e718975cf49a2e03abe4b919bbca (diff)
Did refactoring and made private fields protected in order to allow
subclassing git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@21 a78bb65f-1512-4460-ba86-f6dc96a7bf27
Diffstat (limited to 'src/java/com/sun')
-rw-r--r--src/java/com/sun/gluegen/JavaMethodBindingEmitter.java22
-rwxr-xr-xsrc/java/com/sun/gluegen/opengl/GLJavaMethodBindingEmitter.java6
-rwxr-xr-xsrc/java/com/sun/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java8
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,