These parameters will allow to create a slider which adapts to the display.
width/height parameters will be optional. If set, the initial slider will
be resized to meet these requirements.
A main use case will be the possibility to create a fullscreen timeslider
that automatically spans the whole screen whatever the screen resolution.
e.g syntax would be <Slider width="100%" ....>
Up to now, text control could but be focusable, and this focus was used
to scroll text, should it be too long for full display.
From a user viewpoint, this behavior is often counterintuitive :
- Most of the time, the control is designed to fit the text anyway, and
scrolling is not expected.
- On the other hand, an underlying control may be used to move the window
(for instance, the title bar), and a text control is expected not to
interact in this endeavor. Same goes for popupmenu, that is expected
to work if one happens to right-click on a text control.
This patch adds a 'focus' attribute to the text control, and leave it to the
skins developper to decide which behavior is most desirable on a per-control
basis. focus still defaults to true to maintain skins current behavior.
So far in skins2, all x, y, width and height were given in pixels, and
no reference to the screen resolution could be made.
This patch implements the following :
- all x, y, width, height can be given in pixels or in % of their container.
For windows, the container is the screen. For widgets, it can be the
layout or a panel.
- Five new tags eases up positioning
- position : relative position given as "Center", "West", "NorthWest", ...
- x/y-margin : margins to take into account (in px or %) wrt the borders.
- x/y-offset : additional offset to apply (in px or %).
- the image control can now accept a width and a height parameters.
This patch gives skins developpers the possibility to display the art file
associated to the current input in an image control.
It features the following :
- a new 'art' boolean parameter is added for the Image control (skin.dtd)
- when set to true, the skin engine will reuse this control to display
the current art file
- in addition to 'scale' and 'mosaic', the resize parameter can now accept
a new 'scale2' value, that respects the original aspect ratio of art files
This loop parameter is intended to run animated images for a given time
In addition, animation is started again in the following cases :
- when visibility changes
- when active layout changes
- New Panel tag, allowing to group the resizing behaviour of controls
- Documentation updated accordingly
- Fixed a memory leak due to CtrlMove/CtrlResize objects
controls. When set to "true", the behaviour of the resizing is changed
(cf. documentation). The main use for these attributes is to keep a
a control centered in the layout (horizontally, vertically or both) without
resizing the control.
- anchors have a new "lefttop" attribute, allowing them to follow the
border of the window when resizing
- the resizing is now handled by the WindowManager class (to enforce the
mediator pattern). This makes it possible to handle tricky cases,
such as:
window B is anchored to window A, and A is resized
==> B moves accordingly, and can still be anchored by other windows
with id "pledit" (defined in the new tag "<IniFile>" contains:
[Text]
Normal=#FFFFFF
it will create a constant "pledit.Text.Normal" with value "#FFFFFF"
* winamp2.xml: use the "pledit.txt" file to have correct playlist colors
is it ok to backport in 0.8.5 ?
XML example:
<PopupMenu id="sample_menu">
<MenuItem label="Play" action="vlc.play()" />
<MenuItem label="Pause" action="vlc.pause()" />
<MenuSeparator />
<MenuItem label="Show playlist" action="playlist_window.show()" />
<MenuItem label="Hide playlist" action="playlist_window.hide()" />
<MenuSeparator />
<MenuItem label="Quick open file" action="dialogs.fileSimple()" />
</PopupMenu>
To call the menu:
<Button action="sample_menu.show()" ... />
Known bug: the popup disappears when the user clicks "too fast" on the
button: the control refreshes itself in an asynchronous way, and the popup
dislikes it... so click slowly :)
"nbFrames" and "fps" in the (Sub)Bitmap elements to set the number
of frames and the frame rate in a bitmap. As in the radialslider,
the different frames are just laid vertically in the bitamp (and
all the frames must have the same size)
At the moment animated bitmaps are only supported in Button controls.
- alignment: possible values are left/right/center (left is the default)
The right and center alignments are computed using the width of the
control (as given by the "width" attribute).
- scrolling: possible values are auto/manual/none (auto is the default)
* auto: same behaviour as before, the text automatically starts
scrolling if it doesn't fit in the width of the control. The user can
still drag it manually.
* manual: only manual scrolling is possible
* none: no scrolling possible
* all: the slider background is now in a dedicaded tag
"SliderBackground". The number of images can now be parametrized
in both directions, and the offset between 2 images (padhoriz and
padvert) is no more hardcoded
depends on the position of the slider. The "Slider" elements now
have optional attributes "background", which the Id of a bitmap,
and "nbimages" which is the number of images in the bitmap (it
is similar to the radialslider). At the moment there is a hack
to support winamp slider bars: the different images must be
separated by 3 rows of unused pixels (well, maybe they are
useful; if someone knows how... ;)
* theme_loader.cpp: convert the file names from zip archives to
lower case, to avoid mixed case issues in some winamp skins
several bitmaps in a skin from regions of the same image file.
Usage is:
<Bitmap id="body" file="main.bmp" alphacolor="#FF0000">
<SubBitmap id="sub1" x="0" y="10" width="100" height="100" />
<SubBitmap id="sub2" x="100" y="10" width="100" height="100" />
</Bitmap>
the method used to resize the image, which can be "mosaic" (the default)
or "scale". Note that the previous behaviour was always "scale" before,
but mosaic is much much faster, so use scale method only for fun ;)
* skins2/*: support of the new mosaic method; playlist resize with this
method is significantly faster!
If you change the layout all anchorings are lost, except for anchors that
are in the same position in the old and the new layouts.
Adding more 'persistent' anchorings should not be very difficult.
font for xmms/winamp2 skins is supported (the bitmap must have the
following layout: [0123456789 -] with letters of size 9x13).
Non-digit characters are just skipped, with a hardcoded advance of 6
(it allows correct display of time in xmms skins; the ':' are skipped)
Small example at http://people.via.ecp.fr/~asmax/chaos.vlt (uncomplete skin)
* vars/time.cpp: notify the observers also when the input is stopped
* controls/ctrl_text.cpp: do not reset the FSM state and timer when the
text is displayed (was causing bugs in time display)
- new "Video" element in the XML
- of course it doesn't work if the vout is launched before
the interface
- known bugs:
- no refresh of the area when there is no vout
- BadDrawable X11 error at exit because the vout still uses
a destroyed window
- hardcoded size
- skins2/theme/skin.dtd: Removed Event and Rectangle tags
- skins2/src/theme.cpp: Destroy curves explicitely
- ALL: Anchors can be defined using a Bezier curve, which allows
rectilinear anchors (but it is still possible to define anchors
reduced to a single point).
A "curved anchor" only attracts "single point anchors"
variable is now owned by CtrlGeneric, and handled directly by the layout
and the window (at the moment only the slider control uses it)
* theme/skin.dtd, parser/builder.cpp, parser, skin_parser.cpp: added
the "color" attribute for control text
- huge cleaning of the interpreter; all the variables are stored in
the container VarManager, and can be retrieved by their name (with
type checking if needed). Some variables are still owned by VlcProc
for technical reasons (their interface is not compliant with normal
variable, because of the "updateVLC" trick)
- replaced double by float
win32, by ipkiss and myself...
Among the features:
- framework rewritten from scratch, heavily based on design patterns
=> new controls can be (hopefully) created more easily, portability
to other OS is better, and the interface is less dependant from
the vlc core
- new concept of "layout", to provide a window with several different
views (as in winamp3 skins)
- controls can now be placed at a relative position to the edges of
a window, which allow controls and layouts to be resizable (e.g
for the playlist window)
- Use of libpng and libfreetype2 for better portability between x11 and
win32 => ttf fonts and antialiasing
- New DTD for the xml theme ( *it will probably change again* )
- Very very beginning of scripting in the xml file
- And many things I miss
- And probably many bugs ;)