From 93d272a0525ec57aa3cd584f15cde6cf2a637e0c Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Thu, 3 Jul 2003 00:09:30 +0000 Subject: Added pbuffer support to JOGL on X11; HWShadowmapsSimple and ProceduralTexturePhysics demos are now working on Linux with the appropriate hardware. Moved core GLX routines out of the public GLX interface; this allowed XVisualInfo (and the new GLXFBConfig) to be removed from the public API. Added support to GlueGen for returning arrays of pointers as arrays of StructAccessors in Java and for choosing the typedef name for a pointer-to-struct if the struct itself does not have a typedef name. Added support to GLEmitter to emit ProcAddressTables under arbitrary names and to support arbitrary mechanisms for fetching those tables. Made GLU (on all platforms) and GLX (on X11) be dynamically linked. Refactored ProcAddressTable filling to be mostly shared code. Tested changes on Linux, Mac OS X and Windows. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@17 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/net/java/games/gluegen/JavaConfiguration.java | 28 ++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'src/net/java/games/gluegen/JavaConfiguration.java') diff --git a/src/net/java/games/gluegen/JavaConfiguration.java b/src/net/java/games/gluegen/JavaConfiguration.java index ecd953480..3950a7014 100644 --- a/src/net/java/games/gluegen/JavaConfiguration.java +++ b/src/net/java/games/gluegen/JavaConfiguration.java @@ -105,6 +105,7 @@ public class JavaConfiguration { private List/**/ forcedStructs = new ArrayList(); private Map/*>*/ mirroredArgs = new HashMap(); private Map/**/ returnValueCapacities = new HashMap(); + private Map/**/ returnValueLengths = new HashMap(); private Map/*>*/ temporaryCVariableDeclarations = new HashMap(); private Map/*>*/ temporaryCVariableAssignments = new HashMap(); private Map/*>*/ extendedInterfaces = new HashMap(); @@ -288,7 +289,9 @@ public class JavaConfiguration { /** Provides a Java MessageFormat expression indicating the number of elements in the returned array from the specified function - name as defined by the ReturnsArray directive. */ + name. Indicates that the given return value, which must be a + pointer to a CompoundType, is actually an array of the + CompoundType rather than a pointer to a single object. */ public String returnedArrayLength(String functionName) { return (String) returnedArrayLengths.get(functionName); } @@ -378,6 +381,13 @@ public class JavaConfiguration { return (String) returnValueCapacities.get(functionName); } + /** Returns a MessageFormat string of the C expression calculating + the length of the array being returned from a native method, or + null if no expression has been specified. */ + public String returnValueLength(String functionName) { + return (String) returnValueLengths.get(functionName); + } + /** Returns a List of Strings of expressions declaring temporary C variables in the glue code for the specified function. */ public List/**/ temporaryCVariableDeclarations(String functionName) { @@ -582,6 +592,10 @@ public class JavaConfiguration { readReturnValueCapacity(tok, filename, lineNo); // Warning: make sure delimiters are reset at the top of this loop // because ReturnValueCapacity changes them. + } else if (cmd.equalsIgnoreCase("ReturnValueLength")) { + readReturnValueLength(tok, filename, lineNo); + // Warning: make sure delimiters are reset at the top of this loop + // because ReturnValueLength changes them. } else if (cmd.equalsIgnoreCase("Include")) { doInclude(tok, file, filename, lineNo); } else if (cmd.equalsIgnoreCase("IncludeAs")) { @@ -926,6 +940,18 @@ public class JavaConfiguration { } } + protected void readReturnValueLength(StringTokenizer tok, String filename, int lineNo) { + try { + String functionName = tok.nextToken(); + String restOfLine = tok.nextToken("\n\r\f"); + restOfLine = restOfLine.trim(); + returnValueLengths.put(functionName, restOfLine); + } catch (NoSuchElementException e) { + throw new RuntimeException("Error parsing \"ReturnValueLength\" command at line " + lineNo + + " in file \"" + filename + "\"", e); + } + } + protected void readTemporaryCVariableDeclaration(StringTokenizer tok, String filename, int lineNo) { try { String functionName = tok.nextToken(); -- cgit v1.2.3