File: Clutter.js

package info (click to toggle)
seed 3.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,900 kB
  • sloc: ansic: 24,336; sh: 11,196; makefile: 773; xml: 187; python: 173
file content (67 lines) | stat: -rw-r--r-- 1,826 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Clutter = imports.gi.Clutter;

var animations = new Array();

Clutter.Actor.prototype.animate = function(mode, duration, json)
{
    var properties = new Array();
    var endvalues = new Array();
    for (var prop in json){
	properties.push(prop);
	endvalues.push(new Array(this.__property_type(prop), json[prop]));
    }
    
    var animation =  this.animatev(mode, duration, properties.length, 
				   properties, endvalues);
    animations.push(animation);
    animation.timeline.signal["completed"].connect(
	function(timeline, obj){
	    animations.splice(animations.indexOf(animation),1);
	}, this);
    
    return animation;
}

Clutter.Actor.prototype.animate_with_timeline = function(mode, timeline, json)
{
    var properties = new Array();
    var endvalues = new Array();
    for (var prop in json)	{
	properties.push(prop);
	endvalues.push(new Array(this.__property_type(prop), json[prop]));
    }

    var animation = 
	this.animate_with_timelinev(mode, timeline, properties.length, 
				    properties, endvalues);
    
    animations.push(animation);
    animation.timeline.signal["completed"].connect(
	function(timeline, obj){
	    animations.splice(animations.indexOf(animation),1);
	}, this);
    
    return animation;
}

Clutter.Actor.prototype.animate_with_alpha = function(alpha, json)
{
    var properties = new Array();
    var endvalues = new Array();
    for (var prop in json)	{
	properties.push(prop);
	endvalues.push(new Array(this.__property_type(prop), json[prop]));
    }

    var animation = 
	this.animate_with_alphav(alpha, properties.length, 
				    properties, endvalues);
    
    animations.push(animation);
    animation.timeline.signal["completed"].connect(
	function(timeline, obj){
	    animations.splice(animations.indexOf(animation),1);
	}, this);
    
    return animation;
}