1 #import "ITWindowEffect.h"
2 #import "ITTransientStatusWindow.h"
5 @implementation ITWindowEffect
7 + (NSArray *)effectClasses
9 NSArray *classes = [NSArray arrayWithObjects:
10 NSClassFromString(@"ITCutWindowEffect"),
11 NSClassFromString(@"ITDissolveWindowEffect"),
12 NSClassFromString(@"ITSlideHorizontallyWindowEffect"),
13 NSClassFromString(@"ITSlideVerticallyWindowEffect"),
14 NSClassFromString(@"ITPivotWindowEffect"),
20 - (id)initWithWindow:(NSWindow *)window
22 if ( (self = [super init]) ) {
23 _window = [window retain];
24 _effectTime = DEFAULT_EFFECT_TIME;
26 __shouldReleaseWhenIdle = NO;
29 if ( [window conformsToProtocol:@protocol(ITWindowPositioning)] ) {
30 _verticalPosition = (ITVerticalWindowPosition)[(ITTransientStatusWindow *)window verticalPosition];
31 _horizontalPosition = (ITHorizontalWindowPosition)[(ITTransientStatusWindow *)window horizontalPosition];
33 NSLog(@"ITWindowEffect - initWithWindow: - window does not conform to ITWindowPositioning.");
34 _verticalPosition = ITWindowPositionBottom;
35 _horizontalPosition = ITWindowPositionLeft;
46 - (void)setWindow:(NSWindow *)newWindow
48 [_window autorelease];
49 _window = [newWindow retain];
52 - (void)setWindowVisibility:(ITWindowVisibilityState)visibilityState
54 if ( [_window conformsToProtocol:@protocol(ITWindowMotility)] ) {
55 // Cast so the compiler won't gripe
56 [(ITTransientStatusWindow *)_window setVisibilityState:visibilityState];
58 NSLog(@"ITWindowEffect - setWindowVisibility: - window does not conform to ITWindowVisibility.");
67 - (void)setEffectTime:(float)newTime
69 _effectTime = newTime;
72 + (NSString *)effectName
74 NSLog(@"ITWindowEffect does not implement +effectName.");
78 + (NSDictionary *)supportedPositions
80 NSLog(@"ITWindowEffect does not implement +supportedPositions.");
82 // Below is an example dictionary. Modify it appropriately when subclassing.
83 return [NSDictionary dictionaryWithObjectsAndKeys:
84 [NSDictionary dictionaryWithObjectsAndKeys:
85 [NSNumber numberWithBool:NO], @"Left",
86 [NSNumber numberWithBool:NO], @"Center",
87 [NSNumber numberWithBool:NO], @"Right", nil] , @"Top" ,
88 [NSDictionary dictionaryWithObjectsAndKeys:
89 [NSNumber numberWithBool:NO], @"Left",
90 [NSNumber numberWithBool:NO], @"Center",
91 [NSNumber numberWithBool:NO], @"Right", nil] , @"Middle" ,
92 [NSDictionary dictionaryWithObjectsAndKeys:
93 [NSNumber numberWithBool:NO], @"Left",
94 [NSNumber numberWithBool:NO], @"Center",
95 [NSNumber numberWithBool:NO], @"Right", nil] , @"Bottom" , nil];
98 + (unsigned int)listOrder
100 NSLog(@"ITWindowEffect does not implement +listOrder.");
104 - (void)performAppear
106 NSLog(@"ITWindowEffect does not implement -performAppear.");
109 - (void)performVanish
111 NSLog(@"ITWindowEffect does not implement -performVanish.");
116 NSLog(@"ITWindowEffect does not implement -cancelAppear.");
121 NSLog(@"ITWindowEffect does not implement -cancelVanish.");
124 - (void)releaseWhenIdle;
129 __shouldReleaseWhenIdle = YES;