summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore7
-rw-r--r--Docs/Reference.txt4
-rw-r--r--Docs/Tutorial.txt2
-rw-r--r--HISTORY221
-rw-r--r--Makefile72
-rw-r--r--README4
-rw-r--r--README.de60
-rw-r--r--cache.h1
-rw-r--r--common.c161
-rw-r--r--common.h36
-rw-r--r--display.c296
-rw-r--r--display.h6
-rw-r--r--font.c5
-rw-r--r--graphtft/font.c16
-rw-r--r--graphtft/font.h4
-rw-r--r--i18n.c41
-rw-r--r--i18n.h11
-rw-r--r--loader.c6
-rw-r--r--menu.c16
-rw-r--r--po/de_DE.po31
-rw-r--r--po/fi_FI.po31
-rw-r--r--po/it_IT.po35
-rw-r--r--render.c354
-rw-r--r--render.h36
-rw-r--r--screen.c10
-rw-r--r--setup.c1
-rw-r--r--setup.h2
-rw-r--r--status.c220
-rw-r--r--status.h34
-rw-r--r--text2skin.c10
-rw-r--r--xml/object.c112
-rw-r--r--xml/object.h52
-rw-r--r--xml/parser.c12
-rw-r--r--xml/skin.c17
-rw-r--r--xml/skin.h33
-rw-r--r--xml/string.c3
-rw-r--r--xml/string.h4
-rw-r--r--xml/type.h1
-rw-r--r--xml/xml.c2
39 files changed, 953 insertions, 1016 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c915306
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+.dependencies
+*.o
+*.so*
+*.pot
+*.tgz
+*~
+debian
diff --git a/Docs/Reference.txt b/Docs/Reference.txt
index cc2ea2a..eca00f8 100644
--- a/Docs/Reference.txt
+++ b/Docs/Reference.txt
@@ -821,7 +821,7 @@ True, if one parameter is true.
---------
True, if both parameters are true.
- equal('Kanäle', trans('Channels'))
+ equal('Kanäle', trans('Channels'))
3.5 ne
---------
@@ -868,7 +868,7 @@ Returns the parameter, if the file exists in the skin directory.
---------
Rreturn the translation (i18n) of the parameter, false, if no translation is found.
- equal('Kanäle', trans('Channels'))
+ equal('Kanäle', trans('Channels'))
4. Attributes
diff --git a/Docs/Tutorial.txt b/Docs/Tutorial.txt
index 1b95588..b173824 100644
--- a/Docs/Tutorial.txt
+++ b/Docs/Tutorial.txt
@@ -231,7 +231,7 @@ The same applies to "{MenuTitle:clean}" if a logo for the current menu page is w
* file - returns the parameter, if the file exists in the skin directory
(e.g. "file('logos/{ChannelName}.png')" )
* trans - return the translation (i18n) of the parameter, false, if no translation is found
- (e.g. "equal('Kanäle', trans('Channels'))" )
+ (e.g. "equal('Kanäle', trans('Channels'))" )
Normally strings in function are quoted in quotation marks, only if the simply consists of a token the quotation marks can be omitted. (e.g. "not({MenuText})" instead of "not('{MenuText}')" )
diff --git a/HISTORY b/HISTORY
index 002f1bd..aad47bd 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,144 +1,97 @@
VDR Plugin 'text2skin' Revision History
---------------------------------------
-2007-07-29: Version 1.1-cvs_ext-0.11 (text2skin-1.1-cvs_ext-0.11.diff)
-
-- moved state tracking of marquee, blink, scroll from cText2SkinRender
- to cxObject
-- fixed compatibility with gcc-4 and vdr-1.5.x
-- fixed use of Update.Lock() in render.h
-- new: dynamic width/height of objects
-- new: Option "bgColor" used for items "Text", "Marquee", and "Blink".
-- remember period to next timeout when doing a non-timeout refresh
- prevent occasional start/stop of marquee-text
-
-2007-05-06: Version 1.1-cvs_ext-0.10c (text2skin-1.1-cvs_ext-0.10c.diff)
-
-- selective update of changed objects
- refresh can be controlled for individual objects by the attributes
- "refresh" and "changed"
- default behaviour is to redraw everything (compatible with old skins)
-
-2007-05-06: Version 1.1-cvs_ext-0.10b (text2skin-1.1-cvs_ext-0.10b.diff)
-
-- increase skin file version to 1.1
-- the position of list items is interpreted relative to the "list" container
- when file version >= 1.1
-- when a position is specified for "block" elements, the position of all
- contained elements is interpreted relative to the container position
-
-2007-05-06: Version 1.1-cvs_ext-0.10a (text2skin-1.1-cvs_ext-0.10a.diff)
-
-- increased efficiency in drawing list items in the main menu
-- introduce relative Pos and Size of objects to given BasePos, BaseSize
- (used to draw list items)
-
-2006-12-03: Version 1.1-cvs_ext-0.10 (vdr-text2skin-1.1-cvs_ext-0.10.diff)
-
-- set EditableWidth. This is important for plugins like 'rotor' or
- 'extrecmenu'
-- now setting the locale setting LC_TIME according to the language-selection
- in VDR
-
-2006-11-19: Version 1.1-cvs_ext-0.9a (vdr-text2skin-1.1-cvs_ext-0.9a.diff)
-
-- added APIVERSION to the Makefile for vdr-1.3.47
-- fixed possible buffer overflow in xml reading (updated to cvs-version
- of text2skin)
-
-2006-11-19: Version 1.1-cvs_ext-0.9 (vdr-text2skin-1.1-cvs_ext-0.9.diff)
-
-- added a test-feature to search for reruns of a program and add the
- information to the extended epg-info (trigger DEVELOPMENT_FEATURES).
- This uses a service-interface of the epgsearch-plugin
- "Epgsearch-searchresults-v1.0"
-- the timer-conflicts are now checked with epgsearch (service-interface
- "Epgsearch-lastconflictinfo-v1.0", as it works more reliable and is
- supported by the plugin author
-- the extended epg-info and the recording-info are extended by AUX-Infos
- (configurable)
- there is also an option to strip known tags
-- the tab-widths are scaled for taking into account that different TT-Fonts
- have a different width than the default font from VDR
-- added tokens for signal-info:
- FrontendSTR, FrontendSNR, FrontendHasLock, FrontendHasSignal
-- changed token TimerConflict to TimerConflicts
-- added token PresentEventID for EPG-images
-- added tokens for recordings:
- RecordingFilename, RecordingPriority, RecordingLifetime
-- removed Text2skin.diff from the rotor-plugin
-
-2006-02-04: Version 1.1-cvs_ext-0.8 (vdr-text2skin-1.1-cvs_ext-0.8.diff)
-
-- added a configuration option for showing the scrollbar in the menus and
- finished implementation
-
-2006-02-04: Version 1.1-cvs_ext-0.7 (vdr-text2skin-1.1-cvs_ext-0.7.diff)
-
-- changed the routines to determine the next timers
-- added the possibility to have a scrollbar in every menu - not fully
- implemented yet (to position in menu-lists is not necessarily correct,
- if there are more items with the same osd-text)
-
-2006-01-10: Version 1.1-cvs_ext-0.6 (vdr-text2skin-1.1-cvs_ext-0.6.diff)
-
-- updated to cvs-version of text2skin
-- since vdr-1.3.38 it is possible to exactly identify the replayed
- recording, so the replay-tokens work now
-- switched the search-order for the fonts to priorise the skin-folder
- (this avoids error-messages in the log)
-
-2006-01-07: Version 1.1-cvs_ext-0.5 (vdr-text2skin-1.1-cvs_ext-0.5.diff)
-
-- modifications to compile with vdr-versions >= 1.3.18
-- added tokens:
- OsdWidth, OsdHeight
-- activating the token ReplayVideoAR
-
-2005-12-18: Version 1.1-cvs_ext-0.4 (vdr-text2skin-1.1-cvs_ext-0.4.diff)
-
-- modified the way, the current replayed recording is determined (status.c:
- cText2SkinStatus::Replaying)
- There remains a problem that recordings with the same name cannot be
- distinguished, so information optained from mReplay are not necessarily
- correct (all the ones added in vdr-text2skin-1.1-cvs_ext-0.2.diff)
-
-2005-12-11: Version 1.1-cvs_ext-0.3 (vdr-text2skin-1.1-cvs_ext-0.3.diff)
-
-- added recording-tokens:
- RecordingLength, RecordingCuttedLength
-
-2005-11-19: Version 1.1-cvs_ext-0.2 (vdr-text2skin-1.1-cvs_ext-0.2.diff)
-
-- removed the previously introduced tokens NextTimerName, NextTimerStart,
- NextTimerChannel, CurrentRecordingsCount and added tokens for the next
- 3 timers: CurrentEventsTitle[123], CurrentEventsStartDateTime[123],
- CurrentEventsStopDateTime[123], CurrentEventsChannelNumber[123],
- CurrentEventsChannelName[123], CurrentEventsIsRecording[123]
-- added audio- and video-tokens:
- PresentLanguageCode, PresentLanguageDescription, PresentVideoAR and
- implemented the missing code for the Language-token
-- added tokens for replay:
- ReplayName, ReplayDateTime, ReplayShortText, ReplayDescription,
- ReplayLanguageCode, ReplayLanguageDescription, ReplayVideoAR
- (not activated yet)
-- additional recording-tokens:
- RecordingVideoAR, RecordingSize
-- added a reset for scrolling text (configurable)
-- included Text2skin.diff from the rotor-plugin
-
-2005-10-22: Version 1.1-cvs_ext-0.1 (vdr-text2skin-1.1-cvs_ext-0.1.diff)
-
-- added several tokens:
- NextTimerName, NextTimerStart, NextTimerChannel, TimerConflict,
- CurrentRecordingsCount, using the service "CheckTimerConflict-v1.0" to
- check timer conflicts. A patch for the timeline-plugin is included in
- Enigma-0.4pre2 (timeline_CheckTimerConflictService-0.1.diff)
+____-__-__: Version 1.3
+
+- Added Italian language texts (thanks to Diego Pierotto / closes #134)
+- Added brougs78-extensions (thanks to Andreas Brugger / references #39)
+ - added tokens for the next 3 timers:
+ CurrentEventsTitle[123], CurrentEventsStartDateTime[123],
+ CurrentEventsStopDateTime[123], CurrentEventsChannelNumber[123],
+ CurrentEventsChannelName[123], CurrentEventsIsRecording[123]
+ - added audio- and video-tokens:
+ PresentLanguageCode, PresentLanguageDescription, PresentVideoAR and
+ implemented the missing code for the Language-token
+ - added tokens for replay:
+ ReplayName, ReplayDateTime, ReplayShortText, ReplayDescription,
+ ReplayLanguageCode, ReplayLanguageDescription, ReplayVideoAR
+ - additional recording-tokens:
+ RecordingVideoAR, RecordingSize
+ - added a reset for scrolling text (configurable)
+ - added recording-tokens:
+ RecordingLength, RecordingCuttedLength
+ - added tokens:
+ OsdWidth, OsdHeight
+ - switched the search-order for the fonts to priorise the skin-folder
+ (this avoids error-messages in the log)
+ - added the possibility to have a scrollbar in every menu - not fully
+ implemented yet (to position in menu-lists is not necessarily correct,
+ if there are more items with the same osd-text)
+ - added a configuration option for showing the scrollbar in the menus
+ - added token TimerConflicts using the service interface of the epgsearch
+ plugin "Epgsearch-lastconflictinfo-v1.0"
+ - added a test-feature to search for reruns of a program and add the
+ information to the extended epg-info (trigger DEVELOPMENT_FEATURES).
+ This uses a service interface of the epgsearch plugin
+ "Epgsearch-searchresults-v1.0"
+ - the extended epg-info and the recording-info are extended by AUX-Infos
+ (configurable)
+ there is also an option to strip known tags
+ - the tab-widths are scaled for taking into account that different TT-Fonts
+ have a different width than the default font from VDR
+ - added tokens for signal-info:
+ FrontendSTR, FrontendSNR, FrontendHasLock, FrontendHasSignal
+ - added token PresentEventID for EPG-images
+ - added tokens for recordings:
+ RecordingFilename, RecordingPriority, RecordingLifetime
+ - set EditableWidth. This is important for plugins like 'rotor' or
+ 'extrecmenu'
+- Added chr13-optimizations (thanks to Christian Tusche / closes #39)
+ - increased efficiency in drawing list items in the main menu
+ - introduce relative Pos and Size of objects to given BasePos, BaseSize
+ (used to draw list items)
+ - increase skin file version to 1.1
+ - the position of list items is interpreted relative to the "list" container
+ when file version >= 1.1
+ - when a position is specified for "block" elements, the position of all
+ contained elements is interpreted relative to the container position
+ - selective update of changed objects
+ refresh can be controlled for individual objects by the attributes
+ "refresh" and "changed"
+ default behaviour is to redraw everything (compatible with old skins)
+ - moved state tracking of marquee, blink, scroll from cText2SkinRender
+ to cxObject
+ - fixed use of Update.Lock() in render.h
+ - new: dynamic width/height of objects
+ - new: Option "bgColor" used for items "Text", "Marquee", and "Blink".
+ - remember period to next timeout when doing a non-timeout refresh
+ prevent occasional start/stop of marquee-text
+
+2009-06-01: Version 1.2
+
+- Moved to http://projects.vdr-developer.org/projects/show/plg-text2skin
+ as community maintained project using a GIT archive
+- adopted to newer VDR >= 1.3.38
+- fixed possible buffer overflow in xml reading
+- Fix build with gcc 4.3's cleaned up C++ headers
+- Make compatible with VDR >= 1.5.4
+- Added gettext support (VDR >= 1.5.7)
+ The skins have to be patched, too. The patches for DeepBlue, Enigma and
+ enElchi are ready for download from http://toms-cafe.de/vdr/download/.
+ To patch other skins the Makefile from these patches could be used
+ without any changes, missing translation entries should be added to the
+ *.skin file (e.g. as comments <!-- trans('Volume') -->)
+- Fix font problems with libfreetype6 >= 2.2.1
+- Replaced 'uint64' with 'uint64_t' to avoid problems on 64-bit machines
+- Quick fix for VDR >= 1.7.3
+- Use pkg-config
+- Convert docs to UTF-8
+- Updated project homepage url in README
2005-06-xx: Version 1.1
- fixed crash due to uninitialized pointer (thanks to Frank Enderle)
-- patch for PresentRemaining by Björn (VDR-Portal)
+- patch for PresentRemaining by Björn (VDR-Portal)
- fixed a race condition (thanks to Reinhard Nissl for pointing this out)
- updated finnish translations (thanks to Rolf Ahrenberg)
- fixed displaying of partial channel numbers while changing channels (thanks to
diff --git a/Makefile b/Makefile
index 625d43e..d149cfb 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,8 @@
#BENCH=1
HAVE_IMAGEMAGICK=1
-#HAVE_IMLIB2=1 # not recommended
+#HAVE_IMLIB2=1
+# not recommended
# comment this out if you don't want to use FreeType font rendering
@@ -22,6 +23,8 @@ HAVE_FREETYPE=1
# The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin.
# By default the main source file also carries this name.
+# IMPORTANT: the presence of this macro is important for the Make.config
+# file. So it must be defined, even if it is not used here!
#
PLUGIN = text2skin
@@ -32,32 +35,28 @@ VERSION = $(shell grep 'const char \*cText2SkinPlugin::VERSION *=' $(PLUGIN).c |
### The C++ compiler and options:
CXX ?= g++
-CXXFLAGS ?= -Wall -Woverloaded-virtual
+CXXFLAGS ?= -fPIC -Wall -Woverloaded-virtual
### The directory environment:
-DVBDIR = ../../../../DVB
VDRDIR = ../../..
LIBDIR = ../../lib
TMPDIR = /tmp
-### The version number of VDR (taken from VDR's "config.h"):
+### Allow user defined options to overwrite defaults:
-VDRVERSION = $(shell sed -ne '/define VDRVERSION/ { s/^.*"\(.*\)".*$$/\1/; p }' $(VDRDIR)/config.h)
-APIVERSION = $(shell sed -ne '/define APIVERSION/ { s/^.*"\(.*\)".*$$/\1/; p }' $(VDRDIR)/config.h)
-ifeq ($(APIVERSION),)
- APIVERSION = $(VDRVERSION)
-endif
+-include $(VDRDIR)/Make.config
+
+### The version number of VDR's plugin API (taken from VDR's "config.h"):
+
+APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' \
+ $(VDRDIR)/config.h)
### The name of the distribution archive:
ARCHIVE = $(PLUGIN)-$(VERSION)
PACKAGE = vdr-$(ARCHIVE)
-### Allow user defined options to overwrite defaults:
-
--include $(VDRDIR)/Make.config
-
### The object files (add further files here):
OBJS = $(PLUGIN).o loader.o display.o render.o common.o bitmap.o \
@@ -80,7 +79,8 @@ endif
ifdef HAVE_IMAGEMAGICK
DEFINES += -DHAVE_IMAGEMAGICK
- LIBS += -lMagick -lMagick++
+ INCLUDES += `pkg-config --cflags ImageMagick++`
+ LIBS += `pkg-config --libs ImageMagick++`
# LIBS += $(shell Magick++-config --ldflags --libs)
endif
@@ -106,31 +106,55 @@ ifdef BENCH
endif
endif
-INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/linux/include -I$(DVBDIR)/include -I.
+INCLUDES += -I$(VDRDIR)/include -I.
DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
+### The main target:
+
+all: libvdr-$(PLUGIN).so i18n
+
### Implicit rules:
%.o: %.c
$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
-# Dependencies:
+### Dependencies:
-MAKEDEP = g++ -MM -MG
+MAKEDEP = $(CXX) -MM -MG
DEPFILE = .dependencies
$(DEPFILE): Makefile
@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
-include $(DEPFILE)
-### Targets:
+### Internationalization (I18N):
+
+PODIR = po
+LOCALEDIR = $(VDRDIR)/locale
+I18Npo = $(notdir $(wildcard $(PODIR)/*.po))
+I18Npot = $(PODIR)/$(PLUGIN).pot
+
+$(I18Npot): $(wildcard *.c)
+ xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP \
+ --msgid-bugs-address='<sascha@akv-soft.de>' -o $@ $^
+
+%.po: $(I18Npot)
+ msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
+ @touch $@
-all: libvdr-$(PLUGIN).so
+$(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.po
+ @mkdir -p $(dir $@)
+ msgfmt -c -o $@ $<
+
+.PHONY: i18n
+i18n: $(I18Npo:%.po=$(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo)
+
+### Targets:
libvdr-$(PLUGIN).so: $(OBJS)
$(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -o $@
- @cp $@ $(LIBDIR)/$@.$(APIVERSION)
+ @cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
ifndef DEBUG
strip $(LIBDIR)/$@.$(APIVERSION)
endif
@@ -139,10 +163,10 @@ dist: clean
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@mkdir $(TMPDIR)/$(ARCHIVE)
@cp -a * $(TMPDIR)/$(ARCHIVE)
- @ln -s $(ARCHIVE) $(TMPDIR)/$(PLUGIN)
- @tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE) $(PLUGIN)
- @-rm -rf $(TMPDIR)/$(ARCHIVE) $(TMPDIR)/$(PLUGIN)
+ @tar czf $(PACKAGE).tgz -C $(TMPDIR) \
+ --exclude debian --exclude CVS --exclude .svn $(ARCHIVE)
+ @-rm -rf $(TMPDIR)/$(ARCHIVE)
@echo Distribution package created as $(PACKAGE).tgz
clean:
- @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ SKINS SKINS.de
+ @-rm -f $(OBJS) $(DEPFILE) *.so $(I18Npot) *.tgz core* *~ SKINS SKINS.de
diff --git a/README b/README
index 0a274b3..54f72fc 100644
--- a/README
+++ b/README
@@ -2,9 +2,9 @@ This is a "plugin" for the Video Disk Recorder (VDR).
Written by: Sascha Volkenandt <sascha@akv-soft.de>
-Project's homepage: http://www.magoa.net/linux/contrib/
+Project's homepage: http://linux.kompiliert.net/index.php?view=text2skin
-Latest version available at: http://www.magoa.net/linux/contrib/
+Latest version available at: http://projects.vdr-developer.org/projects/show/plg-text2skin
See the file COPYING for license information.
diff --git a/README.de b/README.de
index bd4bd82..c3e3f9a 100644
--- a/README.de
+++ b/README.de
@@ -1,12 +1,12 @@
-Dies ist ein "plugin" für den Video Disk Recorder (VDR).
+Dies ist ein "plugin" für den Video Disk Recorder (VDR).
Geschrieben von: Sascha Volkenandt <sascha@akv-soft.de>
-Projekthomepage: http://www.magoa.net/linux/contrib/
+Projekthomepage: http://linux.kompiliert.net/index.php?view=text2skin
-Letzte Version verfügbar auf: http://www.magoa.net/linux/contrib/
+Letzte Version verfügbar auf: http://projects.vdr-developer.org/projects/show/plg-text2skin
-Siehe COPYING für Linzensierungsinformationen.
+Siehe COPYING für Linzensierungsinformationen.
Beschreibung:
@@ -14,41 +14,41 @@ Beschreibung:
Dieses Plugin wurde designed um eine Reihe von Dateien zu laden und zu
interpretieren, die das Aussehen des On Screen Display beschreiben, und diese
-dem VDR via Einstellungen -> OSD zur Verfügung zu stellen. Natürlich ist es
-möglich mehrere textbasierte Skins auf diesem Wege zu laden, und unter diesen
-bei laufendem VDR auszuwählen. Alle Skins können Themeable (die Farbvarianten
-können geändert werden) und Übersetzbar sein, wenn der Autor des Skins dies
-möchte.
+dem VDR via Einstellungen -> OSD zur Verfügung zu stellen. Natürlich ist es
+möglich mehrere textbasierte Skins auf diesem Wege zu laden, und unter diesen
+bei laufendem VDR auszuwählen. Alle Skins können Themeable (die Farbvarianten
+können geändert werden) und Übersetzbar sein, wenn der Autor des Skins dies
+möchte.
Voraussetzungen:
----------------
Um andere Bildformate als einfaches XPM zu laden, brauchen Sie eine
-Grafikbibliothek. Es werden zwei Bibliotheken unterstützt, aus der Sie eine
-zu benutzende wählen können. Dies sind ImageMagick oder Imlib2, wobei erstere
-standardmäßig herangezogen wird. Sie können beeinflussen, welche Bibliothek
-(wenn überhaupt eine) genutzt werden soll, indem Sie die ersten paar Zeilen
-der Datei Makefile ändern. Hier ist eine Übersicht über Möglichkeiten und
-Nachteile jeder möglichen Lösung:
+Grafikbibliothek. Es werden zwei Bibliotheken unterstützt, aus der Sie eine
+zu benutzende wählen können. Dies sind ImageMagick oder Imlib2, wobei erstere
+standardmäßig herangezogen wird. Sie können beeinflussen, welche Bibliothek
+(wenn überhaupt eine) genutzt werden soll, indem Sie die ersten paar Zeilen
+der Datei Makefile ändern. Hier ist eine Übersicht über Möglichkeiten und
+Nachteile jeder möglichen Lösung:
Keine Bibliothek
- - Sie können nur XPM Dateien laden
- - XPMs haben weder Teiltransparenzen noch Alphakanäle
+ - Sie können nur XPM Dateien laden
+ - XPMs haben weder Teiltransparenzen noch Alphakanäle
ImageMagick
- + Sie können viele verschiedene Bildformate laden
+ + Sie können viele verschiedene Bildformate laden
- ist aber etwas langsamer als Imlib2
Imlib2
- + Sie können viele verschiedene Bildformate laden
- - STÜRZT AB, WENN ES ZUSAMMEN MIT DEM GRAPHTFT-PLUGIN ZUM EINSATZ KOMMT!
+ + Sie können viele verschiedene Bildformate laden
+ - STÜRZT AB, WENN ES ZUSAMMEN MIT DEM GRAPHTFT-PLUGIN ZUM EINSATZ KOMMT!
Beide Bibliotheken gleichzeitig zu benutzen macht keinen Sinn.
HINWEIS: Obwohl das Handbuch von ImageMagick behauptet, dass die hier benutzte
Bibliothek Magick++ integraler Bestandteil der Quellen sind, muss auf manchen
-Distributionen das Paket Magick++ zusätzlich installiert werden.
+Distributionen das Paket Magick++ zusätzlich installiert werden.
Installation:
@@ -66,7 +66,7 @@ root@linux # cd ../..
root@linux # make plugins
root@linux # ./vdr -P text2skin
-Wenn Sie VDR 1.3.9 benutzen, müssen Sie auch noch einen Patch anwenden. Dieser
+Wenn Sie VDR 1.3.9 benutzen, müssen Sie auch noch einen Patch anwenden. Dieser
Patch wird in VDR 1.3.10 aber enthalten sein.
root@linux # patch -p1 < PLUGINS/src/text2skin/patches/vdr-1.3.9-osd.diff
@@ -74,19 +74,19 @@ root@linux # make vdr
root@linux # ./vdr -P text2skin
-Wo die Skins hingehören:
+Wo die Skins hingehören:
------------------------
Wie Sie vielleicht wissen, hat VDR einen Unterordner "plugins" innerhalb seines
-Konfigurationsordners, in dem alle Dateien, die zu Plugins gehören, enthalten
-sein sollten. Wenn Sie nicht wissen, wo das sein könnte, schauen Sie in dem
-Ordner nach, den Sie VDR beim Starten mit -v (oder -c, falls gegeben) übergeben
+Konfigurationsordners, in dem alle Dateien, die zu Plugins gehören, enthalten
+sein sollten. Wenn Sie nicht wissen, wo das sein könnte, schauen Sie in dem
+Ordner nach, den Sie VDR beim Starten mit -v (oder -c, falls gegeben) übergeben
haben. "plugins" sollte in diesem Ordner enthalten sein.
Innerhalb dieses "plugins" Ordners erstellen Sie einen Ordner namens
"text2skin". In "text2skin" erstellen Sie einen weiteren Ordner pro Skin. Diese
-Skin-Ordner müssen den gleichen Namen tragen wie die Skins in ihnen. Jedes
-Skin muss mindestens eine Datei enthalten, die denselben Namen trägt, aber mit
+Skin-Ordner müssen den gleichen Namen tragen wie die Skins in ihnen. Jedes
+Skin muss mindestens eine Datei enthalten, die denselben Namen trägt, aber mit
der Endung ".skin".
Beispiel (das Skin heisst myskin):
@@ -95,8 +95,8 @@ Beispiel (das Skin heisst myskin):
/video0/plugins/text2skin/msykin/msykin.skin
/video0/plugins/text2skin/myskin/channeldisplay.png
-Die anderen Dateien in dem Skin-Ordner sind weitere Beschreibungsdateien (für
-Farben und Übersetzungen) sowie Bilder, Logos und Symbole.
+Die anderen Dateien in dem Skin-Ordner sind weitere Beschreibungsdateien (für
+Farben und Übersetzungen) sowie Bilder, Logos und Symbole.
Wenn Sie ein Skin herunterladen, wechseln Sie normalerweise einfach in den
plugins/text2skin Ordner und entpacken es dort.
diff --git a/cache.h b/cache.h
index 0bac611..b4857e6 100644
--- a/cache.h
+++ b/cache.h
@@ -5,6 +5,7 @@
#ifndef VDR_TEXT2SKIN_CACHE_HPP
#define VDR_TEXT2SKIN_CACHE_HPP
+#include <cstdlib>
#include <map>
#include <vector>
#include <string>
diff --git a/common.c b/common.c
index 0bfb1d4..728dedb 100644
--- a/common.c
+++ b/common.c
@@ -4,7 +4,6 @@
#include "common.h"
#include <sstream>
-#include <locale.h>
#include <vdr/plugin.h>
#include <vdr/device.h>
#include <sys/ioctl.h>
@@ -39,7 +38,7 @@ const char *ChannelName(const cChannel *Channel, int Number)
if (Channel)
snprintf(buffer, sizeof(buffer), "%s", Channel->Name());
else if (!Number)
- snprintf(buffer, sizeof(buffer), "%s", tr("*** Invalid Channel ***"));
+ snprintf(buffer, sizeof(buffer), "%s", trVDR("*** Invalid Channel ***"));
#if VDRVERSNUM < 10315
char *ptr;
@@ -61,7 +60,7 @@ const char *ChannelShortName(const cChannel *Channel, int Number)
snprintf(buffer, sizeof(buffer), "%s", Channel->ShortName(true));
#endif
else if (!Number)
- snprintf(buffer, sizeof(buffer), "%s", tr("*** Invalid Channel ***"));
+ snprintf(buffer, sizeof(buffer), "%s", trVDR("*** Invalid Channel ***"));
#if VDRVERSNUM < 10315
char *ptr;
@@ -77,7 +76,7 @@ const char *ChannelShortName(const cChannel *Channel, int Number)
return buffer;
}
-const char *EventType(uint Number)
+const char *EventType(uint Number)
{
static char buffer[25];
buffer[0] = '\0';
@@ -139,7 +138,7 @@ int GetFrontendSTR(void)
{
uint16_t value = 0;
char *dev = NULL;
-
+
asprintf(&dev, FRONTEND_DEVICE, cDevice::ActualDevice()->CardIndex(), 0);
int fe = open(dev, O_RDONLY | O_NONBLOCK);
free(dev);
@@ -154,7 +153,7 @@ int GetFrontendSNR(void)
{
uint16_t value = 0;
char *dev = NULL;
-
+
asprintf(&dev, FRONTEND_DEVICE, cDevice::ActualDevice()->CardIndex(), 0);
int fe = open(dev, O_RDONLY | O_NONBLOCK);
free(dev);
@@ -169,7 +168,7 @@ bool GetFrontendHasLock(void)
{
uint16_t value = 0;
char *dev = NULL;
-
+
asprintf(&dev, FRONTEND_DEVICE, cDevice::ActualDevice()->CardIndex(), 0);
int fe = open(dev, O_RDONLY | O_NONBLOCK);
free(dev);
@@ -184,7 +183,7 @@ bool GetFrontendHasSignal(void)
{
uint16_t value = 0;
char *dev = NULL;
-
+
asprintf(&dev, FRONTEND_DEVICE, cDevice::ActualDevice()->CardIndex(), 0);
int fe = open(dev, O_RDONLY | O_NONBLOCK);
free(dev);
@@ -199,10 +198,10 @@ std::string AddExtInfoToDescription(const char *Title, const char *ShortText, co
{
// max. width so lines don't get wrapped
#define MAX_CHARS 50
-
+
// prepare the description
std::stringstream desc("");
-
+
if (!isempty(Description)) {
// it seems that sometimes the description ends with a newline
// and sometimes it does not
@@ -210,7 +209,7 @@ std::string AddExtInfoToDescription(const char *Title, const char *ShortText, co
while (!buf.empty() && buf[buf.size() - 1] == '\n') buf.erase(buf.size() - 1);
desc << buf << "\n"; // keep one newline
}
-
+
#ifdef DEVELOPMENT_FEATURES
// try to find a rerun of the show using epgsearch-service
if (!isempty(Title)) {
@@ -228,7 +227,7 @@ std::string AddExtInfoToDescription(const char *Title, const char *ShortText, co
if (!desc.str().empty()) desc << "\n";
desc << tr("RERUNS OF THIS SHOW") << ":\n";
int i = 0;
- for (Epgsearch_searchresults_v1_0::cServiceSearchResult *r =
+ for (Epgsearch_searchresults_v1_0::cServiceSearchResult *r =
list->First(); r && i < 5; r = list->Next(r)) {
i++;
std::stringstream buf;
@@ -242,27 +241,30 @@ std::string AddExtInfoToDescription(const char *Title, const char *ShortText, co
}
}
}
-#endif // DEVELOPMENT_FEATURES
-
+#endif // DEVELOPMENT_FEATURES
+
// Add the AUX-Info of the Recording
if (Aux) {
if (StripAux) {
std::string auxRaw(Aux);
std::string auxEpgsearch = StripXmlTag(auxRaw, "epgsearch");
if (!auxEpgsearch.empty()) {
- if (!desc.str().empty()) desc << "\n";
+ if (!desc.str().empty())
+ desc << "\n";
desc << tr("AUXILIARY INFOS") << ":\n";
std::stringstream buf;
buf << " - " << tr("Search timer") << ": " << StripXmlTag(auxRaw, "Search timer");
desc << FitToWidth(buf, MAX_CHARS) << "\n";
}
- } else {
- if (!desc.str().empty()) desc << "\n";
+ }
+ else {
+ if (!desc.str().empty())
+ desc << "\n";
desc << tr("AUXILIARY INFOS") << ":\n";
desc << Aux << "\n";
}
}
-
+
return desc.str();
}
@@ -277,7 +279,7 @@ int GetRecordingSize(const char *FileName)
// use our own approach
{
if (FileName != NULL) {
- bool bRet=false;
+ bool bRet = false;
long long size = 0;
int nFiles;
struct stat fileinfo; // Holds file information structure
@@ -286,38 +288,33 @@ int GetRecordingSize(const char *FileName)
cReadLine reader;
#endif
asprintf(&cmd, "find '%s' -follow -type f -name '*.*'|sort ", FileName);
-
+
FILE *p = popen(cmd, "r");
- int ret=0;
- if (p)
- {
+ int ret = 0;
+ if (p) {
char *s;
-
+
#if VDRVERSNUM >= 10318
- while ((s = reader.Read(p)) != NULL)
+ while ((s = reader.Read(p)) != NULL) {
#else
- while ((s = readline(p)) != NULL)
+ while ((s = readline(p)) != NULL) {
#endif
- {
- if ((ret=stat(s, &fileinfo)) != -1)
- {
+ if ((ret=stat(s, &fileinfo)) != -1) {
size += (long long)fileinfo.st_size;
nFiles++;
}
}
-
- bRet=true;
+
+ bRet = true;
}
-
+
pclose(p);
delete cmd;
-
+
return (int)(size / 1024 / 1024); // [MB]
}
else
- {
return 0;
- }
}
#endif
@@ -325,7 +322,7 @@ int GetRecordingLength(const char *FileName)
{
// based on the enAIO-Patch for VDR
#define INDEXFILESUFFIX "/index.vdr"
-
+
struct tIndex { int offset; uchar type; uchar number; short reserved; };
tIndex *index;
char RecLength[21];
@@ -333,36 +330,36 @@ int GetRecordingLength(const char *FileName)
int last = -1;
index = NULL;
if (FileName) {
- filename = MALLOC(char, strlen(FileName) + strlen(INDEXFILESUFFIX) + 1);
- if (filename) {
- strcpy(filename, FileName);
- char *pFileExt = filename + strlen(filename);
- strcpy(pFileExt, INDEXFILESUFFIX);
- int delta = 0;
- if (access(filename, R_OK) == 0) {
- struct stat buf;
- if (stat(filename, &buf) == 0) {
- delta = buf.st_size % sizeof(tIndex);
- if (delta) {
- delta = sizeof(tIndex) - delta;
- esyslog("ERROR: invalid file size (%ld) in '%s'", buf.st_size, filename);
- }
- last = (buf.st_size + delta) / sizeof(tIndex) - 1;
- char hour[2], min[3];
+ filename = MALLOC(char, strlen(FileName) + strlen(INDEXFILESUFFIX) + 1);
+ if (filename) {
+ strcpy(filename, FileName);
+ char *pFileExt = filename + strlen(filename);
+ strcpy(pFileExt, INDEXFILESUFFIX);
+ int delta = 0;
+ if (access(filename, R_OK) == 0) {
+ struct stat buf;
+ if (stat(filename, &buf) == 0) {
+ delta = buf.st_size % sizeof(tIndex);
+ if (delta) {
+ delta = sizeof(tIndex) - delta;
+ esyslog("ERROR: invalid file size (%ld) in '%s'", (long)buf.st_size, filename);
+ }
+ last = (buf.st_size + delta) / sizeof(tIndex) - 1;
+ char hour[2], min[3];
#if VDRVERSNUM >= 10318
- snprintf(RecLength, sizeof(RecLength), "%s", *IndexToHMSF(last, true));
+ snprintf(RecLength, sizeof(RecLength), "%s", *IndexToHMSF(last, true));
#else
- snprintf(RecLength, sizeof(RecLength), "%s", IndexToHMSF(last, true));
+ snprintf(RecLength, sizeof(RecLength), "%s", IndexToHMSF(last, true));
#endif
- snprintf(hour, sizeof(hour), "%c", RecLength[0]);
- snprintf(min, sizeof(min), "%c%c", RecLength[2], RecLength[3]);
- return (atoi(hour) * 60) + atoi(min);
- }
- }
- free(filename);
- }
- }
-
+ snprintf(hour, sizeof(hour), "%c", RecLength[0]);
+ snprintf(min, sizeof(min), "%c%c", RecLength[2], RecLength[3]);
+ return (atoi(hour) * 60) + atoi(min);
+ }
+ }
+ free(filename);
+ }
+ }
+
return 0;
}
@@ -372,32 +369,27 @@ int GetRecordingCuttedLength(const char *FileName)
double length = 0;
int totalLength = GetRecordingLength(FileName);
const double diffIFrame = FRAMESPERSEC / 2; // approx. 1/2 sec.
-
+
marks.Load(FileName);
-
- if (marks.Count())
- {
+
+ if (marks.Count()) {
int start = 1; // first frame
bool isStart = true;
-
- for (cMark *m = marks.First(); m; m = marks.GetNext(m->position))
- {
+
+ for (cMark *m = marks.First(); m; m = marks.GetNext(m->position)) {
if (isStart)
- {
start = m->position;
- }
else
- {
length += (double)(m->position - start + 1 + diffIFrame) / (FRAMESPERSEC * 60); // [min]
- }
-
+
isStart = !isStart;
}
-
+
// if there is no end-mark the last segment goes to the end of the rec.
- if (!isStart) length += totalLength - (double)(start - 1 - diffIFrame) / (FRAMESPERSEC * 60); // [min]
+ if (!isStart)
+ length += totalLength - (double)(start - 1 - diffIFrame) / (FRAMESPERSEC * 60); // [min]
}
-
+
// just to avoid, that the cutted length is bigger than the total length
return (int)length > totalLength ? totalLength : (int)length;
}
@@ -410,7 +402,6 @@ cxType TimeType(time_t Time, const std::string &Format)
if (Time > 0) {
if (Format.length() > 0) {
- setlocale(LC_TIME, tr("en_US"));
strftime(result, sizeof(result), Format.c_str(), tm);
cxType r = result;
@@ -552,7 +543,8 @@ void SkipQuotes(std::string &Value) {
esyslog("ERROR: text2skin: missing closing %c", quote);
}
-std::string FitToWidth(std::string &Line, uint Width) {
+std::string FitToWidth(std::string &Line, uint Width)
+{
std::string buf(Line);
if (buf.size() > Width) {
buf.erase(Width - 3);
@@ -561,7 +553,8 @@ std::string FitToWidth(std::string &Line, uint Width) {
return buf;
}
-std::string FitToWidth(std::stringstream &Line, uint Width) {
+std::string FitToWidth(std::stringstream &Line, uint Width)
+{
std::string buf(Line.str());
if (buf.size() > Width) {
buf.erase(Width - 3);
@@ -570,7 +563,8 @@ std::string FitToWidth(std::stringstream &Line, uint Width) {
return buf;
}
-std::string StripXmlTag(std::string &Line, const char *Tag) {
+std::string StripXmlTag(std::string &Line, const char *Tag)
+{
// set the search strings
std::stringstream strStart, strStop;
strStart << "<" << Tag << ">";
@@ -578,7 +572,8 @@ std::string StripXmlTag(std::string &Line, const char *Tag) {
// find the strings
std::string::size_type locStart = Line.find(strStart.str());
std::string::size_type locStop = Line.find(strStop.str());
- if (locStart == std::string::npos || locStop == std::string::npos) return "";
+ if (locStart == std::string::npos || locStop == std::string::npos)
+ return "";
// extract relevant text
int pos = locStart + strStart.str().size();
int len = locStop - pos;
diff --git a/common.h b/common.h
index 9d7b30a..f596a01 100644
--- a/common.h
+++ b/common.h
@@ -11,6 +11,9 @@
#include <vdr/config.h>
#include <vdr/epg.h>
+// from recording.h (VDR <= 1.7.2)
+#define FRAMESPERSEC 25
+
#if defined(DEBUG) || defined(BENCH)
# ifdef DEBUG
# define Dprintf(x...) fprintf(stderr, x)
@@ -78,35 +81,32 @@ std::string FitToWidth(std::stringstream &Line, uint Width);
std::string StripXmlTag(std::string &Line, const char *Tag);
// Data structure for service "Epgsearch-searchresults-v1.0"
-struct Epgsearch_searchresults_v1_0
-{
+struct Epgsearch_searchresults_v1_0 {
// in
- char* query; // search term
- int mode; // search mode (0=phrase, 1=and, 2=or, 3=regular expression)
- int channelNr; // channel number to search in (0=any)
- bool useTitle; // search in title
- bool useSubTitle; // search in subtitle
- bool useDescription; // search in description
+ char* query; // search term
+ int mode; // search mode (0=phrase, 1=and, 2=or, 3=regular expression)
+ int channelNr; // channel number to search in (0=any)
+ bool useTitle; // search in title
+ bool useSubTitle; // search in subtitle
+ bool useDescription; // search in description
// out
- class cServiceSearchResult : public cListObject
- {
+ class cServiceSearchResult : public cListObject {
public:
- const cEvent* event;
- cServiceSearchResult(const cEvent* Event) : event(Event) {}
+ const cEvent* event;
+ cServiceSearchResult(const cEvent* Event) : event(Event) {}
};
- cList<cServiceSearchResult>* pResultList; // pointer to the results
+ cList<cServiceSearchResult>* pResultList; // pointer to the results
};
// Data structure for service "Epgsearch-lastconflictinfo-v1.0"
-struct Epgsearch_lastconflictinfo_v1_0
-{
+struct Epgsearch_lastconflictinfo_v1_0 {
// in
// out
- time_t nextConflict; // next conflict date, 0 if none
- int relevantConflicts; // number of relevant conflicts
- int totalConflicts; // total number of conflicts
+ time_t nextConflict; // next conflict date, 0 if none
+ int relevantConflicts; // number of relevant conflicts
+ int totalConflicts; // total number of conflicts
};
#endif // VDR_TEXT2SKIN_COMMON_H
diff --git a/display.c b/display.c
index 69a4745..4bcce4c 100644
--- a/display.c
+++ b/display.c
@@ -245,10 +245,10 @@ cxType cText2SkinDisplayChannel::GetTokenData(const txToken &Token)
cDevice *dev = cDevice::PrimaryDevice();
eTrackType trackType = dev->GetCurrentAudioTrack();
const tTrackId *track = dev->GetTrack(trackType);
- if (track)
- {
+ if (track) {
std::string buffer(track->language);
- if (trackType >= ttDolby) buffer.append("DD");
+ if (trackType >= ttDolby)
+ buffer.append("DD");
return (cxType)buffer.c_str();
}
return (cxType)false;
@@ -597,10 +597,10 @@ cxType cText2SkinDisplayReplay::GetTokenData(const txToken &Token)
cDevice *dev = cDevice::PrimaryDevice();
eTrackType trackType = dev->GetCurrentAudioTrack();
const tTrackId *track = dev->GetTrack(trackType);
- if (track)
- {
+ if (track) {
std::string buffer(track->language);
- if (trackType >= ttDolby) buffer.append("DD");
+ if (trackType >= ttDolby)
+ buffer.append("DD");
return (cxType)buffer.c_str();
}
return (cxType)false;
@@ -865,25 +865,26 @@ void cText2SkinDisplayMenu::SetItem(const char *Text, int Index, bool Current, b
if (mItems.size() <= (uint)Index) {
mItems.push_back(item);
- mDirtyItems.push_back( Index );
+ mDirtyItems.push_back(Index);
SetDirty(cxRefresh::list);
}
else if (mItems[Index] != item) {
mItems[Index] = item;
// refresh only the changed items
- mDirtyItems.push_back( Index );
+ mDirtyItems.push_back(Index);
SetDirty(cxRefresh::list);
}
if (Current && mCurrentItem != (uint)Index) {
// refresh only the changed items
- mDirtyItems.push_back( mCurrentItem );
- mDirtyItems.push_back( Index );
+ mDirtyItems.push_back(mCurrentItem);
+ mDirtyItems.push_back(Index);
SetDirty(cxRefresh::list);
mCurrentItem = Index;
}
-
- if (Current) mRender->mMenuScrollbar.currentOnScreen = (uint)Index;
+
+ if (Current)
+ mRender->mMenuScrollbar.currentOnScreen = (uint)Index;
UpdateUnlock();
}
@@ -980,17 +981,17 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
return mTitle;
case tMenuItem:
- if (Token.Index < 0) return false;
+ if (Token.Index < 0)
+ return false;
- if( mItems.size() <= (uint)Token.Index || !mItems[Token.Index].sel ||
- mCurrentItem == (uint)Token.Index )
+ if (mItems.size() <= (uint)Token.Index || !mItems[Token.Index].sel ||
+ mCurrentItem == (uint)Token.Index)
return false;
- if (Token.Tab < 0) {
+ if (Token.Tab < 0)
return Token.Attrib.Type == aNumber
? (cxType)mItems[Token.Index].tabs[Token.Attrib.Number]
: (cxType)mItems[Token.Index].text;
- }
return (cxType)mItems[Token.Index].tabs[Token.Tab];
@@ -999,24 +1000,22 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
&& mCurrentItem != (uint)Token.Index;
case tMenuCurrent:
- if(mItems.size() <= mCurrentItem)
+ if (mItems.size() <= mCurrentItem)
return false;
-
- if (Token.Index < 0) {
+
+ if (Token.Index < 0)
return Token.Attrib.Type == aNumber
? (cxType)mItems[mCurrentItem].tabs[Token.Attrib.Number]
: (cxType)mItems[mCurrentItem].text;
- }
- if( mItems.size() <= (uint)Token.Index || !mItems[Token.Index].sel ||
- mCurrentItem != (uint)Token.Index )
+ if (mItems.size() <= (uint)Token.Index || !mItems[Token.Index].sel ||
+ mCurrentItem != (uint)Token.Index)
return false;
- if (Token.Tab < 0) {
+ if (Token.Tab < 0)
return Token.Attrib.Type == aNumber
? (cxType)mItems[Token.Index].tabs[Token.Attrib.Number]
: (cxType)mItems[Token.Index].text;
- }
return (cxType)mItems[Token.Index].tabs[Token.Tab];
@@ -1025,16 +1024,16 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
&& mCurrentItem == (uint)Token.Index;
case tMenuGroup:
- if (Token.Index < 0) return false;
+ if (Token.Index < 0)
+ return false;
- if( mItems.size() <= (uint)Token.Index || mItems[Token.Index].sel)
+ if (mItems.size() <= (uint)Token.Index || mItems[Token.Index].sel)
return false;
- if (Token.Tab < 0) {
+ if (Token.Tab < 0)
return Token.Attrib.Type == aNumber
? (cxType)mItems[Token.Index].tabs[Token.Attrib.Number]
: (cxType)mItems[Token.Index].text;
- }
return (cxType)mItems[Token.Index].tabs[Token.Tab];
@@ -1124,9 +1123,9 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
#if VDRVERSNUM >= 10344
// find corresponding timer
const char *aux = NULL;
- for (cTimer *tim = Timers.First(); tim; tim = Timers.Next(tim)) {
- if (tim->Event() == mEvent) aux = tim->Aux();
- }
+ for (cTimer *tim = Timers.First(); tim; tim = Timers.Next(tim))
+ if (tim->Event() == mEvent)
+ aux = tim->Aux();
ExtPresentDescription = AddExtInfoToDescription(mEvent->Title(), mEvent->ShortText(), mEvent->Description(), aux, Text2SkinSetup.StripAux);
#else
ExtPresentDescription = AddExtInfoToDescription(mEvent->Title(), mEvent->ShortText(), mEvent->Description());
@@ -1138,24 +1137,24 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
#if VDRVERSNUM >= 10318
case tPresentLanguageCode:
- if (mEvent)
- {
+ if (mEvent) {
const cComponents *components = mEvent->Components();
- if (components)
- {
+ if (components) {
int index = Token.Attrib.Number;
-
+
// don't return language-code for the video-stream
- for (int i = 0; i < components->NumComponents(); i++)
- {
- const tComponent *c = components->Component(i);
- if (c->stream != 2) index++; // only audio-streams
- if (i == index)
- {
+ for (int i = 0; i < components->NumComponents(); i++) {
+ const tComponent *c = components->Component(i);
+ if (c->stream != 2) // only audio-streams
+ index++;
+ if (i == index) {
std::string buffer(c->language);
- if (c->type == 1) buffer.append("MONO");
- if ((c->type == 2) || (c->type == 4)) buffer.append("DUAL");
- if (c->type == 5) buffer.append("DD");
+ if (c->type == 1)
+ buffer.append("MONO");
+ if ((c->type == 2) || (c->type == 4))
+ buffer.append("DUAL");
+ if (c->type == 5)
+ buffer.append("DD");
return (cxType)buffer.c_str();
}
}
@@ -1163,40 +1162,36 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
}
return false;
- case tPresentLanguageDescription:
- if (mEvent)
- {
+ case tPresentLanguageDescription:
+ if (mEvent) {
const cComponents *components = mEvent->Components();
- if (components)
- {
+ if (components) {
int index = Token.Attrib.Number;
-
+
// don't return language-code for the video-stream
- for (int i = 0; i < components->NumComponents(); i++)
- {
- const tComponent *c = components->Component(i);
- if (c->stream != 2) index++; // only audio-streams
- if (i == index) return (cxType)c->description;
+ for (int i = 0; i < components->NumComponents(); i++) {
+ const tComponent *c = components->Component(i);
+ if (c->stream != 2) // only audio-streams
+ index++;
+ if (i == index)
+ return (cxType)c->description;
}
}
}
return false;
- case tPresentVideoAR:
- if (mEvent)
- {
+ case tPresentVideoAR:
+ if (mEvent) {
const cComponents *components = mEvent->Components();
- if (components)
- {
- for (int i = 0; i < components->NumComponents(); i++)
- {
- const tComponent *c = components->Component(i);
- if (c->stream == 1)
- {
- switch (c->type)
- {
- case 1: return "4:3";
- case 3: return "16:9";
+ if (components) {
+ for (int i = 0; i < components->NumComponents(); i++) {
+ const tComponent *c = components->Component(i);
+ if (c->stream == 1) {
+ switch (c->type) {
+ case 1:
+ return "4:3";
+ case 3:
+ return "16:9";
}
}
}
@@ -1209,7 +1204,7 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
return mEvent != NULL
? (cxType)EventType(mEvent->EventID())
: (cxType)false;
-
+
case tHasVPS:
case tChannelHasVPS:
return mEvent != NULL && mEvent->Vps() != 0;
@@ -1217,31 +1212,35 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
case tChannelName:
if (mEvent) { // extended EPG
cChannel *channel = Channels.GetByChannelID(mEvent->ChannelID(), true);
- return channel != NULL
- ? (cxType)ChannelName(channel, 0)
- : (cxType)false;
- } else if (mRecording) { // recording Info
+ return channel != NULL
+ ? (cxType)ChannelName(channel, 0)
+ : (cxType)false;
+ }
+ else if (mRecording) { // recording Info
cRecordingInfo *recInfo = const_cast<cRecordingInfo*>(mRecording->Info());
cChannel *channel = Channels.GetByChannelID(recInfo->ChannelID(), true);
- return channel != NULL
- ? (cxType)ChannelName(channel, 0)
- : (cxType)false;
- } else return (cxType)false;
+ return channel != NULL
+ ? (cxType)ChannelName(channel, 0)
+ : (cxType)false;
+ } else
+ return (cxType)false;
case tChannelShortName:
if (mEvent) { // extended EPG
cChannel *channel = Channels.GetByChannelID(mEvent->ChannelID(), true);
- return channel != NULL
- ? (cxType)ChannelShortName(channel, 0)
- : (cxType)false;
- } else if (mRecording) { // recording Info
+ return channel != NULL
+ ? (cxType)ChannelShortName(channel, 0)
+ : (cxType)false;
+ }
+ else if (mRecording) { // recording Info
cRecordingInfo *recInfo = const_cast<cRecordingInfo*>(mRecording->Info());
cChannel *channel = Channels.GetByChannelID(recInfo->ChannelID(), true);
- return channel != NULL
- ? (cxType)ChannelShortName(channel, 0)
- : (cxType)false;
- } else return (cxType)false;
-
+ return channel != NULL
+ ? (cxType)ChannelShortName(channel, 0)
+ : (cxType)false;
+ } else
+ return (cxType)false;
+
case tPresentHasVPS:
return mEvent != NULL && mEvent->Vps() != 0 && mEvent->Vps() != mEvent->StartTime();
@@ -1294,77 +1293,72 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
case tRecordingDescription:
if (mRecording) {
- if (ExtRecordingDescription == "") {
+ if (ExtRecordingDescription == "")
#if VDRVERSNUM >= 10344
ExtRecordingDescription = AddExtInfoToDescription(mRecording->Info()->Title(), mRecording->Info()->ShortText(), mRecording->Info()->Description(), Text2SkinSetup.ShowAux ? mRecording->Info()->Aux() : NULL, Text2SkinSetup.StripAux);
#else
ExtRecordingDescription = AddExtInfoToDescription(mRecording->Info()->Title(), mRecording->Info()->ShortText(), mRecording->Info()->Description());
#endif
- }
return (cxType)ExtRecordingDescription;
} else
return (cxType)false;
- case tRecordingLanguageCode:
- if (mRecording)
- {
+ case tRecordingLanguageCode:
+ if (mRecording) {
const cComponents *components = mRecording->Info()->Components();
- if (components)
- {
+ if (components) {
int index = Token.Attrib.Number;
-
+
// don't return language-code for the video-stream
- for (int i = 0; i < components->NumComponents(); i++)
- {
- const tComponent *c = components->Component(i);
- if (c->stream != 2) index++; // only audio-streams
- if (i == index)
- {
+ for (int i = 0; i < components->NumComponents(); i++) {
+ const tComponent *c = components->Component(i);
+ if (c->stream != 2) // only audio-streams
+ index++;
+ if (i == index) {
std::string buffer(c->language);
- if (c->type == 1) buffer.append("MONO");
- if ((c->type == 2) || (c->type == 4)) buffer.append("DUAL");
- if (c->type == 5) buffer.append("DD");
+ if (c->type == 1)
+ buffer.append("MONO");
+ if ((c->type == 2) || (c->type == 4))
+ buffer.append("DUAL");
+ if (c->type == 5)
+ buffer.append("DD");
return (cxType)buffer.c_str();
}
}
}
}
return false;
-
+
case tRecordingLanguageDescription:
- if (mRecording)
- {
+ if (mRecording) {
const cComponents *components = mRecording->Info()->Components();
- if (components)
- {
+ if (components) {
int index = Token.Attrib.Number;
-
+
// don't return language-code for the video-stream
- for (int i = 0; i < components->NumComponents(); i++)
- {
- const tComponent *c = components->Component(i);
- if (c->stream != 2) index++; // only audio-streams
- if (i == index) return (cxType)c->description;
+ for (int i = 0; i < components->NumComponents(); i++) {
+ const tComponent *c = components->Component(i);
+ if (c->stream != 2) // only audio-streams
+ index++;
+ if (i == index)
+ return (cxType)c->description;
}
}
}
return false;
- case tRecordingVideoAR:
- if (mRecording)
- {
+ case tRecordingVideoAR:
+ if (mRecording) {
const cComponents *components = mRecording->Info()->Components();
- if (components)
- {
- for (int i = 0; i < components->NumComponents(); i++)
- {
- const tComponent *c = components->Component(i);
- if (c->stream == 1)
- {
- switch (c->type)
- {
- case 1: return "4:3";
- case 3: return "16:9";
+ if (components) {
+ for (int i = 0; i < components->NumComponents(); i++) {
+ const tComponent *c = components->Component(i);
+ if (c->stream == 1) {
+ switch (c->type) {
+ case 1:
+ return "4:3";
+ case 3:
+ return "16:9";
}
}
}
@@ -1373,21 +1367,21 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
return false;
#endif
- case tRecordingSize:
+ case tRecordingSize:
return mRecording != NULL
? (cxType)GetRecordingSize(mRecording->FileName())
: (cxType)false;
-
- case tRecordingLength:
+
+ case tRecordingLength:
return mRecording != NULL
? (cxType)GetRecordingLength(mRecording->FileName())
- : (cxType)false;
-
- case tRecordingCuttedLength:
+ : (cxType)false;
+
+ case tRecordingCuttedLength:
return mRecording != NULL
? (cxType)GetRecordingCuttedLength(mRecording->FileName())
- : (cxType)false;
-
+ : (cxType)false;
+
default:
return cText2SkinRender::GetTokenData(Token);
}
@@ -1428,12 +1422,11 @@ void cText2SkinDisplayTracks::SetTrack(int Index, const char * const *Tracks)
Dprintf("SetTrack: %d (%s here, %s in array)\n", Index, Tracks[Index], mItems[Index].c_str());
if (mCurrentItem != (uint)Index) {
// refresh only the changed items
- mDirtyItems.push_back( mCurrentItem );
- mDirtyItems.push_back( Index );
+ mDirtyItems.push_back(mCurrentItem);
+ mDirtyItems.push_back(Index);
mCurrentItem = Index;
SetDirty(cxRefresh::list);
}
-
UpdateUnlock();
}
@@ -1449,7 +1442,8 @@ void cText2SkinDisplayTracks::SetAudioChannel(int AudioChannel)
cxType cText2SkinDisplayTracks::GetTokenData(const txToken &Token)
{
- if (Token.Tab >= 0) return false;
+ if (Token.Tab >= 0)
+ return false;
int index = Token.Index;
if (index >= 0 && mCurrentItem >= (uint)mMaxItems) {
@@ -1462,25 +1456,25 @@ cxType cText2SkinDisplayTracks::GetTokenData(const txToken &Token)
return mTitle;
case tMenuItem:
- if (index < 0) return false;
+ if (index < 0)
+ return false;
- if( mItems.size() <= (uint)index || mCurrentItem == (uint)index )
+ if (mItems.size() <= (uint)index || mCurrentItem == (uint)index)
return false;
return (cxType)mItems[index];
case tIsMenuItem:
return mItems.size() > (uint)index && mCurrentItem != (uint)index;
-
+
case tMenuCurrent:
- if(mItems.size() <= mCurrentItem)
+ if (mItems.size() <= mCurrentItem)
return false;
-
- if (index < 0) {
+
+ if (index < 0)
return (cxType)mItems[mCurrentItem];
- }
- if( mItems.size() <= (uint)index || mCurrentItem != (uint)index )
+ if (mItems.size() <= (uint)index || mCurrentItem != (uint)index)
return false;
return (cxType)mItems[index];
diff --git a/display.h b/display.h
index 8bb62da..23c8d89 100644
--- a/display.h
+++ b/display.h
@@ -142,10 +142,10 @@ private:
// detailed event view
const cEvent *mEvent;
- std::string ExtPresentDescription;
+ std::string ExtPresentDescription;
// detailed recording
const cRecording *mRecording;
- std::string ExtRecordingDescription;
+ std::string ExtRecordingDescription;
// long text
std::string mText;
@@ -172,7 +172,7 @@ protected:
virtual int MaxItems(void) { return mMaxItems; }
virtual void SetMaxItems(int MaxItems) { mMaxItems = MaxItems; }
virtual int GetMaxItems(void) { return mMaxItems; }
-
+
public:
cText2SkinDisplayMenu(cText2SkinLoader *Loader);
virtual ~cText2SkinDisplayMenu();
diff --git a/font.c b/font.c
index 7042da9..706ab23 100644
--- a/font.c
+++ b/font.c
@@ -31,8 +31,13 @@ const cFont *cText2SkinFont::Load(const std::string &Path, const std::string &Fi
const cFont *res = NULL;
#ifdef HAVE_FREETYPE
char *cachename;
+#if VDRVERSNUM >= 10507
+ asprintf(&cachename, "%s_%d_%d_%d", Filename.c_str(), Size, Width, I18nCurrentLanguage());
+ if (mFontCache.Load(Path + "/" + Filename, cachename, Size, I18nCurrentLanguage(), Width))
+#else
asprintf(&cachename, "%s_%d_%d_%d", Filename.c_str(), Size, Width, Setup.OSDLanguage);
if (mFontCache.Load(Path + "/" + Filename, cachename, Size, Setup.OSDLanguage, Width))
+#endif
res = mFontCache.GetFont(cachename);
else
esyslog("ERROR: Text2Skin: Couldn't load font %s:%d", Filename.c_str(), Size);
diff --git a/graphtft/font.c b/graphtft/font.c
index 9cfa812..d61a4b3 100644
--- a/graphtft/font.c
+++ b/graphtft/font.c
@@ -41,6 +41,7 @@ bool cGraphtftFont::Load(string Filename, string CacheName, int Size, int Langua
if ( _cache.find(CacheName) != _cache.end() )
return true;
+#if VDRVERSNUM < 10503
int error = FT_New_Face(_library, Filename.c_str(), format, &_face);
// every thing ok?
@@ -138,7 +139,7 @@ bool cGraphtftFont::Load(string Filename, string CacheName, int Size, int Langua
//Load the char
error = FT_Load_Glyph( _face, glyph_index, FT_LOAD_DEFAULT );
if ( error ) continue; /* ignore errors */
-
+
// now, convert to vdr font data
int width = (_slot->metrics.horiAdvance / 64) + 1;
int bearingX = (_slot->metrics.horiBearingX / 64) +1;
@@ -187,6 +188,17 @@ bool cGraphtftFont::Load(string Filename, string CacheName, int Size, int Langua
delete(font_data);
// Something went wrong!
return false;
+#else
+#if VDRVERSNUM < 10504
+ cFont* newFont = new cFreetypeFont(*AddDirectory(FONTDIR, Filename.c_str()), Size);
+#else
+ cFont* newFont = cFont::CreateFont(Filename.c_str(), Size);
+#endif
+ if ( newFont == NULL )
+ return false;
+ _cache[CacheName] = newFont;
+ return true;
+#endif
}
const cFont* cGraphtftFont::GetFont(string CacheName){
@@ -210,10 +222,12 @@ void cGraphtftFont::Clear()
delete((*it).second);
_cache.clear();
+#if VDRVERSNUM < 10503
del_map::iterator del_it = _del.begin();
for (; del_it != _del.end(); ++del_it)
delete((*del_it).second);
_del.clear();
+#endif
}
cGraphtftFont GraphtftFont;
diff --git a/graphtft/font.h b/graphtft/font.h
index 2d2eee1..041baef 100644
--- a/graphtft/font.h
+++ b/graphtft/font.h
@@ -24,7 +24,9 @@ class cGraphtftFont
{
private:
typedef map<string,cFont*> cache_map;
+#if VDRVERSNUM < 10503
typedef map<string,cFont::tPixelData*> del_map;
+#endif
public:
cGraphtftFont();
@@ -40,7 +42,9 @@ private:
FT_Face _face;
FT_GlyphSlot _slot;
cache_map _cache;
+#if VDRVERSNUM < 10503
del_map _del;
+#endif
};
diff --git a/i18n.c b/i18n.c
index 4f97840..c36fb95 100644
--- a/i18n.c
+++ b/i18n.c
@@ -5,6 +5,7 @@
#include "i18n.h"
#include <vdr/config.h>
+#if VDRVERSNUM < 10507
const tI18nPhrase Phrases[] = {
/*
{ "English",
@@ -79,15 +80,15 @@ const tI18nPhrase Phrases[] = {
"",
#endif
},
- { "Flush image cache",
- "Bildspeicher leeren",
+ { "Flushing image cache...",
+ "Bildspeicher wird geleert...",
"",
"",
"",
"",
"",
"",
- "Tyhjennä kuvat välimuistista",
+ "Tyhjennetään välimuistia...",
"",
"",
"",
@@ -454,41 +455,24 @@ const tI18nPhrase Phrases[] = {
"",
#endif
},
- { "en_US",
- "de_DE",
- "sl_SI",
- "it_IT",
- "nl_NL",
- "pt_PT",
- "fr_FR",
- "no_NO",
- "fi_FI",
- "pl_PL",
- "es_ES",
- "el_GR",
- "sv_SE",
- "ro_RO",
- "hu_HU",
- "ca_AD",
- "ru_RU",
- "hr_HR",
-#if VDRVERSNUM >= 10313
- "et_EE",
-#endif
-#if VDRVERSNUM >= 10316
- "da_DK",
-#endif
- },
{ NULL }
};
+#endif
+#if VDRVERSNUM >= 10507
+cText2SkinI18n::cText2SkinI18n(const char *Skin) {
+ mIdentity = std::string("vdr-"PLUGIN_NAME_I18N"-") + Skin;
+ I18nRegister(mIdentity.substr(mIdentity.find('-') + 1).c_str());
+#else
cText2SkinI18n::cText2SkinI18n(const char *Skin): cText2SkinFile(Skin) {
mIdentity = (std::string)"text2skin_" + Skin;
mNumPhrases = 0;
mPhrases = (tI18nPhrase*)malloc(sizeof(tI18nPhrase));
memset(mPhrases[mNumPhrases], 0, sizeof(tI18nPhrase));
+#endif
}
+#if VDRVERSNUM < 10507
cText2SkinI18n::~cText2SkinI18n() {
for (int i = 0; mPhrases[i][0]; ++i) {
for (int j = 0; j < I18nNumLanguages; ++j)
@@ -544,3 +528,4 @@ bool cText2SkinI18n::Load(const std::string &Filename) {
}
return false;
}
+#endif
diff --git a/i18n.h b/i18n.h
index d988e6b..821e7c1 100644
--- a/i18n.h
+++ b/i18n.h
@@ -9,22 +9,33 @@
#include "file.h"
#include <vdr/i18n.h>
+#if VDRVERSNUM < 10507
+#define trNOOP(s) (s)
+#define trVDR(s) tr(s)
+
extern const tI18nPhrase Phrases[];
class cText2SkinI18n: public cText2SkinFile {
+#else
+class cText2SkinI18n {
+#endif
private:
std::string mIdentity;
+#if VDRVERSNUM < 10507
tI18nPhrase *mPhrases;
int mNumPhrases;
protected:
virtual bool Parse(const char *Text);
+#endif
public:
cText2SkinI18n(const char *Skin);
+#if VDRVERSNUM < 10507
virtual ~cText2SkinI18n();
virtual bool Load(const std::string &Filename);
+#endif
std::string Translate(const std::string &Text) { return I18nTranslate(Text.c_str(), mIdentity.c_str()); }
};
diff --git a/loader.c b/loader.c
index bdeea09..c8888c5 100644
--- a/loader.c
+++ b/loader.c
@@ -34,6 +34,9 @@ void cText2SkinLoader::Start(void) {
}
void cText2SkinLoader::Load(const char *Skin) {
+#if VDRVERSNUM >= 10507
+ cText2SkinI18n *translations = new cText2SkinI18n(Skin);
+#else
cText2SkinI18n *translations = NULL;
std::string transfile = SkinPath() + "/" + Skin + "/" + Skin + ".trans";
if (access(transfile.c_str(), F_OK) == 0) {
@@ -41,6 +44,7 @@ void cText2SkinLoader::Load(const char *Skin) {
if (!translations->Load(transfile))
DELETENULL(translations);
}
+#endif
cText2SkinTheme *theme = new cText2SkinTheme(Skin);
std::string themefile = SkinPath() + "/" + Skin + "/" + Skin + ".colors";
@@ -52,7 +56,7 @@ void cText2SkinLoader::Load(const char *Skin) {
cxSkin *skin = xmlParse(Skin, skinfile, translations, theme);
if (skin) {
- if( skin->Version() <= cText2SkinPlugin::SkinVersion() ) {
+ if (skin->Version() <= cText2SkinPlugin::SkinVersion()) {
new cText2SkinLoader(skin, translations, theme, Skin, skin->Title());
return;
} else
diff --git a/menu.c b/menu.c
index 3117022..200278a 100644
--- a/menu.c
+++ b/menu.c
@@ -15,20 +15,21 @@ cText2SkinSetupPage::cText2SkinSetupPage(void) {
void cText2SkinSetupPage::Setup(void) {
int current = Current();
Clear();
-
+
Add(new cMenuEditBoolItem(tr("Show scrollbar in the menus"), &mData.MenuScrollbar, tr("no"), tr("yes")));
Add(new cMenuEditBoolItem(tr("Scrolling behaviour"), &mData.MarqueeLeftRight, tr("to the left"), tr("left and right")));
Add(new cMenuEditBoolItem(tr("Reset Marquee for new item"), &mData.MarqueeReset, tr("no"), tr("yes")));
#if VDRVERSNUM >= 10344
Add(new cMenuEditBoolItem(tr("Show auxiliary infos of recordings"), &mData.ShowAux, tr("no"), tr("yes")));
- if (mData.ShowAux) Add(new cMenuEditBoolItem(tr(" Extract known tags"), &mData.StripAux, tr("no"), tr("yes")));
+ if (mData.ShowAux)
+ Add(new cMenuEditBoolItem(tr(" Extract known tags"), &mData.StripAux, tr("no"), tr("yes")));
#endif
#if VDRVERSNUM >= 10330
Add(new cMenuEditBoolItem(tr("Use 'timeline' to check timer-conflicts"), &mData.CheckTimerConflict, tr("no"), tr("yes")));
#endif
Add(new cOsdItem(tr("Flush image cache"), osUser1));
Add(new cMenuEditIntItem(tr("Max. image cache size"), &mData.MaxCacheFill));
-
+
SetCurrent(Get(current));
Display();
}
@@ -53,7 +54,7 @@ void cText2SkinSetupPage::Store(void) {
eOSState cText2SkinSetupPage::ProcessKey(eKeys Key) {
int oldShowAux = mData.ShowAux;
-
+
eOSState state = cMenuSetupPage::ProcessKey(Key);
if (state == osUser1) {
Skins.Message(mtInfo, tr("Flushing image cache..."));
@@ -61,9 +62,10 @@ eOSState cText2SkinSetupPage::ProcessKey(eKeys Key) {
Skins.Message(mtInfo, NULL);
return osContinue;
}
-
- if (mData.ShowAux != oldShowAux) Setup();
-
+
+ if (mData.ShowAux != oldShowAux)
+ Setup();
+
return state;
}
diff --git a/po/de_DE.po b/po/de_DE.po
new file mode 100644
index 0000000..287601e
--- /dev/null
+++ b/po/de_DE.po
@@ -0,0 +1,31 @@
+# German translations for vdr-text2skin package.
+# Copyright (C) Sascha Volkenandt <sascha@akv-soft.de>
+# This file is distributed under the same license as the vdr-text2skin package.
+# Sascha Volkenandt <sascha@akv-soft.de>, 2004, 2005.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vdr-text2skin 1.2\n"
+"Report-Msgid-Bugs-To: <sascha@akv-soft.de>\n"
+"POT-Creation-Date: 2009-06-01 17:47+0200\n"
+"PO-Revision-Date: 2009-06-01 17:47+0200\n"
+"Last-Translator: Sascha Volkenandt <sascha@akv-soft.de>\n"
+"Language-Team: <vdr@linuxtv.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-15\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "Skin too large or incorrectly aligned"
+msgstr "Skin zu groß oder nicht korrekt ausgerichtet"
+
+msgid "Flush image cache"
+msgstr "Bildspeicher leeren"
+
+msgid "Max. image cache size"
+msgstr "Max. Größe des Bildspeichers"
+
+msgid "Flushing image cache..."
+msgstr "Bildspeicher wird geleert..."
+
+msgid "Loader for text-based skins"
+msgstr "Lader für textbasierte Skins"
diff --git a/po/fi_FI.po b/po/fi_FI.po
new file mode 100644
index 0000000..a8f268c
--- /dev/null
+++ b/po/fi_FI.po
@@ -0,0 +1,31 @@
+# Finnish translations for vdr-text2skin package.
+# Copyright (C) Sascha Volkenandt <sascha@akv-soft.de>
+# This file is distributed under the same license as the vdr-text2skin package.
+# Rolf Ahrenberg <rahrenbe@cc.hut.fi>, 2004, 2005.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vdr-text2skin 1.2\n"
+"Report-Msgid-Bugs-To: <sascha@akv-soft.de>\n"
+"POT-Creation-Date: 2009-06-01 17:47+0200\n"
+"PO-Revision-Date: 2009-06-01 17:47+0200\n"
+"Last-Translator: Rolf Ahrenberg <rahrenbe@cc.hut.fi>\n"
+"Language-Team: <vdr@linuxtv.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-15\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "Skin too large or incorrectly aligned"
+msgstr "Ulkoasu on liian suuri tai väärin asemoitu"
+
+msgid "Flush image cache"
+msgstr "Tyhjennä kuvat välimuistista"
+
+msgid "Max. image cache size"
+msgstr "Välimuistin maksimikoko"
+
+msgid "Flushing image cache..."
+msgstr "Tyhjennetään välimuistia..."
+
+msgid "Loader for text-based skins"
+msgstr "Helposti muokattavat ulkoasut"
diff --git a/po/it_IT.po b/po/it_IT.po
new file mode 100644
index 0000000..3487a9d
--- /dev/null
+++ b/po/it_IT.po
@@ -0,0 +1,35 @@
+# Italian translations for vdr-text2skin package.
+# Copyright (C) Sascha Volkenandt <sascha@akv-soft.de>
+# This file is distributed under the same license as the vdr-text2skin package.
+# Diego Pierotto <vdr-italian@tiscali.it>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vdr-text2skin 1.2\n"
+"Report-Msgid-Bugs-To: <sascha@akv-soft.de>\n"
+"POT-Creation-Date: 2009-06-01 17:47+0200\n"
+"PO-Revision-Date: 2009-06-02 16:11+0100\n"
+"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
+"Language-Team: <vdr@linuxtv.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Italian\n"
+"X-Poedit-Country: ITALY\n"
+"X-Poedit-SourceCharset: utf-8\n"
+
+msgid "Skin too large or incorrectly aligned"
+msgstr "Interfaccia troppo grande o allineamento incorretto"
+
+msgid "Flush image cache"
+msgstr "Svuota cache immagini"
+
+msgid "Max. image cache size"
+msgstr "Dim. massima cache immagini"
+
+msgid "Flushing image cache..."
+msgstr "Svuotamento cache immagini..."
+
+msgid "Loader for text-based skins"
+msgstr "Gestore di stili interfaccia basati su testo"
+
diff --git a/render.c b/render.c
index d94911c..65b0ce7 100644
--- a/render.c
+++ b/render.c
@@ -128,10 +128,6 @@ cText2SkinRender::~cText2SkinRender()
mRender = NULL;
}
-
-
-
-
void cText2SkinRender::Action(void)
{
bool to = true;
@@ -143,19 +139,18 @@ void cText2SkinRender::Action(void)
to = true;
start_time = mNow;
- if( mUpdateIn ) to=mDoUpdate.TimedWait(mDoUpdateMutex, mUpdateIn);
- else mDoUpdate.Wait(mDoUpdateMutex);
+ if (mUpdateIn) to = mDoUpdate.TimedWait(mDoUpdateMutex, mUpdateIn);
+ else mDoUpdate.Wait(mDoUpdateMutex);
if (!mActive) break; // fall out if thread to be stopped
mNow = time_ms();
- if( mUpdateIn ) {
- if( !to || mNow >= start_time + mUpdateIn ) {\
+ if (mUpdateIn) {
+ if (!to || mNow >= start_time + mUpdateIn) {
SetDirty(cxRefresh::timeout);
mUpdateIn = 0; // has to be re-set within Update();
- } else {
+ } else
mUpdateIn -= mNow - start_time;
- }
}
Update();
@@ -163,30 +158,25 @@ void cText2SkinRender::Action(void)
UpdateUnlock();
}
-
-
-
-
-
void cText2SkinRender::Update(void)
{
Dbench(update);
#ifdef BENCH
- fprintf( stderr, "mDirty = 0x%04x\n", mDirty );
+ fprintf(stderr, "mDirty = 0x%04x\n", mDirty);
#endif
- if( mFirst ) {
- mDirty = (1<<cxRefresh::all);
- mFirst = false;
- } else if( mDirty & (1<<cxRefresh::all) ) {
+ if (mFirst) {
+ mDirty = (1<<cxRefresh::all);
+ mFirst = false;
+ }
+ else if (mDirty & (1<<cxRefresh::all))
// we need a complete redraw anyway, that is enough
mDirty = 1 << cxRefresh::all;
- }
for (uint i = 0; i < mDisplay->Objects(); ++i)
DrawObject(mDisplay->GetObject(i));
mDirty = 0;
- while( mDirtyItems.size() > 0 )
+ while (mDirtyItems.size() > 0)
mDirtyItems.pop_back();
Dbench(flush);
@@ -196,36 +186,28 @@ void cText2SkinRender::Update(void)
//printf("====\t%d\n", mDisplay->Objects());
}
-
-
-
-
-
-
-void cText2SkinRender::DrawObject( cxObject *Object,
- const txPoint &BaseOffset /*=txPoint(-1,-1)*/,
- const txSize &BaseSize /*=txSize(-1,-1)*/,
- const txSize &VirtSize /*=txSize(-1,-1)*/,
- int ListItem /*=-1*/,
- bool ForceUpdate /*=false*/)
+void cText2SkinRender::DrawObject(cxObject *Object,
+ const txPoint &BaseOffset /*=txPoint(-1,-1)*/,
+ const txSize &BaseSize /*=txSize(-1,-1)*/,
+ const txSize &VirtSize /*=txSize(-1,-1)*/,
+ int ListItem /*=-1*/,
+ bool ForceUpdate /*=false*/)
{
- if( !Object->mRefresh.Dirty(mDirty, mUpdateIn, ForceUpdate, mNow) ||
- (Object->Condition()!=NULL && !Object->Condition()->Evaluate()))
+ if (!Object->mRefresh.Dirty(mDirty, mUpdateIn, ForceUpdate, mNow) ||
+ (Object->Condition() != NULL && !Object->Condition()->Evaluate()))
return;
txPoint pos;
txSize size;
- pos = Object->Pos(BaseOffset, BaseSize, VirtSize);
+ pos = Object->Pos(BaseOffset, BaseSize, VirtSize);
- if( ListItem >= 0 && !mSkin->Version().Require(1,1) ) {
+ if (ListItem >= 0 && !mSkin->Version().Require(1,1))
// Object is part of al list
// Calculate offset of list item relative to the list offset
size = Object->Size();
- } else {
+ else
size = Object->Size(BaseOffset, BaseSize, VirtSize);
- }
-
switch (Object->Type()) {
case cxObject::image:
@@ -234,28 +216,28 @@ void cText2SkinRender::DrawObject( cxObject *Object,
break;
case cxObject::text:
- if( ListItem >= 0 && Object->Display()->Type() == cxDisplay::menu )
- DrawItemText( Object, ListItem, pos, BaseSize );
+ if (ListItem >= 0 && Object->Display()->Type() == cxDisplay::menu)
+ DrawItemText(Object, ListItem, pos, BaseSize);
else
DrawText(pos, size, Object->Fg(), Object->Bg(), Object->Text(), Object->Font(),
- Object->Align());
+ Object->Align());
break;
case cxObject::marquee:
- if( ListItem >= 0 && Object->Display()->Type() == cxDisplay::menu )
- DrawItemText( Object, ListItem, pos, BaseSize );
+ if (ListItem >= 0 && Object->Display()->Type() == cxDisplay::menu)
+ DrawItemText(Object, ListItem, pos, BaseSize);
else
DrawMarquee(pos, size, Object->Fg(), Object->Bg(), Object->Text(), Object->Font(),
- Object->Align(), Object->Delay(), Object->State());
+ Object->Align(), Object->Delay(), Object->State());
break;
case cxObject::blink:
- if( ListItem >= 0 && Object->Display()->Type() == cxDisplay::menu )
- DrawItemText( Object, ListItem, pos, BaseSize );
+ if (ListItem >= 0 && Object->Display()->Type() == cxDisplay::menu)
+ DrawItemText(Object, ListItem, pos, BaseSize);
else
DrawBlink(pos, size, Object->Fg(), Object->Bg(), Object->Bl(), Object->Text(),
- Object->Font(), Object->Align(), Object->Delay(),
- Object->State());
+ Object->Font(), Object->Align(), Object->Delay(),
+ Object->State());
break;
case cxObject::rectangle:
@@ -271,13 +253,13 @@ void cText2SkinRender::DrawObject( cxObject *Object,
break;
case cxObject::progress:
- DrawProgressbar(pos, size, Object->Current(), Object->Total(),
- Object->Bg(), Object->Fg(), Object->Keep(), Object->Mark(),
+ DrawProgressbar(pos, size, Object->Current(), Object->Total(),
+ Object->Bg(), Object->Fg(), Object->Keep(), Object->Mark(),
Object->Active(), GetMarks());
break;
case cxObject::scrolltext:
- DrawScrolltext(pos, size, Object->Fg(), Object->Text(), Object->Font(),
+ DrawScrolltext(pos, size, Object->Fg(), Object->Text(), Object->Font(),
Object->Align());
break;
@@ -287,49 +269,49 @@ void cText2SkinRender::DrawObject( cxObject *Object,
case cxObject::block:
for (uint i = 0; i < Object->Objects(); ++i)
DrawObject(Object->GetObject(i), pos, size, Object->mVirtSize, ListItem,
- ListItem >= 0 ? true : Object->mRefresh.Full());
+ ListItem >= 0 ? true : Object->mRefresh.Full());
break;
- case cxObject::list:{
- cxObject *item = Object->GetObject(0);
- if (item && item->Type() == cxObject::item) {
- txSize itemsize = item->Size(pos, size);
- txPoint itempos = pos;
- itemsize.w = size.w;
- uint maxitems = size.h / itemsize.h;
- mMenuScrollbar.maxItems = maxitems;
- SetMaxItems(maxitems); //Dprintf("setmaxitems %d\n", maxitems);
- uint index = 0;
- bool partial = false;
-
- // is only a partial update needed?
- if( !Object->mRefresh.Full() &&
- !(Object->mRefresh.Type() & mDirty & ~(1<<cxRefresh::list)) ) {
- maxitems = mDirtyItems.size();
- partial = true;
- }
-
- // draw list items
- for (uint i = 0; i < maxitems; ++i) {
- if (!HasTabText(i, -1))
- continue;
-
- Dbench(item);
- if( partial )
- index = mDirtyItems[i];
- else
- index = i;
+ case cxObject::list: {
+ cxObject *item = Object->GetObject(0);
+ if (item && item->Type() == cxObject::item) {
+ txSize itemsize = item->Size(pos, size);
+ txPoint itempos = pos;
+ itemsize.w = size.w;
+ uint maxitems = size.h / itemsize.h;
+ mMenuScrollbar.maxItems = maxitems;
+ SetMaxItems(maxitems); //Dprintf("setmaxitems %d\n", maxitems);
+ uint index = 0;
+ bool partial = false;
+
+ // is only a partial update needed?
+ if (!Object->mRefresh.Full() &&
+ !(Object->mRefresh.Type() & mDirty & ~(1<<cxRefresh::list))) {
+ maxitems = mDirtyItems.size();
+ partial = true;
+ }
- itempos.y = pos.y + index * itemsize.h;
- for (uint j = 1; j < Object->Objects(); ++j) {
- item = Object->GetObject(j);
- item->SetListIndex( index, -1 );
- DrawObject( item, itempos, itemsize, Object->mVirtSize, index, true);
+ // draw list items
+ for (uint i = 0; i < maxitems; ++i) {
+ if (!HasTabText(i, -1))
+ continue;
+
+ Dbench(item);
+ if (partial)
+ index = mDirtyItems[i];
+ else
+ index = i;
+
+ itempos.y = pos.y + index * itemsize.h;
+ for (uint j = 1; j < Object->Objects(); ++j) {
+ item = Object->GetObject(j);
+ item->SetListIndex(index, -1);
+ DrawObject(item, itempos, itemsize, Object->mVirtSize, index, true);
+ }
+ Ddiff("draw item", item);
}
- Ddiff( "draw item", item );
}
}
- }
break;
case cxObject::item:
@@ -339,29 +321,22 @@ void cText2SkinRender::DrawObject( cxObject *Object,
}
}
-
-
-
-
-
-
-
-void cText2SkinRender::DrawItemText(cxObject *Object, int i, const txPoint &ListOffset, const txSize &ListSize)
+void cText2SkinRender::DrawItemText(cxObject *Object, int i, const txPoint &ListOffset, const txSize &ListSize)
{
bool initialEditableWidthSet = false;
int maxtabs = cSkinDisplayMenu::MaxTabs;
txPoint Pos = ListOffset;
txSize BaseSize = Object->Size(ListOffset, ListSize);
txSize Size = BaseSize;
-
- if( !mTabScaleSet ) {
+
+ if (!mTabScaleSet) {
// VDR assumes, that the font in the menu is fontOsd,
// so the tab width is not necessarily correct
// for TTF
const cFont *defFont = cFont::GetFont(fontOsd);
const char *dummy = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ";
- //if( defFont != Object->Font() )
- mTabScale = 1.08 * (float)Object->Font()->Width(dummy) / (float)defFont->Width(dummy);
+ //if (defFont != Object->Font())
+ mTabScale = 1.08 * (float)Object->Font()->Width(dummy) / (float)defFont->Width(dummy);
mTabScaleSet = true;
}
@@ -379,7 +354,7 @@ void cText2SkinRender::DrawItemText(cxObject *Object, int i, const txPoint &List
// set initial EditableWidth
// this is for plugins like 'extrecmenu' and 'rotor'
- if ( !initialEditableWidthSet ) {
+ if (!initialEditableWidthSet) {
initialEditableWidthSet = true;
SetEditableWidth((int)(Size.w / mTabScale));
}
@@ -395,14 +370,14 @@ void cText2SkinRender::DrawItemText(cxObject *Object, int i, const txPoint &List
++n;
nexttab = (int)(mTabScale * GetTab(n));
}
-
+
if (t >= 0 && nexttab > 0 && nexttab < BaseSize.w - 1)
// there is a "next tab" with text
Size.w = nexttab - thistab;
else {
// there is no "next tab", use the rightmost edge
Size.w = BaseSize.w - thistab;
- if ( t == 1)
+ if (t == 1)
SetEditableWidth((int)(Size.w / mTabScale));
}
@@ -431,11 +406,11 @@ void cText2SkinRender::DrawItemText(cxObject *Object, int i, const txPoint &List
txPoint prog_pos = Pos;
txSize prog_size = Size;
- DrawRectangle(txPoint(prog_pos.x, prog_pos.y + 4),
+ DrawRectangle(txPoint(prog_pos.x, prog_pos.y + 4),
txSize(prog_size.w, 2), Object->Fg());
DrawRectangle(txPoint(prog_pos.x, prog_pos.y + 4),
txSize(2, prog_size.h - 8), Object->Fg());
- DrawRectangle(txPoint(prog_pos.x, prog_pos.y + prog_size.h - 6),
+ DrawRectangle(txPoint(prog_pos.x, prog_pos.y + prog_size.h - 6),
txSize(prog_size.w, 2), Object->Fg());
DrawRectangle(txPoint(prog_pos.x + prog_size.w - 2, prog_pos.y + 4),
txSize(2, prog_size.h - 8), Object->Fg());
@@ -446,23 +421,24 @@ void cText2SkinRender::DrawItemText(cxObject *Object, int i, const txPoint &List
prog_size.h -= 16;
DrawProgressbar(prog_pos, prog_size, current, total, Object->Bg(),
Object->Fg(), NULL, NULL, NULL, NULL);
- } else {
+ }
+ else {
switch (Object->Type()) {
case cxObject::text:
DrawText(Pos, Size, Object->Fg(), Object->Bg(), Object->Text(),
- Object->Font(), Object->Align());
+ Object->Font(), Object->Align());
break;
case cxObject::marquee:
DrawMarquee(Pos, Size, Object->Fg(), Object->Bg(), Object->Text(),
- Object->Font(), Object->Align(), Object->Delay(),
- Object->State());
+ Object->Font(), Object->Align(), Object->Delay(),
+ Object->State());
break;
case cxObject::blink:
DrawBlink(Pos, Size, Object->Fg(), Object->Bg(), Object->Bl(),
- Object->Text(), Object->Font(), Object->Align(),
- Object->Delay(), Object->State());
+ Object->Text(), Object->Font(), Object->Align(),
+ Object->Delay(), Object->State());
break;
default:
break;
@@ -472,7 +448,6 @@ void cText2SkinRender::DrawItemText(cxObject *Object, int i, const txPoint &List
}
}
-
void cText2SkinRender::DrawImage(const txPoint &Pos, const txSize &Size, const tColor *Bg,
const tColor *Fg, const tColor *Mask, int Alpha, int Colors,
const std::string &Path)
@@ -490,45 +465,41 @@ void cText2SkinRender::DrawImage(const txPoint &Pos, const txSize &Size, const t
}
void cText2SkinRender::DrawText(const txPoint &Pos, const txSize &Size, const tColor *Fg,
- const tColor *Bg, const std::string &Text, const cFont *Font, int Align)
+ const tColor *Bg, const std::string &Text, const cFont *Font, int Align)
{
//Dprintf("trying to draw text %s to %d,%d size %d,%d, color %x\n", Text.c_str(), Pos.x, Pos.y,
// Size.w, Size.h, Fg ? *Fg : 0);
- if( Bg ) {
- mScreen->DrawRectangle(Pos.x, Pos.y, Pos.x + Size.w - 1, Pos.y + Size.h - 1, *Bg );
- }
+ if (Bg)
+ mScreen->DrawRectangle(Pos.x, Pos.y, Pos.x + Size.w - 1, Pos.y + Size.h - 1, *Bg);
mScreen->DrawText(Pos.x, Pos.y, Text.c_str(), Fg ? *Fg : 0, 0, Font, Size.w, Size.h, Align);
}
-void cText2SkinRender::DrawMarquee(const txPoint &Pos, const txSize &Size, const tColor *Fg,
+void cText2SkinRender::DrawMarquee(const txPoint &Pos, const txSize &Size, const tColor *Fg,
const tColor *Bg, const std::string &Text, const cFont *Font,
int Align, uint Delay, txState &state)
{
bool scrolling = Font->Width(Text.c_str()) > Size.w;
-
+
if (state.text != Text) {
state = txState();
state.text = Text;
}
-
- if (Text2SkinSetup.MarqueeReset && mUpdate.resetMarquee && mUpdate.currentItem.find(Text, 0) != std::string::npos)
- {
+
+ if (Text2SkinSetup.MarqueeReset && mUpdate.resetMarquee && mUpdate.currentItem.find(Text, 0) != std::string::npos) {
state.offset = 0;
state.direction = 1;
state.nexttime = 0;
state.scrolling = false;
mUpdate.foundFirstItem = true;
}
- else
- {
- if (mUpdate.foundFirstItem)
- {
+ else {
+ if (mUpdate.foundFirstItem) {
mUpdate.resetMarquee = false;
mUpdate.foundFirstItem = false;
}
}
-
+
if (state.nexttime == 0)
state.nexttime = mNow + 1500;
else if (mNow >= state.nexttime) {
@@ -558,22 +529,14 @@ void cText2SkinRender::DrawMarquee(const txPoint &Pos, const txSize &Size, const
//Dprintf("drawMarquee text = %s, state.text = %s, offset = %d, index = %d, scrolling = %d, mUpdatteIn = %d, nexttime = %d, delay = %d\n",
// Text.c_str(), state.text.c_str(), state.offset, Index, scrolling, mUpdateIn, state.nexttime, Delay);
-
- if( Bg ) {
- mScreen->DrawRectangle(Pos.x, Pos.y, Pos.x + Size.w - 1, Pos.y + Size.h - 1, *Bg );
- }
+ if (Bg)
+ mScreen->DrawRectangle(Pos.x, Pos.y, Pos.x + Size.w - 1, Pos.y + Size.h - 1, *Bg);
mScreen->DrawText(Pos.x, Pos.y, Text.c_str() + state.offset, Fg ? *Fg : 0, clrTransparent, Font,
Size.w, Size.h, Align);
}
-
-
-
-
-
-
-void cText2SkinRender::DrawBlink(const txPoint &Pos, const txSize &Size, const tColor *Fg,
+void cText2SkinRender::DrawBlink(const txPoint &Pos, const txSize &Size, const tColor *Fg,
const tColor *Bg, const tColor *Bl, const std::string &Text,
const cFont *Font, int Align, uint Delay, txState &state)
{
@@ -594,51 +557,29 @@ void cText2SkinRender::DrawBlink(const txPoint &Pos, const txSize &Size, const t
const tColor *col = state.offset == 0 ? Fg : Bl;
- if( Bg ) {
- mScreen->DrawRectangle(Pos.x, Pos.y, Pos.x + Size.w - 1, Pos.y + Size.h - 1, *Bg );
- }
+ if (Bg)
+ mScreen->DrawRectangle(Pos.x, Pos.y, Pos.x + Size.w - 1, Pos.y + Size.h - 1, *Bg);
- if( col ) {
+ if (col)
mScreen->DrawText(Pos.x, Pos.y, Text.c_str(), *col, clrTransparent, Font, Size.w, Size.h,
Align);
- }
}
-
-
-
-
-
void cText2SkinRender::DrawRectangle(const txPoint &Pos, const txSize &Size, const tColor *Fg)
{
mScreen->DrawRectangle(Pos.x, Pos.y, Pos.x + Size.w - 1, Pos.y + Size.h - 1, Fg ? *Fg : 0);
}
-
-
-
-
-
void cText2SkinRender::DrawEllipse(const txPoint &Pos, const txSize &Size, const tColor *Fg,
int Arc)
{
mScreen->DrawEllipse(Pos.x, Pos.y, Pos.x + Size.w - 1, Pos.y + Size.h - 1, Fg ? *Fg : 0, Arc);
}
-
-
-
-
-
void cText2SkinRender::DrawSlope(const txPoint &Pos, const txSize &Size, const tColor *Fg, int Arc) {
mScreen->DrawSlope(Pos.x, Pos.y, Pos.x + Size.w - 1, Pos.y + Size.h - 1, Fg ? *Fg : 0, Arc);
}
-
-
-
-
-
void cText2SkinRender::DrawProgressbar(const txPoint &Pos, const txSize &Size, int Current,
int Total, const tColor *Bg, const tColor *Fg,
const tColor *Selected, const tColor *Mark,
@@ -689,11 +630,6 @@ void cText2SkinRender::DrawProgressbar(const txPoint &Pos, const txSize &Size, i
}
}
-
-
-
-
-
void cText2SkinRender::DrawMark(const txPoint &Pos, const txSize &Size, bool Start, bool Current,
bool Horizontal, const tColor *Mark, const tColor *Cur)
{
@@ -721,11 +657,6 @@ void cText2SkinRender::DrawMark(const txPoint &Pos, const txSize &Size, bool Sta
}
}
-
-
-
-
-
void cText2SkinRender::DrawScrolltext(const txPoint &Pos, const txSize &Size, const tColor *Fg,
const std::string &Text, const cFont *Font, int /*Align*/)
{
@@ -736,12 +667,7 @@ void cText2SkinRender::DrawScrolltext(const txPoint &Pos, const txSize &Size, co
else
mScroller->DrawText();
}
-
-
-
-
-
-
+
void cText2SkinRender::DrawScrollbar(const txPoint &Pos, const txSize &Size, const tColor *Bg,
const tColor *Fg)
{
@@ -764,21 +690,18 @@ void cText2SkinRender::DrawScrollbar(const txPoint &Pos, const txSize &Size, con
DrawRectangle(sp, ss, Fg);
}
}
- else if (mMenuScrollbar.Available())
- {
+ else if (mMenuScrollbar.Available()) {
DrawRectangle(Pos, Size, Bg);
txPoint sbPoint = Pos;
txSize sbSize = Size;
- if (sbSize.h > sbSize.w)
- {
+ if (sbSize.h > sbSize.w) {
// -1 to get at least 1 pixel height
double top = double(mMenuScrollbar.Top()) / mMenuScrollbar.total * (sbSize.h - 1);
double bottom = double(mMenuScrollbar.Bottom()) / mMenuScrollbar.total * (sbSize.h - 1);
sbPoint.y += (uint)top;
sbSize.h -= (uint)top + (uint)bottom;
}
- else
- {
+ else {
// -1 to get at least 1 pixel height
double left = double(mMenuScrollbar.Top()) / mMenuScrollbar.total * (sbSize.w - 1);
double right = double(mMenuScrollbar.Bottom()) / mMenuScrollbar.total * (sbSize.w - 1);
@@ -789,22 +712,12 @@ void cText2SkinRender::DrawScrollbar(const txPoint &Pos, const txSize &Size, con
}
}
-
-
-
-
-
txPoint cText2SkinRender::Transform(const txPoint &Pos)
{
txSize base = mRender->mBaseSize;
return txPoint(Pos.x < 0 ? base.w + Pos.x : Pos.x, Pos.y < 0 ? base.h + Pos.y : Pos.y);
}
-
-
-
-
-
bool cText2SkinRender::ItemColor(const std::string &Color, tColor &Result)
{
if (Color != "" && Color != "None") {
@@ -817,25 +730,15 @@ bool cText2SkinRender::ItemColor(const std::string &Color, tColor &Result)
return true;
}
-
-
-
-
-
std::string cText2SkinRender::ImagePath(const std::string &Filename)
{
if (mRender)
return (*Filename.data() == '/')
- ? Filename
- : mRender->mBasePath + "/" + Filename;
+ ? Filename
+ : mRender->mBasePath + "/" + Filename;
return "";
}
-
-
-
-
-
cxType cText2SkinRender::GetToken(const txToken &Token)
{
if (mRender != NULL) {
@@ -904,11 +807,6 @@ cxType cText2SkinRender::GetToken(const txToken &Token)
return false;
}
-
-
-
-
-
cxType cText2SkinRender::GetTokenData(const txToken &Token)
{
#define MB_PER_MINUTE 25.75 // this is just an estimate!
@@ -926,25 +824,25 @@ cxType cText2SkinRender::GetTokenData(const txToken &Token)
case tDateTime: return TimeType(time(NULL), Token.Attrib.Text);
case tCanScrollUp:
- {
- if (mScroller) return mScroller->CanScrollUp();
- else if (mMenuScrollbar.Available()) return mMenuScrollbar.CanScrollUp();
- else return false;
- }
+ if (mScroller)
+ return mScroller->CanScrollUp();
+ if (mMenuScrollbar.Available())
+ return mMenuScrollbar.CanScrollUp();
+ return false;
case tCanScrollDown:
- {
- if (mScroller) return mScroller->CanScrollDown();
- else if (mMenuScrollbar.Available()) return mMenuScrollbar.CanScrollDown();
- else return false;
- }
-
+ if (mScroller)
+ return mScroller->CanScrollDown();
+ if (mMenuScrollbar.Available())
+ return mMenuScrollbar.CanScrollDown();
+ return false;
+
case tIsRecording: return cRecordControls::Active();
-
+
case tOsdWidth: return (cxType)mBaseSize.w;
-
+
case tOsdHeight: return (cxType)mBaseSize.h;
-
+
#if VDRVERSNUM >=10318
case tAudioTrack: {
cDevice *dev = cDevice::PrimaryDevice();
diff --git a/render.h b/render.h
index f788168..e181719 100644
--- a/render.h
+++ b/render.h
@@ -69,7 +69,7 @@ private:
// scalefactor for tabs in the menu list
float mTabScale;
bool mTabScaleSet;
-
+
protected:
// Update thread
void UpdateLock(void) { mDoUpdateMutex.Lock(); }
@@ -77,9 +77,9 @@ protected:
virtual void Action(void);
// Drawing operations
- void DrawObject(cxObject *Object, const txPoint &BaseOffset=txPoint(-1,-1),
- const txSize &BaseSize=txSize(-1,-1), const txSize &VirtSize=txSize(-1,-1),
- int ListItem=-1, bool ForceUpdate=false);
+ void DrawObject(cxObject *Object, const txPoint &BaseOffset = txPoint(-1, -1),
+ const txSize &BaseSize = txSize(-1, -1), const txSize &VirtSize = txSize(-1, -1),
+ int ListItem = -1, bool ForceUpdate = false);
void DrawItemText(cxObject *o, int i, const txPoint &ListOffset, const txSize &ListSize);
void DrawBackground(const txPoint &Pos, const txSize &Size, const tColor *Bg, const tColor *Fg,
@@ -87,12 +87,12 @@ protected:
void DrawImage(const txPoint &Pos, const txSize &Size, const tColor *Bg, const tColor *Fg,
const tColor *Mask, int Alpha, int Colors, const std::string &Path);
void DrawText(const txPoint &Pos, const txSize &Size, const tColor *Fg, const tColor *Bg,
- const std::string &Text, const cFont *Font, int Align);
+ const std::string &Text, const cFont *Font, int Align);
void DrawMarquee(const txPoint &Pos, const txSize &Size, const tColor *Fg, const tColor *Bg,
const std::string &Text, const cFont *Font, int Align, uint Delay, txState &state);
void DrawBlink(const txPoint &Pos, const txSize &Size, const tColor *Fg, const tColor *Bg,
- const tColor *Bl, const std::string &Text, const cFont *Font, int Align,
- uint Delay, txState &state);
+ const tColor *Bl, const std::string &Text, const cFont *Font, int Align,
+ uint Delay, txState &state);
void DrawRectangle(const txPoint &Pos, const txSize &Size, const tColor *Fg);
void DrawEllipse(const txPoint &Pos, const txSize &Size, const tColor *Fg, int Arc);
void DrawSlope(const txPoint &Pos, const txSize &Size, const tColor *Fg, int Arc);
@@ -120,8 +120,7 @@ protected:
// functions for display renderer to control behaviour
void Flush(bool Force = false);
- void SetDirty( cxRefresh::eRefreshType type=cxRefresh::all) {
- mDirty |= 1<<type; }
+ void SetDirty(cxRefresh::eRefreshType type = cxRefresh::all) { mDirty |= 1<<type; }
void Scroll(bool Up, bool Page) { if (mScroller != NULL) mScroller->Scroll(Up, Page); }
void Clear(void) { DELETENULL(mScroller); }
cSkin *Fallback(void) const { return mFallback; }
@@ -137,16 +136,15 @@ public:
static bool ItemColor(const std::string &Color, tColor &Result);
static std::string ImagePath(const std::string &Filename);
static cxType GetToken(const txToken &Token);
-
+
// provide scrollbar in every menu
- struct tMenuScrollbar
- {
+ struct tMenuScrollbar {
uint current; // overall (0 ... toal-1)
uint currentOnScreen; // on the current screen (0 ... maxItems-1)
uint total;
uint maxItems; // viewable on current screen
std::vector<std::string> items;
-
+
tMenuScrollbar(void) : current(0), currentOnScreen(0), total(0), maxItems(0) {}
bool Available(void) { return Text2SkinSetup.MenuScrollbar ? total > maxItems : false; }
uint Top(void) { return current - currentOnScreen; }
@@ -154,28 +152,26 @@ public:
bool CanScrollUp(void) { return Text2SkinSetup.MenuScrollbar ? Top() > 0 : false; }
bool CanScrollDown(void) { return Text2SkinSetup.MenuScrollbar ? Bottom() > 0 : false; }
} mMenuScrollbar;
-
+
// update infos (e.g. timerConflict)
- struct tUpdate
- {
+ struct tUpdate {
bool timerConflict;
bool events;
std::string currentItem;
bool resetMarquee;
bool foundFirstItem;
-
+
tUpdate(void) : timerConflict(true), events(true), currentItem(""), resetMarquee(true), foundFirstItem(false) {}
} mUpdate;
};
inline void cText2SkinRender::Flush(bool Force)
{
- if( Force ) {
+ if (Force)
// do a full redraw
mDirty = (1 << cxRefresh::all);
- }
- if (mDirty>0) {
+ if (mDirty > 0) {
UpdateLock();
mTokenCache.clear();
mDoUpdate.Broadcast();
diff --git a/screen.c b/screen.c
index e4dc088..f86447f 100644
--- a/screen.c
+++ b/screen.c
@@ -69,7 +69,7 @@ void cText2SkinScreen::DrawBitmap(int x, int y, const cBitmap &Bitmap, const tCo
#else
// mOsd->DrawBitmap(x, y, Bitmap, ColorFg, ColorBg);
cBitmap *bm = NULL;
- for (int i = 0; (bm=mOsd->GetBitmap(i)) != NULL; ++i)
+ for (int i = 0; (bm = mOsd->GetBitmap(i)) != NULL; ++i)
DrawBitmapOverlay(*bm, x, y, (cBitmap&)Bitmap, ColorMask);
#endif
}
@@ -126,12 +126,12 @@ void cText2SkinScreen::Flush(void)
#endif
}
#ifdef BENCH
- int x1=0,y1=0,x2=0,y2=0;
+ int x1 = 0, y1 = 0, x2 = 0, y2 = 0;
cBitmap *bm;
- for(int j=0; (bm=mOsd->GetBitmap(j)) != NULL; j++ )
- if(bm->Dirty(x1,y1,x2,y2))
+ for (int j = 0; (bm = mOsd->GetBitmap(j)) != NULL; j++)
+ if (bm->Dirty(x1, y1, x2, y2))
fprintf(stderr, "Flush dirty screen area %2i: x1=%3i x2=%3i y1=%3i y2=%3i\n",
- j,x1,x2,y1,y2 );
+ j, x1, x2, y1, y2);
#endif
if (!mOffScreen)
mOsd->Flush();
diff --git a/setup.c b/setup.c
index 6a27f6d..9abc238 100644
--- a/setup.c
+++ b/setup.c
@@ -35,7 +35,6 @@ bool cText2SkinSetup::SetupParse(const char *Name, const char *Value) {
#endif
else if (strcmp(Name, "MaxCacheFill") == 0) MaxCacheFill = atoi(Value);
else return false;
-
return true;
}
diff --git a/setup.h b/setup.h
index d76291c..ae77b1c 100644
--- a/setup.h
+++ b/setup.h
@@ -12,7 +12,7 @@ public:
cText2SkinSetup(void);
bool SetupParse(const char *Name, const char *Value);
-
+
int MenuScrollbar;
int MarqueeLeftRight;
int MarqueeReset;
diff --git a/status.c b/status.c
index d14314e..9b25a7c 100644
--- a/status.c
+++ b/status.c
@@ -33,11 +33,8 @@ void cText2SkinStatus::SetRender(cText2SkinRender *Render)
mNextRecording = 0;
}
-#if VDRVERSNUM >= 10338
-void cText2SkinStatus::Replaying(const cControl* /*Control*/, const char *Name, const char *FileName, bool On)
-#else
-void cText2SkinStatus::Replaying(const cControl* /*Control*/, const char *Name)
-#endif
+void cText2SkinStatus::Replaying(const cControl* /*Control*/, const char *Name,
+ const char *FileName, bool On)
{
Dprintf("cText2SkinStatus::Replaying(%s)\n", Name);
eReplayMode oldMode = mReplayMode;
@@ -45,7 +42,7 @@ void cText2SkinStatus::Replaying(const cControl* /*Control*/, const char *Name)
if (mRender != NULL)
mRender->UpdateLock();
- if (Name != NULL) {
+ if (On) {
mReplayMode = replayMPlayer;
if (strlen(Name) > 6 && Name[0]=='[' && Name[3]==']' && Name[5]=='(') {
int i;
@@ -60,14 +57,12 @@ void cText2SkinStatus::Replaying(const cControl* /*Control*/, const char *Name)
}
}
#if VDRVERSNUM >= 10338
- else if (const cRecording *rec = GetRecordingByFileName(FileName))
- {
+ else if (const cRecording *rec = GetRecordingByFileName(FileName)) {
mReplay = rec;
mReplayMode = replayNormal;
}
#else
- else if (const cRecording *rec = GetRecordingByName(Name))
- {
+ else if (const cRecording *rec = GetRecordingByName(Name)) {
mReplay = rec;
mReplayMode = replayNormal;
}
@@ -103,11 +98,8 @@ void cText2SkinStatus::Replaying(const cControl* /*Control*/, const char *Name)
}
}
-#if VDRVERSNUM >= 10338
-void cText2SkinStatus::Recording(const cDevice *Device, const char *Name, const char *FileName, bool On)
-#else
-void cText2SkinStatus::Recording(const cDevice *Device, const char *Name)
-#endif
+void cText2SkinStatus::Recording(const cDevice *Device, const char *Name,
+ const char *FileName, bool On)
{
if (mRender != NULL)
mRender->UpdateLock();
@@ -130,38 +122,37 @@ void cText2SkinStatus::Recording(const cDevice *Device, const char *Name)
void cText2SkinStatus::OsdClear(void)
{
+#if VDRVERSNUM >= 10507
+ if (I18nCurrentLanguage() != mLastLanguage) {
+ mLastLanguage = I18nCurrentLanguage();
+#else
if (Setup.OSDLanguage != mLastLanguage) {
mLastLanguage = Setup.OSDLanguage;
+#endif
cxString::Reparse();
}
-
+
if (mRender != NULL)
- {
mRender->mMenuScrollbar.total = 0;
- }
}
void cText2SkinStatus::OsdCurrentItem(const char *Text)
{
- if (mRender && Text)
- {
+ if (mRender && Text) {
// update infos
cText2SkinRender::tUpdate *u = &mRender->mUpdate;
//static std::string lastItem;
-
+
//lastItem = u->currentItem;
u->currentItem = Text;
u->resetMarquee = true;
u->foundFirstItem = false;
-
+
// find current item in scrollbar
- if (Text2SkinSetup.MenuScrollbar)
- {
+ if (Text2SkinSetup.MenuScrollbar) {
cText2SkinRender::tMenuScrollbar *sb = &mRender->mMenuScrollbar;
- for (uint i = 0; i < sb->total; i++)
- {
- if (sb->items[i] == Text)
- {
+ for (uint i = 0; i < sb->total; i++) {
+ if (sb->items[i] == Text) {
sb->current = i;
break;
}
@@ -172,62 +163,53 @@ void cText2SkinStatus::OsdCurrentItem(const char *Text)
void cText2SkinStatus::OsdItem(const char *Text, int Index)
{
- if (mRender && Text2SkinSetup.MenuScrollbar && Text)
- {
+ if (mRender && Text2SkinSetup.MenuScrollbar && Text) {
uint curr = (uint)Index;
cText2SkinRender::tMenuScrollbar *sb = &mRender->mMenuScrollbar;
-
+
if (curr < sb->items.size())
- {
sb->items[curr] = Text;
- }
- else
- {
+ else {
sb->items.push_back(Text);
sb->total = curr + 1;
}
-
- if (curr + 1 > sb->total) sb->total = curr + 1;
+
+ if (curr + 1 > sb->total)
+ sb->total = curr + 1;
}
}
void cText2SkinStatus::UpdateEvents(void)
{
- if (mRender->mUpdate.events)
- {
+ if (mRender->mUpdate.events) {
mRender->mUpdate.events = false;
-
+
mEvents.Clear();
Timers.IncBeingEdited();
-
- for (cTimer *tim = Timers.First(); tim; tim = Timers.Next(tim))
- {
- if (tim->HasFlags(tfActive))
- {
+
+ for (cTimer *tim = Timers.First(); tim; tim = Timers.Next(tim)) {
+ if (tim->HasFlags(tfActive)) {
int i = 0;
cTimer dummy;
dummy = *tim;
-
- do
- {
+
+ do {
mEvents.Add(new tEvent(&dummy));
-
- if (!dummy.IsSingleEvent()) // add 4 additional rep. timer
- {
+
+ if (!dummy.IsSingleEvent()) { // add 4 additional rep. timer
int j = 0;
- do
- {
+ do {
j++; // just to avoid a endless loop
dummy.Skip();
dummy.Matches(); // Refresh start- and end-time
} while (!dummy.DayMatches(dummy.StartTime()) && (j < 7));
}
-
+
i++;
} while (!dummy.IsSingleEvent() && i < 5);
}
}
-
+
Timers.DecBeingEdited();
mEvents.Sort();
}
@@ -236,23 +218,23 @@ void cText2SkinStatus::UpdateEvents(void)
cxType cText2SkinStatus::GetTokenData(const txToken &Token)
{
int event = 0;
-
+
switch (Token.Type) {
case tReplayMode:
return ReplayNames[mReplayMode];
-
+
case tFrontendSTR:
return GetFrontendSTR();
-
+
case tFrontendSNR:
return GetFrontendSNR();
-
+
case tFrontendHasLock:
return GetFrontendHasLock();
-
+
case tFrontendHasSignal:
return GetFrontendHasSignal();
-
+
case tCurrentEventsTitle3:
event++;
case tCurrentEventsTitle2:
@@ -260,9 +242,9 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token)
case tCurrentEventsTitle1:
UpdateEvents();
return mEvents.Count() > event
- ? (cxType)mEvents.Get(event)->title.c_str()
- : (cxType)false;
-
+ ? (cxType)mEvents.Get(event)->title.c_str()
+ : (cxType)false;
+
case tCurrentEventsStartDateTime3:
event++;
case tCurrentEventsStartDateTime2:
@@ -270,9 +252,9 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token)
case tCurrentEventsStartDateTime1:
UpdateEvents();
return mEvents.Count() > event
- ? (cxType)TimeType(mEvents.Get(event)->startTime, Token.Attrib.Text)
- : (cxType)false;
-
+ ? (cxType)TimeType(mEvents.Get(event)->startTime, Token.Attrib.Text)
+ : (cxType)false;
+
case tCurrentEventsStopDateTime3:
event++;
case tCurrentEventsStopDateTime2:
@@ -280,8 +262,8 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token)
case tCurrentEventsStopDateTime1:
UpdateEvents();
return mEvents.Count() > event
- ? (cxType)TimeType(mEvents.Get(event)->stopTime, Token.Attrib.Text)
- : (cxType)false;
+ ? (cxType)TimeType(mEvents.Get(event)->stopTime, Token.Attrib.Text)
+ : (cxType)false;
case tCurrentEventsChannelNumber3:
event++;
@@ -290,8 +272,8 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token)
case tCurrentEventsChannelNumber1:
UpdateEvents();
return mEvents.Count() > event
- ? (cxType)mEvents.Get(event)->channelNumber
- : (cxType)false;
+ ? (cxType)mEvents.Get(event)->channelNumber
+ : (cxType)false;
case tCurrentEventsChannelName3:
event++;
@@ -300,8 +282,8 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token)
case tCurrentEventsChannelName1:
UpdateEvents();
return mEvents.Count() > event
- ? (cxType)mEvents.Get(event)->channelName.c_str()
- : (cxType)false;
+ ? (cxType)mEvents.Get(event)->channelName.c_str()
+ : (cxType)false;
case tCurrentEventsIsRecording3:
event++;
@@ -310,28 +292,25 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token)
case tCurrentEventsIsRecording1:
UpdateEvents();
return mEvents.Count() > event
- ? (cxType)mEvents.Get(event)->isRecording
- : (cxType)false;
-
+ ? (cxType)mEvents.Get(event)->isRecording
+ : (cxType)false;
+
case tTimerConflicts:
#if VDRVERSNUM >= 10330
if (Text2SkinSetup.CheckTimerConflict) {
- if (mRender->mUpdate.timerConflict) {
+ if (mRender->mUpdate.timerConflict) {
Epgsearch_lastconflictinfo_v1_0 conflict;
mRender->mUpdate.timerConflict = false;
-
- if (cPluginManager::CallFirstService("Epgsearch-lastconflictinfo-v1.0", &conflict)) {
+
+ if (cPluginManager::CallFirstService("Epgsearch-lastconflictinfo-v1.0", &conflict))
mTimerConflicts = conflict.relevantConflicts;
- } else {
+ else
mTimerConflicts = 0;
- }
}
return mTimerConflicts;
} else
#endif
- {
return 0;
- }
#if VDRVERSNUM >= 10325
#if VDRVERSNUM >= 10338
@@ -360,32 +339,33 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token)
case tReplayDateTime:
return (cxType)false;
-
+
case tReplayShortText:
return (cxType)false;
case tReplayDescription:
return (cxType)false;
#endif
-
+
case tReplayLanguageCode:
- if (mReplay)
- {
+ if (mReplay) {
const cComponents *components = mReplay->Info()->Components();
- if (components)
- {
+ if (components) {
int index = Token.Attrib.Number;
-
+
// don't return language-code for the video-stream
- for (int i = 0; i < components->NumComponents(); i++)
- {
- const tComponent *c = components->Component(i);
- if (c->stream != 2) index++; // only audio-streams
+ for (int i = 0; i < components->NumComponents(); i++) {
+ const tComponent *c = components->Component(i);
+ if (c->stream != 2) // only audio-streams
+ index++;
{
std::string buffer(c->language);
- if (c->type == 1) buffer.append("MONO");
- if ((c->type == 2) || (c->type == 4)) buffer.append("DUAL");
- if (c->type == 5) buffer.append("DD");
+ if (c->type == 1)
+ buffer.append("MONO");
+ if ((c->type == 2) || (c->type == 4))
+ buffer.append("DUAL");
+ if (c->type == 5)
+ buffer.append("DD");
return (cxType)buffer.c_str();
}
}
@@ -393,40 +373,36 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token)
}
return false;
- case tReplayLanguageDescription:
- if (mReplay)
- {
+ case tReplayLanguageDescription:
+ if (mReplay) {
const cComponents *components = mReplay->Info()->Components();
- if (components)
- {
+ if (components) {
int index = Token.Attrib.Number;
-
+
// don't return language-code for the video-stream
- for (int i = 0; i < components->NumComponents(); i++)
- {
- const tComponent *c = components->Component(i);
- if (c->stream != 2) index++; // only audio-streams
- if (i == index) return (cxType)c->description;
+ for (int i = 0; i < components->NumComponents(); i++) {
+ const tComponent *c = components->Component(i);
+ if (c->stream != 2) // only audio-streams
+ index++;
+ if (i == index)
+ return (cxType)c->description;
}
}
}
return false;
- case tReplayVideoAR:
- if (mReplay)
- {
+ case tReplayVideoAR:
+ if (mReplay) {
const cComponents *components = mReplay->Info()->Components();
- if (components)
- {
- for (int i = 0; i < components->NumComponents(); i++)
- {
- const tComponent *c = components->Component(i);
- if (c->stream == 1)
- {
- switch (c->type)
- {
- case 1: return "4:3";
- case 3: return "16:9";
+ if (components) {
+ for (int i = 0; i < components->NumComponents(); i++) {
+ const tComponent *c = components->Component(i);
+ if (c->stream == 1) {
+ switch (c->type) {
+ case 1:
+ return "4:3";
+ case 3:
+ return "16:9";
}
}
}
diff --git a/status.h b/status.h
index 82afc47..515214c 100644
--- a/status.h
+++ b/status.h
@@ -8,7 +8,6 @@
#include "common.h"
#include <vdr/status.h>
-
class cText2SkinRender;
class cText2SkinStatus: public cStatus {
@@ -28,8 +27,7 @@ public:
typedef std::string tRecordingInfo;
typedef std::vector<tRecordingInfo> tRecordings;
- struct tEvent : public cListObject
- {
+ struct tEvent : public cListObject {
time_t startTime;
time_t stopTime;
int channelNumber;
@@ -37,7 +35,7 @@ public:
int priority;
bool isRecording;
std::string title;
-
+
tEvent(cTimer *timer) :
startTime(timer->StartTime()),
stopTime(timer->StopTime()),
@@ -46,21 +44,21 @@ public:
priority(timer->Priority()),
isRecording(timer->Recording()),
title(timer->File()) {}
-
- virtual int Compare(const cListObject &listObj) const
- {
+
+ virtual int Compare(const cListObject &listObj) const {
tEvent *e = (tEvent *)&listObj;
int r = startTime - e->startTime;
- if (r == 0) r = e->priority - priority;
+ if (r == 0)
+ r = e->priority - priority;
return r;
}
};
-
+
typedef std::vector<tEvent> tEvents;
-
+
private:
void UpdateEvents(void);
-
+
cText2SkinRender *mRender;
eReplayMode mReplayMode;
bool mReplayIsLoop;
@@ -75,17 +73,15 @@ private:
int mTimerConflicts;
protected:
-#if VDRVERSNUM >= 10338
- virtual void Replaying(const cControl *Control, const char *Name, const char *FileName, bool On);
- virtual void Recording(const cDevice *Device, const char *Name, const char *FileName, bool On);
-#else
- virtual void Replaying(const cControl *Control, const char *Name);
- virtual void Recording(const cDevice *Device, const char *Name);
-#endif
+ virtual void Replaying(const cControl *Control, const char *Name,
+ const char *FileName, bool On);
+ virtual void Recording(const cDevice *Device, const char *Name,
+ const char *FileName, bool On);
virtual void OsdClear(void);
+
virtual void OsdCurrentItem(const char *Text);
virtual void OsdItem(const char *Text, int Index);
-
+
public:
cText2SkinStatus(void);
diff --git a/text2skin.c b/text2skin.c
index 04b3d72..bd53f17 100644
--- a/text2skin.c
+++ b/text2skin.c
@@ -14,9 +14,9 @@
#include "loader.h"
#include "status.h"
-const char *cText2SkinPlugin::VERSION = "1.1-cvs_ext-0.10";
+const char *cText2SkinPlugin::VERSION = "1.2";
const char *cText2SkinPlugin::SKINVERSION = "1.1";
-const char *cText2SkinPlugin::DESCRIPTION = "Loader for text-based skins";
+const char *cText2SkinPlugin::DESCRIPTION = trNOOP("Loader for text-based skins");
cText2SkinPlugin::cText2SkinPlugin(void) {
}
@@ -33,7 +33,7 @@ const char **cText2SkinPlugin::SVDRPHelpPages(void)
" current version should be loaded).",
NULL
};
- return HelpPages;
+ return HelpPages;
}
cString cText2SkinPlugin::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode)
@@ -48,8 +48,12 @@ cString cText2SkinPlugin::SVDRPCommand(const char *Command, const char *Option,
#endif
bool cText2SkinPlugin::Start(void) {
+#if VDRVERSNUM < 10507
RegisterI18n(Phrases);
Text2SkinStatus.SetLanguage(Setup.OSDLanguage);
+#else
+ Text2SkinStatus.SetLanguage(I18nCurrentLanguage());
+#endif
cText2SkinLoader::Start();
return true;
}
diff --git a/xml/object.c b/xml/object.c
index eae47e5..ec69fe7 100644
--- a/xml/object.c
+++ b/xml/object.c
@@ -16,7 +16,7 @@ cxObject::cxObject(cxDisplay *Parent):
mType((eType)__COUNT_OBJECT__),
mPos1(0, 0),
mPos2(-1, -1),
- mVirtSize(-1,-1),
+ mVirtSize(-1, -1),
mAlpha(255),
mColors(0),
mArc(0),
@@ -135,7 +135,7 @@ bool cxObject::ParseFontFace(const std::string &Text)
void cxObject::SetListIndex(uint Index, int Tab)
{
- Tab = Tab>=0 ? Tab : -1;
+ Tab = (Tab >= 0 ? Tab : -1);
mListIndex = 1 + Index * cSkinDisplayMenu::MaxTabs + Tab;
mText.SetListIndex(Index, Tab);
mPath.SetListIndex(Index, Tab);
@@ -155,46 +155,45 @@ const cFont *cxObject::Font(void) const
if ((font = cText2SkinFont::Load(SkinPath() + "/" + mSkin->Name(), mFontFace, mFontSize,
mFontWidth)) != NULL)
return font;
-
- if ((font = cText2SkinFont::Load(SkinPath() + "/fonts", mFontFace, mFontSize, mFontWidth))
- != NULL)
+
+ if ((font = cText2SkinFont::Load(SkinPath() + "/fonts", mFontFace, mFontSize, mFontWidth)) != NULL)
return font;
-
+
return cFont::GetFont(fontOsd);
}
-txPoint cxObject::Pos(const txPoint &BaseOffset, const txSize &BaseSize, const txSize &VirtSize) const
+txPoint cxObject::Pos(const txPoint &BaseOffset, const txSize &BaseSize, const txSize &VirtSize) const
{
txPoint bOffset = BaseOffset.x < 0 ? mSkin->BaseOffset() : BaseOffset;
txSize bSize = BaseSize.w < 0 ? mSkin->BaseSize() : BaseSize;
- double scale_x = VirtSize.w>0 ? (double)BaseSize.w / VirtSize.w : 1.0,
- scale_y = VirtSize.h>0 ? (double)BaseSize.h / VirtSize.h : 1.0;
+ double scale_x = VirtSize.w > 0 ? (double)BaseSize.w / VirtSize.w : 1.0,
+ scale_y = VirtSize.h > 0 ? (double)BaseSize.h / VirtSize.h : 1.0;
int x1 = mPos1.x < 0 ? (int)((mPos1.x + 1) * scale_x - 1) : (int)(mPos1.x * scale_x);
int y1 = mPos1.y < 0 ? (int)((mPos1.y + 1) * scale_x - 1) : (int)(mPos1.y * scale_y);
- return txPoint(bOffset.x + (x1 < 0 ? bSize.w + x1 : x1),
- bOffset.y + (y1 < 0 ? bSize.h + y1 : y1));
+ return txPoint(bOffset.x + (x1 < 0 ? bSize.w + x1 : x1),
+ bOffset.y + (y1 < 0 ? bSize.h + y1 : y1));
}
-txSize cxObject::Size(const txPoint &BaseOffset, const txSize &BaseSize, const txSize &VirtSize) const
+txSize cxObject::Size(const txPoint &BaseOffset, const txSize &BaseSize, const txSize &VirtSize) const
{
//txPoint bOffset = BaseOffset.x < 0 ? mSkin->BaseOffset() : BaseOffset;
txSize bSize = BaseSize.w < 0 ? mSkin->BaseSize() : BaseSize;
- double scale_x = VirtSize.w>0 ? (double)BaseSize.w / VirtSize.w : 1.0,
- scale_y = VirtSize.h>0 ? (double)BaseSize.h / VirtSize.h : 1.0;
+ double scale_x = VirtSize.w > 0 ? (double)BaseSize.w / VirtSize.w : 1.0,
+ scale_y = VirtSize.h > 0 ? (double)BaseSize.h / VirtSize.h : 1.0;
int x1 = mPos1.x < 0 ? (int)((mPos1.x + 1) * scale_x - 1) : (int)(mPos1.x * scale_x);
int y1 = mPos1.y < 0 ? (int)((mPos1.y + 1) * scale_x - 1) : (int)(mPos1.y * scale_y);
int x2 = mPos2.x < 0 ? (int)((mPos2.x + 1) * scale_x - 1) : (int)(mPos2.x * scale_x);
int y2 = mPos2.y < 0 ? (int)((mPos2.y + 1) * scale_x - 1) : (int)(mPos2.y * scale_y);
- txPoint p1(x1 < 0 ? bSize.w + x1 : x1,
- y1 < 0 ? bSize.h + y1 : y1);
- txPoint p2(x2 < 0 ? bSize.w + x2 : x2,
- y2 < 0 ? bSize.h + y2 : y2);
+ txPoint p1(x1 < 0 ? bSize.w + x1 : x1,
+ y1 < 0 ? bSize.h + y1 : y1);
+ txPoint p2(x2 < 0 ? bSize.w + x2 : x2,
+ y2 < 0 ? bSize.h + y2 : y2);
return txSize(p2.x - p1.x + 1, p2.y - p1.y + 1);
}
@@ -211,7 +210,7 @@ const tColor *cxObject::Bg(void) const
return cText2SkinRender::ItemColor(mBg, Bg) ? &Bg : NULL;
}
-const tColor *cxObject::Bl(void) const
+const tColor *cxObject::Bl(void) const
{
static tColor Bl;
return cText2SkinRender::ItemColor(mBl, Bl) ? &Bl : NULL;
@@ -252,16 +251,10 @@ cxObjects::~cxObjects()
}
-
-
-
-
-
-
///////////////////////////////////////////////////////////////////////////////
// ---------- class cxRefresh ---------------------------------------------- //
-cxRefresh::cxRefresh( cxObject *Object ):
+cxRefresh::cxRefresh(cxObject *Object):
mRefreshType(0xFF),
mText(NULL),
mChanged(NULL),
@@ -282,15 +275,15 @@ bool cxRefresh::Dirty(uint dirty, uint &updatein, bool force, uint now)
uint nexttime = mObject->State().nexttime;
bool to = force || mForce ||
- mObject->Type() == cxObject::block || mObject->Type() == cxObject::list;
+ mObject->Type() == cxObject::block || mObject->Type() == cxObject::list;
bool changed = force || mForce;
- if( now>0 && nexttime>0 ) {
+ if (now > 0 && nexttime > 0) {
// timeout was set
- if( now >= nexttime ) {
+ if (now >= nexttime)
// timeout has expired
to = true;
- } else {
+ else {
// time left -> set new update interval
uint nextin = nexttime - now;
if (updatein == 0 || nextin < updatein)
@@ -298,72 +291,69 @@ bool cxRefresh::Dirty(uint dirty, uint &updatein, bool force, uint now)
}
}
- // Objaect has changed since last redraw
- if( mChanged != NULL ) {
+ // Object has changed since last redraw
+ if (mChanged != NULL) {
mEval = mChanged->Evaluate();
- if( mEval != mLastEval ) {
+ if (mEval != mLastEval)
changed = true;
- }
}
// refresh
- if( (mRefreshType & dirty & ~(1<<timeout) & ~(1<<update)) ) {
- if( changed ) mLastEval = mEval;
+ if ((mRefreshType & dirty & ~(1<<timeout) & ~(1<<update))) {
+ if (changed)
+ mLastEval = mEval;
return true;
}
// timeout
- if( (mRefreshType & dirty & (1<<timeout)) && to ) {
- if( changed ) mLastEval = mEval;
+ if ((mRefreshType & dirty & (1<<timeout)) && to) {
+ if (changed)
+ mLastEval = mEval;
return true;
}
-
+
// update
- if( (mRefreshType & dirty & (1<<update)) && changed ) {
- mLastEval = mEval;
+ if ((mRefreshType & dirty & (1<<update)) && changed) {
+ mLastEval = mEval;
return true;
}
- return false;
+ return false;
}
-
-
-
-
bool cxRefresh::Parse(const std::string &Text)
{
- uint refresh=0;
- bool force=false, full=false;
+ uint refresh = 0;
+ bool force = false, full = false;
- if( Text.find("all") != std::string::npos )
+ if (Text.find("all") != std::string::npos)
refresh |= (1<<all);
- if( Text.find("timeout") != std::string::npos )
+ if (Text.find("timeout") != std::string::npos)
refresh |= (1<<timeout);
- if( Text.find("update") != std::string::npos )
+ if (Text.find("update") != std::string::npos)
refresh |= (1<<update);
- //if( Text.find("message") =! std::string::npos )
+ //if (Text.find("message") != std::string::npos)
// refresh |= (1<<list);
- if( Text.find("list") != std::string::npos )
+ if (Text.find("list") != std::string::npos)
refresh |= (1<<list);
- if( Text.find("scroll") != std::string::npos )
+ if (Text.find("scroll") != std::string::npos)
refresh |= (1<<scroll);
- if( Text.find("allways") != std::string::npos )
+ if (Text.find("allways") != std::string::npos)
refresh |= 0xFF;
- if( Text.find("full") != std::string::npos )
+ if (Text.find("full") != std::string::npos)
full = true;
- if( Text.find("force") != std::string::npos )
+ if (Text.find("force") != std::string::npos)
force = true;
- if( refresh == 0)
+ if (refresh == 0)
return false;
mForce = force;
@@ -375,13 +365,13 @@ bool cxRefresh::Parse(const std::string &Text)
bool cxRefresh::ParseChanged(const std::string &Text)
{
- if( mObject == NULL )
+ if (mObject == NULL)
return false;
- if(mText == NULL)
+ if (mText == NULL)
mText = new cxString(mObject, false);
- if ( mText->Parse(Text) ) {
+ if (mText->Parse(Text)) {
mChanged = mText;
return true;
}
diff --git a/xml/object.h b/xml/object.h
index aad82a5..18600fe 100644
--- a/xml/object.h
+++ b/xml/object.h
@@ -33,11 +33,6 @@ struct txWindow {
pos1(_x1, _y2), pos2(_x2, _y2), bpp(_bpp) {}
};
-
-
-
-
-
// state information for marquee, blink, scroll
struct txState {
bool scrolling;
@@ -48,14 +43,6 @@ struct txState {
txState(void): scrolling(false), offset(0), direction(1), nexttime(0) {}
};
-
-
-
-
-
-
-
-
class cxObject;
class cxRefresh {
@@ -63,39 +50,33 @@ class cxRefresh {
public:
enum eRefreshType {
- all, // complete redraw of the screen
- timeout, // redraw due to a timeout
- //message, // a message was set or removed
- update, // update of the osd elements
- scroll, // a scroll event
- list, // list items or the current item have changed
+ all, // complete redraw of the screen
+ timeout, // redraw due to a timeout
+ //message, // a message was set or removed
+ update, // update of the osd elements
+ scroll, // a scroll event
+ list, // list items or the current item have changed
};
cxRefresh(cxObject *Object);
~cxRefresh();
- bool Dirty(uint dirty, uint &updatein, bool force=false, uint now=0 );
- bool Full(void) const { return mFull; }
+ bool Dirty(uint dirty, uint &updatein, bool force = false, uint now = 0);
+ bool Full(void) const { return mFull; }
uint Type(void) const { return mRefreshType; }
bool Parse(const std::string &Text);
bool ParseChanged(const std::string &Text);
- cxRefresh &operator=(const cxRefresh &b);
+ cxRefresh &operator=(const cxRefresh &b);
private:
uint mRefreshType;
cxType mLastEval;
- cxType mEval;
+ cxType mEval;
cxString *mText;
cxString *mChanged;
cxObject *mObject;
bool mForce, mFull;
};
-
-
-
-
-
-
class cxObjects;
class cxObject {
@@ -124,7 +105,7 @@ public:
item,
#define __COUNT_OBJECT__ (item + 1)
};
-
+
private:
cxDisplay *mDisplay;
cxSkin *mSkin;
@@ -159,8 +140,7 @@ private:
// state information for marquee, blink, scroll
uint mListIndex;
typedef std::map<uint,txState> tStates;
- tStates mStates;
-
+ tStates mStates;
public:
cxObject(cxDisplay *parent);
@@ -191,10 +171,10 @@ public:
txState &State(void) { return mStates[mListIndex]; }
const std::string &TypeName(void) const;
- txPoint Pos(const txPoint &BaseOffset=txPoint(-1,-1), const txSize &BaseSize=txSize(-1,-1),
- const txSize &VirtSize=txSize(-1,-1) ) const;
- txSize Size(const txPoint &BaseOffset=txPoint(-1,-1), const txSize &BaseSize=txSize(-1,-1),
- const txSize &VirtSize=txSize(-1,-1)) const;
+ txPoint Pos(const txPoint &BaseOffset = txPoint(-1, -1), const txSize &BaseSize = txSize(-1, -1),
+ const txSize &VirtSize = txSize(-1, -1)) const;
+ txSize Size(const txPoint &BaseOffset = txPoint(-1, -1), const txSize &BaseSize = txSize(-1, -1),
+ const txSize &VirtSize = txSize(-1, -1)) const;
const cFont *Font(void) const;
const tColor *Fg(void) const;
const tColor *Bg(void) const;
diff --git a/xml/parser.c b/xml/parser.c
index 158724a..fe93602 100644
--- a/xml/parser.c
+++ b/xml/parser.c
@@ -103,7 +103,7 @@ bool xStartElem(const std::string &name, std::map<std::string,std::string> &attr
display = new cxDisplay(skin);
ATTRIB_MAN_FUNC ("id", display->ParseType);
ATTRIB_OPT_FUNC ("refresh", display->mRefreshDefault.Parse);
- }
+ }
else
TAG_ERR_REMAIN("skin");
}
@@ -130,7 +130,7 @@ bool xStartElem(const std::string &name, std::map<std::string,std::string> &attr
else {
object = new cxObject(display);
if (object->ParseType(name)) {
- if(parents.size() > 0)
+ if (parents.size() > 0)
object->mRefresh = parents.back()->mRefresh;
else
object->mRefresh = display->mRefreshDefault;
@@ -197,9 +197,11 @@ bool xStartElem(const std::string &name, std::map<std::string,std::string> &attr
else if (name == "item") {
ATTRIB_MAN_NUMBER("height", object->mPos2.y);
--object->mPos2.y;
- } else if (name == "block" || name == "list") {
- ATTRIB_OPT_NUMBER("w", object->mVirtSize.w);
- ATTRIB_OPT_NUMBER("h", object->mVirtSize.h);
+ }
+ else if (name == "block"
+ || name == "list") {
+ ATTRIB_OPT_NUMBER("w", object->mVirtSize.w);
+ ATTRIB_OPT_NUMBER("h", object->mVirtSize.h);
}
} else
TAG_ERR_REMAIN(context[context.size() - 1].c_str());
diff --git a/xml/skin.c b/xml/skin.c
index 5578e1e..2935dee 100644
--- a/xml/skin.c
+++ b/xml/skin.c
@@ -18,31 +18,28 @@ cxVersion::cxVersion(int ma, int min):
bool cxVersion::Parse(const std::string &Text)
{
int dot = Text.find(".");
- std::string ma(Text, 0, dot), min(Text, dot+1);
+ std::string ma(Text, 0, dot), min(Text, dot + 1);
char *e = NULL;
- const char *t = NULL;
- long l=0;
+ const char *t = NULL;
+ long l = 0;
t = ma.c_str();
l = strtol(t, &e, 10);
- if (e ==t || *e != '\0') {
+ if (e == t || *e != '\0')
return false;
- } else {
+ else
mMajor = l;
- }
t = min.c_str();
l = strtol(t, &e, 10);
- if (e ==t || *e != '\0') {
+ if (e == t || *e != '\0')
return false;
- } else {
+ else
mMinor = l;
- }
return true;
}
-
cxSkin::cxSkin(const std::string &Name, cText2SkinI18n *I18n, cText2SkinTheme *Theme):
mName(Name),
mI18n(I18n),
diff --git a/xml/skin.h b/xml/skin.h
index 69d96e6..49656ea 100644
--- a/xml/skin.h
+++ b/xml/skin.h
@@ -15,37 +15,38 @@
class cText2SkinI18n;
class cText2SkinTheme;
-
class cxVersion {
public:
- cxVersion( int ma=0, int min=0 );
+ cxVersion(int ma = 0, int min = 0);
bool Parse(const std::string &Text);
int Major(void) const { return mMajor; }
int Minor(void) const { return mMinor; }
- bool Require( int ma, int min ) const {
+ bool Require(int ma, int min) const {
return mMajor > ma ? true : (mMajor == ma ? mMinor >= min : false);
}
- bool Limit( int ma, int min ) const {
+ bool Limit(int ma, int min) const {
return mMajor < ma ? true : (mMajor == ma ? mMinor <= min : false);
}
- bool operator==( const cxVersion &v ) const {
+ bool operator==(const cxVersion &v) const {
return mMajor == v.mMajor && mMinor == v.mMinor;
}
- bool operator>=( const cxVersion &v ) const {
- return Require( v.mMajor , v.mMinor);
+ bool operator>=(const cxVersion &v) const {
+ return Require(v.mMajor, v.mMinor);
}
- bool operator>=( const char *c ) const {
+ bool operator>=(const char *c) const {
cxVersion v;
- if( !v.Parse(c) ) return false;
- return Require( v.mMajor , v.mMinor);
+ if (!v.Parse(c))
+ return false;
+ return Require(v.mMajor, v.mMinor);
}
- bool operator<=( const cxVersion &v ) const {
- return Limit( v.mMajor , v.mMinor );
+ bool operator<=(const cxVersion &v) const {
+ return Limit(v.mMajor, v.mMinor);
}
- bool operator<=( const char *c ) const {
+ bool operator<=(const char *c) const {
cxVersion v;
- if( !v.Parse(c) ) return false;
- return Limit( v.mMajor , v.mMinor);
+ if (!v.Parse(c))
+ return false;
+ return Limit(v.mMajor, v.mMinor);
}
private:
@@ -74,7 +75,7 @@ private:
std::string mName;
std::string mTitle;
cxVersion mVersion;
-
+
cxDisplays mDisplays;
cText2SkinI18n *mI18n; // TODO: should move here completely
diff --git a/xml/string.c b/xml/string.c
index 7568b37..3f671bd 100644
--- a/xml/string.c
+++ b/xml/string.c
@@ -11,7 +11,8 @@ static const char *Tokens[__COUNT_TOKEN__] = {
// Channel Display
"ChannelNumber", "ChannelName", "ChannelShortName", "ChannelBouquet", "ChannelPortal",
"ChannelSource", "ChannelID", "PresentStartDateTime", "PresentVPSDateTime",
- "CurrentEventsTitle1", "CurrentEventsStartDateTime1", "CurrentEventsStopDateTime1", "CurrentEventsChannelNumber1", "CurrentEventsChannelName1", "CurrentEventsIsRecording1", "CurrentEventsTitle2", "CurrentEventsStartDateTime2", "CurrentEventsStopDateTime2", "CurrentEventsChannelNumber2", "CurrentEventsChannelName2", "CurrentEventsIsRecording2",
+ "CurrentEventsTitle1", "CurrentEventsStartDateTime1", "CurrentEventsStopDateTime1", "CurrentEventsChannelNumber1", "CurrentEventsChannelName1", "CurrentEventsIsRecording1",
+ "CurrentEventsTitle2", "CurrentEventsStartDateTime2", "CurrentEventsStopDateTime2", "CurrentEventsChannelNumber2", "CurrentEventsChannelName2", "CurrentEventsIsRecording2",
"CurrentEventsTitle3", "CurrentEventsStartDateTime3", "CurrentEventsStopDateTime3", "CurrentEventsChannelNumber3", "CurrentEventsChannelName3", "CurrentEventsIsRecording3",
"TimerConflicts",
"PresentEndDateTime", "PresentDuration", "PresentProgress", "PresentRemaining",
diff --git a/xml/string.h b/xml/string.h
index 55adbcf..a459253 100644
--- a/xml/string.h
+++ b/xml/string.h
@@ -111,7 +111,7 @@ enum exToken {
tReplayName,
tReplayDateTime,
tReplayShortText,
- tReplayDescription,
+ tReplayDescription,
tReplayLanguageCode,
tReplayLanguageDescription,
tReplayVideoAR,
@@ -171,7 +171,7 @@ enum exToken {
tButtonBlue,
tCanScrollUp,
tCanScrollDown,
-
+
#define __COUNT_TOKEN__ (tCanScrollDown + 1)
};
diff --git a/xml/type.h b/xml/type.h
index e37d99d..7892cbd 100644
--- a/xml/type.h
+++ b/xml/type.h
@@ -5,6 +5,7 @@
#ifndef VDR_TEXT2SKIN_XML_TYPE_H
#define VDR_TEXT2SKIN_XML_TYPE_H
+#include <cstdlib>
#include <string>
#include <vdr/tools.h>
#include <stdio.h>
diff --git a/xml/xml.c b/xml/xml.c
index 81c6655..0c2a074 100644
--- a/xml/xml.c
+++ b/xml/xml.c
@@ -35,7 +35,7 @@ XML::XML(const string &file) {
ifstream f(file.c_str(), ios::in|ios::binary|ios::ate);
size = f.tellg();
f.seekg(0, ios::beg);
- buffer = new char [size+1];
+ buffer = new char [size];
f.read(buffer, size);
f.close();
data.assign(buffer, size);