Obsolete the graphics API in the .rsh files.

Mark the graphics APIs as no longer available starting with version 23.

Modify the generator to change the #ifdef guards around the API to
enable internal code to still access the obsoleted APIs, as we still
neeed to support them at runtime.

Also, include a documentation change in the rs_convert header file that had not
been included previously.

Change-Id: Iaad4833f504da9aa9f5069a977c37b86d1316d3a
diff --git a/api/Specification.cpp b/api/Specification.cpp
index b36acae..a82fd1b 100644
--- a/api/Specification.cpp
+++ b/api/Specification.cpp
@@ -224,7 +224,20 @@
     return minVersion == 0 || minVersion <= maxApiLevel;
 }
 
-Definition::Definition(const std::string& name) : mName(name), mDeprecated(false), mHidden(false) {
+Definition::Definition(const std::string& name)
+    : mName(name), mDeprecated(false), mHidden(false), mFinalVersion(-1) {
+}
+
+void Definition::updateFinalVersion(const VersionInfo& info) {
+    /* We set it if:
+     * - We have never set mFinalVersion before, or
+     * - The max version is 0, which means we have not expired this API, or
+     * - We have a max that's later than what we currently have.
+     */
+    if (mFinalVersion < 0 || info.maxVersion == 0 ||
+        (mFinalVersion > 0 && info.maxVersion > mFinalVersion)) {
+        mFinalVersion = info.maxVersion;
+    }
 }
 
 void Definition::scanDocumentationTags(Scanner* scanner, bool firstOccurence,
@@ -323,6 +336,7 @@
     Constant* constant = systemSpecification.findOrCreateConstant(name, &created);
     ConstantSpecification* spec = new ConstantSpecification(constant);
     constant->addSpecification(spec);
+    constant->updateFinalVersion(info);
     specFile->addConstantSpecification(spec, created);
     spec->mVersionInfo = info;
 
@@ -348,6 +362,7 @@
     Type* type = systemSpecification.findOrCreateType(name, &created);
     TypeSpecification* spec = new TypeSpecification(type);
     type->addSpecification(spec);
+    type->updateFinalVersion(info);
     specFile->addTypeSpecification(spec, created);
     spec->mVersionInfo = info;
 
@@ -529,6 +544,7 @@
     Function* function = systemSpecification.findOrCreateFunction(name, &created);
     FunctionSpecification* spec = new FunctionSpecification(function);
     function->addSpecification(spec);
+    function->updateFinalVersion(info);
     specFile->addFunctionSpecification(spec, created);
 
     spec->mUnexpandedName = unexpandedName;