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"),
23 - (id)initWithWindow:(NSWindow *)window
25 if ( (self = [super init]) ) {
26 _window = [window retain];
27 _effectTime = DEFAULT_EFFECT_TIME;
29 __shouldReleaseWhenIdle = NO;
32 if ( [window conformsToProtocol:@protocol(ITWindowPositioning)] ) {
33 _verticalPosition = (ITVerticalWindowPosition)[(ITTransientStatusWindow *)window verticalPosition];
34 _horizontalPosition = (ITHorizontalWindowPosition)[(ITTransientStatusWindow *)window horizontalPosition];
36 NSLog(@"ITWindowEffect - initWithWindow: - window does not conform to ITWindowPositioning.");
37 _verticalPosition = ITWindowPositionBottom;
38 _horizontalPosition = ITWindowPositionLeft;
49 - (void)setWindow:(NSWindow *)newWindow
51 [_window autorelease];
52 _window = [newWindow retain];
55 - (void)setWindowVisibility:(ITWindowVisibilityState)visibilityState
57 if ( [_window conformsToProtocol:@protocol(ITWindowMotility)] ) {
58 // Cast so the compiler won't gripe
59 [(ITTransientStatusWindow *)_window setVisibilityState:visibilityState];
61 NSLog(@"ITWindowEffect - setWindowVisibility: - window does not conform to ITWindowVisibility.");
70 - (void)setEffectTime:(float)newTime
72 _effectTime = newTime;
75 + (NSString *)effectName
77 NSLog(@"ITWindowEffect does not implement +effectName.");
81 + (NSDictionary *)supportedPositions
83 NSLog(@"ITWindowEffect does not implement +supportedPositions.");
85 // Below is an example dictionary. Modify it appropriately when subclassing.
86 return [NSDictionary dictionaryWithObjectsAndKeys:
87 [NSDictionary dictionaryWithObjectsAndKeys:
88 [NSNumber numberWithBool:NO], @"Left",
89 [NSNumber numberWithBool:NO], @"Center",
90 [NSNumber numberWithBool:NO], @"Right", nil] , @"Top" ,
91 [NSDictionary dictionaryWithObjectsAndKeys:
92 [NSNumber numberWithBool:NO], @"Left",
93 [NSNumber numberWithBool:NO], @"Center",
94 [NSNumber numberWithBool:NO], @"Right", nil] , @"Middle" ,
95 [NSDictionary dictionaryWithObjectsAndKeys:
96 [NSNumber numberWithBool:NO], @"Left",
97 [NSNumber numberWithBool:NO], @"Center",
98 [NSNumber numberWithBool:NO], @"Right", nil] , @"Bottom" , nil];
101 + (unsigned int)listOrder
103 NSLog(@"ITWindowEffect does not implement +listOrder.");
107 - (void)performAppear
109 NSLog(@"ITWindowEffect does not implement -performAppear.");
112 - (void)performVanish
114 NSLog(@"ITWindowEffect does not implement -performVanish.");
119 NSLog(@"ITWindowEffect does not implement -cancelAppear.");
124 NSLog(@"ITWindowEffect does not implement -cancelVanish.");
127 - (void)releaseWhenIdle;
132 __shouldReleaseWhenIdle = YES;