# HG changeset patch # User diego # Date 1023044583 0 # Node ID b85d324d45039c7b9b34827137f5e3a4a3b39741 # Parent 8dfe9b162624dd07cc2dd6273d7f7b5d1540f68b Grammar, spellchecking and HTML fixups as usual, as well as an explanatory diagram. Review by Nilmoni Deb. diff -r 8dfe9b162624 -r b85d324d4503 DOCS/skin.html --- a/DOCS/skin.html Sun Jun 02 18:38:01 2002 +0000 +++ b/DOCS/skin.html Sun Jun 02 19:03:03 2002 +0000 @@ -1,14 +1,20 @@ +
- +skin
fileskin
file
-Thanks to Zoltán Ponekker for his help. +
András Mohari <mayday@freemail.hu> +
- /usr/local/share/mplayer/Skin/ + $(DATADIR)/Skin/ + $(PREFIX)/share/mplayer/Skin/ ~/.mplayer/Skin/
-Note that the first path may vary according to the way MPlayer was configured
-(see the --datadir
argument of the configure
-script).
+Note that the first path may vary according to the way MPlayer was
+configured (see the --prefix
and --datadir
arguments
+of the configure
script).
+
Every skin is installed into its own directory under one of the directories listed above, for example:
- /usr/local/share/mplayer/Skin/default/ + $(PREFIX)/share/mplayer/Skin/default/
In the main window (see below) you can use images with `transparency': -regions filled with the color #FF00FF (magenta) -are fully transparent when viewed by MPlayer. This means that you can even +Regions filled with the color #FF00FF (magenta) +are fully transparent when viewed by MPlayer. This means that you can even have shaped windows if your X server has the XShape extension. +
-A button has three states (pressed, released, -disabled), so its image must be divided into three parts vertically. +disabled), thus its image must be divided into three parts vertically. See the button item for details. +
+A potmeter (mainly used for the seek bar and volume/balance control) can have any number of phases by dividing its image into different parts below each other. See hpotmeter and potmeter for details. +
-Labels are a bit special: the characters needed to draw them are taken +Labels are a bit special: The characters needed to draw them are taken from an image file, and the characters in the image are described by a font description file. The latter is a plain text file which specifies -the x,y position and size of each character in the image. (So the -image file and its font description file form a font together.) +the x,y position and size of each character in the image (the +image file and its font description file form a font together). See dlabel and slabel for details. +
Note: all images can have full transparency as described in the section about image formats. +
A menu entry is defined by its position and size in the image (see the section about the skin menu for details). +
-There is an important thing not mentioned yet: for buttons, potmeters and -menu entries to work, MPlayer must know what to do if they are clicked. +There is an important thing not mentioned yet: For buttons, potmeters and +menu entries to work, MPlayer must know what to do if they are clicked. This is done by messages (events). For these items -you must define the messages to be genereated when they are clicked. +you must define the messages to be generated when they are clicked. +
.fnt
extension).
-skin
fileskin
file
As mentioned above, this is the skin configuration file.
It is line oriented; comment lines start with a ';
' character
at the beginning of the line (only spaces and tabs are allowed before the
';
').
+
The file is made up of sections. Each section describes the skin for an application and has the following form: +
+section = section name . @@ -220,17 +249,24 @@
|
where window name can be one of these strings: +
+-(The sub and menu block is optional---you do not need to create a menu or -to decorate the subwindow.) +(The sub and menu blocks are optional - you do not need to create a menu or +decorate the subwindow.) +
Within a window block, you can define each item for the window by a line in this form: +
--- --item = parameter --
-where item is a string that identifies the type of the GUI item, -parameter is a numeric or textual value (or a list of values +
item = parameter
+item
is a string that identifies the type of the GUI item,
+parameter
is a numeric or textual value (or a list of values
separated by commas).
-
+Putting the above together, the whole file looks something like this: +
-
section = movieplayer window = main @@ -275,31 +312,49 @@ ; ... items for skin menu ... end end - |
+The name of an image file must be given without leading directories - images are
+searched for in the Skin
directory. You may (but you need not)
+specify the extension of the file. If the file does not exist, MPlayer
+tries to load the file <filename>.<ext>
, where
+tga
, TGA
, bmp
, BMP
,
+png
and PNG
is tried for <ext>
+(in this order). The first matching file will be used.
+
-Finally some words about specifying images for the various items.
-
-The name of an image file must be given without leading directories---
-images are searched in the directory of the skins. You may (but you need not)
-specify the file's extension. If the file doesn't exist, MPlayer tries to
-load the file <filename>.<ext>, where tga,
-TGA, bmp, BMP, png and PNG is tried
-for <ext> (in this order). The first matching file will be used.
+Finally some words about positioning. The main window and the subwindow can be
+placed in the different corners of the screen by giving X
and
+Y
coordinates. 0
is top or left, -1
is
+center and -2
is right or bottom, as shown in this illustration:
+
-+(0, 0)----(-1, 0)----(-2, 0) + | | | + | | | +(0,-1)----(-1,-1)----(-2,-1) + | | | + | | | +(0,-2)----(-1,-2)----(-2,-2) + +
Here is an example to make this clear. Suppose that you have an image called
-main.png that you use for the main window:
+main.png that you use for the main window:
-MPlayer tries to load main, main.tga, main.TGA, -main.bmp etc, so main.png will be found. +MPlayer tries to loadbase = main, -1, -1 main , main.tga ,
+main.TGA , main.bmp etc, so that main.png
+will be found.
If (by accident) you wrote @@ -307,44 +362,43 @@ base = main.bmp, -1, -1-then main.bmp, main.bmp.tga, main.bmp.TGA, -main.bmp.bmp would be searched and MPlayer would finally give up -because there is no main.bmp in the directory, but main.png. +then main.bmp , main.bmp.tga , main.bmp.TGA ,
+main.bmp.bmp would be searched for and MPlayer would finally
+give up because there is no main.bmp in the directory, only
+main.png .
|
window = main
' . . . 'end
' block.
base = image, X, Y
+The window will appear at the given X,Y
position on the screen
+The window will have the size of the image.
+
button = image, X, Y, width, height, message
+Place a button of |
decoration = enable|disable
hpotmeter = button, bwidth, bheight, phases, numphases, default, X, Y, width, height, message
width
* height
size
+at position X
,Y
. The image can be divided into
different parts for the different phases of the potmeter (for example,
you can have a pot for volume control that turns from green to red
-while its value changes from the minimum to the maximum.)
-hpotmeter can have a button that can be dragged horizontally.
-The parameters are:
+while its value changes from the minimum to the maximum.).
+hpotmeter
can have a button that can be dragged horizontally.
+
+button
- the image to be used for the button
(must have three parts below each other, like in case of
button)+ |
numphases
- number of phases stored in the phases
+imagedefault
- default value for hpotmeter (in the range 0 to
+100)X
, Y
- position for the hpotmeterwidth
, height
- width and height of the
+hpotmeter
message
- the message to be generated when the value of
+hpotmeter
is changedvpotmeter
item, too, but it is not
+implemented yet.
potmeter = phases, numphases, default, X, Y, width, height, message
hpotmeter
without a button. (I guess it is meant to be turned
+around, but it reacts to horizontal dragging only.)
For the description of the parameters see
-hpotmeter. phases can be
-NULL
, but its quite useless, since you can not see where
-the potmeter is set.
+hpotmeter. phases
can be
+NULL
, but it is quite useless, since you cannot see where
+the potmeter
is set.
font = fontfile, fontid
.fnt
extension (no need to specify the extension
-here).
-fontid is used to refer to the font
+Defines a font. fontfile
is the name of a font description file
+with a .fnt
extension (do not specify the extension here).
+fontid
is used to refer to the font
(see dlabel and slabel).
Up to 25 fonts can be defined.
slabel = X, Y, fontid, "text"
X
,Y
.
+text
is displayed using the font identified by fontid
.
+The text is just a raw string ($x
variables do not work) that must
+be enclosed between double quotes (but the "
character cannot be
+part of the text). The label is displayed using the font identified by
+fontid
.
+dlabel = X, Y, length, align, fontid, "text"
+X
,Y
. The label is
+called dynamic because its text is refreshed periodically. The maximum length of
+the label is given by length
(its height is the height of a
+character). If the text to be displayed is wider than that, it will be scrolled,
+otherwise it is aligned within the specified space by the value of the
+align
parameter: 0
is for right, 1
is for
+center, 2
is for left.
"
) (but the "
cannot be part of the
-text). The label is displayed using the font identified by fontid.
-You can use the following variables in the text.
+The text to be displayed is given by text
: It must be written
+between double quotes (but the "
character cannot be part of the
+text). The label is displayed using the font identified by fontid
.
+You can use the following variables in the text:
-Variable | Meaning | |
---|---|---|
$1 | play time in hh:mm:ss format | |
$5 | play time in ss format (seconds) | |
$6 | -movie's length in hh:mm:ss format | movie length in hh:mm:ss format |
$7 | -movie's length in mmmm:ss format | movie length in mmmm:ss format |
$8 | play time in h:mm:ss format | |
$v | @@ -509,7 +565,7 @@filename in upper case | |
$T | a character according to the stream type (file: f ,
- video CD: v , DVD: d , URL: u )
+ Video CD: v , DVD: d , URL: u )
| |
$p | the "p" character (if a movie is playing and the font has the "p" @@ -523,58 +579,46 @@ | the "e" character (if playback is paused and the font has the "e" character) |
+
||
). You should have a font for normal
characters and a different font for symbols.
See the section about symbols for more information.
-
-
-
-"
cannot be part of the text).
-The label is displayed using the font identified by fontid.
+window = sub
' . . . 'end
' block.
base = image, X, Y, width, height
X
,Y
position
+on the screen (0,0
is the top left corner). You can specify
+-1
for center and -2
for right (X
) and
+bottom (Y
). The window will be as large as the image.
+width
and height
denote the size of the window; they
+are optional (if they are missing, the window is the same size as the image).
background = R, G, B
R
, G
and B
specifies the red, green and blue
component of the color (each of them is a decimal number from 0 to 255).
base
item, while the currently selected entry is taken from the image specified
-by the selected item.
-You must define the position and size of each menu entry by the menu
-item.
+by the selected
item. You must define the position and size of each
+menu entry through the menu
item.
-These are the items that can be used in the 'window = menu
'
+These are the entries that can be used in the 'window = menu
'
. . . 'end
' block.
+
base = image
selected = image
menu = X, Y, width, height, message
X,Y
position and the size of a menu entry in
+the image. message
is the message to be generated when
the mouse button is released over the entry.
-The font description file (with .fnt extension) can have comment
-lines starting with ';
'.
-The file must have a line in the form
-
-+The font description file (with-image = image --
.fnt
extension) can have comment
+lines starting with ';
'. The file must have a line in the form
+
--where image is the name of the image file to be used for +
image = image
+image
is the name of the image file to be used for
the font (you do not have to specify the extension).
-The above line is followed by character definition lines of the form:
+-+-"char" = x, y, w, h --
"char" = X, Y, width, height
+X
and Y
specify the position of the
+char
character in the image (0,0
is the upper left
+corner). width
and height
are the dimensions of the
+character in pixels.
+-Here x and y specifies the position of the -char character in the image (0,0 is the upper left corner). -w and h is the width and height of the character -(in pixels, of course). - -
-Here is an example that defines the A, B, C characters using font.png.
+This example defines the A, B, C characters using font.png
.
-; can be "font" instead of "font.png" +; Can be "font" instead of "font.png". image = font.png -; Three characters are enough for demonstration only. :-) +; Three characters are enough for demonstration purposes :-) "A" = 0,0, 7,13 "B" = 7,0, 7,13 "C" = 14,0, 7,13 @@ -673,17 +710,16 @@ |