--- CV/bin/cv 2003/11/12 19:36:06 1.25 +++ CV/bin/cv 2005/07/17 05:01:30 1.46 @@ -1,5 +1,8 @@ #!/opt/bin/perl +use Cwd (); +use Encode (); + use Gtk2 -init; use Gtk2::Gdk::Keysyms; @@ -12,6 +15,9 @@ use File::Spec; +require Gtk2::CV::Plugin; +require "$ENV{HOME}/.cvrc" if -r "$ENV{HOME}/.cvrc"; + my $mainwin; my $viewer; my $schnauzer; @@ -32,6 +38,8 @@ $viewer->load_image ($_[1]); }); + Gtk2::CV::Plugin->call (new_schnauzer => $s); + $s; } @@ -45,6 +53,8 @@ main_quit Gtk2; } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{v}) { my $w = new Gtk2::Window; + + $w->set_title ("CV: Schnauzer"); $w->add (my $s = new_schnauzer); $s->set_dir (File::Spec->curdir); $s->set_geometry_hints; @@ -55,7 +65,7 @@ require Gtk2::PodViewer; $help = new Gtk2::Window; - $help->set_title ("CV Help"); + $help->set_title ("CV: Help"); $help->set_default_size (500, 300); $help->signal_connect (delete_event => sub { $help->hide; 1 }); @@ -68,11 +78,10 @@ $help->show_all; } else { - #$mainwin->show_all; - $schnauzer->handle_key ($key, $state); + return 0; } - 1; + 1 } { @@ -80,7 +89,10 @@ $viewer->set_title ("CV: Image"); - $viewer->signal_connect (key_press_event => \&std_keys); + $viewer->signal_connect (key_press_event => sub { + &std_keys + or $schnauzer->signal_emit (key_press_event => $_[1]) + }); $viewer->signal_connect (delete_event => sub { main_quit Gtk2 }); $viewer->signal_connect (button3_press_event => sub { @@ -90,6 +102,8 @@ 1; }); + Gtk2::CV::Plugin->call (new_imagewindow => $viewer); + $schnauzer = new_schnauzer; $mainwin = new Gtk2::Window; @@ -100,18 +114,24 @@ $vbox->add ($schnauzer); $vbox->pack_end (my $frame = new Gtk2::Frame, 0, 0, 0); $frame->add (my $hbox = new Gtk2::HBox 0, 0); - $hbox->pack_start ((new Gtk2::Label "Info"), 0, 0, 0); - $hbox->pack_start (($info = new Gtk2::Label), 1, 1, 0); + $hbox->pack_start ((new Gtk2::Label "Info: "), 0, 0, 0); + $hbox->pack_end (my $labelwindow = new Gtk2::EventBox, 1, 1, 0); + $labelwindow->add ($info = new Gtk2::Label); + $labelwindow->signal_connect_after (size_request => sub { $_[1]->width (0); 0 }); + $info->set (selectable => 1, xalign => 0, justify => "left"); $schnauzer->set_geometry_hints; } if (@ARGV) { - $schnauzer->set_paths (\@ARGV); + $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV]); + $schnauzer->show_all; +$viewer->show_all; $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []); } else { $schnauzer->set_dir (File::Spec->curdir); $mainwin->show_all; + $viewer->show_all; } $viewer->show_all; @@ -144,6 +164,7 @@ n reset to normal size m maximize to screensize M maxime to screensize, respecting image aspect + ctrl-m toggle maxpect-always mode u uncrop r set scaling mode to 'nearest' (fastest) s set scaling mode to 'bilinear' (default) @@ -151,6 +172,22 @@ t rotate clockwise 90° T rotate counterclockwise° ctrl-v open a new visual schnauzer window for the current dir + ctrl-s rescan visual schnauzer files for updates/deletes etc. + ctrl-e run an editor ($CV_EDITOR or "gimp") on the current image. + +And when playing movies, these additional keys are active: + + left rewind by 10 seconds + right forward by 10 seconds + down rewind by 60 seconds + up forward by 60 seconds + pg_up rewind by 600 seconds + pg_down forward by 600 seconds + o toggle on-screen display + p pause/unpause + escape stop playing + 9 turn volume down + 0 turn volume up The following keys are redirected to the default visual schnauzer window: @@ -174,6 +211,27 @@ ctrl-d delete selected files WITHOUT ASKING AGAIN ctrl-g generate icons for the selected files ctrl-u update selected (or all) icons if neccessary + ctrl-a select all files + +=head1 ENVIRONMENT + +=over 4 + +=item CV_EDITOR + +The program that gets executed when the user presses C in the +Schnauzer or image window. The default is C. + +=item CV_PRINT_DESTINATION + +The default (perl-style) destination to use in the print dialog. + +=item CV_TRASHCAN + +When set, must point to a directory where all files that are deleted are +moved to. If unset, files that are deleted are really being deleted. + +=back =head1 SECURITY CONSIDERATIONS