--- /dev/null
+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
+
+
--- /dev/null
+/*
+ * 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
--- /dev/null
+#import "ITDissolveWindowEffect.h"
+
+
+@implementation ITDissolveWindowEffect
+
+
+- (void)performAppear
+{
+ NSLog("ITDissolveWindowEffect does not implement performAppear.");
+}
+
+- (void)performVanish
+{
+ NSLog("ITDissolveWindowEffect does not implement performVanish.");
+}
+
+
+@end
--- /dev/null
+/*
+ * 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
--- /dev/null
+#import "ITPivotWindowEffect.h"
+
+
+@implementation ITPivotWindowEffect
+
+
+- (void)performAppear
+{
+ NSLog("ITPivotWindowEffect does not implement performAppear.");
+}
+
+- (void)performVanish
+{
+ NSLog("ITPivotWindowEffect does not implement performVanish.");
+}
+
+
+@end
--- /dev/null
+/*
+ * 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
--- /dev/null
+#import "ITSlideHorizontallyWindowEffect.h"
+
+
+@implementation ITSlideHorizontallyWindowEffect
+
+
+- (void)performAppear
+{
+ NSLog("ITSlideHorizontallyWindowEffect does not implement performAppear.");
+}
+
+- (void)performVanish
+{
+ NSLog("ITSlideHorizontallyWindowEffect does not implement performVanish.");
+}
+
+
+@end
--- /dev/null
+/*
+ * 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
--- /dev/null
+#import "ITSlideVerticallyWindowEffect.h"
+
+
+@implementation ITSlideVerticallyWindowEffect
+
+
+- (void)performAppear
+{
+ NSLog("ITSlideVerticallyWindowEffect does not implement performAppear.");
+}
+
+- (void)performVanish
+{
+ NSLog("ITSlideVerticallyWindowEffect does not implement performVanish.");
+}
+
+
+@end
@class ITTextField;
@class ITGrayRoundedView;
+@class ITWindowEffect;
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;
- (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
{
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];
_backgroundType = backgroundType;
_verticalPosition = ITTransientStatusWindowPositionBottom;
_horizontalPosition = ITTransientStatusWindowPositionLeft;
-// _entryEffect = ITTransientStatusWindowEffectNone;
- _entryEffect = ITTransientStatusWindowEffectPivot;
+ _screenPadding = 32.0;
+ _entryEffect = ITTransientStatusWindowEffectNone;
_exitEffect = ITTransientStatusWindowEffectDissolve;
_effectTime = DEFAULT_EFFECT_TIME;
_effectProgress = 0.00;
_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];
_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];
}
{
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,
--- /dev/null
+/*
+ * 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
--- /dev/null
+//
+// 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