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 // Casts so the compiler won't gripe
31 _verticalPosition = (ITVerticalWindowPosition)[(ITTransientStatusWindow *)window verticalPosition];
32 _horizontalPosition = (ITHorizontalWindowPosition)[(ITTransientStatusWindow *)window horizontalPosition];
34 NSLog(@"ITWindowEffect - initWithWindow: - window does not conform to ITWindowPositioning.");
35 _verticalPosition = ITWindowPositionBottom;
36 _horizontalPosition = ITWindowPositionLeft;
47 - (void)setWindow:(NSWindow *)newWindow
49 [_window autorelease];
50 _window = [newWindow retain];
53 - (void)setWindowVisibility:(ITWindowVisibilityState)visibilityState
55 if ( [_window conformsToProtocol:@protocol(ITWindowMotility)] ) {
56 // Cast so the compiler won't gripe
57 [(ITTransientStatusWindow *)_window setVisibilityState:visibilityState];
59 NSLog(@"ITWindowEffect - setWindowVisibility: - window does not conform to ITWindowVisibility.");
68 - (void)setEffectTime:(float)newTime
70 _effectTime = newTime;
73 + (NSString *)effectName
75 NSLog(@"ITWindowEffect does not implement +effectName.");
79 + (NSDictionary *)supportedPositions
81 NSLog(@"ITWindowEffect does not implement +supportedPositions.");
83 // Below is an example dictionary. Modify it appropriately when subclassing.
84 return [NSDictionary dictionaryWithObjectsAndKeys:
85 [NSDictionary dictionaryWithObjectsAndKeys:
86 [NSNumber numberWithBool:NO], @"Left",
87 [NSNumber numberWithBool:NO], @"Center",
88 [NSNumber numberWithBool:NO], @"Right", nil] , @"Top" ,
89 [NSDictionary dictionaryWithObjectsAndKeys:
90 [NSNumber numberWithBool:NO], @"Left",
91 [NSNumber numberWithBool:NO], @"Center",
92 [NSNumber numberWithBool:NO], @"Right", nil] , @"Middle" ,
93 [NSDictionary dictionaryWithObjectsAndKeys:
94 [NSNumber numberWithBool:NO], @"Left",
95 [NSNumber numberWithBool:NO], @"Center",
96 [NSNumber numberWithBool:NO], @"Right", nil] , @"Bottom" , nil];
99 + (unsigned int)listOrder
101 NSLog(@"ITWindowEffect does not implement +listOrder.");
105 - (void)performAppear
107 NSLog(@"ITWindowEffect does not implement -performAppear.");
110 - (void)performVanish
112 NSLog(@"ITWindowEffect does not implement -performVanish.");
117 NSLog(@"ITWindowEffect does not implement -cancelAppear.");
122 NSLog(@"ITWindowEffect does not implement -cancelVanish.");
125 - (void)releaseWhenIdle;
130 __shouldReleaseWhenIdle = YES;