1 ## -*- coding: utf-8 -*-
2 <?xml version="1.0" encoding="UTF-8"?>
3 <!-- Copyright (C) 2012 The Android Open Source Project
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
9 http://www.apache.org/licenses/LICENSE-2.0
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.
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">
23 % for tag in metadata.tags:
24 % if tag.description and tag.description.strip():
25 <tag id="${tag.id}">${tag.description | x}</tag>
27 <tag id="${tag.id}"><!-- TODO: fill the tag description --></tag>
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>
42 % for root in metadata.outer_namespaces:
43 <namespace name="${root.name}">
44 % for section in root.sections:
45 <section name="${section.name}">
47 % if section.description is not None:
48 <description>${section.description}</description>
51 % for kind in section.kinds: # dynamic,static,controls
54 <%def name="insert_body(node)">
55 % for nested in node.namespaces:
56 ${insert_namespace(nested)}
59 % for entry in node.entries:
60 ${insert_entry(entry)}
64 <%def name="insert_namespace(namespace)">
65 <namespace name="${namespace.name}">
66 ${insert_body(namespace)}
70 <%def name="insert_entry(prop)">
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}"
78 % if prop.details is not None:
79 <details>${prop.details}</details>
82 % if prop.ndk_details is not None:
83 <ndk_details>${prop.ndk_details}</ndk_details>
86 % if prop.hal_details is not None:
87 <hal_details>${prop.hal_details}</hal_details>
90 % for tag in prop.tags:
91 <tag id="${tag.id}" />
96 <entry name="${prop.name_short}" type="${prop.type}"
98 visibility="${prop.visibility}"
103 % if prop.deprecated:
107 optional="${str(prop.optional).lower()}"
112 % if prop.type_notes is not None:
113 type_notes="${prop.type_notes}"
115 % if prop.container is not None:
116 container="${prop.container}"
119 % if prop.typedef is not None:
120 typedef="${prop.typedef.name}"
124 hwlevel="${prop.hwlevel}"
127 % if (prop.hal_major_version, prop.hal_minor_version) != (3,2):
128 hal_version="${prop.hal_major_version}.${prop.hal_minor_version}"
132 % if prop.container == 'array':
134 % for size in prop.container_sizes:
138 % elif prop.container == 'tuple':
140 % for size in prop.container_sizes:
141 <value /> <!-- intentionally generated empty. manually fix -->
147 % for value in prop.enum.values:
149 % if value.deprecated:
158 % if value.ndk_hidden:
161 % if value.id is not None:
164 % if not (value.hal_major_version == prop.hal_major_version and value.hal_minor_version == prop.hal_minor_version):
165 hal_version=${"%d.%d" % (value.hal_major_version, value.hal_minor_version)}
168 % if value.notes is not None:
169 <notes>${value.notes}</notes>
171 % if value.sdk_notes is not None:
172 <sdk_notes>${value.sdk_notes}</sdk_notes>
174 % if value.ndk_notes is not None:
175 <ndk_notes>${value.ndk_notes}</ndk_notes>
183 % if prop.description is not None:
184 <description>${prop.description | x}</description>
187 % if prop.deprecation_description is not None:
188 <deprecation_description>${prop.deprecation_description | x}</deprecation_description>
191 % if prop.units is not None:
192 <units>${prop.units | x}</units>
195 % if prop.range is not None:
196 <range>${prop.range | x}</range>
199 % if prop.details is not None:
200 <details>${prop.details | x}</details>
203 % if prop.ndk_details is not None:
204 <ndk_details>${prop.ndk_details}</ndk_details>
207 % if prop.hal_details is not None:
208 <hal_details>${prop.hal_details | x}</hal_details>
211 % for tag in prop.tags:
212 <tag id="${tag.id}" />
222 % endfor # for each kind