From 2589c16f443dd6fe9df554eb533df464b5bb919b Mon Sep 17 00:00:00 2001 From: Matthew Judy Date: Wed, 19 Mar 2003 03:48:14 +0000 Subject: [PATCH] Checking in new window effect frame, so I can begin moving the guts into it. Also moving the EffectSupport.txt reference file to the kit, where it belongs. --- EffectSupport.txt | 35 ++++++++++++++++++++++++++ ITDissolveWindowEffect.h | 22 +++++++++++++++++ ITDissolveWindowEffect.m | 18 ++++++++++++++ ITPivotWindowEffect.h | 22 +++++++++++++++++ ITPivotWindowEffect.m | 18 ++++++++++++++ ITSlideHorizontallyWindowEffect.h | 22 +++++++++++++++++ ITSlideHorizontallyWindowEffect.m | 18 ++++++++++++++ ITSlideVerticallyWindowEffect.h | 22 +++++++++++++++++ ITSlideVerticallyWindowEffect.m | 18 ++++++++++++++ ITTransientStatusWindow.h | 23 ++++++----------- ITTransientStatusWindow.m | 33 ++++++++++++++----------- ITWindowEffect.h | 39 +++++++++++++++++++++++++++++ ITWindowEffect.m | 41 +++++++++++++++++++++++++++++++ 13 files changed, 302 insertions(+), 29 deletions(-) create mode 100755 EffectSupport.txt create mode 100755 ITDissolveWindowEffect.h create mode 100755 ITDissolveWindowEffect.m create mode 100755 ITPivotWindowEffect.h create mode 100755 ITPivotWindowEffect.m create mode 100755 ITSlideHorizontallyWindowEffect.h create mode 100755 ITSlideHorizontallyWindowEffect.m create mode 100755 ITSlideVerticallyWindowEffect.h create mode 100755 ITSlideVerticallyWindowEffect.m create mode 100755 ITWindowEffect.h create mode 100755 ITWindowEffect.m diff --git a/EffectSupport.txt b/EffectSupport.txt new file mode 100755 index 0000000..d380500 --- /dev/null +++ b/EffectSupport.txt @@ -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 index 0000000..f1f8a0e --- /dev/null +++ b/ITDissolveWindowEffect.h @@ -0,0 +1,22 @@ +/* + * ITKit + * ITDissolveWindowEffect + * Effect subclass which performs a dissolve fade effect on a window. + * + * Original Author : Matt Judy + * Responsibility : Matt Judy + * + * Copyright (c) 2002 - 2003 iThink Software. + * All Rights Reserved + * + */ + + +#import + + +@interface ITDissolveWindowEffect : ITWindowEffect { + +} + +@end diff --git a/ITDissolveWindowEffect.m b/ITDissolveWindowEffect.m new file mode 100755 index 0000000..26e43e8 --- /dev/null +++ b/ITDissolveWindowEffect.m @@ -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 index 0000000..abe13e0 --- /dev/null +++ b/ITPivotWindowEffect.h @@ -0,0 +1,22 @@ +/* + * ITKit + * ITPivotWindowEffect + * Effect subclass which pivots (rotates) a window into position on the screen. + * + * Original Author : Matt Judy + * Responsibility : Matt Judy + * + * Copyright (c) 2002 - 2003 iThink Software. + * All Rights Reserved + * + */ + + +#import + + +@interface ITPivotWindowEffect : ITWindowEffect { + +} + +@end diff --git a/ITPivotWindowEffect.m b/ITPivotWindowEffect.m new file mode 100755 index 0000000..7f0e627 --- /dev/null +++ b/ITPivotWindowEffect.m @@ -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 index 0000000..e63bdd6 --- /dev/null +++ b/ITSlideHorizontallyWindowEffect.h @@ -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 + * Responsibility : Matt Judy + * + * Copyright (c) 2002 - 2003 iThink Software. + * All Rights Reserved + * + */ + + +#import + + +@interface ITSlideHorizontallyWindowEffect : ITWindowEffect { + +} + +@end diff --git a/ITSlideHorizontallyWindowEffect.m b/ITSlideHorizontallyWindowEffect.m new file mode 100755 index 0000000..5ba9550 --- /dev/null +++ b/ITSlideHorizontallyWindowEffect.m @@ -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 index 0000000..fff3957 --- /dev/null +++ b/ITSlideVerticallyWindowEffect.h @@ -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 + * Responsibility : Matt Judy + * + * Copyright (c) 2002 - 2003 iThink Software. + * All Rights Reserved + * + */ + + +#import + + +@interface ITSlideVerticallyWindowEffect : ITWindowEffect { + +} + +@end diff --git a/ITSlideVerticallyWindowEffect.m b/ITSlideVerticallyWindowEffect.m new file mode 100755 index 0000000..13fa2bc --- /dev/null +++ b/ITSlideVerticallyWindowEffect.m @@ -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 diff --git a/ITTransientStatusWindow.h b/ITTransientStatusWindow.h index 0c60020..aa7e5f6 100755 --- a/ITTransientStatusWindow.h +++ b/ITTransientStatusWindow.h @@ -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 diff --git a/ITTransientStatusWindow.m b/ITTransientStatusWindow.m index ed587ff..004396a 100755 --- a/ITTransientStatusWindow.m +++ b/ITTransientStatusWindow.m @@ -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 index 0000000..bb1c3b8 --- /dev/null +++ b/ITWindowEffect.h @@ -0,0 +1,39 @@ +/* + * ITKit + * ITWindowEffect + * Protocal and abstract superclass for performing effects on windows. + * + * Original Author : Matt Judy + * Responsibility : Matt Judy + * + * Copyright (c) 2002 - 2003 iThink Software. + * All Rights Reserved + * + */ + + +#import + + +@protocol ITWindowEffect + +- (void)performAppear; +- (void)performVanish; + +@end + + +@interface ITWindowEffect : NSObject +{ + 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 index 0000000..5c32fb4 --- /dev/null +++ b/ITWindowEffect.m @@ -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 -- 2.20.1