OSDN Git Service

Merge "Camera: Add PASSIVE_UNFOCUSED AF state" into klp-dev
[android-x86/system-media.git] / camera / docs / metadata_template.mako
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}</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.notes is not None:
75                 <notes>${prop.notes}</notes>
76               % endif
77
78               % for tag in prop.tags:
79                 <tag id="${tag.id}" />
80               % endfor
81
82             </clone>
83         % else:
84             <entry name="${prop.name_short}" type="${prop.type}"
85           % if prop.visibility:
86                 visibility="${prop.visibility}"
87           % endif
88           % if prop.enum:
89                 enum="true"
90           % endif
91           % if prop.type_notes is not None:
92                 type_notes="${prop.type_notes}"
93           % endif
94           % if prop.container is not None:
95                 container="${prop.container}"
96           % endif
97
98           % if prop.typedef is not None:
99                 typedef="${prop.typedef.name}"
100           % endif
101             >
102
103               % if prop.container == 'array':
104                 <array>
105                   % for size in prop.container_sizes:
106                     <size>${size}</size>
107                   % endfor
108                 </array>
109               % elif prop.container == 'tuple':
110                 <tuple>
111                   % for size in prop.container_sizes:
112                     <value /> <!-- intentionally generated empty. manually fix -->
113                   % endfor
114                 </tuple>
115               % endif
116               % if prop.enum:
117                 <enum>
118                   % for value in prop.enum.values:
119                       <value
120                     % if value.optional:
121                              optional="true"
122                     % endif:
123                     % if value.id is not None:
124                              id="${value.id}"
125                     % endif
126                       >${value.name}
127                     % if value.notes is not None:
128                              <notes>${value.notes}</notes>
129                     % endif
130                       </value>
131                   % endfor
132                 </enum>
133               % endif
134
135               % if prop.description is not None:
136                 <description>${prop.description | x}</description>
137               % endif
138
139               % if prop.units is not None:
140                 <units>${prop.units | x}</units>
141               % endif
142
143               % if prop.range is not None:
144                 <range>${prop.range | x}</range>
145               % endif
146
147               % if prop.notes is not None:
148                 <notes>${prop.notes | x}</notes>
149               % endif
150
151               % for tag in prop.tags:
152                 <tag id="${tag.id}" />
153               % endfor
154
155             </entry>
156         % endif
157         </%def>
158
159         ${insert_body(kind)}
160
161       </${kind.name}>
162     % endfor # for each kind
163
164   </section>
165   % endfor
166 </namespace>
167 % endfor
168
169 </metadata>