line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Clutter; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Clutter::VERSION = '1.110'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
41937
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
7
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
8
|
1
|
|
|
1
|
|
7
|
use Carp qw/croak/; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
171
|
|
9
|
1
|
|
|
1
|
|
1740
|
use Cairo::GObject; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Glib::Object::Introspection; |
11
|
|
|
|
|
|
|
use Exporter; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $_CLUTTER_BASENAME = 'Clutter'; |
16
|
|
|
|
|
|
|
my $_CLUTTER_VERSION = '1.0'; |
17
|
|
|
|
|
|
|
my $_CLUTTER_PACKAGE = 'Clutter'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub import { |
20
|
|
|
|
|
|
|
my $class = shift; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Glib::Object::Introspection->setup ( |
23
|
|
|
|
|
|
|
basename => $_CLUTTER_BASENAME, |
24
|
|
|
|
|
|
|
version => $_CLUTTER_VERSION, |
25
|
|
|
|
|
|
|
package => $_CLUTTER_PACKAGE, |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# - Overrides --------------------------------------------------------------- # |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub Clutter::CHECK_VERSION { |
32
|
|
|
|
|
|
|
return not defined Clutter::check_version(@_ == 4 ? @_[1..3] : @_); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub Clutter::check_version { |
36
|
|
|
|
|
|
|
Glib::Object::Introspection->invoke ($_CLUTTER_BASENAME, undef, 'check_version', |
37
|
|
|
|
|
|
|
@_ == 4 ? @_[1..3] : @_); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub Clutter::init { |
41
|
|
|
|
|
|
|
my $rest = Glib::Object::Introspection->invoke ( |
42
|
|
|
|
|
|
|
$_CLUTTER_BASENAME, undef, 'init', |
43
|
|
|
|
|
|
|
[$0, @ARGV]); |
44
|
|
|
|
|
|
|
@ARGV = @{$rest}[1 .. $#$rest]; # remove $0 |
45
|
|
|
|
|
|
|
return; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub Clutter::main { |
49
|
|
|
|
|
|
|
# Ignore any arguments passed in. |
50
|
|
|
|
|
|
|
Glib::Object::Introspection->invoke ($_CLUTTER_BASENAME, undef, 'main'); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub Clutter::main_quit { |
54
|
|
|
|
|
|
|
# Ignore any arguments passed in. |
55
|
|
|
|
|
|
|
Glib::Object::Introspection->invoke ($_CLUTTER_BASENAME, undef, 'main_quit'); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub Gtk3::Builder::add_from_string { |
59
|
|
|
|
|
|
|
my ($builder, $string) = @_; |
60
|
|
|
|
|
|
|
return Glib::Object::Introspection->invoke ( |
61
|
|
|
|
|
|
|
$_CLUTTER_BASENAME, 'Script', 'add_from_string', |
62
|
|
|
|
|
|
|
$builder, $string, length $string); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
# Copied from Gtk2.pm |
66
|
|
|
|
|
|
|
sub Clutter::Script::connect_signals { |
67
|
|
|
|
|
|
|
my $builder = shift; |
68
|
|
|
|
|
|
|
my $user_data = shift; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
my $do_connect = sub { |
71
|
|
|
|
|
|
|
my ($object, |
72
|
|
|
|
|
|
|
$signal_name, |
73
|
|
|
|
|
|
|
$user_data, |
74
|
|
|
|
|
|
|
$connect_object, |
75
|
|
|
|
|
|
|
$flags, |
76
|
|
|
|
|
|
|
$handler) = @_; |
77
|
|
|
|
|
|
|
my $func = ($flags & 'after') ? 'signal_connect_after' : 'signal_connect'; |
78
|
|
|
|
|
|
|
# we get connect_object when we're supposed to call |
79
|
|
|
|
|
|
|
# signal_connect_object, which ensures that the data (an object) |
80
|
|
|
|
|
|
|
# lives as long as the signal is connected. the bindings take |
81
|
|
|
|
|
|
|
# care of that for us in all cases, so we only have signal_connect. |
82
|
|
|
|
|
|
|
# if we get a connect_object, just use that instead of user_data. |
83
|
|
|
|
|
|
|
$object->$func($signal_name => $handler, |
84
|
|
|
|
|
|
|
$connect_object ? $connect_object : $user_data); |
85
|
|
|
|
|
|
|
}; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
# $builder->connect_signals ($user_data) |
88
|
|
|
|
|
|
|
# $builder->connect_signals ($user_data, $package) |
89
|
|
|
|
|
|
|
if ($#_ <= 0) { |
90
|
|
|
|
|
|
|
my $package = shift; |
91
|
|
|
|
|
|
|
$package = caller unless defined $package; |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
$builder->connect_signals_full(sub { |
94
|
|
|
|
|
|
|
my ($builder, |
95
|
|
|
|
|
|
|
$object, |
96
|
|
|
|
|
|
|
$signal_name, |
97
|
|
|
|
|
|
|
$handler_name, |
98
|
|
|
|
|
|
|
$connect_object, |
99
|
|
|
|
|
|
|
$flags) = @_; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
no strict qw/refs/; |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
my $handler = $handler_name; |
104
|
|
|
|
|
|
|
if (ref $package) { |
105
|
|
|
|
|
|
|
$handler = sub { $package->$handler_name(@_) }; |
106
|
|
|
|
|
|
|
} else { |
107
|
|
|
|
|
|
|
if ($package && $handler !~ /::/) { |
108
|
|
|
|
|
|
|
$handler = $package.'::'.$handler_name; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
$do_connect->($object, $signal_name, $user_data, $connect_object, |
113
|
|
|
|
|
|
|
$flags, $handler); |
114
|
|
|
|
|
|
|
}); |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
# $builder->connect_signals ($user_data, %handlers) |
118
|
|
|
|
|
|
|
else { |
119
|
|
|
|
|
|
|
my %handlers = @_; |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
$builder->connect_signals_full(sub { |
122
|
|
|
|
|
|
|
my ($builder, |
123
|
|
|
|
|
|
|
$object, |
124
|
|
|
|
|
|
|
$signal_name, |
125
|
|
|
|
|
|
|
$handler_name, |
126
|
|
|
|
|
|
|
$connect_object, |
127
|
|
|
|
|
|
|
$flags) = @_; |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
return unless exists $handlers{$handler_name}; |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
$do_connect->($object, $signal_name, $user_data, $connect_object, |
132
|
|
|
|
|
|
|
$flags, $handlers{$handler_name}); |
133
|
|
|
|
|
|
|
}); |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
} |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
1; |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
__END__ |