r49122 - in /branches/upstream/libclutter-perl/current: MANIFEST META.yml NEWS README examples/bubbles.pl examples/circles.pl examples/custom-container.pl examples/hello.pl lib/Clutter.pm xs/ClutterAnimation.xs xs/ClutterContainer.xs

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Mon Dec 21 21:52:06 UTC 2009


Author: gregoa
Date: Mon Dec 21 21:52:01 2009
New Revision: 49122

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=49122
Log:
[svn-upgrade] Integrating new upstream version, libclutter-perl (1.002)

Added:
    branches/upstream/libclutter-perl/current/examples/bubbles.pl
    branches/upstream/libclutter-perl/current/examples/circles.pl
Modified:
    branches/upstream/libclutter-perl/current/MANIFEST
    branches/upstream/libclutter-perl/current/META.yml
    branches/upstream/libclutter-perl/current/NEWS
    branches/upstream/libclutter-perl/current/README
    branches/upstream/libclutter-perl/current/examples/custom-container.pl
    branches/upstream/libclutter-perl/current/examples/hello.pl
    branches/upstream/libclutter-perl/current/lib/Clutter.pm
    branches/upstream/libclutter-perl/current/xs/ClutterAnimation.xs
    branches/upstream/libclutter-perl/current/xs/ClutterContainer.xs

Modified: branches/upstream/libclutter-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclutter-perl/current/MANIFEST?rev=49122&op=diff
==============================================================================
--- branches/upstream/libclutter-perl/current/MANIFEST (original)
+++ branches/upstream/libclutter-perl/current/MANIFEST Mon Dec 21 21:52:01 2009
@@ -6,7 +6,9 @@
 copyright.pod
 doctypes
 examples/behaviour.pl
+examples/bubbles.pl
 examples/cairo.pl
+examples/circles.pl
 examples/custom-actor.pl
 examples/custom-container.pl
 examples/easing.pl

Modified: branches/upstream/libclutter-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclutter-perl/current/META.yml?rev=49122&op=diff
==============================================================================
--- branches/upstream/libclutter-perl/current/META.yml (original)
+++ branches/upstream/libclutter-perl/current/META.yml Mon Dec 21 21:52:01 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                Clutter
-version:             1.001
+version:             1.002
 abstract:            Simple GL-based canvas library
 license:             perl, lgpl
 author:              

Modified: branches/upstream/libclutter-perl/current/NEWS
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclutter-perl/current/NEWS?rev=49122&op=diff
==============================================================================
--- branches/upstream/libclutter-perl/current/NEWS (original)
+++ branches/upstream/libclutter-perl/current/NEWS Mon Dec 21 21:52:01 2009
@@ -1,3 +1,10 @@
+Clutter 1.002
+=============
+* Allow omitting FOREACH_WITH_INTERNALS from Container implementations,
+  just like the documentation said
+* Improve Clutter::Animation documentation
+* Improve the examples
+
 Clutter 1.001
 =============
 * Add Clutter::Cogl::Pango API bindings

Modified: branches/upstream/libclutter-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclutter-perl/current/README?rev=49122&op=diff
==============================================================================
--- branches/upstream/libclutter-perl/current/README (original)
+++ branches/upstream/libclutter-perl/current/README Mon Dec 21 21:52:01 2009
@@ -1,4 +1,4 @@
-Clutter version 1.001
+Clutter version 1.002
 =====================
 
 Perl bindings to the Clutter OpenGL canvas.  Clutter aims to give a nice

Added: branches/upstream/libclutter-perl/current/examples/bubbles.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclutter-perl/current/examples/bubbles.pl?rev=49122&op=file
==============================================================================
--- branches/upstream/libclutter-perl/current/examples/bubbles.pl (added)
+++ branches/upstream/libclutter-perl/current/examples/bubbles.pl Mon Dec 21 21:52:01 2009
@@ -1,0 +1,156 @@
+use warnings;
+use strict;
+
+use Math::Trig qw( :pi );
+use Cairo;
+use Glib qw( :constants );
+use Clutter qw( :init );
+
+use constant {
+    N_BUBBLES   => 50,
+
+    BUBBLE_R    => 128, # bubble radius
+    BUBBLE_D    => 10,  # bubble delta
+
+    SCREEN_W    => 640, # stage width
+    SCREEN_H    => 480, # stage height
+};
+
+sub bubble_y_notify {
+    my ($actor, $pspec, $stage) = @_;
+
+    return if $actor->get_y() > -$actor->get_height();
+
+    my $size = BUBBLE_R / 4 + int(rand(BUBBLE_R * 2));
+    $actor->set_size($size, $size);
+    $actor->set_rotation('z-axis', rand(360), $size / 2, $size / 2, 0);
+    $actor->set_position(
+        rand(SCREEN_W - BUBBLE_R),
+        SCREEN_H * 2 + rand(SCREEN_H * 3),
+    );
+
+    $actor->{linear}  =  0.5 + rand(3.0);
+    $actor->{angular} = -0.5 + rand(0.5);
+}
+
+sub create_bubble {
+    my $bubble = Clutter::CairoTexture->new(
+        BUBBLE_R * 2,
+        BUBBLE_R * 2,
+    );
+
+    my $cr = $bubble->create_context();
+
+    $cr->set_operator('clear');
+    $cr->paint();
+
+    $cr->set_operator('add');
+
+    $cr->arc(BUBBLE_R, BUBBLE_R, BUBBLE_R, 0.0, pi2);
+
+    my $pattern = Cairo::RadialGradient->create(
+        BUBBLE_R,
+        BUBBLE_R,
+        0.0,
+        BUBBLE_R,
+        BUBBLE_R,
+        BUBBLE_R,
+    );
+    $pattern->add_color_stop_rgba(0  , 0.88, 0.95, 0.99, 0.1);
+    $pattern->add_color_stop_rgba(0.6, 0.88, 0.95, 0.99, 0.1);
+    $pattern->add_color_stop_rgba(0.8, 0.67, 0.83, 0.91, 0.2);
+    $pattern->add_color_stop_rgba(0.9, 0.50, 0.67, 0.88, 0.7);
+    $pattern->add_color_stop_rgba(1.0, 0.30, 0.43, 0.69, 0.8);
+
+    $cr->set_source($pattern);
+    $cr->fill_preserve();
+
+    $pattern = Cairo::LinearGradient->create(
+        0,
+        0,
+        BUBBLE_R * 2,
+        BUBBLE_R * 2,
+    );
+    $pattern->add_color_stop_rgba(0.00, 1.0, 1.0, 1.0, 0.00);
+    $pattern->add_color_stop_rgba(0.15, 1.0, 1.0, 1.0, 0.95);
+    $pattern->add_color_stop_rgba(0.30, 1.0, 1.0, 1.0, 0.00);
+    $pattern->add_color_stop_rgba(0.70, 1.0, 1.0, 1.0, 0.00);
+    $pattern->add_color_stop_rgba(0.85, 1.0, 1.0, 1.0, 0.95);
+    $pattern->add_color_stop_rgba(1.00, 1.0, 1.0, 1.0, 0.00);
+
+    $cr->set_source($pattern);
+    $cr->fill();
+
+    $cr = undef;    # uload the contents
+
+    return $bubble;
+}
+
+sub main {
+    my $stage = Clutter::Stage->new();
+    $stage->set_size(SCREEN_W, SCREEN_H);
+    $stage->set_color(Clutter::Color->new(0xe0, 0xf2, 0xfc, 0xff));
+    $stage->signal_connect(destroy => sub { Clutter->main_quit(); });
+
+    my $timeline = Clutter::Timeline->new(5000);
+    $timeline->set_loop(TRUE);
+
+    # the original bubble; we will be cloning it to avoid creating
+    # all the textures, so we need to hide it after adding it to
+    # the stage
+    my $bubble = create_bubble();
+    $stage->add($bubble);
+    $bubble->hide();
+
+    my @bubbles = ();
+    foreach my $index (1 .. N_BUBBLES) {
+        my $actor = Clutter::Clone->new($bubble);
+
+        $actor->set_position(
+            $index * BUBBLE_R * 2,
+                -1 * BUBBLE_R * 2,
+        );
+        $actor->signal_connect("notify::y" => \&bubble_y_notify, $stage);
+
+        $stage->add($actor);
+
+        bubble_y_notify($actor, undef, $stage);
+
+        push @bubbles, $actor;
+    }
+
+    $timeline->signal_connect(new_frame => sub {
+        my ($t, $elapsed) = @_;
+
+        foreach my $b (@bubbles) {
+            my $linear  = $b->{linear};
+            my $angular = $b->{angular};
+
+            $angular *= BUBBLE_D;
+
+            $b->set_y($b->get_y() - ($linear * BUBBLE_D));
+            $b->set_x($b->get_x() - $angular);
+
+            $angular += ($b->get_rotation('z-axis'))[0];
+
+            if    ($angular > 360) {
+                $angular -= 360;
+            }
+            elsif ($angular <   0) {
+                $angular += 360;
+            }
+
+            my $radius = $b->get_width() / 2;
+            $b->set_rotation('z-axis', $angular, $radius, $radius, 0);
+        }
+    });
+    $timeline->start();
+
+    $stage->show();
+
+    Clutter->main();
+
+    0;
+}
+
+exit(main());

Added: branches/upstream/libclutter-perl/current/examples/circles.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclutter-perl/current/examples/circles.pl?rev=49122&op=file
==============================================================================
--- branches/upstream/libclutter-perl/current/examples/circles.pl (added)
+++ branches/upstream/libclutter-perl/current/examples/circles.pl Mon Dec 21 21:52:01 2009
@@ -1,0 +1,132 @@
+use warnings;
+use strict;
+
+use Math::Trig qw( :pi );
+use Glib qw( :constants );
+use Clutter qw( :init );
+
+use constant {
+    N_CIRCLES   => 4,
+
+    CIRCLE_W    => 128, # circle width
+    CIRCLE_G    => 32,  # circle gap
+    CIRCLE_S    => 4,   # circle segments
+
+    SCREEN_W    => 640, # screen width
+    SCREEN_H    => 480, # screen height
+};
+
+sub main {
+    my $stage = Clutter::Stage->new();
+    $stage->set_size(SCREEN_W, SCREEN_H);
+    $stage->set_color(Clutter::Color->new(0xe0, 0xf2, 0xfc, 0xff));
+    $stage->signal_connect(destroy => sub { Clutter->main_quit(); });
+
+    my $timeline = Clutter::Timeline->new(5000);
+    $timeline->set_loop(TRUE);
+
+    foreach my $index (1 .. N_CIRCLES) {
+        # we use rectangles because they are the perfect placeholder
+        # for custom painting functions without requiring sub-classing
+        # Clutter::Actor
+        my $actor = Clutter::Rectangle->new();
+
+        my $size = $index
+                 * (CIRCLE_W + CIRCLE_G)
+                 * 2;
+
+        $actor->set_size($size, $size);
+        $actor->set_position(
+            SCREEN_W - $size / 2,
+            SCREEN_H - $size / 2
+        );
+
+        $stage->add($actor);
+
+        $actor->{angle} = rand(90.0);
+
+        $actor->signal_connect(paint => sub {
+            my $radius = $actor->get_width() / 2;
+
+            # override the color of the material
+            Clutter::Cogl->set_source_color([ 255, 255, 255, 224 ]);
+
+            # draw each circle segment
+            foreach my $i (1 .. CIRCLE_S) {
+                $actor->{angle} += (pi2 / CIRCLE_S);
+
+                my $a0 = $actor->{angle};
+                my $a1 = $a0 + (pi2 / CIRCLE_S) / 2;
+
+                # move to the segment start
+                Clutter::Cogl::Path->move_to(
+                    (($radius - CIRCLE_W) * cos($a0)) + $radius,
+                    (($radius - CIRCLE_W) * sin($a0)) + $radius,
+                );
+
+                # upper arc
+                Clutter::Cogl::Path->arc(
+                    $radius,
+                    $radius,
+                    $radius,
+                    $radius,
+                    ($a0 * 180 / pi),
+                    ($a1 * 180 / pi),
+                );
+
+                # line down
+                Clutter::Cogl::Path->line_to(
+                    (($radius - CIRCLE_W) * cos($a1)) + $radius,
+                    (($radius - CIRCLE_W) * sin($a1)) + $radius,
+                );
+
+                # lower arc, backwards
+                Clutter::Cogl::Path->arc(
+                    $radius,
+                    $radius,
+                    $radius - CIRCLE_W,
+                    $radius - CIRCLE_W,
+                    ($a1 * 180 / pi),
+                    ($a0 * 180 / pi),
+                );
+
+                # line up, by closing the path
+                Clutter::Cogl::Path->close();
+
+                # fill the shape using the default color
+                Clutter::Cogl::Path->fill();
+
+                # store the last angle for the next iteration
+                $actor->{angle} = $a0;
+            }
+
+            # stop the signal emission here, to prevent the default
+            # ::paint handler of Clutter::Rectangle from running
+            $actor->signal_stop_emission_by_name('paint');
+        });
+
+        # let the actors spin
+        my $behaviour = Clutter::Behaviour::Rotate->new(
+            Clutter::Alpha->new($timeline, 'linear'),
+            'z-axis',
+            ($index % 2) ? 'cw' : 'ccw',
+            0.0, 0.0,
+        );
+        $behaviour->set_center($size / 2, $size / 2, 0);
+        $behaviour->apply($actor);
+
+        # it's importat that we keep a back pointer here, to avoid
+        # the behaviour reference to get out of scope and be collected
+        $actor->{behaviour} = $behaviour;
+    }
+
+    $stage->show_all();
+
+    $timeline->start();
+
+    Clutter->main();
+
+    0;
+}
+
+exit(main());

Modified: branches/upstream/libclutter-perl/current/examples/custom-container.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclutter-perl/current/examples/custom-container.pl?rev=49122&op=diff
==============================================================================
--- branches/upstream/libclutter-perl/current/examples/custom-container.pl (original)
+++ branches/upstream/libclutter-perl/current/examples/custom-container.pl Mon Dec 21 21:52:01 2009
@@ -126,14 +126,6 @@
     }
 }
 
-sub FOREACH_WITH_INTERNALS {
-    my ($self, $func, $data) = @_;
-
-    foreach my $child (@{$self->{children}}) {
-        &$func ($child, $data);
-    }
-}
-
 sub CREATE_CHILD_META {
     my ($self, $actor) = @_;
 

Modified: branches/upstream/libclutter-perl/current/examples/hello.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclutter-perl/current/examples/hello.pl?rev=49122&op=diff
==============================================================================
--- branches/upstream/libclutter-perl/current/examples/hello.pl (original)
+++ branches/upstream/libclutter-perl/current/examples/hello.pl Mon Dec 21 21:52:01 2009
@@ -10,11 +10,15 @@
 use strict;
 use warnings;
 
+use constant FONT_DESC  => 'Sans 96px';
+
+use Math::Trig qw( :pi );
+use Glib qw( :constants );
 use Clutter qw( :init );
 use Clutter::Keysyms;
 
 my $stage = Clutter::Stage->get_default();
-$stage->set_color(Clutter::Color->parse('DarkSlateGray'));
+$stage->set_color(Clutter::Color->from_string('DarkSlateGray'));
 $stage->signal_connect('button-press-event' => sub { Clutter->main_quit() });
 $stage->signal_connect('key-press-event'    => sub {
     my ($stage, $event) = @_;
@@ -23,13 +27,85 @@
         if ($event->keyval == $Clutter::Keysyms{Escape});
 });
 $stage->set_size(800, 600);
+$stage->show();
 
-my $label = Clutter::Label->new("Sans 30", "Hello, Clutter!");
-$label->set_color(Clutter::Color->new(0xff, 0xcc, 0xcc, 0xdd));
-$label->set_position(($stage->get_width()  - $label->get_width())  / 2,
-                     ($stage->get_height() - $label->get_height()) / 2);
-$stage->add($label);
-$stage->show_all();
+my $timeline = Clutter::Timeline->new(3000);
+$timeline->set_loop(TRUE);
+
+my $alpha = Clutter::Alpha->new($timeline);
+$alpha->set_func(sub {
+    return sin($alpha->get_timeline()->get_progress() * pi);
+});
+
+my $x_offset = 64;
+my $y_offset = $stage->get_height() / 2;
+
+my @str = split(//, 'hello, clutter!', -1);
+my $idx = 0;
+foreach my $char (@str) {
+    my $color = Clutter::Color->new(
+        int(rand(255)),
+        int(rand(255)),
+        int(rand(255)),
+        255,
+    );
+    my $text = Clutter::Text->new(FONT_DESC, "$char", $color);
+
+    $text->set_position($x_offset, $y_offset);
+    $stage->add($text);
+
+    my $behaviour;
+
+    if ($idx % 7 == 0) {
+        $behaviour = Clutter::Behaviour::Opacity->new(
+            $alpha,
+            255, int(rand(64)),
+        );
+    }
+    elsif ($idx % 3 == 0) {
+        $behaviour = Clutter::Behaviour::Rotate->new(
+            $alpha,
+            'z-axis',
+            ($idx % 2) ? 'cw' : 'ccw',
+            0.0, 0.0,
+        );
+        $behaviour->set_center(
+            $text->get_width(),
+            $text->get_height(),
+            0,
+        );
+    }
+    elsif ($idx % 2 == 0) {
+        my $final = ($idx % 5) ? 1.0 + rand(1.0) : rand(0.8);
+        $behaviour = Clutter::Behaviour::Scale->new(
+            $alpha,
+            1.0,    1.0,
+            $final, $final,
+        );
+        $text->move_anchor_point_from_gravity('center');
+    }
+    else {
+        my ($x, $y) = (int(rand(50)), int(rand(50)));
+        $behaviour = Clutter::Behaviour::Path->new(
+            $alpha,
+            Clutter::Path->new(
+                [ 'move-to', [ [ $x_offset     , $y_offset      ] ] ],
+                [ 'line-to', [ [ $x_offset + $x, $y_offset - $y ] ] ],
+                [ 'line-to', [ [ $x_offset + $x, $y_offset + $y ] ] ],
+                [ 'line-to', [ [ $x_offset - $x, $y_offset + $y ] ] ],
+            ),
+        );
+    }
+
+    $behaviour->apply($text);
+    $text->{behaviour} = $behaviour;
+
+    $x_offset += $text->get_width() - 5;
+
+    $idx += 1;
+}
+
+$timeline->start();
 
 Clutter->main();
 

Modified: branches/upstream/libclutter-perl/current/lib/Clutter.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclutter-perl/current/lib/Clutter.pm?rev=49122&op=diff
==============================================================================
--- branches/upstream/libclutter-perl/current/lib/Clutter.pm (original)
+++ branches/upstream/libclutter-perl/current/lib/Clutter.pm Mon Dec 21 21:52:01 2009
@@ -41,7 +41,7 @@
 # this scheme allocates enough space for ten releases of the bindings
 # for each point release of libclutter, which should be enough even in
 # case of brown paper bag releases. -- ebassi
-our $VERSION = '1.001';
+our $VERSION = '1.002';
 $VERSION = eval $VERSION;
 
 our @ISA = qw( DynaLoader Exporter );

Modified: branches/upstream/libclutter-perl/current/xs/ClutterAnimation.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclutter-perl/current/xs/ClutterAnimation.xs?rev=49122&op=diff
==============================================================================
--- branches/upstream/libclutter-perl/current/xs/ClutterAnimation.xs (original)
+++ branches/upstream/libclutter-perl/current/xs/ClutterAnimation.xs Mon Dec 21 21:52:01 2009
@@ -29,6 +29,11 @@
     # start the animation
     $animation->get_timeline()->start();
 
+    # set the object as reactive when the animation ends
+    $animation->signal_connect(completed => sub {
+        $animation->get_object()->set_reactive(TRUE);
+    })
+
 =head1 DESCRIPTION
 
 B<Clutter::Animation> is an class providing simple, implicit animations
@@ -41,6 +46,8 @@
 
 The duration of the animation is set using Clutter::Animation::set_duration().
 The easing mode of the animation is set using Clutter::Animation::set_mode().
+
+=head2 Controlling the Animation
 
 If you want to control the animation you should retrieve the
 L<Clutter::Timeline> using Clutter::Animation::get_timeline() and then
@@ -60,16 +67,52 @@
 Clutter::Animatable interface it is possible for that instance to control
 the way the initial and final states are interpolated.
 
+=head2 Changing the Animation
+
+The initial and final value of a property bound to the Animation are
+controlled by a L<Clutter::Interval> instance. You can retrieve the
+Interval instance and change the values, or you can change the Interval
+instance itself:
+
+    # increase the scaling factor
+    $animation->get_interval('scale-x')->set_final_value(2.5);
+    $animation->get_interval('scale-y')->set_final_value(2.5);
+
+    # change the opacity interval
+    $cur_value = $animation->get_object()->get_opacity();
+    $interval = Clutter::Interval->new('Glib::Uchar');
+    $interval->set_interval($cur_value, 128);
+    $animation->update_interval('opacity', $interval);
+
+=head2 Differences between Animation and Behaviour
+
 Clutter::Animation is distinguished from L<Clutter::Behaviour> because
 the former can only control Glib::Object properties of a single Glib::Object
 instance, while the latter can control multiple properties using accessor
 functions inside the L<Clutter::Behaviour>::ALPHA_NOTIFY virtual function,
 and can control multiple L<Clutter::Actor>s at the same time.
 
+=head2 Convenience API
+
 For convenience, it is possible to use the Clutter::Actor::animate()
 method which will take care of setting up and tearing down a
 Clutter::Animation instance and animate an actor between its current
-state and the specified final state.
+state and the specified final state:
+
+    $texture->animate(
+        'ease-out-cubic', 500,
+        scale_x => 2.0,
+        scale_y => 2.0,
+        opacity => 255
+    )->signal_connect(completed => sub { $texture->set_reactive(TRUE) })
+
+The example above reproduces the same animation as the one in the Synopsis.
+
+The Clutter::Animation instance created by Clutter::Actor::animate() is
+managed by the animate() method itself and it is guaranteed to be valid for
+as long as the animation is running; once the animation emits the I<completed>
+signal, the animation will still be valid from within handlers connected to
+that signal, until the default signal handler is executed.
 
 =cut
 
@@ -85,28 +128,59 @@
 =for enum Clutter::AnimationMode
 =cut
 
+=for apidoc
+Creates a new Clutter::Animation
+=cut
 ClutterAnimation *clutter_animation_new (class);
     C_ARGS:
         /* void */
 
+=for apidoc
+Sets the object to be animated. The I<object> must be set before calling
+Clutter::Animation::bind() or Clutter::Animation::bind_interval()
+=cut
 void clutter_animation_set_object (ClutterAnimation *animation, GObject *object);
 
+=for apidoc
+Retrieves the object set using Clutter::Animation::set_object()
+=cut
 GObject *clutter_animation_get_object (ClutterAnimation *animation);
 
+=for apidoc
+Sets the easing mode of I<animation>. The easing mode can either be a value
+of the Clutter::AnimationMode enumeration or the logical id returned by
+Clutter::Alpha::register_func() for custom easing modes
+=cut
 void clutter_animation_set_mode (ClutterAnimation *animation, SV *mode);
     CODE:
         clutter_animation_set_mode (animation, clutter_perl_animation_mode_from_sv (mode));
 
+=for apidoc
+Retrieves the easing mode as set using Clutter::Animation::set_mode()
+=cut
 SV *clutter_animation_get_mode (ClutterAnimation *animation);
     CODE:
         clutter_perl_animation_mode_to_sv (clutter_animation_get_mode (animation));
 
+=for apidoc
+Sets the duration of I<animation>, in milliseconds
+=cut
 void clutter_animation_set_duration (ClutterAnimation *animation, gint msecs);
 
+=for apidoc
+Gets the duration set using Clutter::Animation::set_duration()
+=cut
 guint clutter_animation_get_duration (ClutterAnimation *animation);
 
+=for apidoc
+Sets whether I<animation> should loop. A looping animation will never emit
+the I<completed> signal
+=cut
 void clutter_animation_set_loop (ClutterAnimation *animation, gboolean loop);
 
+=for apidoc
+Retrieves whether I<animation> is looping or not
+=cut
 gboolean clutter_animation_get_loop (ClutterAnimation *animation);
 
 void clutter_animation_set_timeline (ClutterAnimation *animation, ClutterTimeline *timeline);
@@ -117,6 +191,23 @@
 
 ClutterAlpha *clutter_animation_get_alpha (ClutterAnimation *animation);
 
+=for apidoc
+Binds I<property_name> to the animation.
+
+An implicit L<Clutter::Interval> will be created which will use:
+
+=over 4
+
+=item the type of the property
+
+=item the current value as the initial value
+
+=item the passed I<final> value as the final value
+
+=back
+
+This method will croak if I<animation> does not have an object set.
+=cut
 ClutterAnimation *clutter_animation_bind (animation, property_name, final)
         ClutterAnimation *animation
         const gchar *property_name
@@ -164,5 +255,8 @@
 
 ClutterInterval_noinc *clutter_animation_get_interval (ClutterAnimation *animation, const gchar *property_name);
 
+=for apidoc
+Emits the I<completed> signal on I<animation>
+=cut
 void clutter_animation_completed (ClutterAnimation *animation);
 

Modified: branches/upstream/libclutter-perl/current/xs/ClutterContainer.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclutter-perl/current/xs/ClutterContainer.xs?rev=49122&op=diff
==============================================================================
--- branches/upstream/libclutter-perl/current/xs/ClutterContainer.xs (original)
+++ branches/upstream/libclutter-perl/current/xs/ClutterContainer.xs Mon Dec 21 21:52:01 2009
@@ -33,6 +33,13 @@
        HV * stash = gperl_object_stash_from_type (G_OBJECT_TYPE (obj)); \
        GV * slot = gv_fetchmethod (stash, name);
 
+#define GET_METHOD_WITH_FALLBACK(obj, name, fallback) \
+        HV * stash = gperl_object_stash_from_type (G_OBJECT_TYPE (obj)); \
+        GV * slot = gv_fetchmethod (stash, name); \
+        if (slot == NULL || !GvCV (slot)) { \
+          slot = gv_fetchmethod (stash, fallback); \
+        }
+
 #define METHOD_EXISTS (slot && GvCV (slot))
 
 #define PREP(obj) \
@@ -167,7 +174,9 @@
                                               ClutterCallback   callback,
                                               gpointer          callback_data)
 {
-  GET_METHOD (container, "FOREACH_WITH_INTERNALS");
+  GET_METHOD_WITH_FALLBACK (container,
+                            "FOREACH_WITH_INTERNALS",
+                            "FOREACH");
 
   if (METHOD_EXISTS)
     {




More information about the Pkg-perl-cvs-commits mailing list