This about does it. I want to do a couple more things, especially multiple screen...
[ITKit.git] / ITDissolveWindowEffect.m
index b058548..5481832 100755 (executable)
 @implementation ITDissolveWindowEffect
 
 
 @implementation ITDissolveWindowEffect
 
 
++ (NSString *)effectName
+{
+    return @"Dissolve";
+}
+
++ (NSDictionary *)supportedPositions
+{
+    return [NSDictionary dictionaryWithObjectsAndKeys:
+        [NSDictionary dictionaryWithObjectsAndKeys:
+            [NSNumber numberWithBool:YES], @"Left",
+            [NSNumber numberWithBool:YES], @"Center",
+            [NSNumber numberWithBool:YES], @"Right", nil] , @"Top" ,
+        [NSDictionary dictionaryWithObjectsAndKeys:
+            [NSNumber numberWithBool:YES], @"Left",
+            [NSNumber numberWithBool:YES], @"Center",
+            [NSNumber numberWithBool:YES], @"Right", nil] , @"Middle" ,
+        [NSDictionary dictionaryWithObjectsAndKeys:
+            [NSNumber numberWithBool:YES], @"Left",
+            [NSNumber numberWithBool:YES], @"Center",
+            [NSNumber numberWithBool:YES], @"Right", nil] , @"Bottom" , nil];
+}
+
++ (unsigned int)listOrder
+{
+    return 200;
+}
+
+
 /*************************************************************************/
 #pragma mark -
 #pragma mark APPEAR METHODS
 /*************************************************************************/
 #pragma mark -
 #pragma mark APPEAR METHODS
 
 - (void)performAppear
 {
 
 - (void)performAppear
 {
-    CGAffineTransform transform;
-    NSPoint appearPoint;
     __idle = NO;
     
     __idle = NO;
     
-    //Set the location on the screen
-    if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionLeft ) {
-        appearPoint.x = -( 32.0 + [[_window screen] visibleFrame].origin.x );
-    } else if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionRight ) {
-        appearPoint.x = -(([[_window screen] visibleFrame].size.width + [[_window screen] visibleFrame].origin.x) - 32.0 - [_window frame].size.width);
-    } else if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionCenter ) {
-        appearPoint.x = ( [_window frame].size.width - [[_window screen] visibleFrame].size.width ) / 2;
-    }
-    
-    if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionTop ) {
-        appearPoint.y = ( 64.0 + [[_window screen] visibleFrame].origin.y - [_window frame].size.height );
-    } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) {
-        appearPoint.y = -( [[_window screen] frame].size.height - ( [_window frame].size.height + 32.0 + [[_window screen] visibleFrame].origin.y) );
-    } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionMiddle ) {
-        appearPoint.y = ( [_window frame].size.height - [[_window screen] visibleFrame].size.height) / 2;
-    }
-    
-    transform = CGAffineTransformMakeTranslation(appearPoint.x, appearPoint.y);
-    CGSSetWindowTransform([NSApp contextID],
-                          (CGSWindowID)[_window windowNumber],
-                          transform);
-    
     [self setWindowVisibility:ITWindowAppearingState];
     [self performAppearFromProgress:0.0 effectTime:_effectTime];
 }
     [self setWindowVisibility:ITWindowAppearingState];
     [self performAppearFromProgress:0.0 effectTime:_effectTime];
 }