Revision: 14812
          http://sourceforge.net/p/skim-app/code/14812
Author:   hofman
Date:     2024-12-10 15:34:38 +0000 (Tue, 10 Dec 2024)
Log Message:
-----------
no need to implement displlay update methods in PDFView class

Modified Paths:
--------------
    trunk/PDFView_SKExtensions.h
    trunk/PDFView_SKExtensions.m
    trunk/SKMainWindowController.m
    trunk/SKMainWindowController_FullScreen.m
    trunk/SKMainWindowController_UI.m
    trunk/SKPDFView.h
    trunk/SKPDFView.m
    trunk/SKSnapshotWindowController.m

Modified: trunk/PDFView_SKExtensions.h
===================================================================
--- trunk/PDFView_SKExtensions.h        2024-12-10 15:14:29 UTC (rev 14811)
+++ trunk/PDFView_SKExtensions.h        2024-12-10 15:34:38 UTC (rev 14812)
@@ -56,11 +56,9 @@
 
 - (BOOL)isPageAtIndexDisplayed:(NSUInteger)pageIndex;
 
-- (void)setNeedsDisplayInRect:(NSRect)rect ofPage:(PDFPage *)page;
 - (void)updatedAnnotation:(PDFAnnotation *)annotation;
 - (void)addedAnnotation:(PDFAnnotation *)annotation onPage:(PDFPage *)page;
 - (void)removedAnnotation:(PDFAnnotation *)annotation onPage:(PDFPage *)page;
-- (void)requiresDisplay;
 
 - (void)doPdfsyncWithEvent:(NSEvent *)theEvent;
 - (void)doDragWithEvent:(NSEvent *)theEvent;

Modified: trunk/PDFView_SKExtensions.m
===================================================================
--- trunk/PDFView_SKExtensions.m        2024-12-10 15:14:29 UTC (rev 14811)
+++ trunk/PDFView_SKExtensions.m        2024-12-10 15:34:38 UTC (rev 14812)
@@ -104,23 +104,10 @@
     return nil;
 }
 
-- (void)setNeedsDisplayInRect:(NSRect)rect ofPage:(PDFPage *)page {
-    if ([self isPageAtIndexDisplayed:[page pageIndex]]) {
-        rect = NSIntegralRect([self convertRect:NSInsetRect(rect, -1.0, -1.0) 
fromPage:page]);
-        rect = NSIntersectionRect([self bounds], [self convertRect:rect 
toView:self]);
-        if (NSIsEmptyRect(rect) == NO)
-            [self setNeedsDisplayInRect:rect];
-    }
-}
-
 - (void)updatedAnnotation:(PDFAnnotation *)annotation {
     [[self safePageViewForPage:[annotation page]] updateAnnotation:annotation];
 }
 
-- (void)requiresDisplay {
-    [self setNeedsDisplay:YES];
-}
-
 - (void)addedAnnotation:(PDFAnnotation *)annotation onPage:(PDFPage *)page {
     [[self safePageViewForPage:page] addAnnotation:annotation];
 }

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2024-12-10 15:14:29 UTC (rev 14811)
+++ trunk/SKMainWindowController.m      2024-12-10 15:34:38 UTC (rev 14812)
@@ -2100,7 +2100,7 @@
         for (SKSnapshotWindowController *wc in snapshots) {
             if ([wc isPageVisible:page]) {
                 [self snapshotNeedsUpdate:wc placeholder:NO];
-                [[wc pdfView] requiresDisplay];
+                [[wc pdfView] setNeedsDisplay:YES];
             }
         }
         if (displayChanged)
@@ -2112,7 +2112,7 @@
             [self allThumbnailsNeedUpdate];
     }
     
-    [secondaryPdfView requiresDisplay];
+    [secondaryPdfView setNeedsDisplay:YES];
     
     if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisplayPageBoundsKey])
         [self updateRightStatus];
@@ -2572,7 +2572,7 @@
             [pdfView setInterpolationQuality:[[NSUserDefaults 
standardUserDefaults] integerForKey:SKInterpolationQualityKey]];
             [secondaryPdfView setInterpolationQuality:[[NSUserDefaults 
standardUserDefaults] integerForKey:SKInterpolationQualityKey]];
             [pdfView requiresDisplay];
-            [secondaryPdfView requiresDisplay];
+            [secondaryPdfView setNeedsDisplay:YES];
             [self allThumbnailsNeedUpdate];
         } else if ([keyPath isEqualToString:SKTableFontSizeKey]) {
             [self updateTableFont];

Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m   2024-12-10 15:14:29 UTC (rev 
14811)
+++ trunk/SKMainWindowController_FullScreen.m   2024-12-10 15:34:38 UTC (rev 
14812)
@@ -467,7 +467,7 @@
         [pdfView setExtendedDisplayModeAndRewind:mode];
     
     [pdfView layoutDocumentView];
-    [pdfView requiresDisplay];
+    [pdfView setNeedsDisplay:YES];
     
     if (mwcFlags.thumbnailsNeedUpdateAfterPresentaton) {
         mwcFlags.thumbnailsNeedUpdateAfterPresentaton = 0;

Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m   2024-12-10 15:14:29 UTC (rev 14811)
+++ trunk/SKMainWindowController_UI.m   2024-12-10 15:34:38 UTC (rev 14812)
@@ -271,7 +271,7 @@
             [sideWindow setFrame:frame display:YES];
         }
         [pdfView layoutDocumentView];
-        [pdfView requiresDisplay];
+        [pdfView setNeedsDisplay:YES];
     }
 }
 
@@ -282,7 +282,7 @@
         if (NSEqualRects(screenFrame, [[self window] frame]) == NO) {
             [[self window] setFrame:screenFrame display:NO];
             [pdfView layoutDocumentView];
-            [pdfView requiresDisplay];
+            [pdfView setNeedsDisplay:YES];
         }
     } else if ([[notification object] isEqual:[self window]] && [self 
interactionMode] == SKPresentationMode) {
         if (sideWindow) {

Modified: trunk/SKPDFView.h
===================================================================
--- trunk/SKPDFView.h   2024-12-10 15:14:29 UTC (rev 14811)
+++ trunk/SKPDFView.h   2024-12-10 15:34:38 UTC (rev 14812)
@@ -258,6 +258,9 @@
 
 - (void)updatedAnnotation:(PDFAnnotation *)annotation forKey:(nullable 
NSString *)key fromValue:(nullable id)oldValue;
 
+- (void)requiresDisplay;
+- (void)setNeedsDisplayInRect:(NSRect)rect ofPage:(PDFPage *)page;
+
 @end
 
 NS_ASSUME_NONNULL_END

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2024-12-10 15:14:29 UTC (rev 14811)
+++ trunk/SKPDFView.m   2024-12-10 15:34:38 UTC (rev 14812)
@@ -850,7 +850,7 @@
 - (void)setCurrentSelectionRect:(NSRect)rect {
     if (toolMode == SKToolModeSelect) {
         if (NSEqualRects(selectionRect, rect) == NO)
-            [self requiresDisplay];
+            [self setNeedsDisplay:YES];
         @synchronized (self) {
             if (NSIsEmptyRect(rect)) {
                 selectionRect = NSZeroRect;
@@ -871,7 +871,7 @@
 - (void)setCurrentSelectionPage:(PDFPage *)page {
     if (toolMode == SKToolModeSelect) {
         if (selectionPageIndex != [page pageIndex] || (page == nil && 
selectionPageIndex != NSNotFound))
-            [self requiresDisplay];
+            [self setNeedsDisplay:YES];
         @synchronized (self) {
             if (page == nil) {
                 selectionPageIndex = NSNotFound;
@@ -894,7 +894,6 @@
         hideNotes = flag;
         if (hideNotes)
             [self setCurrentAnnotation:nil];
-        [self requiresDisplay];
     }
 }
 
@@ -1364,7 +1363,7 @@
             selectionPageIndex = [page pageIndex];
         }
         [[NSNotificationCenter defaultCenter] 
postNotificationName:SKPDFViewSelectionChangedNotification object:self];
-        [self requiresDisplay];
+        [self setNeedsDisplay:YES];
     }
 }
 
@@ -2859,13 +2858,18 @@
 }
 
 - (void)requiresDisplay {
-    [super requiresDisplay];
+    [self setNeedsDisplay:YES];
     [loupeController updateContents];
 }
 
 - (void)setNeedsDisplayInRect:(NSRect)rect ofPage:(PDFPage *)page {
-    [super setNeedsDisplayInRect:rect ofPage:page];
-    [loupeController updateContents];
+    if ([self isPageAtIndexDisplayed:[page pageIndex]]) {
+        rect = NSIntegralRect([self convertRect:NSInsetRect(rect, -1.0, -1.0) 
fromPage:page]);
+        rect = NSIntersectionRect([self bounds], [self convertRect:rect 
toView:self]);
+        if (NSIsEmptyRect(rect) == NO)
+            [self setNeedsDisplayInRect:rect];
+        [loupeController updateContents];
+    }
 }
 
 #pragma mark Sync
@@ -4347,7 +4351,7 @@
         selectionRect.size = NSZeroSize;
         resizeHandle = SKMaxXEdgeMask | SKMinYEdgeMask;
         if (didSelect)
-            [self requiresDisplay];
+            [self setNeedsDisplay:YES];
     }
     
        NSRect initialRect = selectionRect;
@@ -4480,7 +4484,7 @@
             for (PDFPage *p in [self displayedPages])
                 [self setNeedsDisplayInRect:dirtyRect ofPage:p];
         } else {
-            [self requiresDisplay];
+            [self setNeedsDisplay:YES];
             didSelect = YES;
         }
         @synchronized (self) {
@@ -4495,7 +4499,7 @@
             selectionPageIndex = NSNotFound;
         }
         [[NSNotificationCenter defaultCenter] 
postNotificationName:SKPDFViewSelectionChangedNotification object:self];
-        [self requiresDisplay];
+        [self setNeedsDisplay:YES];
     } else if (resizeHandle) {
         [self setNeedsDisplayInRect:NSInsetRect(selectionRect, -margin, 
-margin) ofPage:page];
     }

Modified: trunk/SKSnapshotWindowController.m
===================================================================
--- trunk/SKSnapshotWindowController.m  2024-12-10 15:14:29 UTC (rev 14811)
+++ trunk/SKSnapshotWindowController.m  2024-12-10 15:34:38 UTC (rev 14812)
@@ -707,7 +707,7 @@
                 [self updateWindowLevel];
         } else if ([keyPath isEqualToString:SKInterpolationQualityKey]) {
             [pdfView setInterpolationQuality:[[NSUserDefaults 
standardUserDefaults] integerForKey:SKInterpolationQualityKey]];
-            [pdfView requiresDisplay];
+            [pdfView setNeedsDisplay:YES];
             if ([[self delegate] 
respondsToSelector:@selector(snapshotControllerDidChange:)])
                 [[self delegate] snapshotControllerDidChange:self];
         }

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

Reply via email to