html.mako revision b8dc88148bca2e5a267c2ff39aff94b98b00ad6d
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.0 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    .entries_header { background-color: #dddddd; text-align: center}
33
34    /* toc style */
35    .toc_section_header { font-size:1.3em;  }
36    .toc_kind_header { font-size:1.2em;  }
37
38    /* table column sizes */
39    table { border-collapse:collapse; table-layout: fixed; width: 100%; word-wrap: break-word }
40    td,th { border: 1px solid; border-color: #aaaaaa; padding-left: 0.5em; padding-right: 0.5em }
41    .th_name { width: 20% }
42    .th_units { width: 10% }
43    .th_tags { width: 5% }
44    .th_notes { width: 25% }
45    .th_type { width: 20% }
46    .th_description { width: 20% }
47    .th_range { width: 10% }
48    td { font-size: 0.9em; }
49
50    /* hide the first thead, we need it there only to enforce column sizes */
51    .thead_dummy { visibility: hidden; }
52
53    /* Entry flair */
54    .entry_name { color: #333333; padding-left:1.0em; font-size:1.1em; font-family: monospace; }
55
56    /* Entry type flair */
57    .entry_type_name { font-size:1.1em; color: #669900; font-weight: bold;}
58    .entry_type_name_enum:after { color: #669900; font-weight: bold; content:" (enum)" }
59    .entry_type_visibility { font-weight: bolder; padding-left:1em}
60    .entry_type_enum_name { font-family: monospace; font-weight: bolder; }
61    .entry_type_enum_notes:before { content:" - " }
62    .entry_type_enum_value:before { content:" = " }
63    .entry_type_enum_value { font-family: monospace; }
64    .entry ul { margin: 0 0 0 0; list-style-position: inside; padding-left: 0.5em; }
65    .entry ul li { padding: 0 0 0 0; margin: 0 0 0 0;}
66
67    /* Entry visibility flair */
68
69    /* Entry tags flair */
70    .entry_tags ul { list-style-type: none; }
71
72
73    /* TODO: generate abbr element for each tag link? */
74    /* TODO for each x.y.z try to link it to the entry */
75
76  </style>
77
78  <style>
79
80    {
81      /* broken...
82         supposedly there is a bug in chrome that it lays out tables before
83         it knows its being printed, so the page-break-* styles are ignored
84         */
85        tr { page-break-after: always; page-break-inside: avoid; }
86    }
87
88  </style>
89</head>
90
91<%!
92  import re
93
94  # insert word break hints for the browser
95  def wbr(text):
96    new_txt = text
97
98    # for johnyOrange.appleCider.redGuardian also insert wbr before the caps
99    # => johny<wbr>Orange.apple<wbr>Cider.red<wbr>Guardian
100    for words in text.split(" "):
101      if len(words.split(".")) >= 3: # match only x.y.z
102        addwbr = lambda x: i.isupper() and ("<wbr>" + i) or i
103        new_word = "".join([addwbr(i) for i in words])
104        new_txt = new_txt.replace(words, new_word)
105
106    # e.g. X/Y/Z -> X/<wbr>Y/<wbr>/Z. also for X.Y.Z, X_Y_Z.
107    replace_chars=['.', '/', '_', ',']
108    for i in replace_chars:
109      new_txt = new_txt.replace(i, i + "<wbr>")
110
111    return new_txt
112
113  # insert line breaks after every two \n\n
114  def br(text):
115    return re.sub(r"(\r?\n)(\r?\n)", r"\1<br>\2<br>", text)
116%>
117
118<body>
119  <h1>Android Camera HAL3.0 Properties</h1>
120\
121<%def name="insert_toc_body(node)">
122  % for nested in node.namespaces:
123${    insert_toc_body(nested)}
124  % endfor
125  % for entry in node.merged_entries:
126            <li><a href="#${entry.kind}_${entry.name}">${entry.name}</a></li>
127  % endfor
128</%def>
129
130  <h2>Table of Contents</h2>
131  <ul class="toc">
132    <li><a href="#tag_index" class="toc_section_header">Tags</a></li>
133% for root in metadata.outer_namespaces:
134  % for section in root.sections:
135    <li>
136      <span class="toc_section_header"><a href="#section_${section.name}">${section.name}</a></span>
137      <ul class="toc_section">
138      % for kind in section.merged_kinds: # dynamic,static,controls
139        <li>
140          <span class="toc_kind_header">${kind.name}</span>
141          <ul class="toc_section">\
142${          insert_toc_body(kind)}\
143          </ul>
144        </li>
145      % endfor
146      </ul> <!-- toc_section -->
147    </li>
148  % endfor
149% endfor
150  </ul>
151
152
153  <h1>Properties</h1>
154  <table class="properties">
155
156    <thead class="thead_dummy">
157      <tr>
158        <th class="th_name">Property Name</th>
159        <th class="th_type">Type</th>
160        <th class="th_description">Description</th>
161        <th class="th_units">Units</th>
162        <th class="th_range">Range</th>
163        <th class="th_notes">Notes</th>
164        <th class="th_tags">Tags</th>
165      </tr>
166    </thead> <!-- so that the first occurrence of thead is not
167                         above the first occurrence of tr -->
168% for root in metadata.outer_namespaces:
169<!-- <namespace name="${root.name}"> -->
170  % for section in root.sections:
171  <tr><td colspan="7" id="section_${section.name}" class="section">${section.name}</td></tr>
172
173    % if section.description is not None:
174      <tr class="description"><td>${section.description}</td></tr>
175    % endif
176
177    % for kind in section.merged_kinds: # dynamic,static,controls
178      <tr><td colspan="7" class="kind">${kind.name}</td></tr>
179
180      <thead class="entries_header">
181        <tr>
182          <th class="th_name">Property Name</th>
183          <th class="th_type">Type</th>
184          <th class="th_description">Description</th>
185          <th class="th_units">Units</th>
186          <th class="th_range">Range</th>
187          <th class="th_notes">Notes</th>
188          <th class="th_tags">Tags</th>
189        </tr>
190      </thead>
191
192      <tbody>
193
194        <%def name="insert_body(node)">
195            % for nested in node.namespaces:
196                ${insert_namespace(nested)}
197            % endfor
198
199            % for entry in node.merged_entries:
200                ${insert_entry(entry)}
201            % endfor
202        </%def>
203
204        <%def name="insert_namespace(namespace)">
205            ${insert_body(namespace)}
206        </%def>
207
208        <%def name="insert_entry(prop)">
209        % if False: #prop.is_clone():
210            <clone entry="${prop.name}" kind="${prop.target_kind}">
211
212              % if prop.notes is not None:
213                <notes>${prop.notes | h,wbr}</notes>
214              % endif
215
216              % for tag in prop.tags:
217                <tag id="${tag.id}" />
218              % endfor
219
220            </clone>
221        % else:
222          <tr class="entry" id="${prop.kind}_${prop.name}">
223            <td class="entry_name">${prop.name | wbr}</td>
224            <td class="entry_type">
225              % if prop.enum:
226                <span class="entry_type_name entry_type_name_enum">${prop.type}</span>
227              % else:
228                <span class="entry_type_name">${prop.type}</span>
229              % endif
230              % if prop.container is not None:
231                <span class="entry_type_container">x</span>
232              % endif
233
234              % if prop.container == 'array':
235                <span class="entry_type_array">
236                  ${" x ".join(prop.container_sizes)}
237                </span>
238              % elif prop.container == 'tuple':
239                <ul class="entry_type_tuple">
240                % for val in prop.tuple_values:
241                  <li>${val}</li>
242                % endfor
243                </ul>
244              % endif
245              <span class="entry_type_visibility"> [${prop.applied_visibility}${" as %s" %prop.typedef.name if prop.typedef else ""}]</span>
246              % if prop.type_notes is not None:
247                <div class="entry_type_notes">${prop.type_notes | wbr}</div>
248              % endif
249
250              % if prop.enum:
251                <ul class="entry_type_enum">
252                  % for value in prop.enum.values:
253                  <li>
254                    <span class="entry_type_enum_name">${value.name}</span>
255                  % if value.optional:
256                    <span class="entry_type_enum_optional">optional</span>
257                  % endif:
258                  % if value.id is not None:
259                    <span class="entry_type_enum_value">${value.id}</span>
260                  % endif
261                  % if value.notes is not None:
262                    <span class="entry_type_enum_notes">${value.notes | wbr}</span>
263                  % endif
264                  </li>
265                  % endfor
266                </ul>
267              % endif
268
269            </td> <!-- entry_type -->
270
271            <td class="entry_description">
272            % if prop.description is not None:
273              ${prop.description | wbr, br}
274            % endif
275            </td>
276
277            <td class="entry_units">
278            % if prop.units is not None:
279              ${prop.units | wbr}
280            % endif
281            </td>
282
283            <td class="entry_range">
284            % if prop.range is not None:
285              ${prop.range | wbr}
286            % endif
287            </td>
288
289            <td class="entry_notes">
290            % if prop.notes is not None:
291              ${prop.notes | wbr, br}
292            % endif
293            </td>
294
295            <td class="entry_tags">
296            % if next(prop.tags, None):
297              <ul class="entry_tags">
298              % for tag in prop.tags:
299                  <li><a href="#tag_${tag.id}">${tag.id}</a></li>
300              % endfor
301              </ul>
302            % endif
303            </td>
304
305          </tr> <!-- end of entry -->
306        % endif
307        </%def>
308
309        ${insert_body(kind)}
310
311      <!-- end of kind -->
312      </tbody>
313    % endfor # for each kind
314
315  <!-- end of section -->
316  % endfor
317<!-- </namespace> -->
318% endfor
319  </table>
320
321  <div class="tags" id="tag_index">
322    <h2>Tags</h2>
323    <ul>
324    % for tag in metadata.tags:
325      <li id="tag_${tag.id}">${tag.id} - ${tag.description}
326        <ul class="tags_entries">
327        % for prop in tag.entries:
328          <li><a href="#${prop.kind}_${prop.name}">${prop.name}</a> (${prop.kind})</li>
329        % endfor
330        </ul>
331      </li> <!-- tag_${tag.id} -->
332    % endfor
333    </ul>
334  </div>
335
336  [ <a href="#">top</a> ]
337
338</body>
339</html>
340