ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CV/bin/cv
(Generate patch)

Comparing CV/bin/cv (file contents):
Revision 1.29 by root, Fri Nov 14 00:38:43 2003 UTC vs.
Revision 1.44 by root, Fri Jul 15 03:25:57 2005 UTC

1#!/opt/bin/perl 1#!/opt/bin/perl
2
3use Cwd ();
4use Encode ();
2 5
3use Gtk2 -init; 6use Gtk2 -init;
4use Gtk2::Gdk::Keysyms; 7use Gtk2::Gdk::Keysyms;
5 8
6use Gtk2::CV::ImageWindow; 9use Gtk2::CV::ImageWindow;
9use Gtk2::CV; 12use Gtk2::CV;
10 13
11Gtk2::Rc->parse (Gtk2::CV::find_rcfile "gtkrc"); 14Gtk2::Rc->parse (Gtk2::CV::find_rcfile "gtkrc");
12 15
13use File::Spec; 16use File::Spec;
17
18require Gtk2::CV::Plugin;
19require "$ENV{HOME}/.cvrc" if -r "$ENV{HOME}/.cvrc";
14 20
15my $mainwin; 21my $mainwin;
16my $viewer; 22my $viewer;
17my $schnauzer; 23my $schnauzer;
18my $info; 24my $info;
30 -s $_[1]; 36 -s $_[1];
31 $info->set_label ($label); 37 $info->set_label ($label);
32 $viewer->load_image ($_[1]); 38 $viewer->load_image ($_[1]);
33 }); 39 });
34 40
41 Gtk2::CV::Plugin->call (new_schnauzer => $s);
42
35 $s; 43 $s;
36} 44}
37 45
38sub std_keys { 46sub std_keys {
39 my $key = $_[1]->keyval; 47 my $key = $_[1]->keyval;
68 $h->load_string (do { local $/; <DATA> }); 76 $h->load_string (do { local $/; <DATA> });
69 } 77 }
70 78
71 $help->show_all; 79 $help->show_all;
72 } else { 80 } else {
73 #$mainwin->show_all; 81 return 0;
74 $schnauzer->handle_key ($key, $state);
75 } 82 }
76 83
77 1; 84 1
78} 85}
79 86
80{ 87{
81 $viewer = new Gtk2::CV::ImageWindow; 88 $viewer = new Gtk2::CV::ImageWindow;
82 89
83 $viewer->set_title ("CV: Image"); 90 $viewer->set_title ("CV: Image");
84 91
85 $viewer->signal_connect (key_press_event => \&std_keys); 92 $viewer->signal_connect (key_press_event => sub {
93 &std_keys
94 or $schnauzer->signal_emit (key_press_event => $_[1])
95 });
86 $viewer->signal_connect (delete_event => sub { main_quit Gtk2 }); 96 $viewer->signal_connect (delete_event => sub { main_quit Gtk2 });
87 97
88 $viewer->signal_connect (button3_press_event => sub { 98 $viewer->signal_connect (button3_press_event => sub {
89 $mainwin->visible 99 $mainwin->visible
90 ? $mainwin->hide 100 ? $mainwin->hide
91 : $mainwin->show_all; 101 : $mainwin->show_all;
92 1; 102 1;
93 }); 103 });
94 104
105 Gtk2::CV::Plugin->call (new_imagewindow => $viewer);
106
95 $schnauzer = new_schnauzer; 107 $schnauzer = new_schnauzer;
96 108
97 $mainwin = new Gtk2::Window; 109 $mainwin = new Gtk2::Window;
98 $mainwin->set_title ("CV"); 110 $mainwin->set_title ("CV");
99 $mainwin->add (my $vbox = new Gtk2::VBox); 111 $mainwin->add (my $vbox = new Gtk2::VBox);
102 $vbox->add ($schnauzer); 114 $vbox->add ($schnauzer);
103 $vbox->pack_end (my $frame = new Gtk2::Frame, 0, 0, 0); 115 $vbox->pack_end (my $frame = new Gtk2::Frame, 0, 0, 0);
104 $frame->add (my $hbox = new Gtk2::HBox 0, 0); 116 $frame->add (my $hbox = new Gtk2::HBox 0, 0);
105 $hbox->pack_start ((new Gtk2::Label "Info"), 0, 0, 0); 117 $hbox->pack_start ((new Gtk2::Label "Info"), 0, 0, 0);
106 $hbox->pack_start (($info = new Gtk2::Label), 1, 1, 0); 118 $hbox->pack_start (($info = new Gtk2::Label), 1, 1, 0);
119 $info->set (wrap => 1);
107 120
108 $schnauzer->set_geometry_hints; 121 $schnauzer->set_geometry_hints;
109} 122}
110 123
111if (@ARGV) { 124if (@ARGV) {
112 $schnauzer->set_paths (\@ARGV); 125 $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV]);
126 $schnauzer->show_all;
113 $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []); 127 $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []);
114
115 $viewer->load_image ($ARGV[0]);
116} else { 128} else {
117 $schnauzer->set_dir (File::Spec->curdir); 129 $schnauzer->set_dir (File::Spec->curdir);
118 $mainwin->show_all; 130 $mainwin->show_all;
131 $viewer->show_all;
119} 132}
120 133
121$viewer->show_all; 134$viewer->show_all;
122 135
123main Gtk2; 136main Gtk2;
155 S set scaling mode to 'hyper' (slowest) 168 S set scaling mode to 'hyper' (slowest)
156 t rotate clockwise 90° 169 t rotate clockwise 90°
157 T rotate counterclockwise° 170 T rotate counterclockwise°
158 ctrl-v open a new visual schnauzer window for the current dir 171 ctrl-v open a new visual schnauzer window for the current dir
159 ctrl-s rescan visual schnauzer files for updates/deletes etc. 172 ctrl-s rescan visual schnauzer files for updates/deletes etc.
173 ctrl-e run an editor ($CV_EDITOR or "gimp") on the current image.
174
175And when playing movies, these additional keys are active:
176
177 left rewind by 10 seconds
178 right forward by 10 seconds
179 down rewind by 60 seconds
180 up forward by 60 seconds
181 pg_up rewind by 600 seconds
182 pg_down forward by 600 seconds
183 o toggle on-screen display
184 p pause/unpause
185 escape stop playing
186 9 turn volume down
187 0 turn volume up
160 188
161The following keys are redirected to the default visual schnauzer window: 189The following keys are redirected to the default visual schnauzer window:
162 190
163 space next image 191 space next image
164 backspace last image 192 backspace last image
178 end move to last file 206 end move to last file
179 207
180 ctrl-d delete selected files WITHOUT ASKING AGAIN 208 ctrl-d delete selected files WITHOUT ASKING AGAIN
181 ctrl-g generate icons for the selected files 209 ctrl-g generate icons for the selected files
182 ctrl-u update selected (or all) icons if neccessary 210 ctrl-u update selected (or all) icons if neccessary
211 ctrl-a select all files
183 212
184=head1 ENVIRONMENT 213=head1 ENVIRONMENT
185 214
186=over 4 215=over 4
187 216
217=item CV_EDITOR
218
219The program that gets executed when the user presses C<CTRL-e> in the
220Schnauzer or image window. The default is C<gimp>.
221
188=item CV_PRINT_DESTINATION 222=item CV_PRINT_DESTINATION
189 223
190The default (perl-style) destination to use in the print dialog. 224The default (perl-style) destination to use in the print dialog.
225
226=item CV_TRASHCAN
227
228When set, must point to a directory where all files that are deleted are
229moved to. If unset, files that are deleted are really being deleted.
191 230
192=back 231=back
193 232
194=head1 SECURITY CONSIDERATIONS 233=head1 SECURITY CONSIDERATIONS
195 234

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines