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

Comparing CV/bin/cv (file contents):
Revision 1.62 by root, Tue Oct 4 04:55:47 2005 UTC vs.
Revision 1.71 by root, Thu Oct 4 10:30:12 2007 UTC

70 } else { 70 } else {
71 &std_keys 71 &std_keys
72 or $schnauzer->signal_emit (key_press_event => $_[1]) 72 or $schnauzer->signal_emit (key_press_event => $_[1])
73 } 73 }
74 }); 74 });
75 $self->signal_connect (delete_event => sub { $_[0]->destroy; 0 });
75 $self->signal_connect (destroy => sub { 76 $self->signal_connect (destroy => sub {
76 $viewer = undef if $viewer == $_[0]; 77 $viewer = undef if $viewer == $_[0];
77 78
78 main_quit Gtk2 unless --$viewer_count; 79 main_quit Gtk2 unless --$viewer_count;
80
81 0
79 }); 82 });
80 83
81 $self->signal_connect (button3_press_event => sub { 84 $self->signal_connect (button3_press_event => sub {
82 $mainwin->visible 85 $mainwin->visible
83 ? $mainwin->hide 86 ? $mainwin->hide
84 : $mainwin->show_all; 87 : $mainwin->show_all;
88
85 1 89 1
86 }); 90 });
87 91
88 Gtk2::CV::Plugin->call (new_imagewindow => $self); 92 Gtk2::CV::Plugin->call (new_imagewindow => $self);
89 93
99 if ($key == $Gtk2::Gdk::Keysyms{q}) { 103 if ($key == $Gtk2::Gdk::Keysyms{q}) {
100 $viewer->destroy; 104 $viewer->destroy;
101 } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{v}) { 105 } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{v}) {
102 my $w = new Gtk2::Window; 106 my $w = new Gtk2::Window;
103 107
108 $w->set_role ("schnauzer");
104 $w->set_title ("CV: Schnauzer"); 109 $w->set_title ("CV: Schnauzer");
105 $w->add (my $s = new_schnauzer); 110 $w->add (my $s = new_schnauzer);
106 $s->set_dir (File::Spec->curdir); 111 $s->set_dir (File::Spec->curdir);
107 $s->set_geometry_hints; 112 $s->set_geometry_hints;
108 $w->show_all; 113 $w->show_all;
110 } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{h}) { 115 } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{h}) {
111 unless ($help) { 116 unless ($help) {
112 require Gtk2::PodViewer; 117 require Gtk2::PodViewer;
113 118
114 $help = new Gtk2::Window; 119 $help = new Gtk2::Window;
120 $help->set_role ("help");
115 $help->set_title ("CV: Help"); 121 $help->set_title ("CV: Help");
116 $help->set_default_size (500, 300); 122 $help->set_default_size (500, 300);
117 $help->signal_connect (delete_event => sub { $help->hide; 1 }); 123 $help->signal_connect (delete_event => sub { $help->hide; 1 });
118 124
119 $help->add (my $sw = new Gtk2::ScrolledWindow); 125 $help->add (my $sw = new Gtk2::ScrolledWindow);
136 $::cur_viewer = $viewer; 142 $::cur_viewer = $viewer;
137 143
138 $schnauzer = new_schnauzer; 144 $schnauzer = new_schnauzer;
139 145
140 $mainwin = new Gtk2::Window; 146 $mainwin = new Gtk2::Window;
147 $mainwin->set_role ("main");
141 $mainwin->set_title ("CV"); 148 $mainwin->set_title ("CV");
142 $mainwin->add (my $vbox = new Gtk2::VBox); 149 $mainwin->add (my $vbox = new Gtk2::VBox);
143 $mainwin->signal_connect (delete_event => sub { $mainwin->hide; 1 }); 150 $mainwin->signal_connect (delete_event => sub { $mainwin->hide; 1 });
144 151
145 $vbox->add ($schnauzer); 152 $vbox->add ($schnauzer);
153 160
154 $schnauzer->set_geometry_hints; 161 $schnauzer->set_geometry_hints;
155} 162}
156 163
157if (@ARGV) { 164if (@ARGV) {
158 @ARGV == 1 && -d $ARGV[0] 165 my $show_first = sub {
159 ? $schnauzer->set_dir (Glib::filename_to_unicode shift)
160 : $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV]);
161 $schnauzer->show_all; 166 $schnauzer->show_all;
162 $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []); 167 $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []);
168 $viewer->show_all;
169 };
170
171 if (@ARGV == 1 && $ARGV[0] eq "-0r") {
172 local $/;
173 $schnauzer->set_paths ([map Glib::filename_to_unicode $_, split /\x00/, <STDIN>], 1, $show_first);
174 } elsif (@ARGV == 1 && -d $ARGV[0]) {
175 $schnauzer->set_dir (Glib::filename_to_unicode shift, $show_first);
176 } else {
177 $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV], 1, $show_first);
178 }
163} else { 179} else {
164 $schnauzer->set_dir (File::Spec->curdir); 180 $schnauzer->set_dir (File::Spec->curdir, sub {
165 $mainwin->show_all; 181 $mainwin->show_all;
166}
167
168$viewer->show_all; 182 $viewer->show_all;
183 });
184}
169 185
170main Gtk2; 186main Gtk2;
187
188Gtk2::CV::flush_aio;
171 189
172__DATA__ 190__DATA__
173 191
174=encoding utf-8 192=encoding utf-8
175 193
292 r set scaling mode to 'nearest' (fastest) 310 r set scaling mode to 'nearest' (fastest)
293 s set scaling mode to 'bilinear' (default) 311 s set scaling mode to 'bilinear' (default)
294 shift-s set scaling mode to 'hyper' (slowest) 312 shift-s set scaling mode to 'hyper' (slowest)
295 t rotate clockwise 90° 313 t rotate clockwise 90°
296 T rotate counterclockwise° 314 T rotate counterclockwise°
315 a apply all rotations loslessly to a jpeg file (using exiftran)
297 ctrl-v open a new visual schnauzer window for the current dir 316 ctrl-v open a new visual schnauzer window for the current dir
317 ctrl-c clone the current image window
298 ctrl-e run an editor ($CV_EDITOR or "gimp") on the current image 318 ctrl-e run an editor ($CV_EDITOR or "gimp") on the current image
299 ctrl-p fire up the print dialog 319 ctrl-p fire up the print dialog
300 escape cancel a crop action 320 escape cancel a crop action
301 321
302And when playing movies, these additional keys are active: 322And when playing movies, these additional keys are active:
319Left-clicking into the image window will let you crop the image (usually 339Left-clicking into the image window will let you crop the image (usually
320to zoom into large images that CV scales down). 340to zoom into large images that CV scales down).
321 341
322=head2 THE VISUAL SCHNAUZER 342=head2 THE VISUAL SCHNAUZER
323 343
344Any image-loading action in a schnauzer window acts on the
345"last-recently-activated" imagewindow, which currently is simply the last
346image window that received a keypress.
347
324You can use the following keys in the schnauzer window: 348You can use the following keys in the schnauzer window:
325 349
326 ctrl-space, 350 ctrl-space,
327 space move to and display next image 351 space move to and display next image
328 ctrl-backspace, 352 ctrl-backspace,
409=item CV_EDITOR 433=item CV_EDITOR
410 434
411The program that gets executed when the user presses C<CTRL-e> in the 435The program that gets executed when the user presses C<CTRL-e> in the
412Schnauzer or image window. The default is C<gimp>. 436Schnauzer or image window. The default is C<gimp>.
413 437
438=item CV_AUDIO_PLAYER
439
440Program used to play all sorts of audio (wav, aif, mp3, ogg...), default "play".
441Will be called like C<< $CV_AUDIO_PLAYER -- <path> >>.
442
414=item CV_PRINT_DESTINATION 443=item CV_PRINT_DESTINATION
415 444
416The default (perl-style) destination to use in the print dialog. 445The default (perl-style) destination to use in the print dialog.
417 446
418=item CV_TRASHCAN 447=item CV_TRASHCAN

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines