You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
(23) |
Apr
(254) |
May
(252) |
Jun
(209) |
Jul
(198) |
Aug
(192) |
Sep
(207) |
Oct
(120) |
Nov
(179) |
Dec
(52) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(48) |
Feb
(69) |
Mar
(129) |
Apr
(250) |
May
(113) |
Jun
(177) |
Jul
(228) |
Aug
(155) |
Sep
(218) |
Oct
(185) |
Nov
(109) |
Dec
(88) |
2009 |
Jan
(83) |
Feb
(39) |
Mar
(70) |
Apr
(47) |
May
(48) |
Jun
(67) |
Jul
(61) |
Aug
(97) |
Sep
(221) |
Oct
(141) |
Nov
(70) |
Dec
(61) |
2010 |
Jan
(45) |
Feb
(76) |
Mar
(178) |
Apr
(106) |
May
(57) |
Jun
(32) |
Jul
(64) |
Aug
(98) |
Sep
(96) |
Oct
(19) |
Nov
(34) |
Dec
(117) |
2011 |
Jan
(55) |
Feb
(48) |
Mar
(64) |
Apr
(21) |
May
(39) |
Jun
(53) |
Jul
(99) |
Aug
(56) |
Sep
(39) |
Oct
(26) |
Nov
(19) |
Dec
(69) |
2012 |
Jan
(17) |
Feb
(40) |
Mar
(17) |
Apr
|
May
(2) |
Jun
(8) |
Jul
(2) |
Aug
(10) |
Sep
(10) |
Oct
(38) |
Nov
(48) |
Dec
(70) |
2013 |
Jan
(43) |
Feb
(47) |
Mar
(39) |
Apr
(37) |
May
(25) |
Jun
(6) |
Jul
(20) |
Aug
(49) |
Sep
(33) |
Oct
(34) |
Nov
(75) |
Dec
(6) |
2014 |
Jan
(32) |
Feb
(10) |
Mar
(17) |
Apr
|
May
|
Jun
(26) |
Jul
(5) |
Aug
|
Sep
(4) |
Oct
(23) |
Nov
(80) |
Dec
(48) |
2015 |
Jan
(80) |
Feb
(50) |
Mar
(58) |
Apr
(20) |
May
(11) |
Jun
(16) |
Jul
(24) |
Aug
(27) |
Sep
(56) |
Oct
(30) |
Nov
(16) |
Dec
(6) |
2016 |
Jan
(31) |
Feb
(14) |
Mar
(23) |
Apr
(17) |
May
(40) |
Jun
(12) |
Jul
(17) |
Aug
(9) |
Sep
(32) |
Oct
(36) |
Nov
(23) |
Dec
(9) |
2017 |
Jan
(37) |
Feb
(23) |
Mar
(65) |
Apr
(22) |
May
(6) |
Jun
(3) |
Jul
|
Aug
|
Sep
(3) |
Oct
(22) |
Nov
(63) |
Dec
(71) |
2018 |
Jan
(83) |
Feb
(21) |
Mar
(35) |
Apr
(44) |
May
(14) |
Jun
(12) |
Jul
(8) |
Aug
(18) |
Sep
(10) |
Oct
(145) |
Nov
(144) |
Dec
(76) |
2019 |
Jan
(18) |
Feb
(28) |
Mar
(5) |
Apr
(208) |
May
(291) |
Jun
(158) |
Jul
(27) |
Aug
(8) |
Sep
(10) |
Oct
(83) |
Nov
(41) |
Dec
(31) |
2020 |
Jan
(16) |
Feb
(46) |
Mar
(100) |
Apr
(78) |
May
(69) |
Jun
(71) |
Jul
(28) |
Aug
(131) |
Sep
(176) |
Oct
(89) |
Nov
(147) |
Dec
(19) |
2021 |
Jan
(19) |
Feb
(25) |
Mar
(91) |
Apr
(98) |
May
(14) |
Jun
(44) |
Jul
(8) |
Aug
(3) |
Sep
(38) |
Oct
(57) |
Nov
(97) |
Dec
(74) |
2022 |
Jan
(89) |
Feb
(47) |
Mar
(15) |
Apr
(50) |
May
(54) |
Jun
(56) |
Jul
(80) |
Aug
(12) |
Sep
(11) |
Oct
(60) |
Nov
(48) |
Dec
(4) |
2023 |
Jan
(75) |
Feb
(49) |
Mar
(84) |
Apr
(24) |
May
(13) |
Jun
(74) |
Jul
(32) |
Aug
(66) |
Sep
(50) |
Oct
(38) |
Nov
(105) |
Dec
(181) |
2024 |
Jan
(21) |
Feb
(49) |
Mar
(77) |
Apr
(84) |
May
(20) |
Jun
(71) |
Jul
(53) |
Aug
(33) |
Sep
(54) |
Oct
(124) |
Nov
(151) |
Dec
(73) |
2025 |
Jan
(61) |
Feb
(17) |
Mar
(136) |
Apr
(72) |
May
(200) |
Jun
(238) |
Jul
(91) |
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <ho...@us...> - 2007-07-17 08:23:30
|
Revision: 2507 http://skim-app.svn.sourceforge.net/skim-app/?rev=2507&view=rev Author: hofman Date: 2007-07-17 01:23:28 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Make transition overlay opaque. Modified Paths: -------------- trunk/SKTransitionController.m trunk/Skim.xcodeproj/project.pbxproj Modified: trunk/SKTransitionController.m =================================================================== --- trunk/SKTransitionController.m 2007-07-16 23:23:27 UTC (rev 2506) +++ trunk/SKTransitionController.m 2007-07-17 08:23:28 UTC (rev 2507) @@ -272,8 +272,6 @@ transitionWindow = [[NSWindow alloc] initWithContentRect:frame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO screen:[window screen]]; [transitionWindow setReleasedWhenClosed:NO]; [transitionWindow setDisplaysWhenScreenProfileChanges:YES]; - [transitionWindow setBackgroundColor:[NSColor clearColor]]; - [transitionWindow setOpaque:NO]; [transitionWindow setIgnoresMouseEvents:YES]; transitionView = [[SKTransitionView alloc] init]; @@ -322,7 +320,7 @@ - (void)setCurrentProgress:(NSAnimationProgress)progress { [filter setValue:[NSNumber numberWithFloat:[self currentValue]] forKey:@"inputTime"]; [super setCurrentProgress:progress]; - [[self delegate] display]; + [[[self delegate] window] display]; } - (CIImage *)currentImage { @@ -397,27 +395,34 @@ } } -- (BOOL)isOpaque { return NO; } - - (void)drawRect:(NSRect)rect { - if (animation) { - NSRect bounds = [self bounds]; + NSRect bounds = [self bounds]; + + [[self openGLContext] makeCurrentContext]; + + if (needsReshape) { + // reset the views coordinate system when the view has been resized or scrolled - [[self openGLContext] makeCurrentContext]; - - if (needsReshape) { - // reset the views coordinate system when the view has been resized or scrolled - - glViewport (0, 0, NSWidth(bounds), NSHeight(bounds)); + glViewport (0, 0, NSWidth(bounds), NSHeight(bounds)); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(NSMinX(bounds), NSMaxX(bounds), NSMinY(bounds), NSMaxY(bounds), -1, 1); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(NSMinX(bounds), NSMaxX(bounds), NSMinY(bounds), NSMaxY(bounds), -1, 1); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - needsReshape = NO; - } + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + needsReshape = NO; + } + + glColor4f(0.0f, 0.0f, 0.0f, 0.0f); + glBegin(GL_POLYGON); + glVertex2f(NSMinX(rect), NSMinY(rect)); + glVertex2f(NSMaxX(rect), NSMinY(rect)); + glVertex2f(NSMaxX(rect), NSMaxY(rect)); + glVertex2f(NSMinX(rect), NSMaxY(rect)); + glEnd(); + + if (animation) { if (context == nil) { NSOpenGLPixelFormat *pf = [self pixelFormat]; @@ -426,18 +431,11 @@ context = [[CIContext contextWithCGLContext:CGLGetCurrentContext() pixelFormat:[pf CGLPixelFormatObj] options:nil] retain]; } - glColor4f(0.0f, 0.0f, 0.0f, 0.0f); - glBegin(GL_POLYGON); - glVertex2f(bounds.origin.x, bounds.origin.y); - glVertex2f(bounds.origin.x + bounds.size.width, bounds.origin.y); - glVertex2f(bounds.origin.x + bounds.size.width, bounds.origin.y + bounds.size.height); - glVertex2f(bounds.origin.x, bounds.origin.y + bounds.size.height); - glEnd(); - [context drawImage:[animation currentImage] inRect:*(CGRect*)&bounds fromRect:*(CGRect*)&bounds]; - glFlush(); } + + glFlush(); } @end Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-07-16 23:23:27 UTC (rev 2506) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-07-17 08:23:28 UTC (rev 2507) @@ -841,6 +841,8 @@ F97751620B37461000DF673B /* SKPSProgressController.m */, CE2DEB1A0B8618DE00D0DA12 /* SKFindController.h */, CE2DEB1B0B8618DE00D0DA12 /* SKFindController.m */, + CEB72B890C4A189D000350F9 /* SKTransitionController.h */, + CE1ADEBE0C4C341100071840 /* SKTransitionController.m */, ); name = Controllers; sourceTree = "<group>"; @@ -867,8 +869,6 @@ CE2DE4D10B85D92F00D0DA12 /* Views */ = { isa = PBXGroup; children = ( - CEB72B890C4A189D000350F9 /* SKTransitionController.h */, - CE1ADEBE0C4C341100071840 /* SKTransitionController.m */, CE4D97FA0C3C2BFF002C20CB /* SKColorSwatch.h */, CE4D97FB0C3C2BFF002C20CB /* SKColorSwatch.m */, CE4BC12D0C357A0300C2AF03 /* SKLineWell.h */, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-16 23:23:28
|
Revision: 2506 http://skim-app.svn.sourceforge.net/skim-app/?rev=2506&view=rev Author: hofman Date: 2007-07-16 16:23:27 -0700 (Mon, 16 Jul 2007) Log Message: ----------- Use OpenGL to draw the animations for page transitions, as it is much faster. Put the OpenGLView in an overlay window, because switching between openGL/quartz drawing in the same window does not seem to work, and NSOpenGLView doesn't allow subviews. Modified Paths: -------------- trunk/SKFullScreenWindow.m trunk/SKMainWindowController.m trunk/SKPDFView.h trunk/SKPDFView.m trunk/Skim.xcodeproj/project.pbxproj trunk/vendorsrc/andymatuschak/Sparkle/Sparkle.xcodeproj/project.pbxproj Added Paths: ----------- trunk/SKTransitionController.h trunk/SKTransitionController.m Removed Paths: ------------- trunk/SKAnimationView.h trunk/SKAnimationView.m Deleted: trunk/SKAnimationView.h =================================================================== --- trunk/SKAnimationView.h 2007-07-16 21:09:12 UTC (rev 2505) +++ trunk/SKAnimationView.h 2007-07-16 23:23:27 UTC (rev 2506) @@ -1,141 +0,0 @@ -// -// SKAnimationView.h -// Skim -// -// Created by Christiaan Hofman on 7/15/07. -/* - This software is Copyright (c) 2007 - Christiaan Hofman. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - - Neither the name of Christiaan Hofman nor the names of any - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#import <Cocoa/Cocoa.h> - -#pragma mark Private Core Graphics types and functions - -typedef int CGSConnection; -typedef int CGSWindow; - -typedef enum _CGSTransitionType { - CGSNone, - CGSFade, - CGSZoom, - CGSReveal, - CGSSlide, - CGSWarpFade, - CGSSwap, - CGSCube, - CGSWarpSwitch -} CGSTransitionType; - -typedef enum _CGSTransitionOption { - CGSDown, - CGSLeft, - CGSRight, - CGSInRight, - CGSBottomLeft = 5, - CGSBottomRight, - CGSDownTopRight, - CGSUp, - CGSTopLeft, - CGSTopRight, - CGSUpBottomRight, - CGSInBottom, - CGSLeftBottomRight, - CGSRightBottomLeft, - CGSInBottomRight, - CGSInOut -} CGSTransitionOption; - -typedef struct _CGSTransitionSpec { - uint32_t unknown1; - CGSTransitionType type; - CGSTransitionOption option; - CGSWindow wid; // Can be 0 for full-screen - float *backColour; // Null for black otherwise pointer to 3 float array with RGB value -} CGSTransitionSpec; - -extern CGSConnection _CGSDefaultConnection(void); - -extern OSStatus CGSNewTransition(const CGSConnection cid, const CGSTransitionSpec* spec, int *pTransitionHandle); -extern OSStatus CGSInvokeTransition(const CGSConnection cid, int transitionHandle, float duration); -extern OSStatus CGSReleaseTransition(const CGSConnection cid, int transitionHandle); - -#pragma mark SKAnimationView - -@class CIFilter, CIImage; - -typedef enum _SKAnimationTransitionStyle { - SKNoTransition = CGSNone, - // Core Graphics transitions - SKFadeTransition = CGSFade, - SKZoomTransition = CGSZoom, - SKRevealTransition = CGSReveal, - SKSlideTransition = CGSSlide, - SKWarpFadeTransition = CGSWarpFade, - SKSwapTransition = CGSSwap, - SKCubeTransition = CGSCube, - SKWarpSwitchTransition = CGSWarpSwitch, - // Core Image transitions - SKCopyMachineTransition, - SKDisintegrateTransition, - SKDissolveTransition, - SKFlashTransition, - SKModTransition, - SKPageCurlTransition, - SKRippleTransition, - SKSwipeTransition -} SKAnimationTransitionStyle; - - -@interface SKAnimationView : NSView { - CIImage *initialImage; - NSRect imageRect; -} - -- (void)prepareForAnimationWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle fromRect:(NSRect)rect; -- (void)animateWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle direction:(CGSTransitionOption)direction duration:(float)duration fromRect:(NSRect)rect; - -@end - - -@interface SKTransitionAnimation : NSAnimation { - CIFilter *filter; -} - -- (id)initWithFilter:(CIFilter *)aFilter duration:(NSTimeInterval)duration animationCurve:(NSAnimationCurve)animationCurve; -- (CIImage *)currentImage; - -@end - - -@interface NSObject (SKTransitionAnimationDelegate) -- (void)transitionAnimationDidUpdate:(SKTransitionAnimation *)anAnimation; -@end Deleted: trunk/SKAnimationView.m =================================================================== --- trunk/SKAnimationView.m 2007-07-16 21:09:12 UTC (rev 2505) +++ trunk/SKAnimationView.m 2007-07-16 23:23:27 UTC (rev 2506) @@ -1,286 +0,0 @@ -// -// SKAnimationView.m -// Skim -// -// Created by Christiaan Hofman on 7/15/07. -/* - This software is Copyright (c) 2007 - Christiaan Hofman. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - - Neither the name of Christiaan Hofman nor the names of any - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - This code is based partly on Apple's AnimatingTabView example code - and Ankur Kothari's AnimatingTabsDemo application <http://dev.lipidity.com> -*/ - -#import "SKAnimationView.h" -#import <Quartz/Quartz.h> -#import "NSBitmapImageRep_SKExtensions.h" -#include <unistd.h> - - -@implementation SKAnimationView - -- (void)dealloc { - [initialImage release]; - [super dealloc]; -} - -- (CIImage *)inputShadingImage { - static CIImage *inputShadingImage = nil; - if (inputShadingImage == nil) { - NSData *shadingBitmapData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"TransitionShading" ofType:@"tiff"]]; - NSBitmapImageRep *shadingBitmap = [[[NSBitmapImageRep alloc] initWithData:shadingBitmapData] autorelease]; - inputShadingImage = [[CIImage alloc] initWithBitmapImageRep:shadingBitmap]; - } - return inputShadingImage; -} - -- (CIImage *)inputMaskImage { - static CIImage *inputMaskImage = nil; - if (inputMaskImage == nil) { - NSData *maskBitmapData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"TransitionMask" ofType:@"jpg"]]; - NSBitmapImageRep *maskBitmap = [[[NSBitmapImageRep alloc] initWithData:maskBitmapData] autorelease]; - inputMaskImage = [[CIImage alloc] initWithBitmapImageRep:maskBitmap]; - } - return inputMaskImage; -} - -- (CIFilter *)transitionFilter:(SKAnimationTransitionStyle)transitionStyle forRect:(NSRect)rect initialCIImage:(CIImage *)initialCIImage finalCIImage:(CIImage *)finalCIImage { - CIFilter *transitionFilter = nil; - - CIFilter *maskScalingFilter = nil; - CGRect maskExtent; - NSRect bounds = [self bounds]; - - if (NSEqualRects(rect, bounds) == NO) { - CIFilter *cropFilter = [CIFilter filterWithName:@"CICrop"]; - [cropFilter setValue:[CIVector vectorWithX:NSMinX(imageRect) Y:NSMinY(imageRect) Z:NSWidth(imageRect) W:NSHeight(imageRect)] forKey:@"inputRectangle"]; - [cropFilter setValue:initialCIImage forKey:@"inputImage"]; - initialCIImage = [cropFilter valueForKey:@"outputImage"]; - [cropFilter setValue:finalCIImage forKey:@"inputImage"]; - finalCIImage = [cropFilter valueForKey:@"outputImage"]; - } - - switch (transitionStyle) { - case SKCopyMachineTransition: - transitionFilter = [CIFilter filterWithName:@"CICopyMachineTransition"]; - [transitionFilter setDefaults]; - [transitionFilter setValue:[CIVector vectorWithX:NSMinX(rect) Y:NSMinY(rect) Z:NSWidth(rect) W:NSHeight(rect)] forKey:@"inputExtent"]; - break; - - case SKDisintegrateTransition: - transitionFilter = [CIFilter filterWithName:@"CIDisintegrateWithMaskTransition"]; - [transitionFilter setDefaults]; - - // Scale our mask image to match the transition area size, and set the scaled result as the "inputMaskImage" to the transitionFilter. - maskScalingFilter = [CIFilter filterWithName:@"CILanczosScaleTransform"]; - [maskScalingFilter setDefaults]; - maskExtent = [[self inputMaskImage] extent]; - float xScale = NSWidth(rect) / CGRectGetWidth(maskExtent); - float yScale = NSHeight(rect) / CGRectGetHeight(maskExtent); - [maskScalingFilter setValue:[NSNumber numberWithFloat:yScale] forKey:@"inputScale"]; - [maskScalingFilter setValue:[NSNumber numberWithFloat:xScale / yScale] forKey:@"inputAspectRatio"]; - [maskScalingFilter setValue:[self inputMaskImage] forKey:@"inputImage"]; - - [transitionFilter setValue:[maskScalingFilter valueForKey:@"outputImage"] forKey:@"inputMaskImage"]; - break; - - case SKDissolveTransition: - transitionFilter = [CIFilter filterWithName:@"CIDissolveTransition"]; - [transitionFilter setDefaults]; - break; - - case SKFlashTransition: - transitionFilter = [CIFilter filterWithName:@"CIFlashTransition"]; - [transitionFilter setDefaults]; - [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:@"inputCenter"]; - [transitionFilter setValue:[CIVector vectorWithX:NSMinX(bounds) Y:NSMinY(bounds) Z:NSWidth(bounds) W:NSHeight(bounds)] forKey:@"inputExtent"]; - break; - - case SKModTransition: - transitionFilter = [CIFilter filterWithName:@"CIModTransition"]; - [transitionFilter setDefaults]; - [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:@"inputCenter"]; - break; - - case SKPageCurlTransition: - transitionFilter = [CIFilter filterWithName:@"CIPageCurlTransition"]; - [transitionFilter setDefaults]; - [transitionFilter setValue:[NSNumber numberWithFloat:-M_PI_4] forKey:@"inputAngle"]; - [transitionFilter setValue:initialCIImage forKey:@"inputBacksideImage"]; - [transitionFilter setValue:[self inputShadingImage] forKey:@"inputShadingImage"]; - [transitionFilter setValue:[CIVector vectorWithX:NSMinX(rect) Y:NSMinY(rect) Z:NSWidth(rect) W:NSHeight(rect)] forKey:@"inputExtent"]; - break; - - case SKSwipeTransition: - transitionFilter = [CIFilter filterWithName:@"CISwipeTransition"]; - [transitionFilter setDefaults]; - break; - - case SKRippleTransition: - default: - transitionFilter = [CIFilter filterWithName:@"CIRippleTransition"]; - [transitionFilter setDefaults]; - [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:@"inputCenter"]; - [transitionFilter setValue:[CIVector vectorWithX:NSMinX(bounds) Y:NSMinY(bounds) Z:NSWidth(bounds) W:NSHeight(bounds)] forKey:@"inputExtent"]; - [transitionFilter setValue:[self inputShadingImage] forKey:@"inputShadingImage"]; - break; - } - [transitionFilter setValue:initialCIImage forKey:@"inputImage"]; - [transitionFilter setValue:finalCIImage forKey:@"inputTargetImage"]; - - return transitionFilter; -} - -- (void)prepareForAnimationWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle fromRect:(NSRect)rect{ - if (transitionStyle >= SKCopyMachineTransition) { - NSRect bounds = [self bounds]; - [initialImage release]; - NSBitmapImageRep *initialContentBitmap = [self bitmapImageRepForCachingDisplayInRect:bounds]; - [initialContentBitmap clear]; - [self cacheDisplayInRect:bounds toBitmapImageRep:initialContentBitmap]; - initialImage = [[CIImage alloc] initWithBitmapImageRep:initialContentBitmap]; - imageRect = rect; - } -} - -- (void)animateWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle direction:(CGSTransitionOption)direction duration:(float)duration fromRect:(NSRect)rect { - if (transitionStyle == SKNoTransition) { - - } else if (transitionStyle < SKCopyMachineTransition) { - - // declare our variables - int handle = -1; - CGSTransitionSpec spec; - - // specify our specifications - spec.unknown1 = 0; - spec.type = transitionStyle; - spec.option = direction; - spec.backColour = NULL; - spec.wid = [[self window] windowNumber]; - - // Let’s get a connection - CGSConnection cgs = _CGSDefaultConnection(); - - // Create a transition - CGSNewTransition(cgs, &spec, &handle); - - // Redraw the window - [[self window] display]; - - CGSInvokeTransition(cgs, handle, duration); - // We need to wait for the transition to finish before we get rid of it, otherwise we’ll get all sorts of nasty errors... or maybe not. - usleep((useconds_t)(duration * 1000000)); - - CGSReleaseTransition(cgs, handle); - handle = 0; - - } else { - - if (initialImage == nil) - [self prepareForAnimationWithTransitionStyle:transitionStyle fromRect:rect]; - NSRect bounds = [self bounds]; - imageRect = NSIntersectionRect(NSUnionRect(imageRect, rect), bounds); - - NSBitmapImageRep *finalContentBitmap = [self bitmapImageRepForCachingDisplayInRect:bounds]; - [finalContentBitmap clear]; - [self cacheDisplayInRect:bounds toBitmapImageRep:finalContentBitmap]; - CIImage *finalImage = [[CIImage alloc] initWithBitmapImageRep:finalContentBitmap]; - - CIFilter *transitionFilter = [self transitionFilter:transitionStyle forRect:imageRect initialCIImage:initialImage finalCIImage:finalImage]; - - [finalImage release]; - [initialImage release]; - initialImage = nil; - - SKTransitionAnimation *animation = [[SKTransitionAnimation alloc] initWithFilter:transitionFilter duration:duration animationCurve:NSAnimationLinear]; - [animation setDelegate:self]; - - [animation startAnimation]; - - [animation release]; - - [self setNeedsDisplay:YES]; - - } -} - -- (void)transitionAnimationDidUpdate:(SKTransitionAnimation *)anAnimation { - NSRect nsBounds = [self bounds]; - CGRect cgBounds = *(CGRect *)&nsBounds; - - [self lockFocus]; - - NSGraphicsContext *context = [NSGraphicsContext currentContext]; - [context saveGraphicsState]; - - [[[self window] backgroundColor] setFill]; - NSRectFill(nsBounds); - - [[context CIContext] drawImage:[anAnimation currentImage] inRect:cgBounds fromRect:cgBounds]; - [context flushGraphics]; - - [context restoreGraphicsState]; - - [self unlockFocus]; -} - -@end - - -@implementation SKTransitionAnimation - -- (id)initWithFilter:(CIFilter *)aFilter duration:(NSTimeInterval)duration animationCurve:(NSAnimationCurve)animationCurve { - if (self = [super initWithDuration:duration animationCurve:animationCurve]) { - filter = [aFilter retain]; - } - return self; -} - -- (void)dealloc { - [filter release]; - [super dealloc]; -} - -- (void)setCurrentProgress:(NSAnimationProgress)progress { - [filter setValue:[NSNumber numberWithFloat:[self currentValue]] forKey:@"inputTime"]; - [super setCurrentProgress:progress]; - if ([[self delegate] respondsToSelector:@selector(transitionAnimationDidUpdate:)]) - [[self delegate] transitionAnimationDidUpdate:self]; -} - -- (CIImage *)currentImage { - return [filter valueForKey:@"outputImage"]; -} - -@end Modified: trunk/SKFullScreenWindow.m =================================================================== --- trunk/SKFullScreenWindow.m 2007-07-16 21:09:12 UTC (rev 2505) +++ trunk/SKFullScreenWindow.m 2007-07-16 23:23:27 UTC (rev 2506) @@ -39,7 +39,6 @@ #import "SKFullScreenWindow.h" #import "SKMainWindowController.h" #import "SKPDFHoverWindow.h" -#import "SKAnimationview.h" @implementation SKFullScreenWindow @@ -50,7 +49,6 @@ [self setDisplaysWhenScreenProfileChanges:YES]; [self setAcceptsMouseMovedEvents:YES]; [self setBackgroundColor:[NSColor blackColor]]; - [self setContentView:[[[SKAnimationView alloc] init] autorelease]]; } return self; } Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-07-16 21:09:12 UTC (rev 2505) +++ trunk/SKMainWindowController.m 2007-07-16 23:23:27 UTC (rev 2506) @@ -74,7 +74,6 @@ #import "SKLineInspector.h" #import "SKColorSwatch.h" #import "SKStatusBar.h" -#import "SKAnimationView.h" #define SEGMENTED_CONTROL_HEIGHT 25.0 #define WINDOW_X_DELTA 0.0 @@ -1657,9 +1656,6 @@ [pdfView layoutDocumentView]; [pdfView setNeedsDisplay:YES]; - if ([self isPresentation]) - [pdfView setAnimationView:(SKAnimationView *)[fullScreenWindow contentView]]; - NSEnumerator *wcEnum = [[[self document] windowControllers] objectEnumerator]; NSWindowController *wc = [wcEnum nextObject]; @@ -1847,8 +1843,6 @@ [fullScreenWindow setBackgroundColor:backgroundColor]; [fullScreenWindow setLevel:NSPopUpMenuWindowLevel]; - [pdfView setAnimationView:(SKAnimationView *)[fullScreenWindow contentView]]; - // periodically send a 'user activity' to prevent sleep mode and screensaver from being activated activityTimer = [[NSTimer scheduledTimerWithTimeInterval:30 target:self selector:@selector(activityTimerFired:) userInfo:NULL repeats:YES] retain]; @@ -1860,8 +1854,6 @@ [activityTimer release]; activityTimer = nil; - [pdfView setAnimationView:nil]; - NSScrollView *scrollView = [[pdfView documentView] enclosingScrollView]; [self applyPDFSettings:savedNormalSetup]; [scrollView setNeverHasHorizontalScroller:NO]; Modified: trunk/SKPDFView.h =================================================================== --- trunk/SKPDFView.h 2007-07-16 21:09:12 UTC (rev 2505) +++ trunk/SKPDFView.h 2007-07-16 23:23:27 UTC (rev 2506) @@ -39,7 +39,7 @@ #import <Cocoa/Cocoa.h> #import <Quartz/Quartz.h> #import "SKMainWindowController.h" -#import "SKAnimationView.h" +#import "SKTransitionController.h" extern NSString *SKPDFViewToolModeChangedNotification; extern NSString *SKPDFViewAnnotationModeChangedNotification; @@ -73,7 +73,7 @@ SKLineNote } SKNoteType; -@class SKReadingBar, SKAnimationView; +@class SKReadingBar, SKTransitionController; @interface SKPDFView : PDFView { SKToolMode toolMode; @@ -89,7 +89,7 @@ SKReadingBar *readingBar; - SKAnimationView *animationView; + SKTransitionController *transitionController; SKAnimationTransitionStyle transitionStyle; float transitionDuration; @@ -143,9 +143,6 @@ - (void)toggleReadingBar; -- (SKAnimationView *)animationView; -- (void)setAnimationView:(SKAnimationView *)view; - - (SKAnimationTransitionStyle)transitionStyle; - (void)setTransitionStyle:(SKAnimationTransitionStyle)style; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-07-16 21:09:12 UTC (rev 2505) +++ trunk/SKPDFView.m 2007-07-16 23:23:27 UTC (rev 2506) @@ -150,7 +150,7 @@ toolMode = [[NSUserDefaults standardUserDefaults] integerForKey:SKLastToolModeKey]; annotationMode = [[NSUserDefaults standardUserDefaults] integerForKey:SKLastAnnotationModeKey]; - animationView = nil; + transitionController = nil; transitionStyle = SKNoTransition; transitionDuration = 1.0; @@ -219,6 +219,7 @@ [[SKPDFHoverWindow sharedHoverWindow] orderOut:self]; [self removeHoverRects]; [hoverRects release]; + [transitionController release]; [navWindow release]; [readingBar release]; [super dealloc]; @@ -531,14 +532,6 @@ } } -- (SKAnimationView *)animationView { - return animationView; -} - -- (void)setAnimationView:(SKAnimationView *)view { - animationView = view; -} - - (SKAnimationTransitionStyle)transitionStyle { return transitionStyle; } @@ -584,28 +577,31 @@ #pragma mark Actions +- (void)animateTransitionForNextPage:(BOOL)next { + if (transitionController == nil) + transitionController = [[SKTransitionController alloc] initWithView:self]; + NSRect rect = [self convertRect:[[self currentPage] boundsForBox:[self displayBox]] fromPage:[self currentPage]]; + [transitionController prepareForAnimationWithTransitionStyle:[self transitionStyle] fromRect:rect]; + if (next) + [super goToNextPage:self]; + else + [super goToPreviousPage:self]; + rect = [self convertRect:[[self currentPage] boundsForBox:[self displayBox]] fromPage:[self currentPage]]; + [transitionController animateWithTransitionStyle:[self transitionStyle] direction:next ? CGSLeft : CGSRight duration:[self transitionDuration] fromRect:rect]; +} + - (void)goToNextPage:(id)sender { - if (animationView && [self transitionStyle] != SKNoTransition && [self canGoToNextPage]) { - NSRect rect = [self convertRect:[self convertRect:[[self currentPage] boundsForBox:[self displayBox]] fromPage:[self currentPage]] toView:animationView]; - [animationView prepareForAnimationWithTransitionStyle:[self transitionStyle] fromRect:rect]; + if (hasNavigation && autohidesCursor && [self transitionStyle] != SKNoTransition && [self canGoToNextPage]) + [self animateTransitionForNextPage:YES]; + else [super goToNextPage:sender]; - rect = [self convertRect:[self convertRect:[[self currentPage] boundsForBox:[self displayBox]] fromPage:[self currentPage]] toView:animationView]; - [animationView animateWithTransitionStyle:[self transitionStyle] direction:CGSLeft duration:[self transitionDuration] fromRect:rect]; - } else { - [super goToNextPage:sender]; - } } - (void)goToPreviousPage:(id)sender { - if (animationView && [self transitionStyle] != SKNoTransition && [self canGoToPreviousPage]) { - NSRect rect = [self convertRect:[self convertRect:[[self currentPage] boundsForBox:[self displayBox]] fromPage:[self currentPage]] toView:animationView]; - [animationView prepareForAnimationWithTransitionStyle:[self transitionStyle] fromRect:rect]; + if (hasNavigation && autohidesCursor && [self transitionStyle] != SKNoTransition && [self canGoToPreviousPage]) + [self animateTransitionForNextPage:NO]; + else [super goToPreviousPage:sender]; - rect = [self convertRect:[self convertRect:[[self currentPage] boundsForBox:[self displayBox]] fromPage:[self currentPage]] toView:animationView]; - [animationView animateWithTransitionStyle:[self transitionStyle] direction:CGSRight duration:[self transitionDuration] fromRect:rect]; - } else { - [super goToPreviousPage:sender]; - } } - (IBAction)printDocument:(id)sender{ Copied: trunk/SKTransitionController.h (from rev 2502, trunk/SKAnimationView.h) =================================================================== --- trunk/SKTransitionController.h (rev 0) +++ trunk/SKTransitionController.h 2007-07-16 23:23:27 UTC (rev 2506) @@ -0,0 +1,135 @@ +// +// SKTransitionController.h +// Skim +// +// Created by Christiaan Hofman on 7/15/07. +/* + This software is Copyright (c) 2007 + Christiaan Hofman. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of Christiaan Hofman nor the names of any + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import <Cocoa/Cocoa.h> + +#pragma mark Private Core Graphics types and functions + +typedef int CGSConnection; +typedef int CGSWindow; + +typedef enum _CGSTransitionType { + CGSNone, + CGSFade, + CGSZoom, + CGSReveal, + CGSSlide, + CGSWarpFade, + CGSSwap, + CGSCube, + CGSWarpSwitch +} CGSTransitionType; + +typedef enum _CGSTransitionOption { + CGSDown, + CGSLeft, + CGSRight, + CGSInRight, + CGSBottomLeft = 5, + CGSBottomRight, + CGSDownTopRight, + CGSUp, + CGSTopLeft, + CGSTopRight, + CGSUpBottomRight, + CGSInBottom, + CGSLeftBottomRight, + CGSRightBottomLeft, + CGSInBottomRight, + CGSInOut +} CGSTransitionOption; + +typedef struct _CGSTransitionSpec { + uint32_t unknown1; + CGSTransitionType type; + CGSTransitionOption option; + CGSWindow wid; // Can be 0 for full-screen + float *backColour; // Null for black otherwise pointer to 3 float array with RGB value +} CGSTransitionSpec; + +extern CGSConnection _CGSDefaultConnection(void); + +extern OSStatus CGSNewTransition(const CGSConnection cid, const CGSTransitionSpec* spec, int *pTransitionHandle); +extern OSStatus CGSInvokeTransition(const CGSConnection cid, int transitionHandle, float duration); +extern OSStatus CGSReleaseTransition(const CGSConnection cid, int transitionHandle); + +#pragma mark SKTransitionController + +@class CIFilter, CIImage; + +typedef enum _SKAnimationTransitionStyle { + SKNoTransition = CGSNone, + // Core Graphics transitions + SKFadeTransition = CGSFade, + SKZoomTransition = CGSZoom, + SKRevealTransition = CGSReveal, + SKSlideTransition = CGSSlide, + SKWarpFadeTransition = CGSWarpFade, + SKSwapTransition = CGSSwap, + SKCubeTransition = CGSCube, + SKWarpSwitchTransition = CGSWarpSwitch, + // Core Image transitions + SKCopyMachineTransition, + SKDisintegrateTransition, + SKDissolveTransition, + SKFlashTransition, + SKModTransition, + SKPageCurlTransition, + SKRippleTransition, + SKSwipeTransition +} SKAnimationTransitionStyle; + +@class SKTransitionView; + +@interface SKTransitionController : NSObject { + NSWindow *transitionWindow; + SKTransitionView *transitionView; + NSView *view; + CIImage *initialImage; + NSRect imageRect; +} + +- (id)initWithView:(NSView *)aView; + +- (NSView *)view; +- (void)setView:(NSView *)newView; + +- (void)prepareForAnimationWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle fromRect:(NSRect)rect; +- (void)animateWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle direction:(CGSTransitionOption)direction duration:(float)duration fromRect:(NSRect)rect; + +@end Copied: trunk/SKTransitionController.m (from rev 2505, trunk/SKAnimationView.m) =================================================================== --- trunk/SKTransitionController.m (rev 0) +++ trunk/SKTransitionController.m 2007-07-16 23:23:27 UTC (rev 2506) @@ -0,0 +1,443 @@ +// +// SKTransitionController.m +// Skim +// +// Created by Christiaan Hofman on 7/15/07. +/* + This software is Copyright (c) 2007 + Christiaan Hofman. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of Christiaan Hofman nor the names of any + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + This code is based partly on Apple's AnimatingTabView example code + and Ankur Kothari's AnimatingTabsDemo application <http://dev.lipidity.com> +*/ + +#import "SKTransitionController.h" +#import <Quartz/Quartz.h> +#import "NSBitmapImageRep_SKExtensions.h" +#include <unistd.h> +#import <OpenGL/OpenGL.h> +#import <OpenGL/gl.h> +#import "SKFullScreenWindow.h" + + +@interface SKTransitionAnimation : NSAnimation { + CIFilter *filter; +} + +- (id)initWithFilter:(CIFilter *)aFilter duration:(NSTimeInterval)duration animationCurve:(NSAnimationCurve)animationCurve; +- (CIImage *)currentImage; + +@end + +#pragma mark - + +@interface SKTransitionView : NSOpenGLView { + SKTransitionAnimation *animation; + CIContext *context; + BOOL needsReshape; +} +- (SKTransitionAnimation *)animation; +- (void)setAnimation:(SKTransitionAnimation *)newAnimation; +@end + +#pragma mark - + +@implementation SKTransitionController + +- (id)initWithView:(NSView *)aView { + if (self = [super init]) { + view = aView; + } + return self; +} + +- (void)dealloc { + [transitionWindow release]; + [initialImage release]; + [super dealloc]; +} + +- (NSView *)view { + return view; +} + +- (void)setView:(NSView *)newView { + view = newView; +} + +- (CIImage *)inputShadingImage { + static CIImage *inputShadingImage = nil; + if (inputShadingImage == nil) { + NSData *shadingBitmapData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"TransitionShading" ofType:@"tiff"]]; + NSBitmapImageRep *shadingBitmap = [[[NSBitmapImageRep alloc] initWithData:shadingBitmapData] autorelease]; + inputShadingImage = [[CIImage alloc] initWithBitmapImageRep:shadingBitmap]; + } + return inputShadingImage; +} + +- (CIImage *)inputMaskImage { + static CIImage *inputMaskImage = nil; + if (inputMaskImage == nil) { + NSData *maskBitmapData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"TransitionMask" ofType:@"jpg"]]; + NSBitmapImageRep *maskBitmap = [[[NSBitmapImageRep alloc] initWithData:maskBitmapData] autorelease]; + inputMaskImage = [[CIImage alloc] initWithBitmapImageRep:maskBitmap]; + } + return inputMaskImage; +} + +- (CIFilter *)transitionFilter:(SKAnimationTransitionStyle)transitionStyle forRect:(NSRect)rect initialCIImage:(CIImage *)initialCIImage finalCIImage:(CIImage *)finalCIImage { + CIFilter *transitionFilter = nil; + + CIFilter *maskScalingFilter = nil; + CGRect maskExtent; + NSRect bounds = [view bounds]; + + if (NSEqualRects(rect, bounds) == NO) { + CIFilter *cropFilter = [CIFilter filterWithName:@"CICrop"]; + [cropFilter setValue:[CIVector vectorWithX:NSMinX(imageRect) Y:NSMinY(imageRect) Z:NSWidth(imageRect) W:NSHeight(imageRect)] forKey:@"inputRectangle"]; + [cropFilter setValue:initialCIImage forKey:@"inputImage"]; + initialCIImage = [cropFilter valueForKey:@"outputImage"]; + [cropFilter setValue:finalCIImage forKey:@"inputImage"]; + finalCIImage = [cropFilter valueForKey:@"outputImage"]; + } + + switch (transitionStyle) { + case SKCopyMachineTransition: + transitionFilter = [CIFilter filterWithName:@"CICopyMachineTransition"]; + [transitionFilter setDefaults]; + [transitionFilter setValue:[CIVector vectorWithX:NSMinX(rect) Y:NSMinY(rect) Z:NSWidth(rect) W:NSHeight(rect)] forKey:@"inputExtent"]; + break; + + case SKDisintegrateTransition: + transitionFilter = [CIFilter filterWithName:@"CIDisintegrateWithMaskTransition"]; + [transitionFilter setDefaults]; + + // Scale our mask image to match the transition area size, and set the scaled result as the "inputMaskImage" to the transitionFilter. + maskScalingFilter = [CIFilter filterWithName:@"CILanczosScaleTransform"]; + [maskScalingFilter setDefaults]; + maskExtent = [[self inputMaskImage] extent]; + float xScale = NSWidth(rect) / CGRectGetWidth(maskExtent); + float yScale = NSHeight(rect) / CGRectGetHeight(maskExtent); + [maskScalingFilter setValue:[NSNumber numberWithFloat:yScale] forKey:@"inputScale"]; + [maskScalingFilter setValue:[NSNumber numberWithFloat:xScale / yScale] forKey:@"inputAspectRatio"]; + [maskScalingFilter setValue:[self inputMaskImage] forKey:@"inputImage"]; + + [transitionFilter setValue:[maskScalingFilter valueForKey:@"outputImage"] forKey:@"inputMaskImage"]; + break; + + case SKDissolveTransition: + transitionFilter = [CIFilter filterWithName:@"CIDissolveTransition"]; + [transitionFilter setDefaults]; + break; + + case SKFlashTransition: + transitionFilter = [CIFilter filterWithName:@"CIFlashTransition"]; + [transitionFilter setDefaults]; + [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:@"inputCenter"]; + [transitionFilter setValue:[CIVector vectorWithX:NSMinX(bounds) Y:NSMinY(bounds) Z:NSWidth(bounds) W:NSHeight(bounds)] forKey:@"inputExtent"]; + break; + + case SKModTransition: + transitionFilter = [CIFilter filterWithName:@"CIModTransition"]; + [transitionFilter setDefaults]; + [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:@"inputCenter"]; + break; + + case SKPageCurlTransition: + transitionFilter = [CIFilter filterWithName:@"CIPageCurlTransition"]; + [transitionFilter setDefaults]; + [transitionFilter setValue:[NSNumber numberWithFloat:-M_PI_4] forKey:@"inputAngle"]; + [transitionFilter setValue:initialCIImage forKey:@"inputBacksideImage"]; + [transitionFilter setValue:[self inputShadingImage] forKey:@"inputShadingImage"]; + [transitionFilter setValue:[CIVector vectorWithX:NSMinX(rect) Y:NSMinY(rect) Z:NSWidth(rect) W:NSHeight(rect)] forKey:@"inputExtent"]; + break; + + case SKSwipeTransition: + transitionFilter = [CIFilter filterWithName:@"CISwipeTransition"]; + [transitionFilter setDefaults]; + break; + + case SKRippleTransition: + default: + transitionFilter = [CIFilter filterWithName:@"CIRippleTransition"]; + [transitionFilter setDefaults]; + [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:@"inputCenter"]; + [transitionFilter setValue:[CIVector vectorWithX:NSMinX(bounds) Y:NSMinY(bounds) Z:NSWidth(bounds) W:NSHeight(bounds)] forKey:@"inputExtent"]; + [transitionFilter setValue:[self inputShadingImage] forKey:@"inputShadingImage"]; + break; + } + [transitionFilter setValue:initialCIImage forKey:@"inputImage"]; + [transitionFilter setValue:finalCIImage forKey:@"inputTargetImage"]; + + return transitionFilter; +} + +- (void)prepareForAnimationWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle fromRect:(NSRect)rect { + if (transitionStyle >= SKCopyMachineTransition) { + NSRect bounds = [view bounds]; + [initialImage release]; + NSBitmapImageRep *initialContentBitmap = [view bitmapImageRepForCachingDisplayInRect:bounds]; + [initialContentBitmap clear]; + [view cacheDisplayInRect:bounds toBitmapImageRep:initialContentBitmap]; + initialImage = [[CIImage alloc] initWithBitmapImageRep:initialContentBitmap]; + imageRect = rect; + } +} + +- (void)animateWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle direction:(CGSTransitionOption)direction duration:(float)duration fromRect:(NSRect)rect { + if (transitionStyle == SKNoTransition) { + + } else if (transitionStyle < SKCopyMachineTransition) { + + // declare our variables + int handle = -1; + CGSTransitionSpec spec; + + // specify our specifications + spec.unknown1 = 0; + spec.type = transitionStyle; + spec.option = direction; + spec.backColour = NULL; + spec.wid = [[view window] windowNumber]; + + // Let’s get a connection + CGSConnection cgs = _CGSDefaultConnection(); + + // Create a transition + CGSNewTransition(cgs, &spec, &handle); + + // Redraw the window + [[view window] display]; + + CGSInvokeTransition(cgs, handle, duration); + // We need to wait for the transition to finish before we get rid of it, otherwise we’ll get all sorts of nasty errors... or maybe not. + usleep((useconds_t)(duration * 1000000)); + + CGSReleaseTransition(cgs, handle); + handle = 0; + + } else { + + if (initialImage == nil) + [self prepareForAnimationWithTransitionStyle:transitionStyle fromRect:rect]; + NSRect bounds = [view bounds]; + imageRect = NSIntersectionRect(NSUnionRect(imageRect, rect), bounds); + + NSBitmapImageRep *finalContentBitmap = [view bitmapImageRepForCachingDisplayInRect:bounds]; + [finalContentBitmap clear]; + [view cacheDisplayInRect:bounds toBitmapImageRep:finalContentBitmap]; + CIImage *finalImage = [[CIImage alloc] initWithBitmapImageRep:finalContentBitmap]; + + CIFilter *transitionFilter = [self transitionFilter:transitionStyle forRect:imageRect initialCIImage:initialImage finalCIImage:finalImage]; + + [finalImage release]; + [initialImage release]; + initialImage = nil; + + NSWindow *window = [view window]; + NSRect frame = [view convertRect:[view frame] toView:nil]; + frame.origin = [window convertBaseToScreen:frame.origin]; + + if (transitionWindow == nil) { + transitionWindow = [[NSWindow alloc] initWithContentRect:frame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO screen:[window screen]]; + [transitionWindow setReleasedWhenClosed:NO]; + [transitionWindow setDisplaysWhenScreenProfileChanges:YES]; + [transitionWindow setBackgroundColor:[NSColor clearColor]]; + [transitionWindow setOpaque:NO]; + [transitionWindow setIgnoresMouseEvents:YES]; + + transitionView = [[SKTransitionView alloc] init]; + [transitionWindow setContentView:transitionView]; + [transitionView release]; + } + + SKTransitionAnimation *animation = [[SKTransitionAnimation alloc] initWithFilter:transitionFilter duration:duration animationCurve:NSAnimationEaseInOut]; + [transitionView setAnimation:animation]; + [animation release]; + + [transitionWindow setFrame:frame display:NO]; + [transitionWindow orderBack:nil]; + [transitionWindow display]; + [window addChildWindow:transitionWindow ordered:NSWindowAbove]; + + [animation startAnimation]; + + [view display]; + + [transitionView setAnimation:nil]; + [window removeChildWindow:transitionWindow]; + [transitionWindow orderOut:nil]; + + } +} + +@end + +#pragma mark - + +@implementation SKTransitionAnimation + +- (id)initWithFilter:(CIFilter *)aFilter duration:(NSTimeInterval)duration animationCurve:(NSAnimationCurve)animationCurve { + if (self = [super initWithDuration:duration animationCurve:animationCurve]) { + filter = [aFilter retain]; + } + return self; +} + +- (void)dealloc { + [filter release]; + [super dealloc]; +} + +- (void)setCurrentProgress:(NSAnimationProgress)progress { + [filter setValue:[NSNumber numberWithFloat:[self currentValue]] forKey:@"inputTime"]; + [super setCurrentProgress:progress]; + [[self delegate] display]; +} + +- (CIImage *)currentImage { + return [filter valueForKey:@"outputImage"]; +} + +@end + +#pragma mark - + +@implementation SKTransitionView + ++ (NSOpenGLPixelFormat *)defaultPixelFormat { + static NSOpenGLPixelFormat *pf; + + if (pf == nil) { + static const NSOpenGLPixelFormatAttribute attr[] = { + NSOpenGLPFAAccelerated, + NSOpenGLPFANoRecovery, + NSOpenGLPFAColorSize, 32, + 0 + }; + + pf = [[NSOpenGLPixelFormat alloc] initWithAttributes:(void *)&attr]; + } + + return pf; +} + +- (void)dealloc { + [animation release]; + [context release]; + [super dealloc]; +} + +- (void)reshape { + needsReshape = YES; +} + +- (void)prepareOpenGL { + // Enable beam-synced updates. + long parm = 1; + [[self openGLContext] setValues:&parm forParameter:NSOpenGLCPSwapInterval]; + + // Make sure that everything we don't need is disabled. Some of these + //are enabled by default and can slow down rendering. + + glDisable(GL_ALPHA_TEST); + glDisable(GL_DEPTH_TEST); + glDisable(GL_SCISSOR_TEST); + glDisable(GL_BLEND); + glDisable(GL_DITHER); + glDisable(GL_CULL_FACE); + glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + glDepthMask(GL_FALSE); + glStencilMask(0); + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + glHint(GL_TRANSFORM_HINT_APPLE, GL_FASTEST); + + needsReshape = YES; +} + +- (SKTransitionAnimation *)animation { + return animation; +} + +- (void)setAnimation:(SKTransitionAnimation *)newAnimation { + if (animation != newAnimation) { + [animation release]; + animation = [newAnimation retain]; + [animation setDelegate:self]; + } +} + +- (BOOL)isOpaque { return NO; } + +- (void)drawRect:(NSRect)rect { + if (animation) { + NSRect bounds = [self bounds]; + + [[self openGLContext] makeCurrentContext]; + + if (needsReshape) { + // reset the views coordinate system when the view has been resized or scrolled + + glViewport (0, 0, NSWidth(bounds), NSHeight(bounds)); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(NSMinX(bounds), NSMaxX(bounds), NSMinY(bounds), NSMaxY(bounds), -1, 1); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + needsReshape = NO; + } + + if (context == nil) { + NSOpenGLPixelFormat *pf = [self pixelFormat]; + if (pf == nil) + pf = [[self class] defaultPixelFormat]; + context = [[CIContext contextWithCGLContext:CGLGetCurrentContext() pixelFormat:[pf CGLPixelFormatObj] options:nil] retain]; + } + + glColor4f(0.0f, 0.0f, 0.0f, 0.0f); + glBegin(GL_POLYGON); + glVertex2f(bounds.origin.x, bounds.origin.y); + glVertex2f(bounds.origin.x + bounds.size.width, bounds.origin.y); + glVertex2f(bounds.origin.x + bounds.size.width, bounds.origin.y + bounds.size.height); + glVertex2f(bounds.origin.x, bounds.origin.y + bounds.size.height); + glEnd(); + + [context drawImage:[animation currentImage] inRect:*(CGRect*)&bounds fromRect:*(CGRect*)&bounds]; + + glFlush(); + } +} + +@end Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-07-16 21:09:12 UTC (rev 2505) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-07-16 23:23:27 UTC (rev 2506) @@ -64,6 +64,8 @@ CE15832D0BA0740000D5B03F /* ToolbarStrikeOutNote.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CE1583290BA073FF00D5B03F /* ToolbarStrikeOutNote.tiff */; }; CE15832E0BA0740000D5B03F /* ToolbarUnderlineNote.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CE15832A0BA073FF00D5B03F /* ToolbarUnderlineNote.tiff */; }; CE15832F0BA0740000D5B03F /* UnderlineNoteAdorn.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CE15832B0BA073FF00D5B03F /* UnderlineNoteAdorn.tiff */; }; + CE1ADB280C4BC6DE00071840 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE1ADB170C4BC6DE00071840 /* OpenGL.framework */; }; + CE1ADEBF0C4C341100071840 /* SKTransitionController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE1ADEBE0C4C341100071840 /* SKTransitionController.m */; }; CE1E25680BDA61E80011D9DD /* ReadNotesAccessoryView.nib in Resources */ = {isa = PBXBuildFile; fileRef = CE1E25660BDA61E80011D9DD /* ReadNotesAccessoryView.nib */; }; CE1E2B290BDAB6180011D9DD /* SKPDFSynchronizer.m in Sources */ = {isa = PBXBuildFile; fileRef = CE1E2B270BDAB6180011D9DD /* SKPDFSynchronizer.m */; }; CE1E301D0BDB9D5C0011D9DD /* NSScanner_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE1E301B0BDB9D5C0011D9DD /* NSScanner_SKExtensions.m */; }; @@ -170,7 +172,6 @@ CEAFFD7C0C40ED5400C3ECBB /* ToolbarColors.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CEAFFD7A0C40ED5400C3ECBB /* ToolbarColors.tiff */; }; CEAFFD7D0C40ED5400C3ECBB /* ToolbarFonts.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CEAFFD7B0C40ED5400C3ECBB /* ToolbarFonts.tiff */; }; CEAFFD9D0C40F2A800C3ECBB /* ToolbarLines.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CEAFFD9C0C40F2A800C3ECBB /* ToolbarLines.tiff */; }; - CEB72B8C0C4A189D000350F9 /* SKAnimationView.m in Sources */ = {isa = PBXBuildFile; fileRef = CEB72B8A0C4A189D000350F9 /* SKAnimationView.m */; }; CEB7359C0C4A8C1C000350F9 /* TransitionMask.jpg in Resources */ = {isa = PBXBuildFile; fileRef = CEB7359A0C4A8C1B000350F9 /* TransitionMask.jpg */; }; CEB735A20C4A8CD6000350F9 /* TransitionShading.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CEB735A10C4A8CD6000350F9 /* TransitionShading.tiff */; }; CECBA5910BFCEE260030AB59 /* SelectToolAdorn.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CECBA5900BFCEE250030AB59 /* SelectToolAdorn.tiff */; }; @@ -365,6 +366,8 @@ CE1583290BA073FF00D5B03F /* ToolbarStrikeOutNote.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = ToolbarStrikeOutNote.tiff; path = Images/ToolbarStrikeOutNote.tiff; sourceTree = "<group>"; }; CE15832A0BA073FF00D5B03F /* ToolbarUnderlineNote.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = ToolbarUnderlineNote.tiff; path = Images/ToolbarUnderlineNote.tiff; sourceTree = "<group>"; }; CE15832B0BA073FF00D5B03F /* UnderlineNoteAdorn.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = UnderlineNoteAdorn.tiff; path = Images/UnderlineNoteAdorn.tiff; sourceTree = "<group>"; }; + CE1ADB170C4BC6DE00071840 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; }; + CE1ADEBE0C4C341100071840 /* SKTransitionController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SKTransitionController.m; sourceTree = "<group>"; }; CE1E25670BDA61E80011D9DD /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/ReadNotesAccessoryView.nib; sourceTree = "<group>"; }; CE1E259E0BDA6E4D0011D9DD /* Dutch */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Dutch; path = Dutch.lproj/ReadNotesAccessoryView.nib; sourceTree = "<group>"; }; CE1E259F0BDA6E570011D9DD /* Italian */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Italian; path = Italian.lproj/ReadNotesAccessoryView.nib; sourceTree = "<group>"; }; @@ -544,8 +547,7 @@ CEAFFD7A0C40ED5400C3ECBB /* ToolbarColors.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = ToolbarColors.tiff; path = Images/ToolbarColors.tiff; sourceTree = "<group>"; }; CEAFFD7B0C40ED5400C3ECBB /* ToolbarFonts.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = ToolbarFonts.tiff; path = Images/ToolbarFonts.tiff; sourceTree = "<group>"; }; CEAFFD9C0C40F2A800C3ECBB /* ToolbarLines.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = ToolbarLines.tiff; path = Images/ToolbarLines.tiff; sourceTree = "<group>"; }; - CEB72B890C4A189D000350F9 /* SKAnimationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKAnimationView.h; sourceTree = "<group>"; }; - CEB72B8A0C4A189D000350F9 /* SKAnimationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKAnimationView.m; sourceTree = "<group>"; }; + CEB72B890C4A189D000350F9 /* SKTransitionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKTransitionController.h; sourceTree = "<group>"; }; CEB7359A0C4A8C1B000350F9 /* TransitionMask.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = TransitionMask.jpg; path = Images/TransitionMask.jpg; sourceTree = "<group>"; }; CEB735A10C4A8CD6000350F9 /* TransitionShading.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = TransitionShading.tiff; path = Images/TransitionShading.tiff; sourceTree = "<group>"; }; CECBA5900BFCEE250030AB59 /* SelectToolAdorn.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = SelectToolAdorn.tiff; path = Images/SelectToolAdorn.tiff; sourceTree = "<group>"; }; @@ -601,6 +603,7 @@ F977319F0B939B7D002A7823 /* libbz2.dylib in Frameworks */, CE2BD83E0BD4132B00A5F4DB /* Sparkle.framework in Frameworks */, CE5F43730BF8A3410069D89C /* IOKit.framework in Frameworks */, + CE1ADB280C4BC6DE00071840 /* OpenGL.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -622,6 +625,7 @@ 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */, F98E24BE0B702D9400914AF0 /* Carbon.framework */, 455989F70B2662FF00E5419B /* Quartz.framework */, + CE1ADB170C4BC6DE00071840 /* OpenGL.framework */, CE5F42D30BF8A3400069D89C /* IOKit.framework */, CE2BD82A0BD4132B00A5F4DB /* Sparkle.framework */, F977319E0B939B7D002A7823 /* libbz2.dylib */, @@ -863,8 +867,8 @@ CE2DE4D10B85D92F00D0DA12 /* Views */ = { isa = PBXGroup; children = ( - CEB72B890C4A189D000350F9 /* SKAnimationView.h */, - CEB72B8A0C4A189D000350F9 /* SKAnimationView.m */, + CEB72B890C4A189D000350F9 /* SKTransitionController.h */, + CE1ADEBE0C4C341100071840 /* SKTransitionController.m */, CE4D97FA0C3C2BFF002C20CB /* SKColorSwatch.h */, CE4D97FB0C3C2BFF002C20CB /* SKColorSwatch.m */, CE4BC12D0C357A0300C2AF03 /* SKLineWell.h */, @@ -1406,7 +1410,7 @@ CE4D97FD0C3C2BFF002C20CB /* SKColorSwatch.m in Sources */, CEAF079D0C4139EB00C3ECBB /* SKStatusBar.m in Sources */, CEAF2E5A0C45414100C3ECBB /* SKLine.m in Sources */, - CEB72B8C0C4A189D000350F9 /* SKAnimationView.m in Sources */, + CE1ADEBF0C4C341100071840 /* SKTransitionController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; Modified: trunk/vendorsrc/andymatuschak/Sparkle/Sparkle.xcodeproj/project.pbxproj =================================================================== --- trunk/vendorsrc/andymatuschak/Sparkle/Sparkle.xcodeproj/project.pbxproj 2007-07-16 21:09:12 UTC (rev 2505) +++ trunk/vendorsrc/andymatuschak/Sparkle/Sparkle.xcodeproj/project.pbxproj 2007-07-16 23:23:27 UTC (rev 2506) @@ -104,7 +104,7 @@ 61B5F8E409C4CE3C00B25A18 /* SUUpdater.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SUUpdater.m; sourceTree = "<group>"; }; 61B5F8E509C4CE3C00B25A18 /* NSFileManager+Authentication.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = "NSFileManager+Authentication.m"; sourceTree = "<group>"; }; 61B5F8F609C4CEB300B25A18 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; }; - 61B5F90209C4CEE200B25A18 /* Sparkle Test App.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = "Sparkle Test App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 61B5F90209C4CEE200B25A18 /* Sparkle Test App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Sparkle Test App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 61B5F90409C4CEE200B25A18 /* Test Application-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = "Test Application-Info.plist"; path = "Test Application/Test Application-Info.plist"; sourceTree = "<group>"; }; 61B5F92409C4CFC900B25A18 /* main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = main.m; path = "Test Application/main.m"; sourceTree = "<group>"; }; 61B5F92B09C4CFD800B25A18 /* English */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.strings; name = English; path = "Test Application/English.lproj/InfoPlist.strings"; sourceTree = "<group>"; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-16 21:09:25
|
Revision: 2505 http://skim-app.svn.sourceforge.net/skim-app/?rev=2505&view=rev Author: hofman Date: 2007-07-16 14:09:12 -0700 (Mon, 16 Jul 2007) Log Message: ----------- Don't add fullscreen navigation control as child window, but at a higher window level. Hide when deactivates. Modified Paths: -------------- trunk/SKNavigationWindow.m trunk/SKPDFView.m Modified: trunk/SKNavigationWindow.m =================================================================== --- trunk/SKNavigationWindow.m 2007-07-16 19:47:21 UTC (rev 2504) +++ trunk/SKNavigationWindow.m 2007-07-16 21:09:12 UTC (rev 2505) @@ -63,6 +63,7 @@ [self setDisplaysWhenScreenProfileChanges:YES]; [self setReleasedWhenClosed:NO]; [self setLevel:[[pdfView window] level]]; + [self setHidesOnDeactivate:YES]; [self setContentView:[[[SKNavigationContentView alloc] init] autorelease]]; @@ -140,7 +141,6 @@ - (void)orderOut:(id)sender { [animation stopAnimation]; [[SKNavigationToolTipWindow sharedToolTipWindow] orderOut:self]; - [[self parentWindow] removeChildWindow:self]; [super orderOut:sender]; } Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-07-16 19:47:21 UTC (rev 2504) +++ trunk/SKPDFView.m 2007-07-16 21:09:12 UTC (rev 2505) @@ -1043,7 +1043,6 @@ BOOL shouldShowNavWindow = hasNavigation && (activateNavigationAtBottom == NO || [theEvent locationInWindow].y < 5.0); if (activateNavigationAtBottom || shouldShowNavWindow) { if (shouldShowNavWindow && [navWindow isVisible] == NO) { - [[self window] addChildWindow:navWindow ordered:NSWindowAbove]; [navWindow orderFront:self]; } [self doAutohide:YES]; @@ -1974,7 +1973,7 @@ name: NSWindowWillCloseNotification object: [self window]]; navWindow = [[SKNavigationWindow alloc] initWithPDFView:self]; [navWindow moveToScreen:[[self window] screen]]; - [navWindow setLevel:[[self window] level]]; + [navWindow setLevel:[[self window] level] + 1]; } else if ([navWindow isVisible]) { [navWindow orderOut:self]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-16 19:47:22
|
Revision: 2504 http://skim-app.svn.sourceforge.net/skim-app/?rev=2504&view=rev Author: hofman Date: 2007-07-16 12:47:21 -0700 (Mon, 16 Jul 2007) Log Message: ----------- Don't show facing pages in presentation mode. Modified Paths: -------------- trunk/SKFullScreenWindow.m Modified: trunk/SKFullScreenWindow.m =================================================================== --- trunk/SKFullScreenWindow.m 2007-07-16 12:49:49 UTC (rev 2503) +++ trunk/SKFullScreenWindow.m 2007-07-16 19:47:21 UTC (rev 2504) @@ -68,10 +68,6 @@ SKMainWindowController *wc = (SKMainWindowController *)[self windowController]; if (ch == 0x1B) { [wc exitFullScreen:self]; - } else if (ch == '1' && [wc isPresentation]) { - [wc displaySinglePages:self]; - } else if (ch == '2' && [wc isPresentation]) { - [wc displayFacingPages:self]; } else { [super keyDown:theEvent]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-16 12:49:51
|
Revision: 2503 http://skim-app.svn.sourceforge.net/skim-app/?rev=2503&view=rev Author: hofman Date: 2007-07-16 05:49:49 -0700 (Mon, 16 Jul 2007) Log Message: ----------- Fix changing tool mode through arrow keys. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-07-16 12:35:30 UTC (rev 2502) +++ trunk/SKPDFView.m 2007-07-16 12:49:49 UTC (rev 2503) @@ -843,19 +843,19 @@ } else if (isPresentation == NO && ([self toolMode] == SKTextToolMode || [self toolMode] == SKNoteToolMode) && (eventChar == NSTabCharacter) && (modifiers == NSAlternateKeyMask)) { [self selectNextActiveAnnotation:self]; // backtab is a bit inconsistent, it seems Shift+Tab gives a Shift-BackTab key event, I would have expected either Shift-Tab (as for the raw event) or BackTab (as for most shift-modified keys) - } else if (isPresentation == NO && ([self toolMode] == SKTextToolMode || [self toolMode] == SKNoteToolMode) && (((eventChar == NSBackTabCharacter) && (modifiers == NSAlternateKeyMask | NSShiftKeyMask)) || ((eventChar == NSBackTabCharacter) && (modifiers == NSAlternateKeyMask)) || ((eventChar == NSTabCharacter) && (modifiers == NSAlternateKeyMask)))) { + } else if (isPresentation == NO && ([self toolMode] == SKTextToolMode || [self toolMode] == SKNoteToolMode) && (((eventChar == NSBackTabCharacter) && (modifiers == (NSAlternateKeyMask | NSShiftKeyMask))) || ((eventChar == NSBackTabCharacter) && (modifiers == NSAlternateKeyMask)) || ((eventChar == NSTabCharacter) && (modifiers == NSAlternateKeyMask)))) { [self selectPreviousActiveAnnotation:self]; } else if (isPresentation == NO && [activeAnnotation isNoteAnnotation] && [activeAnnotation isMovable] && (eventChar == NSRightArrowFunctionKey || eventChar == NSLeftArrowFunctionKey || eventChar == NSUpArrowFunctionKey || eventChar == NSDownArrowFunctionKey) && (modifiers == 0 || modifiers == NSShiftKeyMask)) { [self moveActiveAnnotationForKey:eventChar byAmount:(modifiers & NSShiftKeyMask) ? 10.0 : 1.0]; - } else if (isPresentation == NO && [activeAnnotation isNoteAnnotation] && [activeAnnotation isResizable] && (eventChar == NSRightArrowFunctionKey || eventChar == NSLeftArrowFunctionKey || eventChar == NSUpArrowFunctionKey || eventChar == NSDownArrowFunctionKey) && (modifiers == NSControlKeyMask || modifiers == NSControlKeyMask | NSShiftKeyMask)) { + } else if (isPresentation == NO && [activeAnnotation isNoteAnnotation] && [activeAnnotation isResizable] && (eventChar == NSRightArrowFunctionKey || eventChar == NSLeftArrowFunctionKey || eventChar == NSUpArrowFunctionKey || eventChar == NSDownArrowFunctionKey) && (modifiers == NSControlKeyMask || modifiers == (NSControlKeyMask | NSShiftKeyMask))) { [self resizeActiveAnnotationForKey:eventChar byAmount:(modifiers & NSShiftKeyMask) ? 10.0 : 1.0]; - } else if (isPresentation == NO && (eventChar == NSRightArrowFunctionKey) && (modifiers == NSCommandKeyMask | NSAlternateKeyMask)) { + } else if (isPresentation == NO && (eventChar == NSRightArrowFunctionKey) && (modifiers == (NSCommandKeyMask | NSAlternateKeyMask))) { [self setToolMode:(toolMode + 1) % 5]; - } else if (isPresentation == NO && (eventChar == NSLeftArrowFunctionKey) && (modifiers == NSCommandKeyMask | NSAlternateKeyMask)) { + } else if (isPresentation == NO && (eventChar == NSLeftArrowFunctionKey) && (modifiers == (NSCommandKeyMask | NSAlternateKeyMask))) { [self setToolMode:(toolMode + 4) % 5]; - } else if (isPresentation == NO && (eventChar == NSDownArrowFunctionKey) && (modifiers == NSCommandKeyMask | NSAlternateKeyMask)) { + } else if (isPresentation == NO && (eventChar == NSDownArrowFunctionKey) && (modifiers == (NSCommandKeyMask | NSAlternateKeyMask))) { [self setAnnotationMode:(annotationMode + 1) % 8]; - } else if (isPresentation == NO && (eventChar == NSUpArrowFunctionKey) && (modifiers == NSCommandKeyMask | NSAlternateKeyMask)) { + } else if (isPresentation == NO && (eventChar == NSUpArrowFunctionKey) && (modifiers == (NSCommandKeyMask | NSAlternateKeyMask))) { [self setAnnotationMode:(annotationMode + 7) % 8]; } else if (readingBar && (eventChar == NSRightArrowFunctionKey || eventChar == NSLeftArrowFunctionKey || eventChar == NSUpArrowFunctionKey || eventChar == NSDownArrowFunctionKey) && (modifiers == NSAlternateKeyMask)) { [self moveReadingBarForKey:eventChar]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-16 12:35:39
|
Revision: 2502 http://skim-app.svn.sourceforge.net/skim-app/?rev=2502&view=rev Author: hofman Date: 2007-07-16 05:35:30 -0700 (Mon, 16 Jul 2007) Log Message: ----------- Implement optional page transition animations for presentation mode. There are a few CoreGraphics transitions (based on some private CG API) and standard CoreImage transitions. PDFView's superview runs the animations based on bitmaps of itself. Disable some more menu actions in presentation mode. In particular ones that change the view settings. Modified Paths: -------------- trunk/Dutch.lproj/MainMenu.nib/classes.nib trunk/Dutch.lproj/MainMenu.nib/keyedobjects.nib trunk/Dutch.lproj/MainWindow.nib/classes.nib trunk/Dutch.lproj/MainWindow.nib/data.dependency trunk/Dutch.lproj/MainWindow.nib/info.nib trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib trunk/English.lproj/MainMenu.nib/classes.nib trunk/English.lproj/MainMenu.nib/keyedobjects.nib trunk/English.lproj/MainWindow.nib/classes.nib trunk/English.lproj/MainWindow.nib/info.nib trunk/English.lproj/MainWindow.nib/keyedobjects.nib trunk/Italian.lproj/MainMenu.nib/classes.nib trunk/Italian.lproj/MainMenu.nib/keyedobjects.nib trunk/Italian.lproj/MainWindow.nib/classes.nib trunk/Italian.lproj/MainWindow.nib/info.nib trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib trunk/NSBitmapImageRep_SKExtensions.h trunk/NSBitmapImageRep_SKExtensions.m trunk/SKFullScreenWindow.m trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/SKPDFView.h trunk/SKPDFView.m trunk/Skim.xcodeproj/project.pbxproj Added Paths: ----------- trunk/Images/TransitionMask.jpg trunk/Images/TransitionShading.tiff trunk/SKAnimationView.h trunk/SKAnimationView.m Modified: trunk/Dutch.lproj/MainMenu.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/MainMenu.nib/classes.nib 2007-07-14 12:34:25 UTC (rev 2501) +++ trunk/Dutch.lproj/MainMenu.nib/classes.nib 2007-07-16 12:35:30 UTC (rev 2502) @@ -11,6 +11,7 @@ changeLeftSidePaneState = id; changeRightSidePaneState = id; changeToolMode = id; + chooseTransition = id; createNewNote = id; crop = id; cropAll = id; Modified: trunk/Dutch.lproj/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Dutch.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/classes.nib 2007-07-14 12:34:25 UTC (rev 2501) +++ trunk/Dutch.lproj/MainWindow.nib/classes.nib 2007-07-16 12:35:30 UTC (rev 2502) @@ -48,6 +48,7 @@ changeScaleFactor = id; changeToolMode = id; chooseScale = id; + chooseTransition = id; createNewNote = id; crop = id; cropAll = id; @@ -55,6 +56,7 @@ dismissChoosePageSheet = id; dismissChooseScaleSheet = id; dismissPasswordSheet = id; + dismissTransitionSheet = id; displayFacingPages = id; displaySinglePages = id; doAutoScale = id; @@ -96,6 +98,7 @@ toggleLeftSidePane = id; togglePresentation = id; toggleRightSidePane = id; + toggleStatusBar = id; }; CLASS = SKMainWindowController; LANGUAGE = ObjC; @@ -155,6 +158,10 @@ thumbnailView = NSView; tocView = NSView; toolModeButton = NSSegmentedControl; + transitionDurationField = NSTextField; + transitionDurationSlider = NSSlider; + transitionSheet = NSWindow; + transitionStylePopUpButton = NSPopUpButton; }; SUPERCLASS = NSWindowController; }, Modified: trunk/Dutch.lproj/MainWindow.nib/data.dependency =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/data.dependency 2007-07-14 12:34:25 UTC (rev 2501) +++ trunk/Dutch.lproj/MainWindow.nib/data.dependency 2007-07-16 12:35:30 UTC (rev 2502) @@ -5,6 +5,7 @@ <key>IBPaletteDependency</key> <array> <string>PDFKit</string> + <string>Controllers</string> </array> </dict> </plist> Modified: trunk/Dutch.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-07-14 12:34:25 UTC (rev 2501) +++ trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-07-16 12:35:30 UTC (rev 2502) @@ -25,11 +25,6 @@ <array> <integer>208</integer> </array> - <key>IBOpenObjects</key> - <array> - <integer>168</integer> - <integer>5</integer> - </array> <key>IBSystem Version</key> <string>8R218</string> </dict> Modified: trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/MainMenu.nib/classes.nib =================================================================== --- trunk/English.lproj/MainMenu.nib/classes.nib 2007-07-14 12:34:25 UTC (rev 2501) +++ trunk/English.lproj/MainMenu.nib/classes.nib 2007-07-16 12:35:30 UTC (rev 2502) @@ -11,6 +11,7 @@ changeLeftSidePaneState = id; changeRightSidePaneState = id; changeToolMode = id; + chooseTransition = id; createNewNote = id; crop = id; cropAll = id; Modified: trunk/English.lproj/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/English.lproj/MainWindow.nib/classes.nib 2007-07-14 12:34:25 UTC (rev 2501) +++ trunk/English.lproj/MainWindow.nib/classes.nib 2007-07-16 12:35:30 UTC (rev 2502) @@ -48,6 +48,7 @@ changeScaleFactor = id; changeToolMode = id; chooseScale = id; + chooseTransition = id; createNewNote = id; crop = id; cropAll = id; @@ -55,6 +56,7 @@ dismissChoosePageSheet = id; dismissChooseScaleSheet = id; dismissPasswordSheet = id; + dismissTransitionSheet = id; displayFacingPages = id; displaySinglePages = id; doAutoScale = id; @@ -96,6 +98,7 @@ toggleLeftSidePane = id; togglePresentation = id; toggleRightSidePane = id; + toggleStatusBar = id; }; CLASS = SKMainWindowController; LANGUAGE = ObjC; @@ -155,6 +158,10 @@ thumbnailView = NSView; tocView = NSView; toolModeButton = NSSegmentedControl; + transitionDurationField = NSTextField; + transitionDurationSlider = NSSlider; + transitionSheet = NSWindow; + transitionStylePopUpButton = NSPopUpButton; }; SUPERCLASS = NSWindowController; }, Modified: trunk/English.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/English.lproj/MainWindow.nib/info.nib 2007-07-14 12:34:25 UTC (rev 2501) +++ trunk/English.lproj/MainWindow.nib/info.nib 2007-07-16 12:35:30 UTC (rev 2502) @@ -27,17 +27,18 @@ </array> <key>IBOpenObjects</key> <array> + <integer>633</integer> + <integer>502</integer> + <integer>539</integer> <integer>168</integer> - <integer>539</integer> + <integer>553</integer> + <integer>585</integer> <integer>5</integer> - <integer>208</integer> + <integer>256</integer> + <integer>224</integer> <integer>314</integer> <integer>511</integer> - <integer>256</integer> - <integer>585</integer> - <integer>502</integer> - <integer>224</integer> - <integer>553</integer> + <integer>208</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/English.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Added: trunk/Images/TransitionMask.jpg =================================================================== (Binary files differ) Property changes on: trunk/Images/TransitionMask.jpg ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: trunk/Images/TransitionShading.tiff =================================================================== (Binary files differ) Property changes on: trunk/Images/TransitionShading.tiff ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Modified: trunk/Italian.lproj/MainMenu.nib/classes.nib =================================================================== --- trunk/Italian.lproj/MainMenu.nib/classes.nib 2007-07-14 12:34:25 UTC (rev 2501) +++ trunk/Italian.lproj/MainMenu.nib/classes.nib 2007-07-16 12:35:30 UTC (rev 2502) @@ -11,6 +11,7 @@ changeLeftSidePaneState = id; changeRightSidePaneState = id; changeToolMode = id; + chooseTransition = id; createNewNote = id; crop = id; cropAll = id; Modified: trunk/Italian.lproj/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/Italian.lproj/MainWindow.nib/classes.nib 2007-07-14 12:34:25 UTC (rev 2501) +++ trunk/Italian.lproj/MainWindow.nib/classes.nib 2007-07-16 12:35:30 UTC (rev 2502) @@ -48,6 +48,7 @@ changeScaleFactor = id; changeToolMode = id; chooseScale = id; + chooseTransition = id; createNewNote = id; crop = id; cropAll = id; @@ -55,6 +56,7 @@ dismissChoosePageSheet = id; dismissChooseScaleSheet = id; dismissPasswordSheet = id; + dismissTransitionSheet = id; displayFacingPages = id; displaySinglePages = id; doAutoScale = id; @@ -96,6 +98,7 @@ toggleLeftSidePane = id; togglePresentation = id; toggleRightSidePane = id; + toggleStatusBar = id; }; CLASS = SKMainWindowController; LANGUAGE = ObjC; @@ -155,6 +158,10 @@ thumbnailView = NSView; tocView = NSView; toolModeButton = NSSegmentedControl; + transitionDurationField = NSTextField; + transitionDurationSlider = NSSlider; + transitionSheet = NSWindow; + transitionStylePopUpButton = NSPopUpButton; }; SUPERCLASS = NSWindowController; }, Modified: trunk/Italian.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Italian.lproj/MainWindow.nib/info.nib 2007-07-14 12:34:25 UTC (rev 2501) +++ trunk/Italian.lproj/MainWindow.nib/info.nib 2007-07-16 12:35:30 UTC (rev 2502) @@ -27,12 +27,13 @@ </array> <key>IBOpenObjects</key> <array> - <integer>208</integer> <integer>168</integer> - <integer>553</integer> <integer>511</integer> + <integer>5</integer> + <integer>208</integer> <integer>539</integer> - <integer>5</integer> + <integer>553</integer> + <integer>628</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/NSBitmapImageRep_SKExtensions.h =================================================================== --- trunk/NSBitmapImageRep_SKExtensions.h 2007-07-14 12:34:25 UTC (rev 2501) +++ trunk/NSBitmapImageRep_SKExtensions.h 2007-07-16 12:35:30 UTC (rev 2502) @@ -44,4 +44,6 @@ - (NSBitmapImageRep *)initWithPDFPage:(PDFPage *)page forBox:(PDFDisplayBox)box; - (NSRect)foregroundRect; +- (void)clear; + @end Modified: trunk/NSBitmapImageRep_SKExtensions.m =================================================================== --- trunk/NSBitmapImageRep_SKExtensions.m 2007-07-14 12:34:25 UTC (rev 2501) +++ trunk/NSBitmapImageRep_SKExtensions.m 2007-07-16 12:35:30 UTC (rev 2502) @@ -217,4 +217,11 @@ return self; } +// A fast alternative to filling with [NSColor clearColor]. +- (void)clear { + unsigned char *bitmapData = [self bitmapData]; + if (bitmapData) + bzero(bitmapData, [self bytesPerRow] * [self pixelsHigh]); +} + @end Added: trunk/SKAnimationView.h =================================================================== --- trunk/SKAnimationView.h (rev 0) +++ trunk/SKAnimationView.h 2007-07-16 12:35:30 UTC (rev 2502) @@ -0,0 +1,141 @@ +// +// SKAnimationView.h +// Skim +// +// Created by Christiaan Hofman on 7/15/07. +/* + This software is Copyright (c) 2007 + Christiaan Hofman. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of Christiaan Hofman nor the names of any + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import <Cocoa/Cocoa.h> + +#pragma mark Private Core Graphics types and functions + +typedef int CGSConnection; +typedef int CGSWindow; + +typedef enum _CGSTransitionType { + CGSNone, + CGSFade, + CGSZoom, + CGSReveal, + CGSSlide, + CGSWarpFade, + CGSSwap, + CGSCube, + CGSWarpSwitch +} CGSTransitionType; + +typedef enum _CGSTransitionOption { + CGSDown, + CGSLeft, + CGSRight, + CGSInRight, + CGSBottomLeft = 5, + CGSBottomRight, + CGSDownTopRight, + CGSUp, + CGSTopLeft, + CGSTopRight, + CGSUpBottomRight, + CGSInBottom, + CGSLeftBottomRight, + CGSRightBottomLeft, + CGSInBottomRight, + CGSInOut +} CGSTransitionOption; + +typedef struct _CGSTransitionSpec { + uint32_t unknown1; + CGSTransitionType type; + CGSTransitionOption option; + CGSWindow wid; // Can be 0 for full-screen + float *backColour; // Null for black otherwise pointer to 3 float array with RGB value +} CGSTransitionSpec; + +extern CGSConnection _CGSDefaultConnection(void); + +extern OSStatus CGSNewTransition(const CGSConnection cid, const CGSTransitionSpec* spec, int *pTransitionHandle); +extern OSStatus CGSInvokeTransition(const CGSConnection cid, int transitionHandle, float duration); +extern OSStatus CGSReleaseTransition(const CGSConnection cid, int transitionHandle); + +#pragma mark SKAnimationView + +@class CIFilter, CIImage; + +typedef enum _SKAnimationTransitionStyle { + SKNoTransition = CGSNone, + // Core Graphics transitions + SKFadeTransition = CGSFade, + SKZoomTransition = CGSZoom, + SKRevealTransition = CGSReveal, + SKSlideTransition = CGSSlide, + SKWarpFadeTransition = CGSWarpFade, + SKSwapTransition = CGSSwap, + SKCubeTransition = CGSCube, + SKWarpSwitchTransition = CGSWarpSwitch, + // Core Image transitions + SKCopyMachineTransition, + SKDisintegrateTransition, + SKDissolveTransition, + SKFlashTransition, + SKModTransition, + SKPageCurlTransition, + SKRippleTransition, + SKSwipeTransition +} SKAnimationTransitionStyle; + + +@interface SKAnimationView : NSView { + CIImage *initialImage; + NSRect imageRect; +} + +- (void)prepareForAnimationWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle fromRect:(NSRect)rect; +- (void)animateWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle direction:(CGSTransitionOption)direction duration:(float)duration fromRect:(NSRect)rect; + +@end + + +@interface SKTransitionAnimation : NSAnimation { + CIFilter *filter; +} + +- (id)initWithFilter:(CIFilter *)aFilter duration:(NSTimeInterval)duration animationCurve:(NSAnimationCurve)animationCurve; +- (CIImage *)currentImage; + +@end + + +@interface NSObject (SKTransitionAnimationDelegate) +- (void)transitionAnimationDidUpdate:(SKTransitionAnimation *)anAnimation; +@end Added: trunk/SKAnimationView.m =================================================================== --- trunk/SKAnimationView.m (rev 0) +++ trunk/SKAnimationView.m 2007-07-16 12:35:30 UTC (rev 2502) @@ -0,0 +1,286 @@ +// +// SKAnimationView.m +// Skim +// +// Created by Christiaan Hofman on 7/15/07. +/* + This software is Copyright (c) 2007 + Christiaan Hofman. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of Christiaan Hofman nor the names of any + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + This code is based partly on Apple's AnimatingTabView example code + and Ankur Kothari's AnimatingTabsDemo application <http://dev.lipidity.com> +*/ + +#import "SKAnimationView.h" +#import <Quartz/Quartz.h> +#import "NSBitmapImageRep_SKExtensions.h" +#include <unistd.h> + + +@implementation SKAnimationView + +- (void)dealloc { + [initialImage release]; + [super dealloc]; +} + +- (CIImage *)inputShadingImage { + static CIImage *inputShadingImage = nil; + if (inputShadingImage == nil) { + NSData *shadingBitmapData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"TransitionShading" ofType:@"tiff"]]; + NSBitmapImageRep *shadingBitmap = [[[NSBitmapImageRep alloc] initWithData:shadingBitmapData] autorelease]; + inputShadingImage = [[CIImage alloc] initWithBitmapImageRep:shadingBitmap]; + } + return inputShadingImage; +} + +- (CIImage *)inputMaskImage { + static CIImage *inputMaskImage = nil; + if (inputMaskImage == nil) { + NSData *maskBitmapData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"TransitionMask" ofType:@"jpg"]]; + NSBitmapImageRep *maskBitmap = [[[NSBitmapImageRep alloc] initWithData:maskBitmapData] autorelease]; + inputMaskImage = [[CIImage alloc] initWithBitmapImageRep:maskBitmap]; + } + return inputMaskImage; +} + +- (CIFilter *)transitionFilter:(SKAnimationTransitionStyle)transitionStyle forRect:(NSRect)rect initialCIImage:(CIImage *)initialCIImage finalCIImage:(CIImage *)finalCIImage { + CIFilter *transitionFilter = nil; + + CIFilter *maskScalingFilter = nil; + CGRect maskExtent; + NSRect bounds = [self bounds]; + + if (NSEqualRects(rect, bounds) == NO) { + CIFilter *cropFilter = [CIFilter filterWithName:@"CICrop"]; + [cropFilter setValue:[CIVector vectorWithX:NSMinX(imageRect) Y:NSMinY(imageRect) Z:NSWidth(imageRect) W:NSHeight(imageRect)] forKey:@"inputRectangle"]; + [cropFilter setValue:initialCIImage forKey:@"inputImage"]; + initialCIImage = [cropFilter valueForKey:@"outputImage"]; + [cropFilter setValue:finalCIImage forKey:@"inputImage"]; + finalCIImage = [cropFilter valueForKey:@"outputImage"]; + } + + switch (transitionStyle) { + case SKCopyMachineTransition: + transitionFilter = [CIFilter filterWithName:@"CICopyMachineTransition"]; + [transitionFilter setDefaults]; + [transitionFilter setValue:[CIVector vectorWithX:NSMinX(rect) Y:NSMinY(rect) Z:NSWidth(rect) W:NSHeight(rect)] forKey:@"inputExtent"]; + break; + + case SKDisintegrateTransition: + transitionFilter = [CIFilter filterWithName:@"CIDisintegrateWithMaskTransition"]; + [transitionFilter setDefaults]; + + // Scale our mask image to match the transition area size, and set the scaled result as the "inputMaskImage" to the transitionFilter. + maskScalingFilter = [CIFilter filterWithName:@"CILanczosScaleTransform"]; + [maskScalingFilter setDefaults]; + maskExtent = [[self inputMaskImage] extent]; + float xScale = NSWidth(rect) / CGRectGetWidth(maskExtent); + float yScale = NSHeight(rect) / CGRectGetHeight(maskExtent); + [maskScalingFilter setValue:[NSNumber numberWithFloat:yScale] forKey:@"inputScale"]; + [maskScalingFilter setValue:[NSNumber numberWithFloat:xScale / yScale] forKey:@"inputAspectRatio"]; + [maskScalingFilter setValue:[self inputMaskImage] forKey:@"inputImage"]; + + [transitionFilter setValue:[maskScalingFilter valueForKey:@"outputImage"] forKey:@"inputMaskImage"]; + break; + + case SKDissolveTransition: + transitionFilter = [CIFilter filterWithName:@"CIDissolveTransition"]; + [transitionFilter setDefaults]; + break; + + case SKFlashTransition: + transitionFilter = [CIFilter filterWithName:@"CIFlashTransition"]; + [transitionFilter setDefaults]; + [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:@"inputCenter"]; + [transitionFilter setValue:[CIVector vectorWithX:NSMinX(bounds) Y:NSMinY(bounds) Z:NSWidth(bounds) W:NSHeight(bounds)] forKey:@"inputExtent"]; + break; + + case SKModTransition: + transitionFilter = [CIFilter filterWithName:@"CIModTransition"]; + [transitionFilter setDefaults]; + [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:@"inputCenter"]; + break; + + case SKPageCurlTransition: + transitionFilter = [CIFilter filterWithName:@"CIPageCurlTransition"]; + [transitionFilter setDefaults]; + [transitionFilter setValue:[NSNumber numberWithFloat:-M_PI_4] forKey:@"inputAngle"]; + [transitionFilter setValue:initialCIImage forKey:@"inputBacksideImage"]; + [transitionFilter setValue:[self inputShadingImage] forKey:@"inputShadingImage"]; + [transitionFilter setValue:[CIVector vectorWithX:NSMinX(rect) Y:NSMinY(rect) Z:NSWidth(rect) W:NSHeight(rect)] forKey:@"inputExtent"]; + break; + + case SKSwipeTransition: + transitionFilter = [CIFilter filterWithName:@"CISwipeTransition"]; + [transitionFilter setDefaults]; + break; + + case SKRippleTransition: + default: + transitionFilter = [CIFilter filterWithName:@"CIRippleTransition"]; + [transitionFilter setDefaults]; + [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:@"inputCenter"]; + [transitionFilter setValue:[CIVector vectorWithX:NSMinX(bounds) Y:NSMinY(bounds) Z:NSWidth(bounds) W:NSHeight(bounds)] forKey:@"inputExtent"]; + [transitionFilter setValue:[self inputShadingImage] forKey:@"inputShadingImage"]; + break; + } + [transitionFilter setValue:initialCIImage forKey:@"inputImage"]; + [transitionFilter setValue:finalCIImage forKey:@"inputTargetImage"]; + + return transitionFilter; +} + +- (void)prepareForAnimationWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle fromRect:(NSRect)rect{ + if (transitionStyle >= SKCopyMachineTransition) { + NSRect bounds = [self bounds]; + [initialImage release]; + NSBitmapImageRep *initialContentBitmap = [self bitmapImageRepForCachingDisplayInRect:bounds]; + [initialContentBitmap clear]; + [self cacheDisplayInRect:bounds toBitmapImageRep:initialContentBitmap]; + initialImage = [[CIImage alloc] initWithBitmapImageRep:initialContentBitmap]; + imageRect = rect; + } +} + +- (void)animateWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle direction:(CGSTransitionOption)direction duration:(float)duration fromRect:(NSRect)rect { + if (transitionStyle == SKNoTransition) { + + } else if (transitionStyle < SKCopyMachineTransition) { + + // declare our variables + int handle = -1; + CGSTransitionSpec spec; + + // specify our specifications + spec.unknown1 = 0; + spec.type = transitionStyle; + spec.option = direction; + spec.backColour = NULL; + spec.wid = [[self window] windowNumber]; + + // Let’s get a connection + CGSConnection cgs = _CGSDefaultConnection(); + + // Create a transition + CGSNewTransition(cgs, &spec, &handle); + + // Redraw the window + [[self window] display]; + + CGSInvokeTransition(cgs, handle, duration); + // We need to wait for the transition to finish before we get rid of it, otherwise we’ll get all sorts of nasty errors... or maybe not. + usleep((useconds_t)(duration * 1000000)); + + CGSReleaseTransition(cgs, handle); + handle = 0; + + } else { + + if (initialImage == nil) + [self prepareForAnimationWithTransitionStyle:transitionStyle fromRect:rect]; + NSRect bounds = [self bounds]; + imageRect = NSIntersectionRect(NSUnionRect(imageRect, rect), bounds); + + NSBitmapImageRep *finalContentBitmap = [self bitmapImageRepForCachingDisplayInRect:bounds]; + [finalContentBitmap clear]; + [self cacheDisplayInRect:bounds toBitmapImageRep:finalContentBitmap]; + CIImage *finalImage = [[CIImage alloc] initWithBitmapImageRep:finalContentBitmap]; + + CIFilter *transitionFilter = [self transitionFilter:transitionStyle forRect:imageRect initialCIImage:initialImage finalCIImage:finalImage]; + + [finalImage release]; + [initialImage release]; + initialImage = nil; + + SKTransitionAnimation *animation = [[SKTransitionAnimation alloc] initWithFilter:transitionFilter duration:duration animationCurve:NSAnimationLinear]; + [animation setDelegate:self]; + + [animation startAnimation]; + + [animation release]; + + [self setNeedsDisplay:YES]; + + } +} + +- (void)transitionAnimationDidUpdate:(SKTransitionAnimation *)anAnimation { + NSRect nsBounds = [self bounds]; + CGRect cgBounds = *(CGRect *)&nsBounds; + + [self lockFocus]; + + NSGraphicsContext *context = [NSGraphicsContext currentContext]; + [context saveGraphicsState]; + + [[[self window] backgroundColor] setFill]; + NSRectFill(nsBounds); + + [[context CIContext] drawImage:[anAnimation currentImage] inRect:cgBounds fromRect:cgBounds]; + [context flushGraphics]; + + [context restoreGraphicsState]; + + [self unlockFocus]; +} + +@end + + +@implementation SKTransitionAnimation + +- (id)initWithFilter:(CIFilter *)aFilter duration:(NSTimeInterval)duration animationCurve:(NSAnimationCurve)animationCurve { + if (self = [super initWithDuration:duration animationCurve:animationCurve]) { + filter = [aFilter retain]; + } + return self; +} + +- (void)dealloc { + [filter release]; + [super dealloc]; +} + +- (void)setCurrentProgress:(NSAnimationProgress)progress { + [filter setValue:[NSNumber numberWithFloat:[self currentValue]] forKey:@"inputTime"]; + [super setCurrentProgress:progress]; + if ([[self delegate] respondsToSelector:@selector(transitionAnimationDidUpdate:)]) + [[self delegate] transitionAnimationDidUpdate:self]; +} + +- (CIImage *)currentImage { + return [filter valueForKey:@"outputImage"]; +} + +@end Modified: trunk/SKFullScreenWindow.m =================================================================== --- trunk/SKFullScreenWindow.m 2007-07-14 12:34:25 UTC (rev 2501) +++ trunk/SKFullScreenWindow.m 2007-07-16 12:35:30 UTC (rev 2502) @@ -39,6 +39,7 @@ #import "SKFullScreenWindow.h" #import "SKMainWindowController.h" #import "SKPDFHoverWindow.h" +#import "SKAnimationview.h" @implementation SKFullScreenWindow @@ -49,6 +50,7 @@ [self setDisplaysWhenScreenProfileChanges:YES]; [self setAcceptsMouseMovedEvents:YES]; [self setBackgroundColor:[NSColor blackColor]]; + [self setContentView:[[[SKAnimationView alloc] init] autorelease]]; } return self; } Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2007-07-14 12:34:25 UTC (rev 2501) +++ trunk/SKMainWindowController.h 2007-07-16 12:35:30 UTC (rev 2502) @@ -162,6 +162,11 @@ IBOutlet NSWindow *passwordSheet; IBOutlet NSTextField *passwordField; + IBOutlet NSWindow *transitionSheet; + IBOutlet NSPopUpButton *transitionStylePopUpButton; + IBOutlet NSTextField *transitionDurationField; + IBOutlet NSSlider *transitionDurationSlider; + NSButton *colorAccessoryView; BOOL updatingColor; BOOL updatingFont; @@ -243,6 +248,8 @@ - (IBAction)password:(id)sender; - (IBAction)dismissPasswordSheet:(id)sender; - (IBAction)savePDFSettingToDefaults:(id)sender; +- (IBAction)chooseTransition:(id)sender; +- (IBAction)dismissTransitionSheet:(id)sender; - (void)showSnapshotAtPageNumber:(int)pageNum forRect:(NSRect)rect factor:(int)factor display:(BOOL)display; - (void)toggleSnapshots:(NSArray *)snapshotArray; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-07-14 12:34:25 UTC (rev 2501) +++ trunk/SKMainWindowController.m 2007-07-16 12:35:30 UTC (rev 2502) @@ -74,6 +74,7 @@ #import "SKLineInspector.h" #import "SKColorSwatch.h" #import "SKStatusBar.h" +#import "SKAnimationView.h" #define SEGMENTED_CONTROL_HEIGHT 25.0 #define WINDOW_X_DELTA 0.0 @@ -1221,7 +1222,10 @@ } - (IBAction)toggleAutoScale:(id)sender { - [pdfView setAutoScales:[pdfView autoScales] == NO]; + if ([self isPresentation]) + [self toggleAutoActualSize:sender]; + else + [pdfView setAutoScales:[pdfView autoScales] == NO]; } - (IBAction)toggleAutoActualSize:(id)sender { @@ -1653,6 +1657,9 @@ [pdfView layoutDocumentView]; [pdfView setNeedsDisplay:YES]; + if ([self isPresentation]) + [pdfView setAnimationView:(SKAnimationView *)[fullScreenWindow contentView]]; + NSEnumerator *wcEnum = [[[self document] windowControllers] objectEnumerator]; NSWindowController *wc = [wcEnum nextObject]; @@ -1840,6 +1847,8 @@ [fullScreenWindow setBackgroundColor:backgroundColor]; [fullScreenWindow setLevel:NSPopUpMenuWindowLevel]; + [pdfView setAnimationView:(SKAnimationView *)[fullScreenWindow contentView]]; + // periodically send a 'user activity' to prevent sleep mode and screensaver from being activated activityTimer = [[NSTimer scheduledTimerWithTimeInterval:30 target:self selector:@selector(activityTimerFired:) userInfo:NULL repeats:YES] retain]; @@ -1851,6 +1860,8 @@ [activityTimer release]; activityTimer = nil; + [pdfView setAnimationView:nil]; + NSScrollView *scrollView = [[pdfView documentView] enclosingScrollView]; [self applyPDFSettings:savedNormalSetup]; [scrollView setNeverHasHorizontalScroller:NO]; @@ -2038,6 +2049,29 @@ [[NSUserDefaults standardUserDefaults] setObject:[self currentPDFSettings] forKey:SKDefaultPDFDisplaySettingsKey]; } +- (void)transitionSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { + if (returnCode == NSOKButton) { + [pdfView setTransitionStyle:[[transitionStylePopUpButton selectedItem] tag]]; + [pdfView setTransitionDuration:fmax([transitionDurationField floatValue], 0.0)]; + } +} + +- (IBAction)chooseTransition:(id)sender { + [transitionStylePopUpButton selectItemWithTag:[pdfView transitionStyle]]; + [transitionDurationField setFloatValue:[pdfView transitionDuration]]; + [transitionDurationSlider setFloatValue:[pdfView transitionDuration]]; + [NSApp beginSheet:transitionSheet + modalForWindow:[self window] + modalDelegate:self + didEndSelector:@selector(transitionSheetDidEnd:returnCode:contextInfo:) + contextInfo:NULL]; +} + +- (IBAction)dismissTransitionSheet:(id)sender { + [NSApp endSheet:transitionSheet returnCode:[sender tag]]; + [transitionSheet orderOut:self]; +} + #pragma mark Swapping tables - (void)replaceSideView:(NSView *)oldView withView:(NSView *)newView animate:(BOOL)animate { @@ -3977,10 +4011,10 @@ SEL action = [menuItem action]; if (action == @selector(createNewNote:)) { BOOL isMarkup = [menuItem tag] == SKHighlightNote || [menuItem tag] == SKUnderlineNote || [menuItem tag] == SKStrikeOutNote; - return ([pdfView toolMode] == SKTextToolMode || [pdfView toolMode] == SKNoteToolMode) && (isMarkup == NO || [[[pdfView currentSelection] pages] count]) && [pdfView hideNotes] == NO; + return [self isPresentation] == NO && ([pdfView toolMode] == SKTextToolMode || [pdfView toolMode] == SKNoteToolMode) && (isMarkup == NO || [[[pdfView currentSelection] pages] count]) && [pdfView hideNotes] == NO; } else if (action == @selector(editNote:)) { PDFAnnotation *annotation = [pdfView activeAnnotation]; - return [annotation isNoteAnnotation] && ([[annotation type] isEqualToString:@"FreeText"] || [[annotation type] isEqualToString:@"Note"]); + return [self isPresentation] == NO && [annotation isNoteAnnotation] && ([[annotation type] isEqualToString:@"FreeText"] || [[annotation type] isEqualToString:@"Note"]); } else if (action == @selector(toggleHideNotes:)) { if ([pdfView hideNotes]) [menuItem setTitle:NSLocalizedString(@"Show Notes", @"Menu item title")]; @@ -3990,24 +4024,24 @@ } else if (action == @selector(displaySinglePages:)) { BOOL displaySinglePages = [pdfView displayMode] == kPDFDisplaySinglePage || [pdfView displayMode] == kPDFDisplaySinglePageContinuous; [menuItem setState:displaySinglePages ? NSOnState : NSOffState]; - return YES; + return [self isPresentation] == NO; } else if (action == @selector(displayFacingPages:)) { BOOL displayFacingPages = [pdfView displayMode] == kPDFDisplayTwoUp || [pdfView displayMode] == kPDFDisplayTwoUpContinuous; [menuItem setState:displayFacingPages ? NSOnState : NSOffState]; - return YES; + return [self isPresentation] == NO; } else if (action == @selector(toggleDisplayContinuous:)) { BOOL displayContinuous = [pdfView displayMode] == kPDFDisplaySinglePageContinuous || [pdfView displayMode] == kPDFDisplayTwoUpContinuous; [menuItem setState:displayContinuous ? NSOnState : NSOffState]; - return YES; + return [self isPresentation] == NO; } else if (action == @selector(toggleDisplayAsBook:)) { [menuItem setState:[pdfView displaysAsBook] ? NSOnState : NSOffState]; - return [pdfView displayMode] == kPDFDisplayTwoUp || [pdfView displayMode] == kPDFDisplayTwoUpContinuous; + return [self isPresentation] == NO && ([pdfView displayMode] == kPDFDisplayTwoUp || [pdfView displayMode] == kPDFDisplayTwoUpContinuous); } else if (action == @selector(toggleDisplayPageBreaks:)) { [menuItem setState:[pdfView displaysPageBreaks] ? NSOnState : NSOffState]; - return YES; + return [self isPresentation] == NO; } else if (action == @selector(changeDisplayBox:)) { [menuItem setState:[pdfView displayBox] == [menuItem tag] ? NSOnState : NSOffState]; - return YES; + return [self isPresentation] == NO; } else if (action == @selector(changeToolMode:)) { [menuItem setState:[pdfView toolMode] == (unsigned)[menuItem tag] ? NSOnState : NSOffState]; return YES; @@ -4026,24 +4060,24 @@ } else if (action == @selector(doGoForward:)) { return [pdfView canGoForward]; } else if (action == @selector(doZoomIn:)) { - return [pdfView canZoomIn]; + return [self isPresentation] == NO && [pdfView canZoomIn]; } else if (action == @selector(doZoomOut:)) { - return [pdfView canZoomOut]; + return [self isPresentation] == NO && [pdfView canZoomOut]; } else if (action == @selector(doZoomToActualSize:)) { return fabs([pdfView scaleFactor] - 1.0 ) > 0.01; } else if (action == @selector(doZoomToSelection:)) { - return NSIsEmptyRect([pdfView currentSelectionRect]) == NO; + return [self isPresentation] == NO && NSIsEmptyRect([pdfView currentSelectionRect]) == NO; } else if (action == @selector(doZoomToFit:)) { - return [pdfView autoScales] == NO; + return [self isPresentation] == NO && [pdfView autoScales] == NO; } else if (action == @selector(doAutoScale:)) { return [pdfView autoScales] == NO; } else if (action == @selector(toggleAutoScale:)) { [menuItem setState:[pdfView autoScales] ? NSOnState : NSOffState]; return YES; - } else if (action == @selector(cropAll:) || action == @selector(crop:)) { - return YES; + } else if (action == @selector(cropAll:) || action == @selector(crop:) || action == @selector(autoCropAll:) || action == @selector(smartAutoCropAll:)) { + return [self isPresentation] == NO; } else if (action == @selector(autoSelectContent:)) { - return [pdfView toolMode] == SKSelectToolMode; + return [self isPresentation] == NO && [pdfView toolMode] == SKSelectToolMode; } else if (action == @selector(toggleLeftSidePane:)) { if ([self isFullScreen]) { if ([leftSideWindow state] == NSDrawerOpenState || [leftSideWindow state] == NSDrawerOpeningState) @@ -4072,16 +4106,16 @@ return [self isPresentation] == NO; } else if (action == @selector(changeLeftSidePaneState:)) { [menuItem setState:(int)leftSidePaneState == [menuItem tag] ? ([findTableView window] ? NSMixedState : NSOnState) : NSOffState]; - return [menuItem tag] == SKThumbnailSidePaneState || pdfOutline; + return [self isPresentation] == NO && ([menuItem tag] == SKThumbnailSidePaneState || pdfOutline); } else if (action == @selector(changeRightSidePaneState:)) { [menuItem setState:(int)rightSidePaneState == [menuItem tag] ? NSOnState : NSOffState]; - return YES; + return [self isPresentation] == NO; } else if (action == @selector(toggleStatusBar:)) { if ([statusBar isVisible]) [menuItem setTitle:NSLocalizedString(@"Hide Status Bar", @"Menu item title")]; else [menuItem setTitle:NSLocalizedString(@"Show Status Bar", @"Menu item title")]; - return YES; + return [self isPresentation] == NO; } else if (action == @selector(searchPDF:)) { return [self isPresentation] == NO; } else if (action == @selector(toggleFullScreen:)) { @@ -4097,20 +4131,17 @@ [menuItem setTitle:NSLocalizedString(@"Presentation", @"Menu item title")]; return YES; } else if (action == @selector(getInfo:)) { - return YES; + return [self isPresentation] == NO; } else if (action == @selector(performFit:)) { - if ([self isFullScreen] || [self isPresentation]) - return NO; - else - return YES; + return [self isFullScreen] == NO && [self isPresentation] == NO; } else if (action == @selector(password:)) { - return [[self pdfDocument] isEncrypted]; + return [self isPresentation] == NO && [[self pdfDocument] isEncrypted]; } else if (action == @selector(toggleReadingBar:)) { if ([[self pdfView] hasReadingBar]) [menuItem setTitle:NSLocalizedString(@"Hide Reading Bar", @"Menu item title")]; else [menuItem setTitle:NSLocalizedString(@"Show Reading Bar", @"Menu item title")]; - return YES; + return [self isPresentation] == NO; } else if (action == @selector(savePDFSettingToDefaults:)) { if ([self isFullScreen]) [menuItem setTitle:NSLocalizedString(@"Use Current View Settings as Default for Full Screen", @"Menu item title")]; Modified: trunk/SKPDFView.h =================================================================== --- trunk/SKPDFView.h 2007-07-14 12:34:25 UTC (rev 2501) +++ trunk/SKPDFView.h 2007-07-16 12:35:30 UTC (rev 2502) @@ -39,6 +39,7 @@ #import <Cocoa/Cocoa.h> #import <Quartz/Quartz.h> #import "SKMainWindowController.h" +#import "SKAnimationView.h" extern NSString *SKPDFViewToolModeChangedNotification; extern NSString *SKPDFViewAnnotationModeChangedNotification; @@ -72,7 +73,7 @@ SKLineNote } SKNoteType; -@class SKReadingBar; +@class SKReadingBar, SKAnimationView; @interface SKPDFView : PDFView { SKToolMode toolMode; @@ -88,6 +89,11 @@ SKReadingBar *readingBar; + SKAnimationView *animationView; + + SKAnimationTransitionStyle transitionStyle; + float transitionDuration; + PDFAnnotation *activeAnnotation; PDFAnnotation *highlightAnnotation; PDFAnnotationTextWidget *editAnnotation; @@ -137,6 +143,15 @@ - (void)toggleReadingBar; +- (SKAnimationView *)animationView; +- (void)setAnimationView:(SKAnimationView *)view; + +- (SKAnimationTransitionStyle)transitionStyle; +- (void)setTransitionStyle:(SKAnimationTransitionStyle)style; + +- (float)transitionDuration; +- (void)setTransitionDuration:(float)duration; + - (IBAction)delete:(id)sender; - (IBAction)autoSelectContent:(id)sender; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-07-14 12:34:25 UTC (rev 2501) +++ trunk/SKPDFView.m 2007-07-16 12:35:30 UTC (rev 2502) @@ -150,6 +150,10 @@ toolMode = [[NSUserDefaults standardUserDefaults] integerForKey:SKLastToolModeKey]; annotationMode = [[NSUserDefaults standardUserDefaults] integerForKey:SKLastAnnotationModeKey]; + animationView = nil; + transitionStyle = SKNoTransition; + transitionDuration = 1.0; + spellingTag = [NSSpellChecker uniqueSpellDocumentTag]; hideNotes = NO; @@ -438,8 +442,6 @@ - (void)setToolMode:(SKToolMode)newToolMode { if (toolMode != newToolMode) { if ((toolMode == SKTextToolMode || toolMode == SKNoteToolMode) && newToolMode != SKTextToolMode && newToolMode != SKNoteToolMode) { - if (editAnnotation) - [self endAnnotationEdit:self]; if (activeAnnotation) [self setActiveAnnotation:nil]; if ([self currentSelection]) @@ -529,6 +531,30 @@ } } +- (SKAnimationView *)animationView { + return animationView; +} + +- (void)setAnimationView:(SKAnimationView *)view { + animationView = view; +} + +- (SKAnimationTransitionStyle)transitionStyle { + return transitionStyle; +} + +- (void)setTransitionStyle:(SKAnimationTransitionStyle)style { + transitionStyle = style; +} + +- (float)transitionDuration { + return transitionDuration; +} + +- (void)setTransitionDuration:(float)duration { + transitionDuration = duration; +} + #pragma mark Reading bar - (BOOL)hasReadingBar { @@ -558,6 +584,30 @@ #pragma mark Actions +- (void)goToNextPage:(id)sender { + if (animationView && [self transitionStyle] != SKNoTransition && [self canGoToNextPage]) { + NSRect rect = [self convertRect:[self convertRect:[[self currentPage] boundsForBox:[self displayBox]] fromPage:[self currentPage]] toView:animationView]; + [animationView prepareForAnimationWithTransitionStyle:[self transitionStyle] fromRect:rect]; + [super goToNextPage:sender]; + rect = [self convertRect:[self convertRect:[[self currentPage] boundsForBox:[self displayBox]] fromPage:[self currentPage]] toView:animationView]; + [animationView animateWithTransitionStyle:[self transitionStyle] direction:CGSLeft duration:[self transitionDuration] fromRect:rect]; + } else { + [super goToNextPage:sender]; + } +} + +- (void)goToPreviousPage:(id)sender { + if (animationView && [self transitionStyle] != SKNoTransition && [self canGoToPreviousPage]) { + NSRect rect = [self convertRect:[self convertRect:[[self currentPage] boundsForBox:[self displayBox]] fromPage:[self currentPage]] toView:animationView]; + [animationView prepareForAnimationWithTransitionStyle:[self transitionStyle] fromRect:rect]; + [super goToPreviousPage:sender]; + rect = [self convertRect:[self convertRect:[[self currentPage] boundsForBox:[self displayBox]] fromPage:[self currentPage]] toView:animationView]; + [animationView animateWithTransitionStyle:[self transitionStyle] direction:CGSRight duration:[self transitionDuration] fromRect:rect]; + } else { + [super goToPreviousPage:sender]; + } +} + - (IBAction)printDocument:(id)sender{ id document = [[[self window] windowController] document]; if ([document respondsToSelector:_cmd]) @@ -837,8 +887,11 @@ mouseDownLoc = [theEvent locationInWindow]; unsigned int modifiers = [theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; - if (hasNavigation && autohidesCursor && ([self areaOfInterestForMouse:theEvent] & kPDFLinkArea) == 0) { - [self goToNextPage:self]; + if (hasNavigation && autohidesCursor) { + if ([self areaOfInterestForMouse:theEvent] & kPDFLinkArea) + [super mouseDown:theEvent]; + else + [self goToNextPage:self]; return; } @@ -3348,7 +3401,12 @@ NSPoint p = [self convertPoint:[theEvent locationInWindow] fromView:nil]; NSCursor *cursor = nil; - if (NSPointInRect(p, [self visibleContentRect]) == NO || ([navWindow isVisible] && NSPointInRect([NSEvent mouseLocation], [navWindow frame]))) { + if (hasNavigation && autohidesCursor) { + if ([self areaOfInterestForMouse:theEvent] & kPDFLinkArea) + cursor = [NSCursor pointingHandCursor]; + else + cursor = [NSCursor arrowCursor]; + } else if (NSPointInRect(p, [self visibleContentRect]) == NO || ([navWindow isVisible] && NSPointInRect([NSEvent mouseLocation], [navWindow frame]))) { cursor = [NSCursor arrowCursor]; } else if ([theEvent modifierFlags] & NSCommandKeyMask) { if ([theEvent modifierFlags] & NSShiftKeyMask) Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-07-14 12:34:25 UTC (rev 2501) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-07-16 12:35:30 UTC (rev 2502) @@ -170,6 +170,9 @@ CEAFFD7C0C40ED5400C3ECBB /* ToolbarColors.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CEAFFD7A0C40ED5400C3ECBB /* ToolbarColors.tiff */; }; CEAFFD7D0C40ED5400C3ECBB /* ToolbarFonts.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CEAFFD7B0C40ED5400C3ECBB /* ToolbarFonts.tiff */; }; CEAFFD9D0C40F2A800C3ECBB /* ToolbarLines.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CEAFFD9C0C40F2A800C3ECBB /* ToolbarLines.tiff */; }; + CEB72B8C0C4A189D000350F9 /* SKAnimationView.m in Sources */ = {isa = PBXBuildFile; fileRef = CEB72B8A0C4A189D000350F9 /* SKAnimationView.m */; }; + CEB7359C0C4A8C1C000350F9 /* TransitionMask.jpg in Resources */ = {isa = PBXBuildFile; fileRef = CEB7359A0C4A8C1B000350F9 /* TransitionMask.jpg */; }; + CEB735A20C4A8CD6000350F9 /* TransitionShading.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CEB735A10C4A8CD6000350F9 /* TransitionShading.tiff */; }; CECBA5910BFCEE260030AB59 /* SelectToolAdorn.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CECBA5900BFCEE250030AB59 /* SelectToolAdorn.tiff */; }; CEE106150BCBB72C00BF2D3E /* SKNotesDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = CEE106140BCBB72C00BF2D3E /* SKNotesDocument.m */; }; CEE1065E0BCBBE1300BF2D3E /* NotesDocument.nib in Resources */ = {isa = PBXBuildFile; fileRef = CEE106580BCBBE1200BF2D3E /* NotesDocument.nib */; }; @@ -541,6 +544,10 @@ CEAFFD7A0C40ED5400C3ECBB /* ToolbarColors.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = ToolbarColors.tiff; path = Images/ToolbarColors.tiff; sourceTree = "<group>"; }; CEAFFD7B0C40ED5400C3ECBB /* ToolbarFonts.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = ToolbarFonts.tiff; path = Images/ToolbarFonts.tiff; sourceTree = "<group>"; }; CEAFFD9C0C40F2A800C3ECBB /* ToolbarLines.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = ToolbarLines.tiff; path = Images/ToolbarLines.tiff; sourceTree = "<group>"; }; + CEB72B890C4A189D000350F9 /* SKAnimationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKAnimationView.h; sourceTree = "<group>"; }; + CEB72B8A0C4A189D000350F9 /* SKAnimationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKAnimationView.m; sourceTree = "<group>"; }; + CEB7359A0C4A8C1B000350F9 /* TransitionMask.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = TransitionMask.jpg; path = Images/TransitionMask.jpg; sourceTree = "<group>"; }; + CEB735A10C4A8CD6000350F9 /* TransitionShading.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = TransitionShading.tiff; path = Images/TransitionShading.tiff; sourceTree = "<group>"; }; CECBA5900BFCEE250030AB59 /* SelectToolAdorn.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = SelectToolAdorn.tiff; path = Images/SelectToolAdorn.tiff; sourceTree = "<group>"; }; CEE106130BCBB72C00BF2D3E /* SKNotesDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKNotesDocument.h; sourceTree = "<group>"; }; CEE106140BCBB72C00BF2D3E /* SKNotesDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKNotesDocument.m; sourceTree = "<group>"; }; @@ -856,6 +863,8 @@ CE2DE4D10B85D92F00D0DA12 /* Views */ = { isa = PBXGroup; children = ( + CEB72B890C4A189D000350F9 /* SKAnimationView.h */, + CEB72B8A0C4A189D000350F9 /* SKAnimationView.m */, CE4D97FA0C3C2BFF002C20CB /* SKColorSwatch.h */, CE4D97FB0C3C2BFF002C20CB /* SKColorSwatch.m */, CE4BC12D0C357A0300C2AF03 /* SKLineWell.h */, @@ -996,6 +1005,8 @@ CE5478C60B33456300F8AFB6 /* ToolbarZoomOut.tiff */, CE01D08B0C07157100FA32EF /* ToolbarZoomToSelection.tiff */, CE5478C70B33456300F8AFB6 /* ToolbarZoomToFit.tiff */, + CEB7359A0C4A8C1B000350F9 /* TransitionMask.jpg */, + CEB735A10C4A8CD6000350F9 /* TransitionShading.tiff */, CE7467540B7F321100CBF969 /* zoomInCursor.tiff */, CE7467550B7F321A00CBF969 /* zoomOutCursor.tiff */, ); @@ -1221,6 +1232,8 @@ CEAFFD7C0C40ED5400C3ECBB /* ToolbarColors.tiff in Resources */, CEAFFD7D0C40ED5400C3ECBB /* ToolbarFonts.tiff in Resources */, CEAFFD9D0C40F2A800C3ECBB /* ToolbarLines.tiff in Resources */, + CEB7359C0C4A8C1C000350F9 /* TransitionMask.jpg in Resources */, + CEB735A20C4A8CD6000350F9 /* TransitionShading.tiff in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1393,6 +1406,7 @@ CE4D97FD0C3C2BFF002C20CB /* SKColorSwatch.m in Sources */, CEAF079D0C4139EB00C3ECBB /* SKStatusBar.m in Sources */, CEAF2E5A0C45414100C3ECBB /* SKLine.m in Sources */, + CEB72B8C0C4A189D000350F9 /* SKAnimationView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-14 12:34:48
|
Revision: 2501 http://skim-app.svn.sourceforge.net/skim-app/?rev=2501&view=rev Author: hofman Date: 2007-07-14 05:34:25 -0700 (Sat, 14 Jul 2007) Log Message: ----------- Hide blanking windows on deactivate. Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-07-14 11:06:06 UTC (rev 2500) +++ trunk/SKMainWindowController.m 2007-07-14 12:34:25 UTC (rev 2501) @@ -1675,6 +1675,7 @@ [window setFrame:[screenToBlank frame] display:YES]; [window orderFront:nil]; [window setReleasedWhenClosed:YES]; + [window setHidesOnDeactivate:YES]; [blankingWindows addObject:window]; [window release]; } @@ -2513,13 +2514,15 @@ } - (void)handleApplicationDidResignActiveNotification:(NSNotification *)notification { - if ([self isPresentation]) + if ([self isPresentation]) { [fullScreenWindow setLevel:NSNormalWindowLevel]; + } } - (void)handleApplicationWillBecomeActiveNotification:(NSNotification *)notification { - if ([self isPresentation]) + if ([self isPresentation]) { [fullScreenWindow setLevel:NSPopUpMenuWindowLevel]; + } } - (void)handleDocumentWillSaveNotification:(NSNotification *)notification { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-14 11:06:08
|
Revision: 2500 http://skim-app.svn.sourceforge.net/skim-app/?rev=2500&view=rev Author: hofman Date: 2007-07-14 04:06:06 -0700 (Sat, 14 Jul 2007) Log Message: ----------- Change shortcuts for rotating through tool modes to Opt-Cmd-arrows, to avoid conflicts with moving the active note. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-07-14 11:03:47 UTC (rev 2499) +++ trunk/SKPDFView.m 2007-07-14 11:06:06 UTC (rev 2500) @@ -799,13 +799,13 @@ [self moveActiveAnnotationForKey:eventChar byAmount:(modifiers & NSShiftKeyMask) ? 10.0 : 1.0]; } else if (isPresentation == NO && [activeAnnotation isNoteAnnotation] && [activeAnnotation isResizable] && (eventChar == NSRightArrowFunctionKey || eventChar == NSLeftArrowFunctionKey || eventChar == NSUpArrowFunctionKey || eventChar == NSDownArrowFunctionKey) && (modifiers == NSControlKeyMask || modifiers == NSControlKeyMask | NSShiftKeyMask)) { [self resizeActiveAnnotationForKey:eventChar byAmount:(modifiers & NSShiftKeyMask) ? 10.0 : 1.0]; - } else if (isPresentation == NO && (eventChar == NSRightArrowFunctionKey) && (modifiers == NSShiftKeyMask)) { + } else if (isPresentation == NO && (eventChar == NSRightArrowFunctionKey) && (modifiers == NSCommandKeyMask | NSAlternateKeyMask)) { [self setToolMode:(toolMode + 1) % 5]; - } else if (isPresentation == NO && (eventChar == NSLeftArrowFunctionKey) && (modifiers == NSShiftKeyMask)) { + } else if (isPresentation == NO && (eventChar == NSLeftArrowFunctionKey) && (modifiers == NSCommandKeyMask | NSAlternateKeyMask)) { [self setToolMode:(toolMode + 4) % 5]; - } else if (isPresentation == NO && (eventChar == NSDownArrowFunctionKey) && (modifiers == NSShiftKeyMask)) { + } else if (isPresentation == NO && (eventChar == NSDownArrowFunctionKey) && (modifiers == NSCommandKeyMask | NSAlternateKeyMask)) { [self setAnnotationMode:(annotationMode + 1) % 8]; - } else if (isPresentation == NO && (eventChar == NSUpArrowFunctionKey) && (modifiers == NSShiftKeyMask)) { + } else if (isPresentation == NO && (eventChar == NSUpArrowFunctionKey) && (modifiers == NSCommandKeyMask | NSAlternateKeyMask)) { [self setAnnotationMode:(annotationMode + 7) % 8]; } else if (readingBar && (eventChar == NSRightArrowFunctionKey || eventChar == NSLeftArrowFunctionKey || eventChar == NSUpArrowFunctionKey || eventChar == NSDownArrowFunctionKey) && (modifiers == NSAlternateKeyMask)) { [self moveReadingBarForKey:eventChar]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-14 11:03:53
|
Revision: 2499 http://skim-app.svn.sourceforge.net/skim-app/?rev=2499&view=rev Author: hofman Date: 2007-07-14 04:03:47 -0700 (Sat, 14 Jul 2007) Log Message: ----------- Don't print notes when all notes are hidden. Modified Paths: -------------- trunk/SKMainWindowController.m trunk/SKPDFAnnotationNote.m trunk/SKPDFView.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-07-13 19:15:55 UTC (rev 2498) +++ trunk/SKMainWindowController.m 2007-07-14 11:03:47 UTC (rev 2499) @@ -734,6 +734,7 @@ unsigned pageIndex = [[dict objectForKey:@"pageIndex"] unsignedIntValue]; if (annotation = [[PDFAnnotation alloc] initWithDictionary:dict]) { [annotation setShouldDisplay:[pdfView hideNotes] == NO]; + [annotation setShouldPrint:[pdfView hideNotes] == NO]; if (pageIndex == NSNotFound) pageIndex = 0; else if (pageIndex >= [pdfDoc pageCount]) @@ -1069,8 +1070,10 @@ BOOL wasHidden = [pdfView hideNotes]; NSEnumerator *noteEnum = [notes objectEnumerator]; PDFAnnotation *note; - while (note = [noteEnum nextObject]) + while (note = [noteEnum nextObject]) { [note setShouldDisplay:wasHidden]; + [note setShouldPrint:wasHidden]; + } [pdfView setHideNotes:wasHidden == NO]; } Modified: trunk/SKPDFAnnotationNote.m =================================================================== --- trunk/SKPDFAnnotationNote.m 2007-07-13 19:15:55 UTC (rev 2498) +++ trunk/SKPDFAnnotationNote.m 2007-07-14 11:03:47 UTC (rev 2499) @@ -562,6 +562,7 @@ - (id)initWithBounds:(NSRect)bounds { if (self = [super initWithBounds:bounds]) { + [self setShouldPrint:YES]; NSColor *color = [NSUnarchiver unarchiveObjectWithData:[[NSUserDefaults standardUserDefaults] dataForKey:SKCircleNoteInteriorColorKey]]; if ([color alphaComponent] > 0.0) [super setInteriorColor:color]; @@ -594,8 +595,6 @@ - (BOOL)isMovable { return YES; } -- (BOOL)shouldPrint { return YES; } - - (void)setInteriorColor:(NSColor *)color { [[[self undoManager] prepareWithInvocationTarget:self] setInteriorColor:[self interiorColor]]; [[self undoManager] setActionName:NSLocalizedString(@"Edit Note", @"Undo action name")]; @@ -628,6 +627,7 @@ - (id)initWithBounds:(NSRect)bounds { if (self = [super initWithBounds:bounds]) { + [self setShouldPrint:YES]; NSColor *color = [NSUnarchiver unarchiveObjectWithData:[[NSUserDefaults standardUserDefaults] dataForKey:SKSquareNoteInteriorColorKey]]; if ([color alphaComponent] > 0.0) [super setInteriorColor:color]; @@ -660,8 +660,6 @@ - (BOOL)isMovable { return YES; } -- (BOOL)shouldPrint { return YES; } - - (void)setInteriorColor:(NSColor *)color { [[[self undoManager] prepareWithInvocationTarget:self] setInteriorColor:[self interiorColor]]; [[self undoManager] setActionName:NSLocalizedString(@"Edit Note", @"Undo action name")]; @@ -729,6 +727,7 @@ - (id)initWithBounds:(NSRect)bounds markupType:(int)type quadrilateralPointsAsStrings:(NSArray *)pointStrings { if (self = [super initWithBounds:bounds]) { + [self setShouldPrint:YES]; [self setMarkupType:type]; NSString *colorKey = nil; @@ -950,8 +949,6 @@ - (BOOL)isMarkupAnnotation { return YES; } -- (BOOL)shouldPrint { return YES; } - // fix a bug in PDFKit, the color space sometimes is not correct - (void)drawWithBox:(CGPDFBox)box inContext:(CGContextRef)context { CGContextSaveGState(context); @@ -993,6 +990,7 @@ - (id)initWithBounds:(NSRect)bounds { if (self = [super initWithBounds:bounds]) { + [self setShouldPrint:YES]; NSFont *font = [NSFont fontWithName:[[NSUserDefaults standardUserDefaults] stringForKey:SKTextNoteFontNameKey] size:[[NSUserDefaults standardUserDefaults] floatForKey:SKTextNoteFontSizeKey]]; [super setFont:font]; @@ -1035,8 +1033,6 @@ - (BOOL)isEditable { return YES; } -- (BOOL)shouldPrint { return YES; } - - (void)setFont:(NSFont *)font { [[[self undoManager] prepareWithInvocationTarget:self] setFont:[self font]]; [[self undoManager] setActionName:NSLocalizedString(@"Edit Note", @"Undo action name")]; @@ -1094,6 +1090,7 @@ - (id)initWithBounds:(NSRect)bounds { if (self = [super initWithBounds:bounds]) { + [self setShouldPrint:YES]; originalSetColor(self, @selector(setColor:), [NSUnarchiver unarchiveObjectWithData:[[NSUserDefaults standardUserDefaults] dataForKey:SKAnchoredNoteColorKey]]); [super setIconType:[[NSUserDefaults standardUserDefaults] integerForKey:SKAnchoredNoteIconTypeKey]]; texts = [[NSArray alloc] initWithObjects:[[[SKNoteText alloc] initWithAnnotation:self] autorelease], nil]; @@ -1141,8 +1138,6 @@ - (BOOL)isEditable { return YES; } -- (BOOL)shouldPrint { return YES; } - - (NSString *)type { return @"Note"; } @@ -1329,8 +1324,6 @@ - (BOOL)isMovable { return YES; } -- (BOOL)shouldPrint { return YES; } - - (void)setStartPoint:(NSPoint)point { [[[self undoManager] prepareWithInvocationTarget:self] setStartPoint:[self startPoint]]; [[self undoManager] setActionName:NSLocalizedString(@"Edit Note", @"Undo action name")]; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-07-13 19:15:55 UTC (rev 2498) +++ trunk/SKPDFView.m 2007-07-14 11:03:47 UTC (rev 2499) @@ -1592,6 +1592,7 @@ - (void)addAnnotation:(PDFAnnotation *)annotation toPage:(PDFPage *)page { [[[self undoManager] prepareWithInvocationTarget:self] removeAnnotation:annotation]; [annotation setShouldDisplay:hideNotes == NO]; + [annotation setShouldPrint:hideNotes == NO]; [page addAnnotation:annotation]; [self setNeedsDisplayForAnnotation:annotation]; [self resetHoverRects]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-13 19:15:56
|
Revision: 2498 http://skim-app.svn.sourceforge.net/skim-app/?rev=2498&view=rev Author: hofman Date: 2007-07-13 12:15:55 -0700 (Fri, 13 Jul 2007) Log Message: ----------- Interchange replacing %line and replacing %file in pdfsync command. Modified Paths: -------------- trunk/SKDocument.m Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-07-13 18:28:07 UTC (rev 2497) +++ trunk/SKDocument.m 2007-07-13 19:15:55 UTC (rev 2498) @@ -880,25 +880,25 @@ NSRange range = NSMakeRange(0, 0); unichar prevChar, nextChar; while (NSMaxRange(range) < [cmdString length]) { - range = [cmdString rangeOfString:@"%file" options:NSLiteralSearch range:NSMakeRange(NSMaxRange(range), [cmdString length] - NSMaxRange(range))]; + range = [cmdString rangeOfString:@"%line" options:NSLiteralSearch range:NSMakeRange(NSMaxRange(range), [cmdString length] - NSMaxRange(range))]; if (range.location == NSNotFound) break; - prevChar = range.location > 0 ? [cmdString characterAtIndex:range.location - 1] : 0; nextChar = NSMaxRange(range) < [cmdString length] ? [cmdString characterAtIndex:NSMaxRange(range)] : 0; - if (prevChar == '\'' && nextChar == '\'') - [cmdString replaceCharactersInRange:range withString:file]; - else if ([[NSCharacterSet letterCharacterSet] characterIsMember:nextChar] == NO) - [cmdString replaceCharactersInRange:range withString:[file stringByEscapingShellChars]]; + if ([[NSCharacterSet letterCharacterSet] characterIsMember:nextChar] == NO) + [cmdString replaceCharactersInRange:range withString:[NSString stringWithFormat:@"%d", line]]; } range = NSMakeRange(0, 0); while (NSMaxRange(range) < [cmdString length]) { - range = [cmdString rangeOfString:@"%line" options:NSLiteralSearch range:NSMakeRange(NSMaxRange(range), [cmdString length] - NSMaxRange(range))]; + range = [cmdString rangeOfString:@"%file" options:NSLiteralSearch range:NSMakeRange(NSMaxRange(range), [cmdString length] - NSMaxRange(range))]; if (range.location == NSNotFound) break; + prevChar = range.location > 0 ? [cmdString characterAtIndex:range.location - 1] : 0; nextChar = NSMaxRange(range) < [cmdString length] ? [cmdString characterAtIndex:NSMaxRange(range)] : 0; - if ([[NSCharacterSet letterCharacterSet] characterIsMember:nextChar] == NO) - [cmdString replaceCharactersInRange:range withString:[NSString stringWithFormat:@"%d", line]]; + if (prevChar == '\'' && nextChar == '\'') + [cmdString replaceCharactersInRange:range withString:file]; + else if ([[NSCharacterSet letterCharacterSet] characterIsMember:nextChar] == NO) + [cmdString replaceCharactersInRange:range withString:[file stringByEscapingShellChars]]; } [cmdString insertString:@"\" " atIndex:0]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-13 18:28:12
|
Revision: 2497 http://skim-app.svn.sourceforge.net/skim-app/?rev=2497&view=rev Author: hofman Date: 2007-07-13 11:28:07 -0700 (Fri, 13 Jul 2007) Log Message: ----------- Use arrow cursor for most note tool modes, as links are disabled. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-07-13 18:20:19 UTC (rev 2496) +++ trunk/SKPDFView.m 2007-07-13 18:28:07 UTC (rev 2497) @@ -3366,6 +3366,8 @@ if ((readingBar && [[readingBar page] isEqual:page] && NSPointInRect(p, [readingBar currentBoundsForBox:[self displayBox]])) || (area == kPDFNoArea || (canSelectOrDrag && area == kPDFPageArea && [[page selectionForRect:NSMakeRect(p.x - 30.0, p.y - 40.0, 60.0, 80.0)] string] == nil))) cursor = [NSCursor openHandCursor]; + else if (toolMode == SKNoteToolMode && annotationMode != SKHighlightNote && annotationMode != SKUnderlineNote && annotationMode != SKStrikeOutNote) + cursor = [NSCursor arrowCursor]; break; } case SKMoveToolMode: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-13 18:22:47
|
Revision: 2496 http://skim-app.svn.sourceforge.net/skim-app/?rev=2496&view=rev Author: hofman Date: 2007-07-13 11:20:19 -0700 (Fri, 13 Jul 2007) Log Message: ----------- Escape special shell characters in file path passed to shell for pdfsync. Modified Paths: -------------- trunk/NSString_SKExtensions.h trunk/NSString_SKExtensions.m trunk/SKDocument.m Modified: trunk/NSString_SKExtensions.h =================================================================== --- trunk/NSString_SKExtensions.h 2007-07-13 16:39:31 UTC (rev 2495) +++ trunk/NSString_SKExtensions.h 2007-07-13 18:20:19 UTC (rev 2496) @@ -47,6 +47,7 @@ - (NSString *)stringByReplacingPathExtension:(NSString *)ext; +- (NSString *)stringByEscapingShellChars; - (NSArray *)shellScriptArgumentsArray; - (NSRange)rangeOfLeadingEmptyLine; Modified: trunk/NSString_SKExtensions.m =================================================================== --- trunk/NSString_SKExtensions.m 2007-07-13 16:39:31 UTC (rev 2495) +++ trunk/NSString_SKExtensions.m 2007-07-13 18:20:19 UTC (rev 2496) @@ -117,6 +117,25 @@ return [[self stringByDeletingPathExtension] stringByAppendingPathExtension:ext]; } +// Escape those characters that are special, to the shell, inside a "quoted" string +- (NSString *)stringByEscapingShellChars { + static NSCharacterSet *shellSpecialChars = nil; + if (shellSpecialChars == nil) + shellSpecialChars = [[NSCharacterSet characterSetWithCharactersInString:@"$\"`\\"] retain]; + + NSMutableString *result = [self mutableCopy]; + unsigned int i = 0; + while (i < [result length]) { + i = [result rangeOfCharacterFromSet:shellSpecialChars options:0 range:NSMakeRange(i, [result length] - i)].location; + if (i != NSNotFound) { + [result insertString:@"\\" atIndex: i]; + i += 2; + } + } + + return [result autorelease]; +} + // parses a space separated list of shell script argments // allows quoting parts of an argument and escaped characters outside quotes, according to shell rules - (NSArray *)shellScriptArgumentsArray; Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-07-13 16:39:31 UTC (rev 2495) +++ trunk/SKDocument.m 2007-07-13 18:20:19 UTC (rev 2496) @@ -877,8 +877,30 @@ } } - [cmdString replaceOccurrencesOfString:@"%file" withString:file options:NSLiteralSearch range: NSMakeRange(0, [cmdString length] )]; - [cmdString replaceOccurrencesOfString:@"%line" withString:[NSString stringWithFormat:@"%d", line] options:NSLiteralSearch range:NSMakeRange(0, [cmdString length])]; + NSRange range = NSMakeRange(0, 0); + unichar prevChar, nextChar; + while (NSMaxRange(range) < [cmdString length]) { + range = [cmdString rangeOfString:@"%file" options:NSLiteralSearch range:NSMakeRange(NSMaxRange(range), [cmdString length] - NSMaxRange(range))]; + if (range.location == NSNotFound) + break; + prevChar = range.location > 0 ? [cmdString characterAtIndex:range.location - 1] : 0; + nextChar = NSMaxRange(range) < [cmdString length] ? [cmdString characterAtIndex:NSMaxRange(range)] : 0; + if (prevChar == '\'' && nextChar == '\'') + [cmdString replaceCharactersInRange:range withString:file]; + else if ([[NSCharacterSet letterCharacterSet] characterIsMember:nextChar] == NO) + [cmdString replaceCharactersInRange:range withString:[file stringByEscapingShellChars]]; + } + + range = NSMakeRange(0, 0); + while (NSMaxRange(range) < [cmdString length]) { + range = [cmdString rangeOfString:@"%line" options:NSLiteralSearch range:NSMakeRange(NSMaxRange(range), [cmdString length] - NSMaxRange(range))]; + if (range.location == NSNotFound) + break; + nextChar = NSMaxRange(range) < [cmdString length] ? [cmdString characterAtIndex:NSMaxRange(range)] : 0; + if ([[NSCharacterSet letterCharacterSet] characterIsMember:nextChar] == NO) + [cmdString replaceCharactersInRange:range withString:[NSString stringWithFormat:@"%d", line]]; + } + [cmdString insertString:@"\" " atIndex:0]; [cmdString insertString:editorCmd atIndex:0]; [cmdString insertString:@"\"" atIndex:0]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-13 16:39:40
|
Revision: 2495 http://skim-app.svn.sourceforge.net/skim-app/?rev=2495&view=rev Author: hofman Date: 2007-07-13 09:39:31 -0700 (Fri, 13 Jul 2007) Log Message: ----------- Implement spell checking. Modified Paths: -------------- trunk/SKPDFView.h trunk/SKPDFView.m Modified: trunk/SKPDFView.h =================================================================== --- trunk/SKPDFView.h 2007-07-12 19:39:46 UTC (rev 2494) +++ trunk/SKPDFView.h 2007-07-13 16:39:31 UTC (rev 2495) @@ -111,6 +111,8 @@ int trackingRect; NSMutableArray *hoverRects; int hoverRect; + + int spellingTag; } - (SKToolMode)toolMode; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-07-12 19:39:46 UTC (rev 2494) +++ trunk/SKPDFView.m 2007-07-13 16:39:31 UTC (rev 2495) @@ -150,6 +150,8 @@ toolMode = [[NSUserDefaults standardUserDefaults] integerForKey:SKLastToolModeKey]; annotationMode = [[NSUserDefaults standardUserDefaults] integerForKey:SKLastAnnotationModeKey]; + spellingTag = [NSSpellChecker uniqueSpellDocumentTag]; + hideNotes = NO; autohidesCursor = NO; @@ -205,6 +207,7 @@ } - (void)dealloc { + [[NSSpellChecker sharedSpellChecker] closeSpellDocumentWithTag:spellingTag]; [[NSUserDefaultsController sharedUserDefaultsController] removeObserver:self forKeys: [NSArray arrayWithObjects:SKReadingBarColorKey, SKReadingBarInvertKey, nil]]; [[NSNotificationCenter defaultCenter] removeObserver:self]; @@ -1232,6 +1235,60 @@ } } +- (void)checkSpellingStartingAtIndex:(int)index onPage:(PDFPage *)page { + unsigned int i, first = [[self document] indexForPage:page]; + unsigned int count = [[self document] pageCount]; + BOOL didWrap = NO; + i = first; + NSRange range = NSMakeRange(NSNotFound, 0); + + while (YES) { + range = [[NSSpellChecker sharedSpellChecker] checkSpellingOfString:[page string] startingAt:index language:nil wrap:NO inSpellDocumentWithTag:spellingTag wordCount:NULL]; + if (range.location != NSNotFound) break; + if (++i >= count) { + i = 0; + didWrap = YES; + } + if (didWrap && i > first) break; + page = [[self document] pageAtIndex:i]; + index = 0; + } + + if (range.location != NSNotFound) { + PDFSelection *selection = [page selectionForRange:range]; + [self setCurrentSelection:selection]; + [self scrollRect:[selection boundsForPage:page] inPageToVisible:page]; + [[NSSpellChecker sharedSpellChecker] updateSpellingPanelWithMisspelledWord:[selection string]]; + } else NSBeep(); +} + +- (void)checkSpelling:(id)sender { + PDFSelection *selection = [self currentSelection]; + PDFPage *page = [self currentPage]; + int index = 0; + if ([[selection pages] count]) { + page = [[selection pages] lastObject]; + index = NSMaxRange([selection safeRangeAtIndex:[selection safeNumberOfRangesOnPage:page] - 1 onPage:page]); + } + [self checkSpellingStartingAtIndex:index onPage:page]; +} + +- (void)showGuessPanel:(id)sender { + PDFSelection *selection = [self currentSelection]; + PDFPage *page = [self currentPage]; + int index = 0; + if ([[selection pages] count]) { + page = [[selection pages] objectAtIndex:0]; + index = [selection safeRangeAtIndex:0 onPage:page].location; + } + [self checkSpellingStartingAtIndex:index onPage:page]; + [[[NSSpellChecker sharedSpellChecker] spellingPanel] orderFront:self]; +} + +- (void)ignoreSpelling:(id)sender { + [[NSSpellChecker sharedSpellChecker] ignoreWord:[[sender selectedCell] stringValue] inSpellDocumentWithTag:spellingTag]; +} + #pragma mark Tracking mousemoved fix - (void)setFrame:(NSRect)frame { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-12 19:39:47
|
Revision: 2494 http://skim-app.svn.sourceforge.net/skim-app/?rev=2494&view=rev Author: hofman Date: 2007-07-12 12:39:46 -0700 (Thu, 12 Jul 2007) Log Message: ----------- Use a thread safe flag to determine if DVI converter is converting PS rather than switching the cancel button action. Change hidden pref key for dvi conversion command. Modified Paths: -------------- trunk/SKPSProgressController.h trunk/SKPSProgressController.m Modified: trunk/SKPSProgressController.h =================================================================== --- trunk/SKPSProgressController.h 2007-07-12 18:58:42 UTC (rev 2493) +++ trunk/SKPSProgressController.h 2007-07-12 19:39:46 UTC (rev 2494) @@ -37,6 +37,7 @@ */ #import <Cocoa/Cocoa.h> +#import <libkern/OSAtomic.h> @interface SKConversionProgressController : NSWindowController { IBOutlet NSButton *cancelButton; @@ -57,7 +58,7 @@ @interface SKDVIProgressController : SKPSProgressController { NSTask *task; + volatile int32_t convertingPS __attribute__ ((aligned (4))); } - (NSData *)PDFDataWithDVIFile:(NSString *)dviFile; -- (IBAction)cancelPS:(id)sender; @end Modified: trunk/SKPSProgressController.m =================================================================== --- trunk/SKPSProgressController.m 2007-07-12 18:58:42 UTC (rev 2493) +++ trunk/SKPSProgressController.m 2007-07-12 19:39:46 UTC (rev 2494) @@ -273,7 +273,9 @@ - (IBAction)cancel:(id)sender { - if ([task isRunning]) { + if (convertingPS) { + [super cancel:sender]; + } else if ([task isRunning]) { [task terminate]; } else { NSBeep(); @@ -283,11 +285,6 @@ } } -- (IBAction)cancelPS:(id)sender -{ - [super cancel:sender]; -} - - (NSData *)PDFDataWithDVIFile:(NSString *)dviFile { NSMutableData *pdfData = [[NSMutableData alloc] init]; @@ -312,7 +309,7 @@ NSString *dviFile = [info objectForKey:@"dviFile"]; - NSString *commandPath = [[NSUserDefaults standardUserDefaults] stringForKey:@"SKDviConverterBinary"]; + NSString *commandPath = [[NSUserDefaults standardUserDefaults] stringForKey:@"SKDviConversionCommand"]; NSString *commandName = commandPath ? [commandPath lastPathComponent] : @"dvips"; NSFileManager *fm = [NSFileManager defaultManager]; NSArray *paths = [NSArray arrayWithObjects:@"/usr/texbin", @"/usr/local/teTeX/bin/powerpc-apple-darwin-current", @"/sw/bin", @"/opt/local/bin", @"/usr/local/bin", nil]; @@ -387,13 +384,7 @@ NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:(id)provider, @"provider", (id)consumer, @"consumer", nil]; - SEL selector = @selector(cancelPS:); - ms = [self methodSignatureForSelector:@selector(setAction)]; - invocation = [NSInvocation invocationWithMethodSignature:ms]; - [invocation setTarget:cancelButton]; - [invocation setSelector:@selector(setAction)]; - [invocation setArgument:&selector atIndex:2]; - [invocation performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:NO]; + OSAtomicCompareAndSwap32Barrier(0, 1, (int32_t *)&convertingPS); [super doConversionWithInfo:dictionary]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-12 18:58:43
|
Revision: 2493 http://skim-app.svn.sourceforge.net/skim-app/?rev=2493&view=rev Author: hofman Date: 2007-07-12 11:58:42 -0700 (Thu, 12 Jul 2007) Log Message: ----------- Change cancel action when the dvi converter converts ps. Modified Paths: -------------- trunk/SKPSProgressController.h trunk/SKPSProgressController.m Modified: trunk/SKPSProgressController.h =================================================================== --- trunk/SKPSProgressController.h 2007-07-12 18:40:55 UTC (rev 2492) +++ trunk/SKPSProgressController.h 2007-07-12 18:58:42 UTC (rev 2493) @@ -59,4 +59,5 @@ NSTask *task; } - (NSData *)PDFDataWithDVIFile:(NSString *)dviFile; +- (IBAction)cancelPS:(id)sender; @end Modified: trunk/SKPSProgressController.m =================================================================== --- trunk/SKPSProgressController.m 2007-07-12 18:40:55 UTC (rev 2492) +++ trunk/SKPSProgressController.m 2007-07-12 18:58:42 UTC (rev 2493) @@ -40,7 +40,6 @@ #import "NSString_SKExtensions.h" enum { - SKConversionCanceled = -1, SKConversionSucceeded = 0, SKConversionFailed = 1 }; @@ -284,6 +283,11 @@ } } +- (IBAction)cancelPS:(id)sender +{ + [super cancel:sender]; +} + - (NSData *)PDFDataWithDVIFile:(NSString *)dviFile { NSMutableData *pdfData = [[NSMutableData alloc] init]; @@ -383,6 +387,14 @@ NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:(id)provider, @"provider", (id)consumer, @"consumer", nil]; + SEL selector = @selector(cancelPS:); + ms = [self methodSignatureForSelector:@selector(setAction)]; + invocation = [NSInvocation invocationWithMethodSignature:ms]; + [invocation setTarget:cancelButton]; + [invocation setSelector:@selector(setAction)]; + [invocation setArgument:&selector atIndex:2]; + [invocation performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:NO]; + [super doConversionWithInfo:dictionary]; CGDataProviderRelease(provider); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-12 18:40:57
|
Revision: 2492 http://skim-app.svn.sourceforge.net/skim-app/?rev=2492&view=rev Author: hofman Date: 2007-07-12 11:40:55 -0700 (Thu, 12 Jul 2007) Log Message: ----------- Allow using different dvi conversion binaries. Currently support for dvipdfmx, dvipdfm, dvipdf and dvips. The last one is followed by a ps->pdf conversion using our PS converter (which is actually the same object) Modified Paths: -------------- trunk/SKPSProgressController.h trunk/SKPSProgressController.m Modified: trunk/SKPSProgressController.h =================================================================== --- trunk/SKPSProgressController.h 2007-07-12 17:39:06 UTC (rev 2491) +++ trunk/SKPSProgressController.h 2007-07-12 18:40:55 UTC (rev 2492) @@ -55,7 +55,7 @@ @end -@interface SKDVIProgressController : SKConversionProgressController { +@interface SKDVIProgressController : SKPSProgressController { NSTask *task; } - (NSData *)PDFDataWithDVIFile:(NSString *)dviFile; Modified: trunk/SKPSProgressController.m =================================================================== --- trunk/SKPSProgressController.m 2007-07-12 17:39:06 UTC (rev 2491) +++ trunk/SKPSProgressController.m 2007-07-12 18:40:55 UTC (rev 2492) @@ -48,6 +48,7 @@ @interface SKConversionProgressController (Private) - (int)runModalConversionInWithInfo:(NSDictionary *)info; - (void)doConversionWithInfo:(NSDictionary *)info; +- (void)stopModalOnMainThread:(BOOL)success; - (void)conversionCompleted:(BOOL)didComplete; - (void)conversionStarted; - (NSString *)fileType; @@ -58,6 +59,8 @@ - (void)showPostScriptConversionMessage:(NSString *)message; @end +#pragma mark Callbacks + static void PSConverterBeginDocumentCallback(void *info) { id delegate = (id)info; @@ -94,6 +97,17 @@ [delegate performSelectorOnMainThread:@selector(showPostScriptConversionMessage:) withObject:(id)message waitUntilDone:NO]; } +CGPSConverterCallbacks SKPSConverterCallbacks = { + 0, + PSConverterBeginDocumentCallback, + PSConverterEndDocumentCallback, + PSConverterBeginPageCallback, /* haven't seen this called in my testing */ + NULL, + NULL, + PSConverterMessageCallback, /* haven't seen this called in my testing */ + NULL +}; + #pragma mark - @implementation SKConversionProgressController @@ -142,7 +156,17 @@ return rv; } -- (void)doConversionWithInfo:(NSDictionary *)info {} +- (void)doConversionWithInfo:(NSDictionary *)info {} + +- (void)stopModalOnMainThread:(BOOL)success { + int val = (success ? SKConversionSucceeded : SKConversionFailed); + NSMethodSignature *ms = [NSApp methodSignatureForSelector:@selector(stopModalWithCode:)]; + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:ms]; + [invocation setTarget:NSApp]; + [invocation setSelector:@selector(stopModalWithCode:)]; + [invocation setArgument:&val atIndex:2]; + [invocation performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:NO]; +} - (NSString *)fileType { return @""; } @@ -174,8 +198,6 @@ - (IBAction)cancel:(id)sender { - [NSApp stopModalWithCode:SKConversionCanceled]; - if (CGPSConverterAbort(converter) == false) { NSBeep(); [textField setStringValue:NSLocalizedString(@"Converter already stopped.", @"PS conversion progress message")]; @@ -188,19 +210,8 @@ { NSAssert(NULL == converter, @"attempted to reenter SKPSProgressController, but this is not supported"); - CGPSConverterCallbacks converterCallbacks = { - 0, - PSConverterBeginDocumentCallback, - PSConverterEndDocumentCallback, - PSConverterBeginPageCallback, /* haven't seen this called in my testing */ - NULL, - NULL, - PSConverterMessageCallback, /* haven't seen this called in my testing */ - NULL - }; - // pass self as info - converter = CGPSConverterCreate((void *)self, &converterCallbacks, NULL); + converter = CGPSConverterCreate((void *)self, &SKPSConverterCallbacks, NULL); NSAssert(converter != NULL, @"unable to create PS converter"); CGDataProviderRef provider = CGDataProviderCreateWithCFData((CFDataRef)psData); @@ -236,15 +247,8 @@ CGDataConsumerRef consumer = (void *)[info objectForKey:@"consumer"]; Boolean success = CGPSConverterConvert(converter, provider, consumer, NULL); - int val = (success ? SKConversionSucceeded : SKConversionFailed); + [self stopModalOnMainThread:success]; - NSMethodSignature *ms = [NSApp methodSignatureForSelector:@selector(stopModalWithCode:)]; - NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:ms]; - [invocation setTarget:NSApp]; - [invocation setSelector:@selector(stopModalWithCode:)]; - [invocation setArgument:&val atIndex:2]; - [invocation performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:NO]; - [pool release]; } @@ -270,13 +274,13 @@ - (IBAction)cancel:(id)sender { - if (task == nil) { + if ([task isRunning]) { + [task terminate]; + } else { NSBeep(); [textField setStringValue:NSLocalizedString(@"Converter already stopped.", @"PS conversion progress message")]; [cancelButton setTitle:NSLocalizedString(@"Close", @"Button title")]; [cancelButton setAction:@selector(close:)]; - } else { - [task terminate]; } } @@ -302,24 +306,28 @@ - (void)doConversionWithInfo:(NSDictionary *)info { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + NSString *dviFile = [info objectForKey:@"dviFile"]; - NSString *dvipdfmxPath = [[NSUserDefaults standardUserDefaults] stringForKey:@"SKDvipdfmxBinaryPath"]; + NSString *commandPath = [[NSUserDefaults standardUserDefaults] stringForKey:@"SKDviConverterBinary"]; + NSString *commandName = commandPath ? [commandPath lastPathComponent] : @"dvips"; NSFileManager *fm = [NSFileManager defaultManager]; NSArray *paths = [NSArray arrayWithObjects:@"/usr/texbin", @"/usr/local/teTeX/bin/powerpc-apple-darwin-current", @"/sw/bin", @"/opt/local/bin", @"/usr/local/bin", nil]; int i = 0, count = [paths count]; - while ([fm isExecutableFileAtPath:dvipdfmxPath] == NO) { - if (i < count) { - dvipdfmxPath = [[paths objectAtIndex:i++] stringByAppendingPathComponent:@"dvipdfmx"]; - } else { - dvipdfmxPath = nil; - break; - } + NSAssert1(commandName == nil || [commandName isEqualToString:@"dvips"] || [commandName isEqualToString:@"dvipdf"] || [commandName isEqualToString:@"dvipdfm"] || [commandName isEqualToString:@"dvipdfmx"], @"DVI converter %@ is not supported", commandName); + + while ([fm isExecutableFileAtPath:commandPath] == NO) { + if (i < count) + commandPath = [[paths objectAtIndex:i++] stringByAppendingPathComponent:commandName]; + else + commandPath = nil; } NSString *tmpDir = NSTemporaryDirectory(); - NSString *pdfFile = [tmpDir stringByAppendingPathComponent:[[dviFile lastPathComponent] stringByReplacingPathExtension:@"pdf"]]; - BOOL success = dvipdfmxPath != nil && [fm fileExistsAtPath:dviFile]; + BOOL outputPS = [commandName isEqualToString:@"dvips"]; + NSString *outFile = [tmpDir stringByAppendingPathComponent:[[dviFile lastPathComponent] stringByReplacingPathExtension:outputPS ? @"ps" : @"pdf"]]; + NSArray *arguments = [commandName isEqualToString:@"dvipdf"] ? [NSArray arrayWithObjects:dviFile, outFile, nil] : [NSArray arrayWithObjects:@"-o", outFile, dviFile, nil]; + BOOL success = commandPath != nil && [fm fileExistsAtPath:dviFile]; NSMethodSignature *ms; NSInvocation *invocation; @@ -329,8 +337,8 @@ [fm createDirectoryAtPath:tmpDir attributes:nil]; task = [[NSTask alloc] init]; - [task setLaunchPath:dvipdfmxPath]; - [task setArguments:[NSArray arrayWithObjects:@"-o", pdfFile, dviFile, nil]]; + [task setLaunchPath:commandPath]; + [task setArguments:arguments]; [task setCurrentDirectoryPath:[dviFile stringByDeletingLastPathComponent]]; [task setStandardError:[NSFileHandle fileHandleWithNullDevice]]; @@ -360,24 +368,40 @@ [task release]; task = nil; - if (success) - [[info objectForKey:@"pdfData"] setData:[NSData dataWithContentsOfFile:pdfFile]]; - [fm removeFileAtPath:tmpDir handler:nil]; + NSData *outData = success ? [NSData dataWithContentsOfFile:outFile] : nil; + NSMutableData *pdfData = [info objectForKey:@"pdfData"]; - ms = [self methodSignatureForSelector:@selector(conversionCompleted:)]; - invocation = [NSInvocation invocationWithMethodSignature:ms]; - [invocation setTarget:self]; - [invocation setSelector:@selector(conversionCompleted:)]; - [invocation setArgument:&success atIndex:2]; - [invocation performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:NO]; + if (outputPS && success) { + NSAssert(NULL == converter, @"attempted to reenter SKPSProgressController, but this is not supported"); + + // pass self as info + converter = CGPSConverterCreate((void *)self, &SKPSConverterCallbacks, NULL); + NSAssert(converter != NULL, @"unable to create PS converter"); + + CGDataProviderRef provider = CGDataProviderCreateWithCFData((CFDataRef)outData); + CGDataConsumerRef consumer = CGDataConsumerCreateWithCFData((CFMutableDataRef)pdfData); + + NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:(id)provider, @"provider", (id)consumer, @"consumer", nil]; + + [super doConversionWithInfo:dictionary]; + + CGDataProviderRelease(provider); + CGDataConsumerRelease(consumer); + } else { + if (success) + [pdfData setData:outData]; + + ms = [self methodSignatureForSelector:@selector(conversionCompleted:)]; + invocation = [NSInvocation invocationWithMethodSignature:ms]; + [invocation setTarget:self]; + [invocation setSelector:@selector(conversionCompleted:)]; + [invocation setArgument:&success atIndex:2]; + [invocation performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:NO]; + + [self stopModalOnMainThread:success]; + } - int val = (success ? SKConversionSucceeded : SKConversionFailed); - ms = [NSApp methodSignatureForSelector:@selector(stopModalWithCode:)]; - invocation = [NSInvocation invocationWithMethodSignature:ms]; - [invocation setTarget:NSApp]; - [invocation setSelector:@selector(stopModalWithCode:)]; - [invocation setArgument:&val atIndex:2]; - [invocation performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:NO]; + [fm removeFileAtPath:tmpDir handler:nil]; [pool release]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ama...@us...> - 2007-07-12 17:39:08
|
Revision: 2491 http://skim-app.svn.sourceforge.net/skim-app/?rev=2491&view=rev Author: amaxwell Date: 2007-07-12 10:39:06 -0700 (Thu, 12 Jul 2007) Log Message: ----------- make sure nil data is not passed to NSXMLDocument Modified Paths: -------------- trunk/vendorsrc/andymatuschak/Sparkle/SUAppcast.m Modified: trunk/vendorsrc/andymatuschak/Sparkle/SUAppcast.m =================================================================== --- trunk/vendorsrc/andymatuschak/Sparkle/SUAppcast.m 2007-07-12 17:14:18 UTC (rev 2490) +++ trunk/vendorsrc/andymatuschak/Sparkle/SUAppcast.m 2007-07-12 17:39:06 UTC (rev 2491) @@ -46,7 +46,11 @@ NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:60.0]; NSURLResponse *response = nil; NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; - NSXMLDocument *document = [[NSXMLDocument alloc] initWithData:data options:0 error:&error]; + NSXMLDocument *document = nil; + + if (data) + [[NSXMLDocument alloc] initWithData:data options:0 error:&error]; + BOOL failed = NO; if (nil == document) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-12 17:14:21
|
Revision: 2490 http://skim-app.svn.sourceforge.net/skim-app/?rev=2490&view=rev Author: hofman Date: 2007-07-12 10:14:18 -0700 (Thu, 12 Jul 2007) Log Message: ----------- Avoid dirtying the document when setting the print info, as we don't save that. Modified Paths: -------------- trunk/SKDocument.m Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-07-12 16:55:54 UTC (rev 2489) +++ trunk/SKDocument.m 2007-07-12 17:14:18 UTC (rev 2490) @@ -950,6 +950,11 @@ return data; } +- (void)setPrintInfo:(NSPrintInfo *)printInfo { + [super setPrintInfo:printInfo]; + [self updateChangeCount:[[self undoManager] isUndoing] ? NSChangeDone : NSChangeUndone]; +} + #pragma mark Scripting support - (unsigned int)countOfPages { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-12 16:55:56
|
Revision: 2489 http://skim-app.svn.sourceforge.net/skim-app/?rev=2489&view=rev Author: hofman Date: 2007-07-12 09:55:54 -0700 (Thu, 12 Jul 2007) Log Message: ----------- Set page orientation to Landscape when the first page is wider than higher. Modified Paths: -------------- trunk/SKDocument.m Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-07-12 12:47:26 UTC (rev 2488) +++ trunk/SKDocument.m 2007-07-12 16:55:54 UTC (rev 2489) @@ -105,6 +105,14 @@ - (void)windowControllerDidLoadNib:(NSWindowController *)aController{ SKMainWindowController *mainController = (SKMainWindowController *)aController; + if ([pdfDocument pageCount]) { + NSPrintInfo *printInfo = [self printInfo]; + NSSize paperSize = [printInfo paperSize]; + NSSize pageSize = [[pdfDocument pageAtIndex:0] boundsForBox:kPDFDisplayBoxMediaBox].size; + if ((pageSize.width > pageSize.height) != (paperSize.width > paperSize.height)) + [printInfo setOrientation:NSLandscapeOrientation]; + } + [mainController setPdfDocument:pdfDocument]; [self setPDFDoc:nil]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-12 12:47:27
|
Revision: 2488 http://skim-app.svn.sourceforge.net/skim-app/?rev=2488&view=rev Author: hofman Date: 2007-07-12 05:47:26 -0700 (Thu, 12 Jul 2007) Log Message: ----------- Use NSUnarchiveFromData transformer for binding of some color preferences. Modified Paths: -------------- trunk/Italian.lproj/PreferenceWindow.nib/keyedobjects.nib Modified: trunk/Italian.lproj/PreferenceWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-12 12:38:25
|
Revision: 2487 http://skim-app.svn.sourceforge.net/skim-app/?rev=2487&view=rev Author: hofman Date: 2007-07-12 05:38:22 -0700 (Thu, 12 Jul 2007) Log Message: ----------- Interpret nil number as zero number for lineWidth; [nil floatValue] is undefined. Modified Paths: -------------- trunk/SKLineInspector.m Modified: trunk/SKLineInspector.m =================================================================== --- trunk/SKLineInspector.m 2007-07-12 09:16:07 UTC (rev 2486) +++ trunk/SKLineInspector.m 2007-07-12 12:38:22 UTC (rev 2487) @@ -479,9 +479,9 @@ - (void)setAnnotationStyle:(PDFAnnotation *)annotation { NSString *type = [annotation type]; if ([type isEqualToString:@"FreeText"] || [type isEqualToString:@"Circle"] || [type isEqualToString:@"Square"] || [type isEqualToString:@"Line"]) { - [self setLineWidth:[[annotation border] lineWidth]]; + [self setLineWidth:[annotation border] ? [[annotation border] lineWidth] : 0.0]; [self setDashPattern:[[annotation border] dashPattern]]; - [self setStyle:[[annotation border] style]]; + [self setStyle:[annotation border] ? [[annotation border] style] : 0]; } if ([type isEqualToString:@"Line"]) { [self setStartLineStyle:[(PDFAnnotationLine *)annotation startLineStyle]]; @@ -490,8 +490,9 @@ } - (void)setNilValueForKey:(NSString *)key { - if ([key isEqualToString:@"lineWidth"] || [key isEqualToString:@"style"] || - [key isEqualToString:@"startLineStyle"] || [key isEqualToString:@"endLineStyle"]) { + if ([key isEqualToString:@"lineWidth"]) { + [self setValue:[NSNumber numberWithFloat:0.0] forKey:key]; + } else if ([key isEqualToString:@"style"] || [key isEqualToString:@"startLineStyle"] || [key isEqualToString:@"endLineStyle"]) { [self setValue:[NSNumber numberWithInt:0] forKey:key]; } else { [super setNilValueForKey:key]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-12 09:35:55
|
Revision: 2486 http://skim-app.svn.sourceforge.net/skim-app/?rev=2486&view=rev Author: hofman Date: 2007-07-12 02:16:07 -0700 (Thu, 12 Jul 2007) Log Message: ----------- Updated version for help. Should be in release, but luckily it's not used (I hate xcode). Modified Paths: -------------- trunk/Dutch.lproj/Skim Help/version.texi trunk/Italian.lproj/Skim Help/version.texi Modified: trunk/Dutch.lproj/Skim Help/version.texi =================================================================== --- trunk/Dutch.lproj/Skim Help/version.texi 2007-07-12 08:18:43 UTC (rev 2485) +++ trunk/Dutch.lproj/Skim Help/version.texi 2007-07-12 09:16:07 UTC (rev 2486) @@ -1 +1 @@ -@set VERSION 0.5 +@set VERSION 0.5.1 Modified: trunk/Italian.lproj/Skim Help/version.texi =================================================================== --- trunk/Italian.lproj/Skim Help/version.texi 2007-07-12 08:18:43 UTC (rev 2485) +++ trunk/Italian.lproj/Skim Help/version.texi 2007-07-12 09:16:07 UTC (rev 2486) @@ -1 +1 @@ -@set VERSION 0.5 +@set VERSION 0.5.1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-12 08:18:44
|
Revision: 2485 http://skim-app.svn.sourceforge.net/skim-app/?rev=2485&view=rev Author: hofman Date: 2007-07-12 01:18:43 -0700 (Thu, 12 Jul 2007) Log Message: ----------- Tag for release. Added Paths: ----------- tags/REL_0_5_1/ Copied: tags/REL_0_5_1 (from rev 2484, trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-12 08:18:02
|
Revision: 2484 http://skim-app.svn.sourceforge.net/skim-app/?rev=2484&view=rev Author: hofman Date: 2007-07-12 01:17:59 -0700 (Thu, 12 Jul 2007) Log Message: ----------- Update version and release notes for release. Modified Paths: -------------- trunk/Dutch.lproj/InfoPlist.strings trunk/English.lproj/InfoPlist.strings trunk/English.lproj/Skim Help/version.texi trunk/Info.plist trunk/Italian.lproj/InfoPlist.strings trunk/ReleaseNotes.rtf Modified: trunk/Dutch.lproj/InfoPlist.strings =================================================================== (Binary files differ) Modified: trunk/English.lproj/InfoPlist.strings =================================================================== (Binary files differ) Modified: trunk/English.lproj/Skim Help/version.texi =================================================================== --- trunk/English.lproj/Skim Help/version.texi 2007-07-12 07:50:23 UTC (rev 2483) +++ trunk/English.lproj/Skim Help/version.texi 2007-07-12 08:17:59 UTC (rev 2484) @@ -1 +1 @@ -@set VERSION 0.5 +@set VERSION 0.5.1 Modified: trunk/Info.plist =================================================================== --- trunk/Info.plist 2007-07-12 07:50:23 UTC (rev 2483) +++ trunk/Info.plist 2007-07-12 08:17:59 UTC (rev 2484) @@ -312,11 +312,11 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>0.5</string> + <string>0.5.1</string> <key>CFBundleSignature</key> <string>SKIM</string> <key>CFBundleVersion</key> - <string>v6</string> + <string>v7</string> <key>LSMinimumSystemVersion</key> <string>10.4.0</string> <key>NSAppleScriptEnabled</key> Modified: trunk/Italian.lproj/InfoPlist.strings =================================================================== (Binary files differ) Modified: trunk/ReleaseNotes.rtf =================================================================== --- trunk/ReleaseNotes.rtf 2007-07-12 07:50:23 UTC (rev 2483) +++ trunk/ReleaseNotes.rtf 2007-07-12 08:17:59 UTC (rev 2484) @@ -93,8 +93,9 @@ {\list\listtemplateid89\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid89} {\list\listtemplateid90\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid90} {\list\listtemplateid91\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid91} -{\list\listtemplateid92\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid92}} -{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}{\listoverride\listid6\listoverridecount0\ls6}{\listoverride\listid7\listoverridecount0\ls7}{\listoverride\listid8\listoverridecount0\ls8}{\listoverride\listid9\listoverridecount0\ls9}{\listoverride\listid10\listoverridecount0\ls10}{\listoverride\listid11\listoverridecount0\ls11}{\listoverride\listid12\listoverridecount0\ls12}{\listoverride\listid13\listoverridecount0\ls13}{\listoverride\listid14\listoverridecount0\ls14}{\listoverride\listid15\listoverridecount0\ls15}{\listoverride\listid16\listoverridecount0\ls16}{\listoverride\listid17\listoverridecount0\ls17}{\listoverride\listid18\listoverridecount0\ls18}{\listoverride\listid19\listoverridecount0\ls19}{\listoverride\listid20\listoverridecount0\ls20}{\listoverride\listid21\listoverridecount0\ls21}{\listoverride\listid22\listoverridecount0\ls22}{\listoverride\listid23\listoverridecount0\ls23}{\listoverride\listid24\listoverridecount0\ls24}{\listoverride\listid25\listoverridecount0\ls25}{\listoverride\listid26\listoverridecount0\ls26}{\listoverride\listid27\listoverridecount0\ls27}{\listoverride\listid28\listoverridecount0\ls28}{\listoverride\listid29\listoverridecount0\ls29}{\listoverride\listid30\listoverridecount0\ls30}{\listoverride\listid31\listoverridecount0\ls31}{\listoverride\listid32\listoverridecount0\ls32}{\listoverride\listid33\listoverridecount0\ls33}{\listoverride\listid34\listoverridecount0\ls34}{\listoverride\listid35\listoverridecount0\ls35}{\listoverride\listid36\listoverridecount0\ls36}{\listoverride\listid37\listoverridecount0\ls37}{\listoverride\listid38\listoverridecount0\ls38}{\listoverride\listid39\listoverridecount0\ls39}{\listoverride\listid40\listoverridecount0\ls40}{\listoverride\listid41\listoverridecount0\ls41}{\listoverride\listid42\listoverridecount0\ls42}{\listoverride\listid43\listoverridecount0\ls43}{\listoverride\listid44\listoverridecount0\ls44}{\listoverride\listid45\listoverridecount0\ls45}{\listoverride\listid46\listoverridecount0\ls46}{\listoverride\listid47\listoverridecount0\ls47}{\listoverride\listid48\listoverridecount0\ls48}{\listoverride\listid49\listoverridecount0\ls49}{\listoverride\listid50\listoverridecount0\ls50}{\listoverride\listid51\listoverridecount0\ls51}{\listoverride\listid52\listoverridecount0\ls52}{\listoverride\listid53\listoverridecount0\ls53}{\listoverride\listid54\listoverridecount0\ls54}{\listoverride\listid55\listoverridecount0\ls55}{\listoverride\listid56\listoverridecount0\ls56}{\listoverride\listid57\listoverridecount0\ls57}{\listoverride\listid58\listoverridecount0\ls58}{\listoverride\listid59\listoverridecount0\ls59}{\listoverride\listid60\listoverridecount0\ls60}{\listoverride\listid61\listoverridecount0\ls61}{\listoverride\listid62\listoverridecount0\ls62}{\listoverride\listid63\listoverridecount0\ls63}{\listoverride\listid64\listoverridecount0\ls64}{\listoverride\listid65\listoverridecount0\ls65}{\listoverride\listid66\listoverridecount0\ls66}{\listoverride\listid67\listoverridecount0\ls67}{\listoverride\listid68\listoverridecount0\ls68}{\listoverride\listid69\listoverridecount0\ls69}{\listoverride\listid70\listoverridecount0\ls70}{\listoverride\listid71\listoverridecount0\ls71}{\listoverride\listid72\listoverridecount0\ls72}{\listoverride\listid73\listoverridecount0\ls73}{\listoverride\listid74\listoverridecount0\ls74}{\listoverride\listid75\listoverridecount0\ls75}{\listoverride\listid76\listoverridecount0\ls76}{\listoverride\listid77\listoverridecount0\ls77}{\listoverride\listid78\listoverridecount0\ls78}{\listoverride\listid79\listoverridecount0\ls79}{\listoverride\listid80\listoverridecount0\ls80}{\listoverride\listid81\listoverridecount0\ls81}{\listoverride\listid82\listoverridecount0\ls82}{\listoverride\listid83\listoverridecount0\ls83}{\listoverride\listid84\listoverridecount0\ls84}{\listoverride\listid85\listoverridecount0\ls85}{\listoverride\listid86\listoverridecount0\ls86}{\listoverride\listid87\listoverridecount0\ls87}{\listoverride\listid88\listoverridecount0\ls88}{\listoverride\listid89\listoverridecount0\ls89}{\listoverride\listid90\listoverridecount0\ls90}{\listoverride\listid91\listoverridecount0\ls91}{\listoverride\listid92\listoverridecount0\ls92}} +{\list\listtemplateid92\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid92} +{\list\listtemplateid93\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid93}} +{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}{\listoverride\listid6\listoverridecount0\ls6}{\listoverride\listid7\listoverridecount0\ls7}{\listoverride\listid8\listoverridecount0\ls8}{\listoverride\listid9\listoverridecount0\ls9}{\listoverride\listid10\listoverridecount0\ls10}{\listoverride\listid11\listoverridecount0\ls11}{\listoverride\listid12\listoverridecount0\ls12}{\listoverride\listid13\listoverridecount0\ls13}{\listoverride\listid14\listoverridecount0\ls14}{\listoverride\listid15\listoverridecount0\ls15}{\listoverride\listid16\listoverridecount0\ls16}{\listoverride\listid17\listoverridecount0\ls17}{\listoverride\listid18\listoverridecount0\ls18}{\listoverride\listid19\listoverridecount0\ls19}{\listoverride\listid20\listoverridecount0\ls20}{\listoverride\listid21\listoverridecount0\ls21}{\listoverride\listid22\listoverridecount0\ls22}{\listoverride\listid23\listoverridecount0\ls23}{\listoverride\listid24\listoverridecount0\ls24}{\listoverride\listid25\listoverridecount0\ls25}{\listoverride\listid26\listoverridecount0\ls26}{\listoverride\listid27\listoverridecount0\ls27}{\listoverride\listid28\listoverridecount0\ls28}{\listoverride\listid29\listoverridecount0\ls29}{\listoverride\listid30\listoverridecount0\ls30}{\listoverride\listid31\listoverridecount0\ls31}{\listoverride\listid32\listoverridecount0\ls32}{\listoverride\listid33\listoverridecount0\ls33}{\listoverride\listid34\listoverridecount0\ls34}{\listoverride\listid35\listoverridecount0\ls35}{\listoverride\listid36\listoverridecount0\ls36}{\listoverride\listid37\listoverridecount0\ls37}{\listoverride\listid38\listoverridecount0\ls38}{\listoverride\listid39\listoverridecount0\ls39}{\listoverride\listid40\listoverridecount0\ls40}{\listoverride\listid41\listoverridecount0\ls41}{\listoverride\listid42\listoverridecount0\ls42}{\listoverride\listid43\listoverridecount0\ls43}{\listoverride\listid44\listoverridecount0\ls44}{\listoverride\listid45\listoverridecount0\ls45}{\listoverride\listid46\listoverridecount0\ls46}{\listoverride\listid47\listoverridecount0\ls47}{\listoverride\listid48\listoverridecount0\ls48}{\listoverride\listid49\listoverridecount0\ls49}{\listoverride\listid50\listoverridecount0\ls50}{\listoverride\listid51\listoverridecount0\ls51}{\listoverride\listid52\listoverridecount0\ls52}{\listoverride\listid53\listoverridecount0\ls53}{\listoverride\listid54\listoverridecount0\ls54}{\listoverride\listid55\listoverridecount0\ls55}{\listoverride\listid56\listoverridecount0\ls56}{\listoverride\listid57\listoverridecount0\ls57}{\listoverride\listid58\listoverridecount0\ls58}{\listoverride\listid59\listoverridecount0\ls59}{\listoverride\listid60\listoverridecount0\ls60}{\listoverride\listid61\listoverridecount0\ls61}{\listoverride\listid62\listoverridecount0\ls62}{\listoverride\listid63\listoverridecount0\ls63}{\listoverride\listid64\listoverridecount0\ls64}{\listoverride\listid65\listoverridecount0\ls65}{\listoverride\listid66\listoverridecount0\ls66}{\listoverride\listid67\listoverridecount0\ls67}{\listoverride\listid68\listoverridecount0\ls68}{\listoverride\listid69\listoverridecount0\ls69}{\listoverride\listid70\listoverridecount0\ls70}{\listoverride\listid71\listoverridecount0\ls71}{\listoverride\listid72\listoverridecount0\ls72}{\listoverride\listid73\listoverridecount0\ls73}{\listoverride\listid74\listoverridecount0\ls74}{\listoverride\listid75\listoverridecount0\ls75}{\listoverride\listid76\listoverridecount0\ls76}{\listoverride\listid77\listoverridecount0\ls77}{\listoverride\listid78\listoverridecount0\ls78}{\listoverride\listid79\listoverridecount0\ls79}{\listoverride\listid80\listoverridecount0\ls80}{\listoverride\listid81\listoverridecount0\ls81}{\listoverride\listid82\listoverridecount0\ls82}{\listoverride\listid83\listoverridecount0\ls83}{\listoverride\listid84\listoverridecount0\ls84}{\listoverride\listid85\listoverridecount0\ls85}{\listoverride\listid86\listoverridecount0\ls86}{\listoverride\listid87\listoverridecount0\ls87}{\listoverride\listid88\listoverridecount0\ls88}{\listoverride\listid89\listoverridecount0\ls89}{\listoverride\listid90\listoverridecount0\ls90}{\listoverride\listid91\listoverridecount0\ls91}{\listoverride\listid92\listoverridecount0\ls92}{\listoverride\listid93\listoverridecount0\ls93}} \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f0\fs60 \cf0 Skim Release Notes\ @@ -118,15 +119,17 @@ {\listtext \'a5 }Added an optional status bar, displaying the page number, number and pages, as well as informatino about the tool mode, if it applies.\ {\listtext \'a5 }You can now print documents from AppleScript.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls2\ilvl0\cf0 {\listtext \'a5 }Separated AppleScript support for pdfsync from the open command.\ +\ls2\ilvl0\cf0 {\listtext \'a5 }Pdfsync from AppleScript now goes separately through the go command instead of the open command.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls3\ilvl0\cf0 {\listtext \'a5 }You can now quickly rotate through tool modes using Shift-modified arrow keys.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \f2\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f3\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls3\ilvl0 +\ls4\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Prevent chaching of update info for updater.\ {\listtext \'a5 }Fix the default text export templates.\ {\listtext \'a5 }Allow other active application windows in front of Skim in presentation mode.\ @@ -149,7 +152,7 @@ \f3\i\fs26 \cf0 New Features\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls4\ilvl0 +\ls5\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }You can now hide all notes and highlights.\ {\listtext \'a5 }Remember last exported type.\ {\listtext \'a5 }Keyboard shortcut for Export.\ @@ -167,13 +170,13 @@ {\listtext \'a5 }You can now change the icon type of anchored notes from the note's window to some standard proofreader marks.\ {\listtext \'a5 }Hidden default for icon type of anchored notes (SKAnchoredNoteiconType).\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls5\ilvl0\cf0 {\listtext \'a5 }Skim now saves the file type and creator code.\ +\ls6\ilvl0\cf0 {\listtext \'a5 }Skim now saves the file type and creator code.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls6\ilvl0\cf0 {\listtext \'a5 }The reading bar is now shown on the thumbnails.\ +\ls7\ilvl0\cf0 {\listtext \'a5 }The reading bar is now shown on the thumbnails.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls7\ilvl0\cf0 {\listtext \'a5 }Add border/line properties to circle, box, text and line notes. Accessible through a new inspector panel and AppleScript.\ +\ls8\ilvl0\cf0 {\listtext \'a5 }Add border/line properties to circle, box, text and line notes. Accessible through a new inspector panel and AppleScript.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls8\ilvl0\cf0 {\listtext \'a5 }Allow setting the interior (fill) color for circles and boxes. Select the check button at the bottom of the color panel.\ +\ls9\ilvl0\cf0 {\listtext \'a5 }Allow setting the interior (fill) color for circles and boxes. Select the check button at the bottom of the color panel.\ {\listtext \'a5 }Add a TeX editor perset for LyX.\ {\listtext \'a5 }You can now reopen snapshots from a previous run.\ {\listtext \'a5 }New preferences for line styles and interior colors.\ @@ -188,7 +191,7 @@ \f3\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls9\ilvl0 +\ls10\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Use old-style check for network availability for the updater, as the newer API is not reliable for dial-up connections.\ {\listtext \'a5 }Never add a new note on a click in note tool mode, because undoing such an addition can also remove a text edit in progress.\ {\listtext \'a5 }Update the window title when the document is reloaded; the number of pages can change. \ @@ -198,7 +201,7 @@ {\listtext \'a5 }Add help about cropping pages.\ {\listtext \'a5 }Start and end points for arrow notes in AppleScript are now relative to the page, and changing them automatically changes the bounds.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls10\ilvl0\cf0 {\listtext \'a5 }The side panels in full screen mode are now hidden when you switch to another application.\ +\ls11\ilvl0\cf0 {\listtext \'a5 }The side panels in full screen mode are now hidden when you switch to another application.\ {\listtext \'a5 }Renamed "Arrow" to "Line", as it now allows more general line styles. Also change some keyboard shortcuts.\ {\listtext \'a5 }Enable Password menu item for encrypted files that are flagged as unlocked, as the latter is unreliable in PDFKit.\ {\listtext \'a5 }Fix tab-loop for PDFs with fiallable forms. Also add some help about fillable forms.\ @@ -221,7 +224,7 @@ \f3\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls11\ilvl0 +\ls12\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Fixed installation of new versions by updater.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural @@ -233,50 +236,50 @@ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 New Features\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls12\ilvl0 +\ls13\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Add a menu item in the Help menu to visit the web site.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls13\ilvl0\cf0 {\listtext \'a5 }Add single-character shortcuts to change the note style in note mode (t, n, c, b, h, u, s, a).\ +\ls14\ilvl0\cf0 {\listtext \'a5 }Add single-character shortcuts to change the note style in note mode (t, n, c, b, h, u, s, a).\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls14\ilvl0\cf0 {\listtext \'a5 }Fix PDFSync support to work with file names containing spaces.\ +\ls15\ilvl0\cf0 {\listtext \'a5 }Fix PDFSync support to work with file names containing spaces.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls15\ilvl0\cf0 {\listtext \'a5 }Add hidden default for activation of navigation buttons in presentation mode (SKActivatePresentationNavigationAtBottom).\ +\ls16\ilvl0\cf0 {\listtext \'a5 }Add hidden default for activation of navigation buttons in presentation mode (SKActivatePresentationNavigationAtBottom).\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls16\ilvl0\cf0 {\listtext \'a5 }Start search using the find panel at the current page when there is no selection.\ +\ls17\ilvl0\cf0 {\listtext \'a5 }Start search using the find panel at the current page when there is no selection.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls17\ilvl0\cf0 {\listtext \'a5 }Wrap selection using the find panel.\ +\ls18\ilvl0\cf0 {\listtext \'a5 }Wrap selection using the find panel.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls18\ilvl0\cf0 {\listtext \'a5 }Add support for apple remote control. It can be disabled through the hidden default SKEnableAppleRemote.\ +\ls19\ilvl0\cf0 {\listtext \'a5 }Add support for apple remote control. It can be disabled through the hidden default SKEnableAppleRemote.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls19\ilvl0\cf0 {\listtext \'a5 }Hidden defaults for line ending style of arrows (SKLineNoteStartLineStyle, SKLineNoteEndLineStyle).\ +\ls20\ilvl0\cf0 {\listtext \'a5 }Hidden defaults for line ending style of arrows (SKLineNoteStartLineStyle, SKLineNoteEndLineStyle).\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls20\ilvl0\cf0 {\listtext \'a5 }Hidden pref option for reading missing notes from separate .skim file (SKReadMissingNotesFromSkimFileOption). \ +\ls21\ilvl0\cf0 {\listtext \'a5 }Hidden pref option for reading missing notes from separate .skim file (SKReadMissingNotesFromSkimFileOption). \ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls21\ilvl0\cf0 {\listtext \'a5 }You can now open the corresponding PDF from a Skim Notes document.\ +\ls22\ilvl0\cf0 {\listtext \'a5 }You can now open the corresponding PDF from a Skim Notes document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls22\ilvl0\cf0 {\listtext \'a5 }Skim can now read TIFF images from the clipboard.\ +\ls23\ilvl0\cf0 {\listtext \'a5 }Skim can now read TIFF images from the clipboard.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls23\ilvl0\cf0 {\listtext \'a5 }New select tool. Allows you to copy PDF and TIFF images from a section of a page.\ +\ls24\ilvl0\cf0 {\listtext \'a5 }New select tool. Allows you to copy PDF and TIFF images from a section of a page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls24\ilvl0\cf0 {\listtext \'a5 }You can now search Skim note files from Spotlight.\ +\ls25\ilvl0\cf0 {\listtext \'a5 }You can now search Skim note files from Spotlight.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls25\ilvl0\cf0 {\listtext \'a5 }New Crop menu items and toolbar button.\ +\ls26\ilvl0\cf0 {\listtext \'a5 }New Crop menu items and toolbar button.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls26\ilvl0\cf0 {\listtext \'a5 }Cropping and page rotation are now undoable.\ +\ls27\ilvl0\cf0 {\listtext \'a5 }Cropping and page rotation are now undoable.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls27\ilvl0\cf0 {\listtext \'a5 }Allow reverting a document when it has changed on disk.\ +\ls28\ilvl0\cf0 {\listtext \'a5 }Allow reverting a document when it has changed on disk.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls28\ilvl0\cf0 {\listtext \'a5 }New menu item to set the selection from the content of the page.\ +\ls29\ilvl0\cf0 {\listtext \'a5 }New menu item to set the selection from the content of the page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls29\ilvl0\cf0 {\listtext \'a5 }Hidden defaults for automatic crop box margins (SKAutoCropBoxMarginWidth, SKAutoCropBoxMarginHeight).\ +\ls30\ilvl0\cf0 {\listtext \'a5 }Hidden defaults for automatic crop box margins (SKAutoCropBoxMarginWidth, SKAutoCropBoxMarginHeight).\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls30\ilvl0\cf0 {\listtext \'a5 }New Zoom To Selection menu item and toolbar button.\ +\ls31\ilvl0\cf0 {\listtext \'a5 }New Zoom To Selection menu item and toolbar button.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls31\ilvl0\cf0 {\listtext \'a5 }New preference option to open files fit to the PDF.\ +\ls32\ilvl0\cf0 {\listtext \'a5 }New preference option to open files fit to the PDF.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls32\ilvl0\cf0 {\listtext \'a5 }You can now join markup highlights using shift-click, or by selecting a highlight before adding a new one.\ +\ls33\ilvl0\cf0 {\listtext \'a5 }You can now join markup highlights using shift-click, or by selecting a highlight before adding a new one.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls33\ilvl0\cf0 {\listtext \'a5 }You can now supply templates for text export of notes. See the wiki for more information.\ +\ls34\ilvl0\cf0 {\listtext \'a5 }You can now supply templates for text export of notes. See the wiki for more information.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \f2\b\fs28 \cf0 \ @@ -284,26 +287,26 @@ \f3\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls34\ilvl0 +\ls35\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Fix links in help.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls35\ilvl0\cf0 {\listtext \'a5 }Don't create a new note in note tool mode on mousedown outside a page.\ +\ls36\ilvl0\cf0 {\listtext \'a5 }Don't create a new note in note tool mode on mousedown outside a page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls36\ilvl0\cf0 {\listtext \'a5 }Don't add new resizable notes in note tool mode when just clicking.\ +\ls37\ilvl0\cf0 {\listtext \'a5 }Don't add new resizable notes in note tool mode when just clicking.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls37\ilvl0\cf0 {\listtext \'a5 }You can now access links that are "hidden" by transparent highlights and arrows.\ +\ls38\ilvl0\cf0 {\listtext \'a5 }You can now access links that are "hidden" by transparent highlights and arrows.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls38\ilvl0\cf0 {\listtext \'a5 }Scroll reading bar to visible when it is shown.\ +\ls39\ilvl0\cf0 {\listtext \'a5 }Scroll reading bar to visible when it is shown.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls39\ilvl0\cf0 {\listtext \'a5 }Scroll to previous position on page when reloading PDF.\ +\ls40\ilvl0\cf0 {\listtext \'a5 }Scroll to previous position on page when reloading PDF.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls40\ilvl0\cf0 {\listtext \'a5 }Escape spaces in TeX editor command.\ +\ls41\ilvl0\cf0 {\listtext \'a5 }Escape spaces in TeX editor command.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls41\ilvl0\cf0 {\listtext \'a5 }Thumbnails now use the current display box.\ +\ls42\ilvl0\cf0 {\listtext \'a5 }Thumbnails now use the current display box.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls42\ilvl0\cf0 {\listtext \'a5 }Retry automatic reloading of files changed on disk a few times.\ +\ls43\ilvl0\cf0 {\listtext \'a5 }Retry automatic reloading of files changed on disk a few times.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls42\ilvl0 +\ls43\ilvl0 \f2\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Changes since 0.2\ @@ -313,74 +316,74 @@ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 New Features\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls43\ilvl0 +\ls44\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Add shortcuts for bigger/smaller font sizes.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls44\ilvl0\cf0 {\listtext \'a5 }Command-click a snapshot.\ +\ls45\ilvl0\cf0 {\listtext \'a5 }Command-click a snapshot.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls45\ilvl0\cf0 {\listtext \'a5 }We now print notes and highlights.\ +\ls46\ilvl0\cf0 {\listtext \'a5 }We now print notes and highlights.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls46\ilvl0\cf0 {\listtext \'a5 }Add copy/cut/paste items to the contextual menu, when they apply.\ +\ls47\ilvl0\cf0 {\listtext \'a5 }Add copy/cut/paste items to the contextual menu, when they apply.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls47\ilvl0\cf0 {\listtext \'a5 }You can now make a snapshot of a page by Command-clicking a thumbnail.\ +\ls48\ilvl0\cf0 {\listtext \'a5 }You can now make a snapshot of a page by Command-clicking a thumbnail.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls48\ilvl0\cf0 {\listtext \'a5 }Added Dutch localization.\ +\ls49\ilvl0\cf0 {\listtext \'a5 }Added Dutch localization.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls49\ilvl0\cf0 {\listtext \'a5 }We now do not leave Full Screen when switching to another application.\ +\ls50\ilvl0\cf0 {\listtext \'a5 }We now do not leave Full Screen when switching to another application.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls50\ilvl0\cf0 {\listtext \'a5 }Export notes as RTF.\ +\ls51\ilvl0\cf0 {\listtext \'a5 }Export notes as RTF.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls51\ilvl0\cf0 {\listtext \'a5 }Add preference options for default note/highlight colors and text note font.\ +\ls52\ilvl0\cf0 {\listtext \'a5 }Add preference options for default note/highlight colors and text note font.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls52\ilvl0\cf0 {\listtext \'a5 }Add menu item to save the current PDF display settings to be used for new documents.\ +\ls53\ilvl0\cf0 {\listtext \'a5 }Add menu item to save the current PDF display settings to be used for new documents.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls53\ilvl0\cf0 {\listtext \'a5 }Search results from the Find Panel are now also highlighted with a red oval.\ +\ls54\ilvl0\cf0 {\listtext \'a5 }Search results from the Find Panel are now also highlighted with a red oval.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls54\ilvl0\cf0 {\listtext \'a5 }Select search field when opening the Contents pane in full screen mode.\ +\ls55\ilvl0\cf0 {\listtext \'a5 }Select search field when opening the Contents pane in full screen mode.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls55\ilvl0\cf0 {\listtext \'a5 }You can now reset all preferences or all preferences in a pane.\ +\ls56\ilvl0\cf0 {\listtext \'a5 }You can now reset all preferences or all preferences in a pane.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls56\ilvl0\cf0 {\listtext \'a5 }Added Italian localization. (Thanks Andrea Bergia!)\ +\ls57\ilvl0\cf0 {\listtext \'a5 }Added Italian localization. (Thanks Andrea Bergia!)\ {\listtext \'a5 }Screensaver and sleep are now disabled in Presentation mode.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls57\ilvl0\cf0 {\listtext \'a5 }Skim can now return to the last page viewed in a document.\ +\ls58\ilvl0\cf0 {\listtext \'a5 }Skim can now return to the last page viewed in a document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls58\ilvl0\cf0 {\listtext \'a5 }Link tool tips now show the top of the text when the link refers to the (empty) top of a page. \ +\ls59\ilvl0\cf0 {\listtext \'a5 }Link tool tips now show the top of the text when the link refers to the (empty) top of a page. \ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls59\ilvl0\cf0 {\listtext \'a5 }Skim can now also view separate Skim notes (.skim) files.\ +\ls60\ilvl0\cf0 {\listtext \'a5 }Skim can now also view separate Skim notes (.skim) files.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls60\ilvl0\cf0 {\listtext \'a5 }Using Sparkle for automatic updating. (Thanks Andy Matuschak!)\ +\ls61\ilvl0\cf0 {\listtext \'a5 }Using Sparkle for automatic updating. (Thanks Andy Matuschak!)\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls61\ilvl0\cf0 {\listtext \'a5 }Display the number of pages in the title bar.\ +\ls62\ilvl0\cf0 {\listtext \'a5 }Display the number of pages in the title bar.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls62\ilvl0\cf0 {\listtext \'a5 }Skim can now automatically backup a skim notes file whenever it saves a PDF file.\ +\ls63\ilvl0\cf0 {\listtext \'a5 }Skim can now automatically backup a skim notes file whenever it saves a PDF file.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls63\ilvl0\cf0 {\listtext \'a5 }You can now resize the current note using the arrow keys, when you hold down the Control key.\ +\ls64\ilvl0\cf0 {\listtext \'a5 }You can now resize the current note using the arrow keys, when you hold down the Control key.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls64\ilvl0\cf0 {\listtext \'a5 }Notes are now ordered according to page and location in page.\ +\ls65\ilvl0\cf0 {\listtext \'a5 }Notes are now ordered according to page and location in page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls65\ilvl0\cf0 {\listtext \'a5 }Several improvements of Skim's custom tool-tips.\ +\ls66\ilvl0\cf0 {\listtext \'a5 }Several improvements of Skim's custom tool-tips.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls66\ilvl0\cf0 {\listtext \'a5 }Add a menu item to select the search field.\ +\ls67\ilvl0\cf0 {\listtext \'a5 }Add a menu item to select the search field.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls67\ilvl0\cf0 {\listtext \'a5 }You can now add arrows to a PDF document.\ +\ls68\ilvl0\cf0 {\listtext \'a5 }You can now add arrows to a PDF document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls68\ilvl0\cf0 {\listtext \'a5 }You can now add notes from external .skim files rather than just overwriting them.\ +\ls69\ilvl0\cf0 {\listtext \'a5 }You can now add notes from external .skim files rather than just overwriting them.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls69\ilvl0\cf0 {\listtext \'a5 }PDFSync support. See the Wiki for more information.\ +\ls70\ilvl0\cf0 {\listtext \'a5 }PDFSync support. See the Wiki for more information.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls70\ilvl0\cf0 {\listtext \'a5 }You can now set transparent colors from the color panel. \ +\ls71\ilvl0\cf0 {\listtext \'a5 }You can now set transparent colors from the color panel. \ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls71\ilvl0\cf0 {\listtext \'a5 }You can now set separate PDF view settings for full screen mode. \ +\ls72\ilvl0\cf0 {\listtext \'a5 }You can now set separate PDF view settings for full screen mode. \ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls72\ilvl0\cf0 {\listtext \'a5 }Add a Look Up in Dictionary item to the contextual menu.\ +\ls73\ilvl0\cf0 {\listtext \'a5 }Add a Look Up in Dictionary item to the contextual menu.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls73\ilvl0\cf0 {\listtext \'a5 }You can now undo edits of notes and highlights.\ +\ls74\ilvl0\cf0 {\listtext \'a5 }You can now undo edits of notes and highlights.\ {\listtext \'a5 }Add a hidden preference (SKActivateFullScreenNavigationAtBottom) to show the navigation buttons in full screen mode only when moving the mouse at the bottom of the screen. \ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls74\ilvl0\cf0 {\listtext \'a5 }Add hidden preferences for the line widths of circles and boxes (SKCircleNoteLineWidth and SKSquareNoteLineWidth).\ +\ls75\ilvl0\cf0 {\listtext \'a5 }Add hidden preferences for the line widths of circles and boxes (SKCircleNoteLineWidth and SKSquareNoteLineWidth).\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls75\ilvl0\cf0 {\listtext \'a5 }New tool modes for ading notes or highlights.\ +\ls76\ilvl0\cf0 {\listtext \'a5 }New tool modes for ading notes or highlights.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \f2\b\fs28 \cf0 \ @@ -388,40 +391,40 @@ \f3\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls76\ilvl0 +\ls77\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }We now don't edit new text notes, so they can be moved, resized or deleted.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls77\ilvl0\cf0 {\listtext \'a5 }We now make sure new notes are added to a visible page.\ +\ls78\ilvl0\cf0 {\listtext \'a5 }We now make sure new notes are added to a visible page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls78\ilvl0\cf0 {\listtext \'a5 }Disable the TOC menu item when there is no TOC.\ +\ls79\ilvl0\cf0 {\listtext \'a5 }Disable the TOC menu item when there is no TOC.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls79\ilvl0\cf0 {\listtext \'a5 }Return to the location that was viewed when reloading a document.\ +\ls80\ilvl0\cf0 {\listtext \'a5 }Return to the location that was viewed when reloading a document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls80\ilvl0\cf0 {\listtext \'a5 }Search text in a PDf file asynchronously, so it does not block Skim.\ +\ls81\ilvl0\cf0 {\listtext \'a5 }Search text in a PDf file asynchronously, so it does not block Skim.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls81\ilvl0\cf0 {\listtext \'a5 }Fix crashes that can appear for links with missing URLs.\ +\ls82\ilvl0\cf0 {\listtext \'a5 }Fix crashes that can appear for links with missing URLs.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls82\ilvl0\cf0 {\listtext \'a5 }Add separators in the Notes menu for categories.\ +\ls83\ilvl0\cf0 {\listtext \'a5 }Add separators in the Notes menu for categories.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls83\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting a PDF-document.\ +\ls84\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting a PDF-document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls84\ilvl0\cf0 {\listtext \'a5 }Fix typos in the Help and update for new features.\ +\ls85\ilvl0\cf0 {\listtext \'a5 }Fix typos in the Help and update for new features.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls85\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting the document. Unfortunately this disabled tool tips.\ +\ls86\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting the document. Unfortunately this disabled tool tips.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls86\ilvl0\cf0 {\listtext \'a5 }Open the contents pane to display the search term when opening from Spotlight.\ +\ls87\ilvl0\cf0 {\listtext \'a5 }Open the contents pane to display the search term when opening from Spotlight.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls87\ilvl0\cf0 {\listtext \'a5 }Save notes when auto-saving and exporting as PDF.\ +\ls88\ilvl0\cf0 {\listtext \'a5 }Save notes when auto-saving and exporting as PDF.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls88\ilvl0\cf0 {\listtext \'a5 }Remember the width of notes pane.\ +\ls89\ilvl0\cf0 {\listtext \'a5 }Remember the width of notes pane.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls89\ilvl0\cf0 {\listtext \'a5 }Fix leaks leading to excessive memory use.\ +\ls90\ilvl0\cf0 {\listtext \'a5 }Fix leaks leading to excessive memory use.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls90\ilvl0\cf0 {\listtext \'a5 }Fix back-tabbing through notes and links.\ +\ls91\ilvl0\cf0 {\listtext \'a5 }Fix back-tabbing through notes and links.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls91\ilvl0\cf0 {\listtext \'a5 }Zooming using the scroll-wheel now only affects the current window.\ +\ls92\ilvl0\cf0 {\listtext \'a5 }Zooming using the scroll-wheel now only affects the current window.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls92\ilvl0\cf0 {\listtext \'a5 }Lazy updating of page thumbnails to avoid slowdown when opening a file.\ +\ls93\ilvl0\cf0 {\listtext \'a5 }Lazy updating of page thumbnails to avoid slowdown when opening a file.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f2\b\fs28 \cf0 \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-12 07:50:24
|
Revision: 2483 http://skim-app.svn.sourceforge.net/skim-app/?rev=2483&view=rev Author: hofman Date: 2007-07-12 00:50:23 -0700 (Thu, 12 Jul 2007) Log Message: ----------- Also use shift-arrowDown/Up keys to rotate through annotation mode. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-07-11 20:41:54 UTC (rev 2482) +++ trunk/SKPDFView.m 2007-07-12 07:50:23 UTC (rev 2483) @@ -800,6 +800,10 @@ [self setToolMode:(toolMode + 1) % 5]; } else if (isPresentation == NO && (eventChar == NSLeftArrowFunctionKey) && (modifiers == NSShiftKeyMask)) { [self setToolMode:(toolMode + 4) % 5]; + } else if (isPresentation == NO && (eventChar == NSDownArrowFunctionKey) && (modifiers == NSShiftKeyMask)) { + [self setAnnotationMode:(annotationMode + 1) % 8]; + } else if (isPresentation == NO && (eventChar == NSUpArrowFunctionKey) && (modifiers == NSShiftKeyMask)) { + [self setAnnotationMode:(annotationMode + 7) % 8]; } else if (readingBar && (eventChar == NSRightArrowFunctionKey || eventChar == NSLeftArrowFunctionKey || eventChar == NSUpArrowFunctionKey || eventChar == NSDownArrowFunctionKey) && (modifiers == NSAlternateKeyMask)) { [self moveReadingBarForKey:eventChar]; } else if (isPresentation == NO && [self toolMode] == SKNoteToolMode && modifiers == 0 && eventChar == 't') { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |