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

Comparing CV/bin/cv (file contents):
Revision 1.22 by root, Sat Nov 8 13:19:53 2003 UTC vs.
Revision 1.36 by root, Sat Feb 12 17:23:41 2005 UTC

15my $mainwin; 15my $mainwin;
16my $viewer; 16my $viewer;
17my $schnauzer; 17my $schnauzer;
18my $info; 18my $info;
19my $help; 19my $help;
20
21my $schnauzer_idx = 0;
20 22
21sub new_schnauzer { 23sub new_schnauzer {
22 my $s = new Gtk2::CV::Schnauzer; 24 my $s = new Gtk2::CV::Schnauzer;
23 25
24 $s->signal_connect_after (key_press_event => \&std_keys); 26 $s->signal_connect_after (key_press_event => \&std_keys);
41 43
42 if ($key == $Gtk2::Gdk::Keysyms{q}) { 44 if ($key == $Gtk2::Gdk::Keysyms{q}) {
43 main_quit Gtk2; 45 main_quit Gtk2;
44 } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{v}) { 46 } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{v}) {
45 my $w = new Gtk2::Window; 47 my $w = new Gtk2::Window;
48
49 $w->set_title ("CV: Schnauzer");
46 $w->add (my $s = new_schnauzer); 50 $w->add (my $s = new_schnauzer);
47 $s->set_dir (File::Spec->curdir); 51 $s->set_dir (File::Spec->curdir);
52 $s->set_geometry_hints;
48 $w->show_all; 53 $w->show_all;
54
49 } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{h}) { 55 } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{h}) {
50 unless ($help) { 56 unless ($help) {
51 require Gtk2::PodViewer; 57 require Gtk2::PodViewer;
52 58
53 $help = new Gtk2::Window; 59 $help = new Gtk2::Window;
54 $help->set_title ("CV Help"); 60 $help->set_title ("CV: Help");
55 $help->set_default_size (500, 300); 61 $help->set_default_size (500, 300);
56 $help->signal_connect (delete_event => sub { $help->hide; 1 }); 62 $help->signal_connect (delete_event => sub { $help->hide; 1 });
57 63
58 $help->add (my $sw = new Gtk2::ScrolledWindow); 64 $help->add (my $sw = new Gtk2::ScrolledWindow);
59 $sw->add (my $h = new Gtk2::PodViewer); 65 $sw->add (my $h = new Gtk2::PodViewer);
81 87
82 $viewer->signal_connect (button3_press_event => sub { 88 $viewer->signal_connect (button3_press_event => sub {
83 $mainwin->visible 89 $mainwin->visible
84 ? $mainwin->hide 90 ? $mainwin->hide
85 : $mainwin->show_all; 91 : $mainwin->show_all;
92 1;
86 }); 93 });
87 94
88 $schnauzer = new_schnauzer; 95 $schnauzer = new_schnauzer;
89 96
90 $mainwin = new Gtk2::Window; 97 $mainwin = new Gtk2::Window;
91 $mainwin->set_title ("CV"); 98 $mainwin->set_title ("CV");
92 $mainwin->add (my $vbox = new Gtk2::VBox); 99 $mainwin->add (my $vbox = new Gtk2::VBox);
100 $mainwin->signal_connect (delete_event => sub { $mainwin->hide; 1; });
93 101
94 $vbox->add ($schnauzer); 102 $vbox->add ($schnauzer);
95 $vbox->pack_end (my $frame = new Gtk2::Frame, 0, 0, 0); 103 $vbox->pack_end (my $frame = new Gtk2::Frame, 0, 0, 0);
96 $frame->add (my $hbox = new Gtk2::HBox 0, 0); 104 $frame->add (my $hbox = new Gtk2::HBox 0, 0);
97 $hbox->pack_start ((new Gtk2::Label "Info"), 0, 0, 0); 105 $hbox->pack_start ((new Gtk2::Label "Info"), 0, 0, 0);
98 $hbox->pack_start (($info = new Gtk2::Label), 1, 1, 0); 106 $hbox->pack_start (($info = new Gtk2::Label), 1, 1, 0);
107
108 $schnauzer->set_geometry_hints;
99} 109}
100 110
101if (@ARGV) { 111if (@ARGV) {
102 $schnauzer->set_paths (\@ARGV); 112 $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV]);
113 $schnauzer->show_all;
103 $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []); 114 $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []);
104} else { 115} else {
105 $schnauzer->set_dir (File::Spec->curdir); 116 $schnauzer->set_dir (File::Spec->curdir);
106 $mainwin->show_all; 117 $mainwin->show_all;
118 $viewer->show_all;
107} 119}
108 120
109$viewer->show_all; 121$viewer->show_all;
110 122
111main Gtk2; 123main Gtk2;
134 , shrink the image by 10% 146 , shrink the image by 10%
135 . enlarge the image by 10% 147 . enlarge the image by 10%
136 n reset to normal size 148 n reset to normal size
137 m maximize to screensize 149 m maximize to screensize
138 M maxime to screensize, respecting image aspect 150 M maxime to screensize, respecting image aspect
151 ctrl-m toggle maxpect-always mode
139 u uncrop 152 u uncrop
140 r set scaling mode to 'nearest' (fastest) 153 r set scaling mode to 'nearest' (fastest)
141 s set scaling mode to 'bilinear' (default) 154 s set scaling mode to 'bilinear' (default)
142 S set scaling mode to 'hyper' (slowest) 155 S set scaling mode to 'hyper' (slowest)
143 t rotate clockwise 90° 156 t rotate clockwise 90°
144 T rotate counterclockwise° 157 T rotate counterclockwise°
145 ctrl-v open a new visual schnauzer window for the current dir 158 ctrl-v open a new visual schnauzer window for the current dir
159 ctrl-s rescan visual schnauzer files for updates/deletes etc.
160 ctrl-e run an editor ($CV_EDITOR or "gimp") on the current image.
161
162And when playing movies, these additional keys are active:
163
164 left rewind by 10 seconds
165 right forward by 10 seconds
166 down rewind by 60 seconds
167 up forward by 60 seconds
168 pg_up rewind by 600 seconds
169 pg_down forward by 600 seconds
170 o toggle on-screen display
171 p pause/unpause
172 escape stop playing
173 9 turn volume down
174 0 turn volume up
146 175
147The following keys are redirected to the default visual schnauzer window: 176The following keys are redirected to the default visual schnauzer window:
148 177
149 space next image 178 space next image
150 backspace last image 179 backspace last image
161 page-up move one page up 190 page-up move one page up
162 page-down move one page down 191 page-down move one page down
163 home move to first file 192 home move to first file
164 end move to last file 193 end move to last file
165 194
195 ctrl-d delete selected files WITHOUT ASKING AGAIN
166 ctrl-g generate icons for the selected files 196 ctrl-g generate icons for the selected files
167 ctrl-d delete selected files WITHOUT ASKING AGAIN 197 ctrl-u update selected (or all) icons if neccessary
198 ctrl-a select all files
199
200=head1 ENVIRONMENT
201
202=over 4
203
204=item CV_PRINT_DESTINATION
205
206The default (perl-style) destination to use in the print dialog.
207
208=back
209
210=head1 SECURITY CONSIDERATIONS
211
212CV uses Pixbuf to load images. Pixbuf is not considered safe for this
213purpose, though (from the gtk-2.2 release notes):
214
215"While efforts have been made to make gdk-pixbuf robust against invalid
216images, using gdk-pixbuf to load untrusted data is not recommended, due to
217the likelyhood that there are additional problems where an invalid image
218could cause gdk-pixbuf to crash or worse."
168 219
169=head1 BUGS/TODO 220=head1 BUGS/TODO
221
222 Pixbuf doesn't honor G_BROKEN_FILENAMES, so accessing files with names
223 incompatible with utf-8 fails.
170 224
171 rotate on disk 225 rotate on disk
172 print 226 print
173 lots of ui issues 227 lots of ui issues
174 save(?) 228 save(?)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines