Revision: 14802
          http://sourceforge.net/p/skim-app/code/14802
Author:   hofman
Date:     2024-12-09 16:37:43 +0000 (Mon, 09 Dec 2024)
Log Message:
-----------
Keep page view private by using super

Modified Paths:
--------------
    trunk/PDFView_SKExtensions.h
    trunk/PDFView_SKExtensions.m
    trunk/SKPDFView.m

Modified: trunk/PDFView_SKExtensions.h
===================================================================
--- trunk/PDFView_SKExtensions.h        2024-12-09 15:52:27 UTC (rev 14801)
+++ trunk/PDFView_SKExtensions.h        2024-12-09 16:37:43 UTC (rev 14802)
@@ -47,12 +47,6 @@
     NSPoint point;
 } SKDestination;
 
-@protocol SKPDFPageView
-- (void)addAnnotation:(PDFAnnotation *)annotation;
-- (void)updateAnnotation:(PDFAnnotation *)annotation;
-- (void)removeAnnotation:(PDFAnnotation *)annotation;
-@end
-
 @interface PDFView (SKExtensions) <NSDraggingSource>
 
 @property (nonatomic) CGFloat physicalScaleFactor;
@@ -84,8 +78,6 @@
 @property (class, nonatomic, readonly) NSColor *defaultBackgroundColor;
 @property (class, nonatomic, readonly) NSColor 
*defaultFullScreenBackgroundColor;
 
-- (nullable NSView<SKPDFPageView> *)safePageViewForPage:(PDFPage *)page;
-
 @end
 
 

Modified: trunk/PDFView_SKExtensions.m
===================================================================
--- trunk/PDFView_SKExtensions.m        2024-12-09 15:52:27 UTC (rev 14801)
+++ trunk/PDFView_SKExtensions.m        2024-12-09 16:37:43 UTC (rev 14802)
@@ -58,6 +58,12 @@
 - (id)pageViewForPageAtIndex:(NSUInteger)index;
 @end
 
+@interface NSView (SKPrivatePageViewDeclarations)
+- (void)addAnnotation:(PDFAnnotation *)annotation;
+- (void)updateAnnotation:(PDFAnnotation *)annotation;
+- (void)removeAnnotation:(PDFAnnotation *)annotation;
+@end
+
 #define PAGE_BREAK_MARGIN 4.0
 
 @implementation PDFView (SKExtensions)
@@ -89,7 +95,7 @@
     return [self descendantOfClass:[NSScrollView class]];
 }
 
-- (NSView<SKPDFPageView> *)safePageViewForPage:(PDFPage *)page {
+- (NSView *)safePageViewForPage:(PDFPage *)page {
     if ([self respondsToSelector:@selector(pageViewForPageAtIndex:)] == NO)
         return nil;
     id pageView = [self pageViewForPageAtIndex:[page pageIndex]];

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2024-12-09 15:52:27 UTC (rev 14801)
+++ trunk/SKPDFView.m   2024-12-09 16:37:43 UTC (rev 14802)
@@ -2836,8 +2836,9 @@
 
 - (void)updatedAnnotation:(PDFAnnotation *)annotation forKey:(NSString *)key 
fromRect:(NSRect)oldRect {
     BOOL updateHighlight = key == nil || [key 
isEqualToString:SKNPDFAnnotationBoundsKey] || [key 
isEqualToString:SKNPDFAnnotationDrawsImageKey];
+    // these properties don't notify automatically because they don't use the 
annotationValue
     if ([annotation isNote] && ([key isEqualToString:SKNPDFAnnotationImageKey] 
|| [key isEqualToString:SKNPDFAnnotationDrawsImageKey]))
-        [[self safePageViewForPage:[annotation page]] 
updateAnnotation:annotation];
+        [super updatedAnnotation:annotation];
     if (updateHighlight && annotation == currentAnnotation && 
atomic_load(&highlightLayerState) != SKLayerUse) {
         PDFPage *page = [annotation page];
         CGFloat margin = (([annotation isResizable] || [annotation isNote]) ? 
HANDLE_SIZE  : 1.0) / [self scaleFactor];

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to