Browse Source

【偏好设置】批注模块,线条设置项调式

tangchao 1 year ago
parent
commit
d65b056262

+ 56 - 0
PDF Office/PDF Master/Class/Preference/Tools/KMPreferenceCommon.swift

@@ -0,0 +1,56 @@
+//
+//  KMPreferenceCommon.swift
+//  PDF Reader Pro
+//
+//  Created by tangchao on 2024/1/16.
+//
+
+import Foundation
+
+func KMPreferenceKeyToCKey(pKey: KMPreferenceKey) -> String? {
+    // freeText
+    if pKey == KMPreference.freeTextNoteLineWidthKey {
+        return CFreeTextNoteLineWidthKey
+    } else if pKey == KMPreference.freeTextNoteLineStyleKey {
+        return CFreeTextNoteLineStyleKey
+    } else if pKey == KMPreference.freeTextNoteDashPatternKey {
+        return CFreeTextNoteDashPatternKey
+    }
+    // Line
+    else if pKey == KMPreference.lineNoteLineWidthKey {
+        return CLineNoteLineWidthKey
+    } else if pKey == KMPreference.lineNoteLineStyleKey {
+        return CLineNoteLineStyleKey
+    } else if pKey == KMPreference.lineNoteDashPatternKey {
+        return CLineNoteDashPatternKey
+    } else if pKey == KMPreference.lineNoteStartLineStyleKey {
+        return CLineNoteStartLineStyleKey
+    } else if pKey == KMPreference.lineNoteEndLineStyleKey {
+        return CLineNoteEndLineStyleKey
+    }
+    // freehand
+    else if pKey == KMPreference.inkNoteLineWidthKey {
+        return CInkNoteLineWidthKey
+    } else if pKey == KMPreference.inkNoteLineStyleKey {
+        return CInkNoteLineStyleKey
+    } else if pKey == KMPreference.inkNoteDashPatternKey {
+        return CInkNoteDashPatternKey
+    }
+    // circle
+    else if pKey == KMPreference.circleNoteLineWidthKey {
+        return CCircleNoteLineWidthKey
+    } else if pKey == KMPreference.circleNoteLineStyleKey {
+        return CCircleNoteLineStyleKey
+    } else if pKey == KMPreference.circleNoteDashPatternKey {
+        return CCircleNoteDashPatternKey
+    }
+    // rect
+    else if pKey == KMPreference.squareNoteLineWidthKey {
+        return CSquareNoteLineWidthKey
+    } else if pKey == KMPreference.squareNoteLineStyleKey {
+        return CSquareNoteLineStyleKey
+    } else if pKey == KMPreference.squareNoteDashPatternKey {
+        return CSquareNoteDashPatternKey
+    }
+    return nil
+}

+ 5 - 0
PDF Office/PDF Master/Class/Preference/Tools/KMPreferenceManager.swift

@@ -1684,6 +1684,11 @@ extension KMPreferenceManager {
         } else if (key == KMMarkupNoteFontSizeKey) {
 //            UserDefaults.standard.set(data, forKey: CFreeTextNoteFontSizeKey)
 //            UserDefaults.standard.synchronize()
+        } else {
+            if let cKey = KMPreferenceKeyToCKey(pKey: key) {
+                UserDefaults.standard.set(data, forKey: cKey)
+                UserDefaults.standard.synchronize()
+            }
         }
     }
     

+ 8 - 0
PDF Office/PDF Reader Pro.xcodeproj/project.pbxproj

@@ -4587,6 +4587,9 @@
 		BBFBE74B28DD7DDE008B2335 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BBFBE6C328DD7B98008B2335 /* Main.storyboard */; };
 		BBFBE74C28DD7DE4008B2335 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BBFBE6F228DD7C21008B2335 /* Assets.xcassets */; };
 		BBFBE74D28DD7DE8008B2335 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BBFBE72128DD7C43008B2335 /* Assets.xcassets */; };
+		BBFCCE082B56988C003742B3 /* KMPreferenceCommon.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBFCCE072B56988C003742B3 /* KMPreferenceCommon.swift */; };
+		BBFCCE092B56988C003742B3 /* KMPreferenceCommon.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBFCCE072B56988C003742B3 /* KMPreferenceCommon.swift */; };
+		BBFCCE0A2B56988C003742B3 /* KMPreferenceCommon.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBFCCE072B56988C003742B3 /* KMPreferenceCommon.swift */; };
 		BBFD2B122AEFAAF70016C456 /* KMBatchOperateBaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBFD2B112AEFAAF70016C456 /* KMBatchOperateBaseViewController.swift */; };
 		BBFD2B142AEFAB8F0016C456 /* KMOperationQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBFD2B132AEFAB8F0016C456 /* KMOperationQueue.swift */; };
 		BBFD2B162AEFAC9C0016C456 /* KMBatchOperateBaseViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BBFD2B152AEFAC9B0016C456 /* KMBatchOperateBaseViewController.xib */; };
@@ -6619,6 +6622,7 @@
 		BBFBE73528DD7C43008B2335 /* PDF Reader Pro DMGUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "PDF Reader Pro DMGUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
 		BBFBE73928DD7C43008B2335 /* PDF_ Master_DMGUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PDF_ Master_DMGUITests.swift"; sourceTree = "<group>"; };
 		BBFBE73B28DD7C43008B2335 /* PDF_ Master_DMGUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PDF_ Master_DMGUITestsLaunchTests.swift"; sourceTree = "<group>"; };
+		BBFCCE072B56988C003742B3 /* KMPreferenceCommon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPreferenceCommon.swift; sourceTree = "<group>"; };
 		BBFD2B112AEFAAF70016C456 /* KMBatchOperateBaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMBatchOperateBaseViewController.swift; sourceTree = "<group>"; };
 		BBFD2B132AEFAB8F0016C456 /* KMOperationQueue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMOperationQueue.swift; sourceTree = "<group>"; };
 		BBFD2B152AEFAC9B0016C456 /* KMBatchOperateBaseViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KMBatchOperateBaseViewController.xib; sourceTree = "<group>"; };
@@ -9714,6 +9718,7 @@
 			children = (
 				BB00301C298CB799002DD1A0 /* KMPreferenceManager.swift */,
 				BBA93D2C29BEBAA60044E0DD /* KMPreferenceEnum.swift */,
+				BBFCCE072B56988C003742B3 /* KMPreferenceCommon.swift */,
 			);
 			path = Tools;
 			sourceTree = "<group>";
@@ -14760,6 +14765,7 @@
 				BBC8A76D2B05EDDF00FA9377 /* KMThumbnail.swift in Sources */,
 				BBF62C702B0347AF007B7E86 /* SplitWindowController.swift in Sources */,
 				AD1CA3F72A05FCB60070541F /* KMAnnotationScreenViewController.swift in Sources */,
+				BBFCCE082B56988C003742B3 /* KMPreferenceCommon.swift in Sources */,
 				ADB2D6E6294740F30029D2B3 /* KMPrintPaperSetWindowController.swift in Sources */,
 				BB897271294DB6BE0045787C /* KMWatermarkAdjectivePlainView.swift in Sources */,
 				ADBC2D37299F0A5A006280C8 /* KMPrintHelpViewController.swift in Sources */,
@@ -15211,6 +15217,7 @@
 				899700F728F4051B009AF911 /* KMAnnotationViewController.swift in Sources */,
 				9F1FE4C429406E4700E952CA /* CTPageTransition.c in Sources */,
 				BBB9B311299A5D6D004F3235 /* KMCloudDownloadOperationQueue.m in Sources */,
+				BBFCCE092B56988C003742B3 /* KMPreferenceCommon.swift in Sources */,
 				ADDF834E2B391A5C00A81A4E /* DSignatureCertifyDetailViewController.swift in Sources */,
 				BBF729902B1960FF00576AC5 /* KMCompressOperationQueue.swift in Sources */,
 				BBF8A3FE2AE8B04100788BAC /* KMBatchOperateFile.swift in Sources */,
@@ -16486,6 +16493,7 @@
 				AD867FB529DFBB2700F00440 /* KMAnnotationOutlineSectionView.swift in Sources */,
 				ADBC373E29CA9AE100D93208 /* KMComparativeManager.swift in Sources */,
 				BB5F8A1329BB04F000365ADB /* GBDeviceInfo_Common.m in Sources */,
+				BBFCCE0A2B56988C003742B3 /* KMPreferenceCommon.swift in Sources */,
 				BB2F9AB12AFCAE1F00F9DD93 /* KMProfileTitleCellView.swift in Sources */,
 				BB2F615A2966B69D001CB369 /* KMWatermarkPropertyHomeController.swift in Sources */,
 				89752E1F2942CB04003FF08E /* KMSearchMode.swift in Sources */,

+ 4 - 4
PDF Office/PDF Reader Pro.xcodeproj/xcshareddata/xcschemes/PDF Reader Pro Edition.xcscheme

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
    LastUpgradeVersion = "1520"
-   version = "1.7">
+   version = "1.8">
    <BuildAction
       parallelizeBuildables = "YES"
       buildImplicitDependencies = "YES">
@@ -15,7 +15,7 @@
             <BuildableReference
                BuildableIdentifier = "primary"
                BlueprintIdentifier = "BBFBE6EB28DD7C20008B2335"
-               BuildableName = "PDF Reader Pro Edition.app"
+               BuildableName = "PDF Reaer Pro.app"
                BlueprintName = "PDF Reader Pro Edition"
                ReferencedContainer = "container:PDF Reader Pro.xcodeproj">
             </BuildableReference>
@@ -68,7 +68,7 @@
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "BBFBE6EB28DD7C20008B2335"
-            BuildableName = "PDF Reader Pro Edition.app"
+            BuildableName = "PDF Reaer Pro.app"
             BlueprintName = "PDF Reader Pro Edition"
             ReferencedContainer = "container:PDF Reader Pro.xcodeproj">
          </BuildableReference>
@@ -85,7 +85,7 @@
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "BBFBE6EB28DD7C20008B2335"
-            BuildableName = "PDF Reader Pro Edition.app"
+            BuildableName = "PDF Reaer Pro.app"
             BlueprintName = "PDF Reader Pro Edition"
             ReferencedContainer = "container:PDF Reader Pro.xcodeproj">
          </BuildableReference>