API  0.9.10
CALayer.j File Reference

Go to the source code of this file.

Macros

#define ADJUST_CONTENTS_ZINDEX(aLayer)
 
#define DOM(aLayer)   aLayer._DOMElement
 

Functions

void addSublayer: (CALayer aLayer)
 
CGAffineTransform affineTransform ()
 
CGPoint anchorPoint ()
 
CPColor backgroundColor ()
 
CGRect backingStoreFrame ()
 
CGRect bounds ()
 
id CALayer: (id CPObject)
 
void composite ()
 
BOOL containsPoint: (CGPoint aPoint)
 
CGImage contents ()
 
CGPoint convertPoint:fromLayer: (CGPoint aPoint, [fromLayer] CALayer aLayer)
 
CGPoint convertPoint:toLayer: (CGPoint aPoint, [toLayer] CALayer aLayer)
 
CGRect convertRect:fromLayer: (CGRect aRect, [fromLayer] CALayer aLayer)
 
CGRect convertRect:toLayer: (CGRect aRect, [toLayer] CALayer aLayer)
 
id delegate ()
 
void display ()
 
void drawInContext: (CGContext aContext)
 
id drawInContext:displayLayer: (void delegate, [displayLayer] CALayer layer)
 
void drawLayer:inContext: (CALayer layer, [inContext] CGContextRef ctx)
 
CGRect frame ()
 
BOOL hidden ()
 
CALayer hitTest: (CGPoint aPoint)
 
id init ()
 
void insertSublayer:above: (CALayer aLayer, [above] CALayer aSublayer)
 
void insertSublayer:atIndex: (CALayer aLayer, [atIndex] CPUInteger anIndex)
 
void insertSublayer:below: (CALayer aLayer, [below] CALayer aSublayer)
 
BOOL isHidden ()
 
CALayer layer ()
 
BOOL needsDisplayOnBoundsChange ()
 
float opacity ()
 
CGPoint position ()
 
void registerRunLoopUpdateWithMask: (unsigned anUpdateMask)
 
void removeFromSuperlayer ()
 
void replaceSublayer:with: (CALayer aSublayer, [with] CALayer aLayer)
 
void runLoopUpdateLayers ()
 
void setAffineTransform: (CGAffineTransform anAffineTransform)
 
void setAnchorPoint: (CGPoint anAnchorPoint)
 
void setBackgroundColor: (CPColor aColor)
 
void setBackingStoreFrame: (CGRect aFrame)
 
void setBounds: (CGRect aBounds)
 
void setContents: (CGImage contents)
 
void setDelegate: (id aDelegate)
 
void setFrame: (CGRect aFrame)
 
void setHidden: (BOOL isHidden)
 
void setMasksToBounds: (BOOL masksToBounds)
 
void setNeedsComposite ()
 
void setNeedsDisplay ()
 
void setNeedsDisplayInRect: (CGRect aRect)
 
void setNeedsDisplayOnBoundsChange: (BOOL needsDisplayOnBoundsChange)
 
void setOpacity: (float anOpacity)
 
void setPosition: (CGPoint aPosition)
 
void setSublayerTransform: (CGAffineTransform anAffineTransform)
 
void setZPosition: (int aZPosition)
 
CPArray sublayers ()
 
CGAffineTransform sublayerTransform ()
 
CALayer superlayer ()
 
CGAffineTransform transformToLayer ()
 

Variables

var CALayerCompositeUpdateMask = 16
 
var CALayerDisplayUpdateMask = 8
 
var CALayerDOMUpdateMask = CALayerZPositionUpdateMask | CALayerFrameOriginUpdateMask | CALayerFrameSizeUpdateMask
 
var CALayerFrameOriginUpdateMask = 1
 
var CALayerFrameSizeUpdateMask = 2
 
var CALayerGeometryAffineTransformMask = 8
 
var CALayerGeometryAnchorPointMask = 4
 
var CALayerGeometryBoundsMask = 1
 
var CALayerGeometryParentSublayerTransformMask = 16
 
var CALayerGeometryPositionMask = 2
 
var CALayerRegisteredRunLoopUpdates = nil
 
var CALayerZPositionUpdateMask = 4
 
A CALayer is similar to a CPView
 
If the delegate implements this method
 
var USE_BUFFER = NO
 

Macro Definition Documentation

◆ ADJUST_CONTENTS_ZINDEX

#define ADJUST_CONTENTS_ZINDEX (   aLayer)
Value:
if (_DOMContentsElement && aLayer._zPosition > _DOMContentsElement.style.zIndex)\
_DOMContentsElement.style.zIndex -= 100.0;\

Definition at line 651 of file CALayer.j.

◆ DOM

#define DOM (   aLayer)    aLayer._DOMElement

Definition at line 26 of file CALayer.j.

Function Documentation

◆ addSublayer:()

void addSublayer: ( CALayer  aLayer)
virtual

Adds the specified layer as a sublayer of the receiver.

Definition at line 658 of file CALayer.j.

◆ affineTransform()

CGAffineTransform affineTransform ( )
virtual

Returns the layer's affine transform.

Definition at line 293 of file CALayer.j.

◆ anchorPoint()

CGPoint anchorPoint ( )
virtual

Returns the layer's anchor point.

Definition at line 271 of file CALayer.j.

◆ backgroundColor()

CPColor backgroundColor ( )
virtual

Returns the layer's background color.

Definition at line 629 of file CALayer.j.

◆ backingStoreFrame()

CGRect backingStoreFrame ( )
virtual

The Backing Store Frame specifies the frame of the actual backing store used to contain this layer. Naturally, by default it is the same as the frame, however, users can specify their own custom Backing Store Frame in order to speed up certain operations, such as live transformation.

Returns
the backing store frame

Definition at line 374 of file CALayer.j.

◆ bounds()

CGRect bounds ( )
virtual

Returns the layer's bound.

Definition at line 203 of file CALayer.j.

◆ CALayer:()

id CALayer: ( id  CPObject)
virtual

Definition at line 56 of file CALayer.j.

◆ composite()

void composite ( )
virtual

Definition at line 442 of file CALayer.j.

◆ containsPoint:()

BOOL containsPoint: ( CGPoint  aPoint)
virtual

Returns YES if the layer contains the point.

Parameters
aPointthe point to test

Definition at line 912 of file CALayer.j.

◆ contents()

CGImage contents ( )
virtual

Returns the CGImage contents of this layer. The default contents are nil.

Definition at line 419 of file CALayer.j.

◆ convertPoint:fromLayer:()

CGPoint convertPoint:fromLayer: ( CGPoint  aPoint,
[fromLayer] CALayer  aLayer 
)
virtual

Converts the point from the specified layer's coordinate system into the receiver's coordinate system.

Parameters
aPointthe point to convert
aLayerthe layer coordinate system to convert from
Returns
the converted point

Definition at line 869 of file CALayer.j.

◆ convertPoint:toLayer:()

CGPoint convertPoint:toLayer: ( CGPoint  aPoint,
[toLayer] CALayer  aLayer 
)
virtual

Converts the point from the receiver's coordinate system to the specified layer's coordinate system.

Parameters
aPointthe point to convert
aLayerthe layer coordinate system to convert to
Returns
the converted point

Definition at line 880 of file CALayer.j.

◆ convertRect:fromLayer:()

CGRect convertRect:fromLayer: ( CGRect  aRect,
[fromLayer] CALayer  aLayer 
)
virtual

Converts the rectangle from the specified layer's coordinate system to the receiver's coordinate system.

Parameters
aRectthe rectangle to convert
aLayerthe layer coordinate system to convert from
Returns
the converted rectangle

Definition at line 891 of file CALayer.j.

◆ convertRect:toLayer:()

CGRect convertRect:toLayer: ( CGRect  aRect,
[toLayer] CALayer  aLayer 
)
virtual

Converts the rectangle from the receiver's coordinate system to the specified layer's coordinate system.

Parameters
aRectthe rectangle to convert
aLayerthe layer coordinate system to convert to
Returns
the converted rectangle

Definition at line 902 of file CALayer.j.

◆ delegate()

id delegate ( )
virtual

Returns the layer's delegate

Definition at line 965 of file CALayer.j.

◆ display()

void display ( )
virtual

Displays the contents of this layer.

Definition at line 488 of file CALayer.j.

◆ drawInContext:()

void drawInContext: ( CGContext  aContext)
virtual

Draws this layer's contents into the specified context.

Parameters
aContextthe context to draw the layer into

Definition at line 538 of file CALayer.j.

◆ drawInContext:displayLayer:()

id drawInContext:displayLayer: ( void  delegate,
[displayLayer] CALayer  layer 
)
virtual

◆ drawLayer:inContext:()

void drawLayer:inContext: ( CALayer  layer,
[inContext] CGContextRef  ctx 
)
virtual

◆ frame()

CGRect frame ( )
virtual

Returns the layer's frame.

The frame defines the bounding box of the layer: the smallest possible rectangle that could fit this layer after transform properties are applied in superlayer coordinates.

Definition at line 358 of file CALayer.j.

◆ hidden()

BOOL hidden ( )
virtual

Returns YES if the layer is hidden.

Definition at line 589 of file CALayer.j.

◆ hitTest:()

CALayer hitTest: ( CGPoint  aPoint)
virtual

Returns the farthest descendant of this layer that contains the specified point.

Parameters
aPointthe point to test
Returns
the containing layer or nil if there was no hit.

Definition at line 922 of file CALayer.j.

◆ init()

id init ( )
virtual

Initializes the animation layer.

Definition at line 126 of file CALayer.j.

◆ insertSublayer:above:()

void insertSublayer:above: ( CALayer  aLayer,
[above] CALayer  aSublayer 
)
virtual

Inserts a layer above another layer.

Parameters
aLayerthe layer to insert
aSublayerthe layer to insert above
Exceptions
CALayerNotFoundExceptionif aSublayer is not in the array of sublayers

Definition at line 743 of file CALayer.j.

◆ insertSublayer:atIndex:()

void insertSublayer:atIndex: ( CALayer  aLayer,
[atIndex] CPUInteger  anIndex 
)
virtual

Inserts the specified layer as a sublayer into the specified index.

Parameters
aLayerthe layer to insert
anIndexthe index to insert the layer at

Definition at line 685 of file CALayer.j.

◆ insertSublayer:below:()

void insertSublayer:below: ( CALayer  aLayer,
[below] CALayer  aSublayer 
)
virtual

Inserts a layer below another layer.

Parameters
aLayerthe layer to insert
aSublayerthe layer to insert below
Exceptions
CALayerNotFoundExceptionif aSublayer is not in the array of sublayers

Definition at line 730 of file CALayer.j.

◆ isHidden()

BOOL isHidden ( )
virtual

Returns YES if the layer is hidden.

Definition at line 597 of file CALayer.j.

◆ layer()

CALayer layer ( )
staticvirtual

Returns a new animation layer.

Definition at line 118 of file CALayer.j.

◆ needsDisplayOnBoundsChange()

BOOL needsDisplayOnBoundsChange ( )
virtual

Returns YES if the display should be redrawn on a bounds change.

Definition at line 847 of file CALayer.j.

◆ opacity()

float opacity ( )
virtual

Returns the opacity of the layer. The value is between 0.0 (transparent) and 1.0 (opaque).

Definition at line 556 of file CALayer.j.

◆ position()

CGPoint position ( )
virtual

Returns the layer's position

Definition at line 225 of file CALayer.j.

◆ registerRunLoopUpdateWithMask:()

void registerRunLoopUpdateWithMask: ( unsigned  anUpdateMask)
virtual

Definition at line 805 of file CALayer.j.

◆ removeFromSuperlayer()

void removeFromSuperlayer ( )
virtual

Removes the receiver from its superlayer.

Definition at line 666 of file CALayer.j.

◆ replaceSublayer:with:()

void replaceSublayer:with: ( CALayer  aSublayer,
[with] CALayer  aLayer 
)
virtual

Replaces a sublayer.

Parameters
aSublayerthe layer to insert
aLayerthe layer to replace

Definition at line 758 of file CALayer.j.

◆ runLoopUpdateLayers()

void runLoopUpdateLayers ( )
staticvirtual

Definition at line 780 of file CALayer.j.

◆ setAffineTransform:()

void setAffineTransform: ( CGAffineTransform  anAffineTransform)
virtual

Sets the affine transform applied to this layer.

Parameters
anAffineTransformthe new affine transform

Definition at line 280 of file CALayer.j.

◆ setAnchorPoint:()

void setAnchorPoint: ( CGPoint  anAnchorPoint)
virtual

Sets the layer's anchor point. The default point is [0.5, 0.5].

Parameters
anAnchorPointthe layer's new anchor point

Definition at line 248 of file CALayer.j.

◆ setBackgroundColor:()

void setBackgroundColor: ( CPColor  aColor)
virtual

Sets the layer's background color.

Parameters
aColorthe new background color

Definition at line 619 of file CALayer.j.

◆ setBackingStoreFrame:()

void setBackingStoreFrame: ( CGRect  aFrame)
virtual

Sets the frame's backing store.

Parameters
aFramethe new backing store.

Definition at line 383 of file CALayer.j.

◆ setBounds:()

void setBounds: ( CGRect  aBounds)
virtual

Sets the bounds (origin and size) of the rectangle.

Parameters
aBoundsthe new bounds for the layer

Definition at line 175 of file CALayer.j.

◆ setContents:()

void setContents: ( CGImage  contents)
virtual

Sets the image contents of this layer.

Parameters
contentsthe image to display

Definition at line 428 of file CALayer.j.

◆ setDelegate:()

void setDelegate: ( id  aDelegate)
virtual

Sets the delegate for this layer.

Parameters
aDelegatethe delegate

Definition at line 948 of file CALayer.j.

◆ setFrame:()

void setFrame: ( CGRect  aFrame)
virtual

Sets the frame of the layer. The frame defines a bounding rectangle in the superlayer's coordinate system.

Parameters
aFramethe new frame rectangle

Definition at line 346 of file CALayer.j.

◆ setHidden:()

void setHidden: ( BOOL  isHidden)
virtual

Sets whether the layer is hidden.

Parameters
isHiddenYES means the layer will be hidden. NO means the layer will be visible.

Definition at line 580 of file CALayer.j.

◆ setMasksToBounds:()

void setMasksToBounds: ( BOOL  masksToBounds)
virtual

Sets whether content that goes lies outside the bounds is hidden or visible.

Parameters
masksToBoundsYES hides the excess content. NO makes it visible.

Definition at line 606 of file CALayer.j.

◆ setNeedsComposite()

void setNeedsComposite ( )
virtual

Definition at line 822 of file CALayer.j.

◆ setNeedsDisplay()

void setNeedsDisplay ( )
virtual

Marks the layer as needing to be redrawn.

Definition at line 830 of file CALayer.j.

◆ setNeedsDisplayInRect:()

void setNeedsDisplayInRect: ( CGRect  aRect)
virtual

Marks the specified rectangle as needing to be redrawn.

Parameters
aRectthe area that needs to be redrawn.

Definition at line 856 of file CALayer.j.

◆ setNeedsDisplayOnBoundsChange:()

void setNeedsDisplayOnBoundsChange: ( BOOL  needsDisplayOnBoundsChange)
virtual

Sets whether the layer needs to be redrawn when its bounds are changed.

Parameters
needsDisplayOnBoundsChangeYES means the display is redraw on a bounds change.

Definition at line 839 of file CALayer.j.

◆ setOpacity:()

void setOpacity: ( float  anOpacity)
virtual

Sets the opacity for the layer.

Parameters
anOpacitythe new opacity (between 0.0 (transparent) and 1.0 (opaque)).

Definition at line 565 of file CALayer.j.

◆ setPosition:()

void setPosition: ( CGPoint  aPosition)
virtual

Sets the layer's position.

Parameters
aPositionthe layer's new position

Definition at line 212 of file CALayer.j.

◆ setSublayerTransform:()

void setSublayerTransform: ( CGAffineTransform  anAffineTransform)
virtual

Sets the affine transform that gets applied to all the sublayers.

Parameters
anAffineTransformthe transform to apply to sublayers

Definition at line 302 of file CALayer.j.

◆ setZPosition:()

void setZPosition: ( int  aZPosition)
virtual

Sets the layer's z-ordering.

Parameters
aZPositionthe layer's new z-ordering

Definition at line 234 of file CALayer.j.

◆ sublayers()

CPArray sublayers ( )
virtual

Returns an array of the receiver's sublayers.

Definition at line 638 of file CALayer.j.

◆ sublayerTransform()

CGAffineTransform sublayerTransform ( )
virtual

Returns the affine transform applied to the sublayers.

Definition at line 327 of file CALayer.j.

◆ superlayer()

CALayer superlayer ( )
virtual

Returns the receiver's superlayer.

Definition at line 646 of file CALayer.j.

◆ transformToLayer()

CGAffineTransform transformToLayer ( )
virtual

Definition at line 336 of file CALayer.j.

Variable Documentation

◆ CALayerCompositeUpdateMask

var CALayerCompositeUpdateMask = 16

Definition at line 40 of file CALayer.j.

◆ CALayerDisplayUpdateMask

var CALayerDisplayUpdateMask = 8

Definition at line 39 of file CALayer.j.

◆ CALayerDOMUpdateMask

Definition at line 41 of file CALayer.j.

◆ CALayerFrameOriginUpdateMask

var CALayerFrameOriginUpdateMask = 1

Definition at line 36 of file CALayer.j.

◆ CALayerFrameSizeUpdateMask

var CALayerFrameSizeUpdateMask = 2

Definition at line 37 of file CALayer.j.

◆ CALayerGeometryAffineTransformMask

var CALayerGeometryAffineTransformMask = 8

Definition at line 31 of file CALayer.j.

◆ CALayerGeometryAnchorPointMask

var CALayerGeometryAnchorPointMask = 4

Definition at line 30 of file CALayer.j.

◆ CALayerGeometryBoundsMask

var CALayerGeometryBoundsMask = 1

Definition at line 28 of file CALayer.j.

◆ CALayerGeometryParentSublayerTransformMask

var CALayerGeometryParentSublayerTransformMask = 16

Definition at line 32 of file CALayer.j.

◆ CALayerGeometryPositionMask

var CALayerGeometryPositionMask = 2

Definition at line 29 of file CALayer.j.

◆ CALayerRegisteredRunLoopUpdates

var CALayerRegisteredRunLoopUpdates = nil

Definition at line 43 of file CALayer.j.

◆ CALayerZPositionUpdateMask

var CALayerZPositionUpdateMask = 4

Definition at line 38 of file CALayer.j.

◆ CPView

A CALayer is similar to a CPView

Definition at line 46 of file CALayer.j.

◆ method

If the delegate implements this method

Definition at line 50 of file CALayer.j.

◆ USE_BUFFER

var USE_BUFFER = NO

Definition at line 34 of file CALayer.j.