You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
(23) |
Apr
(254) |
May
(252) |
Jun
(209) |
Jul
(198) |
Aug
(192) |
Sep
(207) |
Oct
(120) |
Nov
(179) |
Dec
(52) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(48) |
Feb
(69) |
Mar
(129) |
Apr
(250) |
May
(113) |
Jun
(177) |
Jul
(228) |
Aug
(155) |
Sep
(218) |
Oct
(185) |
Nov
(109) |
Dec
(88) |
2009 |
Jan
(83) |
Feb
(39) |
Mar
(70) |
Apr
(47) |
May
(48) |
Jun
(67) |
Jul
(61) |
Aug
(97) |
Sep
(221) |
Oct
(141) |
Nov
(70) |
Dec
(61) |
2010 |
Jan
(45) |
Feb
(76) |
Mar
(178) |
Apr
(106) |
May
(57) |
Jun
(32) |
Jul
(64) |
Aug
(98) |
Sep
(96) |
Oct
(19) |
Nov
(34) |
Dec
(117) |
2011 |
Jan
(55) |
Feb
(48) |
Mar
(64) |
Apr
(21) |
May
(39) |
Jun
(53) |
Jul
(99) |
Aug
(56) |
Sep
(39) |
Oct
(26) |
Nov
(19) |
Dec
(69) |
2012 |
Jan
(17) |
Feb
(40) |
Mar
(17) |
Apr
|
May
(2) |
Jun
(8) |
Jul
(2) |
Aug
(10) |
Sep
(10) |
Oct
(38) |
Nov
(48) |
Dec
(70) |
2013 |
Jan
(43) |
Feb
(47) |
Mar
(39) |
Apr
(37) |
May
(25) |
Jun
(6) |
Jul
(20) |
Aug
(49) |
Sep
(33) |
Oct
(34) |
Nov
(75) |
Dec
(6) |
2014 |
Jan
(32) |
Feb
(10) |
Mar
(17) |
Apr
|
May
|
Jun
(26) |
Jul
(5) |
Aug
|
Sep
(4) |
Oct
(23) |
Nov
(80) |
Dec
(48) |
2015 |
Jan
(80) |
Feb
(50) |
Mar
(58) |
Apr
(20) |
May
(11) |
Jun
(16) |
Jul
(24) |
Aug
(27) |
Sep
(56) |
Oct
(30) |
Nov
(16) |
Dec
(6) |
2016 |
Jan
(31) |
Feb
(14) |
Mar
(23) |
Apr
(17) |
May
(40) |
Jun
(12) |
Jul
(17) |
Aug
(9) |
Sep
(32) |
Oct
(36) |
Nov
(23) |
Dec
(9) |
2017 |
Jan
(37) |
Feb
(23) |
Mar
(65) |
Apr
(22) |
May
(6) |
Jun
(3) |
Jul
|
Aug
|
Sep
(3) |
Oct
(22) |
Nov
(63) |
Dec
(71) |
2018 |
Jan
(83) |
Feb
(21) |
Mar
(35) |
Apr
(44) |
May
(14) |
Jun
(12) |
Jul
(8) |
Aug
(18) |
Sep
(10) |
Oct
(145) |
Nov
(144) |
Dec
(76) |
2019 |
Jan
(18) |
Feb
(28) |
Mar
(5) |
Apr
(208) |
May
(291) |
Jun
(158) |
Jul
(27) |
Aug
(8) |
Sep
(10) |
Oct
(83) |
Nov
(41) |
Dec
(31) |
2020 |
Jan
(16) |
Feb
(46) |
Mar
(100) |
Apr
(78) |
May
(69) |
Jun
(71) |
Jul
(28) |
Aug
(131) |
Sep
(176) |
Oct
(89) |
Nov
(147) |
Dec
(19) |
2021 |
Jan
(19) |
Feb
(25) |
Mar
(91) |
Apr
(98) |
May
(14) |
Jun
(44) |
Jul
(8) |
Aug
(3) |
Sep
(38) |
Oct
(57) |
Nov
(97) |
Dec
(74) |
2022 |
Jan
(89) |
Feb
(47) |
Mar
(15) |
Apr
(50) |
May
(54) |
Jun
(56) |
Jul
(80) |
Aug
(12) |
Sep
(11) |
Oct
(60) |
Nov
(48) |
Dec
(4) |
2023 |
Jan
(75) |
Feb
(49) |
Mar
(84) |
Apr
(24) |
May
(13) |
Jun
(74) |
Jul
(32) |
Aug
(66) |
Sep
(50) |
Oct
(38) |
Nov
(105) |
Dec
(181) |
2024 |
Jan
(21) |
Feb
(49) |
Mar
(77) |
Apr
(84) |
May
(20) |
Jun
(71) |
Jul
(53) |
Aug
(33) |
Sep
(54) |
Oct
(124) |
Nov
(151) |
Dec
(73) |
2025 |
Jan
(61) |
Feb
(17) |
Mar
(136) |
Apr
(72) |
May
(200) |
Jun
(238) |
Jul
(91) |
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <ho...@us...> - 2025-05-21 14:31:54
|
Revision: 15249 http://sourceforge.net/p/skim-app/code/15249 Author: hofman Date: 2025-05-21 14:31:51 +0000 (Wed, 21 May 2025) Log Message: ----------- get correct point for link Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-21 14:15:21 UTC (rev 15248) +++ trunk/SKPresentationView.m 2025-05-21 14:31:51 UTC (rev 15249) @@ -1133,7 +1133,7 @@ [[NSCursor arrowCursor] set]; else if (pvFlags.cursorHidden) [[NSCursor emptyCursor] set]; - else if ([[self linkAnotationAtPoint:point] destination]) + else if ([[self linkAnotationAtPoint:[self convertPointFromScreen:point]] destination]) [[NSCursor pointingHandCursor] set]; else if (pvFlags.useArrowCursor) [[NSCursor arrowCursor] set]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-21 14:15:23
|
Revision: 15248 http://sourceforge.net/p/skim-app/code/15248 Author: hofman Date: 2025-05-21 14:15:21 +0000 (Wed, 21 May 2025) Log Message: ----------- return directly when the page does not have annotations Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-21 09:28:07 UTC (rev 15247) +++ trunk/SKPresentationView.m 2025-05-21 14:15:21 UTC (rev 15248) @@ -613,7 +613,7 @@ } - (PDFAnnotation *)linkAnotationAtPoint:(NSPoint)point { - if (page == nil) + if ([[page annotations] count] == 0) return nil; point = [self convertPointToPage:point]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-21 09:28:10
|
Revision: 15247 http://sourceforge.net/p/skim-app/code/15247 Author: hofman Date: 2025-05-21 09:28:07 +0000 (Wed, 21 May 2025) Log Message: ----------- Allow clicking local links in presentation Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-21 09:12:57 UTC (rev 15246) +++ trunk/SKPresentationView.m 2025-05-21 09:28:07 UTC (rev 15247) @@ -55,6 +55,7 @@ #import "NSView_SKExtensions.h" #import "PDFPage_SKExtensions.h" #import "PDFDocument_SKExtensions.h" +#import "PDFAnnotation_SKExtensions.h" #define NAVIGATION_BOTTOM_EDGE_HEIGHT 5.0 @@ -611,6 +612,20 @@ return [transform transformPoint:point]; } +- (PDFAnnotation *)linkAnotationAtPoint:(NSPoint)point { + if (page == nil) + return nil; + + point = [self convertPointToPage:point]; + + for (PDFAnnotation *annotation in [[page annotations] reverseObjectEnumerator]) { + if ([annotation isLink] && [annotation hitTest:point]) + return annotation; + } + + return nil; +} + #pragma mark Accessors - (BOOL)canBecomeKeyView { @@ -786,7 +801,11 @@ if ([pageLayer opacity] <= 0.0) { [pageLayer setOpacity:1.0]; } else if ([NSApp willDragMouse] == NO) { - [self goToNextPage:self]; + PDFDestination *link = [[self linkAnotationAtPoint:[theEvent locationInView:self]] destination]; + if (link) + [self setPage:[link page]]; + else + [self goToNextPage:self]; } else if (IS_TABLET_EVENT(theEvent, NSPointingDeviceTypePen) == NO && ([[self window] styleMask] & NSWindowStyleMaskResizable) != 0 && NSEqualRects([[self window] frame], [[[self window] screen] frame]) == NO && (pvFlags.enableDrawing == NO || ([theEvent modifierFlags] & NSEventModifierFlagShift) == 0)) { pvFlags.cursorHidden = NO; [[NSCursor closedHandCursor] set]; @@ -807,8 +826,8 @@ - (void)mouseMoved:(NSEvent *)theEvent { pvFlags.cursorHidden = NO; - - [self setCursorAndAutoHide]; + [self setCursorForMouse:theEvent]; + [self performSelectorOnce:@selector(doAutoHide) afterDelay:AUTO_HIDE_DELAY]; if (navigationMode != SKNavigationNone && [navWindow isVisible] == NO) { if (navigationMode == SKNavigationEverywhere && [cursorWindow isVisible] == NO && NSPointInRect([theEvent locationInWindow], [[[self window] contentView] frame])) { @@ -1114,6 +1133,8 @@ [[NSCursor arrowCursor] set]; else if (pvFlags.cursorHidden) [[NSCursor emptyCursor] set]; + else if ([[self linkAnotationAtPoint:point] destination]) + [[NSCursor pointingHandCursor] set]; else if (pvFlags.useArrowCursor) [[NSCursor arrowCursor] set]; else if (pvFlags.removeLaserPointerShadow) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-21 09:12:59
|
Revision: 15246 http://sourceforge.net/p/skim-app/code/15246 Author: hofman Date: 2025-05-21 09:12:57 +0000 (Wed, 21 May 2025) Log Message: ----------- also predraw next page when all pages change Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-21 09:10:14 UTC (rev 15245) +++ trunk/SKPresentationView.m 2025-05-21 09:12:57 UTC (rev 15246) @@ -543,9 +543,11 @@ } - (void)setNeedsDisplayForPage:(PDFPage *)aPage { - if (page) { - [self removePredrawnImageAtIndex:aPage ? [aPage pageIndex] : NSNotFound]; - if (page == aPage || aPage == nil) { + if (page == nil) + return; + if (aPage) { + [self removePredrawnImageAtIndex:[aPage pageIndex]]; + if (page == aPage) { [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(displayCurrentPage:) object:nil]; [self performSelector:@selector(displayCurrentPage:) withObject:nil afterDelay:0.0]; } else if ([page pageIndex] + 1 == [aPage pageIndex]) { @@ -552,6 +554,12 @@ [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(predrawNextPage) object:nil]; [self performSelector:@selector(predrawNextPage) withObject:nil afterDelay:0.0]; } + } else { + [self removePredrawnImageAtIndex:NSNotFound]; + [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(displayCurrentPage:) object:nil]; + [self performSelector:@selector(displayCurrentPage:) withObject:nil afterDelay:0.0]; + [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(predrawNextPage) object:nil]; + [self performSelector:@selector(predrawNextPage) withObject:nil afterDelay:0.0]; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-21 09:10:18
|
Revision: 15245 http://sourceforge.net/p/skim-app/code/15245 Author: hofman Date: 2025-05-21 09:10:14 +0000 (Wed, 21 May 2025) Log Message: ----------- Redisplay presentation when page bounds changes. Add some convenience method to transform points in presentation view Modified Paths: -------------- trunk/SKMainWindowController.m trunk/SKPresentationView.h trunk/SKPresentationView.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-21 08:49:31 UTC (rev 15244) +++ trunk/SKMainWindowController.m 2025-05-21 09:10:14 UTC (rev 15245) @@ -2157,6 +2157,9 @@ [secondaryPdfView setNeedsDisplay:YES]; + if ([self interactionMode] == SKPresentationMode) + [presentationView setNeedsDisplayForPage:page]; + if ([[NSUserDefaults standardUserDefaults] boolForKey:SKDisplayPageBoundsKey]) [self updateRightStatus]; Modified: trunk/SKPresentationView.h =================================================================== --- trunk/SKPresentationView.h 2025-05-21 08:49:31 UTC (rev 15244) +++ trunk/SKPresentationView.h 2025-05-21 09:10:14 UTC (rev 15245) @@ -117,7 +117,7 @@ - (void)didOpen; - (void)willClose; -- (void)setNeedsDisplayForPage:(PDFPage *)aPage; +- (void)setNeedsDisplayForPage:(nullable PDFPage *)aPage; @end Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-21 08:49:31 UTC (rev 15244) +++ trunk/SKPresentationView.m 2025-05-21 09:10:14 UTC (rev 15245) @@ -543,16 +543,66 @@ } - (void)setNeedsDisplayForPage:(PDFPage *)aPage { - [self removePredrawnImageAtIndex:[aPage pageIndex]]; - if (page == aPage) { - [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(displayCurrentPage:) object:nil]; - [self performSelector:@selector(displayCurrentPage:) withObject:nil afterDelay:0.0]; - } else if (page && [page pageIndex] + 1 == [aPage pageIndex]) { - [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(predrawNextPage) object:nil]; - [self performSelector:@selector(predrawNextPage) withObject:nil afterDelay:0.0]; + if (page) { + [self removePredrawnImageAtIndex:aPage ? [aPage pageIndex] : NSNotFound]; + if (page == aPage || aPage == nil) { + [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(displayCurrentPage:) object:nil]; + [self performSelector:@selector(displayCurrentPage:) withObject:nil afterDelay:0.0]; + } else if ([page pageIndex] + 1 == [aPage pageIndex]) { + [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(predrawNextPage) object:nil]; + [self performSelector:@selector(predrawNextPage) withObject:nil afterDelay:0.0]; + } } } +#pragma mark Transforms + +- (NSPoint)convertPointToPage:(NSPoint)point { + if (page == nil) + return point; + + NSRect bounds = [self bounds]; + NSRect pageBounds = [page boundsForBox:kPDFDisplayBoxCropBox]; + CGFloat scale; + if (pvFlags.autoScales == NO) + scale = 1.0; + else if (([page rotation] % 180)) + scale = fmin(NSHeight(bounds) / NSWidth(pageBounds), NSWidth(bounds) / NSHeight(pageBounds)); + else + scale = fmin(NSHeight(bounds) / NSHeight(pageBounds), NSWidth(bounds) / NSWidth(pageBounds)); + + NSAffineTransform *transform = [NSAffineTransform transform]; + [transform translateXBy:NSMidX(pageBounds) yBy:NSMidY(pageBounds)]; + [transform rotateByDegrees:[page rotation]]; + [transform scaleBy:1.0 / scale]; + [transform translateXBy:-NSMidX(bounds) yBy:-NSMidY(bounds)]; + + return [transform transformPoint:point]; +} + +- (NSPoint)convertPointFromPage:(NSPoint)point { + if (page == nil) + return point; + + NSRect bounds = [self bounds]; + NSRect pageBounds = [page boundsForBox:kPDFDisplayBoxCropBox]; + CGFloat scale; + if (pvFlags.autoScales == NO) + scale = 1.0; + else if (([page rotation] % 180)) + scale = fmin(NSHeight(bounds) / NSWidth(pageBounds), NSWidth(bounds) / NSHeight(pageBounds)); + else + scale = fmin(NSHeight(bounds) / NSHeight(pageBounds), NSWidth(bounds) / NSWidth(pageBounds)); + + NSAffineTransform *transform = [NSAffineTransform transform]; + [transform translateXBy:NSMidX(bounds) yBy:NSMidY(bounds)]; + [transform scaleBy:scale]; + [transform rotateByDegrees:-[page rotation]]; + [transform translateXBy:-NSMidX(pageBounds) yBy:-NSMidY(pageBounds)]; + + return [transform transformPoint:point]; +} + #pragma mark Accessors - (BOOL)canBecomeKeyView { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-21 08:49:34
|
Revision: 15244 http://sourceforge.net/p/skim-app/code/15244 Author: hofman Date: 2025-05-21 08:49:31 +0000 (Wed, 21 May 2025) Log Message: ----------- simplify transform calculation for drawing freehand in presentation Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-20 09:04:25 UTC (rev 15243) +++ trunk/SKPresentationView.m 2025-05-21 08:49:31 UTC (rev 15244) @@ -867,20 +867,21 @@ - (void)doDrawFreehandNoteWithEvent:(NSEvent *)theEvent { NSRect bounds = [self bounds]; NSRect pageBounds = [page boundsForBox:kPDFDisplayBoxCropBox]; - NSRect pageRect = pageBounds; - if (([page rotation] % 180) != 0) - pageRect = NSMakeRect(0.0, 0.0, NSHeight(pageRect), NSWidth(pageRect)); - CGFloat scale = pvFlags.autoScales ? fmin(NSHeight(bounds) / NSHeight(pageRect), NSWidth(bounds) / NSWidth(pageRect)) : 1.0; - pageRect = NSInsetRect(bounds, 0.5 * (NSWidth(bounds) - scale * NSWidth(pageRect)), 0.5 * (NSHeight(bounds) - scale * NSHeight(pageRect))); + CGFloat scale; + if (pvFlags.autoScales == NO) + scale = 1.0; + else if (([page rotation] % 180)) + scale = fmin(NSHeight(bounds) / NSWidth(pageBounds), NSWidth(bounds) / NSHeight(pageBounds)); + else + scale = fmin(NSHeight(bounds) / NSHeight(pageBounds), NSWidth(bounds) / NSWidth(pageBounds)); - NSAffineTransform *viewFromPage = [NSAffineTransform transform]; - [viewFromPage translateXBy:NSMinX(pageRect) yBy:NSMinY(pageRect)]; - [viewFromPage scaleBy:scale]; - [viewFromPage prependTransform:[page affineTransformForBox:kPDFDisplayBoxCropBox]]; - NSAffineTransform *viewToPage = [[NSAffineTransform alloc] initWithTransform:viewFromPage]; - [viewToPage invert]; + NSAffineTransform *transform = [NSAffineTransform transform]; + [transform translateXBy:NSMidX(pageBounds) yBy:NSMidY(pageBounds)]; + [transform rotateByDegrees:[page rotation]]; + [transform scaleBy:1.0 / scale]; + [transform translateXBy:-NSMidX(bounds) yBy:-NSMidY(bounds)]; - NSPoint point = [viewToPage transformPoint:[theEvent locationInView:self]]; + NSPoint point = [transform transformPoint:[theEvent locationInView:self]]; NSWindow *window = [self window]; BOOL wasMouseCoalescingEnabled = [NSEvent isMouseCoalescingEnabled]; BOOL isOption = ([theEvent modifierFlags] & NSEventModifierFlagOption) != 0; @@ -890,16 +891,15 @@ CGMutablePathRef cgPath = NULL; NSUserDefaults *sud = [NSUserDefaults standardUserDefaults]; CAShapeLayer *layer = nil; - NSRect boxBounds = NSIntersectionRect(pageBounds, SKTransformRect(viewToPage, bounds)); + NSRect boxBounds = pvFlags.autoScales ? pageBounds : NSIntersectionRect(pageBounds, SKTransformRect(transform, bounds)); CGAffineTransform t = CGAffineTransformMakeRotation(-M_PI_2 * [page rotation] / 90.0); NSColor *tmpColor = [sud colorForKey:SKPresentationInkNoteColorKey]; layer = [CAShapeLayer layer]; // transform and place so that the path is in scaled page coordinates [layer setBounds:CGRectMake(scale * NSMinX(boxBounds), scale * NSMinY(boxBounds), scale * NSWidth(boxBounds), scale * NSHeight(boxBounds))]; - [layer setAnchorPoint:CGPointZero]; - [layer setPosition:NSPointToCGPoint([viewFromPage transformPoint:boxBounds.origin])]; + [layer setAnchorPoint:CGPointMake(0.5, 0.5)]; + [layer setPosition:CGPointMake(NSMidX(bounds), NSMidY(bounds))]; [layer setAffineTransform:t]; - [layer setZPosition:1.0]; [layer setMasksToBounds:YES]; [layer setFillColor:NULL]; [layer setLineJoin:kCALineJoinRound]; @@ -937,7 +937,7 @@ [PDFAnnotation addPoint:point toSkimNotesPath:bezierPath]; } - point = [viewToPage transformPoint:[theEvent locationInView:self]]; + point = [transform transformPoint:[theEvent locationInView:self]]; if (isOption && wantsBreak == NO) { NSInteger eltCount = [bezierPath elementCount]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-20 09:04:28
|
Revision: 15243 http://sourceforge.net/p/skim-app/code/15243 Author: hofman Date: 2025-05-20 09:04:25 +0000 (Tue, 20 May 2025) Log Message: ----------- Tag for release Added Paths: ----------- tags/REL_1_7_10/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-20 09:03:41
|
Revision: 15242 http://sourceforge.net/p/skim-app/code/15242 Author: hofman Date: 2025-05-20 09:03:39 +0000 (Tue, 20 May 2025) Log Message: ----------- copy back trunk Added Paths: ----------- trunk/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-20 08:58:39
|
Revision: 15241 http://sourceforge.net/p/skim-app/code/15241 Author: hofman Date: 2025-05-20 08:58:37 +0000 (Tue, 20 May 2025) Log Message: ----------- delete tag Removed Paths: ------------- tags/REL_1_7_10/ trunk/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-20 08:58:06
|
Revision: 15240 http://sourceforge.net/p/skim-app/code/15240 Author: hofman Date: 2025-05-20 08:58:03 +0000 (Tue, 20 May 2025) Log Message: ----------- Update version numbers for release Modified Paths: -------------- trunk/Info.plist trunk/Skim.xcodeproj/project.pbxproj Modified: trunk/Info.plist =================================================================== --- trunk/Info.plist 2025-05-20 08:57:35 UTC (rev 15239) +++ trunk/Info.plist 2025-05-20 08:58:03 UTC (rev 15240) @@ -310,7 +310,7 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>1.7.9</string> + <string>1.7.10</string> <key>CFBundleSignature</key> <string>SKim</string> <key>CFBundleURLTypes</key> Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2025-05-20 08:57:35 UTC (rev 15239) +++ trunk/Skim.xcodeproj/project.pbxproj 2025-05-20 08:58:03 UTC (rev 15240) @@ -3803,7 +3803,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = CE17EE460E24ED7C00DE06EA /* Skim-App.xcconfig */; buildSettings = { - CURRENT_PROJECT_VERSION = 161; + CURRENT_PROJECT_VERSION = 162; }; name = Debug; }; @@ -3811,7 +3811,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = CE17EE460E24ED7C00DE06EA /* Skim-App.xcconfig */; buildSettings = { - CURRENT_PROJECT_VERSION = 161; + CURRENT_PROJECT_VERSION = 162; }; name = Release; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-20 08:57:38
|
Revision: 15239 http://sourceforge.net/p/skim-app/code/15239 Author: hofman Date: 2025-05-20 08:57:35 +0000 (Tue, 20 May 2025) Log Message: ----------- reorder code Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-20 08:53:06 UTC (rev 15238) +++ trunk/SKPresentationView.m 2025-05-20 08:57:35 UTC (rev 15239) @@ -452,28 +452,8 @@ return self; } -- (void)viewWillStartLiveResize { - [super viewWillStartLiveResize]; - [self removePredrawnImageAtIndex:NSNotFound]; -} +#pragma mark Drawing -- (void)viewDidEndLiveResize { - [super viewDidEndLiveResize]; - [self removePredrawnImageAtIndex:NSNotFound]; - [self displayCurrentPage:nil]; -} - -- (void)setNeedsDisplayForPage:(PDFPage *)aPage { - [self removePredrawnImageAtIndex:[aPage pageIndex]]; - if (page == aPage) { - [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(displayCurrentPage:) object:nil]; - [self performSelector:@selector(displayCurrentPage:) withObject:nil afterDelay:0.0]; - } else if (page && [page pageIndex] + 1 == [aPage pageIndex]) { - [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(predisplayNextPage) object:nil]; - [self performSelector:@selector(predisplayNextPage) withObject:nil afterDelay:0.0]; - } -} - - (NSImage *)predrawnImageAtIndex:(NSUInteger)pageIndex { if (predrawnImages == nil) return nil; @@ -501,7 +481,7 @@ } } -- (void)predisplayNextPage { +- (void)predrawNextPage { if (page == nil) return; @@ -548,9 +528,31 @@ - (void)displayCurrentPage:(void (^)(void))completionHandler { [super displayCurrentPage:completionHandler]; - [self predisplayNextPage]; + [self predrawNextPage]; } +- (void)viewWillStartLiveResize { + [super viewWillStartLiveResize]; + [self removePredrawnImageAtIndex:NSNotFound]; +} + +- (void)viewDidEndLiveResize { + [super viewDidEndLiveResize]; + [self removePredrawnImageAtIndex:NSNotFound]; + [self displayCurrentPage:nil]; +} + +- (void)setNeedsDisplayForPage:(PDFPage *)aPage { + [self removePredrawnImageAtIndex:[aPage pageIndex]]; + if (page == aPage) { + [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(displayCurrentPage:) object:nil]; + [self performSelector:@selector(displayCurrentPage:) withObject:nil afterDelay:0.0]; + } else if (page && [page pageIndex] + 1 == [aPage pageIndex]) { + [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(predrawNextPage) object:nil]; + [self performSelector:@selector(predrawNextPage) withObject:nil afterDelay:0.0]; + } +} + #pragma mark Accessors - (BOOL)canBecomeKeyView { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-20 08:53:08
|
Revision: 15238 http://sourceforge.net/p/skim-app/code/15238 Author: hofman Date: 2025-05-20 08:53:06 +0000 (Tue, 20 May 2025) Log Message: ----------- Tag for release Added Paths: ----------- tags/REL_1_7_10/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-19 14:39:01
|
Revision: 15237 http://sourceforge.net/p/skim-app/code/15237 Author: hofman Date: 2025-05-19 14:38:57 +0000 (Mon, 19 May 2025) Log Message: ----------- Always remove predrawn image when page needs display, redisplay when invalidating next page Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-19 13:57:32 UTC (rev 15236) +++ trunk/SKPresentationView.m 2025-05-19 14:38:57 UTC (rev 15237) @@ -464,10 +464,13 @@ } - (void)setNeedsDisplayForPage:(PDFPage *)aPage { + [self removePredrawnImageAtIndex:[aPage pageIndex]]; if (page == aPage) { - [self removePredrawnImageAtIndex:[aPage pageIndex]]; [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(displayCurrentPage:) object:nil]; [self performSelector:@selector(displayCurrentPage:) withObject:nil afterDelay:0.0]; + } else if (page && [page pageIndex] + 1 == [aPage pageIndex]) { + [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(predisplayNextPage) object:nil]; + [self performSelector:@selector(predisplayNextPage) withObject:nil afterDelay:0.0]; } } @@ -498,9 +501,7 @@ } } -- (void)displayCurrentPage:(void (^)(void))completionHandler { - [super displayCurrentPage:completionHandler]; - +- (void)predisplayNextPage { if (page == nil) return; @@ -545,6 +546,11 @@ } +- (void)displayCurrentPage:(void (^)(void))completionHandler { + [super displayCurrentPage:completionHandler]; + [self predisplayNextPage]; +} + #pragma mark Accessors - (BOOL)canBecomeKeyView { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-19 13:57:34
|
Revision: 15236 http://sourceforge.net/p/skim-app/code/15236 Author: hofman Date: 2025-05-19 13:57:32 +0000 (Mon, 19 May 2025) Log Message: ----------- don't set image when page is nil Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-19 09:37:48 UTC (rev 15235) +++ trunk/SKPresentationView.m 2025-05-19 13:57:32 UTC (rev 15236) @@ -359,7 +359,7 @@ } dispatch_block_t imageGenerator = [self imageGeneratorForPage:page handler:^(NSImage *image){ - if (pageIndex == [page pageIndex]) + if (page && pageIndex == [page pageIndex]) [pageLayer setContents:image]; if (completionHandler) completionHandler(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-19 09:37:49
|
Revision: 15235 http://sourceforge.net/p/skim-app/code/15235 Author: hofman Date: 2025-05-19 09:37:48 +0000 (Mon, 19 May 2025) Log Message: ----------- compare page index so we don't needto capture the page Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-19 09:36:23 UTC (rev 15234) +++ trunk/SKPresentationView.m 2025-05-19 09:37:48 UTC (rev 15235) @@ -358,9 +358,8 @@ return; } - PDFPage *thePage = page; dispatch_block_t imageGenerator = [self imageGeneratorForPage:page handler:^(NSImage *image){ - if (thePage == page) + if (pageIndex == [page pageIndex]) [pageLayer setContents:image]; if (completionHandler) completionHandler(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-19 09:36:27
|
Revision: 15234 http://sourceforge.net/p/skim-app/code/15234 Author: hofman Date: 2025-05-19 09:36:23 +0000 (Mon, 19 May 2025) Log Message: ----------- don't need bitmap anymore Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-19 09:35:00 UTC (rev 15233) +++ trunk/SKPresentationView.m 2025-05-19 09:36:23 UTC (rev 15234) @@ -517,11 +517,6 @@ else if (NSMapGet(predrawnImages, (void *)pageIndex)) return; - NSBitmapImageRep *imageRep = [self bitmapImageRepForCachingDisplayInRect:[self bounds]]; - - if (imageRep == nil) - return; - __block void *block = NULL; dispatch_block_t imageGenerator = [self imageGeneratorForPage:[[page document] pageAtIndex:pageIndex] handler:^(NSImage *image){ if (predrawnImages && block == NSMapGet(predrawnImages, (void *)pageIndex)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-19 09:35:03
|
Revision: 15233 http://sourceforge.net/p/skim-app/code/15233 Author: hofman Date: 2025-05-19 09:35:00 +0000 (Mon, 19 May 2025) Log Message: ----------- convenience method to create block drawing the image and scheduling main queue handler Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-19 08:48:22 UTC (rev 15232) +++ trunk/SKPresentationView.m 2025-05-19 09:35:00 UTC (rev 15233) @@ -297,37 +297,47 @@ - (void)removePredrawnImageAtIndex:(NSUInteger)pageIndex {} -static NSImage *imageByDrawingPageToBitmapImageRep(NSBitmapImageRep *imageRep, PDFPage *aPage, BOOL autoScales) { - NSSize size = [imageRep size]; - NSRect pageRect = [aPage boundsForBox:kPDFDisplayBoxCropBox]; - if (([aPage rotation] % 180) != 0) - pageRect = NSMakeRect(0.0, 0.0, NSHeight(pageRect), NSWidth(pageRect)); - CGFloat scale = 1.0; - if (autoScales) { - scale = fmin(size.height / NSHeight(pageRect), size.width / NSWidth(pageRect)); - pageRect.size.width *= scale; - pageRect.size.height *= scale; - } - pageRect.origin.x = 0.5 * (size.width - NSWidth(pageRect)); - pageRect.origin.y = 0.5 * (size.height - NSHeight(pageRect)); +- (dispatch_block_t)imageGeneratorForPage:(PDFPage *)aPage handler:(void (^)(NSImage *))handler { + NSBitmapImageRep *imageRep = [self bitmapImageRepForCachingDisplayInRect:[self bounds]]; - CGContextRef context = [[NSGraphicsContext graphicsContextWithBitmapImageRep:imageRep] CGContext]; + if (imageRep == nil) + return nil; - CGContextSaveGState(context); - CGContextSetFillColorWithColor(context, CGColorGetConstantColor(kCGColorWhite)); - CGContextFillRect(context, SKPixelAlignedRect(NSRectToCGRect(pageRect), context)); - CGContextRestoreGState(context); - CGContextSaveGState(context); - CGContextSetInterpolationQuality(context, [[NSUserDefaults standardUserDefaults] integerForKey:SKInterpolationQualityKey] + 1); - CGContextTranslateCTM(context, NSMinX(pageRect), NSMinY(pageRect)); - CGContextScaleCTM(context, scale, scale); - [aPage drawWithBox:kPDFDisplayBoxCropBox toContext:context]; - CGContextRestoreGState(context); + BOOL autoScales = [self autoScales]; - NSImage *image = [[NSImage alloc] initWithSize:size]; - [image addRepresentation:imageRep]; - - return image; + return dispatch_block_create(0, ^{ + + NSSize size = [imageRep size]; + NSRect pageRect = [aPage boundsForBox:kPDFDisplayBoxCropBox]; + if (([aPage rotation] % 180) != 0) + pageRect = NSMakeRect(0.0, 0.0, NSHeight(pageRect), NSWidth(pageRect)); + CGFloat scale = 1.0; + if (autoScales) { + scale = fmin(size.height / NSHeight(pageRect), size.width / NSWidth(pageRect)); + pageRect.size.width *= scale; + pageRect.size.height *= scale; + } + pageRect.origin.x = 0.5 * (size.width - NSWidth(pageRect)); + pageRect.origin.y = 0.5 * (size.height - NSHeight(pageRect)); + + CGContextRef context = [[NSGraphicsContext graphicsContextWithBitmapImageRep:imageRep] CGContext]; + + CGContextSaveGState(context); + CGContextSetFillColorWithColor(context, CGColorGetConstantColor(kCGColorWhite)); + CGContextFillRect(context, SKPixelAlignedRect(NSRectToCGRect(pageRect), context)); + CGContextRestoreGState(context); + CGContextSaveGState(context); + CGContextSetInterpolationQuality(context, [[NSUserDefaults standardUserDefaults] integerForKey:SKInterpolationQualityKey] + 1); + CGContextTranslateCTM(context, NSMinX(pageRect), NSMinY(pageRect)); + CGContextScaleCTM(context, scale, scale); + [aPage drawWithBox:kPDFDisplayBoxCropBox toContext:context]; + CGContextRestoreGState(context); + + NSImage *image = [[NSImage alloc] initWithSize:size]; + [image addRepresentation:imageRep]; + + dispatch_async(dispatch_get_main_queue(), ^{ handler(image); }); + }); } - (void)displayCurrentPage:(void (^)(void))completionHandler { @@ -348,9 +358,15 @@ return; } - NSBitmapImageRep *imageRep = [self bitmapImageRepForCachingDisplayInRect:[self bounds]]; + PDFPage *thePage = page; + dispatch_block_t imageGenerator = [self imageGeneratorForPage:page handler:^(NSImage *image){ + if (thePage == page) + [pageLayer setContents:image]; + if (completionHandler) + completionHandler(); + }]; - if (imageRep == nil) { + if (imageGenerator == nil) { if (completionHandler) completionHandler(); return; @@ -362,24 +378,8 @@ drawingQueue = dispatch_queue_create("net.sourceforge.skim-app.skim.pageview.drawing", queuePriority); } - PDFPage *thePage = page; - BOOL autoScales = [self autoScales]; + dispatch_async(drawingQueue, imageGenerator); - dispatch_async(drawingQueue, ^{ - - NSImage *image = imageByDrawingPageToBitmapImageRep(imageRep, thePage, autoScales); - - dispatch_async(dispatch_get_main_queue(), ^{ - - if (thePage == page) - [pageLayer setContents:image]; - if (completionHandler) - completionHandler(); - - }); - - }); - } - (void)redisplayAtCurrentScaleFactorIfNeeded { @@ -522,34 +522,24 @@ if (imageRep == nil) return; - PDFPage *thePage = [[page document] pageAtIndex:pageIndex]; - BOOL autoScales = [self autoScales]; + __block void *block = NULL; + dispatch_block_t imageGenerator = [self imageGeneratorForPage:[[page document] pageAtIndex:pageIndex] handler:^(NSImage *image){ + if (predrawnImages && block == NSMapGet(predrawnImages, (void *)pageIndex)) { + NSMapRemove(predrawnImages, (void *)pageIndex); + NSUInteger currentIndex = [page pageIndex]; + if (pageIndex > currentIndex) + NSMapInsert(predrawnImages, (void *)pageIndex, (__bridge void *)image); + else if (pageIndex == currentIndex) + [pageLayer setContents:image]; + } + }]; - __block void *myBlock = NULL; - dispatch_block_t block = dispatch_block_create(0, ^{ - - NSImage *image = imageByDrawingPageToBitmapImageRep(imageRep, thePage, autoScales); - - dispatch_async(dispatch_get_main_queue(), ^{ - - if (predrawnImages && myBlock == NSMapGet(predrawnImages, (void *)pageIndex)) { - NSMapRemove(predrawnImages, (void *)pageIndex); - if (image) { - NSUInteger currentIndex = [page pageIndex]; - if (pageIndex > currentIndex) - NSMapInsert(predrawnImages, (void *)pageIndex, (__bridge void *)image); - else if (pageIndex == currentIndex) - [pageLayer setContents:image]; - } - } - - }); - - }); + if (imageGenerator == nil) + return; // set this block so we can cancel it - myBlock = (__bridge void *)block; - NSMapInsert(predrawnImages, (void *)pageIndex, myBlock); + block = (__bridge void *)imageGenerator; + NSMapInsert(predrawnImages, (void *)pageIndex, block); static dispatch_queue_t predrawingQueue = nil; if (predrawingQueue == nil) { @@ -557,7 +547,7 @@ predrawingQueue = dispatch_queue_create("net.sourceforge.skim-app.skim.pageview.predrawing", queuePriority); } - dispatch_async(predrawingQueue, block); + dispatch_async(predrawingQueue, imageGenerator); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-19 08:48:24
|
Revision: 15232 http://sourceforge.net/p/skim-app/code/15232 Author: hofman Date: 2025-05-19 08:48:22 +0000 (Mon, 19 May 2025) Log Message: ----------- get queue laterr Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-18 21:24:51 UTC (rev 15231) +++ trunk/SKPresentationView.m 2025-05-19 08:48:22 UTC (rev 15232) @@ -517,12 +517,6 @@ else if (NSMapGet(predrawnImages, (void *)pageIndex)) return; - static dispatch_queue_t predrawingQueue = nil; - if (predrawingQueue == nil) { - dispatch_queue_attr_t queuePriority = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_BACKGROUND, 0); - predrawingQueue = dispatch_queue_create("net.sourceforge.skim-app.skim.pageview.predrawing", queuePriority); - } - NSBitmapImageRep *imageRep = [self bitmapImageRepForCachingDisplayInRect:[self bounds]]; if (imageRep == nil) @@ -557,6 +551,12 @@ myBlock = (__bridge void *)block; NSMapInsert(predrawnImages, (void *)pageIndex, myBlock); + static dispatch_queue_t predrawingQueue = nil; + if (predrawingQueue == nil) { + dispatch_queue_attr_t queuePriority = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_BACKGROUND, 0); + predrawingQueue = dispatch_queue_create("net.sourceforge.skim-app.skim.pageview.predrawing", queuePriority); + } + dispatch_async(predrawingQueue, block); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-18 21:10:52
|
Revision: 15230 http://sourceforge.net/p/skim-app/code/15230 Author: hofman Date: 2025-05-18 21:10:49 +0000 (Sun, 18 May 2025) Log Message: ----------- compare whether block itself is registered for image generation, otherwise ignore Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-18 16:19:53 UTC (rev 15229) +++ trunk/SKPresentationView.m 2025-05-18 21:10:49 UTC (rev 15230) @@ -481,12 +481,8 @@ return nil; } -static inline BOOL imageOrBlockIsBlock(id imageOrBlock) { - return imageOrBlock && [imageOrBlock isKindOfClass:[NSImage class]] == NO; -} - static inline void cancelIfBlock(id imageOrBlock) { - if (imageOrBlockIsBlock(imageOrBlock)) + if (imageOrBlock && [imageOrBlock isKindOfClass:[NSImage class]] == NO) dispatch_block_cancel((dispatch_block_t)imageOrBlock); } @@ -535,13 +531,14 @@ PDFPage *thePage = [[page document] pageAtIndex:pageIndex]; BOOL autoScales = [self autoScales]; + __block void *myBlock = NULL; dispatch_block_t block = dispatch_block_create(0, ^{ - + NSImage *image = imageByDrawingPageToBitmapImageRep(imageRep, thePage, autoScales); dispatch_async(dispatch_get_main_queue(), ^{ - if (predrawnImages && imageOrBlockIsBlock((__bridge id)NSMapGet(predrawnImages, (void *)pageIndex))) { + if (predrawnImages && myBlock == NSMapGet(predrawnImages, (void *)pageIndex)) { NSMapRemove(predrawnImages, (void *)pageIndex); if (image) { NSUInteger currentIndex = [page pageIndex]; @@ -557,7 +554,8 @@ }); // set this block so we can cancel it - NSMapInsert(predrawnImages, (void *)pageIndex, (__bridge void *)block); + myBlock = (__bridge void *)block; + NSMapInsert(predrawnImages, (void *)pageIndex, myBlock); dispatch_async(predrawingQueue, block); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-18 16:19:54
|
Revision: 15229 http://sourceforge.net/p/skim-app/code/15229 Author: hofman Date: 2025-05-18 16:19:53 +0000 (Sun, 18 May 2025) Log Message: ----------- combine conditions Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-18 16:17:27 UTC (rev 15228) +++ trunk/SKPresentationView.m 2025-05-18 16:19:53 UTC (rev 15229) @@ -541,16 +541,14 @@ dispatch_async(dispatch_get_main_queue(), ^{ - if (predrawnImages) { - if (imageOrBlockIsBlock((__bridge id)NSMapGet(predrawnImages, (void *)pageIndex))) { - NSMapRemove(predrawnImages, (void *)pageIndex); - if (image) { - NSUInteger currentIndex = [page pageIndex]; - if (pageIndex > currentIndex) - NSMapInsert(predrawnImages, (void *)pageIndex, (__bridge void *)image); - else if (pageIndex == currentIndex) - [pageLayer setContents:image]; - } + if (predrawnImages && imageOrBlockIsBlock((__bridge id)NSMapGet(predrawnImages, (void *)pageIndex))) { + NSMapRemove(predrawnImages, (void *)pageIndex); + if (image) { + NSUInteger currentIndex = [page pageIndex]; + if (pageIndex > currentIndex) + NSMapInsert(predrawnImages, (void *)pageIndex, (__bridge void *)image); + else if (pageIndex == currentIndex) + [pageLayer setContents:image]; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-18 16:17:30
|
Revision: 15228 http://sourceforge.net/p/skim-app/code/15228 Author: hofman Date: 2025-05-18 16:17:27 +0000 (Sun, 18 May 2025) Log Message: ----------- Cancel predrawn image block when removing Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-18 15:54:37 UTC (rev 15227) +++ trunk/SKPresentationView.m 2025-05-18 16:17:27 UTC (rev 15228) @@ -481,11 +481,26 @@ return nil; } +static inline BOOL imageOrBlockIsBlock(id imageOrBlock) { + return imageOrBlock && [imageOrBlock isKindOfClass:[NSImage class]] == NO; +} + +static inline void cancelIfBlock(id imageOrBlock) { + if (imageOrBlockIsBlock(imageOrBlock)) + dispatch_block_cancel((dispatch_block_t)imageOrBlock); +} + - (void)removePredrawnImageAtIndex:(NSUInteger)pageIndex { - if (pageIndex == NSNotFound) - predrawnImages = nil; - else if (predrawnImages) - NSMapRemove(predrawnImages, (void *)pageIndex); + if (predrawnImages) { + if (pageIndex == NSNotFound) { + for (id imageOrBlock in NSAllMapTableValues(predrawnImages)) + cancelIfBlock(imageOrBlock); + predrawnImages = nil; + } else { + cancelIfBlock((__bridge id)NSMapGet(predrawnImages, (void *)pageIndex)); + NSMapRemove(predrawnImages, (void *)pageIndex); + } + } } - (void)displayCurrentPage:(void (^)(void))completionHandler { @@ -506,9 +521,6 @@ else if (NSMapGet(predrawnImages, (void *)pageIndex)) return; - // set NSNull so we can invalidate this image - NSMapInsert(predrawnImages, (void *)pageIndex, (__bridge void *)[NSNull null]); - static dispatch_queue_t predrawingQueue = nil; if (predrawingQueue == nil) { dispatch_queue_attr_t queuePriority = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_BACKGROUND, 0); @@ -523,7 +535,7 @@ PDFPage *thePage = [[page document] pageAtIndex:pageIndex]; BOOL autoScales = [self autoScales]; - dispatch_async(predrawingQueue, ^{ + dispatch_block_t block = dispatch_block_create(0, ^{ NSImage *image = imageByDrawingPageToBitmapImageRep(imageRep, thePage, autoScales); @@ -530,7 +542,7 @@ dispatch_async(dispatch_get_main_queue(), ^{ if (predrawnImages) { - if ((__bridge id)NSMapGet(predrawnImages, (void *)pageIndex) == [NSNull null]) { + if (imageOrBlockIsBlock((__bridge id)NSMapGet(predrawnImages, (void *)pageIndex))) { NSMapRemove(predrawnImages, (void *)pageIndex); if (image) { NSUInteger currentIndex = [page pageIndex]; @@ -546,6 +558,11 @@ }); + // set this block so we can cancel it + NSMapInsert(predrawnImages, (void *)pageIndex, (__bridge void *)block); + + dispatch_async(predrawingQueue, block); + } #pragma mark Accessors This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-18 15:54:39
|
Revision: 15227 http://sourceforge.net/p/skim-app/code/15227 Author: hofman Date: 2025-05-18 15:54:37 +0000 (Sun, 18 May 2025) Log Message: ----------- Always remove NSNull from predrawnImages when drawing finishes Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-18 09:01:35 UTC (rev 15226) +++ trunk/SKPresentationView.m 2025-05-18 15:54:37 UTC (rev 15227) @@ -529,14 +529,16 @@ dispatch_async(dispatch_get_main_queue(), ^{ - if (image && predrawnImages && (__bridge id)NSMapGet(predrawnImages, (void *)pageIndex) == [NSNull null]) { - NSUInteger currentIndex = [page pageIndex]; - if (pageIndex > currentIndex) { - NSMapInsert(predrawnImages, (void *)pageIndex, (__bridge void *)image); - } else { - if (pageIndex == currentIndex) - [pageLayer setContents:image]; - [self removePredrawnImageAtIndex:pageIndex]; + if (predrawnImages) { + if ((__bridge id)NSMapGet(predrawnImages, (void *)pageIndex) == [NSNull null]) { + NSMapRemove(predrawnImages, (void *)pageIndex); + if (image) { + NSUInteger currentIndex = [page pageIndex]; + if (pageIndex > currentIndex) + NSMapInsert(predrawnImages, (void *)pageIndex, (__bridge void *)image); + else if (pageIndex == currentIndex) + [pageLayer setContents:image]; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-18 09:01:38
|
Revision: 15226 http://sourceforge.net/p/skim-app/code/15226 Author: hofman Date: 2025-05-18 09:01:35 +0000 (Sun, 18 May 2025) Log Message: ----------- hide cursor style windoww from cancelOperation Modified Paths: -------------- trunk/SKMainWindowController_Actions.m trunk/SKPresentationView.h trunk/SKPresentationView.m Modified: trunk/SKMainWindowController_Actions.m =================================================================== --- trunk/SKMainWindowController_Actions.m 2025-05-17 15:52:41 UTC (rev 15225) +++ trunk/SKMainWindowController_Actions.m 2025-05-18 09:01:35 UTC (rev 15226) @@ -1285,6 +1285,8 @@ [self hideOverviewAnimating:YES]; else if ([presentationView hasBlackout]) [presentationView toggleBlackout:sender]; + else if ([presentationView showingCursorStyleWindow]) + [presentationView closeCursorStyleWindow:sender]; else [self exitPresentation]; } else if ([self hasOverview]) { Modified: trunk/SKPresentationView.h =================================================================== --- trunk/SKPresentationView.h 2025-05-17 15:52:41 UTC (rev 15225) +++ trunk/SKPresentationView.h 2025-05-18 09:01:35 UTC (rev 15226) @@ -99,6 +99,8 @@ @property (nonatomic) BOOL removeCursorShadow; @property (nonatomic) BOOL drawInPresentation; +@property (nonatomic) BOOL showingCursorStyleWindow; + - (void)toggleAutoActualSize:(nullable id)sender; - (void)toggleBlackout:(nullable id)sender; Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-17 15:52:41 UTC (rev 15225) +++ trunk/SKPresentationView.m 2025-05-18 09:01:35 UTC (rev 15226) @@ -430,7 +430,7 @@ @implementation SKPresentationView -@dynamic autoScales, cursorStyle, hasBlackout, removeCursorShadow, drawInPresentation; +@dynamic autoScales, cursorStyle, hasBlackout, removeCursorShadow, drawInPresentation, showingCursorStyleWindow; + (void)initialize { SKINITIALIZE; @@ -582,6 +582,10 @@ return pvFlags.enableDrawing; } +- (BOOL)showingCursorStyleWindow { + return [cursorWindow isVisible]; +} + #pragma mark Actions - (void)toggleAutoActualSize:(id)sender { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-17 15:52:45
|
Revision: 15225 http://sourceforge.net/p/skim-app/code/15225 Author: hofman Date: 2025-05-17 15:52:41 +0000 (Sat, 17 May 2025) Log Message: ----------- rename method Modified Paths: -------------- trunk/SKMainWindowController.m trunk/SKPresentationView.h trunk/SKPresentationView.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-17 15:25:02 UTC (rev 15224) +++ trunk/SKMainWindowController.m 2025-05-17 15:52:41 UTC (rev 15225) @@ -2192,7 +2192,7 @@ [presentationNotes addObject:annotation]; if (page) { [self updateThumbnailAtPageIndex:[page pageIndex]]; - [presentationView updatedAnnotationOnPage:page]; + [presentationView setNeedsDisplayForPage:page]; } } else { [[undoManager prepareWithInvocationTarget:[notification object]] removeAnnotation:annotation]; @@ -2216,7 +2216,7 @@ } [secondaryPdfView addedAnnotation:annotation onPage:page]; if ([self interactionMode] == SKPresentationMode) - [presentationView updatedAnnotationOnPage:page]; + [presentationView setNeedsDisplayForPage:page]; } } } @@ -2234,7 +2234,7 @@ [presentationNotes removeObject:annotation]; if (page) { [self updateThumbnailAtPageIndex:[page pageIndex]]; - [presentationView updatedAnnotationOnPage:page]; + [presentationView setNeedsDisplayForPage:page]; } } else if (page) { [self updateThumbnailAtPageIndex:[page pageIndex]]; @@ -2264,7 +2264,7 @@ } [secondaryPdfView removedAnnotation:annotation onPage:page]; if ([self interactionMode] == SKPresentationMode) - [presentationView updatedAnnotationOnPage:page]; + [presentationView setNeedsDisplayForPage:page]; } } } @@ -2289,8 +2289,8 @@ [secondaryPdfView removedAnnotation:annotation onPage:oldPage]; [secondaryPdfView addedAnnotation:annotation onPage:newPage]; if ([self interactionMode] == SKPresentationMode) { - [presentationView updatedAnnotationOnPage:oldPage]; - [presentationView updatedAnnotationOnPage:newPage]; + [presentationView setNeedsDisplayForPage:oldPage]; + [presentationView setNeedsDisplayForPage:newPage]; } } @@ -2731,7 +2731,7 @@ [secondaryPdfView updatedAnnotation:note]; if ([self interactionMode] == SKPresentationMode) - [presentationView updatedAnnotationOnPage:page]; + [presentationView setNeedsDisplayForPage:page]; if ([keyPath isEqualToString:SKNPDFAnnotationBoundsKey] && note == [pdfView currentAnnotation] && [[NSUserDefaults standardUserDefaults] boolForKey:SKDisplayNoteBoundsKey]) [self updateRightStatus]; Modified: trunk/SKPresentationView.h =================================================================== --- trunk/SKPresentationView.h 2025-05-17 15:25:02 UTC (rev 15224) +++ trunk/SKPresentationView.h 2025-05-17 15:52:41 UTC (rev 15225) @@ -115,7 +115,7 @@ - (void)didOpen; - (void)willClose; -- (void)updatedAnnotationOnPage:(PDFPage *)aPage; +- (void)setNeedsDisplayForPage:(PDFPage *)aPage; @end Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-17 15:25:02 UTC (rev 15224) +++ trunk/SKPresentationView.m 2025-05-17 15:52:41 UTC (rev 15225) @@ -464,7 +464,7 @@ [self displayCurrentPage:nil]; } -- (void)updatedAnnotationOnPage:(PDFPage *)aPage { +- (void)setNeedsDisplayForPage:(PDFPage *)aPage { if (page == aPage) { [self removePredrawnImageAtIndex:[aPage pageIndex]]; [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(displayCurrentPage:) object:nil]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-17 15:25:06
|
Revision: 15224 http://sourceforge.net/p/skim-app/code/15224 Author: hofman Date: 2025-05-17 15:25:02 +0000 (Sat, 17 May 2025) Log Message: ----------- redisplay quickly when resolution changes Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-16 21:31:28 UTC (rev 15223) +++ trunk/SKPresentationView.m 2025-05-17 15:25:02 UTC (rev 15224) @@ -81,6 +81,7 @@ @interface SKPDFPageView () - (void)displayCurrentPage:(void (^)(void))completionHandler; +- (void)redisplayAtCurrentScaleFactorIfNeeded; @end @implementation SKPDFPageView @@ -146,6 +147,7 @@ CGFloat scale = [[self window] backingScaleFactor]; if (fabs([pageLayer contentsScale] - scale) > 0.0) { [pageLayer setContentsScale:scale]; + [self redisplayAtCurrentScaleFactorIfNeeded]; [self removePredrawnImageAtIndex:NSNotFound]; [self displayCurrentPage:nil]; } @@ -380,6 +382,24 @@ } +- (void)redisplayAtCurrentScaleFactorIfNeeded { + CALayerContentsGravity gravity = [pageLayer contentsGravity]; + if (gravity != kCAGravityResize && gravity != kCAGravityResizeAspect && gravity != kCAGravityResizeAspectFill) { + NSImage *image = [pageLayer contents]; + if ([image isKindOfClass:[NSImage class]]) { + NSRect bounds = [self bounds]; + NSBitmapImageRep *imageRep = [self bitmapImageRepForCachingDisplayInRect:bounds]; + [NSGraphicsContext saveGraphicsState]; + [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:imageRep]]; + [image drawInRect:bounds]; + [NSGraphicsContext restoreGraphicsState]; + image = [[NSImage alloc] initWithSize:bounds.size]; + [image removeRepresentation:[[image representations] firstObject]]; + [pageLayer setContents:image]; + } + } +} + - (NSBitmapImageRep *)bitmapImageRepCachingDisplay { NSImage *image = [pageLayer contents]; if ([image isKindOfClass:[NSImage class]]) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |