ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CV/lib/Gtk2/CV.pm
(Generate patch)

Comparing CV/lib/Gtk2/CV.pm (file contents):
Revision 1.21 by root, Sun Aug 21 02:19:16 2005 UTC vs.
Revision 1.33 by root, Sat Mar 17 13:12:20 2007 UTC

6use IO::AIO; 6use IO::AIO;
7 7
8BEGIN { 8BEGIN {
9 use XSLoader; 9 use XSLoader;
10 10
11 $VERSION = '0.5'; 11 $VERSION = '1.4';
12 12
13 XSLoader::load "Gtk2::CV", $VERSION; 13 XSLoader::load "Gtk2::CV", $VERSION;
14} 14}
15 15
16my $aio_source; 16my $aio_source;
17 17
18IO::AIO::min_parallel 32;
19IO::AIO::max_poll_time 0.01;
20
18# we use a low priority to give GUI interactions as high a priority 21# we use a low priority watcher to give GUI interactions as high a priority
19# as possible. 22# as possible.
20sub enable_aio { 23sub enable_aio {
21 $aio_source ||= 24 $aio_source ||=
22 add_watch Glib::IO IO::AIO::poll_fileno, 25 add_watch Glib::IO IO::AIO::poll_fileno,
23 in => sub { IO::AIO::poll_cb; 1 }, 26 in => sub {
24 undef, 27 eval { IO::AIO::poll_cb };
28 warn $@ if $@;#d#
29 1
30 },
31 undef,
25 &Glib::G_PRIORITY_LOW; 32 &Glib::G_PRIORITY_LOW;
26} 33}
27 34
28sub disable_aio { 35sub disable_aio {
29 remove Glib::Source $aio_source if $aio_source; 36 remove Glib::Source $aio_source if $aio_source;
30 undef $aio_source; 37 undef $aio_source;
31} 38}
32 39
40sub flush_aio {
41 enable_aio;
42 IO::AIO::flush;
43}
44
33enable_aio; 45enable_aio;
34IO::AIO::max_outstanding 128;
35 46
36sub find_rcfile($) { 47sub find_rcfile($) {
37 my $path; 48 my $path;
38 49
39 for (@INC) { 50 for (@INC) {
51sub dealpha_compose($) { 62sub dealpha_compose($) {
52 return $_[0] unless $_[0]->get_has_alpha; 63 return $_[0] unless $_[0]->get_has_alpha;
53 64
54 Gtk2::CV::dealpha_expose $_[0]->composite_color_simple ( 65 Gtk2::CV::dealpha_expose $_[0]->composite_color_simple (
55 $_[0]->get_width, $_[0]->get_height, 66 $_[0]->get_width, $_[0]->get_height,
56 'nearest', 255, 16, 0xa0a0a0ff, 0x606060ff, 67 'nearest', 255, 16, 0xffc0c0c0, 0xff606060,
57 ) 68 )
58} 69}
59 70
60# TODO: make preferences 71# TODO: make preferences
61sub dealpha($) { 72sub dealpha($) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines