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
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ho...@us...> - 2007-05-01 19:54:59
|
Revision: 1950 http://skim-app.svn.sourceforge.net/skim-app/?rev=1950&view=rev Author: hofman Date: 2007-05-01 12:54:58 -0700 (Tue, 01 May 2007) Log Message: ----------- Check wether private methods are implemented. Modified Paths: -------------- trunk/PDFPage_SKExtensions.m trunk/SKPDFView.m Modified: trunk/PDFPage_SKExtensions.m =================================================================== --- trunk/PDFPage_SKExtensions.m 2007-05-01 19:34:11 UTC (rev 1949) +++ trunk/PDFPage_SKExtensions.m 2007-05-01 19:54:58 UTC (rev 1950) @@ -137,6 +137,9 @@ } - (NSArray *)lineBounds { + if ([PDFSelection instancesRespondToSelector:@selector(numberOfRangesOnPage:)] == NO || [PDFSelection instancesRespondToSelector:@selector(rangeAtIndex:onPage:)] == NO) + return [NSArray array]; + static NSCharacterSet *nonWhitespaceAndNewlineCharacterSet = nil; if (nonWhitespaceAndNewlineCharacterSet == nil) nonWhitespaceAndNewlineCharacterSet = [[[NSCharacterSet whitespaceAndNewlineCharacterSet] invertedSet] copy]; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-05-01 19:34:11 UTC (rev 1949) +++ trunk/SKPDFView.m 2007-05-01 19:54:58 UTC (rev 1950) @@ -2751,17 +2751,26 @@ PDFSelection *sel = selection; NSArray *pages = [selection pages]; - if ([pages count] && [selection respondsToSelector:@selector(numberOfRangesOnPage:)] && [selection respondsToSelector:@selector(rangeAtIndex:onPage:)]) { + if ([pages count]) { PDFPage *firstPage = [pages objectAtIndex:0]; PDFPage *lastPage = [pages lastObject]; unsigned int pageIndex = [self indexForPage:page]; unsigned int firstPageIndex = [self indexForPage:firstPage]; unsigned int lastPageIndex = [self indexForPage:lastPage]; - int firstChar = [selection rangeAtIndex:0 onPage:firstPage].location; - int lastChar = NSMaxRange([selection rangeAtIndex:[selection numberOfRangesOnPage:lastPage] - 1 onPage:lastPage]) - 1; - NSRect firstRect = [firstPage characterBoundsAtIndex:firstChar]; - NSRect lastRect = [lastPage characterBoundsAtIndex:lastChar]; + NSRect firstRect, lastRect; + if ([selection respondsToSelector:@selector(numberOfRangesOnPage:)] && [selection respondsToSelector:@selector(rangeAtIndex:onPage:)]) { + int firstChar = [selection rangeAtIndex:0 onPage:firstPage].location; + int lastChar = NSMaxRange([selection rangeAtIndex:[selection numberOfRangesOnPage:lastPage] - 1 onPage:lastPage]) - 1; + firstRect = [firstPage characterBoundsAtIndex:firstChar]; + lastRect = [lastPage characterBoundsAtIndex:lastChar]; + } else { + firstRect = [selection boundsForPage:firstPage]; + firstRect = NSMakeRect(NSMinX(firstRect), NSMaxY(firstRect), 0.0, 0.0); + lastRect = [selection boundsForPage:lastPage]; + lastRect = NSMakeRect(NSMaxX(lastRect), NSMinY(lastRect), 0.0, 0.0); + } + if (pageIndex < firstPageIndex || (pageIndex == firstPageIndex && (point.y > NSMaxY(firstRect) || (point.y > NSMinY(firstRect) && point.x < NSMinX(firstRect))))) sel = [self selectionFromPage:page atPoint:point toPage:lastPage atPoint:NSMakePoint(NSMaxX(lastRect), NSMidY(lastRect))]; if (pageIndex > lastPageIndex || (pageIndex == lastPageIndex && (point.y < NSMinY(lastRect) || (point.y < NSMaxY(lastRect) && point.x > NSMaxX(lastRect))))) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-01 19:34:15
|
Revision: 1949 http://skim-app.svn.sourceforge.net/skim-app/?rev=1949&view=rev Author: hofman Date: 2007-05-01 12:34:11 -0700 (Tue, 01 May 2007) Log Message: ----------- Draw selection rect when we do rectangle text selection (with option key). Modified Paths: -------------- trunk/SKPDFView.h trunk/SKPDFView.m Modified: trunk/SKPDFView.h =================================================================== --- trunk/SKPDFView.h 2007-05-01 17:59:53 UTC (rev 1948) +++ trunk/SKPDFView.h 2007-05-01 19:34:11 UTC (rev 1949) @@ -86,6 +86,7 @@ NSPoint wasEndPoint; NSPoint mouseDownLoc; NSPoint clickDelta; + NSRect selectionRect; BOOL resizingAnnotation; BOOL draggingAnnotation; BOOL draggingStartPoint; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-05-01 17:59:53 UTC (rev 1948) +++ trunk/SKPDFView.m 2007-05-01 19:34:11 UTC (rev 1949) @@ -306,6 +306,13 @@ } } + if (NSIsEmptyRect(selectionRect) == NO) { + NSRect rect = NSInsetRect([self convertRect:selectionRect toPage:pdfPage], 0.5, 0.5); + float color[4] = { 0.0, 0.0, 0.0, 1.0 }; + CGContextSetStrokeColor(context, color); + CGContextStrokeRect(context, *(CGRect *)&rect); + } + CGContextRestoreGState(context); } @@ -598,9 +605,15 @@ - (void)mouseUp:(NSEvent *)theEvent{ switch (toolMode) { case SKTextToolMode: - mouseDownInAnnotation = NO; - [wasSelection release]; - wasSelection = nil; + if (mouseDownInAnnotation) { + if (nil == activeAnnotation && NSIsEmptyRect(selectionRect) == NO) { + [self setNeedsDisplayInRect:selectionRect]; + selectionRect = NSZeroRect; + } + mouseDownInAnnotation = NO; + [wasSelection release]; + wasSelection = nil; + } if (draggingAnnotation) { draggingAnnotation = NO; if ([[activeAnnotation type] isEqualToString:@"Circle"] || [[activeAnnotation type] isEqualToString:@"Square"]) { @@ -2346,7 +2359,13 @@ PDFSelection *sel = nil; if (rectSelection) { // how to handle multipage selection? Preview.app's behavior is screwy as well, so we'll do the same thing - sel = [page1 selectionForRect:NSMakeRect(fmin(p2.x, p1.x), fmin(p2.y, p1.y), fabs(p2.x - p1.x), fabs(p2.y - p1.y))]; + NSRect selRect = NSMakeRect(fmin(p2.x, p1.x), fmin(p2.y, p1.y), fabs(p2.x - p1.x), fabs(p2.y - p1.y)); + sel = [page1 selectionForRect:selRect]; + if (NSIsEmptyRect(selectionRect) == NO) + [self setNeedsDisplayInRect:selectionRect]; + selectionRect = NSIntegralRect([self convertRect:selRect fromPage:page1]); + [self setNeedsDisplayInRect:selectionRect]; + [[self window] flushWindow]; } else if (extendSelection) { sel = [[self document] selectionByExtendingSelection:wasSelection toPage:page2 atPoint:p2]; } else { @@ -2413,7 +2432,7 @@ NSPoint mouseLoc = [theEvent locationInWindow]; NSPoint startPoint = [[self documentView] convertPoint:mouseLoc fromView:nil]; NSPoint currentPoint; - NSRect selectionRect = {startPoint, NSZeroSize}; + NSRect selRect = {startPoint, NSZeroSize}; NSRect bounds; float minX, maxX, minY, maxY; BOOL dragged = NO; @@ -2457,14 +2476,14 @@ maxX = fmax(fmin(maxX, NSMaxX(bounds)), NSMinX(bounds)); minY = fmin(fmax(minY, NSMinY(bounds)), NSMaxY(bounds)); maxY = fmax(fmin(maxY, NSMaxY(bounds)), NSMinY(bounds)); - selectionRect = NSMakeRect(minX, minY, maxX - minX, maxY - minY); + selRect = NSMakeRect(minX, minY, maxX - minX, maxY - minY); - [[self window] cacheImageInRect:NSInsetRect([[self documentView] convertRect:selectionRect toView:nil], -2.0, -2.0)]; + [[self window] cacheImageInRect:NSInsetRect([[self documentView] convertRect:selRect toView:nil], -2.0, -2.0)]; [self lockFocus]; [NSGraphicsContext saveGraphicsState]; [[NSColor blackColor] set]; - [NSBezierPath strokeRect:NSInsetRect(NSIntegralRect([self convertRect:selectionRect fromView:[self documentView]]), 0.5, 0.5)]; + [NSBezierPath strokeRect:NSInsetRect(NSIntegralRect([self convertRect:selRect fromView:[self documentView]]), 0.5, 0.5)]; [NSGraphicsContext restoreGraphicsState]; [self unlockFocus]; [[self window] flushWindow]; @@ -2484,9 +2503,9 @@ [[self window] discardCachedImage]; [self flagsChanged:theEvent]; - NSPoint point = [self convertPoint:NSMakePoint(NSMidX(selectionRect), NSMidY(selectionRect)) fromView:[self documentView]]; + NSPoint point = [self convertPoint:NSMakePoint(NSMidX(selRect), NSMidY(selRect)) fromView:[self documentView]]; PDFPage *page = [self pageForPoint:point nearest:YES]; - NSRect rect = [self convertRect:selectionRect fromView:[self documentView]]; + NSRect rect = [self convertRect:selRect fromView:[self documentView]]; int factor = 1; if (dragged == NO) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-01 17:59:57
|
Revision: 1948 http://skim-app.svn.sourceforge.net/skim-app/?rev=1948&view=rev Author: hofman Date: 2007-05-01 10:59:53 -0700 (Tue, 01 May 2007) Log Message: ----------- Better position for hover window for active link. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-05-01 14:25:45 UTC (rev 1947) +++ trunk/SKPDFView.m 2007-05-01 17:59:53 UTC (rev 1948) @@ -1218,8 +1218,10 @@ [self setActiveAnnotation:annotation]; if ([[annotation type] isEqualToString:@"Link"] || [annotation text]) { NSRect bounds = [annotation bounds]; - NSPoint point = [self convertPoint:[self convertPoint:NSMakePoint(NSMidX(bounds), NSMidY(bounds)) fromPage:[annotation page]] toView:nil]; - [[SKPDFHoverWindow sharedHoverWindow] showForAnnotation:annotation atPoint:[[self window] convertBaseToScreen:point]]; + NSPoint point = NSMakePoint(NSMinX(bounds) + 0.3 * NSWidth(bounds), NSMinY(bounds) + 0.3 * NSHeight(bounds)); + point = [self convertPoint:[self convertPoint:point fromPage:[annotation page]] toView:nil]; + point = [[self window] convertBaseToScreen:NSMakePoint(roundf(point.x), roundf(point.y))]; + [[SKPDFHoverWindow sharedHoverWindow] showForAnnotation:annotation atPoint:point]; } else { [[SKPDFHoverWindow sharedHoverWindow] orderOut:self]; } @@ -1261,8 +1263,10 @@ [self setActiveAnnotation:annotation]; if ([[annotation type] isEqualToString:@"Link"] || [annotation text]) { NSRect bounds = [annotation bounds]; - NSPoint point = [self convertPoint:[self convertPoint:NSMakePoint(NSMidX(bounds), NSMidY(bounds)) fromPage:[annotation page]] toView:nil]; - [[SKPDFHoverWindow sharedHoverWindow] showForAnnotation:annotation atPoint:[[self window] convertBaseToScreen:point]]; + NSPoint point = NSMakePoint(NSMinX(bounds) + 0.3 * NSWidth(bounds), NSMinY(bounds) + 0.3 * NSHeight(bounds)); + point = [self convertPoint:[self convertPoint:point fromPage:[annotation page]] toView:nil]; + point = [[self window] convertBaseToScreen:NSMakePoint(roundf(point.x), roundf(point.y))]; + [[SKPDFHoverWindow sharedHoverWindow] showForAnnotation:annotation atPoint:point]; } else { [[SKPDFHoverWindow sharedHoverWindow] orderOut:self]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-01 14:25:54
|
Revision: 1947 http://skim-app.svn.sourceforge.net/skim-app/?rev=1947&view=rev Author: hofman Date: 2007-05-01 07:25:45 -0700 (Tue, 01 May 2007) Log Message: ----------- End editing when changing active annotation. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-05-01 12:12:11 UTC (rev 1946) +++ trunk/SKPDFView.m 2007-05-01 14:25:45 UTC (rev 1947) @@ -372,9 +372,12 @@ BOOL changed = newAnnotation != activeAnnotation; // Will need to redraw old active anotation. - if (activeAnnotation != nil) + if (activeAnnotation != nil) { [self setNeedsDisplayForAnnotation:activeAnnotation]; - + if (changed && editAnnotation) + [self endAnnotationEdit:nil]; + } + // Assign. if (newAnnotation) { activeAnnotation = newAnnotation; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-01 12:12:12
|
Revision: 1946 http://skim-app.svn.sourceforge.net/skim-app/?rev=1946&view=rev Author: hofman Date: 2007-05-01 05:12:11 -0700 (Tue, 01 May 2007) Log Message: ----------- Redisplay snapshots when pages rotate. Modified Paths: -------------- trunk/SKMainWindowController.m trunk/SKSnapshotWindowController.h trunk/SKSnapshotWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-05-01 11:48:23 UTC (rev 1945) +++ trunk/SKMainWindowController.m 2007-05-01 12:12:11 UTC (rev 1946) @@ -876,6 +876,15 @@ [[pdfView currentPage] setRotation:[[pdfView currentPage] rotation] + 90]; [pdfView layoutDocumentView]; + NSEnumerator *snapshotEnum = [snapshots objectEnumerator]; + SKSnapshotWindowController *wc; + while (wc = [snapshotEnum nextObject]) { + if ([wc isPageVisible:[pdfView currentPage]]) { + [self snapshotNeedsUpdate:wc]; + [wc redisplay]; + } + } + SKThumbnail *thumbnail = [[self thumbnails] objectAtIndex:[[pdfView document] indexForPage:[pdfView currentPage]]]; [self thumbnailNeedsUpdate:thumbnail]; } @@ -884,6 +893,15 @@ [[pdfView currentPage] setRotation:[[pdfView currentPage] rotation] - 90]; [pdfView layoutDocumentView]; + NSEnumerator *snapshotEnum = [snapshots objectEnumerator]; + SKSnapshotWindowController *wc; + while (wc = [snapshotEnum nextObject]) { + if ([wc isPageVisible:[pdfView currentPage]]) { + [self snapshotNeedsUpdate:wc]; + [wc redisplay]; + } + } + SKThumbnail *thumbnail = [[self thumbnails] objectAtIndex:[[pdfView document] indexForPage:[pdfView currentPage]]]; [self thumbnailNeedsUpdate:thumbnail]; } @@ -894,6 +912,10 @@ [[[pdfView document] pageAtIndex:i] setRotation:[[[pdfView document] pageAtIndex:i] rotation] + 90]; } [pdfView layoutDocumentView]; + + [snapshots makeObjectsPerformSelector:@selector(redisplay) withObject:nil]; + [self allSnapshotsNeedUpdate]; + [self allThumbnailsNeedUpdate]; } @@ -903,6 +925,10 @@ [[[pdfView document] pageAtIndex:i] setRotation:[[[pdfView document] pageAtIndex:i] rotation] - 90]; } [pdfView layoutDocumentView]; + + [snapshots makeObjectsPerformSelector:@selector(redisplay) withObject:nil]; + [self allSnapshotsNeedUpdate]; + [self allThumbnailsNeedUpdate]; } Modified: trunk/SKSnapshotWindowController.h =================================================================== --- trunk/SKSnapshotWindowController.h 2007-05-01 11:48:23 UTC (rev 1945) +++ trunk/SKSnapshotWindowController.h 2007-05-01 12:12:11 UTC (rev 1946) @@ -39,7 +39,7 @@ #import <Cocoa/Cocoa.h> -@class PDFView, PDFDocument; +@class PDFView, PDFDocument, PDFPage; @interface SKSnapshotWindowController : NSWindowController { IBOutlet PDFView* pdfView; @@ -50,6 +50,7 @@ } - (void)setPdfDocument:(PDFDocument *)pdfDocument scaleFactor:(float)factor goToPageNumber:(int)pageNum rect:(NSRect)rect; - (BOOL)isPageVisible:(PDFPage *)page; +- (void)redisplay; - (id)delegate; - (void)setDelegate:(id)newDelegate; - (PDFView *)pdfView; Modified: trunk/SKSnapshotWindowController.m =================================================================== --- trunk/SKSnapshotWindowController.m 2007-05-01 11:48:23 UTC (rev 1945) +++ trunk/SKSnapshotWindowController.m 2007-05-01 12:12:11 UTC (rev 1946) @@ -88,6 +88,10 @@ [pdfView setNeedsDisplayInRect:rect]; } +- (void)redisplay { + [pdfView setNeedsDisplay:YES]; +} + - (void)handlePageChangedNotification:(NSNotification *)notification { [[self window] setTitle:[self windowTitleForDocumentDisplayName:[[self document] displayName]]]; [self willChangeValueForKey:@"pageLabel"]; @@ -225,6 +229,9 @@ } - (BOOL)isPageVisible:(PDFPage *)page { + if ([[page document] isEqual:[pdfView document]] == NO) + return NO; + NSView *clipView = [[[pdfView documentView] enclosingScrollView] contentView]; NSRect visibleRect = [clipView convertRect:[clipView visibleRect] toView:pdfView]; unsigned first, last, index = [[pdfView document] indexForPage:page]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-01 11:48:24
|
Revision: 1945 http://skim-app.svn.sourceforge.net/skim-app/?rev=1945&view=rev Author: hofman Date: 2007-05-01 04:48:23 -0700 (Tue, 01 May 2007) Log Message: ----------- Improve redisplay of snapshots. Modified Paths: -------------- trunk/SKMainWindowController.m trunk/SKSnapshotWindowController.h trunk/SKSnapshotWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-05-01 11:13:10 UTC (rev 1944) +++ trunk/SKMainWindowController.m 2007-05-01 11:48:23 UTC (rev 1945) @@ -1887,8 +1887,10 @@ PDFPage *newPage = [[notification userInfo] objectForKey:@"newPage"]; if (oldPage || newPage) { - [self thumbnailNeedsUpdate:[[self thumbnails] objectAtIndex:[[pdfView document] indexForPage:oldPage]]]; - [self thumbnailNeedsUpdate:[[self thumbnails] objectAtIndex:[[pdfView document] indexForPage:newPage]]]; + if (oldPage) + [self thumbnailNeedsUpdate:[[self thumbnails] objectAtIndex:[[pdfView document] indexForPage:oldPage]]]; + if (newPage) + [self thumbnailNeedsUpdate:[[self thumbnails] objectAtIndex:[[pdfView document] indexForPage:newPage]]]; NSEnumerator *snapshotEnum = [snapshots objectEnumerator]; SKSnapshotWindowController *wc; while (wc = [snapshotEnum nextObject]) { Modified: trunk/SKSnapshotWindowController.h =================================================================== --- trunk/SKSnapshotWindowController.h 2007-05-01 11:13:10 UTC (rev 1944) +++ trunk/SKSnapshotWindowController.h 2007-05-01 11:48:23 UTC (rev 1945) @@ -68,7 +68,8 @@ - (void)handleViewChangedNotification:(NSNotification *)notification; - (void)handleAnnotationWillChangeNotification:(NSNotification *)notification; - (void)handleAnnotationDidChangeNotification:(NSNotification *)notification; -- (void)handleDidRemoveAnnotationNotification:(NSNotification *)notification; +- (void)handleDidAddRemoveAnnotationNotification:(NSNotification *)notification; +- (void)handleDidMoveAnnotationNotification:(NSNotification *)notification; @end Modified: trunk/SKSnapshotWindowController.m =================================================================== --- trunk/SKSnapshotWindowController.m 2007-05-01 11:13:10 UTC (rev 1944) +++ trunk/SKSnapshotWindowController.m 2007-05-01 11:48:23 UTC (rev 1945) @@ -76,6 +76,18 @@ return [NSString stringWithFormat:@"%@ - Page %@", displayName, [[pdfView currentPage] label]]; } +- (void)setNeedsDisplayForAnnotation:(PDFAnnotation *)annotation onPage:(PDFPage *)page { + NSRect rect = [pdfView convertRect:[page boundsForBox:kPDFDisplayBoxCropBox] fromPage:page]; + float scale = [pdfView scaleFactor]; + float maxX = ceilf(NSMaxX(rect) + scale); + float maxY = ceilf(NSMaxY(rect) + scale); + float minX = floorf(NSMinX(rect) - scale); + float minY = floorf(NSMinY(rect) - scale); + rect = NSIntersectionRect([pdfView bounds], NSMakeRect(minX, minY, maxX - minX, maxY - minY)); + if (NSIsEmptyRect(rect) == NO) + [pdfView setNeedsDisplayInRect:rect]; +} + - (void)handlePageChangedNotification:(NSNotification *)notification { [[self window] setTitle:[self windowTitleForDocumentDisplayName:[[self document] displayName]]]; [self willChangeValueForKey:@"pageLabel"]; @@ -100,35 +112,32 @@ - (void)handleAnnotationWillChangeNotification:(NSNotification *)notification { PDFAnnotation *annotation = [notification object]; - if ([[annotation page] isEqual:[pdfView currentPage]] && [[[notification userInfo] objectForKey:@"key"] isEqualToString:@"bounds"]) { - NSRect aRect = [pdfView convertRect:[[annotation page] boundsForBox:kPDFDisplayBoxCropBox] fromPage:[annotation page]]; - float scale = [pdfView scaleFactor]; - NSPoint max = NSMakePoint(ceilf(NSMaxX(aRect)) + scale, ceilf(NSMaxY(aRect)) + scale); - NSPoint origin = NSMakePoint(floorf(NSMinX(aRect)) - scale, floorf(NSMinY(aRect)) - scale); - [pdfView setNeedsDisplayInRect:NSMakeRect(origin.x, origin.y, max.x - origin.x, max.y - origin.y)]; - } + if ([[[annotation page] document] isEqual:[pdfView document]] && [self isPageVisible:[annotation page]] && [[[notification userInfo] objectForKey:@"key"] isEqualToString:@"bounds"]) + [self setNeedsDisplayForAnnotation:annotation onPage:[annotation page]]; } - (void)handleAnnotationDidChangeNotification:(NSNotification *)notification { PDFAnnotation *annotation = [notification object]; - if ([[annotation page] isEqual:[pdfView currentPage]]) { - NSRect aRect = [pdfView convertRect:[[annotation page] boundsForBox:kPDFDisplayBoxCropBox] fromPage:[annotation page]]; - float scale = [pdfView scaleFactor]; - NSPoint max = NSMakePoint(ceilf(NSMaxX(aRect)) + scale, ceilf(NSMaxY(aRect)) + scale); - NSPoint origin = NSMakePoint(floorf(NSMinX(aRect)) - scale, floorf(NSMinY(aRect)) - scale); - [pdfView setNeedsDisplayInRect:NSMakeRect(origin.x, origin.y, max.x - origin.x, max.y - origin.y)]; - } + if ([[[annotation page] document] isEqual:[pdfView document]] && [self isPageVisible:[annotation page]]) + [self setNeedsDisplayForAnnotation:annotation onPage:[annotation page]]; } -- (void)handleDidRemoveAnnotationNotification:(NSNotification *)notification { +- (void)handleDidAddRemoveAnnotationNotification:(NSNotification *)notification { + PDFAnnotation *annotation = [notification object]; PDFPage *page = [[notification userInfo] objectForKey:@"page"]; - if ([page isEqual:[pdfView currentPage]]) { - [page removeAnnotation:[[notification userInfo] objectForKey:@"annotation"]]; - NSRect aRect = [pdfView convertRect:[page boundsForBox:kPDFDisplayBoxCropBox] fromPage:page]; - float scale = [pdfView scaleFactor]; - NSPoint max = NSMakePoint(ceilf(NSMaxX(aRect)) + scale, ceilf(NSMaxY(aRect)) + scale); - NSPoint origin = NSMakePoint(floorf(NSMinX(aRect)) - scale, floorf(NSMinY(aRect)) - scale); - [pdfView setNeedsDisplayInRect:NSMakeRect(origin.x, origin.y, max.x - origin.x, max.y - origin.y)]; + if ([[page document] isEqual:[pdfView document]] && [self isPageVisible:page]) + [self setNeedsDisplayForAnnotation:annotation onPage:page]; +} + +- (void)handleDidMoveAnnotationNotification:(NSNotification *)notification { + PDFAnnotation *annotation = [notification object]; + PDFPage *oldPage = [[notification userInfo] objectForKey:@"oldPage"]; + PDFPage *newPage = [[notification userInfo] objectForKey:@"newPage"]; + if ([[newPage document] isEqual:[pdfView document]]) { + if ([self isPageVisible:oldPage]) + [self setNeedsDisplayForAnnotation:annotation onPage:oldPage]; + if ([self isPageVisible:newPage]) + [self setNeedsDisplayForAnnotation:annotation onPage:newPage]; } } @@ -156,8 +165,12 @@ name:SKAnnotationWillChangeNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAnnotationDidChangeNotification:) name:SKAnnotationDidChangeNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleDidRemoveAnnotationNotification:) + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleDidAddRemoveAnnotationNotification:) + name:SKPDFViewDidAddAnnotationNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleDidAddRemoveAnnotationNotification:) name:SKPDFViewDidRemoveAnnotationNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleDidMoveAnnotationNotification:) + name:SKPDFViewDidMoveAnnotationNotification object:nil]; if ([[self delegate] respondsToSelector:@selector(snapshotControllerDidFinishSetup:)]) [[self delegate] performSelector:@selector(snapshotControllerDidFinishSetup:) withObject:self afterDelay:0.1]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-01 11:13:12
|
Revision: 1944 http://skim-app.svn.sourceforge.net/skim-app/?rev=1944&view=rev Author: hofman Date: 2007-05-01 04:13:10 -0700 (Tue, 01 May 2007) Log Message: ----------- Reorganize some event handling code. Modified Paths: -------------- trunk/SKMainWindowController.m trunk/SKPDFView.m trunk/SKSnapshotWindowController.h trunk/SKSnapshotWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-04-30 20:14:21 UTC (rev 1943) +++ trunk/SKMainWindowController.m 2007-05-01 11:13:10 UTC (rev 1944) @@ -1844,7 +1844,7 @@ NSEnumerator *snapshotEnum = [snapshots objectEnumerator]; SKSnapshotWindowController *wc; while (wc = [snapshotEnum nextObject]) { - if ([[[wc pdfView] currentPage] isEqual:page]) + if ([wc isPageVisible:page]) [self snapshotNeedsUpdate:wc]; } } @@ -1875,7 +1875,7 @@ NSEnumerator *snapshotEnum = [snapshots objectEnumerator]; SKSnapshotWindowController *wc; while (wc = [snapshotEnum nextObject]) { - if ([[[wc pdfView] currentPage] isEqual:page]) + if ([wc isPageVisible:page]) [self snapshotNeedsUpdate:wc]; } } @@ -1892,7 +1892,7 @@ NSEnumerator *snapshotEnum = [snapshots objectEnumerator]; SKSnapshotWindowController *wc; while (wc = [snapshotEnum nextObject]) { - if ([[[wc pdfView] currentPage] isEqual:oldPage] || [[[wc pdfView] currentPage] isEqual:newPage]) + if ([wc isPageVisible:oldPage] || [wc isPageVisible:newPage]) [self snapshotNeedsUpdate:wc]; } } @@ -1915,7 +1915,7 @@ NSEnumerator *snapshotEnum = [snapshots objectEnumerator]; SKSnapshotWindowController *wc; while (wc = [snapshotEnum nextObject]) { - if ([[[wc pdfView] currentPage] isEqual:[annotation page]]) + if ([wc isPageVisible:[annotation page]]) [self snapshotNeedsUpdate:wc]; } Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-30 20:14:21 UTC (rev 1943) +++ trunk/SKPDFView.m 2007-05-01 11:13:10 UTC (rev 1944) @@ -78,6 +78,7 @@ @interface SKPDFView (Private) - (NSRange)visiblePageIndexRange; +- (NSRect)visibleContentRect; - (void)resetHoverRects; - (void)removeHoverRects; @@ -100,8 +101,10 @@ - (void)selectSnapshotWithEvent:(NSEvent *)theEvent; - (void)magnifyWithEvent:(NSEvent *)theEvent; - (void)dragWithEvent:(NSEvent *)theEvent; +- (void)selectTextWithEvent:(NSEvent *)theEvent; - (void)dragReadingBarWithEvent:(NSEvent *)theEvent; - (void)pdfsyncWithEvent:(NSEvent *)theEvent; +- (NSCursor *)cursorForEvent:(NSEvent *)theEvent; @end @@ -405,69 +408,6 @@ } } -#pragma mark Tracking mousemoved fix - -- (void)setFrame:(NSRect)frame { - [super setFrame:frame]; - if ([self window] && trackingRect) - [self removeTrackingRect:trackingRect]; - trackingRect = [self addTrackingRect:[self bounds] owner:self userData:NULL assumeInside:NO]; -} - -- (void)setFrameSize:(NSSize)size { - [super setFrameSize:size]; - if ([self window] && trackingRect) - [self removeTrackingRect:trackingRect]; - trackingRect = [self addTrackingRect:[self bounds] owner:self userData:NULL assumeInside:NO]; -} - -- (void)setBounds:(NSRect)bounds { - [super setBounds:bounds]; - if ([self window] && trackingRect) - [self removeTrackingRect:trackingRect]; - trackingRect = [self addTrackingRect:[self bounds] owner:self userData:NULL assumeInside:NO]; -} - -- (void)setBoundsSize:(NSSize)size { - [super setBoundsSize:size]; - if ([self window] && trackingRect) - [self removeTrackingRect:trackingRect]; - trackingRect = [self addTrackingRect:[self bounds] owner:self userData:NULL assumeInside:NO]; -} - -- (void)viewWillMoveToWindow:(NSWindow *)newWindow { - if ([self window] && trackingRect) - [self removeTrackingRect:trackingRect]; -} - -- (void)viewDidMoveToWindow { - trackingRect = [self addTrackingRect:[self bounds] owner:self userData:NULL assumeInside:NO]; -} - -- (void)mouseEntered:(NSEvent *)theEvent { - NSTrackingRectTag trackingNumber = [theEvent trackingNumber]; - [super mouseEntered:theEvent]; - if (trackingNumber == trackingRect) { - [[self window] setAcceptsMouseMovedEvents:YES]; - } else if (NSNotFound != [hoverRects indexOfObject:(id)trackingNumber]) { - [[SKPDFHoverWindow sharedHoverWindow] showForAnnotation:(id)[theEvent userData] atPoint:NSZeroPoint]; - hoverRect = trackingNumber; - } -} - -- (void)mouseExited:(NSEvent *)theEvent { - NSTrackingRectTag trackingNumber = [theEvent trackingNumber]; - [super mouseExited:theEvent]; - if (trackingNumber == trackingRect) { - [[self window] setAcceptsMouseMovedEvents:NO]; - } else if (NSNotFound != [hoverRects indexOfObject:(id)trackingNumber]) { - if (hoverRect == trackingNumber) { - [[SKPDFHoverWindow sharedHoverWindow] hide]; - hoverRect = 0; - } - } -} - #pragma mark Actions - (void)delete:(id)sender @@ -632,27 +572,8 @@ if (area == kPDFNoArea || (area == kPDFPageArea && [[page selectionForRect:NSMakeRect(p.x - 30.0, p.y - 40.0, 60.0, 80.0)] string] == nil)) { [self dragWithEvent:theEvent]; } else { - if (nil == activeAnnotation && mouseDownInAnnotation) { - if (modifiers & NSAlternateKeyMask) { - rectSelection = YES; - extendSelection = NO; - [self setCurrentSelection:nil]; - } else if (modifiers & NSShiftKeyMask) { - rectSelection = NO; - extendSelection = YES; - wasSelection = [[self currentSelection] retain]; - if (page == nil) { - p = [self convertPoint:mouseDownLoc fromView:nil]; - page = [self pageForPoint:p nearest:YES]; - p = [self convertPoint:p toPage:page]; - } - [self setCurrentSelection:[[self document] selectionByExtendingSelection:wasSelection toPage:page atPoint:p]]; - } else { - rectSelection = NO; - extendSelection = NO; - [self setCurrentSelection:nil]; - } - } + if (nil == activeAnnotation && mouseDownInAnnotation) + [self selectTextWithEvent:theEvent]; [super mouseDown:theEvent]; } } @@ -700,16 +621,6 @@ } } -static inline NSRect rectWithCorners(NSPoint p1, NSPoint p2) -{ - NSRect rect; - rect.size.width = ABS(p2.x - p1.x); - rect.size.height = ABS(p2.y - p1.y); - rect.origin.x = MIN(p2.x, p1.x); - rect.origin.y = MIN(p2.y, p1.y); - return rect; -} - - (void)mouseDragged:(NSEvent *)theEvent { switch (toolMode) { case SKTextToolMode: @@ -720,36 +631,11 @@ } [self dragAnnotationWithEvent:theEvent]; } else if (nil == activeAnnotation) { - if (mouseDownInAnnotation) { + if (mouseDownInAnnotation) // reimplement text selection behavior so we can select text inside markup annotation bounds rectangles (and have a highlight and strikeout on the same line, for instance), but don't select inside an existing markup annotation - - // if we autoscroll, the mouseDownLoc is no longer correct as a starting point - NSPoint mouseDownLocInDoc = [[self documentView] convertPoint:mouseDownLoc fromView:nil]; - if ([[self documentView] autoscroll:theEvent]) - mouseDownLoc = [[self documentView] convertPoint:mouseDownLocInDoc toView:nil]; - - NSPoint p1 = [self convertPoint:mouseDownLoc fromView:nil]; - PDFPage *page1 = [self pageForPoint:p1 nearest:YES]; - p1 = [self convertPoint:p1 toPage:page1]; - - NSPoint p2 = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - PDFPage *page2 = [self pageForPoint:p2 nearest:YES]; - p2 = [self convertPoint:p2 toPage:page2]; - - PDFSelection *sel = nil; - if (rectSelection) { - // how to handle multipage selection? Preview.app's behavior is screwy as well, so we'll do the same thing - sel = [page1 selectionForRect:rectWithCorners(p1, p2)]; - } else if (extendSelection) { - sel = [[self document] selectionByExtendingSelection:wasSelection toPage:page2 atPoint:p2]; - } else { - sel = [[self document] selectionFromPage:page1 atPoint:p1 toPage:page2 atPoint:p2]; - } - - [self setCurrentSelection:sel]; - } else { + [self selectTextWithEvent:theEvent]; + else [super mouseDragged:theEvent]; - } } break; case SKMoveToolMode: @@ -763,53 +649,12 @@ - (void)mouseMoved:(NSEvent *)theEvent { - // we receive this message whenever we are first responder, so check the location - NSView *clipView = [[[self documentView] enclosingScrollView] contentView]; - NSPoint p = [clipView convertPoint:[theEvent locationInWindow] fromView:nil]; - NSCursor *cursor = nil; + NSCursor *cursor = [self cursorForEvent:theEvent]; + if (cursor) + [cursor set]; + else + [super mouseMoved:theEvent]; - if (NSPointInRect(p, [clipView visibleRect]) == NO || ([navWindow isVisible] && NSPointInRect([NSEvent mouseLocation], [navWindow frame]))) { - cursor = [NSCursor arrowCursor]; - } else if ([theEvent modifierFlags] & NSCommandKeyMask) { - if ([theEvent modifierFlags] & NSShiftKeyMask) - cursor = [NSCursor arrowCursor]; - else - cursor = [NSCursor cameraCursor]; - } else { - switch (toolMode) { - case SKTextToolMode: - { - p = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - PDFPage *page = [self pageForPoint:p nearest:NO]; - p = [self convertPoint:p toPage:page]; - PDFAreaOfInterest area = [self areaOfInterestForMouse:theEvent]; - if ((readingBar && [[readingBar page] isEqual:page] && NSPointInRect(p, [readingBar currentBoundsForBox:[self displayBox]])) || - (area == kPDFNoArea || (area == kPDFPageArea && [[page selectionForRect:NSMakeRect(p.x - 30.0, p.y - 40.0, 60.0, 80.0)] string] == nil))) - cursor = [NSCursor openHandCursor]; - else - [super mouseMoved:theEvent]; - break; - } - case SKMoveToolMode: - cursor = [NSCursor openHandCursor]; - break; - case SKMagnifyToolMode: - if ([self areaOfInterestForMouse:theEvent] == kPDFNoArea) - cursor = [NSCursor openHandCursor]; - else - cursor = ([theEvent modifierFlags] & NSShiftKeyMask) ? [NSCursor zoomOutCursor] : [NSCursor zoomInCursor]; - break; - } - } - [cursor set]; - - p = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - PDFPage *page = [self pageForPoint:p nearest:NO]; - PDFAnnotation *annotation = nil; - - if (page) - annotation = [page annotationAtPoint:[self convertPoint:p toPage:page]]; - if ([[activeAnnotation type] isEqualToString:@"Link"]) { [[SKPDFHoverWindow sharedHoverWindow] hide]; [self setActiveAnnotation:nil]; @@ -1012,6 +857,67 @@ [self setScaleFactor:[self scaleFactor] + 0.5 * dy]; } +- (void)mouseEntered:(NSEvent *)theEvent { + NSTrackingRectTag trackingNumber = [theEvent trackingNumber]; + [super mouseEntered:theEvent]; + if (trackingNumber == trackingRect) { + [[self window] setAcceptsMouseMovedEvents:YES]; + } else if (NSNotFound != [hoverRects indexOfObject:(id)trackingNumber]) { + [[SKPDFHoverWindow sharedHoverWindow] showForAnnotation:(id)[theEvent userData] atPoint:NSZeroPoint]; + hoverRect = trackingNumber; + } +} + +- (void)mouseExited:(NSEvent *)theEvent { + NSTrackingRectTag trackingNumber = [theEvent trackingNumber]; + [super mouseExited:theEvent]; + if (trackingNumber == trackingRect) { + [[self window] setAcceptsMouseMovedEvents:NO]; + } else if (hoverRect == trackingNumber) { + [[SKPDFHoverWindow sharedHoverWindow] hide]; + hoverRect = 0; + } +} + +#pragma mark Tracking mousemoved fix + +- (void)setFrame:(NSRect)frame { + [super setFrame:frame]; + if ([self window] && trackingRect) + [self removeTrackingRect:trackingRect]; + trackingRect = [self addTrackingRect:[self bounds] owner:self userData:NULL assumeInside:NO]; +} + +- (void)setFrameSize:(NSSize)size { + [super setFrameSize:size]; + if ([self window] && trackingRect) + [self removeTrackingRect:trackingRect]; + trackingRect = [self addTrackingRect:[self bounds] owner:self userData:NULL assumeInside:NO]; +} + +- (void)setBounds:(NSRect)bounds { + [super setBounds:bounds]; + if ([self window] && trackingRect) + [self removeTrackingRect:trackingRect]; + trackingRect = [self addTrackingRect:[self bounds] owner:self userData:NULL assumeInside:NO]; +} + +- (void)setBoundsSize:(NSSize)size { + [super setBoundsSize:size]; + if ([self window] && trackingRect) + [self removeTrackingRect:trackingRect]; + trackingRect = [self addTrackingRect:[self bounds] owner:self userData:NULL assumeInside:NO]; +} + +- (void)viewWillMoveToWindow:(NSWindow *)newWindow { + if ([self window] && trackingRect) + [self removeTrackingRect:trackingRect]; +} + +- (void)viewDidMoveToWindow { + trackingRect = [self addTrackingRect:[self bounds] owner:self userData:NULL assumeInside:NO]; +} + #pragma mark UndoManager - (NSUndoManager *)undoManager { @@ -1559,8 +1465,13 @@ autohideTimer = [[NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(autohideTimerFired:) userInfo:nil repeats:NO] retain]; } +- (NSRect)visibleContentRect { + NSView *clipView = [[[self documentView] enclosingScrollView] contentView]; + return [clipView convertRect:[clipView visibleRect] toView:self]; +} + - (NSRange)visiblePageIndexRange { - NSRect visibleRect = [[[self documentView] superview] convertRect:[[[self documentView] superview] visibleRect] toView:self]; + NSRect visibleRect = [self visibleContentRect]; PDFPage *page; unsigned first, last; @@ -1594,7 +1505,7 @@ NSRange range = [self visiblePageIndexRange]; int i, iMax = NSMaxRange(range); - NSRect visibleRect = [[[self documentView] superview] convertRect:[[[self documentView] superview] visibleRect] toView:self]; + NSRect visibleRect = [self visibleContentRect]; for (i = 0; i < iMax; i++) { PDFPage *page = [[self document] pageAtIndex:i]; @@ -2383,9 +2294,63 @@ [NSCursor pop]; // ??? PDFView's delayed layout seems to reset the cursor to an arrow - [self performSelector:@selector(mouseMoved:) withObject:theEvent afterDelay:0]; + [[self cursorForEvent:theEvent] performSelector:@selector(set) withObject:nil afterDelay:0]; } +- (void)selectTextWithEvent:(NSEvent *)theEvent { + if ([theEvent type] == NSLeftMouseDown) { + + unsigned int modifiers = [theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; + + if (modifiers & NSAlternateKeyMask) { + rectSelection = YES; + extendSelection = NO; + [self setCurrentSelection:nil]; + } else if (modifiers & NSShiftKeyMask) { + rectSelection = NO; + extendSelection = YES; + wasSelection = [[self currentSelection] retain]; + NSPoint p = [self convertPoint:[theEvent locationInWindow] fromView:nil]; + PDFPage *page = [self pageForPoint:p nearest:YES]; + p = [self convertPoint:p toPage:page]; + [self setCurrentSelection:[[self document] selectionByExtendingSelection:wasSelection toPage:page atPoint:p]]; + } else { + rectSelection = NO; + extendSelection = NO; + [self setCurrentSelection:nil]; + } + + } else if ([theEvent type] == NSLeftMouseDragged) { + // reimplement text selection behavior so we can select text inside markup annotation bounds rectangles (and have a highlight and strikeout on the same line, for instance), but don't select inside an existing markup annotation + + // if we autoscroll, the mouseDownLoc is no longer correct as a starting point + NSPoint mouseDownLocInDoc = [[self documentView] convertPoint:mouseDownLoc fromView:nil]; + if ([[self documentView] autoscroll:theEvent]) + mouseDownLoc = [[self documentView] convertPoint:mouseDownLocInDoc toView:nil]; + + NSPoint p1 = [self convertPoint:mouseDownLoc fromView:nil]; + PDFPage *page1 = [self pageForPoint:p1 nearest:YES]; + p1 = [self convertPoint:p1 toPage:page1]; + + NSPoint p2 = [self convertPoint:[theEvent locationInWindow] fromView:nil]; + PDFPage *page2 = [self pageForPoint:p2 nearest:YES]; + p2 = [self convertPoint:p2 toPage:page2]; + + PDFSelection *sel = nil; + if (rectSelection) { + // how to handle multipage selection? Preview.app's behavior is screwy as well, so we'll do the same thing + sel = [page1 selectionForRect:NSMakeRect(fmin(p2.x, p1.x), fmin(p2.y, p1.y), fabs(p2.x - p1.x), fabs(p2.y - p1.y))]; + } else if (extendSelection) { + sel = [[self document] selectionByExtendingSelection:wasSelection toPage:page2 atPoint:p2]; + } else { + sel = [[self document] selectionFromPage:page1 atPoint:p1 toPage:page2 atPoint:p2]; + } + + [self setCurrentSelection:sel]; + + } +} + - (void)dragReadingBarWithEvent:(NSEvent *)theEvent { BOOL keepGoing = YES; PDFPage *page = [readingBar page]; @@ -2434,7 +2399,7 @@ [NSCursor pop]; // ??? PDFView's delayed layout seems to reset the cursor to an arrow - [self performSelector:@selector(mouseMoved:) withObject:theEvent afterDelay:0]; + [[self cursorForEvent:theEvent] performSelector:@selector(set) withObject:nil afterDelay:0]; } - (void)selectSnapshotWithEvent:(NSEvent *)theEvent { @@ -2685,6 +2650,43 @@ } } +- (NSCursor *)cursorForEvent:(NSEvent *)theEvent { + NSPoint p = [self convertPoint:[theEvent locationInWindow] fromView:nil]; + NSCursor *cursor = nil; + + 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) + cursor = [NSCursor arrowCursor]; + else + cursor = [NSCursor cameraCursor]; + } else { + switch (toolMode) { + case SKTextToolMode: + { + PDFPage *page = [self pageForPoint:p nearest:NO]; + p = [self convertPoint:p toPage:page]; + PDFAreaOfInterest area = [self areaOfInterestForMouse:theEvent]; + if ((readingBar && [[readingBar page] isEqual:page] && NSPointInRect(p, [readingBar currentBoundsForBox:[self displayBox]])) || + (area == kPDFNoArea || (area == kPDFPageArea && [[page selectionForRect:NSMakeRect(p.x - 30.0, p.y - 40.0, 60.0, 80.0)] string] == nil))) + cursor = [NSCursor openHandCursor]; + break; + } + case SKMoveToolMode: + cursor = [NSCursor openHandCursor]; + break; + case SKMagnifyToolMode: + if ([self areaOfInterestForMouse:theEvent] == kPDFNoArea) + cursor = [NSCursor openHandCursor]; + else + cursor = ([theEvent modifierFlags] & NSShiftKeyMask) ? [NSCursor zoomOutCursor] : [NSCursor zoomInCursor]; + break; + } + } + return cursor; +} + @end #pragma mark Core Graphics extension Modified: trunk/SKSnapshotWindowController.h =================================================================== --- trunk/SKSnapshotWindowController.h 2007-04-30 20:14:21 UTC (rev 1943) +++ trunk/SKSnapshotWindowController.h 2007-05-01 11:13:10 UTC (rev 1944) @@ -49,6 +49,7 @@ BOOL forceOnTop; } - (void)setPdfDocument:(PDFDocument *)pdfDocument scaleFactor:(float)factor goToPageNumber:(int)pageNum rect:(NSRect)rect; +- (BOOL)isPageVisible:(PDFPage *)page; - (id)delegate; - (void)setDelegate:(id)newDelegate; - (PDFView *)pdfView; Modified: trunk/SKSnapshotWindowController.m =================================================================== --- trunk/SKSnapshotWindowController.m 2007-04-30 20:14:21 UTC (rev 1943) +++ trunk/SKSnapshotWindowController.m 2007-05-01 11:13:10 UTC (rev 1944) @@ -211,6 +211,17 @@ [self performSelector:@selector(goToDestination:) withObject:dest afterDelay:0.1]; } +- (BOOL)isPageVisible:(PDFPage *)page { + NSView *clipView = [[[pdfView documentView] enclosingScrollView] contentView]; + NSRect visibleRect = [clipView convertRect:[clipView visibleRect] toView:pdfView]; + unsigned first, last, index = [[pdfView document] indexForPage:page]; + + first = [[pdfView document] indexForPage:[pdfView pageForPoint:NSMakePoint(NSMinX(visibleRect), NSMaxY(visibleRect)) nearest:YES]]; + last = [[pdfView document] indexForPage:[pdfView pageForPoint:NSMakePoint(NSMaxX(visibleRect), NSMinY(visibleRect)) nearest:YES]]; + + return index >= first && index <= last; +} + #pragma mark Acessors - (id)delegate { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-30 20:14:23
|
Revision: 1943 http://skim-app.svn.sourceforge.net/skim-app/?rev=1943&view=rev Author: hofman Date: 2007-04-30 13:14:21 -0700 (Mon, 30 Apr 2007) Log Message: ----------- Make radius of link highlight dependent on height. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-30 19:57:07 UTC (rev 1942) +++ trunk/SKPDFView.m 2007-04-30 20:14:21 UTC (rev 1943) @@ -243,7 +243,7 @@ float color[4] = { 0.0, 0.0, 0.0, 1.0 }; NSRect rect = NSInsetRect(NSIntegralRect(bounds), 0.5 * lineWidth, 0.5 * lineWidth); if (isLink) { - CGMutablePathRef path = SKCGCreatePathWithRoundRectInRect(*(CGRect *)&rect, 2.0); + CGMutablePathRef path = SKCGCreatePathWithRoundRectInRect(*(CGRect *)&rect, floorf(0.3 * NSHeight(rect))); color[3] = 0.1; CGContextSetFillColor(context, color); CGContextBeginPath(context); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-30 19:57:10
|
Revision: 1942 http://skim-app.svn.sourceforge.net/skim-app/?rev=1942&view=rev Author: hofman Date: 2007-04-30 12:57:07 -0700 (Mon, 30 Apr 2007) Log Message: ----------- Improve dirtying of rect on a page. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-30 18:34:32 UTC (rev 1941) +++ trunk/SKPDFView.m 2007-04-30 19:57:07 UTC (rev 1942) @@ -309,18 +309,23 @@ - (void)setNeedsDisplayInRect:(NSRect)rect ofPage:(PDFPage *)page { NSRect aRect = [self convertRect:rect fromPage:page]; float scale = [self scaleFactor]; - NSPoint max = NSMakePoint(ceilf(NSMaxX(aRect)) + scale, ceilf(NSMaxY(aRect)) + scale); - NSPoint origin = NSMakePoint(floorf(NSMinX(aRect)) - scale, floorf(NSMinY(aRect)) - scale); + float maxX = ceilf(NSMaxX(aRect) + scale); + float maxY = ceilf(NSMaxY(aRect) + scale); + float minX = floorf(NSMinX(aRect) - scale); + float minY = floorf(NSMinY(aRect) - scale); - [self setNeedsDisplayInRect:NSMakeRect(origin.x, origin.y, max.x - origin.x, max.y - origin.y)]; + aRect = NSIntersectionRect([self bounds], NSMakeRect(minX, minY, maxX - minX, maxY - minY)); + if (NSIsEmptyRect(aRect) == NO) + [self setNeedsDisplayInRect:aRect]; } - (void)setNeedsDisplayForAnnotation:(PDFAnnotation *)annotation { NSRect bounds = [annotation bounds]; if ([[annotation type] isEqualToString:@"Underline"]) { - bounds.origin.y -= 0.03 * NSHeight(bounds); - bounds.size.height *= 1.03; - } else if ([[annotation type] isEqualToString:@"Line"] && [annotation isEqual:activeAnnotation]) { + float delta = 0.03 * NSHeight(bounds); + bounds.origin.y -= delta; + bounds.size.height += delta; + } else if ([[annotation type] isEqualToString:@"Line"]) { bounds = NSInsetRect(bounds, -4.0, -4.0); } [self setNeedsDisplayInRect:bounds ofPage:[annotation page]]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ama...@us...> - 2007-04-30 18:34:33
|
Revision: 1941 http://skim-app.svn.sourceforge.net/skim-app/?rev=1941&view=rev Author: amaxwell Date: 2007-04-30 11:34:32 -0700 (Mon, 30 Apr 2007) Log Message: ----------- pass nil instead of NO Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-30 18:31:57 UTC (rev 1940) +++ trunk/SKPDFView.m 2007-04-30 18:34:32 UTC (rev 1941) @@ -631,7 +631,7 @@ if (modifiers & NSAlternateKeyMask) { rectSelection = YES; extendSelection = NO; - [self setCurrentSelection:NO]; + [self setCurrentSelection:nil]; } else if (modifiers & NSShiftKeyMask) { rectSelection = NO; extendSelection = YES; @@ -645,7 +645,7 @@ } else { rectSelection = NO; extendSelection = NO; - [self setCurrentSelection:NO]; + [self setCurrentSelection:nil]; } } [super mouseDown:theEvent]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-30 18:31:58
|
Revision: 1940 http://skim-app.svn.sourceforge.net/skim-app/?rev=1940&view=rev Author: hofman Date: 2007-04-30 11:31:57 -0700 (Mon, 30 Apr 2007) Log Message: ----------- Remove annotation from the correct page. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-30 18:27:52 UTC (rev 1939) +++ trunk/SKPDFView.m 2007-04-30 18:31:57 UTC (rev 1940) @@ -1187,10 +1187,10 @@ [[[self undoManager] prepareWithInvocationTarget:self] moveAnnotation:annotation toPage:oldPage]; [self setNeedsDisplayForAnnotation:annotation]; [annotation retain]; - [page removeAnnotation:annotation]; + [oldPage removeAnnotation:annotation]; [page addAnnotation:annotation]; + [annotation release]; [self setNeedsDisplayForAnnotation:annotation]; - [annotation release]; [[NSNotificationCenter defaultCenter] postNotificationName:SKPDFViewDidMoveAnnotationNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:oldPage, @"oldPage", page, @"newPage", annotation, @"annotation", nil]]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-30 18:27:53
|
Revision: 1939 http://skim-app.svn.sourceforge.net/skim-app/?rev=1939&view=rev Author: hofman Date: 2007-04-30 11:27:52 -0700 (Mon, 30 Apr 2007) Log Message: ----------- Handle moving notes to another page separately, instead of remove+add. Modified Paths: -------------- trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/SKPDFView.h trunk/SKPDFView.m Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2007-04-30 11:04:51 UTC (rev 1938) +++ trunk/SKMainWindowController.h 2007-04-30 18:27:52 UTC (rev 1939) @@ -317,6 +317,7 @@ - (void)handleDidChangeActiveAnnotationNotification:(NSNotification *)notification; - (void)handleDidAddAnnotationNotification:(NSNotification *)notification; - (void)handleDidRemoveAnnotationNotification:(NSNotification *)notification; +- (void)handleDidMoveAnnotationNotification:(NSNotification *)notification; - (void)handleDoubleClickedAnnotationNotification:(NSNotification *)notification; - (void)handleAnnotationDidChangeNotification:(NSNotification *)notification; - (void)handleDocumentBeginWrite:(NSNotification *)notification; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-04-30 11:04:51 UTC (rev 1938) +++ trunk/SKMainWindowController.m 2007-04-30 18:27:52 UTC (rev 1939) @@ -286,6 +286,8 @@ name:SKPDFViewDidAddAnnotationNotification object:pdfView]; [nc addObserver:self selector:@selector(handleDidRemoveAnnotationNotification:) name:SKPDFViewDidRemoveAnnotationNotification object:pdfView]; + [nc addObserver:self selector:@selector(handleDidMoveAnnotationNotification:) + name:SKPDFViewDidMoveAnnotationNotification object:pdfView]; [nc addObserver:self selector:@selector(handleDoubleClickedAnnotationNotification:) name:SKPDFViewAnnotationDoubleClickedNotification object:pdfView]; [nc addObserver:self selector:@selector(handleAnnotationDidChangeNotification:) @@ -1880,6 +1882,25 @@ [noteOutlineView reloadData]; } +- (void)handleDidMoveAnnotationNotification:(NSNotification *)notification { + PDFPage *oldPage = [[notification userInfo] objectForKey:@"oldPage"]; + PDFPage *newPage = [[notification userInfo] objectForKey:@"newPage"]; + + if (oldPage || newPage) { + [self thumbnailNeedsUpdate:[[self thumbnails] objectAtIndex:[[pdfView document] indexForPage:oldPage]]]; + [self thumbnailNeedsUpdate:[[self thumbnails] objectAtIndex:[[pdfView document] indexForPage:newPage]]]; + NSEnumerator *snapshotEnum = [snapshots objectEnumerator]; + SKSnapshotWindowController *wc; + while (wc = [snapshotEnum nextObject]) { + if ([[[wc pdfView] currentPage] isEqual:oldPage] || [[[wc pdfView] currentPage] isEqual:newPage]) + [self snapshotNeedsUpdate:wc]; + } + } + + [noteArrayController rearrangeObjects]; + [noteOutlineView reloadData]; +} + - (void)handleDoubleClickedAnnotationNotification:(NSNotification *)notification { PDFAnnotation *annotation = [[notification userInfo] objectForKey:@"annotation"]; Modified: trunk/SKPDFView.h =================================================================== --- trunk/SKPDFView.h 2007-04-30 11:04:51 UTC (rev 1938) +++ trunk/SKPDFView.h 2007-04-30 18:27:52 UTC (rev 1939) @@ -44,6 +44,7 @@ extern NSString *SKPDFViewActiveAnnotationDidChangeNotification; extern NSString *SKPDFViewDidAddAnnotationNotification; extern NSString *SKPDFViewDidRemoveAnnotationNotification; +extern NSString *SKPDFViewDidMoveAnnotationNotification; extern NSString *SKPDFViewAnnotationDoubleClickedNotification; extern NSString *SKSkimNotePboardType; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-30 11:04:51 UTC (rev 1938) +++ trunk/SKPDFView.m 2007-04-30 18:27:52 UTC (rev 1939) @@ -57,6 +57,7 @@ NSString *SKPDFViewActiveAnnotationDidChangeNotification = @"SKPDFViewActiveAnnotationDidChangeNotification"; NSString *SKPDFViewDidAddAnnotationNotification = @"SKPDFViewDidAddAnnotationNotification"; NSString *SKPDFViewDidRemoveAnnotationNotification = @"SKPDFViewDidRemoveAnnotationNotification"; +NSString *SKPDFViewDidMoveAnnotationNotification = @"SKPDFViewDidMoveAnnotationNotification"; NSString *SKPDFViewAnnotationDoubleClickedNotification = @"SKPDFViewAnnotationDoubleClickedNotification"; NSString *SKSkimNotePboardType = @"SKSkimNotePboardType"; @@ -1181,6 +1182,18 @@ [wasAnnotation release]; } +- (void)moveAnnotation:(PDFAnnotation *)annotation toPage:(PDFPage *)page { + PDFPage *oldPage = [annotation page]; + [[[self undoManager] prepareWithInvocationTarget:self] moveAnnotation:annotation toPage:oldPage]; + [self setNeedsDisplayForAnnotation:annotation]; + [annotation retain]; + [page removeAnnotation:annotation]; + [page addAnnotation:annotation]; + [self setNeedsDisplayForAnnotation:annotation]; + [annotation release]; + [[NSNotificationCenter defaultCenter] postNotificationName:SKPDFViewDidMoveAnnotationNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:oldPage, @"oldPage", page, @"newPage", annotation, @"annotation", nil]]; +} + - (void)editThisAnnotation:(id)sender { PDFAnnotation *annotation = [sender representedObject]; @@ -2302,11 +2315,7 @@ } else { if (newActivePage != activePage) { // move the annotation to the new page - PDFAnnotation *saveActiveAnnotation = [activeAnnotation retain]; - [self removeAnnotation:saveActiveAnnotation]; - [self addAnnotation:saveActiveAnnotation toPage:newActivePage]; - [self setActiveAnnotation:saveActiveAnnotation]; - [saveActiveAnnotation release]; + [self moveAnnotation:activeAnnotation toPage:newActivePage]; activePage = newActivePage; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-30 11:05:11
|
Revision: 1938 http://skim-app.svn.sourceforge.net/skim-app/?rev=1938&view=rev Author: hofman Date: 2007-04-30 04:04:51 -0700 (Mon, 30 Apr 2007) Log Message: ----------- Add arrow as default toolbar item Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-04-30 10:59:35 UTC (rev 1937) +++ trunk/SKMainWindowController.m 2007-04-30 11:04:51 UTC (rev 1938) @@ -2997,7 +2997,8 @@ NSToolbarSeparatorItemIdentifier, SKDocumentToolbarNewNoteItemIdentifier, SKDocumentToolbarNewCircleNoteItemIdentifier, - SKDocumentToolbarNewMarkupItemIdentifier, nil]; + SKDocumentToolbarNewMarkupItemIdentifier, + SKDocumentToolbarNewArrowItemIdentifier, nil]; } - (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-30 10:59:36
|
Revision: 1937 http://skim-app.svn.sourceforge.net/skim-app/?rev=1937&view=rev Author: hofman Date: 2007-04-30 03:59:35 -0700 (Mon, 30 Apr 2007) Log Message: ----------- fix typos in method names Modified Paths: -------------- trunk/SKPDFAnnotationNote.m Modified: trunk/SKPDFAnnotationNote.m =================================================================== --- trunk/SKPDFAnnotationNote.m 2007-04-30 10:08:46 UTC (rev 1936) +++ trunk/SKPDFAnnotationNote.m 2007-04-30 10:59:35 UTC (rev 1937) @@ -165,7 +165,7 @@ return page ? [[page document] indexForPage:page] : NSNotFound; } -- (void)replecamentSetBounds:(NSRect)bounds { +- (void)replacementSetBounds:(NSRect)bounds { if ([self isNoteAnnotation]) { [[[self undoManager] prepareWithInvocationTarget:self] setBounds:[self bounds]]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationWillChangeNotification @@ -177,7 +177,7 @@ object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; } -- (void)replecamentSetContents:(NSString *)contents { +- (void)replacementSetContents:(NSString *)contents { if ([self isNoteAnnotation]) [[[self undoManager] prepareWithInvocationTarget:self] setContents:[self contents]]; originalSetContents(self, _cmd, contents); @@ -186,7 +186,7 @@ object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"contents", @"key", nil]]; } -- (void)replecamentSetColor:(NSColor *)color { +- (void)replacementSetColor:(NSColor *)color { if ([self isNoteAnnotation]) [[[self undoManager] prepareWithInvocationTarget:self] setColor:[self color]]; originalSetColor(self, _cmd, color); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-30 10:10:08
|
Revision: 1936 http://skim-app.svn.sourceforge.net/skim-app/?rev=1936&view=rev Author: hofman Date: 2007-04-30 03:08:46 -0700 (Mon, 30 Apr 2007) Log Message: ----------- Use method swizzling for override of common setters. Modified Paths: -------------- trunk/SKPDFAnnotationNote.m Modified: trunk/SKPDFAnnotationNote.m =================================================================== --- trunk/SKPDFAnnotationNote.m 2007-04-30 09:50:05 UTC (rev 1935) +++ trunk/SKPDFAnnotationNote.m 2007-04-30 10:08:46 UTC (rev 1936) @@ -41,6 +41,7 @@ #import "PDFPage_SKExtensions.h" #import "PDFSelection_SKExtensions.h" #import "SKPDFView.h" +#import "OBUtilities.h" enum { SKASTextNote = 'NTxt', @@ -74,8 +75,25 @@ @end +@interface PDFAnnotation (SKPDFAnnotationPrivate) +- (void)replacementSetBounds:(NSRect)bounds; +- (void)replacementSetContents:(NSString *)contents; +- (void)replacementSetColor:(NSColor *)color; +@end + + @implementation PDFAnnotation (SKExtensions) +static IMP originalSetBounds = NULL; +static IMP originalSetContents = NULL; +static IMP originalSetColor = NULL; + ++ (void)load { + originalSetBounds = OBReplaceMethodImplementationWithSelector(self, @selector(setBounds:), @selector(replacementSetBounds:)); + originalSetContents = OBReplaceMethodImplementationWithSelector(self, @selector(setContents:), @selector(replacementSetContents:)); + originalSetColor = OBReplaceMethodImplementationWithSelector(self, @selector(setColor:), @selector(replacementSetColor:)); +} + - (id)initWithDictionary:(NSDictionary *)dict{ [[self initWithBounds:NSZeroRect] release]; @@ -147,6 +165,36 @@ return page ? [[page document] indexForPage:page] : NSNotFound; } +- (void)replecamentSetBounds:(NSRect)bounds { + if ([self isNoteAnnotation]) { + [[[self undoManager] prepareWithInvocationTarget:self] setBounds:[self bounds]]; + [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationWillChangeNotification + object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; + } + originalSetBounds(self, _cmd, bounds); + if ([self isNoteAnnotation]) + [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification + object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; +} + +- (void)replecamentSetContents:(NSString *)contents { + if ([self isNoteAnnotation]) + [[[self undoManager] prepareWithInvocationTarget:self] setContents:[self contents]]; + originalSetContents(self, _cmd, contents); + if ([self isNoteAnnotation]) + [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification + object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"contents", @"key", nil]]; +} + +- (void)replecamentSetColor:(NSColor *)color { + if ([self isNoteAnnotation]) + [[[self undoManager] prepareWithInvocationTarget:self] setColor:[self color]]; + originalSetColor(self, _cmd, color); + if ([self isNoteAnnotation]) + [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification + object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"color", @"key", nil]]; +} + - (NSImage *)image { return nil; } - (NSAttributedString *)text { return nil; } @@ -312,29 +360,6 @@ - (BOOL)shouldPrint { return YES; } -- (void)setBounds:(NSRect)bounds { - [[[self undoManager] prepareWithInvocationTarget:self] setBounds:[self bounds]]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationWillChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; - [super setBounds:bounds]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; -} - -- (void)setContents:(NSString *)contents { - [[[self undoManager] prepareWithInvocationTarget:self] setContents:[self contents]]; - [super setContents:contents]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"contents", @"key", nil]]; -} - -- (void)setColor:(NSColor *)color { - [[[self undoManager] prepareWithInvocationTarget:self] setColor:[self color]]; - [super setColor:color]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"color", @"key", nil]]; -} - @end #pragma mark - @@ -357,29 +382,6 @@ - (BOOL)shouldPrint { return YES; } -- (void)setBounds:(NSRect)bounds { - [[[self undoManager] prepareWithInvocationTarget:self] setBounds:[self bounds]]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationWillChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; - [super setBounds:bounds]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; -} - -- (void)setContents:(NSString *)contents { - [[[self undoManager] prepareWithInvocationTarget:self] setContents:[self contents]]; - [super setContents:contents]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"contents", @"key", nil]]; -} - -- (void)setColor:(NSColor *)color { - [[[self undoManager] prepareWithInvocationTarget:self] setColor:[self color]]; - [super setColor:color]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"color", @"key", nil]]; -} - @end #pragma mark - @@ -608,29 +610,6 @@ - (BOOL)shouldPrint { return YES; } -- (void)setBounds:(NSRect)bounds { - [[[self undoManager] prepareWithInvocationTarget:self] setBounds:[self bounds]]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationWillChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; - [super setBounds:bounds]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; -} - -- (void)setContents:(NSString *)contents { - [[[self undoManager] prepareWithInvocationTarget:self] setContents:[self contents]]; - [super setContents:contents]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"contents", @"key", nil]]; -} - -- (void)setColor:(NSColor *)color { - [[[self undoManager] prepareWithInvocationTarget:self] setColor:[self color]]; - [super setColor:color]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"color", @"key", nil]]; -} - // fix a bug in PDFKit, the color space sometimes is not correct - (void)drawWithBox:(CGPDFBox)box inContext:(CGContextRef)context { CGContextSaveGState(context); @@ -673,29 +652,6 @@ - (BOOL)shouldPrint { return YES; } -- (void)setBounds:(NSRect)bounds { - [[[self undoManager] prepareWithInvocationTarget:self] setBounds:[self bounds]]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationWillChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; - [super setBounds:bounds]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; -} - -- (void)setContents:(NSString *)contents { - [[[self undoManager] prepareWithInvocationTarget:self] setContents:[self contents]]; - [super setContents:contents]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"contents", @"key", nil]]; -} - -- (void)setColor:(NSColor *)color { - [[[self undoManager] prepareWithInvocationTarget:self] setColor:[self color]]; - [super setColor:color]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"color", @"key", nil]]; -} - - (void)setFont:(NSFont *)font { [[[self undoManager] prepareWithInvocationTarget:self] setFont:[self font]]; [super setFont:font]; @@ -752,29 +708,6 @@ - (BOOL)shouldPrint { return YES; } -- (void)setBounds:(NSRect)bounds { - [[[self undoManager] prepareWithInvocationTarget:self] setBounds:[self bounds]]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationWillChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; - [super setBounds:bounds]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; -} - -- (void)setContents:(NSString *)contents { - [[[self undoManager] prepareWithInvocationTarget:self] setContents:[self contents]]; - [super setContents:contents]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"contents", @"key", nil]]; -} - -- (void)setColor:(NSColor *)color { - [[[self undoManager] prepareWithInvocationTarget:self] setColor:[self color]]; - [super setColor:color]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"color", @"key", nil]]; -} - - (NSString *)type { return @"Note"; } @@ -899,29 +832,6 @@ object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"endPoint", @"key", nil]]; } -- (void)setBounds:(NSRect)bounds { - [[[self undoManager] prepareWithInvocationTarget:self] setBounds:[self bounds]]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationWillChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; - [super setBounds:bounds]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; -} - -- (void)setContents:(NSString *)contents { - [[[self undoManager] prepareWithInvocationTarget:self] setContents:[self contents]]; - [super setContents:contents]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"contents", @"key", nil]]; -} - -- (void)setColor:(NSColor *)color { - [[[self undoManager] prepareWithInvocationTarget:self] setColor:[self color]]; - [super setColor:color]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification - object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"color", @"key", nil]]; -} - - (BOOL)hitTest:(NSPoint)point { NSRect bounds = [self bounds]; NSPoint startPoint = [self startPoint]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-30 09:50:07
|
Revision: 1935 http://skim-app.svn.sourceforge.net/skim-app/?rev=1935&view=rev Author: hofman Date: 2007-04-30 02:50:05 -0700 (Mon, 30 Apr 2007) Log Message: ----------- Some code improvements. Modified Paths: -------------- trunk/SKDocument.h trunk/SKDocument.m trunk/SKPDFAnnotationNote.m Modified: trunk/SKDocument.h =================================================================== --- trunk/SKDocument.h 2007-04-29 20:16:10 UTC (rev 1934) +++ trunk/SKDocument.h 2007-04-30 09:50:05 UTC (rev 1935) @@ -87,9 +87,6 @@ - (NSDictionary *)currentDocumentSetup; -- (void)checkFileUpdatesIfNeeded; -- (void)checkFileUpdateStatus:(NSTimer *)timer; - - (SKPDFSynchronizer *)synchronizer; - (void)handleApplicationWillTerminateNotification:(NSNotification *)notification; Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-04-29 20:16:10 UTC (rev 1934) +++ trunk/SKDocument.m 2007-04-30 09:50:05 UTC (rev 1935) @@ -66,6 +66,20 @@ NSString *SKDocumentWillSaveNotification = @"SKDocumentWillSaveNotification"; + +@interface SKDocument (Private) + +- (void)setPDFData:(NSData *)data; +- (void)setPDFDoc:(PDFDocument *)doc; +- (void)setNoteDicts:(NSArray *)array; +- (void)setLastChangedDate:(NSDate *)date; + +- (void)checkFileUpdatesIfNeeded; +- (void)checkFileUpdateStatus:(NSTimer *)timer; + +@end + + @implementation SKDocument + (void)initialize { @@ -105,8 +119,7 @@ pdfDocument = nil; [mainController setAnnotationsFromDictionaries:noteDicts]; - [noteDicts release]; - noteDicts = nil; + [self setNoteDicts:nil]; [self checkFileUpdatesIfNeeded]; @@ -170,8 +183,7 @@ if (saveOperation == NSSaveOperation || saveOperation == NSSaveAsOperation) { [[self undoManager] removeAllActions]; [self updateChangeCount:NSChangeCleared]; - [lastChangedDate release]; - lastChangedDate = [[[fm fileAttributesAtPath:[absoluteURL path] traverseLink:YES] fileModificationDate] retain]; + [self setLastChangedDate:[[fm fileAttributesAtPath:[absoluteURL path] traverseLink:YES] fileModificationDate]]; } } @@ -212,57 +224,67 @@ - (BOOL)revertToContentsOfURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError{ if ([super revertToContentsOfURL:absoluteURL ofType:typeName error:outError]) { - if ([typeName isEqualToString:SKNotesDocumentType] == NO) { - [[self mainWindowController] setPdfDocument:pdfDocument]; - [pdfDocument autorelease]; - pdfDocument = nil; - [[self undoManager] removeAllActions]; - } else { - // Should this now be one? - [self updateChangeCount:NSChangeCleared]; - } + [[self mainWindowController] setPdfDocument:pdfDocument]; + [pdfDocument autorelease]; + pdfDocument = nil; if (noteDicts) { [[self mainWindowController] setAnnotationsFromDictionaries:noteDicts]; - [noteDicts release]; - noteDicts = nil; + [self setNoteDicts:nil]; } + [[self undoManager] removeAllActions]; return YES; } else return NO; } - (void)setPDFData:(NSData *)data { - [pdfData autorelease]; - pdfData = [data copy]; + if (pdfData != data) { + [pdfData release]; + pdfData = [data retain]; + } } -- (void)setPDFDocument:(PDFDocument *)doc { - [pdfDocument autorelease]; - pdfDocument = [doc retain]; +- (void)setPDFDoc:(PDFDocument *)doc { + if (pdfDocument != doc) { + [pdfDocument release]; + pdfDocument = [doc retain]; + } } +- (void)setNoteDicts:(NSArray *)array { + if (noteDicts != array) { + [noteDicts autorelease]; + noteDicts = [array retain]; + } +} + +- (void)setLastChangedDate:(NSDate *)date { + if (lastChangedDate != date) { + [lastChangedDate release]; + lastChangedDate = [date retain]; + } +} + - (BOOL)readFromData:(NSData *)data ofType:(NSString *)docType error:(NSError **)outError; { BOOL didRead = NO; PDFDocument *pdfDoc = nil; NSError *error = nil; - if ([docType isEqualToString:SKPDFDocumentType]) { - pdfDoc = [[PDFDocument alloc] initWithData:data]; - } else if ([docType isEqualToString:SKPostScriptDocumentType]) { - SKPSProgressController *progressController = [[SKPSProgressController alloc] init]; - if (data = [progressController PDFDataWithPostScriptData:data]) - pdfDoc = [[PDFDocument alloc] initWithData:data]; - [progressController autorelease]; + if ([docType isEqualToString:SKPostScriptDocumentType]) { + SKPSProgressController *progressController = [[[SKPSProgressController alloc] init] autorelease]; + data = [progressController PDFDataWithPostScriptData:data]; } + if (data) + pdfDoc = [[PDFDocument alloc] initWithData:data]; + [self setPDFData:data]; - [self setPDFDocument:pdfDoc]; - [pdfDoc release]; + [self setPDFDoc:pdfDoc]; if (pdfDoc) { + [pdfDoc release]; didRead = YES; - [lastChangedDate release]; - lastChangedDate = nil; + [self setLastChangedDate:nil]; } if (didRead == NO && outError != NULL) @@ -303,8 +325,7 @@ if ([alert runModal] == NSAlertDefaultReturn) { NSArray *array = [NSKeyedUnarchiver unarchiveObjectWithFile:path]; if (array) { - [noteDicts release]; - noteDicts = [array copy]; + [self setNoteDicts:array]; [self updateChangeCount:NSChangeDone]; } } @@ -324,11 +345,10 @@ if (pdfDoc) { didRead = YES; [self setPDFData:data]; - [self setPDFDocument:pdfDoc]; + [self setPDFDoc:pdfDoc]; [pdfDoc release]; [data release]; - [lastChangedDate release]; - lastChangedDate = [[[[NSFileManager defaultManager] fileAttributesAtPath:[absoluteURL path] traverseLink:YES] fileModificationDate] retain]; + [self setLastChangedDate:[[[NSFileManager defaultManager] fileAttributesAtPath:[absoluteURL path] traverseLink:YES] fileModificationDate]]; } else { [self setPDFData:nil]; } @@ -381,21 +401,18 @@ NSData *data = [fm extendedAttributeNamed:@"net_sourceforge_skim-app_notes" atPath:[aURL path] traverseLink:YES error:&error]; - if (noteDicts) - [noteDicts release]; - noteDicts = nil; + if ([data length]) + [self setNoteDicts:[NSKeyedUnarchiver unarchiveObjectWithData:data]]; + else + [self setNoteDicts:nil]; - if ([data length]) - noteDicts = [[NSKeyedUnarchiver unarchiveObjectWithData:data] retain]; - } else { success = NO; if(error == nil && outError) *outError = [NSError errorWithDomain:NSPOSIXErrorDomain code:ENOENT userInfo:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"The file does not exist or is not a file.", @"Error description"), NSLocalizedDescriptionKey, nil]]; } if (success == NO) { - [noteDicts release]; - noteDicts = nil; + [self setNoteDicts:nil]; } return success; } @@ -503,8 +520,7 @@ NSDate *changeDate = (NSDate *)contextInfo; if (returnCode == NSAlertOtherReturn) { - [lastChangedDate release]; - lastChangedDate = changeDate; + [self setLastChangedDate:changeDate]; autoUpdate = NO; } else { NSError *error = nil; @@ -512,8 +528,7 @@ [changeDate release]; } else { [NSApp presentError:error]; - [lastChangedDate release]; - lastChangedDate = changeDate; + [self setLastChangedDate:changeDate]; } if (returnCode == NSAlertAlternateReturn) autoUpdate = YES; Modified: trunk/SKPDFAnnotationNote.m =================================================================== --- trunk/SKPDFAnnotationNote.m 2007-04-29 20:16:10 UTC (rev 1934) +++ trunk/SKPDFAnnotationNote.m 2007-04-30 09:50:05 UTC (rev 1935) @@ -264,7 +264,6 @@ - (void)setBoundsAsQDRect:(NSData *)inQDBoundsAsData { if ([inQDBoundsAsData length] == sizeof(Rect)) { const Rect *qdBounds = (const Rect *)[inQDBoundsAsData bytes]; - SKPDFView *pdfView = [[[self page] containingDocument] pdfView]; NSRect newBounds = NSRectFromRect(*qdBounds); if ([self isResizable] == NO) newBounds.size = [self bounds].size; @@ -953,7 +952,6 @@ - (void)setStartPointAsQDPoint:(NSData *)inQDPointAsData { if ([inQDPointAsData length] == sizeof(Rect)) { const Point *qdPoint = (const Point *)[inQDPointAsData bytes]; - SKPDFView *pdfView = [[[self page] containingDocument] pdfView]; NSPoint newPoint = NSPointFromPoint(*qdPoint); newPoint.x += 0.5; newPoint.y += 0.5; @@ -978,7 +976,6 @@ - (void)setEndPointAsQDPoint:(NSData *)inQDPointAsData { if ([inQDPointAsData length] == sizeof(Rect)) { const Point *qdPoint = (const Point *)[inQDPointAsData bytes]; - SKPDFView *pdfView = [[[self page] containingDocument] pdfView]; NSPoint newPoint = NSPointFromPoint(*qdPoint); newPoint.x += 0.5; newPoint.y += 0.5; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-29 20:16:19
|
Revision: 1934 http://skim-app.svn.sourceforge.net/skim-app/?rev=1934&view=rev Author: hofman Date: 2007-04-29 13:16:10 -0700 (Sun, 29 Apr 2007) Log Message: ----------- Update release notes. Modified Paths: -------------- trunk/Dutch.lproj/ReleaseNotes.rtf trunk/English.lproj/ReleaseNotes.rtf trunk/Italian.lproj/ReleaseNotes.rtf Modified: trunk/Dutch.lproj/ReleaseNotes.rtf =================================================================== --- trunk/Dutch.lproj/ReleaseNotes.rtf 2007-04-29 19:58:09 UTC (rev 1933) +++ trunk/Dutch.lproj/ReleaseNotes.rtf 2007-04-29 20:16:10 UTC (rev 1934) @@ -46,16 +46,19 @@ {\list\listtemplateid41\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid41} {\list\listtemplateid42\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid42} {\list\listtemplateid43\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid43} -{\list\listtemplateid44\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid44}} -{\*\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}} +{\list\listtemplateid44\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid44} +{\list\listtemplateid45\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid45} +{\list\listtemplateid46\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid46} +{\list\listtemplateid47\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid47}} +{\*\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}} \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f0\fs60 \cf0 Skim Release Notes\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\fs22 \cf0 \ -Last update: 23 April 2007 (rev -\f2\fs20 1887 +Last update: 29 April 2007 (rev +\f2\fs20 1933 \f1\fs22 )\ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural @@ -123,48 +126,54 @@ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls26\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 -\ls27\ilvl0\cf0 {\listtext \'a5 }PDFSync support.\ +\ls27\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 \ls28\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 +\ls29\ilvl0\cf0 {\listtext \'a5 }You can now set separate PDF view settigns for full screen mode. \ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls30\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 +\ls31\ilvl0\cf0 {\listtext \'a5 }You can now undo edits of notes and highlights.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \f3\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f4\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls29\ilvl0 +\ls32\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 -\ls30\ilvl0\cf0 {\listtext \'a5 }We now make sure new notes are added to a visible page.\ +\ls33\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 -\ls31\ilvl0\cf0 {\listtext \'a5 }Disable the TOC menu item when there is no TOC.\ +\ls34\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 -\ls32\ilvl0\cf0 {\listtext \'a5 }Return to the location that was viewed when reloading a document.\ +\ls35\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 -\ls33\ilvl0\cf0 {\listtext \'a5 }Search text in a PDf file asynchronously, so it does not block Skim.\ +\ls36\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 -\ls34\ilvl0\cf0 {\listtext \'a5 }Fix crashes that can appear for links with missing URLs.\ +\ls37\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 -\ls35\ilvl0\cf0 {\listtext \'a5 }Add separators in the Notes menu for categories.\ +\ls38\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 -\ls36\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting a PDF-document.\ +\ls39\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 -\ls37\ilvl0\cf0 {\listtext \'a5 }Fix typos in the Help and update for new features.\ +\ls40\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 -\ls38\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting the document. Unfortunately this disabled tool tips.\ +\ls41\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 -\ls39\ilvl0\cf0 {\listtext \'a5 }Open the contents pane to display the search term when opening from Spotlight.\ +\ls42\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 -\ls40\ilvl0\cf0 {\listtext \'a5 }Save notes when auto-saving and exporting as PDF.\ +\ls43\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 -\ls41\ilvl0\cf0 {\listtext \'a5 }Remember the width of notes pane.\ +\ls44\ilvl0\cf0 {\listtext \'a5 }Remember the width of notes pane.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls42\ilvl0\cf0 {\listtext \'a5 }Fix leaks leading to excessive memory use.\ +\ls45\ilvl0\cf0 {\listtext \'a5 }Fix leaks leading to excessive memory use.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls43\ilvl0\cf0 {\listtext \'a5 }Fix back-tabbing through notes and links.\ +\ls46\ilvl0\cf0 {\listtext \'a5 }Fix back-tabbing through notes and links.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls44\ilvl0\cf0 {\listtext \'a5 }Zooming using the scroll-wheel now only affects the current window.\ +\ls47\ilvl0\cf0 {\listtext \'a5 }Zooming using the scroll-wheel now only affects the current window.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f3\b\fs28 \cf0 \ Modified: trunk/English.lproj/ReleaseNotes.rtf =================================================================== --- trunk/English.lproj/ReleaseNotes.rtf 2007-04-29 19:58:09 UTC (rev 1933) +++ trunk/English.lproj/ReleaseNotes.rtf 2007-04-29 20:16:10 UTC (rev 1934) @@ -46,16 +46,19 @@ {\list\listtemplateid41\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid41} {\list\listtemplateid42\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid42} {\list\listtemplateid43\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid43} -{\list\listtemplateid44\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid44}} -{\*\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}} +{\list\listtemplateid44\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid44} +{\list\listtemplateid45\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid45} +{\list\listtemplateid46\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid46} +{\list\listtemplateid47\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid47}} +{\*\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}} \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f0\fs60 \cf0 Skim Release Notes\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\fs22 \cf0 \ -Last update: 23 April 2007 (rev -\f2\fs20 1887 +Last update: 29 April 2007 (rev +\f2\fs20 1933 \f1\fs22 )\ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural @@ -123,48 +126,54 @@ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls26\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 -\ls27\ilvl0\cf0 {\listtext \'a5 }PDFSync support.\ +\ls27\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 \ls28\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 +\ls29\ilvl0\cf0 {\listtext \'a5 }You can now set separate PDF view settigns for full screen mode. \ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls30\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 +\ls31\ilvl0\cf0 {\listtext \'a5 }You can now undo edits of notes and highlights.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \f3\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f4\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls29\ilvl0 +\ls32\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 -\ls30\ilvl0\cf0 {\listtext \'a5 }We now make sure new notes are added to a visible page.\ +\ls33\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 -\ls31\ilvl0\cf0 {\listtext \'a5 }Disable the TOC menu item when there is no TOC.\ +\ls34\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 -\ls32\ilvl0\cf0 {\listtext \'a5 }Return to the location that was viewed when reloading a document.\ +\ls35\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 -\ls33\ilvl0\cf0 {\listtext \'a5 }Search text in a PDf file asynchronously, so it does not block Skim.\ +\ls36\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 -\ls34\ilvl0\cf0 {\listtext \'a5 }Fix crashes that can appear for links with missing URLs.\ +\ls37\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 -\ls35\ilvl0\cf0 {\listtext \'a5 }Add separators in the Notes menu for categories.\ +\ls38\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 -\ls36\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting a PDF-document.\ +\ls39\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 -\ls37\ilvl0\cf0 {\listtext \'a5 }Fix typos in the Help and update for new features.\ +\ls40\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 -\ls38\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting the document. Unfortunately this disabled tool tips.\ +\ls41\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 -\ls39\ilvl0\cf0 {\listtext \'a5 }Open the contents pane to display the search term when opening from Spotlight.\ +\ls42\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 -\ls40\ilvl0\cf0 {\listtext \'a5 }Save notes when auto-saving and exporting as PDF.\ +\ls43\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 -\ls41\ilvl0\cf0 {\listtext \'a5 }Remember the width of notes pane.\ +\ls44\ilvl0\cf0 {\listtext \'a5 }Remember the width of notes pane.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls42\ilvl0\cf0 {\listtext \'a5 }Fix leaks leading to excessive memory use.\ +\ls45\ilvl0\cf0 {\listtext \'a5 }Fix leaks leading to excessive memory use.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls43\ilvl0\cf0 {\listtext \'a5 }Fix back-tabbing through notes and links.\ +\ls46\ilvl0\cf0 {\listtext \'a5 }Fix back-tabbing through notes and links.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls44\ilvl0\cf0 {\listtext \'a5 }Zooming using the scroll-wheel now only affects the current window.\ +\ls47\ilvl0\cf0 {\listtext \'a5 }Zooming using the scroll-wheel now only affects the current window.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f3\b\fs28 \cf0 \ Modified: trunk/Italian.lproj/ReleaseNotes.rtf =================================================================== --- trunk/Italian.lproj/ReleaseNotes.rtf 2007-04-29 19:58:09 UTC (rev 1933) +++ trunk/Italian.lproj/ReleaseNotes.rtf 2007-04-29 20:16:10 UTC (rev 1934) @@ -46,16 +46,19 @@ {\list\listtemplateid41\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid41} {\list\listtemplateid42\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid42} {\list\listtemplateid43\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid43} -{\list\listtemplateid44\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid44}} -{\*\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}} +{\list\listtemplateid44\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid44} +{\list\listtemplateid45\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid45} +{\list\listtemplateid46\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid46} +{\list\listtemplateid47\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid47}} +{\*\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}} \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f0\fs60 \cf0 Skim Release Notes\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\fs22 \cf0 \ -Last update: 23 April 2007 (rev -\f2\fs20 1887 +Last update: 29 April 2007 (rev +\f2\fs20 1933 \f1\fs22 )\ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural @@ -123,48 +126,54 @@ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls26\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 -\ls27\ilvl0\cf0 {\listtext \'a5 }PDFSync support.\ +\ls27\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 \ls28\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 +\ls29\ilvl0\cf0 {\listtext \'a5 }You can now set separate PDF view settigns for full screen mode. \ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls30\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 +\ls31\ilvl0\cf0 {\listtext \'a5 }You can now undo edits of notes and highlights.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \f3\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f4\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls29\ilvl0 +\ls32\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 -\ls30\ilvl0\cf0 {\listtext \'a5 }We now make sure new notes are added to a visible page.\ +\ls33\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 -\ls31\ilvl0\cf0 {\listtext \'a5 }Disable the TOC menu item when there is no TOC.\ +\ls34\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 -\ls32\ilvl0\cf0 {\listtext \'a5 }Return to the location that was viewed when reloading a document.\ +\ls35\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 -\ls33\ilvl0\cf0 {\listtext \'a5 }Search text in a PDf file asynchronously, so it does not block Skim.\ +\ls36\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 -\ls34\ilvl0\cf0 {\listtext \'a5 }Fix crashes that can appear for links with missing URLs.\ +\ls37\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 -\ls35\ilvl0\cf0 {\listtext \'a5 }Add separators in the Notes menu for categories.\ +\ls38\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 -\ls36\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting a PDF-document.\ +\ls39\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 -\ls37\ilvl0\cf0 {\listtext \'a5 }Fix typos in the Help and update for new features.\ +\ls40\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 -\ls38\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting the document. Unfortunately this disabled tool tips.\ +\ls41\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 -\ls39\ilvl0\cf0 {\listtext \'a5 }Open the contents pane to display the search term when opening from Spotlight.\ +\ls42\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 -\ls40\ilvl0\cf0 {\listtext \'a5 }Save notes when auto-saving and exporting as PDF.\ +\ls43\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 -\ls41\ilvl0\cf0 {\listtext \'a5 }Remember the width of notes pane.\ +\ls44\ilvl0\cf0 {\listtext \'a5 }Remember the width of notes pane.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls42\ilvl0\cf0 {\listtext \'a5 }Fix leaks leading to excessive memory use.\ +\ls45\ilvl0\cf0 {\listtext \'a5 }Fix leaks leading to excessive memory use.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls43\ilvl0\cf0 {\listtext \'a5 }Fix back-tabbing through notes and links.\ +\ls46\ilvl0\cf0 {\listtext \'a5 }Fix back-tabbing through notes and links.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls44\ilvl0\cf0 {\listtext \'a5 }Zooming using the scroll-wheel now only affects the current window.\ +\ls47\ilvl0\cf0 {\listtext \'a5 }Zooming using the scroll-wheel now only affects the current window.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f3\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-04-29 19:58:19
|
Revision: 1933 http://skim-app.svn.sourceforge.net/skim-app/?rev=1933&view=rev Author: hofman Date: 2007-04-29 12:58:09 -0700 (Sun, 29 Apr 2007) Log Message: ----------- Remove some unnecessary dirtying of the pdfview. Modified Paths: -------------- trunk/SKMainWindowController.m trunk/SKPDFAnnotationNote.m trunk/SKPDFView.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-04-29 18:32:07 UTC (rev 1932) +++ trunk/SKMainWindowController.m 2007-04-29 19:58:09 UTC (rev 1933) @@ -719,7 +719,6 @@ if ([annotation isNoteAnnotation]) { if ([[annotation color] isEqual:[sender color]] == NO) [annotation setColor:[sender color]]; - [pdfView setNeedsDisplayForAnnotation:annotation]; } } @@ -728,7 +727,6 @@ if ([annotation isNoteAnnotation] && [annotation respondsToSelector:@selector(setFont:)] && [annotation respondsToSelector:@selector(font)]) { NSFont *font = [sender convertFont:[(PDFAnnotationFreeText *)annotation font]]; [(PDFAnnotationFreeText *)annotation setFont:font]; - [pdfView setNeedsDisplayForAnnotation:annotation]; } } Modified: trunk/SKPDFAnnotationNote.m =================================================================== --- trunk/SKPDFAnnotationNote.m 2007-04-29 18:32:07 UTC (rev 1932) +++ trunk/SKPDFAnnotationNote.m 2007-04-29 19:58:09 UTC (rev 1933) @@ -268,9 +268,7 @@ NSRect newBounds = NSRectFromRect(*qdBounds); if ([self isResizable] == NO) newBounds.size = [self bounds].size; - [pdfView setNeedsDisplayForAnnotation:self]; [self setBounds:newBounds]; - [pdfView setNeedsDisplayForAnnotation:self]; } } @@ -967,9 +965,7 @@ newPoint.y = 0.5; else if (newPoint.y > NSHeight([self bounds])) newPoint.y = NSHeight([self bounds]) - 0.5; - [pdfView setNeedsDisplayForAnnotation:self]; [self setStartPoint:newPoint]; - [pdfView setNeedsDisplayForAnnotation:self]; } } @@ -994,9 +990,7 @@ newPoint.y = 0.5; else if (newPoint.y > NSHeight([self bounds])) newPoint.y = NSHeight([self bounds]) - 0.5; - [pdfView setNeedsDisplayForAnnotation:self]; [self setEndPoint:newPoint]; - [pdfView setNeedsDisplayForAnnotation:self]; } } Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-29 18:32:07 UTC (rev 1932) +++ trunk/SKPDFView.m 2007-04-29 19:58:09 UTC (rev 1933) @@ -1992,11 +1992,9 @@ - (BOOL)selectAnnotationWithEvent:(NSEvent *)theEvent { PDFAnnotation *newActiveAnnotation = NULL; - PDFAnnotation *wasActiveAnnotation; NSArray *annotations; int i; NSPoint pagePoint; - BOOL changed; PDFPage *activePage; // Mouse in display view coordinates. @@ -2042,29 +2040,9 @@ [newAnnotation release]; } - // Flag indicating if activeAnnotation will change. - changed = (activeAnnotation != newActiveAnnotation); + if (activeAnnotation != newActiveAnnotation) + [self setActiveAnnotation:newActiveAnnotation]; - // Deselect old annotation when appropriate. - if (activeAnnotation && changed) - [self setNeedsDisplayForAnnotation:activeAnnotation]; - - if (changed) { - if (editAnnotation) - [self endAnnotationEdit:self]; - - // Assign. - wasActiveAnnotation = activeAnnotation; - activeAnnotation = (PDFAnnotationFreeText *)newActiveAnnotation; - - NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithCapacity:2]; - if (wasActiveAnnotation) - [userInfo setObject:wasActiveAnnotation forKey:@"wasActiveAnnotation"]; - if (activeAnnotation) - [userInfo setObject:activeAnnotation forKey:@"activeAnnotation"]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKPDFViewActiveAnnotationDidChangeNotification object:self userInfo:userInfo]; - } - if (newActiveAnnotation == nil) { //[super mouseDown:theEvent]; } else if ([theEvent clickCount] == 2 && [[activeAnnotation type] isEqualToString:@"FreeText"]) { @@ -2094,8 +2072,6 @@ wasEndPoint = [(SKPDFAnnotationLine *)activeAnnotation endPoint]; } - // Force redisplay. - [self setNeedsDisplayForAnnotation:activeAnnotation]; draggingAnnotation = [activeAnnotation isMovable]; // Hit-test for resize box. @@ -2328,7 +2304,7 @@ // move the annotation to the new page PDFAnnotation *saveActiveAnnotation = [activeAnnotation retain]; [self removeAnnotation:saveActiveAnnotation]; - [self addAnnotation:activeAnnotation toPage:newActivePage]; + [self addAnnotation:saveActiveAnnotation toPage:newActivePage]; [self setActiveAnnotation:saveActiveAnnotation]; [saveActiveAnnotation release]; activePage = newActivePage; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-29 18:32:09
|
Revision: 1932 http://skim-app.svn.sourceforge.net/skim-app/?rev=1932&view=rev Author: hofman Date: 2007-04-29 11:32:07 -0700 (Sun, 29 Apr 2007) Log Message: ----------- Workaround for undoManager registering an extra change count when an undo group is ended. Modified Paths: -------------- trunk/SKPDFView.h trunk/SKPDFView.m Modified: trunk/SKPDFView.h =================================================================== --- trunk/SKPDFView.h 2007-04-29 17:58:21 UTC (rev 1931) +++ trunk/SKPDFView.h 2007-04-29 18:32:07 UTC (rev 1932) @@ -137,4 +137,6 @@ - (void)handleAnnotationDidChangeNotification:(NSNotification *)notification; - (void)handleWindowWillCloseNotification:(NSNotification *)notification; +- (NSUndoManager *)undoManager; + @end Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-29 17:58:21 UTC (rev 1931) +++ trunk/SKPDFView.m 2007-04-29 18:32:07 UTC (rev 1932) @@ -677,8 +677,11 @@ NSString *selString = [[[[activeAnnotation page] selectionForRect:[activeAnnotation bounds]] string] stringByCollapsingWhitespaceAndNewlinesAndRemovingSurroundingWhitespaceAndNewlines]; [activeAnnotation setContents:selString]; } - if (didDrag) - [[[[[self window] windowController] document] undoManager] endUndoGrouping]; + if (didDrag) { + [[self undoManager] endUndoGrouping]; + // due to an Appkit bug, endUndoGrouping registers an extra change count, which is not reverted when the group is undone + [[[[self window] windowController] document] updateChangeCount:NSChangeUndone]; + } } else [super mouseUp:theEvent]; break; @@ -707,7 +710,7 @@ if (draggingAnnotation) { if (didDrag == NO) { didDrag = YES; - [[[[[self window] windowController] document] undoManager] beginUndoGrouping]; + [[self undoManager] beginUndoGrouping]; } [self dragAnnotationWithEvent:theEvent]; } else if (nil == activeAnnotation) { @@ -1003,6 +1006,12 @@ [self setScaleFactor:[self scaleFactor] + 0.5 * dy]; } +#pragma mark UndoManager + +- (NSUndoManager *)undoManager { + return [[[[self window] windowController] document] undoManager]; +} + #pragma mark Annotation management - (void)addAnnotationFromMenu:(id)sender { @@ -1137,7 +1146,7 @@ } - (void)addAnnotation:(PDFAnnotation *)annotation toPage:(PDFPage *)page { - [[[[[[self window] windowController] document] undoManager] prepareWithInvocationTarget:self] removeAnnotation:annotation]; + [[[self undoManager] prepareWithInvocationTarget:self] removeAnnotation:annotation]; [page addAnnotation:annotation]; [self setNeedsDisplayForAnnotation:annotation]; [[NSNotificationCenter defaultCenter] postNotificationName:SKPDFViewDidAddAnnotationNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:page, @"page", annotation, @"annotation", nil]]; @@ -1159,7 +1168,7 @@ PDFAnnotation *wasAnnotation = [annotation retain]; PDFPage *page = [wasAnnotation page]; - [[[[[[self window] windowController] document] undoManager] prepareWithInvocationTarget:self] addAnnotation:wasAnnotation toPage:page]; + [[[self undoManager] prepareWithInvocationTarget:self] addAnnotation:wasAnnotation toPage:page]; if (editAnnotation && activeAnnotation == annotation) [self endAnnotationEdit:self]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-29 17:58:23
|
Revision: 1931 http://skim-app.svn.sourceforge.net/skim-app/?rev=1931&view=rev Author: hofman Date: 2007-04-29 10:58:21 -0700 (Sun, 29 Apr 2007) Log Message: ----------- Implement undo. Implementation mostly in data model (i.e. PDFAnnotation subclasses). Wrap dragging of annotations in an undoGroup. Undoing those however doesn't remove the dirty flag. Modified Paths: -------------- trunk/PDFPage_SKExtensions.m trunk/SKDocument.m trunk/SKMainWindowController.m trunk/SKPDFAnnotationNote.h trunk/SKPDFAnnotationNote.m trunk/SKPDFView.h trunk/SKPDFView.m Modified: trunk/PDFPage_SKExtensions.m =================================================================== --- trunk/PDFPage_SKExtensions.m 2007-04-29 13:38:19 UTC (rev 1930) +++ trunk/PDFPage_SKExtensions.m 2007-04-29 17:58:21 UTC (rev 1931) @@ -247,10 +247,8 @@ - (void)insertInNotes:(id)newNote { SKDocument *document = [self containingDocument]; - [self addAnnotation:newNote]; + [[document pdfView] addAnnotation:newNote toPage:self]; - [[document pdfView] setNeedsDisplayForAnnotation:newNote]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKPDFViewDidAddAnnotationNotification object:[document pdfView] userInfo:[NSDictionary dictionaryWithObjectsAndKeys:newNote, @"annotation", self, @"page", nil]]; } Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-04-29 13:38:19 UTC (rev 1930) +++ trunk/SKDocument.m 2007-04-29 17:58:21 UTC (rev 1931) @@ -168,6 +168,7 @@ } if (saveOperation == NSSaveOperation || saveOperation == NSSaveAsOperation) { + [[self undoManager] removeAllActions]; [self updateChangeCount:NSChangeCleared]; [lastChangedDate release]; lastChangedDate = [[[fm fileAttributesAtPath:[absoluteURL path] traverseLink:YES] fileModificationDate] retain]; @@ -215,7 +216,9 @@ [[self mainWindowController] setPdfDocument:pdfDocument]; [pdfDocument autorelease]; pdfDocument = nil; + [[self undoManager] removeAllActions]; } else { + // Should this now be one? [self updateChangeCount:NSChangeCleared]; } if (noteDicts) { @@ -409,6 +412,8 @@ [[self mainWindowController] setAnnotationsFromDictionaries:array]; else [[self mainWindowController] addAnnotationsFromDictionaries:array]; + // previous undo actions are not reliable anymore + [[self undoManager] removeAllActions]; [self updateChangeCount:NSChangeDone]; } Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-04-29 13:38:19 UTC (rev 1930) +++ trunk/SKMainWindowController.m 2007-04-29 17:58:21 UTC (rev 1931) @@ -1849,7 +1849,6 @@ } } [noteOutlineView reloadData]; - [[self document] updateChangeCount:NSChangeDone]; } - (void)handleDidRemoveAnnotationNotification:(NSNotification *)notification { @@ -1881,7 +1880,6 @@ } } [noteOutlineView reloadData]; - [[self document] updateChangeCount:NSChangeDone]; } - (void)handleDoubleClickedAnnotationNotification:(NSNotification *)notification { @@ -1893,7 +1891,6 @@ - (void)handleAnnotationDidChangeNotification:(NSNotification *)notification { PDFAnnotation *annotation = [notification object]; if ([[[annotation page] document] isEqual:[[self pdfView] document]]) { - [[self document] updateChangeCount:NSChangeDone]; [self thumbnailNeedsUpdate:[[self thumbnails] objectAtIndex:[annotation pageIndex]]]; NSEnumerator *snapshotEnum = [snapshots objectEnumerator]; Modified: trunk/SKPDFAnnotationNote.h =================================================================== --- trunk/SKPDFAnnotationNote.h 2007-04-29 13:38:19 UTC (rev 1930) +++ trunk/SKPDFAnnotationNote.h 2007-04-29 17:58:21 UTC (rev 1931) @@ -64,6 +64,8 @@ - (BOOL)isMovable; - (BOOL)isEditable; +- (NSUndoManager *)undoManager; + - (BOOL)hitTest:(NSPoint)point; - (NSScriptObjectSpecifier *)objectSpecifier; @@ -100,6 +102,7 @@ @interface SKPDFAnnotationNote : PDFAnnotationText { NSImage *image; NSTextStorage *textStorage; + NSAttributedString *text; NSArray *texts; } Modified: trunk/SKPDFAnnotationNote.m =================================================================== --- trunk/SKPDFAnnotationNote.m 2007-04-29 13:38:19 UTC (rev 1930) +++ trunk/SKPDFAnnotationNote.m 2007-04-29 17:58:21 UTC (rev 1931) @@ -167,6 +167,10 @@ return NSPointInRect(point, [self bounds]); } +- (NSUndoManager *)undoManager { + return [[[self page] containingDocument] undoManager]; +} + #pragma mark Scripting support - (id)init { @@ -312,6 +316,7 @@ - (BOOL)shouldPrint { return YES; } - (void)setBounds:(NSRect)bounds { + [[[self undoManager] prepareWithInvocationTarget:self] setBounds:[self bounds]]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationWillChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; [super setBounds:bounds]; @@ -320,12 +325,14 @@ } - (void)setContents:(NSString *)contents { + [[[self undoManager] prepareWithInvocationTarget:self] setContents:[self contents]]; [super setContents:contents]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"contents", @"key", nil]]; } - (void)setColor:(NSColor *)color { + [[[self undoManager] prepareWithInvocationTarget:self] setColor:[self color]]; [super setColor:color]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"color", @"key", nil]]; @@ -354,6 +361,7 @@ - (BOOL)shouldPrint { return YES; } - (void)setBounds:(NSRect)bounds { + [[[self undoManager] prepareWithInvocationTarget:self] setBounds:[self bounds]]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationWillChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; [super setBounds:bounds]; @@ -362,12 +370,14 @@ } - (void)setContents:(NSString *)contents { + [[[self undoManager] prepareWithInvocationTarget:self] setContents:[self contents]]; [super setContents:contents]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"contents", @"key", nil]]; } - (void)setColor:(NSColor *)color { + [[[self undoManager] prepareWithInvocationTarget:self] setColor:[self color]]; [super setColor:color]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"color", @"key", nil]]; @@ -602,6 +612,7 @@ - (BOOL)shouldPrint { return YES; } - (void)setBounds:(NSRect)bounds { + [[[self undoManager] prepareWithInvocationTarget:self] setBounds:[self bounds]]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationWillChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; [super setBounds:bounds]; @@ -610,12 +621,14 @@ } - (void)setContents:(NSString *)contents { + [[[self undoManager] prepareWithInvocationTarget:self] setContents:[self contents]]; [super setContents:contents]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"contents", @"key", nil]]; } - (void)setColor:(NSColor *)color { + [[[self undoManager] prepareWithInvocationTarget:self] setColor:[self color]]; [super setColor:color]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"color", @"key", nil]]; @@ -664,6 +677,7 @@ - (BOOL)shouldPrint { return YES; } - (void)setBounds:(NSRect)bounds { + [[[self undoManager] prepareWithInvocationTarget:self] setBounds:[self bounds]]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationWillChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; [super setBounds:bounds]; @@ -672,18 +686,21 @@ } - (void)setContents:(NSString *)contents { + [[[self undoManager] prepareWithInvocationTarget:self] setContents:[self contents]]; [super setContents:contents]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"contents", @"key", nil]]; } - (void)setColor:(NSColor *)color { + [[[self undoManager] prepareWithInvocationTarget:self] setColor:[self color]]; [super setColor:color]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"color", @"key", nil]]; } - (void)setFont:(NSFont *)font { + [[[self undoManager] prepareWithInvocationTarget:self] setFont:[self font]]; [super setFont:font]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"font", @"key", nil]]; @@ -710,12 +727,14 @@ texts = [[NSArray alloc] initWithObjects:[[[SKNoteText alloc] initWithAnnotation:self] autorelease], nil]; textStorage = [[NSTextStorage allocWithZone:[self zone]] init]; [textStorage setDelegate:self]; + text = [[NSAttributedString alloc] init]; } return self; } - (void)dealloc { [textStorage release]; + [text release]; [image release]; [texts release]; [super dealloc]; @@ -737,6 +756,7 @@ - (BOOL)shouldPrint { return YES; } - (void)setBounds:(NSRect)bounds { + [[[self undoManager] prepareWithInvocationTarget:self] setBounds:[self bounds]]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationWillChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; [super setBounds:bounds]; @@ -745,12 +765,14 @@ } - (void)setContents:(NSString *)contents { + [[[self undoManager] prepareWithInvocationTarget:self] setContents:[self contents]]; [super setContents:contents]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"contents", @"key", nil]]; } - (void)setColor:(NSColor *)color { + [[[self undoManager] prepareWithInvocationTarget:self] setColor:[self color]]; [super setColor:color]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"color", @"key", nil]]; @@ -767,6 +789,7 @@ - (void)setImage:(NSImage *)newImage; { + [[[self undoManager] prepareWithInvocationTarget:self] setImage:[self image]]; if (image != newImage) { [image release]; image = [newImage retain]; @@ -777,7 +800,7 @@ - (NSAttributedString *)text; { - return [[[NSAttributedString allocWithZone:[self zone]] initWithAttributedString:textStorage] autorelease]; + return text; } - (void)setText:(NSAttributedString *)newText; @@ -793,12 +816,15 @@ - (void)textStorageWillProcessEditing:(NSNotification *)notification; { + [[[self undoManager] prepareWithInvocationTarget:self] setText:text]; [self willChangeValueForKey:@"text"]; } - (void)textStorageDidProcessEditing:(NSNotification *)notification; { [self didChangeValueForKey:@"text"]; + [text release]; + text = [[NSAttributedString allocWithZone:[self zone]] initWithAttributedString:textStorage]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"text", @"key", nil]]; } @@ -863,18 +889,21 @@ - (BOOL)shouldPrint { return YES; } - (void)setStartPoint:(NSPoint)point { + [[[self undoManager] prepareWithInvocationTarget:self] setStartPoint:[self startPoint]]; [super setStartPoint:point]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"startPoint", @"key", nil]]; } - (void)setEndPoint:(NSPoint)point { + [[[self undoManager] prepareWithInvocationTarget:self] setEndPoint:[self endPoint]]; [super setEndPoint:point]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"endPoint", @"key", nil]]; } - (void)setBounds:(NSRect)bounds { + [[[self undoManager] prepareWithInvocationTarget:self] setBounds:[self bounds]]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationWillChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"bounds", @"key", nil]]; [super setBounds:bounds]; @@ -883,12 +912,14 @@ } - (void)setContents:(NSString *)contents { + [[[self undoManager] prepareWithInvocationTarget:self] setContents:[self contents]]; [super setContents:contents]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"contents", @"key", nil]]; } - (void)setColor:(NSColor *)color { + [[[self undoManager] prepareWithInvocationTarget:self] setColor:[self color]]; [super setColor:color]; [[NSNotificationCenter defaultCenter] postNotificationName:SKAnnotationDidChangeNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"color", @"key", nil]]; Modified: trunk/SKPDFView.h =================================================================== --- trunk/SKPDFView.h 2007-04-29 13:38:19 UTC (rev 1930) +++ trunk/SKPDFView.h 2007-04-29 17:58:21 UTC (rev 1931) @@ -88,6 +88,7 @@ BOOL resizingAnnotation; BOOL draggingAnnotation; BOOL draggingStartPoint; + BOOL didDrag; BOOL mouseDownInAnnotation; BOOL extendSelection; BOOL rectSelection; @@ -112,6 +113,7 @@ - (void)addAnnotationFromMenu:(id)sender; - (void)addAnnotationFromSelectionWithType:(SKNoteType)annotationType; - (void)addAnnotationWithType:(SKNoteType)annotationType contents:(NSString *)text page:(PDFPage *)page bounds:(NSRect)bounds; +- (void)addAnnotation:(PDFAnnotation *)annotation toPage:(PDFPage *)page; - (void)removeActiveAnnotation:(id)sender; - (void)removeThisAnnotation:(id)sender; - (void)removeAnnotation:(PDFAnnotation *)annotation; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-29 13:38:19 UTC (rev 1930) +++ trunk/SKPDFView.m 2007-04-29 17:58:21 UTC (rev 1931) @@ -537,10 +537,7 @@ [newAnnotation setContents:[pboard stringForType:NSStringPboardType]]; } - [page addAnnotation:newAnnotation]; - - [[NSNotificationCenter defaultCenter] postNotificationName:SKPDFViewDidAddAnnotationNotification object:self - userInfo:[NSDictionary dictionaryWithObjectsAndKeys:newAnnotation, @"annotation", page, @"page", nil]]; + [self addAnnotation:newAnnotation toPage:page]; [self setActiveAnnotation:newAnnotation]; } @@ -606,7 +603,9 @@ mouseDownLoc = [theEvent locationInWindow]; unsigned int modifiers = [theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; - + + didDrag = NO; + if (modifiers & NSCommandKeyMask) { if (modifiers & NSShiftKeyMask) [self pdfsyncWithEvent:theEvent]; @@ -674,10 +673,12 @@ wasSelection = nil; if (draggingAnnotation) { draggingAnnotation = NO; - if ([[activeAnnotation type] isEqualToString:@"Square"] || [[activeAnnotation type] isEqualToString:@"Square"]) { + if ([[activeAnnotation type] isEqualToString:@"Circle"] || [[activeAnnotation type] isEqualToString:@"Square"]) { NSString *selString = [[[[activeAnnotation page] selectionForRect:[activeAnnotation bounds]] string] stringByCollapsingWhitespaceAndNewlinesAndRemovingSurroundingWhitespaceAndNewlines]; [activeAnnotation setContents:selString]; } + if (didDrag) + [[[[[self window] windowController] document] undoManager] endUndoGrouping]; } else [super mouseUp:theEvent]; break; @@ -704,6 +705,10 @@ switch (toolMode) { case SKTextToolMode: if (draggingAnnotation) { + if (didDrag == NO) { + didDrag = YES; + [[[[[self window] windowController] document] undoManager] beginUndoGrouping]; + } [self dragAnnotationWithEvent:theEvent]; } else if (nil == activeAnnotation) { if (mouseDownInAnnotation) { @@ -1122,10 +1127,7 @@ if ([[activeAnnotation type] isEqualToString:@"Line"] == NO) [newAnnotation setContents:text]; - [page addAnnotation:newAnnotation]; - - [[NSNotificationCenter defaultCenter] postNotificationName:SKPDFViewDidAddAnnotationNotification object:self - userInfo:[NSDictionary dictionaryWithObjectsAndKeys:newAnnotation, @"annotation", page, @"page", nil]]; + [self addAnnotation:newAnnotation toPage:page]; [self setActiveAnnotation:newAnnotation]; [newAnnotation release]; @@ -1134,6 +1136,13 @@ userInfo:[NSDictionary dictionaryWithObjectsAndKeys:activeAnnotation, @"annotation", nil]]; } +- (void)addAnnotation:(PDFAnnotation *)annotation toPage:(PDFPage *)page { + [[[[[[self window] windowController] document] undoManager] prepareWithInvocationTarget:self] removeAnnotation:annotation]; + [page addAnnotation:annotation]; + [self setNeedsDisplayForAnnotation:annotation]; + [[NSNotificationCenter defaultCenter] postNotificationName:SKPDFViewDidAddAnnotationNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:page, @"page", annotation, @"annotation", nil]]; +} + - (void)removeActiveAnnotation:(id)sender{ if ([activeAnnotation isNoteAnnotation]) [self removeAnnotation:activeAnnotation]; @@ -1150,6 +1159,8 @@ PDFAnnotation *wasAnnotation = [annotation retain]; PDFPage *page = [wasAnnotation page]; + [[[[[[self window] windowController] document] undoManager] prepareWithInvocationTarget:self] addAnnotation:wasAnnotation toPage:page]; + if (editAnnotation && activeAnnotation == annotation) [self endAnnotationEdit:self]; if (activeAnnotation == annotation) @@ -2017,12 +2028,9 @@ if (([theEvent modifierFlags] & NSAlternateKeyMask) && [newActiveAnnotation isMovable]) { // select a new copy of the annotation PDFAnnotation *newAnnotation = [[PDFAnnotation alloc] initWithDictionary:[newActiveAnnotation dictionaryValue]]; - [activePage addAnnotation:newAnnotation]; + [self addAnnotation:newAnnotation toPage:activePage]; newActiveAnnotation = newAnnotation; [newAnnotation release]; - - [[NSNotificationCenter defaultCenter] postNotificationName:SKPDFViewDidAddAnnotationNotification object:self - userInfo:[NSDictionary dictionaryWithObjectsAndKeys:newAnnotation, @"annotation", activePage, @"page", nil]]; } // Flag indicating if activeAnnotation will change. @@ -2309,13 +2317,11 @@ } else { if (newActivePage != activePage) { // move the annotation to the new page - [activeAnnotation retain]; - [self setNeedsDisplayForAnnotation:activeAnnotation]; - [activePage removeAnnotation:activeAnnotation]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKPDFViewDidRemoveAnnotationNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:activePage, @"page", activeAnnotation, @"annotation", nil]]; - [newActivePage addAnnotation:activeAnnotation]; - [activeAnnotation release]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKPDFViewDidAddAnnotationNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:newActivePage, @"page", activeAnnotation, @"annotation", nil]]; + PDFAnnotation *saveActiveAnnotation = [activeAnnotation retain]; + [self removeAnnotation:saveActiveAnnotation]; + [self addAnnotation:activeAnnotation toPage:newActivePage]; + [self setActiveAnnotation:saveActiveAnnotation]; + [saveActiveAnnotation release]; activePage = newActivePage; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-29 13:38:20
|
Revision: 1930 http://skim-app.svn.sourceforge.net/skim-app/?rev=1930&view=rev Author: hofman Date: 2007-04-29 06:38:19 -0700 (Sun, 29 Apr 2007) Log Message: ----------- Avoid scaling of text. Modified Paths: -------------- trunk/SKPDFHoverWindow.m Modified: trunk/SKPDFHoverWindow.m =================================================================== --- trunk/SKPDFHoverWindow.m 2007-04-29 13:23:23 UTC (rev 1929) +++ trunk/SKPDFHoverWindow.m 2007-04-29 13:38:19 UTC (rev 1930) @@ -247,8 +247,6 @@ NSRect targetRect = sourceRect; targetRect.origin = NSZeroPoint; - contentRect.size = targetRect.size; - image = [[NSImage alloc] initWithSize:targetRect.size]; [image lockFocus]; @@ -290,22 +288,20 @@ if (text) { - NSRect rect = [text boundingRectWithSize:NSInsetRect(contentRect, TEXT_MARGIN_X, TEXT_MARGIN_Y).size options:NSStringDrawingUsesLineFragmentOrigin]; + NSRect textRect = [text boundingRectWithSize:NSInsetRect(contentRect, TEXT_MARGIN_X, TEXT_MARGIN_Y).size options:NSStringDrawingUsesLineFragmentOrigin]; - rect.size.width = ceilf(NSWidth(rect) + 2.0 * TEXT_MARGIN_X); - rect.size.height = ceilf(fmin(NSHeight(rect) + 2.0 * TEXT_MARGIN_Y, NSHeight(contentRect))); - rect.origin = NSZeroPoint; + textRect.size.height = fmin(NSHeight(textRect), NSHeight(contentRect) - 2.0 * TEXT_MARGIN_Y); + textRect.origin = NSMakePoint(TEXT_MARGIN_X, TEXT_MARGIN_Y); - image = [[NSImage alloc] initWithSize:rect.size]; + image = [[NSImage alloc] initWithSize:NSInsetRect(NSIntegralRect(textRect), -TEXT_MARGIN_X, -TEXT_MARGIN_X).size]; color = backgroundColor; [image lockFocus]; - [text drawWithRect:NSInsetRect(rect, TEXT_MARGIN_X, TEXT_MARGIN_Y) options:NSStringDrawingUsesLineFragmentOrigin]; + [text drawWithRect:textRect options:NSStringDrawingUsesLineFragmentOrigin]; [image unlockFocus]; [text release]; - contentRect.size = rect.size; } if (image) { @@ -315,6 +311,7 @@ [imageView setImage:image]; [image release]; + contentRect.size = [image size]; contentRect.origin.y -= NSHeight(contentRect); contentRect = SKRectFittingRectInRect(contentRect, [[NSScreen mainScreen] visibleFrame]); [self setFrame:[self frameRectForContentRect:contentRect] display:NO]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-29 13:23:28
|
Revision: 1929 http://skim-app.svn.sourceforge.net/skim-app/?rev=1929&view=rev Author: hofman Date: 2007-04-29 06:23:23 -0700 (Sun, 29 Apr 2007) Log Message: ----------- Better rendering of hover window. Ensure integral rects, draw a portion of an image rather than scrolling, clip text we draw. Modified Paths: -------------- trunk/SKPDFHoverWindow.h trunk/SKPDFHoverWindow.m Modified: trunk/SKPDFHoverWindow.h =================================================================== --- trunk/SKPDFHoverWindow.h 2007-04-29 09:50:17 UTC (rev 1928) +++ trunk/SKPDFHoverWindow.h 2007-04-29 13:23:23 UTC (rev 1929) @@ -41,7 +41,6 @@ @class PDFAnnotation; @interface SKPDFHoverWindow : NSPanel { - NSImageView *imageView; NSFont *font; NSColor *backgroundColor; NSFont *labelFont; Modified: trunk/SKPDFHoverWindow.m =================================================================== --- trunk/SKPDFHoverWindow.m 2007-04-29 09:50:17 UTC (rev 1928) +++ trunk/SKPDFHoverWindow.m 2007-04-29 13:23:23 UTC (rev 1929) @@ -50,6 +50,13 @@ @implementation SKPDFHoverWindow +static NSMutableParagraphStyle *SKPDFHoverWindowTextParagraphStyle = nil; + ++ (void)initialize { + SKPDFHoverWindowTextParagraphStyle = [[NSMutableParagraphStyle alloc] init]; + [SKPDFHoverWindowTextParagraphStyle setLineBreakMode:NSLineBreakByClipping]; +} + + (id)sharedHoverWindow { static SKPDFHoverWindow *sharedHoverWindow = nil; if (sharedHoverWindow == nil) @@ -66,12 +73,9 @@ [self setLevel:NSStatusWindowLevel]; [self setAlphaValue:ALPHA_VALUE]; - NSScrollView *scrollView = [[NSScrollView alloc] init]; - imageView = [[NSImageView alloc] init]; + NSImageView *imageView = [[NSImageView alloc] init]; [imageView setImageFrameStyle:NSImageFrameNone]; - [scrollView setDocumentView:imageView]; - [self setContentView:scrollView]; - [scrollView release]; + [self setContentView:imageView]; [imageView release]; font = [[NSFont toolTipsFontOfSize:11.0] retain]; @@ -173,24 +177,24 @@ [super orderOut:sender]; } -- (NSRect)hoverWindowRectFittingScreenFromRect:(NSRect)rect{ - NSRect screenRect = [[NSScreen mainScreen] visibleFrame]; - - if (NSMaxX(rect) > NSMaxX(screenRect) - 2.0) - rect.origin.x = NSMaxX(screenRect) - NSWidth(rect) - 2.0; - if (NSMinX(rect) < NSMinX(screenRect) + 2.0) - rect.origin.x = NSMinX(screenRect) + 2.0; - if (NSMaxY(rect) > NSMaxY(screenRect) - 2.0) - rect.origin.y = NSMaxY(screenRect) - NSHeight(rect) - 2.0; - if (NSMinY(rect) < NSMinY(screenRect) + 2.0) - rect.origin.y = NSMinY(screenRect) + 2.0; - - return [self frameRectForContentRect:rect]; +static NSRect SKRectFittingRectInRect(NSRect inRect, NSRect outRect) { + if (NSWidth(inRect) > NSWidth(outRect)) + inRect.size.width = NSWidth(outRect); + if (NSHeight(inRect) > NSHeight(outRect)) + inRect.size.height = NSHeight(outRect); + if (NSMaxX(inRect) > NSMaxX(outRect) ) + inRect.origin.x = NSMaxX(outRect) - NSWidth(inRect); + if (NSMinX(inRect) < NSMinX(outRect)) + inRect.origin.x = NSMinX(outRect); + if (NSMaxY(inRect) > NSMaxY(outRect)) + inRect.origin.y = NSMaxY(outRect) - NSHeight(inRect); + if (NSMinY(inRect) < NSMinY(outRect)) + inRect.origin.y = NSMinY(outRect); + return inRect; } -- (void)timerFired:(NSTimer *)aTimer { +- (void)showWithTimer:(NSTimer *)aTimer { NSPoint thePoint = NSEqualPoints(point, NSZeroPoint) ? [NSEvent mouseLocation] : point; - NSRect rect = NSZeroRect; NSRect contentRect = NSMakeRect(thePoint.x, thePoint.y - WINDOW_OFFSET, WINDOW_WIDTH, WINDOW_HEIGHT); NSImage *image = nil; NSAttributedString *text = nil; @@ -206,47 +210,50 @@ if (page) { + NSImage *pageImage = [page image]; + NSRect pageImageRect = {NSZeroPoint, [pageImage size]}; NSRect bounds = [page boundsForBox:kPDFDisplayBoxCropBox]; + NSRect sourceRect = contentRect; - rect = contentRect; - rect.origin = [dest point]; - rect.origin.x -= NSMinX(bounds); - rect.origin.y -= NSMinY(bounds) + NSHeight(rect); + sourceRect.origin = [dest point]; + sourceRect.origin.x -= NSMinX(bounds); + sourceRect.origin.y -= NSMinY(bounds) + NSHeight(sourceRect); PDFSelection *selection = [page selectionForRect:bounds]; if ([selection string]) { NSRect selBounds = [selection boundsForPage:page]; - float top = fmax(NSMaxY(selBounds), NSMinX(selBounds) + NSHeight(rect)); - float left = fmin(NSMinX(selBounds), NSMaxX(bounds) - NSWidth(rect)); - if (top < NSMaxY(rect)) - rect.origin.y = top - NSHeight(rect); - if (left > NSMinX(rect)) - rect.origin.x = left; + float top = ceilf(fmax(NSMaxY(selBounds), NSMinX(selBounds) + NSHeight(sourceRect))); + float left = floorf(fmin(NSMinX(selBounds), NSMaxX(bounds) - NSWidth(sourceRect))); + if (top < NSMaxY(sourceRect)) + sourceRect.origin.y = top - NSHeight(sourceRect); + if (left > NSMinX(sourceRect)) + sourceRect.origin.x = left; } - image = [[page image] retain]; color = [NSColor controlBackgroundColor]; - if (NSMaxX(rect) > [image size].width) - rect.origin.x = [image size].width - NSWidth(rect); - if (NSMinX(rect) < 0.0) - rect.origin.x = 0.0; - if (NSMaxY(rect) > [image size].height) - rect.origin.y = [image size].height - NSHeight(rect); - if (NSMinY(rect) < 0.0) - rect.origin.y = 0.0; + sourceRect = SKRectFittingRectInRect(sourceRect, pageImageRect); - NSDictionary *attrs = [[NSDictionary alloc] initWithObjectsAndKeys:labelFont, NSFontAttributeName, color, NSForegroundColorAttributeName, nil]; + NSDictionary *attrs = [[NSDictionary alloc] initWithObjectsAndKeys:labelFont, NSFontAttributeName, color, NSForegroundColorAttributeName, SKPDFHoverWindowTextParagraphStyle, NSParagraphStyleAttributeName, nil]; NSAttributedString *labelString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:NSLocalizedString(@"Page %@", @"Tool tip label format"), [page label]] attributes:attrs]; NSRect labelRect = [labelString boundingRectWithSize:NSZeroSize options:NSStringDrawingUsesLineFragmentOrigin]; - float labelOffset = (0.5 * NSHeight(labelRect)); // make sure the cap radius is integral - labelRect.size.height = 2.0 * labelOffset; - labelRect.origin.x = NSMaxX(rect) - NSWidth(labelRect) - labelOffset - TEXT_MARGIN_X; - labelRect.origin.y = NSMinY(rect) + TEXT_MARGIN_Y; + labelRect.size.width = floorf(NSWidth(labelRect)); + labelRect.size.height = 2.0 * floorf(0.5 * NSHeight(labelRect)); // make sure the cap radius is integral + labelRect.origin.x = NSWidth(sourceRect) - NSWidth(labelRect) - 0.5 * NSHeight(labelRect) - TEXT_MARGIN_X; + labelRect.origin.y = TEXT_MARGIN_Y; + labelRect = NSIntegralRect(labelRect); + NSRect targetRect = sourceRect; + targetRect.origin = NSZeroPoint; + + contentRect.size = targetRect.size; + + image = [[NSImage alloc] initWithSize:targetRect.size]; + [image lockFocus]; [NSGraphicsContext saveGraphicsState]; + [pageImage drawInRect:targetRect fromRect:sourceRect operation:NSCompositeCopy fraction:1.0]; [labelColor setFill]; [NSBezierPath fillHorizontalOvalAroundRect:labelRect]; [labelString drawWithRect:labelRect options:NSStringDrawingUsesLineFragmentOrigin]; @@ -276,16 +283,17 @@ } if (string) { - NSDictionary *attrs = [[NSDictionary alloc] initWithObjectsAndKeys:font, NSFontAttributeName, nil]; + NSDictionary *attrs = [[NSDictionary alloc] initWithObjectsAndKeys:font, NSFontAttributeName, SKPDFHoverWindowTextParagraphStyle, NSParagraphStyleAttributeName, nil]; text = [[NSAttributedString alloc] initWithString:string attributes:attrs]; [attrs release]; } if (text) { - rect = [text boundingRectWithSize:NSInsetRect(contentRect, TEXT_MARGIN_X, TEXT_MARGIN_Y).size options:NSStringDrawingUsesLineFragmentOrigin]; - rect.size.width = contentRect.size.width = NSWidth(rect) + 2.0 * TEXT_MARGIN_X; - rect.size.height = contentRect.size.height = fmin(NSHeight(rect) + 2.0 * TEXT_MARGIN_Y, NSHeight(contentRect)); + NSRect rect = [text boundingRectWithSize:NSInsetRect(contentRect, TEXT_MARGIN_X, TEXT_MARGIN_Y).size options:NSStringDrawingUsesLineFragmentOrigin]; + + rect.size.width = ceilf(NSWidth(rect) + 2.0 * TEXT_MARGIN_X); + rect.size.height = ceilf(fmin(NSHeight(rect) + 2.0 * TEXT_MARGIN_Y, NSHeight(contentRect))); rect.origin = NSZeroPoint; image = [[NSImage alloc] initWithSize:rect.size]; @@ -296,17 +304,20 @@ [image unlockFocus]; [text release]; + + contentRect.size = rect.size; } if (image) { - [imageView setFrameSize:[image size]]; + NSImageView *imageView = (NSImageView *)[self contentView]; + [imageView setImage:image]; [image release]; contentRect.origin.y -= NSHeight(contentRect); - [self setFrame:[self hoverWindowRectFittingScreenFromRect:contentRect] display:NO]; - [imageView scrollRectToVisible:rect]; + contentRect = SKRectFittingRectInRect(contentRect, [[NSScreen mainScreen] visibleFrame]); + [self setFrame:[self frameRectForContentRect:contentRect] display:NO]; [[imageView enclosingScrollView] setBackgroundColor:color]; @@ -347,7 +358,7 @@ annotation = [note retain]; NSDate *date = [NSDate dateWithTimeIntervalSinceNow:[self isVisible] ? 0.1 : 1.0]; - timer = [[NSTimer alloc] initWithFireDate:date interval:0 target:self selector:@selector(timerFired:) userInfo:NULL repeats:NO]; + timer = [[NSTimer alloc] initWithFireDate:date interval:0 target:self selector:@selector(showWithTimer:) userInfo:NULL repeats:NO]; [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSDefaultRunLoopMode]; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-29 09:50:18
|
Revision: 1928 http://skim-app.svn.sourceforge.net/skim-app/?rev=1928&view=rev Author: hofman Date: 2007-04-29 02:50:17 -0700 (Sun, 29 Apr 2007) Log Message: ----------- Fix comparison Modified Paths: -------------- trunk/SKPDFSynchronizer.m Modified: trunk/SKPDFSynchronizer.m =================================================================== --- trunk/SKPDFSynchronizer.m 2007-04-29 09:34:55 UTC (rev 1927) +++ trunk/SKPDFSynchronizer.m 2007-04-29 09:50:17 UTC (rev 1928) @@ -63,7 +63,7 @@ if (NO == CFURLGetFSRef((CFURLRef)[NSURL fileURLWithPath:path], &fileRef)) return nil; - if (noErr == FSGetCatalogInfo( &fileRef, kFSCatInfoContentMod, &info, NULL,NULL, NULL )) + if (noErr != FSGetCatalogInfo( &fileRef, kFSCatInfoContentMod, &info, NULL,NULL, NULL )) return nil; union { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-29 09:34:58
|
Revision: 1927 http://skim-app.svn.sourceforge.net/skim-app/?rev=1927&view=rev Author: hofman Date: 2007-04-29 02:34:55 -0700 (Sun, 29 Apr 2007) Log Message: ----------- Reorganize PDF contextual menu. Put notes stuff on top, and rename New Notes item. Modified Paths: -------------- trunk/Dutch.lproj/Localizable.strings trunk/Dutch.lproj/PreferenceWindow.nib/info.nib trunk/Dutch.lproj/PreferenceWindow.nib/keyedobjects.nib trunk/English.lproj/Localizable.strings trunk/SKPDFView.m Modified: trunk/Dutch.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/Dutch.lproj/PreferenceWindow.nib/info.nib =================================================================== --- trunk/Dutch.lproj/PreferenceWindow.nib/info.nib 2007-04-28 20:35:01 UTC (rev 1926) +++ trunk/Dutch.lproj/PreferenceWindow.nib/info.nib 2007-04-29 09:34:55 UTC (rev 1927) @@ -3,7 +3,7 @@ <plist version="1.0"> <dict> <key>IBDocumentLocation</key> - <string>68 59 356 240 0 0 1440 938 </string> + <string>69 58 356 240 0 0 1440 938 </string> <key>IBFramework Version</key> <string>446.1</string> <key>IBLockedObjects</key> Modified: trunk/Dutch.lproj/PreferenceWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-28 20:35:01 UTC (rev 1926) +++ trunk/SKPDFView.m 2007-04-29 09:34:55 UTC (rev 1927) @@ -856,7 +856,7 @@ if (hasNavigation && autohidesCursor) return menu; - [menu addItem:[NSMenuItem separatorItem]]; + [menu insertItem:[NSMenuItem separatorItem] atIndex:0]; submenu = [[NSMenu allocWithZone:[menu zone]] init]; @@ -872,22 +872,32 @@ [item setTag:SKMagnifyToolMode]; [item setTarget:self]; - item = [menu addItemWithTitle:NSLocalizedString(@"Tools", @"Menu item title") action:NULL keyEquivalent:@""]; + item = [menu insertItemWithTitle:NSLocalizedString(@"Tools", @"Menu item title") action:NULL keyEquivalent:@"" atIndex:0]; [item setSubmenu:submenu]; [submenu release]; NSPoint point = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - [menu addItem:[NSMenuItem separatorItem]]; + [menu insertItem:[NSMenuItem separatorItem] atIndex:0]; - item = [menu addItemWithTitle:NSLocalizedString(@"Take Snapshot", @"Menu item title") action:@selector(takeSnapshot:) keyEquivalent:@""]; + item = [menu insertItemWithTitle:NSLocalizedString(@"Take Snapshot", @"Menu item title") action:@selector(takeSnapshot:) keyEquivalent:@"" atIndex:0]; [item setRepresentedObject:[NSValue valueWithPoint:point]]; [item setTarget:self]; if ([self toolMode] == SKTextToolMode) { - [menu addItem:[NSMenuItem separatorItem]]; + long version; + OSStatus err = Gestalt(gestaltSystemVersion, &version); + if ([[self currentSelection] string] && noErr == err && version < 0x00001050) { + + [menu insertItem:[NSMenuItem separatorItem] atIndex:0]; + + item = [menu insertItemWithTitle:NSLocalizedString(@"Look Up in Dictionary", @"") action:@selector(lookUpCurrentSelectionInDictionary:) keyEquivalent:@"" atIndex:0]; + } + + [menu insertItem:[NSMenuItem separatorItem] atIndex:0]; + submenu = [[NSMenu allocWithZone:[menu zone]] init]; item = [submenu addItemWithTitle:NSLocalizedString(@"Text Note", @"Menu item title") action:@selector(addAnnotationFromMenu:) keyEquivalent:@""]; @@ -932,23 +942,12 @@ [item setTag:SKArrowNote]; [item setTarget:self]; - item = [menu addItemWithTitle:NSLocalizedString(@"New Note", @"Menu item title") action:NULL keyEquivalent:@""]; + item = [menu insertItemWithTitle:NSLocalizedString(@"New Note or Highlight", @"Menu item title") action:NULL keyEquivalent:@"" atIndex:0]; [item setSubmenu:submenu]; [submenu release]; - [menu addItem:[NSMenuItem separatorItem]]; + [menu insertItem:[NSMenuItem separatorItem] atIndex:0]; - if ([self currentSelection] || ([activeAnnotation isNoteAnnotation] && [activeAnnotation isMovable])) { - item = [menu addItemWithTitle:NSLocalizedString(@"Copy", @"Menu item title") action:@selector(copy:) keyEquivalent:@""]; - if ([activeAnnotation isNoteAnnotation] && [activeAnnotation isMovable]) - item = [menu addItemWithTitle:NSLocalizedString(@"Cut", @"Menu item title") action:@selector(copy:) keyEquivalent:@""]; - } - - if ([[NSPasteboard generalPasteboard] availableTypeFromArray:[NSArray arrayWithObjects:SKSkimNotePboardType, NSStringPboardType, nil]]) { - SEL selector = ([theEvent modifierFlags] & NSAlternateKeyMask) ? @selector(alternatePaste:) : @selector(paste:); - item = [menu addItemWithTitle:NSLocalizedString(@"Paste", @"Menu item title") action:selector keyEquivalent:@""]; - } - PDFPage *page = [self pageForPoint:point nearest:YES]; PDFAnnotation *annotation = nil; @@ -959,35 +958,34 @@ } if (annotation) { - item = [menu addItemWithTitle:NSLocalizedString(@"Remove Note", @"Menu item title") action:@selector(removeThisAnnotation:) keyEquivalent:@""]; - [item setRepresentedObject:annotation]; - [item setTarget:self]; - if ((annotation != activeAnnotation || editAnnotation == nil) && [annotation isEditable]) { - item = [menu addItemWithTitle:NSLocalizedString(@"Edit Note", @"Menu item title") action:@selector(editThisAnnotation:) keyEquivalent:@""]; + item = [menu insertItemWithTitle:NSLocalizedString(@"Edit Note", @"Menu item title") action:@selector(editThisAnnotation:) keyEquivalent:@"" atIndex:0]; [item setRepresentedObject:annotation]; [item setTarget:self]; } - } else if ([activeAnnotation isNoteAnnotation]) { - item = [menu addItemWithTitle:NSLocalizedString(@"Remove Current Note", @"Menu item title") action:@selector(removeActiveAnnotation:) keyEquivalent:@""]; - [item setTarget:self]; + item = [menu insertItemWithTitle:NSLocalizedString(@"Remove Note", @"Menu item title") action:@selector(removeThisAnnotation:) keyEquivalent:@"" atIndex:0]; + [item setRepresentedObject:annotation]; + [item setTarget:self]; + } else if ([activeAnnotation isNoteAnnotation]) { if (editAnnotation == nil && [activeAnnotation isEditable]) { - item = [menu addItemWithTitle:NSLocalizedString(@"Edit Current Note", @"Menu item title") action:@selector(editActiveAnnotation:) keyEquivalent:@""]; + item = [menu insertItemWithTitle:NSLocalizedString(@"Edit Current Note", @"Menu item title") action:@selector(editActiveAnnotation:) keyEquivalent:@"" atIndex:0]; [item setTarget:self]; } + + item = [menu insertItemWithTitle:NSLocalizedString(@"Remove Current Note", @"Menu item title") action:@selector(removeActiveAnnotation:) keyEquivalent:@"" atIndex:0]; + [item setTarget:self]; } - long version; - OSStatus err = Gestalt(gestaltSystemVersion, &version); + if ([[NSPasteboard generalPasteboard] availableTypeFromArray:[NSArray arrayWithObjects:SKSkimNotePboardType, NSStringPboardType, nil]]) { + SEL selector = ([theEvent modifierFlags] & NSAlternateKeyMask) ? @selector(alternatePaste:) : @selector(paste:); + item = [menu insertItemWithTitle:NSLocalizedString(@"Paste", @"Menu item title") action:selector keyEquivalent:@"" atIndex:0]; + } - if ([[self currentSelection] string] && noErr == err && version < 0x00001050) { - - [menu addItem:[NSMenuItem separatorItem]]; - - item = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:NSLocalizedString(@"Look Up in Dictionary", @"") action:@selector(lookUpCurrentSelectionInDictionary:) keyEquivalent:@""]; - [menu addItem:item]; - [item release]; + if ([self currentSelection] || ([activeAnnotation isNoteAnnotation] && [activeAnnotation isMovable])) { + if ([activeAnnotation isNoteAnnotation] && [activeAnnotation isMovable]) + item = [menu insertItemWithTitle:NSLocalizedString(@"Cut", @"Menu item title") action:@selector(copy:) keyEquivalent:@"" atIndex:0]; + item = [menu insertItemWithTitle:NSLocalizedString(@"Copy", @"Menu item title") action:@selector(copy:) keyEquivalent:@"" atIndex:0]; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-28 20:35:07
|
Revision: 1926 http://skim-app.svn.sourceforge.net/skim-app/?rev=1926&view=rev Author: hofman Date: 2007-04-28 13:35:01 -0700 (Sat, 28 Apr 2007) Log Message: ----------- check if server is still running while waiting for server Modified Paths: -------------- trunk/SKPDFSynchronizer.m Modified: trunk/SKPDFSynchronizer.m =================================================================== --- trunk/SKPDFSynchronizer.m 2007-04-28 20:14:20 UTC (rev 1925) +++ trunk/SKPDFSynchronizer.m 2007-04-28 20:35:01 UTC (rev 1926) @@ -244,13 +244,13 @@ #pragma mark | Finding - (void)findLineForLocation:(NSPoint)point inRect:(NSRect)rect atPageIndex:(unsigned int)pageIndex { - while (serverOnServerThread == nil) + while (shouldKeepRunning && serverOnServerThread == nil) [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; [serverOnServerThread serverFindLineForLocation:point inRect:rect atPageIndex:pageIndex]; } - (void)findPageLocationForLine:(int)line inFile:(NSString *)file { - while (serverOnServerThread == nil) + while (shouldKeepRunning && serverOnServerThread == nil) [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; [serverOnServerThread serverFindPageLocationForLine:line inFile:file]; } @@ -334,6 +334,8 @@ } } +#pragma mark | Parsing and Finding + - (BOOL)parsePdfsyncFileIfNeeded { NSString *theFileName = [self fileName]; @@ -349,8 +351,6 @@ return YES; } -#pragma mark | Parsing and Finding - - (BOOL)parsePdfsyncFile { NSString *theFileName = [self fileName]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |