Revision: 12198
          http://sourceforge.net/p/skim-app/code/12198
Author:   hofman
Date:     2021-03-10 17:11:52 +0000 (Wed, 10 Mar 2021)
Log Message:
-----------
use CGContext property of NSGraphicsContext, as we target 10.10

Modified Paths:
--------------
    trunk/NSImage_SKExtensions.m
    trunk/QuickLook-Skim/GenerateThumbnailForURL.m
    trunk/SKColorSwatch.m
    trunk/SKHighlightingTableRowView.m
    trunk/SKPDFView.m
    trunk/SKReadingBar.m

Modified: trunk/NSImage_SKExtensions.m
===================================================================
--- trunk/NSImage_SKExtensions.m        2021-03-10 17:05:36 UTC (rev 12197)
+++ trunk/NSImage_SKExtensions.m        2021-03-10 17:11:52 UTC (rev 12198)
@@ -307,13 +307,13 @@
     NSImage *image = [[[NSImage alloc] initWithSize:NSMakeSize(24.0, 24.0)] 
autorelease];;
     if (RUNNING_BEFORE(10_11)) {
         [image lockFocus];
-        CGContextDrawShading([[NSGraphicsContext currentContext] 
graphicsPort], shading);
+        CGContextDrawShading([[NSGraphicsContext currentContext] CGContext], 
shading);
         [image unlockFocus];
     } else {
         NSSize size = NSMakeSize(24.0, 24.0);
         CGFloat scale;
         void (^drawingHandler)(NSRect) = ^(NSRect rect){
-            CGContextDrawShading([[NSGraphicsContext currentContext] 
graphicsPort], shading);
+            CGContextDrawShading([[NSGraphicsContext currentContext] 
CGContext], shading);
         };
         for (scale = 1.0; scale <= 8.0; scale *= 2.0)
             [image addRepresentation:[NSBitmapImageRep imageRepWithSize:size 
scale:scale drawingHandler:drawingHandler]];

Modified: trunk/QuickLook-Skim/GenerateThumbnailForURL.m
===================================================================
--- trunk/QuickLook-Skim/GenerateThumbnailForURL.m      2021-03-10 17:05:36 UTC 
(rev 12197)
+++ trunk/QuickLook-Skim/GenerateThumbnailForURL.m      2021-03-10 17:11:52 UTC 
(rev 12198)
@@ -88,7 +88,7 @@
 // assumes that the current NSGraphicsContext is the destination
 static void drawAttributedStringInCurrentContext(NSAttributedString 
*attrString)
 {
-    CGContextRef ctxt = [[NSGraphicsContext currentContext] graphicsPort];
+    CGContextRef ctxt = [[NSGraphicsContext currentContext] CGContext];
     
     NSTextStorage *textStorage = createTextStorage();
     [textStorage beginEditing];

Modified: trunk/SKColorSwatch.m
===================================================================
--- trunk/SKColorSwatch.m       2021-03-10 17:05:36 UTC (rev 12197)
+++ trunk/SKColorSwatch.m       2021-03-10 17:11:52 UTC (rev 12198)
@@ -938,7 +938,7 @@
         NSColor *aColor = color;
         if (disabled) {
             aColor = [aColor colorUsingColorSpace:[NSColorSpace 
genericGamma22GrayColorSpace]];
-            CGContextSetAlpha([[NSGraphicsContext currentContext] 
graphicsPort], 0.5);
+            CGContextSetAlpha([[NSGraphicsContext currentContext] CGContext], 
0.5);
         }
         
         [[NSBezierPath bezierPathWithRoundedRect:rect xRadius:2.0 yRadius:2.0] 
addClip];

Modified: trunk/SKHighlightingTableRowView.m
===================================================================
--- trunk/SKHighlightingTableRowView.m  2021-03-10 17:05:36 UTC (rev 12197)
+++ trunk/SKHighlightingTableRowView.m  2021-03-10 17:11:52 UTC (rev 12198)
@@ -98,7 +98,7 @@
         CGFunctionRef function = CGFunctionCreate((void *)&color, 1, domain, 
4, range, &callbacks);
         CGShadingRef shading = CGShadingCreateAxial(colorSpace, 
CGPointMake(NSMinX(rect), 0.0), CGPointMake(NSMaxX(rect), 0.0), function, 
false, false);
         CGColorSpaceRelease(colorSpace);
-        CGContextDrawShading([[NSGraphicsContext currentContext] 
graphicsPort], shading);
+        CGContextDrawShading([[NSGraphicsContext currentContext] CGContext], 
shading);
         CGShadingRelease(shading);
     }
     

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2021-03-10 17:05:36 UTC (rev 12197)
+++ trunk/SKPDFView.m   2021-03-10 17:11:52 UTC (rev 12198)
@@ -531,7 +531,7 @@
     } else {
         // Let PDFView do most of the hard work.
         [super drawPage:pdfPage];
-        [self drawPageHighlights:pdfPage toContext:[[NSGraphicsContext 
currentContext] graphicsPort]];
+        [self drawPageHighlights:pdfPage toContext:[[NSGraphicsContext 
currentContext] CGContext]];
     }
 }
 
@@ -4756,7 +4756,7 @@
                 [[NSGraphicsContext currentContext] setShouldAntialias:[self 
shouldAntiAlias]];
                 [[NSGraphicsContext currentContext] 
setImageInterpolation:interpolation];
                 if ([PDFView 
instancesRespondToSelector:@selector(drawPage:toContext:)])
-                    [self drawPage:page toContext:[[NSGraphicsContext 
currentContext] graphicsPort]];
+                    [self drawPage:page toContext:[[NSGraphicsContext 
currentContext] CGContext]];
                 else
                     [self drawPage:page];
                 [[NSGraphicsContext currentContext] 
setImageInterpolation:NSImageInterpolationDefault];

Modified: trunk/SKReadingBar.m
===================================================================
--- trunk/SKReadingBar.m        2021-03-10 17:05:36 UTC (rev 12197)
+++ trunk/SKReadingBar.m        2021-03-10 17:11:52 UTC (rev 12198)
@@ -286,7 +286,7 @@
 }
 
 - (void)drawForPage:(PDFPage *)pdfPage withBox:(PDFDisplayBox)box 
active:(BOOL)active {
-    CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
+    CGContextRef context = [[NSGraphicsContext currentContext] CGContext];
     [pdfPage transformContext:context forBox:box];
     [self drawForPage:pdfPage withBox:box inContext:context];
 }

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