1
mirror of https://code.videolan.org/videolan/vlc synced 2024-08-06 16:44:19 +02:00

- doc/skins: some documentation about the skins

- doc/skins/curve_maker: files for a VB project for easy Bezier curves
   creation
 - share/skins/default: a default skin. It's an awful one made for
   testing purposes, you'll be warned...
This commit is contained in:
Olivier Teulière 2003-03-18 02:48:05 +00:00
parent 0648c70a09
commit 70ff1f1695
37 changed files with 1146 additions and 0 deletions

View File

@ -0,0 +1,77 @@
Attribute VB_Name = "Bezier"
Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Declare Function LoadImage Lib "user32" Alias "LoadImageA" (ByVal hInst As Long, ByVal lpsz As String, ByVal un1 As Long, ByVal n1 As Long, ByVal n2 As Long, ByVal un2 As Long) As Long
Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Public Const SRCCOPY = &HCC0020
Global imgDC As Long
Type pts
x As Single
y As Single
End Type
Global ft(30) As Single
Global Pt(30) As pts
Global MaxPt As Long
Sub bezier_draw(nb As Long, OffX As Long, OffY As Long)
Dim i As Long, pas As Single, t As Single, oldx As Single, oldy As Single, x As Single, y As Single
pas = 1 / nb
Call ini_factorielles
oldx = Pt(0).x
oldy = Pt(0).y
For t = pas To 1 Step pas
x = bezier_ptx(t)
y = bezier_pty(t)
ppal.Line (OffX + oldx, OffY + oldy)-(OffX + x, OffY + y), QBColor(ppal.Color.Value)
oldx = x
oldy = y
Next t
For i = 0 To MaxPt
ppal.PSet (OffX + Pt(i).x, OffY + Pt(i).y), QBColor(ppal.Color.Value)
Next i
End Sub
Function bezier_pty(t As Single) As Single
Dim k As Long, i As Long
k = 0
For i = 0 To MaxPt
bezier_pty = bezier_pty + Pt(i).y * melange(k, MaxPt, t)
k = k + 1
Next i
End Function
Function bezier_ptx(t As Single) As Single
Dim k As Long, i As Long
k = 0
For i = 0 To MaxPt
bezier_ptx = bezier_ptx + Pt(i).x * melange(k, MaxPt, t)
k = k + 1
Next i
End Function
Sub ini_factorielles()
ft(0) = 1
For i& = 1 To 30
ft(i&) = ft(i& - 1) * i&
Next i&
End Sub
Sub make_pt(i As Long, x As Long, y As Long)
Pt(i).x = x
Pt(i).y = y
End Sub
Function melange(i As Long, n As Long, t As Single) As Single
melange = CSng(ft(n) / ft(i) / ft(n - i)) * t ^ i * (1 - t) ^ (n - i)
End Function

View File

@ -0,0 +1,391 @@
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
Begin VB.Form ppal
AutoRedraw = -1 'True
BackColor = &H00FFFFFF&
Caption = "VLC skin Curve Maker"
ClientHeight = 7140
ClientLeft = 165
ClientTop = 450
ClientWidth = 10440
Icon = "Bezier.frx":0000
LinkTopic = "Form1"
ScaleHeight = 476
ScaleMode = 3 'Pixel
ScaleWidth = 696
StartUpPosition = 2 'CenterScreen
Begin VB.PictureBox Pict
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 975
Left = 2640
ScaleHeight = 65
ScaleMode = 3 'Pixel
ScaleWidth = 73
TabIndex = 4
Top = 1800
Visible = 0 'False
Width = 1095
End
Begin VB.PictureBox toolbox
Align = 1 'Align Top
BorderStyle = 0 'None
Height = 900
Left = 0
ScaleHeight = 900
ScaleWidth = 10440
TabIndex = 0
Top = 0
Width = 10440
Begin VB.HScrollBar Size
Height = 255
Left = 4920
Max = 5
Min = 1
TabIndex = 3
Top = 480
Value = 1
Width = 2655
End
Begin VB.HScrollBar Color
Height = 255
Left = 4920
Max = 15
TabIndex = 2
Top = 120
Width = 2655
End
Begin VB.TextBox Result
Height = 615
Left = 120
Locked = -1 'True
MultiLine = -1 'True
TabIndex = 1
Top = 120
Width = 4575
End
End
Begin MSComDlg.CommonDialog Cmd
Left = 7560
Top = 120
_ExtentX = 847
_ExtentY = 847
_Version = 327680
End
Begin VB.Menu m_file
Caption = "&File"
Begin VB.Menu m_load
Caption = "Load..."
End
Begin VB.Menu m_saveas
Caption = "Save as..."
End
Begin VB.Menu m_sep1
Caption = "-"
End
Begin VB.Menu m_quit
Caption = "Quit"
End
End
Begin VB.Menu m_picture
Caption = "Picture"
Begin VB.Menu m_loadpicture
Caption = "Load..."
End
End
Begin VB.Menu m_tool
Caption = "Tool"
Visible = 0 'False
Begin VB.Menu m_addpoint
Caption = "AddPoint"
End
Begin VB.Menu m_center
Caption = "Center"
End
End
Begin VB.Menu m_point
Caption = "Point"
Visible = 0 'False
Begin VB.Menu m_deletept
Caption = "Delete"
End
End
End
Attribute VB_Name = "ppal"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim xe As Single
Dim ye As Single
Dim Sel As Long
Dim MouseX As Long
Dim MouseY As Long
Dim SelectPt As Long
Dim PictureFile As String
Dim CurveFile As String
Dim OffsetX As Long
Dim OffsetY As Long
Sub form_draw()
Dim i As Long
Me.Cls
BitBlt ppal.hdc, OffsetX, OffsetY, Pict.Width, Pict.Height, imgDC, 0, 0, SRCCOPY
If MaxPt < 0 Then Exit Sub
Call bezier_draw(40, OffsetX, OffsetY)
Me.DrawWidth = 1
For i = 0 To MaxPt
Me.Line (OffsetX + Pt(i).x - 6, OffsetY + Pt(i).y - 6)-(OffsetX + Pt(i).x + 6, OffsetY + Pt(i).y + 6), QBColor(Color.Value), B
Next i
Me.DrawWidth = Size.Value
End Sub
Sub RefreshResult()
Dim i As Long
Result.Text = "abs="""
For i = 0 To MaxPt
If i > 0 Then Result.Text = Result.Text & ","
Result.Text = Result.Text & Pt(i).x
Next i
Result.Text = Result.Text & """" & Chr$(13) & Chr$(10) & "ord="""
For i = 0 To MaxPt
If i > 0 Then Result.Text = Result.Text & ","
Result.Text = Result.Text & Pt(i).y
Next i
Result.Text = Result.Text & """"
End Sub
Private Sub Color_Change()
form_draw
End Sub
Private Sub Form_Load()
PictureFile = "none"
MaxPt = -1
OffsetX = 0
OffsetY = 0
'Pict.Width = 0
'Pict.Height = 0
Call m_center_Click
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim i As Long
If Button = 2 Then
For i = 0 To MaxPt
If Pt(i).x + OffsetX > x - 5 And Pt(i).x + OffsetX < x + 5 Then
If Pt(i).y + OffsetY > y - 5 And Pt(i).y + OffsetY < y + 5 Then
SelectPt = i + 1
Me.PopupMenu m_point
Exit Sub
End If
End If
Next i
MouseX = x
MouseY = y
Me.PopupMenu m_tool
ElseIf Button = 1 Then
For i = 0 To MaxPt
If Pt(i).x + OffsetX > x - 5 And Pt(i).x + OffsetX < x + 5 Then
If Pt(i).y + OffsetY > y - 5 And Pt(i).y + OffsetY < y + 5 Then
SelectPt = i + 1
Exit Sub
End If
End If
Next i
SelectPt = 0
Me.MousePointer = 5
MouseX = x
MouseY = y
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 1 Then
If SelectPt > 0 Then
Pt(SelectPt - 1).x = x - OffsetX
Pt(SelectPt - 1).y = y - OffsetY
form_draw
Else
OffsetX = OffsetX - (x - MouseX)
OffsetY = OffsetY - (y - MouseY)
MouseX = x
MouseY = y
form_draw
End If
ElseIf Button = 0 Then
For i = 0 To MaxPt
If Pt(i).x + OffsetX > x - 5 And Pt(i).x + OffsetX < x + 5 Then
If Pt(i).y + OffsetY > y - 5 And Pt(i).y + OffsetY < y + 5 Then
SelectPt = i + 1
Me.MousePointer = 10
Exit Sub
End If
End If
Next i
Me.MousePointer = 0
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 1 Then
If SelectPt > 0 Then
SelectPt = 0
form_draw
Call RefreshResult
End If
Me.MousePointer = 0
End If
End Sub
Private Sub m_addpoint_Click()
MaxPt = MaxPt + 1
Call make_pt(MaxPt, MouseX - OffsetX, MouseY - OffsetY)
Call form_draw
Call RefreshResult
End Sub
Private Sub m_center_Click()
OffsetX = (Me.ScaleWidth - Pict.Width) / 2
OffsetY = (Me.ScaleHeight - Pict.Height - toolbox.Height) / 2
form_draw
End Sub
Private Sub m_deletept_Click()
Dim i As Long
MaxPt = MaxPt - 1
For i = SelectPt - 1 To MaxPt
Pt(i).x = Pt(i + 1).x
Pt(i).y = Pt(i + 1).y
Next
form_draw
Call RefreshResult
End Sub
Private Sub m_load_Click()
Dim F As FileSystemObject
Set F = New FileSystemObject
Cmd.filename = CurveFile
Cmd.CancelError = False
Cmd.DialogTitle = "Open Curve"
Cmd.Filter = "Fichier VLC curve |*.curve.vlc"
Cmd.FilterIndex = 0
Cmd.InitDir = App.Path
Cmd.ShowOpen
If Not F.FileExists(Cmd.filename) Then Exit Sub
CurveFile = Cmd.filename
Dim i As Long, l As Long
Open CurveFile For Binary As #1
Get #1, , l
PictureFile = Space$(l)
Get #1, , PictureFile
Get #1, , OffsetX
Get #1, , OffsetY
Get #1, , MaxPt
For i = 0 To MaxPt
Get #1, , Pt(i).x
Get #1, , Pt(i).y
Next i
Close #1
If PictureFile <> "none" Then Pict.Picture = LoadPicture(PictureFile)
Call form_draw
Call RefreshResult
End Sub
Private Sub m_loadpicture_Click()
Dim F As FileSystemObject
Set F = New FileSystemObject
Cmd.CancelError = False
Cmd.DialogTitle = "Open picture"
Cmd.Filter = "Fichier bitmap |*.bmp"
Cmd.FilterIndex = 0
Cmd.InitDir = App.Path
Cmd.ShowOpen
If Not F.FileExists(Cmd.filename) Then Exit Sub
PictureFile = Cmd.filename
Pict.Picture = LoadPicture(Cmd.filename)
Dim HBitmap As Long
HBitmap = LoadImage(0, Cmd.filename, 0, 0, 0, 16)
imgDC = CreateCompatibleDC(0)
SelectObject imgDC, HBitmap
Pict.AutoSize = True
Call m_center_Click
End Sub
Private Sub m_quit_Click()
End
End Sub
Private Sub m_saveas_Click()
Dim F As FileSystemObject
Set F = New FileSystemObject
On Error GoTo error
Cmd.CancelError = True
Cmd.DialogTitle = "Save Curve"
Cmd.Filter = "Fichier VLC curve |*.curve.vlc"
Cmd.FilterIndex = 0
Cmd.InitDir = App.Path
Cmd.ShowSave
CurveFile = Cmd.filename
Dim i As Long
Open CurveFile For Binary As #1
Put #1, , CLng(Len(PictureFile))
Put #1, , PictureFile
Put #1, , OffsetX
Put #1, , OffsetY
Put #1, , MaxPt
For i = 0 To MaxPt
Put #1, , Pt(i).x
Put #1, , Pt(i).y
Next i
Close #1
error:
End Sub
Private Sub Size_Change()
Me.DrawWidth = Size.Value
form_draw
End Sub

Binary file not shown.

View File

@ -0,0 +1,2 @@
ppal = 27, 3, 755, 576, , 87, 80, 858, 718,
Bezier = 125, 26, 841, 710, C

View File

@ -0,0 +1,38 @@
Type=Exe
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINNT\System32\stdole2.tlb#OLE Automation
Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0; COMDLG32.OCX
Reference=*\G{420B2830-E718-11CF-893D-00A0C9054228}#1.0#0#C:\WINNT\System32\scrrun.dll#Microsoft Scripting Runtime
Form=Bezier.frm
Module=Bezier; Bezier.bas
IconForm="ppal"
Startup="ppal"
HelpFile=""
Title="VLC Bezier Curve Maker"
ExeName32="VLC-curve-maker.exe"
Command32=""
Name="Projet1"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=2
AutoIncrementVer=0
ServerSupportFiles=0
VersionLegalCopyright="VideoLAN"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
ThreadPerObject=0
MaxNumberOfThreads=1
[MS Transaction Server]
AutoRefresh=1

196
doc/skins/events-howto.txt Normal file
View File

@ -0,0 +1,196 @@
Before reading this document, you should first take a look at skins-howto.txt
to understand general purpose about VLC skins.
What is an event ?
==================
Events are the dynamic part of the skins. It means that beyond visual aspect,
the interface must react with the user actions. An event describes a simple
interaction, in fact one simple action such as playing a file, hiding a
window...
So when designing a skin you will have to specify what those interactions are.
For this you will use simple actions that are described in event tags and you
would be able to add them and associate them to controls.
How to create an event ?
========================
An event describes a simple action as seen above.
All attibutes are explained in the 'skins-howto.txt' file except the 'event'
attribute wich is a bit special.
In the 'event' attribute you will enter a simple script with the following
syntax :
"EVENT(parameter1,parameter2,...)"
The number of parameters depends on EVENT.
All this is case sensitive.
Don't add spaces.
EVENT is the action to execute, it can be one of the followings
- VLC_NOTHING:
Action : none, it executes nothing so don't use it !
Parameters: none.
- VLC_SHOW:
Action : Open all windows of the interface with a fading effect if
selected.
Parameters: none.
- VLC_HIDE:
Action : Close all windows of the interface with a fading effect if
selected.
Parameters:
- First 1 is an EVENT to execute when all windows have been closed.
- VLC_QUIT:
Action : Quit the interface
Parameters: none.
- VLC_OPEN:
Action : Open an "open file dialog box" to open a file to play.
Parameters: none.
- VLC_LOAD_SKIN:
Action : Open an "open file dialog box" to change the current skin.
Parameters: none.
- VLC_LOG_SHOW:
Not supported yet
- VLC_LOG_CLEAR:
Not supported yet.
- VLC_INTF_REFRESH:
Action : Force refreshing of the interface.
Parameters: none.
- VLC_CHANGE_TRAY:
Action : if VLC is not visible in system tray, show it, else, hide it.
Parameters: none.
- VLC_CHANGE_TASKBAR:
Action : if VLC is not visible in taskbar, show it, else, hide it.
Parameters: none.
- VLC_FULLSCREEN:
Action : switch current playing file to fullscreen mode.
Parameters: none.
- VLC_PLAY:
Action : play stream.
Parameters: none.
- VLC_STOP:
Action : stop playing stream.
Parameters: none.
- VLC_PAUSE:
Action : pause the stream.
Parameters: none.
- VLC_NEXT:
Action : go to next file in playlist.
Parameters: none.
- VLC_PREV:
Action : go to previous file in playlist.
Parameters: none.
- VLC_STREAMPOS:
Not supported yet.
- VLC_VOLUME_CHANGE:
Action : change sound volume.
Parameters:
1: - VLC_VOLUME_MUTE: switch to mute mode.
- VLC_VOLUME_UP: raise sounds volume.
- VLC_VOLUME_DOWN:
- VLC_VOLUME_SET: set sound volume to second parameter
2: if first parameter is VLC_VOLUME_SET only, an integer between 0 and 100.
- VLC_PLAYLIST_ADD_FILE:
Action : Open an "open file dialog box" to add files to playlist.
Parameters: none.
- VLC_WINDOW_MOVE:
Action : initiate manual window movement.
Parameters: only one which must match the ID of a window. It should be
used with image controls.
- VLC_WINDOW_OPEN:
Action : open a window with a fading effect if selected.
Parameters: only one which must match the ID of a window.
- VLC_WINDOW_CLOSE:
Action : close a window with a fading effect if selected.
Parameters: only one who must match the ID of a window.
- CTRL_SET_SLIDER:
Not supported yet.
- CTRL_SET_TEXT:
Not supported yet.
- CTRL_ID_VISIBLE:
Action : hide/show a control.
Parameters:
1: ID of the control to hide/show.
2: Describe what to do. Nothing is showing control. TRUE is the same. FALSE
is hiding control. CHANGE is switching between this to state.
- CTRL_ID_ENABLED:
Not supported yet.
- CTRL_ID_MOVE:
Action : moves a control.
Parameters:
1: ID of the control to move.
2: horizontal offset of movement.
3: vertical offset of movement.
- PLAYLIST_ID_DEL:
Action : remove items from playlist.
Parameters:
1: ID of the playlist.
What to do with event ?
=======================
When creating your event, you must assign an ID to each of them.
Now you have to associate events with controls.
Some attributes of some controls are supposed to be filled with those IDs. That
is to say that when the action correspounding to the attribute will be done,
the event associated will be executed. The best exemple is assigning an event
to the 'onclick' attribute of a button control. The event will be executed when
clicking on the button.
You can execute several events. To do this you just have to separate them with
semicolon.
Exemple:
<ButtonControl [...] onclick="event1;event2;event3"/>
Do I have to create every event for each skin ?
===============================================
No, a set of predefined events are present. Here they are with their ID and
shortcut.
ID Shortcut Description
tray CTRL+T Hide or show in the system tray.
taskbar CTRL+B Hide or show in the taskbar.
play X Play.
pause C Pause.
stop V Stop.
next B Next file.
prev Z Previous file.
fullscreen F Switch to fullscreen mode.
mute Mute the sound.
volume_up
volume_down
quit CTRL+C Quit VLC.
open CTRL+O Open a file.
add_file CTRL+A Add a file.
load_skin CTRL+S Change skin.

337
doc/skins/skins-howto.txt Normal file
View File

@ -0,0 +1,337 @@
Note: This document is short and highly incomplete. If you want to write a new,
decent one, it will be more than welcome!
Basic principles
================
A skin (or theme, the two words have almost the same meaning) for VLC is made
of many BMP files (Windows Bitmap format) containing all the images needed, and
of an XML file describing how these images should be displayed, what happens
when the user clicks on a button, etc.
Those of you who have already done skins for other softwares shouldn't have too
many difficulties to understand how all this works.
Bezier curves
=============
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 !
This is not the place to explain how these curves work, the only thing to know
is that a Bezier curve can be caracterised by a set of points. Once you have
them (thanks to the graphical utility presented at the end of this file, for
example), you just need to enter the list of abscissas in the 'abs' attribute
and the list of ordinates (in the same order...) in the 'ord' attribute. The
separator is the coma. Example: abs="2,45,88" ord="50,120,50"
Bezier curves are used for the SliderControl and the PlaylistControl tags.
The bitmaps
===========
Basically, you need one bitmap file by state of control. For example, with a
image control you'll need 1 image, with a button 2 images (or 3 if you provide
the disabled state). A slider will also need 2, one for the static part and
another for the mobile part. Of course, the same bitmap file can be used for
many controls, provided you want to display the same image!
The bitmap format doesn't allow a transparent color, but in the XML file you
can specify a color that will be considered as transparent wherever it appears
in the bitmap file.
The XML file
============
XML is a markup language, like HTML. It won't be explained here any further,
please use Google if you don't know what is XML. You'll see, it's rather easy
to understand.
The XML file used for the VLC skins follows a predefined DTD. You can find this
DTD in VLC CVS, and its reading is strongly advised, since it contains most of
the default values used for the parameters. A skin that doesn't follow the DTD
with which VLC was compiled won't be loaded by VLC (and it might even crash
it...).
For a better comprehension of what follows, you should have a look at the DTD
(in modules/gui/skin/parser/dkin.dtd) and/or at an example of valid xml skin
(such as modules/gui/skin/skins/default/theme.xml).
OK, let's go for an enumeration of the different tags and theor attributes :
- Theme: The main tag.
Attributes:
- magnet: allows to select the range of action (in pixels) of magnetism
with border of screen : that is to say when the distance between the
border of the screen and a window is less than this value, the window
will stick to the border. 0 means no magnetism.
Default is "9".
- log: not yet supported.
- ThemeInfo: You can enter here some information about you (but this
information is currently unused by VLC...)
Attributes :
- name: not yet supported.
- author: not yet supported.
- email: not yet supported.
- webpage: not yet supported.
- Bitmap: Associates a bitmap file with a name (=identifiant) that will be
used by the various controls. Obviously, you need one Bitmap tag for each
bitmap file you have.
Attributes:
- id: this is the name of the bitmap that will be used with controls
( 2 bitmaps shouldn't have the same name).
- alphacolor: this is the 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).
- file: this attribute is used to indicate the path and name of the bitmap
file used. This path can be absolute (but you should avoid it as often as
possible), else it will be relative to the path of the xml file.
- Event: An action that will be associated to a control later.
Attributes :
- id: this is the name of the event that will be used with controls.
(2 events shouldn't have the same name).
- event: see event.howto.
- key: this is the shortcut key associated with the event. This means that
the event will be executed when hitting the correspounding key. It must
be indicated with following format : "MOD+L" where MOD is "CTRL" or "ALT"
if control or alt keys or associated the key and "L" is the letter and
must be in uppercase format ("MOD+" is optionnal).
Default is "none".
- Font: Declares a font to be used in a TextControl or PlaylistControl.
Attributes :
- id: this is the name of the event that will be used with controls
Default is "default". (2 fonts shouldn't have the same name).
- font: this is the name of the font
Default is "arial".
- size: this is the size of the police in point
Default is "12".
- color: this is the color of the font with the following format,
"#RRGGBB" (see bitmap).
Default is "#000000" (black).
- weight: this is the weight of the font. It must be between 0 and 1000
Default is "400" (normal weight). Fewer is thinner...
- italic: sets if the font must be in italic format.
Default is "false".
- underline: sets if the font must be underlined.
Default is "false".
- Window: A window that will appear on screen.
- id: this is the name of the window (it will be only used for events
but it is important : 2 windows shouldn't have the same name).
- visible: sets if the window should appear or not at the launch of VLC.
Default is "true".
- x: sets the left position of the window.
Default is "0".
- y: sets the top position of the window.
Default is "0".
- fadetime: sets the time in milliseconds of the hide/show fading
transition.
Default is "500".
- alpha: sets the transparency of the window. It must be between 1 and
255. 1 is nearly total transaprency and should be avoid. 255 is total
opacity.
Default is "255". You should use high values.
- movealpha: sets the transparency of the window when the window is
moving. Same range as alpha.
Default is "255".
- dragdrop: sets if drag and drop of media files is allowed in this
window.
Default is "true".
- ControlGroup: Adds an offset to the elements it contains. A ControlGroup 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 ControlGroup is necessary, just
inside Window). ControlGroup tags can be nested.
Attributes :
- x: try and guess.
Default is "0".
- y: what do you think ?
Default is "0".
- Anchor: Creates a "magnetic point" 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 ('priority' 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 linked
anchors, you need to move the Window whose anchor has the lower priority.
Attributes :
- x: is it really necessary to explain ?
Default is "0".
- y: ...
Default is "0".
- priority: priority of anchor (see the previous description).
No default, must de defined !!!
- range: Range of action in pixel of the anchor.
Default is "10".
- ImageControl, ButtonControl, CheckBoxControl, TextControl, SliderControl,
PlaylistControl: The various visual controls that constitute a Window. They
share some properties: 'x' and 'y' for the position, 'visible' for the
initial state, 'id' for identifying them (only needed if you want to create
an event acting on this particular control) and 'help' for a short
description of the control that could be displayed in a special TextControl
(see below). All the controls can also accept events, and you have the
possibility to associate many events to a control at once, separing them
with semicolons.
- ImageControl: Creates a simple image. Usefull for backgrounds.
- image: this attribute must be set to an identifiant of a Bitmap tag.
- onclick: the 'event' attribute can be used to associate an event to the
image (the event is triggered by a click on the image).
Typical use: an Event made with 'WINDOW_MOVE(window)' (where 'window' is
the name of a Window) can be associated to an ImageControl of this
Window. Hence the Window can be moved via the image...
- ButtonControl: Creates a button.
- up: identifiants of a bitmap. Used for drawing the up state of the
button.
- down: identifiants of a bitmap. Used for drawinf the down state of the
button.
- disabled : identifiants of a bitmap. Used for drawing the disabled state
of the button.
- onclick: event executed when clicking on the button.
Default is "none".
- tooltiptext : used to display a tooltip.
Default is "none". (no tooltip).
- CheckBoxControl: Creates 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, an image corresponding to a click not yet released,
and an image for the disabled control. If you supply only the basic images,
the other ones will be identical.
Attributes:
- img1: identifiants of a bitmap. Used for drawing control in state 1.
- clickimg1: identifiants of a bitmap. Used for drawing control when
clicking on it in state 1.
Default is the value of 'img1' attribute.
- img2: identifiants of a bitmap. Used for drawing control in state 2.
- clickimg2: identifiants of a bitmap. Used for drawing control when
clicking on it in state 2.
Default is the value of 'img2' attribute.
- disabled1: identifiants of a bitmap. Used for drawing control in state 1
when disabling.
Default is the value of 'img1' attribute.
- disabled2: identifiants of a bitmap. Used for drawing control in state 1
when disabling.
Default is the value of 'img2' attribute.
- onclick1: event executed when clicking on the control in state 1.
Default is "none".
- onclick2: event executed when clicking on the control in state 2.
Default is "none".
- TextControl: Creates a text.
Attributes:
- font: the font to use, which must be one of the Font identifiants.
- text: the text to display.
- align: either 'left' or 'center' or 'right'.
Default is "left".
- scroll: if set to 'true', the text will scroll if it does not fit into
the 'scrollspace'.
Default is "true".
- scrollspace: size in pixel between two occurences of the text when
scrolling.
Default is "20".
- display: this value is a bit special, it allows to have a text
auto-updated by VLC. Possible values are 'time', 'left_time',
'total_time', 'file_name' (for the current file name) and 'help'
(for a help about the controls that defined their 'help' attribute).
You can specify several type by separating them with semicolons. TO
switch between then, just double click on the text.
Usefull to switch betxeen 'time' and 'left_time'.
- width: Width of the text in pixel. If set to "0", the width is
automatically calculated to fit with the current text.
Default is "0".
- SliderControl: Creates a slider. The 'abs' and 'ord' attributes are needed
for the Bezier curve that the slider will follow. 'up' and 'down' are the
images of the slider. The 'tooltiptext' attribute works, and the slider will
automatically append the percentage of the position.
Attributes:
- type: two 'types' of sliders are predefined: 'time' for a slider
allowing to seek in the stream, and 'volume' for a volume slider.
Default is "time".
- up: identifiants of a bitmap.
- down: identifiants of a bitmap.
- abs: see SliderControl description and bezier curve description.
- ord: see SliderControl description and bezier curve description..
- tooltiptext: see button.
Default is "none". Disable tooltip.
- PlaylistControl: Creates a playlist. This tag must contain a SliderControl
tag (to allow scrolling in the playlist). If the playlist contains entries
wider than the list width, an automatic tooltip will appear with
the full name of the entry. The other attributes are rather easy to
understand...
Attributes:
- width: width in pixel of the list. This is the whole width for file
name, number of file in the playlist and info text.
Default is "200".
- infowidth: width in pixel of the info text.
Default is "50".
- font: the font to use, which must be one of the Font identifiants.
- playfont: the font to use for current playing file, which must be one of
the Font identifiants.
Default is "none".
- selcolor: color in "#RRGGBB" format of the selected files.
Default is "#0000FF" (blue).
- abs: see PlaylistControl description and bezier curve description.
- ord: see PlaylistControl description and bezier curve description.
Compression
===========
Once your skin is finished, instead of keeping many bitmap files and the XML
file, you can compress them in a .tar.gz archive (Winzip and UmtimateZip can do
it perfectly, for example). Before doing so, don't forget to rename your XML
file into "theme.xml", or VLC won't be able to read it... Then rename your
compressed file with the .vlt extension and... that's all! VLC can load
directly skins with the .vlt extension.
Tools and advice
================
- To generate easily Bezier curves, you can use the curve-maker. 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 ob abscissas and ordinates in the 'abs' and 'ord'
attributes of your SliderControl or PlaylistControl. The curve-maker also
allows to load a bitmap, this could be useful if you want to follow a
specific pattern of a slider, for example.
- When you are creating your skin, you may want to see the VLC messages where
some errors are logged. For this, open a dos window, go to the directory
where VLC is installed, and type "vlc -I skin -v --extraintf logger". This
should open VLC and a log window (what's more, the logs should be saved in a
file called vlc-log.txt). The interesting lines are those with "skin
interface"...
- For the Bitmap tags, don't 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.
- To fully use the possibilities given, you should look at how other skins are
made, it's often very useful.
Good luck!

BIN
share/skins/default/b1.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,105 @@
<!DOCTYPE Theme SYSTEM "skin.dtd">
<Theme>
<ThemeInfo name="skin-test" author="Emmanuel Puig"
email="magic@karibu.org" webpage=""/>
<Bitmap id="body" file="skin-test/body.bmp" alphacolor="#FF0000"/>
<Bitmap id="q_up" file="skin-test/quit_up.bmp" alphacolor="#FF0000"/>
<Bitmap id="q_down" file="skin-test/quit_down.bmp" alphacolor="#FF0000"/>
<Bitmap id="b1_up" file="skin-test/b1_up.bmp" alphacolor="#FF0000"/>
<Bitmap id="b1_down" file="skin-test/b1_down.bmp" alphacolor="#FF0000"/>
<Bitmap id="b2_up" file="skin-test/b2_up.bmp" alphacolor="#FF0000"/>
<Bitmap id="b2_down" file="skin-test/b2_down.bmp" alphacolor="#FF0000"/>
<Bitmap id="b3_up" file="skin-test/b3_up.bmp" alphacolor="#FF0000"/>
<Bitmap id="b3_down" file="skin-test/b3_down.bmp" alphacolor="#FF0000"/>
<Bitmap id="b3_dis" file="skin-test/b3_disabled.bmp" alphacolor="#FF0000"/>
<Bitmap id="b4_up" file="skin-test/b4_up.bmp" alphacolor="#FF0000"/>
<Bitmap id="b4_down" file="skin-test/b4_down.bmp" alphacolor="#FF0000"/>
<Bitmap id="b4_dis" file="skin-test/b4_disabled.bmp" alphacolor="#FF0000"/>
<Bitmap id="b5_up" file="skin-test/b5_up.bmp" alphacolor="#FF0000"/>
<Bitmap id="b5_down" file="skin-test/b5_down.bmp" alphacolor="#FF0000"/>
<Bitmap id="b5_dis" file="skin-test/b5_disabled.bmp" alphacolor="#FF0000"/>
<Bitmap id="b6_up" file="skin-test/b6_up.bmp" alphacolor="#FF0000"/>
<Bitmap id="b6_down" file="skin-test/b6_down.bmp" alphacolor="#FF0000"/>
<Bitmap id="b7_up" file="skin-test/b7_up.bmp" alphacolor="#FF0000"/>
<Bitmap id="b7_down" file="skin-test/b7_down.bmp" alphacolor="#FF0000"/>
<Bitmap id="slider" file="skin-test/slider.bmp" alphacolor="#FF0000"/>
<Bitmap id="cursor_up" file="skin-test/cursor_up.bmp" alphacolor="#FF0000"/>
<Bitmap id="cursor_down" file="skin-test/cursor_down.bmp" alphacolor="#FF0000"/>
<Bitmap id="log_up" file="skin-test/log_up.bmp" alphacolor="#FF0000"/>
<Bitmap id="log_down" file="skin-test/log_down.bmp" alphacolor="#FF0000"/>
<Bitmap id="playlist" file="skin-test/playlist.bmp" alphacolor="#FF0000"/>
<Bitmap id="DEFAULT_VLC_NULL_IMAGE" file="skin-test/cursor_down.bmp" alphacolor="#FF0000"/>
<Event id="move_main" event="WINDOW_MOVE(mainwindow)"/>
<Event id="move_main2" event="WINDOW_MOVE(mainwindow2)"/>
<Event id="move_child" event="WINDOW_MOVE(child)"/>
<Event id="hide_child" event="WINDOW_CLOSE(child)"/>
<Event id="show_child" event="WINDOW_OPEN(child)"/>
<Event id="hide_test" event="CTRL_ID_VISIBLE(test)"/>
<Font id="time" font="system" size="7" color="#00FF00"/>
<Font id="defil" font="system" size="7" color="#000000"/>
<Font id="help" font="system" size="8" color="#000000"/>
<Font id="playlist" font="arial" size="8" color="#00FF00" weight="200"/>
<Font id="playlist2" font="arial" size="8" color="#FFFFFF" weight="200"/>
<Window id="mainwindow" x="100" y="100" alpha="255" fadetime="500" movealpha="192">
<ControlGroup x="0" y="0">
<ImageControl x="5" y="5" image="body" onclick="move_main"/>
<ButtonControl x="0" y="0" up="q_up" down="q_down" onclick="quit" tooltiptext="quit" help="test"/>
<!--<CheckBoxControl x="250" y="5" img1="log_up" img2="log_down" action1="show_log" action2="hide_log"/>
-->
<TextControl font="time" align="right" x="155" y="21" width="100" text="0:00:00" display="time;left_time"/>
<TextControl font="help" align="center" x="105" y="61" width="150" text=" " display="help"/>
<CheckBoxControl x="250" y="50" img1="log_up" img2="log_down" onclick1="show_child" onclick2="hide_child"/>
<ControlGroup x="9" y="122">
<ControlGroup x="0" y="0">
<ButtonControl x="-27" y="0" up="b1_up" down="b1_down" onclick="show_child"/>
<ButtonControl x="0" y="0" up="b1_up" down="b1_down" onclick="open"/>
<ButtonControl x="27" y="0" up="b2_up" down="b2_down" onclick="prev"/>
<ButtonControl x="54" y="0" up="b3_up" down="b3_down" disabled="b3_dis" onclick="stop"/>
</ControlGroup>
<ButtonControl x="81" y="0" up="b4_up" down="b4_down" disabled="b4_dis" onclick="play"/>
<ControlGroup x="107" y="0">
<ButtonControl x="0" y="0" up="b5_up" down="b5_down" disabled="b5_dis" onclick="pause"/>
<ButtonControl x="27" y="0" up="b6_up" down="b6_down" onclick="next"/>
<ButtonControl x="54" y="0" up="b7_up" down="b7_down" onclick="load_skin"/>
<ButtonControl x="81" y="0" up="b7_up" down="b7_down" onclick="hide_test"/>
<ButtonControl id="test" x="108" y="0" up="b7_up" down="b7_down" onclick="fullscreen"/>
</ControlGroup>
</ControlGroup>
<ControlGroup x="9" y="92">
<ImageControl x="0" y="0" image="slider"/>
<SliderControl up="cursor_up" down="cursor_down" abs="10,184" ord="10,10" tooltiptext="Time"/>
</ControlGroup>
<ControlGroup x="9" y="172">
<ImageControl x="0" y="0" image="slider"/>
<SliderControl type="volume" up="cursor_up" down="cursor_down" abs="10,184" ord="10,10" tooltiptext="Sound"/>
</ControlGroup>
</ControlGroup>
</Window>
<Window id="child" x="350" y="100" alpha="255" fadetime="500" movealpha="192">
<ControlGroup x="0" y="0">
<ButtonControl x="0" y="0" up="q_up" down="q_down" onclick="quit"/>
<ImageControl x="0" y="0" image="playlist" onclick="move_child"/>
<PlayListControl font="playlist" playfont="playlist2" abs="119,87,100" ord="36,182,200">
<SliderControl up="cursor_up" down="cursor_down" abs="265,310,321,330,327,315,308" ord="20,36,62,87,107,119,134"/>
</PlayListControl>
</ControlGroup>
</Window>
</Theme>