Revision: 13716
          http://sourceforge.net/p/skim-app/code/13716
Author:   hofman
Date:     2023-11-01 22:28:12 +0000 (Wed, 01 Nov 2023)
Log Message:
-----------
Remove some diagnostic escapes. Use CGGlyph instead of NSGlyph.

Modified Paths:
--------------
    trunk/NSImage_SKExtensions.m
    trunk/PDFDocument_SKExtensions.m
    trunk/SKColorPicker.m
    trunk/SKHighlightingTableRowView.m
    trunk/SKImageToolTipContext.m
    trunk/SKMainWindowController.m
    trunk/SKPDFView.m
    trunk/SKThumbnailView.m

Modified: trunk/NSImage_SKExtensions.m
===================================================================
--- trunk/NSImage_SKExtensions.m        2023-11-01 18:22:59 UTC (rev 13715)
+++ trunk/NSImage_SKExtensions.m        2023-11-01 22:28:12 UTC (rev 13716)
@@ -331,19 +331,14 @@
             [manager addTextContainer:container];
             
             NSRange glyphRange = [manager 
glyphRangeForTextContainer:container];
-            NSGlyph glyphArray[glyphRange.length];
-            // NSGlyph based methods for NSLayoutManager were deprecated in 
10.10
-            // but the NSBezierPath methods for CGGlyph was only added in 10.13
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-            NSUInteger glyphCount = [manager getGlyphs:glyphArray 
range:glyphRange];
-#pragma clang diagnostic pop
+            CGGlyph glyphArray[glyphRange.length];
+            NSUInteger glyphCount = [manager getGlyphsInRange:glyphRange 
glyphs:glyphArray properties:NULL characterIndexes:NULL bidiLevels:NULL];
             CGFloat width = NSWidth([manager 
boundingRectForGlyphRange:glyphRange inTextContainer:container]);
             
             NSBezierPath *path = [NSBezierPath bezierPath];
             [path moveToPoint:NSMakePoint(0.5 * (NSWidth(rect) - width), 0.5 * 
(NSHeight(rect) - [font capHeight]))];
-            [path appendBezierPathWithGlyphs:glyphArray count:glyphCount 
inFont:font];
-            
+            [path appendBezierPathWithCGGlyphs:glyphArray count:glyphCount 
inFont:font];
+
             NSBezierPath *mask = [NSBezierPath bezierPathWithRect:rect];
             [mask appendBezierPath:path];
             [mask setWindingRule:NSEvenOddWindingRule];

Modified: trunk/PDFDocument_SKExtensions.m
===================================================================
--- trunk/PDFDocument_SKExtensions.m    2023-11-01 18:22:59 UTC (rev 13715)
+++ trunk/PDFDocument_SKExtensions.m    2023-11-01 22:28:12 UTC (rev 13716)
@@ -271,9 +271,6 @@
     return angles;
 }
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
-
 - (BOOL)allowsNotes {
     return [self isLocked] == NO && [self allowsCommenting];
 }
@@ -282,8 +279,6 @@
     return [self allowsCommenting];
 }
 
-#pragma clang diagnostic pop
-
 - (NSDocument *)containingDocument {
     NSDocument *document = nil;
     

Modified: trunk/SKColorPicker.m
===================================================================
--- trunk/SKColorPicker.m       2023-11-01 18:22:59 UTC (rev 13715)
+++ trunk/SKColorPicker.m       2023-11-01 22:28:12 UTC (rev 13716)
@@ -54,16 +54,13 @@
 - (id)init {
     self = [super init];
     if (self) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
-        scrubber = [[NSClassFromString(@"NSScrubber") alloc] 
initWithFrame:NSMakeRect(0.0, 0.0, 180, 22.0)];
+        scrubber = [[NSScrubber alloc] initWithFrame:NSMakeRect(0.0, 0.0, 180, 
22.0)];
         [scrubber setDelegate:self];
         [scrubber setDataSource:self];
         [scrubber setScrubberLayout:[[[NSScrubberProportionalLayout alloc] 
initWithNumberOfVisibleItems:[[self colors] count]] autorelease]];
-        [scrubber registerClass:[NSClassFromString(@"NSScrubberItemView") 
class] forItemIdentifier:COLOR_IDENTIFIER];
-        [scrubber 
setSelectionOverlayStyle:[NSClassFromString(@"NSScrubberSelectionStyle") 
outlineOverlayStyle]];
+        [scrubber registerClass:[NSScrubberItemView class] 
forItemIdentifier:COLOR_IDENTIFIER];
+        [scrubber setSelectionOverlayStyle:[NSScrubberSelectionStyle 
outlineOverlayStyle]];
         [scrubber reloadData];
-#pragma clang diagnostic pop
         
         NSView *view = [[[NSView alloc] initWithFrame:NSMakeRect(0.0, 0.0, 
180, 30.0)] autorelease];
         NSArray *constraints = @[
@@ -73,11 +70,8 @@
             [NSLayoutConstraint constraintWithItem:scrubber 
attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil 
attribute:NSLayoutAttributeNotAnAttribute multiplier:0.0 constant:22.0]];
         [scrubber setTranslatesAutoresizingMaskIntoConstraints:NO];
         [view addSubview:scrubber];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
         [NSLayoutConstraint activateConstraints:constraints];
-#pragma clang diagnostic pop
-
+        
         [self setView:view];
         
         [[NSUserDefaultsController sharedUserDefaultsController] 
addObserver:self forKey:SKSwatchColorsKey 
context:&SKColorPickerDefaultsObservationContext];

Modified: trunk/SKHighlightingTableRowView.m
===================================================================
--- trunk/SKHighlightingTableRowView.m  2023-11-01 18:22:59 UTC (rev 13715)
+++ trunk/SKHighlightingTableRowView.m  2023-11-01 22:28:12 UTC (rev 13716)
@@ -80,10 +80,7 @@
             [highlightView setAutoresizingMask:NSViewWidthSizable | 
NSViewHeightSizable];
             [self addSubview:highlightView positioned:NSWindowBelow 
relativeTo:nil];
             [highlightView setMaterial:NSVisualEffectMaterialSelection];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
             [highlightView setEmphasized:[self isEmphasized]];
-#pragma clang diagnostic pop
         }
         [self updateHighlightMask];
     } else if (highlightView) {
@@ -122,10 +119,7 @@
     [super setEmphasized:emphasized];
     if (supportsHighlights) {
         if (RUNNING_AFTER(10_15))
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
             [highlightView setEmphasized:emphasized];
-#pragma clang diagnostic pop
         else if ([self isSelected] == NO && [self highlightLevel] > 0)
             [self setNeedsDisplay:YES];
     }

Modified: trunk/SKImageToolTipContext.m
===================================================================
--- trunk/SKImageToolTipContext.m       2023-11-01 18:22:59 UTC (rev 13715)
+++ trunk/SKImageToolTipContext.m       2023-11-01 22:28:12 UTC (rev 13716)
@@ -193,10 +193,7 @@
 
 - (NSImage *)toolTipImageWithScale:(CGFloat)scale {
     PDFSelection *sel = [self copy];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
     [sel setColor:[NSColor findHighlightColor]];
-#pragma clang diagnostic pop
     NSArray *selections = @[sel];
     [sel release];
     return [[self destination] toolTipImageWithOffset:NSMakePoint(-50.0, 20.0) 
scale:scale selections:selections label:nil];
@@ -209,10 +206,7 @@
 
 - (NSImage *)toolTipImageWithScale:(CGFloat)scale {
     NSArray *selections = [[[NSArray alloc] initWithArray:[self matches] 
copyItems:YES] autorelease];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
     [selections setValue:[NSColor findHighlightColor] forKey:@"color"];
-#pragma clang diagnostic pop
     return [[[selections firstObject] destination] 
toolTipImageWithOffset:NSMakePoint(-50.0, 20.0) scale:scale 
selections:selections label:[self label]];
 }
 

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2023-11-01 18:22:59 UTC (rev 13715)
+++ trunk/SKMainWindowController.m      2023-11-01 22:28:12 UTC (rev 13716)
@@ -2028,10 +2028,7 @@
         }
         
         NSArray *highlights = [[NSArray alloc] initWithArray:findResults 
copyItems:YES];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
         [highlights setValue:[NSColor findHighlightColor] forKey:@"color"];
-#pragma clang diagnostic pop
         [pdfView setHighlightedSelections:highlights];
         [highlights release];
         

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2023-11-01 18:22:59 UTC (rev 13715)
+++ trunk/SKPDFView.m   2023-11-01 22:28:12 UTC (rev 13716)
@@ -3352,7 +3352,10 @@
 #pragma mark Dark mode
 
 - (void)viewDidChangeEffectiveAppearance {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpartial-availability"
     [super viewDidChangeEffectiveAppearance];
+#pragma clang diagnostic pop
     [loupeController updateColorFilters];
 }
 

Modified: trunk/SKThumbnailView.m
===================================================================
--- trunk/SKThumbnailView.m     2023-11-01 18:22:59 UTC (rev 13715)
+++ trunk/SKThumbnailView.m     2023-11-01 22:28:12 UTC (rev 13716)
@@ -198,10 +198,7 @@
                 [self addSubview:imageHighlightView positioned:NSWindowBelow 
relativeTo:nil];
                 [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(updateImageHighlightMask:) 
name:NSViewFrameDidChangeNotification object:imageHighlightView];
             }
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
             [imageHighlightView setEmphasized:[self isMenuHighlighted]];
-#pragma clang diagnostic pop
             [self updateImageHighlightMask:nil];
         } else if (imageHighlightView) {
             [[NSNotificationCenter defaultCenter] removeObserver:self 
name:NSViewFrameDidChangeNotification object:imageHighlightView];
@@ -233,10 +230,7 @@
         if ([self isSelected] || [self highlightLevel] > 0) {
             if (labelHighlightView == nil) {
                 labelHighlightView = [self newHighlightView];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
                 [labelHighlightView setEmphasized:[[self window] isKeyWindow]];
-#pragma clang diagnostic pop
                 [labelHighlightView setFrame:[labelView frame]];
                 [labelHighlightView setAutoresizingMask:NSViewWidthSizable | 
NSViewMaxYMargin];
                 [self addSubview:labelHighlightView positioned:NSWindowBelow 
relativeTo:nil];
@@ -391,10 +385,7 @@
     if ([self isSelected] || [self highlightLevel] > 0) {
         [self updateBackgroundStyle];
         if (RUNNING_AFTER(10_15))
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
             [labelHighlightView setEmphasized:[[self window] isKeyWindow]];
-#pragma clang diagnostic pop
         else
             [self setNeedsDisplayInRect:[labelView frame]];
     }

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



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to