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.68 by root, Mon Oct 23 17:52:37 2006 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) {
165 my $show_first = sub {
166 $schnauzer->show_all;
167 $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []);
168 $viewer->show_all;
169 };
170
158 @ARGV == 1 && -d $ARGV[0] 171 @ARGV == 1 && -d $ARGV[0]
159 ? $schnauzer->set_dir (Glib::filename_to_unicode shift) 172 ? $schnauzer->set_dir (Glib::filename_to_unicode shift, $show_first)
160 : $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV]); 173 : $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV], 1, $show_first);
161 $schnauzer->show_all;
162 $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []);
163} else { 174} else {
164 $schnauzer->set_dir (File::Spec->curdir); 175 $schnauzer->set_dir (File::Spec->curdir, sub {
165 $mainwin->show_all; 176 $mainwin->show_all;
166}
167
168$viewer->show_all; 177 $viewer->show_all;
178 });
179}
169 180
170main Gtk2; 181main Gtk2;
171 182
172__DATA__ 183__DATA__
173 184
292 r set scaling mode to 'nearest' (fastest) 303 r set scaling mode to 'nearest' (fastest)
293 s set scaling mode to 'bilinear' (default) 304 s set scaling mode to 'bilinear' (default)
294 shift-s set scaling mode to 'hyper' (slowest) 305 shift-s set scaling mode to 'hyper' (slowest)
295 t rotate clockwise 90° 306 t rotate clockwise 90°
296 T rotate counterclockwise° 307 T rotate counterclockwise°
308 a apply all rotations loslessly to a jpeg file (using exiftran)
297 ctrl-v open a new visual schnauzer window for the current dir 309 ctrl-v open a new visual schnauzer window for the current dir
310 ctrl-c clone the current image window
298 ctrl-e run an editor ($CV_EDITOR or "gimp") on the current image 311 ctrl-e run an editor ($CV_EDITOR or "gimp") on the current image
299 ctrl-p fire up the print dialog 312 ctrl-p fire up the print dialog
300 escape cancel a crop action 313 escape cancel a crop action
301 314
302And when playing movies, these additional keys are active: 315And when playing movies, these additional keys are active:
319Left-clicking into the image window will let you crop the image (usually 332Left-clicking into the image window will let you crop the image (usually
320to zoom into large images that CV scales down). 333to zoom into large images that CV scales down).
321 334
322=head2 THE VISUAL SCHNAUZER 335=head2 THE VISUAL SCHNAUZER
323 336
337Any image-loading action in a schnauzer window acts on the
338"last-recently-activated" imagewindow, which currently is simply the last
339image window that received a keypress.
340
324You can use the following keys in the schnauzer window: 341You can use the following keys in the schnauzer window:
325 342
326 ctrl-space, 343 ctrl-space,
327 space move to and display next image 344 space move to and display next image
328 ctrl-backspace, 345 ctrl-backspace,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines