Added alternatives for glGetActiveUniform/Attrib.

Added a javadoc comment to all alternative methods.
This commit is contained in:
Ioannis Tsakpinis 2010-03-23 12:43:44 +00:00
parent 2f172a09bf
commit ef86a6c501
8 changed files with 86 additions and 26 deletions

View file

@ -48,4 +48,7 @@ public @interface Alternate {
/** If true, an alternate Java->native call will be created. Useful when the alternate implementation uses different types. */
boolean nativeAlt() default false;
/** If true, the alternate method's name will be used for the Java call. */
boolean javaAlt() default false;
}

View file

@ -210,7 +210,7 @@ public class JavaMethodsGenerator {
StripPostfix strip_annotation = method.getAnnotation(StripPostfix.class);
String method_name;
Alternate alt_annotation = method.getAnnotation(Alternate.class);
method_name = alt_annotation == null ? method.getSimpleName() : alt_annotation.value();
method_name = alt_annotation == null || alt_annotation.javaAlt() ? method.getSimpleName() : alt_annotation.value();
if (strip_annotation != null && mode == Mode.NORMAL)
method_name = getPostfixStrippedName(type_map, interface_decl, method);
writer.print(" " + method_name + "(");
@ -324,7 +324,7 @@ public class JavaMethodsGenerator {
}
String method_name;
Alternate alt_annotation = method.getAnnotation(Alternate.class);
method_name = alt_annotation == null ? method.getSimpleName() : alt_annotation.value();
method_name = alt_annotation == null || alt_annotation.javaAlt() ? method.getSimpleName() : alt_annotation.value();
String extension_postfix = "NULL".equals(strip_annotation.extension()) ? getExtensionPostfix(interface_decl) : strip_annotation.extension();
String result;

View file

@ -154,7 +154,8 @@ public class Utils {
while (doc_lines.hasMoreTokens())
writer.println("\t *" + doc_lines.nextToken());
writer.println("\t */");
}
} else if ( (decl instanceof MethodDeclaration) && decl.getAnnotation(Alternate.class) != null )
writer.println("\t/** Overloads " + decl.getAnnotation(Alternate.class).value() + " */");
}
public static AnnotationMirror getParameterAutoAnnotation(ParameterDeclaration param) {