Revision: 16514
          http://sourceforge.net/p/skim-app/code/16514
Author:   hofman
Date:     2026-09-21 14:43:07 +0000 (Mon, 21 Sep 2026)
Log Message:
-----------
use #ifdef and #ifndef directives

Modified Paths:
--------------
    trunk/SkimNotes/PDFAnnotation_SKNExtensions.h
    trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
    trunk/SkimNotes/PDFDocument_SKNExtensions.m
    trunk/SkimNotes/SKNPDFAnnotationNote.h
    trunk/SkimNotes/SKNPDFAnnotationNote.m
    trunk/SkimNotes/SKNUtilities.m

Modified: trunk/SkimNotes/PDFAnnotation_SKNExtensions.h
===================================================================
--- trunk/SkimNotes/PDFAnnotation_SKNExtensions.h       2026-09-21 09:21:36 UTC 
(rev 16513)
+++ trunk/SkimNotes/PDFAnnotation_SKNExtensions.h       2026-09-21 14:43:07 UTC 
(rev 16514)
@@ -268,7 +268,7 @@
 */
 @interface PDFAnnotation (SKNExtensions)
 
-#if !defined(PDFKIT_PLATFORM_IOS)
+#ifndef PDFKIT_PLATFORM_IOS
 /*!
     @abstract   Initializes a new Skim note annotation.  This is the 
designated initializer for a Skim note on macOS.
     @discussion This method can be implemented in subclasses to provide 
default properties for Skim notes.
@@ -332,7 +332,7 @@
 */
 + (void)setPoints:(NSArray *)points ofSkimNotePath:(PDFKitPlatformBezierPath 
*)path;
 
-#if !defined(PDFKIT_PLATFORM_IOS)
+#ifndef PDFKIT_PLATFORM_IOS
 /*!
     @abstract   Method to add a point to a path, to be used to build the path 
for a Skim note.
     @param      point The point to add to the path.
@@ -356,7 +356,7 @@
 
 #pragma mark -
 
-#if !defined(PDFKIT_PLATFORM_IOS)
+#ifndef PDFKIT_PLATFORM_IOS
 
 /*!
     @abstract    Provides methods to translate between dictionary 
representations of Skim notes and <code>PDFAnnotation</code> objects.

Modified: trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
===================================================================
--- trunk/SkimNotes/PDFAnnotation_SKNExtensions.m       2026-09-21 09:21:36 UTC 
(rev 16513)
+++ trunk/SkimNotes/PDFAnnotation_SKNExtensions.m       2026-09-21 14:43:07 UTC 
(rev 16514)
@@ -40,7 +40,7 @@
 #import "SKNPDFAnnotationNote.h"
 #import <tgmath.h>
 
-#if defined(PDFKIT_PLATFORM_IOS)
+#ifdef PDFKIT_PLATFORM_IOS
 
 #import <CoreGraphics/CoreGraphics.h>
 #import <objc/runtime.h>
@@ -141,7 +141,7 @@
         NSUInteger i;
         for (i = 0; i < MAX([array count], 4); i++)
             c[i] = [[array objectAtIndex:i] doubleValue];
-#if defined(PDFKIT_PLATFORM_IOS)
+#ifdef PDFKIT_PLATFORM_IOS
         return [UIColor colorWithRed:c[0] green:c[1] blue:c[2] alpha:c[3]];
 #else
         return [NSColor colorWithColorSpace:[NSColorSpace sRGBColorSpace] 
components:c count:4];
@@ -151,7 +151,7 @@
         c[0] = [[array objectAtIndex:0] doubleValue];
         if ([array count] == 2)
             c[1] = [[array objectAtIndex:1] doubleValue];
-#if defined(PDFKIT_PLATFORM_IOS)
+#ifdef PDFKIT_PLATFORM_IOS
         return [UIColor colorWithWhite:c[0] alpha:c[1]];
 #else
         return [NSColor colorWithColorSpace:[NSColorSpace 
genericGamma22GrayColorSpace] components:c count:2];
@@ -161,7 +161,7 @@
     }
 }
 
-#if defined(PDFKIT_PLATFORM_IOS)
+#ifdef PDFKIT_PLATFORM_IOS
 
 static UIImage *appearanceImageForAnnotation(PDFAnnotation *annotation) {
     CGRect rect = [annotation bounds];
@@ -265,7 +265,7 @@
 
 #endif
 
-#if !defined(PDFKIT_PLATFORM_IOS)
+#ifndef PDFKIT_PLATFORM_IOS
 
 #if !defined(MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MAX_ALLOWED < 
MAC_OS_X_VERSION_10_12
 @interface PDFAnnotation (SKNSierraDeclarations)
@@ -289,7 +289,7 @@
 
 char SKNIsSkimNoteKey;
 
-#if !defined(PDFKIT_PLATFORM_IOS)
+#ifndef PDFKIT_PLATFORM_IOS
 
 static inline Class SKNAnnotationClassForType(NSString *type) {
 #pragma clang diagnostic push
@@ -335,7 +335,7 @@
     if ([type hasPrefix:@"/"])
         type = [type substringFromIndex:1];
     
-#if defined(PDFKIT_PLATFORM_IOS)
+#ifdef PDFKIT_PLATFORM_IOS
     
     if ([type isEqualToString:SKNNoteString] || [type 
isEqualToString:SKNTextString] || [type isEqualToString:SKNStampString]) {
         if ([self isMemberOfClass:[PDFAnnotation class]]) {
@@ -398,7 +398,7 @@
     NSString *type = [dict objectForKey:SKNPDFAnnotationTypeKey];
     
         
-#if defined(PDFKIT_PLATFORM_IOS)
+#ifdef PDFKIT_PLATFORM_IOS
     
     if (([type isEqualToString:SKNNoteString] || [type 
isEqualToString:SKNTextString] || [type isEqualToString:SKNStampString]) && 
[self isMemberOfClass:[PDFAnnotation class]]) {
         // replace by our subclass
@@ -466,7 +466,7 @@
             [[self border] setLineWidth:0.0];
         }
         
-#if defined(PDFKIT_PLATFORM_IOS)
+#ifdef PDFKIT_PLATFORM_IOS
         
         color = [dict objectForKey:SKNPDFAnnotationInteriorColorKey];
         if ([color isKindOfClass:colorClass])
@@ -606,7 +606,7 @@
         return value;
     else if ([value isKindOfClass:[NSArray class]] == NO || [value count] == 0)
         return nil;
-#if defined(PDFKIT_PLATFORM_IOS)
+#ifdef PDFKIT_PLATFORM_IOS
     CGFloat c[5] = {0.0, 1.0, 0.0, 1.0, 1.0};
     NSUInteger i;
     for (i = 0; i < MIN([value count], 4); i++)
@@ -1018,7 +1018,7 @@
 
 + (NSArray *)pointsFromSkimNotePath:(PDFKitPlatformBezierPath *)path {
     NSMutableArray *points = [NSMutableArray array];
-#if defined(PDFKIT_PLATFORM_IOS)
+#ifdef PDFKIT_PLATFORM_IOS
     CGPathApplyWithBlock([path CGPath], ^(const CGPathElement *element){
         CGPoint *p = element->points;
         NSUInteger i = 0;
@@ -1085,7 +1085,7 @@
                 controlPoint2.y -= diff1.y / (3.0 * (d0 + d2));
             }
             
-#if defined(PDFKIT_PLATFORM_IOS)
+#ifdef PDFKIT_PLATFORM_IOS
             [path addCurveToPoint:prevPoint controlPoint1:controlPoint1 
controlPoint2:controlPoint2];
 #else
             [path curveToPoint:prevPoint controlPoint1:controlPoint1 
controlPoint2:controlPoint2];
@@ -1099,7 +1099,7 @@
         }
     }
     
-#if defined(PDFKIT_PLATFORM_IOS)
+#ifdef PDFKIT_PLATFORM_IOS
     if (iMax == 2)
         [path addLineToPoint:point];
     else if (iMax > 2)
@@ -1112,7 +1112,7 @@
 #endif
 }
 
-#if !defined(PDFKIT_PLATFORM_IOS)
+#ifndef PDFKIT_PLATFORM_IOS
 
 + (void)addPoint:(NSPoint)point toSkimNotesPath:(NSBezierPath *)path {
     NSUInteger count = [path elementCount];
@@ -1182,7 +1182,7 @@
 
 #pragma mark -
 
-#if !defined(PDFKIT_PLATFORM_IOS)
+#ifndef PDFKIT_PLATFORM_IOS
 
 @implementation PDFAnnotationCircle (SKNExtensions)
 

Modified: trunk/SkimNotes/PDFDocument_SKNExtensions.m
===================================================================
--- trunk/SkimNotes/PDFDocument_SKNExtensions.m 2026-09-21 09:21:36 UTC (rev 
16513)
+++ trunk/SkimNotes/PDFDocument_SKNExtensions.m 2026-09-21 14:43:07 UTC (rev 
16514)
@@ -42,7 +42,7 @@
 #import "NSFileManager_SKNExtensions.h"
 #import "SKNDefines.h"
 
-#if defined(PDFKIT_PLATFORM_IOS)
+#ifdef PDFKIT_PLATFORM_IOS
 
 #import <CoreGraphics/CoreGraphics.h>
 
@@ -98,7 +98,7 @@
 }
 
 static inline SKNPDFWidgetType SKNWidgetTypeForAnnotation(PDFAnnotation 
*annotation) {
-#if !defined(PDFKIT_PLATFORM_IOS)
+#ifndef PDFKIT_PLATFORM_IOS
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
     if ([annotation isKindOfClass:[PDFAnnotationTextWidget class]])
@@ -157,7 +157,7 @@
                     if (widgetType == kSKNPDFWidgetTypeButton) {
                         if ([annotation 
respondsToSelector:@selector(setButtonWidgetState:)])
                             [annotation setButtonWidgetState:[[dict 
objectForKey:SKNPDFAnnotationStateKey] integerValue]];
-#if !defined(PDFKIT_PLATFORM_IOS)
+#ifndef PDFKIT_PLATFORM_IOS
                         else if ([annotation 
respondsToSelector:@selector(setState:)])
                             [(id)annotation setState:[[dict 
objectForKey:SKNPDFAnnotationStateKey] integerValue]];
 #endif
@@ -164,7 +164,7 @@
                     } else {
                         if ([annotation 
respondsToSelector:@selector(setWidgetStringValue:)])
                             [annotation setWidgetStringValue:[dict 
objectForKey:SKNPDFAnnotationStringValueKey]];
-#if !defined(PDFKIT_PLATFORM_IOS)
+#ifndef PDFKIT_PLATFORM_IOS
                         else if ([annotation 
respondsToSelector:@selector(setStringValue:)])
                             [(id)annotation setStringValue:[dict 
objectForKey:SKNPDFAnnotationStringValueKey]];
 #endif

Modified: trunk/SkimNotes/SKNPDFAnnotationNote.h
===================================================================
--- trunk/SkimNotes/SKNPDFAnnotationNote.h      2026-09-21 09:21:36 UTC (rev 
16513)
+++ trunk/SkimNotes/SKNPDFAnnotationNote.h      2026-09-21 14:43:07 UTC (rev 
16514)
@@ -71,7 +71,7 @@
 */
 PDFKIT_EXTERN const PDFSize SKNPDFAnnotationNoteSize;
 
-#if !defined(PDFKIT_PLATFORM_IOS)
+#ifndef PDFKIT_PLATFORM_IOS
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
 /*!
@@ -88,7 +88,7 @@
     PDFKitPlatformImage *_image;
     NSAttributedString *_text;
     BOOL _drawsImage;
-#if !defined(PDFKIT_PLATFORM_IOS)
+#ifndef PDFKIT_PLATFORM_IOS
     NSTextStorage *_textStorage;
     NSArray *_texts;
 #endif

Modified: trunk/SkimNotes/SKNPDFAnnotationNote.m
===================================================================
--- trunk/SkimNotes/SKNPDFAnnotationNote.m      2026-09-21 09:21:36 UTC (rev 
16513)
+++ trunk/SkimNotes/SKNPDFAnnotationNote.m      2026-09-21 14:43:07 UTC (rev 
16514)
@@ -45,7 +45,7 @@
 
 const PDFSize SKNPDFAnnotationNoteSize = {16.0, 16.0};
 
-#if !defined(PDFKIT_PLATFORM_IOS)
+#ifndef PDFKIT_PLATFORM_IOS
 
 #import <CoreGraphics/CoreGraphics.h>
 
@@ -84,7 +84,7 @@
 @synthesize text = _text;
 @synthesize image = _image;
 @synthesize drawsImage = _drawsImage;
-#if !defined(PDFKIT_PLATFORM_IOS)
+#ifndef PDFKIT_PLATFORM_IOS
 @dynamic mutableText;
 @synthesize texts = _texts;
 #endif
@@ -166,7 +166,7 @@
     }
 }
 
-#if defined(PDFKIT_PLATFORM_IOS)
+#ifdef PDFKIT_PLATFORM_IOS
 
 - (void)setText:(NSAttributedString *)text {
     if (_text != text) {

Modified: trunk/SkimNotes/SKNUtilities.m
===================================================================
--- trunk/SkimNotes/SKNUtilities.m      2026-09-21 09:21:36 UTC (rev 16513)
+++ trunk/SkimNotes/SKNUtilities.m      2026-09-21 14:43:07 UTC (rev 16514)
@@ -167,7 +167,7 @@
     if (array)
         return array;
     if ([color isKindOfClass:[SKNColor class]]) {
-#if defined(SKIMNOTES_PLATFORM_IOS)
+#ifdef SKIMNOTES_PLATFORM_IOS
         if (CGColorSpaceGetModel(CGColorGetColorSpace([color CGColor])) == 
kCGColorSpaceModelMonochrome) {
             CGFloat w = 0.0, a = 1.0;
             [color getWhite:&w alpha:&a];
@@ -205,7 +205,7 @@
             NSUInteger i;
             for (i = 0; i < MAX([array count], 4); i++)
                 c[i] = [[array objectAtIndex:i] doubleValue];
-#if defined(SKIMNOTES_PLATFORM_IOS)
+#ifdef SKIMNOTES_PLATFORM_IOS
             return [UIColor colorWithRed:c[0] green:c[1] blue:c[2] alpha:c[3]];
 #else
             return [NSColor colorWithColorSpace:[NSColorSpace sRGBColorSpace] 
components:c count:4];
@@ -215,7 +215,7 @@
             c[0] = [[array objectAtIndex:0] doubleValue];
             if ([array count] == 2)
                 c[1] = [[array objectAtIndex:1] doubleValue];
-#if defined(SKIMNOTES_PLATFORM_IOS)
+#ifdef SKIMNOTES_PLATFORM_IOS
             return [UIColor colorWithWhite:c[0] alpha:c[1]];
 #else
             return [NSColor colorWithColorSpace:[NSColorSpace 
genericGamma22GrayColorSpace] components:c count:2];
@@ -240,7 +240,7 @@
         [data getBytes:&ch range:NSMakeRange(8, 1)];
     ch >>= 4;
     if (ch == 0xD) {
-#if !defined(SKIMNOTES_PLATFORM_IOS)
+#ifndef SKIMNOTES_PLATFORM_IOS
         @try {
 #if (!defined(MAC_OS_X_VERSION_10_13) || MAC_OS_X_VERSION_MIN_REQUIRED < 
MAC_OS_X_VERSION_10_13)
             if ([NSKeyedUnarchiver 
respondsToSelector:@selector(unarchivedObjectOfClasses:fromData:error:)] == NO)
@@ -310,7 +310,7 @@
     if (noteDicts == nil) {
         return nil;
     }
-#if !defined(PDFKIT_PLATFORM_IOS)
+#ifndef PDFKIT_PLATFORM_IOS
     if (asPlist == NO) {
 #if (!defined(MAC_OS_X_VERSION_10_13) || MAC_OS_X_VERSION_MIN_REQUIRED < 
MAC_OS_X_VERSION_10_13)
         if ([NSKeyedArchiver 
respondsToSelector:@selector(archivedDataWithRootObject:requiringSecureCoding:error:)]
 == NO)
@@ -361,7 +361,7 @@
         }
         if ((value = [dict objectForKey:NOTE_IMAGE_KEY])) {
             if ([value isKindOfClass:[SKNImage class]]) {
-#if defined(SKIMNOTES_PLATFORM_IOS)
+#ifdef SKIMNOTES_PLATFORM_IOS
                 value = UIImagePNGRepresentation(value);
 #else
                 id imageRep = [[value representations] count] == 1 ? [[value 
representations] objectAtIndex:0] : nil;

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