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

Comparing CV/bin/cv (file contents):
Revision 1.47 by root, Wed Jul 20 09:06:37 2005 UTC vs.
Revision 1.53 by root, Tue Aug 16 02:46:58 2005 UTC

4use Encode (); 4use Encode ();
5 5
6use Gtk2 -init; 6use Gtk2 -init;
7use Gtk2::Gdk::Keysyms; 7use Gtk2::Gdk::Keysyms;
8 8
9use Gtk2::CV;
10
9use Gtk2::CV::ImageWindow; 11use Gtk2::CV::ImageWindow;
10use Gtk2::CV::Schnauzer; 12use Gtk2::CV::Schnauzer;
11 13
12use Gtk2::CV; 14BEGIN {
15 require Gtk2::CV::Plugin;
16 require "$ENV{HOME}/.cvrc" if -r "$ENV{HOME}/.cvrc";
17}
18
19use Gtk2::CV::Plugin::NameCluster;
20use Gtk2::CV::Plugin::RCluster;
13 21
14Gtk2::Rc->parse (Gtk2::CV::find_rcfile "gtkrc"); 22Gtk2::Rc->parse (Gtk2::CV::find_rcfile "gtkrc");
15 23
16use File::Spec; 24use File::Spec;
17
18require Gtk2::CV::Plugin;
19require "$ENV{HOME}/.cvrc" if -r "$ENV{HOME}/.cvrc";
20 25
21my $mainwin; 26my $mainwin;
22my $viewer; 27my $viewer;
23my $schnauzer; 28my $schnauzer;
24my $info; 29my $info;
38 $viewer->load_image ($_[1]); 43 $viewer->load_image ($_[1]);
39 }); 44 });
40 45
41 Gtk2::CV::Plugin->call (new_schnauzer => $s); 46 Gtk2::CV::Plugin->call (new_schnauzer => $s);
42 47
43 $s; 48 $s
44} 49}
45 50
46sub std_keys { 51sub std_keys {
47 my $key = $_[1]->keyval; 52 my $key = $_[1]->keyval;
48 my $state = $_[1]->state; 53 my $state = $_[1]->state;
97 102
98 $viewer->signal_connect (button3_press_event => sub { 103 $viewer->signal_connect (button3_press_event => sub {
99 $mainwin->visible 104 $mainwin->visible
100 ? $mainwin->hide 105 ? $mainwin->hide
101 : $mainwin->show_all; 106 : $mainwin->show_all;
102 1; 107 1
103 }); 108 });
104 109
105 Gtk2::CV::Plugin->call (new_imagewindow => $viewer); 110 Gtk2::CV::Plugin->call (new_imagewindow => $viewer);
106 111
107 $schnauzer = new_schnauzer; 112 $schnauzer = new_schnauzer;
108 113
109 $mainwin = new Gtk2::Window; 114 $mainwin = new Gtk2::Window;
110 $mainwin->set_title ("CV"); 115 $mainwin->set_title ("CV");
111 $mainwin->add (my $vbox = new Gtk2::VBox); 116 $mainwin->add (my $vbox = new Gtk2::VBox);
112 $mainwin->signal_connect (delete_event => sub { $mainwin->hide; 1; }); 117 $mainwin->signal_connect (delete_event => sub { $mainwin->hide; 1 });
113 118
114 $vbox->add ($schnauzer); 119 $vbox->add ($schnauzer);
115 $vbox->pack_end (my $frame = new Gtk2::Frame, 0, 0, 0); 120 $vbox->pack_end (my $frame = new Gtk2::Frame, 0, 0, 0);
116 $frame->add (my $hbox = new Gtk2::HBox 0, 0); 121 $frame->add (my $hbox = new Gtk2::HBox 0, 0);
117 $hbox->pack_start ((new Gtk2::Label "Info: "), 0, 0, 0); 122 $hbox->pack_start ((new Gtk2::Label "Info: "), 0, 0, 0);
122 127
123 $schnauzer->set_geometry_hints; 128 $schnauzer->set_geometry_hints;
124} 129}
125 130
126if (@ARGV) { 131if (@ARGV) {
132 @ARGV == 1 && -d $ARGV[0]
133 ? $schnauzer->set_dir (Glib::filename_to_unicode shift)
127 $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV]); 134 : $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV]);
128 $schnauzer->show_all; 135 $schnauzer->show_all;
129$viewer->show_all;
130 $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []); 136 $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []);
131} else { 137} else {
132 $schnauzer->set_dir (File::Spec->curdir); 138 $schnauzer->set_dir (File::Spec->curdir);
133 $mainwin->show_all; 139 $mainwin->show_all;
134 $viewer->show_all;
135} 140}
136 141
137$viewer->show_all; 142$viewer->show_all;
138 143
139main Gtk2; 144main Gtk2;
164 169
165This algorithm is quite unprecise - it doesn't make a difference between 170This algorithm is quite unprecise - it doesn't make a difference between
166files, device nodes, symlinks and the like, and filetype detection is done 171files, device nodes, symlinks and the like, and filetype detection is done
167using the file extension only. 172using the file extension only.
168 173
174=item * queuing for all time-consuming background tasks
175
176All tasks, such as unlinking files or generating thumbnails, that can be
177done in the background will be done so - no waiting required, even when
178changing directories.
179
169=item * use of asynchronous I/O 180=item * use of asynchronous I/O
170 181
171CV tries to use asynchronous I/O whereever it makes sense, for example 182CV tries to use asynchronous I/O whereever it makes sense, for example
172while scanning directories, waiting for stat data or unlinking files. This 183while scanning directories, waiting for stat data, unlinking files or
173usually decreases scanning times for large directories a bit (especially 184generating thumbnails. This usually decreases scanning times for large
174on RAID devices and over NFS). 185directories a bit (especially on RAID devices and over NFS) and makes CV
186much more interactive.
175 187
176=item * fast image loading 188=item * fast image loading
177 189
178The time span between the user issuing a command and displaying the new 190The time span between the user issuing a command and displaying the new
179image should be as small as possible. CV uses optimized (especially 191image should be as small as possible. CV uses optimized (especially
223 235
224=head2 THE IMAGE WINDOW 236=head2 THE IMAGE WINDOW
225 237
226You can use the following keys in the image window: 238You can use the following keys in the image window:
227 239
228 q quit the program 240 q quit the program
229 < half the image size 241 < half the image size
230 > double the image size 242 > double the image size
231 , shrink the image by 10% 243 , shrink the image by 10%
232 . enlarge the image by 10% 244 . enlarge the image by 10%
233 n reset to normal size 245 n reset to normal size
234 m maximize to screensize 246 m maximize to screensize
235 M maximize to screensize, respecting image aspect 247 M maximize to screensize, respecting image aspect
236 ctrl-m toggle maxpect-always mode 248 ctrl-m toggle maxpect-always mode
237 u uncrop 249 u uncrop
238 r set scaling mode to 'nearest' (fastest) 250 r set scaling mode to 'nearest' (fastest)
239 s set scaling mode to 'bilinear' (default) 251 s set scaling mode to 'bilinear' (default)
240 shift-s set scaling mode to 'hyper' (slowest) 252 shift-s set scaling mode to 'hyper' (slowest)
241 t rotate clockwise 90° 253 t rotate clockwise 90°
242 T rotate counterclockwise° 254 T rotate counterclockwise°
243 ctrl-v open a new visual schnauzer window for the current dir 255 ctrl-v open a new visual schnauzer window for the current dir
244 ctrl-e run an editor ($CV_EDITOR or "gimp") on the current image 256 ctrl-e run an editor ($CV_EDITOR or "gimp") on the current image
245 ctrl-p fire up the print fialog 257 ctrl-p fire up the print fialog
246 escape cancel a crop action 258 escape cancel a crop action
247 259
248And when playing movies, these additional keys are active: 260And when playing movies, these additional keys are active:
249 261
250 left rewind by 10 seconds 262 left rewind by 10 seconds
251 right forward by 10 seconds 263 right forward by 10 seconds
252 down rewind by 60 seconds 264 down rewind by 60 seconds
253 up forward by 60 seconds 265 up forward by 60 seconds
254 pg_up rewind by 600 seconds 266 pg_up rewind by 600 seconds
255 pg_down forward by 600 seconds 267 pg_down forward by 600 seconds
256 o toggle on-screen display 268 o toggle on-screen display
257 p pause/unpause 269 p pause/unpause
258 escape stop playing 270 escape stop playing
259 9 turn volume down 271 9 turn volume down
260 0 turn volume up 272 0 turn volume up
261 273
262Any other keys will be sent to the default schnauzer window, which can be 274Any other keys will be sent to the default schnauzer window, which can be
263toggled on and off by right-clicking into the image window. 275toggled on and off by right-clicking into the image window.
264 276
265Left-clicking into the image window will let you crop the image (usually 277Left-clicking into the image window will let you crop the image (usually
268=head2 THE VISUAL SCHNAUZER 280=head2 THE VISUAL SCHNAUZER
269 281
270You can use the following keys in the schnauzer window: 282You can use the following keys in the schnauzer window:
271 283
272 ctrl-space, 284 ctrl-space,
273 space move to and display next image 285 space move to and display next image
274 ctrl-backspace, 286 ctrl-backspace,
275 backspace move to and display previous image 287 backspace move to and display previous image
276 ctrl-return, 288 ctrl-return,
277 return display selected picture, or enter directory 289 return display selected picture, or enter directory
278 290
279 cursor keys move selection 291 cursor keys move selection
280 page-up move one page up 292 page-up move one page up
281 page-down move one page down 293 page-down move one page down
282 home move to first file 294 home move to first file
283 end move to last file 295 end move to last file
284 296
285 ctrl-a select all files 297 ctrl-a select all files
298 ctrl-shift-a select all files currently displayed in the schnauzer window
286 ctrl-d delete selected files WITHOUT ASKING AGAIN 299 ctrl-d delete selected files WITHOUT ASKING AGAIN
287 ctrl-g force generation of thumbnais for the selected files 300 ctrl-g force generation of thumbnais for the selected files
288 ctrl-s rescan current direcory or files updates/deletes etc. 301 ctrl-s rescan current direcory or files updates/deletes etc.
289 ctrl-u update selected (or all) icons if neccessary 302 ctrl-u update selected (or all) icons if neccessary
290 ctrl-l don't use, will become a plug-in eventually 303 ctrl-l don't use, will become a plug-in eventually
291 304
292 0-9, 305 0-9,
293 a-z find the first filename beginning with this letter 306 a-z find the first filename beginning with this letter
294 307
295Right-clicking into the schnauzer window displays a pop-up menu with 308Right-clicking into the schnauzer window displays a pop-up menu with
296additional actions. 309additional actions.
297 310
298=head1 FILES 311=head1 FILES

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines