diff options
Diffstat (limited to 'AppKit/GTMNSAnimation+Duration.h')
-rw-r--r-- | AppKit/GTMNSAnimation+Duration.h | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/AppKit/GTMNSAnimation+Duration.h b/AppKit/GTMNSAnimation+Duration.h index fa1d86f..ee4be84 100644 --- a/AppKit/GTMNSAnimation+Duration.h +++ b/AppKit/GTMNSAnimation+Duration.h @@ -16,27 +16,47 @@ // the License. // -// Categories for changing the duration of an animation based on the current -// event. Right now they track the state of the shift and control keys to slow -// down animations similar to how minimize window animations occur. #import <AppKit/AppKit.h> #import "GTMDefines.h" +// Given a "normal" duration for an animation, return what it should be based +// on the current system state. For example, holding down the shift and/or +// control keys modifies the normal duration for an animation making it slower. +NSTimeInterval GTMModifyDurationBasedOnCurrentState(NSTimeInterval duration); + +// Categories for changing the duration of an animation based on the current +// event. Right now they track the state of the shift and control keys to slow +// down animations similar to how minimize window animations occur. @interface NSAnimation (GTMNSAnimationDurationAdditions) + +// Note that using this initializer will set the duration of the animation +// based on the current event when the animation is created. If the animation +// is to be reused, the duration for the event should be reset with +// gtm_setDuration each time the animation is started. +- (id)gtm_initWithDuration:(NSTimeInterval)duration + animationCurve:(NSAnimationCurve)animationCurve; + +// Sets the duration by taking the duration passed in and calling +// GTMModifyDurationBasedOnCurrentState to calculate the real duration. - (void)gtm_setDuration:(NSTimeInterval)duration; @end - #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 #import <QuartzCore/QuartzCore.h> @interface NSAnimationContext (GTMNSAnimationDurationAdditions) + +// Sets the duration by taking the duration passed in and calling +// GTMModifyDurationBasedOnCurrentState to calculate the real duration. - (void)gtm_setDuration:(NSTimeInterval)duration; @end @interface CAAnimation (GTMCAAnimationDurationAdditions) + +// Sets the duration by taking the duration passed in and calling +// GTMModifyDurationBasedOnCurrentState to calculate the real duration. - (void)gtm_setDuration:(CFTimeInterval)duration; @end |