The dissolve, cut and slides all work properly now, I hope :D
authorKent Sutherland <ksuther@ithinksw.com>
Fri, 14 Nov 2003 00:11:01 +0000 (00:11 +0000)
committerKent Sutherland <ksuther@ithinksw.com>
Fri, 14 Nov 2003 00:11:01 +0000 (00:11 +0000)
ITCutWindowEffect.m
ITDissolveWindowEffect.m
ITPivotWindowEffect.m
ITSlideHorizontallyWindowEffect.m
ITSlideVerticallyWindowEffect.m

index 79381cb..8ab95cd 100755 (executable)
@@ -1,6 +1,6 @@
 #import "ITCutWindowEffect.h"
 #import "ITTransientStatusWindow.h"
-
+#import "ITCoreGraphicsHacks.h"
 
 @implementation ITCutWindowEffect
 
 
 - (void)performAppear
 {
+    CGAffineTransform transform;
+    NSPoint appearPoint;
+    
+    //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);
+    
     [_window orderFront:self];
     [self setWindowVisibility:ITWindowVisibleState];
 }
index 147840d..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
 {
+    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];
 }
index 81a4b5c..fdacd63 100755 (executable)
 
 - (void)setPivot:(float)angle
 {
-    float degAngle = (angle * (pi / 180));
-
-    CGAffineTransform transform = CGAffineTransformMakeRotation(degAngle);
+    float degAngle;
+    NSPoint appearPoint;
+    CGAffineTransform transform;
+    
+    if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionLeft ) {
+        if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) {
+            degAngle = (angle * (pi / 180));
+        } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionTop ) {
+            degAngle = (-angle * (pi / 180));
+        }
+    } else if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionRight ) {
+        if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) {
+            degAngle = (angle * (pi / 180));
+        } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionTop ) {
+            degAngle = (-angle * (pi / 180));
+        }
+    }
+    
+    transform = CGAffineTransformMakeRotation(degAngle);
     
  // Set pivot rotation point
     transform.tx = -( 32.0 + [[_window screen] visibleFrame].origin.x );
     transform.ty = ( [_window frame].size.height + 32.0 + [[_window screen] visibleFrame].origin.y );
-
+    
+    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 = ( [_window frame].size.height - [[_window screen] visibleFrame].size.height) / 2;
+    } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) {
+        appearPoint.y = -( [[_window screen] frame].size.height - ([_window frame].origin.y) + 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;
+    }*/
     CGSSetWindowTransform([NSApp contextID],
                           (CGSWindowID)[_window windowNumber],
                           CGAffineTransformTranslate( transform,
-                                                     -( [_window frame].origin.x - (32.0 + [[_window screen] visibleFrame].origin.x) ),
-                                                     -( [[_window screen] frame].size.height - ([_window frame].origin.y) + 32.0 + [[_window screen] visibleFrame].origin.y) ) );
+                                                     appearPoint.x,
+                                                     appearPoint.y ) );
 }
 
-
 @end
index 4de74ec..2382cc4 100755 (executable)
 - (void)setSlide:(float)distance
 {
     CGAffineTransform transform;
-    if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionLeft ) {
+    float yPoint;
+    
+    if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionTop ) {
+        yPoint = ( 64.0 + [[_window screen] visibleFrame].origin.y - [_window frame].size.height );
+    } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) {
+        yPoint = -( [[_window screen] frame].size.height - ( [_window frame].size.height + 32.0 + [[_window screen] visibleFrame].origin.y) );
+    } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionMiddle ) {
+        yPoint = ( [_window frame].size.height - [[_window screen] visibleFrame].size.height) / 2;
+    }
+    
+    /*if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionLeft ) {
         transform = CGAffineTransformMakeTranslation((distance - (32.0 + [[_window screen] visibleFrame].origin.x)),
                                                     ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) ? -( [[_window screen] frame].size.height - ( [_window frame].size.height + 32.0 + [[_window screen] visibleFrame].origin.y) ) : ( 64.0 + [[_window screen] visibleFrame].origin.y - [_window frame].size.height ) );
     } else if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionRight ) {
         transform = CGAffineTransformMakeTranslation(-((([[_window screen] visibleFrame].size.width + [[_window screen] visibleFrame].origin.x) + distance) - 32.0 - [_window frame].size.width),
                                                     ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) ? -( [[_window screen] frame].size.height - ( [_window frame].size.height + 32.0 + [[_window screen] visibleFrame].origin.y) ) : ( 64.0 + [[_window screen] visibleFrame].origin.y - [_window frame].size.height ) );
-    }
-
+    }*/
+    
+    transform = CGAffineTransformMakeTranslation( ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionLeft ) ? (distance - (32.0 + [[_window screen] visibleFrame].origin.x)) : -((([[_window screen] visibleFrame].size.width + [[_window screen] visibleFrame].origin.x) + distance) - 32.0 - [_window frame].size.width),
+                                                 yPoint);
+    
     CGSSetWindowTransform([NSApp contextID],
                           (CGSWindowID)[_window windowNumber],
                           transform);
index 140ffbd..023e276 100755 (executable)
 - (void)setSlide:(float)distance
 {
     CGAffineTransform transform;
-    if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) {
+    float xPoint;
+    
+    if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionLeft ) {
+        xPoint = -( 32.0 + [[_window screen] visibleFrame].origin.x );
+    } else if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionRight ) {
+        xPoint = -(([[_window screen] visibleFrame].size.width + [[_window screen] visibleFrame].origin.x) - 32.0 - [_window frame].size.width);
+    } else if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionCenter ) {
+        xPoint = ( [_window frame].size.width - [[_window screen] visibleFrame].size.width ) / 2;
+    }
+    
+    /*if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) {
         transform = CGAffineTransformMakeTranslation( ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionLeft ) ? -( 32.0 + [[_window screen] visibleFrame].origin.x ) : -(([[_window screen] visibleFrame].size.width + [[_window screen] visibleFrame].origin.x) - 32.0 - [_window frame].size.width),
                                                     -( [[_window screen] frame].size.height - ( distance + 32.0 + [[_window screen] visibleFrame].origin.y ) ) );
     } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionTop ) {
         transform = CGAffineTransformMakeTranslation( ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionLeft ) ? -( 32.0 + [[_window screen] visibleFrame].origin.x ) : -(([[_window screen] visibleFrame].size.width + [[_window screen] visibleFrame].origin.x) - 32.0 - [_window frame].size.width),
                                                     [[_window screen] visibleFrame].origin.y - distance + 64.0 );
-    }
+    }*/
+    
+    transform = CGAffineTransformMakeTranslation(xPoint,
+                                                 ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionTop ) ? ( [[_window screen] visibleFrame].origin.y - distance + 64.0 ) : -( [[_window screen] frame].size.height - ( distance + 32.0 + [[_window screen] visibleFrame].origin.y ) ) );
     
     CGSSetWindowTransform([NSApp contextID],
                           (CGSWindowID)[_window windowNumber],