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-12 15:52:52
|
Revision: 15198 http://sourceforge.net/p/skim-app/code/15198 Author: hofman Date: 2025-05-12 15:52:49 +0000 (Mon, 12 May 2025) Log Message: ----------- Move some methods to functions. Calculate some variables outside block, and avoid strongly referencing self from block. Modified Paths: -------------- trunk/SKTransitionController.m Modified: trunk/SKTransitionController.m =================================================================== --- trunk/SKTransitionController.m 2025-05-12 15:22:49 UTC (rev 15197) +++ trunk/SKTransitionController.m 2025-05-12 15:52:49 UTC (rev 15198) @@ -68,9 +68,13 @@ #pragma mark - +@interface SKTransitionController () +@property (nonatomic) BOOL animating; +@end + @implementation SKTransitionController -@synthesize transition, pageTransitions, shouldScale; +@synthesize transition, pageTransitions, shouldScale, animating; static inline CGRect scaleRect(NSRect rect, CGFloat scale) { return CGRectMake(scale * NSMinX(rect), scale * NSMinY(rect), scale * NSWidth(rect), scale * NSHeight(rect)); @@ -77,7 +81,7 @@ } // rect and extent are in pixels -- (CIFilter *)transitionFilterWithName:(NSString *)name rect:(CGRect)rect extent:(CGRect)extent scale:(CGFloat)scale forward:(BOOL)forward initialImage:(CIImage *)initialImage finalImage:(CIImage *)finalImage { +static CIFilter *makeTransitionFilter(NSString *name, CGRect rect, CGRect extent, CGFloat scale, BOOL forward, CIImage *initialImage, CIImage *finalImage) { CIFilter *transitionFilter = [CIFilter filterWithName:name]; BOOL scaled = fabs(scale - 1.0) > 0.0; @@ -154,7 +158,7 @@ return transitionFilter; } -- (CIImage *)currentImageForView:(NSView *)view { +static CIImage *currentImageForView(NSView *view) { NSBitmapImageRep *contentBitmap = [view bitmapImageRepCachingDisplay]; CIImage *image = [[CIImage alloc] initWithBitmapImageRep:contentBitmap]; NSArray *colorFilters = SKColorEffectFilters(); @@ -180,41 +184,40 @@ animating = YES; - CIImage *initialImage = [self currentImageForView:view]; + CIImage *initialImage = currentImageForView(view); + NSRect bounds = [view bounds]; + CGFloat imageScale = CGRectGetWidth([initialImage extent]) / NSWidth(bounds); + CGFloat scale = shouldScale ? imageScale * NSHeight(bounds) / NSHeight([[[view window] screen] frame]) : imageScale; + + if (transitionView == nil) + transitionView = [[SKTransitionView alloc] initWithFrame:bounds]; + else + [transitionView setFrame:bounds]; + SKTransitionView *transView = transitionView; + + __weak SKTransitionController *weakSelf = self; + return ^(NSRect rect, BOOL forward, void (^completionHandler)(void)){ - NSRect bounds = [view bounds]; - CIImage *finalImage = [self currentImageForView:view]; - CGFloat imageScale = CGRectGetWidth([initialImage extent]) / NSWidth(bounds); + CIImage *finalImage = currentImageForView(view); CGRect cgRect = CGRectIntegral(scaleRect(rect, imageScale)); CGRect cgBounds = scaleRect(bounds, imageScale); CGRect extent = [currentTransition shouldRestrict] ? cgRect : cgBounds; NSString *filterName = [currentTransition styleName]; - CGFloat scale = shouldScale ? imageScale * NSHeight(bounds) / NSHeight([[[view window] screen] frame]) : imageScale; - CIFilter *transitionFilter = [self transitionFilterWithName:filterName - rect:cgRect - extent:extent - scale:scale - forward:forward - initialImage:initialImage - finalImage:finalImage]; + CIFilter *transitionFilter = makeTransitionFilter(filterName, cgRect, extent, scale, forward, initialImage, finalImage); - if (transitionView == nil) - transitionView = [[SKTransitionView alloc] initWithFrame:bounds]; - else - [transitionView setFrame:bounds]; - [transitionView setExtent:cgBounds]; - [transitionView setFilter:transitionFilter]; - [view addSubview:transitionView positioned:NSWindowAbove relativeTo:nil]; + [transView setExtent:cgBounds]; + [transView setFilter:transitionFilter]; + [view addSubview:transView positioned:NSWindowAbove relativeTo:nil]; [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){ [context setDuration:[currentTransition duration]]; - [[transitionView animator] setProgress:1.0]; + [[transView animator] setProgress:1.0]; } completionHandler:^{ - [transitionView removeFromSuperview]; - [transitionView setFilter:nil]; - animating = NO; + [transView removeFromSuperview]; + [transView setFilter:nil]; + [weakSelf setAnimating:NO]; 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-12 15:22:50
|
Revision: 15197 http://sourceforge.net/p/skim-app/code/15197 Author: hofman Date: 2025-05-12 15:22:49 +0000 (Mon, 12 May 2025) Log Message: ----------- Wwe can get the image scale from the returned image Modified Paths: -------------- trunk/SKTransitionController.m Modified: trunk/SKTransitionController.m =================================================================== --- trunk/SKTransitionController.m 2025-05-12 14:44:23 UTC (rev 15196) +++ trunk/SKTransitionController.m 2025-05-12 15:22:49 UTC (rev 15197) @@ -154,8 +154,7 @@ return transitionFilter; } -- (CIImage *)currentImageForView:(NSView *)view scale:(CGFloat *)scalePtr { - NSRect bounds = [view bounds]; +- (CIImage *)currentImageForView:(NSView *)view { NSBitmapImageRep *contentBitmap = [view bitmapImageRepCachingDisplay]; CIImage *image = [[CIImage alloc] initWithBitmapImageRep:contentBitmap]; NSArray *colorFilters = SKColorEffectFilters(); @@ -165,7 +164,6 @@ image = [filter outputImage]; } } - if (scalePtr) *scalePtr = CGRectGetWidth([image extent]) / NSWidth(bounds); return image; } @@ -182,13 +180,13 @@ animating = YES; - CIImage *initialImage = [self currentImageForView:view scale:NULL]; + CIImage *initialImage = [self currentImageForView:view]; return ^(NSRect rect, BOOL forward, void (^completionHandler)(void)){ NSRect bounds = [view bounds]; - CGFloat imageScale = 1.0; - CIImage *finalImage = [self currentImageForView:view scale:&imageScale]; + CIImage *finalImage = [self currentImageForView:view]; + CGFloat imageScale = CGRectGetWidth([initialImage extent]) / NSWidth(bounds); CGRect cgRect = CGRectIntegral(scaleRect(rect, imageScale)); CGRect cgBounds = scaleRect(bounds, imageScale); CGRect extent = [currentTransition shouldRestrict] ? cgRect : cgBounds; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-12 14:44:26
|
Revision: 15196 http://sourceforge.net/p/skim-app/code/15196 Author: hofman Date: 2025-05-12 14:44:23 +0000 (Mon, 12 May 2025) Log Message: ----------- use macros for some constants Modified Paths: -------------- trunk/SKPresentationOptionsSheetController.m Modified: trunk/SKPresentationOptionsSheetController.m =================================================================== --- trunk/SKPresentationOptionsSheetController.m 2025-05-12 14:33:10 UTC (rev 15195) +++ trunk/SKPresentationOptionsSheetController.m 2025-05-12 14:44:23 UTC (rev 15196) @@ -68,6 +68,8 @@ #define TABLE_OFFSET 28.0 #define BOX_OFFSET 20.0 +#define PREVIEW_INSET 6.0 +#define PREVIEW_CORNER_RADIUS 6.0 #define PREVIEW_DELAY 1.0 static char *SKTransitionPropertiesObservationContext; @@ -321,8 +323,8 @@ return; NSRect rect = [[[self window] screen] frame]; - rect.size.width = round(0.5 * NSWidth(rect)) + 12.0; - rect.size.height = round(0.5 * NSHeight(rect)) + 34.0; + rect.size.width = round(0.5 * NSWidth(rect)) + 2.0 * PREVIEW_INSET; + rect.size.height = round(0.5 * NSHeight(rect)) + PREVIEW_INSET + 28.0; if (previewWindow == nil) { previewWindow = [[NSPanel alloc] initWithContentRect:rect styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskFullSizeContentView backing:NSBackingStoreBuffered defer:NO screen:[[self window] screen]]; @@ -344,7 +346,7 @@ NSView *bgView = [[NSView alloc] init]; CALayer *layer = [CALayer layer]; [layer setBackgroundColor:CGColorGetConstantColor(kCGColorBlack)]; - [layer setCornerRadius:6.0]; + [layer setCornerRadius:PREVIEW_CORNER_RADIUS]; [bgView setLayer:layer]; [bgView setWantsLayer:YES]; [bgView setLayerContentsRedrawPolicy:NSViewLayerContentsRedrawDuringViewResize]; @@ -351,10 +353,10 @@ [bgView setTranslatesAutoresizingMaskIntoConstraints:NO]; [contentView addSubview:bgView]; NSArray *constraints = @[ - [[bgView leadingAnchor] constraintEqualToAnchor:[contentView leadingAnchor] constant:6.0], - [[contentView trailingAnchor] constraintEqualToAnchor:[bgView trailingAnchor] constant:6.0], + [[bgView leadingAnchor] constraintEqualToAnchor:[contentView leadingAnchor] constant:PREVIEW_INSET], + [[contentView trailingAnchor] constraintEqualToAnchor:[bgView trailingAnchor] constant:PREVIEW_INSET], [[bgView topAnchor] constraintEqualToAnchor:[[previewWindow contentLayoutGuide] topAnchor] constant:0.0], - [[contentView bottomAnchor] constraintEqualToAnchor:[bgView bottomAnchor] constant:6.0]]; + [[contentView bottomAnchor] constraintEqualToAnchor:[bgView bottomAnchor] constant:PREVIEW_INSET]]; [[constraints objectAtIndex:2] setPriority:NSLayoutPriorityDefaultHigh]; [NSLayoutConstraint activateConstraints:constraints]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-12 14:33:12
|
Revision: 15195 http://sourceforge.net/p/skim-app/code/15195 Author: hofman Date: 2025-05-12 14:33:10 +0000 (Mon, 12 May 2025) Log Message: ----------- noneed for variable Modified Paths: -------------- trunk/SKPresentationOptionsSheetController.m Modified: trunk/SKPresentationOptionsSheetController.m =================================================================== --- trunk/SKPresentationOptionsSheetController.m 2025-05-12 14:29:44 UTC (rev 15194) +++ trunk/SKPresentationOptionsSheetController.m 2025-05-12 14:33:10 UTC (rev 15195) @@ -367,11 +367,10 @@ [[previewView transitionController] setTransition:info]; [previewWindow setTitle:[info localizedStyleName]]; - CGFloat titleHeight = NSHeight([previewWindow frame]) - NSHeight([previewWindow contentLayoutRect]); - rect.size.height += titleHeight - 28.0; + rect.size.height += NSHeight([previewWindow frame]) - NSHeight([previewWindow contentLayoutRect]) - 28.0; [previewWindow setFrame:rect display:NO]; + [previewWindow center]; [previewWindow layoutIfNeeded]; - [previewWindow center]; previewing = YES; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-12 14:29:46
|
Revision: 15194 http://sourceforge.net/p/skim-app/code/15194 Author: hofman Date: 2025-05-12 14:29:44 +0000 (Mon, 12 May 2025) Log Message: ----------- commit edtit before getting data Modified Paths: -------------- trunk/SKPresentationOptionsSheetController.m Modified: trunk/SKPresentationOptionsSheetController.m =================================================================== --- trunk/SKPresentationOptionsSheetController.m 2025-05-12 14:28:27 UTC (rev 15193) +++ trunk/SKPresentationOptionsSheetController.m 2025-05-12 14:29:44 UTC (rev 15194) @@ -302,6 +302,8 @@ if (previewing) return; + [arrayController commitEditing]; + SKLabeledTransitionInfo *info = transition; NSInteger idx = -1; if (separate) { @@ -318,8 +320,6 @@ if ([info style] == SKNoTransition) return; - [arrayController commitEditing]; - NSRect rect = [[[self window] screen] frame]; rect.size.width = round(0.5 * NSWidth(rect)) + 12.0; rect.size.height = round(0.5 * NSHeight(rect)) + 34.0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-12 14:28:28
|
Revision: 15193 http://sourceforge.net/p/skim-app/code/15193 Author: hofman Date: 2025-05-12 14:28:27 +0000 (Mon, 12 May 2025) Log Message: ----------- don't set flag before we can have an early return Modified Paths: -------------- trunk/SKPresentationOptionsSheetController.m Modified: trunk/SKPresentationOptionsSheetController.m =================================================================== --- trunk/SKPresentationOptionsSheetController.m 2025-05-12 09:10:08 UTC (rev 15192) +++ trunk/SKPresentationOptionsSheetController.m 2025-05-12 14:28:27 UTC (rev 15193) @@ -301,7 +301,6 @@ - (void)preview:(id)sender { if (previewing) return; - previewing = YES; SKLabeledTransitionInfo *info = transition; NSInteger idx = -1; @@ -374,6 +373,8 @@ [previewWindow layoutIfNeeded]; [previewWindow center]; + previewing = YES; + [previewView displayPage:[[controller pdfDocument] pageAtIndex:idx] completionHandler:^{ [previewWindow makeKeyAndOrderFront:nil]; DISPATCH_MAIN_AFTER_SEC(PREVIEW_DELAY, ^{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-12 09:10:10
|
Revision: 15192 http://sourceforge.net/p/skim-app/code/15192 Author: hofman Date: 2025-05-12 09:10:08 +0000 (Mon, 12 May 2025) Log Message: ----------- remove space Modified Paths: -------------- trunk/SKPresentationOptionsSheetController.m Modified: trunk/SKPresentationOptionsSheetController.m =================================================================== --- trunk/SKPresentationOptionsSheetController.m 2025-05-12 09:09:24 UTC (rev 15191) +++ trunk/SKPresentationOptionsSheetController.m 2025-05-12 09:10:08 UTC (rev 15192) @@ -378,7 +378,7 @@ [previewWindow makeKeyAndOrderFront:nil]; DISPATCH_MAIN_AFTER_SEC(PREVIEW_DELAY, ^{ [previewView animateToNextPage:^{ - DISPATCH_MAIN_AFTER_SEC(PREVIEW_DELAY , ^{ + DISPATCH_MAIN_AFTER_SEC(PREVIEW_DELAY, ^{ if ([previewWindow isKeyWindow] && [[self window] isVisible]) [[self window] makeKeyWindow]; [previewWindow orderOut:nil]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-12 09:09:27
|
Revision: 15191 http://sourceforge.net/p/skim-app/code/15191 Author: hofman Date: 2025-05-12 09:09:24 +0000 (Mon, 12 May 2025) Log Message: ----------- use macro for delay Modified Paths: -------------- trunk/SKPresentationOptionsSheetController.m Modified: trunk/SKPresentationOptionsSheetController.m =================================================================== --- trunk/SKPresentationOptionsSheetController.m 2025-05-12 08:50:43 UTC (rev 15190) +++ trunk/SKPresentationOptionsSheetController.m 2025-05-12 09:09:24 UTC (rev 15191) @@ -68,6 +68,8 @@ #define TABLE_OFFSET 28.0 #define BOX_OFFSET 20.0 +#define PREVIEW_DELAY 1.0 + static char *SKTransitionPropertiesObservationContext; #define SKTouchBarItemIdentifierOK @"net.sourceforge.skim-app.touchbar-item.OK" @@ -374,9 +376,9 @@ [previewView displayPage:[[controller pdfDocument] pageAtIndex:idx] completionHandler:^{ [previewWindow makeKeyAndOrderFront:nil]; - DISPATCH_MAIN_AFTER_SEC(1.0, ^{ + DISPATCH_MAIN_AFTER_SEC(PREVIEW_DELAY, ^{ [previewView animateToNextPage:^{ - DISPATCH_MAIN_AFTER_SEC(1.0 , ^{ + DISPATCH_MAIN_AFTER_SEC(PREVIEW_DELAY , ^{ if ([previewWindow isKeyWindow] && [[self window] isVisible]) [[self window] makeKeyWindow]; [previewWindow orderOut:nil]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-12 08:50:46
|
Revision: 15190 http://sourceforge.net/p/skim-app/code/15190 Author: hofman Date: 2025-05-12 08:50:43 +0000 (Mon, 12 May 2025) Log Message: ----------- Implement all page navigation methods in page view class as well as validation methods Modified Paths: -------------- trunk/SKPresentationView.h trunk/SKPresentationView.m Modified: trunk/SKPresentationView.h =================================================================== --- trunk/SKPresentationView.h 2025-05-11 21:24:30 UTC (rev 15189) +++ trunk/SKPresentationView.h 2025-05-12 08:50:43 UTC (rev 15190) @@ -55,8 +55,15 @@ @property (nonatomic, nullable, strong) SKTransitionController *transitionController; +@property (nonatomic) BOOL canGoToNextPage; +@property (nonatomic) BOOL canGoToPreviousPage; +@property (nonatomic) BOOL canGoToFirstPage; +@property (nonatomic) BOOL canGoToLastPage; + - (void)goToNextPage:(nullable id)sender; - (void)goToPreviousPage:(nullable id)sender; +- (void)goToFirstPage:(nullable id)sender; +- (void)goToLastPage:(nullable id)sender; - (void)displayPage:(PDFPage *)page completionHandler:(void (^ _Nullable)(void))completionHandler; - (void)animateToNextPage:(void (^)(void))completionHandler; @@ -85,11 +92,6 @@ @property (nonatomic) BOOL autoScales; -@property (nonatomic) BOOL canGoToNextPage; -@property (nonatomic) BOOL canGoToPreviousPage; -@property (nonatomic) BOOL canGoToFirstPage; -@property (nonatomic) BOOL canGoToLastPage; - @property (nonatomic) BOOL hasBlackout; @property (nonatomic) NSInteger cursorStyle; @@ -96,9 +98,6 @@ @property (nonatomic) BOOL removeCursorShadow; @property (nonatomic) BOOL drawInPresentation; -- (void)goToFirstPage:(nullable id)sender; -- (void)goToLastPage:(nullable id)sender; - - (void)toggleAutoActualSize:(nullable id)sender; - (void)toggleBlackout:(nullable id)sender; Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-11 21:24:30 UTC (rev 15189) +++ trunk/SKPresentationView.m 2025-05-12 08:50:43 UTC (rev 15190) @@ -85,7 +85,7 @@ @implementation SKPDFPageView -@synthesize page, transitionController; +@synthesize page, transitionController, canGoToNextPage, canGoToPreviousPage, canGoToFirstPage, canGoToLastPage; static inline NSArray *defaultKeysToObserve() { if (@available(macOS 10.14, *)) @@ -202,6 +202,22 @@ - (BOOL)autoScales { return YES; } +- (BOOL)canGoToNextPage { + return [page pageIndex] + 1 < [[page document] pageCount]; +} + +- (BOOL)canGoToPreviousPage { + return [page pageIndex] > 0; +} + +- (BOOL)canGoToFirstPage { + return [page pageIndex] > 0; +} + +- (BOOL)canGoToLastPage { + return [page pageIndex] + 1 < [[page document] pageCount]; +} + #pragma mark Action - (void)goToNextPage:(id)sender { @@ -224,6 +240,20 @@ } } +- (void)goToFirstPage:(id)sender { + PDFDocument *pdfDoc = [page document]; + NSUInteger idx = [page pageIndex]; + if (idx > 0) + [self setPage:[pdfDoc pageAtIndex:0]]; +} + +- (void)goToLastPage:(id)sender { + PDFDocument *pdfDoc = [page document]; + NSUInteger idx = [page pageIndex]; + if (idx + 1 < [pdfDoc pageCount]) + [self setPage:[pdfDoc pageAtIndex:[pdfDoc pageCount] - 1]]; +} + #pragma mark Drawing - (void)displayPage:(void (^)(void))completionHandler { @@ -317,7 +347,7 @@ @implementation SKPresentationView -@dynamic autoScales, canGoToNextPage, canGoToPreviousPage, canGoToFirstPage, canGoToLastPage, cursorStyle, hasBlackout, removeCursorShadow, drawInPresentation; +@dynamic autoScales, cursorStyle, hasBlackout, removeCursorShadow, drawInPresentation; + (void)initialize { SKINITIALIZE; @@ -373,22 +403,6 @@ return [pageView alphaValue] <= 0.0; } -- (BOOL)canGoToNextPage { - return [page pageIndex] + 1 < [[page document] pageCount]; -} - -- (BOOL)canGoToPreviousPage { - return [page pageIndex] > 0; -} - -- (BOOL)canGoToFirstPage { - return [page pageIndex] > 0; -} - -- (BOOL)canGoToLastPage { - return [page pageIndex] + 1 < [[page document] pageCount]; -} - - (NSInteger)cursorStyle { return pvFlags.useArrowCursor ? -1 : laserPointerColor; } @@ -403,20 +417,6 @@ #pragma mark Actions -- (void)goToFirstPage:(id)sender { - PDFDocument *pdfDoc = [page document]; - NSUInteger idx = [page pageIndex]; - if (idx > 0) - [self setPage:[pdfDoc pageAtIndex:0]]; -} - -- (void)goToLastPage:(id)sender { - PDFDocument *pdfDoc = [page document]; - NSUInteger idx = [page pageIndex]; - if (idx + 1 < [pdfDoc pageCount]) - [self setPage:[pdfDoc pageAtIndex:[pdfDoc pageCount] - 1]]; -} - - (void)toggleAutoActualSize:(id)sender { [self setAutoScales:[self autoScales] == NO]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-11 21:24:33
|
Revision: 15189 http://sourceforge.net/p/skim-app/code/15189 Author: hofman Date: 2025-05-11 21:24:30 +0000 (Sun, 11 May 2025) Log Message: ----------- Rename method to avoid stupid compile warning Modified Paths: -------------- trunk/SKPresentationOptionsSheetController.m trunk/SKPresentationView.h trunk/SKPresentationView.m Modified: trunk/SKPresentationOptionsSheetController.m =================================================================== --- trunk/SKPresentationOptionsSheetController.m 2025-05-11 21:14:34 UTC (rev 15188) +++ trunk/SKPresentationOptionsSheetController.m 2025-05-11 21:24:30 UTC (rev 15189) @@ -363,6 +363,8 @@ [bgView addSubviewWithConstraints:previewView]; } + [[previewView transitionController] setTransition:info]; + [previewWindow setTitle:[info localizedStyleName]]; CGFloat titleHeight = NSHeight([previewWindow frame]) - NSHeight([previewWindow contentLayoutRect]); rect.size.height += titleHeight - 28.0; @@ -370,10 +372,7 @@ [previewWindow layoutIfNeeded]; [previewWindow center]; - [[previewView transitionController] setTransition:info]; - - PDFPage *page = [[controller pdfDocument] pageAtIndex:idx]; - void (^displayPreview)(void) = ^{ + [previewView displayPage:[[controller pdfDocument] pageAtIndex:idx] completionHandler:^{ [previewWindow makeKeyAndOrderFront:nil]; DISPATCH_MAIN_AFTER_SEC(1.0, ^{ [previewView animateToNextPage:^{ @@ -385,9 +384,7 @@ }); }]; }); - }; - - [previewView setPage:page completionHandler:displayPreview]; + }]; } - (NSArray *)availableTransitions { Modified: trunk/SKPresentationView.h =================================================================== --- trunk/SKPresentationView.h 2025-05-11 21:14:34 UTC (rev 15188) +++ trunk/SKPresentationView.h 2025-05-11 21:24:30 UTC (rev 15189) @@ -58,7 +58,7 @@ - (void)goToNextPage:(nullable id)sender; - (void)goToPreviousPage:(nullable id)sender; -- (void)setPage:(PDFPage *)page completionHandler:(void (^ _Nullable)(void))completionHandler; +- (void)displayPage:(PDFPage *)page completionHandler:(void (^ _Nullable)(void))completionHandler; - (void)animateToNextPage:(void (^)(void))completionHandler; @end Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-11 21:14:34 UTC (rev 15188) +++ trunk/SKPresentationView.m 2025-05-11 21:24:30 UTC (rev 15189) @@ -143,7 +143,7 @@ #pragma mark Transitions -- (void)setPage:(PDFPage *)newPage completionHandler:(void (^)(void))completionHandler { +- (void)displayPage:(PDFPage *)newPage completionHandler:(void (^)(void))completionHandler { page = newPage; [self displayPage:completionHandler]; [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewPageChangedNotification object:self]; @@ -169,7 +169,7 @@ SKTransitionAnimation animation = [transitionController animationAtIndex:idx forView:self]; if (animation) { NSRect rect = NSUnionRect([self pageRect:page], [self pageRect:toPage]); - [self setPage:toPage completionHandler:^{ animation(rect, forward, nil); }]; + [self displayPage:toPage completionHandler:^{ animation(rect, forward, nil); }]; return YES; } } @@ -184,9 +184,9 @@ SKTransitionAnimation animation = [transitionController animationAtIndex:idx forView:self]; if (animation) { NSRect rect = NSUnionRect([self pageRect:page], [self pageRect:toPage]); - [self setPage:toPage completionHandler:^{ animation(rect, YES, completionHandler); }]; + [self displayPage:toPage completionHandler:^{ animation(rect, YES, completionHandler); }]; } else { - [self setPage:toPage completionHandler:completionHandler]; + [self displayPage:toPage completionHandler:completionHandler]; } } else { completionHandler(); @@ -197,7 +197,7 @@ - (void)setPage:(PDFPage *)newPage { if (newPage != page) - [self setPage:newPage completionHandler:nil]; + [self displayPage:newPage completionHandler:nil]; } - (BOOL)autoScales { return YES; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-11 21:14:36
|
Revision: 15188 http://sourceforge.net/p/skim-app/code/15188 Author: hofman Date: 2025-05-11 21:14:34 +0000 (Sun, 11 May 2025) Log Message: ----------- use background queue for snapshot thumbnail wwhen pane is closed Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-11 21:07:43 UTC (rev 15187) +++ trunk/SKMainWindowController.m 2025-05-11 21:14:34 UTC (rev 15188) @@ -3073,7 +3073,7 @@ NSDate *date = [NSDate date]; dispatch_queue_t queue; - if ([rightSideController.snapshotTableView window] == nil) + if ([rightSideController.snapshotTableView window] == nil || [self leftSidePaneIsOpen] == NO) queue = [[self class] backgroundThumbnailQueue]; else if (lowPriority) queue = [[self class] thumbnailQueue]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-11 21:07:46
|
Revision: 15187 http://sourceforge.net/p/skim-app/code/15187 Author: hofman Date: 2025-05-11 21:07:43 +0000 (Sun, 11 May 2025) Log Message: ----------- Start the transition preview when page was drawn, don't start preview when we are busy previewing. Modified Paths: -------------- trunk/SKPresentationOptionsSheetController.h trunk/SKPresentationOptionsSheetController.m trunk/SKPresentationView.h trunk/SKPresentationView.m Modified: trunk/SKPresentationOptionsSheetController.h =================================================================== --- trunk/SKPresentationOptionsSheetController.h 2025-05-11 15:41:28 UTC (rev 15186) +++ trunk/SKPresentationOptionsSheetController.h 2025-05-11 21:07:43 UTC (rev 15187) @@ -61,6 +61,7 @@ NSMutableSet<SKLabeledTransitionInfo *> *changedTransitions; NSPanel *previewWindow; SKPDFPageView *previewView; + BOOL previewing; } @property (nonatomic, nullable, strong) IBOutlet NSPopUpButton *notesDocumentPopUpButton; Modified: trunk/SKPresentationOptionsSheetController.m =================================================================== --- trunk/SKPresentationOptionsSheetController.m 2025-05-11 15:41:28 UTC (rev 15186) +++ trunk/SKPresentationOptionsSheetController.m 2025-05-11 21:07:43 UTC (rev 15187) @@ -297,6 +297,10 @@ } - (void)preview:(id)sender { + if (previewing) + return; + previewing = YES; + SKLabeledTransitionInfo *info = transition; NSInteger idx = -1; if (separate) { @@ -366,26 +370,24 @@ [previewWindow layoutIfNeeded]; [previewWindow center]; - [previewView setPage:[[controller pdfDocument] pageAtIndex:idx]]; [[previewView transitionController] setTransition:info]; - [previewWindow makeKeyAndOrderFront:nil]; + PDFPage *page = [[controller pdfDocument] pageAtIndex:idx]; + void (^displayPreview)(void) = ^{ + [previewWindow makeKeyAndOrderFront:nil]; + DISPATCH_MAIN_AFTER_SEC(1.0, ^{ + [previewView animateToNextPage:^{ + DISPATCH_MAIN_AFTER_SEC(1.0 , ^{ + if ([previewWindow isKeyWindow] && [[self window] isVisible]) + [[self window] makeKeyWindow]; + [previewWindow orderOut:nil]; + previewing = NO; + }); + }]; + }); + }; - DISPATCH_MAIN_AFTER_SEC(1.0, ^{ - - [previewView animateToNextPage:^{ - - DISPATCH_MAIN_AFTER_SEC(1.0 , ^{ - - if ([previewWindow isKeyWindow]) - [[self window] makeKeyWindow]; - [previewWindow orderOut:nil]; - - }); - - }]; - - }); + [previewView setPage:page completionHandler:displayPreview]; } - (NSArray *)availableTransitions { Modified: trunk/SKPresentationView.h =================================================================== --- trunk/SKPresentationView.h 2025-05-11 15:41:28 UTC (rev 15186) +++ trunk/SKPresentationView.h 2025-05-11 21:07:43 UTC (rev 15187) @@ -58,6 +58,7 @@ - (void)goToNextPage:(nullable id)sender; - (void)goToPreviousPage:(nullable id)sender; +- (void)setPage:(PDFPage *)page completionHandler:(void (^ _Nullable)(void))completionHandler; - (void)animateToNextPage:(void (^)(void))completionHandler; @end Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-11 15:41:28 UTC (rev 15186) +++ trunk/SKPresentationView.m 2025-05-11 21:07:43 UTC (rev 15187) @@ -141,7 +141,7 @@ [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } -#pragma mark Accessors +#pragma mark Transitions - (void)setPage:(PDFPage *)newPage completionHandler:(void (^)(void))completionHandler { page = newPage; @@ -149,15 +149,6 @@ [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewPageChangedNotification object:self]; } -- (void)setPage:(PDFPage *)newPage { - if (newPage != page) - [self setPage:newPage completionHandler:nil]; -} - -- (BOOL)autoScales { return YES; } - -#pragma mark Action - - (NSRect)pageRect:(PDFPage *)aPage { NSRect bounds = [self bounds]; NSRect pageRect = [aPage boundsForBox:kPDFDisplayBoxCropBox]; @@ -202,6 +193,17 @@ } } +#pragma mark Accessors + +- (void)setPage:(PDFPage *)newPage { + if (newPage != page) + [self setPage:newPage completionHandler:nil]; +} + +- (BOOL)autoScales { return YES; } + +#pragma mark Action + - (void)goToNextPage:(id)sender { PDFDocument *pdfDoc = [page document]; NSUInteger idx = [page pageIndex]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-11 15:41:30
|
Revision: 15186 http://sourceforge.net/p/skim-app/code/15186 Author: hofman Date: 2025-05-11 15:41:28 +0000 (Sun, 11 May 2025) Log Message: ----------- combine check for window in animation method Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-11 14:59:46 UTC (rev 15185) +++ trunk/SKPresentationView.m 2025-05-11 15:41:28 UTC (rev 15186) @@ -172,8 +172,9 @@ } - (BOOL)animateTransitionAtIndex:(NSUInteger)idx forward:(BOOL)forward toPage:(PDFPage *)toPage { - if ([transitionController pageTransitions] || - ([[transitionController transition] style] != SKNoTransition && equalStrings([page label], [toPage label]) == NO)) { + if ([self window] && + ([transitionController pageTransitions] || + ([[transitionController transition] style] != SKNoTransition && equalStrings([page label], [toPage label]) == NO))) { SKTransitionAnimation animation = [transitionController animationAtIndex:idx forView:self]; if (animation) { NSRect rect = NSUnionRect([self pageRect:page], [self pageRect:toPage]); @@ -206,7 +207,7 @@ NSUInteger idx = [page pageIndex]; if (idx + 1 < [pdfDoc pageCount]) { PDFPage *toPage = [pdfDoc pageAtIndex:idx + 1]; - if ([self window] == nil || NO == [self animateTransitionAtIndex:idx forward:YES toPage:toPage]) + if (NO == [self animateTransitionAtIndex:idx forward:YES toPage:toPage]) [self setPage:toPage]; } } @@ -216,7 +217,7 @@ NSUInteger idx = [page pageIndex]; if (idx > 0) { PDFPage *toPage = [pdfDoc pageAtIndex:idx - 1]; - if ([self window] == nil || NO == [self animateTransitionAtIndex:idx - 1 forward:NO toPage:toPage]) + if (NO == [self animateTransitionAtIndex:idx - 1 forward:NO toPage:toPage]) [self setPage:toPage]; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-11 14:59:49
|
Revision: 15185 http://sourceforge.net/p/skim-app/code/15185 Author: hofman Date: 2025-05-11 14:59:46 +0000 (Sun, 11 May 2025) Log Message: ----------- There shouldbe no need to clip the bitmaps to the pages. Pass intersectied rect and forward flag to animation block. Modified Paths: -------------- trunk/SKPresentationView.m trunk/SKTransitionController.h trunk/SKTransitionController.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-11 14:14:19 UTC (rev 15184) +++ trunk/SKPresentationView.m 2025-05-11 14:59:46 UTC (rev 15185) @@ -164,7 +164,7 @@ if (([aPage rotation] % 180) != 0) pageRect = NSMakeRect(0.0, 0.0, NSHeight(pageRect), NSWidth(pageRect)); CGFloat scale = [self autoScales] ? fmin(NSHeight(bounds) / NSHeight(pageRect), NSWidth(bounds) / NSWidth(pageRect)) : 1.0; - return NSInsetRect(bounds, 0.5 * (NSWidth(bounds) - scale * NSWidth(pageRect)), 0.5 * (NSHeight(bounds) - scale * NSHeight(pageRect))); + return NSInsetRect(bounds, 0.5 * fmax(0.0, NSWidth(bounds) - scale * NSWidth(pageRect)), 0.5 * fmax(0.0, NSHeight(bounds) - scale * NSHeight(pageRect))); } static inline BOOL equalStrings(NSString *s1, NSString *s2) { @@ -174,9 +174,10 @@ - (BOOL)animateTransitionAtIndex:(NSUInteger)idx forward:(BOOL)forward toPage:(PDFPage *)toPage { if ([transitionController pageTransitions] || ([[transitionController transition] style] != SKNoTransition && equalStrings([page label], [toPage label]) == NO)) { - SKTransitionAnimation animation = [transitionController animationAtIndex:idx forView:self fromRect:[self pageRect:page] toRect:[self pageRect:toPage] forward:forward]; + SKTransitionAnimation animation = [transitionController animationAtIndex:idx forView:self]; if (animation) { - [self setPage:toPage completionHandler:^{ animation(nil); }]; + NSRect rect = NSUnionRect([self pageRect:page], [self pageRect:toPage]); + [self setPage:toPage completionHandler:^{ animation(rect, forward, nil); }]; return YES; } } @@ -188,8 +189,13 @@ NSUInteger idx = [page pageIndex]; if (idx + 1 < [pdfDoc pageCount]) { PDFPage *toPage = [pdfDoc pageAtIndex:idx + 1]; - SKTransitionAnimation animation = [transitionController animationAtIndex:idx forView:self fromRect:[self pageRect:page] toRect:[self pageRect:toPage] forward:YES]; - [self setPage:toPage completionHandler:animation ? ^{ animation(completionHandler); } : completionHandler]; + SKTransitionAnimation animation = [transitionController animationAtIndex:idx forView:self]; + if (animation) { + NSRect rect = NSUnionRect([self pageRect:page], [self pageRect:toPage]); + [self setPage:toPage completionHandler:^{ animation(rect, YES, completionHandler); }]; + } else { + [self setPage:toPage completionHandler:completionHandler]; + } } else { completionHandler(); } Modified: trunk/SKTransitionController.h =================================================================== --- trunk/SKTransitionController.h 2025-05-11 14:14:19 UTC (rev 15184) +++ trunk/SKTransitionController.h 2025-05-11 14:59:46 UTC (rev 15185) @@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN -typedef void (^SKTransitionAnimation)(void (^ _Nullable completionHandler)(void)); +typedef void (^SKTransitionAnimation)(NSRect rect, BOOL forward, void (^ _Nullable completionHandler)(void)); @class SKTransitionView, SKTransitionInfo; @@ -58,7 +58,7 @@ @property (nonatomic) BOOL shouldScale; -- (nullable SKTransitionAnimation)animationAtIndex:(NSUInteger)anIndex forView:(NSView *)view fromRect:(NSRect)rect toRect:(NSRect)toRect forward:(BOOL)forward; +- (nullable SKTransitionAnimation)animationAtIndex:(NSUInteger)anIndex forView:(NSView *)view; @end Modified: trunk/SKTransitionController.m =================================================================== --- trunk/SKTransitionController.m 2025-05-11 14:14:19 UTC (rev 15184) +++ trunk/SKTransitionController.m 2025-05-11 14:59:46 UTC (rev 15185) @@ -154,12 +154,10 @@ return transitionFilter; } -- (CIImage *)currentImageForRect:(NSRect)rect inView:(NSView *)view scale:(CGFloat *)scalePtr { +- (CIImage *)currentImageForView:(NSView *)view scale:(CGFloat *)scalePtr { NSRect bounds = [view bounds]; NSBitmapImageRep *contentBitmap = [view bitmapImageRepCachingDisplay]; - CIImage *tmpImage = [[CIImage alloc] initWithBitmapImageRep:contentBitmap]; - CGFloat scale = CGRectGetWidth([tmpImage extent]) / NSWidth(bounds); - CIImage *image = [tmpImage imageByCroppingToRect:CGRectIntegral(scaleRect(NSIntersectionRect(rect, bounds), scale))]; + CIImage *image = [[CIImage alloc] initWithBitmapImageRep:contentBitmap]; NSArray *colorFilters = SKColorEffectFilters(); if ([colorFilters count] > 0) { for (CIFilter *filter in colorFilters) { @@ -167,11 +165,11 @@ image = [filter outputImage]; } } - if (scalePtr) *scalePtr = scale; + if (scalePtr) *scalePtr = CGRectGetWidth([image extent]) / NSWidth(bounds); return image; } -- (SKTransitionAnimation)animationAtIndex:(NSUInteger)idx forView:(NSView *)view fromRect:(NSRect)rect toRect:(NSRect)toRect forward:(BOOL)forward { +- (SKTransitionAnimation)animationAtIndex:(NSUInteger)idx forView:(NSView *)view { if (animating) return nil; @@ -184,14 +182,14 @@ animating = YES; - CIImage *initialImage = [self currentImageForRect:rect inView:view scale:NULL]; + CIImage *initialImage = [self currentImageForView:view scale:NULL]; - return ^(void (^completionHandler)(void)){ + return ^(NSRect rect, BOOL forward, void (^completionHandler)(void)){ NSRect bounds = [view bounds]; CGFloat imageScale = 1.0; - CIImage *finalImage = [self currentImageForRect:toRect inView:view scale:&imageScale]; - CGRect cgRect = CGRectIntegral(scaleRect(NSIntersectionRect(NSUnionRect(rect, toRect), bounds), imageScale)); + CIImage *finalImage = [self currentImageForView:view scale:&imageScale]; + CGRect cgRect = CGRectIntegral(scaleRect(rect, imageScale)); CGRect cgBounds = scaleRect(bounds, imageScale); CGRect extent = [currentTransition shouldRestrict] ? cgRect : cgBounds; NSString *filterName = [currentTransition styleName]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-11 14:14:22
|
Revision: 15184 http://sourceforge.net/p/skim-app/code/15184 Author: hofman Date: 2025-05-11 14:14:19 +0000 (Sun, 11 May 2025) Log Message: ----------- Expose transition animation as block and let the caller execute the block. Fully initialize rather than passing arguments. Modified Paths: -------------- trunk/SKPresentationView.m trunk/SKTransitionController.h trunk/SKTransitionController.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-10 22:13:11 UTC (rev 15183) +++ trunk/SKPresentationView.m 2025-05-11 14:14:19 UTC (rev 15184) @@ -143,12 +143,15 @@ #pragma mark Accessors +- (void)setPage:(PDFPage *)newPage completionHandler:(void (^)(void))completionHandler { + page = newPage; + [self displayPage:completionHandler]; + [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewPageChangedNotification object:self]; +} + - (void)setPage:(PDFPage *)newPage { - if (newPage != page) { - page = newPage; - [self displayPage:nil]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewPageChangedNotification object:self]; - } + if (newPage != page) + [self setPage:newPage completionHandler:nil]; } - (BOOL)autoScales { return YES; } @@ -155,10 +158,10 @@ #pragma mark Action -- (NSRect)pageRect { +- (NSRect)pageRect:(PDFPage *)aPage { NSRect bounds = [self bounds]; - NSRect pageRect = [page boundsForBox:kPDFDisplayBoxCropBox]; - if (([page rotation] % 180) != 0) + NSRect pageRect = [aPage boundsForBox:kPDFDisplayBoxCropBox]; + if (([aPage rotation] % 180) != 0) pageRect = NSMakeRect(0.0, 0.0, NSHeight(pageRect), NSWidth(pageRect)); CGFloat scale = [self autoScales] ? fmin(NSHeight(bounds) / NSHeight(pageRect), NSWidth(bounds) / NSWidth(pageRect)) : 1.0; return NSInsetRect(bounds, 0.5 * (NSWidth(bounds) - scale * NSWidth(pageRect)), 0.5 * (NSHeight(bounds) - scale * NSHeight(pageRect))); @@ -169,18 +172,15 @@ } - (BOOL)animateTransitionAtIndex:(NSUInteger)idx forward:(BOOL)forward toPage:(PDFPage *)toPage { - if ([transitionController pageTransitions] == nil && - ([[transitionController transition] style] == SKNoTransition || equalStrings([page label], [toPage label]))) - return NO; - id animation = [transitionController animationAtIndex:idx forRect:[self pageRect] inView:self]; - if (animation == nil) - return NO; - page = toPage; - [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewPageChangedNotification object:self]; - [self displayPage:^{ - [transitionController performAnimation:animation toRect:[self pageRect] forward:forward completionHandler:nil]; - }]; - return YES; + if ([transitionController pageTransitions] || + ([[transitionController transition] style] != SKNoTransition && equalStrings([page label], [toPage label]) == NO)) { + SKTransitionAnimation animation = [transitionController animationAtIndex:idx forView:self fromRect:[self pageRect:page] toRect:[self pageRect:toPage] forward:forward]; + if (animation) { + [self setPage:toPage completionHandler:^{ animation(nil); }]; + return YES; + } + } + return NO; } - (void)animateToNextPage:(void (^)(void))completionHandler { @@ -188,12 +188,8 @@ NSUInteger idx = [page pageIndex]; if (idx + 1 < [pdfDoc pageCount]) { PDFPage *toPage = [pdfDoc pageAtIndex:idx + 1]; - id animation = [transitionController animationAtIndex:idx forRect:[self pageRect] inView:self]; - page = toPage; - [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewPageChangedNotification object:self]; - [self displayPage:^{ - [transitionController performAnimation:animation toRect:[self pageRect] forward:YES completionHandler:completionHandler]; - }]; + SKTransitionAnimation animation = [transitionController animationAtIndex:idx forView:self fromRect:[self pageRect:page] toRect:[self pageRect:toPage] forward:YES]; + [self setPage:toPage completionHandler:animation ? ^{ animation(completionHandler); } : completionHandler]; } else { completionHandler(); } Modified: trunk/SKTransitionController.h =================================================================== --- trunk/SKTransitionController.h 2025-05-10 22:13:11 UTC (rev 15183) +++ trunk/SKTransitionController.h 2025-05-11 14:14:19 UTC (rev 15184) @@ -40,6 +40,8 @@ NS_ASSUME_NONNULL_BEGIN +typedef void (^SKTransitionAnimation)(void (^ _Nullable completionHandler)(void)); + @class SKTransitionView, SKTransitionInfo; @interface SKTransitionController : NSObject { @@ -56,8 +58,7 @@ @property (nonatomic) BOOL shouldScale; -- (id)animationAtIndex:(NSUInteger)anIndex forRect:(NSRect)rect inView:(NSView *)view; -- (void)performAnimation:(nullable id)animation toRect:(NSRect)toRect forward:(BOOL)forward completionHandler:(void (^ _Nullable)(void))completionHandler; +- (nullable SKTransitionAnimation)animationAtIndex:(NSUInteger)anIndex forView:(NSView *)view fromRect:(NSRect)rect toRect:(NSRect)toRect forward:(BOOL)forward; @end Modified: trunk/SKTransitionController.m =================================================================== --- trunk/SKTransitionController.m 2025-05-10 22:13:11 UTC (rev 15183) +++ trunk/SKTransitionController.m 2025-05-11 14:14:19 UTC (rev 15184) @@ -171,7 +171,7 @@ return image; } -- (id)animationAtIndex:(NSUInteger)idx forRect:(NSRect)rect inView:(NSView *)view { +- (SKTransitionAnimation)animationAtIndex:(NSUInteger)idx forView:(NSView *)view fromRect:(NSRect)rect toRect:(NSRect)toRect forward:(BOOL)forward { if (animating) return nil; @@ -186,7 +186,7 @@ CIImage *initialImage = [self currentImageForRect:rect inView:view scale:NULL]; - return [^(NSRect toRect, BOOL forward, void (^completionHandler)(void)){ + return ^(void (^completionHandler)(void)){ NSRect bounds = [view bounds]; CGFloat imageScale = 1.0; @@ -223,16 +223,9 @@ completionHandler(); }]; - } copy]; + }; } -- (void)performAnimation:(id)animation toRect:(NSRect)toRect forward:(BOOL)forward completionHandler:(void (^)(void))completionHandler { - if (animation) - ((void (^)(NSRect, BOOL, void(^)(void)))animation)(toRect, forward, completionHandler); - else if (completionHandler) - completionHandler(); -} - @end #pragma mark - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-10 22:13:14
|
Revision: 15183 http://sourceforge.net/p/skim-app/code/15183 Author: hofman Date: 2025-05-10 22:13:11 +0000 (Sat, 10 May 2025) Log Message: ----------- rename method Modified Paths: -------------- trunk/SKPresentationView.m trunk/SKTransitionController.h trunk/SKTransitionController.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-10 21:31:36 UTC (rev 15182) +++ trunk/SKPresentationView.m 2025-05-10 22:13:11 UTC (rev 15183) @@ -172,7 +172,7 @@ if ([transitionController pageTransitions] == nil && ([[transitionController transition] style] == SKNoTransition || equalStrings([page label], [toPage label]))) return NO; - id animation = [transitionController animationForView:self atIndex:idx fomRect:[self pageRect]]; + id animation = [transitionController animationAtIndex:idx forRect:[self pageRect] inView:self]; if (animation == nil) return NO; page = toPage; @@ -188,7 +188,7 @@ NSUInteger idx = [page pageIndex]; if (idx + 1 < [pdfDoc pageCount]) { PDFPage *toPage = [pdfDoc pageAtIndex:idx + 1]; - id animation = [transitionController animationForView:self atIndex:idx fomRect:[self pageRect]]; + id animation = [transitionController animationAtIndex:idx forRect:[self pageRect] inView:self]; page = toPage; [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewPageChangedNotification object:self]; [self displayPage:^{ Modified: trunk/SKTransitionController.h =================================================================== --- trunk/SKTransitionController.h 2025-05-10 21:31:36 UTC (rev 15182) +++ trunk/SKTransitionController.h 2025-05-10 22:13:11 UTC (rev 15183) @@ -56,7 +56,7 @@ @property (nonatomic) BOOL shouldScale; -- (id)animationForView:(NSView *)view atIndex:(NSUInteger)anIndex fomRect:(NSRect)rect; +- (id)animationAtIndex:(NSUInteger)anIndex forRect:(NSRect)rect inView:(NSView *)view; - (void)performAnimation:(nullable id)animation toRect:(NSRect)toRect forward:(BOOL)forward completionHandler:(void (^ _Nullable)(void))completionHandler; @end Modified: trunk/SKTransitionController.m =================================================================== --- trunk/SKTransitionController.m 2025-05-10 21:31:36 UTC (rev 15182) +++ trunk/SKTransitionController.m 2025-05-10 22:13:11 UTC (rev 15183) @@ -171,7 +171,7 @@ return image; } -- (id)animationForView:(NSView *)view atIndex:(NSUInteger)idx fomRect:(NSRect)rect { +- (id)animationAtIndex:(NSUInteger)idx forRect:(NSRect)rect inView:(NSView *)view { if (animating) return nil; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-10 21:31:37
|
Revision: 15182 http://sourceforge.net/p/skim-app/code/15182 Author: hofman Date: 2025-05-10 21:31:36 +0000 (Sat, 10 May 2025) Log Message: ----------- animation can be nil Modified Paths: -------------- trunk/SKTransitionController.h Modified: trunk/SKTransitionController.h =================================================================== --- trunk/SKTransitionController.h 2025-05-10 21:29:58 UTC (rev 15181) +++ trunk/SKTransitionController.h 2025-05-10 21:31:36 UTC (rev 15182) @@ -57,7 +57,7 @@ @property (nonatomic) BOOL shouldScale; - (id)animationForView:(NSView *)view atIndex:(NSUInteger)anIndex fomRect:(NSRect)rect; -- (void)performAnimation:(id)animation toRect:(NSRect)toRect forward:(BOOL)forward completionHandler:(void (^ _Nullable)(void))completionHandler; +- (void)performAnimation:(nullable id)animation toRect:(NSRect)toRect forward:(BOOL)forward completionHandler:(void (^ _Nullable)(void))completionHandler; @end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-10 21:30:01
|
Revision: 15181 http://sourceforge.net/p/skim-app/code/15181 Author: hofman Date: 2025-05-10 21:29:58 +0000 (Sat, 10 May 2025) Log Message: ----------- Separate methods for preparing transition animation and performing it after display, pass completion handler to be called when animation has completed. Modified Paths: -------------- trunk/SKPresentationOptionsSheetController.m trunk/SKPresentationView.h trunk/SKPresentationView.m trunk/SKTransitionController.h trunk/SKTransitionController.m Modified: trunk/SKPresentationOptionsSheetController.m =================================================================== --- trunk/SKPresentationOptionsSheetController.m 2025-05-10 16:25:52 UTC (rev 15180) +++ trunk/SKPresentationOptionsSheetController.m 2025-05-10 21:29:58 UTC (rev 15181) @@ -375,7 +375,7 @@ [previewView animateToNextPage:^{ - DISPATCH_MAIN_AFTER_SEC(1.0 + [info duration], ^{ + DISPATCH_MAIN_AFTER_SEC(1.0 , ^{ if ([previewWindow isKeyWindow]) [[self window] makeKeyWindow]; Modified: trunk/SKPresentationView.h =================================================================== --- trunk/SKPresentationView.h 2025-05-10 16:25:52 UTC (rev 15180) +++ trunk/SKPresentationView.h 2025-05-10 21:29:58 UTC (rev 15181) @@ -58,7 +58,7 @@ - (void)goToNextPage:(nullable id)sender; - (void)goToPreviousPage:(nullable id)sender; -- (void)animateToNextPage:(void (^)(void))didDisplay; +- (void)animateToNextPage:(void (^)(void))completionHandler; @end Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-10 16:25:52 UTC (rev 15180) +++ trunk/SKPresentationView.m 2025-05-10 21:29:58 UTC (rev 15181) @@ -155,10 +155,10 @@ #pragma mark Action -- (NSRect)pageRect:(PDFPage *)aPage { +- (NSRect)pageRect { NSRect bounds = [self bounds]; - NSRect pageRect = [aPage boundsForBox:kPDFDisplayBoxCropBox]; - if (([aPage rotation] % 180) != 0) + NSRect pageRect = [page boundsForBox:kPDFDisplayBoxCropBox]; + if (([page rotation] % 180) != 0) pageRect = NSMakeRect(0.0, 0.0, NSHeight(pageRect), NSWidth(pageRect)); CGFloat scale = [self autoScales] ? fmin(NSHeight(bounds) / NSHeight(pageRect), NSWidth(bounds) / NSWidth(pageRect)) : 1.0; return NSInsetRect(bounds, 0.5 * (NSWidth(bounds) - scale * NSWidth(pageRect)), 0.5 * (NSHeight(bounds) - scale * NSHeight(pageRect))); @@ -172,26 +172,30 @@ if ([transitionController pageTransitions] == nil && ([[transitionController transition] style] == SKNoTransition || equalStrings([page label], [toPage label]))) return NO; - [transitionController animateView:self forRect:[self pageRect:page] toRect:[self pageRect:toPage] atIndex:idx forward:forward change:^(void (^done)(void)){ - page = toPage; - [self displayPage:done]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewPageChangedNotification object:self]; + id animation = [transitionController animationForView:self atIndex:idx fomRect:[self pageRect]]; + if (animation == nil) + return NO; + page = toPage; + [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewPageChangedNotification object:self]; + [self displayPage:^{ + [transitionController performAnimation:animation toRect:[self pageRect] forward:forward completionHandler:nil]; }]; return YES; } -- (void)animateToNextPage:(void (^)(void))didDisplay { +- (void)animateToNextPage:(void (^)(void))completionHandler { PDFDocument *pdfDoc = [page document]; NSUInteger idx = [page pageIndex]; if (idx + 1 < [pdfDoc pageCount]) { PDFPage *toPage = [pdfDoc pageAtIndex:idx + 1]; - [transitionController animateView:self forRect:[self pageRect:page] toRect:[self pageRect:toPage] atIndex:idx forward:YES change:^(void (^done)(void)){ - page = toPage; - [self displayPage:done ? ^{ done(); didDisplay(); } : didDisplay]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewPageChangedNotification object:self]; + id animation = [transitionController animationForView:self atIndex:idx fomRect:[self pageRect]]; + page = toPage; + [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewPageChangedNotification object:self]; + [self displayPage:^{ + [transitionController performAnimation:animation toRect:[self pageRect] forward:YES completionHandler:completionHandler]; }]; } else { - didDisplay(); + completionHandler(); } } Modified: trunk/SKTransitionController.h =================================================================== --- trunk/SKTransitionController.h 2025-05-10 16:25:52 UTC (rev 15180) +++ trunk/SKTransitionController.h 2025-05-10 21:29:58 UTC (rev 15181) @@ -56,7 +56,8 @@ @property (nonatomic) BOOL shouldScale; -- (void)animateView:(NSView *)view forRect:(NSRect)rect toRect:(NSRect)toRect atIndex:(NSUInteger)anIndex forward:(BOOL)forward change:(void (^)(void (^ _Nullable done)(void)))change; +- (id)animationForView:(NSView *)view atIndex:(NSUInteger)anIndex fomRect:(NSRect)rect; +- (void)performAnimation:(id)animation toRect:(NSRect)toRect forward:(BOOL)forward completionHandler:(void (^ _Nullable)(void))completionHandler; @end Modified: trunk/SKTransitionController.m =================================================================== --- trunk/SKTransitionController.m 2025-05-10 16:25:52 UTC (rev 15180) +++ trunk/SKTransitionController.m 2025-05-10 21:29:58 UTC (rev 15181) @@ -171,69 +171,68 @@ return image; } -- (void)animateView:(NSView *)view forRect:(NSRect)rect toRect:(NSRect)toRect atIndex:(NSUInteger)idx forward:(BOOL)forward change:(void (^)(void (^done)(void)))change { - if (animating) { - change(nil); - return; - } +- (id)animationForView:(NSView *)view atIndex:(NSUInteger)idx fomRect:(NSRect)rect { + if (animating) + return nil; SKTransitionInfo *currentTransition = transition; if (idx < [pageTransitions count]) currentTransition = [[SKTransitionInfo alloc] initWithProperties:[pageTransitions objectAtIndex:idx]]; - if ([currentTransition style] == SKNoTransition) { + if ([currentTransition style] == SKNoTransition) + return nil; + + animating = YES; + + CIImage *initialImage = [self currentImageForRect:rect inView:view scale:NULL]; + + return [^(NSRect toRect, BOOL forward, void (^completionHandler)(void)){ - change(nil); + NSRect bounds = [view bounds]; + CGFloat imageScale = 1.0; + CIImage *finalImage = [self currentImageForRect:toRect inView:view scale:&imageScale]; + CGRect cgRect = CGRectIntegral(scaleRect(NSIntersectionRect(NSUnionRect(rect, toRect), bounds), imageScale)); + CGRect cgBounds = scaleRect(bounds, imageScale); + CGRect extent = [currentTransition shouldRestrict] ? cgRect : cgBounds; + NSString *filterName = [currentTransition styleName]; + CGFloat scale = shouldScale ? imageScale * NSHeight(bounds) / NSHeight([[[view window] screen] frame]) : imageScale; + CIFilter *transitionFilter = [self transitionFilterWithName:filterName + rect:cgRect + extent:extent + scale:scale + forward:forward + initialImage:initialImage + finalImage:finalImage]; - } else { - - animating = YES; - - CIImage *initialImage = [self currentImageForRect:rect inView:view scale:NULL]; - - change(^{ - - NSRect bounds = [view bounds]; - CGFloat imageScale = 1.0; - CIImage *finalImage = [self currentImageForRect:toRect inView:view scale:&imageScale]; - CGRect cgRect = CGRectIntegral(scaleRect(NSIntersectionRect(NSUnionRect(rect, toRect), bounds), imageScale)); - CGRect cgBounds = scaleRect(bounds, imageScale); - CGRect extent = [currentTransition shouldRestrict] ? cgRect : cgBounds; - NSString *filterName = [currentTransition styleName]; - CGFloat scale = shouldScale ? imageScale * NSHeight(bounds) / NSHeight([[[view window] screen] frame]) : imageScale; - CIFilter *transitionFilter = [self transitionFilterWithName:filterName - rect:cgRect - extent:extent - scale:scale - forward:forward - initialImage:initialImage - finalImage:finalImage]; - - if (transitionView == nil) - transitionView = [[SKTransitionView alloc] initWithFrame:bounds]; - else - [transitionView setFrame:bounds]; - [transitionView setExtent:cgBounds]; - [transitionView setFilter:transitionFilter]; - [view addSubview:transitionView positioned:NSWindowAbove relativeTo:nil]; + if (transitionView == nil) + transitionView = [[SKTransitionView alloc] initWithFrame:bounds]; + else + [transitionView setFrame:bounds]; + [transitionView setExtent:cgBounds]; + [transitionView setFilter:transitionFilter]; + [view addSubview:transitionView positioned:NSWindowAbove relativeTo:nil]; - // Update the view and its window, so it shows the correct state when it is shown. - [view display]; - - [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){ - [context setDuration:[currentTransition duration]]; - [[transitionView animator] setProgress:1.0]; - } completionHandler:^{ - [transitionView removeFromSuperview]; - [transitionView setFilter:nil]; - animating = NO; - }]; - - }); + [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){ + [context setDuration:[currentTransition duration]]; + [[transitionView animator] setProgress:1.0]; + } completionHandler:^{ + [transitionView removeFromSuperview]; + [transitionView setFilter:nil]; + animating = NO; + if (completionHandler) + completionHandler(); + }]; - } + } copy]; } +- (void)performAnimation:(id)animation toRect:(NSRect)toRect forward:(BOOL)forward completionHandler:(void (^)(void))completionHandler { + if (animation) + ((void (^)(NSRect, BOOL, void(^)(void)))animation)(toRect, forward, completionHandler); + else if (completionHandler) + completionHandler(); +} + @end #pragma mark - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-10 16:25:53
|
Revision: 15180 http://sourceforge.net/p/skim-app/code/15180 Author: hofman Date: 2025-05-10 16:25:52 +0000 (Sat, 10 May 2025) Log Message: ----------- make sure completion block is executed Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-10 16:23:00 UTC (rev 15179) +++ trunk/SKPresentationView.m 2025-05-10 16:25:52 UTC (rev 15180) @@ -190,6 +190,8 @@ [self displayPage:done ? ^{ done(); didDisplay(); } : didDisplay]; [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewPageChangedNotification object:self]; }]; + } else { + didDisplay(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-10 16:23:01
|
Revision: 15179 http://sourceforge.net/p/skim-app/code/15179 Author: hofman Date: 2025-05-10 16:23:00 +0000 (Sat, 10 May 2025) Log Message: ----------- Separate method to preview page transitions, soit will also animat when the page label does not change and the previewer can wait until after the page was displayed. Modified Paths: -------------- trunk/SKPresentationOptionsSheetController.m trunk/SKPresentationView.h trunk/SKPresentationView.m Modified: trunk/SKPresentationOptionsSheetController.m =================================================================== --- trunk/SKPresentationOptionsSheetController.m 2025-05-10 15:51:27 UTC (rev 15178) +++ trunk/SKPresentationOptionsSheetController.m 2025-05-10 16:23:00 UTC (rev 15179) @@ -373,15 +373,18 @@ DISPATCH_MAIN_AFTER_SEC(1.0, ^{ - [previewView goToNextPage:nil]; + [previewView animateToNextPage:^{ + + DISPATCH_MAIN_AFTER_SEC(1.0 + [info duration], ^{ + + if ([previewWindow isKeyWindow]) + [[self window] makeKeyWindow]; + [previewWindow orderOut:nil]; + + }); + + }]; - DISPATCH_MAIN_AFTER_SEC(1.0 + [info duration], ^{ - - if ([previewWindow isKeyWindow]) - [[self window] makeKeyWindow]; - [previewWindow orderOut:nil]; - - }); }); } Modified: trunk/SKPresentationView.h =================================================================== --- trunk/SKPresentationView.h 2025-05-10 15:51:27 UTC (rev 15178) +++ trunk/SKPresentationView.h 2025-05-10 16:23:00 UTC (rev 15179) @@ -58,6 +58,8 @@ - (void)goToNextPage:(nullable id)sender; - (void)goToPreviousPage:(nullable id)sender; +- (void)animateToNextPage:(void (^)(void))didDisplay; + @end #pragma mark - Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-10 15:51:27 UTC (rev 15178) +++ trunk/SKPresentationView.m 2025-05-10 16:23:00 UTC (rev 15179) @@ -180,6 +180,19 @@ return YES; } +- (void)animateToNextPage:(void (^)(void))didDisplay { + PDFDocument *pdfDoc = [page document]; + NSUInteger idx = [page pageIndex]; + if (idx + 1 < [pdfDoc pageCount]) { + PDFPage *toPage = [pdfDoc pageAtIndex:idx + 1]; + [transitionController animateView:self forRect:[self pageRect:page] toRect:[self pageRect:toPage] atIndex:idx forward:YES change:^(void (^done)(void)){ + page = toPage; + [self displayPage:done ? ^{ done(); didDisplay(); } : didDisplay]; + [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewPageChangedNotification object:self]; + }]; + } +} + - (void)goToNextPage:(id)sender { PDFDocument *pdfDoc = [page document]; NSUInteger idx = [page pageIndex]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-10 15:51:30
|
Revision: 15178 http://sourceforge.net/p/skim-app/code/15178 Author: hofman Date: 2025-05-10 15:51:27 +0000 (Sat, 10 May 2025) Log Message: ----------- Draw page in presentation view async in bitmap. Delay transition animation until the image is drawn and set. Modified Paths: -------------- trunk/SKPresentationOptionsSheetController.m trunk/SKPresentationView.m trunk/SKTransitionController.h trunk/SKTransitionController.m Modified: trunk/SKPresentationOptionsSheetController.m =================================================================== --- trunk/SKPresentationOptionsSheetController.m 2025-05-09 22:02:52 UTC (rev 15177) +++ trunk/SKPresentationOptionsSheetController.m 2025-05-10 15:51:27 UTC (rev 15178) @@ -320,7 +320,7 @@ rect.size.height = round(0.5 * NSHeight(rect)) + 34.0; if (previewWindow == nil) { - previewWindow = [[NSPanel alloc] initWithContentRect:rect styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskFullSizeContentView backing:NSBackingStoreBuffered defer:NO]; + previewWindow = [[NSPanel alloc] initWithContentRect:rect styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskFullSizeContentView backing:NSBackingStoreBuffered defer:NO screen:[[self window] screen]]; [previewWindow setReleasedWhenClosed:NO]; [previewWindow setTitlebarAppearsTransparent:YES]; [previewWindow setHidesOnDeactivate:NO]; @@ -363,6 +363,7 @@ CGFloat titleHeight = NSHeight([previewWindow frame]) - NSHeight([previewWindow contentLayoutRect]); rect.size.height += titleHeight - 28.0; [previewWindow setFrame:rect display:NO]; + [previewWindow layoutIfNeeded]; [previewWindow center]; [previewView setPage:[[controller pdfDocument] pageAtIndex:idx]]; Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-09 22:02:52 UTC (rev 15177) +++ trunk/SKPresentationView.m 2025-05-10 15:51:27 UTC (rev 15178) @@ -80,6 +80,7 @@ static NSInteger navigationMode = SKNavigationBottom; @interface SKPDFPageView () <CALayerDelegate> +- (void)displayPage:(void (^)(void))completionHandler; @end @implementation SKPDFPageView @@ -101,7 +102,7 @@ CALayer *layer = [CALayer layer]; [layer setMasksToBounds:YES]; [layer setFrame:NSRectToCGRect([self bounds])]; - [layer setDelegate:self]; + [layer setActions:@{@"contents": [NSNull null]}]; pageView = [[NSView alloc] initWithFrame:[self bounds]]; [pageView setLayer:layer]; [pageView setWantsLayer:YES]; @@ -145,7 +146,7 @@ - (void)setPage:(PDFPage *)newPage { if (newPage != page) { page = newPage; - [[pageView layer] setNeedsDisplay]; + [self displayPage:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewPageChangedNotification object:self]; } } @@ -171,7 +172,11 @@ if ([transitionController pageTransitions] == nil && ([[transitionController transition] style] == SKNoTransition || equalStrings([page label], [toPage label]))) return NO; - [transitionController animateView:self forRect:[self pageRect:page] toRect:[self pageRect:toPage] atIndex:idx forward:forward change:^{ [self setPage:toPage]; }]; + [transitionController animateView:self forRect:[self pageRect:page] toRect:[self pageRect:toPage] atIndex:idx forward:forward change:^(void (^done)(void)){ + page = toPage; + [self displayPage:done]; + [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewPageChangedNotification object:self]; + }]; return YES; } @@ -195,31 +200,77 @@ } } -#pragma mark CALayer delegate +#pragma mark Drawing -- (void)drawLayer:(CALayer *)aLayer inContext:(CGContextRef)context { - if (page == nil) +- (void)displayPage:(void (^)(void))completionHandler { + if (page == nil) { + [[pageView layer] setContents:nil]; + if (completionHandler) + completionHandler(); return; + } + + static dispatch_queue_t drawingQueue = nil; + if (drawingQueue == nil) { + dispatch_queue_attr_t queuePriority = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_CONCURRENT, QOS_CLASS_UTILITY, 0); + drawingQueue = dispatch_queue_create("net.sourceforge.skim-app.skim.pageView", queuePriority); + } + NSRect bounds = [self bounds]; - NSRect pageRect = [page boundsForBox:kPDFDisplayBoxCropBox]; - if (([page rotation] % 180) != 0) - pageRect = NSMakeRect(0.0, 0.0, NSHeight(pageRect), NSWidth(pageRect)); - CGFloat scale = [self 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))); - 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); - [page drawWithBox:kPDFDisplayBoxCropBox toContext:context]; - CGContextRestoreGState(context); + NSBitmapImageRep *imageRep = [self bitmapImageRepForCachingDisplayInRect:bounds]; + + if (imageRep == nil) { + if (completionHandler) + completionHandler(); + return; + } + + PDFPage *thePage = page; + BOOL autoScales = [self autoScales]; + + dispatch_async(drawingQueue, ^{ + + NSRect pageRect = [thePage boundsForBox:kPDFDisplayBoxCropBox]; + if (([thePage rotation] % 180) != 0) + pageRect = NSMakeRect(0.0, 0.0, NSHeight(pageRect), NSWidth(pageRect)); + CGFloat scale = 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))); + 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); + [thePage drawWithBox:kPDFDisplayBoxCropBox toContext:context]; + CGContextRestoreGState(context); + + NSImage *image = [[NSImage alloc] initWithSize:bounds.size]; + [image addRepresentation:imageRep]; + + dispatch_async(dispatch_get_main_queue(), ^{ + + if (thePage == page) + [[pageView layer] setContents:image]; + if (completionHandler) + completionHandler(); + + }); + + }); } -- (BOOL)layer:(CALayer *)aLayer shouldInheritContentsScale:(CGFloat)newScale fromWindow:(NSWindow *)window { - return YES; +- (NSBitmapImageRep *)bitmapImageRepCachingDisplay { + NSImage *image = [[pageView layer] contents]; + if ([image isKindOfClass:[NSImage class]]) { + NSImageRep *imageRep = [[image representations] firstObject]; + if ([imageRep isKindOfClass:[NSBitmapImageRep class]]) + return (NSBitmapImageRep *)imageRep; + } + return [super bitmapImageRepCachingDisplay]; } @end @@ -267,12 +318,12 @@ - (void)viewDidEndLiveResize { [super viewDidEndLiveResize]; - [[pageView layer] setNeedsDisplay]; + [self displayPage:nil]; } - (void)updatedAnnotationOnPage:(PDFPage *)aPage { if (page == aPage) - [[pageView layer] setNeedsDisplay]; + [self displayPage:nil]; } #pragma mark Accessors @@ -289,7 +340,7 @@ if (flag != pvFlags.autoScales) { pvFlags.autoScales = flag; [pageView setLayerContentsPlacement:flag ? NSViewLayerContentsPlacementScaleProportionallyToFill : NSViewLayerContentsPlacementCenter]; - [[pageView layer] setNeedsDisplay]; + [self displayPage:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewAutoScalesChangedNotification object:self]; } } Modified: trunk/SKTransitionController.h =================================================================== --- trunk/SKTransitionController.h 2025-05-09 22:02:52 UTC (rev 15177) +++ trunk/SKTransitionController.h 2025-05-10 15:51:27 UTC (rev 15178) @@ -56,7 +56,7 @@ @property (nonatomic) BOOL shouldScale; -- (void)animateView:(NSView *)view forRect:(NSRect)rect toRect:(NSRect)toRect atIndex:(NSUInteger)anIndex forward:(BOOL)forward change:(void (^)(void))change; +- (void)animateView:(NSView *)view forRect:(NSRect)rect toRect:(NSRect)toRect atIndex:(NSUInteger)anIndex forward:(BOOL)forward change:(void (^)(void (^ _Nullable done)(void)))change; @end Modified: trunk/SKTransitionController.m =================================================================== --- trunk/SKTransitionController.m 2025-05-09 22:02:52 UTC (rev 15177) +++ trunk/SKTransitionController.m 2025-05-10 15:51:27 UTC (rev 15178) @@ -171,9 +171,9 @@ return image; } -- (void)animateView:(NSView *)view forRect:(NSRect)rect toRect:(NSRect)toRect atIndex:(NSUInteger)idx forward:(BOOL)forward change:(void (^)(void))change { +- (void)animateView:(NSView *)view forRect:(NSRect)rect toRect:(NSRect)toRect atIndex:(NSUInteger)idx forward:(BOOL)forward change:(void (^)(void (^done)(void)))change { if (animating) { - change(); + change(nil); return; } @@ -183,7 +183,7 @@ if ([currentTransition style] == SKNoTransition) { - change(); + change(nil); } else { @@ -191,44 +191,46 @@ CIImage *initialImage = [self currentImageForRect:rect inView:view scale:NULL]; - change(); + change(^{ + + NSRect bounds = [view bounds]; + CGFloat imageScale = 1.0; + CIImage *finalImage = [self currentImageForRect:toRect inView:view scale:&imageScale]; + CGRect cgRect = CGRectIntegral(scaleRect(NSIntersectionRect(NSUnionRect(rect, toRect), bounds), imageScale)); + CGRect cgBounds = scaleRect(bounds, imageScale); + CGRect extent = [currentTransition shouldRestrict] ? cgRect : cgBounds; + NSString *filterName = [currentTransition styleName]; + CGFloat scale = shouldScale ? imageScale * NSHeight(bounds) / NSHeight([[[view window] screen] frame]) : imageScale; + CIFilter *transitionFilter = [self transitionFilterWithName:filterName + rect:cgRect + extent:extent + scale:scale + forward:forward + initialImage:initialImage + finalImage:finalImage]; + + if (transitionView == nil) + transitionView = [[SKTransitionView alloc] initWithFrame:bounds]; + else + [transitionView setFrame:bounds]; + [transitionView setExtent:cgBounds]; + [transitionView setFilter:transitionFilter]; + [view addSubview:transitionView positioned:NSWindowAbove relativeTo:nil]; - NSRect bounds = [view bounds]; - CGFloat imageScale = 1.0; - CIImage *finalImage = [self currentImageForRect:toRect inView:view scale:&imageScale]; - CGRect cgRect = CGRectIntegral(scaleRect(NSIntersectionRect(NSUnionRect(rect, toRect), bounds), imageScale)); - CGRect cgBounds = scaleRect(bounds, imageScale); - CGRect extent = [currentTransition shouldRestrict] ? cgRect : cgBounds; - NSString *filterName = [currentTransition styleName]; - CGFloat scale = shouldScale ? imageScale * NSHeight(bounds) / NSHeight([[[view window] screen] frame]) : imageScale; - CIFilter *transitionFilter = [self transitionFilterWithName:filterName - rect:cgRect - extent:extent - scale:scale - forward:forward - initialImage:initialImage - finalImage:finalImage]; + // Update the view and its window, so it shows the correct state when it is shown. + [view display]; + + [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){ + [context setDuration:[currentTransition duration]]; + [[transitionView animator] setProgress:1.0]; + } completionHandler:^{ + [transitionView removeFromSuperview]; + [transitionView setFilter:nil]; + animating = NO; + }]; + + }); - if (transitionView == nil) - transitionView = [[SKTransitionView alloc] initWithFrame:bounds]; - else - [transitionView setFrame:bounds]; - [transitionView setExtent:cgBounds]; - [transitionView setFilter:transitionFilter]; - [view addSubview:transitionView positioned:NSWindowAbove relativeTo:nil]; - - // Update the view and its window, so it shows the correct state when it is shown. - [view display]; - - [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){ - [context setDuration:[currentTransition duration]]; - [[transitionView animator] setProgress:1.0]; - } completionHandler:^{ - [transitionView removeFromSuperview]; - [transitionView setFilter:nil]; - animating = NO; - }]; - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-09 22:02:56
|
Revision: 15177 http://sourceforge.net/p/skim-app/code/15177 Author: hofman Date: 2025-05-09 22:02:52 +0000 (Fri, 09 May 2025) Log Message: ----------- Don't update page view on resize. Don't resize transition preview window in animation, use standard window animation to show/hide th window. Modified Paths: -------------- trunk/SKPresentationOptionsSheetController.m trunk/SKPresentationView.m Modified: trunk/SKPresentationOptionsSheetController.m =================================================================== --- trunk/SKPresentationOptionsSheetController.m 2025-05-09 21:42:32 UTC (rev 15176) +++ trunk/SKPresentationOptionsSheetController.m 2025-05-09 22:02:52 UTC (rev 15177) @@ -325,7 +325,7 @@ [previewWindow setTitlebarAppearsTransparent:YES]; [previewWindow setHidesOnDeactivate:NO]; [previewWindow setFloatingPanel:YES]; - [previewWindow setAnimationBehavior:NSWindowAnimationBehaviorNone]; + [previewWindow setAnimationBehavior:NSWindowAnimationBehaviorDocumentWindow]; NSView *contentView = [previewWindow contentView]; @@ -359,75 +359,29 @@ [bgView addSubviewWithConstraints:previewView]; } - [previewView setPage:[[controller pdfDocument] pageAtIndex:idx]]; - [[previewView transitionController] setTransition:info]; - [previewWindow setTitle:[info localizedStyleName]]; CGFloat titleHeight = NSHeight([previewWindow frame]) - NSHeight([previewWindow contentLayoutRect]); rect.size.height += titleHeight - 28.0; [previewWindow setFrame:rect display:NO]; [previewWindow center]; - rect = [previewWindow frame]; - NSRect sourceRect = rect, targetRect = rect; - if ([NSView shouldShowSlideAnimation]) { - if (separate) { - sourceRect = [tableView convertRectToScreen:[tableView frameOfCellAtColumn:0 row:idx]]; - sourceRect = NSOffsetRect(NSInsetRect(sourceRect, -6.0, -6.0 - 0.5 * titleHeight), 0.0, 0.5 * titleHeight); - targetRect = [tableView convertRectToScreen:[tableView frameOfCellAtColumn:1 row:idx]]; - targetRect = NSOffsetRect(NSInsetRect(targetRect, -6.0, -6.0 - 0.5 * titleHeight), 0.0, 0.5 * titleHeight); - } else { - targetRect = sourceRect = [[stylePopUpButton superview] convertRectToScreen:[[stylePopUpButton superview] bounds]]; - } - } - BOOL shouldAnimate = [NSView shouldShowFadeAnimation]; - id viewOrWindow = previewWindow; - NSView *titleView = nil; - if (separate && NSEqualRects(sourceRect, rect) == NO) { - viewOrWindow = [[[previewWindow contentView] subviews] firstObject]; - titleView = [[[[previewWindow contentView] superview] subviews] lastObject]; - [previewWindow setOpaque:NO]; - [previewWindow setBackgroundColor:[NSColor clearColor]]; - } else { - [previewWindow setOpaque:YES]; - [previewWindow setBackgroundColor:[NSColor blackColor]]; - } - [previewWindow setFrame:sourceRect display:NO]; - if (shouldAnimate) { - [viewOrWindow setAlphaValue:0.0]; - [titleView setAlphaValue:0.0]; - } + + [previewView setPage:[[controller pdfDocument] pageAtIndex:idx]]; + [[previewView transitionController] setTransition:info]; + [previewWindow makeKeyAndOrderFront:nil]; - [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){ - if (shouldAnimate == NO) { - [context setDuration:0.0]; - } else { - [[viewOrWindow animator] setAlphaValue:1.0]; - [[titleView animator] setAlphaValue:1.0]; - } - [[previewWindow animator] setFrame:rect display:YES]; - } completionHandler:^{ - [previewWindow invalidateShadow]; - DISPATCH_MAIN_AFTER_SEC(1.0, ^{ - [previewView goToNextPage:nil]; - DISPATCH_MAIN_AFTER_SEC(1.0 + [info duration], ^{ - if ([previewWindow isKeyWindow]) - [[self window] makeKeyWindow]; - [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){ - if (shouldAnimate == NO) { - [context setDuration:0.0]; - } else { - [[viewOrWindow animator] setAlphaValue:0.0]; - [[titleView animator] setAlphaValue:0.0]; - } - [[previewWindow animator] setFrame:targetRect display:YES]; - } completionHandler:^{ - [previewWindow orderOut:nil]; - [viewOrWindow setAlphaValue:1.0]; - [titleView setAlphaValue:1.0]; - }]; - }); + + DISPATCH_MAIN_AFTER_SEC(1.0, ^{ + + [previewView goToNextPage:nil]; + + DISPATCH_MAIN_AFTER_SEC(1.0 + [info duration], ^{ + + if ([previewWindow isKeyWindow]) + [[self window] makeKeyWindow]; + [previewWindow orderOut:nil]; + }); - }]; + }); } - (NSArray *)availableTransitions { Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-09 21:42:32 UTC (rev 15176) +++ trunk/SKPresentationView.m 2025-05-09 22:02:52 UTC (rev 15177) @@ -105,8 +105,6 @@ pageView = [[NSView alloc] initWithFrame:[self bounds]]; [pageView setLayer:layer]; [pageView setWantsLayer:YES]; - if ([self isMemberOfClass:[SKPDFPageView class]]) - [pageView setLayerContentsRedrawPolicy:NSViewLayerContentsRedrawDuringViewResize]; [pageView setContentFilters:SKColorEffectFilters()]; [pageView setTranslatesAutoresizingMaskIntoConstraints:NO]; [self addSubviewWithConstraints:pageView]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-09 21:42:35
|
Revision: 15176 http://sourceforge.net/p/skim-app/code/15176 Author: hofman Date: 2025-05-09 21:42:32 +0000 (Fri, 09 May 2025) Log Message: ----------- enum for reopen options Modified Paths: -------------- trunk/SKApplicationController.m Modified: trunk/SKApplicationController.m =================================================================== --- trunk/SKApplicationController.m 2025-05-09 09:27:19 UTC (rev 15175) +++ trunk/SKApplicationController.m 2025-05-09 21:42:32 UTC (rev 15176) @@ -111,6 +111,12 @@ NSString *SKPageLabelsChangedNotification = @"SKPageLabelsChangedNotification"; +enum { + SKReopenNever = 0, + SKReopenOnDefaultLaunch = 1, + SKReopenAlways = 2 +}; + @interface SKApplicationController () @property (nonatomic, readonly) SKDownloadController *downloadController; @end @@ -200,7 +206,7 @@ [PDFPage setUsesSequentialPageNumbering:[[NSUserDefaults standardUserDefaults] boolForKey:SKSequentialPageNumberingKey]]; [sud addObserver:self forKeyPath:SKSequentialPageNumberingKey options:0 context:&SKApplicationControllerDefaultsObservationContext]; - if ([sud integerForKey:SKReopenLastOpenFilesKey] == 2 || [sud boolForKey:SKIsRelaunchKey]) { + if ([sud integerForKey:SKReopenLastOpenFilesKey] == SKReopenAlways || [sud boolForKey:SKIsRelaunchKey]) { // just remove this in case opening the last open files crashes the app after a relaunch if ([sud objectForKey:SKIsRelaunchKey]) { [sud removeObjectForKey:SKIsRelaunchKey]; @@ -213,7 +219,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification{ NSUserDefaults *sud = [NSUserDefaults standardUserDefaults]; - if (didReopen == NO && [sud integerForKey:SKReopenLastOpenFilesKey] == 1 && [[[aNotification userInfo] objectForKey:NSApplicationLaunchIsDefaultLaunchKey] boolValue]) + if (didReopen == NO && [sud integerForKey:SKReopenLastOpenFilesKey] == SKReopenOnDefaultLaunch && [[[aNotification userInfo] objectForKey:NSApplicationLaunchIsDefaultLaunchKey] boolValue]) [self reopenLastOpenFiles]; [NSApp setServicesProvider:[NSDocumentController sharedDocumentController]]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-09 09:27:21
|
Revision: 15175 http://sourceforge.net/p/skim-app/code/15175 Author: hofman Date: 2025-05-09 09:27:19 +0000 (Fri, 09 May 2025) Log Message: ----------- only set layer contents redraw policy for page view,never for presentation view Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-09 09:19:17 UTC (rev 15174) +++ trunk/SKPresentationView.m 2025-05-09 09:27:19 UTC (rev 15175) @@ -105,7 +105,8 @@ pageView = [[NSView alloc] initWithFrame:[self bounds]]; [pageView setLayer:layer]; [pageView setWantsLayer:YES]; - [pageView setLayerContentsRedrawPolicy:NSViewLayerContentsRedrawDuringViewResize]; + if ([self isMemberOfClass:[SKPDFPageView class]]) + [pageView setLayerContentsRedrawPolicy:NSViewLayerContentsRedrawDuringViewResize]; [pageView setContentFilters:SKColorEffectFilters()]; [pageView setTranslatesAutoresizingMaskIntoConstraints:NO]; [self addSubviewWithConstraints:pageView]; @@ -259,7 +260,6 @@ pvFlags.removeLaserPointerShadow = [[NSUserDefaults standardUserDefaults] boolForKey:SKRemoveLaserPointerShadowKey]; pvFlags.enableDrawing = NO == [[NSUserDefaults standardUserDefaults] boolForKey:SKDisableDrawingInPresentationKey]; - [pageView setLayerContentsRedrawPolicy:NSViewLayerContentsRedrawNever]; [pageView setLayerContentsPlacement:NSViewLayerContentsPlacementScaleProportionallyToFill]; [self addTrackingArea:[[NSTrackingArea alloc] initWithRect:NSZeroRect options:NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingActiveInKeyWindow | NSTrackingInVisibleRect owner:self userInfo:nil]]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-09 09:19:20
|
Revision: 15174 http://sourceforge.net/p/skim-app/code/15174 Author: hofman Date: 2025-05-09 09:19:17 +0000 (Fri, 09 May 2025) Log Message: ----------- always just remove blackout on mouse down when in blackout Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-09 09:07:10 UTC (rev 15173) +++ trunk/SKPresentationView.m 2025-05-09 09:19:17 UTC (rev 15174) @@ -474,11 +474,10 @@ - (void)mouseDown:(NSEvent *)theEvent { BOOL didHideMouse = pvFlags.cursorHidden; - if ([NSApp willDragMouse] == NO) { - if ([pageView alphaValue] <= 0.0) - [self toggleBlackout:nil]; - else - [self goToNextPage:self]; + if ([pageView alphaValue] <= 0.0) { + [self toggleBlackout:nil]; + } else if ([NSApp willDragMouse] == NO) { + [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]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |