Adding a better cancel job to the Pivot effect. Also redoing the showcase interface...
[ITKit.git] / ITWindowEffect.h
1 /*
2  *      ITKit
3  *  ITWindowEffect
4  *    Protocal and abstract superclass for performing effects on windows.
5  *
6  *  Original Author : Matt Judy <mjudy@ithinksw.com>
7  *   Responsibility : Matt Judy <mjudy@ithinksw.com>
8  *
9  *  Copyright (c) 2002 - 2003 iThink Software.
10  *  All Rights Reserved
11  *
12  */
13
14
15 #import <Cocoa/Cocoa.h>
16 #import "ITWindowPositioning.h"
17
18
19 #define EFFECT_FPS 30.0
20 #define DEFAULT_EFFECT_TIME 0.75
21
22
23 typedef enum {
24     ITTransientStatusWindowHiddenState,
25     ITTransientStatusWindowAppearingState,
26     ITTransientStatusWindowVisibleState,
27     ITTransientStatusWindowVanishingState
28 } ITWindowVisibilityState;
29
30
31 @protocol ITWindowEffect
32 - (void)performAppear;
33 - (void)performVanish;
34 - (void)cancelAppear;
35 - (void)cancelVanish;
36 @end
37
38
39 @protocol ITWindowVisibility
40 - (ITWindowVisibilityState)visibilityState;
41 - (void)setVisibilityState:(ITWindowVisibilityState)newState;
42 @end
43
44
45 @interface ITWindowEffect : NSObject <ITWindowEffect>
46 {
47     NSWindow                   *_window;
48     float                       _effectTime;
49     float                       _effectSpeed;
50     double                      _effectProgress;
51     ITVerticalWindowPosition    _verticalPosition;
52     ITHorizontalWindowPosition  _horizontalPosition;
53     NSTimer                    *_effectTimer;
54 }
55
56 // Designated initializer
57 - (id)initWithWindow:(NSWindow *)window;
58
59 - (NSWindow *)window;
60
61 - (void)setWindow:(NSWindow *)newWindow;
62
63 - (void)setWindowVisibility:(ITWindowVisibilityState)visibilityState;
64
65 - (float)effectTime;
66 - (void)setEffectTime:(float)newTime;
67
68 @end