#import "ITTextField.h"
#import "ITGrayRoundedView.h"
+@class ITTextField;
+@class ITGrayRoundedView;
/*************************************************************************/
#pragma mark -
{
NSRect contentRect;
- CGSValueObj key;
- CGSValueObj ignore;
-
- // If no Content View was provided, use a generic NSImageView with the app icon.
+ // If no Content View was provided, use a generic NSView with the app icon.
if ( ! (contentView) ) {
contentView = [[[NSView alloc] initWithFrame:
NSMakeRect(100.0, 100.0, 200.0, 200.0)] autorelease];
backing:NSBackingStoreBuffered
defer:NO] ) ) {
- _visibilityState = ITTransientStatusWindowHiddenState;
- _exitMode = exitMode;
- _exitDelay = DEFAULT_EXIT_DELAY;
- _backgroundType = backgroundType;
- _verticalPosition = ITTransientStatusWindowPositionBottom;
- _horizontalPosition = ITTransientStatusWindowPositionLeft;
- _entryEffect = ITTransientStatusWindowEffectNone;
- _exitEffect = ITTransientStatusWindowEffectDissolve;
-
+ _visibilityState = ITTransientStatusWindowHiddenState;
+ _exitMode = exitMode;
+ _exitDelay = DEFAULT_EXIT_DELAY;
+ _backgroundType = backgroundType;
+ _verticalPosition = ITTransientStatusWindowPositionBottom;
+ _horizontalPosition = ITTransientStatusWindowPositionLeft;
+ _entryEffect = ITTransientStatusWindowEffectNone;
+ _exitEffect = ITTransientStatusWindowEffectDissolve;
+ _effectTime = DEFAULT_EFFECT_TIME;
+ _reallyIgnoresEvents = YES;
_delayTimer = nil;
_fadeTimer = nil;
// [self setContentView:contentView];
// }
-// [self setIgnoresMouseEvents:YES];
-
- key = CGSCreateCString("IgnoreForEvents");
- ignore = CGSCreateBoolean(kCGSTrue);
-
- CGSSetWindowProperty([NSApp contextID], (CGSWindowID)[self windowNumber], key, ignore);
-
- CGSReleaseObj(key);
- CGSReleaseObj(ignore);
-
+ [self setIgnoresMouseEvents:YES];
[self setLevel:NSScreenSaverWindowLevel];
[self setContentView:contentView];
[self rebuildWindow];
#pragma mark INSTANCE METHODS
/*************************************************************************/
+- (void)setRotation:(float)angle
+{
+ CGAffineTransform transform = CGAffineTransformMakeRotation(angle);
+ transform.tx = -32.0;
+ transform.ty = [self frame].size.height + 32.0;
+ CGSSetWindowTransform([NSApp contextID],
+ (CGSWindowID)[self windowNumber],
+ CGAffineTransformTranslate(transform,
+ (([self frame].origin.x - 32.0) * -1),
+ (([[self screen] frame].size.height - ([self frame].origin.y) + 32.0) * -1) ));
+ NSLog(@"%f %f", ([self frame].origin.x * -1), ([self frame].origin.y * -1));
+}
+
+- (BOOL)ignoresMouseEvents
+{
+ return _reallyIgnoresEvents;
+}
+
+- (void)setIgnoresMouseEvents:(BOOL)flag
+{
+ CGSValueObj key;
+ CGSValueObj ignore;
+
+ key = CGSCreateCString("IgnoreForEvents");
+ ignore = CGSCreateBoolean( (flag ? kCGSTrue : kCGSFalse) );
+ CGSSetWindowProperty([NSApp contextID], (CGSWindowID)[self windowNumber], key, ignore);
+ CGSReleaseObj(key);
+ CGSReleaseObj(ignore);
+
+ _reallyIgnoresEvents = flag;
+}
+
- (void)orderFront:(id)sender
{
- if ( _exitMode = ITTransientStatusWindowExitAfterDelay ) {
+ if ( _exitMode == ITTransientStatusWindowExitAfterDelay ) {
// set the timer, and orderOut: when it lapses.
}
- (void)makeKeyAndOrderFront:(id)sender
{
- if ( _exitMode = ITTransientStatusWindowExitAfterDelay ) {
+ if ( _exitMode == ITTransientStatusWindowExitAfterDelay ) {
// set the timer, and orderOut: when it lapses.
}
}
}
+- (NSTimeInterval)animationResizeTime:(NSRect)newFrame
+{
+ return _effectTime;
+}
+
/*
- (id)contentView
return _visibilityState;
}
-- (ITTransientStatusWindowExitMode)ExitMode
+- (ITTransientStatusWindowExitMode)exitMode
{
return _exitMode;
}
if ( _entryEffect == ITTransientStatusWindowEffectDissolve ) {
[self dissolveEffect:YES];
} else if ( _entryEffect == ITTransientStatusWindowEffectSlideVertically ) {
- [self slideEffect:YES];
+ [self slideVerticalEffect:YES];
} else if ( _entryEffect == ITTransientStatusWindowEffectSlideHorizontally ) {
- [self slideEffect:YES];
+ [self slideHorizontalEffect:YES];
}
} else if ( _visibilityState == ITTransientStatusWindowVisibleState ) {
if ( _exitEffect == ITTransientStatusWindowEffectDissolve ) {
[self dissolveEffect:NO];
} else if ( _exitEffect == ITTransientStatusWindowEffectSlideVertically ) {
- [self slideEffect:NO];
+ [self slideVerticalEffect:NO];
} else if ( _exitEffect == ITTransientStatusWindowEffectSlideHorizontally ) {
- [self slideEffect:NO];
+ [self slideHorizontalEffect:NO];
}
}
}
- (void)dissolveEffect:(BOOL)entering
{
-
- [super orderFront:self];
+ if ( entering ) {
+ [super orderFront:self];
+ } else {
+ [super orderOut:self];
+ }
}
- (void)slideVerticalEffect:(BOOL)entering
{
- [super orderFront:self];
+ if ( entering ) {
+ [super orderFront:self];
+ } else {
+ [super orderOut:self];
+ }
}
- (void)slideHorizontalEffect:(BOOL)entering
{
- [super orderFront:self];
+ if ( entering ) {
+ [super orderFront:self];
+ } else {
+ [super orderOut:self];
+ }
}