summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog7
-rw-r--r--ivybanner188
-rwxr-xr-xivybanner.prj10
3 files changed, 131 insertions, 74 deletions
diff --git a/debian/changelog b/debian/changelog
index db1dfab..16a7236 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+ivybanner (1.2) unstable; urgency=low
+
+ * Ajout de l'option -smallsize : 640x480
+ * Reagit a l'option X: -geometry (pour le positionnement seulement)
+
+ -- Daniel Etienne <etienne@cena.fr> Tue, 25 Nov 2003 17:35:13 +0200
+
ivybanner (1.1.1) unstable; urgency=low
* Correction de bug apparu dans la 1.1 : la liste des applis
diff --git a/ivybanner b/ivybanner
index 0523cd6..b2d8b5e 100644
--- a/ivybanner
+++ b/ivybanner
@@ -29,6 +29,8 @@ my $logfile = "ivybanner-";
my $conffile = "/etc/ivybanner.conf";
my $width = 1024;
my $height = 768;
+my $smallsized = 0;
+my $coef = 1;
# the following variables can be overloaded in configuration file
my $ivylaunch_command = "/usr/bin/ivylaunch";
@@ -61,8 +63,9 @@ my $currentlogfile;
# parse options
#------------------------
+Getopt::Long::Configure('pass_through');
&usage unless Getopt::Long::GetOptions(\%opt, 'conf=s', 'testdir=s', '-dir=s',
- 'nocursor', 'help', 'override');
+ 'nocursor', 'help', 'override', 'smallsize' );
&usage if $opt{help};
if ($opt{conf}) {
@@ -84,6 +87,8 @@ if ($opt{dir}) {
}
+
+
if ($opt{testdir}) {
$testsdir = $opt{testdir};
} elsif ($ENV{'IVYTESTSDIR'}) {
@@ -93,6 +98,18 @@ if ($opt{testdir}) {
}
+if ($opt{smallsize})
+{
+ $width = 640;
+ $height = 480;
+ $smallsized = 1;
+ $coef = 0.620;
+ @fontspec24 = (-font =>
+ '-b&h-lucida-bold-i-normal-sans-15-150-100-100-p-216-iso8859-1');
+ @fontspec17 = (-font =>
+ '-adobe-helvetica-medium-r-normal--11-80-100-100-p-60-iso10646-1');
+}
+
# test directories
#----------------------------
@@ -129,6 +146,7 @@ $ivylaunch_command .= " -override" if $opt{override};
#------------------------------
my $mw = MainWindow->new (-bg => 'black');
+
if ($opt{nocursor}) {
open(CURSOR, ">/tmp/cursor-ivybanner");
print CURSOR "#define cursor_width 1\n";
@@ -144,12 +162,13 @@ if ($opt{nocursor}) {
} else {
$mw->configure(-cursor => 'circle');
}
-$mw->geometry ($width."x".$height."--0+0");
+$mw->geometry ($width."x".$height);
$mw->title ('ivybanner');
$mw->client ('ivybanner');
$mw->resizable(0,0);
+#$mw->scale($maingroup, $winW/1280, $winH/1024); if $smallsized;
my $logo_small =$mw->Photo ('logo-small',
-file => Tk::findINC('logo.gif'));
@@ -159,7 +178,7 @@ my $logo_bg = $mw->Photo ('logo_bg',
my ($fm1, $fm2, $fm3, $tlog, $tlog2);
$fm1 = $mw->Frame->pack(-expand => 1, -fill => 'both');
-my @buttonattr = (-width => 8, -height => 3,
+my @buttonattr = (-width => 8*$coef, -height => 3,
-borderwidth => 1,
@fontspec24,
-relief => 'flat',
@@ -171,15 +190,23 @@ my @buttonattr = (-width => 8, -height => 3,
-foreground => $fg);
$fm1->Label(-image => $logo_bg)->place(-x => 0, -y => 0);
-$fm1->Button(-text => 'demos',
- -command => [\&demosframe, $demosdir],
- @buttonattr)->place(-x => 800, -y => 100);
-$fm1->Button(-text => 'tests',
- -command => [\&demosframe, $testsdir],
- @buttonattr)->place(-x => 800, -y => 330);
-$fm1->Button(-text => 'quit',
- @buttonattr,
- -command => [sub {exit(0)}])->place(-x => 800, -y => 560);
+
+if ($opt{smallsize}){
+
+ $fm1->Label(-image => $logo_bg)->place(-x => -120, -y => -144);
+}else{
+ $fm1->Label(-image => $logo_bg)->place(-x => 0, -y => 0);
+}
+
+ $fm1->Button(-text => 'demos',
+ -command => [\&demosframe, $demosdir],
+ @buttonattr)->place(-x => 800*$coef, -y => 100*$coef);
+ $fm1->Button(-text => 'tests',
+ -command => [\&demosframe, $testsdir],
+ @buttonattr)->place(-x => 800*$coef, -y => 330*$coef);
+ $fm1->Button(-text => 'quit',
+ @buttonattr,
+ -command => [sub {exit(0)}])->place(-x => 800*$coef, -y => 560*$coef);
print "--- Environment variables\n";
print "\$IVYCONFIGSDIR=",$ENV{'IVYCONFIGSDIR'},"\n";
@@ -231,28 +258,37 @@ sub demosframe {
$fm1->packForget();
$fm2 = $mw->Frame(-background => $darkbg)->pack(-expand => 1, -fill => 'both');
- $fm2->Frame(-background => $darkbg, -relief => 'groove', -borderwidth => 5,
- -width => $width+20, -height => 160)
- ->place(-x => -10, -y => -10);
-
- my $lb_logo = $fm2->Label(-image => $logo_small,
+ my $lb_logo;
+
+ $fm2->Frame(-background => $darkbg, -relief => 'groove', -borderwidth => 5,
+ -width => $width+20*$coef, -height => 160*$coef)
+ ->place(-x => -10*$coef, -y => -10*$coef);
+
+ if ($opt{smallsize}){
+ $lb_logo = $fm2->Label(-image => $logo_small,
+ -borderwidth => 0)->place(-x => 225, -y => -16);
+ }else{
+ $lb_logo = $fm2->Label(-image => $logo_small,
-borderwidth => 0)->place(-x => 390, -y => 26);
+ }
+
+
# Note that we use a decorative frame for each widget because frame size can be
# set in pixel unit whereas buttons family manages size in characters number
# (so, the size depends on used font)
# ivy network parameters frames
#--------------------------------------------------
- my $y = 25;
- my $x = 70;
- my $h = 50;
- my $w = 130;
- my $dx = 15;
- my $dy = 10;
- my @placeattr = (-x => 2, -y => 2);
- my @lab_placeattr = (-x => $w - 8, -y => 10 );
+ my $y = 25*$coef;
+ my $x = 70*$coef;
+ my $h = 50*$coef;
+ my $w = 130*$coef;
+ my $dx = 15*$coef;
+ my $dy = 10*$coef;
+ my @placeattr = (-x => 2*$coef, -y => 2*$coef);
+ my @lab_placeattr = (-x => $w - 8*$coef, -y => 10*$coef );
my @frameattr = (-relief => 'flat',
- -highlightthickness => 3,
+ -highlightthickness => 3*$coef*$coef,
-highlightbackground => $hlbg,
-highlightcolor => $hlbg,
-height => $h,
@@ -269,7 +305,7 @@ sub demosframe {
-activeforeground => $fg,
-activebackground => $bg,
-selectcolor => $selcolor);
- my @entryattr = (-width => 15,
+ my @entryattr = (-width => 15*$coef,
-state => 'disable',
@fontspec17,
-background => $bg);
@@ -308,7 +344,7 @@ sub demosframe {
# ivy port parameters frames
#--------------------------------------------------
- $x = 540;
+ $x = 540*$coef;
my @ports = (@ivyports);
my $port = $default_port;
my @fm_port;
@@ -341,21 +377,21 @@ sub demosframe {
# demos frame
#--------------------------------------------------
- my @bbox = (40, 160, $width-40, 640);
- my $fmh = 90;
- my $fmw = 180;
- my $butw = 14;
+ my @bbox = (40*$coef, 160*$coef, $width-40*$coef, 640*$coef);
+ my $fmh = 90*$coef;
+ my $fmw = 180*$coef;
+ my $butw = 14*$coef;
my $max_columns = int(($bbox[2]-$bbox[0])/$fmw);
my $max_rows = int(($bbox[3]-$bbox[1])/$fmh);
my $maxnb = $max_columns*$max_rows;
- @placeattr = (-x => 10, -y => 5);
+ @placeattr = (-x => 10*$coef, -y => 5*$coef);
@frameattr = (-relief => 'flat',
- -highlightthickness => 3,
+ -highlightthickness => 3*$coef*$coef,
-highlightbackground => $hlbg,
-height => $fmh,
-width => $fmw,
-background => $bg);
- my @rbuttonattr = (-width => $butw, -height => 4,
+ my @rbuttonattr = (-width => $butw, -height => 4*$coef,
-borderwidth => 1,
@fontspec17,
-relief => 'flat',
@@ -366,11 +402,11 @@ sub demosframe {
-activebackground => $bg,
-selectcolor => $selcolor,
);
- my @buttonattr = (-width => $butw, -height => 4,
+ my @buttonattr = (-width => $butw, -height => 4*$coef,
-borderwidth => 1,
@fontspec17,
-relief => 'flat',
- -highlightthickness => 3,
+ -highlightthickness => 3*$coef*$coef,
-highlightbackground => $hlbg,
-activebackground => $bg,
-activeforeground => $fg,
@@ -455,21 +491,21 @@ sub demosframe {
# control buttons bottom frame
#--------------------------------------------------
- $y = 680;
+ $y = 680*$coef;
my @buttonattr = (-width => 6, -height => 2,
-borderwidth => 1,
@fontspec24,
-relief => 'flat',
- -highlightthickness => 3,
+ -highlightthickness => 3*$coef*$coef,
-highlightbackground => $hlbg,
-activebackground => $bg,
-activeforeground => $fg,
-background => $bg,
-foreground => $fg);
$fm2->Frame(-background => $darkbg, -relief => 'groove',
- -borderwidth => 5,
- -width => $width+20,
- -height => $height)->place(-x => -10, -y => $y - 30);
+ -borderwidth => 5*$coef,
+ -width => $width+20*$coef,
+ -height => $height)->place(-x => -10*$coef, -y => $y - 30*$coef);
$fm2->Button(@buttonattr,
-text => "back",
-command => sub {
@@ -477,18 +513,18 @@ sub demosframe {
$selected_button = undef;
$fm2->destroy;
$fm1->pack(@packinfo);
- })->place(-x => 70, -y => $y);
+ })->place(-x => 70*$coef, -y => $y);
# $fm2->Button(@buttonattr,
# -command => sub {},
# -text => "kill")->place(-x => 290, -y => $y);
$fm2->Button(@buttonattr,
-command => \&viewLog,
- -text => "view\nlog")->place(-x => 510, -y => $y);
+ -text => "view\nlog")->place(-x => 510*$coef, -y => $y);
$view_button =
$fm2->Button(@buttonattr,
-state => 'disabled',
-command => sub {&viewConfig($path, $selected_demo)},
- -text => "view\nconfig")->place(-x => 670, -y => $y);
+ -text => "view\nconfig")->place(-x => 670*$coef, -y => $y);
$launch_button =
$fm2->Button(@buttonattr,
-state => 'disabled',
@@ -506,7 +542,7 @@ sub demosframe {
#print "port=$p domain=$d\n";
&execute($path, $selected_demo, $p, $d);
},
- -text => "launch")->place(-x => 830, -y => $y);
+ -text => "launch")->place(-x => 830*$coef, -y => $y);
} # end demosframe
@@ -525,22 +561,22 @@ sub viewConfig {
-relief => 'sunken',
-foreground => $fg,
-borderwidth => 2,
- -highlightthickness => 3,
+ -highlightthickness => 3*$coef,
-highlightbackground => $hlbg,
@fontspec17,
-height => 28,
-width => 102,
-scrollbars => 'oe');
- $t->Subwidget('yscrollbar')->configure(-width => 40,
- -borderwidth => 3,
+ $t->Subwidget('yscrollbar')->configure(-width => 40*$coef,
+ -borderwidth => 3*$coef,
-relief => 'flat',
- -highlightthickness => 3,
+ -highlightthickness => 3*$coef,
-troughcolor => $darkbg,
-highlightbackground => $hlbg,
-activebackground => $hlbg,
-background => $bg);
- $t->place(-x => 50, -y => 120);
+ $t->place(-x => 50*$coef*$coef*$coef, -y => 120*$coef);
$t->tagConfigure('comment', -foreground => 'gray70');
open(C_FILE, "cpp -traditional $dir/$file|");
while (<C_FILE>) {
@@ -553,12 +589,12 @@ sub viewConfig {
}
close C_FILE;
$t->configure(-state => 'disabled');
- my @labelattr = (-width => 40,
+ my @labelattr = (-width => 40*$coef,
-height => 2,
-borderwidth => 1,
@fontspec24,
-relief => 'flat',
- -highlightthickness => 3,
+ -highlightthickness => 3*$coef,
-highlightbackground => $hlbg,
-background => $bg,
-foreground => $fg);
@@ -574,13 +610,13 @@ sub viewConfig {
$fm3->Label(-text => "$text1\n$text2",
@labelattr,
-width => ($len1 > $len2) ? $len1 : $len2,
- )->place(-x => 50, -y => 30);
+ )->place(-x => 50*$coef*$coef*$coef, -y => 30*$coef);
$fm3->Button(@buttonattr,
-text => "back",
-command => sub {
$fm3->destroy;
$fm2->pack(@packinfo);
- })->place(-x => 70, -y => 680);
+ })->place(-x => 70*$coef, -y => 680*$coef);
} # end viewConfig
@@ -607,12 +643,12 @@ sub viewLog {
my $cnt = $#logfiles;
- my @labelattr = (-width => 40,
+ my @labelattr = (-width => 40*$coef,
-height => 2,
-borderwidth => 1,
@fontspec24,
-relief => 'flat',
- -highlightthickness => 3,
+ -highlightthickness => 3*$coef,
-highlightbackground => $hlbg,
-background => $bg,
-foreground => $fg);
@@ -622,28 +658,28 @@ sub viewLog {
-activeforeground => $fg);
my $l = $fm3->Label(@labelattr,
- )->place(-x => 50, -y => 30);
+ )->place(-x => 50*$coef*$coef*$coef, -y => 30*$coef);
$fm3->Button(@buttonattr,
-text => "back",
-command => sub {
$fm3->destroy;
$fm2->pack(@packinfo);
- })->place(-x => 70, -y => 680);
+ })->place(-x => 70*$coef, -y => 680*$coef);
my $select_button =
$fm3->Button(@buttonattr,
-text => "select...",
-command => \&selectappname,
- )->place(-x => 400, -y => 680);
+ )->place(-x => 400*$coef, -y => 680*$coef);
my $prev_button =
$fm3->Button(@buttonattr,
-text => "previous\nlog",
- )->place(-x => 600, -y => 680);
+ )->place(-x => 600*$coef, -y => 680*$coef);
my $next_button =
$fm3->Button(@buttonattr,
-text => "next\nlog",
-state => 'disabled',
- )->place(-x => 800, -y => 680);
+ )->place(-x => 800*$coef, -y => 680*$coef);
if (@logfiles <= 1) {
$prev_button->configure(-state => 'disabled');
$next_button->configure(-state => 'disabled');
@@ -694,7 +730,7 @@ sub selectappname {
-foreground => $fg,
-borderwidth => 1,
-highlightbackground => $hlbg,
- -highlightthickness => 3,
+ -highlightthickness => 3*$coef,
-height => 2,
-activebackground => $bg,
-activeforeground => $fg,
@@ -755,21 +791,21 @@ sub readlog {
-height => 28,
-width => 102,
-borderwidth => 2,
- -highlightthickness => 3,
+ -highlightthickness => 3*$coef,
-highlightbackground => $hlbg,
-state => 'disabled',
-scrollbars => 'oe');
- $tlog->Subwidget('yscrollbar')->configure(-width => 40,
- -borderwidth => 3,
+ $tlog->Subwidget('yscrollbar')->configure(-width => 40*$coef,
+ -borderwidth => 3*$coef,
-relief => 'flat',
- -highlightthickness => 3,
+ -highlightthickness => 3*$coef,
-troughcolor => $darkbg,
-highlightbackground => $hlbg,
-activebackground => $hlbg,
-background => $bg);
$tlog->tagConfigure('bold', -foreground => $hlbg);
- $tlog->place(-x => 50, -y => 120);
+ $tlog->place(-x => 50*$coef*$coef*$coef, -y => 120*$coef);
$l->configure(-text => "loading...");
$l->update;
@@ -812,22 +848,22 @@ sub readpartiallog {
-height => 28,
-width => 102,
-borderwidth => 2,
- -highlightthickness => 3,
+ -highlightthickness => 3*$coef,
-highlightbackground => $hlbg,
-state => 'disabled',
-scrollbars => 'oe');
- $tlog2->Subwidget('yscrollbar')->configure(-width => 40,
- -borderwidth => 3,
+ $tlog2->Subwidget('yscrollbar')->configure(-width => 40*$coef,
+ -borderwidth => 3*$coef,
-relief => 'flat',
- -highlightthickness => 3,
+ -highlightthickness => 3*$coef,
-troughcolor => $darkbg,
-highlightbackground => $hlbg,
-activebackground => $hlbg,
-background => $bg);
$tlog2->tagConfigure('bold', -foreground => $hlbg);
- $tlog2->place(-x => 50, -y => 120);
+ $tlog2->place(-x => 50*$coef*$coef*$coef, -y => 120*$coef);
$tlog2->configure(-state => 'normal');
open(FILE, $currentlogfile) or warn "cannot read file '$currentlogfile'\n";
@@ -896,6 +932,7 @@ sub usage {
print " -conf <file> configuration file; default=/etc/ivybanner.conf\n";
print " -dir <dir> fugue configs directory\n";
print " -testdir <dir> tests directory\n";
+ print " -smallsize display IvyBanner in 640x480 instead of 1024x768\n";
print "\n";
exit 0;
}
@@ -909,7 +946,7 @@ ivybanner - an interface for ivy launcher
=head1 SYNOPSIS
-ivybanner [-help] [-nocursor] [-override] [-conf configfile] [-dir fugueconfdir] [-testdir testsdir]
+ivybanner [-help] [-nocursor] [-override] [-conf configfile] [-dir fugueconfdir] [-testdir testsdir] [-smallsize]
=head1 DESCRIPTION
@@ -943,6 +980,9 @@ Specify tests directory. Default is current directory unless the $IVYTESTSDIR va
Infer ivylaunch behavior when a B<global> agent is detected on the bus. See ivylaunch(1) man page.
+=item B<-smallsize>
+
+display IvyBanner in 640x480 instead of 1024x768.
=back
diff --git a/ivybanner.prj b/ivybanner.prj
new file mode 100755
index 0000000..277e166
--- /dev/null
+++ b/ivybanner.prj
@@ -0,0 +1,10 @@
+[Project ID]
+Signature=UE Proj: v.1
+[Files]
+0=E:\Travail\ivybanner\debian\changelog
+1=E:\Travail\ivybanner\debian\rules
+2=E:\Travail\ivybanner\ivybanner
+3=E:\Travail\ivybanner\ivybanner.conf
+4=E:\Travail\ivybanner\ivybanner.prj
+[Group]
+0=