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_properties.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 74 % if prop.details is not None: 75 <details>${prop.details}</details> 76 % endif 77 78 % if prop.hal_details is not None: 79 <hal_details>${prop.hal_details}</hal_details> 80 % endif 81 82 % for tag in prop.tags: 83 <tag id="${tag.id}" /> 84 % endfor 85 86 </clone> 87 % else: 88 <entry name="${prop.name_short}" type="${prop.type}" 89 % if prop.visibility: 90 visibility="${prop.visibility}" 91 % endif 92 % if prop.synthetic: 93 synthetic="true" 94 % endif 95 % if prop.deprecated: 96 deprecated="true" 97 % endif 98 % if prop.optional: 99 optional="${str(prop.optional).lower()}" 100 % endif 101 % if prop.enum: 102 enum="true" 103 % endif 104 % if prop.type_notes is not None: 105 type_notes="${prop.type_notes}" 106 % endif 107 % if prop.container is not None: 108 container="${prop.container}" 109 % endif 110 111 % if prop.typedef is not None: 112 typedef="${prop.typedef.name}" 113 % endif 114 115 % if prop.hwlevel: 116 hwlevel="${prop.hwlevel}" 117 % endif 118 > 119 120 % if prop.container == 'array': 121 <array> 122 % for size in prop.container_sizes: 123 <size>${size}</size> 124 % endfor 125 </array> 126 % elif prop.container == 'tuple': 127 <tuple> 128 % for size in prop.container_sizes: 129 <value /> <!-- intentionally generated empty. manually fix --> 130 % endfor 131 </tuple> 132 % endif 133 % if prop.enum: 134 <enum> 135 % for value in prop.enum.values: 136 <value 137 % if value.deprecated: 138 deprecated="true" 139 % endif: 140 % if value.optional: 141 optional="true" 142 % endif: 143 % if value.hidden: 144 hidden="true" 145 % endif: 146 % if value.ndk_hidden: 147 ndk_hidden="true" 148 % endif: 149 % if value.id is not None: 150 id="${value.id}" 151 % endif 152 >${value.name} 153 % if value.notes is not None: 154 <notes>${value.notes}</notes> 155 % endif 156 </value> 157 % endfor 158 </enum> 159 % endif 160 161 % if prop.description is not None: 162 <description>${prop.description | x}</description> 163 % endif 164 165 % if prop.units is not None: 166 <units>${prop.units | x}</units> 167 % endif 168 169 % if prop.range is not None: 170 <range>${prop.range | x}</range> 171 % endif 172 173 % if prop.details is not None: 174 <details>${prop.details | x}</details> 175 % endif 176 177 % if prop.hal_details is not None: 178 <hal_details>${prop.hal_details | x}</hal_details> 179 % endif 180 181 % for tag in prop.tags: 182 <tag id="${tag.id}" /> 183 % endfor 184 185 </entry> 186 % endif 187 </%def> 188 189 ${insert_body(kind)} 190 191 </${kind.name}> 192 % endfor # for each kind 193 194 </section> 195 % endfor 196</namespace> 197% endfor 198 199</metadata> 200