API  0.9.10
CPViewAnimator.j File Reference

Go to the source code of this file.

Variables

FrameUpdater prototype addTarget
 
var createUpdateFrame
 
var CSSStringFromCGAffineTransform
 
var DEFAULT_CSS_PROPERTIES = nil
 
FrameUpdater prototype description
 
var FRAME_UPDATERS = {}
 
var frameOriginToCSSTransformMatrix
 
var frameToCSSTranslationTransformMatrix
 
var FrameUpdater
 
FrameUpdater prototype identifier
 
FrameUpdater prototype start
 
FrameUpdater prototype stop
 
var transformFrameToHeight
 
var transformFrameToWidth
 
var transformSizeToHeight
 
var transformSizeToWidth
 
FrameUpdater prototype updateFunction
 

Variable Documentation

◆ addTarget

FrameUpdater prototype addTarget
Initial value:
= function(target, keyPath, duration)
{
var callback = createUpdateFrame(target, keyPath);
if (callback)
{
this._duration = MAX(this._duration, duration);
this._targets.push(target);
this._callbacks.push(callback);
}
}
var createUpdateFrame

Definition at line 371 of file CPViewAnimator.j.

◆ createUpdateFrame

var createUpdateFrame

Definition at line 383 of file CPViewAnimator.j.

◆ CSSStringFromCGAffineTransform

var CSSStringFromCGAffineTransform
Initial value:
= function(anAffineTransform)
{
return "matrix(" + anAffineTransform.a + ", " + anAffineTransform.b + ", " + anAffineTransform.c + ", " + anAffineTransform.d + ", " + anAffineTransform.tx + (CPBrowserIsEngine(CPGeckoBrowserEngine) ? "px, " : ", ") + anAffineTransform.ty + (CPBrowserIsEngine(CPGeckoBrowserEngine) ? "px)" : ")");
}
CPGeckoBrowserEngine
function CPBrowserIsEngine(anEngine)

Definition at line 211 of file CPViewAnimator.j.

◆ DEFAULT_CSS_PROPERTIES

var DEFAULT_CSS_PROPERTIES = nil

Definition at line 3 of file CPViewAnimator.j.

◆ description

FrameUpdater prototype description
Initial value:
= function()
{
return "<timer " + this._identifier + " " + this._targets.map(function(t){return [t debug_description];}) + ">";
}

Definition at line 366 of file CPViewAnimator.j.

◆ FRAME_UPDATERS

var FRAME_UPDATERS = {}

Definition at line 4 of file CPViewAnimator.j.

◆ frameOriginToCSSTransformMatrix

var frameOriginToCSSTransformMatrix
Initial value:
= function(start, current)
{
var affine = CGAffineTransformMakeTranslation(current.x - start.x, current.y - start.y);
}
var CSSStringFromCGAffineTransform
function CGAffineTransformMakeTranslation(tx, ty)
FrameUpdater prototype start

Definition at line 216 of file CPViewAnimator.j.

◆ frameToCSSTranslationTransformMatrix

var frameToCSSTranslationTransformMatrix
Initial value:
= function(start, current)
{
var affine = CGAffineTransformMakeTranslation(current.origin.x - start.origin.x, current.origin.y - start.origin.y);
}
var CSSStringFromCGAffineTransform
function CGAffineTransformMakeTranslation(tx, ty)
FrameUpdater prototype start

Definition at line 223 of file CPViewAnimator.j.

◆ FrameUpdater

var FrameUpdater
Initial value:
= function(anIdentifier)
{
this._identifier = anIdentifier;
this._requestId = null;
this._duration = 0;
this._stop = false;
this._targets = [];
this._callbacks = [];
var frameUpdater = this;
this._updateFunction = function(timestamp)
{
if (frameUpdater._startDate == null)
frameUpdater._startDate = timestamp;
if (frameUpdater._stop)
return;
for (var i = 0; i < frameUpdater._callbacks.length; i++)
frameUpdater._callbacks[i]();
if (timestamp - frameUpdater._startDate < frameUpdater._duration * 1000)
window.requestAnimationFrame(frameUpdater._updateFunction);
};
}

Definition at line 313 of file CPViewAnimator.j.

◆ identifier

FrameUpdater prototype identifier
Initial value:
= function()
{
return this._identifier;
}

Definition at line 361 of file CPViewAnimator.j.

◆ start

FrameUpdater prototype start
Initial value:
= function()
{
this._requestId = window.requestAnimationFrame(this._updateFunction);
}

Definition at line 340 of file CPViewAnimator.j.

◆ stop

FrameUpdater prototype stop
Initial value:
= function()
{
CPLog.warn("STOP FrameUpdater" + this._identifier);
if (window.cancelAnimationFrame)
window.cancelAnimationFrame(this._requestId);
this._stop = true;
}

Definition at line 345 of file CPViewAnimator.j.

◆ transformFrameToHeight

var transformFrameToHeight
Initial value:
= function(start, current)
{
return current.size.height + "px";
}
FrameUpdater prototype start

Definition at line 196 of file CPViewAnimator.j.

◆ transformFrameToWidth

var transformFrameToWidth
Initial value:
= function(start, current)
{
return current.size.width + "px";
}
FrameUpdater prototype start

Definition at line 191 of file CPViewAnimator.j.

◆ transformSizeToHeight

var transformSizeToHeight
Initial value:
= function(start, current)
{
return current.height + "px";
}
FrameUpdater prototype start

Definition at line 206 of file CPViewAnimator.j.

◆ transformSizeToWidth

var transformSizeToWidth
Initial value:
= function(start, current)
{
return current.width + "px";
}
FrameUpdater prototype start

Definition at line 201 of file CPViewAnimator.j.

◆ updateFunction

FrameUpdater prototype updateFunction
Initial value:
= function()
{
return this._updateFunction;
}

Definition at line 356 of file CPViewAnimator.j.