diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2007-08-12 18:00:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2007-08-12 18:00:00 +0200 |
commit | 4c65b525dc1e3c62336b223d200a46fb30dc7e52 (patch) | |
tree | 4a6b2381dd6a50792d90b6a3bd3635260ba0737b /PLUGINS.html | |
parent | 8849308cf9ad1e85ed1790aa832806ce7f74e565 (diff) | |
download | vdr-patch-lnbsharing-4c65b525dc1e3c62336b223d200a46fb30dc7e52.tar.gz vdr-patch-lnbsharing-4c65b525dc1e3c62336b223d200a46fb30dc7e52.tar.bz2 |
Version 1.5.7vdr-1.5.7
- All logging now goes to LOG_ERR, because some systems split error, info and
debug messages into separate files, which repeatedly caused extra efforts to
find out when incomplete log excerpts were attached to problem reports in
the past.
- Updated the Estonian OSD texts (thanks to Arthur Konovalov).
- Fixed a problem with characters >0x7F in the modified version of skipspace()
(thanks to Marco Schlüßler).
- Fixed a bug I introduced when simplifying the original patch for detecting
Premiere NVOD channel links (crash reported by Malte Schröder).
- Internationalization is now done with 'gettext' (following a suggestion by
Lucian Muresan). Plugin authors may want to use the Perl script
'i18n-to-gettext.pl' to convert their internationalized texts to the gettext
format (see the instructions inside that script file). The function
cPlugin::RegisterI18n() is still present for compatibility, but doesn't
have any more functionality. So plugins that don't convert their texts to
the gettext format will only present English texts.
See PLUGINS.html, section "Internationalization", for instructions on how
to make strings in arrays translatable.
See README.i18n for information on how to create new or maintain existing
translations.
- The three letter language codes and their aliases are stored in i18n.c, and
each translation file only contains one of them to link that language name
to the code.
- The 'newplugin' script has been extended to generate the Makefile section
for i18n support.
- The parameter OSDLanguage in 'setup.conf' is now a string and holds the locale
code of the selected OSD language (e.g. en_US). If Setup.OSDLanguage is not
set to a particular locale that is found in VDR's locale directory, the
locale as defined in the system environment is used by default.
- The list of tracks given in cStatus::SetAudioTrack() is now NULL terminated,
so that plugins can actually use all the strings in the list, not just the
one pointed to by Index (thanks to Alexander Rieger).
- Fixed handling kLeft in the calls to cStatus::MsgOsdTextItem() (thanks to
Alexander Rieger).
- Added the "...or (at your option) any later version" phrase to the license
information of all plugins, and also the 'newplugin' script (suggested by
Ville Skyttä). Plugin authors may want to consider doing the same.
- Fixed the link to the GPL2 at http://www.gnu.org in vdr.c (thanks to Ville
Skyttä).
- cBitmap::SetXpm() now checks whether the given Xpm pointer is not NULL, to
avoid a crash with files that only contain "/* XPM */" (suggested by Andreas
Mair).
- Added a debug error message to cReceiver::~cReceiver() in case it is still
attached to a device (thanks to Reinhard Nissl).
Diffstat (limited to 'PLUGINS.html')
-rw-r--r-- | PLUGINS.html | 94 |
1 files changed, 32 insertions, 62 deletions
diff --git a/PLUGINS.html b/PLUGINS.html index dc725a5..d18bc42 100644 --- a/PLUGINS.html +++ b/PLUGINS.html @@ -14,15 +14,18 @@ Copyright © 2006 Klaus Schmidinger<br> <a href="http://www.cadsoft.de/vdr">www.cadsoft.de/vdr</a> </center> <p> -<!--X1.5.0--><table width=100%><tr><td bgcolor=#00AA00> </td><td width=100%> +<!--X1.5.0--><table width=100%><tr><td bgcolor=#0000AA> </td><td width=100%> Important modifications introduced in version 1.5.0 are marked like this. <!--X1.5.0--></td></tr></table> -<!--X1.5.1--><table width=100%><tr><td bgcolor=#AA0000> </td><td width=100%> +<!--X1.5.1--><table width=100%><tr><td bgcolor=#00AA00> </td><td width=100%> Important modifications introduced in version 1.5.1 are marked like this. <!--X1.5.1--></td></tr></table> -<!--X1.5.3--><table width=100%><tr><td bgcolor=#FF0000> </td><td width=100%> +<!--X1.5.3--><table width=100%><tr><td bgcolor=#AA0000> </td><td width=100%> Important modifications introduced in version 1.5.3 are marked like this. <!--X1.5.3--></td></tr></table> +<!--X1.5.7--><table width=100%><tr><td bgcolor=#FF0000> </td><td width=100%> +Important modifications introduced in version 1.5.7 are marked like this. +<!--X1.5.7--></td></tr></table> <p> VDR provides an easy to use plugin interface that allows additional functionality to be added to the program by implementing a dynamically loadable library file. @@ -61,7 +64,7 @@ structures and allows it to hook itself into specific areas to perform special a <li><a href="#Housekeeping">Housekeeping</a> <li><a href="#Main thread hook">Main thread hook</a> <li><a href="#Activity">Activity</a> -<!--X1.5.1--><table width=100%><tr><td bgcolor=#AA0000> </td><td width=100%> +<!--X1.5.1--><table width=100%><tr><td bgcolor=#00AA00> </td><td width=100%> <li><a href="#Wakeup">Wakeup</a> <!--X1.5.1--></td></tr></table> <li><a href="#Setup parameters">Setup parameters</a> @@ -85,7 +88,7 @@ structures and allows it to hook itself into specific areas to perform special a <li><a href="#Devices">Devices</a> <li><a href="#Audio">Audio</a> <li><a href="#Remote Control">Remote Control</a> -<!--X1.5.0--><table width=100%><tr><td bgcolor=#00AA00> </td><td width=100%> +<!--X1.5.0--><table width=100%><tr><td bgcolor=#0000AA> </td><td width=100%> <li><a href="#Conditional Access">Conditional Access</a> <!--X1.5.0--></td></tr></table> </ul> @@ -684,7 +687,7 @@ be queried, and further prompts may show up. If all prompts have been confirmed, the shutdown will take place. As soon as one prompt is not confirmed, no further plugins will be queried and no shutdown will be done. -<!--X1.5.1--><table width=100%><tr><td bgcolor=#AA0000> </td><td width=100%> +<!--X1.5.1--><table width=100%><tr><td bgcolor=#00AA00> </td><td width=100%> <a name="Wakeup"><hr><h2>Wakeup</h2> <center><i><b>Wake me up before you go-go</b></i></center><p> @@ -909,72 +912,38 @@ const char *MyConfigDir = cPlugin::ConfigDirectory(); <center><i><b>Welcome to Babylon!</b></i></center><p> -If a plugin displays texts to the user, it should implement internationalized -versions of these texts and call the function +<!--X1.5.7--><table width=100%><tr><td bgcolor=#FF0000> </td><td width=100%> +If a plugin displays texts to the user, it should prepare for internationalization +of these texts. All that is necessary for this is to mark every text that is +presented to the user as translatable, as in <p><table><tr><td bgcolor=#F0F0F0><pre> -void RegisterI18n(const tI18nPhrase * const Phrases); +const char *s = tr("Hello world!"); </pre></td></tr></table><p> -to register them with VDR's internationalization mechanism. +The text given here must be the English version, and the returned pointer is either +a translated version (if available) or the original string. +Texts are first searched for in the domain registered for this plugin (if any) +and then in the global VDR texts. So a plugin can make use of texts defined by the +core VDR code. <p> -The call to this function must be done in the <a href="#Getting started"><tt>Initialize()</tt></a> -or <a href="#Getting started"><tt>Start()</tt></a> function of the plugin: +Sometimes texts are stored in an array, in which case they need to be marked +differently, using the trNOOP() macro. The actual translation is then done +when such a text is used, as in <p><table><tr><td bgcolor=#F0F0F0><pre> -const tI18nPhrase Phrases[] = { - { "Hello world!", - "Hallo Welt!", - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - }, - { NULL } +const char *Texts = { + trNOOP("First text"), + trNOOP("Second text"), + trNOOP("Third one") }; -void cPluginHello::Start(void) -{ - RegisterI18n(Phrases); -} -</pre></td></tr></table><p> - -Each entry of type <tt>tI18nPhrase</tt> must have exactly as many members as defined -by the constant <tt>I18nNumLanguages</tt> in the file <tt>VDR/i18n.h</tt>, and the -sequence of the various languages must be the same as defined in <tt>VDR/i18n.c</tt>.<br> -<b>It is very important that the array is terminated with a <tt>{ NULL }</tt> -entry!</b>. -<p> -Usually you won't be able to fill in all the different translations by yourself, so -you may want to contact the maintainers of these languages (listed in the file -<tt>VDR/i18n.c</tt>) and ask them to provide the additional translations. -<p> -The actual runtime selection of the texts corresponding to the selected language -is done by wrapping each internationalized text with the <tt>tr()</tt> macro: - -<p><table><tr><td bgcolor=#F0F0F0><pre> -const char *s = tr("Hello world!"); +for (int i = 0; i < 3; i++) + MyFunc(tr(Texts[i])); </pre></td></tr></table><p> -The text given here must be the first one defined in the related <i>Phrases</i> -entry (which is the English version), and the returned pointer is either a translated -version (if available) or the original string. In the latter case a message will be -written to the log file, indicating that a translation is missing. -Texts are first searched for in the <i>Phrases</i> registered for this plugin (if any) -and then in the global VDR texts. So a plugin can make use of texts defined by the -core VDR code. <p> -<!--X1.5.3--><table width=100%><tr><td bgcolor=#FF0000> </td><td width=100%> +<!--X1.5.3--><table width=100%><tr><td bgcolor=#AA0000> </td><td width=100%> The system VDR is running on may use a character encoding where a single character (or <i>symbol</i>) consists of more than one byte (UTF-8, as opposed to, for instance, ISO8859-1, where every character is represented by a single byte in memory). @@ -986,6 +955,7 @@ and are defined in <tt>VDR/tools.h</tt>. Most of the time a plugin doesn't need to care about this, but when it comes to handling individual characters these functions may come in handy. <!--X1.5.3--></td></tr></table> +<!--X1.5.7--></td></tr></table> <a name="Custom services"><hr><h2>Custom services</h2> @@ -1635,7 +1605,7 @@ with the full required resolution. Only if this fails shall it use alternate areas. Drawing areas are always rectangular and may not overlap (but do not need to be adjacent). <p> -<!--X1.5.3--><table width=100%><tr><td bgcolor=#FF0000> </td><td width=100%> +<!--X1.5.3--><table width=100%><tr><td bgcolor=#AA0000> </td><td width=100%> Special consideration may have to be given to color usage if the OSD provides 8bpp (256 colors). In that case, fonts may be drawn using <i>anti-aliasing</i>, which requires several blended color values between the foreground and background @@ -2118,7 +2088,7 @@ Put(uint64 Code, bool Repeat = false, bool Release = false); The other parameters have the same meaning as in the first version of this function. -<!--X1.5.0--><table width=100%><tr><td bgcolor=#00AA00> </td><td width=100%> +<!--X1.5.0--><table width=100%><tr><td bgcolor=#0000AA> </td><td width=100%> <a name="Conditional Access"><hr><h2>Conditional Access</h2> <center><i><b>Members only!</b></i></center><p> |