From 1d3cd38e88ae97dd6906f9818d52b9ef07bf057d Mon Sep 17 00:00:00 2001 From: lordjaxom Date: Wed, 16 Jun 2004 18:50:57 +0000 Subject: - fixed disappearing Scrolltext when Message was displayed - fixed display-items "MenuScrollUp" and "MenuScrollDown" which didn't display any other items than "Symbol" - fixed the above for all replay- and channel-symbols (for all display-items that can be symbols there must be path, altpath or both to tell the plugin if that item is to be drawn if the symbol is on, off or in both cases) - fixed various memory leaks and missing destructions (valgrind rox) - fixed the image loaders to respect the alpha value and palette properly (this hopefully also fixes the phenomenon that images "get lost" after some time) - added display-item "Scrollbar" - SKINS and SKINS.de are now generated during the make --- HISTORY | 16 ++ Makefile | 12 +- README | 19 +- SKINS | 565 --------------------------------------------- SKINS.de | 259 --------------------- bitmap.c | 79 ++++--- bitmap.h | 12 +- cache.h | 11 +- common.c | 9 +- common.h | 11 +- contrib/items.doc | 620 ++++++++++++++++++++++++++++++++++++++++++++++++++ contrib/list_items.pl | 173 ++++++++++++++ data.c | 29 ++- deprecated/SKINS | 565 +++++++++++++++++++++++++++++++++++++++++++++ deprecated/SKINS.de | 259 +++++++++++++++++++++ display.c | 4 +- i18n.c | 14 +- loader.c | 3 +- render.c | 57 +++-- render.h | 9 +- text2skin.c | 4 +- theme.c | 6 +- 22 files changed, 1813 insertions(+), 923 deletions(-) delete mode 100644 SKINS delete mode 100644 SKINS.de create mode 100644 contrib/items.doc create mode 100755 contrib/list_items.pl create mode 100644 deprecated/SKINS create mode 100644 deprecated/SKINS.de diff --git a/HISTORY b/HISTORY index 243fedb..c4c1520 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,22 @@ VDR Plugin 'text2skin' Revision History --------------------------------------- +2004-06-16: Version 0.0.5 + +- fixed disappearing Scrolltext when Message was displayed +- fixed display-items "MenuScrollUp" and "MenuScrollDown" which didn't display + any other items than "Symbol" +- fixed the above for all replay- and channel-symbols + (for all display-items that can be symbols there must be path, altpath or + both to tell the plugin if that item is to be drawn if the symbol is on, + off or in both cases) +- fixed various memory leaks and missing destructions (valgrind rox) +- fixed the image loaders to respect the alpha value and palette properly + (this hopefully also fixes the phenomenon that images "get lost" after some + time) +- added display-item "Scrollbar" +- SKINS and SKINS.de are now generated during the make + 2004-06-13: Version 0.0.4 - added parameter alpha for images diff --git a/Makefile b/Makefile index ddf7267..3d35506 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ HAVE_IMAGEMAGICK=1 # DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING # ------------------------------------------------------------- # -# $Id: Makefile,v 1.10 2004/06/12 18:00:05 lordjaxom Exp $ +# $Id: Makefile,v 1.11 2004/06/16 18:46:50 lordjaxom Exp $ # # The official name of this plugin. @@ -90,10 +90,16 @@ $(DEPFILE): Makefile all: libvdr-$(PLUGIN).so -libvdr-$(PLUGIN).so: $(OBJS) +libvdr-$(PLUGIN).so: $(OBJS) SKINS SKINS.de $(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -o $@ @cp $@ $(LIBDIR)/$@.$(VDRVERSION) +SKINS: contrib/items.doc + @contrib/list_items.pl >$@ + +SKINS.de: contrib/items.doc + @contrib/list_items.pl de >$@ + dist: clean @-rm -rf $(TMPDIR)/$(ARCHIVE) @mkdir $(TMPDIR)/$(ARCHIVE) @@ -103,4 +109,4 @@ dist: clean @echo Distribution package created as $(PACKAGE).tgz clean: - @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ + @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ SKINS SKINS.de diff --git a/README b/README index 16c11f3..1faba7d 100644 --- a/README +++ b/README @@ -53,7 +53,9 @@ Installation: Install text2skin like any other plugin. In this example I assume that you have changed to the folder where the VDR sourcecode is located, and that it is -version 0.0.1 of the plugin you wish to install. +version 0.0.1 of the plugin you wish to install. During the build process, +there will be generated two files called SKINS and SKINS.de, the skin format +documentation. root@linux # cd PLUGINS/src root@linux # wget http://www.magoa.net/linux/contrib/vdr-text2skin-0.0.1.tgz @@ -63,6 +65,13 @@ root@linux # cd ../.. root@linux # make plugins root@linux # ./vdr -P text2skin +If you are using VDR 1.3.10, your have to apply a patch to the sources of VDR. +This patch will hopefully be included in VDR 1.3.11. + +root@linux # patch -p1 < PLUGINS/src/text2skin/patches/vdr-1.3.10-scroller.diff +root@linux # make vdr +root@linux # ./vdr -P text2skin + If you are using VDR 1.3.9, you also have to apply a patch to the sources. This patch will be included in VDR 1.3.10. @@ -85,9 +94,11 @@ Inside that "plugins" folder, create a subfolder called "text2skin". Inside same names as the skins residing in them. Each skin must at least have a file carrying the same name, but ending in ".skin". Example: -/video0/plugins/text2skin/demo/demo.skin -/video0/plugins/text2skin/skin2/skin2.skin -... +Example (the Skin is called myskin): +/video0/plugins/text2skin/ +/video0/plugins/text2skin/myskin/ +/video0/plugins/text2skin/msykin/msykin.skin +/video0/plugins/text2skin/myskin/channeldisplay.png The other files inside the skin-folder are additional description files (for Themeing and Translation), images, logos and symbols. diff --git a/SKINS b/SKINS deleted file mode 100644 index da5ea09..0000000 --- a/SKINS +++ /dev/null @@ -1,565 +0,0 @@ - - -THIS DOCUMENT IS NOT UP-TO-DATE (sorry) - - -How To create text-based skins ------------------------------- - -[ TODO remove this ] -You may encounter bracketed phrases in this document. Please ignore them, they -are comments for me which will be removed in official release versions. - -[ TODO move this to manual ] -The Skin itself is located in a subdirectory "text2skin" inside the "plugins" -directory of your VDR configuration directory. This usually is the video -directory, if you didn't specify -c on the commandline. If you did, the -subdirectory is located there. Each skin has an own subdirectory there, which -holds the skin description file and the needed image files. The skin -description file must have the same name as the skin directory, with the -extension ".skin" - -Example (the Skin is called myskin): -/video0/plugins/text2skin/ -/video0/plugins/text2skin/myskin/ -/video0/plugins/text2skin/msykin/msykin.skin -/video0/plugins/text2skin/myskin/channeldisplay.png - -It is important that you understand the limitations of the OSD memory. If there -are too many objects with too many colors defined, VDR will throw an error and -some areas will not be displayed. For other output devices this limitations may -not apply, so if you are planning to design a skin for another output device, -feel free to use more colors, but remember that VDR can handle a maximum of 256 -areas per object. - -An object is defined to be a specific area with a specific palette and color -depth. Those objects will be referred to as 'backgrounds' later on. Calculate -the dimensions of them wisely, since overlapping areas or oversized areas will -lead to an error. Also, the widht and height of each area has to be a multiple -of four [ TODO may not apply to different output devices ]. - - -Creation of an image --------------------- - -I used gimp to create some test images displaying things on screen, although -I don't know much about image processing :-). To give an advice, I will point -out how I created those test images. - -I've used a template for a menu provided by a community member, tiled it into -sections fully covered by the image. That made three images in this case. Then -I added a little bit of transparency to the image covering the middle part. I've -resized the image so that it's width and height were multiples of four. Now I've -added 50% transparency to the top layer of the image. Then I've reduced the -colordepth of the image (Image->Mode->Indexed) to 14 colors (of course the -image may not be too extensive, but 14 colors can give some nice gradients). -That leaves two colors for text and progress bar in the same display. Reduce -the number of colors according to the background depth and additional -decoration you intend to use. I saved the results to a png file and placed the -result into the skin. - -If you intend to use xpm's, be aware that VDR doesn't know about named colors, -so some images GIMP creates will not be read on-the-fly, because GIMP may use -some named colors, but VDR only recognizes "None". - - -The Description File Format ---------------------------- - -It is a simple configuration file, consisting of Sections and items. -Commentary lines can be added when they are lead in by a '#'. Blank lines will -be ignored. A section is placed in '[]' brackets. An item is lead in by an -'Item=object' phrase. - -Example: -Item=Skin,name=Test,version=0.0.1; -[Channel] -Item=Background,path=channeltop.xpm,x=42,y=350,width=540,height=32,bg=#00FFFFFF; -Item=Background,path=channel.png,x=48,y=382,width=528,height=84; -Item=ChannelNumberName,x=50,y=355,fg=#FFFFFFFF,bg=#FF1965FF,font=Sml; -Item=PresentTime,x=52,y=387,fg=#FFFFFFFF,bg=#7F002254,font=Osd; -[Volume] -Item=Background,x=10,y=10,width=10,height=100; -Item=Volumebar,x=10,y=10,width=10,height=100,bg=#FF000000,fg=#FFFFFFFF; - - -Known Sections --------------- - -Section: [ChannelSmall] -Description: The channel display. It displays the current programme and number - only, together with some decoration. - -Section: [Channel] -Description: The channel display. It displays the current programme and number, - together with the currently running programme and possibly a - timebar and (not implemented yet) channel logo [ TODO remove - comment ]. - -Section: [Volume] -Description: The volume display. It displays the volumebar and possibly a mute - symbol, along with decorative items. - -Section: [ReplayMode] -Description: The replay modes display. Will be shown if only the replay mode - symbol shall be shown. - -Section: [Replay] -Description: [ TODO ] Full replay display. - -Section: [Message] -Description: [ TODO ] Message only display. - -Section: [Menu] -Description: [ TODO ] Full menu. - - -Known Items ------------ - -Item: Item=Skin -Description: This identifies the skin and adds a description to it. -Parameters: name, version - -Item: Item=Background -Description: This adds a background area for the specific display. This area - will be used to draw anything else, so you have to define a - background for everything that will be drawn later on. You can - define a background image for that area here, too. That picture - has to be the same width and height as the area. If you don't use - a background image, the area will be initialized with the bg color - (default 0). If an image is present, the background color will - replace the color 0 in the images palette, and the foreground - color will replace color 1. -Parameters: x, y, width, height, bpp, path, bg, fg - -Item: Item=Text -Description: Draws plain text into the given area, using the given foreground - color. The background color is ignored, so no initializing - rectangle will be drawn. If no width or height are given, the - limits are the background areas. -Parameters: x, y, text, width, height, fg, font, align - -Item: Item=Image -Description: Draws a plain image into the given area, using background and - foreground color (if given) to replace the palette indices 0 - and 1. -Parameters: x, y, width, height, fg, bg, path - -Item: Item=DateTime -Description: Draws a date and time string into the given area. Otherwise, see - Item=Text -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=Date -Description: Draws a date string into the given area. Otherwise, see Item=Text -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=Time -Description: Draws a time string into the given area. Otherwise, see Item=Text -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=DateTimeF -Description: Draws a string expressing some details of the current date and - time. What is to be displayed will be decided by the skin author. - The paremeter "format" holds a format string according to the - manpage of strftime. -Parameters: x, y, width, height, fg, font, align, text, format - -Item: Item=ChannelLogo -Description: Draws a logo for the current channel (if present). The logo's - filename will be the channel name, and the parameter type - gives the file extension. The parameter path can give an - additional subdirectory to the skin's directory. -Example: Item=ChannelLogo,path=logos/,type=png,...; -Parameters: x, y, width, height, fg, bg, path, type - -Item: Item=ChannelNumberName -Description: Draws the channel number and name into the given area. Otherwise, - see Item=Text -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=ChannelNumber -Description: Draws the channel number into the given area. Otherwise, see - Item=Text -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=ChannelName -Description: Draws the channel name into the given area. Otherwise, see - Item=Text -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=Rectangle -Description: Draws a filled rectangle into the defined area. -Parameters: x, y, width, height, fg - -Item: Item=Ellipse -Description: Draws a filled ellipse or a part of an ellipse into the defined - area. -Parameters: x, y, width, height, fg - -Item: Item=Timebar -Description: Draws a timebar displaying the progress of the current programme. - The area will be filled with the background color (if given) and - the bar will be drawn using the foreground color. If width is - greater than height, the bar will be drawn horizontally, otherwise - vertically. -Parameters: x, y, width, height, fg, bg - -Item: Item=PresentTime -Description: Draws the start time of the present programme. -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=PresentTitle -Description: Draws the title of the present programme. -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=PresentShortText -Description: Draws the short text (or episode name) of the present programme. -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=FollowingTime -Description: Draws the start time of the following programme. -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=FollowingTitle -Description: Draws the title of the following programme. -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=FollowingShortText -Description: Draws the short text (or episode name) of the following programme. -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=SymbolTeletext -Description: Draws the specified image into the specified location if the - current channel has teletext. If that is not the case, the - alternative image (if given) will be displayed. For details on the - image handling, see Item=Background. -Parameters: x, y, width, height, path, altpath, fg, bg - -Item: Item=SymbolAudio -Description: Draws the specified image into the specified location if the - current channel has multiple languages. If that is not the case, - the alternative image (if given) will be displayed. For details on - the image handling, see Item=Background. -Parameters: x, y, width, height, path, altpath, fg, bg - -Item: Item=SymbolDolby -Description: Draws the specified image into the specified location if the - current channel has ac3 sound. If that is not the case, the - alternative image (if given) will be displayed. For details on the - image handling, see Item=Background. -Parameters: x, y, width, height, path, altpath, fg, bg - -Item: Item=SymbolEncrypted -Description: Draws the specified image into the specified location if the - current channel is encrypted. If that is not the case, the - alternative image (if given) will be displayed. For details on the - image handling, see Item=Background. -Parameters: x, y, width, height, path, altpath, fg, bg - -Item: Item=SymbolRecording -Description: Draws the specified image into the specified location if VDR is - currently recording. If that is not the case, the alternative - image (if given) will be displayed. For details on the image - handling, see Item=Background. -Parameters: x, y, width, height, path, altpath, fg, bg - -Item: Item=SymbolRadio -Description: Draws the specified image into the specified location if the - current channel is a radio channel. If that is not the case, the - alternative image (if given) will be displayed. For details on the - image handling, see Item=Background. -Parameters: x, y, width, height, path, altpath, fg, bg - -Item: Item=SymbolPlay -Description: Draws the specified image into the specified location if the - current replay is playing normally. If that is not the case, the - alternative image (if given) will be displayed. For details on the - image handling, see Item=Background. -Parameters: x, y, width, height, path, altpath, fg, bg - -Item: Item=SymbolPause -Description: Draws the specified image into the specified location if the - current replay is paused. If that is not the case, the - alternative image (if given) will be displayed. For details on the - image handling, see Item=Background. -Parameters: x, y, width, height, path, altpath, fg, bg - -Item: Item=SymbolFastFwd -Description: Draws the specified image into the specified location if the - current replay is fast forwarding. If that is not the case, the - alternative image (if given) will be displayed. For details on the - image handling, see Item=Background. -Parameters: x, y, width, height, path, altpath, fg, bg - -Item: Item=SymbolFastRew -Description: Draws the specified image into the specified location if the - current replay is fast rewinding. If that is not the case, the - alternative image (if given) will be displayed. For details on the - image handling, see Item=Background. -Parameters: x, y, width, height, path, altpath, fg, bg - -Item: Item=SymbolSlowFwd -Description: Draws the specified image into the specified location if the - current replay is slow forwarding. If that is not the case, the - alternative image (if given) will be displayed. For details on the - image handling, see Item=Background. -Parameters: x, y, width, height, path, altpath, fg, bg - -Item: Item=SymbolSlowRew -Description: Draws the specified image into the specified location if the - current replay is slow rewinding. If that is not the case, the - alternative image (if given) will be displayed. For details on the - image handling, see Item=Background. -Parameters: x, y, width, height, path, altpath, fg, bg - -Item: Item=SymbolEventRunning -Description: Draws the specified image into the specified location if the - displayed event (in menu display) is currently running. If that - is not the case, the alternative image (if given) will be - displayed. For details on the image handling, see Item=Background. -Parameters: x, y, width, height, path, altpath, fg, bg - -Item: Item=SymbolEventTimer -Description: Draws the specified image into the specified location if the - displayed event (in menu display) will be recorded. If that is - not the case, the alternative image (if given) will be displayed. - For details on the image handling, see Item=Background. -Parameters: x, y, width, height, path, altpath, fg, bg - -Item: Item=SymbolEventVPS -Description: Draws the specified image into the specified location if the - displayed event (in menu display) is VPS. If that is not the - case, the alternative image (if given) will be displayed. For - details on the image handling, see Item=Background. -Parameters: x, y, width, height, path, altpath, fg, bg - -Item: Item=SymbolScrollUp -Description: Draws the specified image into the specified location if the - current display is scrollable and not at the top of its contents. - If that is not the case, the alternative image (if given) will be - displayed. For details on the image handling, see Item=Background. -Parameters: x, y, width, height, path, altpath, fg, bg - -Item: Item=SymbolScrollDown -Description: Draws the specified image into the specified location if the - current display is scrollable and not at the bottom of its - contents. If that is not the case, the alternative image (if - given) will be displayed. For details on the image handling, see - Item=Background. -Parameters: x, y, width, height, path, altpath, fg, bg - -Item: Item=Language -Description: Draws a logo for the current language (currently the only - languages VDR knows are "Audio 1" and possibly "Audio 2", - regardless of the real language). For more information on how - the logo is found, see Item=ChannelLogo. The logo's filename will - be the language's name. -Parameters: x, y, width, height, path, type, fg, bg - -Item: Item=Volumebar -Description: Draws a volumebar into the specified area. For more details, see - Item=Timebar. -Parameters: x, y, width, height, fg, bg - -Item: Item=Mute -Description: Draws a mute symbol and/or text (if given) into the specified area. - See Item=Text and Item=Background for more on text and image - handling. -Parameters: x, y, width, height, fg, bg, text, font, align, path - -Item: Item=Replaybar -Description: Draws a progressbar displaying the replay progress into the - specified area. For more details, see Item=Timebar. -Parameters: x, y, width, height, fg, bg - -Item: Item=ReplayTitle -Description: Draws the title of the current replay. -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=ReplayCurrent -Description: Draws the current time in the current replay. -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=ReplayTotal -Description: Draws the total length of the current replay. -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=ReplayJump -Description: Draws the "Jump:" prompt (if present) of the current replay. -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=MessageStatus -Description: Draws the current status message (if present). -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=MessageInfo -Description: Draws the current info message (if present). -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=MessageWarning -Description: Draws the current warning message (if present). -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=MessageError -Description: Draws the current error message (if present). -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=MenuArea -Description: Specifies the area in which the menu items will be shown as a - list. -Parameters: x, y, width, height - -Item: Item=MenuItem -Description: Specifies how one item is drawn in the list of menu items. - list. -Parameters: [x,] [y,] width, height, fg, bg, font, align - -Item: Item=MenuCurrent -Description: Specifies how the currently selected item is drawn in the list of - menu items. - list. -Parameters: [x,] [y,] width, height, fg, bg, font, align - -Item: Item=MenuTitle -Description: Draws the title line of the displayed menu. -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=MenuRed, Item=MenuGreen, Item=MenuYellow, Item=MenuBlue -Description: Draws the red, green, yellow or blue (respectively) button. -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=MenuText -Description: Draws the current menu text in a scrollable text-area. If this - item is present, SymbolScrollUp and SymbolScrollDown apply, too. -Parameters: x, y, width, height, fg, [bg,] font, [align,] text - -Item: Item=MenuEventTitle -Description: Draws the title of the currently selected event when viewing EPG - entries. -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=MenuEventShortText -Description: Draws the short text or episode name of the currently selected - event when viewing EPG entries. -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=MenuEventDescription -Description: Draws the long text of the currently selected event when viewing - EPG entries in a scrollable text-area. If this item is present, - SymbolScrollUp and SymbolScrollDown apply, too. -Parameters: x, y, width, height, fg, [bg,] font, [align,] text - -Item: Item=MenuEventTime -Description: Draws the start time of the currently selected event when viewing - EPG entries. -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=MenuEventEndTime -Description: Draws the end time of the currently selected event when viewing - EPG entries. -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=MenuEventVPSTime -Description: Draws the vps time of the currently selected event when viewing - EPG entries, if that is different from the start time. -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=MenuEventDate -Description: Draws the date of the currently selected event when viewing - EPG entries. -Parameters: x, y, width, height, fg, font, align, text - -Item: Item=MenuEventDateTimeF -Description: Draws a string expressing some details of the start time of the - currently selected event when viewing EPG entries. What is to - be displayed will be decided by the skin author. The paremeter - "format" holds a format string according to the manpage of - strftime. -Parameters: x, y, width, height, fg, font, align, text, format - -Item: Item=MenuRecording -Description: Draws the summary of the currently selected recording when - browsing recordings in a scrollable text-area. If this item is - present, SymbolScrollUp and SymbolScrollDown apply, too. -Parameters: x, y, width, height, fg, [bg,] font, [align,] text - -Known Parameters ----------------- - -Parameter: x -Description: A positive number representing the vertical offset in pixels. -Default: MANDATORY - -Parameter: y -Description: A positive number representing the horizontal offset in pixels. -Default: MANDATORY - -Parameter: width -Description: A positive number representing the width in pixels. -Default: not given (sometimes mandatory) - -Parameter: height -Description: A positive number representing the height in pixels. -Default: not given (sometimes mandatory) - -Parameter: bpp -Description: A positive number representing the depth of a background area. - Possible values are 1, 2, 3, 4 and 8 mapping to 2, 4, 8, 16 and - 256 colors. -Default: 4 (16 colors) - -Parameter: fg -Description: A hex quadriplet [ TODO is this word correct?! ] introduced by '#' - representing a 32-bit foreground color in the order ARGB. -Default: not given -Example: #ff000000 - -Parameter: bg -Description: A hex quadriplet [ TODO is this word correct?! ] introduced by '#' - representing a 32-bit background color in the order ARGB. -Default: not given - -Parameter: font -Description: A string representing one of VDR's skins, possible values are - 'Osd', 'Sml' and 'Fix'. -Default: Osd - -Parameter: path -Description: A string representing a path- and filename relative to the skin - directory. Currently, xpm images and png files (with alphachannel - support) can be loaded, but the number of different colors used - in the image must not exceed those possible in the corresponding - background area. -Default: not given - -Parameter: altpath -Description: A string representing a path- and filename relative to the skin - directory. This is used for for displaying alternate images i.e. - for symbols. For more information, see path=... -Default: not given - -Parameter: text -Description: For non-text-items (and for the item "Text" itself), this is the - plain text to be displayed. For items that have it's own texts - (such as "Date", "PresentTitle" etc.), this is a template that - defines how the text is to be displayed. A dollar symbol '$' will - be replaced by the original text. -Default: not given -Example: Item=ReplayCurrent,text=Current: $; would display for example - "Current: 0:00:21" instead of only "0:00:21". - -Parameter: type -Description: The string giving the file extensions for logos. -Default: not given - -Parameter: type -Description: The format string for a date/time display according to strftime. -Default: "" - -Parameter: align -Description: A number describing the text alignment. Possible values are '0' - for left aligned, '1' for centered and '2' for right aligned. -Default: 0 - diff --git a/SKINS.de b/SKINS.de deleted file mode 100644 index 2e1cc8e..0000000 --- a/SKINS.de +++ /dev/null @@ -1,259 +0,0 @@ - - -DIESES DOKUMENT IST NICHT AUF DEM NEUESTEN STAND (sorry) - - -Wie man textbasierte Skins erstellt ------------------------------------ - -Das Skin selbst findet in einem Unterverzeichnis "text2skin" innerhalb des -"plugins" Verzeichnisses ihres Konfigurationsordners. Das ist normalerweise das -Videoverzeichnis, wenn beim VDR-Start -c nicht angegeben wurde, sonst eben das -dort angegebene. Jedes Skin hat dort ein eigenes Verzeichnis, welches die -Beschreibungsdatei und Bilder enthält. Die Beschreibungsdatei muss den gleichen -Namen wie das Skin tragen, mit der Dateiendung ".skin". - -Beispiel (das Skin heisst myskin): -/video0/plugins/text2skin/ -/video0/plugins/text2skin/myskin/ -/video0/plugins/text2skin/myskin/myskin.skin -/video0/plugins/text2skin/myskin/channeldisplay.png - -Es ist wichtig, dass sie die Limitierungen des OSD Speichers verstehen. Wenn -zuviele Objekte mit zuvielen Farben definiert werden, dann wird VDR einen -Fehler ins Log schreiben und einige Bereiche werden nicht angezeigt werden. Bei -anderen Ausgabegeräten mag es sein, dass diese Limitierungen nicht zutreffen, -wenn Sie also ein Skin für ein anderes Gerät schreiben möchten, benutzen Sie -ruhig ein paar mehr Farben, aber denken Sie daran, dass VDR generell maximal -256 Farben pro Objekt verwalten kann. - -Ein Objekt ist als ein bestimmter Bereich definiert, der eine bestimmte -Farbpalette und Farbtiefe verwendet. Diese Objekte werden im Verlauf dieses -Dokuments "Backgrounds" genannt. Berechnen sie die Dimensionen dieser Bereiche -weise, denn überlappende oder übergroße Backgrounds führen zu einem Fehler. -Zusätzlich muss die Breite und Höhe jedes Backgrounds durch vier teilbar sein. - - -Die Erstellung eines Bildes ---------------------------- - -Ich habe mit gimp einige Beispielbilder erstellt, die Dinge auf dem Bildschirm -anzeigen, obwohl ich mit Grafik eigentlich recht wenig am Hut habe. Um einige -Hinweise zu geben, werde ich erklären wie ich diese Bilder erzeugt habe. - -Ich habe eine Vorlage für ein Kanaldisplay von einem Community-Mitglied -erhalten, dieses in drei Bereiche zerlegt, die jeweils komplett vom Hintergrund -gefüllt wurden. Nun habe ich das Bild so vergrößert, dass Breite und Höhe durch -vier teilbar sind. Um im mittleren Bereich etwas Transparenz zu erzeugen, habe -ich die Deckkraft der Bildebene auf 50% reduziert. Anschliessend habe ich alle -Bilder auf 14 Farben reduziert (Bild->Modus->Indiziert) (natürlich darf das -Bild nicht zu aufwändig sein, aber mit 14 Farben bekommt man schon schöne -Übergänge hin. Dann bleiben zwei Farben für Text und Symbole übrig, und das -ganze passt in einen 16-farb (4-bit) Background. Reduzieren sie die Azahl der -Farben entsprechend, wenn Sie beabsichtigen, mehr Vordergrundobjekte zu -zeichnen. Das Ergebnis habe ich als PNG gespeichert und in das Skin kopiert. - -Wenn sie beabsichtigen, xpm's zu nutzen, achten sie darauf dass VDR keine -benannten Farben beherrscht, es könnte also sein dass Bilder die gimp erzeugt -nicht sofort nutzbar sind. Die einzige benannte Farbe, die VDR beherrscht, ist -"None". - - -Das Format der Beschreibungsdatei ---------------------------------- - -Die Datei ist eine einfache Konfigurationsdatei, die aus Sektionen und Objekten -besteht. Kommentarzeilen können mit einem '#' eingeleitet werden. Leerzeilen -werden ignoriert. Eine Sektion ist von eckigen '[]' Klammern eingeschlossen. -Ein Objekt beginnt mit dem Text "Item=", gefolgt von der Art des Objekts. -Dahinter folgen Parameter für das Objekt, mit Komma getrennt. Die Zeile wird -durch ein Semikolon ';' abgeschlossen. - -Beispiel: -Item=Skin,name=Test,version=0.0.1; -[Channel] -Item=Background,path=channeltop.xpm,x=42,y=350,width=540,height=32,bg=#00FFFFFF; -Item=Background,path=channel.png,x=48,y=382,width=528,height=84; -Item=ChannelNumberName,x=50,y=355,fg=#FFFFFFFF,bg=#FF1965FF,font=Sml; -Item=PresentTime,x=52,y=387,fg=#FFFFFFFF,bg=#7F002254,font=Osd; -[Volume] -Item=Background,x=10,y=10,width=10,height=100; -Item=Volumebar,x=10,y=10,width=10,height=100,bg=#FF000000,fg=#FFFFFFFF; - - -Bekannte Sektionen ------------------- - -Sektion: [ChannelSmall] - Die Kanalanzeige, die nur aktuellen Kanalnamen und -nummer - anzeigt. - -Sektion: [Channel] -Beschreibung: Die Kanalanzeige. Sie zeigt aktuellen Kanalnamen und -nummer, - gemeinsam mit dem aktuellen Programm und möglicherweise eine - Zeitleiste und ein Kanallogo (noch nicht implementiert). - -Sektion: [Volume] -Beschreibung: Die Lautstärkeanzeige. Zeigt die Lautstärkeleiste und - möglicherweise ein Mute-Symbol und etwas Dekoration. - -Sektion: [ReplayMode] -Beschreibung: Die Wiedergabeanzeige. Wird angezeigt wenn nur der - Wiedergabemodus gezeigt werden soll. - -Sektion: [Replay] -Beschreibung: [ TODO ] Die große Wiedergabeanzeige - -Sektion: [Message] -Beschreibung: [ TODO ] Anzeige einer Nachricht - -Sektion: [Menu] -Beschreibung: [ TODO ] Vollständiges Menü - - -Bekannte Objekte ----------------- - -Objekt: Item=Skin -Beschreibung: Dieses Objekt identifiziert ein Skin und fügt eine Beschreibung - hinzu. -Parameter: name, version - -Objekt: Item=Background -Parameter: x, y, width, height, bpp, path, bg, fg - -Objekt: Item=Text -Parameter: x, y, text, width, height, fg, font, align - - -Objekt: Item=DateTime -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=Date -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=Time -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=ChannelNumberName -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=ChannelNumber -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=ChannelName -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=Rectangle -Parameter: x, y, width, height, fg - -Objekt: Item=Ellipse -Parameter: x, y, width, height, fg - -Objekt: Item=Timebar -Parameter: x, y, width, height, fg, bg - -Objekt: Item=PresentTime -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=PresentTitle -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=PresentShortText -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=FollowingTime -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=FollowingTitle -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=FollowingShortText -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=SymbolTeletext -Parameter: x, y, width, height, path, altpath, fg, bg - -Objekt: Item=SymbolAudio -Parameter: x, y, width, height, path, altpath, fg, bg - -Objekt: Item=SymbolDolby -Parameter: x, y, width, height, path, altpath, fg, bg - -Objekt: Item=SymbolEncrypted -Parameter: x, y, width, height, path, altpath, fg, bg - -Objekt: Item=Volumebar -Parameter: x, y, width, height, fg, bg - -Objekt: Item=Mute -Parameter: x, y, width, height, fg, bg, text, font, align, path - -Objekt: Item=Progressbar -Parameter: x, y, width, height, fg, bg - -Objekt: Item=ReplayTitle -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=ReplayCurrent -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=ReplayTotal -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=ReplayJump -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=MessageStatus -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=MessageInfo -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=MessageWarning -Parameter: x, y, width, height, fg, font, align - -Objekt: Item=MessageError -Parameter: x, y, width, height, fg, font, align - - -Bekannte Parameters ----------------- - -Parameter: x -Standard: PFLICHT - -Parameter: y -Standard: PFLICHT - -Parameter: width -Standard: nicht gesetzt (sometimes mandatory) - -Parameter: height -Standard: nicht gesetzt (sometimes mandatory) - -Parameter: bpp -Standard: 4 (16 Farbem) - -Parameter: fg -Standard: nicht gesetzt -Beispiel: #ff000000 - -Parameter: bg -Standard: nicht gesetzt - -Parameter: font -Standard: Osd - -Parameter: path -Standard: nicht gesetzt - -Parameter: altpath -Standard: nicht gesetzt - -Parameter: text -Standard: nicht gesetzt - -Parameter: align -Standard: 0 - diff --git a/bitmap.c b/bitmap.c index 9e7c02b..3aa91a5 100644 --- a/bitmap.c +++ b/bitmap.c @@ -1,5 +1,5 @@ /* - * $Id: bitmap.c,v 1.15 2004/06/12 19:16:11 lordjaxom Exp $ + * $Id: bitmap.c,v 1.16 2004/06/16 18:46:50 lordjaxom Exp $ */ #include "bitmap.h" @@ -11,9 +11,7 @@ #endif #ifdef HAVE_IMAGEMAGICK #include -using Magick::Image; -using Magick::PixelPacket; -using Magick::Exception; +using namespace Magick; #endif template<> @@ -22,6 +20,7 @@ void cImageCache::Delete(string &key, cText2SkinBitmap *&value) { } cImageCache cText2SkinBitmap::mCache(Text2SkinSetup.MaxCacheFill); +bool cText2SkinBitmap::mFirstTime = true; cText2SkinBitmap::cText2SkinBitmap(void) { mCurrent = 0; @@ -31,6 +30,7 @@ cText2SkinBitmap::cText2SkinBitmap(void) { cText2SkinBitmap::~cText2SkinBitmap() { for (int i = 0; i < (int)mBitmaps.size(); ++i) delete mBitmaps[i]; + mBitmaps.clear(); } cBitmap &cText2SkinBitmap::Get(int &UpdateIn) { @@ -60,10 +60,25 @@ cBitmap &cText2SkinBitmap::Get(int &UpdateIn) { return *mBitmaps[mCurrent]; } +void cText2SkinBitmap::SetAlpha(int Alpha) { + if (Alpha > 0) { + vector::iterator it = mBitmaps.begin(); + for (; it != mBitmaps.end(); ++it) { + int count; + if ((*it)->Colors(count)) { + for (int i = 0; i < count; ++i) { + int alpha = (((*it)->Color(i) & 0xFF000000) >> 24) * Alpha / 255; + (*it)->SetColor(i, ((*it)->Color(i) & 0x00FFFFFF) | (alpha << 24)); + } + } + } + } +} + cText2SkinBitmap *cText2SkinBitmap::Load(const char *Filename, int Alpha) { - if (mCache.Contains(Filename)) { + if (mCache.Contains(Filename)) return mCache[Filename]; - } else { + else { cText2SkinBitmap *bmp = new cText2SkinBitmap; int len = strlen(Filename); bool result = false; @@ -84,8 +99,11 @@ cText2SkinBitmap *cText2SkinBitmap::Load(const char *Filename, int Alpha) { } else esyslog("ERROR: text2skin: filename %s too short to identify format", Filename); - if (result) + if (result) { + bmp->SetAlpha(Alpha); return (mCache[Filename] = bmp); + } else + delete bmp; } return false; } @@ -93,11 +111,6 @@ cText2SkinBitmap *cText2SkinBitmap::Load(const char *Filename, int Alpha) { bool cText2SkinBitmap::LoadXpm(const char *Filename, int Alpha) { cBitmap *bmp = new cBitmap(1,1,1); if (bmp->LoadXpm(Filename)) { - int count; - if (Alpha && bmp->Colors(count)) { - for (int i = 0; i < count; ++i) - bmp->SetColor(i, (bmp->Color(i) & 0x00FFFFFF) | (Alpha << 24)); - } mBitmaps.push_back(bmp); return true; } @@ -121,13 +134,7 @@ bool cText2SkinBitmap::LoadImlib(const char *Filename, int Alpha) { for (int y = 0; y < bmp->Height(); ++y) { for (int x = 0; x < bmp->Width(); ++x) { tColor col = (data[pos + 3] << 24) | (data[pos + 2] << 16) | (data[pos + 1] << 8) | data[pos + 0]; - if (Alpha) - col = (col & 0x00FFFFFF) | (Alpha << 24); - int res = bmp->Index(col); - if (pal > 0 && res == 0) - ;//esyslog("ERROR: text2skin: Too many colors used in palette"); - else - bmp->SetIndex(x, y, res); + bmp->DrawPixel(x, y, col); pos += 4; } } @@ -140,6 +147,9 @@ bool cText2SkinBitmap::LoadImlib(const char *Filename, int Alpha) { #ifdef HAVE_IMAGEMAGICK bool cText2SkinBitmap::LoadMagick(const char *Filename, int Alpha) { + if (mFirstTime) + InitializeMagick("text2skin"); + vector images; cBitmap *bmp = NULL; try { @@ -154,16 +164,33 @@ bool cText2SkinBitmap::LoadMagick(const char *Filename, int Alpha) { for (it = images.begin(); it != images.end(); ++it) { w = (*it).columns(); h = (*it).rows(); - bmp = new cBitmap(w, h, 8); + if ((*it).depth() > 8) { + esyslog("ERROR: text2skin: More than 8bpp images are not supported"); + return false; + } + bmp = new cBitmap(w, h, (*it).depth()); - const PixelPacket *ptr = (*it).getConstPixels(0, 0, w, h); + if ((*it).classType() == PseudoClass) { + int total = (*it).totalColors(); + for (int ic = 0; ic < (int)total; ++ic) { + Color c = (*it).colorMap(ic); + tColor col = (~(c.alphaQuantum() * 255 / MaxRGB) << 24) | ((c.redQuantum() * 255 / MaxRGB) << 16) | ((c.greenQuantum() * 255 / MaxRGB) << 8) | (c.blueQuantum() * 255 / MaxRGB); + bmp->SetColor(ic, col); + } + } + + const PixelPacket *pix = (*it).getConstPixels(0, 0, w, h); + const IndexPacket *idx = (*it).getConstIndexes(); for (int iy = 0; iy < h; ++iy) { for (int ix = 0; ix < w; ++ix) { - tColor col = (((~ptr->opacity & 0xFF00) << 16) | ((ptr->red & 0xFF00) << 8) | (ptr->green & 0xFF00) | ((ptr->blue & 0xFF00) >> 8)); - if (Alpha) - col = (col & 0x00FFFFFF) | (Alpha << 24); - bmp->DrawPixel(ix, iy, col); - ++ptr; + if ((*it).classType() == PseudoClass) { + bmp->SetIndex(ix, iy, *idx); + ++idx; + } else { + tColor col = (~(pix->opacity * 255 / MaxRGB) << 24) | ((pix->red * 255 / MaxRGB) << 16) | ((pix->green * 255 / MaxRGB) << 8) | (pix->blue * 255 / MaxRGB); + bmp->DrawPixel(ix, iy, col); + ++pix; + } } } mBitmaps.push_back(bmp); diff --git a/bitmap.h b/bitmap.h index ac0f0e4..44a3e1b 100644 --- a/bitmap.h +++ b/bitmap.h @@ -1,5 +1,5 @@ /* - * $Id: bitmap.h,v 1.10 2004/06/12 18:00:05 lordjaxom Exp $ + * $Id: bitmap.h,v 1.11 2004/06/16 18:46:50 lordjaxom Exp $ */ #ifndef VDR_TEXT2SKIN_BITMAP_H @@ -15,11 +15,12 @@ typedef cText2SkinCache cImageCache; class cText2SkinBitmap { private: static cImageCache mCache; + static bool mFirstTime; - vector mBitmaps; - int mCurrent; - time_t mDelay; - time_t mLastGet; + vector mBitmaps; + int mCurrent; + time_t mDelay; + time_t mLastGet; // disallow direct construction cText2SkinBitmap(void); @@ -32,6 +33,7 @@ public: cBitmap &Get(int &UpdateIn); void SetColor(int Index, tColor Color) { mBitmaps[mCurrent]->SetColor(Index, Color); } + void SetAlpha(int Alpha); bool LoadXpm(const char *Filename, int Alpha); #ifdef HAVE_IMLIB2 diff --git a/cache.h b/cache.h index 11b7d79..1fd0811 100644 --- a/cache.h +++ b/cache.h @@ -1,5 +1,5 @@ /* - * $Id: cache.h,v 1.3 2004/06/08 20:45:52 lordjaxom Exp $ + * $Id: cache.h,v 1.4 2004/06/16 18:46:50 lordjaxom Exp $ */ #ifndef VDR_TEXT2SKIN_CACHE_HPP @@ -68,10 +68,6 @@ inline void cText2SkinCache::Delete(Item *item) { delete item; } -template -inline void cText2SkinCache::Delete(K &key, D &Data) { -} - template inline void cText2SkinCache::Update(Item *item) { item->_lastUsed = time_ms(); @@ -110,6 +106,11 @@ cText2SkinCache::~cText2SkinCache() { Flush(); } +template +void cText2SkinCache::Delete(K &key, D &Data) { + abort(); +} + template void cText2SkinCache::Flush(void) { Item *cur = _first; diff --git a/common.c b/common.c index 4643b9f..5ec7970 100644 --- a/common.c +++ b/common.c @@ -1,5 +1,5 @@ /* - * $Id: common.c,v 1.9 2004/06/12 18:00:05 lordjaxom Exp $ + * $Id: common.c,v 1.10 2004/06/16 18:46:50 lordjaxom Exp $ */ #include "data.h" @@ -12,7 +12,8 @@ const string SectionNames[__SECTION_COUNT__] = const string ItemNames[__ITEM_COUNT__] = { "Unknown", "Skin", "Background", "Text", "Scrolltext", "Image", "Rectangle", - "Ellipse", "Slope", "Progress", "Logo", "Symbol", "MenuArea", "MenuItem" }; + "Ellipse", "Slope", "Progress", "Logo", "Symbol", "MenuArea", "MenuItem", + "Scrollbar" }; const string DisplayNames[__DISPLAY_COUNT__] = { "Always", "DateTimeF", "DateTime", "Date", "Time", "ChannelNumberName", @@ -131,10 +132,10 @@ bool ParseVar(const char *Text, const char *Name, string &Value){ return res; } -bool ParseVar(const char *Text, const char *Name, tColor **Value) { +bool ParseVar(const char *Text, const char *Name, tColor *Value) { string value; if (ParseVar(Text, Name, value) && value[0] == '#') { - *Value = new tColor(strtoul(value.c_str() + 1, NULL, 16)); + *Value = (tColor)strtoul(value.c_str() + 1, NULL, 16); return true; } return false; diff --git a/common.h b/common.h index 64163d9..c1a0436 100644 --- a/common.h +++ b/common.h @@ -1,5 +1,5 @@ /* - * $Id: common.h,v 1.9 2004/06/12 18:00:05 lordjaxom Exp $ + * $Id: common.h,v 1.10 2004/06/16 18:46:50 lordjaxom Exp $ */ #ifndef VDR_TEXT2SKIN_COMMON_H @@ -49,6 +49,7 @@ enum eSkinItem { itemSymbol, itemMenuArea, itemMenuItem, + itemScrollbar, __ITEM_COUNT__ }; @@ -74,9 +75,9 @@ enum eSkinDisplay { displayPresentTitle, // exc: text displayPresentShortText, // exc: text displayPresentDescription, // exc: text - displayFollowingStartTime, // exc: text, progress - displayFollowingEndTime, // exc: text, progress - displayFollowingDuration, // exc: text, progress + displayFollowingStartTime, // exc: text + displayFollowingEndTime, // exc: text + displayFollowingDuration, // exc: text displayFollowingTitle, // exc: text displayFollowingShortText, // exc: text displayTeletext, // exc: symbol @@ -161,7 +162,7 @@ bool ParseVar(const char *Text, const char *Name, eSkinDisplay *Value); bool ParseVar(const char *Text, const char *Name, int *Value); bool ParseVar(const char *Text, const char *Name, const cFont **Value); bool ParseVar(const char *Text, const char *Name, string &Value); -bool ParseVar(const char *Text, const char *Name, tColor **Value); +bool ParseVar(const char *Text, const char *Name, tColor *Value); bool ParseVar(const char *Text, const char *Name, eTextAlignment *Value); #endif // VDR_TEXT2SKIN_COMMON_H diff --git a/contrib/items.doc b/contrib/items.doc new file mode 100644 index 0000000..716f4a2 --- /dev/null +++ b/contrib/items.doc @@ -0,0 +1,620 @@ +%LANGS = ("en" => 0, "de" => 1); + +%TRANS = ( + "Known Sections" => [ "Bekannte Sektionen" ], + "Known drawable Items" => [ "Bekannte Zeichnungs-Items" ], + "Known Display-Items" => [ "Bekannte Anzeige-Items" ], + "Known Parameters" => [ "Bekannte Parameter" ], + + "Section:" => [ "Sektion:" ], + "Description:" => [ "Beschreibung:" ], + "Item:" => [ "Item:" ], + "Parameters:" => [ "Parameter:" ], + "Display:" => [ "Anzeige:" ], + "Parameter:" => [ "Parameter:" ], + "Default:" => [ "Standard:" ], + "Substitutes:" => [ "Ersetzt:" ], +); + + +@INTRO = ( <Mode->Indexed) to 14 colors (of course the +image may not be too extensive, but 14 colors can give some nice gradients). +That leaves two colors for text and progress bar in the same display. Reduce +the number of colors according to the background depth and additional +decoration you intend to use. I saved the results to a png file and placed the +result into the skin. + +If you intend to use xpm's, be aware that VDR doesn't know about named colors, +so some images GIMP creates will not be read on-the-fly, because GIMP may use +some named colors, but VDR only recognizes "None". + + +The Description File Format +--------------------------- + +It is a simple configuration file, consisting of Sections and items. +Commentary lines can be added when they are lead in by a '#'. Blank lines will +be ignored. A section is placed in '[]' brackets. All other lines specify +drawable items and are lead in by the phrase "Item=<...>" followed by one or +more parameters (separated by commas). The line must end with a semicolon. + +It is quite important that you understand the relation between the Item and +it's display parameter. The display parameter doesn't only specify WHAT to +display, it also specifies IF it is displayed. For example a rectangle with +display=PresentVPSTime will only be drawn if there is a present VPS time given. +A text with display=PresentVPSTime behaves the same, but the text is +substituted by the actual VPS time string. If the text-parameter contains a +dollar-sign, like in display=PresentVPSTime,text=VPS: $, the VPS time will be +substituted in place of the dollar-sign. + +Example (sorry for the long lines): + +# Description of the skin file +Item=Skin,name=Test,version=0.0.2; +[Channel] +# This is the full channel display +# Background area to draw on (a background MUST be specified to make items +# drawn on it actually visible!!!), with background picture. Bpp=4 equals 16 +# colors +Item=Background,path=channeltop.xpm,x=42,y=350,width=540,height=32,bpp=4; +# A second area below the first one, again with 16 colors (make 32 colors +# alltogether) +Item=Background,path=channel.png,x=48,y=382,width=528,height=84,bpp=4; +# A textual item displaying the channel numer and name (if present) +# The color is a symbolic name that will be filled in the .colors-file +Item=Text,display=ChannelNumberName,x=50,y=355,width=250,height=28,fg=ChNumNameFG,font=Sml; +# A textual item displaying the current date and time +Item=Text,display=PresentDateTime,x=52,y=387,width=150,height=28,fg=DateTimeFG,font=Osd; +[Volume] +# This is the volume display +# Again, we specify an area to be able to draw items on it +Item=Background,x=10,y=10,width=20,height=200,bpp=4; +# A progressbar displaying the current volume. +Item=Progress,display=VolumeCurrent,x=10,y=10,width=20,height=200,bg=VolumeBG,fg=VolumeFG; + + +END_EN + +, <Modus->Indiziert) (natürlich darf das +Bild nicht zu aufwändig sein, aber mit 14 Farben bekommt man schon schöne +Übergänge hin. Dann bleiben zwei Farben für Text und Symbole übrig, und das +ganze passt in einen 16-farb (4-bit) Background. Reduzieren sie die Azahl der +Farben entsprechend, wenn Sie beabsichtigen, mehr Vordergrundobjekte zu +zeichnen. Das Ergebnis habe ich als PNG gespeichert und in das Skin kopiert. + +Wenn sie beabsichtigen, xpm's zu nutzen, achten sie darauf dass VDR keine +benannten Farben beherrscht, es könnte also sein dass Bilder die gimp erzeugt +nicht sofort nutzbar sind. Die einzige benannte Farbe, die VDR beherrscht, ist +"None". + + +Das Format der Beschreibungsdatei +--------------------------------- + +Die Datei ist eine einfache Konfigurationsdatei, die aus Sektionen und Objekten +besteht. Kommentarzeilen können mit einem '#' eingeleitet werden. Leerzeilen +werden ignoriert. Eine Sektion ist von eckigen '[]' Klammern eingeschlossen. +Ein Objekt beginnt mit dem Text "Item=", gefolgt von der Art des Objekts. +Dahinter folgen Parameter für das Objekt, mit Komma getrennt. Die Zeile wird +durch ein Semikolon ';' abgeschlossen. + +Es ist sehr wichtig, dass sie den Zusammenhang zwischen Item und seinem +display-Parameter verstehen. Der display-Parameter gibt nicht nur an WAS +angezeigt wird, sondern auch OB es angezeigt wird. Ein Rechteck mit +display=PresentVPSTime wird nur angezeigt, wenn eine aktuelle VPS-Zeit gegeben +ist. Ein Text-Item mit display=PresentVPSTime verhält sich genauso, aber der +anzuzeigende Text durch die tatsächliche VPS-Zeit ersetzt. Wenn Text ein +Dollarzeichen enthält, wie in display=PresentVPSTime,text=VPS: $, dann wird +die VPS-Zeit an der Stelle des Dollarzeichens eingesetzt. + +Beispiel: + +# Description of the skin file +Item=Skin,name=Test,version=0.0.2; +[Channel] +# Dies ist die grosse Kanalanzeige +# Hintergrundbereich wo wir drauf zeichnen (so etwas MUSS angegeben werden, +# damit Objekte die darauf gezeichnet werden überhaupt sichtbar werden), mit +# Bild. Bpp=4 entspricht 16 Farben +Item=Background,path=channeltop.xpm,x=42,y=350,width=540,height=32,bpp=4; +# Ein zweiter Bereich unter dem ersten, wieder mit 16 Farben (macht 32 Farben +# insgesamt) +Item=Background,path=channel.png,x=48,y=382,width=528,height=84,bpp=4; +# Ein Text-Objekt welches die Kanalnummer und den -namen anzeigt (wenn +# vorhanden) +Item=Text,display=ChannelNumberName,x=50,y=355,width=250,height=28,fg=ChNumNameFG,font=Sml; +# Ein Text-Objekt welches das aktuelle Datum und die Zeit anzeigt. +Item=Text,display=PresentDateTime,x=52,y=387,width=150,height=28,fg=DateTimeFG,font=Osd; +[Volume] +# Dies ist die Lautstärkeanzeige +# Und wieder ein Bereich in dem wir Objekte zeichnen können (diesmal ohne Bild) +# Wird keine BG-Farbe angegeben, so wird transparent (unsichtbar) benutzt. +Item=Background,x=10,y=10,width=20,height=200,bpp=4; +# Eine Fortschrittsleiste welche die aktuelle Lautstärke anzeigt. +Item=Progress,display=VolumeCurrent,x=10,y=10,width=20,height=200,bg=VolumeBG,fg=VolumeFG; + + +END_DE + +); + +%SECTIONS = ( + "ChannelSmall" => [ + "The channel display. It displays the current programme and number only, ". + "together with some decoration. [UNUSED]", + + "Die Kanalanzeige, die nur den aktuellen Kanalnamen und die -nummer mit ". + "etwas Dekoration anzeigt. [UNGENUTZT]" + ], + + "Channel" => [ + "The channel display. It displays the current programme and number, ". + "together with the currently running programme and possibly a ". + "timebar, channel logo and some symbols.", + + "Die Kanalanzeige. Sie zeigt aktuellen Kanalnamen und -nummer, ". + "gemeinsam mit dem aktuellen Programm und möglicherweise eine ". + "Zeitleiste und ein Kanallogo (noch nicht implementiert)." + ], + + "Volume" => [ + "The volume display. It displays the volumebar and possibly a mute ". + "symbol, along with decorative items.", + + "Die Lautstärkeanzeige. Zeigt die Lautstärkeleiste und ". + "möglicherweise ein Mute-Symbol und etwas Dekoration." + ], + + "ReplayMode" => [ + "The replay modes display. Will be shown if only the replay mode ". + "symbol(s) shall be shown. This display can't contain a progress-bar.", + + "Die Wiedergabeanzeige. Wird angezeigt wenn nur der ". + "Wiedergabemodus gezeigt werden soll. Diese Anzeige kann keine ". + "Wiedergabeleiste enthalten." + ], + + "Replay" => [ + "The full replay display. It shows the title, time and length of an ". + "ongoing replay, together with a Progressbar and maybe even a replay logo", + + "" + ], + + "Message" => [ + "This display will be used only if there is no other display open, and ". + "VDR wants to display a message. Therefore this display shouldn't show ". + "much more than that message.", + + "" + ], + + "Menu" => [ + "The full menu. This is the all-round display used when showing a list of ". + "items or when showing something in detail (EPG-summary for example).", + + "" + ], +); + +%ITEMS = ( + "Background" => [ + "This adds a background area for the specific display. This area ". + "will be used to draw anything else, so you have to define a ". + "background for everything that will be drawn later on. You can ". + "define a background image for that area here, too. That picture ". + "has to be the same width and height as the area. If you don't use ". + "a background image, the area will be initialized with the bg color ". + "(default transparent). If an image is present, the background color will ". + "replace the color 0 in the image's palette, and the foreground ". + "color will replace color 1.", + + "" + ], + + "Text" => [ + "Draws plain text into the given area, using the given foreground ". + "color. Text has no background, only the pixels containing the foreground ". + "color will be drawn. If no width or height are given, the ". + "limits are the background areas. If you want to align the text, you need ". + "to specify at least the width. If this item is specified with an ". + "appropriate display parameter, and text is not given or contains a ". + "dollar sign, it will be substituted by the content given by the display ". + "parameter.", + + "" + ], + + "Scrolltext" => [ + "Draws a line-wrapped, scrollable text-area into the area, using the ". + "given foreground color. Behaves like Text otherwise. This item makes ". + "most sense for display=MenuText, display=PresentDescription and ". + "display=MenuRecording, since those are the only one's supporting ". + "the actual scrolling mechanism (inside the menu).", + + "" + ], + + "Image" => [ + "Draws the image from the parameter path into the area, substituting ". + "foreground and background colors like in Item=Background", + + "" + ], + + "Rectangle" => [ + "Draws a rectangle filled with the foreground color into the area.", + + "" + ], + + "Ellipse" => [ + "Draws an ellipse (or part of it) filled with the foreground color into ". + "the area. The parameter arc, if given, specifies which part of the ". + "ellipse will be drawn.", + + "" + ], + + "Slope" => [ + "Draws a slope (some kind of wave) (or part of it) filled with the ". + "foreground color into the area. The parameter arc, if give, specifies ". + "how the slope is formed.", + + "" + ], + + "Progress" => [ + "Draws a progress bar into the display. The \"shown\" fraction of the ". + "relevant display-parameter is drawn using the foreground color, while ". + "the \"rest\" fraction is drawn using the background color (if given). ". + "This item makes sense for display=PresentDuration, VolumeCurrent and ". + "ReplayTime", + + "" + ], + + "Logo" => [ + "Draws an image displaying some kind of logo into the area. The image ". + "file is given by the path- and type-parameters, together with the result ". + "from the corresponding display-parameter. This item makes sense for ". + "display=ChannelName (where the channel name is the filename), for ". + "display=ReplayMode (where the filename can be one of \"normal\", ". + "\"dvd\", \"vcd\", \"mp3\" and \"mplayer\" (more to come hopefully) ". + "and for display=Language (where the language code is [WILL BE] the ". + "filename. Behaves like Item=Image otherwise", + + "" + ], + + "Symbol" => [ + "Draws an On/Off-symbol into the area. The On-image is given by the path-". + "parameter, the Off-image with the altpath-parameter. Otherwise like ". + "Item=Image", + + "" + ], + + "MenuArea" => [ + "Specifies the area that is considered to be the central menu area ". + "(where the list of menu items is drawn). Note that this will not display ". + "anything yet, you have to give additional Text items to actually draw ". + "the list", + + "" + ], + + "MenuItem" => [ + "Specifies the area occupied by one item of the list which is displayed ". + "in the central menu area. The number of items that can be displayed is ". + "determined by the height of MenuArea and the height of this item. Note ". + "that this will not display anything yet, you have to give additional ". + "Text items to actually draw the list. Also note that the x- and y-". + "parameters (if given) are relative to the top-left corner of the ". + "MenuArea.", + + "" + ], + + "Scrollbar" => [ + "Draws a real scrollbar into the display. The \"seen\" and \"rest\" ". + "fractions are drawn using the background color, while the bar indicating ". + "the \"shown\" fraction and the current position, is drawn using the ". + "foreground color. This item makes sense for display=MenuText, ". + "PresentDescription and MenuRecording", + + "" + ], +); + +%ITEMPARAMS = ( + "Background" => "x, y, width, height, bpp, path, bg, fg", + "Text" => "display, x, y, width, height, fg, font, align", + "Scrolltext" => "display, x, y, width, height, fg, font", + "Image" => "display, x, y, width, height, bg, fg, path", + "Rectangle" => "display, x, y, width, height, fg", + "Ellipse" => "display, x, y, width, height, fg, arc", + "Slope" => "display, x, y, width, height, fg, arc", + "Progress" => "display, x, y, width, height, bg, fg", + "Logo" => "display, x, y, width, height, bg, fg, path, type", + "Symbol" => "display, x, y, width, height, bg, fg, path, altpath", + "MenuArea" => "x, y, width, height", + "MenuItem" => "x, y, width, height", + "Scrollbar" => "display, x, y, width, height, bg, fg", +); + +%DISPLAYS = ( + "DateTimeF" => [ + "The current date and time, formatted according to the format-parameter. ". + "To learn how the string can be formatted, please see man strftime.", + + "" + ], + + "DateTime" => [ + "The current date and time, pre-formatted like \"dd.mm. HH:MM\".", + + "" + ], + + "Date" => [ + "The current date, pre-formatted like \"dd.mm.\".", + + "" + ], + + "Time" => [ + "The current time, pre-formatted like \"HH:MM\".", + + "" + ], + + "ChannelNumberName" => [ + "A string containing the current channel number and name, where the ". + "channel number can be followed by a minus (while entering a channel) ". + "or where the channel name can be a channel group separator", + + "" + ], + + "ChannelNumber" => [ + "A string containing the current channel number, where the ". + "channel number can be followed by a minus (while entering a channel).", + + "" + ], + "ChannelName" => [ + "A string containing the current channel name, where the ". + "channel name can be a channel group separator. This also substitutes the ". + "channel logo (if present).", + + "" + ], + + "Language" => [ + "This substitutes a language logo, which will someday show the flag of ". + "the language currently in programme. Today only \"Audio 1\", \"Audio 2\" ". + "and \"Digital Audio\" are possible.", + + "" + ], + + "PresentDateTimeF" => [ + "The start date and time of the present event (in the channel display or ". + "while viewing EPG-details in the menu), formatted according to the ". + "format-parameter. ". + "To learn how the string can be formatted, please see man strftime.", + + "" + ], + + "PresentStartTime" => [ + "The start time of the present event (in the channel display or ". + "while viewing EPG-details in the menu), formatted like \"HH:MM\"", + + "" + ], + + "PresentDate" => [ + "The start date of the present event (in the channel display or ". + "while viewing EPG-details in the menu), formatted like \"dd.mm.\"", + + "" + ], + + "PresentVPSTime" => [ + "The VPS start time of the present event (in the channel display or ". + "while viewing EPG-details in the menu), formatted like \"HH:MM\", ". + "if present and different from the normal start time.", + + "" + ], + + "PresentEndTime" => [ + "The end time of the present event (in the channel display or ". + "while viewing EPG-details in the menu), formatted like \"HH:MM\"", + + "" + ], + + "PresentDuration" => [ + "The duration time of the present event (in the channel display or ". + "while viewing EPG-details in the menu), formatted like \"HH:MM\". This ". + "also substitutes the progress bar (timebar).", + + "" + ], + + "PresentVPS" => [ + "Substitutes a symbol, which shows whether the channel broadcasting ". + "the present event is a VPS-channel", + + "" + ], + + "PresentRunning" => [ + "Substitutes a symbol, which shows whether the present event is running.", + + "" + ], + + "PresentTimer" => [ + "Substitutes a symbol, which shows whether the present event is scheduled ". + "for recording.", + + "" + ], + + "PresentTitle" => [ + "The title of the currently displayed event.", + + "" + ], + + "PresentShortText" => [ + "The short text (or episode name) of the currently displayed event.", + + "" + ], + + "PresentDescription" => [ + "The long description of the currently displayed event. Makes most sense ". + "when used when displaying an EPG-detail in the menu, inside a Scrolltext.", + + "" + ], + + "FollowingStartTime" => [ + "The start time of the following event (in the channel display only), ". + "formatted like \"HH:MM\"", + + "" + ], + + "FollowingEndTime" => [ + "The end time of the following event (in the channel display only), ". + "formatted like \"HH:MM\"", + + "" + ], + + "FollowingDuration" => [ + "The duration time of the following event (in the channel display only), ". + "formatted like \"HH:MM\".", + + "" + ], + + "FollowingTitle" => [ + "The title of the following event.", + + "" + ], + + "FollowingShortText" => [ + "The short text (or episode name) of the following event.", + + "" + ], +); + +%DISPLAYPARAMS = ( + "DateTimeF" => "format", + "PresentDateTimeF" => "format" +); + +%DISPLAYSUBST = ( + "DateTimeF" => "text", + "DateTime" => "text", + "Date" => "text", + "Time" => "text", + "ChannelNumberName" => "text", + "ChannelNumber" => "text", + "ChannelName" => "text, path", + "Language" => "path", + "PresentDateTimeF" => "text", + "PresentStartTime" => "text", + "PresentDate" => "text", + "PresentVPSTime" => "text", + "PresentEndTime" => "text", + "PresentDuration" => "text, progress", + "PresentVPS" => "path", + "PresentRunning" => "path", + "PresentTimer" => "path", + "PresentTitle" => "text", + "PresentShortText" => "text", + "PresentDescription" => "text", + "FollowingStartTime" => "text", + "FollowingEndTime" => "text", + "FollowingDuration" => "text, progress", + "FollowingTitle" => "text", + "FollowingShortText" => "text", +); + +return 1; diff --git a/contrib/list_items.pl b/contrib/list_items.pl new file mode 100755 index 0000000..ad0fde9 --- /dev/null +++ b/contrib/list_items.pl @@ -0,0 +1,173 @@ +#!/usr/bin/perl + +$ITEMFILE="common.h"; +$PARMFILE="data.h"; + +sub printo { + my $text = shift; + my $len = shift; + print sprintf("%.*s", $len, $text); + if (length($text) < $len) { + print " " x ($len - length($text)); + } +} + +sub printa { + my $text = shift; + my $len = shift; + + my @words = split(/\s+/, $text); + my $offset = $len; + while (@words) { + $word = shift(@words); + if ($offset + length($word) + 1 >= 80) { + print "\n"; + print " " x $len; + $offset = $len; + } + print "$word "; + $offset += length($word) + 1; + } +} + +sub i18n { + my $text = shift; + if ($lang != 0) { + return $TRANS{$text}->[$lang - 1]; + } + return $text; +} + +require 'contrib/items.doc'; + +$lang = "en"; +if (defined($ARGV[0])) { + $lang = $ARGV[0]; +} +$lang = $LANGS{$lang}; + +print $INTRO[$lang]; + +$where = 0; +$until = ""; + +open DAT, "<$ITEMFILE" or die "Couldn't open $ITEMFILE: $!"; +while (defined($_ = )) { + chomp; + + /^enum\s+eSkinSection/ and do { + $where = 1; + $until = "__SECTION_COUNT__"; + print i18n("Known Sections")."\n"; + print "-" x length(i18n("Known Sections")); + print "\n\n"; + next; + }; + + /^enum\s+eSkinItem/ and do { + $where = 2; + $until = "__ITEM_COUNT__"; + print i18n("Known drawable Items")."\n"; + print "-" x length(i18n("Known drawable Items")); + print "\n\n"; + next; + }; + + /^enum\s+eSkinDisplay/ and do { + $where = 3; + $until = "__DISPLAY_COUNT__"; + print i18n("Known Display-Items")."\n"; + print "-" x length(i18n("Known Display-Items")); + print "\n\n"; + next; + }; + + (length($until) && /$until/) and do { + $where = 0; + $until = ""; + print "\n"; + next; + }; + + if ($where == 1) { + next if /sectionSkin/; + /section([\w]+)/ and do { + $what = $1; + printo i18n("Section:"), 15; + print "[$what]\n"; + printo i18n("Description:"), 15; + printa $SECTIONS{$what}->[$lang], 15; + print "\n\n"; + }; + } + + if ($where == 2) { + next if /itemUnknown/; + next if /itemSkin/; + /item([\w]+)/ and do { + $what = $1; + printo i18n("Item:"), 15; + print "Item=$what\n"; + printo i18n("Description:"), 15; + printa $ITEMS{$what}->[$lang], 15; + print "\n"; + printo i18n("Parameters:"), 15; + printa $ITEMPARAMS{$what}, 15; + print "\n\n"; + }; + } + + if ($where == 3) { + next if /displayAlways/; + /display([\w]+)/ and do { + $what = $1; + printo i18n("Display:"), 15; + print "display=$what\n"; + printo i18n("Description:"), 15; + printa $DISPLAYS{$what}->[$lang], 15; + print "\n"; + printo i18n("Parameters:"), 15; + printa $DISPLAYPARAMS{$what}, 15; + print "\n"; + printo i18n("Substitutes:"), 15; + printa $DISPLAYSUBST{$what}, 15; + print "\n\n"; + }; + } +} +close DAT; + +open DAT, "<$PARMFILE" or die "Couldn't open $PARMFILE: $!"; +while (defined($_ = )) { + chomp; + + /eSkinItem\s+mItem;/ and do { + $where = 1; + $until = "protected:"; + print i18n("Known Parameters")."\n"; + print "-" x length(i18n("Known Parameters")); + print "\n\n"; + next; + }; + + (length($until) && /$until/) and do { + $where = 0; + $until = ""; + next; + }; + + if ($where == 1) { + next if /mItem;\s*$/; + /m([\w]+);\s*$/ and do { + $what = lc($1); + printo i18n("Parameter:"), 15; + print "$what\n"; + printo i18n("Description:"), 15; + print "\n"; + printo i18n("Default:"), 15; + print "\n\n"; + }; + } +} +close DAT; + diff --git a/data.c b/data.c index 8e44dae..a801fb4 100644 --- a/data.c +++ b/data.c @@ -1,5 +1,5 @@ /* - * $Id: data.c,v 1.18 2004/06/12 18:00:05 lordjaxom Exp $ + * $Id: data.c,v 1.19 2004/06/16 18:46:50 lordjaxom Exp $ */ #include "data.h" @@ -23,27 +23,21 @@ cText2SkinItem::~cText2SkinItem() { } bool cText2SkinItem::Parse(const char *Text) { - char *text = strdup(Text); - char *ptr = text; + const char *text = Text; + const char *ptr = text; + bool res = false; // check if this is an item if (ParseVar(ptr, "Item", &mItem)) { - if (mItem == itemSkin) { // the Skin item - if (!ParseVar(ptr, "name", mName) || !ParseVar(ptr, "version", mVersion)){ - esyslog("ERROR: text2skin: Item=Skin is missing the name and/or version parameter(s)"); - return false; - } - } - - if (mItem != itemUnknown) { + if (mItem == itemSkin && (!ParseVar(ptr, "name", mName) || !ParseVar(ptr, "version", mVersion))) + esyslog("ERROR: text2skin: Item=Skin is missing the name and/or version parameter(s)"); + else if (mItem != itemUnknown) { ParseItem(ptr); - return true; + res = true; } } else esyslog("ERROR: text2skin: unknown item in skin"); - - // fall through - return false; + return res; } bool cText2SkinItem::ParseItem(const char *Text) { @@ -74,6 +68,11 @@ cText2SkinData::cText2SkinData(const char *Skin): cText2SkinFile(Skin) { } cText2SkinData::~cText2SkinData() { + for (int i = 0; i < __SECTION_COUNT__; ++i) { + for (int j = 0; j < (int)mSections[i].size(); ++j) + delete mSections[i][j]; + mSections[i].clear(); + } } bool cText2SkinData::Parse(const char *Text) { diff --git a/deprecated/SKINS b/deprecated/SKINS new file mode 100644 index 0000000..da5ea09 --- /dev/null +++ b/deprecated/SKINS @@ -0,0 +1,565 @@ + + +THIS DOCUMENT IS NOT UP-TO-DATE (sorry) + + +How To create text-based skins +------------------------------ + +[ TODO remove this ] +You may encounter bracketed phrases in this document. Please ignore them, they +are comments for me which will be removed in official release versions. + +[ TODO move this to manual ] +The Skin itself is located in a subdirectory "text2skin" inside the "plugins" +directory of your VDR configuration directory. This usually is the video +directory, if you didn't specify -c on the commandline. If you did, the +subdirectory is located there. Each skin has an own subdirectory there, which +holds the skin description file and the needed image files. The skin +description file must have the same name as the skin directory, with the +extension ".skin" + +Example (the Skin is called myskin): +/video0/plugins/text2skin/ +/video0/plugins/text2skin/myskin/ +/video0/plugins/text2skin/msykin/msykin.skin +/video0/plugins/text2skin/myskin/channeldisplay.png + +It is important that you understand the limitations of the OSD memory. If there +are too many objects with too many colors defined, VDR will throw an error and +some areas will not be displayed. For other output devices this limitations may +not apply, so if you are planning to design a skin for another output device, +feel free to use more colors, but remember that VDR can handle a maximum of 256 +areas per object. + +An object is defined to be a specific area with a specific palette and color +depth. Those objects will be referred to as 'backgrounds' later on. Calculate +the dimensions of them wisely, since overlapping areas or oversized areas will +lead to an error. Also, the widht and height of each area has to be a multiple +of four [ TODO may not apply to different output devices ]. + + +Creation of an image +-------------------- + +I used gimp to create some test images displaying things on screen, although +I don't know much about image processing :-). To give an advice, I will point +out how I created those test images. + +I've used a template for a menu provided by a community member, tiled it into +sections fully covered by the image. That made three images in this case. Then +I added a little bit of transparency to the image covering the middle part. I've +resized the image so that it's width and height were multiples of four. Now I've +added 50% transparency to the top layer of the image. Then I've reduced the +colordepth of the image (Image->Mode->Indexed) to 14 colors (of course the +image may not be too extensive, but 14 colors can give some nice gradients). +That leaves two colors for text and progress bar in the same display. Reduce +the number of colors according to the background depth and additional +decoration you intend to use. I saved the results to a png file and placed the +result into the skin. + +If you intend to use xpm's, be aware that VDR doesn't know about named colors, +so some images GIMP creates will not be read on-the-fly, because GIMP may use +some named colors, but VDR only recognizes "None". + + +The Description File Format +--------------------------- + +It is a simple configuration file, consisting of Sections and items. +Commentary lines can be added when they are lead in by a '#'. Blank lines will +be ignored. A section is placed in '[]' brackets. An item is lead in by an +'Item=object' phrase. + +Example: +Item=Skin,name=Test,version=0.0.1; +[Channel] +Item=Background,path=channeltop.xpm,x=42,y=350,width=540,height=32,bg=#00FFFFFF; +Item=Background,path=channel.png,x=48,y=382,width=528,height=84; +Item=ChannelNumberName,x=50,y=355,fg=#FFFFFFFF,bg=#FF1965FF,font=Sml; +Item=PresentTime,x=52,y=387,fg=#FFFFFFFF,bg=#7F002254,font=Osd; +[Volume] +Item=Background,x=10,y=10,width=10,height=100; +Item=Volumebar,x=10,y=10,width=10,height=100,bg=#FF000000,fg=#FFFFFFFF; + + +Known Sections +-------------- + +Section: [ChannelSmall] +Description: The channel display. It displays the current programme and number + only, together with some decoration. + +Section: [Channel] +Description: The channel display. It displays the current programme and number, + together with the currently running programme and possibly a + timebar and (not implemented yet) channel logo [ TODO remove + comment ]. + +Section: [Volume] +Description: The volume display. It displays the volumebar and possibly a mute + symbol, along with decorative items. + +Section: [ReplayMode] +Description: The replay modes display. Will be shown if only the replay mode + symbol shall be shown. + +Section: [Replay] +Description: [ TODO ] Full replay display. + +Section: [Message] +Description: [ TODO ] Message only display. + +Section: [Menu] +Description: [ TODO ] Full menu. + + +Known Items +----------- + +Item: Item=Skin +Description: This identifies the skin and adds a description to it. +Parameters: name, version + +Item: Item=Background +Description: This adds a background area for the specific display. This area + will be used to draw anything else, so you have to define a + background for everything that will be drawn later on. You can + define a background image for that area here, too. That picture + has to be the same width and height as the area. If you don't use + a background image, the area will be initialized with the bg color + (default 0). If an image is present, the background color will + replace the color 0 in the images palette, and the foreground + color will replace color 1. +Parameters: x, y, width, height, bpp, path, bg, fg + +Item: Item=Text +Description: Draws plain text into the given area, using the given foreground + color. The background color is ignored, so no initializing + rectangle will be drawn. If no width or height are given, the + limits are the background areas. +Parameters: x, y, text, width, height, fg, font, align + +Item: Item=Image +Description: Draws a plain image into the given area, using background and + foreground color (if given) to replace the palette indices 0 + and 1. +Parameters: x, y, width, height, fg, bg, path + +Item: Item=DateTime +Description: Draws a date and time string into the given area. Otherwise, see + Item=Text +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=Date +Description: Draws a date string into the given area. Otherwise, see Item=Text +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=Time +Description: Draws a time string into the given area. Otherwise, see Item=Text +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=DateTimeF +Description: Draws a string expressing some details of the current date and + time. What is to be displayed will be decided by the skin author. + The paremeter "format" holds a format string according to the + manpage of strftime. +Parameters: x, y, width, height, fg, font, align, text, format + +Item: Item=ChannelLogo +Description: Draws a logo for the current channel (if present). The logo's + filename will be the channel name, and the parameter type + gives the file extension. The parameter path can give an + additional subdirectory to the skin's directory. +Example: Item=ChannelLogo,path=logos/,type=png,...; +Parameters: x, y, width, height, fg, bg, path, type + +Item: Item=ChannelNumberName +Description: Draws the channel number and name into the given area. Otherwise, + see Item=Text +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=ChannelNumber +Description: Draws the channel number into the given area. Otherwise, see + Item=Text +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=ChannelName +Description: Draws the channel name into the given area. Otherwise, see + Item=Text +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=Rectangle +Description: Draws a filled rectangle into the defined area. +Parameters: x, y, width, height, fg + +Item: Item=Ellipse +Description: Draws a filled ellipse or a part of an ellipse into the defined + area. +Parameters: x, y, width, height, fg + +Item: Item=Timebar +Description: Draws a timebar displaying the progress of the current programme. + The area will be filled with the background color (if given) and + the bar will be drawn using the foreground color. If width is + greater than height, the bar will be drawn horizontally, otherwise + vertically. +Parameters: x, y, width, height, fg, bg + +Item: Item=PresentTime +Description: Draws the start time of the present programme. +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=PresentTitle +Description: Draws the title of the present programme. +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=PresentShortText +Description: Draws the short text (or episode name) of the present programme. +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=FollowingTime +Description: Draws the start time of the following programme. +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=FollowingTitle +Description: Draws the title of the following programme. +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=FollowingShortText +Description: Draws the short text (or episode name) of the following programme. +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=SymbolTeletext +Description: Draws the specified image into the specified location if the + current channel has teletext. If that is not the case, the + alternative image (if given) will be displayed. For details on the + image handling, see Item=Background. +Parameters: x, y, width, height, path, altpath, fg, bg + +Item: Item=SymbolAudio +Description: Draws the specified image into the specified location if the + current channel has multiple languages. If that is not the case, + the alternative image (if given) will be displayed. For details on + the image handling, see Item=Background. +Parameters: x, y, width, height, path, altpath, fg, bg + +Item: Item=SymbolDolby +Description: Draws the specified image into the specified location if the + current channel has ac3 sound. If that is not the case, the + alternative image (if given) will be displayed. For details on the + image handling, see Item=Background. +Parameters: x, y, width, height, path, altpath, fg, bg + +Item: Item=SymbolEncrypted +Description: Draws the specified image into the specified location if the + current channel is encrypted. If that is not the case, the + alternative image (if given) will be displayed. For details on the + image handling, see Item=Background. +Parameters: x, y, width, height, path, altpath, fg, bg + +Item: Item=SymbolRecording +Description: Draws the specified image into the specified location if VDR is + currently recording. If that is not the case, the alternative + image (if given) will be displayed. For details on the image + handling, see Item=Background. +Parameters: x, y, width, height, path, altpath, fg, bg + +Item: Item=SymbolRadio +Description: Draws the specified image into the specified location if the + current channel is a radio channel. If that is not the case, the + alternative image (if given) will be displayed. For details on the + image handling, see Item=Background. +Parameters: x, y, width, height, path, altpath, fg, bg + +Item: Item=SymbolPlay +Description: Draws the specified image into the specified location if the + current replay is playing normally. If that is not the case, the + alternative image (if given) will be displayed. For details on the + image handling, see Item=Background. +Parameters: x, y, width, height, path, altpath, fg, bg + +Item: Item=SymbolPause +Description: Draws the specified image into the specified location if the + current replay is paused. If that is not the case, the + alternative image (if given) will be displayed. For details on the + image handling, see Item=Background. +Parameters: x, y, width, height, path, altpath, fg, bg + +Item: Item=SymbolFastFwd +Description: Draws the specified image into the specified location if the + current replay is fast forwarding. If that is not the case, the + alternative image (if given) will be displayed. For details on the + image handling, see Item=Background. +Parameters: x, y, width, height, path, altpath, fg, bg + +Item: Item=SymbolFastRew +Description: Draws the specified image into the specified location if the + current replay is fast rewinding. If that is not the case, the + alternative image (if given) will be displayed. For details on the + image handling, see Item=Background. +Parameters: x, y, width, height, path, altpath, fg, bg + +Item: Item=SymbolSlowFwd +Description: Draws the specified image into the specified location if the + current replay is slow forwarding. If that is not the case, the + alternative image (if given) will be displayed. For details on the + image handling, see Item=Background. +Parameters: x, y, width, height, path, altpath, fg, bg + +Item: Item=SymbolSlowRew +Description: Draws the specified image into the specified location if the + current replay is slow rewinding. If that is not the case, the + alternative image (if given) will be displayed. For details on the + image handling, see Item=Background. +Parameters: x, y, width, height, path, altpath, fg, bg + +Item: Item=SymbolEventRunning +Description: Draws the specified image into the specified location if the + displayed event (in menu display) is currently running. If that + is not the case, the alternative image (if given) will be + displayed. For details on the image handling, see Item=Background. +Parameters: x, y, width, height, path, altpath, fg, bg + +Item: Item=SymbolEventTimer +Description: Draws the specified image into the specified location if the + displayed event (in menu display) will be recorded. If that is + not the case, the alternative image (if given) will be displayed. + For details on the image handling, see Item=Background. +Parameters: x, y, width, height, path, altpath, fg, bg + +Item: Item=SymbolEventVPS +Description: Draws the specified image into the specified location if the + displayed event (in menu display) is VPS. If that is not the + case, the alternative image (if given) will be displayed. For + details on the image handling, see Item=Background. +Parameters: x, y, width, height, path, altpath, fg, bg + +Item: Item=SymbolScrollUp +Description: Draws the specified image into the specified location if the + current display is scrollable and not at the top of its contents. + If that is not the case, the alternative image (if given) will be + displayed. For details on the image handling, see Item=Background. +Parameters: x, y, width, height, path, altpath, fg, bg + +Item: Item=SymbolScrollDown +Description: Draws the specified image into the specified location if the + current display is scrollable and not at the bottom of its + contents. If that is not the case, the alternative image (if + given) will be displayed. For details on the image handling, see + Item=Background. +Parameters: x, y, width, height, path, altpath, fg, bg + +Item: Item=Language +Description: Draws a logo for the current language (currently the only + languages VDR knows are "Audio 1" and possibly "Audio 2", + regardless of the real language). For more information on how + the logo is found, see Item=ChannelLogo. The logo's filename will + be the language's name. +Parameters: x, y, width, height, path, type, fg, bg + +Item: Item=Volumebar +Description: Draws a volumebar into the specified area. For more details, see + Item=Timebar. +Parameters: x, y, width, height, fg, bg + +Item: Item=Mute +Description: Draws a mute symbol and/or text (if given) into the specified area. + See Item=Text and Item=Background for more on text and image + handling. +Parameters: x, y, width, height, fg, bg, text, font, align, path + +Item: Item=Replaybar +Description: Draws a progressbar displaying the replay progress into the + specified area. For more details, see Item=Timebar. +Parameters: x, y, width, height, fg, bg + +Item: Item=ReplayTitle +Description: Draws the title of the current replay. +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=ReplayCurrent +Description: Draws the current time in the current replay. +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=ReplayTotal +Description: Draws the total length of the current replay. +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=ReplayJump +Description: Draws the "Jump:" prompt (if present) of the current replay. +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=MessageStatus +Description: Draws the current status message (if present). +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=MessageInfo +Description: Draws the current info message (if present). +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=MessageWarning +Description: Draws the current warning message (if present). +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=MessageError +Description: Draws the current error message (if present). +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=MenuArea +Description: Specifies the area in which the menu items will be shown as a + list. +Parameters: x, y, width, height + +Item: Item=MenuItem +Description: Specifies how one item is drawn in the list of menu items. + list. +Parameters: [x,] [y,] width, height, fg, bg, font, align + +Item: Item=MenuCurrent +Description: Specifies how the currently selected item is drawn in the list of + menu items. + list. +Parameters: [x,] [y,] width, height, fg, bg, font, align + +Item: Item=MenuTitle +Description: Draws the title line of the displayed menu. +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=MenuRed, Item=MenuGreen, Item=MenuYellow, Item=MenuBlue +Description: Draws the red, green, yellow or blue (respectively) button. +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=MenuText +Description: Draws the current menu text in a scrollable text-area. If this + item is present, SymbolScrollUp and SymbolScrollDown apply, too. +Parameters: x, y, width, height, fg, [bg,] font, [align,] text + +Item: Item=MenuEventTitle +Description: Draws the title of the currently selected event when viewing EPG + entries. +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=MenuEventShortText +Description: Draws the short text or episode name of the currently selected + event when viewing EPG entries. +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=MenuEventDescription +Description: Draws the long text of the currently selected event when viewing + EPG entries in a scrollable text-area. If this item is present, + SymbolScrollUp and SymbolScrollDown apply, too. +Parameters: x, y, width, height, fg, [bg,] font, [align,] text + +Item: Item=MenuEventTime +Description: Draws the start time of the currently selected event when viewing + EPG entries. +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=MenuEventEndTime +Description: Draws the end time of the currently selected event when viewing + EPG entries. +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=MenuEventVPSTime +Description: Draws the vps time of the currently selected event when viewing + EPG entries, if that is different from the start time. +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=MenuEventDate +Description: Draws the date of the currently selected event when viewing + EPG entries. +Parameters: x, y, width, height, fg, font, align, text + +Item: Item=MenuEventDateTimeF +Description: Draws a string expressing some details of the start time of the + currently selected event when viewing EPG entries. What is to + be displayed will be decided by the skin author. The paremeter + "format" holds a format string according to the manpage of + strftime. +Parameters: x, y, width, height, fg, font, align, text, format + +Item: Item=MenuRecording +Description: Draws the summary of the currently selected recording when + browsing recordings in a scrollable text-area. If this item is + present, SymbolScrollUp and SymbolScrollDown apply, too. +Parameters: x, y, width, height, fg, [bg,] font, [align,] text + +Known Parameters +---------------- + +Parameter: x +Description: A positive number representing the vertical offset in pixels. +Default: MANDATORY + +Parameter: y +Description: A positive number representing the horizontal offset in pixels. +Default: MANDATORY + +Parameter: width +Description: A positive number representing the width in pixels. +Default: not given (sometimes mandatory) + +Parameter: height +Description: A positive number representing the height in pixels. +Default: not given (sometimes mandatory) + +Parameter: bpp +Description: A positive number representing the depth of a background area. + Possible values are 1, 2, 3, 4 and 8 mapping to 2, 4, 8, 16 and + 256 colors. +Default: 4 (16 colors) + +Parameter: fg +Description: A hex quadriplet [ TODO is this word correct?! ] introduced by '#' + representing a 32-bit foreground color in the order ARGB. +Default: not given +Example: #ff000000 + +Parameter: bg +Description: A hex quadriplet [ TODO is this word correct?! ] introduced by '#' + representing a 32-bit background color in the order ARGB. +Default: not given + +Parameter: font +Description: A string representing one of VDR's skins, possible values are + 'Osd', 'Sml' and 'Fix'. +Default: Osd + +Parameter: path +Description: A string representing a path- and filename relative to the skin + directory. Currently, xpm images and png files (with alphachannel + support) can be loaded, but the number of different colors used + in the image must not exceed those possible in the corresponding + background area. +Default: not given + +Parameter: altpath +Description: A string representing a path- and filename relative to the skin + directory. This is used for for displaying alternate images i.e. + for symbols. For more information, see path=... +Default: not given + +Parameter: text +Description: For non-text-items (and for the item "Text" itself), this is the + plain text to be displayed. For items that have it's own texts + (such as "Date", "PresentTitle" etc.), this is a template that + defines how the text is to be displayed. A dollar symbol '$' will + be replaced by the original text. +Default: not given +Example: Item=ReplayCurrent,text=Current: $; would display for example + "Current: 0:00:21" instead of only "0:00:21". + +Parameter: type +Description: The string giving the file extensions for logos. +Default: not given + +Parameter: type +Description: The format string for a date/time display according to strftime. +Default: "" + +Parameter: align +Description: A number describing the text alignment. Possible values are '0' + for left aligned, '1' for centered and '2' for right aligned. +Default: 0 + diff --git a/deprecated/SKINS.de b/deprecated/SKINS.de new file mode 100644 index 0000000..2e1cc8e --- /dev/null +++ b/deprecated/SKINS.de @@ -0,0 +1,259 @@ + + +DIESES DOKUMENT IST NICHT AUF DEM NEUESTEN STAND (sorry) + + +Wie man textbasierte Skins erstellt +----------------------------------- + +Das Skin selbst findet in einem Unterverzeichnis "text2skin" innerhalb des +"plugins" Verzeichnisses ihres Konfigurationsordners. Das ist normalerweise das +Videoverzeichnis, wenn beim VDR-Start -c nicht angegeben wurde, sonst eben das +dort angegebene. Jedes Skin hat dort ein eigenes Verzeichnis, welches die +Beschreibungsdatei und Bilder enthält. Die Beschreibungsdatei muss den gleichen +Namen wie das Skin tragen, mit der Dateiendung ".skin". + +Beispiel (das Skin heisst myskin): +/video0/plugins/text2skin/ +/video0/plugins/text2skin/myskin/ +/video0/plugins/text2skin/myskin/myskin.skin +/video0/plugins/text2skin/myskin/channeldisplay.png + +Es ist wichtig, dass sie die Limitierungen des OSD Speichers verstehen. Wenn +zuviele Objekte mit zuvielen Farben definiert werden, dann wird VDR einen +Fehler ins Log schreiben und einige Bereiche werden nicht angezeigt werden. Bei +anderen Ausgabegeräten mag es sein, dass diese Limitierungen nicht zutreffen, +wenn Sie also ein Skin für ein anderes Gerät schreiben möchten, benutzen Sie +ruhig ein paar mehr Farben, aber denken Sie daran, dass VDR generell maximal +256 Farben pro Objekt verwalten kann. + +Ein Objekt ist als ein bestimmter Bereich definiert, der eine bestimmte +Farbpalette und Farbtiefe verwendet. Diese Objekte werden im Verlauf dieses +Dokuments "Backgrounds" genannt. Berechnen sie die Dimensionen dieser Bereiche +weise, denn überlappende oder übergroße Backgrounds führen zu einem Fehler. +Zusätzlich muss die Breite und Höhe jedes Backgrounds durch vier teilbar sein. + + +Die Erstellung eines Bildes +--------------------------- + +Ich habe mit gimp einige Beispielbilder erstellt, die Dinge auf dem Bildschirm +anzeigen, obwohl ich mit Grafik eigentlich recht wenig am Hut habe. Um einige +Hinweise zu geben, werde ich erklären wie ich diese Bilder erzeugt habe. + +Ich habe eine Vorlage für ein Kanaldisplay von einem Community-Mitglied +erhalten, dieses in drei Bereiche zerlegt, die jeweils komplett vom Hintergrund +gefüllt wurden. Nun habe ich das Bild so vergrößert, dass Breite und Höhe durch +vier teilbar sind. Um im mittleren Bereich etwas Transparenz zu erzeugen, habe +ich die Deckkraft der Bildebene auf 50% reduziert. Anschliessend habe ich alle +Bilder auf 14 Farben reduziert (Bild->Modus->Indiziert) (natürlich darf das +Bild nicht zu aufwändig sein, aber mit 14 Farben bekommt man schon schöne +Übergänge hin. Dann bleiben zwei Farben für Text und Symbole übrig, und das +ganze passt in einen 16-farb (4-bit) Background. Reduzieren sie die Azahl der +Farben entsprechend, wenn Sie beabsichtigen, mehr Vordergrundobjekte zu +zeichnen. Das Ergebnis habe ich als PNG gespeichert und in das Skin kopiert. + +Wenn sie beabsichtigen, xpm's zu nutzen, achten sie darauf dass VDR keine +benannten Farben beherrscht, es könnte also sein dass Bilder die gimp erzeugt +nicht sofort nutzbar sind. Die einzige benannte Farbe, die VDR beherrscht, ist +"None". + + +Das Format der Beschreibungsdatei +--------------------------------- + +Die Datei ist eine einfache Konfigurationsdatei, die aus Sektionen und Objekten +besteht. Kommentarzeilen können mit einem '#' eingeleitet werden. Leerzeilen +werden ignoriert. Eine Sektion ist von eckigen '[]' Klammern eingeschlossen. +Ein Objekt beginnt mit dem Text "Item=", gefolgt von der Art des Objekts. +Dahinter folgen Parameter für das Objekt, mit Komma getrennt. Die Zeile wird +durch ein Semikolon ';' abgeschlossen. + +Beispiel: +Item=Skin,name=Test,version=0.0.1; +[Channel] +Item=Background,path=channeltop.xpm,x=42,y=350,width=540,height=32,bg=#00FFFFFF; +Item=Background,path=channel.png,x=48,y=382,width=528,height=84; +Item=ChannelNumberName,x=50,y=355,fg=#FFFFFFFF,bg=#FF1965FF,font=Sml; +Item=PresentTime,x=52,y=387,fg=#FFFFFFFF,bg=#7F002254,font=Osd; +[Volume] +Item=Background,x=10,y=10,width=10,height=100; +Item=Volumebar,x=10,y=10,width=10,height=100,bg=#FF000000,fg=#FFFFFFFF; + + +Bekannte Sektionen +------------------ + +Sektion: [ChannelSmall] + Die Kanalanzeige, die nur aktuellen Kanalnamen und -nummer + anzeigt. + +Sektion: [Channel] +Beschreibung: Die Kanalanzeige. Sie zeigt aktuellen Kanalnamen und -nummer, + gemeinsam mit dem aktuellen Programm und möglicherweise eine + Zeitleiste und ein Kanallogo (noch nicht implementiert). + +Sektion: [Volume] +Beschreibung: Die Lautstärkeanzeige. Zeigt die Lautstärkeleiste und + möglicherweise ein Mute-Symbol und etwas Dekoration. + +Sektion: [ReplayMode] +Beschreibung: Die Wiedergabeanzeige. Wird angezeigt wenn nur der + Wiedergabemodus gezeigt werden soll. + +Sektion: [Replay] +Beschreibung: [ TODO ] Die große Wiedergabeanzeige + +Sektion: [Message] +Beschreibung: [ TODO ] Anzeige einer Nachricht + +Sektion: [Menu] +Beschreibung: [ TODO ] Vollständiges Menü + + +Bekannte Objekte +---------------- + +Objekt: Item=Skin +Beschreibung: Dieses Objekt identifiziert ein Skin und fügt eine Beschreibung + hinzu. +Parameter: name, version + +Objekt: Item=Background +Parameter: x, y, width, height, bpp, path, bg, fg + +Objekt: Item=Text +Parameter: x, y, text, width, height, fg, font, align + + +Objekt: Item=DateTime +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=Date +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=Time +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=ChannelNumberName +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=ChannelNumber +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=ChannelName +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=Rectangle +Parameter: x, y, width, height, fg + +Objekt: Item=Ellipse +Parameter: x, y, width, height, fg + +Objekt: Item=Timebar +Parameter: x, y, width, height, fg, bg + +Objekt: Item=PresentTime +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=PresentTitle +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=PresentShortText +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=FollowingTime +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=FollowingTitle +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=FollowingShortText +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=SymbolTeletext +Parameter: x, y, width, height, path, altpath, fg, bg + +Objekt: Item=SymbolAudio +Parameter: x, y, width, height, path, altpath, fg, bg + +Objekt: Item=SymbolDolby +Parameter: x, y, width, height, path, altpath, fg, bg + +Objekt: Item=SymbolEncrypted +Parameter: x, y, width, height, path, altpath, fg, bg + +Objekt: Item=Volumebar +Parameter: x, y, width, height, fg, bg + +Objekt: Item=Mute +Parameter: x, y, width, height, fg, bg, text, font, align, path + +Objekt: Item=Progressbar +Parameter: x, y, width, height, fg, bg + +Objekt: Item=ReplayTitle +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=ReplayCurrent +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=ReplayTotal +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=ReplayJump +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=MessageStatus +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=MessageInfo +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=MessageWarning +Parameter: x, y, width, height, fg, font, align + +Objekt: Item=MessageError +Parameter: x, y, width, height, fg, font, align + + +Bekannte Parameters +---------------- + +Parameter: x +Standard: PFLICHT + +Parameter: y +Standard: PFLICHT + +Parameter: width +Standard: nicht gesetzt (sometimes mandatory) + +Parameter: height +Standard: nicht gesetzt (sometimes mandatory) + +Parameter: bpp +Standard: 4 (16 Farbem) + +Parameter: fg +Standard: nicht gesetzt +Beispiel: #ff000000 + +Parameter: bg +Standard: nicht gesetzt + +Parameter: font +Standard: Osd + +Parameter: path +Standard: nicht gesetzt + +Parameter: altpath +Standard: nicht gesetzt + +Parameter: text +Standard: nicht gesetzt + +Parameter: align +Standard: 0 + diff --git a/display.c b/display.c index 50f042d..43a6786 100644 --- a/display.c +++ b/display.c @@ -1,5 +1,5 @@ /* - * $Id: display.c,v 1.16 2004/06/12 18:00:05 lordjaxom Exp $ + * $Id: display.c,v 1.17 2004/06/16 18:46:50 lordjaxom Exp $ */ #include "render.h" @@ -300,8 +300,8 @@ void cText2SkinDisplayMenu::SetItem(const char *Text, int Index, bool Current, b if (!Tab(i + 1)) break; } - SetEditableWidth(mRender->GetEditableWidth(item, Current)); mRender->Lock(); + SetEditableWidth(mRender->GetEditableWidth(item, Current)); if ((int)mRender->mMenuItems.size() <= Index) { mRender->mMenuItems.push_back(item); mDirty = true; diff --git a/i18n.c b/i18n.c index 4493b3b..affc848 100644 --- a/i18n.c +++ b/i18n.c @@ -1,5 +1,5 @@ /* - * $Id: i18n.c,v 1.6 2004/06/12 21:16:18 lordjaxom Exp $ + * $Id: i18n.c,v 1.7 2004/06/16 18:46:50 lordjaxom Exp $ */ #include "i18n.h" @@ -54,6 +54,11 @@ cText2SkinI18n::cText2SkinI18n(const char *Skin): cText2SkinFile(Skin) { } cText2SkinI18n::~cText2SkinI18n() { + for (int i = 0; mPhrases[i][0]; ++i) { + for (int j = 0; j < I18nNumLanguages; ++j) + free((void*)mPhrases[i][j]); + } + free(mPhrases); } bool cText2SkinI18n::Parse(const char *Text) { @@ -66,17 +71,18 @@ bool cText2SkinI18n::Parse(const char *Text) { memset(&p, 0, sizeof(tI18nPhrase)); Text += 17; - for (i = 0; i < I18nNumLanguages; ++i) { char *langs = strdup(I18nLanguageCode(i)); char *ptr = langs, *ep; string text; - p[i] = ""; + p[i] = strdup(""); do { if ((ep = strchr(ptr, ',')) != NULL) *ep = '\0'; - if (ParseVar(Text, ptr, text)) + if (ParseVar(Text, ptr, text)) { + free((void*)p[i]); p[i] = strdup(text.c_str()); + } ptr = ep + 1; } while (ep != NULL); free(langs); diff --git a/loader.c b/loader.c index d2218da..3bbb5ec 100644 --- a/loader.c +++ b/loader.c @@ -1,5 +1,5 @@ /* - * $Id: loader.c,v 1.10 2004/06/11 15:01:58 lordjaxom Exp $ + * $Id: loader.c,v 1.11 2004/06/16 18:46:50 lordjaxom Exp $ */ #include "loader.h" @@ -74,7 +74,6 @@ cText2SkinLoader::~cText2SkinLoader() { delete mData; delete mI18n; delete mTheme; - // mDescription is part of mData } cSkinDisplayChannel *cText2SkinLoader::DisplayChannel(bool WithInfo) { diff --git a/render.c b/render.c index 03ad7eb..e778dfc 100644 --- a/render.c +++ b/render.c @@ -1,5 +1,5 @@ /* - * $Id: render.c,v 1.30 2004/06/13 18:19:18 lordjaxom Exp $ + * $Id: render.c,v 1.31 2004/06/16 18:46:50 lordjaxom Exp $ */ #include "render.h" @@ -48,8 +48,6 @@ cText2SkinRender::cText2SkinRender(cText2SkinLoader *Loader, eSkinSection Sectio mActive = false; mUpdateIn = 0; - cText2SkinBitmap::FlushCache(); - cText2SkinData::tIterator it = mData->First(mSection); for (; it != mData->Last(mSection); ++it) { if ((*it)->Item() == itemBackground) { @@ -90,26 +88,25 @@ cText2SkinRender::cText2SkinRender(cText2SkinLoader *Loader, eSkinSection Sectio } esyslog("ERROR: text2skin: OSD provider can't handle skin: %s\n", emsg); } - Start(); } cText2SkinRender::~cText2SkinRender() { if (mActive) { mActive = false; - TriggerUpdate(); + Flush(); Cancel(3); } delete mScroller; delete mOsd; + cText2SkinBitmap::FlushCache(); } void cText2SkinRender::Action(void) { mActive = true; Lock(); while (mActive) { - bool res = true; - if (mUpdateIn) res = mDoUpdate.TimedWait(mMutex, mUpdateIn); + if (mUpdateIn) mDoUpdate.TimedWait(mMutex, mUpdateIn); else mDoUpdate.Wait(mMutex); if (!mActive) break; // fall out if thread to be stopped @@ -121,6 +118,9 @@ void cText2SkinRender::Action(void) { } void cText2SkinRender::Update(void) { + if (mScroller && !mMenuScroll) + mOsd->SaveRegion(mScroller->Left(), mScroller->Top(), mScroller->Left() + mScroller->Width() - 1, mScroller->Top() + mScroller->Height() - 1); + cText2SkinData::tIterator it = mData->First(mSection); for (; it != mData->Last(mSection); ++it) { switch ((*it)->Display()) { @@ -362,12 +362,30 @@ void cText2SkinRender::DrawMark(const POINT &Pos, const SIZE &Size, bool Start, } } -void cText2SkinRender::DrawScrollText(const POINT &Pos, const SIZE &Size, const tColor *Fg, const string &Text, const cFont *Font, int Align) { +void cText2SkinRender::DrawScrolltext(const POINT &Pos, const SIZE &Size, const tColor *Fg, const string &Text, const cFont *Font, int Align) { if (mScroller == NULL) mScroller = new cTextScroller(mOsd, Pos.x, Pos.y, Size.w, Size.h, Text.c_str(), Font, Fg ? *Fg : 0, clrTransparent); else if (mMenuScroll) { mScroller->Scroll(mMenuScrollUp, mMenuScrollPage); mMenuScroll = false; + } else + mOsd->RestoreRegion(); +} + +void cText2SkinRender::DrawScrollbar(const POINT &Pos, const SIZE &Size, int Offset, int Shown, int Total, const tColor *Bg, const tColor *Fg) { + DrawRectangle(Pos, Size, Bg); + if (Size.h > Size.w) { + POINT sp = Pos; + SIZE ss = Size; + sp.y += Size.h * Offset / Total; + ss.h -= Size.h * (Shown - 2) / Total; + DrawRectangle(sp, ss, Fg); + } else { + POINT sp = Pos; + SIZE ss = Size; + sp.x += Size.w * Offset / Total; + ss.w -= Size.w * (Shown - 2) / Total; + DrawRectangle(sp, ss, Fg); } } @@ -382,14 +400,15 @@ void cText2SkinRender::DisplayItem(cText2SkinItem *Item, const ItemData *Data) { DrawText(Item->Pos(), Item->Size(), ItemFg(Item), ItemText(Item, Data->text), Item->Font(), Item->Align()); break; case itemScrolltext: - DrawScrollText(Item->Pos(), Item->Size(), ItemFg(Item), Data->text, Item->Font(), Item->Align()); + DrawScrolltext(Item->Pos(), Item->Size(), ItemFg(Item), Data->text, Item->Font(), Item->Align()); break; case itemImage: DrawImage(Item->Pos(), Item->Size(), ItemBg(Item), ItemFg(Item), Item->Alpha(), Item->Path()); break; case itemLogo: case itemSymbol: - DrawImage(Item->Pos(), Item->Size(), ItemBg(Item), ItemFg(Item), Item->Alpha(), Data->path); + if (Data->path != "") + DrawImage(Item->Pos(), Item->Size(), ItemBg(Item), ItemFg(Item), Item->Alpha(), Data->path); break; case itemRectangle: DrawRectangle(Item->Pos(), Item->Size(), ItemFg(Item)); @@ -403,6 +422,8 @@ void cText2SkinRender::DisplayItem(cText2SkinItem *Item, const ItemData *Data) { case itemProgress: DrawProgressbar(Item->Pos(), Item->Size(), Data->current, Data->total, ItemBg(Item), ItemFg(Item), Data->marks); break; + case itemScrollbar: + DrawScrollbar(Item->Pos(), Item->Size(), Data->current, Data->shown, Data->total, ItemBg(Item), ItemFg(Item)); default: break; } @@ -710,11 +731,10 @@ void cText2SkinRender::DisplayVolume(cText2SkinItem *Item) { } void cText2SkinRender::DisplayMuteIcon(cText2SkinItem *Item) { - if (mVolumeMute) { - ItemData data; - data.path = Item->Path(); + ItemData data; + data.path = mVolumeMute ? Item->Path() : Item->AltPath(); + if (data.path != "") DisplayItem(Item, &data); - } } void cText2SkinRender::DisplayReplayTime(cText2SkinItem *Item) { @@ -841,8 +861,15 @@ void cText2SkinRender::DisplayMenuText(cText2SkinItem *Item) { default: break; } - if (data.text != "") + if (data.text != "") { + // HACK: make sure the scroller exists! + if (mScroller) { + data.current = mScroller->Offset(); + data.shown = mScroller->Shown(); + data.total = mScroller->Total(); + } DisplayItem(Item, &data); + } } void cText2SkinRender::DisplayMenuScrollIcon(cText2SkinItem *Item) { diff --git a/render.h b/render.h index 2433dbf..b47db56 100644 --- a/render.h +++ b/render.h @@ -1,5 +1,5 @@ /* - * $Id: render.h,v 1.21 2004/06/12 18:00:05 lordjaxom Exp $ + * $Id: render.h,v 1.22 2004/06/16 18:46:50 lordjaxom Exp $ */ #ifndef VDR_TEXT2SKIN_RENDER_H @@ -37,6 +37,7 @@ private: string text; string path; int current; + int shown; int total; const cMarks *marks; ItemData(void) { marks = NULL; } @@ -113,7 +114,8 @@ protected: void DrawSlope(const POINT &Pos, const SIZE &Size, const tColor *Fg, int Arc); void DrawProgressbar(const POINT &Pos, const SIZE &Size, int Current, int Total, const tColor *Fg, const tColor *Bg, const cMarks *Marks = NULL); void DrawMark(const POINT &Pos, const SIZE &Size, bool Start, bool Current, bool Horizontal); - void DrawScrollText(const POINT &Pos, const SIZE &Size, const tColor *Fg, const string &Text, const cFont *Font, int Align); + void DrawScrolltext(const POINT &Pos, const SIZE &Size, const tColor *Fg, const string &Text, const cFont *Font, int Align); + void DrawScrollbar(const POINT &Pos, const SIZE &Size, int Offset, int Shown, int Total, const tColor *Bg, const tColor *Fg); // displays a full item void DisplayItem(cText2SkinItem *Item, const ItemData *Data = NULL); @@ -149,14 +151,13 @@ protected: tColor *ItemFg(cText2SkinItem *Item); tColor *ItemBg(cText2SkinItem *Item); int GetEditableWidth(MenuItem Item, bool Current); - void TriggerUpdate(void) { mDoUpdate.Broadcast(); } void Update(void); public: cText2SkinRender(cText2SkinLoader *Loader, eSkinSection Section); virtual ~cText2SkinRender(); - void Flush(void) { TriggerUpdate(); } + void Flush(void) { Lock(); mDoUpdate.Broadcast(); Unlock(); } }; #endif // VDR_TEXT2SKIN_RENDER_H diff --git a/text2skin.c b/text2skin.c index 8ded7a4..c974236 100644 --- a/text2skin.c +++ b/text2skin.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: text2skin.c,v 1.19 2004/06/13 18:20:17 lordjaxom Exp $ + * $Id: text2skin.c,v 1.20 2004/06/16 18:46:50 lordjaxom Exp $ */ #include "text2skin.h" @@ -11,7 +11,7 @@ #include "i18n.h" #include "loader.h" -const char *cText2SkinPlugin::VERSION = "0.0.4"; +const char *cText2SkinPlugin::VERSION = "0.0.5"; const char *cText2SkinPlugin::THEMEVERSION = "0.0.2"; const char *cText2SkinPlugin::DESCRIPTION = "Loader for text-based skins"; diff --git a/theme.c b/theme.c index c76166d..706a15d 100644 --- a/theme.c +++ b/theme.c @@ -1,5 +1,5 @@ /* - * $Id: theme.c,v 1.1 2004/06/02 20:43:05 lordjaxom Exp $ + * $Id: theme.c,v 1.2 2004/06/16 18:46:50 lordjaxom Exp $ */ #include "theme.h" #include @@ -17,9 +17,9 @@ bool cText2SkinTheme::Parse(const char *Text) { if (strncmp(Text, "Item=Color,", 11) == 0) { Text += 11; string name; - tColor *value; + tColor value; if (ParseVar(Text, "name", name) && ParseVar(Text, "default", &value)) { - mMap[name] = mTheme.AddColor(name.c_str(), *value); + mMap[name] = mTheme.AddColor(name.c_str(), value); result = true; } else esyslog("ERROR: text2skin: Parameters name and default must be present\n"); -- cgit v1.2.3