Revision: 6528
http://skim-app.svn.sourceforge.net/skim-app/?rev=6528&view=rev
Author: hofman
Date: 2010-05-09 16:37:15 +0000 (Sun, 09 May 2010)
Log Message:
-----------
Fixes to transitions. Fix localized names for core graphics transirions, fix
core filter key name. Use windowcontroller subclass and init with the window.
Modified Paths:
--------------
trunk/SKTransitionController.h
trunk/SKTransitionController.m
Modified: trunk/SKTransitionController.h
===================================================================
--- trunk/SKTransitionController.h 2010-05-08 11:22:41 UTC (rev 6527)
+++ trunk/SKTransitionController.h 2010-05-09 16:37:15 UTC (rev 6528)
@@ -62,9 +62,7 @@
@class CIImage;
-...@interface SKTransitionController : NSObject {
- NSWindow *transitionWindow;
-
+...@interface SKTransitionController : NSWindowController {
NSView *view;
CIImage *initialImage;
NSRect imageRect;
Modified: trunk/SKTransitionController.m
===================================================================
--- trunk/SKTransitionController.m 2010-05-08 11:22:41 UTC (rev 6527)
+++ trunk/SKTransitionController.m 2010-05-09 16:37:15 UTC (rev 6528)
@@ -54,7 +54,7 @@
NSString *SKShouldRestrictKey = @"shouldRestrict";
#define kCIInputBacksideImageKey @"inputBacksideImage"
-#define kCIInputRectangleKey @"inputRectangleImage"
+#define kCIInputRectangleKey @"inputRectangle"
#define WEAK_NULL NULL
@@ -207,16 +207,21 @@
case SKRevealTransition: return NSLocalizedString(@"Reveal",
@"Transition name");
case SKSlideTransition: return NSLocalizedString(@"Slide",
@"Transition name");
case SKWarpFadeTransition: return NSLocalizedString(@"Warp Fade",
@"Transition name");
- case SKSwapTransition: return NSLocalizedString(@"Warp Switch",
@"Transition name");
- case SKCubeTransition: return NSLocalizedString(@"Swap",
@"Transition name");
- case SKWarpSwitchTransition: return NSLocalizedString(@"Cube",
@"Transition name");
+ case SKSwapTransition: return NSLocalizedString(@"Swap",
@"Transition name");
+ case SKCubeTransition: return NSLocalizedString(@"Cube",
@"Transition name");
+ case SKWarpSwitchTransition: return NSLocalizedString(@"Warp Switch",
@"Transition name");
case SKWarpFlipTransition: return NSLocalizedString(@"Flip",
@"Transition name");
default: return [CIFilter
localizedNameForFilterName:[self nameForStyle:style]];
};
}
- (id)initWithView:(NSView *)aView {
- if (self = [super init]) {
+ NSWindow *window = [[[NSWindow alloc] initWithContentRect:NSZeroRect
styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]
autorelease];
+ [window setReleasedWhenClosed:NO];
+ [window setIgnoresMouseEvents:YES];
+ [window setContentView:[[[SKTransitionView alloc] init] autorelease]];
+
+ if (self = [self initWithWindow:window]) {
view = aView; // don't retain as it may retain us
transitionStyle = SKNoTransition;
@@ -227,17 +232,12 @@
currentShouldRestrict = YES;
currentForward = YES;
- transitionWindow = [[NSWindow alloc] initWithContentRect:NSZeroRect
styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
- [transitionWindow setReleasedWhenClosed:NO];
- [transitionWindow setIgnoresMouseEvents:YES];
- [transitionWindow setContentView:[[[SKTransitionView alloc] init]
autorelease]];
}
return self;
}
- (void)dealloc {
view = nil;
- SKDESTROY(transitionWindow);
SKDESTROY(initialImage);
SKDESTROY(filters);
SKDESTROY(pageTransitions);
@@ -355,12 +355,8 @@
return [[CIImage alloc] initWithBitmapImageRep:contentBitmap];
}
-- (NSWindow *)transitionWindow {
- return transitionWindow;
-}
-
- (SKTransitionView *)transitionView {
- return (SKTransitionView *)[transitionWindow contentView];
+ return (SKTransitionView *)[[self window] contentView];
}
- (void)prepareAnimationForRect:(NSRect)rect from:(NSUInteger)fromIndex
to:(NSUInteger)toIndex {
@@ -420,9 +416,9 @@
[[self transitionView] setImage:initialImage];
initialImage = nil;
- [[self transitionWindow] setFrame:frame display:YES];
- [[self transitionWindow] orderBack:nil];
- [[view window] addChildWindow:[self transitionWindow]
ordered:NSWindowAbove];
+ [[self window] setFrame:frame display:YES];
+ [[self window] orderBack:nil];
+ [[view window] addChildWindow:[self window] ordered:NSWindowAbove];
}
// declare our variables
@@ -433,7 +429,7 @@
spec.type = currentTransitionStyle;
spec.option = currentForward ? CGSLeft : CGSRight;
spec.backColour = NULL;
- spec.wid = [(currentShouldRestrict ? [self transitionWindow] : [view
window]) windowNumber];
+ spec.wid = [(currentShouldRestrict ? [self window] : [view window])
windowNumber];
// Let's get a connection
CGSConnection cgs = _CGSDefaultConnection();
@@ -460,8 +456,8 @@
handle = 0;
if (currentShouldRestrict) {
- [[view window] removeChildWindow:[self transitionWindow]];
- [[self transitionWindow] orderOut:nil];
+ [[view window] removeChildWindow:[self window]];
+ [[self window] orderOut:nil];
[[self transitionView] setImage:nil];
}
}
@@ -488,9 +484,9 @@
[[self transitionView] setAnimation:animation];
[animation release];
- [[self transitionWindow] setFrame:frame display:NO];
- [[self transitionWindow] orderBack:nil];
- [[view window] addChildWindow:[self transitionWindow]
ordered:NSWindowAbove];
+ [[self window] setFrame:frame display:NO];
+ [[self window] orderBack:nil];
+ [[view window] addChildWindow:[self window] ordered:NSWindowAbove];
[animation startAnimation];
@@ -500,8 +496,8 @@
[[view window] enableFlushWindow];
[[view window] flushWindow];
- [[view window] removeChildWindow:[self transitionWindow]];
- [[self transitionWindow] orderOut:nil];
+ [[view window] removeChildWindow:[self window]];
+ [[self window] orderOut:nil];
[[self transitionView] setAnimation:nil];
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit