forked from erkyrath/Inform7-IDE-Mac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIFViewAnimator.h
66 lines (54 loc) · 2.24 KB
/
IFViewAnimator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//
// IFViewAnimator.h
// Inform-xc2
//
// Created by Andrew Hunter on 01/09/2006.
// Copyright 2006 Andrew Hunter. All rights reserved.
//
#import <Cocoa/Cocoa.h>
typedef enum IFViewAnimationStyle {
IFAnimateLeft,
IFAnimateRight,
IFAnimateUp,
IFAnimateDown,
IFAnimateCrossFade,
IFFloatIn,
IFFloatOut
} IFViewAnimationStyle;
///
/// A class that can be used to perform various animations for a particular view
///
@interface IFViewAnimator : NSView {
// The start and the end of the animation
NSImage* startImage;
NSImage* endImage;
// Animation settings
NSTimeInterval animationTime;
IFViewAnimationStyle animationStyle;
// Information used while animating
NSTimer* animationTimer;
NSRect originalFrame;
NSView* originalView;
NSView* originalSuperview;
NSDate* whenStarted;
id finishedObject;
SEL finishedMessage;
}
// Caching views
+ (NSImage*) cacheView: (NSView*) view; // Returns an image with the contents of the specified view
- (void) cacheStartView: (NSView*) view; // Caches a specific image as the start of an animation
// Animating
- (void) setTime: (float) animationTime; // Set how long the animation should take
- (void) prepareToAnimateView: (NSView*) view; // Prepares to animate, using the specified view as a template
- (void) animateTo: (NSView*) view // Begins animating the specified view so that transitions from the state set in prepareToAnimateView to the new state
style: (IFViewAnimationStyle) style;
- (void) animateTo: (NSView*) view // Begins animating the specified view so that transitions from the state set in prepareToAnimateView to the new state, sending the specified message to the specified object when it finishes
style: (IFViewAnimationStyle) style
sendMessage: (SEL) finishedMessage
toObject: (id) whenFinished;
- (void) finishAnimation; // Abandons any running animation
@end
@interface NSObject(IFViewAnimation)
- (void) removeTrackingRects; // Optional method implemented by views that is a request from the animation view to remove any applicable tracking rectangles
- (void) setTrackingRects; // Optional method implemented by views that is a request from the animation view to add any tracking rectangles back again
@end