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"),
15 NSClassFromString(@"ITZoomWindowEffect"),
16 NSClassFromString(@"ITSpinWindowEffect"),
22 - (id)initWithWindow:(NSWindow *)window
24 if ( (self = [super init]) ) {
25 _window = [window retain];
26 _effectTime = DEFAULT_EFFECT_TIME;
28 __shouldReleaseWhenIdle = NO;
31 if ( [window conformsToProtocol:@protocol(ITWindowPositioning)] ) {
32 _verticalPosition = (ITVerticalWindowPosition)[(ITTransientStatusWindow *)window verticalPosition];
33 _horizontalPosition = (ITHorizontalWindowPosition)[(ITTransientStatusWindow *)window horizontalPosition];
35 NSLog(@"ITWindowEffect - initWithWindow: - window does not conform to ITWindowPositioning.");
36 _verticalPosition = ITWindowPositionBottom;
37 _horizontalPosition = ITWindowPositionLeft;
48 - (void)setWindow:(NSWindow *)newWindow
50 [_window autorelease];
51 _window = [newWindow retain];
54 - (void)setWindowVisibility:(ITWindowVisibilityState)visibilityState
56 if ( [_window conformsToProtocol:@protocol(ITWindowMotility)] ) {
57 // Cast so the compiler won't gripe
58 [(ITTransientStatusWindow *)_window setVisibilityState:visibilityState];
60 NSLog(@"ITWindowEffect - setWindowVisibility: - window does not conform to ITWindowVisibility.");
69 - (void)setEffectTime:(float)newTime
71 _effectTime = newTime;
74 + (NSString *)effectName
76 NSLog(@"ITWindowEffect does not implement +effectName.");
80 + (NSDictionary *)supportedPositions
82 NSLog(@"ITWindowEffect does not implement +supportedPositions.");
84 // Below is an example dictionary. Modify it appropriately when subclassing.
85 return [NSDictionary dictionaryWithObjectsAndKeys:
86 [NSDictionary dictionaryWithObjectsAndKeys:
87 [NSNumber numberWithBool:NO], @"Left",
88 [NSNumber numberWithBool:NO], @"Center",
89 [NSNumber numberWithBool:NO], @"Right", nil] , @"Top" ,
90 [NSDictionary dictionaryWithObjectsAndKeys:
91 [NSNumber numberWithBool:NO], @"Left",
92 [NSNumber numberWithBool:NO], @"Center",
93 [NSNumber numberWithBool:NO], @"Right", nil] , @"Middle" ,
94 [NSDictionary dictionaryWithObjectsAndKeys:
95 [NSNumber numberWithBool:NO], @"Left",
96 [NSNumber numberWithBool:NO], @"Center",
97 [NSNumber numberWithBool:NO], @"Right", nil] , @"Bottom" , nil];
100 + (unsigned int)listOrder
102 NSLog(@"ITWindowEffect does not implement +listOrder.");
106 - (void)performAppear
108 NSLog(@"ITWindowEffect does not implement -performAppear.");
111 - (void)performVanish
113 NSLog(@"ITWindowEffect does not implement -performVanish.");
118 NSLog(@"ITWindowEffect does not implement -cancelAppear.");
123 NSLog(@"ITWindowEffect does not implement -cancelVanish.");
126 - (void)releaseWhenIdle;
131 __shouldReleaseWhenIdle = YES;