Checking in new window effect frame, so I can begin moving the guts into it. Also...
authorMatthew Judy <mjudy@ithinksw.com>
Wed, 19 Mar 2003 03:48:14 +0000 (03:48 +0000)
committerMatthew Judy <mjudy@ithinksw.com>
Wed, 19 Mar 2003 03:48:14 +0000 (03:48 +0000)
13 files changed:
EffectSupport.txt [new file with mode: 0755]
ITDissolveWindowEffect.h [new file with mode: 0755]
ITDissolveWindowEffect.m [new file with mode: 0755]
ITPivotWindowEffect.h [new file with mode: 0755]
ITPivotWindowEffect.m [new file with mode: 0755]
ITSlideHorizontallyWindowEffect.h [new file with mode: 0755]
ITSlideHorizontallyWindowEffect.m [new file with mode: 0755]
ITSlideVerticallyWindowEffect.h [new file with mode: 0755]
ITSlideVerticallyWindowEffect.m [new file with mode: 0755]
ITTransientStatusWindow.h
ITTransientStatusWindow.m
ITWindowEffect.h [new file with mode: 0755]
ITWindowEffect.m [new file with mode: 0755]

diff --git a/EffectSupport.txt b/EffectSupport.txt
new file mode 100755 (executable)
index 0000000..d380500
--- /dev/null
@@ -0,0 +1,35 @@
+POSITIONS:
+
++-------------------+
+| A       B       C |
+|                   |
+| D       E       F |
+|                   |
+| G       H       I |
++-------------------+
+
+
+EFFECTS:
+
+0-) None
+1-) Dissolve
+2-) Slide Vertically
+3-) Slide Horizontally
+4-) Pivot
+
+
+MATCHES
+
+Pos. | Possible Effects      + = Maybe (Future)
+-----+--------------------   - = Not Supported
+  A  | 0   1   2   3   4
+  B  | 0   1   2   -   +
+  C  | 0   1   2   3   4
+  D  | 0   1   -   3   +
+  E  | 0   1   -   -   -
+  F  | 0   1   -   3   +
+  G  | 0   1   2   3   4
+  H  | 0   1   2   -   +
+  I  | 0   1   2   3   4
+
+
diff --git a/ITDissolveWindowEffect.h b/ITDissolveWindowEffect.h
new file mode 100755 (executable)
index 0000000..f1f8a0e
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ *     ITKit
+ *  ITDissolveWindowEffect
+ *    Effect subclass which performs a dissolve fade effect on a window.
+ *
+ *  Original Author : Matt Judy <mjudy@ithinksw.com>
+ *   Responsibility : Matt Judy <mjudy@ithinksw.com>
+ *
+ *  Copyright (c) 2002 - 2003 iThink Software.
+ *  All Rights Reserved
+ *
+ */
+
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface ITDissolveWindowEffect : ITWindowEffect <ITWindowEffect> {
+
+}
+
+@end
diff --git a/ITDissolveWindowEffect.m b/ITDissolveWindowEffect.m
new file mode 100755 (executable)
index 0000000..26e43e8
--- /dev/null
@@ -0,0 +1,18 @@
+#import "ITDissolveWindowEffect.h"
+
+
+@implementation ITDissolveWindowEffect
+
+
+- (void)performAppear
+{
+    NSLog("ITDissolveWindowEffect does not implement performAppear.");
+}
+
+- (void)performVanish
+{
+    NSLog("ITDissolveWindowEffect does not implement performVanish.");
+}
+
+
+@end
diff --git a/ITPivotWindowEffect.h b/ITPivotWindowEffect.h
new file mode 100755 (executable)
index 0000000..abe13e0
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ *     ITKit
+ *  ITPivotWindowEffect
+ *    Effect subclass which pivots (rotates) a window into position on the screen.
+ *
+ *  Original Author : Matt Judy <mjudy@ithinksw.com>
+ *   Responsibility : Matt Judy <mjudy@ithinksw.com>
+ *
+ *  Copyright (c) 2002 - 2003 iThink Software.
+ *  All Rights Reserved
+ *
+ */
+
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface ITPivotWindowEffect : ITWindowEffect <ITWindowEffect> {
+
+}
+
+@end
diff --git a/ITPivotWindowEffect.m b/ITPivotWindowEffect.m
new file mode 100755 (executable)
index 0000000..7f0e627
--- /dev/null
@@ -0,0 +1,18 @@
+#import "ITPivotWindowEffect.h"
+
+
+@implementation ITPivotWindowEffect
+
+
+- (void)performAppear
+{
+    NSLog("ITPivotWindowEffect does not implement performAppear.");
+}
+
+- (void)performVanish
+{
+    NSLog("ITPivotWindowEffect does not implement performVanish.");
+}
+
+
+@end
diff --git a/ITSlideHorizontallyWindowEffect.h b/ITSlideHorizontallyWindowEffect.h
new file mode 100755 (executable)
index 0000000..e63bdd6
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ *     ITKit
+ *  ITSlideHorizontallyWindowEffect
+ *    Effect subclass which slides a window in from the right or left side of the screen.
+ *
+ *  Original Author : Matt Judy <mjudy@ithinksw.com>
+ *   Responsibility : Matt Judy <mjudy@ithinksw.com>
+ *
+ *  Copyright (c) 2002 - 2003 iThink Software.
+ *  All Rights Reserved
+ *
+ */
+
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface ITSlideHorizontallyWindowEffect : ITWindowEffect <ITWindowEffect> {
+
+}
+
+@end
diff --git a/ITSlideHorizontallyWindowEffect.m b/ITSlideHorizontallyWindowEffect.m
new file mode 100755 (executable)
index 0000000..5ba9550
--- /dev/null
@@ -0,0 +1,18 @@
+#import "ITSlideHorizontallyWindowEffect.h"
+
+
+@implementation ITSlideHorizontallyWindowEffect
+
+
+- (void)performAppear
+{
+    NSLog("ITSlideHorizontallyWindowEffect does not implement performAppear.");
+}
+
+- (void)performVanish
+{
+    NSLog("ITSlideHorizontallyWindowEffect does not implement performVanish.");
+}
+
+
+@end
diff --git a/ITSlideVerticallyWindowEffect.h b/ITSlideVerticallyWindowEffect.h
new file mode 100755 (executable)
index 0000000..fff3957
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ *     ITKit
+ *  ITSlideVerticallyWindowEffect
+ *    Effect subclass which slides a window in from the top or bottom of the screen.
+ *
+ *  Original Author : Matt Judy <mjudy@ithinksw.com>
+ *   Responsibility : Matt Judy <mjudy@ithinksw.com>
+ *
+ *  Copyright (c) 2002 - 2003 iThink Software.
+ *  All Rights Reserved
+ *
+ */
+
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface ITSlideVerticallyWindowEffect : ITWindowEffect <ITWindowEffect> {
+
+}
+
+@end
diff --git a/ITSlideVerticallyWindowEffect.m b/ITSlideVerticallyWindowEffect.m
new file mode 100755 (executable)
index 0000000..13fa2bc
--- /dev/null
@@ -0,0 +1,18 @@
+#import "ITSlideVerticallyWindowEffect.h"
+
+
+@implementation ITSlideVerticallyWindowEffect
+
+
+- (void)performAppear
+{
+    NSLog("ITSlideVerticallyWindowEffect does not implement performAppear.");
+}
+
+- (void)performVanish
+{
+    NSLog("ITSlideVerticallyWindowEffect does not implement performVanish.");
+}
+
+
+@end
index 0c60020..aa7e5f6 100755 (executable)
@@ -24,6 +24,7 @@
 
 @class ITTextField;
 @class ITGrayRoundedView;
+@class ITWindowEffect;
 
 
 typedef enum {
@@ -57,27 +58,19 @@ typedef enum {
     ITTransientStatusWindowOther
 } ITTransientStatusWindowPosition;
 
-typedef enum {                                      // Note: Entry effects described here.  Exit does the reverse.
-    ITTransientStatusWindowEffectNone,              // No effect, window just appears.
-    ITTransientStatusWindowEffectDissolve,          // Fades in.
-    ITTransientStatusWindowEffectSlideVertically,   // Slides vertically onto the screen from the nearest edge
-    ITTransientStatusWindowEffectSlideHorizontally, // Slides horizontally onto the screen from the nearest edge
-    ITTransientStatusWindowEffectPivot              // Rotate into place from perpendicular edge
-} ITTransientStatusWindowEffect;
-
-
 @interface ITTransientStatusWindow : NSWindow {
 
     ITTransientStatusWindowVisibilityState _visibilityState;
     ITTransientStatusWindowExitMode        _exitMode;
     float                                  _exitDelay;
     ITTransientStatusWindowBackgroundType  _backgroundType;
-    ITTransientStatusWindowEffect          _entryEffect;
-    ITTransientStatusWindowEffect          _exitEffect;
+    ITWindowEffect                        *_entryEffect;
+    ITWindowEffect                        *_exitEffect;
     float                                  _effectTime;
     double                                 _effectProgress;
     ITTransientStatusWindowPosition        _verticalPosition;
     ITTransientStatusWindowPosition        _horizontalPosition;
+    int                                    _screenPadding;
 
     BOOL _reallyIgnoresEvents;
     
@@ -110,11 +103,11 @@ typedef enum {                                      // Note: Entry effects descr
 - (ITTransientStatusWindowPosition)horizontalPosition;
 - (void)setHorizontalPosition:(ITTransientStatusWindowPosition)newPosition;
 
-- (ITTransientStatusWindowEffect)entryEffect;
-- (void)setEntryEffect:(ITTransientStatusWindowEffect)newEffect;
+- (ITWindowEffect *)entryEffect;
+- (void)setEntryEffect:(ITWindowEffect *)newEffect;
 
-- (ITTransientStatusWindowEffect)exitEffect;
-- (void)setExitEffect:(ITTransientStatusWindowEffect)newEffect;
+- (ITWindowEffect *)exitEffect;
+- (void)setExitEffect:(ITWindowEffect *)newEffect;
 
 
 @end
index ed587ff..004396a 100755 (executable)
@@ -76,7 +76,7 @@ static ITTransientStatusWindow *staticWindow = nil;
 {
     NSRect contentRect;
     
-    // If no Content View was provided, use a generic NSView with the app icon.
+    // If no Content View was provided, use a generic view.
     if ( ! (contentView) ) {
         contentView = [[[NSView alloc] initWithFrame:
             NSMakeRect(100.0, 100.0, 200.0, 200.0)] autorelease];
@@ -96,8 +96,8 @@ static ITTransientStatusWindow *staticWindow = nil;
         _backgroundType      = backgroundType;
         _verticalPosition    = ITTransientStatusWindowPositionBottom;
         _horizontalPosition  = ITTransientStatusWindowPositionLeft;
-//      _entryEffect         = ITTransientStatusWindowEffectNone;
-        _entryEffect         = ITTransientStatusWindowEffectPivot;
+        _screenPadding       = 32.0;
+        _entryEffect         = ITTransientStatusWindowEffectNone;
         _exitEffect          = ITTransientStatusWindowEffectDissolve;
         _effectTime          = DEFAULT_EFFECT_TIME;
         _effectProgress      = 0.00;
@@ -105,11 +105,11 @@ static ITTransientStatusWindow *staticWindow = nil;
         _delayTimer          = nil;
         _effectTimer         = nil;
 
-//        if ( _backgroundType == ITTransientStatusWindowRounded ) {
-//            _contentSubView = contentView;
-//        } else {
-//            [self setContentView:contentView];
-//        }
+//      if ( _backgroundType == ITTransientStatusWindowRounded ) {
+//          _contentSubView = contentView;
+//      } else {
+//          [self setContentView:contentView];
+//      }
 
         [self setIgnoresMouseEvents:YES];
         [self setLevel:NSScreenSaverWindowLevel];
@@ -271,24 +271,26 @@ static ITTransientStatusWindow *staticWindow = nil;
     _horizontalPosition = newPosition;
 }
 
-- (ITTransientStatusWindowEffect)entryEffect
+- (ITWindowEffect *)entryEffect
 {
     return _entryEffect;
 }
 
-- (void)setEntryEffect:(ITTransientStatusWindowEffect)newEffect;
+- (void)setEntryEffect:(ITWindowEffect *)newEffect
 {
-    _entryEffect = newEffect;
+    [_entryEffect autorelease];
+    _entryEffect = [newEffect retain];
 }
 
-- (ITTransientStatusWindowEffect)exitEffect;
+- (ITWindowEffect *)exitEffect
 {
     return _exitEffect;
 }
 
-- (void)setExitEffect:(ITTransientStatusWindowEffect)newEffect;
+- (void)setExitEffect:(ITWindowEffect *)newEffect
 {
-    _exitEffect = newEffect;
+    [_exitEffect autorelease];
+    _exitEffect = [newEffect retain];
 }
 
 
@@ -421,8 +423,11 @@ static ITTransientStatusWindow *staticWindow = nil;
 {
     float degAngle = (angle * (pi / 180));
     CGAffineTransform transform = CGAffineTransformMakeRotation(degAngle);
+    
+ // Set pivot point
     transform.tx = -32.0;
     transform.ty = [self frame].size.height + 32.0;
+    
     CGSSetWindowTransform([NSApp contextID],
                           (CGSWindowID)[self windowNumber],
                           CGAffineTransformTranslate(transform,
diff --git a/ITWindowEffect.h b/ITWindowEffect.h
new file mode 100755 (executable)
index 0000000..bb1c3b8
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ *     ITKit
+ *  ITWindowEffect
+ *    Protocal and abstract superclass for performing effects on windows.
+ *
+ *  Original Author : Matt Judy <mjudy@ithinksw.com>
+ *   Responsibility : Matt Judy <mjudy@ithinksw.com>
+ *
+ *  Copyright (c) 2002 - 2003 iThink Software.
+ *  All Rights Reserved
+ *
+ */
+
+
+#import <Cocoa/Cocoa.h>
+
+
+@protocol ITWindowEffect
+
+- (void)performAppear;
+- (void)performVanish;
+
+@end
+
+
+@interface ITWindowEffect : NSObject <ITWindowEffect>
+{
+    NSWindow *_window;
+}
+
+// Designated initializer
+- (id)initWithWindow:(NSWindow *)window;
+
+- (NSWindow *)window;
+
+// setWindow: does not retain or release its window.  It simply references it.
+- (void)setWindow:(NSWindow *)newWindow;
+
+@end
diff --git a/ITWindowEffect.m b/ITWindowEffect.m
new file mode 100755 (executable)
index 0000000..5c32fb4
--- /dev/null
@@ -0,0 +1,41 @@
+//
+//  ITWindowEffect.m
+//  ITKit
+//
+//  Created by Matt L. Judy on Sat Mar 01 2003.
+//  Copyright (c) 2003 NibFile.com. All rights reserved.
+//
+
+#import "ITWindowEffect.h"
+
+
+@implementation ITWindowEffect
+
+
+- (id)initWithWindow:(NSWindow *)window
+{
+    _window = window;
+}
+
+- (NSWindow *)window
+{
+    return _window;
+}
+
+- (void)setWindow:(NSWindow *)newWindow
+{
+    _window = newWindow;
+}
+
+- (void)performAppear
+{
+    NSLog("ITWindowEffect does not implement performAppear.");
+}
+
+- (void)performVanish
+{
+    NSLog("ITWindowEffect does not implement performVanish.");
+}
+
+
+@end