]> git.sesse.net Git - vlc/blob - doc/skins/skins2-howto.xml
skins2: update documentation with new features for vlc1.1 and vlc1.2
[vlc] / doc / skins / skins2-howto.xml
1 <?xml version="1.0" encoding="iso8859-1" ?>
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1//EN" "/usr/share/sgml/docbook/dtd/xml/4.1.2/docbookx.dtd">
3
4 <!-- vim: set ts=2 sts=2 sw=2 et -->
5
6 <article id="skin-creation-howto">
7
8 <articleinfo>
9
10 <title>HowTo create your own skin</title>
11
12 <copyright>
13 <year>2004-2010</year>
14 <holder>
15 the VideoLAN project
16 </holder>
17 </copyright>
18
19 <abstract>
20 <para>
21 Skin creation HowTo
22 </para>
23 </abstract>
24
25 <legalnotice>
26 <para>
27 Permission is granted to copy, distribute and/or
28 modify this document under the terms of the GNU General Public License
29 as published by the Free Software Foundation; either version 2 of the
30 License, or (at your option) any later version. The text of the license
31 can be found on <ulink url="http://www.gnu.org/copyleft/gpl.html">the GNU
32 website</ulink>.
33 </para>
34 </legalnotice>
35
36 <authorgroup>
37   <author>
38   <firstname>Olivier</firstname>
39   <surname>Teulière</surname>
40   </author>
41 </authorgroup>
42
43 <keywordset>
44     <keyword>VLC</keyword>
45     <keyword>Skin</keyword>
46     <keyword>XML</keyword>
47     <keyword>Bezier</keyword>
48 </keywordset>
49
50 </articleinfo>
51
52 <toc></toc>
53
54 <sect1><title>Basic principles</title>
55
56 <para>A skin (or theme, the two words have almost the same meaning) for VLC is made of:</para>
57
58 <itemizedlist>
59   <listitem><para>many PNG (Portable Network Graphics) files, for the images of the different states of the controls,</para></listitem>
60   <listitem><para>font files in the TTF (TrueType Font) format,</para></listitem>
61   <listitem><para>a XML file describing the logical structure of the skin (which bitmaps correspond to which controls, where to place buttons, sliders, and so on) and its behaviour (what happens when the user clicks on a button, etc.).</para></listitem>
62 </itemizedlist>
63
64 <para>Those of you who have already made skins for other software should have no
65 difficulty to understand how VLC skins work.</para>
66
67 </sect1>
68
69 <sect1>
70 <title>The bitmaps</title>
71
72 <para>Basically, you need one bitmap file (in PNG format) by state of control. For example, with a <link linkend="Image">Image</link> control you need 1 image, with a <link linkend="Button">Button</link> control you need 3 images (for the up, down and mouseover states). The same bitmap file can be used for many controls, using <link linkend="SubBitmap">sub-bitmaps</link>.</para>
73
74 <para>The PNG format allows setting a transparency mask, which will be used wherever the image needs to be displayed (only non-transparent parts will be drawn). In addition, you can also specify a transparency color in the XML file: the bitmap will be considered as transparent wherever this color appears in the bitmap file.</para>
75
76 <note><para>Both the transparency mask and the transparent color will be taken into acount, so if the transparency mask is correctly set in the bitmap file you need to choose a unused color for the transparency color.</para></note>
77
78 <note><para>Starting from VLC 0.8.5, it is not anymore necessary to use PNG format for the bitmap files: most common formats are supported. Using PNG format is still recommended, for compatibility with older VLC versions.</para></note>
79
80 </sect1>
81
82 <sect1>
83 <title>The XML file</title>
84
85 <para>XML is a markup language, like HTML. It won't be explained here any further, please use Google if you don't know what XML is. You'll see, it is rather easy to understand.</para>
86
87 <para>The XML file used for the VLC skins follows a predefined DTD. You can find this DTD <ulink url="http://git.videolan.org/gitweb.cgi?p=vlc.git;a=blob;f=share/skins2/skin.dtd;hb=HEAD">in VLC Git</ulink>, and its reading is strongly advised, since it contains the default values used for the parameters. A skin that does not follow the DTD with which VLC was compiled won't be loaded by VLC (and it might even crash it...).</para>
88
89 <para>For a better undestanding of what follows, you should have a look at the DTD <!--(the last version is available on <ulink url="FIXME">TODO</ulink>) -->and/or at an example of valid XML skin<!-- TODO: link to the current DTD -->.</para>
90
91 <para>OK, let's go for an enumeration of the different tags and their attributes:</para>
92
93 <sect2 id="Theme">
94   <title>Theme</title>
95   <para>Main tag, for global attributes</para>
96       <sect3 id="themeversion">
97       <title>version</title>
98       <para>Version of the DTD used when making the skin, such as "2.0" (you can find the version in the <!--TODO: link-->DTD itself). This number might be used in the future to provide a better backward compatibility with older skins.</para>
99       <para><emphasis>Required.</emphasis></para>
100     </sect3>
101     <sect3 id="themetooltipfont">
102       <title>tooltipfont</title>
103       <para>Identifiant of a <link linkend="Font">Font</link> or <link linkend="BitmapFont">BitmapFont</link>, used for the tooltips (beware that any character not present in a <link linkend="BitmapFont">BitmapFont</link> will be printed as a space, so will be invisible). The default value uses a font provided with VLC, so you don't need to provide it with your skin.</para>
104       <para>Default value: defaultfont</para>
105     </sect3>
106     <sect3 id="thememagnet">
107       <title>magnet</title>
108       <para>Allows to select the range of action (in pixels) of magnetism with borders of the screen: when the distance between the border of the screen and an anchor of a window is less than this value, the window will stick to the border. 0 disables magnetism with the screen borders.</para>
109       <para>Default value: 15</para>
110     </sect3>
111     <sect3 id="themealpha">
112       <title>alpha</title>
113       <para>Sets the alpha transparency of the windows. The value must be between 1 (nearly total transparency) and 255 (total opacity). Low values should be avoided.</para>
114 <note><para>This only works if transparency is not disabled in the preferences of the skins2 module.</para></note>
115       <para>Default value: 255</para>
116     </sect3>
117     <sect3 id="thememovealpha">
118       <title>movealpha</title>
119       <para>Sets the alpha transparency of the windows when they are moving. Same range as <link linkend="themealpha">alpha</link>.</para>
120       <note><para>This only works if transparency is not disabled in the preferences of the skins2 module.</para></note>
121       <para>Default value: 255</para>
122     </sect3>
123   </sect2>
124
125 <sect2 id="ThemeInfo">
126   <title>ThemeInfo</title>
127   <para>You can enter here some information about you (but this information is currently unused by VLC...)</para>
128       <sect3 id="themeinfoname">
129       <title>name</title>
130       <para>Skin name. Not supported yet.</para>
131       <para><emphasis>Implied.</emphasis></para>
132     </sect3>
133     <sect3 id="themeinfoauthor">
134       <title>author</title>
135       <para>Author of the skin. Not supported yet.</para>
136       <para><emphasis>Implied.</emphasis></para>
137     </sect3>
138     <sect3 id="themeinfoemail">
139       <title>email</title>
140       <para>Email of the author. Not supported yet.</para>
141       <para><emphasis>Implied.</emphasis></para>
142     </sect3>
143     <sect3 id="themeinfowebpage">
144       <title>webpage</title>
145       <para>Web page in relation with the skin. Not supported yet.</para>
146       <para>Default value: http://www.videolan.org/vlc/</para>
147     </sect3>
148 </sect2>
149
150 <sect2 id="Bitmap">
151   <title>Bitmap</title>
152   <para>Associates a bitmap file (usually in PNG format) with an identifiant (=name) that will be used by the various controls. Obviously, you need one Bitmap tag for each bitmap file you have.</para>
153   <sect3 id="bitmapid">
154     <title>id</title>
155     <para>Identifiant of the bitmap that will be used with controls. Two bitmaps cannot have the same id.</para>
156     <para><emphasis>Required.</emphasis></para>
157   </sect3>
158   <sect3 id="bitmapfile">
159     <title>file</title>
160     <para>Indicates the path and name of the bitmap file used. This path can be absolute (but you should definitely avoid it), or relative to the path of the XML file.</para>
161     <para><emphasis>Required.</emphasis></para>
162   </sect3>
163   <sect3 id="bitmapalphacolor">
164     <title>alphacolor</title>
165     <para>Transparency color of the bitmap. It must be indicated with the following format: "#RRGGBB", where RR stands for the hexadecimal value of the red component, GG for the green one, and BB for the blue one.</para>
166     <note><para>If your PNG file specifies a transparency mask, it will be taken into account too.</para></note>
167     <para>Default value: #000000</para><!--XXX: should we change it into a less often used color?-->
168   </sect3>
169   <sect3 id="bitmapnbframes">
170     <title>nbframes</title>
171     <para>This attribute is needed to define animated bitmaps; it is the number of frames (images) contained in your animation. All the different frames are just images laid vertically in the bitmap. Animated GIFs are not supported at the moment. (since VLC 0.8.5)</para>
172     <para>Default value: 1</para>
173   </sect3>
174   <sect3 id="bitmapfps">
175     <title>fps</title>
176     <para>Only used in animated bitmaps; it is the number of frames (images) per seconds of the animation. (since VLC 0.8.5)</para>
177     <para>Default value: 0</para>
178   </sect3>
179   <sect3 id="bitmaploop">
180     <title>loop</title>
181     <para>Only used in animated bitmaps; it is the number of loops before animation stops. Default value 0 means animation doesn't stop. Otherwise, animation stops on the last frame after the number of loops has been reached (since VLC 1.1)</para>
182     <para>Default value: 0</para>
183   </sect3>
184
185 </sect2>
186
187 <sect2 id="SubBitmap">
188   <title>SubBitmap</title>
189   <para>Declares a portion of bitmap, that will be used with controls in the same way as a regular Bitmap. A SubBitmap tag can only be placed inside a <link linkend="Bitmap">Bitmap</link> tag, and references implicitly the same file. SubBitmaps are very convenient when a file contains images for several controls. (This tag was not available before VLC 0.8.5).</para>
190   <sect3 id="subbitmapid">
191     <title>id</title>
192     <para>Identifiant of the portion of bitmap that will be used with controls. It must be unique in the whole skin.</para>
193     <para><emphasis>Required.</emphasis></para>
194   </sect3>
195   <sect3 id="subbitmapx">
196     <title>x</title>
197     <para>Horizontal offset of the sub-bitmap (in pixels), relative to the "parent" bitmap.</para>
198     <para><emphasis>Required.</emphasis></para>
199   </sect3>
200   <sect3 id="subbitmapy">
201     <title>y</title>
202     <para>Vertical offset of the sub-bitmap (in pixels), relative to the "parent" bitmap.</para>
203     <para><emphasis>Required.</emphasis></para>
204   </sect3>
205   <sect3 id="subbitmapwidth">
206     <title>width</title>
207     <para>Width of the sub-bitmap, in pixels.</para>
208     <para><emphasis>Required.</emphasis></para>
209   </sect3>
210   <sect3 id="subbitmapheight">
211     <title>height</title>
212     <para>Height of the SubBitmap, in pixels.</para>
213     <para><emphasis>Required.</emphasis></para>
214   </sect3>
215   <sect3 id="subbitmapnbframes">
216     <title>nbframes</title>
217     <para>Same as in <link linkend="bitmapnbframes">Bitmap</link> tag.</para>
218     <para>Default value: 1</para>
219   </sect3>
220   <sect3 id="subbitmapfps">
221     <title>fps</title>
222     <para>Same as in <link linkend="bitmapfps">Bitmap</link> tag.</para>
223   </sect3>
224   <sect3 id="subbitmaploop">
225     <title>loop</title>
226     <para>Same as in <link linkend="bitmaploop">Bitmap</link> tag.</para>
227   </sect3>
228
229 </sect2>
230
231 <sect2 id="Font">
232   <title>Font</title>
233   <para>Declares a font to be used in a <link linkend="Text">Text</link> or <link linkend="Playtree">Playtree</link>.</para>
234   <sect3 id="fontid">
235     <title>id</title>
236     <para>Identifiant of the font that will be used with controls.</para>
237     <para><emphasis>Required.</emphasis></para>
238   </sect3>
239   <sect3 id="fontfile">
240     <title>file</title>
241     <para>This is the file containing a TrueType font.</para>
242     <para><emphasis>Required.</emphasis></para>
243   </sect3>
244   <sect3 id="fontsize">
245     <title>size</title>
246     <para>This is the size of the font, in points.</para>
247     <para>Default value: 12</para>
248   </sect3>
249 </sect2>
250
251 <sect2 id="BitmapFont">
252   <title>BitmapFont</title>
253   <para><!--TODO--></para>
254   <sect3 id="bitmapfontid">
255     <title>id</title>
256     <para>Identifiant of the font that will be used with controls.</para>
257     <para><emphasis>Required.</emphasis></para>
258   </sect3>
259   <sect3 id="bitmapfontfile">
260     <title>file</title>
261     <para>This is the file containing a bitmap font, Ã  la Winamp.</para>
262     <para><emphasis>Required.</emphasis></para>
263   </sect3>
264   <sect3 id="bitmapfonttype">
265     <title>type</title>
266     <para>Type of font, one of "digits" or "text".</para>
267     <para>Default value: digits</para>
268   </sect3>
269 </sect2>
270
271 <sect2 id="Window">
272   <title>Window</title>
273   <para>A window that will appear on screen.</para>
274   <sect3 id="windowid">
275     <title>id</title>
276     <para>Name of the window (it may be used for actions). Two windows cannot have the same id.</para>
277     <para>Default value: none</para>
278     <para>As of vlc1.1, a special id has been added to provide a skinnable fullscreen controller. This value id="fullscreenController" allows the window to be displayed only in fullscreen mode. Display is toggled by pressing the 'i' hotkey or clicking the mouse middle button</para>
279   </sect3>
280   <sect3 id="windowvisible">
281     <title>visible</title>
282     <para>Indicates whether the window should appear when VLC is started. Since VLC remembers the skin windows position and visibility, this attribute will only be used the first time the skin is started.</para>
283     <para>Default value: true</para>
284   </sect3>
285   <sect3 id="windowx">
286     <title>x</title>
287     <para>Initial left position of the window.</para>
288     <para>Default value: 0</para>
289   </sect3>
290   <sect3 id="windowy">
291     <title>y</title>
292     <para>Initial top position of the window.</para>
293     <para>Default value: 0</para>
294   </sect3>
295   <sect3 id="windowdragdrop">
296     <title>dragdrop</title>
297     <para>Indicates whether drag and drop of media files is allowed on this window.</para>
298     <para>Default value: true</para>
299   </sect3>
300   <sect3 id="windowplayondrop">
301     <title>playondrop</title>
302     <para>Indicates whether a dropped file is played directly (true) or only enqueued (false). This attribute has no effect if <link linkend="windowdragdrop">dragdrop</link> is set to "false".</para>
303     <para>Default value: true</para>
304   </sect3>
305 </sect2>
306
307 <sect2 id="Layout">
308   <title>Layout</title>
309   <para>A layout is one aspect of a window, i.e. a set of controls and anchors. A window can have many layouts, but only one will be visible at any time.</para>
310   <sect3 id="layoutid">
311     <title>id</title>
312     <para>Name of the layout (it may be used for actions). Two layouts cannot have the same id.</para>
313     <para>Default value: none</para>
314   </sect3>
315   <sect3 id="layoutwidth">
316     <title>width</title>
317     <para><!--TODO: calculate it in VLC :)-->Initial width of the layout. This value is required since VLC is not (yet?) able to calculate it using the sizes and positions of the controls.</para>
318     <para><emphasis>Required.</emphasis></para>
319   </sect3>
320   <sect3 id="layoutheight">
321     <title>height</title>
322     <para><!--TODO: calculate it in VLC :)-->Initial height of the layout. This value is required since VLC is not (yet?) able to calculate it using the sizes and positions of the controls.</para>
323     <para><emphasis>Required.</emphasis></para>
324   </sect3>
325   <sect3 id="minwidth">
326     <title>minwidth</title>
327     <para>Minimum width of the layout. This value is only used when resizing the layout. If this value is set to "-1", the initial width (as specified by the <link linkend="layoutwidth">width</link> attribute) will be used as minimum width.</para>
328     <para>Default value: -1</para>
329   </sect3>
330   <sect3 id="maxwidth">
331     <title>maxwidth</title>
332     <para>Maximum width of the layout. This value is only used when resizing the layout. If this value is set to "-1", the initial width (as specified by the <link linkend="layoutwidth">width</link> attribute) will be used as maximum width.</para>
333     <para>Default value: -1</para>
334   </sect3>
335   <sect3 id="minheight">
336     <title>minheight</title>
337     <para>Minimum height of the layout. This value is only used when resizing the layout. If this value is set to "-1", the initial height (as specified by the <link linkend="layoutheight">height</link> attribute) will be used as minimum height.</para>
338     <para>Default value: -1</para>
339   </sect3>
340   <sect3 id="maxheight">
341     <title>maxheight</title>
342     <para>Maximum height of the layout. This value is only used when resizing the layout. If this value is set to "-1", the initial height (as specified by the <link linkend="layoutheight">height</link> attribute) will be used as maximum height.</para>
343     <para>Default value: -1</para>
344   </sect3>
345 </sect2>
346
347 <sect2 id="Group">
348   <title>Group</title>
349   <para>Add an offset to the elements it contains. A Group is only supposed to ease the job of the skin designer, who can adjust the position of a group of controls without modifying all the coordinates, but you can ignore it if you want (only one Group is necessary, inside the <link linkend="Layout">Layout</link> tag). Group tags can be nested. Note that Group elements are deprecated, since <link linkend="Panel">Panel</link> elements are more powerful.</para>
350   <sect3 id="groupx">
351     <title>x</title>
352     <para>Horizontal offset, relative to the container box (see the <link linkend="layoutmodel">Layout model</link> for more details).</para>
353     <para>Default value: 0</para>
354   </sect3>
355   <sect3 id="groupy">
356     <title>y</title>
357     <para>Vertical offset, relative to the container box (see the <link linkend="layoutmodel">Layout model</link> for more details).</para>
358     <para>Default value: 0</para>
359   </sect3>
360 </sect2>
361
362 <sect2 id="Panel">
363   <title>Panel</title>
364   <para>A Panel can be seen as an enhanced <link linkend="Layout">Group</link>. It also adds an offset to the elements it contains, but in addition it becomes their reference for the lefttop, rightbottom, xkeepratio and ykeepratio attributes. Panel tags can be nested. Since VLC 0.9.0.</para>
365   <para>See the <link linkend="commattr">common attributes</link>.</para>
366   <sect3 id="panelx">
367     <title>x</title>
368     <para>Same as the <link linkend="x">x</link> attribute of the <link linkend="commattr">common attributes</link>.</para>
369   </sect3>
370   <sect3 id="panely">
371     <title>y</title>
372     <para>Same as the <link linkend="y">y</link> attribute of the <link linkend="commattr">common attributes</link>.</para>
373   </sect3>
374   <sect3 id="panelwidth">
375     <title>width</title>
376     <para>Initial width of this container box (see the <link linkend="layoutmodel">Layout model</link> for more details).</para>
377     <para><emphasis>Required.</emphasis></para>
378   </sect3>
379   <sect3 id="panelheight">
380     <title>height</title>
381     <para>Initial height of this container box (see the <link linkend="layoutmodel">Layout model</link> for more details).</para>
382     <para><emphasis>Required.</emphasis></para>
383   </sect3>
384   <sect3 id="panellefttop">
385     <title>lefttop</title>
386     <para>Same as the <link linkend="lefttop">lefttop</link> attribute of the <link linkend="commattr">common attributes</link>.</para>
387   </sect3>
388   <sect3 id="panelrightbottom">
389     <title>rightbottom</title>
390     <para>Same as the <link linkend="rightbottom">rightbottom</link> attribute of the <link linkend="commattr">common attributes</link>.</para>
391   </sect3>
392   <sect3 id="panelxkeepratio">
393     <title>xkeepratio</title>
394     <para>Same as the <link linkend="xkeepratio">xkeepratio</link> attribute of the <link linkend="commattr">common attributes</link>.</para>
395   </sect3>
396   <sect3 id="panelykeepratio">
397     <title>ykeepratio</title>
398     <para>Same as the <link linkend="ykeepratio">ykeepratio</link> attribute of the <link linkend="commattr">common attributes</link>.</para>
399   </sect3>
400 </sect2>
401
402 <sect2 id="Anchor">
403   <title>Anchor</title>
404   <para>Create a "magnetic point" (or curve) in the current window. If an anchor of another window enters in the range of action of this anchor, the 2 anchors will automatically be on the same place, and the windows are "sticked". Each anchor has a priority (<link linkend="anchorpriority">priority</link> attribute), and the anchor with the highest priority is the winner, which means that when moving its window all the other anchored windows will move too. To break the effect of 2 anchored windows, you need to move the window whose anchor has the lower priority.</para>
405   <sect3 id="anchorx">
406     <title>x</title>
407     <para>Is it really necessary to explain?</para>
408     <para>Default value: 0</para>
409   </sect3>
410   <sect3 id="anchory">
411     <title>y</title>
412     <para>...</para>
413     <para>Default value: 0</para>
414   </sect3>
415   <sect3 id="anchorlefttop">
416     <title>lefttop</title>
417     <para>Indicate to which corner of the Layout the top-left-hand corner of this anchor is attached, in case of resizing. Possible values are 'lefttop', 'leftbottom', 'righttop' and 'rightbottom'. Available since VLC 0.8.6.</para>
418     <para>Note that there is no "rightbottom" attribute for the anchors (contrarily to normal controls), because an anchor is not resizable (even when the anchor is not ponctual and follows a Bezier curve).</para>
419     <para>Default value: lefttop</para>
420   </sect3>
421   <sect3 id="anchorpriority">
422     <title>priority</title>
423     <para>Priority of anchor (see the previous description).</para>
424     <para><emphasis>Required.</emphasis></para>
425   </sect3>
426   <sect3 id="anchorpoints">
427     <title>points</title>
428     <para>Points defining the <link linkend="bezier">Bezier curve</link> followed by the anchor.</para>
429     <note><para>You don't need to change this parameter if all you want is a ponctual anchor.</para></note>
430     <para>Default value: (0,0)</para>
431   </sect3>
432   <sect3 id="anchorrange">
433     <title>range</title>
434     <para>Range of action of the anchor, in pixels.</para>
435     <para>Default value: 10</para>
436   </sect3>
437 </sect2>
438
439
440 <sect2 id="commattr">
441   <title>Common attributes</title>
442   <para>The following attributes are common to all the controls (Image, Button, Checkbox, Text, Slider, RadialSlider, Playlist, Playtree, Video)</para>
443   <sect3 id="attrid">
444     <title>id</title>
445     <para>Identifiant of the control. Currently unused.</para>
446     <para>Default value: none</para>
447   </sect3>
448   <sect3 id="visible">
449     <title>visible</title>
450     <para>See <link linkend="boolexpr">Boolean expressions</link>.</para>
451     <para>Default value: true</para>
452   </sect3>
453   <sect3 id="x">
454     <title>x</title>
455     <para>Horizontal offset of the control, relative to the container box (see the <link linkend="layoutmodel">Layout model</link>) or to the parent <link linkend="Group">Group</link>.</para>
456     <para>Default value: 0</para>
457   </sect3>
458   <sect3 id="y">
459     <title>y</title>
460     <para>Vertical offset of the control, relative to the container box (see the <link linkend="layoutmodel">Layout model</link>) or to the parent <link linkend="Group">Group</link>.</para>
461     <para>Default value: 0</para>
462   </sect3>
463   <sect3 id="lefttop">
464     <title>lefttop</title>
465     <para>Indicate to which corner of the container box the top-left-hand corner of this control is attached, in case of resizing. Possible values are 'lefttop', 'leftbottom', 'righttop' and 'rightbottom'. See the <link linkend="layoutmodel">Layout model</link> for more details.</para>
466     <para>Default value: lefttop</para>
467   </sect3>
468   <sect3 id="rightbottom">
469     <title>rightbottom</title>
470     <para>Indicate to which corner of the container box the bottom-right-hand corner of this control is attached, in case of resizing. See the <link linkend="layoutmodel">Layout model</link> for more details.</para>
471     <para>Default value: lefttop</para>
472   </sect3>
473   <sect3 id="xkeepratio">
474     <title>xkeepratio</title>
475     <para>When set to true, the behaviour of the horizontal resizing is changed. Instead of taking into account the <link linkend="lefttop">lefttop</link> and <link linkend="rightbottom">rightbottom</link> attributes to determine how the control will be moved/resized, only its initial position inside the container box matters. For example, if initially the space to the left of the control is twice as big as the one to its right, this will stay the same during any horizontal resizing. The width of the control stays constant.</para>
476     <para>This attribute can be particularly useful to keep a control centered in the container box, without resizing it (to resize it, you would rather use the lefttop/rightbottom attributes). See the <link linkend="layoutmodel">Layout model</link> for more details. Available since VLC 0.8.6.</para>
477     <para>Default value: false</para>
478   </sect3>
479   <sect3 id="ykeepratio">
480     <title>ykeepratio</title>
481     <para>When set to true, the behaviour of the vertical resizing is changed. Instead of taking into account the <link linkend="lefttop">lefttop</link> and <link linkend="rightbottom">rightbottom</link> attributes to determine how the control will be moved/resized, only its initial position inside the <link linkend="Layout">Layout</link> matters. For example, if initially the space to the top of the control is twice as big as the one to its bottom, this will stay the same during any vertical resizing. The height of the control stays constant.</para>
482     <para>This attribute can be particularly useful to keep a control centered in the container box, without resizing it (to resize it, you would rather use the lefttop/rightbottom attributes). See the <link linkend="layoutmodel">Layout model</link> for more details. Available since VLC 0.8.6.</para>
483     <para>Default value: false</para>
484   </sect3>
485   <sect3 id="help">
486     <title>help</title>
487     <para>Help text for the current control. The variable '$H' will be expanded to this value when the mouse hovers the current control (see <link linkend="textvars">Text variables</link>).</para>
488     <para>Default value: </para>
489   </sect3>
490 </sect2>
491
492 <sect2 id="Image">
493   <title>Image</title>
494   <para>Create a simple image. Particularly useful for backgrounds.</para>
495   <para>See the <link linkend="commattr">Common attributes</link>.</para>
496   <sect3 id="image">
497     <title>image</title>
498     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link>.</para>
499     <para><emphasis>Required.</emphasis></para>
500   </sect3>
501   <sect3 id="imageresize">
502     <title>resize</title>
503     <para>Since VLC 0.8.2. Specify the behaviour of the image when it is resized. Possible values are 'mosaic' (the image is repeated as many times as necessary to reach the wanted dimensions) and 'scale' (the image is actually rescaled). Beware that the 'scale' behaviour is much slower than the 'mosaic' one, so make sure to use it only when it's really needed.</para>
504     <para>In future VLC 1.2. a third value 'scale2' is available to scale an image, yet preserving its aspect ratio. The image is centered and scaled either heightwise or widthwise to fill up as much area as possible. Extra borders are made transparent.</para>
505     <para>Default value: mosaic.</para>
506   </sect3>
507   <sect3 id="imageaction">
508     <title>action</title>
509     <para>Action triggered by a click on the control. Possible values are 'move', to move the window, 'resizeE', to resize horizontally, 'resizeS' to resize vertically, and 'resizeSE' to resize both horizontally and vertically. Mnemonics: S, E and SE stand for South, East, and South-East. The 'resizeS' and 'resizeE' actions are available since VLC 0.8.5 only.</para>
510     <para>Default value: none</para>
511   </sect3>
512   <sect3 id="imageaction2">
513     <title>action2</title>
514     <para>Action triggered by a double-click on the control. See <link linkend="actions">Actions</link> for a list of possible actions. (Since VLC 0.8.5).</para>
515     <para>Default value: none</para>
516   </sect3>
517   <sect3 id="imageart">
518     <title>art</title>
519     <para>if set to true, the skin engine reuses the control to display the art file of the resource currently being played back. Usually, resize="scale2" is desirable, for art to be rendered in the best possible way. (in future VLC 1.2).</para>
520     <para>Default value: false</para>
521   </sect3>
522 </sect2>
523
524 <sect2 id="Button">
525   <title>Button</title>
526   <para>Create a button.</para>
527   <para>See the <link linkend="commattr">common attributes</link>.</para>
528   <sect3 id="buttonup">
529     <title>up</title>
530     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link>, used when the button is up.</para>
531     <para><emphasis>Required.</emphasis></para>
532   </sect3>
533   <sect3 id="buttondown">
534     <title>down</title>
535     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link>, used when the button is down.</para>
536     <para>Default value: none</para>
537   </sect3>
538   <sect3 id="buttonover">
539     <title>over</title>
540     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link>, used when the mouse is over the button.</para>
541     <para>Default value: none</para>
542   </sect3>
543   <sect3 id="buttonaction">
544     <title>action</title>
545     <para>Action executed when the button is clicked. See <link linkend="actions">Actions</link> for a list of possible actions.</para>
546     <para>Default value: none</para>
547   </sect3>
548   <sect3 id="buttontooltiptext">
549     <title>tooltiptext</title>
550     <para>Tooltip associated with the button. See also <link linkend="textvars">Text variables</link>.</para>
551     <para>Default value: </para>
552   </sect3>
553 </sect2>
554
555 <sect2 id="Checkbox">
556   <title>Checkbox</title>
557   <para>Create a checkbox, i.e. a button with 2 states (checked/unchecked). So you need 6 images for a full-featured checkbox: each state has a basic image ('up' state), an image for the control being hovered by the mouse ('over' state) and an image corresponding to a click not yet released ('down' state). If you supply only the basic images, the other ones will be identical.</para>
558   <para>See the <link linkend="commattr">common attributes</link>.</para>
559   <sect3 id="up1">
560     <title>up1</title>
561     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link>, used when the checkbox is up in the first state.</para>
562     <para><emphasis>Required.</emphasis></para>
563   </sect3>
564   <sect3 id="down1">
565     <title>down1</title>
566     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link>, used when the checkbox is down in the first state.</para>
567     <para>Default value: none</para>
568   </sect3>
569   <sect3 id="over1">
570     <title>over1</title>
571     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link>, used when the mouse is over the checkbox in the first state.</para>
572     <para>Default value: none</para>
573   </sect3>
574   <sect3 id="up2">
575     <title>up2</title>
576     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link>, used when the checkbox is up in the second state.</para>
577     <para><emphasis>Required.</emphasis></para>
578   </sect3>
579   <sect3 id="down2">
580     <title>down2</title>
581     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link>, used when the checkbox is down in the second state.</para>
582     <para>Default value: none</para>
583   </sect3>
584   <sect3 id="over2">
585     <title>over2</title>
586     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link>, used when the mouse is over the checkbox in the second state.</para>
587     <para>Default value: none</para>
588   </sect3>
589   <sect3 id="state">
590     <title>state</title>
591     <para><link linkend="boolexpr">Boolean expression</link> specifying the state of the checkbox: if the expression resolves to 'false', the first state will be used, and if it resolves to 'true' the second state will be used. Example for a checkbox showing/hiding a window whose <link linkend="windowid">id</link> is "playlist_window": state="playlist_window.isVisible" (or state="not playlist_window.isVisible", depending on the states you chose).</para>
592     <para><emphasis>Required.</emphasis></para>
593   </sect3>
594   <sect3 id="action1">
595     <title>action1</title>
596     <para>Action executed when the checkbox is clicked (state 1 to state 2). See <link linkend="actions">Actions</link> for a list of possible actions.</para>
597     <para>Default value: none</para>
598   </sect3>
599   <sect3 id="action2">
600     <title>action2</title>
601     <para>Action executed when the checkbox is clicked (state 2 to state 1). See <link linkend="actions">Actions</link> for a list of possible actions.</para>
602     <para>Default value: none</para>
603   </sect3>
604   <sect3 id="tooltiptext1">
605     <title>tooltiptext1</title>
606     <para>Tooltip associated with the checkbox in state 1. See also <link linkend="textvars">Text variables</link>.</para>
607     <para>Default value: </para>
608   </sect3>
609   <sect3 id="tooltiptext2">
610     <title>tooltiptext2</title>
611     <para>Tooltip associated with the checkbox in state 2. See also <link linkend="textvars">Text variables</link>.</para>
612     <para>Default value: </para>
613   </sect3>
614 </sect2>
615
616 <sect2 id="Text">
617   <title>Text</title>
618   <para>Control to display some text.</para>
619   <para>See the <link linkend="commattr">common attributes</link>.</para>
620   <sect3 id="textfont">
621     <title>font</title>
622     <para>Identifiant of a <link linkend="Font">Font</link> or <link linkend="BitmapFont">BitmapFont</link> (beware that any character not present in the <link linkend="BitmapFont">BitmapFont</link> will be printed as a space, so will be invisible).</para>
623     <para><emphasis>Required.</emphasis></para>
624   </sect3>
625   <sect3 id="texttext">
626     <title>text</title>
627     <para>Text to display. See also <link linkend="textvars">Text variables</link>.</para>
628     <para>Default value: </para>
629   </sect3>
630   <sect3 id="textcolor">
631     <title>color</title>
632     <para>Color of the text, using the #RRGGBB format.</para>
633     <para>Default value: #000000</para>
634   </sect3>
635   <sect3 id="textwidth">
636     <title>width</title>
637     <para>Width of the text in pixels. If set to "0", the width is automatically calculated to fit with the current text.<!--XXX: Probably false...--></para>
638     <para>Default value: 0</para>
639   </sect3>
640   <sect3 id="textalignment">
641     <title>alignment</title>
642     <para>Alignment of the text inside the control. Possible values are 'left', 'center' and 'right'. The 'width' and 'center' alignments are computed using the width of the control (as given by the <link linkend="textwidth">width</link> attribute). Available since VLC 0.8.5.</para>
643     <para>Default value: left</para>
644   </sect3>
645   <sect3 id="textscrolling">
646     <title>scrolling</title>
647     <para>Scrolling behaviour of the text (only when it doesn't fit in the <link linkend="textwidth">width</link> of the control). Possible values are 'auto', 'manual' and 'none'. If this attribute is set to 'auto', the text automatically starts scrolling. The user can drag the text, and click on it to start/stop the scrolling. If this attribute is set to 'manual', the text only scrolls when dragged by the user. If this attribute is set to 'none', no scrolling is possible at all. Available since VLC 0.8.5.</para>
648     <para>Default value: auto</para>
649   </sect3>
650 </sect2>
651
652 <sect2 id="Slider">
653   <title>Slider</title>
654   <para>Create a slider. This element can be used alone, or can contain a <link linkend="SliderBackground">SliderBackground</link> element.</para>
655   <para>See the <link linkend="commattr">common attributes</link>.</para>
656   <sect3 id="sliderup">
657     <title>up</title>
658     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link>, used when the slider cursor is up.</para>
659     <para><emphasis>Required.</emphasis></para>
660   </sect3>
661   <sect3 id="sliderdown">
662     <title>down</title>
663     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link>, used when the slider cursor is down.</para>
664     <para>Default value: none</para>
665   </sect3>
666   <sect3 id="sliderover">
667     <title>over</title>
668     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link>, used when the mouse is over the slider cursor.</para>
669     <para>Default value: none</para>
670   </sect3>
671   <sect3 id="sliderpoints">
672     <title>points</title>
673     <para>Points defining the <link linkend="bezier">Bezier curve</link> followed by the slider cursor.</para>
674     <para>Default value: none</para>
675   </sect3>
676   <sect3 id="sliderthickness">
677     <title>thickness</title>
678     <para>Thickness of the slider curve. This attribute is used to determine whether the mouse is over the slider (hence whether a mouse click will have an effect on the cursor position).</para>
679     <para>Default value: 10</para>
680   </sect3>
681   <sect3 id="slidervalue">
682     <title>value</title>
683     <para>Variable controlled by the slider. This must be a <link linkend="percent">percentage variable</link>, e.g "volume" or "time" (only exception: the <link linkend="Slider">Slider</link> defined inside the <link linkend="Playtree">Playtree</link> tag does not need to set this attribute).</para>
684     <para>Default value: none</para>
685   </sect3>
686   <sect3 id="slidertooltiptext">
687     <title>tooltiptext</title>
688     <para>Tooltip associated with the slider. See also <link linkend="textvars">Text variables</link>.</para>
689     <para>Default value: </para>
690   </sect3>
691 </sect2>
692
693
694 <sect2 id="SliderBackground">
695   <title>SliderBackground</title>
696   <para>Set of background images associated to a slider (it must be a sub-element of a <link linkend="Slider">Slider</link>). The displayed image depends on the value of the corresponding slider; if the SliderBackground contains n images, the image #m will be displayed, where m = n * (slider value). A SliderBackground actually contains a single image, which is divided into a grid to build all the sub-images. All the sub-images of the grid have the same size, and can be separated by unused pixel lines or rows if needed (this is called "padding").</para>
697   <para>See the <link linkend="commattr">common attributes</link>.</para>
698   <sect3 id="sbg_image">
699     <title>image</title>
700     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link>; image containing the sub-images used to draw the background of the slider.</para>
701     <para><emphasis>Required.</emphasis></para>
702   </sect3>
703   <sect3 id="nbhoriz">
704     <title>nbhoriz</title>
705     <para>Number of sub-images in the horizontal direction.</para>
706     <para>Default value: 1</para>
707   </sect3>
708   <sect3 id="nbvert">
709     <title>nbvert</title>
710     <para>Number of sub-images in the vertical direction.</para>
711     <para>Default value: 1</para>
712   </sect3>
713   <sect3 id="padhoriz">
714     <title>padhoriz</title>
715     <para>Horizontal padding: number of unused pixel rows between two sub-images.</para>
716     <para>Default value: 0</para>
717   </sect3>
718   <sect3 id="padvert">
719     <title>padvert</title>
720     <para>Vertical padding: number of unused pixel lines between two sub-images.</para>
721     <para>Default value: 0</para>
722   </sect3>
723 </sect2>
724
725 <sect2 id="RadialSlider">
726   <title>RadialSlider</title>
727   <para>Create a circular slider from a list of images with the different possible positions.</para>
728   <para>See the <link linkend="commattr">common attributes</link>.</para>
729   <sect3 id="sequence">
730     <title>sequence</title>
731     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link> containing the list of images of the different positions of the slider, concatenated vertically.</para>
732     <para><emphasis>Required.</emphasis></para>
733   </sect3>
734   <sect3 id="nbimages">
735     <title>nbimages</title>
736     <para>Number of elementary images contained in the sequence.</para>
737     <para><emphasis>Required.</emphasis></para>
738   </sect3>
739   <sect3 id="minangle">
740     <title>minangle</title>
741     <para>Minimum angle of the rotation, corresponding to 0%.</para>
742     <para>Default value: 0</para>
743   </sect3>
744   <sect3 id="maxangle">
745     <title>maxangle</title>
746     <para>Maximum angle of the rotation, corresponding to 100%.</para>
747     <para>Default value: 360</para>
748   </sect3>
749   <sect3 id="radialslidervalue">
750     <title>value</title>
751     <para>Variable controlled by the slider. This must be a <link linkend="percent">percentage variable</link>, e.g "volume" or "time".</para>
752     <para>Default value: none</para>
753   </sect3>
754   <sect3 id="radialslidertooltiptext">
755     <title>tooltiptext</title>
756     <para>Tooltip associated with the slider. See also <link linkend="textvars">Text variables</link>.</para>
757     <para>Default value: </para>
758   </sect3>
759 </sect2>
760
761 <sect2 id="Video">
762   <title>Video</title>
763   <para>Control containing a video. This allows skinable video outputs!</para>
764   <note><para>This control is still under development and its behaviour may change a lot in the future.</para></note>
765   <sect3 id="videowidth">
766     <title>width</title>
767     <para>Initial width of the control, in pixels.<!--XXX: cannot be deduced?--></para>
768     <para>Default value: 0</para>
769   </sect3>
770   <sect3 id="videoheight">
771     <title>height</title>
772     <para>Initial height of the control, in pixels.<!--XXX: cannot be deduced?--></para>
773     <para>Default value: 0</para>
774   </sect3>
775   <sect3 id="videoautoresize">
776     <title>autoresize</title>
777     <para>Indicate whether the layout should be automatically resized to fit the dimensions of the played video.</para>
778     <para>Default value: true</para>
779   </sect3>
780 </sect2>
781
782 <sect2 id="Playlist">
783  <title>Playlist</title>
784  <para>This tag used to create a playlist. This tag is deprecated, you should now use <link linkend="Playtree">Playtree</link></para>
785 </sect2>
786
787 <sect2 id="Playtree">
788   <title>Playtree</title>
789   <para>Create a playlist. This tag must contain a <link linkend="Slider">Slider</link> tag (to allow scrolling in the playlist).</para>
790   <para>See the <link linkend="commattr">common attributes</link>.</para>
791   <sect3 id="playlistwidth">
792     <title>width</title>
793     <para>Width of the playlist, in pixels. If playlist items are wider, the end of the name will be replaced with '...'.</para>
794     <para>Default value: 0</para>
795   </sect3>
796   <sect3 id="playlistheight">
797     <title>height</title>
798     <para>Height of the playlist, in pixels.</para>
799     <para>Default value: 0</para>
800   </sect3>
801   <sect3 id="playlistfont">
802     <title>font</title>
803     <para>Identifiant of a <link linkend="Font">Font</link> tag.</para>
804     <para><emphasis>Required.</emphasis></para>
805   </sect3>
806   <sect3 id="var">
807     <title>var</title>
808     <para>Type of playlist. Currently, only "playlist" is recognized, so don't bother with this attribute :)</para>
809     <para>Default value: playlist</para>
810   </sect3>
811   <sect3 id="bgimage">
812     <title>bgimage</title>
813     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link>, used as the background image. When no bitmap is specified, the background will be filled using the <link linkend="bgcolor1">bgcolor1</link> and <link linkend="bgcolor2">bgcolor2</link> attributes.</para>
814     <para>Default value: none</para>
815   </sect3>
816   <sect3 id="fgcolor">
817     <title>fgcolor</title>
818     <para>Foreground color of the playlist items.</para>
819     <para>Default value: #000000</para>
820   </sect3>
821   <sect3 id="playcolor">
822     <title>playcolor</title>
823     <para>Foreground color of the item currently played.</para>
824     <para>Default value: #FF0000</para>
825   </sect3>
826   <sect3 id="selcolor">
827     <title>selcolor</title>
828     <para>Background color of selected items.</para>
829     <para>Default value: #0000FF</para>
830   </sect3>
831   <sect3 id="bgcolor1">
832     <title>bgcolor1</title>
833     <para>Background color for odd playlist items. This attribute is ignored if the <link linkend="bgimage">bgimage</link> one is used.</para>
834     <para>Default value: #FFFFFF</para>
835   </sect3>
836   <sect3 id="bgcolor2">
837     <title>bgcolor2</title>
838     <para>Background color for even playlist items. This attribute is ignored if the <link linkend="bgimage">bgimage</link> one is used.</para>
839     <para>Default value: #FFFFFF</para>
840   </sect3>
841   <sect3 id="flat">
842     <title>flat</title>
843     <para>Boolean to indicate whether the playlist should use the tree structure or be completely "flat" (only show the leafs of the tree).</para>
844     <para>A flat playtree will work like old-style playlists.</para>
845     <para>Default value: false</para>
846   </sect3>
847   <sect3 id="itemimage">
848     <title>itemimage</title>
849     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link> shown to the left of a leaf (playlist item).</para>
850  </sect3>
851   <sect3 id="openimage">
852     <title>openimage</title>
853     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link> shown to the left of a node, when it is expanded.</para>
854  </sect3>
855  <sect3 id="closedimage">
856     <title>closedimage</title>
857     <para>Identifiant of a <link linkend="Bitmap">Bitmap</link> shown to the left of a node, when it is retracted.</para>
858  </sect3>
859 </sect2>
860
861 </sect1>
862
863 <sect1 id="actions">
864 <title>Actions</title>
865
866 <para>There is a predefined list of actions:</para>
867
868 <itemizedlist>
869   <listitem><para>
870     <emphasis>none</emphasis>: Do nothing
871   </para></listitem>
872   <listitem><para>
873     <emphasis>dialogs.changeSkin()</emphasis>: Show a dialog box to load a new skin. This does the same as the predefined hotkey Ctrl+S.
874   </para></listitem>
875   <listitem><para>
876     <emphasis>dialogs.fileSimple()</emphasis>: Show the simple "Open File" dialog box.
877   </para></listitem>
878   <listitem><para>
879     <emphasis>dialogs.file()</emphasis>: Show the "Open File" dialog box, with many options (stream output, subtitles, etc...).
880   </para></listitem>
881   <listitem><para>
882     <emphasis>dialogs.directory()</emphasis>: Show the "Open Directory" dialog box (new after VLC 0.8.2).
883   </para></listitem>
884   <listitem><para>
885     <emphasis>dialogs.disc()</emphasis>: Show the "Open Disc" dialog box.
886   </para></listitem>
887   <listitem><para>
888     <emphasis>dialogs.net()</emphasis>: Show the "Open Network Stream" dialog box.
889   </para></listitem>
890   <listitem><para>
891     <emphasis>dialogs.messages()</emphasis>: Show the "Meessage" dialog box (which gives error/warning/debug messages).
892   </para></listitem>
893   <listitem><para>
894     <emphasis>dialogs.prefs()</emphasis>: Show the "Preferences" dialog box.
895   </para></listitem>
896   <listitem><para>
897     <emphasis>dialogs.fileInfo()</emphasis>: Show the "File Info" dialog box.
898   </para></listitem>
899   <listitem><para>
900     <emphasis>dialogs.playlist()</emphasis>: Show the "standard" (not skinned) playlist dialog (since VLC 0.8.6).
901   </para></listitem>
902   <listitem><para>
903     <emphasis>dialogs.streamingWizard()</emphasis>: Show the "Streaming Wizard" dialog box (new after VLC 0.8.2).
904   </para></listitem>
905   <listitem><para>
906     <emphasis>dialogs.popup()</emphasis>: Show the full popup menu, (already available with a right-click on a <link linkend="Image">Image</link> control).
907   </para></listitem>
908   <listitem><para>
909     <emphasis>dialogs.audioPopup()</emphasis>: Show the audio settings popup menu (since VLC 0.8.6).
910   </para></listitem>
911    <listitem><para>
912     <emphasis>dialogs.videoPopup()</emphasis>: Show the video settings popup menu (since VLC 0.8.6).
913   </para></listitem>
914   <listitem><para>
915     <emphasis>dialogs.miscPopup()</emphasis>: Show a popup menu containing playback control and general options (since VLC 0.8.6).
916   </para></listitem>
917   <listitem><para>
918     <emphasis>equalizer.enable()</emphasis>: Enable the equalizer audio filter (since VLC 0.8.5).
919   </para></listitem>
920   <listitem><para>
921     <emphasis>equalizer.disable()</emphasis>: Disable the equalizer audio filter (since VLC 0.8.5).
922   </para></listitem>
923   <listitem><para>
924     <emphasis>vlc.play()</emphasis>: Play the current playlist item.
925   </para></listitem>
926   <listitem><para>
927     <emphasis>vlc.pause()</emphasis>: Pause the current playlist item.
928   </para></listitem>
929   <listitem><para>
930     <emphasis>vlc.stop()</emphasis>: Stop the current playlist item.
931   </para></listitem>
932   <listitem><para>
933     <emphasis>vlc.faster()</emphasis>: Play the current playlist item faster.
934   </para></listitem>
935   <listitem><para>
936     <emphasis>vlc.slower()</emphasis>: Play the current playlist item slower.
937   </para></listitem>
938   <listitem><para>
939     <emphasis>vlc.mute()</emphasis>: Toggle mute/un-mute.
940   </para></listitem>
941   <listitem><para>
942     <emphasis>vlc.volumeUp()</emphasis>: Increase the volume (since VLC 0.8.2).
943   </para></listitem>
944   <listitem><para>
945     <emphasis>vlc.volumeDown()</emphasis>: Reduce the volume (since VLC 0.8.2).
946   </para></listitem>
947   <listitem><para>
948     <emphasis>vlc.fullscreen()</emphasis>: Toggle the fullscreen mode.
949   </para></listitem>
950   <listitem><para>
951     <emphasis>vlc.snapshot()</emphasis>: Take a snapshot (since VLC 0.8.5).
952   </para></listitem>
953   <listitem><para>
954     <emphasis>vlc.toggleRecord()</emphasis>: Start/Stop recording (since VLC 1.1).
955   </para></listitem>
956   <listitem><para>
957     <emphasis>vlc.nextFrame()</emphasis>: Advance one frame at a time (since VLC 1.1).
958   </para></listitem>
959   <listitem><para>
960     <emphasis>vlc.onTop()</emphasis>: Toggle the "Always on top" status (since VLC 0.8.0).
961   </para></listitem>
962   <listitem><para>
963     <emphasis>vlc.minimize()</emphasis>: Minimize VLC (since VLC 0.8.0)
964   </para></listitem>
965   <listitem><para>
966     <emphasis>vlc.quit()</emphasis>: Quit VLC.
967   </para></listitem>
968   <listitem><para>
969     <emphasis>playlist.add()</emphasis>: Add a new item to the playlist.
970   </para></listitem>
971   <listitem><para>
972     <emphasis>playlist.del()</emphasis>: Remove the selected items from the playlist.
973   </para></listitem>
974   <listitem><para>
975     <emphasis>playlist.next()</emphasis>: Go to the next playlist item.
976   </para></listitem>
977   <listitem><para>
978     <emphasis>playlist.previous()</emphasis>: Go to the previous playlist item.
979   </para></listitem>
980   <listitem><para>
981     <emphasis>playlist.sort()</emphasis>: Sort the playlist alphabetically.
982   </para></listitem>
983   <listitem><para>
984     <emphasis>playlist.setRandom(true)</emphasis>: Play the playlist items in random order.
985   </para></listitem>
986   <listitem><para>
987     <emphasis>playlist.setRandom(false)</emphasis>: Play the playlist items in the playlist order.
988   </para></listitem>
989   <listitem><para>
990     <emphasis>playlist.setLoop(true)</emphasis>: Loop at playlist end.
991   </para></listitem>
992   <listitem><para>
993     <emphasis>playlist.setLoop(false)</emphasis>: Do not loop at playlist end.
994   </para></listitem>
995   <listitem><para>
996     <emphasis>playlist.setRepeat(true)</emphasis>: Repeat the current playlist item (since VLC 0.8.0).
997   </para></listitem>
998   <listitem><para>
999     <emphasis>playlist.setRepeat(false)</emphasis>: Stop repeating the current playlist item (since VLC 0.8.0).
1000   </para></listitem>
1001   <listitem><para>
1002     <emphasis>playlist.load()</emphasis>: Load an external playlist file (since VLC 0.8.0).
1003   </para></listitem>
1004   <listitem><para>
1005     <emphasis>playlist.save()</emphasis>: Save the current playlist (since VLC 0.8.0).
1006   </para></listitem>
1007   <listitem id="dvdactions"><para>
1008     <emphasis>dvd.nextTitle()</emphasis>: Go to the next title of the DVD (since VLC 0.8.5).
1009   </para></listitem>
1010   <listitem><para>
1011     <emphasis>dvd.previousTitle()</emphasis>: Go to the previous title of the DVD (since VLC 0.8.5).
1012   </para></listitem>
1013   <listitem><para>
1014     <emphasis>dvd.nextChapter()</emphasis>: Go to the next chapter of the DVD (since VLC 0.8.5).
1015   </para></listitem>
1016   <listitem><para>
1017     <emphasis>dvd.previousChapter()</emphasis>: Go to the previous chapter of the DVD (since VLC 0.8.5).
1018   </para></listitem>
1019   <listitem><para>
1020     <emphasis>dvd.rootMenu()</emphasis>: Go to the root menu of the DVD (since VLC 0.8.5).
1021   </para></listitem>
1022   <listitem><para>
1023     <emphasis>WindowID.show()</emphasis>: Show the <link linkend="Window">Window</link> whose <link linkend="windowid">id</link> attribute is 'WindowID'.
1024   </para></listitem>
1025   <listitem><para>
1026     <emphasis>WindowID.hide()</emphasis>: Hide the <link linkend="Window">Window</link> whose <link linkend="windowid">id</link> attribute is 'WindowID'.
1027   </para></listitem>
1028   <listitem><para>
1029     <emphasis>WindowID.maximize()</emphasis>: Maximize the <link linkend="Window">Window</link> whose <link linkend="windowid">id</link> attribute is 'WindowID'. Since VLC 0.9.0.
1030   </para></listitem>
1031   <listitem><para>
1032     <emphasis>WindowID.unmaximize()</emphasis>: Unmaximize the <link linkend="Window">Window</link> whose <link linkend="windowid">id</link> attribute is 'WindowID'. Since VLC 0.9.0.
1033   </para></listitem>
1034   <listitem><para>
1035     <emphasis>WindowID.setLayout(LayoutID)</emphasis>: Change the layout of the <link linkend="Window">Window</link> whose <link linkend="windowid">id</link> attribute is 'WindowID', using the <link linkend="Layout">Layout</link> whose <link linkend="layoutid">id</link> attribute is 'LayoutID'.
1036   </para></listitem>
1037 </itemizedlist>
1038
1039 <para>It is possible to run several actions at once, by separating them with ';'. Example: action="playlist_id.hide(); main_window_id.setLayout(main_layout)"</para>
1040
1041 </sect1>
1042
1043 <sect1 id="textvars">
1044 <title>Text variables</title>
1045
1046 <para>When specifying the <link linkend="texttext">text</link> attribute of the <link linkend="Text">Text</link> control or any tooltip attribute, you can insert escape sequences which will be expanded dynamically. An escape sequence always starts with the '$' character, followed by one or more predefined letters. Here is the list of accepted escape sequences:</para>
1047
1048 <itemizedlist>
1049   <listitem><para>
1050     <emphasis>$B</emphasis>: Get the audio stream bitrate (in kb/s).
1051   </para></listitem>
1052   <listitem><para>
1053     <emphasis>$V</emphasis>: Value of the volume (from 0 to 100 --> useful for a percentage).
1054   </para></listitem>
1055   <listitem><para>
1056     <emphasis>$T</emphasis>: Current time (the output format is H:MM:SS).
1057   </para></listitem>
1058   <listitem><para>
1059     <emphasis>$L</emphasis>: Remaining time, when available (the output format is H:MM:SS).
1060   </para></listitem>
1061   <listitem><para>
1062     <emphasis>$D</emphasis>: Duration of the stream, when available (the output format is H:MM:SS).
1063   </para></listitem>
1064   <listitem><para>
1065     <emphasis>$t, $l, $d</emphasis>: Same as $T, $L and $D, except that the hour in the format is displayed only if its value is different from 0. These text variables were needed to support Winamp2 skins, but it is advised to use the uppercase ones. (Since VLC 0.8.5).
1066   </para></listitem>
1067   <listitem><para>
1068     <emphasis>$H</emphasis>: Value of the <link linkend="help">help</link> attribute of the control that is under the mouse. The main use of this escape character is to create a kind of status bar, providing contextual help.</para>
1069     <note><para>Escape sequences in the help string are also transformed (except $H itself, it would generate an infinite loop!).</para></note>
1070   </listitem>
1071   <listitem><para>
1072     <emphasis>$N</emphasis>: Name of the stream that is being played.
1073   </para></listitem>
1074   <listitem><para>
1075     <emphasis>$F</emphasis>: Full name (with path) of the stream that is being played.
1076   </para></listitem>
1077   <listitem><para>
1078     <emphasis>$S</emphasis>: Get the audio sample rate (in kHz).
1079   </para></listitem>
1080 </itemizedlist>
1081
1082 <para>Example of <link linkend="slidertooltiptext">tooltiptext</link> value for a slider controlling the volume: "Volume: $V%".</para>
1083
1084 </sect1>
1085
1086 <sect1 id="boolexpr">
1087 <title>Boolean expressions</title>
1088
1089 <para>Some attributes in the XML file require a boolean value, such as "true" or "false". But sometimes, you may need something more complex than a mere "static" boolean value. For example, let's say that you want a <link linkend="Text">Text</link> control to display "Pause" whenever the stream is paused. Wouldn't it be nice to show this control only when the stream is paused, and to hide it the rest of the time? Well, guess what: this is possible. You only have to set the <link linkend="visible">visible</link> attribute of the <link linkend="Text">Text</link> control to "vlc.isPaused".</para>
1090
1091 <para>Here is a list of all the dynamic statuses that can be used in boolean expressions:</para>
1092
1093 <itemizedlist>
1094   <listitem><para>
1095     <emphasis>equalizer.isEnabled</emphasis>: True if the equalizer audio filter is enabled (since VLC 0.8.5).
1096   </para></listitem>
1097   <listitem><para>
1098     <emphasis>vlc.hasVout</emphasis>: True if a video is being played (since VLC 0.8.5).
1099   </para></listitem>
1100   <listitem><para>
1101     <emphasis>vlc.hasAudio</emphasis>: True if audio is being played (since VLC 0.8.5).
1102   </para></listitem>
1103   <listitem><para>
1104     <emphasis>vlc.isFullscreen</emphasis>: True when the video is in fullscreen mode (since VLC 0.8.5).
1105   </para></listitem>
1106   <listitem><para>
1107     <emphasis>vlc.isPlaying</emphasis>: True when VLC is playing, false otherwise.
1108   </para></listitem>
1109   <listitem><para>
1110     <emphasis>vlc.isStopped</emphasis>: True when VLC is stopped, false otherwise.
1111   </para></listitem>
1112   <listitem><para>
1113     <emphasis>vlc.isPaused</emphasis>: True when VLC is paused, false otherwise.
1114   </para></listitem>
1115   <listitem><para>
1116     <emphasis>vlc.isSeekable</emphasis>: True when the stream is seekable, false otherwise. This one can be used if you want to display a slider only when seeking is allowed.
1117   </para></listitem>
1118   <listitem><para>
1119     <emphasis>vlc.canRecord</emphasis>: True if the stream can be recorded, false otherwise. (since vlc1.1)
1120   </para></listitem>
1121   <listitem><para>
1122     <emphasis>vlc.isRecording</emphasis>: True if the stream is being recorded, false otherwise. (since vlc1.1)
1123   </para></listitem>
1124   <listitem><para>
1125     <emphasis>vlc.isMute</emphasis>: True when the sound is mute (in VLC, not on your OS), false otherwise.
1126   </para></listitem>
1127   <listitem><para>
1128     <emphasis>vlc.isOnTop</emphasis>: True when the windows have the "Always on top" status (since VLC 0.8.0).
1129   </para></listitem>
1130   <listitem><para>
1131     <emphasis>playlist.isRandom</emphasis>: True when the playlist items are played in a random order, false otherwise.
1132   </para></listitem>
1133   <listitem><para>
1134     <emphasis>playlist.isLoop</emphasis>: True when the playlist is looping, false otherwise.
1135   </para></listitem>
1136   <listitem><para>
1137     <emphasis>playlist.isRepeat</emphasis>: True when the current playlist item is being repeated, false otherwise (since VLC 0.8.0).
1138   </para></listitem>
1139   <listitem><para>
1140    <emphasis>dvd.isActive</emphasis>: True when a DVD is currently playing. This variable can be used to display buttons associated to the <link linkend="dvdactions">dvd.* actions</link> only when needed (since VLC 0.8.5).
1141   </para></listitem>
1142   <listitem><para>
1143     <emphasis>WindowID.isMaximized</emphasis>: True when the window whose <link linkend="windowid">id</link> is "WindowID" is maximized, false otherwise (since VLC 0.9.0).
1144   </para></listitem>
1145   <listitem><para>
1146     <emphasis>WindowID.isVisible</emphasis>: True when the window whose <link linkend="windowid">id</link> is "WindowID" is visible, false otherwise.
1147   </para></listitem>
1148   <listitem><para>
1149     <emphasis>LayoutID.isVisible</emphasis>: True when the layout whose <link linkend="layoutid">id</link> is "LayoutID" is the active layout in its window (even if the window is hidden), false otherwise (since VLC 0.8.6).
1150   </para></listitem>
1151 </itemizedlist>
1152
1153 <para>In addition to these dynamic values, you can use the constant values "true" and "false". And of course, any combination is allowed, using the "and", "or" and "not" operators. For example, supposing that you have a window named "playlist_window", the following expression is valid (even though completely stupid):</para>
1154 <para>visible="(true) and ((not playlist_window.isVisible) and (not vlc.isStopped or false))"</para>
1155
1156 </sect1>
1157
1158 <sect1 id="percent">
1159 <title>Percentage variables</title>
1160
1161 <para>Every <link linkend="Slider">slider</link> is associated to a percentage variable, which corresponds to the position of the cursor (between 0 and 100%)</para>
1162
1163 <para>Here is a list of predefined percentage variables:</para>
1164
1165 <itemizedlist>
1166   <listitem><para>
1167     <emphasis>equalizer.band(n)</emphasis>: Where 'n' is an integer between 0 and 9. When the equalizer audio filter is enabled, this value corresponds to the amplification factor of the n'th frequency band: 0% means -20 dB, and 100% means +20 dB. The frequencies corresponding to the 10 bands are: 60Hz, 170Hz, 310Hz, 600Hz, 1kHz, 3kHz, 6kHz, 12kHz, 14kHz, 16kHz. (Since VLC 0.8.5)
1168   </para></listitem>
1169   <listitem><para>
1170     <emphasis>equalizer.preamp</emphasis>: Preamplification value (if the equalizer audio filter is enabled). A value of 0% means -20 dB, and 100% means +20 dB. (Since VLC 0.8.5)
1171   </para></listitem>
1172   <listitem><para>
1173     <emphasis>time</emphasis>: Position of the stream being played.
1174   </para></listitem>
1175   <listitem><para>
1176     <emphasis>volume</emphasis>: Value of the volume.
1177   </para></listitem>
1178 </itemizedlist>
1179
1180 </sect1>
1181
1182 <sect1 id="layoutmodel">
1183 <title>Layout model</title>
1184
1185 <para>Placing the controls on a window is easy, using their x and y attributes, but these positions become insufficient for a resizable window. Some controls (or groups of controls) should stay centered in the window, others should follow the right side of the window, others should change their size automatically, etc... To handle these various behaviours, the layout model followed by the skins engine is a model based on nested boxes.</para>
1186
1187 <para>There are 2 kinds of boxes:</para>
1188
1189 <itemizedlist>
1190   <listitem><para>
1191     <emphasis>simple boxes</emphasis>: These boxes cannot contain other boxes. All the visible controls are simple boxes: Image, Button, Checkbox, Text, Slider, RadialSlider, Playlist, Playtree, Video.
1192   </para></listitem>
1193   <listitem><para>
1194     <emphasis>container boxes</emphasis>: These boxes can contain other boxes. Only two XML tags create container boxes: <link linkend="Panel">Panel</link> and <link linkend="Layout">Layout</link>. The Layout tag is necessarily the top-level box for the current layout, and cannot be contained, but Panel elements can be contained.
1195   </para></listitem>
1196 </itemizedlist>
1197
1198 <para>A box inside a container box always defines how it should react when its container box is resized. Two different mechanisms are provided: corners anchoring (useful when resizing of the inner box is wanted, for example) and constant ratio (mainly useful to keep the inner box centered inside its parent):</para>
1199 <itemizedlist>
1200   <listitem><para>
1201     <emphasis>corners anchoring</emphasis>: The top-left-hand corner (TL) and the bottom-right-hand corner (BR) of the inner box are "tied" to corners of the container box (TL, TR, BL or BR). When any resizing occurs, tied corners move together, which can move or resize the inner box. For example, if the TL corner of the inner box is tied to the TL corner of the container (let's write it TL/TL), and if the BR corner of the inner box is also tied to the TL corner of the container box (BR/TL), the inner box will not be resized, and will always stay at the same place (this is the default behaviour). If we have TL/TL and TL/BL, the inner box is resized vertically when its container is resized. If we have TL/TR and BR/TR, the inner box moves with the TR corner of its container. We could even define TL/BR and BR/TL, in which case increasing the size of the container box would shrink the size of the inner box... until it disappears completely!
1202   </para>
1203   <para>This mechanism is controlled by the <link linkend="lefttop">lefttop</link> and <link linkend="rightbottom">rightbottom</link> attributes of the controls.
1204   </para></listitem>
1205   <listitem><para>
1206     <emphasis>constant ratio</emphasis>: When a box doesn't fill completely its container box, there is space on the top, bottom, left and right of the inner box. It is possible to force the ratio between the space on the top and the space on the bottom (or the one on the left and the one on the right)  to be constant. Any resizing of the container box will then move the inner box accordingly, and the size of the inner box will never change (it overrides the corners anchoring mechanism). The horizontal and vertical ratios being independent, it is for example possible to keep only the horizontal ratio constant, in which case the inner box can still resize vertically (depending on its attributes for the corners anchoring, of course).
1207   </para>
1208   <para>This mechanism is controlled by the <link linkend="xkeepratio">xkeepratio</link> and <link linkend="ykeepratio">ykeepratio</link> attributes of the controls.
1209   </para></listitem>
1210 </itemizedlist>
1211
1212 </sect1>
1213
1214
1215 <sect1>
1216
1217 <title>Compression</title>
1218
1219 <para>When designing a new skin, it can be useful to organize your files in different directories. For example, you can have one directory for the fonts, another one for the images of the main window, yet another one for the images of the playlist window, etc...</para>
1220
1221 <para>But such a structure is not very convenient when it comes to distributing the skin. To address this problem, VLC is able to load skins directly from a .tar.gz archive containing all your files, along with directory information. When loading the skin, the files will be extracted in a temporary directory, then VLC will recursively search a file named "theme.xml", and the first one to be found will be used to load the skin. Of course, the temporary directory will be removed when you quit VLC or change the interface.</para>
1222
1223 <para>On Linux, creating a .tar.gz archive is rather straight-forward using the 'tar' and 'gzip' commands. On Windows, it can be done using Winzip, UltimateZip, or any other (well, almost) compression software...</para>
1224
1225 <para>Since VLC 0.8.5, it is also possible to archive your skin in a zip file.</para>
1226
1227 <para>It is advised to rename your .tar.gz (or .zip) archive with the .vlt extension, for 2 main reasons:</para>
1228
1229 <itemizedlist>
1230   <listitem><para>on some systems, the "Change skin" dialog box only displays files which have a .vlt or .xml extension,</para></listitem>
1231   <listitem><para>in the future, .vlt files could be associated to VLC in such a way that double-clicking a .vlt file would automatically load the skin in VLC.</para></listitem>
1232 </itemizedlist>
1233
1234 </sect1>
1235
1236 <sect1 id="bezier">
1237 <title>Bezier curves</title>
1238
1239 <para>One cool thing with VLC sliders is that they are not necessarily rectilinear, but they can follow any Bezier curve. So if you want to have a slider moving on a half-circle, or even doing a loop, you can!</para>
1240
1241 <para>This is not the place to explain how Bezier curves work (see <ulink url="http://astronomy.swin.edu.au/~pbourke/curves/bezier/">http://astronomy.swin.edu.au/~pbourke/curves/bezier/</ulink> for a nice introduction), the main thing to know is that a Bezier curve can be characterized by a set of points. Once you have them (thanks to the <link linkend="CurveMaker">CurveMaker</link> utility for example<!--XXX: deprecated-->), you just need to enter the list of points in the <link linkend="sliderpoints">points</link> attribute. Here is an example with 3 points: points="(2,50),(45,120),(88,50)".</para>
1242
1243 <para>Bezier curves can be used with the <link linkend="Slider">Slider</link> and <link linkend="Anchor">Anchor</link> tags:</para>
1244
1245 <itemizedlist>
1246     <listitem><para>For sliders, it defines the curve followed by the cursor of the slider. This curve is of course invisible, so if you want a visible background for your <link linkend="Slider">Slider</link> you need to provide it yourself using a <link linkend="SliderBackground">SliderBackground</link> or <link linkend="Image">Image</link> tag.</para></listitem>
1247   <listitem><para>For anchors, the use of Bezier curves is more anecdotic. Its purpose is to have non-ponctual anchor, the whole curve becoming the anchor. In this case, a ponctual anchor (and only a ponctual one) can be attracted by any point of the curve, if it is in its range of action. In fact, you can consider the curve as an easy way to define at once many anchors that share the same properties (except their position, of course :)).</para></listitem>
1248 </itemizedlist>
1249
1250 <note><para>The coordinates are relative to the upper-left corner of the control (i.e. to its <link linkend="x">x</link> and <link linkend="y">y</link> attributes).</para></note>
1251
1252 </sect1>
1253
1254 <sect1>
1255 <title>Tools and advice</title>
1256
1257   <sect2 id="CurveMaker">
1258   <title>Generating Bezier curves</title>
1259
1260   <para>
1261 To generate easily Bezier curves, you can use the <ulink url="/vlc/skins/VLC-curve-maker.exe">CurveMaker</ulink> utility (sorry, this is for Windows users only). Basically, you add and remove points at will, and you can move them to see how the curve evolves. When you have reached the perfect curve, you just have to copy-paste the list of abscissas and ordinates to form the <link linkend="sliderpoints">points</link> attribute of your <link linkend="Slider">Slider</link> or <link linkend="Anchor">Anchor</link>. The curve-maker also allows to load a .bmp file, this could be useful if you want to follow a specific pattern of a slider, for example.
1262   </para>
1263
1264 <note><para>This tool was made for the first version of the skins and has not been modified since then. This explains why it does not use PNG files and why it does not generate directly the value of the <link linkend="sliderpoints">points</link> attribute.</para></note>
1265   </sect2>
1266
1267   <sect2>
1268   <title>Using VLC warning messages</title>
1269   <para>
1270 VLC is able to give warnings and error messages about a loaded skin if it finds problems in the XML file. This can be very helpful to detect syntax errors (a tag which is never closed for example), or incorrect values of attributes. Here is how to see these messages:
1271   </para>
1272
1273 <itemizedlist>
1274   <listitem><para>on Linux, simply start VLC from a console with the following command-line: 'vlc -I skins2 -v' (you can use -vv if you want to see debug messages too),</para></listitem>
1275   <listitem><para>on Windows it is more difficult to use the same method (but you can use it with a rxvt console, in the Cygwin environment). Then another solution is to start VLC with a command-line such as 'vlc -I skins2 -v --extraintf logger'. This should open both VLC and a log window containing the messages. What's more, the logs should be saved in a file named 'vlc-log.txt', in VLC installation directory. The relevant lines are those starting with "[00000178] skins2 interface" (the number may be different).</para></listitem>
1276 </itemizedlist>
1277
1278   </sect2>
1279
1280   <sect2>
1281   <title>Relative paths</title>
1282   <para>For the Bitmap tags, do not use absolute paths but relative paths (they are relative to the XML file directory), so that your skin can be reused by anybody without a particular file structure.</para>
1283   </sect2>
1284
1285   <sect2>
1286   <title>Get inspiration</title>
1287   <para>In order to use plainly the possibilities given, you should look at how existing skins are made, it may give you ideas for your own skins... You can also consult <ulink url="http://wiki.videolan.org/DefaultSkinRequirements">on the wiki</ulink> a list of features usually expected from a skin. </para>
1288   </sect2>
1289
1290   <sect2>
1291   <title>Submit your skin!</title>
1292   <para>Once your skin is finished, you can share it with other people. The easiest way is probably to send it by email to vlc -at- videolan -dot- org, so that we can put it on the website with the other ones. You can also post it in the <ulink url="http://forum.videolan.org/viewforum.php?f=15">skins forum</ulink>. Feel free to ask for support there if you have any problems...</para>
1293   </sect2>
1294
1295 </sect1>
1296
1297 </article>
1298