Incremental checkin for Status Windows, and correcting a path setting.
[ITKit.git] / ITWindowEffect.m
1 #import "ITWindowEffect.h"
2 #import "ITTransientStatusWindow.h"
3
4
5 @implementation ITWindowEffect
6
7
8 - (id)initWithWindow:(NSWindow *)window
9 {
10     if ( (self = [super init]) ) {
11     
12         _window         = [window retain];
13         _effectTime     = DEFAULT_EFFECT_TIME;
14         _effectProgress = 0.00;
15         _effectTimer    = nil;
16
17         if ( [window conformsToProtocol:@protocol(ITWindowPositioning)] ) {
18                                                            // Casts so the compiler won't gripe
19             _verticalPosition   = (ITVerticalWindowPosition)[(ITTransientStatusWindow *)window verticalPosition];
20             _horizontalPosition = (ITHorizontalWindowPosition)[(ITTransientStatusWindow *)window horizontalPosition];
21         } else {
22             NSLog(@"ITWindowEffect - initWithWindow: - window does not conform to ITWindowPositioning.");
23             _verticalPosition   = ITWindowPositionBottom;
24             _horizontalPosition = ITWindowPositionLeft;
25         }
26     }
27     return self;
28 }
29
30 - (NSWindow *)window
31 {
32     return _window;
33 }
34
35 - (void)setWindow:(NSWindow *)newWindow
36 {
37     [_window autorelease];
38     _window = [newWindow retain];
39 }
40
41 - (void)setWindowVisibility:(ITWindowVisibilityState)visibilityState
42 {
43     if ( [_window conformsToProtocol:@protocol(ITWindowVisibility)] ) {
44        // Cast so the compiler won't gripe
45         [(ITTransientStatusWindow *)_window setVisibilityState:visibilityState];
46     } else {
47         NSLog(@"ITWindowEffect - setWindowVisibility: - window does not conform to ITWindowVisibility.");
48     }
49 }
50
51 - (float)effectTime
52 {
53     return _effectTime;
54 }
55
56 - (void)setEffectTime:(float)newTime
57 {
58     _effectTime = newTime;
59 }
60
61 - (void)performAppear
62 {
63     NSLog(@"ITWindowEffect does not implement performAppear.");
64 }
65
66 - (void)performVanish
67 {
68     NSLog(@"ITWindowEffect does not implement performVanish.");
69 }
70
71 - (void)cancelAppear
72 {
73     NSLog(@"ITWindowEffect does not implement cancelAppear.");
74 }
75
76 - (void)cancelVanish
77 {
78     NSLog(@"ITWindowEffect does not implement cancelVanish.");
79 }
80
81 - (void)dealloc
82 {
83         [_window release];
84         [super dealloc];
85 }
86
87
88 @end