* New upstream release * debian/rules: Use make distclean rather than make clean * debian/control: - Add myself to uploaders - Add build-depends on markdown
open my$fh,"<:utf8",$file or do { warn $!; return };
776
775
my $first;
776
my $linecount=0; my ($linefirst,$linenext);
777
777
while (1)
778
778
{ my ($next,$longline);
779
779
my @lines=($first);
780
780
while (local $_=<$fh>)
781
{ s#^\s+##;
781
{ $linecount++;
782
s#^\s+##;
782
783
next if m/^#/;
783
784
s#\s*[\n\r]+$##;
784
785
if (s#\\$##) {$longline.=$_;next}
785
786
next if $_ eq '';
786
787
if ($longline) {$_=$longline.$_;undef $longline;}
787
if (m#^[{[]#) {$next=$_;last}
788
if (m#^[{[]#) { $next=$_; $linenext=$linecount; last}
788
789
push @lines,$_;
789
790
}
790
791
if ($first)
791
{ if ($first=~m#^\[#) {ParseLayout(\@lines,$path)}
792
{ if ($first=~m#^\[#) {ParseLayout(\@lines,$file,$linefirst)}
792
793
else {ParseSongTreeSkin(\@lines)}
793
794
}
794
$first=$next;
795
$first=$next; $linefirst=$linenext;
795
796
last unless $first;
796
797
}
797
798
close $fh;
798
799
}
799
800
800
801
sub ParseLayout
801
{ my ($lines,$path)=@_;
802
{ my ($lines,$file,$line)=@_;
802
803
my $first=shift @$lines;
803
804
my $name;
804
805
if ($first=~m/^\[([^]=]+)\](?:\s*based on (.+))?$/)
822
823
for my $key (qw/Name Category Title/)
823
824
{ $Layouts{$name}{$key}=~s/^"(.*)"$/$1/ if $Layouts{$name}{$key}; #remove quotes from layout name and category
824
825
}
826
my $path=$file; $path=~s#([^/]+)$##; $file=$1;
825
827
$Layouts{$name}{PATH}=$path;
828
$Layouts{$name}{FILE}=$file;
829
$Layouts{$name}{LINE}=$line;
826
830
}
827
831
828
832
sub ParseSongTreeSkin
871
875
%default= @optlist;
872
876
}
873
877
$_=::ParseOptions($_) for values %default;
878
$default{DEFAULT_OPTIONS}=1;
879
$default{Window}{DEFAULT_OPTIONS}=1;
874
880
return \%default;
875
881
}
876
882
1815
1821
my (undef,undef,$monitorwidth,$monitorheight)=$screen->get_monitor_geometry($monitor)->values;
1816
1822
$w= $1*$monitorwidth/100 if $w=~m/(\d+)%/;
1817
1823
$h= $1*$monitorheight/100 if $h=~m/(\d+)%/;
1824
if ($self->{options}{DEFAULT_OPTIONS}) { $monitorwidth-=40; $monitorheight-=80; } # if using default layout size, reserve some space for potential panels and decorations
1825
$w=$monitorwidth if $w>$monitorwidth;
1826
$h=$monitorheight if $h>$monitorheight;
1818
1827
if ($self->{fixedsize})
1819
1828
{ $w=-1 if $w<1; # -1 => do not override default minimum size