summaryrefslogtreecommitdiff
path: root/contrib/list_items.pl
diff options
context:
space:
mode:
authorlordjaxom <lordjaxom>2004-06-16 18:50:57 +0000
committerlordjaxom <lordjaxom>2004-06-16 18:50:57 +0000
commit1d3cd38e88ae97dd6906f9818d52b9ef07bf057d (patch)
tree925b1ff6a76c29178ba6fd4bf1c5516848ab9ab3 /contrib/list_items.pl
parent3d738f9c8a5d48bb22b3330c036b6887b0f9d6c1 (diff)
downloadvdr-plugin-text2skin-0.0.5.tar.gz
vdr-plugin-text2skin-0.0.5.tar.bz2
- fixed disappearing Scrolltext when Message was displayedv0.0.5
- fixed display-items "MenuScrollUp" and "MenuScrollDown" which didn't display any other items than "Symbol" - fixed the above for all replay- and channel-symbols (for all display-items that can be symbols there must be path, altpath or both to tell the plugin if that item is to be drawn if the symbol is on, off or in both cases) - fixed various memory leaks and missing destructions (valgrind rox) - fixed the image loaders to respect the alpha value and palette properly (this hopefully also fixes the phenomenon that images "get lost" after some time) - added display-item "Scrollbar" - SKINS and SKINS.de are now generated during the make
Diffstat (limited to 'contrib/list_items.pl')
-rwxr-xr-xcontrib/list_items.pl173
1 files changed, 173 insertions, 0 deletions
diff --git a/contrib/list_items.pl b/contrib/list_items.pl
new file mode 100755
index 0000000..ad0fde9
--- /dev/null
+++ b/contrib/list_items.pl
@@ -0,0 +1,173 @@
+#!/usr/bin/perl
+
+$ITEMFILE="common.h";
+$PARMFILE="data.h";
+
+sub printo {
+ my $text = shift;
+ my $len = shift;
+ print sprintf("%.*s", $len, $text);
+ if (length($text) < $len) {
+ print " " x ($len - length($text));
+ }
+}
+
+sub printa {
+ my $text = shift;
+ my $len = shift;
+
+ my @words = split(/\s+/, $text);
+ my $offset = $len;
+ while (@words) {
+ $word = shift(@words);
+ if ($offset + length($word) + 1 >= 80) {
+ print "\n";
+ print " " x $len;
+ $offset = $len;
+ }
+ print "$word ";
+ $offset += length($word) + 1;
+ }
+}
+
+sub i18n {
+ my $text = shift;
+ if ($lang != 0) {
+ return $TRANS{$text}->[$lang - 1];
+ }
+ return $text;
+}
+
+require 'contrib/items.doc';
+
+$lang = "en";
+if (defined($ARGV[0])) {
+ $lang = $ARGV[0];
+}
+$lang = $LANGS{$lang};
+
+print $INTRO[$lang];
+
+$where = 0;
+$until = "";
+
+open DAT, "<$ITEMFILE" or die "Couldn't open $ITEMFILE: $!";
+while (defined($_ = <DAT>)) {
+ chomp;
+
+ /^enum\s+eSkinSection/ and do {
+ $where = 1;
+ $until = "__SECTION_COUNT__";
+ print i18n("Known Sections")."\n";
+ print "-" x length(i18n("Known Sections"));
+ print "\n\n";
+ next;
+ };
+
+ /^enum\s+eSkinItem/ and do {
+ $where = 2;
+ $until = "__ITEM_COUNT__";
+ print i18n("Known drawable Items")."\n";
+ print "-" x length(i18n("Known drawable Items"));
+ print "\n\n";
+ next;
+ };
+
+ /^enum\s+eSkinDisplay/ and do {
+ $where = 3;
+ $until = "__DISPLAY_COUNT__";
+ print i18n("Known Display-Items")."\n";
+ print "-" x length(i18n("Known Display-Items"));
+ print "\n\n";
+ next;
+ };
+
+ (length($until) && /$until/) and do {
+ $where = 0;
+ $until = "";
+ print "\n";
+ next;
+ };
+
+ if ($where == 1) {
+ next if /sectionSkin/;
+ /section([\w]+)/ and do {
+ $what = $1;
+ printo i18n("Section:"), 15;
+ print "[$what]\n";
+ printo i18n("Description:"), 15;
+ printa $SECTIONS{$what}->[$lang], 15;
+ print "\n\n";
+ };
+ }
+
+ if ($where == 2) {
+ next if /itemUnknown/;
+ next if /itemSkin/;
+ /item([\w]+)/ and do {
+ $what = $1;
+ printo i18n("Item:"), 15;
+ print "Item=$what\n";
+ printo i18n("Description:"), 15;
+ printa $ITEMS{$what}->[$lang], 15;
+ print "\n";
+ printo i18n("Parameters:"), 15;
+ printa $ITEMPARAMS{$what}, 15;
+ print "\n\n";
+ };
+ }
+
+ if ($where == 3) {
+ next if /displayAlways/;
+ /display([\w]+)/ and do {
+ $what = $1;
+ printo i18n("Display:"), 15;
+ print "display=$what\n";
+ printo i18n("Description:"), 15;
+ printa $DISPLAYS{$what}->[$lang], 15;
+ print "\n";
+ printo i18n("Parameters:"), 15;
+ printa $DISPLAYPARAMS{$what}, 15;
+ print "\n";
+ printo i18n("Substitutes:"), 15;
+ printa $DISPLAYSUBST{$what}, 15;
+ print "\n\n";
+ };
+ }
+}
+close DAT;
+
+open DAT, "<$PARMFILE" or die "Couldn't open $PARMFILE: $!";
+while (defined($_ = <DAT>)) {
+ chomp;
+
+ /eSkinItem\s+mItem;/ and do {
+ $where = 1;
+ $until = "protected:";
+ print i18n("Known Parameters")."\n";
+ print "-" x length(i18n("Known Parameters"));
+ print "\n\n";
+ next;
+ };
+
+ (length($until) && /$until/) and do {
+ $where = 0;
+ $until = "";
+ next;
+ };
+
+ if ($where == 1) {
+ next if /mItem;\s*$/;
+ /m([\w]+);\s*$/ and do {
+ $what = lc($1);
+ printo i18n("Parameter:"), 15;
+ print "$what\n";
+ printo i18n("Description:"), 15;
+ print "\n";
+ printo i18n("Default:"), 15;
+ print "\n\n";
+ };
+ }
+}
+close DAT;
+