Revision: 14564
          http://sourceforge.net/p/skim-app/code/14564
Author:   hofman
Date:     2024-10-21 17:30:43 +0000 (Mon, 21 Oct 2024)
Log Message:
-----------
AppleScript support for drawsImage by adding image enumreator to icon type enum

Modified Paths:
--------------
    trunk/PDFAnnotationText_SKExtensions.h
    trunk/PDFAnnotationText_SKExtensions.m
    trunk/SKNPDFAnnotationNote_SKExtensions.h
    trunk/SKNPDFAnnotationNote_SKExtensions.m
    trunk/Skim.sdef

Modified: trunk/PDFAnnotationText_SKExtensions.h
===================================================================
--- trunk/PDFAnnotationText_SKExtensions.h      2024-10-21 17:07:53 UTC (rev 
14563)
+++ trunk/PDFAnnotationText_SKExtensions.h      2024-10-21 17:30:43 UTC (rev 
14564)
@@ -41,10 +41,7 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-extern NSString *SKPDFAnnotationScriptingIconTypeKey;
-
 @interface PDFAnnotationText (SKExtensions)
-@property (nonatomic) PDFTextAnnotationIconType scriptingIconType;
 @end
 
 NS_ASSUME_NONNULL_END

Modified: trunk/PDFAnnotationText_SKExtensions.m
===================================================================
--- trunk/PDFAnnotationText_SKExtensions.m      2024-10-21 17:07:53 UTC (rev 
14563)
+++ trunk/PDFAnnotationText_SKExtensions.m      2024-10-21 17:30:43 UTC (rev 
14564)
@@ -42,8 +42,6 @@
 #import "SKFDFParser.h"
 
 
-NSString *SKPDFAnnotationScriptingIconTypeKey = @"scriptingIconType";
-
 @implementation PDFAnnotationText (SKExtensions)
 
 - (NSString *)fdfString {
@@ -78,7 +76,6 @@
     static NSSet *customTextScriptingKeys = nil;
     if (customTextScriptingKeys == nil) {
         NSMutableSet *customKeys = [[super customScriptingKeys] mutableCopy];
-        [customKeys addObject:SKPDFAnnotationScriptingIconTypeKey];
         [customKeys removeObject:SKNPDFAnnotationLineWidthKey];
         [customKeys removeObject:SKNPDFAnnotationBorderStyleKey];
         [customKeys removeObject:SKNPDFAnnotationDashPatternKey];
@@ -87,14 +84,4 @@
     return customTextScriptingKeys;
 }
 
-- (PDFTextAnnotationIconType)scriptingIconType {
-    return [self iconType];
-}
-
-- (void)setScriptingIconType:(PDFTextAnnotationIconType)iconType {
-    if ([self isEditable]) {
-        [self setIconType:iconType];
-    }
-}
-
 @end

Modified: trunk/SKNPDFAnnotationNote_SKExtensions.h
===================================================================
--- trunk/SKNPDFAnnotationNote_SKExtensions.h   2024-10-21 17:07:53 UTC (rev 
14563)
+++ trunk/SKNPDFAnnotationNote_SKExtensions.h   2024-10-21 17:30:43 UTC (rev 
14564)
@@ -43,6 +43,7 @@
 NS_ASSUME_NONNULL_BEGIN
 
 extern NSString *SKPDFAnnotationRichTextKey;
+extern NSString *SKPDFAnnotationScriptingIconTypeKey;
 
 enum {
     kSKNPDFTextAnnotationIconImage = 7
@@ -51,6 +52,7 @@
 @interface SKNPDFAnnotationNote (SKExtensions)
 @property (nonatomic, nullable, readonly) id richText;
 @property (nonatomic) PDFTextAnnotationIconType extendedIconType;
+@property (nonatomic) PDFTextAnnotationIconType scriptingIconType;
 @end
 
 NS_ASSUME_NONNULL_END

Modified: trunk/SKNPDFAnnotationNote_SKExtensions.m
===================================================================
--- trunk/SKNPDFAnnotationNote_SKExtensions.m   2024-10-21 17:07:53 UTC (rev 
14563)
+++ trunk/SKNPDFAnnotationNote_SKExtensions.m   2024-10-21 17:30:43 UTC (rev 
14564)
@@ -49,6 +49,8 @@
 
 NSString *SKPDFAnnotationRichTextKey = @"richText";
 
+NSString *SKPDFAnnotationScriptingIconTypeKey = @"scriptingIconType";
+
 @interface SKNPDFAnnotationNote (SKPrivateDeclarations)
 - (NSTextStorage *)mutableText;
 - (NSArray *)texts;
@@ -134,6 +136,7 @@
         NSMutableSet *customKeys = [[super customScriptingKeys] mutableCopy];
 #pragma clang diagnostic pop
         [customKeys addObject:SKPDFAnnotationRichTextKey];
+        [customKeys addObject:SKPDFAnnotationScriptingIconTypeKey];
         customNoteScriptingKeys = [customKeys copy];
     }
     return customNoteScriptingKeys;
@@ -163,4 +166,14 @@
         return [[NSScriptCoercionHandler sharedCoercionHandler] 
coerceValue:value toClass:[NSTextStorage class]];
 }
 
+- (PDFTextAnnotationIconType)scriptingIconType {
+    return [self iconType];
+}
+
+- (void)setScriptingIconType:(PDFTextAnnotationIconType)iconType {
+    if ([self isEditable]) {
+        [self setIconType:iconType];
+    }
+}
+
 @end

Modified: trunk/Skim.sdef
===================================================================
--- trunk/Skim.sdef     2024-10-21 17:07:53 UTC (rev 14563)
+++ trunk/Skim.sdef     2024-10-21 17:30:43 UTC (rev 14564)
@@ -1426,6 +1426,10 @@
                 description="Insert icon.">
                 <cocoa integer-value="6"/>
             </enumerator>
+            <enumerator name="image icon" code="IImg"
+                description="Image icon.">
+                <cocoa integer-value="7"/>
+            </enumerator>
         </enumeration>
 
         <enumeration name="line ending style" code="LESE" inline="0">

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