summaryrefslogtreecommitdiffstats
path: root/src/java/com/sun/gluegen/MethodBinding.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2008-05-26 18:35:33 +0000
committerKenneth Russel <[email protected]>2008-05-26 18:35:33 +0000
commit040e730115f8a50b598edb448fc29f8917bde392 (patch)
tree9b2a78e5dc09d1c693a523355ad74242750e9eef /src/java/com/sun/gluegen/MethodBinding.java
parentc84a0811ac16ef8c25f257c1bcee4d386e7afcb9 (diff)
Added support for passing outgoing arrays of compound types, including
non-const arrays of compound types and the associated copies back to Java, in support of constructs like eglChooseConfig. Generated code has been compiled but not yet tested. Refactorings to allow generated glue code using StructAccessors to work on Java ME / CDC / FP + JSR-239 NIO, as well as Java SE. Bug fix to ForceProcAddressGen. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@77 a78bb65f-1512-4460-ba86-f6dc96a7bf27
Diffstat (limited to 'src/java/com/sun/gluegen/MethodBinding.java')
-rw-r--r--src/java/com/sun/gluegen/MethodBinding.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/java/com/sun/gluegen/MethodBinding.java b/src/java/com/sun/gluegen/MethodBinding.java
index f8a4d2c..04b73e2 100644
--- a/src/java/com/sun/gluegen/MethodBinding.java
+++ b/src/java/com/sun/gluegen/MethodBinding.java
@@ -58,6 +58,7 @@ public class MethodBinding {
private boolean signatureUsesNIO;
private boolean signatureCanUseIndirectNIO;
private boolean signatureUsesCompoundTypeWrappers;
+ private boolean signatureUsesArraysOfCompoundTypeWrappers;
private boolean signatureUsesCVoidPointers;
private boolean signatureUsesCPrimitivePointers;
private boolean signatureUsesCArrays;
@@ -84,6 +85,7 @@ public class MethodBinding {
this.signatureUsesNIO = bindingToCopy.signatureUsesNIO;
this.signatureCanUseIndirectNIO = bindingToCopy.signatureCanUseIndirectNIO;
this.signatureUsesCompoundTypeWrappers = bindingToCopy.signatureUsesCompoundTypeWrappers;
+ this.signatureUsesArraysOfCompoundTypeWrappers = bindingToCopy.signatureUsesArraysOfCompoundTypeWrappers;
this.signatureUsesCVoidPointers = bindingToCopy.signatureUsesCVoidPointers;
this.signatureUsesCPrimitivePointers = bindingToCopy.signatureUsesCPrimitivePointers;
this.signatureUsesCArrays = bindingToCopy.signatureUsesCArrays;
@@ -233,6 +235,16 @@ public class MethodBinding {
}
/**
+ * Returns true if the return type or any of the outgoing arguments
+ * in the method's signature use arrays of "compound type wrappers",
+ * or NIO-based wrappers for C data structures.
+ */
+ public boolean signatureUsesArraysOfCompoundTypeWrappers() {
+ computeSignatureProperties();
+ return signatureUsesArraysOfCompoundTypeWrappers;
+ }
+
+ /**
* Returns true if the function needs NIO-related
* wrapping/unwrapping or conversion of various arguments. Currently
* this returns the logical OR of signatureUsesNIO() and
@@ -290,6 +302,7 @@ public class MethodBinding {
signatureUsesNIO = false;
signatureCanUseIndirectNIO = false;
signatureUsesCompoundTypeWrappers = false;
+ signatureUsesArraysOfCompoundTypeWrappers = false;
signatureUsesCVoidPointers = false;
signatureUsesCPrimitivePointers = false;
signatureUsesCArrays = false;
@@ -333,6 +346,12 @@ public class MethodBinding {
signatureUsesCompoundTypeWrappers = true;
}
+ if (javaArgType.isArrayOfCompoundTypeWrappers()) {
+ // Needs to be duplicated and this array lowered to an array
+ // of Buffers for code emission
+ signatureUsesArraysOfCompoundTypeWrappers = true;
+ }
+
if (javaArgType.isNIOBuffer() ||
javaArgType.isNIOBufferArray()) {
// Needs checking of direct buffer property