1## -*- coding: utf-8 -*- 2<?xml version="1.0" encoding="UTF-8"?> 3<!-- Copyright (C) 2012 The Android Open Source Project 4 5 Licensed under the Apache License, Version 2.0 (the "License"); 6 you may not use this file except in compliance with the License. 7 You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11 Unless required by applicable law or agreed to in writing, software 12 distributed under the License is distributed on an "AS IS" BASIS, 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 See the License for the specific language governing permissions and 15 limitations under the License. 16--> 17<metadata 18 xmlns="http://schemas.android.com/service/camera/metadata/" 19 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 20 xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata_definitions.xsd"> 21 22<tags> 23% for tag in metadata.tags: 24 % if tag.description and tag.description.strip(): 25 <tag id="${tag.id}">${tag.description | x}</tag> 26 % else: 27 <tag id="${tag.id}"><!-- TODO: fill the tag description --></tag> 28 % endif 29% endfor 30</tags> 31 32<types> 33% for typedef in metadata.types: 34 <typedef name="${typedef.name}"> 35 % for (language, klass) in typedef.languages.items(): 36 <language name="${language}">${klass | h}</language> 37 % endfor 38 </typedef> 39% endfor 40</types> 41 42% for root in metadata.outer_namespaces: 43<namespace name="${root.name}"> 44 % for section in root.sections: 45 <section name="${section.name}"> 46 47 % if section.description is not None: 48 <description>${section.description}</description> 49 % endif 50 51 % for kind in section.kinds: # dynamic,static,controls 52 <${kind.name}> 53 54 <%def name="insert_body(node)"> 55 % for nested in node.namespaces: 56 ${insert_namespace(nested)} 57 % endfor 58 59 % for entry in node.entries: 60 ${insert_entry(entry)} 61 % endfor 62 </%def> 63 64 <%def name="insert_namespace(namespace)"> 65 <namespace name="${namespace.name}"> 66 ${insert_body(namespace)} 67 </namespace> 68 </%def> 69 70 <%def name="insert_entry(prop)"> 71 % if prop.is_clone(): 72 <clone entry="${prop.name}" kind="${prop.target_kind}" 73 % if ('hal_version' in prop._property_keys): 74 hal_version="${prop.hal_major_version}.${prop.hal_minor_version}" 75 % endif 76 > 77 78 % if prop.details is not None: 79 <details>${prop.details}</details> 80 % endif 81 82 % if prop.ndk_details is not None: 83 <ndk_details>${prop.ndk_details}</ndk_details> 84 % endif 85 86 % if prop.hal_details is not None: 87 <hal_details>${prop.hal_details}</hal_details> 88 % endif 89 90 % for tag in prop.tags: 91 <tag id="${tag.id}" /> 92 % endfor 93 94 </clone> 95 % else: 96 <entry name="${prop.name_short}" type="${prop.type}" 97 % if prop.visibility: 98 visibility="${prop.visibility}" 99 % endif 100 % if prop.synthetic: 101 synthetic="true" 102 % endif 103 % if prop.deprecated: 104 deprecated="true" 105 % endif 106 % if prop.optional: 107 optional="${str(prop.optional).lower()}" 108 % endif 109 % if prop.enum: 110 enum="true" 111 % endif 112 % if prop.type_notes is not None: 113 type_notes="${prop.type_notes}" 114 % endif 115 % if prop.container is not None: 116 container="${prop.container}" 117 % endif 118 119 % if prop.typedef is not None: 120 typedef="${prop.typedef.name}" 121 % endif 122 123 % if prop.hwlevel: 124 hwlevel="${prop.hwlevel}" 125 % endif 126 127 % if prop.permission_needed == "true": 128 permission_needed="true" 129 % endif 130 131 % if (prop.hal_major_version, prop.hal_minor_version) != (3,2): 132 hal_version="${prop.hal_major_version}.${prop.hal_minor_version}" 133 % endif 134 > 135 136 % if prop.container == 'array': 137 <array> 138 % for size in prop.container_sizes: 139 <size>${size}</size> 140 % endfor 141 </array> 142 % elif prop.container == 'tuple': 143 <tuple> 144 % for size in prop.container_sizes: 145 <value /> <!-- intentionally generated empty. manually fix --> 146 % endfor 147 </tuple> 148 % endif 149 % if prop.enum: 150 <enum> 151 % for value in prop.enum.values: 152 <value 153 % if value.deprecated: 154 deprecated="true" 155 % endif: 156 % if value.optional: 157 optional="true" 158 % endif: 159 % if value.visibility is not None: 160 visibility="${value.visibility}" 161 % endif: 162 % if value.id is not None: 163 id="${value.id}" 164 % endif 165 % if not (value.hal_major_version == prop.hal_major_version and value.hal_minor_version == prop.hal_minor_version): 166 hal_version=${"%d.%d" % (value.hal_major_version, value.hal_minor_version)} 167 % endif 168 >${value.name} 169 % if value.notes is not None: 170 <notes>${value.notes}</notes> 171 % endif 172 % if value.sdk_notes is not None: 173 <sdk_notes>${value.sdk_notes}</sdk_notes> 174 % endif 175 % if value.ndk_notes is not None: 176 <ndk_notes>${value.ndk_notes}</ndk_notes> 177 % endif 178 179 </value> 180 % endfor 181 </enum> 182 % endif 183 184 % if prop.description is not None: 185 <description>${prop.description | x}</description> 186 % endif 187 188 % if prop.deprecation_description is not None: 189 <deprecation_description>${prop.deprecation_description | x}</deprecation_description> 190 % endif 191 192 % if prop.units is not None: 193 <units>${prop.units | x}</units> 194 % endif 195 196 % if prop.range is not None: 197 <range>${prop.range | x}</range> 198 % endif 199 200 % if prop.details is not None: 201 <details>${prop.details | x}</details> 202 % endif 203 204 % if prop.ndk_details is not None: 205 <ndk_details>${prop.ndk_details}</ndk_details> 206 % endif 207 208 % if prop.hal_details is not None: 209 <hal_details>${prop.hal_details | x}</hal_details> 210 % endif 211 212 % for tag in prop.tags: 213 <tag id="${tag.id}" /> 214 % endfor 215 216 </entry> 217 % endif 218 </%def> 219 220 ${insert_body(kind)} 221 222 </${kind.name}> 223 % endfor # for each kind 224 225 </section> 226 % endfor 227</namespace> 228% endfor 229 230</metadata> 231