summaryrefslogtreecommitdiffstats
path: root/src/java/com/sun/gluegen/cgram
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-04-17 21:26:26 +0000
committerKenneth Russel <[email protected]>2006-04-17 21:26:26 +0000
commit2aa23056d44c96db88d7cab700243886f6c00304 (patch)
tree1c0a604a727b2bd19621341e329a58a90829ecbe /src/java/com/sun/gluegen/cgram
parent97522e9c738cc01dc0081454a71019a829eb2a5f (diff)
Fixed Issue 212: Incorporate patch to add URL links to GL javadoc
Incorporated patch from user cylab on javagaming.org forums to generate @native tags in GL javadoc which are postprocessed using a taglet: http://www.javagaming.org/forums/index.php?topic=12629.0 Modified supplied patch to restrict the @native designation to only the function name, and to understand OpenGL data type-related suffixes (i.e., glVertex -> glVertex3f). git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@29 a78bb65f-1512-4460-ba86-f6dc96a7bf27
Diffstat (limited to 'src/java/com/sun/gluegen/cgram')
-rw-r--r--src/java/com/sun/gluegen/cgram/types/Field.java2
-rw-r--r--src/java/com/sun/gluegen/cgram/types/FunctionSymbol.java5
-rw-r--r--src/java/com/sun/gluegen/cgram/types/FunctionType.java15
-rw-r--r--src/java/com/sun/gluegen/cgram/types/PointerType.java2
4 files changed, 20 insertions, 4 deletions
diff --git a/src/java/com/sun/gluegen/cgram/types/Field.java b/src/java/com/sun/gluegen/cgram/types/Field.java
index e16ffbc..996d716 100644
--- a/src/java/com/sun/gluegen/cgram/types/Field.java
+++ b/src/java/com/sun/gluegen/cgram/types/Field.java
@@ -95,7 +95,7 @@ public class Field {
return "" + getType() + " " + getName() + ";";
} else {
FunctionType ft = getType().asPointer().getTargetType().asFunction();
- return ft.toString(getName(), true) + ";";
+ return ft.toString(getName(), false, true) + ";";
}
}
}
diff --git a/src/java/com/sun/gluegen/cgram/types/FunctionSymbol.java b/src/java/com/sun/gluegen/cgram/types/FunctionSymbol.java
index 50ee8cc..bc54538 100644
--- a/src/java/com/sun/gluegen/cgram/types/FunctionSymbol.java
+++ b/src/java/com/sun/gluegen/cgram/types/FunctionSymbol.java
@@ -88,6 +88,11 @@ public class FunctionSymbol {
return getType().toString(getName());
}
+ /** Helper routine for emitting native javadoc tags */
+ public String toString(boolean emitNativeTag) {
+ return getType().toString(getName(), emitNativeTag);
+ }
+
public int hashCode() {
if (name == null) {
return 0;
diff --git a/src/java/com/sun/gluegen/cgram/types/FunctionType.java b/src/java/com/sun/gluegen/cgram/types/FunctionType.java
index 5e22e47..e109121 100644
--- a/src/java/com/sun/gluegen/cgram/types/FunctionType.java
+++ b/src/java/com/sun/gluegen/cgram/types/FunctionType.java
@@ -107,7 +107,11 @@ public class FunctionType extends Type {
return toString(functionName, false);
}
- String toString(String functionName, boolean isPointer) {
+ public String toString(String functionName, boolean emitNativeTag) {
+ return toString(functionName, emitNativeTag, false);
+ }
+
+ String toString(String functionName, boolean emitNativeTag, boolean isPointer) {
StringBuffer res = new StringBuffer();
res.append(getReturnType());
res.append(" ");
@@ -115,7 +119,14 @@ public class FunctionType extends Type {
res.append("(*");
}
if (functionName != null) {
+ if (emitNativeTag) {
+ // Emit @native tag for javadoc purposes
+ res.append("{@native ");
+ }
res.append(functionName);
+ if (emitNativeTag) {
+ res.append("}");
+ }
}
if (isPointer) {
res.append(")");
@@ -126,7 +137,7 @@ public class FunctionType extends Type {
Type t = getArgumentType(i);
if (t.isFunctionPointer()) {
FunctionType ft = t.asPointer().getTargetType().asFunction();
- res.append(ft.toString(getArgumentName(i), true));
+ res.append(ft.toString(getArgumentName(i), false, true));
} else if (t.isArray()) {
res.append(t.asArray().toString(getArgumentName(i)));
} else {
diff --git a/src/java/com/sun/gluegen/cgram/types/PointerType.java b/src/java/com/sun/gluegen/cgram/types/PointerType.java
index 3fe69a1..6202505 100644
--- a/src/java/com/sun/gluegen/cgram/types/PointerType.java
+++ b/src/java/com/sun/gluegen/cgram/types/PointerType.java
@@ -126,7 +126,7 @@ public class PointerType extends Type {
if (!targetType.isFunction()) {
throw new RuntimeException("<Internal error or misuse> This method is only for use when printing function pointers");
}
- return ((FunctionType) targetType).toString(functionName, true);
+ return ((FunctionType) targetType).toString(functionName, false, true);
}
public void visit(TypeVisitor arg) {