ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CV/lib/Gtk2/CV.pm
Revision: 1.19
Committed: Tue Aug 16 02:08:06 2005 UTC (18 years, 11 months ago) by root
Branch: MAIN
Changes since 1.18: +5 -1 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 package Gtk2::CV;
2
3 use XSLoader;
4
5 $VERSION = '0.5';
6
7 XSLoader::load "Gtk2::CV", $VERSION;
8
9 use Gtk2;
10 use Glib;
11
12 use IO::AIO;
13
14 my $aio_source;
15
16 # we use a low priority to give GUI interactions as high a priority
17 # as possible.
18 sub enable_aio {
19 $aio_source ||=
20 add_watch Glib::IO IO::AIO::poll_fileno,
21 in => sub { IO::AIO::poll_cb; 1 },
22 undef,
23 &Glib::G_PRIORITY_LOW;
24 }
25
26 sub disable_aio {
27 remove Glib::Source $aio_source if $aio_source;
28 undef $aio_source;
29 }
30
31 enable_aio;
32 IO::AIO::max_outstanding 128;
33
34 sub find_rcfile($) {
35 my $path;
36
37 for (@INC) {
38 $path = "$_/Gtk2/CV/$_[0]";
39 return $path if -r $path;
40 }
41
42 die "FATAL: can't find required file $_[0]\n";
43 }
44
45 sub require_image($) {
46 new_from_file Gtk2::Gdk::Pixbuf find_rcfile "images/$_[0]";
47 }
48
49 1;
50