… | |
… | |
15 | |
15 | |
16 | $s->signal_connect (activate => sub { $viewer->load_image ($_[1]) }); |
16 | $s->signal_connect (activate => sub { $viewer->load_image ($_[1]) }); |
17 | $s->signal_connect_after (key_press_event => \&std_keys); |
17 | $s->signal_connect_after (key_press_event => \&std_keys); |
18 | |
18 | |
19 | $s->set_dir ("."); |
19 | $s->set_dir ("."); |
20 | $w->show_all; |
|
|
21 | |
20 | |
22 | $s; |
21 | $s; |
23 | } |
22 | } |
24 | |
23 | |
25 | sub std_keys { |
24 | sub std_keys { |
… | |
… | |
29 | my $ctrl = grep $_ eq "control-mask", @$state; |
28 | my $ctrl = grep $_ eq "control-mask", @$state; |
30 | |
29 | |
31 | if ($key == $Gtk2::Gdk::Keysyms{q}) { |
30 | if ($key == $Gtk2::Gdk::Keysyms{q}) { |
32 | main_quit Gtk2; |
31 | main_quit Gtk2; |
33 | } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{v}) { |
32 | } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{v}) { |
34 | new_schnauzer; |
33 | new_schnauzer->get_toplevel->show_all; |
35 | } else { |
34 | } else { |
36 | $schnauzer->handle_key ($key, $state); |
35 | $schnauzer->handle_key ($key, $state); |
37 | } |
36 | } |
38 | |
37 | |
39 | 1; |
38 | 1; |
… | |
… | |
43 | $viewer->signal_connect (key_press_event => \&std_keys); |
42 | $viewer->signal_connect (key_press_event => \&std_keys); |
44 | $viewer->signal_connect (delete_event => sub { main_quit Gtk2 }); |
43 | $viewer->signal_connect (delete_event => sub { main_quit Gtk2 }); |
45 | |
44 | |
46 | $schnauzer = new_schnauzer; |
45 | $schnauzer = new_schnauzer; |
47 | |
46 | |
|
|
47 | my $mainwin = $schnauzer->get_toplevel; |
|
|
48 | |
|
|
49 | $viewer->signal_connect (button3_press_event => sub { |
|
|
50 | $mainwin->visible |
|
|
51 | ? $mainwin->hide |
|
|
52 | : $mainwin->show_all; |
|
|
53 | }); |
|
|
54 | |
48 | if (@ARGV) { |
55 | if (@ARGV) { |
49 | $viewer->load_image ($ARGV[0]); |
56 | $viewer->load_image ($ARGV[0]); |
50 | |
57 | |
51 | if (@ARGV > 1) { |
58 | if (@ARGV > 1) { |
52 | $schnauzer->set_files (\@ARGV); |
59 | $schnauzer->set_paths (\@ARGV); |
53 | } |
60 | } |
54 | } |
61 | } |
55 | |
62 | |
56 | $viewer->show_all; |
63 | $viewer->show_all; |
57 | |
64 | |
58 | main Gtk2; |
65 | main Gtk2; |
59 | |
66 | |
|
|
67 | =head1 NAME |
60 | |
68 | |
|
|
69 | cv - a fast gtk+ image viewer modeled after xv |
|
|
70 | |
|
|
71 | =head1 SYNOPSIS |
|
|
72 | |
|
|
73 | cv [file...] |
|
|
74 | |
|
|
75 | =head1 DESCRIPTION |
|
|
76 | |
|
|
77 | None yet. |
|
|
78 | |
|
|
79 | =head2 THE IMAGE WINDOW |
|
|
80 | |
|
|
81 | You can use the following keys in the image window: |
|
|
82 | |
|
|
83 | q quit the program |
|
|
84 | < half the image size |
|
|
85 | > double the image size |
|
|
86 | , shrink the image by 10% |
|
|
87 | . enlarge the image by 10% |
|
|
88 | n reset to normal size |
|
|
89 | m maximize to screensize |
|
|
90 | M maxime to screensize, respecting image aspect |
|
|
91 | u uncrop |
|
|
92 | r set scaling mode to 'nearest' (fastest) |
|
|
93 | s set scaling mode to 'bilinear' (default) |
|
|
94 | S set scaling mode to 'hyper' (slowest) |
|
|
95 | t rotate clockwise 90° |
|
|
96 | T rotate counterclockwise° |
|
|
97 | ctrl-v open a new visual schnauzer window for the current dir |
|
|
98 | |
|
|
99 | The following keys are redirected to the default visual schnauzer window: |
|
|
100 | |
|
|
101 | space next image |
|
|
102 | backspace last image |
|
|
103 | |
|
|
104 | =head2 THE VISUAL SCHNAUZER |
|
|
105 | |
|
|
106 | You can use the following keys in the schnauzer window: |
|
|
107 | |
|
|
108 | space move to and display next image |
|
|
109 | backspace move to and display previous image |
|
|
110 | return display selected picture |
|
|
111 | |
|
|
112 | cursor keys move selection |
|
|
113 | page-up move one page up |
|
|
114 | page-down move one page down |
|
|
115 | home move to first file |
|
|
116 | end move to last file |
|
|
117 | |
|
|
118 | ctrl-g generate icons for the selected files |
|
|
119 | ctrl-d delete selected files WITHOUT ASKING AGAIN |
|
|
120 | |
|
|
121 | =head1 BUGS/TODO |
|
|
122 | |
|
|
123 | rotate on disk |
|
|
124 | print |
|
|
125 | lots of ui issues |
|
|
126 | save(?) |
|
|
127 | preferences |
|
|
128 | ctrl-u in schnauzer |
|
|
129 | shift-cursor in schnauzer |
|
|
130 | |
|
|
131 | =head1 AUTHOR |
|
|
132 | |
|
|
133 | Marc Lehmann <cv@plan9.de>. |
|
|
134 | |
|
|
135 | =cut |
|
|
136 | |