1## -*- coding: utf-8 -*-
2<!DOCTYPE html>
3<html>
4<!-- Copyright (C) 2012 The Android Open Source Project
5
6     Licensed under the Apache License, Version 2.0 (the "License");
7     you may not use this file except in compliance with the License.
8     You may obtain a copy of the License at
9
10          http://www.apache.org/licenses/LICENSE-2.0
11
12     Unless required by applicable law or agreed to in writing, software
13     distributed under the License is distributed on an "AS IS" BASIS,
14     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15     See the License for the specific language governing permissions and
16     limitations under the License.
17-->
18<head>
19  <!-- automatically generated from html.mako. do NOT edit directly -->
20  <meta charset="utf-8" />
21  <title>Android Camera HAL3.4 Properties</title>
22  <style type="text/css">
23     body { background-color: #f7f7f7; font-family: Roboto, sans-serif;}
24     h1 { color: #333333; }
25     h2 { color: #333333; }
26     a:link { color: #258aaf; text-decoration: none}
27     a:hover { color: #459aaf; text-decoration: underline }
28     a:visited { color: #154a5f; text-decoration: none}
29    .section { color: #eeeeee; font-size: 1.5em; font-weight: bold; background-color: #888888; padding: 0.5em 0em 0.5em 0.5em; border-width: thick thin thin thin; border-color: #111111 #777777 #777777 #777777}
30    .kind { color: #eeeeee; font-size: 1.2em; font-weight: bold; padding-left: 1.5em; background-color: #aaaaaa }
31    .entry { background-color: #f0f0f0 }
32    .entry_cont { background-color: #f0f0f0 }
33    .entries_header { background-color: #dddddd; text-align: center}
34
35    /* toc style */
36    .toc_section_header { font-size:1.3em;  }
37    .toc_kind_header { font-size:1.2em;  }
38    .toc_deprecated { text-decoration:line-through; }
39
40    /* table column sizes */
41    table { border-collapse:collapse; table-layout: fixed; width: 100%; word-wrap: break-word }
42    td,th { border: 1px solid; border-color: #aaaaaa; padding-left: 0.5em; padding-right: 0.5em }
43    .th_name { width: 20% }
44    .th_units { width: 10% }
45    .th_tags { width: 5% }
46    .th_details { width: 25% }
47    .th_type { width: 17% }
48    .th_description { width: 20% }
49    .th_range { width: 8% }
50    .th_hal_version { width: 5% }
51    td { font-size: 0.9em; }
52
53    /* hide the first thead, we need it there only to enforce column sizes */
54    .thead_dummy { visibility: hidden; }
55
56    /* Entry flair */
57    .entry_name { color: #333333; padding-left:1.0em; font-size:1.1em; font-family: monospace; vertical-align:top; }
58    .entry_name_deprecated { text-decoration:line-through; }
59
60    /* Entry type flair */
61    .entry_type_name { font-size:1.1em; color: #669900; font-weight: bold;}
62    .entry_type_name_enum:after { color: #669900; font-weight: bold; content:" (enum)" }
63    .entry_type_visibility { font-weight: bolder; padding-left:1em}
64    .entry_type_synthetic { font-weight: bolder; color: #996600; }
65    .entry_type_hwlevel { font-weight: bolder; color: #000066; }
66    .entry_type_deprecated { font-weight: bolder; color: #4D4D4D; }
67    .entry_type_enum_name { font-family: monospace; font-weight: bolder; }
68    .entry_type_enum_notes:before { content:" - " }
69    .entry_type_enum_notes>p:first-child { display:inline; }
70    .entry_type_enum_value:before { content:" = " }
71    .entry_type_enum_value { font-family: monospace; }
72    .entry ul { margin: 0 0 0 0; list-style-position: inside; padding-left: 0.5em; }
73    .entry ul li { padding: 0 0 0 0; margin: 0 0 0 0;}
74    .entry_range_deprecated { font-weight: bolder; }
75
76    /* Entry tags flair */
77    .entry_tags ul { list-style-type: none; }
78
79    /* Entry details (full docs) flair */
80    .entry_details_header { font-weight: bold; background-color: #dddddd;
81      text-align: center; font-size: 1.1em; margin-left: 0em; margin-right: 0em; }
82
83    /* Entry spacer flair */
84    .entry_spacer { background-color: transparent; border-style: none; height: 0.5em; }
85
86    /* TODO: generate abbr element for each tag link? */
87    /* TODO for each x.y.z try to link it to the entry */
88
89  </style>
90
91  <style>
92
93    {
94      /* broken...
95         supposedly there is a bug in chrome that it lays out tables before
96         it knows its being printed, so the page-break-* styles are ignored
97         */
98        tr { page-break-after: always; page-break-inside: avoid; }
99    }
100
101  </style>
102</head>
103
104<%!
105  import re
106  from metadata_helpers import md
107  from metadata_helpers import IMAGE_SRC_METADATA
108  from metadata_helpers import filter_tags
109  from metadata_helpers import filter_links
110  from metadata_helpers import wbr
111
112  # insert line breaks after every two \n\n
113  def br(text):
114    return re.sub(r"(\r?\n)(\r?\n)", r"\1<br>\2<br>", text)
115
116  # Convert node name "x.y.z" of kind w to an HTML anchor of form
117  # <a href="#w_x.y.z">x.y.z</a>
118  def html_anchor(node):
119    return '<a href="#%s_%s">%s</a>' % (node.kind, node.name, node.name)
120
121  # Convert target "xxx.yyy#zzz" to a HTML reference to Android public developer
122  # docs with link name from shortname.
123  def html_link(target, target_ndk, shortname):
124    if shortname == '':
125      lastdot = target.rfind('.')
126      if lastdot == -1:
127        shortname = target
128      else:
129        shortname = target[lastdot + 1:]
130
131    target = target.replace('.','/')
132    if target.find('#') != -1:
133      target = target.replace('#','.html#')
134    else:
135      target = target + '.html'
136
137    return '<a href="https://developer.android.com/reference/%s">%s</a>' % (target, shortname)
138
139  # Render as markdown, and do HTML-doc-specific rewrites
140  def md_html(text):
141    return md(text, IMAGE_SRC_METADATA)
142
143  # linkify tag names such as "android.x.y.z" into html anchors
144  def linkify_tags(metadata):
145    def linkify_filter(text):
146      tagged_text = filter_tags(text, metadata, html_anchor)
147      return filter_links(tagged_text, html_link)
148    return linkify_filter
149
150  # Number of rows an entry will span
151  def entry_cols(prop):
152    cols = 1
153    if prop.details: cols = cols + 2
154    if prop.hal_details: cols = cols + 2
155    return cols
156%>
157
158<body>
159  <h1>Android Camera HAL3.2 Properties</h1>
160\
161<%def name="insert_toc_body(node)">
162  % for nested in node.namespaces:
163${    insert_toc_body(nested)}
164  % endfor
165  % for entry in node.merged_entries:
166            <li
167    % if entry.deprecated:
168                class="toc_deprecated"
169    % endif
170            >${html_anchor(entry)}</li>
171  % endfor
172</%def>
173
174  <h2>Table of Contents</h2>
175  <ul class="toc">
176    <li><a href="#tag_index" class="toc_section_header">Tags</a></li>
177% for root in metadata.outer_namespaces:
178  % for section in root.sections:
179    <li>
180      <span class="toc_section_header"><a href="#section_${section.name}">${section.name}</a></span>
181      <ul class="toc_section">
182      % for kind in section.merged_kinds: # dynamic,static,controls
183        <li>
184          <span class="toc_kind_header">${kind.name}</span>
185          <ul class="toc_section">\
186${          insert_toc_body(kind)}\
187          </ul>
188        </li>
189      % endfor
190      </ul> <!-- toc_section -->
191    </li>
192  % endfor
193% endfor
194  </ul>
195
196
197  <h1>Properties</h1>
198  <table class="properties">
199
200    <thead class="thead_dummy">
201      <tr>
202        <th class="th_name">Property Name</th>
203        <th class="th_type">Type</th>
204        <th class="th_description">Description</th>
205        <th class="th_units">Units</th>
206        <th class="th_range">Range</th>
207        <th class="th_hal_version">HIDL HAL version</th>
208        <th class="th_tags">Tags</th>
209      </tr>
210    </thead> <!-- so that the first occurrence of thead is not
211                         above the first occurrence of tr -->
212% for root in metadata.outer_namespaces:
213<!-- <namespace name="${root.name}"> -->
214  % for section in root.sections:
215  <tr><td colspan="7" id="section_${section.name}" class="section">${section.name}</td></tr>
216
217    % if section.description is not None:
218      <tr class="description"><td>${section.description}</td></tr>
219    % endif
220
221    % for kind in section.merged_kinds: # dynamic,static,controls
222      <tr><td colspan="7" class="kind">${kind.name}</td></tr>
223
224      <thead class="entries_header">
225        <tr>
226          <th class="th_name">Property Name</th>
227          <th class="th_type">Type</th>
228          <th class="th_description">Description</th>
229          <th class="th_units">Units</th>
230          <th class="th_range">Range</th>
231          <th class="th_hal_version">Initial HIDL HAL version</th>
232          <th class="th_tags">Tags</th>
233        </tr>
234      </thead>
235
236      <tbody>
237
238        <%def name="insert_body(node)">
239            % for nested in node.namespaces:
240                ${insert_namespace(nested)}
241            % endfor
242
243            % for entry in node.merged_entries:
244                ${insert_entry(entry)}
245            % endfor
246        </%def>
247
248        <%def name="insert_namespace(namespace)">
249            ${insert_body(namespace)}
250        </%def>
251
252        <%def name="insert_entry(prop)">
253          <tr class="entry" id="${prop.kind}_${prop.name}">
254            <td class="entry_name
255              % if prop.deprecated:
256                entry_name_deprecated
257              % endif
258             " rowspan="${entry_cols(prop)}">
259              ${prop.name | wbr}
260            </td>
261            <td class="entry_type">
262              % if prop.enum:
263                <span class="entry_type_name entry_type_name_enum">${prop.type}</span>
264              % else:
265                <span class="entry_type_name">${prop.type}</span>
266              % endif
267              % if prop.container is not None:
268                <span class="entry_type_container">x</span>
269              % endif
270
271              % if prop.container == 'array':
272                <span class="entry_type_array">
273                  ${" x ".join(prop.container_sizes)}
274                </span>
275              % elif prop.container == 'tuple':
276                <ul class="entry_type_tuple">
277                % for val in prop.tuple_values:
278                  <li>${val}</li>
279                % endfor
280                </ul>
281              % endif
282              <span class="entry_type_visibility"> [${prop.applied_visibility}${" as %s" %prop.typedef.name if prop.typedef else ""}]</span>
283
284              % if prop.synthetic:
285              <span class="entry_type_synthetic">[synthetic] </span>
286              % endif
287
288              % if prop.hwlevel:
289              <span class="entry_type_hwlevel">[${prop.hwlevel}] </span>
290              % endif
291
292              % if prop.deprecated:
293              <span class="entry_type_deprecated">[deprecated] </span>
294              % endif
295
296              % if prop.type_notes is not None:
297                <div class="entry_type_notes">${prop.type_notes | wbr}</div>
298              % endif
299
300              % if prop.enum:
301                <ul class="entry_type_enum">
302                  % for value in prop.enum.values:
303                  <li>
304                    <span class="entry_type_enum_name">${value.name} (v${value.hal_major_version}.${value.hal_minor_version})</span>
305                  % if value.deprecated:
306                    <span class="entry_type_enum_deprecated">[deprecated]</span>
307                  % endif:
308                  % if value.optional:
309                    <span class="entry_type_enum_optional">[optional]</span>
310                  % endif:
311                  % if value.hidden:
312                    <span class="entry_type_enum_hidden">[hidden]</span>
313                  % endif:
314                  % if value.id is not None:
315                    <span class="entry_type_enum_value">${value.id}</span>
316                  % endif
317                  % if value.notes is not None:
318                    <span class="entry_type_enum_notes">${value.notes | md_html, linkify_tags(metadata), wbr}</span>
319                  % endif
320                  </li>
321                  % endfor
322                </ul>
323              % endif
324
325            </td> <!-- entry_type -->
326
327            <td class="entry_description">
328            % if prop.description is not None:
329              ${prop.description | md_html, linkify_tags(metadata), wbr}
330            % endif
331            </td>
332
333            <td class="entry_units">
334            % if prop.units is not None:
335              ${prop.units | wbr}
336            % endif
337            </td>
338
339            <td class="entry_range">
340            % if prop.deprecated:
341              <p><span class="entry_range_deprecated">Deprecated</span>. Do not use.</p>
342            % endif
343            % if prop.range is not None:
344              ${prop.range | md_html, linkify_tags(metadata), wbr}
345            % endif
346            </td>
347
348            <td class="entry_hal_version">
349              ${"%d.%d" % (prop.hal_major_version, prop.hal_minor_version) | md_html, linkify_tags(metadata), wbr}
350            </td>
351
352            <td class="entry_tags">
353            % if next(prop.tags, None):
354              <ul class="entry_tags">
355              % for tag in prop.tags:
356                  <li><a href="#tag_${tag.id}">${tag.id}</a></li>
357              % endfor
358              </ul>
359            % endif
360            </td>
361
362          </tr>
363          % if prop.details is not None:
364          <tr class="entries_header">
365            <th class="th_details" colspan="6">Details</th>
366          </tr>
367          <tr class="entry_cont">
368            <td class="entry_details" colspan="6">
369              ${prop.details | md_html, linkify_tags(metadata), wbr}
370            </td>
371          </tr>
372          % endif
373
374          % if prop.hal_details is not None:
375          <tr class="entries_header">
376            <th class="th_details" colspan="6">HAL Implementation Details</th>
377          </tr>
378          <tr class="entry_cont">
379            <td class="entry_details" colspan="6">
380              ${prop.hal_details | md_html, linkify_tags(metadata), wbr}
381            </td>
382          </tr>
383          % endif
384
385          <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
386           <!-- end of entry -->
387        </%def>
388
389        ${insert_body(kind)}
390
391      <!-- end of kind -->
392      </tbody>
393    % endfor # for each kind
394
395  <!-- end of section -->
396  % endfor
397<!-- </namespace> -->
398% endfor
399  </table>
400
401  <div class="tags" id="tag_index">
402    <h2>Tags</h2>
403    <ul>
404    % for tag in metadata.tags:
405      <li id="tag_${tag.id}">${tag.id} - ${tag.description}
406        <ul class="tags_entries">
407        % for prop in tag.entries:
408          <li>${html_anchor(prop)} (${prop.kind})</li>
409        % endfor
410        </ul>
411      </li> <!-- tag_${tag.id} -->
412    % endfor
413    </ul>
414  </div>
415
416  [ <a href="#">top</a> ]
417
418</body>
419</html>
420