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.13 by root, Mon Jul 11 02:14:10 2005 UTC vs.
Revision 1.27 by root, Sun Oct 22 21:51:13 2006 UTC

1package Gtk2::CV; 1package Gtk2::CV;
2
3use IO::AIO;
4
5use XSLoader;
6
7$VERSION = '0.3';
8
9XSLoader::load "Gtk2::CV", $VERSION;
10 2
11use Gtk2; 3use Gtk2;
12use Glib; 4use Glib;
13 5
14add_watch Glib::IO IO::AIO::poll_fileno, 'in', \&IO::AIO::poll_cb; 6use IO::AIO;
7
8BEGIN {
9 use XSLoader;
10
11 $VERSION = '1.3';
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 ||=
22 add_watch Glib::IO IO::AIO::poll_fileno,
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;
15 34
16sub find_rcfile($) { 35sub find_rcfile($) {
17 my $path; 36 my $path;
18 37
19 for (@INC) { 38 for (@INC) {
26 45
27sub require_image($) { 46sub require_image($) {
28 new_from_file Gtk2::Gdk::Pixbuf find_rcfile "images/$_[0]"; 47 new_from_file Gtk2::Gdk::Pixbuf find_rcfile "images/$_[0]";
29} 48}
30 49
50sub dealpha_compose($) {
51 return $_[0] unless $_[0]->get_has_alpha;
52
53 Gtk2::CV::dealpha_expose $_[0]->composite_color_simple (
54 $_[0]->get_width, $_[0]->get_height,
55 'nearest', 255, 16, 0xffc0c0c0, 0xff606060,
56 )
57}
58
59# TODO: make preferences
60sub dealpha($) {
61 &dealpha_compose
62}
63
311; 641;
32 65

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines