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"),
17 NSClassFromString(@"ITSpinAndZoomWindowEffect"),
18 NSClassFromString(@"ITCoreImageWindowEffect"),
24 - (id)initWithWindow:(NSWindow *)window
26 if ( (self = [super init]) ) {
27 _window = [window retain];
28 _effectTime = DEFAULT_EFFECT_TIME;
30 __shouldReleaseWhenIdle = NO;
33 if ( [window conformsToProtocol:@protocol(ITWindowPositioning)] ) {
34 _verticalPosition = (ITVerticalWindowPosition)[(ITTransientStatusWindow *)window verticalPosition];
35 _horizontalPosition = (ITHorizontalWindowPosition)[(ITTransientStatusWindow *)window horizontalPosition];
37 NSLog(@"ITWindowEffect - initWithWindow: - window does not conform to ITWindowPositioning.");
38 _verticalPosition = ITWindowPositionBottom;
39 _horizontalPosition = ITWindowPositionLeft;
50 - (void)setWindow:(NSWindow *)newWindow
52 [_window autorelease];
53 _window = [newWindow retain];
56 - (void)setWindowVisibility:(ITWindowVisibilityState)visibilityState
58 if ( [_window conformsToProtocol:@protocol(ITWindowMotility)] ) {
59 // Cast so the compiler won't gripe
60 [(ITTransientStatusWindow *)_window setVisibilityState:visibilityState];
62 NSLog(@"ITWindowEffect - setWindowVisibility: - window does not conform to ITWindowVisibility.");
71 - (void)setEffectTime:(float)newTime
73 _effectTime = newTime;
76 + (NSString *)effectName
78 NSLog(@"ITWindowEffect does not implement +effectName.");
82 + (NSDictionary *)supportedPositions
84 NSLog(@"ITWindowEffect does not implement +supportedPositions.");
86 // Below is an example dictionary. Modify it appropriately when subclassing.
87 return [NSDictionary dictionaryWithObjectsAndKeys:
88 [NSDictionary dictionaryWithObjectsAndKeys:
89 [NSNumber numberWithBool:NO], @"Left",
90 [NSNumber numberWithBool:NO], @"Center",
91 [NSNumber numberWithBool:NO], @"Right", nil] , @"Top" ,
92 [NSDictionary dictionaryWithObjectsAndKeys:
93 [NSNumber numberWithBool:NO], @"Left",
94 [NSNumber numberWithBool:NO], @"Center",
95 [NSNumber numberWithBool:NO], @"Right", nil] , @"Middle" ,
96 [NSDictionary dictionaryWithObjectsAndKeys:
97 [NSNumber numberWithBool:NO], @"Left",
98 [NSNumber numberWithBool:NO], @"Center",
99 [NSNumber numberWithBool:NO], @"Right", nil] , @"Bottom" , nil];
102 + (unsigned int)listOrder
104 NSLog(@"ITWindowEffect does not implement +listOrder.");
108 - (void)performAppear
110 NSLog(@"ITWindowEffect does not implement -performAppear.");
113 - (void)performVanish
115 NSLog(@"ITWindowEffect does not implement -performVanish.");
120 NSLog(@"ITWindowEffect does not implement -cancelAppear.");
125 NSLog(@"ITWindowEffect does not implement -cancelVanish.");
128 - (void)releaseWhenIdle;
133 __shouldReleaseWhenIdle = YES;