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