Commit Graph

33 Commits

Author SHA1 Message Date
Erwan Tulou 91a9eee8d9 skins2: add width/height parameters to slider
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%" ....>
2013-06-22 18:29:45 +02:00
Erwan Tulou 81717b48cd skins2: implement a new 'focus' attribute for text control
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.
2010-12-11 15:24:33 +01:00
Erwan Tulou 6f772953ac skins2: implement relative positioning
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.
2010-11-22 16:22:27 +01:00
Erwan Tulou 0530638a50 skins2: implement art display in image controls
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
2010-05-18 22:10:53 +02:00
Erwan Tulou 01461816d8 skins: update skins dtd (new loop parameter) 2009-12-27 13:24:13 +01:00
Daniel Dreibrodt 8a5a4a2d23 Skins2: change DTD to add possibility to store ID for Anchors, Panels and Groups.
It adds possibility to store IDs for Anchors, Panels and Groups.
This does not change the way skins2 works I believe. It just stops the
XML parser from complaining about non standard skins when they have set
IDs for those elements. And setting IDs for them is vital in the skin
editor, as it differentiates between different elements in the skin just
by their ID.
2009-02-01 18:19:48 +01:00
Olivier Teulière 1650c7648c Allow controls directly in the Layout tag (the intermediate Group tag is not mandatory anymore). 2007-09-27 18:04:45 +00:00
Olivier Teulière 8086b07cf0 * skins2:
- New Panel tag, allowing to group the resizing behaviour of controls
    - Documentation updated accordingly
    - Fixed a memory leak due to CtrlMove/CtrlResize objects
2007-01-28 16:49:30 +00:00
Olivier Teulière dda858d436 * skins2: new "xkeepratio" and "ykeepratio" attributes, common to all the
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.
2006-08-05 13:37:06 +00:00
Olivier Teulière 24648f43cf * modules/gui/skins2/*:
- 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
2006-06-03 23:57:40 +00:00
Cyril Deguet a5a9346ce5 * all: added a INI file parser in skins2. For instance if the file
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 ?
2006-04-17 12:46:51 +00:00
Antoine Cellerier 832b6848b6 Fix dtd (a Layout can have more than one groups) 2006-04-15 22:33:27 +00:00
Antoine Cellerier 3cbb889e73 Ooops, i forgot to commit this in [14771] 2006-04-04 21:21:23 +00:00
Cyril Deguet 1d02365417 * attribute "nbFrames" of element Bitmap is now "nbframes", as said in the
documentation (and the old name was inconsistent with other attribute names)
 Sorry for the compatibility break...
2006-03-25 11:01:03 +00:00
Olivier Teulière 87d12b49df * share/skins2/skin.dtd: Video.autoresize defaults to true
* doc/skins/skins2-howto.xml: Added documentation for this attribute
2005-12-04 16:54:17 +00:00
Olivier Teulière 8a3513c025 * skins2: support for custom popup menus, and win32 implementation.
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 :)
2005-12-04 14:47:26 +00:00
Olivier Teulière 191dc6be6b * share/skins2/skin.dtd: fixed a typo 2005-12-03 22:46:33 +00:00
Cyril Deguet 07391315eb * all: support of animated bitmaps in skins: there are new attributes
"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.
2005-12-03 11:43:35 +00:00
Olivier Teulière 5c4ccbb149 * skins2: The Image control now supports the "action2" attribute (feel free to
suggest a better name :)), triggered by a double click.
   Very kewl to change the layout...
2005-11-28 21:01:07 +00:00
Olivier Teulière e2cc1fabee * skins2: the Text control now supports 2 additional attributes:
- 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
2005-11-15 20:00:04 +00:00
Cyril Deguet b704f90f33 * winamp2.xml: all the equalizer sliders are working !!
* 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
2005-11-10 22:30:22 +00:00
Olivier Teulière 4ad69b4e4a * skins2: experimental support for the <Include file="foo.xml"/> tag.
Be warned, no DTD validation is done on the included XML file, and the
   loading will fail if it contains several top-level tags.
2005-11-09 22:47:18 +00:00
Cyril Deguet e0352f9138 * all: the skin sliders can now have a background image, which
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
2005-11-08 20:26:13 +00:00
Cyril Deguet 1ada3176c1 * all: added a new xml element: "SubBitmap". It allows to define
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>
2005-11-06 14:23:16 +00:00
Cyril Deguet 6b229b7e4d * all: added an attribute "autoresize" to the Video control.
When it is set to "true", the window is automatically resized
  when the vout size changes.
2005-11-01 15:53:07 +00:00
Antoine Cellerier 4d28264511 * skin.dtd : add Playtree stuff
* playtree.vlt : default.vlt modified to use a Playtree instead of a
                  Playlist
2005-08-20 00:20:53 +00:00
Olivier Teulière d59a067be7 * skins2: New Playlist.bgimage attribute, to specify a background image for
the Playlist control. If no image is specified (default behaviour), the
   background is filled like before, with the bgcolor1 and bgcolor2 attributes.
2005-05-14 14:39:05 +00:00
Cyril Deguet f07020df7a * skin.dtd: added an attribute "resize" in the "Image" element, to define
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!
2005-05-04 20:52:43 +00:00
Olivier Teulière e446629b59 * skins2: Text control now accepts lefttop and rightbottom attributes, like
most other controls. The text is not really resized though (only cropped
   when needed).
   The change in the DTD is backwards-compatible.
2005-04-03 12:56:25 +00:00
Cyril Deguet 3edd27b7cf - skin.dtd: a Playlist may not have a Slider 2004-10-18 21:16:58 +00:00
Olivier Teulière ac01cdf7c0 * skins2: Removed the Theme.fadetime attribute (unused) 2004-05-12 18:56:51 +00:00
Olivier Teulière d10776c2c6 * share/skins2/skin.dtd: removed a useless attribute 2004-05-04 19:50:43 +00:00
Cyril Deguet f812f2cb8d * all: the DTD lookup for skins2 themes now use XML catalogs:
The XML file must begin with:
    <!DOCTYPE Theme PUBLIC "-//VideoLAN//DTD VLC Skins V2.0//EN" "skin.dtd">
    (the "skin.dtd" is ignored but should be an URL on the website)
    and the DTD is looked up at runtime in the directories of the resource
    path (see previous commit), e.g /usr/local/share/vlc/skins2/skin.dtd
    -> the DTD doesn't need any more to be shipped with the themes.
2004-04-12 17:08:58 +00:00