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;
16 if ( [window conformsToProtocol:@protocol(ITWindowPositioning)] ) {
17 // Casts so the compiler won't gripe
18 _verticalPosition = (ITVerticalWindowPosition)[(ITTransientStatusWindow *)window verticalPosition];
19 _horizontalPosition = (ITHorizontalWindowPosition)[(ITTransientStatusWindow *)window horizontalPosition];
21 NSLog(@"ITWindowEffect - initWithWindow: - window does not conform to ITWindowPositioning.");
22 _verticalPosition = ITWindowPositionBottom;
23 _horizontalPosition = ITWindowPositionLeft;
34 - (void)setWindow:(NSWindow *)newWindow
36 [_window autorelease];
37 _window = [newWindow retain];
40 - (void)setWindowVisibility:(ITWindowVisibilityState)visibilityState
42 if ( [_window conformsToProtocol:@protocol(ITWindowMotility)] ) {
43 // Cast so the compiler won't gripe
44 [(ITTransientStatusWindow *)_window setVisibilityState:visibilityState];
46 NSLog(@"ITWindowEffect - setWindowVisibility: - window does not conform to ITWindowVisibility.");
55 - (void)setEffectTime:(float)newTime
57 _effectTime = newTime;
62 NSLog(@"ITWindowEffect does not implement performAppear.");
67 NSLog(@"ITWindowEffect does not implement performVanish.");
72 NSLog(@"ITWindowEffect does not implement cancelAppear.");
77 NSLog(@"ITWindowEffect does not implement cancelVanish.");