1 #import "ITWindowEffect.h"
2 #import "ITTransientStatusWindow.h"
5 @implementation ITWindowEffect
8 - (id)initWithWindow:(NSWindow *)window
10 if ( (self = [super init]) ) {
12 _window = [window retain];
13 _effectTime = DEFAULT_EFFECT_TIME;
15 __shouldReleaseWhenIdle = NO;
18 if ( [window conformsToProtocol:@protocol(ITWindowPositioning)] ) {
19 // Casts so the compiler won't gripe
20 _verticalPosition = (ITVerticalWindowPosition)[(ITTransientStatusWindow *)window verticalPosition];
21 _horizontalPosition = (ITHorizontalWindowPosition)[(ITTransientStatusWindow *)window horizontalPosition];
23 NSLog(@"ITWindowEffect - initWithWindow: - window does not conform to ITWindowPositioning.");
24 _verticalPosition = ITWindowPositionBottom;
25 _horizontalPosition = ITWindowPositionLeft;
36 - (void)setWindow:(NSWindow *)newWindow
38 [_window autorelease];
39 _window = [newWindow retain];
42 - (void)setWindowVisibility:(ITWindowVisibilityState)visibilityState
44 if ( [_window conformsToProtocol:@protocol(ITWindowMotility)] ) {
45 // Cast so the compiler won't gripe
46 [(ITTransientStatusWindow *)_window setVisibilityState:visibilityState];
48 NSLog(@"ITWindowEffect - setWindowVisibility: - window does not conform to ITWindowVisibility.");
57 - (void)setEffectTime:(float)newTime
59 _effectTime = newTime;
64 NSLog(@"ITWindowEffect does not implement performAppear.");
69 NSLog(@"ITWindowEffect does not implement performVanish.");
74 NSLog(@"ITWindowEffect does not implement cancelAppear.");
79 NSLog(@"ITWindowEffect does not implement cancelVanish.");
82 - (void)releaseWhenIdle;
87 __shouldReleaseWhenIdle = YES;