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, 10 months ago) by root
Branch: MAIN
Changes since 1.18: +5 -1 lines
Log Message:
*** empty log message ***

File Contents

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