Fixed a crash when Core Image was available.
[ITKit.git] / ITCutWindowEffect.m
1 #import "ITCutWindowEffect.h"
2 #import "ITTransientStatusWindow.h"
3 #import "ITCoreGraphicsHacks.h"
4
5 @implementation ITCutWindowEffect
6
7
8 + (NSString *)effectName
9 {
10     return @"Cut";
11 }
12
13 + (NSDictionary *)supportedPositions
14 {
15     return [NSDictionary dictionaryWithObjectsAndKeys:
16         [NSDictionary dictionaryWithObjectsAndKeys:
17             [NSNumber numberWithBool:YES], @"Left",
18             [NSNumber numberWithBool:YES], @"Center",
19             [NSNumber numberWithBool:YES], @"Right", nil] , @"Top" ,
20         [NSDictionary dictionaryWithObjectsAndKeys:
21             [NSNumber numberWithBool:YES], @"Left",
22             [NSNumber numberWithBool:YES], @"Center",
23             [NSNumber numberWithBool:YES], @"Right", nil] , @"Middle" ,
24         [NSDictionary dictionaryWithObjectsAndKeys:
25             [NSNumber numberWithBool:YES], @"Left",
26             [NSNumber numberWithBool:YES], @"Center",
27             [NSNumber numberWithBool:YES], @"Right", nil] , @"Bottom" , nil];
28 }
29
30 + (unsigned int)listOrder
31 {
32     return 100;
33 }
34
35
36 /*************************************************************************/
37 #pragma mark -
38 #pragma mark APPEAR METHODS
39 /*************************************************************************/
40
41 - (void)performAppear
42 {
43     [_window orderFront:self];
44     [self setWindowVisibility:ITWindowVisibleState];
45 }
46
47 - (void)cancelAppear
48 {
49     [self performVanish];
50 }
51
52
53 /*************************************************************************/
54 #pragma mark -
55 #pragma mark VANISH METHODS
56 /*************************************************************************/
57
58 - (void)performVanish
59 {
60     [_window orderOut:self];
61     [self setWindowVisibility:ITWindowHiddenState];
62 }
63
64 - (void)cancelVanish
65 {
66     [self performAppear];
67 }
68
69
70 @end