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.id is not None: 147 id="${value.id}" 148 % endif 149 >${value.name} 150 % if value.notes is not None: 151 <notes>${value.notes}</notes> 152 % endif 153 </value> 154 % endfor 155 </enum> 156 % endif 157 158 % if prop.description is not None: 159 <description>${prop.description | x}</description> 160 % endif 161 162 % if prop.units is not None: 163 <units>${prop.units | x}</units> 164 % endif 165 166 % if prop.range is not None: 167 <range>${prop.range | x}</range> 168 % endif 169 170 % if prop.details is not None: 171 <details>${prop.details | x}</details> 172 % endif 173 174 % if prop.hal_details is not None: 175 <hal_details>${prop.hal_details | x}</hal_details> 176 % endif 177 178 % for tag in prop.tags: 179 <tag id="${tag.id}" /> 180 % endfor 181 182 </entry> 183 % endif 184 </%def> 185 186 ${insert_body(kind)} 187 188 </${kind.name}> 189 % endfor # for each kind 190 191 </section> 192 % endfor 193</namespace> 194% endfor 195 196</metadata> 197