Revision: 13335
http://sourceforge.net/p/skim-app/code/13335
Author: hofman
Date: 2023-03-02 16:39:57 +0000 (Thu, 02 Mar 2023)
Log Message:
-----------
replace deprecated enum values. #define for older SDKs.
Modified Paths:
--------------
trunk/NSEvent_SKExtensions.m
trunk/NSImage_SKExtensions.m
trunk/NSMenu_SKExtensions.m
trunk/NSURL_SKExtensions.m
trunk/PDFAnnotationFreeText_SKExtensions.m
trunk/PDFAnnotationInk_SKExtensions.m
trunk/PDFAnnotation_SKExtensions.m
trunk/PDFPage_SKExtensions.m
trunk/PDFView_SKExtensions.m
trunk/QuickLook-Skim/GenerateThumbnailForURL.m
trunk/SKAnimatedBorderlessWindow.m
trunk/SKApplication.m
trunk/SKApplicationController.m
trunk/SKBasePDFView.m
trunk/SKBookmark.m
trunk/SKBookmarkController.m
trunk/SKColorMenuView.m
trunk/SKColorSwatch.m
trunk/SKCompatibility.h
trunk/SKDocumentController.m
trunk/SKDownload.m
trunk/SKDownloadController.m
trunk/SKDownloadPreferenceController.m
trunk/SKDragImageView.m
trunk/SKFDFParser.m
trunk/SKFindController.m
trunk/SKFontWell.m
trunk/SKFullScreenWindow.m
trunk/SKImageToolTipContext.m
trunk/SKLineWell.m
trunk/SKMainDocument.m
trunk/SKMainToolbarController.m
trunk/SKMainTouchBarController.m
trunk/SKMainWindow.m
trunk/SKMainWindowController.m
trunk/SKMainWindowController_Actions.m
trunk/SKMainWindowController_FullScreen.m
trunk/SKMainWindowController_UI.m
trunk/SKNavigationWindow.m
trunk/SKNoteOutlineView.m
trunk/SKNoteWindowController.m
trunk/SKNotesDocument.m
trunk/SKOutlineView.m
trunk/SKPDFView.m
trunk/SKSecondaryPDFView.m
trunk/SKSideWindow.m
trunk/SKSnapshotPDFView.m
trunk/SKSnapshotWindowController.m
trunk/SKStatusBar.m
trunk/SKTableView.m
trunk/SKTextNoteEditor.m
trunk/SKThumbnailView.m
trunk/SKTransitionController.m
trunk/SKTypeSelectHelper.m
Modified: trunk/NSEvent_SKExtensions.m
===================================================================
--- trunk/NSEvent_SKExtensions.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/NSEvent_SKExtensions.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -38,11 +38,11 @@
#import "NSEvent_SKExtensions.h"
-#define SKStandardModifierFlagsMask (NSCommandKeyMask | NSAlternateKeyMask |
NSShiftKeyMask | NSControlKeyMask)
+#define SKStandardModifierFlagsMask (NSEventModifierFlagCommand |
NSEventModifierFlagOption | NSEventModifierFlagShift |
NSEventModifierFlagControl)
@implementation NSEvent (SKExtensions)
-static NSPointingDeviceType currentPointingDeviceType =
NSUnknownPointingDevice;
+static NSPointingDeviceType currentPointingDeviceType =
NSPointingDeviceTypeUnknown;
+ (NSUInteger)standardModifierFlags {
return [self modifierFlags] & SKStandardModifierFlagsMask;
@@ -49,7 +49,7 @@
}
- (NSUInteger)deviceIndependentModifierFlags {
- return [self modifierFlags] & NSDeviceIndependentModifierFlagsMask;
+ return [self modifierFlags] &
NSEventModifierFlagDeviceIndependentFlagsMask;
}
- (NSUInteger)standardModifierFlags {
Modified: trunk/NSImage_SKExtensions.m
===================================================================
--- trunk/NSImage_SKExtensions.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/NSImage_SKExtensions.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -879,7 +879,7 @@
[path appendBezierPathWithOvalInRect:NSMakeRect(10.5, 10.0, 6.0, 6.0)];
[path fill];
[NSGraphicsContext saveGraphicsState];
- [[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositeClear];
+ [[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositingOperationClear];
[[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(9.8, 5.8, 7.4,
7.4)] stroke];
path = [NSBezierPath bezierPath];
[path appendBezierPathWithArcWithCenter:NSMakePoint(13.5, 9.5)
radius:1.8 startAngle:45.0 endAngle:225.0];
@@ -943,7 +943,7 @@
MAKE_IMAGE(SKImageNameToolbarFonts, YES, 27.0, 20.0,
[[NSColor blackColor] setFill];
[NSBezierPath fillRect:NSMakeRect(4.0, 1.0, 19.0, 19.0)];
- [[NSImage imageNamed:NSImageNameFontPanel] drawInRect:NSMakeRect(4.0,
1.0, 19.0, 19.0) fromRect:NSZeroRect operation:NSCompositeDestinationAtop
fraction:1.0];
+ [[NSImage imageNamed:NSImageNameFontPanel] drawInRect:NSMakeRect(4.0,
1.0, 19.0, 19.0) fromRect:NSZeroRect
operation:NSCompositingOperationDestinationAtop fraction:1.0];
);
MAKE_IMAGE(SKImageNameToolbarLines, YES, 27.0, 20.0,
@@ -958,7 +958,7 @@
[[NSColor blackColor] setFill];
[NSBezierPath fillRect:NSMakeRect(4.0, 1.0, 19.0, 19.0)];
NSImage *customizeImage = [[NSWorkspace sharedWorkspace]
iconForFileType:NSFileTypeForHFSTypeCode(kToolbarCustomizeIcon)];
- [customizeImage drawInRect:NSMakeRect(4.0, 1.0, 19.0, 19.0)
fromRect:NSZeroRect operation:NSCompositeDestinationAtop fraction:1.0];
+ [customizeImage drawInRect:NSMakeRect(4.0, 1.0, 19.0, 19.0)
fromRect:NSZeroRect operation:NSCompositingOperationDestinationAtop
fraction:1.0];
);
MAKE_IMAGE(SKImageNameToolbarPrint, YES, 27.0, 20.0,
@@ -1303,7 +1303,7 @@
[path appendBezierPathWithOvalInRect:NSMakeRect(10.5, 10.0, 6.0, 6.0)];
[path fill];
[NSGraphicsContext saveGraphicsState];
- [[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositeClear];
+ [[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositingOperationClear];
[[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(9.8, 5.8, 7.4,
7.4)] stroke];
path = [NSBezierPath bezierPath];
[path appendBezierPathWithArcWithCenter:NSMakePoint(13.5, 9.5)
radius:1.8 startAngle:45.0 endAngle:225.0];
@@ -1375,12 +1375,12 @@
+ (void)makeColoredToolbarImages {
MAKE_IMAGE(SKImageNameToolbarColors, NO, 27.0, 20.0,
- [[NSImage imageNamed:NSImageNameColorPanel] drawInRect:NSMakeRect(4.0,
1.0, 19.0, 19.0) fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0];
+ [[NSImage imageNamed:NSImageNameColorPanel] drawInRect:NSMakeRect(4.0,
1.0, 19.0, 19.0) fromRect:NSZeroRect operation:NSCompositingOperationCopy
fraction:1.0];
);
MAKE_IMAGE(SKImageNameGeneralPreferences, NO, 32.0, 32.0,
NSImage *generalImage = [NSImage
imageNamed:NSImageNamePreferencesGeneral];
- [generalImage drawInRect:NSMakeRect(0.0, 0.0, 32.0, 32.0)
fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0];
+ [generalImage drawInRect:NSMakeRect(0.0, 0.0, 32.0, 32.0)
fromRect:NSZeroRect operation:NSCompositingOperationCopy fraction:1.0];
);
MAKE_IMAGE(SKImageNameDisplayPreferences, NO, 32.0, 32.0,
@@ -1387,8 +1387,8 @@
NSImage *fontImage = [NSImage imageNamed:NSImageNameFontPanel];
NSImage *colorImage = [NSImage imageNamed:NSImageNameColorPanel];
NSRectFill(NSMakeRect(0.0, 0.0, 21.0, 29.0));
- [fontImage drawInRect:NSMakeRect(-4.0, 0.0, 29.0, 29.0)
fromRect:NSZeroRect operation:NSCompositeDestinationAtop fraction:1.0];
- [colorImage drawInRect:NSMakeRect(0.0, 0.0, 32.0, 32.0)
fromRect:NSZeroRect operation:NSCompositeDestinationOver fraction:1.0];
+ [fontImage drawInRect:NSMakeRect(-4.0, 0.0, 29.0, 29.0)
fromRect:NSZeroRect operation:NSCompositingOperationDestinationAtop
fraction:1.0];
+ [colorImage drawInRect:NSMakeRect(0.0, 0.0, 32.0, 32.0)
fromRect:NSZeroRect operation:NSCompositingOperationDestinationOver
fraction:1.0];
);
MAKE_IMAGE(SKImageNameNotesPreferences, NO, 32.0, 32.0,
@@ -1396,10 +1396,10 @@
NSGradient *gradient = [[[NSGradient alloc]
initWithStartingColor:[NSColor colorWithSRGBRed:1.0 green:0.939 blue:0.495
alpha:1.0] endingColor:[NSColor colorWithSRGBRed:1.0 green:0.976 blue:0.810
alpha:1.0]] autorelease];
[[NSColor blackColor] setFill];
[NSBezierPath fillRect:NSMakeRect(2.0, 0.0, 28.0, 32.0)];
- [clippingImage drawInRect:NSMakeRect(2.0, 0.0, 28.0, 32.0)
fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
- [[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositeMultiply];
+ [clippingImage drawInRect:NSMakeRect(2.0, 0.0, 28.0, 32.0)
fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0];
+ [[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositingOperationMultiply];
[gradient drawInRect:NSMakeRect(2.0, 0.0, 28.0, 32.0) angle:90.0];
- [clippingImage drawInRect:NSMakeRect(2.0, 0.0, 28.0, 32.0)
fromRect:NSZeroRect operation:NSCompositeDestinationAtop fraction:1.0];
+ [clippingImage drawInRect:NSMakeRect(2.0, 0.0, 28.0, 32.0)
fromRect:NSZeroRect operation:NSCompositingOperationDestinationAtop
fraction:1.0];
);
MAKE_IMAGE(SKImageNameSyncPreferences, NO, 32.0, 32.0,
@@ -1407,8 +1407,8 @@
NSImage *genericDocImage = [[NSWorkspace sharedWorkspace]
iconForFileType:NSFileTypeForHFSTypeCode(kGenericDocumentIcon)];
[[NSColor colorWithSRGBRed:0.3 green:0.45 blue:0.65 alpha:1.0] set];
NSRectFill(NSMakeRect(11.0, 10.0, 10.0, 12.0));
- [refreshImage drawInRect:NSMakeRect(11.0, 10.0, 10.0, 12.0)
fromRect:NSZeroRect operation:NSCompositeDestinationAtop fraction:1.0];
- [genericDocImage drawInRect:NSMakeRect(0.0, 0.0, 32.0, 32.0)
fromRect:NSZeroRect operation:NSCompositeDestinationOver fraction:1.0];
+ [refreshImage drawInRect:NSMakeRect(11.0, 10.0, 10.0, 12.0)
fromRect:NSZeroRect operation:NSCompositingOperationDestinationAtop
fraction:1.0];
+ [genericDocImage drawInRect:NSMakeRect(0.0, 0.0, 32.0, 32.0)
fromRect:NSZeroRect operation:NSCompositingOperationDestinationOver
fraction:1.0];
);
}
@@ -1424,7 +1424,7 @@
MAKE_IMAGE(SKImageNameWidgetNote, YES, 21.0, 19.0,
[[NSColor blackColor] setStroke];
[NSBezierPath strokeRect:NSMakeRect(1.5, 2.5, 16.0, 10.0)];
- [[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositeCopy];
+ [[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositingOperationCopy];
drawTextNote();
);
@@ -1814,7 +1814,7 @@
[NSShadow setShadowWithWhite:0.0 alpha:0.33333 blurRadius:1.0
yOffset:-1.0];
[NSBezierPath fillRect:NSMakeRect(2.0, 14.0, 28.0, 4.0)];
[NSGraphicsContext restoreGraphicsState];
- [[[NSCursor openHandCursor] image] drawInRect:NSMakeRect(0.0, 0.0,
32.0, 32.0) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
+ [[[NSCursor openHandCursor] image] drawInRect:NSMakeRect(0.0, 0.0,
32.0, 32.0) fromRect:NSZeroRect operation:NSCompositingOperationSourceOver
fraction:1.0];
);
MAKE_VECTOR_IMAGE(SKImageNameClosedHandBarCursor, NO, 32.0, 32.0,
@@ -1824,7 +1824,7 @@
[NSShadow setShadowWithWhite:0.0 alpha:0.33333 blurRadius:1.0
yOffset:-1.0];
[NSBezierPath fillRect:NSMakeRect(2.0, 14.0, 28.0, 4.0)];
[NSGraphicsContext restoreGraphicsState];
- [[[NSCursor closedHandCursor] image] drawInRect:NSMakeRect(0.0, 0.0,
32.0, 32.0) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
+ [[[NSCursor closedHandCursor] image] drawInRect:NSMakeRect(0.0, 0.0,
32.0, 32.0) fromRect:NSZeroRect operation:NSCompositingOperationSourceOver
fraction:1.0];
);
} else {
@@ -1832,13 +1832,13 @@
MAKE_VECTOR_IMAGE(SKImageNameOpenHandBarCursor, NO, size.width, size.width,
[[NSColor blackColor] setFill];
[NSBezierPath fillRect:NSMakeRect(0.0, 9.0 / 16.0 * size.height,
size.width, 3.0 / 16.0 * size.height)];
- [[[NSCursor openHandCursor] image] drawInRect:NSMakeRect(0.0, 0.0,
size.width, size.height) fromRect:NSZeroRect operation:NSCompositeSourceOver
fraction:1.0];
+ [[[NSCursor openHandCursor] image] drawInRect:NSMakeRect(0.0, 0.0,
size.width, size.height) fromRect:NSZeroRect
operation:NSCompositingOperationSourceOver fraction:1.0];
);
MAKE_VECTOR_IMAGE(SKImageNameClosedHandBarCursor, NO, size.width,
size.width,
[[NSColor blackColor] setFill];
[NSBezierPath fillRect:NSMakeRect(0.0, 6.0 / 16.0 * size.height,
size.width, 3.0 / 16.0 * size.height)];
- [[[NSCursor closedHandCursor] image] drawInRect:NSMakeRect(0.0, 0.0,
size.width, size.height) fromRect:NSZeroRect operation:NSCompositeSourceOver
fraction:1.0];
+ [[[NSCursor closedHandCursor] image] drawInRect:NSMakeRect(0.0, 0.0,
size.width, size.height) fromRect:NSZeroRect
operation:NSCompositingOperationSourceOver fraction:1.0];
);
}
@@ -2201,7 +2201,7 @@
[addPath appendBezierPathWithRect:NSMakeRect(16.0, 4.0, 5.0, 1.0)];
[addPath appendBezierPathWithRect:NSMakeRect(18.0, 2.0, 1.0, 5.0)];
[NSGraphicsContext saveGraphicsState];
- [[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositeCopy];
+ [[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositingOperationCopy];
[[NSColor colorWithGenericGamma22White:0.0 alpha:0.6] setFill];
[addPath fill];
[NSGraphicsContext restoreGraphicsState];
@@ -2226,7 +2226,7 @@
static inline void drawPageBackgroundInRect(NSRect rect) {
[NSGraphicsContext saveGraphicsState];
- [[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositeCopy];
+ [[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositingOperationCopy];
[[NSColor colorWithGenericGamma22White:0.0 alpha:0.25] setFill];
[NSBezierPath fillRect:rect];
[NSGraphicsContext restoreGraphicsState];
@@ -2234,7 +2234,7 @@
static inline void drawArrowCursor() {
NSImage *arrowCursor = [[NSCursor arrowCursor] image];
- [arrowCursor drawAtPoint:NSMakePoint(0.0, 42.0 - [arrowCursor
size].height) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
+ [arrowCursor drawAtPoint:NSMakePoint(0.0, 42.0 - [arrowCursor
size].height) fromRect:NSZeroRect operation:NSCompositingOperationSourceOver
fraction:1.0];
}
static void evaluateLaserPointer(void *info, const CGFloat *in, CGFloat *out) {
Modified: trunk/NSMenu_SKExtensions.m
===================================================================
--- trunk/NSMenu_SKExtensions.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/NSMenu_SKExtensions.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -144,7 +144,7 @@
} else {
NSImage *newImage = [[NSImage alloc] initWithSize:dstSize];
[newImage lockFocus];
- [image drawInRect:(NSRect){NSZeroPoint, dstSize} fromRect:NSZeroRect
operation:NSCompositeCopy fraction:1.0];
+ [image drawInRect:(NSRect){NSZeroPoint, dstSize} fromRect:NSZeroRect
operation:NSCompositingOperationCopy fraction:1.0];
[newImage unlockFocus];
[self setImage:newImage];
[newImage release];
Modified: trunk/NSURL_SKExtensions.m
===================================================================
--- trunk/NSURL_SKExtensions.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/NSURL_SKExtensions.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -221,7 +221,7 @@
fileImage = [[NSWorkspace sharedWorkspace]
iconForFileType:NSFileTypeForHFSTypeCode(kGenericDocumentIcon)];
NSImage *image = [[NSImage alloc] initWithSize:NSMakeSize(16.0, 16.0)];
[image lockFocus];
- [fileImage drawInRect:NSMakeRect(0.0, 0.0, 16.0, 16.0)
fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0];
+ [fileImage drawInRect:NSMakeRect(0.0, 0.0, 16.0, 16.0)
fromRect:NSZeroRect operation:NSCompositingOperationCopy fraction:1.0];
[image unlockFocus];
if (typeIconWrappers == nil)
typeIconWrappers = [[NSMutableDictionary alloc] init];
Modified: trunk/PDFAnnotationFreeText_SKExtensions.m
===================================================================
--- trunk/PDFAnnotationFreeText_SKExtensions.m 2023-03-02 14:54:15 UTC (rev
13334)
+++ trunk/PDFAnnotationFreeText_SKExtensions.m 2023-03-02 16:39:57 UTC (rev
13335)
@@ -73,9 +73,9 @@
static inline NSString *alignmentStyleKeyword(NSTextAlignment alignment) {
switch (alignment) {
- case NSLeftTextAlignment: return @"left";
- case NSRightTextAlignment: return @"right";
- case NSCenterTextAlignment: return @"center";
+ case NSTextAlignmentLeft: return @"left";
+ case NSTextAlignmentRight: return @"right";
+ case NSTextAlignmentCenter: return @"center";
default: return @"left";
}
}
Modified: trunk/PDFAnnotationInk_SKExtensions.m
===================================================================
--- trunk/PDFAnnotationInk_SKExtensions.m 2023-03-02 14:54:15 UTC (rev
13334)
+++ trunk/PDFAnnotationInk_SKExtensions.m 2023-03-02 16:39:57 UTC (rev
13335)
@@ -320,12 +320,12 @@
[NSShadow setShadowWithColor:[NSColor colorWithGenericGamma22White:0.0
alpha:0.33333] blurRadius:r offset:offset];
[path stroke];
[NSGraphicsContext restoreGraphicsState];
- [[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositeClear];
+ [[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositingOperationClear];
[path stroke];
[image unlockFocus];
[NSGraphicsContext saveGraphicsState];
[NSGraphicsContext setCurrentContext:[NSGraphicsContext
graphicsContextWithCGContext:context flipped:NO]];
- [image drawInRect:rect fromRect:imgRect
operation:NSCompositeSourceOver fraction:[[self color] alphaComponent]];
+ [image drawInRect:rect fromRect:imgRect
operation:NSCompositingOperationSourceOver fraction:[[self color]
alphaComponent]];
[NSGraphicsContext restoreGraphicsState];
[image release];
}
Modified: trunk/PDFAnnotation_SKExtensions.m
===================================================================
--- trunk/PDFAnnotation_SKExtensions.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/PDFAnnotation_SKExtensions.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -781,7 +781,7 @@
}
- (NSTextAlignment)scriptingAlignment {
- return NSLeftTextAlignment;
+ return NSTextAlignmentLeft;
}
- (PDFBorderStyle)scriptingBorderStyle {
@@ -854,7 +854,7 @@
return NO;
PDFView *pdfView = [(SKMainDocument *)doc pdfView];
NSPoint point = SKCenterPoint([pdfView convertRect:[self bounds]
fromPage:[self page]]);
- NSEvent *event = [NSEvent mouseEventWithType:NSRightMouseDown
+ NSEvent *event = [NSEvent mouseEventWithType:NSEventTypeRightMouseDown
location:[pdfView convertPoint:point
toView:nil]
modifierFlags:0
timestamp:0
Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/PDFPage_SKExtensions.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -302,7 +302,7 @@
NSImage *image = [[[NSImage alloc] initWithSize:destRect.size]
autorelease];
[image lockFocus];
- [pageImage drawInRect:destRect fromRect:sourceRect
operation:NSCompositeCopy fraction:1.0];
+ [pageImage drawInRect:destRect fromRect:sourceRect
operation:NSCompositingOperationCopy fraction:1.0];
[image unlockFocus];
return [image TIFFRepresentation];
Modified: trunk/PDFView_SKExtensions.m
===================================================================
--- trunk/PDFView_SKExtensions.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/PDFView_SKExtensions.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -126,7 +126,7 @@
- (void)doPdfsyncWithEvent:(NSEvent *)theEvent {
// eat up mouseDragged/mouseUp events, so we won't get their event handlers
while (YES) {
- if ([[[self window] nextEventMatchingMask: NSLeftMouseUpMask |
NSLeftMouseDraggedMask] type] == NSLeftMouseUp)
+ if ([[[self window] nextEventMatchingMask: NSEventMaskLeftMouseUp |
NSEventMaskLeftMouseDragged] type] == NSEventTypeLeftMouseUp)
break;
}
@@ -152,8 +152,8 @@
while (YES) {
- theEvent = [[self window] nextEventMatchingMask:
NSLeftMouseUpMask | NSLeftMouseDraggedMask];
- if ([theEvent type] == NSLeftMouseUp)
+ theEvent = [[self window] nextEventMatchingMask:
NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged];
+ if ([theEvent type] == NSEventTypeLeftMouseUp)
break;
// convert takes flipping and scaling into account
@@ -185,7 +185,7 @@
return NO;
NSImage *dragImage = [NSImage bitmapImageWithSize:NSMakeSize(32.0, 32.0)
scale:[self backingScale] drawingHandler:^(NSRect rect){
- [[[NSWorkspace sharedWorkspace]
iconForFileType:NSFileTypeForHFSTypeCode(kClippingTextType)] drawInRect:rect
fromRect:rect operation:NSCompositeCopy fraction:1.0 respectFlipped:YES
hints:nil];
+ [[[NSWorkspace sharedWorkspace]
iconForFileType:NSFileTypeForHFSTypeCode(kClippingTextType)] drawInRect:rect
fromRect:rect operation:NSCompositingOperationCopy fraction:1.0
respectFlipped:YES hints:nil];
}];
NSRect dragFrame = SKRectFromCenterAndSize([theEvent locationInView:self],
[dragImage size]);
@@ -316,7 +316,7 @@
- (BOOL)accessibilityPerformShowMenu {
NSRect rect = [self visibleContentRect];
NSPoint point = NSMakePoint(NSMidX(rect), floor(NSMinY(rect) + 0.75 *
NSHeight(rect)));
- NSEvent *event = [NSEvent mouseEventWithType:NSRightMouseDown
+ NSEvent *event = [NSEvent mouseEventWithType:NSEventTypeRightMouseDown
location:[self convertPoint:point
toView:nil]
modifierFlags:0
timestamp:0
Modified: trunk/QuickLook-Skim/GenerateThumbnailForURL.m
===================================================================
--- trunk/QuickLook-Skim/GenerateThumbnailForURL.m 2023-03-02 14:54:15 UTC
(rev 13334)
+++ trunk/QuickLook-Skim/GenerateThumbnailForURL.m 2023-03-02 16:39:57 UTC
(rev 13335)
@@ -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/SKAnimatedBorderlessWindow.m
===================================================================
--- trunk/SKAnimatedBorderlessWindow.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKAnimatedBorderlessWindow.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -51,7 +51,7 @@
@dynamic fadeInDuration, fadeOutDuration, backgroundImage;
- (id)initWithContentRect:(NSRect)contentRect {
- self = [super initWithContentRect:contentRect
styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
+ self = [super initWithContentRect:contentRect
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
if (self) {
defaultAlphaValue = ALPHA_VALUE;
autoHideTimeInterval = AUTO_HIDE_TIME_INTERVAL;
Modified: trunk/SKApplication.m
===================================================================
--- trunk/SKApplication.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKApplication.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -53,7 +53,7 @@
}
- (void)sendEvent:(NSEvent *)anEvent {
- if ([anEvent type] == NSApplicationDefined && [anEvent subtype] ==
SKRemoteButtonEvent) {
+ if ([anEvent type] == NSEventTypeApplicationDefined && [anEvent subtype]
== SKRemoteButtonEvent) {
id target = [self targetForAction:@selector(remoteButtonPressed:)];
if (target == nil) {
target = [[NSDocumentController sharedDocumentController]
currentDocument];
@@ -64,8 +64,8 @@
[target remoteButtonPressed:anEvent];
return;
}
- } else if ([anEvent type] == NSTabletProximity) {
- [NSEvent setCurrentPointingDeviceType:[anEvent isEnteringProximity] ?
[anEvent pointingDeviceType] : NSUnknownPointingDevice];
+ } else if ([anEvent type] == NSEventTypeTabletProximity) {
+ [NSEvent setCurrentPointingDeviceType:[anEvent isEnteringProximity] ?
[anEvent pointingDeviceType] : NSPointingDeviceTypeUnknown];
}
[super sendEvent:anEvent];
}
@@ -89,7 +89,7 @@
}
- (BOOL)willDragMouse {
- return NSLeftMouseDragged == [[self
nextEventMatchingMask:(NSLeftMouseUpMask | NSLeftMouseDraggedMask)
untilDate:[NSDate distantFuture] inMode:NSEventTrackingRunLoopMode dequeue:NO]
type];
+ return NSEventTypeLeftMouseDragged == [[self
nextEventMatchingMask:(NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged)
untilDate:[NSDate distantFuture] inMode:NSEventTrackingRunLoopMode dequeue:NO]
type];
}
- (id <SKApplicationDelegate>)delegate { return (id
<SKApplicationDelegate>)[super delegate]; }
Modified: trunk/SKApplicationController.m
===================================================================
--- trunk/SKApplicationController.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKApplicationController.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -390,7 +390,7 @@
remoteScrolling = !remoteScrolling;
[self showRemoteSwitchIndication];
} else {
- NSEvent *theEvent = [NSEvent
otherEventWithType:NSApplicationDefined
+ NSEvent *theEvent = [NSEvent
otherEventWithType:NSEventTypeApplicationDefined
location:NSZeroPoint
modifierFlags:0
timestamp:[[NSProcessInfo
processInfo] systemUptime]
Modified: trunk/SKBasePDFView.m
===================================================================
--- trunk/SKBasePDFView.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKBasePDFView.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -189,8 +189,8 @@
unichar eventChar = [theEvent firstCharacter];
NSUInteger modifiers = [theEvent standardModifierFlags];
- if ((eventChar == SKSpaceCharacter) && ((modifiers & ~NSShiftKeyMask)
== 0)) {
- eventChar = modifiers == NSShiftKeyMask ? NSPageUpFunctionKey :
NSPageDownFunctionKey;
+ if ((eventChar == SKSpaceCharacter) && ((modifiers &
~NSEventModifierFlagShift) == 0)) {
+ eventChar = modifiers == NSEventModifierFlagShift ?
NSPageUpFunctionKey : NSPageDownFunctionKey;
modifiers = 0;
}
Modified: trunk/SKBookmark.m
===================================================================
--- trunk/SKBookmark.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKBookmark.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -440,8 +440,8 @@
icon = [NSImage imageWithSize:NSMakeSize(16.0, 16.0) flipped:NO
drawingHandler:^(NSRect rect) {
[[NSColor darkGrayColor] setFill];
[NSBezierPath fillRect:NSMakeRect(8.0, 0.0, 8.0, 8.0)];
- [badge drawInRect:NSMakeRect(8.0, 0.0, 8.0, 8.0)
fromRect:NSZeroRect operation:NSCompositeDestinationAtop fraction:1.0];
- [icon drawInRect:rect fromRect:NSZeroRect
operation:NSCompositeDestinationOver fraction:1.0];
+ [badge drawInRect:NSMakeRect(8.0, 0.0, 8.0, 8.0)
fromRect:NSZeroRect operation:NSCompositingOperationDestinationAtop
fraction:1.0];
+ [icon drawInRect:rect fromRect:NSZeroRect
operation:NSCompositingOperationDestinationOver fraction:1.0];
return YES;
}];
if (type)
@@ -462,8 +462,8 @@
NSImage *genericDocImage = [[NSWorkspace sharedWorkspace]
iconForFileType:NSFileTypeForHFSTypeCode(kGenericDocumentIcon)];
NSImage *questionMark = [[NSWorkspace sharedWorkspace]
iconForFileType:NSFileTypeForHFSTypeCode(kQuestionMarkIcon)];
icon = [NSImage imageWithSize:NSMakeSize(16.0, 16.0)
flipped:NO drawingHandler:^(NSRect rect) {
- [genericDocImage drawInRect:rect fromRect:NSZeroRect
operation:NSCompositeCopy fraction:0.7];
- [questionMark drawInRect:NSMakeRect(3.0, 2.0, 10.0, 10.0)
fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:0.7];
+ [genericDocImage drawInRect:rect fromRect:NSZeroRect
operation:NSCompositingOperationCopy fraction:0.7];
+ [questionMark drawInRect:NSMakeRect(3.0, 2.0, 10.0, 10.0)
fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:0.7];
return YES;
}];
}
Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKBookmarkController.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -497,7 +497,7 @@
[openPanel setCanChooseDirectories:YES];
[openPanel setAllowedFileTypes:types];
[openPanel beginSheetModalForWindow:[self window]
completionHandler:^(NSInteger result){
- if (result == NSFileHandlingPanelOKButton) {
+ if (result == NSModalResponseOK) {
NSArray *newBookmarks = [SKBookmark
bookmarksForURLs:[openPanel URLs]];
if ([newBookmarks count] > 0) {
SKBookmark *item = nil;
@@ -601,7 +601,7 @@
}
[item setRepresentedObject:bookmark];
if (isAlternate) {
- [item setKeyEquivalentModifierMask:NSAlternateKeyMask];
+ [item setKeyEquivalentModifierMask:NSEventModifierFlagOption];
[item setAlternate:YES];
[item setImageAndSize:[bookmark alternateIcon]];
} else {
@@ -1317,7 +1317,7 @@
}
- (BOOL)previewPanel:(QLPreviewPanel *)panel handleEvent:(NSEvent *)event {
- if ([event type] == NSKeyDown) {
+ if ([event type] == NSEventTypeKeyDown) {
[outlineView keyDown:event];
return YES;
}
Modified: trunk/SKColorMenuView.m
===================================================================
--- trunk/SKColorMenuView.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKColorMenuView.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -148,13 +148,13 @@
[self setHoveredIndex:idx];
NSRect rect = [self rectAtIndex:idx];
while (YES) {
- theEvent = [[self window] nextEventMatchingMask:NSLeftMouseUpMask
| NSLeftMouseDraggedMask];
+ theEvent = [[self window]
nextEventMatchingMask:NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged];
BOOL inside = NSPointInRect([theEvent locationInView:self], rect);
[self setHoveredIndex:inside ? idx : NSNotFound];
- if ([theEvent type] == NSLeftMouseUp) {
+ if ([theEvent type] == NSEventTypeLeftMouseUp) {
if (inside) {
- BOOL isShift = ([theEvent modifierFlags] & NSShiftKeyMask)
!= 0;
- BOOL isAlt = ([theEvent modifierFlags] &
NSAlternateKeyMask) != 0;
+ BOOL isShift = ([theEvent modifierFlags] &
NSEventModifierFlagShift) != 0;
+ BOOL isAlt = ([theEvent modifierFlags] &
NSEventModifierFlagOption) != 0;
[annotation setColor:[colors objectAtIndex:idx]
alternate:isAlt updateDefaults:isShift];
[[[self enclosingMenuItem] menu] cancelTracking];
}
Modified: trunk/SKColorSwatch.m
===================================================================
--- trunk/SKColorSwatch.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKColorSwatch.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -366,9 +366,9 @@
BOOL keepOn = YES;
while (keepOn) {
- theEvent = [[self window] nextEventMatchingMask: NSLeftMouseUpMask
| NSLeftMouseDraggedMask];
+ theEvent = [[self window] nextEventMatchingMask:
NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged];
switch ([theEvent type]) {
- case NSLeftMouseDragged:
+ case NSEventTypeLeftMouseDragged:
{
if ([self isEnabled])
[[itemViews objectAtIndex:i] setHighlighted:NO];
@@ -394,7 +394,7 @@
keepOn = NO;
break;
}
- case NSLeftMouseUp:
+ case NSEventTypeLeftMouseUp:
if ([self isEnabled]) {
if ([self selects]) {
if (selectedIndex != -1 && selectedIndex == i)
@@ -716,7 +716,7 @@
- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender {
NSPoint mouseLoc = [self convertPoint:[sender draggingLocation]
fromView:nil];
- BOOL isCopy = ([NSEvent standardModifierFlags] &
NSDeviceIndependentModifierFlagsMask) == NSAlternateKeyMask;
+ BOOL isCopy = ([NSEvent standardModifierFlags] &
NSEventModifierFlagDeviceIndependentFlagsMask) == NSEventModifierFlagOption;
BOOL isMove = [sender draggingSource] == self && isCopy == NO;
NSInteger i = isCopy || isMove ? [self insertionIndexAtPoint:mouseLoc] :
[self colorIndexAtPoint:mouseLoc];
NSDragOperation dragOp = isCopy ? NSDragOperationCopy :
NSDragOperationGeneric;
@@ -738,7 +738,7 @@
NSPasteboard *pboard = [sender draggingPasteboard];
NSColor *color = [NSColor colorFromPasteboard:pboard];
NSPoint mouseLoc = [self convertPoint:[sender draggingLocation]
fromView:nil];
- BOOL isCopy = ([NSEvent standardModifierFlags] &
NSDeviceIndependentModifierFlagsMask) == NSAlternateKeyMask;
+ BOOL isCopy = ([NSEvent standardModifierFlags] &
NSEventModifierFlagDeviceIndependentFlagsMask) == NSEventModifierFlagOption;
BOOL isMove = [sender draggingSource] == self && isCopy == NO;
NSInteger i = isCopy || isMove ? [self insertionIndexAtPoint:mouseLoc] :
[self colorIndexAtPoint:mouseLoc];
if ([self isEnabled] && i != -1 &&
Modified: trunk/SKCompatibility.h
===================================================================
--- trunk/SKCompatibility.h 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKCompatibility.h 2023-03-02 16:39:57 UTC (rev 13335)
@@ -151,6 +151,58 @@
NSWindowTabbingModeDisallowed
};
+#define NSEventModifierFlagShift NSShiftKeyMask
+#define NSEventModifierFlagControl NSControlKeyMask
+#define NSEventModifierFlagOption NSAlternateKeyMask
+#define NSEventModifierFlagCommand NSCommandKeyMask
+#define NSEventModifierFlagCapsLock NSAlphaShiftKeyMask
+#define NSEventModifierFlagNumericPad NSNumericPadKeyMask
+#define NSEventModifierFlagFunction NSFunctionKeyMask
+#define NSEventModifierFlagDeviceIndependentFlagsMask
NSDeviceIndependentModifierFlagsMask
+
+#define NSEventTypeKeyDown NSKeyDown
+#define NSEventTypeLeftMouseDown NSLeftMouseDown
+#define NSEventTypeLeftMouseUp NSLeftMouseUp
+#define NSEventTypeLeftMouseDragged NSLeftMouseDragged
+#define NSEventTypeMouseMoved NSMouseMoved
+#define NSEventTypeRightMouseDown NSRightMouseDown
+#define NSEventTypeScrollWheel NSScrollWheel
+#define NSEventTypeTabletProximity NSTabletProximity
+#define NSEventTypeApplicationDefined NSApplicationDefined
+
+#define NSEventMaskLeftMouseUp NSLeftMouseUpMask
+#define NSEventMaskLeftMouseDragged NSLeftMouseDraggedMask
+#define NSEventMaskMouseEntered NSMouseEnteredMask
+#define NSEventMaskMouseExited NSMouseExitedMask
+#define NSEventMaskFlagsChanged NSFlagsChangedMask
+#define NSEventMaskPeriodic NSPeriodicMask
+
+#define NSEventSubtypeTabletProximity NSTabletProximityEventSubtype
+#define NSEventSubtypeTabletPoint NSTabletPointEventSubtype
+
+#define NSPointingDeviceTypePen NSPenPointingDevice
+#define NSPointingDeviceTypeEraser NSEraserPointingDevice
+#define NSPointingDeviceTypeUnknown NSUnknownPointingDevice
+
+#define NSTextAlignmentLeft NSLeftTextAlignment
+#define NSTextAlignmentRight NSTextAlignmentRight
+#define NSTextAlignmentCenter NSCenterTextAlignment
+
+#define NSControlSizeSmall NSSmallControlSize
+
+#define NSCompositingOperationClear NSCompositeClear
+#define NSCompositingOperationCopy NSCompositeCopy
+#define NSCompositingOperationSourceOver NSCompositeSourceOver
+#define NSCompositingOperationDestinationOver NSCompositeDestinationOver
+#define NSCompositingOperationDestinationAtop NSCompositeDestinationAtop
+#define NSCompositingOperationMultiply NSCompositeMultiply
+
+#define NSWindowStyleMaskBorderless NSBorderlessWindowMask
+#define NSWindowStyleMaskResizable NSResizableWindowMask
+#define NSWindowStyleMaskTitled NSTitledWindowMask
+#define NSWindowStyleMaskFullScreen NSFullScreenWindowMask
+#define NSWindowStyleMaskFullSizeContentView NSFullSizeContentViewWindowMask
+
@interface NSWindow (SKSierraDeclarations)
+ (NSWindowUserTabbingPreference)userTabbingPreference;
- (NSArray *)tabbedWindows;
@@ -190,6 +242,13 @@
#endif
+#if SDK_BEFORE(10_13)
+
+#define NSModalResponseOK NSFileHandlingPanelOKButton
+#define NSModalResponseCancel NSFileHandlingPanelCancelButton
+
+#endif
+
#if SDK_BEFORE(10_14)
enum {
Modified: trunk/SKDocumentController.m
===================================================================
--- trunk/SKDocumentController.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKDocumentController.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -130,7 +130,7 @@
}
[super beginOpenPanel:openPanel forTypes:inTypes
completionHandler:^(NSInteger result) {
completionHandler(result);
- if (shouldResetTab && result == NSFileHandlingPanelCancelButton)
+ if (shouldResetTab && result == NSModalResponseCancel)
[self _setTabPlusButtonWasClicked:NO];
}];
}
Modified: trunk/SKDownload.m
===================================================================
--- trunk/SKDownload.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKDownload.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -84,7 +84,7 @@
static NSImage *deleteImage = nil;
if (deleteImage == nil) {
deleteImage = [[NSImage imageWithSize:NSMakeSize(16.0, 16.0)
flipped:NO drawingHandler:^(NSRect rect){
- [[[NSWorkspace sharedWorkspace]
iconForFileType:NSFileTypeForHFSTypeCode(kToolbarDeleteIcon)]
drawInRect:NSMakeRect(-2.0, -1.0, 20.0, 20.0) fromRect:NSZeroRect
operation:NSCompositeSourceOver fraction:1.0];
+ [[[NSWorkspace sharedWorkspace]
iconForFileType:NSFileTypeForHFSTypeCode(kToolbarDeleteIcon)]
drawInRect:NSMakeRect(-2.0, -1.0, 20.0, 20.0) fromRect:NSZeroRect
operation:NSCompositingOperationSourceOver fraction:1.0];
return YES;
}] retain];
[deleteImage setAccessibilityDescription:NSLocalizedString(@"delete",
@"Accessibility description")];
@@ -96,7 +96,7 @@
static NSImage *cancelImage = nil;
if (cancelImage == nil) {
cancelImage = [[NSImage imageWithSize:NSMakeSize(16.0, 16.0)
flipped:NO drawingHandler:^(NSRect rect){
- [[NSImage imageNamed:NSImageNameStopProgressFreestandingTemplate]
drawInRect:NSInsetRect(rect, 1.0, 1.0) fromRect:NSZeroRect
operation:NSCompositeDestinationAtop fraction:1.0];
+ [[NSImage imageNamed:NSImageNameStopProgressFreestandingTemplate]
drawInRect:NSInsetRect(rect, 1.0, 1.0) fromRect:NSZeroRect
operation:NSCompositingOperationDestinationAtop fraction:1.0];
return YES;
}] retain];
[cancelImage setTemplate:YES];
@@ -109,7 +109,7 @@
static NSImage *resumeImage = nil;
if (resumeImage == nil) {
resumeImage = [[NSImage imageWithSize:NSMakeSize(16.0, 16.0)
flipped:NO drawingHandler:^(NSRect rect){
- [[NSImage imageNamed:NSImageNameRefreshFreestandingTemplate]
drawInRect:NSInsetRect(rect, 1.0, 1.0) fromRect:NSZeroRect
operation:NSCompositeDestinationAtop fraction:1.0];
+ [[NSImage imageNamed:NSImageNameRefreshFreestandingTemplate]
drawInRect:NSInsetRect(rect, 1.0, 1.0) fromRect:NSZeroRect
operation:NSCompositingOperationDestinationAtop fraction:1.0];
return YES;
}] retain];
[resumeImage setTemplate:YES];
Modified: trunk/SKDownloadController.m
===================================================================
--- trunk/SKDownloadController.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKDownloadController.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -677,7 +677,7 @@
}
- (BOOL)previewPanel:(QLPreviewPanel *)panel handleEvent:(NSEvent *)event {
- if ([event type] == NSKeyDown) {
+ if ([event type] == NSEventTypeKeyDown) {
[tableView keyDown:event];
return YES;
}
Modified: trunk/SKDownloadPreferenceController.m
===================================================================
--- trunk/SKDownloadPreferenceController.m 2023-03-02 14:54:15 UTC (rev
13334)
+++ trunk/SKDownloadPreferenceController.m 2023-03-02 16:39:57 UTC (rev
13335)
@@ -81,7 +81,7 @@
[openPanel setPrompt:NSLocalizedString(@"Select", @"Button title")];
[openPanel setDirectoryURL:downloadsFolderURL];
[openPanel beginSheetModalForWindow:[self window]
completionHandler:^(NSInteger result){
- if (result == NSFileHandlingPanelOKButton) {
+ if (result == NSModalResponseOK) {
[[NSUserDefaults standardUserDefaults]
setObject:[[[openPanel URL] path] stringByAbbreviatingWithTildeInPath]
forKey:SKDownloadsDirectoryKey];
[self updateDownloadsFolderPopUp];
}
Modified: trunk/SKDragImageView.m
===================================================================
--- trunk/SKDragImageView.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKDragImageView.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -114,11 +114,11 @@
BOOL isInside = YES;
NSPoint mouseLoc;
while(keepOn){
- theEvent = [[self window] nextEventMatchingMask: NSLeftMouseUpMask |
NSLeftMouseDraggedMask];
+ theEvent = [[self window] nextEventMatchingMask:
NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged];
mouseLoc = [theEvent locationInView:self];
isInside = [self mouse:mouseLoc inRect:[self bounds]];
switch ([theEvent type]) {
- case NSLeftMouseDragged:
+ case NSEventTypeLeftMouseDragged:
if(isInside && [delegate
respondsToSelector:@selector(draggedObjectForDragImageView:)]) {
id<NSPasteboardWriting> object = [delegate
draggedObjectForDragImageView:self];
if (object) {
@@ -137,7 +137,7 @@
keepOn = NO;
break;
}
- case NSLeftMouseUp:
+ case NSEventTypeLeftMouseUp:
keepOn = NO;
break;
default:
Modified: trunk/SKFDFParser.m
===================================================================
--- trunk/SKFDFParser.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKFDFParser.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -135,18 +135,18 @@
NSTextAlignment
SKPDFFreeTextAnnotationAlignmentFromFDFFreeTextAnnotationAlignment(NSInteger
anInt) {
switch (anInt) {
- case 0: return NSLeftTextAlignment;
- case 1: return NSCenterTextAlignment;
- case 2: return NSRightTextAlignment;
- default: return NSLeftTextAlignment;
+ case 0: return NSTextAlignmentLeft;
+ case 1: return NSTextAlignmentCenter;
+ case 2: return NSTextAlignmentRight;
+ default: return NSTextAlignmentLeft;
}
}
NSInteger
SKFDFFreeTextAnnotationAlignmentFromPDFFreeTextAnnotationAlignment(NSTextAlignment
alignment) {
switch (alignment) {
- case NSLeftTextAlignment: return 0;
- case NSRightTextAlignment: return 2;
- case NSCenterTextAlignment: return 1;
+ case NSTextAlignmentLeft: return 0;
+ case NSTextAlignmentRight: return 2;
+ case NSTextAlignmentCenter: return 1;
default: return 0;
}
}
Modified: trunk/SKFindController.m
===================================================================
--- trunk/SKFindController.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKFindController.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -137,7 +137,7 @@
}
- (IBAction)find:(id)sender {
- BOOL forward = [sender isKindOfClass:[NSSegmentedControl class]] ? [sender
selectedSegment] == 1 : ([NSEvent modifierFlags] & NSShiftKeyMask) == 0;
+ BOOL forward = [sender isKindOfClass:[NSSegmentedControl class]] ? [sender
selectedSegment] == 1 : ([NSEvent modifierFlags] & NSEventModifierFlagShift) ==
0;
[self findForward:forward];
}
Modified: trunk/SKFontWell.m
===================================================================
--- trunk/SKFontWell.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKFontWell.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -504,7 +504,7 @@
if ([self state] == NSOnState) {
[NSGraphicsContext saveGraphicsState];
- [[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositeMultiply];
+ [[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositingOperationMultiply];
[[NSColor selectedControlColor] setFill];
[NSBezierPath fillRect:NSInsetRect(frame, 1.0, 1.0)];
[NSGraphicsContext restoreGraphicsState];
Modified: trunk/SKFullScreenWindow.m
===================================================================
--- trunk/SKFullScreenWindow.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKFullScreenWindow.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -45,7 +45,7 @@
- (id)initWithScreen:(NSScreen *)screen level:(NSInteger)level
isMain:(BOOL)flag {
NSRect screenFrame = [(screen ?: [NSScreen mainScreen]) frame];
- self = [self initWithContentRect:screenFrame
styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
+ self = [self initWithContentRect:screenFrame
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
if (self) {
isMain = flag;
[self setBackgroundColor:[NSColor blackColor]];
@@ -102,7 +102,7 @@
}
- (void)sendEvent:(NSEvent *)theEvent {
- if ([theEvent type] == NSRightMouseDown || ([theEvent type] ==
NSLeftMouseDown && ([theEvent modifierFlags] & NSControlKeyMask))) {
+ if ([theEvent type] == NSEventTypeRightMouseDown || ([theEvent type] ==
NSEventTypeLeftMouseDown && ([theEvent modifierFlags] &
NSEventModifierFlagControl))) {
if ([[self windowController]
respondsToSelector:@selector(handleRightMouseDown:)] && [[self
windowController] handleRightMouseDown:theEvent])
return;
}
Modified: trunk/SKImageToolTipContext.m
===================================================================
--- trunk/SKImageToolTipContext.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKImageToolTipContext.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -152,7 +152,7 @@
[image lockFocus];
- [pageImage drawInRect:targetRect fromRect:sourceRect
operation:NSCompositeCopy fraction:1.0];
+ [pageImage drawInRect:targetRect fromRect:sourceRect
operation:NSCompositingOperationCopy fraction:1.0];
CGFloat radius = 0.5 * NSHeight(labelRect);
NSBezierPath *path = [NSBezierPath bezierPath];
Modified: trunk/SKLineWell.m
===================================================================
--- trunk/SKLineWell.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKLineWell.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -259,7 +259,7 @@
if ([self isActive]) {
[NSGraphicsContext saveGraphicsState];
- [[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositeMultiply];
+ [[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositingOperationMultiply];
[[NSColor selectedControlColor] setFill];
[NSBezierPath fillRect:NSInsetRect(bounds, 1.0, 1.0)];
[NSGraphicsContext restoreGraphicsState];
@@ -307,7 +307,7 @@
[[[NSColor textColor] colorWithAlphaComponent:0.6] setStroke];
[NSBezierPath strokeRect:NSInsetRect(rect, 0.5, 0.5)];
rect = NSInsetRect(rect, 1.0, 1.0);
- [imageRep drawInRect:rect fromRect:rect
operation:NSCompositeSourceOver fraction:1.0 respectFlipped:NO hints:nil];
+ [imageRep drawInRect:rect fromRect:rect
operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:NO
hints:nil];
}];
});
@@ -331,11 +331,11 @@
if ([self isEnabled]) {
[self setHighlighted:YES];
[self setNeedsDisplay:YES];
- NSUInteger modifiers = [theEvent modifierFlags] &
NSDeviceIndependentModifierFlagsMask;
- theEvent = [[self window] nextEventMatchingMask: NSLeftMouseUpMask |
NSLeftMouseDraggedMask];
+ NSUInteger modifiers = [theEvent modifierFlags] &
NSEventModifierFlagDeviceIndependentFlagsMask;
+ theEvent = [[self window] nextEventMatchingMask:
NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged];
[self setHighlighted:NO];
[self setNeedsDisplay:YES];
- if ([theEvent type] == NSLeftMouseDragged) {
+ if ([theEvent type] == NSEventTypeLeftMouseDragged) {
NSMutableDictionary *dict = [NSMutableDictionary
dictionaryWithObjectsAndKeys:
[NSNumber numberWithDouble:lineWidth], SKLineWellLineWidthKey,
[NSNumber numberWithInteger:style], SKLineWellStyleKey, dashPattern,
SKLineWellDashPatternKey, nil];
if ([self displayStyle] == SKLineWellDisplayStyleLine) {
@@ -352,7 +352,7 @@
} else if ([self isActive]) {
[self deactivate];
} else {
- [self activate:(modifiers & NSShiftKeyMask) == 0];
+ [self activate:(modifiers & NSEventModifierFlagShift) == 0];
}
}
}
Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKMainDocument.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -1102,7 +1102,7 @@
[oPanel setDirectoryURL:[fileURL URLByDeletingLastPathComponent]];
[oPanel setAllowedFileTypes:@[SKNotesDocumentType]];
[oPanel beginSheetModalForWindow:[self windowForSheet]
completionHandler:^(NSInteger result){
- if (result == NSFileHandlingPanelOKButton) {
+ if (result == NSModalResponseOK) {
NSURL *notesURL = [[oPanel URLs] objectAtIndex:0];
BOOL replace = (replaceNotesCheckButton &&
[replaceNotesCheckButton state] == NSOnState);
[self readNotesFromURL:notesURL replace:replace];
Modified: trunk/SKMainToolbarController.m
===================================================================
--- trunk/SKMainToolbarController.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKMainToolbarController.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -1154,7 +1154,7 @@
}
- (IBAction)zoomActualPhysical:(id)sender {
- ([NSEvent standardModifierFlags] & NSAlternateKeyMask) ?
[mainController.pdfView setPhysicalScaleFactor:1.0] : [mainController.pdfView
setScaleFactor:1.0];
+ ([NSEvent standardModifierFlags] & NSEventModifierFlagOption) ?
[mainController.pdfView setPhysicalScaleFactor:1.0] : [mainController.pdfView
setScaleFactor:1.0];
}
- (IBAction)zoomInActualOut:(id)sender {
@@ -1162,7 +1162,7 @@
if (tag == -1)
[mainController.pdfView zoomOut:sender];
else if (tag == 0)
- ([NSEvent standardModifierFlags] & NSAlternateKeyMask) ?
[mainController.pdfView setPhysicalScaleFactor:1.0] : [mainController.pdfView
setScaleFactor:1.0];
+ ([NSEvent standardModifierFlags] & NSEventModifierFlagOption) ?
[mainController.pdfView setPhysicalScaleFactor:1.0] : [mainController.pdfView
setScaleFactor:1.0];
else if (tag == 1)
[mainController.pdfView zoomIn:sender];
}
@@ -1291,8 +1291,8 @@
- (IBAction)selectColor:(id)sender {
PDFAnnotation *annotation = [mainController.pdfView currentAnnotation];
NSColor *newColor = [sender respondsToSelector:@selector(color)] ? [sender
color] : [sender respondsToSelector:@selector(representedObject)] ? [sender
representedObject] : nil;
- BOOL isShift = ([NSEvent standardModifierFlags] & NSShiftKeyMask) != 0;
- BOOL isAlt = ([NSEvent standardModifierFlags] & NSAlternateKeyMask) != 0;
+ BOOL isShift = ([NSEvent standardModifierFlags] &
NSEventModifierFlagShift) != 0;
+ BOOL isAlt = ([NSEvent standardModifierFlags] & NSEventModifierFlagOption)
!= 0;
if (isAlt == NO && [sender respondsToSelector:@selector(isAlternate)])
isAlt = [sender isAlternate];
if ([annotation isSkimNote]) {
Modified: trunk/SKMainTouchBarController.m
===================================================================
--- trunk/SKMainTouchBarController.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKMainTouchBarController.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -309,8 +309,8 @@
- (void)colorPicker:(SKColorPicker *)colorPicker didSelectColor:(NSColor
*)color {
PDFAnnotation *annotation = [mainController.pdfView currentAnnotation];
- BOOL isShift = ([NSEvent standardModifierFlags] & NSShiftKeyMask) != 0;
- BOOL isAlt = ([NSEvent standardModifierFlags] & NSAlternateKeyMask) != 0;
+ BOOL isShift = ([NSEvent standardModifierFlags] &
NSEventModifierFlagShift) != 0;
+ BOOL isAlt = ([NSEvent standardModifierFlags] & NSEventModifierFlagOption)
!= 0;
if ([annotation isSkimNote]) {
[annotation setColor:color alternate:isAlt updateDefaults:isShift];
} else {
@@ -361,7 +361,7 @@
if (tag == 0) {
[mainController.pdfView zoomOut:sender];
} else if (tag == 1) {
- ([NSEvent standardModifierFlags] & NSAlternateKeyMask) ?
[mainController.pdfView setPhysicalScaleFactor:1.0] : [mainController.pdfView
setScaleFactor:1.0];
+ ([NSEvent standardModifierFlags] & NSEventModifierFlagOption) ?
[mainController.pdfView setPhysicalScaleFactor:1.0] : [mainController.pdfView
setScaleFactor:1.0];
} else if (tag == 2) {
[mainController.pdfView zoomIn:sender];
}
Modified: trunk/SKMainWindow.m
===================================================================
--- trunk/SKMainWindow.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKMainWindow.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -47,10 +47,10 @@
@synthesize disableConstrainedFrame;
- (void)sendEvent:(NSEvent *)theEvent {
- if ([theEvent type] == NSLeftMouseDown || [theEvent type] ==
NSRightMouseDown || [theEvent type] == NSKeyDown) {
+ if ([theEvent type] == NSEventTypeLeftMouseDown || [theEvent type] ==
NSEventTypeRightMouseDown || [theEvent type] == NSEventTypeKeyDown) {
if ([[self delegate]
respondsToSelector:@selector(window:willSendEvent:)])
[[self delegate] window:self willSendEvent:theEvent];
- } else if ([theEvent type] == NSScrollWheel && ([theEvent modifierFlags] &
NSAlternateKeyMask)) {
+ } else if ([theEvent type] == NSEventTypeScrollWheel && ([theEvent
modifierFlags] & NSEventModifierFlagOption)) {
NSResponder *target = (NSResponder *)[[self contentView]
hitTest:[theEvent locationInWindow]] ?: (NSResponder *)self;
while (target && [target respondsToSelector:@selector(magnifyWheel:)]
== NO)
target = [target nextResponder];
@@ -63,7 +63,7 @@
}
- (void)keyDown:(NSEvent *)event {
- if (RUNNING_AFTER(10_12) && [event standardModifierFlags] ==
(NSCommandKeyMask | NSAlternateKeyMask)) {
+ if (RUNNING_AFTER(10_12) && [event standardModifierFlags] ==
(NSEventModifierFlagCommand | NSEventModifierFlagOption)) {
unichar eventChar = [event firstCharacter];
if (eventChar >= '1' && eventChar <= '9') {
#pragma clang diagnostic push
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKMainWindowController.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -403,7 +403,7 @@
[window setToolbarStyle:NSWindowToolbarStyleExpanded];
#pragma clang diagnostic pop
- [window setStyleMask:[window styleMask] | NSFullSizeContentViewWindowMask];
+ [window setStyleMask:[window styleMask] |
NSWindowStyleMaskFullSizeContentView];
if (mwcFlags.fullSizeContent) {
titleBarHeight = NSHeight([window frame]) - NSHeight([window
contentLayoutRect]);
[leftSideController setTopInset:titleBarHeight];
@@ -2914,9 +2914,9 @@
type = @"PDF";
[pageImage lockFocus];
- [[NSImage stampForType:type] drawInRect:rect fromRect:NSZeroRect
operation:NSCompositeSourceOver fraction:1.0];
+ [[NSImage stampForType:type] drawInRect:rect fromRect:NSZeroRect
operation:NSCompositingOperationSourceOver fraction:1.0];
if (isLocked)
- [[[NSWorkspace sharedWorkspace]
iconForFileType:NSFileTypeForHFSTypeCode(kLockedBadgeIcon)] drawInRect:rect
fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:0.5];
+ [[[NSWorkspace sharedWorkspace]
iconForFileType:NSFileTypeForHFSTypeCode(kLockedBadgeIcon)] drawInRect:rect
fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:0.5];
[pageImage unlockFocus];
[pageLabels enumerateObjectsUsingBlock:^(id label, NSUInteger i, BOOL
*stop) {
Modified: trunk/SKMainWindowController_Actions.m
===================================================================
--- trunk/SKMainWindowController_Actions.m 2023-03-02 14:54:15 UTC (rev
13334)
+++ trunk/SKMainWindowController_Actions.m 2023-03-02 16:39:57 UTC (rev
13335)
@@ -109,7 +109,7 @@
if (mwcFlags.updatingColor == 0 && [self hasOverview] == NO && [annotation
isSkimNote]) {
BOOL isFill = [colorAccessoryView state] == NSOnState && [annotation
hasInteriorColor];
BOOL isText = [textColorAccessoryView state] == NSOnState &&
[annotation isText];
- BOOL isShift = ([NSEvent standardModifierFlags] & NSShiftKeyMask) != 0;
+ BOOL isShift = ([NSEvent standardModifierFlags] &
NSEventModifierFlagShift) != 0;
mwcFlags.updatingColor = 1;
[annotation setColor:[sender color] alternate:isFill || isText
updateDefaults:isShift];
mwcFlags.updatingColor = 0;
@@ -142,7 +142,7 @@
- (IBAction)alignLeft:(id)sender {
PDFAnnotation *annotation = [pdfView currentAnnotation];
if ([self hasOverview] == NO && [annotation isSkimNote] && [annotation
isText]) {
- [(PDFAnnotationFreeText *)annotation setAlignment:NSLeftTextAlignment];
+ [(PDFAnnotationFreeText *)annotation setAlignment:NSTextAlignmentLeft];
}
}
@@ -149,7 +149,7 @@
- (IBAction)alignRight:(id)sender {
PDFAnnotation *annotation = [pdfView currentAnnotation];
if ([self hasOverview] == NO && [annotation isSkimNote] && [annotation
isText]) {
- [(PDFAnnotationFreeText *)annotation
setAlignment:NSRightTextAlignment];
+ [(PDFAnnotationFreeText *)annotation
setAlignment:NSTextAlignmentRight];
}
}
@@ -156,7 +156,7 @@
- (IBAction)alignCenter:(id)sender {
PDFAnnotation *annotation = [pdfView currentAnnotation];
if ([self hasOverview] == NO && [annotation isSkimNote] && [annotation
isText]) {
- [(PDFAnnotationFreeText *)annotation
setAlignment:NSCenterTextAlignment];
+ [(PDFAnnotationFreeText *)annotation
setAlignment:NSTextAlignmentCenter];
}
}
Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m 2023-03-02 14:54:15 UTC (rev
13334)
+++ trunk/SKMainWindowController_FullScreen.m 2023-03-02 16:39:57 UTC (rev
13335)
@@ -252,7 +252,7 @@
}
if ([[NSUserDefaults standardUserDefaults]
boolForKey:SKResizablePresentationKey]) {
- [[self window] setStyleMask:[[self window] styleMask] |
NSResizableWindowMask];
+ [[self window] setStyleMask:[[self window] styleMask] |
NSWindowStyleMaskResizable];
[[self window] setHasShadow:YES];
}
@@ -520,7 +520,7 @@
if (autoHideToolbarInFullScreen)
offset = NSHeight([window frame]) - NSHeight([window
contentLayoutRect]);
else if ([[window toolbar] isVisible] == NO)
- offset = NSHeight([NSWindow frameRectForContentRect:NSZeroRect
styleMask:NSTitledWindowMask]);
+ offset = NSHeight([NSWindow frameRectForContentRect:NSZeroRect
styleMask:NSWindowStyleMaskTitled]);
else if (fullScreenToolbarOffset > 0.0)
offset = fullScreenToolbarOffset;
else if (RUNNING_AFTER(10_15))
@@ -637,7 +637,7 @@
NSRect frame = NSRectFromString(frameString);
NSRect startFrame = [window frame];
[(SKMainWindow *)window setDisableConstrainedFrame:YES];
- [window setStyleMask:[window styleMask] & ~NSFullScreenWindowMask];
+ [window setStyleMask:[window styleMask] & ~NSWindowStyleMaskFullScreen];
for (NSView *view in [[[window standardWindowButton:NSWindowCloseButton]
superview] subviews])
if ([view isKindOfClass:[NSControl class]])
[view setAlphaValue:0.0];
Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKMainWindowController_UI.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -150,7 +150,7 @@
NSButton *button = [[NSButton alloc] init];
[button setButtonType:NSSwitchButton];
[button setTitle:title];
- [[button cell] setControlSize:NSSmallControlSize];
+ [[button cell] setControlSize:NSControlSizeSmall];
[button setTarget:self];
[button setAction:@selector(changeColorProperty:)];
[button sizeToFit];
@@ -285,7 +285,7 @@
}
- (void)windowDidMove:(NSNotification *)notification {
- if ([[notification object] isEqual:[self window]] && [[self window]
styleMask] == NSBorderlessWindowMask) {
+ if ([[notification object] isEqual:[self window]] && [[self window]
styleMask] == NSWindowStyleMaskBorderless) {
NSScreen *screen = [[self window] screen];
NSRect screenFrame = [screen frame];
if (NSEqualRects(screenFrame, [[self window] frame]) == NO) {
@@ -319,7 +319,7 @@
[[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil];
if ([pdfView temporaryToolMode] != SKNoToolMode && [pdfView window] ==
sender) {
- if ([event type] == NSLeftMouseDown) {
+ if ([event type] == NSEventTypeLeftMouseDown) {
NSView *view = [pdfView hitTest:[event locationInView:pdfView]];
if ([view isDescendantOf:[pdfView documentView]] == NO || [view
isKindOfClass:[NSTextView class]])
[pdfView setTemporaryToolMode:SKNoToolMode];
@@ -714,8 +714,8 @@
if ([ov isEqual:rightSideController.noteOutlineView]) {
NSPasteboard *pboard = [info draggingPasteboard];
if ([pboard canReadObjectForClasses:@[[NSColor class]] options:@{}]) {
- BOOL isShift = ([NSEvent standardModifierFlags] & NSShiftKeyMask)
!= 0;
- BOOL isAlt = ([NSEvent standardModifierFlags] &
NSAlternateKeyMask) != 0;
+ BOOL isShift = ([NSEvent standardModifierFlags] &
NSEventModifierFlagShift) != 0;
+ BOOL isAlt = ([NSEvent standardModifierFlags] &
NSEventModifierFlagOption) != 0;
[item setColor:[NSColor colorFromPasteboard:pboard]
alternate:isAlt updateDefaults:isShift];
return YES;
}
@@ -754,7 +754,7 @@
- (void)outlineView:(NSOutlineView *)ov didClickTableColumn:(NSTableColumn
*)tableColumn {
if ([ov isEqual:rightSideController.noteOutlineView]) {
NSTableColumn *oldTableColumn = [ov highlightedTableColumn];
- NSTableColumn *newTableColumn = ([NSEvent modifierFlags] &
NSCommandKeyMask) ? nil : tableColumn;
+ NSTableColumn *newTableColumn = ([NSEvent modifierFlags] &
NSEventModifierFlagCommand) ? nil : tableColumn;
NSMutableArray *sortDescriptors = nil;
BOOL ascending = YES;
if ([oldTableColumn isEqual:newTableColumn]) {
@@ -1276,7 +1276,7 @@
[item setRepresentedObject:annotation];
item = [menu
addItemWithTitle:[NSLocalizedString(@"Edit", @"Menu item title")
stringByAppendingEllipsis] action:@selector(editThisAnnotation:)
target:pdfView];
[item setRepresentedObject:annotation];
- [item setKeyEquivalentModifierMask:NSAlternateKeyMask];
+ [item
setKeyEquivalentModifierMask:NSEventModifierFlagOption];
[item setAlternate:YES];
}
}
@@ -1302,11 +1302,11 @@
[item setRepresentedObject:items];
item = [menu addItemWithTitle:[items count] == 1 ?
NSLocalizedString(@"Undo Auto Size Row", @"Menu item title") :
NSLocalizedString(@"Undo Auto Size Rows", @"Menu item title")
action:@selector(resetHeightOfNoteRows:) target:self];
[item setRepresentedObject:items];
- [item setKeyEquivalentModifierMask:NSAlternateKeyMask];
+ [item setKeyEquivalentModifierMask:NSEventModifierFlagOption];
[item setAlternate:YES];
[menu addItemWithTitle:NSLocalizedString(@"Auto Size All", @"Menu
item title") action:@selector(autoSizeNoteRows:) target:self];
item = [menu addItemWithTitle:NSLocalizedString(@"Undo Auto Size
All", @"Menu item title") action:@selector(resetHeightOfNoteRows:) target:self];
- [item setKeyEquivalentModifierMask:NSAlternateKeyMask];
+ [item setKeyEquivalentModifierMask:NSEventModifierFlagOption];
[item setAlternate:YES];
[menu addItemWithTitle:NSLocalizedString(@"Automatically Resize",
@"Menu item title") action:@selector(toggleAutoResizeNoteRows:) target:self];
}
Modified: trunk/SKNavigationWindow.m
===================================================================
--- trunk/SKNavigationWindow.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKNavigationWindow.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -244,7 +244,7 @@
}
- (id)init {
- self = [super initWithContentRect:NSZeroRect
styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
+ self = [super initWithContentRect:NSZeroRect
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES];
if (self) {
[self setBackgroundColor:[NSColor clearColor]];
[self setOpaque:NO];
Modified: trunk/SKNoteOutlineView.m
===================================================================
--- trunk/SKNoteOutlineView.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKNoteOutlineView.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -112,9 +112,9 @@
[[NSCursor resizeUpDownCursor] push];
- while ([theEvent type] != NSLeftMouseUp) {
- theEvent = [[self window] nextEventMatchingMask:
NSLeftMouseUpMask | NSLeftMouseDraggedMask];
- if ([theEvent type] == NSLeftMouseDragged) {
+ while ([theEvent type] != NSEventTypeLeftMouseUp) {
+ theEvent = [[self window] nextEventMatchingMask:
NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged];
+ if ([theEvent type] == NSEventTypeLeftMouseDragged) {
CGFloat currentHeight = fmax([self rowHeight],
round(startHeight + [theEvent locationInView:self].y - mouseLoc.y));
[[self delegate] outlineView:self
setHeight:currentHeight ofRowByItem:item];
[self noteHeightOfRowChanged:row animating:NO];
Modified: trunk/SKNoteWindowController.m
===================================================================
--- trunk/SKNoteWindowController.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKNoteWindowController.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -508,7 +508,7 @@
}
- (BOOL)previewPanel:(QLPreviewPanel *)panel handleEvent:(NSEvent *)event {
- if ([event type] == NSKeyDown) {
+ if ([event type] == NSEventTypeKeyDown) {
[imageView keyDown:event];
return YES;
}
Modified: trunk/SKNotesDocument.m
===================================================================
--- trunk/SKNotesDocument.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKNotesDocument.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -452,7 +452,7 @@
}
- (SKInteractionMode)interactionMode {
- return ([[self window] styleMask] & NSFullScreenWindowMask) == 0 ?
SKNormalMode : SKFullScreenMode;
+ return ([[self window] styleMask] & NSWindowStyleMaskFullScreen) == 0 ?
SKNormalMode : SKFullScreenMode;
}
- (SKInteractionMode)systemInteractionMode {
@@ -703,7 +703,7 @@
- (void)outlineView:(NSOutlineView *)ov didClickTableColumn:(NSTableColumn
*)tableColumn {
NSTableColumn *oldTableColumn = [ov highlightedTableColumn];
- NSTableColumn *newTableColumn = ([NSEvent modifierFlags] &
NSCommandKeyMask) ? nil : [ov highlightedTableColumn];
+ NSTableColumn *newTableColumn = ([NSEvent modifierFlags] &
NSEventModifierFlagCommand) ? nil : [ov highlightedTableColumn];
NSMutableArray *sortDescriptors = nil;
BOOL ascending = YES;
if ([oldTableColumn isEqual:newTableColumn]) {
@@ -869,11 +869,11 @@
[item setRepresentedObject:items];
item = [menu addItemWithTitle:[items count] == 1 ?
NSLocalizedString(@"Auto Size Row", @"Menu item title") :
NSLocalizedString(@"Auto Size Rows", @"Menu item title")
action:@selector(resetHeightOfNoteRows:) target:self];
[item setRepresentedObject:items];
- [item setKeyEquivalentModifierMask:NSAlternateKeyMask];
+ [item setKeyEquivalentModifierMask:NSEventModifierFlagOption];
[item setAlternate:YES];
[menu addItemWithTitle:NSLocalizedString(@"Auto Size All", @"Menu
item title") action:@selector(autoSizeNoteRows:) target:self];
item = [menu addItemWithTitle:NSLocalizedString(@"Auto Size All",
@"Menu item title") action:@selector(resetHeightOfNoteRows:) target:self];
- [item setKeyEquivalentModifierMask:NSAlternateKeyMask];
+ [item setKeyEquivalentModifierMask:NSEventModifierFlagOption];
[item setAlternate:YES];
[menu addItemWithTitle:NSLocalizedString(@"Automatically Resize",
@"Menu item title") action:@selector(toggleAutoResizeNoteRows:) target:self];
}
Modified: trunk/SKOutlineView.m
===================================================================
--- trunk/SKOutlineView.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKOutlineView.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -126,18 +126,18 @@
[[QLPreviewPanel sharedPreviewPanel] orderOut:nil];
else
[[QLPreviewPanel sharedPreviewPanel] makeKeyAndOrderFront:nil];
- } else if ((eventChar == SKSpaceCharacter) && modifierFlags ==
NSShiftKeyMask) {
+ } else if ((eventChar == SKSpaceCharacter) && modifierFlags ==
NSEventModifierFlagShift) {
if (supportsQuickLook == NO)
[[self enclosingScrollView] pageUp:nil];
- } else if (eventChar == NSHomeFunctionKey && (modifierFlags &
~NSFunctionKeyMask) == 0) {
+ } else if (eventChar == NSHomeFunctionKey && (modifierFlags &
~NSEventModifierFlagFunction) == 0) {
[self scrollToBeginningOfDocument:nil];
- } else if (eventChar == NSEndFunctionKey && (modifierFlags &
~NSFunctionKeyMask) == 0) {
+ } else if (eventChar == NSEndFunctionKey && (modifierFlags &
~NSEventModifierFlagFunction) == 0) {
[self scrollToEndOfDocument:nil];
} else if ((eventChar == NSDeleteCharacter || eventChar ==
NSDeleteFunctionKey) && modifierFlags == 0 && [self canDelete]) {
[self delete:self];
- } else if (eventChar == NSLeftArrowFunctionKey && (modifierFlags &
~(NSFunctionKeyMask | NSNumericPadKeyMask)) == (NSCommandKeyMask |
NSAlternateKeyMask)) {
+ } else if (eventChar == NSLeftArrowFunctionKey && (modifierFlags &
~(NSEventModifierFlagFunction | NSEventModifierFlagNumericPad)) ==
(NSEventModifierFlagCommand | NSEventModifierFlagOption)) {
[self collapseItem:nil collapseChildren:YES];
- } else if (eventChar == NSRightArrowFunctionKey && (modifierFlags &
~(NSFunctionKeyMask | NSNumericPadKeyMask)) == (NSCommandKeyMask |
NSAlternateKeyMask)) {
+ } else if (eventChar == NSRightArrowFunctionKey && (modifierFlags &
~(NSEventModifierFlagFunction | NSEventModifierFlagNumericPad)) ==
(NSEventModifierFlagCommand | NSEventModifierFlagOption)) {
[self expandItem:nil expandChildren:YES];
} else if ([typeSelectHelper handleEvent:theEvent] == NO) {
[super keyDown:theEvent];
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2023-03-02 14:54:15 UTC (rev 13334)
+++ trunk/SKPDFView.m 2023-03-02 16:39:57 UTC (rev 13335)
@@ -144,8 +144,8 @@
static char SKPDFViewDefaultsObservationContext;
-static NSUInteger moveReadingBarModifiers = NSAlternateKeyMask;
-static NSUInteger resizeReadingBarModifiers = NSAlternateKeyMask |
NSShiftKeyMask;
+static NSUInteger moveReadingBarModifiers = NSEventModifierFlagOption;
+static NSUInteger resizeReadingBarModifiers = NSEventModifierFlagOption |
NSEventModifierFlagShift;
static BOOL useToolModeCursors = NO;
@@ -1250,7 +1250,7 @@
}
- (IBAction)goToNextPage:(id)sender {
- if (RUNNING(10_12) && [NSEvent standardModifierFlags] == (NSCommandKeyMask
| NSAlternateKeyMask)) {
+ if (RUNNING(10_12) && [NSEvent standardModifierFlags] ==
(NSEventModifierFlagCommand | NSEventModifierFlagOption)) {
[self setToolMode:([self toolMode] + 1) % TOOL_MODE_COUNT];
return;
}
@@ -1262,7 +1262,7 @@
}
- (IBAction)goToPreviousPage:(id)sender {
- if (RUNNING(10_12) && [NSEvent standardModifierFlags] == (NSCommandKeyMask
| NSAlternateKeyMask)) {
+ if (RUNNING(10_12) && [NSEvent standardModifierFlags] ==
(NSEventModifierFlagCommand | NSEventModifierFlagOption)) {
[self setToolMode:([self toolMode] + TOOL_MODE_COUNT - 1) %
TOOL_MODE_COUNT];
return;
}
@@ -1274,7 +1274,7 @@
}
- (IBAction)goToFirstPage:(id)sender {
- if (RUNNING(10_12) && [NSEvent standardModifierFlags] == (NSCommandKeyMask
| NSAlternateKeyMask)) {
+ if (RUNNING(10_12) && [NSEvent standardModifierFlags] ==
(NSEventModifierFlagCommand | NSEventModifierFlagOption)) {
[self setAnnotationMode:([self annotationMode] + ANNOTATION_MODE_COUNT
- 1) % ANNOTATION_MODE_COUNT];
return;
} else {
@@ -1283,7 +1283,7 @@
}
- (IBAction)goToLastPage:(id)sender {
- if (RUNNING(10_12) && [NSEvent standardModifierFlags] == (NSCommandKeyMask
| NSAlternateKeyMask)) {
+ if (RUNNING(10_12) && [NSEvent standardModifierFlags] ==
(NSEventModifierFlagCommand | NSEventModifierFlagOption)) {
[self setAnnotationMode:([self annotationMode] + 1) %
ANNOTATION_MODE_COUNT];
return;
} else {
@@ -1839,9 +1839,9 @@
[self toggleLaserPointer:nil];
} else if (pdfvFlags.useArrowCursorInPresentation == 0 && (eventChar
== 'c') && (modifiers == 0)) {
[self nextLaserPointerColor:nil];
- } else if (pdfvFlags.useArrowCursorInPresentation == 0 && (eventChar
== 'C') && ((modifiers & ~NSShiftKeyMask) == 0)) {
+ } else if (pdfvFlags.useArrowCursorInPresentation == 0 && (eventChar
== 'C') && ((modifiers & ~NSEventModifierFlagShift) == 0)) {
[self previousLaserPointerColor:nil];
- } else if ((eventChar == '?') && ((modifiers & ~NSShiftKeyMask) == 0))
{
+ } else if ((eventChar == '?') && ((modifiers &
~NSEventModifierFlagShift) == 0)) {
[self showHelpMenu];
} else {
[super keyDown:theEvent];
@@ -1854,31 +1854,31 @@
} else if (([self toolMode] == SKTextToolMode || [self toolMode] ==
SKNoteToolMode) && currentAnnotation && editor == nil && IS_ENTER(eventChar) &&
(modifiers == 0)) {
[self editCurrentAnnotation:self];
} else if (([self toolMode] == SKTextToolMode || [self toolMode] ==
SKNoteToolMode) &&
- (eventChar == SKEscapeCharacter) && (modifiers ==
NSAlternateKeyMask)) {
+ (eventChar == SKEscapeCharacter) && (modifiers ==
NSEventModifierFlagOption)) {
[self setCurrentAnnotation:nil];
} else if (([self toolMode] == SKTextToolMode || [self toolMode] ==
SKNoteToolMode) &&
- (eventChar == NSTabCharacter) && (modifiers ==
NSAlternateKeyMask)) {
+ (eventChar == NSTabCharacter) && (modifiers ==
NSEventModifierFlagOption)) {
[self selectNextCurrentAnnotation:self];
// backtab is a bit inconsistent, it seems Shift+Tab gives a
Shift-BackTab key event, I would have expected either Shift-Tab (as for the raw
event) or BackTab (as for most shift-modified keys)
} else if (([self toolMode] == SKTextToolMode || [self toolMode] ==
SKNoteToolMode) &&
- (((eventChar == NSBackTabCharacter) && ((modifiers &
~NSShiftKeyMask) == NSAlternateKeyMask)) ||
- ((eventChar == NSTabCharacter) && (modifiers ==
(NSAlternateKeyMask | NSShiftKeyMask))))) {
+ (((eventChar == NSBackTabCharacter) && ((modifiers &
~NSEventModifierFlagShift) == NSEventModifierFlagOption)) ||
+ ((eventChar == NSTabCharacter) && (modifiers ==
(NSEventModifierFlagOption | NSEventModifierFlagShift))))) {
[self selectPreviousCurrentAnnotation:self];
} else if ([self hasReadingBar] && IS_ARROW(eventChar) && (modifiers
== moveReadingBarModifiers)) {
[self doMoveReadingBarForKey:eventChar];
} else if ([self hasReadingBar] && IS_UP_DOWN_ARROW(eventChar) &&
(modifiers == resizeReadingBarModifiers)) {
[self doResizeReadingBarForKey:eventChar];
- } else if (IS_LEFT_RIGHT_ARROW(eventChar) && (modifiers ==
(NSAlternateKeyMask | NSCommandKeyMask))) {
+ } else if (IS_LEFT_RIGHT_ARROW(eventChar) && (modifiers ==
(NSEventModifierFlagOption | NSEventModifierFlagCommand))) {
[self setToolMode:(toolMode + (eventChar ==
NSRightArrowFunctionKey ? 1 : TOOL_MODE_COUNT - 1)) % TOOL_MODE_COUNT];
- } else if (IS_UP_DOWN_ARROW(eventChar) && (modifiers ==
(NSAlternateKeyMask | NSCommandKeyMask))) {
+ } else if (IS_UP_DOWN_ARROW(eventChar) && (modifiers ==
(NSEventModifierFlagOption | NSEventModifierFlagCommand))) {
[self setAnnotationMode:(annotationMode + (eventChar ==
NSDownArrowFunctionKey ? 1 : ANNOTATION_MODE_COUNT - 1)) %
ANNOTATION_MODE_COUNT];
- } else if ([currentAnnotation isMovable] && IS_ARROW(eventChar) &&
((modifiers & ~NSShiftKeyMask) == 0)) {
- [self doMoveCurrentAnnotationForKey:eventChar byAmount:(modifiers
& NSShiftKeyMask) ? 10.0 : 1.0];
- } else if ([currentAnnotation isResizable] && IS_ARROW(eventChar) &&
(modifiers == (NSAlternateKeyMask | NSControlKeyMask) || modifiers ==
(NSShiftKeyMask | NSControlKeyMask))) {
- [self doResizeCurrentAnnotationForKey:eventChar
byAmount:(modifiers & NSShiftKeyMask) ? 10.0 : 1.0];
+ } else if ([currentAnnotation isMovable] && IS_ARROW(eventChar) &&
((modifiers & ~NSEventModifierFlagShift) == 0)) {
+ [self doMoveCurrentAnnotationForKey:eventChar byAmount:(modifiers
& NSEventModifierFlagShift) ? 10.0 : 1.0];
+ } else if ([currentAnnotation isResizable] && IS_ARROW(eventChar) &&
(modifiers == (NSEventModifierFlagOption | NSEventModifierFlagControl) ||
modifiers == (NSEventModifierFlagShift | NSEventModifierFlagControl))) {
+ [self doResizeCurrentAnnotationForKey:eventChar
byAmount:(modifiers & NSEventModifierFlagShift) ? 10.0 : 1.0];
// with some keyboard layouts, e.g. Japanese, the '=' character
requires Shift
- } else if ([currentAnnotation isResizable] && [currentAnnotation
isLine] == NO && [currentAnnotation isInk] == NO && (eventChar == '=') &&
((modifiers & ~(NSAlternateKeyMask | NSShiftKeyMask)) == NSControlKeyMask)) {
- [self doAutoSizeActiveNoteIgnoringWidth:(modifiers &
NSAlternateKeyMask) != 0];
+ } else if ([currentAnnotation isResizable] && [currentAnnotation
isLine] == NO && [currentAnnotation isInk] == NO && (eventChar == '=') &&
((modifiers & ~(NSEventModifierFlagOption | NSEventModifierFlagShift)) ==
NSEventModifierFlagControl)) {
+ [self doAutoSizeActiveNoteIgnoringWidth:(modifiers &
NSEventModifierFlagOption) != 0];
} else if ([self toolMode] == SKNoteToolMode && (eventChar == 't') &&
(modifiers == 0)) {
[self setAnnotationMode:SKFreeTextNote];
} else if ([self toolMode] == SKNoteToolMode && (eventChar == 'n') &&
(modifiers == 0)) {
@@ -1897,7 +1897,7 @@
[self setAnnotationMode:SKLineNote];
} else if ([self toolMode] == SKNoteToolMode && (eventChar == 'f') &&
(modifiers == 0)) {
[self setAnnotationMode:SKInkNote];
- } else if ((eventChar == '?') && ((modifiers & ~NSShiftKeyMask) == 0))
{
+ } else if ((eventChar == '?') && ((modifiers &
~NSEventModifierFlagShift) == 0)) {
[self showHelpMenu];
} else if ([typeSelectHelper handleEvent:theEvent] == NO) {
[super keyDown:theEvent];
@@ -1906,7 +1906,7 @@
}
}
-#define IS_TABLET_EVENT(theEvent, deviceType) (([theEvent subtype] ==
NSTabletProximityEventSubtype || [theEvent subtype] ==
NSTabletPointEventSubtype) && [NSEvent currentPointingDeviceType] == deviceType)
+#define IS_TABLET_EVENT(theEvent, deviceType) (([theEvent subtype] ==
NSEventSubtypeTabletProximity || [theEvent subtype] ==
NSEventSubtypeTabletPoint) && [NSEvent currentPointingDeviceType] == deviceType)
- (void)mouseDown:(NSEvent *)theEvent{
if ([currentAnnotation isLink])
@@ -1921,7 +1921,7 @@
PDFAreaOfInterest area = [self areaOfInterestForMouse:theEvent];
PDFAnnotation *wasCurrentAnnotation = currentAnnotation;
- if ((modifiers & NSCommandKeyMask) != 0)
+ if ((modifiers & NSEventModifierFlagCommand) != 0)
[self setTemporaryToolMode:SKNoToolMode];
if ([[self document] isLocked]) {
@@ -1930,13 +1930,13 @@
} else if (interactionMode == SKPresentationMode) {
[self setTemporaryToolMode:SKNoToolMode];
BOOL didHideMouse = pdfvFlags.cursorHidden;
- if (pdfvFlags.hideNotes == NO && [[self document] allowsNotes] &&
IS_TABLET_EVENT(theEvent, NSPenPointingDevice)) {
+ if (pdfvFlags.hideNotes == NO && [[self document] allowsNotes] &&
IS_TABLET_EVENT(theEvent, NSPointingDeviceTypePen)) {
[[NSCursor arrowCursor] set];
[self doDrawFreehandNoteWithEvent:theEvent];
[self setCurrentAnnotation:nil];
} else if ((area & kPDFLinkArea)) {
[super mouseDown:theEvent];
- } else if (([[self window] styleMask] & NSResizableWindowMask) != 0 &&
[NSApp willDragMouse]) {
+ } else if (([[self window] styleMask] & NSWindowStyleMaskResizable) !=
0 && [NSApp willDragMouse]) {
[[NSCursor closedHandCursor] set];
[self doDragWindowWithEvent:theEvent];
} else {
@@ -1950,17 +1950,17 @@
[self updateCursorForMouse:nil];
[self performSelectorOnce:@selector(doAutoHideCursor)
afterDelay:AUTO_HIDE_DELAY];
}
- } else if (modifiers == NSCommandKeyMask) {
+ } else if (modifiers == NSEventModifierFlagCommand) {
BOOL wantsLoupe = [loupeController hide];
[self doSelectSnapshotWithEvent:theEvent];
if (wantsLoupe)
[loupeController update];
- } else if (modifiers == (NSCommandKeyMask | NSShiftKeyMask)) {
+ } else if (modifiers == (NSEventModifierFlagCommand |
NSEventModifierFlagShift)) {
BOOL wantsLoupe = [loupeController hide];
[self doPdfsyncWithEvent:theEvent];
if (wantsLoupe)
[loupeController update];
- } else if (modifiers == (NSCommandKeyMask | NSAlternateKeyMask)) {
+ } else if (modifiers == (NSEventModifierFlagCommand |
NSEventModifierFlagOption)) {
BOOL wantsLoupe = [loupeController hide];
[self doMarqueeZoomWithEvent:theEvent];
if (wantsLoupe)
@@ -1976,7 +1976,7 @@
[loupeController update];
} else if ((area & kPDFPageArea) == 0) {
[self doDragWithEvent:theEvent];
- } else if (temporaryToolMode != SKNoToolMode && (modifiers &
NSCommandKeyMask) == 0) {
+ } else if (temporaryToolMode != SKNoToolMode && (modifiers &
NSEventModifierFlagCommand) == 0) {
BOOL wantsLoupe = [loupeController hide];
if (temporaryToolMode == SKZoomToolMode) {
[self doMarqueeZoomWithEvent:theEvent];
@@ -2007,7 +2007,7 @@
} else if (toolMode == SKMagnifyToolMode) {
[self setCurrentSelection:nil];
[self doMagnifyWithEvent:theEvent];
- } else if (pdfvFlags.hideNotes == NO && [[self document] allowsNotes] &&
IS_TABLET_EVENT(theEvent, NSEraserPointingDevice)) {
+ } else if (pdfvFlags.hideNotes == NO && [[self document] allowsNotes] &&
IS_TABLET_EVENT(theEvent, NSPointingDeviceTypeEraser)) {
[self doEraseAnnotationsWithEvent:theEvent];
} else if ([self doSelectAnnotationWithEvent:theEvent]) {
if ([currentAnnotation isLink]) {
@@ -2143,7 +2143,7 @@
i = [menu indexOfItemWithTarget:self
andAction:NSSelectorFromString(@"_setActualSize:")];
if (i != -1) {
item = [menu insertItemWithTitle:NSLocalizedString(@"Physical Size",
@"Menu item title") action:@selector(zoomToPhysicalSize:) target:self atIndex:i
+ 1];
- [item setKeyEquivalentModifierMask:NSAlternateKeyMask];
+ [item setKeyEquivalentModifierMask:NSEventModifierFlagOption];
[item setAlternate:YES];
}
@@ -2300,7 +2300,7 @@
if ([[NSPasteboard generalPasteboard]
canReadObjectForClasses:@[[PDFAnnotation class], [NSString class]]
options:@{}]) {
[menu insertItemWithTitle:NSLocalizedString(@"Paste", @"Menu item
title") action:@selector(paste:) keyEquivalent:@"" atIndex:0];
item = [menu insertItemWithTitle:NSLocalizedString(@"Paste",
@"Menu item title") action:@selector(alternatePaste:) keyEquivalent:@""
atIndex:1];
- [item setKeyEquivalentModifierMask:NSAlternateKeyMask];
+ [item setKeyEquivalentModifierMask:NSEventModifierFlagOption];
[item setAlternate:YES];
}
@@ -2480,8 +2480,8 @@
if ([pboard canReadItemWithDataConformingToTypes:@[NSPasteboardTypeColor,
SKPasteboardTypeLineStyle]]) {
if (highlightAnnotation) {
if ([pboard
canReadItemWithDataConformingToTypes:@[NSPasteboardTypeColor]]) {
- BOOL isShift = ([NSEvent standardModifierFlags] &
NSShiftKeyMask) != 0;
- BOOL isAlt = ([NSEvent standardModifierFlags] &
NSAlternateKeyMask) != 0;
+ BOOL isShift = ([NSEvent standardModifierFlags] &
NSEventModifierFlagShift) != 0;
+ BOOL isAlt = ([NSEvent standardModifierFlags] &
NSEventModifierFlagOption) != 0;
[highlightAnnotation setColor:[NSColor
colorFromPasteboard:pboard] alternate:isAlt updateDefaults:isShift];
performedDrag = YES;
} else if ([highlightAnnotation hasBorder]) {
@@ -3983,7 +3983,7 @@
draggedPoint->x = floor(draggedPoint->x);
draggedPoint->y = floor(draggedPoint->y);
- if (([theEvent modifierFlags] & NSShiftKeyMask)) {
+ if (([theEvent modifierFlags] & NSEventModifierFlagShift)) {
NSPoint *fixedPoint = (resizeHandle & SKMinXEdgeMask) ? &endPoint :
&startPoint;
NSPoint diffPoint = SKSubstractPoints(*draggedPoint, *fixedPoint);
CGFloat dx = fabs(diffPoint.x), dy = fabs(diffPoint.y);
@@ -4036,7 +4036,7 @@
}
}
- if (([theEvent modifierFlags] & NSShiftKeyMask) == 0) {
+ if (([theEvent modifierFlags] & NSEventModifierFlagShift) == 0) {
if ((resizeHandle & SKMaxXEdgeMask)) {
newBounds.size.width += relPoint.x;
@@ -4152,7 +4152,7 @@
CGFloat sy = fmax(1.0, NSHeight(newBounds) - 2.0 * margin) / fmax(1.0,
NSHeight(originalBounds) - 2.0 * margin);
[transform translateXBy:margin yBy:margin];
- if (([theEvent modifierFlags] & NSShiftKeyMask))
+ if (([theEvent modifierFlags] & NSEventModifierFlagShift))
[transform scaleBy:fmin(sx, sy)];
else
[transform scaleXBy:sx yBy:sy];
@@ -4220,20 +4220,20 @@
BOOL draggedAnnotation = NO;
NSEvent *lastMouseEvent = theEvent;
NSPoint offset = SKSubstractPoints(pagePoint, originalBounds.origin);
- NSUInteger eventMask = NSLeftMouseUpMask | NSLeftMouseDraggedMask;
+ NSUInteger eventMask = NSEventMaskLeftMouseUp |
NSEventMaskLeftMouseDragged;
[self
setCursorForAreaOfInterest:SKAreaOfInterestForResizeHandle(resizeHandle, page)];
if (resizeHandle == 0) {
[[NSCursor closedHandCursor] push];
[NSEvent startPeriodicEventsAfterDelay:0.1 withPeriod:0.1];
- eventMask |= NSPeriodicMask;
+ eventMask |= NSEventMaskPeriodic;
}
while (YES) {
theEvent = [[self window] nextEventMatchingMask:eventMask];
- if ([theEvent type] == NSLeftMouseUp) {
+ if ([theEvent type] == NSEventTypeLeftMouseUp) {
break;
- } else if ([theEvent type] == NSLeftMouseDragged) {
+ } else if ([theEvent type] == NSEventTypeLeftMouseDragged) {
if (currentAnnotation == nil) {
[self addAnnotationWithType:annotationMode selection:nil
page:page bounds:SKRectFromCenterAndSquareSize(originalBounds.origin, 0.0)];
}
@@ -4283,9 +4283,9 @@
NSRect bounds = [annotation bounds];
while (YES) {
- theEvent = [[self window] nextEventMatchingMask:
NSLeftMouseUpMask | NSLeftMouseDraggedMask];
+ theEvent = [[self window] nextEventMatchingMask:
NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged];
- if ([theEvent type] == NSLeftMouseUp)
+ if ([theEvent type] == NSEventTypeLeftMouseUp)
break;
NSPoint point = NSZeroPoint;
@@ -4334,7 +4334,7 @@
if (pdfvFlags.hideNotes == NO && [[self document] allowsNotes] && page !=
nil && newCurrentAnnotation != nil) {
BOOL isInk = toolMode == SKNoteToolMode && annotationMode == SKInkNote;
NSUInteger modifiers = [theEvent modifierFlags];
- if ((modifiers & NSAlternateKeyMask) && [newCurrentAnnotation
isMovable] &&
+ if ((modifiers & NSEventModifierFlagOption) && [newCurrentAnnotation
isMovable] &&
[newCurrentAnnotation resizeHandleForPoint:point scaleFactor:[self
scaleFactor]] == 0) {
// select a new copy of the annotation
PDFAnnotation *newAnnotation = [PDFAnnotation
newSkimNoteWithProperties:[newCurrentAnnotation SkimNoteProperties]];
@@ -4344,11 +4344,11 @@
newCurrentAnnotation = newAnnotation;
[newAnnotation release];
} else if (([newCurrentAnnotation isMarkup] ||
- (isInk && (newCurrentAnnotation != currentAnnotation ||
(modifiers & (NSShiftKeyMask | NSAlphaShiftKeyMask))))) &&
+ (isInk && (newCurrentAnnotation != currentAnnotation ||
(modifiers & (NSEventModifierFlagShift | NSEventModifierFlagCapsLock))))) &&
[NSApp willDragMouse]) {
// don't drag markup notes or in freehand tool mode, unless the
note was previously selected, so we can select text or draw freehand strokes
newCurrentAnnotation = nil;
- } else if ((modifiers & NSShiftKeyMask) && currentAnnotation !=
newCurrentAnnotation && [[currentAnnotation page] isEqual:[newCurrentAnnotation
page]] && [[currentAnnotation type] isEqualToString:[newCurrentAnnotation
type]]) {
+ } else if ((modifiers & NSEventModifierFlagShift) && currentAnnotation
!= newCurrentAnnotation && [[currentAnnotation page]
isEqual:[newCurrentAnnotation page]] && [[currentAnnotation type]
isEqualToString:[newCurrentAnnotation type]]) {
PDFAnnotation *newAnnotation = nil;
if ([currentAnnotation isMarkup]) {
NSString *type = [currentAnnotation type];
@@ -4392,7 +4392,7 @@
PDFPage *page = [self pageAndPoint:&point forEvent:theEvent nearest:YES];
NSWindow *window = [self window];
BOOL wasMouseCoalescingEnabled = [NSEvent isMouseCoalescingEnabled];
- BOOL isOption = ([theEvent modifierFlags] & NSAlternateKeyMask) != 0;
+ BOOL isOption = ([theEvent modifierFlags] & NSEventModifierFlagOption) !=
0;
BOOL wasOption = NO;
BOOL wantsBreak = isOption;
NSBezierPath *bezierPath = nil;
@@ -4411,7 +4411,7 @@
[layer setFillColor:NULL];
[layer setLineJoin:kCALineJoinRound];
[layer setLineCap:kCALineCapRound];
- if (([theEvent modifierFlags] & (NSShiftKeyMask | NSAlphaShiftKeyMask)) &&
[currentAnnotation isInk] && [[currentAnnotation page] isEqual:page]) {
+ if (([theEvent modifierFlags] & (NSEventModifierFlagShift |
NSEventModifierFlagCapsLock)) && [currentAnnotation isInk] &&
[[currentAnnotation page] isEqual:page]) {
[layer setStrokeColor:[[currentAnnotation color] CGColor]];
[layer setLineWidth:[currentAnnotation lineWidth]];
if ([currentAnnotation borderStyle] == kPDFBorderStyleDashed) {
@@ -4438,17 +4438,17 @@
// don't coalesce mouse event from mouse while drawing,
// but not from tablets because those fire very rapidly and lead to
serious delays
- if ([NSEvent currentPointingDeviceType] == NSUnknownPointingDevice)
+ if ([NSEvent currentPointingDeviceType] == NSPointingDeviceTypeUnknown)
[NSEvent setMouseCoalescingEnabled:NO];
while (YES) {
- theEvent = [window nextEventMatchingMask: NSLeftMouseUpMask |
NSLeftMouseDraggedMask | NSFlagsChangedMask];
+ theEvent = [window nextEventMatchingMask: NSEventMaskLeftMouseUp |
NSEventMaskLeftMouseDragged | NSEventMaskFlagsChanged];
- if ([theEvent type] == NSLeftMouseUp) {
+ if ([theEvent type] == NSEventTypeLeftMouseUp) {
break;
- } else if ([theEvent type] == NSLeftMouseDragged) {
+ } else if ([theEvent type] == NSEventTypeLeftMouseDragged) {
if (bezierPath == nil) {
bezierPath = [NSBezierPath bezierPath];
@@ -4477,7 +4477,7 @@
[layer setPath:[bezierPath CGPath]];
- } else if ((([theEvent modifierFlags] & NSAlternateKeyMask) != 0) !=
isOption) {
+ } else if ((([theEvent modifierFlags] & NSEventModifierFlagOption) !=
0) != isOption) {
isOption = isOption == NO;
wantsBreak = isOption || wasOption;
@@ -4511,10 +4511,10 @@
if (currentAnnotation) {
[self removeCurrentAnnotation:nil];
[self setCurrentAnnotation:annotation];
- } else if (([theEvent modifierFlags] & (NSShiftKeyMask |
NSAlphaShiftKeyMask))) {
+ } else if (([theEvent modifierFlags] & (NSEventModifierFlagShift |
NSEventModifierFlagCapsLock))) {
[self setCurrentAnnotation:annotation];
}
- } else if (([theEvent modifierFlags] & NSAlphaShiftKeyMask)) {
+ } else if (([theEvent modifierFlags] & NSEventModifierFlagCapsLock)) {
[self setCurrentAnnotation:nil];
}
@@ -4522,8 +4522,8 @@
- (void)doEraseAnnotationsWithEvent:(NSEvent *)theEvent {
while (YES) {
- theEvent = [[self window] nextEventMatchingMask: NSLeftMouseUpMask |
NSLeftMouseDraggedMask];
- if ([theEvent type] == NSLeftMouseUp)
+ theEvent = [[self window] nextEventMatchingMask:
NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged];
+ if ([theEvent type] == NSEventTypeLeftMouseUp)
break;
NSPoint point = NSZeroPoint;
@@ -4578,8 +4578,8 @@
while (YES) {
- theEvent = [[self window] nextEventMatchingMask:
NSLeftMouseUpMask | NSLeftMouseDraggedMask];
- if ([theEvent type] == NSLeftMouseUp)
+ theEvent = [[self window] nextEventMatchingMask:
NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged];
+ if ([theEvent type] == NSEventTypeLeftMouseUp)
break;
// we must be dragging
@@ -4608,7 +4608,7 @@
if (resizeHandle == 0) {
newRect.origin = SKAddPoints(newRect.origin, delta);
- } else if (([theEvent modifierFlags] & NSShiftKeyMask)) {
+ } else if (([theEvent modifierFlags] & NSEventModifierFlagShift)) {
CGFloat width = NSWidth(newRect);
CGFloat height = NSHeight(newRect);
CGFloat square;
@@ -4745,11 +4745,11 @@
while (YES) {
- theEvent = [[self window] nextEventMatchingMask: NSLeftMouseUpMask |
NSLeftMouseDraggedMask | NSPeriodicMask];
+ theEvent = [[self window] nextEventMatchingMask:
NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged | NSEventMaskPeriodic];
- if ([theEvent type] == NSLeftMouseUp)
+ if ([theEvent type] == NSEventTypeLeftMouseUp)
break;
- if ([theEvent type] == NSLeftMouseDragged) {
+ if ([theEvent type] == NSEventTypeLeftMouseDragged) {
lastMouseEvent = theEvent;
isDoubleClick = NO;
}
@@ -4804,7 +4804,7 @@
[NSEvent stopPeriodicEvents];
if (isDoubleClick) {
- if (([lastMouseEvent modifierFlags] & NSShiftKeyMask) != 0)
+ if (([lastMouseEvent modifierFlags] & NSEventModifierFlagShift) != 0)
[readingBar goToPreviousLine];
else
[readingBar goToNextLine];
@@ -4846,8 +4846,8 @@
while (YES) {
- theEvent = [[self window] nextEventMatchingMask: NSLeftMouseUpMask |
NSLeftMouseDraggedMask];
- if ([theEvent type] == NSLeftMouseUp)
+ theEvent = [[self window] nextEventMatchingMask:
NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged];
+ if ([theEvent type] == NSEventTypeLeftMouseUp)
break;
// dragging
@@ -4880,12 +4880,12 @@
[self makeHighlightLayerForType:SKLayerTypeRect];
while (YES) {
- theEvent = [window nextEventMatchingMask: NSLeftMouseUpMask |
NSLeftMouseDraggedMask | NSFlagsChangedMask];
+ theEvent = [window nextEventMatchingMask: NSEventMaskLeftMouseUp |
NSEventMaskLeftMouseDragged | NSEventMaskFlagsChanged];
- if ([theEvent type] == NSLeftMouseUp)
+ if ([theEvent type] == NSEventTypeLeftMouseUp)
break;
- if ([theEvent type] == NSLeftMouseDragged) {
+ if ([theEvent type] == NSEventTypeLeftMouseDragged) {
// change mouseLoc
[[[self scrollView] contentView] autoscroll:theEvent];
mouseLoc = [theEvent locationInWindow];
@@ -4897,7 +4897,7 @@
currentPoint = [[self documentView] convertPoint:mouseLoc
fromView:nil];
// center around startPoint when holding down the Shift key
- if (([theEvent modifierFlags] & NSShiftKeyMask))
+ if (([theEvent modifierFlags] & NSEventModifierFlagShift))
selRect = SKRectFromCenterAndPoint(startPoint, currentPoint);
else
selRect = SKRectFromPoints(startPoint, currentPoint);
@@ -5017,20 +5017,20 @@
NSInteger startLevel = MAX(1, [theEvent clickCount]);
[theEvent retain];
- while ([theEvent type] != NSLeftMouseUp) {
+ while ([theEvent type] != NSEventTypeLeftMouseUp) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- if ([theEvent type] != NSLeftMouseUp && [theEvent type] !=
NSLeftMouseDragged) {
+ if ([theEvent type] != NSEventTypeLeftMouseUp && [theEvent type]
!= NSEventTypeLeftMouseDragged) {
// set up the currentLevel and magnification
NSUInteger modifierFlags = [theEvent modifierFlags];
- CGFloat newMagnification = (modifierFlags &
NSAlternateKeyMask) ? LARGE_MAGNIFICATION : (modifierFlags & NSControlKeyMask)
? SMALL_MAGNIFICATION : DEFAULT_MAGNIFICATION;
- if ((modifierFlags & NSShiftKeyMask))
+ CGFloat newMagnification = (modifierFlags &
NSEventModifierFlagOption) ? LARGE_MAGNIFICATION : (modifierFlags &
NSEventModifierFlagControl) ? SMALL_MAGNIFICATION : DEFAULT_MAGNIFICATION;
+ if ((modifierFlags & NSEventModifierFlagShift))
newMagnification = 1.0 / newMagnification;
if (fabs([loupeController magnification] - newMagnification) >
0.0001) {
[loupeController setMagnification:newMagnification];
[[NSNotificationCenter defaultCenter]
postNotificationName:SKPDFViewMagnificationChangedNotification object:self];
}
- [loupeController setLevel:(modifierFlags & NSCommandKeyMask) ?
startLevel + 1 : startLevel];
+ [loupeController setLevel:(modifierFlags &
NSEventModifierFlagCommand) ? startLevel + 1 : startLevel];
}
[loupeController update];
@@ -5041,7 +5041,7 @@
break;
[theEvent release];
- theEvent = [[window nextEventMatchingMask: NSLeftMouseUpMask |
NSLeftMouseDraggedMask | NSFlagsChangedMask] retain];
+ theEvent = [[window nextEventMatchingMask: NSEventMaskLeftMouseUp
| NSEventMaskLeftMouseDragged | NSEventMaskFlagsChanged] retain];
}
[theEvent release];
@@ -5070,7 +5070,7 @@
BOOL didDrag = NO;;
// eat up mouseDragged/mouseUp events, so we won't get their event handlers
while (YES) {
- if ([[[self window] nextEventMatchingMask: NSLeftMouseUpMask |
NSLeftMouseDraggedMask] type] == NSLeftMouseUp)
+ if ([[[self window] nextEventMatchingMask: NSEventMaskLeftMouseUp |
NSEventMaskLeftMouseDragged] type] == NSEventTypeLeftMouseUp)
break;
didDrag = YES;
}
@@ -5082,8 +5082,8 @@
NSRect frame = [window frame];
NSPoint offset = SKSubstractPoints(frame.origin, [theEvent
locationOnScreen]);
while (YES) {
- theEvent = [window nextEventMatchingMask: NSLeftMouseUpMask |
NSLeftMouseDraggedMask];
- if ([theEvent type] == NSLeftMouseUp)
+ theEvent = [window nextEventMatchingMask: NSEventMaskLeftMouseUp |
NSEventMaskLeftMouseDragged];
+ if ([theEvent type] == NSEventTypeLeftMouseUp)
break;
frame.origin = SKAddPoints([theEvent locationOnScreen], offset);
[window setFrame:SKConstrainRect(frame, [[window screen] frame])
display:YES];
@@ -5119,24 +5119,24 @@
item = [menu addItemWithTitle:NSLocalizedString(@"Move Current Note",
@"Menu item title") action:@selector(moveCurrentAnnotation:)
keyEquivalent:@"\uF703"];
@@ Diff output truncated at 100000 characters. @@
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