Author: sparky                       Date: Wed Dec  7 01:20:08 2005 GMT
Module: vfmg                          Tag: DEVEL
---- Log message:
- killed DR17-advanced
- support config files with multi-line options ('\' at final of the line,
  like in sh)
- genericname only useful in DR17
- finally new DR17 options are configurable

---- Files affected:
vfmg:
   vfmg (1.73.2.41 -> 1.73.2.42) 

---- Diffs:

================================================================
Index: vfmg/vfmg
diff -u vfmg/vfmg:1.73.2.41 vfmg/vfmg:1.73.2.42
--- vfmg/vfmg:1.73.2.41 Sat Dec  3 00:37:36 2005
+++ vfmg/vfmg   Wed Dec  7 02:20:03 2005
@@ -39,9 +39,8 @@
 my $o_output;
 $defopt{xterm}="$ENV{'VFMG_TERM'}" if $ENV{'VFMG_TERM'};
 
-my @wms = qw(ASCII DR17 DR17-advanced aewm afterstep blackbox enlightenment
-       fbpanel fluxbox fvwm fvwm2 icewm metisse olvwm openbox qvwm wmaker
-       wmaker-old xfce4 xpde);
+my @wms = qw(ASCII DR17 aewm afterstep blackbox enlightenment fbpanel fluxbox
+       fvwm fvwm2 icewm metisse olvwm openbox qvwm wmaker wmaker-old xfce4 
xpde);
 
 # %destdir and %iconsdir should only contain directories propsed by WM
 my %destdir = (
@@ -74,6 +73,12 @@
        'icons-fork!'   =>      \$opt{icons_fork},
        'icons-dir|d=s' =>      \$opt{icons_dir},
        'icons-ext|T=s' =>      \$opt{icons_ext},
+       'text-icon=s'   =>      \$opt{text_icon},
+       'wcnt-file=s'   =>      \$opt{wcnt_file},
+       'termapp-class=s'
+                                       =>      \$opt{termapp_class},
+       'termapp-name=s'
+                                       =>      \$opt{termapp_name},
 
        'utf8|u!'               =>      \$opt{utf},
        'encoding|E=s'  =>      \$opt{encoding},
@@ -148,7 +153,6 @@
 $o_output=$ARGV[0];
 die "Unrecognized argument: $o_output\n"
        unless grep { $o_output eq $_ } @wms;
-$o_output =~ s/-advanced//;
 
 # vfmgrc {{{
 my @rcFiles = (qw(/etc/vfmgrc), "$ENV{'HOME'}/.vfmgrc");
@@ -161,6 +165,7 @@
        my $read = 1;
        while (<F_IN>) {
                next if ( /^\s*#/ );
+               $_ .= <F_IN> while s/\\\n$//;
                $read = 0 if /^\[/;
                if ( /^\[$o_output\]/ ) {
                        $read = 1;
@@ -177,6 +182,7 @@
 foreach my $opt (keys %opt) {
        $opt{$opt} = $rcopt{$opt} unless defined $opt{$opt};
        $opt{$opt} = $defopt{$opt} unless defined $opt{$opt};
+       next unless defined $opt{$opt};
        $opt{$opt} =~ s/\${HOME}/$ENV{'HOME'}/go;
 }
 
@@ -410,7 +416,7 @@
                warn "$File::Find::name: missing Name tag! using $utfname\n";
        }
        my $genname = "";
-       if (length $tags{genericname}) {
+       if ($o_output eq "DR17" and length $tags{genericname}) {
                if ($tags{enc} eq 'Legacy-Mixed') {
                        warn "$File::Find::name: Legacy-Mixed encoding is 
depreciated.\n";
 
@@ -912,7 +918,7 @@
                
                unlink $$dr{icon};
                my $icon = $$d[ICON];
-               if ( exists $$dr{advanced} && not -r $icon ) {
+               if ( not -r $icon and defined $$dr{text_icon} ) {
                        ( my $exe = $$dr{text_icon} ) =~ s/%1/"$name"/;
                        system($exe);
                } else {
@@ -932,15 +938,25 @@
                        push @eapp, "-set-name",$name;
                        push @eapp, "-set-generic",$$d[GENNAME] if length 
$$d[GENNAME];
                        push @eapp, "-set-exe",$$d[EXEC];
-                       if ( exists $$dr{advanced} ) {
+                       if ( defined $$dr{wcnt} ) {
                                if ( exists $$dr{wcnt}{$$d[FILENAME]} ) {
                                        my $wcnt = $$dr{wcnt}{$$d[FILENAME]};
-                                       push @eapp, "-set-win-class", $$wcnt[0] 
if defined $$wcnt[0];
+                                       push @eapp, "-set-win-class", $$wcnt[0]
+                                               if defined $$wcnt[0];
                                        push @eapp, "-set-win-name", $$wcnt[1] 
if defined $$wcnt[1];
-                                       push @eapp, "-set-win-title", $$wcnt[2] 
if defined $$wcnt[2];
+                                       push @eapp, "-set-win-title", $$wcnt[2]
+                                               if defined $$wcnt[2];
+                                       push @eapp, "-set-win-role", $$wcnt[3] 
if defined $$wcnt[3];
                                } else {
                                        if ( $$d[TERM] == 1 ) {
-                                               push @eapp, "-set-win-name", 
"Eterm-".$$d[BIN];
+                                               if ( defined 
$opt{termapp_class} ) {
+                                                       (my $tapp = 
$opt{termapp_class}) =~ s/%1/$$d[BIN]/;
+                                                       push @eapp, 
"-set-win-class", $tapp;
+                                               }
+                                               if ( defined $opt{termapp_name} 
) {
+                                                       (my $tapp = 
$opt{termapp_name}) =~ s/%1/$$d[BIN]/;
+                                                       push @eapp, 
"-set-win-name", $tapp;
+                                               }
                                        } else {
                                                my $exe = (split /\s/, 
$$d[EXEC])[0];
                                                $exe = ucfirst lc $exe;
@@ -1405,26 +1421,35 @@
        }
 EOF
        close F_OUT; # }}}
-       if ( $ARGV[0] eq "DR17-advanced" ) { # {{{
-               warn "DR17-advanced !!!\n";
-               open F_IN, "$ENV{HOME}/WIN_cnt" or die;
-               $DR{wcnt} = {};
+       
+       $opt{wcnt_file} = "" unless defined $opt{wcnt_file};
+       $DR{wcnt} = {};
+       foreach my $wcnt_file (split /\s*;\s*/, $opt{wcnt_file}) { # {{{
+               unless (open F_IN, $wcnt_file) {
+                       warn "Can't open WCNT file: $!\n";
+                       next;
+               }
                while ( <F_IN> ) {
                        next if /^\s*#/;
                        next unless s/^\s*(\S+)//;
                        my $name = $1;
                        $DR{wcnt}{$name} = [undef, undef, undef];
-                       foreach my $num (0..2) {
-                               next unless s/^\s*"(([^"]|\")*?[^\\])"// or 
s/^\s*(\S+)//;
+                       foreach my $num (0..3) {
+                               last unless s/^\s*"(([^"]|\")*?[^\\])"// or 
s/^\s*(\S+)//;
                                $DR{wcnt}{$name}[$num] = $1 unless $1 eq "*";
                        }
+                       warn "Omitted: $_\n" if length($_) and $o_verbose;
                }
                close F_IN;
-               $DR{text_icon} = "convert -scale 64x64 -annotate 0,0,2,38 %1" .
-                       " -font /usr/share/fonts/TTF/VeraBd.ttf -pointsize 24" .
-                       " $DR{tmp}/blank.xpm $DR{icon}";
-               $DR{advanced} = 1;
        } # }}}
+       $DR{wcnt} = undef unless %{$DR{wcnt}};
+       
+       $DR{text_icon} = $opt{text_icon};
+       if ( defined $DR{text_icon} ) {
+               $DR{text_icon} =~ s|\%in|$DR{tmp}/blank.xpm|g;
+               $DR{text_icon} =~ s|\%out|$DR{icon}|g;
+       }
+
        DR17($opt{strip},$opt{destdir},"",\%DR);
        unlink "blank.xpm";
        unlink "icon.edc";
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/vfmg/vfmg?r1=1.73.2.41&r2=1.73.2.42&f=u

_______________________________________________
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to