Revision: 15957
http://sourceforge.net/p/skim-app/code/15957
Author: hofman
Date: 2026-01-04 22:28:04 +0000 (Sun, 04 Jan 2026)
Log Message:
-----------
rename scrollView method
Modified Paths:
--------------
trunk/PDFView_SKExtensions.h
trunk/PDFView_SKExtensions.m
trunk/SKBasePDFView.m
trunk/SKLoupeController.m
trunk/SKMainWindowController.m
trunk/SKMainWindowController_Actions.m
trunk/SKPDFView.m
trunk/SKSnapshotPDFView.m
trunk/SKSnapshotWindowController.m
Modified: trunk/PDFView_SKExtensions.h
===================================================================
--- trunk/PDFView_SKExtensions.h 2026-01-04 18:31:47 UTC (rev 15956)
+++ trunk/PDFView_SKExtensions.h 2026-01-04 22:28:04 UTC (rev 15957)
@@ -50,7 +50,7 @@
@interface PDFView (SKExtensions) <NSDraggingSource>
@property (nonatomic) CGFloat physicalScaleFactor;
-@property (nonatomic, readonly) NSScrollView *scrollView;
+@property (nonatomic, readonly) NSScrollView *embeddedScrollView;
@property (nonatomic, readonly) NSArray<PDFPage *> *displayedPages;
@property (nonatomic, readonly) NSRect unobscuredContentRect;
Modified: trunk/PDFView_SKExtensions.m
===================================================================
--- trunk/PDFView_SKExtensions.m 2026-01-04 18:31:47 UTC (rev 15956)
+++ trunk/PDFView_SKExtensions.m 2026-01-04 22:28:04 UTC (rev 15957)
@@ -85,7 +85,7 @@
[self setScaleFactor:scale / physicalScaleFactorForView(self)];
}
-- (NSScrollView *)scrollView {
+- (NSScrollView *)embeddedScrollView {
// don't go through the documentView, because that may not exist,
// e.g. in init or when the document is locked
// also when -documentView is called from -initWithCoder: it may crash
@@ -135,7 +135,7 @@
}
- (void)doDragContentWithEvent:(NSEvent *)theEvent {
- NSView *contentView = [[self scrollView] contentView];
+ NSView *contentView = [[self embeddedScrollView] contentView];
NSPoint startLocation = [contentView convertPoint:[theEvent
locationInWindow] fromView:nil];
[[NSCursor closedHandCursor] push];
@@ -201,7 +201,7 @@
if ([[page document] isLocked] == NO && (invalidatePointWhenRotated == NO
|| [page rotation] == [page intrinsicRotation])) {
// don't use currentDestination, as that always gives the top-left of
the page in non-continuous mode, rather than the visible area
point = SKTopLeftPoint([self bounds]);
- point.y -= [[self scrollView] contentInsets].top;
+ point.y -= [[self embeddedScrollView] contentInsets].top;
point = [self convertPoint:point toPage:page];
}
return (SKDestination){[page pageIndex], point};
@@ -215,7 +215,7 @@
PDFDestination *destination = [[PDFDestination alloc]
initWithPage:page atPoint:dest.point];
[self goToDestination:destination];
if (@available(macOS 12.0, *)) {
- NSScrollView *scrollView = [self scrollView];
+ NSScrollView *scrollView = [self embeddedScrollView];
NSClipView *clipView = [scrollView contentView];
dest.point = [self convertPoint:[self convertPoint:dest.point
fromPage:page] toView:clipView];
if ([clipView isFlipped] == NO)
@@ -267,7 +267,7 @@
}
- (NSRect)unobscuredContentRect {
- NSScrollView *scrollView = [self scrollView];
+ NSScrollView *scrollView = [self embeddedScrollView];
NSView *clipView = [scrollView contentView];
NSRect rect = [self convertRect:[clipView bounds] fromView:clipView];
rect.size.height -= [scrollView contentInsets].top;
Modified: trunk/SKBasePDFView.m
===================================================================
--- trunk/SKBasePDFView.m 2026-01-04 18:31:47 UTC (rev 15956)
+++ trunk/SKBasePDFView.m 2026-01-04 22:28:04 UTC (rev 15957)
@@ -82,9 +82,9 @@
if (@available(macOS 10.14, *)) {
[self setAppearance:nil];
- [[[self scrollView] contentView] setAppearance:[NSAppearance
appearanceNamed:NSAppearanceNameAqua]];
+ [[[self embeddedScrollView] contentView] setAppearance:[NSAppearance
appearanceNamed:NSAppearanceNameAqua]];
if ([[NSUserDefaults standardUserDefaults]
boolForKey:SKInvertColorsInDarkModeKey])
- [[self scrollView] setAppearance:[NSAppearance
appearanceNamed:NSAppearanceNameAqua]];
+ [[self embeddedScrollView] setAppearance:[NSAppearance
appearanceNamed:NSAppearanceNameAqua]];
if (@available(macOS 11.0, *)) {} else {
[self handleScrollerStyleChangedNotification:nil];
@@ -94,7 +94,7 @@
}
}
- [[self scrollView] setContentFilters:SKColorEffectFilters()];
+ [[self embeddedScrollView] setContentFilters:SKColorEffectFilters()];
NSUserDefaults *sud = [NSUserDefaults standardUserDefaults];
for (NSString *key in defaultKeysToObserve())
@@ -135,11 +135,11 @@
- (void)colorFiltersDidChange {
if (@available(macOS 10.14, *)) {
if ([[NSUserDefaults standardUserDefaults]
boolForKey:SKInvertColorsInDarkModeKey])
- [[self scrollView] setAppearance:[NSAppearance
appearanceNamed:NSAppearanceNameAqua]];
+ [[self embeddedScrollView] setAppearance:[NSAppearance
appearanceNamed:NSAppearanceNameAqua]];
else
- [[self scrollView] setAppearance:nil];
+ [[self embeddedScrollView] setAppearance:nil];
}
- [[self scrollView] setContentFilters:SKColorEffectFilters()];
+ [[self embeddedScrollView] setContentFilters:SKColorEffectFilters()];
}
- (void)viewDidChangeEffectiveAppearance {
@@ -146,7 +146,7 @@
if (@available(macOS 10.14, *))
[super viewDidChangeEffectiveAppearance];
if ([[NSUserDefaults standardUserDefaults]
boolForKey:SKInvertColorsInDarkModeKey])
- [[self scrollView] setContentFilters:SKColorEffectFilters()];
+ [[self embeddedScrollView] setContentFilters:SKColorEffectFilters()];
}
- (void)handleScrollerStyleChangedNotification:(NSNotification *)notification {
@@ -154,8 +154,8 @@
NSAppearance *appearance = nil;
if ([NSScroller preferredScrollerStyle] != NSScrollerStyleLegacy)
appearance = [NSAppearance appearanceNamed:NSAppearanceNameAqua];
- [[[self scrollView] verticalScroller] setAppearance:appearance];
- [[[self scrollView] horizontalScroller] setAppearance:appearance];
+ [[[self embeddedScrollView] verticalScroller]
setAppearance:appearance];
+ [[[self embeddedScrollView] horizontalScroller]
setAppearance:appearance];
}
}
@@ -229,7 +229,7 @@
static void horizontallyGoToPage(PDFView *pdfView, PDFPage *page) {
if (page == [pdfView currentPage])
return;
- NSScrollView *scrollView = [pdfView scrollView];
+ NSScrollView *scrollView = [pdfView embeddedScrollView];
NSClipView *clipView = [scrollView contentView];
NSRect bounds = [clipView bounds];
NSRect docRect = [[scrollView documentView] frame];
@@ -242,7 +242,7 @@
}
static void verticallyScrollToPage(PDFView *pdfView, PDFPage *page) {
- NSScrollView *scrollView = [pdfView scrollView];
+ NSScrollView *scrollView = [pdfView embeddedScrollView];
CGFloat inset = [scrollView contentInsets].top;
NSRect pageRect = [pdfView convertRect:[page boundsForBox:[pdfView
displayBox]] fromPage:page];
CGFloat midY = NSMidY([pdfView bounds]);
@@ -264,7 +264,7 @@
}
static void verticallyScrollToTop(PDFView *pdfView) {
- NSScrollView *scrollView = [pdfView scrollView];
+ NSScrollView *scrollView = [pdfView embeddedScrollView];
NSClipView *clipView = [scrollView contentView];
NSRect bounds = [clipView bounds];
CGFloat inset = [clipView contentInsets].top;
@@ -279,7 +279,7 @@
}
static void verticallyScrollToBottom(PDFView *pdfView) {
- NSScrollView *scrollView = [pdfView scrollView];
+ NSScrollView *scrollView = [pdfView embeddedScrollView];
NSClipView *clipView = [scrollView contentView];
NSRect bounds = [clipView bounds];
CGFloat inset = [clipView contentInsets].top;
@@ -366,7 +366,7 @@
- (void)scrollToSKDestination:(SKDestination)dest {
PDFPage *page = [[self document] pageAtIndex:dest.pageIndex];
if (NSEqualPoints(dest.point, SKUnspecifiedPoint) == NO) {
- NSScrollView *scrollView = [self scrollView];
+ NSScrollView *scrollView = [self embeddedScrollView];
NSClipView *clipView = [scrollView contentView];
dest.point = [self convertPoint:[self convertPoint:dest.point
fromPage:page] toView:clipView];
if ([clipView isFlipped])
@@ -413,11 +413,11 @@
pageIndex = [[self currentPage] pageIndex];
} else if (hasVerticalLayout(self)) {
// Apple scrolls by too much, so correct for it
- scrollView = [self scrollView];
+ scrollView = [self embeddedScrollView];
clipView = [scrollView contentView];
bounds = [clipView bounds];
} else if (hasHorizontalLayout(self) && (keyDirection == -1 ? [self
canGoToPreviousPage] : keyDirection == 1 ? [self canGoToNextPage] : NO)) {
- clipView = [[self scrollView] contentView];
+ clipView = [[self embeddedScrollView] contentView];
bounds = [clipView bounds];
}
@@ -469,11 +469,11 @@
pageIndex = [[self currentPage] pageIndex];
} else if (hasVerticalLayout(self)) {
// Apple scrolls by too much, so correct for it
- scrollView = [self scrollView];
+ scrollView = [self embeddedScrollView];
clipView = [scrollView contentView];
bounds = [clipView bounds];
} else if (hasHorizontalLayout(self) && (keyDirection == 1 ? [self
canGoToNextPage] : keyDirection == -1 ? [self canGoToPreviousPage] : NO)) {
- clipView = [[self scrollView] contentView];
+ clipView = [[self embeddedScrollView] contentView];
bounds = [clipView bounds];
}
Modified: trunk/SKLoupeController.m
===================================================================
--- trunk/SKLoupeController.m 2026-01-04 18:31:47 UTC (rev 15956)
+++ trunk/SKLoupeController.m 2026-01-04 22:28:04 UTC (rev 15957)
@@ -77,7 +77,7 @@
[self updateColorFilters];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handlePDFContentViewFrameChangedNotification:)
- name:NSViewBoundsDidChangeNotification object:[[pdfView
scrollView] contentView]];
+ name:NSViewBoundsDidChangeNotification object:[[pdfView
embeddedScrollView] contentView]];
}
return self;
}
@@ -129,7 +129,7 @@
material = NSVisualEffectMaterialUnderPageBackground;
if (material == 0) {
__block CGColorRef cgColor = NULL;
- SKRunWithAppearance([pdfView scrollView], ^{
+ SKRunWithAppearance([pdfView embeddedScrollView], ^{
if ([bgColor alphaComponent] < 1.0)
cgColor = [[[NSColor whiteColor]
blendedColorWithFraction:[bgColor alphaComponent] ofColor:[bgColor
colorWithAlphaComponent:1.0]] CGColor];
if (cgColor == NULL)
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2026-01-04 18:31:47 UTC (rev 15956)
+++ trunk/SKMainWindowController.m 2026-01-04 22:28:04 UTC (rev 15957)
@@ -1831,7 +1831,7 @@
[window makeFirstResponder:pdfView];
if (mwcFlags.fullSizeContent) {
- [[pdfView scrollView] setAutomaticallyAdjustsContentInsets:YES];
+ [[pdfView embeddedScrollView]
setAutomaticallyAdjustsContentInsets:YES];
if ([pdfView autoScales] && ([pdfView extendedDisplayMode] &
kPDFDisplaySinglePageContinuous) == 0) {
[pdfView setAutoScales:NO];
[pdfView setAutoScales:YES];
@@ -1895,7 +1895,7 @@
[findController didAddFindBar];
if (mwcFlags.fullSizeContent) {
- NSScrollView *scrollView = [pdfView scrollView];
+ NSScrollView *scrollView = [pdfView embeddedScrollView];
[scrollView setAutomaticallyAdjustsContentInsets:NO];
[scrollView setContentInsets:NSEdgeInsetsMake(barHeight +
titleBarHeight, 0.0, 0.0, 0.0)];
if ([pdfView autoScales] && ([pdfView extendedDisplayMode] &
kPDFDisplaySinglePageContinuous) == 0) {
@@ -2670,7 +2670,7 @@
[leftSideController setTopInset:titleBarHeight];
if ([[findController view] window]) {
[findBarTopConstraint setConstant:titleBarHeight];
- [[pdfView scrollView]
setContentInsets:NSEdgeInsetsMake([findController height] + titleBarHeight,
0.0, 0.0, 0.0)];
+ [[pdfView embeddedScrollView]
setContentInsets:NSEdgeInsetsMake([findController height] + titleBarHeight,
0.0, 0.0, 0.0)];
}
}
Modified: trunk/SKMainWindowController_Actions.m
===================================================================
--- trunk/SKMainWindowController_Actions.m 2026-01-04 18:31:47 UTC (rev
15956)
+++ trunk/SKMainWindowController_Actions.m 2026-01-04 22:28:04 UTC (rev
15957)
@@ -473,7 +473,7 @@
width = NSHeight(pageRect);
height = NSWidth(pageRect);
}
- frame.size.height -= [[pdfView scrollView] contentInsets].top;
+ frame.size.height -= [[pdfView embeddedScrollView] contentInsets].top;
if ((displayMode & kPDFDisplaySinglePageContinuous) == 0) {
// zoom to width
if (scrollerWidth > 0.0) {
@@ -918,7 +918,7 @@
if ((displayMode & kPDFDisplaySinglePageContinuous) != 0)
pageRect = [pdfView boundsIncludingMarginsForPage:page];
- oldSize.height -= [[[self pdfView] scrollView] contentInsets].top;
+ oldSize.height -= [[[self pdfView] embeddedScrollView] contentInsets].top;
// Calculate the new size for the pdfView
if (horizontal && pageCount > 1)
@@ -1127,7 +1127,7 @@
if (secondaryPdfView == nil) {
NSPoint point = frame.origin;
PDFPage *page = nil;
- BOOL fixedAtBottom = [[[pdfView scrollView] contentView]
isFlipped] == NO;
+ BOOL fixedAtBottom = [[[pdfView embeddedScrollView] contentView]
isFlipped] == NO;
secondaryPdfView = [[SKSecondaryPDFView alloc]
initWithFrame:NSMakeRect(0.0, 0.0, NSWidth(frame), lastSplitPDFHeight)];
[secondaryPdfView setAutoresizingMask:NSViewWidthSizable |
NSViewHeightSizable];
[secondaryPdfView setHidden:YES];
@@ -1135,7 +1135,7 @@
// Because of a PDFView bug, display properties can not be changed
before it is placed in a window
[secondaryPdfView setSynchronizedPDFView:pdfView];
[secondaryPdfView setBackgroundColor:[pdfView backgroundColor]];
- [[secondaryPdfView scrollView] setDrawsBackground:[[pdfView
scrollView] drawsBackground]];
+ [[secondaryPdfView embeddedScrollView]
setDrawsBackground:[[pdfView embeddedScrollView] drawsBackground]];
[secondaryPdfView setDisplaysPageBreaks:NO];
[secondaryPdfView setInterpolationQuality:[[NSUserDefaults
standardUserDefaults] integerForKey:SKInterpolationQualityKey]];
[secondaryPdfView setSynchronizeZoom:YES];
@@ -1144,7 +1144,7 @@
page = [pdfView pageForPoint:point nearest:YES];
[secondaryPdfView goToPage:page];
[secondaryPdfView layoutDocumentView];
- NSClipView *clipView = [[secondaryPdfView scrollView] contentView];
+ NSClipView *clipView = [[secondaryPdfView embeddedScrollView]
contentView];
point = [secondaryPdfView convertPoint:[secondaryPdfView
convertPoint:[pdfView convertPoint:point toPage:page] fromPage:page]
toView:clipView];
[clipView scrollPoint:point];
[secondaryPdfView resetHistory];
@@ -1291,7 +1291,7 @@
[pdfView goToSelection:selection];
PDFPage *page = [selection safeFirstPage];
NSRect rect = [pdfView convertRect:[selection boundsForPage:page]
fromPage:page];
- NSView *clipView = [[pdfView scrollView] contentView];
+ NSView *clipView = [[pdfView embeddedScrollView] contentView];
NSRect visibleRect = [pdfView convertRect:[clipView visibleRect]
fromView:clipView];
visibleRect.origin.x = floor(NSMidX(rect) - 0.5 * NSWidth(visibleRect));
visibleRect.origin.y = ceil(NSMidY(rect) - 0.5 * NSHeight(visibleRect));
@@ -1309,7 +1309,7 @@
}
- (void)doScrollUp:(id)sender {
- NSScrollView *scrollView = [[self pdfView] scrollView];
+ NSScrollView *scrollView = [[self pdfView] embeddedScrollView];
NSClipView *clipView = [scrollView contentView];
NSPoint point = [clipView bounds].origin;
point.y += [clipView isFlipped] ? -4.0 * [scrollView verticalLineScroll] :
4.0 * [scrollView verticalLineScroll];
@@ -1317,7 +1317,7 @@
}
- (void)doScrollDown:(id)sender {
- NSScrollView *scrollView = [[self pdfView] scrollView];
+ NSScrollView *scrollView = [[self pdfView] embeddedScrollView];
NSClipView *clipView = [scrollView contentView];
NSPoint point = [clipView bounds].origin;
point.y += [clipView isFlipped] ? 4.0 * [scrollView verticalLineScroll] :
-4.0 * [scrollView verticalLineScroll];
@@ -1325,7 +1325,7 @@
}
- (void)doScrollRight:(id)sender {
- NSScrollView *scrollView = [[self pdfView] scrollView];
+ NSScrollView *scrollView = [[self pdfView] embeddedScrollView];
NSClipView *clipView = [scrollView contentView];
NSPoint point = [clipView bounds].origin;
point.x += + 4.0 * [scrollView horizontalLineScroll];
@@ -1333,7 +1333,7 @@
}
- (void)doScrollLeft:(id)sender {
- NSScrollView *scrollView = [[self pdfView] scrollView];
+ NSScrollView *scrollView = [[self pdfView] embeddedScrollView];
NSClipView *clipView = [scrollView contentView];
NSPoint point = [clipView bounds].origin;
point.x += -4.0 * [scrollView horizontalLineScroll];
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2026-01-04 18:31:47 UTC (rev 15956)
+++ trunk/SKPDFView.m 2026-01-04 22:28:04 UTC (rev 15957)
@@ -312,7 +312,7 @@
name:PDFViewPageChangedNotification object:self];
[nc addObserver:self selector:@selector(handleScaleChangedNotification:)
name:PDFViewScaleChangedNotification object:self];
- NSView *view = [[self scrollView] contentView];
+ NSView *view = [[self embeddedScrollView] contentView];
if (view)
[nc addObserver:self
selector:@selector(handleUpdateTrackingAreasNotification:)
name:NSViewDidUpdateTrackingAreasNotification object:view];
NSUserDefaults *sud = [NSUserDefaults standardUserDefaults];
@@ -610,7 +610,7 @@
- (NSColor *)backgroundColor {
if (@available(macOS 11.0, *)) {} else if (@available(macOS 10.15, *))
- return [super backgroundColor] ?: [[self scrollView] backgroundColor];
+ return [super backgroundColor] ?: [[self embeddedScrollView]
backgroundColor];
return [super backgroundColor];
}
@@ -1030,7 +1030,7 @@
}
- (void)doPacerScroll {
- NSScrollView *scrollView = [self scrollView];
+ NSScrollView *scrollView = [self embeddedScrollView];
NSClipView *clipView = [scrollView contentView];
NSRect bounds = [clipView bounds];
NSRect docRect = [[scrollView documentView] frame];
@@ -1534,7 +1534,7 @@
}
PDFDisplayMode mode = [self extendedDisplayMode];
if (mode != kPDFDisplaySinglePage) {
- NSScrollView *scrollView = [self scrollView];
+ NSScrollView *scrollView = [self embeddedScrollView];
NSClipView *clipView = [scrollView contentView];
NSRect bounds = [clipView bounds];
CGFloat inset = [clipView contentInsets].top;
@@ -3035,7 +3035,7 @@
- (void)zoomToRect:(NSRect)rect onPage:(PDFPage *)page {
if (NSIsEmptyRect(rect) == NO) {
- NSScrollView *scrollView = [self scrollView];
+ NSScrollView *scrollView = [self embeddedScrollView];
CGFloat scrollerWidth = [NSScroller effectiveScrollerWidth];
NSSize size = [self bounds].size;
CGFloat scale = 1.0;
Modified: trunk/SKSnapshotPDFView.m
===================================================================
--- trunk/SKSnapshotPDFView.m 2026-01-04 18:31:47 UTC (rev 15956)
+++ trunk/SKSnapshotPDFView.m 2026-01-04 22:28:04 UTC (rev 15957)
@@ -100,7 +100,7 @@
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handlePDFViewFrameChangedNotification:)
name:NSViewBoundsDidChangeNotification object:self];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handlePDFContentViewFrameChangedNotification:)
-
name:NSViewBoundsDidChangeNotification object:[[self scrollView] contentView]];
+
name:NSViewBoundsDidChangeNotification object:[[self embeddedScrollView]
contentView]];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handlePDFContentViewFrameChangedDelayedNotification:)
name:SKPDFContentViewChangedNotification object:self];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handlePDFViewScaleChangedNotification:)
Modified: trunk/SKSnapshotWindowController.m
===================================================================
--- trunk/SKSnapshotWindowController.m 2026-01-04 18:31:47 UTC (rev 15956)
+++ trunk/SKSnapshotWindowController.m 2026-01-04 22:28:04 UTC (rev 15957)
@@ -256,7 +256,7 @@
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleDocumentDidUnlockNotification:)
name:PDFDocumentDidUnlockNotification object:[pdfView document]];
- NSView *clipView = [[pdfView scrollView] contentView];
+ NSView *clipView = [[pdfView embeddedScrollView] contentView];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handlePDFViewFrameChangedNotification:)
name:NSViewFrameDidChangeNotification object:clipView];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handlePDFViewFrameChangedNotification:)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit