1 | package Gtk2::CV; |
1 | package Gtk2::CV; |
2 | |
|
|
3 | use XSLoader; |
|
|
4 | |
|
|
5 | $VERSION = '0.5'; |
|
|
6 | |
|
|
7 | XSLoader::load "Gtk2::CV", $VERSION; |
|
|
8 | |
2 | |
9 | use Gtk2; |
3 | use Gtk2; |
10 | use Glib; |
4 | use Glib; |
11 | |
5 | |
12 | use IO::AIO; |
6 | use IO::AIO; |
|
|
7 | |
|
|
8 | BEGIN { |
|
|
9 | use XSLoader; |
|
|
10 | |
|
|
11 | $VERSION = '0.5'; |
|
|
12 | |
|
|
13 | XSLoader::load "Gtk2::CV", $VERSION; |
|
|
14 | } |
13 | |
15 | |
14 | my $aio_source; |
16 | my $aio_source; |
15 | |
17 | |
16 | # we use a low priority to give GUI interactions as high a priority |
18 | # we use a low priority to give GUI interactions as high a priority |
17 | # as possible. |
19 | # as possible. |
… | |
… | |
44 | |
46 | |
45 | sub require_image($) { |
47 | sub require_image($) { |
46 | new_from_file Gtk2::Gdk::Pixbuf find_rcfile "images/$_[0]"; |
48 | new_from_file Gtk2::Gdk::Pixbuf find_rcfile "images/$_[0]"; |
47 | } |
49 | } |
48 | |
50 | |
|
|
51 | sub 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', 100, 10, 0xa0a0a0ff, 0x606060ff, |
|
|
57 | ) |
|
|
58 | } |
|
|
59 | |
|
|
60 | # TODO: make preferences |
|
|
61 | sub dealpha($) { |
|
|
62 | &dealpha_compose |
|
|
63 | } |
|
|
64 | |
49 | 1; |
65 | 1; |
50 | |
66 | |