1 | package Gtk2::CV; |
1 | package Gtk2::CV; |
2 | |
2 | |
3 | use XSLoader; |
3 | use XSLoader; |
4 | |
4 | |
5 | $VERSION = 0.13; |
5 | $VERSION = '0.3'; |
6 | |
6 | |
7 | XSLoader::load "Gtk2::CV", $VERSION; |
7 | XSLoader::load "Gtk2::CV", $VERSION; |
8 | |
8 | |
9 | use Gtk2; |
9 | use Gtk2; |
10 | |
10 | |
11 | sub find_rcfile { |
11 | sub find_rcfile($) { |
12 | my $path; |
12 | my $path; |
13 | |
13 | |
14 | for (@INC) { |
14 | for (@INC) { |
15 | $path = "$_/Gtk2/CV/$_[0]"; |
15 | $path = "$_/Gtk2/CV/$_[0]"; |
16 | return $path if -r $path; |
16 | return $path if -r $path; |
17 | } |
17 | } |
18 | |
18 | |
19 | die "FATAL: can't find required file $_[0]\n"; |
19 | die "FATAL: can't find required file $_[0]\n"; |
20 | } |
20 | } |
21 | |
21 | |
22 | sub require_image { |
22 | sub require_image($) { |
23 | new_from_file Gtk2::Gdk::Pixbuf find_rcfile "images/$_[0]"; |
23 | new_from_file Gtk2::Gdk::Pixbuf find_rcfile "images/$_[0]"; |
24 | } |
24 | } |
25 | |
25 | |
26 | 1; |
26 | 1; |
27 | |
27 | |