Bladeren bron

【OCToSwift】KMNoteTypeImageView

lizhe 1 jaar geleden
bovenliggende
commit
36e54973d9

+ 8 - 16
PDF Office/PDF Master.xcodeproj/project.pbxproj

@@ -203,9 +203,6 @@
 		89D2D2C5294972B900BFF5FE /* KMFormCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89D2D2C4294972B900BFF5FE /* KMFormCellView.swift */; };
 		89D2D2C6294972B900BFF5FE /* KMFormCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89D2D2C4294972B900BFF5FE /* KMFormCellView.swift */; };
 		89D2D2C7294972B900BFF5FE /* KMFormCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89D2D2C4294972B900BFF5FE /* KMFormCellView.swift */; };
-		89D2D2CA2949D4C900BFF5FE /* KMNoteTypeImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D2D2C92949D4C900BFF5FE /* KMNoteTypeImageView.m */; };
-		89D2D2CB2949D4C900BFF5FE /* KMNoteTypeImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D2D2C92949D4C900BFF5FE /* KMNoteTypeImageView.m */; };
-		89D2D2CC2949D4C900BFF5FE /* KMNoteTypeImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D2D2C92949D4C900BFF5FE /* KMNoteTypeImageView.m */; };
 		89D2D2DE294C451400BFF5FE /* KMThumbnailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89D2D2DA294C451400BFF5FE /* KMThumbnailViewController.swift */; };
 		89D2D2DF294C451400BFF5FE /* KMThumbnailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89D2D2DA294C451400BFF5FE /* KMThumbnailViewController.swift */; };
 		89D2D2E0294C451400BFF5FE /* KMThumbnailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89D2D2DA294C451400BFF5FE /* KMThumbnailViewController.swift */; };
@@ -262,9 +259,6 @@
 		89E4E7002963D4A0002DBA6F /* KMComboBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 89E4E6FF2963D4A0002DBA6F /* KMComboBox.m */; };
 		89E4E7012963D4A0002DBA6F /* KMComboBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 89E4E6FF2963D4A0002DBA6F /* KMComboBox.m */; };
 		89E4E7022963D4A0002DBA6F /* KMComboBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 89E4E6FF2963D4A0002DBA6F /* KMComboBox.m */; };
-		89E4E7052963D588002DBA6F /* KMBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 89E4E7032963D588002DBA6F /* KMBox.m */; };
-		89E4E7062963D588002DBA6F /* KMBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 89E4E7032963D588002DBA6F /* KMBox.m */; };
-		89E4E7072963D588002DBA6F /* KMBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 89E4E7032963D588002DBA6F /* KMBox.m */; };
 		89E4E70B2963D62B002DBA6F /* KMAnnotationFontWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 89E4E7092963D62B002DBA6F /* KMAnnotationFontWindowController.xib */; };
 		89E4E70C2963D62B002DBA6F /* KMAnnotationFontWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 89E4E7092963D62B002DBA6F /* KMAnnotationFontWindowController.xib */; };
 		89E4E70D2963D62C002DBA6F /* KMAnnotationFontWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 89E4E7092963D62B002DBA6F /* KMAnnotationFontWindowController.xib */; };
@@ -1437,6 +1431,9 @@
 		ADAC0DE12AC273D600FD4F52 /* KMOCToolClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAC0DE02AC273D600FD4F52 /* KMOCToolClass.swift */; };
 		ADAC0DE22AC273D600FD4F52 /* KMOCToolClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAC0DE02AC273D600FD4F52 /* KMOCToolClass.swift */; };
 		ADAC0DE32AC273D600FD4F52 /* KMOCToolClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAC0DE02AC273D600FD4F52 /* KMOCToolClass.swift */; };
+		ADAC0DE52AC2B04900FD4F52 /* KMNoteTypeImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAC0DE42AC2B04800FD4F52 /* KMNoteTypeImageView.swift */; };
+		ADAC0DE62AC2B04900FD4F52 /* KMNoteTypeImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAC0DE42AC2B04800FD4F52 /* KMNoteTypeImageView.swift */; };
+		ADAC0DE72AC2B04900FD4F52 /* KMNoteTypeImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAC0DE42AC2B04800FD4F52 /* KMNoteTypeImageView.swift */; };
 		ADB1FE28297006DF00ED072D /* KMBatchWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADB1FE26297006DF00ED072D /* KMBatchWindowController.swift */; };
 		ADB1FE29297006DF00ED072D /* KMBatchWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADB1FE26297006DF00ED072D /* KMBatchWindowController.swift */; };
 		ADB1FE2A297006DF00ED072D /* KMBatchWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADB1FE26297006DF00ED072D /* KMBatchWindowController.swift */; };
@@ -3660,8 +3657,6 @@
 		89D2D2BC29486D2400BFF5FE /* KMSignatureCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMSignatureCellView.swift; sourceTree = "<group>"; };
 		89D2D2C029495D2100BFF5FE /* KMFormModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMFormModel.swift; sourceTree = "<group>"; };
 		89D2D2C4294972B900BFF5FE /* KMFormCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMFormCellView.swift; sourceTree = "<group>"; };
-		89D2D2C82949D4C900BFF5FE /* KMNoteTypeImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KMNoteTypeImageView.h; sourceTree = "<group>"; };
-		89D2D2C92949D4C900BFF5FE /* KMNoteTypeImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KMNoteTypeImageView.m; sourceTree = "<group>"; };
 		89D2D2DA294C451400BFF5FE /* KMThumbnailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMThumbnailViewController.swift; sourceTree = "<group>"; };
 		89D2D2E1294C452B00BFF5FE /* KMPDFThumbnailView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMPDFThumbnailView.swift; sourceTree = "<group>"; };
 		89D2D2F9294C806000BFF5FE /* KMPDFThumbnailItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPDFThumbnailItem.swift; sourceTree = "<group>"; };
@@ -4162,6 +4157,7 @@
 		ADA910292A272CE2003352F0 /* KMEditPDFTextManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMEditPDFTextManager.swift; sourceTree = "<group>"; };
 		ADA9102D2A272CEA003352F0 /* KMImageOptimization.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMImageOptimization.swift; sourceTree = "<group>"; };
 		ADAC0DE02AC273D600FD4F52 /* KMOCToolClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMOCToolClass.swift; sourceTree = "<group>"; };
+		ADAC0DE42AC2B04800FD4F52 /* KMNoteTypeImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMNoteTypeImageView.swift; sourceTree = "<group>"; };
 		ADB1FE26297006DF00ED072D /* KMBatchWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMBatchWindowController.swift; sourceTree = "<group>"; };
 		ADB1FE27297006DF00ED072D /* KMBatchWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMBatchWindowController.xib; sourceTree = "<group>"; };
 		ADB1FE30297008E800ED072D /* KMBatchCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMBatchCollectionView.swift; sourceTree = "<group>"; };
@@ -5473,8 +5469,7 @@
 				89D9895728FD21E6003A3E87 /* KMAnnotationCollectionView.swift */,
 				89D9896A28FD50EF003A3E87 /* KMAnnotationCollectionViewItem.swift */,
 				89D9896B28FD50EF003A3E87 /* KMAnnotationCollectionViewItem.xib */,
-				89D2D2C82949D4C900BFF5FE /* KMNoteTypeImageView.h */,
-				89D2D2C92949D4C900BFF5FE /* KMNoteTypeImageView.m */,
+				ADAC0DE42AC2B04800FD4F52 /* KMNoteTypeImageView.swift */,
 				BBA19F4629AE27DA001A285A /* KMAnnotationTableRowView.swift */,
 			);
 			path = View;
@@ -10926,6 +10921,7 @@
 				BB3AAB992987BEA900992A5A /* KMWatermarkPDFView_OC.m in Sources */,
 				BB7FF5072A60E84400901C2D /* KMEnumExtensions.swift in Sources */,
 				F3F0B27329B8ACD000722957 /* CPDFListViewDragObject.m in Sources */,
+				ADAC0DE52AC2B04900FD4F52 /* KMNoteTypeImageView.swift in Sources */,
 				9F8539BE2943085A00DF644E /* KMBrowser.swift in Sources */,
 				89D9896C28FD50EF003A3E87 /* KMAnnotationCollectionViewItem.swift in Sources */,
 				BB86C1ED28F544F4005AD968 /* CPDFListView+Event.m in Sources */,
@@ -11133,7 +11129,6 @@
 				89E4E70E2963D62C002DBA6F /* KMAnnotationFontWindowController.m in Sources */,
 				F37322E4292DF9410013862C /* CPDFCircleAnnotation+PDFListView.m in Sources */,
 				AD68782129A5FADC005B5210 /* KMLightMemberCache.swift in Sources */,
-				89D2D2CA2949D4C900BFF5FE /* KMNoteTypeImageView.m in Sources */,
 				AD8F06172999DB5900D93CBC /* KMPrintDrawPage.swift in Sources */,
 				BB14702F299DC0D100784A6A /* OIDTokenUtilities.m in Sources */,
 				89752E042939DB42003FF08E /* KMToolbarViewController.swift in Sources */,
@@ -11283,7 +11278,6 @@
 				BBB14A5F297929BD00936EDB /* KMRedactPageRangeWindowController.swift in Sources */,
 				ADA08A8A29F21A53009B2A7B /* KMPDFViewAnnotationOnceModeStore.swift in Sources */,
 				89E4E7822967BF5A002DBA6F /* KMCustomizeStampViewController.m in Sources */,
-				89E4E7052963D588002DBA6F /* KMBox.m in Sources */,
 				9F8DDF2D2924B855006CDC73 /* KMPDFToolsViewController.swift in Sources */,
 				BB897275294DC04F0045787C /* KMWatermartAdjectivePageRangeView.swift in Sources */,
 				F3B7DFA9294C545B00333201 /* NSPopover+PDFListView.m in Sources */,
@@ -11965,7 +11959,6 @@
 				BB146FD6299DC0D100784A6A /* GTLRObject.m in Sources */,
 				8942F7F92926089200389627 /* KMSignatureViewController.swift in Sources */,
 				89E4E75B296429CF002DBA6F /* NSShadow_SKExtensions.m in Sources */,
-				89D2D2CB2949D4C900BFF5FE /* KMNoteTypeImageView.m in Sources */,
 				89E4E7292963FB74002DBA6F /* KMPropertiesViewPopController.m in Sources */,
 				89752E052939DB42003FF08E /* KMToolbarViewController.swift in Sources */,
 				9FAAA33A290F72CC0046FFCE /* KMHistoryFileCollectionView.swift in Sources */,
@@ -12102,7 +12095,6 @@
 				BBB14A60297929BD00936EDB /* KMRedactPageRangeWindowController.swift in Sources */,
 				ADA08A8B29F21A53009B2A7B /* KMPDFViewAnnotationOnceModeStore.swift in Sources */,
 				89E4E7832967BF5A002DBA6F /* KMCustomizeStampViewController.m in Sources */,
-				89E4E7062963D588002DBA6F /* KMBox.m in Sources */,
 				BB897252294C3F660045787C /* KMMenuTableView.swift in Sources */,
 				9F1FE4CD29406E4700E952CA /* CTTabContentsController.m in Sources */,
 				8942F7BC29222C7E00389627 /* KMBookCellView.swift in Sources */,
@@ -12158,6 +12150,7 @@
 				BB6DD81D29348F31001F0544 /* KMSecureTextFiled.swift in Sources */,
 				BBC3482A29559B22008D2CD1 /* KMBackgroundListCell.swift in Sources */,
 				F386D15B293E152F00C44524 /* CPDFListViewColorMenuItemView.m in Sources */,
+				ADAC0DE62AC2B04900FD4F52 /* KMNoteTypeImageView.swift in Sources */,
 				BBB9B317299A5D6D004F3235 /* KMDropboxManager.m in Sources */,
 				ADB1FE29297006DF00ED072D /* KMBatchWindowController.swift in Sources */,
 				BB897266294C724D0045787C /* KMWatermarkAdjectiveOutsideView.swift in Sources */,
@@ -12407,7 +12400,6 @@
 				89316839296E436B0073EA59 /* NSImage+CustomImage.m in Sources */,
 				ADBC2D21299CDA29006280C8 /* NSView+Layer.swift in Sources */,
 				BB003028298CF7EC002DD1A0 /* KMPreferenceDisplayController.swift in Sources */,
-				89E4E7072963D588002DBA6F /* KMBox.m in Sources */,
 				9F0CB48929683DC400007028 /* KMPropertiesPanelPresetColorSubVC.swift in Sources */,
 				BB99ACC4292DE22E0048AFD9 /* KMMergeViewController.swift in Sources */,
 				F3732307292DF9410013862C /* CPDFSquareAnnotation+PDFListView.m in Sources */,
@@ -12797,7 +12789,6 @@
 				9F1F82EC2935D02E0092C4B4 /* KMComboBox.swift in Sources */,
 				8997012128F41AB8009AF911 /* KMLeftSideViewController.swift in Sources */,
 				F35B484D29A4903300756255 /* NSPointerArray+PDFListView.m in Sources */,
-				89D2D2CC2949D4C900BFF5FE /* KMNoteTypeImageView.m in Sources */,
 				89752E062939DB42003FF08E /* KMToolbarViewController.swift in Sources */,
 				89D2D2FD294C806000BFF5FE /* KMPDFThumbnailItem.swift in Sources */,
 				BBFBE74928DD7DB8008B2335 /* ViewController.swift in Sources */,
@@ -13105,6 +13096,7 @@
 				BBC347FF295448DE008D2CD1 /* KMWatermarkTemplateModel.swift in Sources */,
 				BBD7FE042A13218F00F96075 /* KMWatermarkAdjectivePropertyBaseController.swift in Sources */,
 				89752DA12936EC50003FF08E /* KMToolbar.m in Sources */,
+				ADAC0DE72AC2B04900FD4F52 /* KMNoteTypeImageView.swift in Sources */,
 				9F1FE4F229406E4700E952CA /* BackgroundGradientView.m in Sources */,
 				896933D229AEED520055327F /* SKTextFieldSheetController.m in Sources */,
 				89752DBF2936FAD0003FF08E /* NSWindow+PopOver.m in Sources */,

+ 0 - 39
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/View/KMNoteTypeImageView.h

@@ -1,39 +0,0 @@
-//
-//  KMNoteTypeImageView.h
-//  SignFlow
-//
-//  Created by wanjun on 2020/12/17.
-//
-
-#import <Cocoa/Cocoa.h>
-#import "CPDFListView.h"
-
-extern NSString *SKNFreeTextString;
-extern NSString *SKNNoteString;
-extern NSString *SKNCircleString;
-extern NSString *SKNSquareString;
-extern NSString *SKNHighlightString;
-extern NSString *SKNUnderlineString;
-extern NSString *SKNStrikeOutString;
-extern NSString *SKNLine_NoneString;
-extern NSString *SKNLine_OpenArrowString;
-extern NSString *SKNInkString;
-extern NSString *SKNStampString;
-extern NSString *SKNStamp_ImageString;
-extern NSString *SKNLinkString;
-extern NSString *SKNSignFalseString;
-extern NSString *SKNSignTureString;
-extern NSString *SKNSignCircleString;
-extern NSString *SKNSignLineString;
-extern NSString *SKNSignDotString;
-extern NSString *SKNRedactString;
-extern NSString *SKNSignatureString;
-
-@interface KMNoteTypeImageView : NSImageView
-
-- (NSImage *)noteTypeImageWithType:(NSString *)type
-                             Color:(NSColor *)color;
-
-- (NSImage *)noteTypeImageWithAnnotation:(CPDFAnnotation *)annotation;
-
-@end

+ 0 - 316
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/View/KMNoteTypeImageView.m

@@ -1,316 +0,0 @@
-//
-//  KMNoteTypeImageView.m
-//  SignFlow
-//
-//  Created by wanjun on 2020/12/17.
-//
-
-#import "KMNoteTypeImageView.h"
-#import "NSImage+PDFListView.h"
-
-
-NSString *KMAnnotationFormRadioButtonKey = @"KMAnnotationFormRadioButtonKey";
-NSString *KMAnnotationFormCheckBoxKey = @"KMAnnotationFormCheckBoxKey";
-NSString *KMAnnotationFormTextFieldKey = @"KMAnnotationFormTextFieldKey";
-NSString *KMAnnotationFormComboBoxKey = @"KMAnnotationFormComboBoxKey";
-NSString *KMAnnotationFormListMenuKey = @"KMAnnotationFormListMenuKey";
-NSString *KMAnnotationFormActionButtonKey = @"KMAnnotationFormActionButtonKey";
-
-NSString *KMSelfSignTypeFalseActionButtonKey = @"KMSelfSignTypeFalseActionButtonKey";
-NSString *KMSelfSignTypeTureActionButtonKey = @"KMSelfSignTypeTureActionButtonKey";
-NSString *KMSelfSignTypeCircleActionButtonKey = @"KMSelfSignTypeCircleActionButtonKey";
-NSString *KMSelfSignTypeLineActionButtonKey = @"KMSelfSignTypeLineActionButtonKey";
-NSString *KMSelfSignTypeDotActionButtonKey = @"KMSelfSignTypeDotActionButtonKey";
-NSString *KMSelfSignTypeTextActionButtonKey = @"KMSelfSignTypeTextActionButtonKey";
-
-NSString *SKNFreeTextString = @"SKNFreeTextString";
-NSString *SKNNoteString = @"SKNNoteString";
-NSString *SKNCircleString = @"SKNCircleString";
-NSString *SKNSquareString = @"SKNSquareString";
-NSString *SKNHighlightString = @"SKNHighlightString";
-NSString *SKNUnderlineString = @"SKNUnderlineString";
-NSString *SKNStrikeOutString = @"SKNStrikeOutString";
-NSString *SKNLine_NoneString = @"SKNLine_NoneString";
-NSString *SKNLine_OpenArrowString = @"SKNLine_OpenArrowString";
-NSString *SKNInkString = @"SKNInkString";
-NSString *SKNStampString = @"SKNStampString";
-NSString *SKNLinkString = @"SKNLinkString";
-NSString *SKNStamp_ImageString = @"SKNStamp_ImageString";
-NSString *SKNSignFalseString = @"SKNSignFalseString";
-NSString *SKNSignTureString = @"SKNSignTureString";
-NSString *SKNSignCircleString = @"SKNSignCircleString";
-NSString *SKNSignLineString = @"SKNSignLineString";
-NSString *SKNSignDotString = @"SKNSignDotString";
-NSString *SKNRedactString = @"SKNRedactString";
-NSString *SKNSignatureString = @"SKNSignatureString";
-
-
-@interface KMNoteTypeImageView ()
-
-@end
-
-@implementation KMNoteTypeImageView
-- (NSImage *)changeImageFillColor:(NSImage *)image withColor:(NSColor *)color {
-    NSImage *newImage = [[NSImage alloc] initWithSize:image.size];
-    [newImage setTemplate:false];
-    [newImage lockFocus];
-
-    [color setFill];
-    NSRect rect = NSMakeRect(0, 0, image.size.width, image.size.height);
-    NSRectFill(rect);
-
-    [image drawAtPoint:NSMakePoint(0, 0) fromRect:NSZeroRect operation:NSCompositingOperationDestinationIn fraction:1.0];
-
-    [newImage unlockFocus];
-    return newImage;
-}
-
-
-- (NSImage *)noteTypeImageWithType:(NSString *)type Color:(NSColor *)color {
-    NSImage *image = nil;
-    
-    NSString *strikePath = @"KMImageNameAnnotationStrikeout";
-    NSString *highlight = @"KMImageNameAnnotationHightlight";
-    NSString *underline = @"KMImageNameAnnotationUnderline";
-    NSString *inkImagePath = [[NSBundle mainBundle] pathForResource:@"KMImageNameAnnotationFreehand" ofType:@"pdf"];
-    if (@available(macOS 10.14, *)) {
-        NSAppearanceName appearanceName = [[NSApp effectiveAppearance] bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
-        if ([appearanceName isEqualToString:NSAppearanceNameDarkAqua]) {
-            strikePath = @"KMImageNameAnnotationStrikeout";
-            highlight = @"KMImageNameAnnotationHightlight";
-            underline = @"KMImageNameAnnotationUnderline";
-            inkImagePath = @"KMImageNameAnnotationFreehandDrak";
-        }
-    }
-    
-    if ([type isEqualToString:SKNNoteString]) {
-        image =  [NSImage colorWithImage:[NSImage imageNamed:@"KMImagePropertTextStyleOne_background"] frameImage:[NSImage imageNamed:@"KMImagePropertTextStyleOne_above"] withColor:color];
-////
-//        [NSImage colorWithImage:baseImage frameImage:frameImage withColor:color]
-//        image = [[NSImage alloc] initWithSize:CGSizeMake(16, 16)];
-//        [image lockFocus];
-//        CGRect rect = CGRectMake(0, 0, image.size.width, image.size.height);
-//        CGContextRef context = [NSGraphicsContext currentContext].graphicsPort;
-//        if (color) {
-//            CGContextSetFillColorWithColor(context, color.CGColor);
-//        } else {
-//            CGContextSetRGBFillColor(context, 1.0, 1.0, 0.0, 1.0);
-//        }
-//        CGContextSetRGBStrokeColor(context, 0.0, 0.0, 0.0, 1.0);
-//
-//        // Draw outer boxes.
-//        CGFloat width = 1.0;
-//        CGFloat size = 4.0;
-//        CGRect outerRect1 = CGRectInset(rect, 0, 0);
-//        outerRect1.origin.y += size;
-//        outerRect1.size.height -= size;
-//        CGRect outerRect2 = outerRect1;
-//        outerRect2.origin.x += size;
-//        outerRect2.origin.y -= size;
-//        outerRect2.size.width = size;
-//        outerRect2.size.height = size;
-//
-//        CGContextSetLineWidth(context, width);
-//        CGContextMoveToPoint(context, CGRectGetMinX(outerRect1), CGRectGetMinY(outerRect1));
-//        CGContextAddLineToPoint(context, CGRectGetMinX(outerRect1), CGRectGetMaxY(outerRect1));
-//        CGContextAddLineToPoint(context, CGRectGetMaxX(outerRect1), CGRectGetMaxY(outerRect1));
-//        CGContextAddLineToPoint(context, CGRectGetMaxX(outerRect1), CGRectGetMinY(outerRect1));
-//        CGContextAddLineToPoint(context, CGRectGetMaxX(outerRect2), CGRectGetMaxY(outerRect2));
-//        CGContextAddLineToPoint(context, CGRectGetMidX(outerRect2), CGRectGetMinY(outerRect2));
-//        CGContextAddLineToPoint(context, CGRectGetMinX(outerRect2), CGRectGetMaxY(outerRect2));
-//        CGContextAddLineToPoint(context, CGRectGetMinX(outerRect1), CGRectGetMinY(outerRect1));
-//        CGContextDrawPath(context, kCGPathFillStroke);
-//
-//        // Draw inner lines.
-//        int count = 3;
-//        CGFloat xDelta = 2.0;
-//        CGFloat yDelta = outerRect1.size.height / (count + 1);
-//
-//        CGRect lineRect = outerRect1;
-//        lineRect.origin.x += xDelta;
-//        lineRect.size.width -= 2*xDelta;
-//
-//        for (int i=0; i<count; i++) {
-//            CGFloat y = CGRectGetMaxY(lineRect) - yDelta * (i + 1);
-//            CGContextMoveToPoint(context, CGRectGetMinX(lineRect), y);
-//            CGContextAddLineToPoint(context, CGRectGetMaxX(lineRect), y);
-//            CGContextStrokePath(context);
-//        }
-//        [image unlockFocus];
-    }
-    else if ([type isEqualToString:SKNFreeTextString])
-        image = [NSImage imageNamed:@"KMImageNameMainToolFreeText"];
-    else if ([type isEqualToString:SKNCircleString]) {
-        image = [[NSImage alloc] initWithSize:CGSizeMake(16, 16)];
-        [image lockFocus];
-        CGContextRef ref = [NSGraphicsContext currentContext].graphicsPort;
-        CGContextSaveGState(ref);
-        CGContextBeginPath(ref);
-        CGContextAddArc(ref, 8, 8, 7, 0, 2*M_PI, 0);
-        NSColor *newColor = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
-        NSColor *newUnderlineColor = [NSColor colorWithRed:newColor.redComponent green:newColor.greenComponent blue:newColor.blueComponent alpha:1];
-        [newUnderlineColor set];
-        CGContextSetLineWidth(ref, 2);
-        CGContextStrokePath(ref);
-        CGContextRestoreGState(ref);
-        [image unlockFocus];
-    } else if ([type isEqualToString:SKNSquareString]) {
-        image = [[NSImage alloc] initWithSize:CGSizeMake(16, 16)];
-        [image lockFocus];
-        CGContextRef ref = [NSGraphicsContext currentContext].graphicsPort;
-        CGContextSaveGState(ref);
-        CGContextBeginPath(ref);
-        CGContextAddRect(ref, CGRectMake(1, 1, 14, 14));
-        NSColor *newColor = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
-        NSColor *newUnderlineColor = [NSColor colorWithRed:newColor.redComponent green:newColor.greenComponent blue:newColor.blueComponent alpha:1];
-        [newUnderlineColor set];
-        CGContextSetLineWidth(ref, 2);
-        CGContextStrokePath(ref);
-        CGContextRestoreGState(ref);
-        [image unlockFocus];
-    } else if ([type isEqualToString:SKNHighlightString]) {
-        NSImage *baseImage = [NSImage imageNamed:highlight];
-        image = [[NSImage alloc] initWithSize:baseImage.size];
-
-        [image lockFocus];
-        CGContextRef ref2 = [NSGraphicsContext currentContext].graphicsPort;
-        CGContextSaveGState(ref2);
-        color = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
-        NSColor *newUnderlineColor = [NSColor colorWithRed:color.redComponent green:color.greenComponent blue:color.blueComponent alpha:0.7];
-        [newUnderlineColor setFill];
-
-        CGContextSetStrokeColorWithColor(ref2, [NSColor clearColor].CGColor);
-        float fw = image.size.width;
-        float fh = image.size.height;
-        CGContextMoveToPoint(ref2, 0, fh-4);
-        CGContextAddArcToPoint(ref2, 0, 0, 4, 0, 2);
-        CGContextAddArcToPoint(ref2, fw, 0, fw, 4, 2);
-        CGContextAddArcToPoint(ref2, fw, fh, fw-4, fh, 2);
-        CGContextAddArcToPoint(ref2, 0, fh, 0, fh-4, 2);
-        CGContextDrawPath(ref2, kCGPathFillStroke);
-
-        [baseImage drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)];
-        CGContextRestoreGState(ref2);
-        [image unlockFocus];
-
-    }else if ([type isEqualToString:SKNUnderlineString]){
-        image = [NSImage imageNamed:underline];
-        [image lockFocus];
-        CGContextRef ref1 = [NSGraphicsContext currentContext].graphicsPort;
-        CGContextSaveGState(ref1);
-        CGContextBeginPath(ref1);
-        CGContextMoveToPoint(ref1, 0, 1);
-        CGContextAddLineToPoint(ref1, image.size.width, 1);
-        NSColor *newColor = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
-        NSColor *newUnderlineColor = [NSColor colorWithRed:newColor.redComponent green:newColor.greenComponent blue:newColor.blueComponent alpha:1];
-        [newUnderlineColor set];
-        CGContextSetLineWidth(ref1, 2);
-        CGContextStrokePath(ref1);
-        CGContextRestoreGState(ref1);
-        [image unlockFocus];
-    } else if ([type isEqualToString:SKNStrikeOutString]) {
-        image = [NSImage imageNamed:strikePath];
-        [image lockFocus];
-        CGContextRef ref = [NSGraphicsContext currentContext].graphicsPort;
-        CGContextSaveGState(ref);
-        CGContextBeginPath(ref);
-        CGContextMoveToPoint(ref, 0, image.size.height/2 - 2);
-        CGContextAddLineToPoint(ref, image.size.width, image.size.height/2 - 2);
-        NSColor *newColor = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
-        NSColor *strikenColor = [NSColor colorWithRed:newColor.redComponent green:newColor.greenComponent blue:newColor.blueComponent alpha:1];
-        [strikenColor set];
-        CGContextSetLineWidth(ref, 2);
-        CGContextStrokePath(ref);
-        CGContextRestoreGState(ref);
-        [image unlockFocus];
-    } else if ([type isEqualToString:SKNLine_NoneString]) {
-        image = [[NSImage alloc] initWithSize:CGSizeMake(16, 16)];
-        [image lockFocus];
-        CGContextRef ref = [NSGraphicsContext currentContext].graphicsPort;
-        CGContextSaveGState(ref);
-        CGContextBeginPath(ref);
-        CGContextMoveToPoint(ref, 0, 0);
-        CGContextAddLineToPoint(ref, 16, 16);
-        NSColor *newColor = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
-        NSColor *newUnderlineColor = [NSColor colorWithRed:newColor.redComponent green:newColor.greenComponent blue:newColor.blueComponent alpha:1];
-        [newUnderlineColor set];
-        CGContextSetLineWidth(ref, 2);
-        CGContextStrokePath(ref);
-        CGContextRestoreGState(ref);
-        [image unlockFocus];
-    } else if ([type isEqualToString:SKNLine_OpenArrowString]) {
-        image = [[NSImage alloc] initWithSize:CGSizeMake(16, 16)];
-        [image lockFocus];
-        CGContextRef ref = [NSGraphicsContext currentContext].graphicsPort;
-        CGContextSaveGState(ref);
-        CGContextBeginPath(ref);
-        CGContextMoveToPoint(ref, 0, 0);
-        CGContextAddLineToPoint(ref, 16, 16);
-        CGContextMoveToPoint(ref, 15, 15);
-        CGContextAddLineToPoint(ref, 9, 15);
-        CGContextMoveToPoint(ref, 15, 15);
-        CGContextAddLineToPoint(ref, 15, 9);
-        NSColor *newColor = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
-        NSColor *newUnderlineColor = [NSColor colorWithRed:newColor.redComponent green:newColor.greenComponent blue:newColor.blueComponent alpha:1];
-        [newUnderlineColor set];
-        CGContextSetLineWidth(ref, 2);
-        CGContextStrokePath(ref);
-        CGContextRestoreGState(ref);
-        [image unlockFocus];
-    } else if ([type isEqualToString:SKNInkString]) {
-        image = [[NSImage imageNamed:@"KMImageNameMainToolPen"] copy];
-//        [image lockFocus];
-//        CGContextRef ref3 = [NSGraphicsContext currentContext].graphicsPort;
-//        CGContextSaveGState(ref3);
-//        CGContextBeginPath(ref3);
-//        CGContextMoveToPoint(ref3, 2, 3);
-//        CGContextAddCurveToPoint(ref3, image.size.width/2, -5,  3 * image.size.width/4, 3 * image.size.width/4, image.size.width, 4);
-//        CGContextSetLineWidth(ref3, 2);
-//        NSColor *newColor = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
-//        NSColor *newInkColor = [NSColor colorWithRed:newColor.redComponent green:newColor.greenComponent blue:newColor.blueComponent alpha:1];
-//        [newInkColor set];
-//        CGContextStrokePath(ref3);
-//        CGContextRestoreGState(ref3);
-//        [image unlockFocus];
-    } else if ([type isEqualToString:SKNStampString])
-        image = [[NSImage imageNamed:@"KMImageNameMainToolStamp"] copy];
-    else if ([type isEqualToString:SKNLinkString])
-        image = [[NSImage imageNamed:@"KMImageNameAnnotationLink"] copy];
-    else if ([type isEqualToString:SKNStamp_ImageString])
-        image = [[NSImage imageNamed:@"KMImageNameAnnotationImage"] copy];
-    else if ([type isEqualToString:SKNSignFalseString])
-        image = [[NSImage imageNamed:@"KMImageNameToolbarForx"] copy];
-    else if ([type isEqualToString:SKNSignTureString])
-        image = [[NSImage imageNamed:@"KMImageNameToolbarTick"] copy];
-    else if ([type isEqualToString:SKNSignCircleString])
-        image = [[NSImage imageNamed:@"KMImageNameToolbarRoundedrec"] copy];
-    else if ([type isEqualToString:SKNSignLineString])
-        image = [[NSImage imageNamed:@"KMImageNameToolbarSignLine"] copy];
-    else if ([type isEqualToString:SKNSignDotString])
-        image = [[NSImage imageNamed:@"KMImageNameToolbarPoint"] copy];
-    else if ([type isEqualToString:SKNRedactString])
-        image = [[NSImage imageNamed:@"KMImageNameAnnotationListRedact"] copy];
-    else if ([type isEqualToString:SKNSignatureString])  {
-        image = [[NSImage imageNamed:@"KMImageNameSidetabbarSignatureNor"] copy];
-    }
-    return image;
-}
-
-- (NSImage *)noteTypeImageWithAnnotation:(CPDFAnnotation *)annotation {
-    NSImage *image = [[NSImage alloc] init];
-    image = [[NSImage alloc] initWithSize:annotation.bounds.size];
-    if (image.size.width != 0 && image.size.height != 0) {
-        [image lockFocus];
-        [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationHigh];
-        CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
-        
-        CGContextTranslateCTM(context, -annotation.bounds.origin.x, -annotation.bounds.origin.y);
-        [annotation drawWithBox:CPDFDisplayCropBox inContext:context];
-        
-        [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationDefault];
-        [image unlockFocus];
-    }
-    return image;
-}
-
-@end

+ 285 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/View/KMNoteTypeImageView.swift

@@ -0,0 +1,285 @@
+//
+//  KMNoteTypeImageView.swift
+//  PDF Master
+//
+//  Created by lizhe on 2023/9/26.
+//
+
+import Cocoa
+
+let KMAnnotationFormRadioButtonKey = "KMAnnotationFormRadioButtonKey"
+let KMAnnotationFormCheckBoxKey = "KMAnnotationFormCheckBoxKey"
+let KMAnnotationFormTextFieldKey = "KMAnnotationFormTextFieldKey"
+let KMAnnotationFormComboBoxKey = "KMAnnotationFormComboBoxKey"
+let KMAnnotationFormListMenuKey = "KMAnnotationFormListMenuKey"
+let KMAnnotationFormActionButtonKey = "KMAnnotationFormActionButtonKey"
+
+let KMSelfSignTypeFalseActionButtonKey = "KMSelfSignTypeFalseActionButtonKey"
+let KMSelfSignTypeTureActionButtonKey = "KMSelfSignTypeTureActionButtonKey"
+let KMSelfSignTypeCircleActionButtonKey = "KMSelfSignTypeCircleActionButtonKey"
+let KMSelfSignTypeLineActionButtonKey = "KMSelfSignTypeLineActionButtonKey"
+let KMSelfSignTypeDotActionButtonKey = "KMSelfSignTypeDotActionButtonKey"
+let KMSelfSignTypeTextActionButtonKey = "KMSelfSignTypeTextActionButtonKey"
+
+let SKNFreeTextString = "SKNFreeTextString"
+let SKNNoteString = "SKNNoteString"
+let SKNCircleString = "SKNCircleString"
+let SKNSquareString = "SKNSquareString"
+let SKNHighlightString = "SKNHighlightString"
+let SKNUnderlineString = "SKNUnderlineString"
+let SKNStrikeOutString = "SKNStrikeOutString"
+let SKNLine_NoneString = "SKNLine_NoneString"
+let SKNLine_OpenArrowString = "SKNLine_OpenArrowString"
+let SKNInkString = "SKNInkString"
+let SKNStampString = "SKNStampString"
+let SKNLinkString = "SKNLinkString"
+let SKNStamp_ImageString = "SKNStamp_ImageString"
+let SKNSignFalseString = "SKNSignFalseString"
+let SKNSignTureString = "SKNSignTureString"
+let SKNSignCircleString = "SKNSignCircleString"
+let SKNSignLineString = "SKNSignLineString"
+let SKNSignDotString = "SKNSignDotString"
+let SKNRedactString = "SKNRedactString"
+let SKNSignatureString = "SKNSignatureString"
+
+class KMNoteTypeImageView: NSImageView {
+    
+    func changeImageFillColor(_ image: NSImage, withColor color: NSColor) -> NSImage {
+        let newImage = NSImage(size: image.size)
+        newImage.isTemplate = false
+        newImage.lockFocus()
+        
+        color.setFill()
+        let rect = NSMakeRect(0, 0, image.size.width, image.size.height)
+        rect.fill()
+        
+        image.draw(at: NSMakePoint(0, 0), from: NSZeroRect, operation: .destinationIn, fraction: 1.0)
+        
+        newImage.unlockFocus()
+        return newImage
+    }
+    
+    func noteTypeImage(withType type: String, color: NSColor) -> NSImage? {
+        var image: NSImage?
+        
+        var strikePath = "KMImageNameAnnotationStrikeout"
+        var highlight = "KMImageNameAnnotationHightlight"
+        var underline = "KMImageNameAnnotationUnderline"
+        var inkImagePath = Bundle.main.path(forResource: "KMImageNameAnnotationFreehand", ofType: "pdf")
+        
+        if #available(macOS 10.14, *) {
+            let appearanceName = NSApp.effectiveAppearance.bestMatch(from: [.aqua, .darkAqua])
+            if appearanceName == .darkAqua {
+                strikePath = "KMImageNameAnnotationStrikeout"
+                highlight = "KMImageNameAnnotationHightlight"
+                underline = "KMImageNameAnnotationUnderline"
+                inkImagePath = "KMImageNameAnnotationFreehandDrak"
+            }
+        }
+
+        if type == SKNNoteString {
+            image = NSImage.colorWithImage(baseImage: NSImage(named: "KMImagePropertTextStyleOne_background")!, frameImage: NSImage(named:"KMImagePropertTextStyleOne_above")!, withColor: color)
+        } else if type == SKNFreeTextString {
+            image = NSImage(named: "KMImageNameMainToolFreeText")
+        } else if type == SKNCircleString {
+            image = NSImage(size: CGSize(width: 16, height: 16))
+            image?.lockFocus()
+            if let context = NSGraphicsContext.current?.cgContext {
+                context.saveGState()
+                context.beginPath()
+                context.addArc(center: CGPoint(x: 8, y: 8), radius: 7, startAngle: 0, endAngle: CGFloat(2 * Double.pi), clockwise: false)
+                let newColor = color.usingColorSpaceName(NSColorSpaceName.calibratedRGB)
+                let newUnderlineColor = NSColor(red: newColor!.redComponent, green: newColor!.greenComponent, blue: newColor!.blueComponent, alpha: 1)
+                newUnderlineColor.setStroke()
+                context.setLineWidth(2)
+                context.strokePath()
+                context.restoreGState()
+            }
+            image?.unlockFocus()
+        } else if type == SKNSquareString {
+            image = NSImage(size: CGSize(width: 16, height: 16))
+            image?.lockFocus()
+            if let context = NSGraphicsContext.current?.cgContext {
+                context.saveGState()
+                context.beginPath()
+                context.addRect(CGRect(x: 1, y: 1, width: 14, height: 14))
+                let newColor = color.usingColorSpaceName(NSColorSpaceName.calibratedRGB)
+                let newUnderlineColor = NSColor(red: newColor!.redComponent, green: newColor!.greenComponent, blue: newColor!.blueComponent, alpha: 1)
+                newUnderlineColor.setStroke()
+                context.setLineWidth(2)
+                context.strokePath()
+                context.restoreGState()
+            }
+            image?.unlockFocus()
+        } else if type == SKNHighlightString {
+            if let baseImage = NSImage(named: highlight) {
+                image = NSImage(size: baseImage.size)
+                image?.lockFocus()
+                if let context = NSGraphicsContext.current?.cgContext {
+                    let newColor = color.usingColorSpaceName(NSColorSpaceName.calibratedRGB)
+                    let newUnderlineColor = NSColor(red: newColor!.redComponent, green: newColor!.greenComponent, blue: newColor!.blueComponent, alpha: 0.7)
+                    newUnderlineColor.setFill()
+                    context.setStrokeColor(NSColor.clear.cgColor)
+                    let fw = image!.size.width
+                    let fh = image!.size.height
+                    context.move(to: CGPoint(x: 0, y: fh - 4))
+                    context.addArc(tangent1End: CGPoint(x: 0, y: 0), tangent2End: CGPoint(x: 4, y: 0), radius: 2)
+                    context.addArc(tangent1End: CGPoint(x: fw, y: 0), tangent2End: CGPoint(x: fw, y: 4), radius: 2)
+                    context.addArc(tangent1End: CGPoint(x: fw, y: fh), tangent2End: CGPoint(x: fw - 4, y: fh), radius: 2)
+                    context.addArc(tangent1End: CGPoint(x: 0, y: fh), tangent2End: CGPoint(x: 0, y: fh - 4), radius: 2)
+                    context.drawPath(using: .fillStroke)
+                    baseImage.draw(in: CGRect(x: 0, y: 0, width: image!.size.width, height: image!.size.height))
+                }
+                image?.unlockFocus()
+            }
+        } else if type == SKNUnderlineString {
+            image = NSImage(named: underline)
+            image?.lockFocus()
+            if let context = NSGraphicsContext.current?.cgContext {
+                context.beginPath()
+                context.move(to: CGPoint(x: 0, y: 1))
+                context.addLine(to: CGPoint(x: image!.size.width, y: 1))
+                let newColor = color.usingColorSpaceName(NSColorSpaceName.calibratedRGB)
+                let newUnderlineColor = NSColor(red: newColor!.redComponent, green: newColor!.greenComponent, blue: newColor!.blueComponent, alpha: 1)
+                newUnderlineColor.setStroke()
+                context.setLineWidth(2)
+                context.strokePath()
+            }
+            image?.unlockFocus()
+        } else if type == SKNStrikeOutString {
+            if let strikeImage = NSImage(named: strikePath) {
+                image = NSImage(size: strikeImage.size)
+                image?.lockFocus()
+                if let context = NSGraphicsContext.current?.cgContext {
+                    context.beginPath()
+                    context.move(to: CGPoint(x: 0, y: strikeImage.size.height / 2 - 2))
+                    context.addLine(to: CGPoint(x: strikeImage.size.width, y: strikeImage.size.height / 2 - 2))
+                    let newColor = color.usingColorSpaceName(NSColorSpaceName.calibratedRGB)
+                    let strikenColor = NSColor(red: newColor!.redComponent, green: newColor!.greenComponent, blue: newColor!.blueComponent, alpha: 1)
+                    strikenColor.setStroke()
+                    context.setLineWidth(2)
+                    context.strokePath()
+                }
+                image?.unlockFocus()
+            }
+        } else if type == SKNLine_NoneString {
+            image = NSImage(size: CGSize(width: 16, height: 16))
+            image?.lockFocus()
+            if let context = NSGraphicsContext.current?.cgContext {
+                context.beginPath()
+                context.move(to: CGPoint(x: 0, y: 0))
+                context.addLine(to: CGPoint(x: 16, y: 16))
+                let newColor = color.usingColorSpaceName(NSColorSpaceName.calibratedRGB)
+                let newUnderlineColor = NSColor(red: newColor!.redComponent, green: newColor!.greenComponent, blue: newColor!.blueComponent, alpha: 1)
+                newUnderlineColor.setStroke()
+                context.setLineWidth(2)
+                context.strokePath()
+            }
+            image?.unlockFocus()
+        } else if type == SKNLine_OpenArrowString {
+            image = NSImage(size: CGSize(width: 16, height: 16))
+            image?.lockFocus()
+            if let context = NSGraphicsContext.current?.cgContext {
+                context.beginPath()
+                context.move(to: CGPoint(x: 0, y: 0))
+                context.addLine(to: CGPoint(x: 16, y: 16))
+                context.move(to: CGPoint(x: 15, y: 15))
+                context.addLine(to: CGPoint(x: 9, y: 15))
+                context.move(to: CGPoint(x: 15, y: 15))
+                context.addLine(to: CGPoint(x: 15, y: 9))
+                let newColor = color.usingColorSpaceName(NSColorSpaceName.calibratedRGB)
+                let newUnderlineColor = NSColor(red: newColor!.redComponent, green: newColor!.greenComponent, blue: newColor!.blueComponent, alpha: 1)
+                newUnderlineColor.setStroke()
+                context.setLineWidth(2)
+                context.strokePath()
+            }
+            image?.unlockFocus()
+        } else if type == SKNInkString {
+            image = NSImage(named: "KMImageNameMainToolPen")?.copy() as? NSImage
+        } else if type == SKNStampString {
+            image = NSImage(named: "KMImageNameMainToolStamp")?.copy() as? NSImage
+        } else if type == SKNLinkString {
+            image = NSImage(named: "KMImageNameAnnotationLink")?.copy() as? NSImage
+        } else if type == SKNStamp_ImageString {
+            image = NSImage(named: "KMImageNameAnnotationImage")?.copy() as? NSImage
+        } else if type == SKNSignFalseString {
+            image = NSImage(named: "KMImageNameToolbarForx")?.copy() as? NSImage
+        } else if type == SKNSignTureString {
+            image = NSImage(named: "KMImageNameToolbarTick")?.copy() as? NSImage
+        } else if type == SKNSignCircleString {
+            image = NSImage(named: "KMImageNameToolbarRoundedrec")?.copy() as? NSImage
+        } else if type == SKNSignLineString {
+            image = NSImage(named: "KMImageNameToolbarSignLine")?.copy() as? NSImage
+        } else if type == SKNSignDotString {
+            image = NSImage(named: "KMImageNameToolbarPoint")?.copy() as? NSImage
+        } else if type == SKNRedactString {
+            image = NSImage(named: "KMImageNameAnnotationListRedact")?.copy() as? NSImage
+        } else if type == SKNSignatureString {
+            image = NSImage(named: "KMImageNameSidetabbarSignatureNor")?.copy() as? NSImage
+        }
+        
+        return image
+    }
+    
+    func noteTypeImage(with annotation: CPDFAnnotation) -> NSImage {
+        var image = NSImage()
+        image = NSImage(size: annotation.bounds.size)
+        if image.size.width != 0 && image.size.height != 0 {
+            image.lockFocus()
+            NSGraphicsContext.current?.imageInterpolation = .high
+            if let context = NSGraphicsContext.current?.cgContext {
+                context.translateBy(x: -annotation.bounds.origin.x, y: -annotation.bounds.origin.y)
+                annotation.draw(with: .cropBox, in: context)
+            }
+            NSGraphicsContext.current?.imageInterpolation = .default
+            image.unlockFocus()
+        }
+        return image
+    }
+}
+
+extension NSImage {
+    static func colorWithImage(baseImage: NSImage, frameImage: NSImage, withColor theColor: NSColor) -> NSImage {
+        if let ciImage = CIImage(bitmapImageRep: NSBitmapImageRep(data: baseImage.tiffRepresentation!)!),
+           let size = ciImage.extent.size as? CGSize {
+            
+            guard let ctx = CGContext(data: nil,
+                                      width: Int(size.width * 4),
+                                      height: Int(size.height * 4),
+                                      bitsPerComponent: 8,
+                                      bytesPerRow: 8 * Int(size.width * 4),
+                                      space: CGColorSpaceCreateDeviceRGB(),
+                                      bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue) else {
+                return NSImage()
+            }
+            
+            let red = UnsafeMutablePointer<CGFloat>.allocate(capacity: 1)
+            let green = UnsafeMutablePointer<CGFloat>.allocate(capacity: 1)
+            let blue = UnsafeMutablePointer<CGFloat>.allocate(capacity: 1)
+            let alpha = UnsafeMutablePointer<CGFloat>.allocate(capacity: 1)
+            
+            theColor.usingColorSpace(NSColorSpace.sRGB)?.getRed(red, green: green, blue: blue, alpha: alpha)
+            
+            let area = CGRect(x: 0, y: 0, width: size.width * 4, height: size.height * 4)
+            ctx.saveGState()
+            ctx.clip(to: area, mask: baseImage.cgImage(forProposedRect: nil, context: nil, hints: nil)!)
+            ctx.setFillColor(CGColor(red: red.pointee, green: green.pointee, blue: blue.pointee, alpha: alpha.pointee))
+            ctx.fill(area)
+            ctx.restoreGState()
+            ctx.setBlendMode(CGBlendMode.multiply)
+            ctx.draw(baseImage.cgImage(forProposedRect: nil, context: nil, hints: nil)!, in: area)
+            ctx.draw(frameImage.cgImage(forProposedRect: nil, context: nil, hints: nil)!, in: area)
+            
+            if let newImage = ctx.makeImage() {
+                let image = NSImage(cgImage: newImage, size: size)
+                return image
+            } else {
+                return NSImage()
+            }
+        } else {
+            return NSImage()
+        }
+    }
+}
+
+

+ 96 - 96
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
         <capability name="Named colors" minToolsVersion="9.0"/>
         <capability name="System colors introduced in macOS 10.13" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -143,7 +143,7 @@
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="a7P-Xu-XKF">
                                 <rect key="frame" x="16" y="1180" width="434" height="74"/>
                                 <subviews>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cC5-0c-h0J">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cC5-0c-h0J">
                                         <rect key="frame" x="-2" y="44" width="125" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="a8K-OV-h6P"/>
@@ -177,7 +177,7 @@
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="Xue-QX-MD2">
                                 <rect key="frame" x="16" y="977" width="434" height="147"/>
                                 <subviews>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="92O-JW-dIi">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="92O-JW-dIi">
                                         <rect key="frame" x="-2" y="117" width="30" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="YBN-Nq-khW"/>
@@ -190,14 +190,14 @@
                                     </textField>
                                     <button hidden="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="taX-st-Tjt">
                                         <rect key="frame" x="418" y="119" width="16" height="16"/>
-                                        <constraints>
-                                            <constraint firstAttribute="width" constant="16" id="BGN-2E-mUA"/>
-                                            <constraint firstAttribute="height" constant="16" id="H5d-hA-s37"/>
-                                        </constraints>
                                         <buttonCell key="cell" type="bevel" bezelStyle="regularSquare" image="KMImageNameBtnFontsetNor" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="62j-iQ-By1">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="width" constant="16" id="BGN-2E-mUA"/>
+                                            <constraint firstAttribute="height" constant="16" id="H5d-hA-s37"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="currentFontColorButtonAction:" target="-2" id="NLz-J7-do0"/>
                                         </connections>
@@ -210,28 +210,28 @@
                                             <subviews>
                                                 <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ViI-Ii-u2U">
                                                     <rect key="frame" x="37" y="5" width="20" height="20"/>
-                                                    <constraints>
-                                                        <constraint firstAttribute="width" constant="20" id="SRZ-aV-WfP"/>
-                                                        <constraint firstAttribute="height" constant="20" id="hFt-m7-V2M"/>
-                                                    </constraints>
                                                     <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="buttonCell:mpI-N3-5Xn:image" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="mpI-N3-5Xn">
                                                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                         <font key="font" metaFont="system"/>
                                                     </buttonCell>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="20" id="SRZ-aV-WfP"/>
+                                                        <constraint firstAttribute="height" constant="20" id="hFt-m7-V2M"/>
+                                                    </constraints>
                                                     <connections>
                                                         <action selector="fontCustomColorButtonAction:" target="-2" id="UGk-7t-CVJ"/>
                                                     </connections>
                                                 </button>
                                                 <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2I2-fI-EWd" customClass="KMGeneralButton">
                                                     <rect key="frame" x="8" y="5" width="20" height="20"/>
-                                                    <constraints>
-                                                        <constraint firstAttribute="height" constant="20" id="Fxs-qY-2lb"/>
-                                                        <constraint firstAttribute="width" constant="20" id="hPc-Bc-dDJ"/>
-                                                    </constraints>
                                                     <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="DLu-8k-sgt">
                                                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                         <font key="font" metaFont="system"/>
                                                     </buttonCell>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="20" id="Fxs-qY-2lb"/>
+                                                        <constraint firstAttribute="width" constant="20" id="hPc-Bc-dDJ"/>
+                                                    </constraints>
                                                     <connections>
                                                         <action selector="fontColorButtonAction:" target="-2" id="oHf-V6-h3Y"/>
                                                     </connections>
@@ -348,7 +348,7 @@
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="j7L-XP-jm7">
                                 <rect key="frame" x="16" y="889" width="434" height="72"/>
                                 <subviews>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="0cN-zY-qYW">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="0cN-zY-qYW">
                                         <rect key="frame" x="-2" y="42" width="51" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="CyS-pK-DRt"/>
@@ -371,14 +371,14 @@
                                     </box>
                                     <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8e2-oa-JZE">
                                         <rect key="frame" x="410" y="40" width="24" height="24"/>
-                                        <constraints>
-                                            <constraint firstAttribute="width" constant="24" id="Bk9-eE-KvQ"/>
-                                            <constraint firstAttribute="height" constant="24" id="EO0-ui-Vyw"/>
-                                        </constraints>
                                         <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="KMImagePropertPanelOpacityButtonImage" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="FSt-Pc-lLe">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="width" constant="24" id="Bk9-eE-KvQ"/>
+                                            <constraint firstAttribute="height" constant="24" id="EO0-ui-Vyw"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="showOpacityView:" target="-2" id="NhJ-TY-mYV"/>
                                         </connections>
@@ -398,7 +398,7 @@
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="UKx-Bm-zSR">
                                 <rect key="frame" x="16" y="808" width="434" height="65"/>
                                 <subviews>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="R6h-Hl-ZJK">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="R6h-Hl-ZJK">
                                         <rect key="frame" x="-2" y="40" width="73" height="15"/>
                                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="BorderColor" id="BO4-ud-8Oa">
                                             <font key="font" metaFont="cellTitle"/>
@@ -418,14 +418,14 @@
                                     </box>
                                     <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2Ci-Mm-JQs">
                                         <rect key="frame" x="410" y="36" width="24" height="24"/>
-                                        <constraints>
-                                            <constraint firstAttribute="width" constant="24" id="r1w-vu-EiY"/>
-                                            <constraint firstAttribute="height" constant="24" id="w4K-0J-axh"/>
-                                        </constraints>
                                         <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="KMImagePropertPanelOpacityButtonImage" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="xMu-UF-F9P">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="width" constant="24" id="r1w-vu-EiY"/>
+                                            <constraint firstAttribute="height" constant="24" id="w4K-0J-axh"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="showBorderOpacityView:" target="-2" id="w1a-3U-tdM"/>
                                         </connections>
@@ -445,7 +445,7 @@
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="Wqc-fu-8cC">
                                 <rect key="frame" x="16" y="722" width="434" height="70"/>
                                 <subviews>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="SXU-Sd-6MR">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="SXU-Sd-6MR">
                                         <rect key="frame" x="-2" y="40" width="438" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="PP5-3V-aNY"/>
@@ -458,7 +458,7 @@
                                     </textField>
                                     <slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="boX-yy-3DZ">
                                         <rect key="frame" x="-2" y="0.0" width="344" height="28"/>
-                                        <sliderCell key="cell" continuous="YES" alignment="left" minValue="0.5" maxValue="18" doubleValue="0.5" tickMarkPosition="above" sliderType="linear" id="uiL-cC-yeG" customClass="KMPropertiesSliderCell"/>
+                                        <sliderCell key="cell" continuous="YES" alignment="left" minValue="0.5" maxValue="18" doubleValue="0.5" tickMarkPosition="above" sliderType="linear" id="uiL-cC-yeG"/>
                                         <connections>
                                             <action selector="borderWidthSliderAction:" target="-2" id="fbp-7j-nGS"/>
                                         </connections>
@@ -491,7 +491,7 @@
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="0Hy-qV-PaZ">
                                 <rect key="frame" x="16" y="589" width="434" height="61"/>
                                 <subviews>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Hpi-My-lMy">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Hpi-My-lMy">
                                         <rect key="frame" x="-2" y="34" width="50" height="17"/>
                                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Rotate" id="Xog-bu-1An">
                                             <font key="font" metaFont="systemBold" size="14"/>
@@ -537,7 +537,7 @@
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="qEm-iT-hYO">
                                 <rect key="frame" x="16" y="509" width="434" height="64"/>
                                 <subviews>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7Mz-Wf-4ou">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7Mz-Wf-4ou">
                                         <rect key="frame" x="-2" y="34" width="42" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="DLT-Lf-6tu"/>
@@ -548,68 +548,68 @@
                                             <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                         </textFieldCell>
                                     </textField>
-                                    <button verticalHuggingPriority="750" tag="201" translatesAutoresizingMaskIntoConstraints="NO" id="tAa-o8-627">
+                                    <button tag="201" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tAa-o8-627">
                                         <rect key="frame" x="0.0" y="0.0" width="24" height="24"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="24" id="pNH-qa-n5Q"/>
-                                        </constraints>
                                         <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="KMImageNamePropertybarFillsignTickNor" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="P4K-Tz-UWO">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="24" id="pNH-qa-n5Q"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="buttonClicked_TypeAwitch:" target="-2" id="jEI-bO-oYf"/>
                                         </connections>
                                     </button>
-                                    <button verticalHuggingPriority="750" tag="202" translatesAutoresizingMaskIntoConstraints="NO" id="HmD-6T-x8g">
+                                    <button tag="202" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="HmD-6T-x8g">
                                         <rect key="frame" x="103" y="0.0" width="24" height="24"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="24" id="3h3-SL-Ktl"/>
-                                        </constraints>
                                         <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="KMImageNamePropertybarFillsignForkNor" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="bbP-ig-gJb">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="24" id="3h3-SL-Ktl"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="buttonClicked_TypeAwitch:" target="-2" id="sbM-N1-nwQ"/>
                                         </connections>
                                     </button>
-                                    <button verticalHuggingPriority="750" tag="204" translatesAutoresizingMaskIntoConstraints="NO" id="jPa-nU-Huo">
+                                    <button tag="204" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jPa-nU-Huo">
                                         <rect key="frame" x="308" y="0.0" width="24" height="24"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="24" id="NpN-6w-VJW"/>
-                                        </constraints>
                                         <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="KMImageNamePropertybarFillsignLineNor" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="EQQ-fD-eND">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="24" id="NpN-6w-VJW"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="buttonClicked_TypeAwitch:" target="-2" id="fBi-2G-xsh"/>
                                         </connections>
                                     </button>
-                                    <button verticalHuggingPriority="750" tag="205" translatesAutoresizingMaskIntoConstraints="NO" id="nb0-WN-6kd">
+                                    <button tag="205" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nb0-WN-6kd">
                                         <rect key="frame" x="410" y="0.0" width="24" height="24"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="24" id="OkL-97-Joq"/>
-                                            <constraint firstAttribute="width" constant="24" id="WKr-9R-hh4"/>
-                                        </constraints>
                                         <buttonCell key="cell" type="bevel" bezelStyle="rounded" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="v8L-w6-HhG">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="24" id="OkL-97-Joq"/>
+                                            <constraint firstAttribute="width" constant="24" id="WKr-9R-hh4"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="buttonClicked_TypeAwitch:" target="-2" id="rRu-v8-Xf9"/>
                                         </connections>
                                     </button>
-                                    <button verticalHuggingPriority="750" tag="203" translatesAutoresizingMaskIntoConstraints="NO" id="Ml3-mh-BGL">
+                                    <button tag="203" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Ml3-mh-BGL">
                                         <rect key="frame" x="205" y="0.0" width="24" height="24"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="24" id="sdf-0M-Mi1"/>
-                                        </constraints>
                                         <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="KMImageNamePropertybarFillsignRoundedrecNor" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="yNZ-ks-GBE">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="24" id="sdf-0M-Mi1"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="buttonClicked_TypeAwitch:" target="-2" id="vcM-ax-Bbr"/>
                                         </connections>
@@ -670,7 +670,7 @@
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="dMO-dl-RLX">
                                 <rect key="frame" x="16" y="400" width="434" height="93"/>
                                 <subviews>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2O6-uo-3Zy">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2O6-uo-3Zy">
                                         <rect key="frame" x="-2" y="63" width="37" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="DzU-o8-kZA"/>
@@ -683,9 +683,6 @@
                                     </textField>
                                     <popUpButton translatesAutoresizingMaskIntoConstraints="NO" id="ec5-v7-tz1" customClass="KMPopUpButton">
                                         <rect key="frame" x="0.0" y="29" width="434" height="24"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="24" id="hTd-sR-52F"/>
-                                        </constraints>
                                         <popUpButtonCell key="cell" type="square" title="Item 1" bezelStyle="shadowlessSquare" alignment="left" lineBreakMode="truncatingTail" state="on" imageScaling="proportionallyDown" inset="2" arrowPosition="noArrow" selectedItem="2nL-Iw-EJZ" id="0vD-XE-dnt">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="menu"/>
@@ -697,6 +694,9 @@
                                                 </items>
                                             </menu>
                                         </popUpButtonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="24" id="hTd-sR-52F"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="dateCheckButtonAction:" target="-2" id="qep-Z5-4sd"/>
                                         </connections>
@@ -726,7 +726,7 @@
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="0kd-2Q-Qgn">
                                 <rect key="frame" x="16" y="16" width="434" height="252"/>
                                 <subviews>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="lch-l1-qrw">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="lch-l1-qrw">
                                         <rect key="frame" x="-2" y="222" width="37" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="B4O-eL-cX9"/>
@@ -811,14 +811,14 @@
                                             <subviews>
                                                 <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jHQ-u9-brw">
                                                     <rect key="frame" x="54" y="4" width="110" height="32"/>
-                                                    <constraints>
-                                                        <constraint firstAttribute="height" constant="32" id="dlV-cz-ZhP"/>
-                                                        <constraint firstAttribute="width" constant="110" id="uwO-gZ-LJV"/>
-                                                    </constraints>
                                                     <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="KMImagePropertPanelLineStyleSolidLine" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="TLd-4r-ahJ">
                                                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                         <font key="font" metaFont="system"/>
                                                     </buttonCell>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="32" id="dlV-cz-ZhP"/>
+                                                        <constraint firstAttribute="width" constant="110" id="uwO-gZ-LJV"/>
+                                                    </constraints>
                                                     <connections>
                                                         <action selector="updateInkStype:" target="-2" id="Ygq-gl-t1V"/>
                                                     </connections>
@@ -836,16 +836,16 @@
                                             <rect key="frame" x="0.0" y="0.0" width="217" height="40"/>
                                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                             <subviews>
-                                                <button verticalHuggingPriority="750" tag="1" translatesAutoresizingMaskIntoConstraints="NO" id="BVT-tc-ES5">
+                                                <button tag="1" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="BVT-tc-ES5">
                                                     <rect key="frame" x="54" y="4" width="110" height="32"/>
-                                                    <constraints>
-                                                        <constraint firstAttribute="width" constant="110" id="3le-TH-rNK"/>
-                                                        <constraint firstAttribute="height" constant="32" id="gfA-pS-IDD"/>
-                                                    </constraints>
                                                     <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="KMImagePropertPanelLineStyleDottedLine" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="n3j-Zw-zcj">
                                                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                         <font key="font" metaFont="system"/>
                                                     </buttonCell>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="110" id="3le-TH-rNK"/>
+                                                        <constraint firstAttribute="height" constant="32" id="gfA-pS-IDD"/>
+                                                    </constraints>
                                                     <connections>
                                                         <action selector="updateInkStype:" target="-2" id="pGR-Zk-SQc"/>
                                                     </connections>
@@ -955,7 +955,7 @@
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="juZ-TW-wNg">
                                 <rect key="frame" x="16" y="284" width="434" height="100"/>
                                 <subviews>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kZM-Zt-V3a">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kZM-Zt-V3a">
                                         <rect key="frame" x="-2" y="85" width="33" height="15"/>
                                         <textFieldCell key="cell" lineBreakMode="clipping" title="Style" id="uNh-05-LPZ">
                                             <font key="font" metaFont="cellTitle"/>
@@ -965,98 +965,98 @@
                                     </textField>
                                     <button translatesAutoresizingMaskIntoConstraints="NO" id="klg-RX-gB8">
                                         <rect key="frame" x="0.0" y="43" width="50" height="32"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="32" id="Acs-oV-D5J"/>
-                                            <constraint firstAttribute="width" constant="50" id="PPF-Kf-ffK"/>
-                                        </constraints>
                                         <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMImagePropertTextStyleOne" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="Qbf-ge-gQh">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="32" id="Acs-oV-D5J"/>
+                                            <constraint firstAttribute="width" constant="50" id="PPF-Kf-ffK"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="textAnnotationStyleAction:" target="-2" id="Vxb-Ir-5w7"/>
                                         </connections>
                                     </button>
                                     <button tag="2" translatesAutoresizingMaskIntoConstraints="NO" id="n4z-HI-nSl">
                                         <rect key="frame" x="60" y="43" width="50" height="32"/>
-                                        <constraints>
-                                            <constraint firstAttribute="width" constant="50" id="53D-XN-6tN"/>
-                                            <constraint firstAttribute="height" constant="32" id="bTB-ax-vji"/>
-                                        </constraints>
                                         <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMImagePropertTextStylenote" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="ABY-FA-34p">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="width" constant="50" id="53D-XN-6tN"/>
+                                            <constraint firstAttribute="height" constant="32" id="bTB-ax-vji"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="textAnnotationStyleAction:" target="-2" id="ATw-zB-741"/>
                                         </connections>
                                     </button>
                                     <button tag="1" translatesAutoresizingMaskIntoConstraints="NO" id="d09-wv-hpl">
                                         <rect key="frame" x="120" y="43" width="50" height="32"/>
-                                        <constraints>
-                                            <constraint firstAttribute="width" constant="50" id="YZf-St-dgm"/>
-                                            <constraint firstAttribute="height" constant="32" id="gb8-uZ-b8y"/>
-                                        </constraints>
                                         <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMImagePropertTextStyleKeyWord" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="4Ky-ca-sVn">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="width" constant="50" id="YZf-St-dgm"/>
+                                            <constraint firstAttribute="height" constant="32" id="gb8-uZ-b8y"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="textAnnotationStyleAction:" target="-2" id="Mkc-2G-w9R"/>
                                         </connections>
                                     </button>
                                     <button tag="3" translatesAutoresizingMaskIntoConstraints="NO" id="mrl-9S-f5R">
                                         <rect key="frame" x="180" y="43" width="50" height="32"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="32" id="BlL-rh-SNH"/>
-                                            <constraint firstAttribute="width" constant="50" id="d0u-Gb-wyX"/>
-                                        </constraints>
                                         <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMImagePropertTextStyleHelp" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="apG-i9-4oc">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="32" id="BlL-rh-SNH"/>
+                                            <constraint firstAttribute="width" constant="50" id="d0u-Gb-wyX"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="textAnnotationStyleAction:" target="-2" id="4Md-1n-wcY"/>
                                         </connections>
                                     </button>
                                     <button tag="5" translatesAutoresizingMaskIntoConstraints="NO" id="dlU-7p-n7P">
                                         <rect key="frame" x="0.0" y="6" width="50" height="32"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="32" id="7rW-UK-NiP"/>
-                                            <constraint firstAttribute="width" constant="50" id="8R6-Vc-rIg"/>
-                                        </constraints>
                                         <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMImagePropertTextStyleP" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="jC4-hW-1xR">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="32" id="7rW-UK-NiP"/>
+                                            <constraint firstAttribute="width" constant="50" id="8R6-Vc-rIg"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="textAnnotationStyleAction:" target="-2" id="ghq-2j-F79"/>
                                         </connections>
                                     </button>
                                     <button tag="6" translatesAutoresizingMaskIntoConstraints="NO" id="jpU-jd-E7o">
                                         <rect key="frame" x="60" y="6" width="50" height="32"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="32" id="oLC-Ec-Ybc"/>
-                                            <constraint firstAttribute="width" constant="50" id="z8l-8d-ors"/>
-                                        </constraints>
                                         <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMImagePropertTextStyleInsert" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="x0Z-ng-kqB">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="32" id="oLC-Ec-Ybc"/>
+                                            <constraint firstAttribute="width" constant="50" id="z8l-8d-ors"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="textAnnotationStyleAction:" target="-2" id="5pw-qC-ECK"/>
                                         </connections>
                                     </button>
                                     <button tag="4" translatesAutoresizingMaskIntoConstraints="NO" id="ogH-xG-Khg">
                                         <rect key="frame" x="120" y="6" width="50" height="32"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="32" id="lTR-c5-dmS"/>
-                                            <constraint firstAttribute="width" constant="50" id="uHJ-UU-jdT"/>
-                                        </constraints>
                                         <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMImagePropertTextStyleNP" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="IfI-No-NHz">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="32" id="lTR-c5-dmS"/>
+                                            <constraint firstAttribute="width" constant="50" id="uHJ-UU-jdT"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="textAnnotationStyleAction:" target="-2" id="kun-WB-L4O"/>
                                         </connections>
@@ -1245,7 +1245,7 @@
                 </comboBox>
                 <slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="u8I-8M-7Z4">
                     <rect key="frame" x="8" y="1" width="344" height="28"/>
-                    <sliderCell key="cell" continuous="YES" alignment="left" maxValue="1" tickMarkPosition="above" sliderType="linear" id="NOi-KA-hpp" customClass="KMPropertiesSliderCell"/>
+                    <sliderCell key="cell" continuous="YES" alignment="left" maxValue="1" tickMarkPosition="above" sliderType="linear" id="NOi-KA-hpp"/>
                     <connections>
                         <action selector="opacitySliderAction:" target="-2" id="qKe-JT-fjd"/>
                     </connections>
@@ -1288,7 +1288,7 @@
                 </comboBox>
                 <slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ysY-BU-1qm">
                     <rect key="frame" x="8" y="1" width="344" height="28"/>
-                    <sliderCell key="cell" alignment="left" maxValue="1" tickMarkPosition="above" sliderType="linear" id="tK2-ir-ZiE" customClass="KMPropertiesSliderCell"/>
+                    <sliderCell key="cell" alignment="left" maxValue="1" tickMarkPosition="above" sliderType="linear" id="tK2-ir-ZiE"/>
                     <connections>
                         <action selector="borderOpacitySliderAction:" target="-2" id="MHo-nI-c91"/>
                     </connections>

+ 0 - 1
PDF Office/PDF Master/PDF_Master-Bridging-Header.h

@@ -23,7 +23,6 @@
 #import "CTTabStripView.h"
 #import "CTTabController.h"
 #import "CTBrowserWindow.h"
-#import "KMNoteTypeImageView.h"
 #import "KMSharingServicePicker+ESSSharingServicePickerMenu.h"
 #import "CPDFListView+Public.h"
 #import "KMGeneralAnnotationViewController.h"