API  1.0.0
CAAnimation.j
Go to the documentation of this file.
1 /*
2  * CAAnimation.j
3  * AppKit
4  *
5  * Created by Francisco Tolmasky.
6  * Copyright 2008, 280 North, Inc.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 
24 
25 /*
26  This is an animation class.
27 */
28 @implementation CAAnimation : CPObject
29 {
30  BOOL _isRemovedOnCompletion;
31  id _delegate;
32  CAMediaTimingFunction _timingFunction;
33  double _duration;
34 }
35 
40 + (id)animation
41 {
42  return [[self alloc] init];
43 }
44 
45 - (id)init
46 {
47  self = [super init];
48 
49  _isRemovedOnCompletion = YES;
50  _timingFunction = nil;
51  _duration = 0.0;
52  _delegate = nil;
53 
54  return self;
55 }
56 
61 - (void)shouldArchiveValueForKey:(CPString)aKey
62 {
63  return YES;
64 }
65 
70 + (id)defaultValueForKey:(CPString)aKey
71 {
72  return nil;
73 }
74 
79 - (void)setRemovedOnCompletion:(BOOL)isRemovedOnCompletion
80 {
81  _isRemovedOnCompletion = isRemovedOnCompletion;
82 }
83 
87 - (BOOL)removedOnCompletion
88 {
89  return _isRemovedOnCompletion;
90 }
91 
95 - (BOOL)isRemovedOnCompletion
96 {
97  return _isRemovedOnCompletion;
98 }
99 
103 - (CAMediaTimingFunction)timingFunction
104 {
105  // Linear Pacing
106  return _timingFunction;
107 }
108 
113 - (void)setDelegate:(id)aDelegate
114 {
115  _delegate = aDelegate;
116 }
117 
121 - (id)delegate
122 {
123  return _delegate;
124 }
125 
126 - (void)runActionForKey:(CPString)aKey object:(id)anObject arguments:(CPDictionary)arguments
127 {
128  [anObject addAnimation:self forKey:aKey];
129 }
130 
131 @end
132 
134 
138 - (CAMediaTimingFunction)timingFunction
139 {
140  return _timingFunction;
141 }
142 
146 - (void)setTimingFunction:(CAMediaTimingFunction)aValue
147 {
148  _timingFunction = aValue;
149 }
150 
154 - (double)duration
155 {
156  return _duration;
157 }
158 
162 - (void)setDuration:(double)aValue
163 {
164  _duration = aValue;
165 }
166 
167 @end
id init()
Definition: CALayer.j:126
id delegate()
Definition: CALayer.j:965
A mutable key-value pair collection.
Definition: CPDictionary.h:2
An immutable string (collection of characters).
Definition: CPString.h:2
id init()
Definition: CPObject.j:145
id alloc()
Definition: CPObject.j:130