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.15 by root, Mon Jul 11 03:49:38 2005 UTC vs.
Revision 1.25 by root, Fri Mar 31 10:56:01 2006 UTC

1package Gtk2::CV; 1package Gtk2::CV;
2
3use XSLoader;
4
5$VERSION = '0.5';
6
7XSLoader::load "Gtk2::CV", $VERSION;
8 2
9use Gtk2; 3use Gtk2;
10use Glib; 4use Glib;
11 5
12use IO::AIO; 6use IO::AIO;
13 7
8BEGIN {
9 use XSLoader;
10
11 $VERSION = '1.2';
12
13 XSLoader::load "Gtk2::CV", $VERSION;
14}
15
16my $aio_source;
17
18# we use a low priority to give GUI interactions as high a priority
19# as possible.
20sub enable_aio {
21 $aio_source ||=
14add_watch Glib::IO IO::AIO::poll_fileno, 22 add_watch Glib::IO IO::AIO::poll_fileno,
15 in => sub { IO::AIO::poll_cb, 1 }; 23 in => sub { IO::AIO::poll_cb; 1 },
24 undef,
25 &Glib::G_PRIORITY_LOW;
26}
27
28sub disable_aio {
29 remove Glib::Source $aio_source if $aio_source;
30 undef $aio_source;
31}
32
33enable_aio;
16IO::AIO::max_outstanding 128; 34IO::AIO::max_outstanding 128;
17 35
18sub find_rcfile($) { 36sub find_rcfile($) {
19 my $path; 37 my $path;
20 38
28 46
29sub require_image($) { 47sub require_image($) {
30 new_from_file Gtk2::Gdk::Pixbuf find_rcfile "images/$_[0]"; 48 new_from_file Gtk2::Gdk::Pixbuf find_rcfile "images/$_[0]";
31} 49}
32 50
51sub dealpha_compose($) {
52 return $_[0] unless $_[0]->get_has_alpha;
53
54 Gtk2::CV::dealpha_expose $_[0]->composite_color_simple (
55 $_[0]->get_width, $_[0]->get_height,
56 'nearest', 255, 16, 0xffc0c0c0, 0xff606060,
57 )
58}
59
60# TODO: make preferences
61sub dealpha($) {
62 &dealpha_compose
63}
64
331; 651;
34 66

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines