1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>B.1. Overview</title><link rel="stylesheet" href="default.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="MPlayer - 电影播放器"><link rel="up" href="skin.html" title="附录 B. MPlayer skin format"><link rel="prev" href="skin.html" title="附录 B. MPlayer skin format"><link rel="next" href="skin-file.html" title="B.2. The skin file"><link rel="preface" href="howtoread.html" title="如何阅读此文档"><link rel="chapter" href="intro.html" title="第 1 章 介绍"><link rel="chapter" href="install.html" title="第 2 章 Installation"><link rel="chapter" href="usage.html" title="第 3 章 Usage"><link rel="chapter" href="advaudio.html" title="第 4 章 Advanced audio usage"><link rel="chapter" href="cd-dvd.html" title="第 5 章 CD/DVD用法"><link rel="chapter" href="video.html" title="第 6 章 Video output devices"><link rel="chapter" href="tv.html" title="第 7 章 TV"><link rel="chapter" href="radio.html" title="第 8 章 广播电台"><link rel="chapter" href="ports.html" title="第 9 章 Ports"><link rel="chapter" href="mencoder.html" title="第 10 章 MEncoder的基础用法"><link rel="chapter" href="encoding-guide.html" title="第 11 章 Encoding with MEncoder"><link rel="chapter" href="faq.html" title="第 12 章 Frequently Asked Questions"><link rel="appendix" href="bugreports.html" title="附录 A. 如何报告错误"><link rel="appendix" href="skin.html" title="附录 B. MPlayer skin format"><link rel="subsection" href="skin-overview.html#skin-overview-directories" title="B.1.1. Directories"><link rel="subsection" href="skin-overview.html#skin-overview-formats" title="B.1.2. Image formats"><link rel="subsection" href="skin-overview.html#skin-overview-components" title="B.1.3. Skin components"><link rel="subsection" href="skin-overview.html#skin-files" title="B.1.4. Files"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">B.1. Overview</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="skin.html">上一页</a> </td><th width="60%" align="center">附录 B. <span class="application">MPlayer</span> skin format</th><td width="20%" align="right"> <a accesskey="n" href="skin-file.html">下一页</a></td></tr></table><hr></div><div class="sect1" title="B.1. Overview"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="skin-overview"></a>B.1. Overview</h2></div></div></div><p>
2
It does not really have anything to do with the skin format, but you should
3
know that <span class="application">MPlayer</span> has
4
<span class="bold"><strong>no</strong></span> builtin skin, so
5
<span class="bold"><strong>at least one skin must be installed in order to be able
6
to use the GUI.</strong></span>
7
</p><div class="sect2" title="B.1.1. Directories"><div class="titlepage"><div><div><h3 class="title"><a name="skin-overview-directories"></a>B.1.1. Directories</h3></div></div></div><p>
8
The directories searched for skins are (in order):
9
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
10
<tt class="filename">$(DATADIR)/skins/</tt>
11
</p></li><li class="listitem"><p>
12
<tt class="filename">$(PREFIX)/share/mplayer/skins/</tt>
13
</p></li><li class="listitem"><p>
14
<tt class="filename">~/.mplayer/skins/</tt>
15
</p></li></ol></div><p>
17
Note that the first path may vary according to the way
18
<span class="application">MPlayer</span> was configured (see the
19
<tt class="option">--prefix</tt> and <tt class="option">--datadir</tt>
20
arguments of the <span class="command"><strong>configure</strong></span> script).
22
Every skin is installed into its own directory under one of the directories
23
listed above, for example:
24
</p><pre class="screen">$(PREFIX)/share/mplayer/skins/default/</pre><p>
25
</p></div><div class="sect2" title="B.1.2. Image formats"><div class="titlepage"><div><div><h3 class="title"><a name="skin-overview-formats"></a>B.1.2. Image formats</h3></div></div></div><p>Images must be truecolor (24 or 32 bpp) PNGs.</p><p>
26
In the main window and in the playbar (see below) you can use images with
27
`transparency': Regions filled with the color #FF00FF (magenta) are fully
28
transparent when viewed by <span class="application">MPlayer</span>. This means
29
that you can even have shaped windows if your X server has the XShape extension.
30
</p></div><div class="sect2" title="B.1.3. Skin components"><div class="titlepage"><div><div><h3 class="title"><a name="skin-overview-components"></a>B.1.3. Skin components</h3></div></div></div><p>
31
Skins are quite free-format (unlike the fixed-format skins of
32
<span class="application">Winamp</span>/<span class="application">XMMS</span>,
33
for example), so it is up to you to create something great.
35
Currently there are four windows to be decorated: the
36
<a class="link" href="skin-file.html#skin-file-main" title="B.2.1. Main window and playbar">main window</a>, the
37
<a class="link" href="skin-file.html#skin-file-subwindow" title="B.2.2. Subwindow">subwindow</a>, the
38
<a class="link" href="skin-file.html#skin-file-main" title="B.2.1. Main window and playbar">playbar</a>, and the
39
<a class="link" href="skin-file.html#skin-file-menu" title="B.2.3. Skin menu">skin menu</a> (which can be activated
42
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
43
The <span class="bold"><strong>main window</strong></span> and/or the
44
<span class="bold"><strong>playbar</strong></span> is where you can control
45
<span class="application">MPlayer</span>. The background of the window is an image.
46
Various items can (and must) be placed in the window:
47
<span class="emphasis"><em>buttons</em></span>, <span class="emphasis"><em>potmeters</em></span> (sliders) and
48
<span class="emphasis"><em>labels</em></span>.
49
For every item, you must specify its position and size.
51
A <span class="bold"><strong>button</strong></span> has three states (pressed, released,
52
disabled), thus its image must be divided into three parts vertically. See the
53
<a class="link" href="skin-file.html#skin-button">button</a> item for details.
55
A <span class="bold"><strong>potmeter</strong></span> (mainly used for the seek bar and
56
volume/balance control) can have any number of phases by dividing its image
57
into different parts below each other. See
58
<a class="link" href="skin-file.html#skin-hpotmeter">hpotmeter</a> and
59
<a class="link" href="skin-file.html#skin-potmeter">potmeter</a> for details.
61
<span class="bold"><strong>Labels</strong></span> are a bit special: The characters
62
needed to draw them are taken from an image file, and the characters in the
63
image are described by a
64
<a class="link" href="skin-fonts.html" title="B.3. Fonts">font description file</a>.
65
The latter is a plain text file which specifies the x,y position and size of
66
each character in the image (the image file and its font description file
67
form a font <span class="emphasis"><em>together</em></span>).
68
See <a class="link" href="skin-file.html#skin-dlabel">dlabel</a>
69
and <a class="link" href="skin-file.html#skin-slabel">slabel</a> for details.
70
</p><div class="note" title="注意" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">注意</h3><p>
71
All images can have full transparency as described in the section about
72
<a class="link" href="skin-overview.html#skin-overview-formats" title="B.1.2. Image formats">image formats</a>. If the X server
73
doesn't support the XShape extension, the parts marked transparent will be
74
black. If you'd like to use this feature, the width of the main window's
75
background image must be dividable by 8.
76
</p></div></li><li class="listitem"><p>
77
The <span class="bold"><strong>subwindow</strong></span> is where the movie appears. It
78
can display a specified image if there is no movie loaded (it is quite boring
79
to have an empty window :-)) <span class="bold"><strong>Note:</strong></span>
80
transparency is <span class="bold"><strong>not allowed</strong></span> here.
81
</p></li><li class="listitem"><p>
82
The <span class="bold"><strong>skin menu</strong></span> is just a way to control
83
<span class="application">MPlayer</span> by means of menu entries. Two images
84
are required for the menu: one of them is the base image that shows the
85
menu in its normal state, the other one is used to display the selected
86
entries. When you pop up the menu, the first image is shown. If you move
87
the mouse over the menu entries, the currently selected entry is copied
88
from the second image over the menu entry below the mouse pointer
89
(the second image is never shown as a whole).
91
A menu entry is defined by its position and size in the image (see the
92
section about the <a class="link" href="skin-file.html#skin-file-menu" title="B.2.3. Skin menu">skin menu</a> for
94
</p></li></ul></div><p>
96
There is an important thing not mentioned yet: For buttons, potmeters and
97
menu entries to work, <span class="application">MPlayer</span> must know what to
98
do if they are clicked. This is done by <a class="link" href="skin-gui.html" title="B.4. GUI messages">messages</a>
99
(events). For these items you must define the messages to be generated when
101
</p></div><div class="sect2" title="B.1.4. Files"><div class="titlepage"><div><div><h3 class="title"><a name="skin-files"></a>B.1.4. Files</h3></div></div></div><p>
102
You need the following files to build a skin:
103
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
104
The configuration file named <a class="link" href="skin-file.html" title="B.2. The skin file">skin</a> tells
105
<span class="application">MPlayer</span> how to put different parts of the skin
106
together and what to do if you click somewhere in the window.
107
</p></li><li class="listitem"><p>
108
The background image for the main window.
109
</p></li><li class="listitem"><p>
110
Images for the items in the main window (including one or more font
111
description files needed to draw labels).
112
</p></li><li class="listitem"><p>
113
The image to be displayed in the subwindow (optional).
114
</p></li><li class="listitem"><p>
115
Two images for the skin menu (they are needed only if you want to create
117
</p></li></ul></div><p>
118
With the exception of the skin configuration file, you can name the other
119
files whatever you want (but note that font description files must have
120
a <tt class="filename">.fnt</tt> extension).
121
</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="skin.html">上一页</a> </td><td width="20%" align="center"><a accesskey="u" href="skin.html">上一级</a></td><td width="40%" align="right"> <a accesskey="n" href="skin-file.html">下一页</a></td></tr><tr><td width="40%" align="left" valign="top">附录 B. <span class="application">MPlayer</span> skin format </td><td width="20%" align="center"><a accesskey="h" href="index.html">起始页</a></td><td width="40%" align="right" valign="top"> B.2. The skin file</td></tr></table></div></body></html>