00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 @import <Foundation/CPObject.j>
00024 @import <Foundation/CPString.j>
00025
00026 @import "CAMediaTimingFunction.j"
00027
00028
00029
00030
00031 @implementation CAAnimation : CPObject
00032 {
00033 BOOL _isRemovedOnCompletion;
00034 id _delegate;
00035 }
00036
00041 + (id)animation
00042 {
00043 return [[self alloc] init];
00044 }
00045
00046 - (id)init
00047 {
00048 self = [super init];
00049
00050 if (self)
00051 _isRemovedOnCompletion = YES;
00052
00053 return self;
00054 }
00055
00060 - (void)shouldArchiveValueForKey:(CPString)aKey
00061 {
00062 return YES;
00063 }
00064
00069 + (id)defaultValueForKey:(CPString)aKey
00070 {
00071 return nil;
00072 }
00073
00078 - (void)setRemovedOnCompletion:(BOOL)isRemovedOnCompletion
00079 {
00080 _isRemovedOnCompletion = isRemovedOnCompletion;
00081 }
00082
00086 - (BOOL)removedOnCompletion
00087 {
00088 return _isRemovedOnCompletion;
00089 }
00090
00094 - (BOOL)isRemovedOnCompletion
00095 {
00096 return _isRemovedOnCompletion;
00097 }
00098
00102 - (CAMediaTimingFunction)timingFunction
00103 {
00104
00105 return nil;
00106 }
00107
00112 - (void)setDelegate:(id)aDelegate
00113 {
00114 _delegate = aDelegate;
00115 }
00116
00120 - (id)delegate
00121 {
00122 return _delegate;
00123 }
00124
00125 - (void)runActionForKey:(CPString)aKey object:(id)anObject arguments:(CPDictionary)arguments
00126 {
00127 [anObject addAnimation:self forKey:aKey];
00128 }
00129
00130 @end
00131
00132
00133
00134
00135 @implementation CAPropertyAnimation : CAAnimation
00136 {
00137 CPString _keyPath;
00138
00139 BOOL _isCumulative;
00140 BOOL _isAdditive;
00141 }
00142
00143 + (id)animationWithKeyPath:(CPString)aKeyPath
00144 {
00145 var animation = [self animation];
00146
00147 [animation setKeyPath:aKeyPath];
00148
00149 return animation;
00150 }
00151
00152 - (void)setKeyPath:(CPString)aKeyPath
00153 {
00154 _keyPath = aKeyPath;
00155 }
00156
00157 - (CPString)keyPath
00158 {
00159 return _keyPath;
00160 }
00161
00162 - (void)setCumulative:(BOOL)isCumulative
00163 {
00164 _isCumulative = isCumulative;
00165 }
00166
00167 - (BOOL)cumulative
00168 {
00169 return _isCumulative;
00170 }
00171
00172 - (BOOL)isCumulative
00173 {
00174 return _isCumulative;
00175 }
00176
00177 - (void)setAdditive:(BOOL)isAdditive
00178 {
00179 _isAdditive = isAdditive;
00180 }
00181
00182 - (BOOL)additive
00183 {
00184 return _isAdditive;
00185 }
00186
00187 - (BOOL)isAdditive
00188 {
00189 return _isAdditive;
00190 }
00191
00192 @end
00193
00199 @implementation CABasicAnimation : CAPropertyAnimation
00200 {
00201 id _fromValue;
00202 id _toValue;
00203 id _byValue;
00204 }
00205
00210 - (void)setFromValue:(id)aValue
00211 {
00212 _fromValue = aValue;
00213 }
00214
00218 - (id)fromValue
00219 {
00220 return _fromValue;
00221 }
00222
00227 - (void)setToValue:(id)aValue
00228 {
00229 _toValue = aValue;
00230 }
00231
00235 - (id)toValue
00236 {
00237 return _toValue;
00238 }
00239
00244 - (void)setByValue:(id)aValue
00245 {
00246 _byValue = aValue;
00247 }
00248
00252 - (id)byValue
00253 {
00254 return _byValue;
00255 }
00256
00257 @end