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