1 #import "ITCutWindowEffect.h"
2 #import "ITTransientStatusWindow.h"
3 #import "ITCoreGraphicsHacks.h"
5 @implementation ITCutWindowEffect
8 /*************************************************************************/
10 #pragma mark APPEAR METHODS
11 /*************************************************************************/
15 CGAffineTransform transform;
18 //Set the location on the screen
19 if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionLeft ) {
20 appearPoint.x = -( 32.0 + [[_window screen] visibleFrame].origin.x );
21 } else if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionRight ) {
22 appearPoint.x = -(([[_window screen] visibleFrame].size.width + [[_window screen] visibleFrame].origin.x) - 32.0 - [_window frame].size.width);
23 } else if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionCenter ) {
24 appearPoint.x = ( [_window frame].size.width - [[_window screen] visibleFrame].size.width ) / 2;
27 if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionTop ) {
28 appearPoint.y = ( 64.0 + [[_window screen] visibleFrame].origin.y - [_window frame].size.height );
29 } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) {
30 appearPoint.y = -( [[_window screen] frame].size.height - ( [_window frame].size.height + 32.0 + [[_window screen] visibleFrame].origin.y) );
31 } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionMiddle ) {
32 appearPoint.y = ( [_window frame].size.height - [[_window screen] visibleFrame].size.height) / 2;
35 transform = CGAffineTransformMakeTranslation(appearPoint.x, appearPoint.y);
36 CGSSetWindowTransform([NSApp contextID],
37 (CGSWindowID)[_window windowNumber],
40 [_window orderFront:self];
41 [self setWindowVisibility:ITWindowVisibleState];
50 /*************************************************************************/
52 #pragma mark VANISH METHODS
53 /*************************************************************************/
57 [_window orderOut:self];
58 [self setWindowVisibility:ITWindowHiddenState];