Jelajahi Sumber

标记密文-新增菜单和设置属性窗口

tangchao 2 tahun lalu
induk
melakukan
810dca29c0
16 mengubah file dengan 1269 tambahan dan 187 penghapusan
  1. 88 0
      PDF Office/PDF Office.xcodeproj/project.pbxproj
  2. TEMPAT SAMPAH
      PDF Office/PDF Office.xcodeproj/project.xcworkspace/xcuserdata/kdanmobile.xcuserdatad/UserInterfaceState.xcuserstate
  3. 17 17
      PDF Office/PDF Office.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  4. 69 0
      PDF Office/PDF Office/Class/PDFTools/Redact/Base/KMRedactBaseWindowController.swift
  5. 375 0
      PDF Office/PDF Office/Class/PDFTools/Redact/Base/KMRedactBaseWindowController.xib
  6. 27 0
      PDF Office/PDF Office/Class/PDFTools/Redact/Base/KMRedactContentBaseView.swift
  7. 18 0
      PDF Office/PDF Office/Class/PDFTools/Redact/View/KMRedactAligementView.swift
  8. 19 0
      PDF Office/PDF Office/Class/PDFTools/Redact/View/KMRedactColorView.swift
  9. 291 0
      PDF Office/PDF Office/Class/PDFTools/Redact/View/KMRedactPropertyContentView.swift
  10. 100 0
      PDF Office/PDF Office/Class/PDFTools/Redact/Window/KMRedactPropertyWindowController.swift
  11. 1 1
      PDF Office/PDF Office/Class/PDFTools/Watermark/Base/KMWatermarkAdjectivePropertyBaseController.xib
  12. 117 0
      PDF Office/PDF Office/Class/PDFTools/Watermark/View/KMWatermarkAligementView.swift
  13. 84 0
      PDF Office/PDF Office/Class/PDFTools/Watermark/View/KMWatermarkColorView.swift
  14. 0 169
      PDF Office/PDF Office/Class/PDFTools/Watermark/View/KMWatermarkTextView.swift
  15. 31 0
      PDF Office/PDF Office/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift
  16. 32 0
      PDF Office/PDF Office/Class/PDFWindowController/ViewController/KMMainViewController.swift

+ 88 - 0
PDF Office/PDF Office.xcodeproj/project.pbxproj

@@ -1249,6 +1249,33 @@
 		BB4BD9CF2909026500A66A65 /* KMRightSideViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB4BD9CB2909026500A66A65 /* KMRightSideViewController.xib */; };
 		BB4BD9D02909026500A66A65 /* KMRightSideViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB4BD9CB2909026500A66A65 /* KMRightSideViewController.xib */; };
 		BB4BD9D12909026500A66A65 /* KMRightSideViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB4BD9CB2909026500A66A65 /* KMRightSideViewController.xib */; };
+		BB4EEF2D29763EE7003A3537 /* KMRedactBaseWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF2B29763EE7003A3537 /* KMRedactBaseWindowController.swift */; };
+		BB4EEF2E29763EE7003A3537 /* KMRedactBaseWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF2B29763EE7003A3537 /* KMRedactBaseWindowController.swift */; };
+		BB4EEF2F29763EE7003A3537 /* KMRedactBaseWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF2B29763EE7003A3537 /* KMRedactBaseWindowController.swift */; };
+		BB4EEF3029763EE7003A3537 /* KMRedactBaseWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB4EEF2C29763EE7003A3537 /* KMRedactBaseWindowController.xib */; };
+		BB4EEF3129763EE7003A3537 /* KMRedactBaseWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB4EEF2C29763EE7003A3537 /* KMRedactBaseWindowController.xib */; };
+		BB4EEF3229763EE7003A3537 /* KMRedactBaseWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB4EEF2C29763EE7003A3537 /* KMRedactBaseWindowController.xib */; };
+		BB4EEF3429764166003A3537 /* KMRedactPropertyWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF3329764166003A3537 /* KMRedactPropertyWindowController.swift */; };
+		BB4EEF3529764166003A3537 /* KMRedactPropertyWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF3329764166003A3537 /* KMRedactPropertyWindowController.swift */; };
+		BB4EEF3629764166003A3537 /* KMRedactPropertyWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF3329764166003A3537 /* KMRedactPropertyWindowController.swift */; };
+		BB4EEF382976451E003A3537 /* KMRedactContentBaseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF372976451E003A3537 /* KMRedactContentBaseView.swift */; };
+		BB4EEF392976451E003A3537 /* KMRedactContentBaseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF372976451E003A3537 /* KMRedactContentBaseView.swift */; };
+		BB4EEF3A2976451E003A3537 /* KMRedactContentBaseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF372976451E003A3537 /* KMRedactContentBaseView.swift */; };
+		BB4EEF3C29764578003A3537 /* KMRedactPropertyContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF3B29764578003A3537 /* KMRedactPropertyContentView.swift */; };
+		BB4EEF3D29764578003A3537 /* KMRedactPropertyContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF3B29764578003A3537 /* KMRedactPropertyContentView.swift */; };
+		BB4EEF3E29764578003A3537 /* KMRedactPropertyContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF3B29764578003A3537 /* KMRedactPropertyContentView.swift */; };
+		BB4EEF4029764FCC003A3537 /* KMWatermarkColorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF3F29764FCC003A3537 /* KMWatermarkColorView.swift */; };
+		BB4EEF4129764FCC003A3537 /* KMWatermarkColorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF3F29764FCC003A3537 /* KMWatermarkColorView.swift */; };
+		BB4EEF4229764FCC003A3537 /* KMWatermarkColorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF3F29764FCC003A3537 /* KMWatermarkColorView.swift */; };
+		BB4EEF4429764FEF003A3537 /* KMWatermarkAligementView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF4329764FEF003A3537 /* KMWatermarkAligementView.swift */; };
+		BB4EEF4529764FEF003A3537 /* KMWatermarkAligementView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF4329764FEF003A3537 /* KMWatermarkAligementView.swift */; };
+		BB4EEF4629764FEF003A3537 /* KMWatermarkAligementView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF4329764FEF003A3537 /* KMWatermarkAligementView.swift */; };
+		BB4EEF482976504C003A3537 /* KMRedactColorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF472976504C003A3537 /* KMRedactColorView.swift */; };
+		BB4EEF492976504C003A3537 /* KMRedactColorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF472976504C003A3537 /* KMRedactColorView.swift */; };
+		BB4EEF4A2976504C003A3537 /* KMRedactColorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF472976504C003A3537 /* KMRedactColorView.swift */; };
+		BB4EEF4C2976544F003A3537 /* KMRedactAligementView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF4B2976544F003A3537 /* KMRedactAligementView.swift */; };
+		BB4EEF4D2976544F003A3537 /* KMRedactAligementView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF4B2976544F003A3537 /* KMRedactAligementView.swift */; };
+		BB4EEF4E2976544F003A3537 /* KMRedactAligementView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4EEF4B2976544F003A3537 /* KMRedactAligementView.swift */; };
 		BB5DF1E92959C5CB0025CDA1 /* KMHeaderFooterPreviewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB5DF1E72959C5CB0025CDA1 /* KMHeaderFooterPreviewController.swift */; };
 		BB5DF1EA2959C5CB0025CDA1 /* KMHeaderFooterPreviewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB5DF1E72959C5CB0025CDA1 /* KMHeaderFooterPreviewController.swift */; };
 		BB5DF1EB2959C5CB0025CDA1 /* KMHeaderFooterPreviewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB5DF1E72959C5CB0025CDA1 /* KMHeaderFooterPreviewController.swift */; };
@@ -2469,6 +2496,15 @@
 		BB49ED20293F527700C82CA2 /* KMConvertExcelSettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMConvertExcelSettingView.swift; sourceTree = "<group>"; };
 		BB4BD9CA2909026500A66A65 /* KMRightSideViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMRightSideViewController.swift; sourceTree = "<group>"; };
 		BB4BD9CB2909026500A66A65 /* KMRightSideViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMRightSideViewController.xib; sourceTree = "<group>"; };
+		BB4EEF2B29763EE7003A3537 /* KMRedactBaseWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMRedactBaseWindowController.swift; sourceTree = "<group>"; };
+		BB4EEF2C29763EE7003A3537 /* KMRedactBaseWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMRedactBaseWindowController.xib; sourceTree = "<group>"; };
+		BB4EEF3329764166003A3537 /* KMRedactPropertyWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMRedactPropertyWindowController.swift; sourceTree = "<group>"; };
+		BB4EEF372976451E003A3537 /* KMRedactContentBaseView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMRedactContentBaseView.swift; sourceTree = "<group>"; };
+		BB4EEF3B29764578003A3537 /* KMRedactPropertyContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMRedactPropertyContentView.swift; sourceTree = "<group>"; };
+		BB4EEF3F29764FCC003A3537 /* KMWatermarkColorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMWatermarkColorView.swift; sourceTree = "<group>"; };
+		BB4EEF4329764FEF003A3537 /* KMWatermarkAligementView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMWatermarkAligementView.swift; sourceTree = "<group>"; };
+		BB4EEF472976504C003A3537 /* KMRedactColorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMRedactColorView.swift; sourceTree = "<group>"; };
+		BB4EEF4B2976544F003A3537 /* KMRedactAligementView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMRedactAligementView.swift; sourceTree = "<group>"; };
 		BB5DF1E72959C5CB0025CDA1 /* KMHeaderFooterPreviewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMHeaderFooterPreviewController.swift; sourceTree = "<group>"; };
 		BB5DF1E82959C5CB0025CDA1 /* KMHeaderFooterPreviewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMHeaderFooterPreviewController.xib; sourceTree = "<group>"; };
 		BB5DF1EF2959C9F00025CDA1 /* KMHeaderFooterController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMHeaderFooterController.swift; sourceTree = "<group>"; };
@@ -4283,6 +4319,8 @@
 		BB35C49C297535C800D46EE2 /* Redact */ = {
 			isa = PBXGroup;
 			children = (
+				BB4EEF2A29763EC7003A3537 /* Base */,
+				BB4EEF2929763EC7003A3537 /* Window */,
 				BB35C49D297535C800D46EE2 /* View */,
 			);
 			path = Redact;
@@ -4292,6 +4330,9 @@
 			isa = PBXGroup;
 			children = (
 				BB35C49E2975362900D46EE2 /* KMRedactTopToolBar.swift */,
+				BB4EEF3B29764578003A3537 /* KMRedactPropertyContentView.swift */,
+				BB4EEF472976504C003A3537 /* KMRedactColorView.swift */,
+				BB4EEF4B2976544F003A3537 /* KMRedactAligementView.swift */,
 			);
 			path = View;
 			sourceTree = "<group>";
@@ -4342,6 +4383,24 @@
 			path = View;
 			sourceTree = "<group>";
 		};
+		BB4EEF2929763EC7003A3537 /* Window */ = {
+			isa = PBXGroup;
+			children = (
+				BB4EEF3329764166003A3537 /* KMRedactPropertyWindowController.swift */,
+			);
+			path = Window;
+			sourceTree = "<group>";
+		};
+		BB4EEF2A29763EC7003A3537 /* Base */ = {
+			isa = PBXGroup;
+			children = (
+				BB4EEF2B29763EE7003A3537 /* KMRedactBaseWindowController.swift */,
+				BB4EEF2C29763EE7003A3537 /* KMRedactBaseWindowController.xib */,
+				BB4EEF372976451E003A3537 /* KMRedactContentBaseView.swift */,
+			);
+			path = Base;
+			sourceTree = "<group>";
+		};
 		BB5DF1E52959C5760025CDA1 /* HeaderFooter */ = {
 			isa = PBXGroup;
 			children = (
@@ -4573,6 +4632,8 @@
 				BB897274294DC04F0045787C /* KMWatermartAdjectivePageRangeView.swift */,
 				BB897278294DFD1E0045787C /* KMWatermarkTextView.swift */,
 				BBF38A61294F53FD0086D025 /* KMWatermarkFileView.swift */,
+				BB4EEF3F29764FCC003A3537 /* KMWatermarkColorView.swift */,
+				BB4EEF4329764FEF003A3537 /* KMWatermarkAligementView.swift */,
 				BBF38A59294F2B760086D025 /* KMWatermarkPositionView.swift */,
 				BBF38A5D294F42FF0086D025 /* KMWatermarkAdjectiveStepper.swift */,
 				BB162E8D294FFC0C0088E9D1 /* KMWatermarkPDFView.swift */,
@@ -5481,6 +5542,7 @@
 				F359917B292B7B8A000D25DE /* InitialUserDefaults.plist in Resources */,
 				BB8F455A295AA1270037EA22 /* KMHeaderFooterPropertyInfoController.xib in Resources */,
 				ADB1FE8229752F3200ED072D /* KMBatchSecurityView.xib in Resources */,
+				BB4EEF3029763EE7003A3537 /* KMRedactBaseWindowController.xib in Resources */,
 				BB3EAEB0293E3D6000D92407 /* KMConvertBaseWindowController.xib in Resources */,
 				9F705F79291A3A84005199AD /* KMHistoryFileDeleteWindowController.xib in Resources */,
 				9F0CB4622966C9E200007028 /* KMFormPropertPanelViewController.xib in Resources */,
@@ -5651,6 +5713,7 @@
 				89752E082939DB42003FF08E /* KMToolbarViewController.xib in Resources */,
 				89D2D2B72947316900BFF5FE /* Quick Start Guide_Widget_Widget.pdf in Resources */,
 				ADCB98CE2924743300B51A03 /* KMBatchProcessingView.xib in Resources */,
+				BB4EEF3129763EE7003A3537 /* KMRedactBaseWindowController.xib in Resources */,
 				BBFE6E792930E53000142C01 /* KMMergePopoverViewController.xib in Resources */,
 				9FDD0F972952FF4D000C4DAD /* $metadata.json in Resources */,
 				BBC348472956A638008D2CD1 /* KMEditBackgroundController.xib in Resources */,
@@ -5890,6 +5953,7 @@
 				899700ED28F3E4D3009AF911 /* MainWindowController.xib in Resources */,
 				89E4E70D2963D62C002DBA6F /* KMAnnotationFontWindowController.xib in Resources */,
 				89E4E7872967BF5A002DBA6F /* KMCustomizeStampViewController.xib in Resources */,
+				BB4EEF3229763EE7003A3537 /* KMRedactBaseWindowController.xib in Resources */,
 				9F853A0A2947137500DF644E /* newtab.pdf in Resources */,
 				8997011328F40842009AF911 /* KMOutlineViewController.xib in Resources */,
 				ADB1FE8429752F3200ED072D /* KMBatchSecurityView.xib in Resources */,
@@ -6071,6 +6135,7 @@
 				BBEC00C7295C319400A26C98 /* KMBatesManager.swift in Sources */,
 				BB5DF1F12959C9F00025CDA1 /* KMHeaderFooterController.swift in Sources */,
 				BBC3482429559506008D2CD1 /* KMBackgroundManager.swift in Sources */,
+				BB4EEF2D29763EE7003A3537 /* KMRedactBaseWindowController.swift in Sources */,
 				ADCB9962292B8DAB00B51A03 /* KMOCRManager.swift in Sources */,
 				BB99ACCF292E2AEF0048AFD9 /* KMMergeCollectionViewItem.swift in Sources */,
 				BB8B17322907B63D001C5EA5 /* CipherTextView.swift in Sources */,
@@ -6158,6 +6223,7 @@
 				89752DB82936F9B9003FF08E /* NSButton+TitleColor.m in Sources */,
 				9F1FE4B729406E4700E952CA /* CTBrowserFrameView.m in Sources */,
 				ADCB98C92924741B00B51A03 /* KMBatchProcessingView.swift in Sources */,
+				BB4EEF3C29764578003A3537 /* KMRedactPropertyContentView.swift in Sources */,
 				9F1FE4D529406E4700E952CA /* NSPasteboard+Utils.m in Sources */,
 				9F1FE4B129406E4700E952CA /* CTTabWindowController.m in Sources */,
 				F37322F9292DF9410013862C /* CPDFRedactAnnotation+PDFListView.m in Sources */,
@@ -6190,6 +6256,7 @@
 				BB6DD81829348A00001F0544 /* KMSecureEncryptComboBoxCellView.swift in Sources */,
 				ADB1FE3B29700D3400ED072D /* KMBatchCollectionViewItem.swift in Sources */,
 				89752D9A2936E675003FF08E /* KMToolBarBox.swift in Sources */,
+				BB4EEF4429764FEF003A3537 /* KMWatermarkAligementView.swift in Sources */,
 				BBEC00AF295C2AF300A26C98 /* KMBatesPreviewController.swift in Sources */,
 				BBC348332955A118008D2CD1 /* KMCreateBackgroundController.swift in Sources */,
 				ADB1FE7629752F0900ED072D /* KMBatchCompressView.swift in Sources */,
@@ -6218,6 +6285,7 @@
 				9FDD0F7C2952F2D8000C4DAD /* KMBaseParser.swift in Sources */,
 				BB2C6AC928F4085200478A33 /* CPDFListView.m in Sources */,
 				BBFBE6C028DD7B97008B2335 /* ViewController.swift in Sources */,
+				BB4EEF3429764166003A3537 /* KMRedactPropertyWindowController.swift in Sources */,
 				9F8DDF2629237910006CDC73 /* Array+KMExtensions.swift in Sources */,
 				BB8F4560295AA39F0037EA22 /* KMHeaderFooterModel.swift in Sources */,
 				BB86C21928F561C7005AD968 /* NSColor_SKExtensions.m in Sources */,
@@ -6309,6 +6377,7 @@
 				BB897275294DC04F0045787C /* KMWatermartAdjectivePageRangeView.swift in Sources */,
 				F3B7DFA9294C545B00333201 /* NSPopover+PDFListView.m in Sources */,
 				BBEC00D9295C39FD00A26C98 /* KMBatesPropertyInfoController.swift in Sources */,
+				BB4EEF482976504C003A3537 /* KMRedactColorView.swift in Sources */,
 				BBEC00E1295C410A00A26C98 /* KMBatesPrefixInfoView.swift in Sources */,
 				BB897220294AF9080045787C /* KMWatermarkAdjectiveTopBarView.swift in Sources */,
 				AD9527D32952D51A0039D2BC /* KMPrintPresenter.swift in Sources */,
@@ -6354,6 +6423,7 @@
 				89316852296E45CA0073EA59 /* KMImageAccessoryController.m in Sources */,
 				ADB1FE962975300B00ED072D /* KMBatchHeaderAndFooterView.swift in Sources */,
 				F3732323292DFFFE0013862C /* CPDFListView+Extension.m in Sources */,
+				BB4EEF4C2976544F003A3537 /* KMRedactAligementView.swift in Sources */,
 				9F1FE4C029406E4700E952CA /* NSWindow+CTThemed.m in Sources */,
 				F37322E1292DF9410013862C /* CPDFChoiceWidgetAnnotation+PDFListView.m in Sources */,
 				9F0CB48729683DC400007028 /* KMPropertiesPanelPresetColorSubVC.swift in Sources */,
@@ -6414,6 +6484,7 @@
 				BB89725E294C5DDA0045787C /* KMWatermarkPropertyInfoController.swift in Sources */,
 				F37322FF292DF9410013862C /* CPDFAnnotation+PDFListView.m in Sources */,
 				BB897218294AED6C0045787C /* KMWatermarkAdjectiveBaseController.swift in Sources */,
+				BB4EEF4029764FCC003A3537 /* KMWatermarkColorView.swift in Sources */,
 				AD4B4548293ED7DA0076FA14 /* KMImageToPDFManager.swift in Sources */,
 				9F8DDF342924DA6B006CDC73 /* KMPDFToolsCollectionView.swift in Sources */,
 				BB99ACC2292DE22E0048AFD9 /* KMMergeViewController.swift in Sources */,
@@ -6452,6 +6523,7 @@
 				89E4E76929656B35002DBA6F /* KMButton.m in Sources */,
 				BBFE6E65293097A600142C01 /* KMPageRangePickerWindowController.swift in Sources */,
 				BB2EDF4C296E63E5003BCF58 /* KMPageEditInsertCustomPageWindowController.swift in Sources */,
+				BB4EEF382976451E003A3537 /* KMRedactContentBaseView.swift in Sources */,
 				8997010E28F40842009AF911 /* KMOutlineViewController.swift in Sources */,
 				BB2F61502966A91D001CB369 /* KMBackgroundPropertyHomeController.swift in Sources */,
 				9F1FE3DE293EE51F00E952CA /* KMMainDocument.swift in Sources */,
@@ -6538,6 +6610,7 @@
 				BBEC00C8295C319400A26C98 /* KMBatesManager.swift in Sources */,
 				BB5DF1F22959C9F00025CDA1 /* KMHeaderFooterController.swift in Sources */,
 				BBC3482529559506008D2CD1 /* KMBackgroundManager.swift in Sources */,
+				BB4EEF2E29763EE7003A3537 /* KMRedactBaseWindowController.swift in Sources */,
 				F373230C292DF9410013862C /* CPDFTextWidgetAnnotation+PDFListView.m in Sources */,
 				9FAAA333290BD0A20046FFCE /* KMHistoryFileCollectionViewItem.swift in Sources */,
 				8997010728F4082C009AF911 /* KMFromViewController.swift in Sources */,
@@ -6625,6 +6698,7 @@
 				9F1FE4E529406E4700E952CA /* GTMNSColor+Luminance.m in Sources */,
 				ADCB996C292C65EE00B51A03 /* KMGOCRManager.m in Sources */,
 				89752DB92936F9B9003FF08E /* NSButton+TitleColor.m in Sources */,
+				BB4EEF3D29764578003A3537 /* KMRedactPropertyContentView.swift in Sources */,
 				BB162E93294FFE020088E9D1 /* KMWatermarkModel.swift in Sources */,
 				F3A9DC7F294309D80074E5D2 /* CPDFListEditAnnotationViewController.m in Sources */,
 				AD9527CB295297B70039D2BC /* KMPrintModel.swift in Sources */,
@@ -6657,6 +6731,7 @@
 				BB897257294C559F0045787C /* KMWatermarkPropertyCreateController.swift in Sources */,
 				ADB1FE3C29700D3400ED072D /* KMBatchCollectionViewItem.swift in Sources */,
 				ADC25DFA2923BA710080A3F6 /* KMImageToPDFWindowController.swift in Sources */,
+				BB4EEF4529764FEF003A3537 /* KMWatermarkAligementView.swift in Sources */,
 				BBEC00B0295C2AF300A26C98 /* KMBatesPreviewController.swift in Sources */,
 				BBC348342955A118008D2CD1 /* KMCreateBackgroundController.swift in Sources */,
 				ADB1FE7729752F0900ED072D /* KMBatchCompressView.swift in Sources */,
@@ -6685,6 +6760,7 @@
 				BB86C21A28F561C7005AD968 /* NSColor_SKExtensions.m in Sources */,
 				9FDD0F8D2952FCE0000C4DAD /* KMGlobalParser.swift in Sources */,
 				ADD1B6ED2946C04C00C3FFF7 /* KMPrintChoosePageSizePamphletView.swift in Sources */,
+				BB4EEF3529764166003A3537 /* KMRedactPropertyWindowController.swift in Sources */,
 				ADCB996F292C65EE00B51A03 /* KMOCROperation.m in Sources */,
 				BB8F4561295AA39F0037EA22 /* KMHeaderFooterModel.swift in Sources */,
 				9F1FE4C729406E4700E952CA /* CTUtil.m in Sources */,
@@ -6776,6 +6852,7 @@
 				9F1FE4CD29406E4700E952CA /* CTTabContentsController.m in Sources */,
 				8942F7BC29222C7E00389627 /* KMBookCellView.swift in Sources */,
 				BBEC00DA295C39FD00A26C98 /* KMBatesPropertyInfoController.swift in Sources */,
+				BB4EEF492976504C003A3537 /* KMRedactColorView.swift in Sources */,
 				BBEC00E2295C410A00A26C98 /* KMBatesPrefixInfoView.swift in Sources */,
 				9F1F82E42934D5240092C4B4 /* KMHomeExtractActionViewController.swift in Sources */,
 				F3732312292DF9410013862C /* CPDFSignatureWidgetAnnotation+PDFListView.m in Sources */,
@@ -6821,6 +6898,7 @@
 				89316853296E45CA0073EA59 /* KMImageAccessoryController.m in Sources */,
 				ADB1FE972975300B00ED072D /* KMBatchHeaderAndFooterView.swift in Sources */,
 				BBA8B7A42935CD740097D183 /* KMRemovePasswordAlertWindowController.swift in Sources */,
+				BB4EEF4D2976544F003A3537 /* KMRedactAligementView.swift in Sources */,
 				F37322EE292DF9410013862C /* CPDFMarkupAnnotation+PDFListView.m in Sources */,
 				9F1FE4FA29406E4700E952CA /* CTTabStripView.m in Sources */,
 				9F0CB48829683DC400007028 /* KMPropertiesPanelPresetColorSubVC.swift in Sources */,
@@ -6881,6 +6959,7 @@
 				AD4B4549293ED7DA0076FA14 /* KMImageToPDFManager.swift in Sources */,
 				9F8DDF2729237910006CDC73 /* Array+KMExtensions.swift in Sources */,
 				8942F7EA2925E1C400389627 /* KMLiftSideCellView.swift in Sources */,
+				BB4EEF4129764FCC003A3537 /* KMWatermarkColorView.swift in Sources */,
 				AD4B455729408CB00076FA14 /* KMOCRChooseView.swift in Sources */,
 				BB86C20B28F5569F005AD968 /* NSGeometry_SKExtensions.m in Sources */,
 				BB49ECDE293EED6100C82CA2 /* KMConvertWordWindowController.swift in Sources */,
@@ -6919,6 +6998,7 @@
 				89E4E76A29656B35002DBA6F /* KMButton.m in Sources */,
 				8942F80F29277BAF00389627 /* NSMenu+Category.m in Sources */,
 				BB2EDF4D296E63E5003BCF58 /* KMPageEditInsertCustomPageWindowController.swift in Sources */,
+				BB4EEF392976451E003A3537 /* KMRedactContentBaseView.swift in Sources */,
 				8997010F28F40842009AF911 /* KMOutlineViewController.swift in Sources */,
 				BB2F61512966A91D001CB369 /* KMBackgroundPropertyHomeController.swift in Sources */,
 				9F1FE3DF293EE51F00E952CA /* KMMainDocument.swift in Sources */,
@@ -7115,6 +7195,7 @@
 				9F1FE4F529406E4700E952CA /* FastResizeView.m in Sources */,
 				9F1FE4FE29406E4700E952CA /* CTTabStripController.m in Sources */,
 				BBEC00B9295C2C1600A26C98 /* KMBatesPropertyHomeController.swift in Sources */,
+				BB4EEF3629764166003A3537 /* KMRedactPropertyWindowController.swift in Sources */,
 				9F705F8B291E576D005199AD /* KMTableView.swift in Sources */,
 				ADD1B6A729416FE800C3FFF7 /* KMOCRPresenter.swift in Sources */,
 				F3732313292DF9410013862C /* CPDFSignatureWidgetAnnotation+PDFListView.m in Sources */,
@@ -7122,12 +7203,14 @@
 				ADB1FE8029752F2900ED072D /* KMBatchSecurityView.swift in Sources */,
 				BBC3485029582920008D2CD1 /* KMBackgroundColorView.swift in Sources */,
 				ADB1FE982975300B00ED072D /* KMBatchHeaderAndFooterView.swift in Sources */,
+				BB4EEF3A2976451E003A3537 /* KMRedactContentBaseView.swift in Sources */,
 				BBC3483029559E12008D2CD1 /* KMBackgroundModel.swift in Sources */,
 				F3732313292DF9410013862C /* CPDFSignatureWidgetAnnotation+PDFListView.m in Sources */,
 				BB897258294C559F0045787C /* KMWatermarkPropertyCreateController.swift in Sources */,
 				F3732330292F78210013862C /* CPDFListStampAnnotation.m in Sources */,
 				BB86C1F428F54535005AD968 /* CPDFListView+KeyEvent.m in Sources */,
 				9F1FE4DA29406E4700E952CA /* NSString+Utils.m in Sources */,
+				BB4EEF4E2976544F003A3537 /* KMRedactAligementView.swift in Sources */,
 				F37322E9292DF9410013862C /* CPDFAnnotationModel.m in Sources */,
 				BB246DA628F6B492005E8F52 /* NSBezierPath_SKExtensions.m in Sources */,
 				BB99ACCC292DEE6E0048AFD9 /* KMMergeTitleBar.swift in Sources */,
@@ -7178,6 +7261,7 @@
 				F37322FB292DF9410013862C /* CPDFRedactAnnotation+PDFListView.m in Sources */,
 				F3D547B629568CC300AA3953 /* ComPDFUIConfig.m in Sources */,
 				9F1F82CC292F6CF90092C4B4 /* KMPDFInsertPageWindow.swift in Sources */,
+				BB4EEF2F29763EE7003A3537 /* KMRedactBaseWindowController.swift in Sources */,
 				BB89727B294DFD1E0045787C /* KMWatermarkTextView.swift in Sources */,
 				BB86C21B28F561C7005AD968 /* NSColor_SKExtensions.m in Sources */,
 				BBEC00AA295BDECF00A26C98 /* KMHeaderFooterContentInfoView.swift in Sources */,
@@ -7226,6 +7310,7 @@
 				9FBA0EF028FFC716001117AF /* KMHomeFastToolViewController.swift in Sources */,
 				9F1FE4E329406E4700E952CA /* GTMNSAnimation+Duration.m in Sources */,
 				BB8F456B295ABDC10037EA22 /* KMWatermarkAdjectiveBaseModel.swift in Sources */,
+				BB4EEF4629764FEF003A3537 /* KMWatermarkAligementView.swift in Sources */,
 				BB86C1FF28F54923005AD968 /* NSEvent_SKExtensions.m in Sources */,
 				BB49ED23293F527700C82CA2 /* KMConvertExcelSettingView.swift in Sources */,
 				BB2EDF48296E4618003BCF58 /* KMPageEditTools.swift in Sources */,
@@ -7318,6 +7403,7 @@
 				ADD1B6D92946BDFD00C3FFF7 /* KMPrintChoosePageSizeView.swift in Sources */,
 				BB2F61522966A91D001CB369 /* KMBackgroundPropertyHomeController.swift in Sources */,
 				ADCB990D292B6ADC00B51A03 /* KMImageToPDFChoosePresenter.swift in Sources */,
+				BB4EEF3E29764578003A3537 /* KMRedactPropertyContentView.swift in Sources */,
 				AD9527C4295294EF0039D2BC /* KMPrintPaperModel.swift in Sources */,
 				BBC348162955920B008D2CD1 /* KMBackgroundPropertyController.swift in Sources */,
 				BB8F4549295A9CDC0037EA22 /* KMHeaderFooterListController.swift in Sources */,
@@ -7348,6 +7434,7 @@
 				BB89721A294AED6C0045787C /* KMWatermarkAdjectiveBaseController.swift in Sources */,
 				AD4B454A293ED7DA0076FA14 /* KMImageToPDFManager.swift in Sources */,
 				F344A3B6293094DB003A4383 /* CPDFListSignatureAnnotation.m in Sources */,
+				BB4EEF4229764FCC003A3537 /* KMWatermarkColorView.swift in Sources */,
 				AD4B455829408CB00076FA14 /* KMOCRChooseView.swift in Sources */,
 				BB5DF1F32959C9F00025CDA1 /* KMHeaderFooterController.swift in Sources */,
 				9F8DDF2829237910006CDC73 /* Array+KMExtensions.swift in Sources */,
@@ -7380,6 +7467,7 @@
 				9F1FE49B29406E4700E952CA /* NewTabButton.m in Sources */,
 				8942F81029277BAF00389627 /* NSMenu+Category.m in Sources */,
 				BB897273294DB6BE0045787C /* KMWatermarkAdjectivePlainView.swift in Sources */,
+				BB4EEF4A2976504C003A3537 /* KMRedactColorView.swift in Sources */,
 				9F1FE4AD29406E4700E952CA /* CTBrowserWindow.m in Sources */,
 				8997011028F40842009AF911 /* KMOutlineViewController.swift in Sources */,
 				9F1F82BE292E01860092C4B4 /* KMCloudEmptyCollectionViewItem.swift in Sources */,

TEMPAT SAMPAH
PDF Office/PDF Office.xcodeproj/project.xcworkspace/xcuserdata/kdanmobile.xcuserdatad/UserInterfaceState.xcuserstate


+ 17 - 17
PDF Office/PDF Office.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -208,23 +208,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "81"
             endingLineNumber = "81"
-            landmarkName = "changeAnnotationModeAction(item:)"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "9A8A781C-5AA0-4450-B8B5-08185C916A6D"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Office/Class/PDFWindowController/Side/LeftSide/Thumbnail/KMThumbnailViewController.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "233"
-            endingLineNumber = "233"
-            landmarkName = "menuNeedsUpdate(_:)"
+            landmarkName = "refreshListViewToolMode()"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -276,5 +260,21 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "E2086A1A-100C-4F97-93E5-FAE720F7EA23"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Office/Class/PDFWindowController/ViewController/KMMainViewController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "294"
+            endingLineNumber = "294"
+            landmarkName = "pdfListViewMenuItemsEditing(at:for:menuItems:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 69 - 0
PDF Office/PDF Office/Class/PDFTools/Redact/Base/KMRedactBaseWindowController.swift

@@ -0,0 +1,69 @@
+//
+//  KMRedactBaseWindowController.swift
+//  PDF Office
+//
+//  Created by tangchao on 2023/1/17.
+//
+
+import Cocoa
+
+class KMRedactBaseWindowController: NSWindowController {
+    
+    @IBOutlet weak var titleLabel: NSTextField!
+    @IBOutlet weak var topLine: NSBox!
+    @IBOutlet weak var contentBox: NSBox!
+    @IBOutlet weak var funcButton: NSButton!
+    @IBOutlet weak var cancelButton: NSButton!
+    
+    @IBOutlet weak var contentWidthConst: NSLayoutConstraint!
+    @IBOutlet weak var contentHeightConst: NSLayoutConstraint!
+    
+    var contentView: KMRedactContentBaseView!
+    
+    var annotation: CPDFRedactAnnotation?
+    convenience init(_ annotation: CPDFRedactAnnotation?) {
+        self.init(windowNibName: "KMRedactBaseWindowController")
+        self.annotation = annotation
+    }
+    
+    override func windowDidLoad() {
+        super.windowDidLoad()
+
+        cancelButton.title = NSLocalizedString("取消", comment: "")
+        cancelButton.isBordered = false
+        cancelButton.wantsLayer = true
+        cancelButton.layer?.borderWidth = 1
+        cancelButton.layer?.borderColor = NSColor.black.cgColor
+        cancelButton.layer?.cornerRadius = 4
+        cancelButton.target = self
+        cancelButton.action = #selector(cancelButtonAction)
+        
+        funcButton.isBordered = false
+        funcButton.wantsLayer = true
+        funcButton.layer?.cornerRadius = 4
+        funcButton.target = self
+        funcButton.action = #selector(funcButtonAction)
+    }
+    
+    // MARK: Private Methods
+    
+    @objc private func cancelButtonAction() {
+        
+    }
+    
+    @objc private func funcButtonAction() {
+        
+    }
+    
+    // Mark: Publick Methods
+    
+    public func setContentSize(_ size: NSSize) {
+        self.contentWidthConst.constant = size.width
+        self.contentHeightConst.constant = size.height - 44 - 60
+    }
+    
+    public func topLineIsShow(_ show: Bool) {
+        self.topLine.isHidden = !show
+    }
+    
+}

+ 375 - 0
PDF Office/PDF Office/Class/PDFTools/Redact/Base/KMRedactBaseWindowController.xib

@@ -0,0 +1,375 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21225" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21225"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMRedactBaseWindowController" customModule="PDF_Office" customModuleProvider="target">
+            <connections>
+                <outlet property="cancelButton" destination="24f-Hm-50n" id="4CK-Lc-R5o"/>
+                <outlet property="contentBox" destination="Rag-Ok-KH1" id="oOm-bf-2K0"/>
+                <outlet property="contentHeightConst" destination="IN9-TF-mcW" id="fEt-WU-k6a"/>
+                <outlet property="contentWidthConst" destination="BGp-bj-uNG" id="Ycg-RL-RzR"/>
+                <outlet property="funcButton" destination="4HG-ei-BTS" id="BJX-EP-tBq"/>
+                <outlet property="titleLabel" destination="SGk-C0-wVt" id="Gwe-SR-1M6"/>
+                <outlet property="topLine" destination="SjR-bh-aVa" id="MHd-Uv-cXV"/>
+                <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
+            <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
+            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
+            <rect key="contentRect" x="196" y="240" width="480" height="270"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
+            <view key="contentView" id="se5-gp-TjO">
+                <rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Z3C-L3-eHe">
+                        <rect key="frame" x="0.0" y="226" width="480" height="44"/>
+                        <view key="contentView" id="Mwt-Jm-rbh">
+                            <rect key="frame" x="0.0" y="0.0" width="480" height="44"/>
+                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                            <subviews>
+                                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="SGk-C0-wVt">
+                                    <rect key="frame" x="14" y="13" width="44" height="19"/>
+                                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="now-x9-Zu3">
+                                        <font key="font" metaFont="system" size="16"/>
+                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    </textFieldCell>
+                                </textField>
+                                <box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="SjR-bh-aVa">
+                                    <rect key="frame" x="0.0" y="-2" width="480" height="5"/>
+                                </box>
+                            </subviews>
+                            <constraints>
+                                <constraint firstItem="SGk-C0-wVt" firstAttribute="top" secondItem="Mwt-Jm-rbh" secondAttribute="top" constant="12" id="3tS-y9-q4V"/>
+                                <constraint firstItem="SGk-C0-wVt" firstAttribute="leading" secondItem="Mwt-Jm-rbh" secondAttribute="leading" constant="16" id="7tP-e6-9Yc"/>
+                                <constraint firstAttribute="bottom" secondItem="SjR-bh-aVa" secondAttribute="bottom" id="dH3-Na-LNp"/>
+                                <constraint firstAttribute="trailing" secondItem="SjR-bh-aVa" secondAttribute="trailing" id="gSE-aS-FjI"/>
+                                <constraint firstItem="SjR-bh-aVa" firstAttribute="leading" secondItem="Mwt-Jm-rbh" secondAttribute="leading" id="yym-8O-t6P"/>
+                            </constraints>
+                        </view>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="44" id="iGP-go-UtZ"/>
+                        </constraints>
+                    </box>
+                    <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Rag-Ok-KH1">
+                        <rect key="frame" x="0.0" y="60" width="480" height="166"/>
+                        <view key="contentView" id="Wwl-MU-jbE">
+                            <rect key="frame" x="0.0" y="0.0" width="480" height="166"/>
+                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        </view>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="166" id="BGp-bj-uNG"/>
+                            <constraint firstAttribute="width" constant="480" id="IN9-TF-mcW"/>
+                        </constraints>
+                    </box>
+                    <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="hK4-nI-kvj">
+                        <rect key="frame" x="0.0" y="0.0" width="480" height="60"/>
+                        <view key="contentView" id="26K-JP-hEK">
+                            <rect key="frame" x="0.0" y="0.0" width="480" height="60"/>
+                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                            <subviews>
+                                <box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="sqd-hn-9Za">
+                                    <rect key="frame" x="0.0" y="57" width="480" height="5"/>
+                                </box>
+                                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="4HG-ei-BTS">
+                                    <rect key="frame" x="366" y="14" width="98" height="32"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="32" id="0Uv-RE-02X"/>
+                                        <constraint firstAttribute="width" constant="98" id="Mzy-ZN-Jeq"/>
+                                    </constraints>
+                                    <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="v51-wm-q97">
+                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                        <font key="font" metaFont="system"/>
+                                    </buttonCell>
+                                </button>
+                                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="24f-Hm-50n">
+                                    <rect key="frame" x="260" y="14" width="98" height="32"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="32" id="Fj1-M0-siO"/>
+                                        <constraint firstAttribute="width" constant="98" id="vgX-6r-Fby"/>
+                                    </constraints>
+                                    <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="V3N-zE-XQU">
+                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                        <font key="font" metaFont="system"/>
+                                    </buttonCell>
+                                </button>
+                            </subviews>
+                            <constraints>
+                                <constraint firstItem="sqd-hn-9Za" firstAttribute="leading" secondItem="26K-JP-hEK" secondAttribute="leading" id="5k5-Nb-3DG"/>
+                                <constraint firstItem="4HG-ei-BTS" firstAttribute="centerY" secondItem="26K-JP-hEK" secondAttribute="centerY" id="82S-bY-xOm"/>
+                                <constraint firstAttribute="trailing" secondItem="sqd-hn-9Za" secondAttribute="trailing" id="A6r-zs-4IN"/>
+                                <constraint firstItem="24f-Hm-50n" firstAttribute="centerY" secondItem="26K-JP-hEK" secondAttribute="centerY" id="G4e-N9-Gug"/>
+                                <constraint firstItem="sqd-hn-9Za" firstAttribute="top" secondItem="26K-JP-hEK" secondAttribute="top" id="Ma7-6f-X0x"/>
+                                <constraint firstAttribute="trailing" secondItem="4HG-ei-BTS" secondAttribute="trailing" constant="16" id="QTG-yr-uw7"/>
+                                <constraint firstItem="4HG-ei-BTS" firstAttribute="leading" secondItem="24f-Hm-50n" secondAttribute="trailing" constant="8" id="vff-by-HP8"/>
+                            </constraints>
+                        </view>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="60" id="Lcb-Tf-6Uz"/>
+                        </constraints>
+                    </box>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="Z3C-L3-eHe" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" id="Cs9-d6-HSA"/>
+                    <constraint firstItem="hK4-nI-kvj" firstAttribute="top" secondItem="Rag-Ok-KH1" secondAttribute="bottom" id="HVZ-ys-Rt5"/>
+                    <constraint firstItem="Rag-Ok-KH1" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" id="P6k-ot-Brz"/>
+                    <constraint firstAttribute="trailing" secondItem="hK4-nI-kvj" secondAttribute="trailing" id="QDt-4u-ZGw"/>
+                    <constraint firstAttribute="trailing" secondItem="Z3C-L3-eHe" secondAttribute="trailing" id="TOn-FR-l4w"/>
+                    <constraint firstItem="hK4-nI-kvj" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" id="gqN-x2-hMB"/>
+                    <constraint firstAttribute="bottom" secondItem="hK4-nI-kvj" secondAttribute="bottom" id="kxx-MX-f1G"/>
+                    <constraint firstItem="Rag-Ok-KH1" firstAttribute="top" secondItem="Z3C-L3-eHe" secondAttribute="bottom" id="q1n-7h-fsr"/>
+                    <constraint firstAttribute="trailing" secondItem="Rag-Ok-KH1" secondAttribute="trailing" id="ric-qW-Xj0"/>
+                    <constraint firstItem="Z3C-L3-eHe" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" id="vg0-I8-xsA"/>
+                </constraints>
+            </view>
+            <connections>
+                <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
+            </connections>
+            <point key="canvasLocation" x="147" y="133"/>
+        </window>
+        <customView id="UgY-BX-X20" customClass="KMRedactPropertyContentView" customModule="PDF_Office" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="532" height="450"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="tIf-xt-4gb">
+                    <rect key="frame" x="0.0" y="360" width="532" height="90"/>
+                    <view key="contentView" id="Ssb-sj-sEh">
+                        <rect key="frame" x="0.0" y="0.0" width="532" height="90"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="vqF-lq-3Jx">
+                                <rect key="frame" x="14" y="46" width="37" height="16"/>
+                                <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="Ct8-Lx-v5U">
+                                    <font key="font" metaFont="system"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="hsW-GA-O7O" customClass="KMRedactColorView" customModule="PDF_Office" customModuleProvider="target">
+                                <rect key="frame" x="12" y="4" width="66" height="32"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="32" id="38z-Up-rrn"/>
+                                    <constraint firstAttribute="width" constant="66" id="ojR-LG-qi8"/>
+                                </constraints>
+                            </customView>
+                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="iEc-3w-bmk">
+                                <rect key="frame" x="152" y="46" width="37" height="16"/>
+                                <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="uYl-J5-Aad">
+                                    <font key="font" metaFont="system"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="HRz-Cj-8os" customClass="KMRedactColorView" customModule="PDF_Office" customModuleProvider="target">
+                                <rect key="frame" x="154" y="4" width="66" height="32"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="32" id="egK-gb-Muu"/>
+                                    <constraint firstAttribute="width" constant="66" id="qG9-CH-XvT"/>
+                                </constraints>
+                            </customView>
+                        </subviews>
+                        <constraints>
+                            <constraint firstItem="iEc-3w-bmk" firstAttribute="leading" secondItem="Ssb-sj-sEh" secondAttribute="leading" constant="154" id="CqO-Ae-alc"/>
+                            <constraint firstItem="iEc-3w-bmk" firstAttribute="top" secondItem="Ssb-sj-sEh" secondAttribute="top" constant="28" id="Evd-Ds-sQ0"/>
+                            <constraint firstItem="vqF-lq-3Jx" firstAttribute="leading" secondItem="Ssb-sj-sEh" secondAttribute="leading" constant="16" id="NJQ-45-bld"/>
+                            <constraint firstItem="HRz-Cj-8os" firstAttribute="leading" secondItem="Ssb-sj-sEh" secondAttribute="leading" constant="154" id="VMz-XP-Z4H"/>
+                            <constraint firstItem="vqF-lq-3Jx" firstAttribute="top" secondItem="Ssb-sj-sEh" secondAttribute="top" constant="28" id="ZSr-OG-sJE"/>
+                            <constraint firstItem="hsW-GA-O7O" firstAttribute="top" secondItem="vqF-lq-3Jx" secondAttribute="bottom" constant="10" id="ceA-yc-ceL"/>
+                            <constraint firstItem="hsW-GA-O7O" firstAttribute="leading" secondItem="Ssb-sj-sEh" secondAttribute="leading" constant="12" id="rie-wm-laW"/>
+                            <constraint firstItem="HRz-Cj-8os" firstAttribute="top" secondItem="iEc-3w-bmk" secondAttribute="bottom" constant="10" id="zDm-k7-mJw"/>
+                        </constraints>
+                    </view>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="90" id="zZn-6Z-pfA"/>
+                    </constraints>
+                </box>
+                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="RYd-he-cdh">
+                    <rect key="frame" x="0.0" y="210" width="532" height="150"/>
+                    <view key="contentView" id="qHK-Cn-a9x">
+                        <rect key="frame" x="0.0" y="0.0" width="532" height="150"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="0vL-Pc-6jb">
+                                <rect key="frame" x="14" y="127" width="65" height="18"/>
+                                <buttonCell key="cell" type="check" title="Check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="rOn-T9-P9w">
+                                    <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                </buttonCell>
+                            </button>
+                            <scrollView borderType="none" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SNV-bT-oq8">
+                                <rect key="frame" x="16" y="10" width="500" height="110"/>
+                                <clipView key="contentView" drawsBackground="NO" id="JY9-i2-puB">
+                                    <rect key="frame" x="0.0" y="0.0" width="500" height="110"/>
+                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    <subviews>
+                                        <textView drawsBackground="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" spellingCorrection="YES" smartInsertDelete="YES" id="kBP-lZ-hOW">
+                                            <rect key="frame" x="0.0" y="0.0" width="500" height="110"/>
+                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                            <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                            <size key="minSize" width="500" height="110"/>
+                                            <size key="maxSize" width="500" height="10000000"/>
+                                            <color key="insertionPointColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                        </textView>
+                                    </subviews>
+                                </clipView>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="110" id="YSU-wI-3i5"/>
+                                </constraints>
+                                <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="UnS-AT-V4D">
+                                    <rect key="frame" x="-100" y="-100" width="240" height="16"/>
+                                    <autoresizingMask key="autoresizingMask"/>
+                                </scroller>
+                                <scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="ci2-BA-GKh">
+                                    <rect key="frame" x="484" y="0.0" width="16" height="110"/>
+                                    <autoresizingMask key="autoresizingMask"/>
+                                </scroller>
+                            </scrollView>
+                        </subviews>
+                        <constraints>
+                            <constraint firstItem="SNV-bT-oq8" firstAttribute="leading" secondItem="qHK-Cn-a9x" secondAttribute="leading" constant="16" id="KST-vW-oGp"/>
+                            <constraint firstItem="SNV-bT-oq8" firstAttribute="top" secondItem="0vL-Pc-6jb" secondAttribute="bottom" constant="8" symbolic="YES" id="Tgj-FZ-LQ4"/>
+                            <constraint firstItem="0vL-Pc-6jb" firstAttribute="leading" secondItem="qHK-Cn-a9x" secondAttribute="leading" constant="16" id="aTV-uu-SFA"/>
+                            <constraint firstAttribute="trailing" secondItem="SNV-bT-oq8" secondAttribute="trailing" constant="16" id="r01-nG-Uuz"/>
+                            <constraint firstItem="0vL-Pc-6jb" firstAttribute="top" secondItem="qHK-Cn-a9x" secondAttribute="top" constant="6" id="wPE-DX-h3A"/>
+                        </constraints>
+                    </view>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="150" id="G8a-U6-VEH"/>
+                    </constraints>
+                </box>
+                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="wj6-32-fo2">
+                    <rect key="frame" x="0.0" y="60" width="532" height="150"/>
+                    <view key="contentView" id="oyn-l5-tNm">
+                        <rect key="frame" x="0.0" y="0.0" width="532" height="150"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ISn-KY-geN">
+                                <rect key="frame" x="14" y="127" width="37" height="16"/>
+                                <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="0cw-s7-zSa">
+                                    <font key="font" usesAppearanceFont="YES"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <comboBox verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="YUH-iC-Gfd">
+                                <rect key="frame" x="16" y="92" width="123" height="25"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="120" id="Gno-ab-YGQ"/>
+                                </constraints>
+                                <comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" completes="NO" numberOfVisibleItems="5" id="dK0-sV-lfi">
+                                    <font key="font" metaFont="system"/>
+                                    <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    <objectValues>
+                                        <string>Item 1</string>
+                                        <string>Item 2</string>
+                                        <string>Item 3</string>
+                                    </objectValues>
+                                </comboBoxCell>
+                            </comboBox>
+                            <comboBox verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="swU-cd-Gvz">
+                                <rect key="frame" x="144" y="92" width="73" height="25"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="70" id="svV-S1-YEh"/>
+                                </constraints>
+                                <comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" completes="NO" numberOfVisibleItems="5" id="EhQ-AU-Tf6">
+                                    <font key="font" metaFont="system"/>
+                                    <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    <objectValues>
+                                        <string>Item 1</string>
+                                        <string>Item 2</string>
+                                        <string>Item 3</string>
+                                    </objectValues>
+                                </comboBoxCell>
+                            </comboBox>
+                            <comboBox verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="XXz-op-f6s">
+                                <rect key="frame" x="18" y="63" width="123" height="25"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="120" id="iyL-bf-vlV"/>
+                                </constraints>
+                                <comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" completes="NO" numberOfVisibleItems="5" id="azE-Sw-hml">
+                                    <font key="font" metaFont="system"/>
+                                    <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    <objectValues>
+                                        <string>Item 1</string>
+                                        <string>Item 2</string>
+                                        <string>Item 3</string>
+                                    </objectValues>
+                                </comboBoxCell>
+                            </comboBox>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="E5s-lo-OLZ" customClass="KMRedactColorView" customModule="PDF_Office" customModuleProvider="target">
+                                <rect key="frame" x="148" y="54" width="66" height="32"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="66" id="Isn-1T-rt1"/>
+                                    <constraint firstAttribute="height" constant="32" id="ism-hV-QiF"/>
+                                </constraints>
+                            </customView>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="w8W-es-efZ" customClass="KMRedactAligementView" customModule="PDF_Office" customModuleProvider="target">
+                                <rect key="frame" x="16" y="25" width="96" height="32"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="32" id="6gq-gK-fU9"/>
+                                    <constraint firstAttribute="width" constant="96" id="AAX-iZ-d5H"/>
+                                </constraints>
+                            </customView>
+                        </subviews>
+                        <constraints>
+                            <constraint firstItem="swU-cd-Gvz" firstAttribute="centerY" secondItem="YUH-iC-Gfd" secondAttribute="centerY" id="56Q-T3-CV2"/>
+                            <constraint firstItem="E5s-lo-OLZ" firstAttribute="top" secondItem="swU-cd-Gvz" secondAttribute="bottom" constant="10" id="8t3-Hb-9Ch"/>
+                            <constraint firstItem="XXz-op-f6s" firstAttribute="top" secondItem="YUH-iC-Gfd" secondAttribute="bottom" constant="10" id="9vt-wz-V5l"/>
+                            <constraint firstItem="w8W-es-efZ" firstAttribute="top" secondItem="XXz-op-f6s" secondAttribute="bottom" constant="10" id="Bcc-Gu-lpJ"/>
+                            <constraint firstItem="E5s-lo-OLZ" firstAttribute="leading" secondItem="XXz-op-f6s" secondAttribute="trailing" constant="10" id="CcL-Yc-2XW"/>
+                            <constraint firstItem="XXz-op-f6s" firstAttribute="leading" secondItem="oyn-l5-tNm" secondAttribute="leading" constant="18" id="XgM-fn-Qc7"/>
+                            <constraint firstItem="swU-cd-Gvz" firstAttribute="leading" secondItem="YUH-iC-Gfd" secondAttribute="trailing" constant="8" id="dy6-uP-vQl"/>
+                            <constraint firstItem="ISn-KY-geN" firstAttribute="leading" secondItem="oyn-l5-tNm" secondAttribute="leading" constant="16" id="jfW-b7-INi"/>
+                            <constraint firstItem="w8W-es-efZ" firstAttribute="leading" secondItem="oyn-l5-tNm" secondAttribute="leading" constant="16" id="kMu-lO-rhv"/>
+                            <constraint firstItem="YUH-iC-Gfd" firstAttribute="top" secondItem="ISn-KY-geN" secondAttribute="bottom" constant="12" id="luR-TP-J6v"/>
+                            <constraint firstItem="YUH-iC-Gfd" firstAttribute="leading" secondItem="oyn-l5-tNm" secondAttribute="leading" constant="16" id="ryg-77-hKk"/>
+                            <constraint firstItem="ISn-KY-geN" firstAttribute="top" secondItem="oyn-l5-tNm" secondAttribute="top" constant="7" id="tOb-eC-wOy"/>
+                        </constraints>
+                    </view>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="150" id="cNx-Kh-A0V"/>
+                    </constraints>
+                </box>
+            </subviews>
+            <constraints>
+                <constraint firstItem="RYd-he-cdh" firstAttribute="top" secondItem="tIf-xt-4gb" secondAttribute="bottom" id="0qa-lc-3GM"/>
+                <constraint firstItem="RYd-he-cdh" firstAttribute="leading" secondItem="UgY-BX-X20" secondAttribute="leading" id="8Pa-H3-W8F"/>
+                <constraint firstAttribute="trailing" secondItem="wj6-32-fo2" secondAttribute="trailing" id="Hyj-4a-hr2"/>
+                <constraint firstAttribute="trailing" secondItem="RYd-he-cdh" secondAttribute="trailing" id="ccK-Ru-cCF"/>
+                <constraint firstItem="tIf-xt-4gb" firstAttribute="top" secondItem="UgY-BX-X20" secondAttribute="top" id="dsg-Aq-R1b"/>
+                <constraint firstItem="tIf-xt-4gb" firstAttribute="leading" secondItem="UgY-BX-X20" secondAttribute="leading" id="gOi-dG-JaV"/>
+                <constraint firstItem="wj6-32-fo2" firstAttribute="top" secondItem="RYd-he-cdh" secondAttribute="bottom" id="km4-Uc-goe"/>
+                <constraint firstItem="wj6-32-fo2" firstAttribute="leading" secondItem="UgY-BX-X20" secondAttribute="leading" id="nv5-NO-Sxq"/>
+                <constraint firstAttribute="trailing" secondItem="tIf-xt-4gb" secondAttribute="trailing" id="qsA-gv-c7A"/>
+            </constraints>
+            <connections>
+                <outlet property="fillColorView" destination="HRz-Cj-8os" id="A5V-NI-oyK"/>
+                <outlet property="fillLabel" destination="iEc-3w-bmk" id="P1P-Mv-yGG"/>
+                <outlet property="fontSizeComboBox" destination="swU-cd-Gvz" id="QbY-yf-Shw"/>
+                <outlet property="fontStyleComboBox" destination="YUH-iC-Gfd" id="ciA-Kh-Eza"/>
+                <outlet property="fontTypeComboBox" destination="XXz-op-f6s" id="bgH-KT-VuB"/>
+                <outlet property="outsideBox" destination="tIf-xt-4gb" id="sBn-hu-yLt"/>
+                <outlet property="outsideColorView" destination="hsW-GA-O7O" id="IeV-vL-cSB"/>
+                <outlet property="outsideLabel" destination="vqF-lq-3Jx" id="AlN-zM-Lue"/>
+                <outlet property="overTextCheck" destination="0vL-Pc-6jb" id="ZiI-yo-evK"/>
+                <outlet property="overTextView" destination="kBP-lZ-hOW" id="zT7-qM-v3l"/>
+                <outlet property="textAligementView" destination="w8W-es-efZ" id="tPj-4C-Vcb"/>
+                <outlet property="textColorView" destination="E5s-lo-OLZ" id="6Va-LZ-rRw"/>
+                <outlet property="textLabel" destination="ISn-KY-geN" id="TFx-pl-YP8"/>
+            </connections>
+            <point key="canvasLocation" x="168" y="570"/>
+        </customView>
+    </objects>
+</document>

+ 27 - 0
PDF Office/PDF Office/Class/PDFTools/Redact/Base/KMRedactContentBaseView.swift

@@ -0,0 +1,27 @@
+//
+//  KMRedactContentBaseView.swift
+//  PDF Office
+//
+//  Created by tangchao on 2023/1/17.
+//
+
+import Cocoa
+typealias KMRedactContentItemClick = (_ index: Int, _ value: Any?) -> ()
+class KMRedactContentBaseView: NSView {
+
+    var itemClick: KMRedactContentItemClick?
+
+    static var nibName: String? {
+        return "KMRedactBaseWindowController"
+    }
+    
+    static func createFromNib(in bundle: Bundle = Bundle.main) -> Self? {
+        guard let nibName = nibName else { return nil }
+        var topLevelArray: NSArray? = nil
+        bundle.loadNibNamed(NSNib.Name(nibName), owner: nil, topLevelObjects: &topLevelArray)
+        guard let results = topLevelArray else { return nil }
+        let views = Array<Any>(results).filter { $0 is Self }
+        return views.last as? Self
+    }
+    
+}

+ 18 - 0
PDF Office/PDF Office/Class/PDFTools/Redact/View/KMRedactAligementView.swift

@@ -0,0 +1,18 @@
+//
+//  KMRedactAligementView.swift
+//  PDF Office
+//
+//  Created by tangchao on 2023/1/17.
+//
+
+import Cocoa
+
+class KMRedactAligementView: KMWatermarkAligementView {
+
+    override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+
+        // Drawing code here.
+    }
+    
+}

+ 19 - 0
PDF Office/PDF Office/Class/PDFTools/Redact/View/KMRedactColorView.swift

@@ -0,0 +1,19 @@
+//
+//  KMRedactColorView.swift
+//  PDF Office
+//
+//  Created by tangchao on 2023/1/17.
+//
+
+import Cocoa
+
+class KMRedactColorView: KMWatermarkColorView {
+
+    override func awakeFromNib() {
+        self.wantsLayer = true
+        self.layer?.borderWidth = 1
+        self.layer?.borderColor = NSColor.black.cgColor
+        self.layer?.cornerRadius = 2
+    }
+    
+}

+ 291 - 0
PDF Office/PDF Office/Class/PDFTools/Redact/View/KMRedactPropertyContentView.swift

@@ -0,0 +1,291 @@
+//
+//  KMRedactPropertyContentView.swift
+//  PDF Office
+//
+//  Created by tangchao on 2023/1/17.
+//
+
+import Cocoa
+
+class KMRedactPropertyContentView: KMRedactContentBaseView {
+
+    @IBOutlet weak var outsideBox: NSBox!
+    
+    @IBOutlet weak var outsideLabel: NSTextField!
+    @IBOutlet weak var outsideColorView: KMRedactColorView!
+    
+    @IBOutlet weak var fillLabel: NSTextField!
+    @IBOutlet weak var fillColorView: KMRedactColorView!
+    
+    @IBOutlet weak var overTextCheck: NSButton!
+    @IBOutlet var overTextView: NSTextView!
+    
+    @IBOutlet weak var textLabel: NSTextField!
+    @IBOutlet weak var fontStyleComboBox: NSComboBox!
+    @IBOutlet weak var fontSizeComboBox: NSComboBox!
+    @IBOutlet weak var fontTypeComboBox: NSComboBox!
+    
+    @IBOutlet weak var textColorView: KMRedactColorView!
+    @IBOutlet weak var textAligementView: KMRedactAligementView!
+    
+    let fontSizes: Array<Int> = [8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72]
+    
+    var annotation : CPDFRedactAnnotation? {
+        get {
+            return nil
+        }
+        set {
+            if (newValue == nil) {
+                return
+            }
+            
+            self.outsideColorView.color = (newValue?.borderColor())!
+            self.fillColorView.color = newValue!.interiorColor()
+            self.textColorView.color = newValue!.fontColor()
+            
+            if ((newValue?.overlayText().isEmpty)!) {
+                self.isOverText(false)
+            } else {
+                self.isOverText(true)
+            }
+        }
+    }
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        self.outsideLabel.stringValue = "密文标记外观"
+        self.fillLabel.stringValue = "密文区域填充"
+        
+        self.overTextCheck.title = "使用覆盖文本"
+        self.overTextCheck.target = self
+        self.overTextCheck.action = #selector(overTextCheckAction)
+        self.overTextView.textContainerInset = NSMakeSize(6, 8)
+        self.overTextView.enclosingScrollView?.borderType = .noBorder
+        self.overTextView.enclosingScrollView?.contentView.wantsLayer = true
+        self.overTextView.enclosingScrollView?.contentView.layer?.borderWidth = 1
+        self.overTextView.enclosingScrollView?.contentView.layer?.borderColor = NSColor.black.cgColor
+        
+        self.overTextView.string = "这里输入覆盖文本"
+        self.overTextView.delegate = self
+        
+        self.textLabel.stringValue = "文本"
+        
+        /**
+         NSDictionary * dic = nil;
+         NSMutableArray * fontNames = [NSMutableArray array];
+         for (NSUInteger i=0; i<self.fonts.count; i++) {
+             NSDictionary *fontDic = self.fonts[i];
+             NSString * fontName = fontDic.allKeys.firstObject?:@"Helvetica";
+             NSString * family =   [notefont.fontDescriptor objectForKey:NSFontFamilyAttribute];
+             [fontNames addObject:fontName];
+             if ([family isEqualToString:fontName]) {
+                 dic = fontDic;
+             }
+         }
+         NSString * style =   [notefont.fontDescriptor objectForKey:NSFontFaceAttribute];
+         [self.fontComboBox removeAllItems];
+         [self.fontComboBox addItemsWithObjectValues:fontNames];
+             
+         */
+        /**
+         
+         -(NSUInteger)setFontStyleWithFontName:(NSString *)fontName currentStyle:(NSString *)style
+         {
+             NSUInteger selectIndex = -1;
+             NSMenu *menu = [[NSMenu alloc] init];
+             for (NSDictionary *dic in self.fonts) {
+                 NSString *familyString = dic.allKeys.firstObject;
+                 if ([familyString isEqual:fontName]) {
+                     NSArray *styles = [dic objectForKey:fontName];
+                     for (NSUInteger i = 0; i < styles.count; i++) {
+                         NSString * styleName = [styles objectAtIndex:i];
+                         if ([style isEqualToString:styleName]) {
+                             selectIndex = i;
+                         }
+                         NSFontDescriptor *attributeFontDescriptor = [NSFontDescriptor fontDescriptorWithFontAttributes:@{NSFontFamilyAttribute:fontName,NSFontFaceAttribute:styleName}];
+                         NSFont *font = [NSFont fontWithDescriptor:attributeFontDescriptor size:12.0];
+                         NSDictionary *attrited = @{NSFontAttributeName:font};
+                         NSAttributedString *string = [[NSAttributedString alloc] initWithString:styleName attributes:attrited];
+                         NSMenuItem *item = [[NSMenuItem alloc] init];
+                         item.attributedTitle = string;
+                         
+                         [menu addItem:item];
+                     }
+                     break;
+                 }
+             }
+             if (!style) {
+                 selectIndex = 0;
+             }
+             [self.fontStylePopUpButton setMenu:menu];
+             
+             return selectIndex;
+         }
+         */
+        var fontNames: Array<String> = []
+        for font in CPDFAnnotationModel.supportFonts() {
+            let fontDict: NSDictionary = font as! NSDictionary
+            let fontName: String = fontDict.allKeys.first as! String
+            fontNames.append(fontName)
+        }
+        self.fontStyleComboBox.delegate = self
+        self.fontStyleComboBox.removeAllItems()
+        self.fontStyleComboBox.addItems(withObjectValues: fontNames)
+        self.updateFontName(fontNames[1])
+        self.fontTypeComboBox.delegate = self
+        self.fontSizeComboBox.delegate = self
+        
+        self.fontSizeComboBox.removeAllItems()
+        self.fontSizeComboBox.addItems(withObjectValues: self.fontSizes)
+        self.fontSizeComboBox.stringValue = "自动"
+        
+        /*
+         self.interiorColor = annotationModel.interiorColor;
+         self.borderColor = annotationModel.color;
+         if (annotationModel.isOverlayText) {
+             self.overlayText = annotationModel.overlayText?:@"";
+             self.fontColor = annotationModel.fontColor;
+             self.alignment = annotationModel.alignment;
+             self.font = [NSFont fontWithName:@"Helvetica" size:annotationModel.fontSize];
+         }
+         */
+        
+        self.outsideColorView.itemClick = { [weak self] idx in
+            if (idx == 2) {
+                guard let callback = self!.itemClick else {
+                    return
+                }
+                callback(1, nil)
+            }
+        }
+        
+        self.fillColorView.itemClick = { [weak self] idx in
+            if (idx == 2) {
+                guard let callback = self!.itemClick else {
+                    return
+                }
+                callback(2, nil)
+            }
+        }
+        
+        self.textColorView.itemClick = { [weak self] idx in
+            if (idx == 2) {
+                guard let callback = self!.itemClick else {
+                    return
+                }
+                callback(8, nil)
+            }
+        }
+        
+        self.textAligementView.itemClick = {
+            (index: Int) in
+            guard let callback = self.itemClick else {
+                return
+            }
+            
+            callback(9, index)
+        }
+    }
+    
+    // MARK: Private Methods
+    
+    @objc private func overTextCheckAction(sender: NSButton) {
+        if (sender.state == .on) {
+            self.isOverText(true)
+        } else {
+            self.isOverText(false)
+        }
+        
+        guard let callback = self.itemClick else {
+            return
+        }
+        callback(3, sender.state == .on)
+    }
+    
+    private func isOverText(_ isOver: Bool) {
+        if (isOver) {
+            self.overTextCheck.state = .on
+            self.overTextView.isEditable = true
+            self.fontStyleComboBox.isEnabled = true
+            self.fontSizeComboBox.isEnabled = true
+            self.fontTypeComboBox.isEnabled = true
+        } else {
+            self.overTextCheck.state = .off
+            self.overTextView.isEditable = false
+            self.fontStyleComboBox.isEnabled = false
+            self.fontSizeComboBox.isEnabled = false
+            self.fontTypeComboBox.isEnabled = false
+//            self.textColorView.
+//            self.textAligementView.enable
+        }
+    }
+    
+    private func updateFontName(_ fontName: String) {
+        var styleNames: Array<String>?
+        for font in CPDFAnnotationModel.supportFonts() {
+            let fontDict = font as! NSDictionary
+            let name: String = fontDict.allKeys.first as! String
+            
+            if (name == fontName) {
+                let datas: Array<String> = fontDict.allValues.first as! Array<String>
+                styleNames = datas
+                self.fontStyleComboBox.stringValue = fontName
+                break
+            }
+        }
+        
+        if (styleNames != nil) {
+            self.fontTypeComboBox.removeAllItems()
+            self.fontTypeComboBox.addItems(withObjectValues: styleNames!)
+            self.fontTypeComboBox.selectItem(at: 0)
+        }
+    }
+    
+}
+
+extension KMRedactPropertyContentView: NSTextViewDelegate {
+    func textDidChange(_ notification: Notification) {
+        if (self.overTextView.isEqual(to: notification.object)) {
+            guard let callback = self.itemClick else {
+                return
+            }
+            callback(4, self.overTextView.string)
+        }
+    }
+}
+
+extension KMRedactPropertyContentView: NSComboBoxDelegate {
+    func comboBoxSelectionDidChange(_ notification: Notification) {
+        if (self.fontStyleComboBox.isEqual(to: notification.object)) {
+            var index: Int = self.fontStyleComboBox.indexOfSelectedItem
+            if (index < 0) {
+                index = 0
+            }
+            
+            guard let callback = self.itemClick else {
+                return
+            }
+            callback(5, index)
+        } else if (self.fontSizeComboBox.isEqual(to: notification.object)) {
+            var index: Int = self.fontSizeComboBox.indexOfSelectedItem
+            if (index < 0) {
+                index = 0
+            }
+            
+            guard let callback = self.itemClick else {
+                return
+            }
+            callback(6, index)
+        } else if (self.fontTypeComboBox.isEqual(to: notification.object)) {
+            var index: Int = self.fontTypeComboBox.indexOfSelectedItem
+            if (index < 0) {
+                index = 0
+            }
+            
+            guard let callback = self.itemClick else {
+                return
+            }
+            callback(7, index)
+        }
+    }
+}

+ 100 - 0
PDF Office/PDF Office/Class/PDFTools/Redact/Window/KMRedactPropertyWindowController.swift

@@ -0,0 +1,100 @@
+//
+//  KMRedactPropertyWindowController.swift
+//  PDF Office
+//
+//  Created by tangchao on 2023/1/17.
+//
+
+import Cocoa
+
+class KMRedactPropertyWindowController: KMRedactBaseWindowController {
+
+    var colorViewIndex: Int = 0
+    override func windowDidLoad() {
+        super.windowDidLoad()
+        self.setContentSize(NSSize(width: 444, height: 527))
+        self.topLineIsShow(false)
+        
+        self.titleLabel.stringValue = "密文设置"
+        self.funcButton.title = NSLocalizedString("确认", comment: "")
+        self.funcButton.layer?.backgroundColor = NSColor.black.cgColor
+        self.funcButton.attributedTitle = NSMutableAttributedString(string: self.funcButton.title, attributes: [NSAttributedString.Key.foregroundColor : NSColor.white])
+        
+        let contentView = KMRedactPropertyContentView.createFromNib()
+        contentView?.frame = self.contentBox.contentView!.bounds
+        contentView?.autoresizingMask = [.width,.height]
+        self.contentBox.contentView?.addSubview(contentView!)
+        self.contentView = contentView
+        contentView?.annotation = self.annotation
+        
+        var outsideColor: NSColor {
+            get {
+                return (self.contentView as! KMRedactPropertyContentView).outsideColorView.color!
+            }
+        }
+        var fillColor: NSColor {
+            get {
+                return (self.contentView as! KMRedactPropertyContentView).fillColorView.color!
+            }
+        }
+        var isOver: Bool {
+            get {
+                return (self.contentView as! KMRedactPropertyContentView).overTextCheck.state == .on
+            }
+        }
+        
+        var overText: String {
+            get {
+                return (self.contentView as! KMRedactPropertyContentView).overTextView.string
+            }
+        }
+        
+        contentView?.itemClick = { [weak self] index, value in
+            if (index == 1) { /// 外观
+                self?.colorViewIndex = 1
+                self?.showColorPanel()
+                return
+            } else if (index == 2) { /// 填充
+                self?.colorViewIndex = 2
+                self?.showColorPanel()
+                return
+            } else if (index == 3) { /// 覆盖文本check
+                
+            } else if (index == 4) { /// 覆盖文本编辑
+                
+            } else if (index == 5) { /// 字体类型
+                
+            } else if (index == 6) { /// 字体大小
+                
+            } else if (index == 7) { /// 字体相关
+                
+            } else if (index == 8) { /// 字体颜色
+                self?.colorViewIndex = 3
+                self?.showColorPanel()
+                return
+            } else if (index == 9) { /// 字体aligement
+                
+            }
+        }
+    }
+    
+    // MARK: Private Methods
+    
+    @objc private func showColorPanel() {
+        let panel = NSColorPanel.shared
+        panel.setTarget(self)
+        panel.setAction(#selector(colorPanelAction))
+        panel.orderFront(nil)
+    }
+    
+    @objc private func colorPanelAction(sender: NSColorPanel) {
+        if (self.colorViewIndex == 1) { /// 外观
+            (self.contentView as! KMRedactPropertyContentView).outsideColorView.color = sender.color
+        } else if (self.colorViewIndex == 2) {
+            (self.contentView as! KMRedactPropertyContentView).fillColorView.color = sender.color
+        } else if (self.colorViewIndex == 3) {
+            (self.contentView as! KMRedactPropertyContentView).textColorView.color = sender.color
+        }
+    }
+
+}

+ 1 - 1
PDF Office/PDF Office/Class/PDFTools/Watermark/Base/KMWatermarkAdjectivePropertyBaseController.xib

@@ -378,7 +378,7 @@
                     <rect key="frame" x="16" y="82" width="228" height="90"/>
                     <clipView key="contentView" drawsBackground="NO" id="7lk-KO-15c">
                         <rect key="frame" x="0.0" y="0.0" width="228" height="90"/>
-                        <autoresizingMask key="autoresizingMask"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <textView importsGraphics="NO" richText="NO" verticallyResizable="YES" spellingCorrection="YES" smartInsertDelete="YES" id="HaX-3g-Efp">
                                 <rect key="frame" x="0.0" y="0.0" width="228" height="90"/>

+ 117 - 0
PDF Office/PDF Office/Class/PDFTools/Watermark/View/KMWatermarkAligementView.swift

@@ -0,0 +1,117 @@
+//
+//  KMWatermarkAligementView.swift
+//  PDF Office
+//
+//  Created by tangchao on 2023/1/17.
+//
+
+import Cocoa
+
+typealias KMWatermarkAligementViewItemClick = (_ index: Int)->()
+class KMWatermarkAligementView: NSView {
+    var leftButton = NSButton()
+    var centerButton = NSButton()
+    var rightButton = NSButton()
+    
+    var vLine = NSView()
+    var vLine2 = NSView()
+    
+    var itemClick: KMWatermarkAligementViewItemClick!
+    
+    override init(frame frameRect: NSRect) {
+        super.init(frame: frameRect)
+        
+        initSubViews()
+    }
+    
+    required init?(coder: NSCoder) {
+        super.init(coder: coder)
+        
+        initSubViews()
+    }
+    
+    func initSubViews() {
+        wantsLayer = true
+        layer?.borderWidth = 1
+        layer?.borderColor = NSColor.black.cgColor
+        layer?.cornerRadius = 2
+        
+        addSubview(leftButton)
+        addSubview(centerButton)
+        addSubview(rightButton)
+        
+        addSubview(vLine)
+        addSubview(vLine2)
+        
+        for button in [leftButton, centerButton, rightButton] {
+            button.isBordered = false
+            button.wantsLayer = true
+            button.target = self
+            button.action = #selector(buttonAction)
+        }
+        
+        leftButton.title = "左"
+        centerButton.title = "中"
+        rightButton.title = "右"
+        
+        for line in [vLine, vLine2] {
+            line.wantsLayer = true
+            line.layer?.backgroundColor = NSColor.black.cgColor
+        }
+        
+        buttonAction(sender: leftButton)
+    }
+    
+    override func layout() {
+        super.layout()
+        
+        let width: CGFloat = NSWidth(self.bounds)
+        let height: CGFloat = NSHeight(self.bounds)
+        
+        let itemWidth: CGFloat = width / 3
+        leftButton.frame = NSMakeRect(0, 0, itemWidth, height)
+        centerButton.frame = NSMakeRect(itemWidth, 0, itemWidth, height)
+        rightButton.frame = NSMakeRect(2*itemWidth, 0, itemWidth, height)
+        
+        vLine.frame = NSMakeRect(itemWidth, 0, 1, height)
+        vLine2.frame = NSMakeRect(2*itemWidth, 0, 1, height)
+    }
+    
+    @objc func buttonAction(sender: NSButton) {
+        dealButtonSelectedState(selectButton: sender)
+        
+        guard let callback = itemClick else {
+            return
+        }
+        
+        var index: Int = 0
+        if (sender.isEqual(to: leftButton)) {
+            index = 0
+        } else if (sender.isEqual(to: centerButton)) {
+            index = 1
+        } else if (sender.isEqual(to: rightButton)) {
+            index = 2
+        }
+        callback(index)
+    }
+    
+    func dealButtonSelectedState(selectButton: NSButton) {
+        for button in [leftButton, centerButton, rightButton] {
+            if (button.isEqual(to: selectButton)) {
+                button.layer?.backgroundColor = NSColor(white: 0, alpha: 0.3).cgColor
+            } else {
+                button.layer?.backgroundColor = NSColor.clear.cgColor
+            }
+        }
+    }
+    
+    func selectIndex(index: Int) {
+        if (index == 0) {
+            dealButtonSelectedState(selectButton: leftButton)
+        } else if (index == 1) {
+            dealButtonSelectedState(selectButton: centerButton)
+        } else if (index == 2) {
+            dealButtonSelectedState(selectButton: rightButton)
+        }
+    }
+}

+ 84 - 0
PDF Office/PDF Office/Class/PDFTools/Watermark/View/KMWatermarkColorView.swift

@@ -0,0 +1,84 @@
+//
+//  KMWatermarkColorView.swift
+//  PDF Office
+//
+//  Created by tangchao on 2023/1/17.
+//
+
+import Cocoa
+
+typealias KMWatermarkColorViewItemClick = (_ idx: Int)->()
+class KMWatermarkColorView: NSView {
+    private var itemSize: CGFloat = 20.0
+    
+    var colorButton = NSButton()
+    var colorPlateButton = NSButton()
+    
+    private var myColor: NSColor = NSColor.black
+    var color: NSColor? {
+        get {
+            return myColor
+        }
+        set {
+            if (newValue == nil) {
+                return
+            }
+            
+            myColor = newValue!
+            self.colorButton.wantsLayer = true
+            self.colorButton.layer?.backgroundColor = newValue?.cgColor
+        }
+    }
+    
+    var itemClick: KMWatermarkColorViewItemClick!
+    
+    override init(frame frameRect: NSRect) {
+        super.init(frame: frameRect)
+        
+        initSubViews()
+    }
+    
+    required init?(coder: NSCoder) {
+        super.init(coder: coder)
+        
+        initSubViews()
+    }
+    
+    func initSubViews() {
+        addSubview(colorButton)
+        addSubview(colorPlateButton)
+        
+        colorButton.title = ""
+        colorButton.isBordered = false
+        colorButton.wantsLayer = true
+        colorButton.layer?.cornerRadius = itemSize * 0.5
+        colorPlateButton.title = ""
+        colorPlateButton.isBordered = false
+        colorPlateButton.wantsLayer = true
+        colorPlateButton.layer?.cornerRadius = itemSize * 0.5
+        colorPlateButton.target = self
+        colorPlateButton.action = #selector(colorPlateButtonAction)
+    }
+    
+    override func layout() {
+        super.layout()
+        
+        let width: CGFloat = NSWidth(self.bounds)
+        let heigth: CGFloat = NSHeight(self.bounds)
+        
+        let itemSize = self.itemSize
+        let itemY: CGFloat = (heigth-itemSize)*0.5
+        let colorX: CGFloat = (width*0.5-itemSize)*0.5
+        colorButton.frame = NSMakeRect(colorX, itemY, itemSize, itemSize)
+        let colorPlateX: CGFloat = width*0.5+colorX
+        colorPlateButton.frame = NSMakeRect(colorPlateX, itemY, itemSize, itemSize)
+    }
+    
+    @objc func colorPlateButtonAction() {
+        guard let callback = itemClick else {
+            return
+        }
+        
+        callback(2)
+    }
+}

+ 0 - 169
PDF Office/PDF Office/Class/PDFTools/Watermark/View/KMWatermarkTextView.swift

@@ -7,175 +7,6 @@
 
 import Cocoa
 
-typealias KMWatermarkColorViewItemClick = (_ idx: Int)->()
-class KMWatermarkColorView: NSView {
-    private var itemSize: CGFloat = 20.0
-    
-    var colorButton = NSButton()
-    var colorPlateButton = NSButton()
-    
-    var itemClick: KMWatermarkColorViewItemClick!
-    
-    override init(frame frameRect: NSRect) {
-        super.init(frame: frameRect)
-        
-        initSubViews()
-    }
-    
-    required init?(coder: NSCoder) {
-        super.init(coder: coder)
-        
-        initSubViews()
-    }
-    
-    func initSubViews() {
-        addSubview(colorButton)
-        addSubview(colorPlateButton)
-        
-        colorButton.title = ""
-        colorButton.isBordered = false
-        colorButton.wantsLayer = true
-        colorButton.layer?.cornerRadius = itemSize * 0.5
-        colorPlateButton.title = ""
-        colorPlateButton.isBordered = false
-        colorPlateButton.wantsLayer = true
-        colorPlateButton.layer?.cornerRadius = itemSize * 0.5
-        colorPlateButton.target = self
-        colorPlateButton.action = #selector(colorPlateButtonAction)
-    }
-    
-    override func layout() {
-        super.layout()
-        
-        let width: CGFloat = NSWidth(self.bounds)
-        let heigth: CGFloat = NSHeight(self.bounds)
-        
-        let itemSize = self.itemSize
-        let itemY: CGFloat = (heigth-itemSize)*0.5
-        let colorX: CGFloat = (width*0.5-itemSize)*0.5
-        colorButton.frame = NSMakeRect(colorX, itemY, itemSize, itemSize)
-        let colorPlateX: CGFloat = width*0.5+colorX
-        colorPlateButton.frame = NSMakeRect(colorPlateX, itemY, itemSize, itemSize)
-    }
-    
-    @objc func colorPlateButtonAction() {
-        guard let callback = itemClick else {
-            return
-        }
-        
-        callback(2)
-    }
-}
-
-typealias KMWatermarkAligementViewItemClick = (_ index: Int)->()
-class KMWatermarkAligementView: NSView {
-    var leftButton = NSButton()
-    var centerButton = NSButton()
-    var rightButton = NSButton()
-    
-    var vLine = NSView()
-    var vLine2 = NSView()
-    
-    var itemClick: KMWatermarkAligementViewItemClick!
-    
-    override init(frame frameRect: NSRect) {
-        super.init(frame: frameRect)
-        
-        initSubViews()
-    }
-    
-    required init?(coder: NSCoder) {
-        super.init(coder: coder)
-        
-        initSubViews()
-    }
-    
-    func initSubViews() {
-        wantsLayer = true
-        layer?.borderWidth = 1
-        layer?.borderColor = NSColor.black.cgColor
-        layer?.cornerRadius = 2
-        
-        addSubview(leftButton)
-        addSubview(centerButton)
-        addSubview(rightButton)
-        
-        addSubview(vLine)
-        addSubview(vLine2)
-        
-        for button in [leftButton, centerButton, rightButton] {
-            button.isBordered = false
-            button.wantsLayer = true
-            button.target = self
-            button.action = #selector(buttonAction)
-        }
-        
-        leftButton.title = "左"
-        centerButton.title = "中"
-        rightButton.title = "右"
-        
-        for line in [vLine, vLine2] {
-            line.wantsLayer = true
-            line.layer?.backgroundColor = NSColor.black.cgColor
-        }
-        
-        buttonAction(sender: leftButton)
-    }
-    
-    override func layout() {
-        super.layout()
-        
-        let width: CGFloat = NSWidth(self.bounds)
-        let height: CGFloat = NSHeight(self.bounds)
-        
-        let itemWidth: CGFloat = width / 3
-        leftButton.frame = NSMakeRect(0, 0, itemWidth, height)
-        centerButton.frame = NSMakeRect(itemWidth, 0, itemWidth, height)
-        rightButton.frame = NSMakeRect(2*itemWidth, 0, itemWidth, height)
-        
-        vLine.frame = NSMakeRect(itemWidth, 0, 1, height)
-        vLine2.frame = NSMakeRect(2*itemWidth, 0, 1, height)
-    }
-    
-    @objc func buttonAction(sender: NSButton) {
-        dealButtonSelectedState(selectButton: sender)
-        
-        guard let callback = itemClick else {
-            return
-        }
-        
-        var index: Int = 0
-        if (sender.isEqual(to: leftButton)) {
-            index = 0
-        } else if (sender.isEqual(to: centerButton)) {
-            index = 1
-        } else if (sender.isEqual(to: rightButton)) {
-            index = 2
-        }
-        callback(index)
-    }
-    
-    func dealButtonSelectedState(selectButton: NSButton) {
-        for button in [leftButton, centerButton, rightButton] {
-            if (button.isEqual(to: selectButton)) {
-                button.layer?.backgroundColor = NSColor(white: 0, alpha: 0.3).cgColor
-            } else {
-                button.layer?.backgroundColor = NSColor.clear.cgColor
-            }
-        }
-    }
-    
-    func selectIndex(index: Int) {
-        if (index == 0) {
-            dealButtonSelectedState(selectButton: leftButton)
-        } else if (index == 1) {
-            dealButtonSelectedState(selectButton: centerButton)
-        } else if (index == 2) {
-            dealButtonSelectedState(selectButton: rightButton)
-        }
-    }
-}
-
 class KMWatermarkTextView: KMWatermarkAdjectiveBaseView {
 
     @IBOutlet var textView: NSTextView!

+ 31 - 0
PDF Office/PDF Office/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -347,6 +347,37 @@ extension KMMainViewController {
         KMPrintWindowController.openFile(url: URL(fileURLWithPath: self.listView.document.documentURL.path))
     }
     
+    // MARK: Redact 【密文标记】
+    @objc func redact_menuItemClick_delete(sender: NSMenuItem?) {
+        self.listView.remove(self.listView.activeAnnotation)
+    }
+    
+    @objc func redact_menuItemClick_setProperty(sender: NSMenuItem?) {
+        let windowController = KMRedactPropertyWindowController((self.listView.activeAnnotation as! CPDFRedactAnnotation))
+        self.view.window?.beginSheet(windowController.window!)
+        self.currentWindowController = windowController
+    }
+    
+    @objc func redact_menuItemClick_setCurrentPropertyToDefaultValue(sender: NSMenuItem?) {
+        
+    }
+    
+    @objc func redact_menuItemClick_MultiPageFlag(sender: NSMenuItem?) {
+        
+    }
+    
+    @objc func redact_menuItemClick_apply(sender: NSMenuItem?) {
+        
+    }
+    
+    @objc func redact_menuItemClick_clear(sender: NSMenuItem?) {
+        
+    }
+    
+    @objc func redact_menuItemClick_paste(sender: NSMenuItem?) {
+        
+    }
+    
     //MARK: action
     
     private func cropCurrentPage() {

+ 32 - 0
PDF Office/PDF Office/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -29,6 +29,7 @@ import Cocoa
     var browserWindowController: KMBrowserWindowController?
     
     var cropSettingWindowController: KMCropSettingWindowController!
+    var currentWindowController: NSWindowController!
     
     @IBOutlet weak var topTipBox: NSBox!
     
@@ -322,6 +323,37 @@ import Cocoa
     
     func pdfListViewMenu(forEvent pdfListView: CPDFListView!, for theEvent: NSEvent!, click menu: AutoreleasingUnsafeMutablePointer<NSMenu?>!) {
         let currentMenu : NSMenu = menu.pointee!
+        if (listView.toolMode == .redactToolMode) {
+            if (listView.activeAnnotation == nil) {
+
+            } else {
+                let currentPoint: NSPoint = pdfListView.convert(theEvent.locationInWindow, from: pdfListView.superview)
+                let currentPage = pdfListView.page(for: currentPoint, nearest: true)
+//                let currentPage = pdfListView.activeAnnotation.page
+                let pagePoint = pdfListView.convert(currentPoint, to: currentPage)
+                
+                currentMenu.removeAllItems()
+                if (pdfListView.activeAnnotation.bounds.contains(pagePoint)) {
+                    currentMenu.insertItem(withTitle: "删除", action: #selector(redact_menuItemClick_delete), target: self, at: currentMenu.items.count)
+                    currentMenu.insertItem(NSMenuItem.separator(), at: currentMenu.items.count)
+                    
+                    currentMenu.insertItem(withTitle: "设置属性...", action: #selector(redact_menuItemClick_setProperty), target: self, at: currentMenu.items.count)
+                    currentMenu.insertItem(withTitle: "设置当前属性为默认值", action: #selector(redact_menuItemClick_setCurrentPropertyToDefaultValue), target: self, at: currentMenu.items.count)
+                    currentMenu.insertItem(NSMenuItem.separator(), at: currentMenu.items.count)
+                    
+                    currentMenu.insertItem(withTitle: "跨页重复标记", action: #selector(redact_menuItemClick_MultiPageFlag), target: self, at: currentMenu.items.count)
+                    currentMenu.insertItem(withTitle: "应用密文...", action: #selector(redact_menuItemClick_apply), target: self, at: currentMenu.items.count)
+                    currentMenu.insertItem(withTitle: "擦除密文...", action: #selector(redact_menuItemClick_clear), target: self, at: currentMenu.items.count)
+                } else {
+                    currentMenu.insertItem(withTitle: "粘贴", action: #selector(redact_menuItemClick_paste), target: self, at: currentMenu.items.count)
+                    
+                    currentMenu.insertItem(NSMenuItem.separator(), at: currentMenu.items.count)
+                    currentMenu.insertItem(self.findStringMenu(), at: currentMenu.items.count)
+                    currentMenu.insertItem(self.printingMenu(), at: currentMenu.items.count)
+                }
+            }
+            return
+        }
         if (listView.toolMode != .selectToolMode) {
             if (listView.activeAnnotation == nil) {
                 if(currentMenu.items.count > 2) {