vfmg: VFMG/xfce4_out.pm (NEW) - xfce4 backend

sparky sparky at pld-linux.org
Sat Dec 2 00:29:40 CET 2006


Author: sparky                       Date: Fri Dec  1 23:29:40 2006 GMT
Module: vfmg                          Tag: HEAD
---- Log message:
- xfce4 backend

---- Files affected:
vfmg/VFMG:
   xfce4_out.pm (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: vfmg/VFMG/xfce4_out.pm
diff -u /dev/null vfmg/VFMG/xfce4_out.pm:1.1
--- /dev/null	Sat Dec  2 00:29:40 2006
+++ vfmg/VFMG/xfce4_out.pm	Sat Dec  2 00:29:35 2006
@@ -0,0 +1,44 @@
+package VFMG::Output;
+
+use strict;
+use warnings;
+
+sub xmlname($) {
+	$_ = $_[0];
+	s/&/&/g;
+	s/\"/"/g;
+	s/</&lt;/g;
+	s/>/&gt;/g;
+	return $_;
+}
+
+sub xfce4 {
+	my ($no, $level) = @_;
+	my $apps = "";
+	foreach my $entry (sort main::cmpdname keys %{$main::menu[$no]}) {
+		my $d = $main::desktop[$entry];
+		my $name = ($$d{Name} =~ /["&<>]/) ?
+			xmlname($$d{Name}) : $$d{Name};
+		my $icon = "";
+		$icon = main::scale_icon($$d{Icon}) if $main::opt{icons};
+		if ($main::menu[$no]{$entry} < 0) {
+			$apps .= qq($level<app name="$name" cmd=");
+			$apps .= ($$d{Exec} =~ /["&<>]/) ? xmlname($$d{Exec}) : $$d{Exec};
+			$apps .= qq(" icon="$icon"/>\n);
+		} else {
+			print qq($level<menu name="$name" icon="$icon" visible="yes">\n);
+			xfce4( $main::menu[$no]{$entry},$level."\t");
+			print "$level</menu>\n";
+		}
+	}
+	print $apps;
+}
+
+sub do_menu() {
+	print "<xfdesktop-menu>\n";
+	print qq(<title name="Desktop Menu" visible="yes"/>\n) unless $main::opt{nomenu};
+	xfce4($main::opt{strip},"\t");
+	print "</xfdesktop-menu>\n";
+}
+
+1;
================================================================


More information about the pld-cvs-commit mailing list