Project fixes so that stuff builds, updates to the Background view, tweaks all over.
[ITKit.git] / ITDissolveWindowEffect.m
index fc2bd38..b058548 100755 (executable)
@@ -1,6 +1,6 @@
 #import "ITDissolveWindowEffect.h"
 #import "ITTransientStatusWindow.h"
-
+#import "ITCoreGraphicsHacks.h"
 
 @interface ITDissolveWindowEffect (Private)
 - (void)performAppearFromProgress:(float)progress effectTime:(float)time;
 
 - (void)performAppear
 {
-    [self setWindowVisibility:ITTransientStatusWindowAppearingState];
+    CGAffineTransform transform;
+    NSPoint appearPoint;
+    __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];
 }
 
 {
     [_effectTimer invalidate];
     _effectTimer = nil;
-    [self setWindowVisibility:ITTransientStatusWindowVisibleState];
+    [self setWindowVisibility:ITWindowVisibleState];
+
+    __idle = YES;
+    
+    if ( __shouldReleaseWhenIdle ) {
+        [self release];
+    }
 }
 
 - (void)cancelAppear
 {
-    [self setWindowVisibility:ITTransientStatusWindowVanishingState];
+    [self setWindowVisibility:ITWindowVanishingState];
 
     [_effectTimer invalidate];
     _effectTimer = nil;
 
 - (void)performVanish
 {
-    [self setWindowVisibility:ITTransientStatusWindowVanishingState];
+    __idle = NO;
+    
+    [self setWindowVisibility:ITWindowVanishingState];
     [self performVanishFromProgress:1.0 effectTime:_effectTime];
 }
 
     _effectTimer = nil;
     [_window orderOut:self];
     [_window setAlphaValue:1.0];
-    [self setWindowVisibility:ITTransientStatusWindowHiddenState];
+    [self setWindowVisibility:ITWindowHiddenState];
+
+    __idle = YES;
+    
+    if ( __shouldReleaseWhenIdle ) {
+        [self release];
+    }
 }
 
 - (void)cancelVanish
 {
-    [self setWindowVisibility:ITTransientStatusWindowVanishingState];
+    [self setWindowVisibility:ITWindowVanishingState];
 
     [_effectTimer invalidate];
     _effectTimer = nil;