--- CV/bin/cv 2005/02/12 17:23:41 1.36 +++ 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; } @@ -70,11 +78,10 @@ $help->show_all; } else { - #$mainwin->show_all; - $schnauzer->handle_key ($key, $state); + return 0; } - 1; + 1 } { @@ -82,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 { @@ -92,6 +102,8 @@ 1; }); + Gtk2::CV::Plugin->call (new_imagewindow => $viewer); + $schnauzer = new_schnauzer; $mainwin = new Gtk2::Window; @@ -102,8 +114,11 @@ $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; } @@ -111,6 +126,7 @@ if (@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); @@ -201,10 +217,20 @@ =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