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

Comparing CV/bin/cv (file contents):
Revision 1.50 by root, Sat Aug 13 15:19:10 2005 UTC vs.
Revision 1.54 by root, Fri Aug 19 00:19:52 2005 UTC

43 $viewer->load_image ($_[1]); 43 $viewer->load_image ($_[1]);
44 }); 44 });
45 45
46 Gtk2::CV::Plugin->call (new_schnauzer => $s); 46 Gtk2::CV::Plugin->call (new_schnauzer => $s);
47 47
48 $s; 48 $s
49} 49}
50 50
51sub std_keys { 51sub std_keys {
52 my $key = $_[1]->keyval; 52 my $key = $_[1]->keyval;
53 my $state = $_[1]->state; 53 my $state = $_[1]->state;
102 102
103 $viewer->signal_connect (button3_press_event => sub { 103 $viewer->signal_connect (button3_press_event => sub {
104 $mainwin->visible 104 $mainwin->visible
105 ? $mainwin->hide 105 ? $mainwin->hide
106 : $mainwin->show_all; 106 : $mainwin->show_all;
107 1; 107 1
108 }); 108 });
109 109
110 Gtk2::CV::Plugin->call (new_imagewindow => $viewer); 110 Gtk2::CV::Plugin->call (new_imagewindow => $viewer);
111 111
112 $schnauzer = new_schnauzer; 112 $schnauzer = new_schnauzer;
113 113
114 $mainwin = new Gtk2::Window; 114 $mainwin = new Gtk2::Window;
115 $mainwin->set_title ("CV"); 115 $mainwin->set_title ("CV");
116 $mainwin->add (my $vbox = new Gtk2::VBox); 116 $mainwin->add (my $vbox = new Gtk2::VBox);
117 $mainwin->signal_connect (delete_event => sub { $mainwin->hide; 1; }); 117 $mainwin->signal_connect (delete_event => sub { $mainwin->hide; 1 });
118 118
119 $vbox->add ($schnauzer); 119 $vbox->add ($schnauzer);
120 $vbox->pack_end (my $frame = new Gtk2::Frame, 0, 0, 0); 120 $vbox->pack_end (my $frame = new Gtk2::Frame, 0, 0, 0);
121 $frame->add (my $hbox = new Gtk2::HBox 0, 0); 121 $frame->add (my $hbox = new Gtk2::HBox 0, 0);
122 $hbox->pack_start ((new Gtk2::Label "Info: "), 0, 0, 0); 122 $hbox->pack_start ((new Gtk2::Label "Info: "), 0, 0, 0);
127 127
128 $schnauzer->set_geometry_hints; 128 $schnauzer->set_geometry_hints;
129} 129}
130 130
131if (@ARGV) { 131if (@ARGV) {
132 @ARGV == 1 && -d $ARGV[0]
133 ? $schnauzer->set_dir (Glib::filename_to_unicode shift)
132 $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV]); 134 : $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV]);
133 $schnauzer->show_all; 135 $schnauzer->show_all;
134 $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []); 136 $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []);
135 $viewer->show_all;
136} else { 137} else {
137 $schnauzer->set_dir (File::Spec->curdir); 138 $schnauzer->set_dir (File::Spec->curdir);
138 $mainwin->show_all; 139 $mainwin->show_all;
139 $viewer->show_all;
140} 140}
141 141
142$viewer->show_all; 142$viewer->show_all;
143 143
144main Gtk2; 144main Gtk2;
169 169
170This algorithm is quite unprecise - it doesn't make a difference between 170This algorithm is quite unprecise - it doesn't make a difference between
171files, device nodes, symlinks and the like, and filetype detection is done 171files, device nodes, symlinks and the like, and filetype detection is done
172using the file extension only. 172using the file extension only.
173 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
174=item * use of asynchronous I/O 180=item * use of asynchronous I/O
175 181
176CV 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
177while scanning directories, waiting for stat data or unlinking files. This 183while scanning directories, waiting for stat data, unlinking files or
178usually decreases scanning times for large directories a bit (especially 184generating thumbnails. This usually decreases scanning times for large
179on RAID devices and over NFS). 185directories a bit (especially on RAID devices and over NFS) and makes CV
186much more interactive.
180 187
181=item * fast image loading 188=item * fast image loading
182 189
183The 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
184image should be as small as possible. CV uses optimized (especially 191image should be as small as possible. CV uses optimized (especially
334 341
335=back 342=back
336 343
337=head1 SECURITY CONSIDERATIONS 344=head1 SECURITY CONSIDERATIONS
338 345
339CV uses Pixbuf to load images. Pixbuf is not considered safe for this 346CV uses Pixbuf to load non-JPEG images. Pixbuf is not considered safe for
340purpose, though (from the gtk-2.2 release notes): 347this purpose, though (from the gtk-2.2 release notes):
341 348
342"While efforts have been made to make gdk-pixbuf robust against invalid 349"While efforts have been made to make gdk-pixbuf robust against invalid
343images, using gdk-pixbuf to load untrusted data is not recommended, due to 350images, using gdk-pixbuf to load untrusted data is not recommended, due to
344the likelyhood that there are additional problems where an invalid image 351the likelyhood that there are additional problems where an invalid image
345could cause gdk-pixbuf to crash or worse." 352could cause gdk-pixbuf to crash or worse."
347=head1 BUGS/TODO 354=head1 BUGS/TODO
348 355
349 Lots of functionality is missing. 356 Lots of functionality is missing.
350 357
351 Pixbuf doesn't always honor G_BROKEN_FILENAMES, so accessing files with 358 Pixbuf doesn't always honor G_BROKEN_FILENAMES, so accessing files with
352 names incompatible might utf-8 fail. 359 names incompatible with utf-8 might fail.
353 360
354 rotate on disk 361 rotate on disk
355 lots of ui issues 362 lots of ui issues
356 save(?) 363 save(?)
357 preferences 364 preferences
358 shift-cursor in schnauzer
359 365
360=head1 AUTHOR 366=head1 AUTHOR
361 367
362Marc Lehmann <cv@plan9.de>. 368Marc Lehmann <cv@plan9.de>.
363 369

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines