Web page updated.
[jspeed] / www / theme-howto.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
2 \r
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fi">\r
4 \r
5 <head>\r
6 \r
7 <title>jSpeed - Theme howto</title>\r
8 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
9 <meta name="description" content="Make your own theme for jSpeed by following this easy howto." />
10 <meta name="keywords" content="theme,howto,themes,speedometer,jspeed,maemo" />
11 <meta name="robots" content="index, follow" />\r
12 <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>\r
13 <script type="text/javascript" src="fancybox/jquery.mousewheel-3.0.2.pack.js"></script>\r
14 <script type="text/javascript" src="fancybox/jquery.fancybox-1.3.1.js"></script>\r
15 <script type="text/javascript" src="js/script.js"></script>\r
16 <link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox-1.3.1.css" media="all" />\r
17 <link rel="stylesheet" href="css/style.css" media="all" type="text/css" />\r
18 \r
19 </head>\r
20         \r
21 <body>\r
22 \r
23 <ul id="mainmenu">\r
24         <li><a href="http://jspeed.garage.maemo.org/">Info</a></li>\r
25         <li><a href="#download">Download</a></li>\r
26         <li><a href="http://jspeed.garage.maemo.org/documentation.html">Documentation</a></li>\r
27         <li><a href="http://jspeed.garage.maemo.org/themes.html">Themes</a></li>\r
28         <li class="selected"><a href="http://jspeed.garage.maemo.org/theme-howto.html">Theme howto</a></li>\r
29 </ul>\r
30 \r
31 <div id="main">\r
32 \r
33 <div id="main-content">\r
34 \r
35 <h1>Theme howto</h1>\r
36 \r
37 <ul class="contents">\r
38         <li>\r
39                 <a href="#screens">Mainscreen and detailscreen tags</a>\r
40         </li>\r
41         <li>\r
42                 <a href="#tag-spec">Tag specification</a>\r
43                 <ul>\r
44                         <li>\r
45                                 <a href="#common-options">Common options</a>\r
46                                 <ul>\r
47                                         <li><a href="#effects">Effects</a></li>\r
48                                 </ul>\r
49                         </li>\r
50                         <li>\r
51                                 <a href="#tag-rectangle">Tag: rectangle</a>\r
52                         </li>\r
53                         <li>\r
54                                 <a href="#tag-image">Tag: image</a>\r
55                         </li>\r
56                         <li>\r
57                                 <a href="#tag-pointer">Tag: pointer</a>\r
58                         </li>\r
59                         <li>\r
60                                 <a href="#tag-compass">Tag: compass</a>\r
61                         </li>\r
62                         <li>\r
63                                 <a href="#tag-text">Tag: text</a>\r
64                         </li>\r
65                 </ul>\r
66         </li>\r
67 </ul>\r
68 \r
69 <p>jSpeed theme files (e.g. default.jspeed) are just <strong>regular zip-files</strong> renamed to .jspeed. The path for theme files is /home/user/.jspeed/themes.</p>\r
70 \r
71 <p>Each of these zip-files contains at least one file called theme.xml, which contains all the information required to draw the theme. Theme file may also contain image files and fonts required for the theme.</p> \r
72 \r
73 <p>A simple theme.xml could look like this:</p>\r
74 \r
75 <pre class="code">\r
76 &lt;theme&gt;\r
77         &lt;mainscreen orientation="landscape"&gt;\r
78                 &lt;text&gt;\r
79                         &lt;xpos&gt;100&lt;/xpos&gt;\r
80                         &lt;ypos&gt;100&lt;/ypos&gt;\r
81                         &lt;data&gt;{SPEED}&lt;/data&gt;\r
82                         &lt;size&gt;36&lt;/size&gt;\r
83                 &lt;/text&gt;\r
84         &lt;/mainscreen&gt;\r
85 &lt;/theme&gt;\r
86 </pre>\r
87 \r
88 <p>This would print the current speed on screen at position (100, 100) using default font and font size 36. This kind of theme would only work in landscape mode. If one would like the get the theme to also work in portrait mode, there should be another &lt;mainscreen&gt; tag with orientation="portrait" and maybe different positions for speed display.</p>\r
89 \r
90 <h2 id="screens">Mainscreen and detailscreen tags</h2>\r
91 \r
92 <p>Each theme.xml must contain at least one &lt;mainscreen&gt; tag like in the example above. jSpeed contains also a detail screen which automatically contains specific speed, time and trip data. The font color and background of this screen can be changed similarly using &lt;detailscreen&gt; tag. Detail screen can also be themed differently in portrait and landscape mode, or the same specification can apply to both portrait and landscape mode by setting attribute orientation="both" on detailscreen tag.</p>\r
93 \r
94 <p>Here's the source code of jSpeed's default theme. The specific explanation of all possible tags is below.</p>\r
95 \r
96 <pre class="code">\r
97 &lt;theme&gt; \r
98 &lt;detailscreen orientation="both" color="#fff"&gt;\r
99         &lt;image&gt;\r
100                 &lt;xpos&gt;0&lt;/xpos&gt;\r
101                 &lt;ypos&gt;0&lt;/ypos&gt;\r
102                 &lt;src&gt;background.png&lt;/src&gt;\r
103         &lt;/image&gt;\r
104 &lt;/detailscreen&gt;\r
105 &lt;mainscreen orientation="landscape"&gt;\r
106         &lt;image&gt;\r
107                 &lt;xpos&gt;0&lt;/xpos&gt;\r
108                 &lt;ypos&gt;0&lt;/ypos&gt;\r
109                 &lt;src&gt;background.png&lt;/src&gt;\r
110         &lt;/image&gt;\r
111         &lt;text&gt;\r
112                 &lt;data&gt;000&lt;/data&gt;\r
113                 &lt;font&gt;digital7.ttf&lt;/font&gt;\r
114                 &lt;size&gt;320&lt;/size&gt;\r
115                 &lt;xpos&gt;100&lt;/xpos&gt;\r
116                 &lt;ypos&gt;75&lt;/ypos&gt;\r
117                 &lt;color&gt;#17202b&lt;/color&gt;\r
118                 &lt;align&gt;right&lt;/align&gt;\r
119                 &lt;width&gt;600&lt;/width&gt;\r
120         &lt;/text&gt;\r
121         &lt;text&gt;\r
122                 &lt;data&gt;{SPEEDUNIT}&lt;/data&gt;\r
123                 &lt;xpos&gt;520&lt;/xpos&gt;\r
124                 &lt;ypos&gt;402&lt;/ypos&gt;\r
125                 &lt;font&gt;Nokia Sans Bold&lt;/font&gt;\r
126                 &lt;size&gt;24&lt;/size&gt;\r
127                 &lt;color&gt;#fff&lt;/color&gt;\r
128                 &lt;bold&gt;true&lt;/bold&gt;\r
129                 &lt;uppercase&gt;true&lt;/uppercase&gt;\r
130                 &lt;effect name="dropshadow"&gt;\r
131                         &lt;xoffset&gt;0&lt;/xoffset&gt;\r
132                         &lt;yoffset&gt;0&lt;/yoffset&gt;\r
133                         &lt;radius&gt;35&lt;/radius&gt;\r
134                         &lt;color&gt;#a5efff&lt;/color&gt;\r
135                 &lt;/effect&gt;\r
136         &lt;/text&gt;\r
137         &lt;text&gt;\r
138                 &lt;data&gt;{SPEED}&lt;/data&gt;\r
139                 &lt;font&gt;digital7.ttf&lt;/font&gt;\r
140                 &lt;size&gt;320&lt;/size&gt;\r
141                 &lt;xpos&gt;100&lt;/xpos&gt;\r
142                 &lt;ypos&gt;75&lt;/ypos&gt;\r
143                 &lt;color&gt;#fff&lt;/color&gt;\r
144                 &lt;align&gt;right&lt;/align&gt;\r
145                 &lt;width&gt;600&lt;/width&gt;\r
146                 &lt;format&gt;%.0f&lt;/format&gt;\r
147                 &lt;effect name="dropshadow"&gt;\r
148                         &lt;xoffset&gt;0&lt;/xoffset&gt;\r
149                         &lt;yoffset&gt;0&lt;/yoffset&gt;\r
150                         &lt;radius&gt;35&lt;/radius&gt;\r
151                         &lt;color&gt;#a5efff&lt;/color&gt;\r
152                 &lt;/effect&gt;\r
153         &lt;/text&gt;\r
154 &lt;/mainscreen&gt;\r
155 &lt;mainscreen orientation="portrait"&gt;\r
156         &lt;image&gt;\r
157                 &lt;xpos&gt;0&lt;/xpos&gt;\r
158                 &lt;ypos&gt;0&lt;/ypos&gt;\r
159                 &lt;src&gt;background.png&lt;/src&gt;\r
160         &lt;/image&gt;\r
161         &lt;text&gt;\r
162                 &lt;data&gt;000&lt;/data&gt;\r
163                 &lt;font&gt;digital7.ttf&lt;/font&gt;\r
164                 &lt;size&gt;250&lt;/size&gt;\r
165                 &lt;xpos&gt;0&lt;/xpos&gt;\r
166                 &lt;ypos&gt;260&lt;/ypos&gt;\r
167                 &lt;color&gt;#17202b&lt;/color&gt;\r
168                 &lt;align&gt;right&lt;/align&gt;\r
169                 &lt;width&gt;470&lt;/width&gt;\r
170         &lt;/text&gt;\r
171         &lt;text&gt;\r
172                 &lt;data&gt;{SPEEDUNIT}&lt;/data&gt;\r
173                 &lt;xpos&gt;330&lt;/xpos&gt;\r
174                 &lt;ypos&gt;522&lt;/ypos&gt;\r
175                 &lt;font&gt;Nokia Sans Bold&lt;/font&gt;\r
176                 &lt;size&gt;22&lt;/size&gt;\r
177                 &lt;color&gt;#fff&lt;/color&gt;\r
178                 &lt;bold&gt;true&lt;/bold&gt;\r
179                 &lt;uppercase&gt;true&lt;/uppercase&gt;\r
180                 &lt;effect name="dropshadow"&gt;\r
181                         &lt;xoffset&gt;0&lt;/xoffset&gt;\r
182                         &lt;yoffset&gt;0&lt;/yoffset&gt;\r
183                         &lt;radius&gt;35&lt;/radius&gt;\r
184                         &lt;color&gt;#a5efff&lt;/color&gt;\r
185                 &lt;/effect&gt;\r
186         &lt;/text&gt;\r
187         &lt;text&gt;\r
188         &lt;data&gt;{SPEED}&lt;/data&gt;\r
189                 &lt;font&gt;digital7.ttf&lt;/font&gt;\r
190                 &lt;size&gt;250&lt;/size&gt;\r
191                 &lt;xpos&gt;0&lt;/xpos&gt;\r
192                 &lt;ypos&gt;260&lt;/ypos&gt;\r
193                 &lt;color&gt;#fff&lt;/color&gt;\r
194                 &lt;align&gt;right&lt;/align&gt;\r
195                 &lt;width&gt;470&lt;/width&gt;\r
196                 &lt;format&gt;%.0f&lt;/format&gt;\r
197                 &lt;effect name="dropshadow"&gt;\r
198                         &lt;xoffset&gt;0&lt;/xoffset&gt;\r
199                         &lt;yoffset&gt;0&lt;/yoffset&gt;\r
200                         &lt;radius&gt;35&lt;/radius&gt;\r
201                         &lt;color&gt;#a5efff&lt;/color&gt;\r
202                 &lt;/effect&gt;\r
203         &lt;/text&gt;\r
204 &lt;/mainscreen&gt;\r
205 &lt;/theme&gt;\r
206 </pre>\r
207 \r
208 <h2 id="tag-spec">Tag specification</h2>\r
209 \r
210 <p>As you can see on the example above, each detailscreen and mainscreen tags consists of other tags that cause something to be drawn on the screen. Each tag contains specific options to alter its look.</p>\r
211 \r
212 <h3 id="common-options">Common options</h3>\r
213 \r
214 <p>Common options that work on all tags are listed below.</p>\r
215 \r
216 <table class="spec">\r
217 <tr class="color">\r
218         <th class="col1">Option</th>\r
219         <th>Definition</th>\r
220         <th class="col3">Example</th>\r
221 </tr>\r
222 <tr>\r
223         <td>xpos</td>\r
224         <td>Defines the x-position of an element in pixels</td>\r
225         <td><pre>&lt;xpos&gt;80&lt;/xpos&gt;</pre></td>\r
226 </tr>\r
227 <tr class="color">\r
228         <td>ypos</td>\r
229         <td>Defines the y-position of an element in pixels.</td>\r
230         <td><pre>&lt;ypos&gt;40&lt;/xpos&gt;</pre></td>\r
231 </tr>\r
232 <tr>\r
233         <td>zpos</td>\r
234         <td>Defines the z-index of an element. An element with bigger zpos gets painted over an element with smaller zpos.</td>\r
235         <td><pre>&lt;zpos&gt;5&lt;/xpos&gt;</pre></td>\r
236 </tr>\r
237 <tr>\r
238         <td>visiblewhen</td>\r
239         <td>Defines when element should be visible. Possible values are <strong>always</strong> (default), <strong>poivisible</strong> (show only when there is a poi (e.g. a speed camera) in view) and <strong>speedexceeded</strong> (show only when speed threshold is exceeded and speed alarm is enabled).</td>\r
240 </tr>\r
241 <tr class="color">\r
242         <td>effect</td>\r
243         <td>Defines an effect to used with the element. See <a href="#effects">effects</a> for more details.</td>\r
244         <td><pre>&lt;effect name="blur"&gt;\r
245         &lt;radius&gt;20&lt;/radius&gt;\r
246 &lt;/effect&gt;</pre></td>\r
247 </tr>\r
248 </table>\r
249 \r
250 <h4 id="effects">Effects</h4>\r
251 \r
252 <p>Each element can contain one effect which is used every time the element is painted or updated. <strong>Note: </strong>There are some bugs in effect redrawing in Qt especially on 24-bit png-images.</p>\r
253 \r
254 <table class="spec">\r
255 <tr class="color">\r
256         <th class="col1">Effect name</th>\r
257         <th>Possible options</th>\r
258         <th class="col3">Example</th>\r
259 </tr>\r
260 <tr>\r
261         <td>blur</td>\r
262         <td>\r
263                 <strong>radius: </strong>changes the blur radius. Bigger radius will cause the element to be blurred more.\r
264         </td>\r
265         <td><pre>&lt;effect name="blur"&gt;\r
266         &lt;radius&gt;20&lt;/radius&gt;\r
267 &lt;/effect&gt;</pre></td>\r
268 </tr>\r
269 <tr class="color">\r
270         <td>dropshadow</td>\r
271         <td>\r
272                 <strong>radius: </strong>changes the shadow radius. Bigger radius will cause the element to have bigger and more spread shadow.<br />\r
273                 <strong>color: </strong>sets the color of the shadow.<br />\r
274                 <strong>xoffset: </strong>shadow's x-distance from the element.<br />\r
275                 <strong>yoffset: </strong>shadow's y-distance from the element<br />\r
276         </td>\r
277         <td>\r
278                 <pre>&lt;effect name="dropshadow"&gt;\r
279         &lt;xoffset&gt;0&lt;/xoffset&gt;\r
280         &lt;yoffset&gt;0&lt;/yoffset&gt;\r
281         &lt;radius&gt;35&lt;/radius&gt;\r
282         &lt;color&gt;#a5efff&lt;/color&gt;\r
283 &lt;/effect&gt;</pre>\r
284         </td>\r
285 </tr>\r
286 <tr>\r
287         <td>opacity</td>\r
288         <td>\r
289                 <strong>opacity: </strong>sets the opacity of an element. Value of 1.0 means totally visible and value of 0.0 totally invisible.<br />\r
290         </td>\r
291         <td>\r
292                 <pre>&lt;effect name="opacity"&gt;\r
293         &lt;opacity&gt;0.8&lt;/opacity&gt;\r
294 &lt;/effect&gt;</pre>\r
295         </td>\r
296 </tr>\r
297 <tr>\r
298         <td>flicker</td>\r
299         <td>\r
300                 <strong>interval: </strong>sets the flickering interval of an element in milliseconds.<br />\r
301         </td>\r
302         <td>\r
303                 <pre>&lt;effect name="flicker"&gt;\r
304         &lt;interval&gt;500&lt;/interval&gt;\r
305 &lt;/effect&gt;</pre>\r
306         </td>\r
307 </tr>\r
308 </table>\r
309 \r
310 <h3 id="tag-rectangle">Tag: rectangle</h3>\r
311 \r
312 <p>Rectangle tag draws an rectangle with specified size and color on the screen. Possible options for rectangle are listed below.</p>\r
313 \r
314 <table class="spec">\r
315 <tr class="color">\r
316         <th class="col1">Option</th>\r
317         <th>Definition</th>\r
318         <th class="col3">Example</th>\r
319 </tr>\r
320 <tr>\r
321         <td>width</td>\r
322         <td>Defines the width of the rectangle.</td>\r
323         <td><pre>&lt;width&gt;600&lt;/width&gt;</pre></td>\r
324 </tr>\r
325 <tr class="color">\r
326         <td>height</td>\r
327         <td>Defines the height of the rectangle.</td>\r
328         <td><pre>&lt;height&gt;400&lt;/height&gt;</pre></td>\r
329 </tr>\r
330 <tr>\r
331         <td>color</td>\r
332         <td>Defines color of the rectangle. Color must be in hexadecimal form.</td>\r
333         <td><pre>&lt;color&gt;#2e94b5&lt;/color&gt;</pre></td>\r
334 </tr>\r
335 </table>\r
336 \r
337 <p>Example:</p>\r
338 \r
339 <pre class="code">\r
340 &lt;rectangle&gt;\r
341         &lt;xpos&gt;100&lt;/xpos&gt;\r
342         &lt;ypos&gt;100&lt;/ypos&gt;\r
343         &lt;width&gt;300&lt;/width&gt;\r
344         &lt;height&gt;200&lt;/height&gt;\r
345         &lt;color&gt;#fff&lt;/color&gt;\r
346 &lt;/rectangle&gt;\r
347 </pre>\r
348 \r
349 \r
350 \r
351 <h3 id="tag-image">Tag: image</h3>\r
352 \r
353 <p>Draws an image on specific location on the screen. The image file should be placed in the same .jspeed file as theme.xml.</p>\r
354 \r
355 <table class="spec">\r
356 <tr class="color">\r
357         <th class="col1">Option</th>\r
358         <th>Definition</th>\r
359         <th class="col3">Example</th>\r
360 </tr>\r
361 <tr>\r
362         <td>width</td>\r
363         <td>Image is resized to this width. If width is set to 0, it is calculated automatically from height to constrain proportions. If both width and height are set to 0 or are not set at all, the image will be painted in its original size.</td>\r
364         <td><pre>&lt;width&gt;600&lt;/width&gt;</pre></td>\r
365 </tr>\r
366 <tr class="color">\r
367         <td>height</td>\r
368         <td>Image is resized to this width. If height is set to 0, it is calculated automatically from width to constrain proportions.</td>\r
369         <td><pre>&lt;height&gt;400&lt;/height&gt;</pre></td>\r
370 </tr>\r
371 </table>\r
372 \r
373 <p>Example:</p>\r
374 \r
375 <pre class="code">\r
376 &lt;image&gt;\r
377         &lt;xpos&gt;100&lt;/xpos&gt;\r
378         &lt;ypos&gt;100&lt;/ypos&gt;\r
379         &lt;width&gt;300&lt;/width&gt;\r
380 &lt;/image&gt;\r
381 </pre>\r
382 \r
383 \r
384 <p>Another example, shows a flickering speed camera warning image when there is a speed camera in view.</p>\r
385 \r
386 <pre class="code">\r
387 &lt;image&gt;\r
388         &lt;src&gt;speedcamera.png&lt;/src&gt;\r
389         &lt;xpos&gt;15&lt;/xpos&gt;\r
390         &lt;ypos&gt;50&lt;/ypos&gt;\r
391         &lt;visiblewhen&gt;poisivible&lt;/visiblewhen&gt;\r
392         &lt;effect name="flicker"&gt;\r
393                 &lt;interval&gt;400&lt;/interval&gt;\r
394         &lt;/effect&gt;\r
395 &lt;/image&gt;\r
396 </pre>\r
397 \r
398 <p>Images in theme files should be saved in 256 colors because the dithering in Qt/Maemo is not very good. You can do that in example in <a href="http://www.irfanview.com/">IrfanView</a> by selecting Image -> Decrease color depth. Just make sure that "Use Floyd-Steinberg dithering" is selected. Although 256 colors may not sound much, it is enough for most of the images. Here's the difference between gradient at 16.7 million colors and 256 colors on the N900's screen:</p>\r
399 \r
400 <div class="imageinfo">\r
401 <img src="img/16M.png" alt="16.7 Million colors" />\r
402 <p>16.7 million colors</p>\r
403 </div>\r
404 \r
405 <div class="imageinfo">\r
406 <img src="img/256.png" alt="256 colors" />\r
407 <p>256 colors</p>\r
408 </div>\r
409 \r
410 \r
411 \r
412 <h3 id="tag-pointer" class="clear">Tag: pointer</h3>\r
413 \r
414 <p>Draws a pointer which moves according to current speed. Can be used to draw analog speedometers. The image file should be placed in the same .jspeed file as theme.xml. The xpos and ypos of a pointer are specified as the rotation point of the pointer on screen (usually somewhere in the middle of the screen).</p>\r
415 \r
416 <table class="spec">\r
417 <tr class="color">\r
418         <th class="col1">Option</th>\r
419         <th>Definition</th>\r
420         <th class="col3">Example</th>\r
421 </tr>\r
422 <tr>\r
423         <td>src</td>\r
424         <td>The image file used to draw the pointer.</td>\r
425         <td><pre>&lt;src&gt;pointer.png&lt;/src&gt;</pre></td>\r
426 </tr>\r
427 <tr class="color">\r
428         <td>zerospeed</td>\r
429         <td>The minimum speed in km/h of a pointer (usually 0).</td>\r
430         <td><pre>&lt;zerospeed&gt;0&lt;/zerospeed&gt;</pre></td>\r
431 </tr>\r
432 <tr>\r
433         <td>fullspeed</td>\r
434         <td>The maximum speed of a pointer in km/h. (usually the maximum speed value in analog speedometer).</td>\r
435         <td><pre>&lt;fullspeed&gt;220&lt;/fullspeed&gt;</pre></td>\r
436 </tr>\r
437 <tr class="color">\r
438         <td>zeroangle</td>\r
439         <td>When speed is at zerospeed or lower, the pointer is rotated this much in degress from its original state.</td>\r
440         <td><pre>&lt;zeroangle&gt;-30&lt;/zeroangle&gt;</pre></td>\r
441 </tr>\r
442 <tr>\r
443         <td>fullangle</td>\r
444         <td>When speed is at fullspeed or higher, the pointer is rotated this much in degress from its original state.</td>\r
445         <td><pre>&lt;fullangle&gt;210&lt;/fullangle&gt;</pre></td>\r
446 </tr>\r
447 <tr class="color">\r
448         <td>xrotationpoint</td>\r
449         <td>The pointer rotates around the point defined with xrotationpoint and yrotationpoint. It is usually located inside the pointer image.</td>\r
450         <td><pre>&lt;xrotationpoint&gt;200&lt;/xrotationpoint&gt;</pre></td>\r
451 </tr>\r
452 <tr>\r
453         <td>yrotationpoint</td>\r
454         <td>The pointer rotates around the point defined with xrotationpoint and yrotationpoint. It is usually located inside the pointer image.</td>\r
455         <td><pre>&lt;yrotationpoint&gt;12&lt;/yrotationpoint&gt;</pre></td>\r
456 </tr>\r
457 </table>\r
458 \r
459 <p>Example:</p>\r
460 \r
461 <pre class="code">\r
462 &lt;pointer&gt;\r
463         &lt;src&gt;pointer.png&lt;/src&gt;\r
464         &lt;zeroangle&gt;-20&lt;/zeroangle&gt;\r
465         &lt;fullangle&gt;210&lt;/fullangle&gt;\r
466         &lt;zerospeed&gt;0&lt;/zerospeed&gt;\r
467         &lt;fullspeed&gt;230&lt;/fullspeed&gt;\r
468         &lt;xpos&gt;400&lt;/xpos&gt;\r
469         &lt;ypos&gt;355&lt;/ypos&gt;\r
470         &lt;xrotationpoint&gt;278&lt;/xrotationpoint&gt;\r
471         &lt;yrotationpoint&gt;14&lt;/yrotationpoint&gt;\r
472 &lt;/pointer&gt;\r
473 </pre>\r
474 \r
475 \r
476 \r
477 <h3 id="tag-compass">Tag: compass</h3>\r
478 \r
479 <p>Draws a compass which is always rotated so that the top of the compass image points to north. The xpos and ypos of a pointer are specified as the rotation point of the compass on screen (usually somewhere in the middle of the screen).</p>\r
480 \r
481 <table class="spec">\r
482 <tr class="color">\r
483         <th class="col1">Option</th>\r
484         <th>Definition</th>\r
485         <th class="col3">Example</th>\r
486 </tr>\r
487 <tr>\r
488         <td>src</td>\r
489         <td>The image file used to draw the compass.</td>\r
490         <td><pre>&lt;src&gt;pointer.png&lt;/src&gt;</pre></td>\r
491 </tr>\r
492 <tr class="color">\r
493         <td>xrotationpoint</td>\r
494         <td>The compass rotates around the point defined with xrotationpoint and yrotationpoint. It is usually located inside the compass image.</td>\r
495         <td><pre>&lt;xrotationpoint&gt;200&lt;/xrotationpoint&gt;</pre></td>\r
496 </tr>\r
497 <tr>\r
498         <td>yrotationpoint</td>\r
499         <td>The compass rotates around the point defined with xrotationpoint and yrotationpoint. It is usually located inside the compass image.</td>\r
500         <td><pre>&lt;yrotationpoint&gt;12&lt;/yrotationpoint&gt;</pre></td>\r
501 </tr>\r
502 </table>\r
503 \r
504 <p>Example:</p>\r
505 \r
506 <pre class="code">\r
507 &lt;compass&gt;\r
508         &lt;src&gt;pointer.png&lt;/src&gt;\r
509         &lt;xpos&gt;400&lt;/xpos&gt;\r
510         &lt;ypos&gt;320&lt;/ypos&gt;\r
511         &lt;xrotationpoint&gt;100&lt;/xrotationpoint&gt;\r
512         &lt;yrotationpoint&gt;100&lt;/yrotationpoint&gt;\r
513 &lt;/compass&gt;\r
514 </pre>\r
515 \r
516 \r
517 \r
518 <h3 id="tag-text">Tag: text</h3>\r
519 \r
520 <p>Draws a text block on the screen.</p>\r
521 \r
522 <table class="spec">\r
523 <tr class="color">\r
524         <th class="col1">Option</th>\r
525         <th>Definition</th>\r
526         <th class="col3">Example</th>\r
527 </tr>\r
528 <tr>\r
529         <td>data</td>\r
530         <td>The actual textual data. Can be a plain text (e.g. "Speed:") or a special field (e.g. "{SPEED}"). Special fields are automatically updated to contain their value in unit which is specified in settings. Possible special fiels are listed below:<br/>\r
531         <strong>{TRIP}: </strong>Trip value.<br />\r
532         <strong>{TOTAL}: </strong>Total travelled kilometers or miles.<br />\r
533         <strong>{SPEED}: </strong>Current speed.<br />\r
534         <strong>{MAXSPEED}: </strong>Maximum speed.<br />\r
535         <strong>{AVGSPEED}: </strong>Average speed.<br />\r
536         <strong>{UNIT}: </strong>Distance unit (km or mi).<br />\r
537         <strong>{SPEEDUNIT}: </strong>Speed unit (km/h or mph).<br />\r
538         <strong>{TIME}: </strong>Current time, formatted according to timeformat tag.<br />\r
539         <strong>{DATE}: </strong>Current date, formatted according to dateformat tag.<br/>\r
540         <strong>{POIDISTANCE}: </strong>Distance to the nearest poi (e.g. speed camera). Empty if there is no poi in view<br />\r
541         <strong>{ANGLE}: </strong>Angle of current direction in degrees. 0 means north.<br />\r
542         <strong>{LATITUDE}: </strong>Current latitude.<br />\r
543         <strong>{LONGITUDE}: </strong>Current longitude.<br />\r
544         </td>\r
545         <td><pre>&lt;data&gt;{SPEED}&lt;/data&gt;</pre></td>\r
546 </tr>\r
547 <tr class="color">\r
548         <td>format</td>\r
549         <td>Special fields trip, total, speed, maxspeed, avgspeed, poidistance, angle, latitude and longitude will be printed according to this format. This field should be in <a href="http://en.wikipedia.org/wiki/Printf">prinf</a> format.</td>\r
550         <td><pre>&lt;format&gt;%.1f&lt;/format&gt;</pre></td>\r
551 </tr>\r
552 <tr>\r
553         <td>width</td>\r
554         <td>The width of the text block.</td>\r
555         <td><pre>&lt;width&gt;200&lt;/width&gt;</pre></td>\r
556 </tr>\r
557 <tr class="color">\r
558         <td>align</td>\r
559         <td>Text align inside the text block (left, center or right).</td>\r
560         <td><pre>&lt;align&gt;right&lt;/align&gt;</pre></td>\r
561 </tr>\r
562 <tr>\r
563         <td>color</td>\r
564         <td>Text color in hexadecimal form.</td>\r
565         <td><pre>&lt;color&gt;#000000&lt;/color&gt;</pre></td>\r
566 </tr>\r
567 <tr class="color">\r
568         <td>size</td>\r
569         <td>Text size in pixels.</td>\r
570         <td><pre>&lt;size&gt;20&lt;/size&gt;</pre></td>\r
571 </tr>\r
572 <tr>\r
573         <td>font</td>\r
574         <td>Text font. Can be a font file inside the theme file (e.g. "somefont.ttf") or a name of a font intalled in system (e.g. "Tahoma").</td>\r
575         <td><pre>&lt;font&gt;arial.ttf&lt;/font&gt;</pre></td>\r
576 </tr>\r
577 <tr class="color">\r
578         <td>bold</td>\r
579         <td>Sets <strong>bold</strong> text.</td>\r
580         <td><pre>&lt;bold&gt;true&lt;/bold&gt;</pre></td>\r
581 </tr>\r
582 <tr>\r
583         <td>italic</td>\r
584         <td>Sets <em>italic</em> text.</td>\r
585         <td><pre>&lt;italic&gt;true&lt;/italic&gt;</pre></td>\r
586 </tr>\r
587 <tr class="color">\r
588         <td>uppercase</td>\r
589         <td>Prints all letters in UPPERCASE.</td>\r
590         <td><pre>&lt;uppercase&gt;true&lt;/uppercase&gt;</pre></td>\r
591 </tr>\r
592 <tr>\r
593         <td>letterspacing</td>\r
594         <td>Sets the spacing between letters.</td>\r
595         <td><pre>&lt;letterspacing&gt;150&lt;/letterspacing&gt;</pre></td>\r
596 </tr>\r
597 <tr class="color">\r
598         <td>timeformat</td>\r
599         <td>Special field time will be printed according to this format. See <a href="http://doc.qt.nokia.com/4.6/qtime.html#toString">Qt QTime manual</a> for possible expressions.</td>\r
600         <td><pre>&lt;timeformat&gt;hh:mm&lt;/timeformat&gt;</pre></td>\r
601 </tr>\r
602 <tr>\r
603         <td>dateformat</td>\r
604         <td>Special field date will be printed according to this format. See <a href="http://doc.qt.nokia.com/4.6/qdate.html#toString">Qt QDate manual</a> for possible expressions.</td>\r
605         <td><pre>&lt;dateformat&gt;dd.MM.yyyy&lt;/dateformat&gt;</pre></td>\r
606 </tr>\r
607 </table>\r
608 \r
609 <p>Example:</p>\r
610 \r
611 <pre class="code">\r
612 &lt;text&gt;\r
613         &lt;data&gt;{SPEED}&lt;/data&gt;\r
614         &lt;font&gt;digital7.ttf&lt;/font&gt;\r
615         &lt;size&gt;320&lt;/size&gt;\r
616         &lt;xpos&gt;100&lt;/xpos&gt;\r
617         &lt;ypos&gt;75&lt;/ypos&gt;\r
618         &lt;color&gt;#fff&lt;/color&gt;\r
619         &lt;align&gt;right&lt;/align&gt;\r
620         &lt;width&gt;600&lt;/width&gt;\r
621         &lt;format&gt;%.0f&lt;/format&gt;\r
622         &lt;effect name=&quot;dropshadow&quot;&gt;\r
623                 &lt;xoffset&gt;0&lt;/xoffset&gt;\r
624                 &lt;yoffset&gt;0&lt;/yoffset&gt;\r
625                 &lt;radius&gt;35&lt;/radius&gt;\r
626                 &lt;color&gt;#a5efff&lt;/color&gt;\r
627         &lt;/effect&gt;\r
628 &lt;/text&gt;\r
629 \r
630 </pre>\r
631 \r
632 <br class="clear" />\r
633 \r
634 </div>\r
635 \r
636 </div>\r
637 \r
638 <div id="bottom">\r
639 \r
640 <div id="bottom-content">\r
641 \r
642 <div class="bottom-box">\r
643 \r
644 <h3 id="download">Download</h3>\r
645 \r
646 <p>jSpeed can be downloaded from Maemo extras-devel repository.</p>\r
647 \r
648 </div>\r
649 \r
650 <div class="bottom-box">\r
651 \r
652 <h3>License</h3>\r
653 \r
654 <p>jSpeed is licensed under the terms of the <a href="http://www.gnu.org/licenses/gpl.txt">GNU General Public License</a>.</p>\r
655 \r
656 </div>\r
657 \r
658 <div class="bottom-box">\r
659 \r
660 <h3>Links</h3>\r
661 \r
662 <ul>\r
663         <li><a href="https://garage.maemo.org/projects/jspeed/">Project page</a></li>\r
664         <li><a href="http://maemo.org/packages/view/jspeed/">Package overview and changelog</a></li>\r
665         <li><a href="https://garage.maemo.org/tracker/?atid=6134&amp;group_id=1756&amp;func=browse">Bug tracker</a></li>\r
666 </ul>\r
667 \r
668 </div>\r
669 \r
670 <div id="copyright">\r
671 Copyright © 2010 Jesse Hakanen | <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#106;&#101;&#115;&#115;&#101;&#104;&#97;&#107;&#97;&#110;&#101;&#110;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;">Contact</a>\r
672 </div>\r
673 \r
674 </div>\r
675 \r
676 </div>\r
677 \r
678 </body>\r
679         \r
680 </html>