Revision: 16541
http://sourceforge.net/p/skim-app/code/16541
Author: hofman
Date: 2026-09-26 21:56:13 +0000 (Sat, 26 Sep 2026)
Log Message:
-----------
use PDFAnnotation class to implement Skim notes rather than legacy subclasses
Modified Paths:
--------------
trunk/PDFAnnotation_SKExtensions.m
Modified: trunk/PDFAnnotation_SKExtensions.m
===================================================================
--- trunk/PDFAnnotation_SKExtensions.m 2026-09-26 21:53:29 UTC (rev 16540)
+++ trunk/PDFAnnotation_SKExtensions.m 2026-09-26 21:56:13 UTC (rev 16541)
@@ -234,25 +234,10 @@
}
static inline Class SKAnnotationClassForType(NSString *type) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if ([type isEqualToString:SKNNoteString] || [type
isEqualToString:SKNTextString] || [type isEqualToString:SKNStampString])
return [SKNPDFAnnotationNote class];
- else if ([type isEqualToString:SKNFreeTextString])
- return [PDFAnnotationFreeText class];
- else if ([type isEqualToString:SKNCircleString])
- return [PDFAnnotationCircle class];
- else if ([type isEqualToString:SKNSquareString])
- return [PDFAnnotationSquare class];
- else if ([type isEqualToString:SKNHighlightString] || [type
isEqualToString:SKNUnderlineString] || [type
isEqualToString:SKNStrikeOutString] || [type isEqualToString:SKNMarkUpString])
- return [PDFAnnotationMarkup class];
- else if ([type isEqualToString:SKNLineString])
- return [PDFAnnotationLine class];
- else if ([type isEqualToString:SKNInkString])
- return [PDFAnnotationInk class];
else
- return Nil;
-#pragma clang diagnostic pop
+ return [PDFAnnotation class];
}
+ (PDFAnnotation *)newSkimNoteWithBounds:(NSRect)bounds forType:(NSString
*)type {
@@ -285,15 +270,15 @@
}
if (lines == nil)
return nil;
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- PDFAnnotation *annotation = [[PDFAnnotationMarkup alloc]
initSkimNoteWithBounds:bounds forType:type];
-#pragma clang diagnostic pop
+
+ PDFAnnotation *annotation = [[PDFAnnotation alloc]
initSkimNoteWithBounds:bounds forType:type];
+
if (annotation) {
NSArray *quadPoints = quadPointsForLineRects(lines, bounds.origin,
[page lineDirectionAngle] / 90);
[annotation setQuadrilateralPoints:quadPoints];
objc_setAssociatedObject(annotation, &SKLineRectsKey, lines,
OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
+
return annotation;
}
@@ -306,12 +291,11 @@
bounds = NSInsetRect(NSIntegralRect(bounds), -8.0, -8.0);
[transform translateXBy:-NSMinX(bounds) yBy:-NSMinY(bounds)];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- PDFAnnotation *annotation = [[PDFAnnotationInk alloc]
initSkimNoteWithBounds:bounds forType:SKNInkString];
-#pragma clang diagnostic pop
+ PDFAnnotation *annotation = [[PDFAnnotation alloc]
initSkimNoteWithBounds:bounds forType:SKNInkString];
+
for (NSBezierPath *path in paths)
[annotation addBezierPath:[transform transformBezierPath:path]];
+
return annotation;
}
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