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.iteritems(): 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.hidden: 160 hidden="true" 161 % endif: 162 % if value.ndk_hidden: 163 ndk_hidden="true" 164 % endif: 165 % if value.id is not None: 166 id="${value.id}" 167 % endif 168 % if not (value.hal_major_version == prop.hal_major_version and value.hal_minor_version == prop.hal_minor_version): 169 hal_version=${"%d.%d" % (value.hal_major_version, value.hal_minor_version)} 170 % endif 171 >${value.name} 172 % if value.notes is not None: 173 <notes>${value.notes}</notes> 174 % endif 175 % if value.sdk_notes is not None: 176 <sdk_notes>${value.sdk_notes}</sdk_notes> 177 % endif 178 % if value.ndk_notes is not None: 179 <ndk_notes>${value.ndk_notes}</ndk_notes> 180 % endif 181 182 </value> 183 % endfor 184 </enum> 185 % endif 186 187 % if prop.description is not None: 188 <description>${prop.description | x}</description> 189 % endif 190 191 % if prop.deprecation_description is not None: 192 <deprecation_description>${prop.deprecation_description | x}</deprecation_description> 193 % endif 194 195 % if prop.units is not None: 196 <units>${prop.units | x}</units> 197 % endif 198 199 % if prop.range is not None: 200 <range>${prop.range | x}</range> 201 % endif 202 203 % if prop.details is not None: 204 <details>${prop.details | x}</details> 205 % endif 206 207 % if prop.ndk_details is not None: 208 <ndk_details>${prop.ndk_details}</ndk_details> 209 % endif 210 211 % if prop.hal_details is not None: 212 <hal_details>${prop.hal_details | x}</hal_details> 213 % endif 214 215 % for tag in prop.tags: 216 <tag id="${tag.id}" /> 217 % endfor 218 219 </entry> 220 % endif 221 </%def> 222 223 ${insert_body(kind)} 224 225 </${kind.name}> 226 % endfor # for each kind 227 228 </section> 229 % endfor 230</namespace> 231% endfor 232 233</metadata> 234