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 }
00035
00040 + (id)animation
00041 {
00042 return [[self alloc] init];
00043 }
00044
00045 - (id)init
00046 {
00047 self = [super init];
00048
00049 if (self)
00050 _isRemovedOnCompletion = YES;
00051
00052 return self;
00053 }
00054
00059 - (void)shouldArchiveValueForKey:(CPString)aKey
00060 {
00061 return YES;
00062 }
00063
00068 + (id)defaultValueForKey:(CPString)aKey
00069 {
00070 return nil;
00071 }
00072
00077 - (void)setRemovedOnCompletion:(BOOL)isRemovedOnCompletion
00078 {
00079 _isRemovedOnCompletion = isRemovedOnCompletion;
00080 }
00081
00085 - (BOOL)removedOnCompletion
00086 {
00087 return _isRemovedOnCompletion;
00088 }
00089
00093 - (BOOL)isRemovedOnCompletion
00094 {
00095 return _isRemovedOnCompletion;
00096 }
00097
00101 - (CAMediaTimingFunction)timingFunction
00102 {
00103
00104 return nil;
00105 }
00106
00111 - (void)setDelegate:(id)aDelegate
00112 {
00113 _delegate = aDelegate;
00114 }
00115
00119 - (id)delegate
00120 {
00121 return _delegate;
00122 }
00123
00124 - (void)runActionForKey:(CPString)aKey object:(id)anObject arguments:(CPDictionary)arguments
00125 {
00126 [anObject addAnimation:self forKey:aKey];
00127 }
00128
00129 @end
00130
00131
00132
00133
00134 @implementation CAPropertyAnimation : CAAnimation
00135 {
00136 CPString _keyPath;
00137
00138 BOOL _isCumulative;
00139 BOOL _isAdditive;
00140 }
00141
00142 + (id)animationWithKeyPath:(CPString)aKeyPath
00143 {
00144 var animation = [self animation];
00145
00146 [animation setKeypath:aKeyPath];
00147
00148 return animation;
00149 }
00150
00151 - (void)setKeyPath:(CPString)aKeyPath
00152 {
00153 _keyPath = aKeyPath;
00154 }
00155
00156 - (CPString)keyPath
00157 {
00158 return _keyPath;
00159 }
00160
00161 - (void)setCumulative:(BOOL)isCumulative
00162 {
00163 _isCumulative = isCumulative;
00164 }
00165
00166 - (BOOL)cumulative
00167 {
00168 return _isCumulative;
00169 }
00170
00171 - (BOOL)isCumulative
00172 {
00173 return _isCumulative;
00174 }
00175
00176 - (void)setAdditive:(BOOL)isAdditive
00177 {
00178 _isAdditive = isAdditive;
00179 }
00180
00181 - (BOOL)additive
00182 {
00183 return _isAdditive;
00184 }
00185
00186 - (BOOL)isAdditive
00187 {
00188 return _isAdditive;
00189 }
00190
00191 @end
00192
00198 @implementation CABasicAnimation : CAPropertyAnimation
00199 {
00200 id _fromValue;
00201 id _toValue;
00202 id _byValue;
00203 }
00204
00209 - (void)setFromValue:(id)aValue
00210 {
00211 _fromValue = aValue;
00212 }
00213
00217 - (id)fromValue
00218 {
00219 return _fromValue;
00220 }
00221
00226 - (void)setToValue:(id)aValue
00227 {
00228 _toValue = aValue;
00229 }
00230
00234 - (id)toValue
00235 {
00236 return _toValue;
00237 }
00238
00243 - (void)setByValue:(id)aValue
00244 {
00245 _byValue = aValue;
00246 }
00247
00251 - (id)byValue
00252 {
00253 return _byValue;
00254 }
00255
00256 @end