Revision: 13712
http://sourceforge.net/p/skim-app/code/13712
Author: hofman
Date: 2023-11-01 16:21:22 +0000 (Wed, 01 Nov 2023)
Log Message:
-----------
Set deployment target to 10.13, to be compatible with Xcode 14. Remove some
typeing to avoid deprecation warnings, implement some methods on PDFAnnotation
to avoid warnings, and use some new names for constants.
Modified Paths:
--------------
trunk/Configurations/Skim-Common.xcconfig
trunk/PDFAnnotationInk_SKExtensions.h
trunk/PDFAnnotationInk_SKExtensions.m
trunk/PDFAnnotationLine_SKExtensions.h
trunk/PDFAnnotationLine_SKExtensions.m
trunk/PDFAnnotation_SKExtensions.h
trunk/PDFAnnotation_SKExtensions.m
trunk/PDFPage_SKExtensions.m
trunk/QuickLook-Skim/GenerateThumbnailForURL.m
trunk/SKBasePDFView.m
trunk/SKColorSwatch.m
trunk/SKFindController.m
trunk/SKLineInspector.m
trunk/SKLoupeController.m
trunk/SKMainWindowController.m
trunk/SKMainWindowController_Actions.m
trunk/SKMainWindowController_UI.m
trunk/SKNPDFAnnotationNote_SKExtensions.m
trunk/SKNoteWindowController.m
trunk/SKPDFView.m
trunk/SKPresentationOptionsSheetController.m
trunk/SKRightSideViewController.m
trunk/SKTextNoteEditor.h
trunk/SKTextNoteEditor.m
Modified: trunk/Configurations/Skim-Common.xcconfig
===================================================================
--- trunk/Configurations/Skim-Common.xcconfig 2023-10-31 15:55:03 UTC (rev
13711)
+++ trunk/Configurations/Skim-Common.xcconfig 2023-11-01 16:21:22 UTC (rev
13712)
@@ -1,7 +1,7 @@
SDKROOT = macosx
DEBUG_INFORMATION_FORMAT = dwarf
ARCHS = $(ARCHS_STANDARD)
-MACOSX_DEPLOYMENT_TARGET = 10.10
+MACOSX_DEPLOYMENT_TARGET = 10.13
COPY_PHASE_STRIP = NO
STRIP_INSTALLED_PRODUCT = NO
Modified: trunk/PDFAnnotationInk_SKExtensions.h
===================================================================
--- trunk/PDFAnnotationInk_SKExtensions.h 2023-10-31 15:55:03 UTC (rev
13711)
+++ trunk/PDFAnnotationInk_SKExtensions.h 2023-11-01 16:21:22 UTC (rev
13712)
@@ -44,11 +44,4 @@
@interface PDFAnnotationInk (SKExtensions)
-- (CGFloat)pathInset;
-
-- (NSArray *)bezierPaths;
-- (void)setBezierPaths:(NSArray *)newPaths;
-
-- (NSArray *)pagePaths;
-
@end
Modified: trunk/PDFAnnotationInk_SKExtensions.m
===================================================================
--- trunk/PDFAnnotationInk_SKExtensions.m 2023-10-31 15:55:03 UTC (rev
13711)
+++ trunk/PDFAnnotationInk_SKExtensions.m 2023-11-01 16:21:22 UTC (rev
13712)
@@ -113,38 +113,6 @@
[border release];
}
-- (CGFloat)pathInset {
- NSRect bounds = NSZeroRect;
- NSSize size = [self bounds].size;
- for (NSBezierPath *path in [self paths])
- bounds = NSUnionRect(bounds, [path nonEmptyBounds]);
- return floor(fmin(8.0, fmax(0.0, fmin(NSMinX(bounds), fmin(NSMinY(bounds),
fmin(size.width - NSMaxX(bounds), size.height - NSMaxY(bounds)))))));
-}
-
-// use a copy of the paths so to ensure different old and new values for undo
-- (NSArray *)bezierPaths {
- return [[[self paths] copy] autorelease];
-}
-
-- (void)setBezierPaths:(NSArray *)newPaths {
- NSArray *paths = [[self paths] copy];
- NSBezierPath *path;
- for (path in paths)
- [self removeBezierPath:path];
- [paths release];
- for (path in newPaths)
- [self addBezierPath:path];
-}
-
-- (NSArray *)pagePaths {
- NSMutableArray *paths = [[[NSMutableArray alloc] initWithArray:[self
paths] copyItems:YES] autorelease];
- NSRect bounds = [self bounds];
- NSAffineTransform *transform = [NSAffineTransform transform];
- [transform translateXBy:NSMinX(bounds) yBy:NSMinY(bounds)];
- [paths
makeObjectsPerformSelector:@selector(transformUsingAffineTransform:)
withObject:transform];
- return paths;
-}
-
- (NSString *)fdfString {
NSMutableString *fdfString = [[[super fdfString] mutableCopy] autorelease];
NSPoint point;
Modified: trunk/PDFAnnotationLine_SKExtensions.h
===================================================================
--- trunk/PDFAnnotationLine_SKExtensions.h 2023-10-31 15:55:03 UTC (rev
13711)
+++ trunk/PDFAnnotationLine_SKExtensions.h 2023-11-01 16:21:22 UTC (rev
13712)
@@ -50,11 +50,6 @@
@interface PDFAnnotationLine (SKExtensions)
-- (NSPoint)observedStartPoint;
-- (void)setObservedStartPoint:(NSPoint)point;
-- (NSPoint)observedEndPoint;
-- (void)setObservedEndPoint:(NSPoint)point;
-
- (void)setStartPointAsQDPoint:(NSData *)inQDPointAsData;
- (void)setEndPointAsQDPoint:(NSData *)inQDPointAsData;
- (void)setScriptingStartLineStyle:(PDFLineStyle)style;
Modified: trunk/PDFAnnotationLine_SKExtensions.m
===================================================================
--- trunk/PDFAnnotationLine_SKExtensions.m 2023-10-31 15:55:03 UTC (rev
13711)
+++ trunk/PDFAnnotationLine_SKExtensions.m 2023-11-01 16:21:22 UTC (rev
13712)
@@ -197,22 +197,6 @@
return fdfString;
}
-- (NSPoint)observedStartPoint {
- return [self startPoint];
-}
-
-- (void)setObservedStartPoint:(NSPoint)point {
- [self setStartPoint:point];
-}
-
-- (NSPoint)observedEndPoint {
- return [self endPoint];
-}
-
-- (void)setObservedEndPoint:(NSPoint)point {
- [self setEndPoint:point];
-}
-
- (BOOL)isLine { return YES; }
- (BOOL)isWidget { return NO; }
Modified: trunk/PDFAnnotation_SKExtensions.h
===================================================================
--- trunk/PDFAnnotation_SKExtensions.h 2023-10-31 15:55:03 UTC (rev 13711)
+++ trunk/PDFAnnotation_SKExtensions.h 2023-11-01 16:21:22 UTC (rev 13712)
@@ -79,6 +79,18 @@
- (NSArray *)dashPattern;
- (void)setDashPattern:(NSArray *)pattern;
+- (NSPoint)observedStartPoint;
+- (void)setObservedStartPoint:(NSPoint)point;
+- (NSPoint)observedEndPoint;
+- (void)setObservedEndPoint:(NSPoint)point;
+
+- (CGFloat)pathInset;
+
+- (NSArray *)bezierPaths;
+- (void)setBezierPaths:(NSArray *)newPaths;
+
+- (NSArray *)pagePaths;
+
- (NSImage *)image;
- (NSAttributedString *)text;
Modified: trunk/PDFAnnotation_SKExtensions.m
===================================================================
--- trunk/PDFAnnotation_SKExtensions.m 2023-10-31 15:55:03 UTC (rev 13711)
+++ trunk/PDFAnnotation_SKExtensions.m 2023-11-01 16:21:22 UTC (rev 13712)
@@ -133,7 +133,10 @@
[propertyList isKindOfClass:[NSData class]]) {
self = [self initSkimNoteWithProperties:[NSKeyedUnarchiver
unarchiveObjectWithData:propertyList]];
} else {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[[self initWithBounds:NSZeroRect] release];
+#pragma clang diagnostic pop
self = nil;
}
return self;
@@ -216,7 +219,7 @@
PDFAnnotation *annotation = [[PDFAnnotationInk alloc]
initSkimNoteWithBounds:bounds forType:SKNInkString];
#pragma clang diagnostic pop
for (path in paths)
- [(PDFAnnotationInk *)annotation addBezierPath:[transform
transformBezierPath:path]];
+ [annotation addBezierPath:[transform transformBezierPath:path]];
return annotation;
}
@@ -304,78 +307,11 @@
}
- (PDFDestination *)linkDestination {
- if ([self respondsToSelector:@selector(destination)]) {
- return [(PDFAnnotationLink *)self destination];
- } else if ([self isLink] && [self
respondsToSelector:@selector(valueForAnnotationKey:)]) {
- id dest = nil;
- id action = [self valueForAnnotationKey:@"/A"];
- if ([action isKindOfClass:[PDFActionGoTo class]]) {
- dest = [(PDFActionGoTo *)action destination];
- } else if ([action isKindOfClass:[NSDictionary class]]) {
- if ([[action objectForKey:@"/S"] isEqualToString:@"/GoTo"])
- dest = [action objectForKey:@"/D"];
- } else {
- dest = [self valueForAnnotationKey:@"/Dest"];
- }
- if ([dest isKindOfClass:[PDFDestination class]]) {
- return dest;
- } else if ([dest isKindOfClass:[NSArray class]] && [dest count] > 1) {
- PDFPage *page = [dest objectAtIndex:0];
- if ([page isKindOfClass:[PDFPage class]]) {
- NSPoint point;
- NSString *type = [dest objectAtIndex:1];
- if ([type isEqualToString:@"/XYZ"] && [dest count] > 3)
- point = NSMakePoint([[dest objectAtIndex:2] doubleValue],
[[dest objectAtIndex:3] doubleValue]);
- else if ([page rotation] == 0)
- point = SKTopLeftPoint([page
boundsForBox:kPDFDisplayBoxCropBox]);
- else if ([page rotation] == 90)
- point = SKBottomLeftPoint([page
boundsForBox:kPDFDisplayBoxCropBox]);
- else if ([page rotation] == 180)
- point = SKBottomRightPoint([page
boundsForBox:kPDFDisplayBoxCropBox]);
- else
- point = SKTopRightPoint([page
boundsForBox:kPDFDisplayBoxCropBox]);
- return [[[PDFDestination alloc] initWithPage:page
atPoint:point] autorelease];
- }
- }
- }
- return nil;
+ return [self destination];
}
- (NSURL *)linkURL {
- if ([self respondsToSelector:@selector(URL)]) {
- return [(PDFAnnotationLink *)self URL];
- } else if ([self isLink] && [self
respondsToSelector:@selector(valueForAnnotationKey:)]) {
- id action = [self valueForAnnotationKey:@"/A"];
- if ([action isKindOfClass:[PDFActionURL class]]) {
- return [(PDFActionURL *)action URL];
- } else if ([action isKindOfClass:[PDFActionRemoteGoTo class]]) {
- return [(PDFActionRemoteGoTo *)action URL];
- } else if ([action isKindOfClass:[NSDictionary class]]) {
- NSString *type = [action objectForKey:@"/S"];
- if ([type isEqualToString:@"/URI"]) {
- id uri = [action objectForKey:@"/URI"];
- if ([uri isKindOfClass:[NSURL class]])
- return (NSURL *)uri;
- else if ([uri isKindOfClass:[NSString class]])
- return [NSURL URLWithString:(NSString *)uri];
- } else if ([type isEqualToString:@"/GoToR"]) {
- id file = [action objectForKey:@"/F"];
- if ([file isKindOfClass:[NSDictionary class]])
- file = [(NSDictionary *)file objectForKey:@"/Unix"] ?:
[(NSDictionary *)file objectForKey:@"/F"];
- if ([file isKindOfClass:[NSURL class]]) {
- return (NSURL *)file;
- } else if ([file isKindOfClass:[NSString class]]) {
- if ([file rangeOfString:@"://"].location != NSNotFound)
- return [NSURL URLWithString:file];
- else if ([file isAbsolutePath])
- return [NSURL fileURLWithPath:file];
- else
- return [NSURL URLWithString:file
relativeToURL:[[[[self page] document] documentURL]
URLByDeletingLastPathComponent]];
- }
- }
- }
- }
- return nil;
+ return [self URL];
}
- (NSUInteger)pageIndex {
@@ -454,6 +390,54 @@
}
}
+- (NSPoint)observedStartPoint {
+ return [self startPoint];
+}
+
+- (void)setObservedStartPoint:(NSPoint)point {
+ [self setStartPoint:point];
+}
+
+- (NSPoint)observedEndPoint {
+ return [self endPoint];
+}
+
+- (void)setObservedEndPoint:(NSPoint)point {
+ [self setEndPoint:point];
+}
+
+- (CGFloat)pathInset {
+ NSRect bounds = NSZeroRect;
+ NSSize size = [self bounds].size;
+ for (NSBezierPath *path in [self paths])
+ bounds = NSUnionRect(bounds, [path nonEmptyBounds]);
+ return floor(fmin(8.0, fmax(0.0, fmin(NSMinX(bounds), fmin(NSMinY(bounds),
fmin(size.width - NSMaxX(bounds), size.height - NSMaxY(bounds)))))));
+}
+
+// use a copy of the paths so to ensure different old and new values for undo
+- (NSArray *)bezierPaths {
+ return [[[self paths] copy] autorelease];
+}
+
+- (void)setBezierPaths:(NSArray *)newPaths {
+ NSArray *paths = [[self paths] copy];
+ NSBezierPath *path;
+ for (path in paths)
+ [self removeBezierPath:path];
+ [paths release];
+ for (path in newPaths)
+ [self addBezierPath:path];
+}
+
+- (NSArray *)pagePaths {
+ NSMutableArray *paths = [[[NSMutableArray alloc] initWithArray:[self
paths] copyItems:YES] autorelease];
+ NSRect bounds = [self bounds];
+ NSAffineTransform *transform = [NSAffineTransform transform];
+ [transform translateXBy:NSMinX(bounds) yBy:NSMinY(bounds)];
+ [paths
makeObjectsPerformSelector:@selector(transformUsingAffineTransform:)
withObject:transform];
+ return paths;
+}
+
- (NSImage *)image { return nil; }
- (NSAttributedString *)text { return nil; }
Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m 2023-10-31 15:55:03 UTC (rev 13711)
+++ trunk/PDFPage_SKExtensions.m 2023-11-01 16:21:22 UTC (rev 13712)
@@ -118,23 +118,19 @@
bytesPerRow:0
bitsPerPixel:32];
if (imageRep) {
- [NSGraphicsContext saveGraphicsState];
- [NSGraphicsContext setCurrentContext:[NSGraphicsContext
graphicsContextWithBitmapImageRep:imageRep]];
- [[NSGraphicsContext currentContext]
setImageInterpolation:NSImageInterpolationNone];
- [[NSGraphicsContext currentContext] setShouldAntialias:NO];
+ CGContextRef context = [[NSGraphicsContext
graphicsContextWithBitmapImageRep:imageRep] CGContext];
+ CGContextSetInterpolationQuality(context, kCGInterpolationNone);
+ CGContextSetShouldAntialias(context, false);
if ([self rotation]) {
- NSAffineTransform *transform = [NSAffineTransform transform];
switch ([self rotation]) {
- case 90: [transform translateXBy:NSWidth(bounds) yBy:0.0];
break;
- case 180: [transform translateXBy:NSHeight(bounds)
yBy:NSWidth(bounds)]; break;
- case 270: [transform translateXBy:0.0 yBy:NSHeight(bounds)];
break;
+ case 90: CGContextTranslateCTM(context, NSWidth(bounds),
0.0); break;
+ case 180: CGContextTranslateCTM(context, NSHeight(bounds),
NSWidth(bounds)); break;
+ case 270: CGContextTranslateCTM(context, 0.0,
NSHeight(bounds)); break;
}
- [transform rotateByDegrees:[self rotation]];
- [transform concat];
+ CGContextRotateCTM(context, [self rotation] * M_PI / 180.0);
}
- [self drawWithBox:box];
- [[NSGraphicsContext currentContext]
setImageInterpolation:NSImageInterpolationDefault];
- [NSGraphicsContext restoreGraphicsState];
+ [self drawWithBox:box toContext:context];
+ CGContextSetInterpolationQuality(context, kCGInterpolationDefault);
}
return imageRep;
}
@@ -231,7 +227,7 @@
[transform concat];
}
- [self drawWithBox:box];
+ [self drawWithBox:box toContext:[[NSGraphicsContext currentContext]
CGContext]];
for (id highlight in highlights) {
// highlight should be a PDFSelection or SKReadingBar
Modified: trunk/QuickLook-Skim/GenerateThumbnailForURL.m
===================================================================
--- trunk/QuickLook-Skim/GenerateThumbnailForURL.m 2023-10-31 15:55:03 UTC
(rev 13711)
+++ trunk/QuickLook-Skim/GenerateThumbnailForURL.m 2023-11-01 16:21:22 UTC
(rev 13712)
@@ -51,13 +51,13 @@
{
[[NSColor whiteColor] setFill];
NSRect pageRect = { NSZeroPoint, _paperSize };
- NSRectFillUsingOperation(pageRect, NSCompositeSourceOver);
+ NSRectFillUsingOperation(pageRect, NSCompositingOperationSourceOver);
NSURL *iconURL = (NSURL
*)CFBundleCopyResourceURL(QLThumbnailRequestGetGeneratorBundle(thumbnail),
CFSTR("Skim"), CFSTR("icns"), NULL);
NSImage *appIcon = [[NSImage alloc] initWithContentsOfFile:[iconURL path]];
[iconURL release];
- [appIcon drawInRect:_iconRect fromRect:NSZeroRect
operation:NSCompositeSourceOver fraction:0.3];
+ [appIcon drawInRect:_iconRect fromRect:NSZeroRect
operation:NSCompositingOperationSourceOver fraction:0.3];
[appIcon release];
}
Modified: trunk/SKBasePDFView.m
===================================================================
--- trunk/SKBasePDFView.m 2023-10-31 15:55:03 UTC (rev 13711)
+++ trunk/SKBasePDFView.m 2023-11-01 16:21:22 UTC (rev 13712)
@@ -416,7 +416,10 @@
PDFDisplayBox *box = [self displayBox];
CGFloat scale = [self scaleFactor];
CGContextSetInterpolationQuality(context, [self interpolationQuality] + 1);
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
CGContextSetShouldAntialias(context, [self shouldAntiAlias]);
+#pragma clang diagnostic pop
for (PDFPage *page in [self visiblePages]) {
NSRect pageRect = [self convertRect:[page boundsForBox:box]
fromPage:page];
if (NSIntersectsRect(pageRect, rect) == NO) continue;
Modified: trunk/SKColorSwatch.m
===================================================================
--- trunk/SKColorSwatch.m 2023-10-31 15:55:03 UTC (rev 13711)
+++ trunk/SKColorSwatch.m 2023-11-01 16:21:22 UTC (rev 13712)
@@ -130,7 +130,7 @@
bezelHeight = 22.0;
- [self registerForDraggedTypes:[NSColor
readableTypesForPasteboard:[NSPasteboard pasteboardWithName:NSDragPboard]]];
+ [self registerForDraggedTypes:[NSColor
readableTypesForPasteboard:[NSPasteboard
pasteboardWithName:NSPasteboardNameDrag]]];
}
- (id)initWithFrame:(NSRect)frame {
Modified: trunk/SKFindController.m
===================================================================
--- trunk/SKFindController.m 2023-10-31 15:55:03 UTC (rev 13711)
+++ trunk/SKFindController.m 2023-11-01 16:21:22 UTC (rev 13712)
@@ -80,7 +80,7 @@
}
- (void)windowDidBecomeKey:(NSNotification *)notification {
- NSPasteboard *findPboard = [NSPasteboard pasteboardWithName:NSFindPboard];
+ NSPasteboard *findPboard = [NSPasteboard
pasteboardWithName:NSPasteboardNameFind];
if (lastChangeCount < [findPboard changeCount]) {
NSArray *strings = [findPboard readObjectsForClasses:@[[NSString
class]] options:@{}];
if ([strings count] > 0) {
@@ -97,7 +97,7 @@
- (void)updateFindPboard {
if (didChange) {
- NSPasteboard *findPboard = [NSPasteboard
pasteboardWithName:NSFindPboard];
+ NSPasteboard *findPboard = [NSPasteboard
pasteboardWithName:NSPasteboardNameFind];
[findPboard clearContents];
[findPboard writeObjects:@[(findString ?: @"")]];
lastChangeCount = [findPboard changeCount];
Modified: trunk/SKLineInspector.m
===================================================================
--- trunk/SKLineInspector.m 2023-10-31 15:55:03 UTC (rev 13711)
+++ trunk/SKLineInspector.m 2023-11-01 16:21:22 UTC (rev 13712)
@@ -328,8 +328,8 @@
[self setStyle:[annotation border] ? [[annotation border] style] : 0];
}
if ([type isEqualToString:SKNLineString]) {
- [self setStartLineStyle:[(PDFAnnotationLine *)annotation
startLineStyle]];
- [self setEndLineStyle:[(PDFAnnotationLine *)annotation endLineStyle]];
+ [self setStartLineStyle:[annotation startLineStyle]];
+ [self setEndLineStyle:[annotation endLineStyle]];
}
}
Modified: trunk/SKLoupeController.m
===================================================================
--- trunk/SKLoupeController.m 2023-10-31 15:55:03 UTC (rev 13711)
+++ trunk/SKLoupeController.m 2023-11-01 16:21:22 UTC (rev 13712)
@@ -279,7 +279,10 @@
CGAffineTransform t =
CGAffineTransformTranslate(CGAffineTransformScale(CGAffineTransformMakeTranslation(mouseLoc.x
- NSMinX(magRect), mouseLoc.y - NSMinY(magRect)), magnification,
magnification), -mouseLoc.x, -mouseLoc.y);
CGInterpolationQuality interpolation = [pdfView interpolationQuality] + 1;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
BOOL shouldAntiAlias = [pdfView shouldAntiAlias];
+#pragma clang diagnostic pop
PDFDisplayBox box = [pdfView displayBox];
NSRect scaledRect = NSMakeRect(mouseLoc.x + (NSMinX(magRect) - mouseLoc.x)
/ magnification, mouseLoc.y + (NSMinY(magRect) - mouseLoc.y) / magnification,
NSWidth(magRect) / magnification, NSHeight(magRect) / magnification);
CGFloat backingScale = [pdfView backingScale];
@@ -335,17 +338,9 @@
CGContextSaveGState(context);
CGContextConcatCTM(context,
CGAffineTransformScale(CGAffineTransformTranslate(t, pageOrigin.x,
pageOrigin.y), scaleFactor, scaleFactor));
CGContextSetShouldAntialias(context, shouldAntiAlias);
- if ([PDFView
instancesRespondToSelector:@selector(drawPage:toContext:)]) {
- CGContextSetInterpolationQuality(context, interpolation);
- [pdfView drawPage:page toContext:context];
- } else {
- [NSGraphicsContext saveGraphicsState];
- [NSGraphicsContext setCurrentContext:[NSGraphicsContext
graphicsContextWithCGContext:context flipped:NO]];
- [[NSGraphicsContext currentContext]
setImageInterpolation:interpolation];
- [pdfView drawPage:page];
- [[NSGraphicsContext currentContext]
setImageInterpolation:NSImageInterpolationDefault];
- [NSGraphicsContext restoreGraphicsState];
- }
+ CGContextSetInterpolationQuality(context, interpolation);
+ [pdfView drawPage:page toContext:context];
+ CGContextSetInterpolationQuality(context, kCGInterpolationDefault);
CGContextRestoreGState(context);
}
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2023-10-31 15:55:03 UTC (rev 13711)
+++ trunk/SKMainWindowController.m 2023-11-01 16:21:22 UTC (rev 13712)
@@ -2930,12 +2930,12 @@
}
if (mwcFlags.updatingFont == 0 && ([keyPath
isEqualToString:SKNPDFAnnotationFontKey])) {
mwcFlags.updatingFont = 1;
- [[NSFontManager sharedFontManager]
setSelectedFont:[(PDFAnnotationFreeText *)note font] isMultiple:NO];
+ [[NSFontManager sharedFontManager] setSelectedFont:[note
font] isMultiple:NO];
mwcFlags.updatingFont = 0;
}
if (mwcFlags.updatingFontAttributes == 0 && ([keyPath
isEqualToString:SKNPDFAnnotationFontColorKey])) {
mwcFlags.updatingFontAttributes = 1;
- [[NSFontManager sharedFontManager]
setSelectedAttributes:[NSDictionary
dictionaryWithObjectsAndKeys:[(PDFAnnotationFreeText *)note fontColor],
NSForegroundColorAttributeName, nil] isMultiple:NO];
+ [[NSFontManager sharedFontManager]
setSelectedAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[note
fontColor], NSForegroundColorAttributeName, nil] isMultiple:NO];
mwcFlags.updatingFontAttributes = 0;
}
if (mwcFlags.updatingLine == 0 && ([keyPath
isEqualToString:SKNPDFAnnotationBorderKey] || [keyPath
isEqualToString:SKNPDFAnnotationStartLineStyleKey] || [keyPath
isEqualToString:SKNPDFAnnotationEndLineStyleKey])) {
Modified: trunk/SKMainWindowController_Actions.m
===================================================================
--- trunk/SKMainWindowController_Actions.m 2023-10-31 15:55:03 UTC (rev
13711)
+++ trunk/SKMainWindowController_Actions.m 2023-11-01 16:21:22 UTC (rev
13712)
@@ -111,9 +111,9 @@
- (IBAction)changeFont:(id)sender{
PDFAnnotation *annotation = [pdfView currentAnnotation];
if (mwcFlags.updatingFont == 0 && [self hasOverview] == NO && [annotation
isSkimNote] && [annotation isText]) {
- NSFont *font = [sender convertFont:[(PDFAnnotationFreeText
*)annotation font]];
+ NSFont *font = [sender convertFont:[annotation font]];
mwcFlags.updatingFont = 1;
- [(PDFAnnotationFreeText *)annotation setFont:font];
+ [annotation setFont:font];
mwcFlags.updatingFont = 0;
}
}
@@ -121,11 +121,11 @@
- (IBAction)changeAttributes:(id)sender{
PDFAnnotation *annotation = [pdfView currentAnnotation];
if (mwcFlags.updatingFontAttributes == 0 && mwcFlags.updatingColor == 0 &&
[self hasOverview] == NO && [annotation isSkimNote] && [annotation isText]) {
- NSColor *color = [(PDFAnnotationFreeText *)annotation fontColor];
+ NSColor *color = [annotation fontColor];
NSColor *newColor = [[sender convertAttributes:[NSDictionary
dictionaryWithObjectsAndKeys:color, NSForegroundColorAttributeName, nil]]
valueForKey:NSForegroundColorAttributeName];
if ([newColor isEqual:color] == NO) {
mwcFlags.updatingFontAttributes = 1;
- [(PDFAnnotationFreeText *)annotation setFontColor:newColor];
+ [annotation setFontColor:newColor];
mwcFlags.updatingFontAttributes = 0;
}
}
@@ -134,7 +134,7 @@
- (IBAction)alignLeft:(id)sender {
PDFAnnotation *annotation = [pdfView currentAnnotation];
if ([self hasOverview] == NO && [annotation isSkimNote] && [annotation
isText]) {
- [(PDFAnnotationFreeText *)annotation setAlignment:NSTextAlignmentLeft];
+ [annotation setAlignment:NSTextAlignmentLeft];
}
}
@@ -141,7 +141,7 @@
- (IBAction)alignRight:(id)sender {
PDFAnnotation *annotation = [pdfView currentAnnotation];
if ([self hasOverview] == NO && [annotation isSkimNote] && [annotation
isText]) {
- [(PDFAnnotationFreeText *)annotation
setAlignment:NSTextAlignmentRight];
+ [annotation setAlignment:NSTextAlignmentRight];
}
}
@@ -148,7 +148,7 @@
- (IBAction)alignCenter:(id)sender {
PDFAnnotation *annotation = [pdfView currentAnnotation];
if ([self hasOverview] == NO && [annotation isSkimNote] && [annotation
isText]) {
- [(PDFAnnotationFreeText *)annotation
setAlignment:NSTextAlignmentCenter];
+ [annotation setAlignment:NSTextAlignmentCenter];
}
}
@@ -169,11 +169,11 @@
break;
case SKLineChangeActionStartLineStyle:
if ([annotation isLine])
- [(PDFAnnotationLine *)annotation setStartLineStyle:[sender
startLineStyle]];
+ [annotation setStartLineStyle:[sender startLineStyle]];
break;
case SKLineChangeActionEndLineStyle:
if ([annotation isLine])
- [(PDFAnnotationLine *)annotation setEndLineStyle:[sender
endLineStyle]];
+ [annotation setEndLineStyle:[sender endLineStyle]];
break;
case SKNoLineChangeAction:
break;
@@ -850,7 +850,7 @@
else
[self displayGroupedFindViewAnimating:YES];
- NSPasteboard *findPboard = [NSPasteboard
pasteboardWithName:NSFindPboard];
+ NSPasteboard *findPboard = [NSPasteboard
pasteboardWithName:NSPasteboardNameFind];
[findPboard clearContents];
[findPboard writeObjects:@[searchString]];
}
@@ -863,7 +863,7 @@
[self updateSnapshotFilterPredicate];
NSString *searchString = [sender stringValue];
if ([searchString length]) {
- NSPasteboard *findPboard = [NSPasteboard
pasteboardWithName:NSFindPboard];
+ NSPasteboard *findPboard = [NSPasteboard
pasteboardWithName:NSPasteboardNameFind];
[findPboard clearContents];
[findPboard writeObjects:@[searchString]];
}
@@ -1177,7 +1177,7 @@
if ([[findController view] window]) {
[findController findForward:forward];
} else {
- NSPasteboard *findPboard = [NSPasteboard
pasteboardWithName:NSFindPboard];
+ NSPasteboard *findPboard = [NSPasteboard
pasteboardWithName:NSPasteboardNameFind];
NSArray *strings = [findPboard
readObjectsForClasses:@[[NSString class]] options:@{}];
if ([strings count] > 0)
findString = [strings objectAtIndex:0];
@@ -1195,7 +1195,7 @@
[findController setFindString:findString];
[findController updateFindPboard];
} else {
- NSPasteboard *findPboard = [NSPasteboard
pasteboardWithName:NSFindPboard];
+ NSPasteboard *findPboard = [NSPasteboard
pasteboardWithName:NSPasteboardNameFind];
[findPboard clearContents];
[findPboard writeObjects:@[findString]];
}
Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m 2023-10-31 15:55:03 UTC (rev 13711)
+++ trunk/SKMainWindowController_UI.m 2023-11-01 16:21:22 UTC (rev 13712)
@@ -215,10 +215,10 @@
if ([annotation isSkimNote]) {
if ([annotation isText]) {
mwcFlags.updatingFont = 1;
- [[NSFontManager sharedFontManager]
setSelectedFont:[(PDFAnnotationFreeText *)annotation font] isMultiple:NO];
+ [[NSFontManager sharedFontManager] setSelectedFont:[annotation
font] isMultiple:NO];
mwcFlags.updatingFont = 0;
mwcFlags.updatingFontAttributes = 1;
- [[NSFontManager sharedFontManager]
setSelectedAttributes:[NSDictionary
dictionaryWithObjectsAndKeys:[(PDFAnnotationFreeText *)annotation fontColor],
NSForegroundColorAttributeName, nil] isMultiple:NO];
+ [[NSFontManager sharedFontManager]
setSelectedAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[annotation
fontColor], NSForegroundColorAttributeName, nil] isMultiple:NO];
mwcFlags.updatingFontAttributes = 0;
}
}
Modified: trunk/SKNPDFAnnotationNote_SKExtensions.m
===================================================================
--- trunk/SKNPDFAnnotationNote_SKExtensions.m 2023-10-31 15:55:03 UTC (rev
13711)
+++ trunk/SKNPDFAnnotationNote_SKExtensions.m 2023-11-01 16:21:22 UTC (rev
13712)
@@ -101,7 +101,10 @@
+ (NSSet *)customScriptingKeys {
static NSSet *customNoteScriptingKeys = nil;
if (customNoteScriptingKeys == nil) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
NSMutableSet *customKeys = [[super customScriptingKeys] mutableCopy];
+#pragma clang diagnostic pop
[customKeys addObject:SKPDFAnnotationRichTextKey];
customNoteScriptingKeys = [customKeys copy];
[customKeys release];
Modified: trunk/SKNoteWindowController.m
===================================================================
--- trunk/SKNoteWindowController.m 2023-10-31 15:55:03 UTC (rev 13711)
+++ trunk/SKNoteWindowController.m 2023-11-01 16:21:22 UTC (rev 13712)
@@ -96,8 +96,7 @@
if (noteIcons[0]) return;
NSRect bounds = {NSZeroPoint, SKNPDFAnnotationNoteSize};
- PDFAnnotationText *annotation = [[SKNPDFAnnotationNote alloc]
initWithBounds:bounds];
- [annotation setColor:[NSColor clearColor]];
+ PDFAnnotation *annotation = [[PDFAnnotation alloc] initWithBounds:bounds
forType:PDFAnnotationSubtypeText
withProperties:@{PDFAnnotationKeyColor:[NSColor clearColor]}];
PDFPage *page = [[PDFPage alloc] init];
[page setBounds:bounds forBox:kPDFDisplayBoxMediaBox];
[page addAnnotation:annotation];
@@ -108,7 +107,7 @@
[annotation setIconType:i];
noteIcons[i] = [[NSImage alloc] initWithSize:SKNPDFAnnotationNoteSize];
[noteIcons[i] lockFocus];
- [page drawWithBox:kPDFDisplayBoxMediaBox];
+ [page drawWithBox:kPDFDisplayBoxMediaBox toContext:[[NSGraphicsContext
currentContext] CGContext]];
[noteIcons[i] unlockFocus];
[noteIcons[i] setTemplate:YES];
}
@@ -257,8 +256,6 @@
- (void)windowWillClose:(NSNotification *)aNotification {
if ([self commitEditing] == NO)
[self discardEditing];
- if ([note respondsToSelector:@selector(setWindowIsOpen:)])
- [(PDFAnnotationText *)note setWindowIsOpen:NO];
if ([[self window] isKeyWindow])
[[[[self document] mainWindowController] window] makeKeyWindow];
else if ([[self window] isMainWindow])
@@ -302,12 +299,6 @@
[super setDocument:document];
}
-- (IBAction)showWindow:(id)sender {
- [super showWindow:sender];
- if ([note respondsToSelector:@selector(setWindowIsOpen:)])
- [(PDFAnnotationText *)note setWindowIsOpen:YES];
-}
-
- (NSString *)windowTitleForDocumentDisplayName:(NSString *)displayName {
return [[[[self note] type] typeName]
stringByAppendingEmDashAndString:[[self note] string] ?: @""];
}
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2023-10-31 15:55:03 UTC (rev 13711)
+++ trunk/SKPDFView.m 2023-11-01 16:21:22 UTC (rev 13712)
@@ -2516,9 +2516,9 @@
[highlightAnnotation setBorderStyle:[number integerValue]];
if ([highlightAnnotation isLine]) {
if ((number = [dict
objectForKey:SKLineWellStartLineStyleKey]))
- [(PDFAnnotationLine *)highlightAnnotation
setStartLineStyle:[number integerValue]];
+ [highlightAnnotation setStartLineStyle:[number
integerValue]];
if ((number = [dict
objectForKey:SKLineWellEndLineStyleKey]))
- [(PDFAnnotationLine *)highlightAnnotation
setEndLineStyle:[number integerValue]];
+ [highlightAnnotation setEndLineStyle:[number
integerValue]];
}
performedDrag = YES;
}
@@ -2945,7 +2945,7 @@
if ([self isEditingAnnotation:currentAnnotation])
return;
- editor = [[SKTextNoteEditor alloc] initWithPDFView:self
annotation:(PDFAnnotationFreeText *)currentAnnotation];
+ editor = [[SKTextNoteEditor alloc] initWithPDFView:self
annotation:currentAnnotation];
[[self window] makeFirstResponder:self];
[editor layoutWithEvent:theEvent];
@@ -3731,7 +3731,7 @@
if ([currentAnnotation isLine]) {
- PDFAnnotationLine *annotation = (PDFAnnotationLine *)currentAnnotation;
+ PDFAnnotation *annotation = currentAnnotation;
NSPoint startPoint = SKIntegralPoint(SKAddPoints([annotation
startPoint], bounds.origin));
NSPoint endPoint = SKIntegralPoint(SKAddPoints([annotation endPoint],
bounds.origin));
NSPoint oldEndPoint = endPoint;
@@ -3962,7 +3962,7 @@
if (NSEqualRects(bounds, newBounds) == NO) {
if ([currentAnnotation isInk]) {
- CGFloat margin = [(PDFAnnotationInk *)currentAnnotation
pathInset];
+ CGFloat margin = [currentAnnotation pathInset];
NSMutableArray *paths = [NSMutableArray array];
NSAffineTransform *transform = [NSAffineTransform transform];
[transform translateXBy:margin yBy:margin];
@@ -3969,10 +3969,10 @@
[transform scaleXBy:fmax(1.0, NSWidth(newBounds) - 2.0 *
margin) / fmax(1.0, NSWidth(bounds) - 2.0 * margin) yBy:fmax(1.0,
NSHeight(newBounds) - 2.0 * margin) / fmax(1.0, NSHeight(bounds) - 2.0 *
margin)];
[transform translateXBy:-margin yBy:-margin];
- for (NSBezierPath *path in [(PDFAnnotationInk
*)currentAnnotation paths])
+ for (NSBezierPath *path in [currentAnnotation paths])
[paths addObject:[transform transformBezierPath:path]];
- [(PDFAnnotationInk *)currentAnnotation setBezierPaths:paths];
+ [currentAnnotation setBezierPaths:paths];
}
[currentAnnotation setBounds:newBounds];
@@ -4134,8 +4134,8 @@
newBounds.origin.y = floor(0.5 * ((startPoint.y + endPoint.y) -
MIN_NOTE_SIZE));
}
- [(PDFAnnotationLine *)currentAnnotation
setObservedStartPoint:SKSubstractPoints(startPoint, newBounds.origin)];
- [(PDFAnnotationLine *)currentAnnotation
setObservedEndPoint:SKSubstractPoints(endPoint, newBounds.origin)];
+ [currentAnnotation setObservedStartPoint:SKSubstractPoints(startPoint,
newBounds.origin)];
+ [currentAnnotation setObservedEndPoint:SKSubstractPoints(endPoint,
newBounds.origin)];
[currentAnnotation setBounds:newBounds];
}
}
@@ -4283,7 +4283,7 @@
for (NSBezierPath *path in originalPaths)
[paths addObject:[transform transformBezierPath:path]];
- [(PDFAnnotationInk *)currentAnnotation setBezierPaths:paths];
+ [currentAnnotation setBezierPaths:paths];
}
[currentAnnotation setBounds:newBounds];
@@ -4331,11 +4331,11 @@
}
}
} else if (isLine) {
- originalStartPoint = SKIntegralPoint(SKAddPoints([(PDFAnnotationLine
*)currentAnnotation startPoint], originalBounds.origin));
- originalEndPoint = SKIntegralPoint(SKAddPoints([(PDFAnnotationLine
*)currentAnnotation endPoint], originalBounds.origin));
+ originalStartPoint = SKIntegralPoint(SKAddPoints([currentAnnotation
startPoint], originalBounds.origin));
+ originalEndPoint = SKIntegralPoint(SKAddPoints([currentAnnotation
endPoint], originalBounds.origin));
} else if ([currentAnnotation isInk]) {
- originalPaths = [[[(PDFAnnotationInk *)currentAnnotation paths] copy]
autorelease];
- margin = [(PDFAnnotationInk *)currentAnnotation pathInset];
+ originalPaths = [[[currentAnnotation paths] copy] autorelease];
+ margin = [currentAnnotation pathInset];
}
// we move or resize the annotation in an event loop, which ensures it's
enclosed in a single undo group
@@ -4481,8 +4481,8 @@
newAnnotation = [[PDFAnnotation newSkimNoteWithSelection:sel
forType:type] autorelease];
[newAnnotation setString:[sel cleanedString]];
} else if ([currentAnnotation isInk]) {
- NSMutableArray *paths = [[(PDFAnnotationInk
*)currentAnnotation pagePaths] mutableCopy];
- [paths addObjectsFromArray:[(PDFAnnotationInk
*)newCurrentAnnotation pagePaths]];
+ NSMutableArray *paths = [[currentAnnotation pagePaths]
mutableCopy];
+ [paths addObjectsFromArray:[newCurrentAnnotation pagePaths]];
NSString *string1 = [currentAnnotation string];
NSString *string2 = [newCurrentAnnotation string];
@@ -4617,7 +4617,7 @@
if (bezierPath) {
NSMutableArray *paths = [[NSMutableArray alloc] init];
if (currentAnnotation)
- [paths addObjectsFromArray:[(PDFAnnotationInk *)currentAnnotation
pagePaths]];
+ [paths addObjectsFromArray:[currentAnnotation pagePaths]];
[paths addObject:bezierPath];
PDFAnnotation *annotation = [PDFAnnotation newSkimNoteWithPaths:paths];
Modified: trunk/SKPresentationOptionsSheetController.m
===================================================================
--- trunk/SKPresentationOptionsSheetController.m 2023-10-31 15:55:03 UTC
(rev 13711)
+++ trunk/SKPresentationOptionsSheetController.m 2023-11-01 16:21:22 UTC
(rev 13712)
@@ -184,7 +184,7 @@
// collapse the table, it is already hidden
[boxLeadingConstraint setConstant:BOX_OFFSET];
- [tableView registerForDraggedTypes:[SKTransitionInfo
readableTypesForPasteboard:[NSPasteboard pasteboardWithName:NSDragPboard]]];
+ [tableView registerForDraggedTypes:[SKTransitionInfo
readableTypesForPasteboard:[NSPasteboard
pasteboardWithName:NSPasteboardNameDrag]]];
[tableView setTypeSelectHelper:[SKTypeSelectHelper
typeSelectHelperWithMatchOption:SKFullStringMatch]];
Modified: trunk/SKRightSideViewController.m
===================================================================
--- trunk/SKRightSideViewController.m 2023-10-31 15:55:03 UTC (rev 13711)
+++ trunk/SKRightSideViewController.m 2023-11-01 16:21:22 UTC (rev 13712)
@@ -117,7 +117,7 @@
[noteOutlineView setIndentationPerLevel:1.0];
- [noteOutlineView registerForDraggedTypes:[NSColor
readableTypesForPasteboard:[NSPasteboard pasteboardWithName:NSDragPboard]]];
+ [noteOutlineView registerForDraggedTypes:[NSColor
readableTypesForPasteboard:[NSPasteboard
pasteboardWithName:NSPasteboardNameDrag]]];
[noteOutlineView setDraggingSourceOperationMask:NSDragOperationEvery
forLocal:NO];
[snapshotTableView setDraggingSourceOperationMask:NSDragOperationEvery
forLocal:NO];
Modified: trunk/SKTextNoteEditor.h
===================================================================
--- trunk/SKTextNoteEditor.h 2023-10-31 15:55:03 UTC (rev 13711)
+++ trunk/SKTextNoteEditor.h 2023-11-01 16:21:22 UTC (rev 13712)
@@ -43,11 +43,11 @@
@interface SKTextNoteEditor : NSView <NSTextViewDelegate> {
NSTextView *textView;
PDFView *pdfView;
- PDFAnnotationFreeText *annotation;
+ PDFAnnotation *annotation;
NSUndoManager *undoManager;
}
-- (id)initWithPDFView:(PDFView *)aPDFView annotation:(PDFAnnotationFreeText
*)anAnnotation;
+- (id)initWithPDFView:(PDFView *)aPDFView annotation:(PDFAnnotation
*)anAnnotation;
@property (nonatomic, readonly) NSString *currentString;
Modified: trunk/SKTextNoteEditor.m
===================================================================
--- trunk/SKTextNoteEditor.m 2023-10-31 15:55:03 UTC (rev 13711)
+++ trunk/SKTextNoteEditor.m 2023-11-01 16:21:22 UTC (rev 13712)
@@ -62,7 +62,7 @@
return @[SKNPDFAnnotationBoundsKey, SKNPDFAnnotationFontKey,
SKNPDFAnnotationFontColorKey, SKNPDFAnnotationAlignmentKey,
SKNPDFAnnotationColorKey, SKNPDFAnnotationBorderKey, SKNPDFAnnotationStringKey];
}
-- (id)initWithPDFView:(PDFView *)aPDFView annotation:(PDFAnnotationFreeText
*)anAnnotation {
+- (id)initWithPDFView:(PDFView *)aPDFView annotation:(PDFAnnotation
*)anAnnotation {
self = [super initWithFrame:[annotation bounds]];
if (self) {
pdfView = aPDFView;
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