Browse Source

【综合】xib兼容问题修复

tangchao 1 year ago
parent
commit
24241cc613

+ 3 - 3
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AIConfigWindowController.xib

@@ -91,7 +91,7 @@
                                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="BOi-Jk-fgK">
                                     <rect key="frame" x="20" y="467" width="755" height="32"/>
                                     <subviews>
-                                        <box boxType="custom" borderType="none" borderWidth="0.0" cornerRadius="5" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="J8Z-2N-iYK" customClass="KMBox">
+                                        <box boxType="custom" borderType="none" borderWidth="0.0" cornerRadius="5" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="J8Z-2N-iYK" customClass="KMBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                             <rect key="frame" x="0.0" y="0.0" width="128" height="32"/>
                                             <view key="contentView" id="DAf-iA-ILp">
                                                 <rect key="frame" x="0.0" y="0.0" width="128" height="32"/>
@@ -325,7 +325,7 @@
                                                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="m3e-e0-Got">
                                                     <rect key="frame" x="16" y="60" width="340" height="276"/>
                                                     <subviews>
-                                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="CK5-9H-oCH" customClass="KMButton">
+                                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="CK5-9H-oCH" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                                             <rect key="frame" x="0.0" y="0.0" width="340" height="276"/>
                                                             <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="AQd-ya-Kbw">
                                                                 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -498,7 +498,7 @@
                                                                 <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                                 <size key="minSize" width="350" height="324"/>
                                                                 <size key="maxSize" width="355" height="10000000"/>
-                                                            </textView>
+							    </textView>
                                                         </subviews>
                                                     </clipView>
                                                     <constraints>

+ 2 - 0
PDF Office/PDF Master/Class/Document/KMMainDocument.swift

@@ -18,6 +18,7 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
     var homeWindowController: KMHomeWindowController?
     var homeViewController: KMHomeViewController?
     var bookmarkSheetController: KMBookmarkSheetController?
+    var bookmarkController: KMBookmarkController?
     var isNewCreated: Bool = false
     var closedByUserGestureFlag: Bool = false   // 标记 closedByUserGesture 这个状态需要延后存储(如果需要)
     var cloud: Bool = false
@@ -653,6 +654,7 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
         
         if item.tag == 3 {
             KMPrint("Edit Bookmark")
+            bookmarkController = KMBookmarkController.showBookmarkController()
         } else if item.tag == 2 {
             KMPrint("session Bookmark")
             bookmarkSheetController = KMBookmarkSheetController.showBookmarkSheetController(type: .session)

+ 75 - 1
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController.swift

@@ -95,7 +95,9 @@ import Cocoa
     var timer: Timer?
     var timerCounter = 0.0
     
+    //AI相关
     var aiTipView: AITipIconView!
+    var aiTypeChooseView: AITypeChooseView!
     
     //试用相关
     var didTrialExpiredLoad: Bool = false
@@ -774,7 +776,7 @@ extension KMHomeViewController {
     func loadAIIconView() -> Void {
         self.aiTipView = AITipIconView.createFromNib()
         self.aiTipView.clickHandle = { [weak self] view in
-            
+            self?.showAITypeChooseView()
         }
         self.aiTipView.frame = CGRectMake(CGRectGetWidth(self.view.frame)-84, CGRectGetHeight(self.view.frame)-84, 72, 72)
         self.aiTipView.autoresizingMask = [.minXMargin, .minYMargin]
@@ -782,6 +784,78 @@ extension KMHomeViewController {
 
     }
     
+    func showAITypeChooseView() -> Void {
+        if AIInfoManager.default().aiInfo.infoDict.isEmpty == true {
+#if VERSION_DMG
+            KMPurchaseCompareWindowController.dmgPurchaseInstance().showWindow(nil)
+#else
+            AIPurchaseWindowController.currentWC().showWindow(nil)
+#endif
+            return
+        }
+        let controller = NSViewController.init()
+        let view = NSView.init()
+        controller.view = view
+        
+        var string: String = NSLocalizedString("AI Summarize", comment: "")
+        if string.count < NSLocalizedString("AI Rewrite", comment: "").count {
+            string = NSLocalizedString("AI Rewrite", comment: "")
+        }
+        if string.count < NSLocalizedString("AI Proofread", comment: "").count {
+            string = NSLocalizedString("AI Proofread", comment: "")
+        }
+        if string.count < NSLocalizedString("AI Translate", comment: "").count {
+            string = NSLocalizedString("AI Translate", comment: "")
+        }
+         
+        let font = NSFont.SFProTextRegularFont(13)
+        var style = NSMutableParagraphStyle.init()
+        style.alignment = .center
+        style.lineBreakMode = .byCharWrapping
+        let size: NSSize = string.boundingRect(with: NSSize(width: 1000, height: 100),
+                                               options: NSString.DrawingOptions(rawValue: 3),
+                                               attributes: [NSAttributedString.Key.font : NSFont.SFProTextRegularFont(13), NSAttributedString.Key.paragraphStyle : style]).size
+         
+        controller.view.frame = CGRectMake(0, 0, size.width+80, 160)
+        if self.aiTypeChooseView == nil {
+            self.aiTypeChooseView = AITypeChooseView.createFromNib()
+        }
+        self.aiTypeChooseView.clickHandle = { [weak self] view, type in
+            DispatchQueue.main.async {
+                let windowVC = AIConfigWindowController.currentWC()
+                windowVC.configType = type
+                if type == .summarize {
+                    windowVC.window?.setFrame(CGRectMake(0, 0, 800, 500), display: true)
+                } else if type == .reWriting {
+                    windowVC.window?.setFrame(CGRectMake(0, 0, 800, 460), display: true)
+                } else if type == .proofreading {
+                    windowVC.window?.setFrame(CGRectMake(0, 0, 800, 460), display: true)
+                } else if type == .translate {
+                    windowVC.window?.setFrame(CGRectMake(0, 0, 800, 545), display: true)
+                }
+                
+                windowVC.cancelHandle = { [weak self] windowVC in
+                    self?.view.window?.endSheet(windowVC.window!)
+                }
+                self?.view.window?.beginSheet(windowVC.window!)
+                windowVC.refreshUI()
+            }
+        }
+        self.aiTypeChooseView.frame = controller.view.bounds
+        self.aiTypeChooseView.autoresizingMask = [.width, .height]
+        controller.view.addSubview(self.aiTypeChooseView)
+        
+        let popover = NSPopover.init()
+        popover.contentViewController = controller
+        popover.animates = true
+        popover.behavior = .transient
+        var rect = self.aiTipView.bounds
+        rect.origin.y += 20
+        popover.show(relativeTo: rect, of: self.aiTipView, preferredEdge: .minY)
+
+    }
+    
+    
     //MARK: - 引导
     func loadFunctionGuide() -> Void {
         self.loadNewUserGuide()

+ 836 - 2
PDF Office/PDF Master/Class/PDFTools/KMBookmark/Controller/KMBookmarkController.swift

@@ -7,12 +7,846 @@
 
 import Cocoa
 
-class KMBookmarkController: NSWindowController {
+let kBookmarksToolbarIdentifier                 = "BookmarksToolbarIdentifier"
+let kBookmarksNewFolderToolbarItemIdentifier    = "BookmarksNewFolderToolbarItemIdentifier"
+let kBookmarksNewSeparatorToolbarItemIdentifier = "BookmarksNewSeparatorToolbarItemIdentifier"
+let kBookmarksDeleteToolbarItemIdentifier       = "BookmarksDeleteToolbarItemIdentifier"
 
+class KMBookmarkController: NSWindowController {
+    
+    @IBOutlet weak var outlineView: NSOutlineView!
+    
+    var toolbarItems: [String: NSToolbarItem] = [:]
     override func windowDidLoad() {
         super.windowDidLoad()
+        setupToolbar()
+        
+//        if let window = self.window, window.responds(to: #selector(setter: NSWindow.tabbingMode)) {
+//            window.tabbingMode = .disallowed
+//        }
+        
+//        windowFrameAutosaveName = SKBookmarksWindowFrameAutosaveName
+        
+//        window?.autorecalculatesContentBorderThickness = false
+//        if UserDefaults.standard.bool(forKey: SKShowBookmarkStatusBarKey) == false {
+//            toggleStatusBar(nil)
+//        } else {
+//            window?.setContentBorderThickness(22.0, for: .minY)
+//        }
+        
+//        outlineView.setTypeSelectHelper(SKTypeSelectHelper.typeSelectHelper())
+        
+//        outlineView.registerForDraggedTypes([SKPasteboardTypeBookmarkRows, kUTTypeFileURL as String, NSFilenamesPboardType])
+        
+//        outlineView.doubleAction = #selector(doubleClickBookmark(_:))
+        
+//        outlineView.supportsQuickLook = true
+    }
+
+//    func updateStatus() {
+//        let row = outlineView.selectedRow
+//        var message = ""
+//        if row != -1 {
+//            if let bookmark = outlineView.item(atRow: row) as? KMBookmark {
+//                switch bookmark.bookmarkType {
+//                case .bookmark:
+//                    message = bookmark.fileURL?.path ?? ""
+//                case .folder:
+//                    let count = bookmark.children.count
+//                    message = count == 1 ? NSLocalizedString("1 item", comment: "Bookmark folder description") : String(format: NSLocalizedString("%ld items", comment: "Bookmark folder description"), count)
+//                default:
+//                    break
+//                }
+//            }
+//        }
+////        statusBar.leftStringValue = message
+//    }
+//    
+    static func showBookmarkController() -> KMBookmarkController {
+        let controller = KMBookmarkController.init(windowNibName: "KMBookmarkController")
+        NSWindow.currentWindow().addChildWindow(controller.window!, ordered: NSWindow.OrderingMode.above)
+        controller.window?.center()
+        return controller
+    }
+//    
+//    
+//    //MARK: Recent Documents
+//    func recentDocumentInfo(at fileURL: URL) -> [String: Any]? {
+//        let path = fileURL.path
+//        for info in recentDocuments as! [[String: Any]] {
+//            if let aliasData = info[ALIASDATA_KEY] as? Data,
+//               let alias = SKAlias(aliasData),
+//               alias.fileURLNoUI?.path.caseInsensitiveCompare(path) == .orderedSame {
+//                return info
+//            }
+//        }
+//        return nil
+//    }
+//
+//    func addRecentDocument(for fileURL: URL, pageIndex: UInt, scaleFactor factor: CGFloat, snapshots setups: [Any]?) {
+//        guard let fileURL = fileURL else { return }
+//        
+//        if let info = recentDocumentInfo(at: fileURL) {
+//            recentDocuments.removeObject(identicalTo: info)
+//        }
+//        
+//        if let alias = SKAlias(url: fileURL) {
+//            var bm: [String: Any] = [
+//                PAGEINDEX_KEY: pageIndex,
+//                SCALE_KEY: factor,
+//                ALIASDATA_KEY: alias.data,
+//                ALIAS_KEY: alias,
+//                SNAPSHOTS_KEY: setups ?? []
+//            ]
+//            recentDocuments.insert(bm, at: 0)
+//            if recentDocuments.count > maxRecentDocumentsCount {
+//                recentDocuments.removeLastObject()
+//            }
+//        }
+//    }
+//
+//    func pageIndex(forRecentDocumentAt fileURL: URL) -> UInt {
+//        guard let fileURL = fileURL else { return UInt.max }
+//        if let pageIndex = recentDocumentInfo(at: fileURL)?[PAGEINDEX_KEY] as? UInt {
+//            return pageIndex
+//        }
+//        return UInt.max
+//    }
+//
+//    func scaleFactor(forRecentDocumentAt fileURL: URL) -> CGFloat {
+//        guard let fileURL = fileURL else { return 0 }
+//        if let scaleFactor = recentDocumentInfo(at: fileURL)?[SCALE_KEY] as? CGFloat {
+//            return scaleFactor
+//        }
+//        return 0
+//    }
+//
+//    func snapshots(forRecentDocumentAt fileURL: URL) -> [Any]? {
+//        guard let fileURL = fileURL else { return nil }
+//        if let setups = recentDocumentInfo(at: fileURL)?[SNAPSHOTS_KEY] as? [Any], !setups.isEmpty {
+//            return setups
+//        }
+//        return nil
+//    }
+//    
+//    //MARK: Bookmarks support
+//    func getInsertionFolder(_ bookmarkPtr: inout SKBookmark?, childIndex indexPtr: inout UInt) {
+//        let rowIndex = outlineView.clickedRow
+//        var indexes = outlineView.selectedRowIndexes
+//        if rowIndex != -1 && !indexes.contains(rowIndex) {
+//            indexes = IndexSet(integer: rowIndex)
+//        }
+//        let rowIdx = indexes.last ?? NSNotFound
+//        
+//        var item = bookmarkRoot
+//        var idx = bookmarkRoot.countOfChildren
+//        
+//        if rowIdx != NSNotFound {
+//            if let selectedItem = outlineView.item(atRow: rowIdx) as? SKBookmark {
+//                if outlineView.isItemExpanded(selectedItem) {
+//                    item = selectedItem
+//                    idx = item.countOfChildren
+//                } else if let parent = selectedItem.parent, let itemIdx = parent.children.index(of: selectedItem) {
+//                    item = parent
+//                    idx = itemIdx + 1
+//                }
+//            }
+//        }
+//        
+//        bookmarkPtr = item
+//        indexPtr = idx
+//    }
+//
+//    @IBAction func openBookmark(_ sender: Any) {
+//        if let bookmark = (sender as AnyObject).representedObject as? SKBookmark {
+//            bookmark.open()
+//        }
+//    }
+//
+//    @IBAction func doubleClickBookmark(_ sender: Any) {
+//        let row = outlineView.clickedRow
+//        if let bm = (row != -1 ? outlineView.item(atRow: row) : nil) as? SKBookmark,
+//           [SKBookmarkType.bookmark, .session].contains(bm.bookmarkType) {
+//            bm.open()
+//        }
+//    }
+//
+//    @IBAction func insertBookmarkFolder(_ sender: Any) {
+//        let folder = SKBookmark.bookmarkFolder(withLabel: NSLocalizedString("Folder", comment: "default folder name"))
+//        var item: SKBookmark?
+//        var idx: UInt = 0
+//        
+//        getInsertionFolder(&item, childIndex: &idx)
+//        item?.insertObject(folder, inChildrenAtIndex: idx)
+//        
+//        if let row = outlineView.row(forItem: folder) {
+//            outlineView.selectRowIndexes(IndexSet(integer: row), byExtendingSelection: false)
+//            outlineView.editColumn(0, row: row, with: nil, select: true)
+//        }
+//    }
+//
+//    @IBAction func insertBookmarkSeparator(_ sender: Any) {
+//        let separator = SKBookmark.bookmarkSeparator()
+//        var item: SKBookmark?
+//        var idx: UInt = 0
+//        
+//        getInsertionFolder(&item, childIndex: &idx)
+//        item?.insertObject(separator, inChildrenAtIndex: idx)
+//        
+//        if let row = outlineView.row(forItem: separator) {
+//            outlineView.selectRowIndexes(IndexSet(integer: row), byExtendingSelection: false)
+//        }
+//    }
+//
+//    @IBAction func addBookmark(_ sender: Any) {
+//        let openPanel = NSOpenPanel()
+//        var types = [String]()
+//        for docClass in NSDocumentController.shared.documentClassNames {
+//            if let docClass = NSClassFromString(docClass) as? NSDocument.Type {
+//                types += docClass.readableTypes
+//            }
+//        }
+//        openPanel.allowsMultipleSelection = true
+//        openPanel.canChooseDirectories = true
+//        openPanel.allowedFileTypes = types
+//        openPanel.beginSheetModal(for: self.window!) { (result) in
+//            guard result == .OK else { return }
+//            let newBookmarks = SKBookmark.bookmarks(forURLs: openPanel.urls)
+//            if !newBookmarks.isEmpty {
+//                var item: SKBookmark?
+//                var index: UInt = 0
+//                self.getInsertionFolder(&item, childIndex: &index)
+//                var indexes = IndexSet(integersIn: Int(index)..<Int(index + UInt(newBookmarks.count)))
+//                item?.mutableArrayValue(forKey: "children").insert(newBookmarks, at: indexes)
+//                if item == self.bookmarkRoot || self.outlineView.isItemExpanded(item) {
+//                    if item != self.bookmarkRoot {
+//                        indexes.shift(startingAt: 0, by: self.outlineView.row(forItem: item)! + 1)
+//                    }
+//                    self.outlineView.selectRowIndexes(indexes, byExtendingSelection: false)
+//                }
+//            }
+//        }
+//    }
+//
+//    @IBAction func deleteBookmark(_ sender: Any) {
+//        outlineView.delete(sender)
+//    }
+//
+//    @IBAction func toggleStatusBar(_ sender: Any) {
+//        UserDefaults.standard.set(!statusBar.isVisible, forKey: SKShowBookmarkStatusBarKey)
+//        statusBar.toggle(below: outlineView.enclosingScrollView, animate: sender != nil)
+//    }
+//
+//    func clickedBookmarks() -> [Any]? {
+//        let row = outlineView.clickedRow
+//        guard row != -1 else { return nil }
+//        var indexes = outlineView.selectedRowIndexes
+//        if !indexes.contains(row) {
+//            indexes = IndexSet(integer: row)
+//        }
+//        return indexes.compactMap { outlineView.item(atRow: $0) }
+//    }
+//
+//    @IBAction func deleteBookmarks(_ sender: Any) {
+//        guard let items = clickedBookmarks() as? [SKBookmark] else { return }
+//        endEditing()
+//        for item in items.reversed() {
+//            if let parent = item.parent, let itemIndex = parent.children.index(of: item) {
+//                parent.removeObject(fromChildrenAtIndex: itemIndex)
+//            }
+//        }
+//    }
+//
+//    @IBAction func openBookmarks(_ sender: Any) {
+//        guard let items = clickedBookmarks() as? [SKBookmark] else { return }
+//        for item in items.reversed() {
+//            item.open()
+//        }
+//    }
+//
+//    @IBAction func previewBookmarks(_ sender: Any) {
+//        if QLPreviewPanel.sharedPreviewPanelExists() && QLPreviewPanel.shared().isVisible {
+//            QLPreviewPanel.shared().orderOut(nil)
+//        } else if let row = outlineView.clickedRow {
+//            outlineView.selectRowIndexes(IndexSet(integer: row), byExtendingSelection: false)
+//            QLPreviewPanel.shared().makeKeyAndOrderFront(nil)
+//        }
+//    }
+//
+//    
+//    // MARK: - NSMenu delegate methods
+//
+//    func addItemForBookmark(_ bookmark: SKBookmark, toMenu menu: NSMenu, isFolder: Bool, isAlternate: Bool) {
+//        var item: NSMenuItem?
+//        if isFolder {
+//            item = menu.addItem(withSubmenuAndTitle: bookmark.label)
+//            item?.submenu?.delegate = self
+//        } else {
+//            item = menu.addItem(withTitle: bookmark.label, action: #selector(openBookmark(_:)), target: self)
+//        }
+//        item?.representedObject = bookmark
+//        if isAlternate {
+//            item?.keyEquivalentModifierMask = .alternate
+//            item?.isAlternate = true
+//            item?.setImageAndSize(bookmark.alternateIcon)
+//        } else {
+//            item?.setImageAndSize(bookmark.icon)
+//        }
+//    }
+//
+//    func menuNeedsUpdate(_ menu: NSMenu) {
+//        if menu == outlineView.menu {
+//            let row = outlineView.clickedRow
+//            menu.removeAllItems()
+//            if row != -1 {
+//                menu.addItem(withTitle: NSLocalizedString("Remove", comment: "Menu item title"), action: #selector(deleteBookmarks(_:)), target: self)
+//                menu.addItem(withTitle: NSLocalizedString("Open", comment: "Menu item title"), action: #selector(openBookmarks(_:)), target: self)
+//                menu.addItem(withTitle: NSLocalizedString("Quick Look", comment: "Menu item title"), action: #selector(previewBookmarks(_:)), target: self)
+//                menu.addItem(.separator())
+//            }
+//            menu.addItem(withTitle: NSLocalizedString("New Folder", comment: "Menu item title"), action: #selector(insertBookmarkFolder(_:)), target: self)
+//            menu.addItem(withTitle: NSLocalizedString("New Separator", comment: "Menu item title"), action: #selector(insertBookmarkSeparator(_:)), target: self)
+//        } else {
+//            guard let supermenu = menu.supermenu, let idx = supermenu.indexOfItem(withSubmenu: menu), let bm = (supermenu == NSApp.mainMenu) ? bookmarkRoot : supermenu.item(at: idx)?.representedObject as? SKBookmark else { return }
+//            
+//            let bookmarks = bm.children
+//            var i = menu.numberOfItems
+//            
+//            while i > 0 {
+//                if let menuItem = menu.item(at: i - 1), menuItem.isSeparatorItem || menuItem.representedObject != nil {
+//                    menu.removeItem(menuItem)
+//                }
+//                i -= 1
+//            }
+//            
+//            if supermenu == NSApp.mainMenu, let previousSession = previousSession {
+//                menu.addItem(.separator())
+//                addItemForBookmark(previousSession, toMenu: menu, isFolder: false, isAlternate: false)
+//                addItemForBookmark(previousSession, toMenu: menu, isFolder: true, isAlternate: true)
+//            }
+//            
+//            if menu.numberOfItems > 0, bookmarks.count > 0 {
+//                menu.addItem(.separator())
+//            }
+//            
+//            for bm in bookmarks {
+//                switch bm.bookmarkType {
+//                case .folder:
+//                    addItemForBookmark(bm, toMenu: menu, isFolder: true, isAlternate: false)
+//                    addItemForBookmark(bm, toMenu: menu, isFolder: false, isAlternate: true)
+//                case .session:
+//                    addItemForBookmark(bm, toMenu: menu, isFolder: false, isAlternate: false)
+//                    addItemForBookmark(bm, toMenu: menu, isFolder: true, isAlternate: true)
+//                case .separator:
+//                    menu.addItem(.separator())
+//                default:
+//                    addItemForBookmark(bm, toMenu: menu, isFolder: false, isAlternate: false)
+//                }
+//            }
+//        }
+//    }
+//
+//    // avoid rebuilding the bookmarks menu on every key event
+//    func menuHasKeyEquivalent(_ menu: NSMenu, for event: NSEvent, target: AutoreleasingUnsafeMutablePointer<AnyObject?>?, action: UnsafeMutablePointer<Selector?>?) -> Bool { false }
+//
+//    
+//    // MARK: - NSOutlineView datasource methods
+//    func minimumCoverForBookmarks(_ items: [SKBookmark]) -> [SKBookmark] {
+//        var lastBm: SKBookmark?
+//        var minimalCover = [SKBookmark]()
+//        
+//        for bm in items {
+//            if !(bm.isDescendant(of: lastBm)) {
+//                minimalCover.append(bm)
+//                lastBm = bm
+//            }
+//        }
+//        return minimalCover
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, numberOfChildrenOfItem item: Any?) -> Int {
+//        let bookmark = item as? SKBookmark ?? bookmarkRoot
+//        return bookmark.bookmarkType == .folder ? bookmark.countOfChildren : 0
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, isItemExpandable item: Any) -> Bool {
+//        let bookmark = item as! SKBookmark
+//        return bookmark.bookmarkType == .folder
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, child index: Int, ofItem item: Any?) -> Any {
+//        let bookmark = (item as? SKBookmark) ?? bookmarkRoot
+//        return bookmark.objectInChildren(at: index)!
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, objectValueFor tableColumn: NSTableColumn?, byItem item: Any?) -> Any? {
+//        guard let column = tableColumn, let tcID = column.identifier else { return nil }
+//        guard let bm = item as? SKBookmark else { return nil }
+//        
+//        switch tcID {
+//        case LABEL_COLUMNID:
+//            return [SKTextWithIconStringKey: bm.label, SKTextWithIconImageKey: bm.icon]
+//        case FILE_COLUMNID:
+//            if bm.bookmarkType == .folder || bm.bookmarkType == .session {
+//                let count = bm.countOfChildren
+//                return count == 1 ? NSLocalizedString("1 item", comment: "Bookmark folder description") : String.localizedStringWithFormat(NSLocalizedString("%ld items", comment: "Bookmark folder description"), count)
+//            } else {
+//                return bm.fileURL?.path ?? ""
+//            }
+//        case PAGE_COLUMNID:
+//            return bm.pageNumber
+//        default:
+//            return nil
+//        }
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, setObjectValue object: Any?, for tableColumn: NSTableColumn?, byItem item: Any?) {
+//        guard let column = tableColumn, let tcID = column.identifier else { return }
+//        guard let bm = item as? SKBookmark else { return }
+//        
+//        switch tcID {
+//        case LABEL_COLUMNID:
+//            if let newLabel = (object as? [String: Any])?[SKTextWithIconStringKey] as? String, newLabel != bm.label {
+//                bm.label = newLabel
+//            }
+//        case PAGE_COLUMNID:
+//            if let newPageNumber = object as? Int, newPageNumber != bm.pageNumber {
+//                bm.pageNumber = newPageNumber
+//            }
+//        default:
+//            break
+//        }
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, writeItems items: [Any], to pboard: NSPasteboard) -> Bool {
+//        draggedBookmarks = minimumCoverForBookmarks(items as! [SKBookmark])
+//        pboard.clearContents()
+//        pboard.setData(Data(), forType: SKPasteboardTypeBookmarkRows)
+//        return true
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, validateDrop info: NSDraggingInfo, proposedItem item: Any?, proposedChildIndex index: Int) -> NSDragOperation {
+//        guard index != NSOutlineViewDropOnItemIndex else { return .none }
+//        guard let pboard = info.draggingPasteboard else { return .none }
+//        
+//        if pboard.canReadItem(withDataConformingToTypes: [SKPasteboardTypeBookmarkRows]) && info.draggingSource as? NSOutlineView == ov {
+//            return .move
+//        } else if NSURL.canReadFileURL(from: pboard) {
+//            return .every
+//        }
+//        return .none
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, acceptDrop info: NSDraggingInfo, item: Any?, childIndex index: Int) -> Bool {
+//        guard let pboard = info.draggingPasteboard else { return false }
+//        
+//        if pboard.canReadItem(withDataConformingToTypes: [SKPasteboardTypeBookmarkRows]) && info.draggingSource as? NSOutlineView == ov {
+//            var movedBookmarks = [SKBookmark]()
+//            var indexes = IndexSet()
+//            var insertionIndex = index
+//            
+//            let targetItem = item as? SKBookmark ?? bookmarkRoot
+//            
+//            endEditing()
+//            for bookmark in draggedBookmarks {
+//                guard let parent = bookmark.parent else { continue }
+//                guard let bookmarkIndex = parent.children.firstIndex(of: bookmark) else { continue }
+//                
+//                if targetItem == parent {
+//                    if insertionIndex > bookmarkIndex {
+//                        insertionIndex -= 1
+//                    }
+//                    if insertionIndex == bookmarkIndex {
+//                        continue
+//                    }
+//                }
+//                parent.removeObjectFromChildren(at: bookmarkIndex)
+//                targetItem.insertObject(bookmark, inChildrenAtIndex: insertionIndex)
+//                movedBookmarks.append(bookmark)
+//                insertionIndex += 1
+//            }
+//            
+//            for bookmark in movedBookmarks {
+//                let row = ov.row(forItem: bookmark)
+//                if row != -1 {
+//                    indexes.insert(row)
+//                }
+//            }
+//            if !indexes.isEmpty {
+//                ov.selectRowIndexes(indexes, byExtendingSelection: false)
+//            }
+//            return true
+//        } else {
+//            guard let urls = NSURL.readFileURLs(from: pboard) else { return false }
+//            
+//            let newBookmarks = SKBookmark.bookmarks(for: urls)
+//            if !newBookmarks.isEmpty {
+//                endEditing()
+//                let indexes = IndexSet(integersIn: index..<(index + newBookmarks.count))
+//                (item as? SKBookmark ?? bookmarkRoot).mutableArrayValue(forKey: "children").insert(newBookmarks, at: indexes)
+//                if item === bookmarkRoot || ov.isItemExpanded(item) {
+//                    if item !== bookmarkRoot {
+//                        indexes.shift(startingAt: 0, by: ov.row(forItem: item) + 1)
+//                    }
+//                    ov.selectRowIndexes(indexes, byExtendingSelection: false)
+//                }
+//                return true
+//            }
+//            return false
+//        }
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, dragEndedWith operation: NSDragOperation) {
+//        draggedBookmarks = nil
+//    }
+//
+//    // MARK: - NSOutlineView delegate methods
+//
+//    func outlineView(_ ov: NSOutlineView, dataCellFor tableColumn: NSTableColumn?, item: Any) -> Any? {
+//        if tableColumn == nil {
+//            return (item as? SKBookmark)?.bookmarkType == .separator ? SKSeparatorCell() : nil
+//        }
+//        return tableColumn?.dataCell(forRow: ov.row(forItem: item))
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, willDisplayCell cell: Any, for tableColumn: NSTableColumn?, item: Any) {
+//        guard let column = tableColumn else { return }
+//        
+//        if column.identifier == FILE_COLUMNID {
+//            if let bm = item as? SKBookmark {
+//                if bm.bookmarkType == .folder || bm.bookmarkType == .session {
+//                    (cell as? NSCell)?.textColor = .disabledControlTextColor
+//                } else {
+//                    (cell as? NSCell)?.textColor = .controlTextColor
+//                }
+//            }
+//        }
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, shouldEditTableColumn tableColumn: NSTableColumn?, item: Any) -> Bool {
+//        guard let column = tableColumn, let tcID = column.identifier else { return false }
+//        guard let bm = item as? SKBookmark else { return false }
+//        
+//        switch tcID {
+//        case LABEL_COLUMNID:
+//            return bm.bookmarkType != .separator
+//        case PAGE_COLUMNID:
+//            return bm.pageIndex != NSNotFound
+//        default:
+//            return false
+//        }
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, toolTipFor cell: NSCell, rect: UnsafeMutablePointer<NSRect>, tableColumn tc: NSTableColumn?, item: Any, mouseLocation: NSPoint) -> String {
+//        guard let column = tc, let tcID = column.identifier else { return "" }
+//        guard let bm = item as? SKBookmark else { return "" }
+//        
+//        switch tcID {
+//        case LABEL_COLUMNID:
+//            return bm.label
+//        case FILE_COLUMNID:
+//            if bm.bookmarkType == .session {
+//                return bm.children.map { $0.path ?? "" }.joined(separator: "\n")
+//            } else if bm.bookmarkType == .folder {
+//                let count = bm.countOfChildren
+//                return count == 1 ? NSLocalizedString("1 item", comment: "Bookmark folder description") : String.localizedStringWithFormat(NSLocalizedString("%ld items", comment: "Bookmark folder description"), count)
+//            } else {
+//                return bm.fileURL?.path ?? ""
+//            }
+//        case PAGE_COLUMNID:
+//            return bm.pageNumber?.stringValue ?? ""
+//        default:
+//            return ""
+//        }
+//    }
+//
+//    func outlineViewSelectionDidChange(_ notification: Notification) {
+//        updateStatus()
+//        if QLPreviewPanel.sharedPreviewPanelExists(), let previewPanel = QLPreviewPanel.shared() as? QLPreviewPanel, previewPanel.isVisible, previewPanel.dataSource === self {
+//            previewPanel.reloadData()
+//        }
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, deleteItems items: [Any]) {
+//        endEditing()
+//        for item in minimumCoverForBookmarks(items as! [SKBookmark]).reversed() {
+//            guard let parent = item.parent, let itemIndex = parent.children.firstIndex(of: item) else { continue }
+//            parent.removeObjectFromChildren(at: itemIndex)
+//        }
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, canDeleteItems items: [Any]) -> Bool {
+//        return !items.isEmpty
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, copyItems items: [Any]) {
+//        var urls = [URL]()
+//        addBookmarkURLsToArray(minimumCoverForBookmarks(items as! [SKBookmark]), urls)
+//        if !urls.isEmpty {
+//            let pboard = NSPasteboard.general
+//            pboard.clearContents()
+//            pboard.writeObjects(urls as [NSPasteboardWriting])
+//        } else {
+//            NSBeep()
+//        }
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, canCopyItems items: [Any]) -> Bool {
+//        return !items.isEmpty
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, pasteFromPasteboard pboard: NSPasteboard) {
+//        guard let urls = NSURL.readFileURLs(from: pboard), !urls.isEmpty else { NSBeep(); return }
+//        
+//        let newBookmarks = SKBookmark.bookmarks(for: urls)
+//        if !newBookmarks.isEmpty {
+//            var item: SKBookmark?
+//            var anIndex = 0
+//            getInsertionFolder(&item, childIndex: &anIndex)
+//            let indexes = IndexSet(integersIn: anIndex..<(anIndex + newBookmarks.count))
+//            (item ?? bookmarkRoot).mutableArrayValue(forKey: "children").insert(newBookmarks, at: indexes)
+//            if item === bookmarkRoot || ov.isItemExpanded(item) {
+//                if item !== bookmarkRoot {
+//                    indexes.shift(startingAt: 0, by: ov.row(forItem: item) + 1)
+//                }
+//                ov.selectRowIndexes(indexes, byExtendingSelection: false)
+//            }
+//        } else {
+//            NSBeep()
+//        }
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, canPasteFromPasteboard pboard: NSPasteboard) -> Bool {
+//        return NSURL.canReadFileURL(from: pboard)
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, typeSelectHelperSelectionStrings typeSelectHelper: SKTypeSelectHelper) -> [String] {
+//        let count = ov.numberOfRows
+//        var labels = [String]()
+//        for i in 0..<count {
+//            if let label = ov.item(atRow: i) as? SKBookmark?.label {
+//                labels.append(label)
+//            }
+//        }
+//        return labels
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, typeSelectHelper typeSelectHelper: SKTypeSelectHelper, didFailToFindMatchForSearchString searchString: String) {
+//        statusBar.setLeftStringValue(String.localizedStringWithFormat(NSLocalizedString("No match: \"%@\"", comment: "Status message"), searchString))
+//    }
+//
+//    func outlineView(_ ov: NSOutlineView, typeSelectHelper typeSelectHelper: SKTypeSelectHelper, updateSearchString searchString: String?) {
+//        if let searchString = searchString {
+//            statusBar.setLeftStringValue(String.localizedStringWithFormat(NSLocalizedString("Finding: \"%@\"", comment: "Status message"), searchString))
+//        } else {
+//            updateStatus()
+//        }
+//    }
+//    
+//    // MARK: - Toolbar
+//
+    func setupToolbar() {
+        // Create a new toolbar instance, and attach it to our document window
+        let toolbar = NSToolbar(identifier: kBookmarksToolbarIdentifier)
+        var dict = [String: NSToolbarItem]()
+        
+        // Set up toolbar properties: Allow customization, give a default display mode, and remember state in user defaults
+        toolbar.allowsUserCustomization = true
+        toolbar.autosavesConfiguration = true
+        toolbar.displayMode = .default
+        
+        // We are the delegate
+        toolbar.delegate = self
+        
+        // Add template toolbar items
+        
+        var item = NSToolbarItem(itemIdentifier: NSToolbarItem.Identifier(kBookmarksNewFolderToolbarItemIdentifier))
+        item.label = NSLocalizedString("New Folder", comment: "Toolbar item label")
+//        item.setLabels(NSLocalizedString("New Folder", comment: "Toolbar item label"))
+        item.toolTip = NSLocalizedString("Add a New Folder", comment: "Tool tip message")
+        item.image = NSImage(named: "NewFolder")
+        item.target = self
+//        item.action = #selector(insertBookmarkFolder(_:))
+        dict[kBookmarksNewFolderToolbarItemIdentifier] = item
+        
+        item = NSToolbarItem(itemIdentifier: NSToolbarItem.Identifier(kBookmarksNewSeparatorToolbarItemIdentifier))
+        item.label = NSLocalizedString("New Separator", comment: "Toolbar item label")
+//        item.setLabels(NSLocalizedString("New Separator", comment: "Toolbar item label"))
+        item.toolTip = NSLocalizedString("Add a New Separator", comment: "Tool tip message")
+        item.image = NSImage(named: "NewSeparator")
+        item.target = self
+//        item.action = #selector(insertBookmarkSeparator(_:))
+        dict[kBookmarksNewSeparatorToolbarItemIdentifier] = item
+        
+        item = NSToolbarItem(itemIdentifier: NSToolbarItem.Identifier(kBookmarksDeleteToolbarItemIdentifier))
+        item.label = NSLocalizedString("Delete", comment: "Toolbar item label")
+//        item.setLabels(NSLocalizedString("Delete", comment: "Toolbar item label"))
+        item.toolTip = NSLocalizedString("Delete Selected Items", comment: "Tool tip message")
+        item.image = NSWorkspace.shared.icon(forFileType: NSFileTypeForHFSTypeCode(OSType(kToolbarDeleteIcon)))
+        item.target = self
+//        item.action = #selector(deleteBookmark(_:))
+        dict[kBookmarksDeleteToolbarItemIdentifier] = item
+        
+        toolbarItems = dict
+        
+        // Attach the toolbar to the window
+        self.window?.toolbar = toolbar
+    }
+
+//    func toolbar(_ toolbar: NSToolbar, itemForItemIdentifier itemIdent: String, willBeInsertedIntoToolbar flag: Bool) -> NSToolbarItem? {
+//        return toolbarItems[itemIdent]
+//    }
+
+//    func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [String] {
+//        return [
+//            kBookmarksNewFolderToolbarItemIdentifier,
+//            kBookmarksNewSeparatorToolbarItemIdentifier,
+//            kBookmarksDeleteToolbarItemIdentifier
+//        ]
+//    }
+//
+//    func toolbarAllowedItemIdentifiers(_ toolbar: NSToolbar) -> [String] {
+//        return [
+//            kBookmarksNewFolderToolbarItemIdentifier,
+//            kBookmarksNewSeparatorToolbarItemIdentifier,
+//            kBookmarksDeleteToolbarItemIdentifier
+////            NSToolbarItem.Identifier.customizeToolbar
+////            NSToolbarFlexibleSpaceItemIdentifier,
+////            NSToolbarSpaceItemIdentifier,
+////            NSToolbarSeparatorItemIdentifier,
+////            NSToolbarCustomizeToolbarItemIdentifier
+//        ]
+//    }
+
+    func validateToolbarItem(_ toolbarItem: NSToolbarItem) -> Bool {
+//        guard let toolbar = self.window?.toolbar else { return false }
+//        
+//        if toolbar.customizationPaletteIsRunning {
+//            return false
+//        } else if toolbarItem.itemIdentifier == kBookmarksDeleteToolbarItemIdentifier {
+//            return outlineView.canDelete
+//        }
+        return true
+    }
 
-        // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
+    func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
+//        if menuItem.action == #selector(toggleStatusBar(_:)) {
+//            if statusBar.isVisible {
+//                menuItem.title = NSLocalizedString("Hide Status Bar", comment: "Menu item title")
+//            } else {
+//                menuItem.title = NSLocalizedString("Show Status Bar", comment: "Menu item title")
+//            }
+//            return true
+//        } else if menuItem.action == #selector(addBookmark(_:)) {
+//            return menuItem.tag == 0
+//        }
+        return true
+    }
+//
+//    // MARK: - Quick Look Panel Support
+//
+//    func acceptsPreviewPanelControl(_ panel: QLPreviewPanel) -> Bool {
+//        return true
+//    }
+//
+//    func beginPreviewPanelControl(_ panel: QLPreviewPanel) {
+//        panel.delegate = self
+//        panel.dataSource = self
+//    }
+//
+//    func endPreviewPanelControl(_ panel: QLPreviewPanel) {
+//    }
+//
+//    func previewItems() -> [SKBookmark] {
+//        var items = [SKBookmark]()
+//        
+//        outlineView.selectedRowIndexes.enumerated().forEach { (idx, _) in
+//            if let item = outlineView.item(atRow: idx) as? SKBookmark {
+//                if item.bookmarkType == .bookmark {
+//                    items.append(item)
+//                } else if item.bookmarkType == .session {
+//                    items.append(contentsOf: item.children)
+//                }
+//            }
+//        }
+//        return items
+//    }
+//
+//    func numberOfPreviewItems(in panel: QLPreviewPanel) -> Int {
+//        return previewItems().count
+//    }
+//
+//    func previewPanel(_ panel: QLPreviewPanel, previewItemAt anIndex: Int) -> QLPreviewItem {
+//        return previewItems()[anIndex]
+//    }
+//
+//    func previewPanel(_ panel: QLPreviewPanel, sourceFrameOnScreenForPreviewItem item: QLPreviewItem) -> NSRect {
+//        var item = item
+//        if let parent = (item as? SKBookmark)?.parent, parent.bookmarkType == .session {
+//            item = parent
+//        }
+//        let row = outlineView.row(forItem: item)
+//        var iconRect = NSZeroRect
+//        if let item = item as? SKBookmark, row != -1 {
+//            let cell = outlineView.preparedCell(atColumn: 0, row: row) as? SKTextWithIconCell
+//            iconRect = cell?.iconRect(forBounds: outlineView.frameOfCell(atColumn: 0, row: row)) ?? NSZeroRect
+//            if outlineView.visibleRect.intersects(iconRect) {
+//                iconRect = outlineView.convert(iconRect, to: nil)
+//            } else {
+//                iconRect = NSZeroRect
+//            }
+//        }
+//        return iconRect
+//    }
+//
+//    func previewPanel(_ panel: QLPreviewPanel, transitionImageForPreviewItem item: QLPreviewItem, contentRect: UnsafeMutablePointer<NSRect>) -> NSImage? {
+//        var item = item
+//        if let parent = (item as? SKBookmark)?.parent, parent.bookmarkType == .session {
+//            item = parent
+//        }
+//        return (item as? SKBookmark)?.icon
+//    }
+//
+//    func previewPanel(_ panel: QLPreviewPanel, handle event: NSEvent) -> Bool {
+//        if event.type == .keyDown {
+//            outlineView.keyDown(with: event)
+//            return true
+//        }
+//        return false
+//    }
+//
+
+}
+
+extension KMBookmarkController: NSToolbarDelegate {
+    func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
+//        return [.flexibleSpace, .yourItem1, .yourItem2, .yourItem3]
+        return [
+            NSToolbarItem.Identifier(kBookmarksNewFolderToolbarItemIdentifier),
+            NSToolbarItem.Identifier(kBookmarksNewSeparatorToolbarItemIdentifier),
+            NSToolbarItem.Identifier(kBookmarksDeleteToolbarItemIdentifier)
+        ]
+    }
+    
+    func toolbarAllowedItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
+//        return [.yourItem1, .yourItem2, .yourItem3, .flexibleSpace, .space]
+        return [
+            NSToolbarItem.Identifier(kBookmarksNewFolderToolbarItemIdentifier),
+            NSToolbarItem.Identifier(kBookmarksNewSeparatorToolbarItemIdentifier),
+            NSToolbarItem.Identifier(kBookmarksDeleteToolbarItemIdentifier),
+            .flexibleSpace,
+            .space
+        ]
     }
     
+    func toolbar(_ toolbar: NSToolbar, itemForItemIdentifier itemIdentifier: NSToolbarItem.Identifier, willBeInsertedIntoToolbar flag: Bool) -> NSToolbarItem? {
+        return toolbarItems[itemIdentifier.rawValue]
+//        let toolbarItem = NSToolbarItem(itemIdentifier: itemIdentifier)
+//        toolbarItem.label = "Your Item Label"
+//        toolbarItem.paletteLabel = "Your Item Palette Label"
+//        toolbarItem.target = self
+//        toolbarItem.action = #selector(yourAction(_:))
+//        toolbarItem.image = NSImage(named: "YourItemImageName")
+//        return toolbarItem
+    }
 }

+ 2 - 1
PDF Office/PDF Master/Class/PDFTools/KMBookmark/Controller/KMBookmarkController.xib

@@ -8,6 +8,7 @@
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="KMBookmarkController" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
+                <outlet property="outlineView" destination="O1w-IL-33b" id="OX0-Jb-ho8"/>
                 <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
             </connections>
         </customObject>
@@ -36,7 +37,7 @@
                                     <rect key="frame" x="0.0" y="0.0" width="512" height="212"/>
                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                     <subviews>
-                                        <outlineView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" typeSelect="NO" autosaveName="SKBookmarksTable" rowHeight="16" headerView="DUP-Q2-ASL" indentationPerLevel="13" outlineTableColumn="qcP-Ly-Zi3" id="O1w-IL-33b" customClass="SKOutlineView">
+                                        <outlineView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" typeSelect="NO" autosaveName="SKBookmarksTable" rowHeight="16" headerView="DUP-Q2-ASL" indentationPerLevel="13" outlineTableColumn="qcP-Ly-Zi3" id="O1w-IL-33b">
                                             <rect key="frame" x="0.0" y="0.0" width="512" height="184"/>
                                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                             <size key="intercellSpacing" width="3" height="2"/>

+ 8 - 2
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationPropertiesViewController.m

@@ -125,8 +125,14 @@
     }
 
     if (_annotations.count > 1) {
-        [self selectAnnotations:_annotations];
-        return;
+        if ([annotation isKindOfClass:[CPDFTextWidgetAnnotation class]] ||
+            [annotation isKindOfClass:[CPDFChoiceWidgetAnnotation class]] ||
+            [annotation isKindOfClass:[CPDFButtonWidgetAnnotation class]]) {
+            
+        } else {
+            [self selectAnnotations:_annotations];
+            return;
+        }
     }
     
     if ([annotation isKindOfClass:[CPDFTextWidgetAnnotation class]]){

+ 44 - 45
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/FormProperties/KMAnnotationTextWidgetOptionsViewController.swift

@@ -11,7 +11,7 @@ import Cocoa
     private var _annotations: [CPDFTextWidgetAnnotation] = []
     private var _formMode: CAnnotationType = .radioButton
     var pdfView: CPDFListView?
-    var annotationModel: CPDFAnnotationModel?
+    var _annotationModel: CPDFAnnotationModel?
 
     @IBOutlet private var textFilledAlignmentLabel: NSTextField! // 对齐方式
     @IBOutlet private var textFilledAlignmentPopUpBtn: KMPopUpButton!
@@ -83,8 +83,9 @@ import Cocoa
     }
     
     private func updateAnnotation() {
-        if annotationModel?.annotation != nil {
+        if annotationModel.annotation != nil {
             for tAnnotation in annotations {
+                tAnnotation.updateAppearanceStream()
                 pdfView?.setNeedsDisplayAnnotationViewFor(tAnnotation.page)
             }
         }
@@ -100,23 +101,6 @@ import Cocoa
             _formMode = newValue
             
             isFromMode = true
-            let defaults = UserDefaults.standard
-            var annotation: CPDFTextWidgetAnnotation? = nil
-            let bounds = NSMakeRect(0, 0, 60, 25)
-            
-            if formMode == .textField {
-                annotation = CPDFTextWidgetAnnotation(PDFListViewNoteWith: pdfView!.document!)
-                annotation?.alignment = NSTextAlignment(rawValue: defaults.integer(forKey: SKAnnotationTextWidgetAlignmenKey)) ?? .left
-                annotation?.stringValue = defaults.string(forKey: SKAnnotationTextStringValueKey) ?? ""
-                
-                annotation?.isMultiline = defaults.bool(forKey: SKAnnotationTextMultilineKey)
-            }
-            
-            if let annotation = annotation {
-                annotations = [annotation]
-            }
-            
-            self.annotation = annotation
         }
     }
 
@@ -129,6 +113,21 @@ import Cocoa
             annotation = _annotations.first
         }
     }
+    
+    var annotationModel: CPDFAnnotationModel {
+        get {
+            return _annotationModel!
+        }
+        set {
+            _annotationModel = newValue
+            formMode = _annotationModel?.annotationType ?? .textField
+            if _annotationModel?.annotations != nil {
+                if annotationModel.annotations.count > 0 {
+                    annotations = annotationModel.annotations as! [CPDFTextWidgetAnnotation]
+                }
+            }
+        }
+    }
 
     func updateAnnotationMode() {
         let sud = UserDefaults.standard
@@ -158,18 +157,18 @@ import Cocoa
     
     @IBAction func textFilledAlignmentAction(_ sender: NSPopUpButton) {
         for tAnnotation in annotations {
-            var annotationString = ""
-            if tAnnotation.stringValue.isEmpty {
-                annotationString = " "
-            } else {
-                let lastString = String(tAnnotation.stringValue.suffix(1))
-                
-                if lastString == " " {
-                    annotationString = String(tAnnotation.stringValue.prefix(tAnnotation.stringValue.count - 1))
-                } else {
-                    annotationString = "\(tAnnotation.stringValue) "
-                }
-            }
+//            var annotationString = ""
+//            if tAnnotation.stringValue.isEmpty {
+//                annotationString = " "
+//            } else {
+//                let lastString = String(tAnnotation.stringValue.suffix(1))
+//                
+//                if lastString == " " {
+//                    annotationString = String(tAnnotation.stringValue.prefix(tAnnotation.stringValue.count - 1))
+//                } else {
+//                    annotationString = "\(tAnnotation.stringValue) "
+//                }
+//            }
             
             switch sender.indexOfSelectedItem {
             case 0:
@@ -182,7 +181,7 @@ import Cocoa
                 break
             }
             
-            tAnnotation.stringValue = annotationString
+//            tAnnotation.stringValue = annotationString
         }
         
         updateAnnotation()
@@ -190,24 +189,24 @@ import Cocoa
     
     @IBAction func textFilledAllowNewLineAction(_ sender: NSButton) {
         for tAnnotation in annotations {
-            var annotationString = ""
-            
-            if tAnnotation.stringValue.isEmpty {
-                annotationString = " "
-            } else {
-                let lastString = String(tAnnotation.stringValue.suffix(1))
-                if lastString == " " {
-                    annotationString = String(tAnnotation.stringValue.prefix(tAnnotation.stringValue.count - 1))
-                } else {
-                    annotationString = "\(tAnnotation.stringValue) "
-                }
-            }
+//            var annotationString = ""
+//            
+//            if tAnnotation.stringValue.isEmpty {
+//                annotationString = " "
+//            } else {
+//                let lastString = String(tAnnotation.stringValue.suffix(1))
+//                if lastString == " " {
+//                    annotationString = String(tAnnotation.stringValue.prefix(tAnnotation.stringValue.count - 1))
+//                } else {
+//                    annotationString = "\(tAnnotation.stringValue) "
+//                }
+//            }
             
             if let textWidgetAnnotation = tAnnotation as? CPDFTextWidgetAnnotation {
                 textWidgetAnnotation.isMultiline = (sender.state == .on)
             }
             
-            tAnnotation.stringValue = annotationString
+//            tAnnotation.stringValue = annotationString
         }
         
         updateAnnotation()

+ 19 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/KMRightSideViewController.swift

@@ -53,7 +53,7 @@ class KMRightSideViewController: NSViewController,CipherTextViewDelegate {
     
     public func reloadDataWithPDFView(pdfView:CPDFListView,isShow:Bool) {
         if self.annotationProperties == nil {
-          self.subViewType = .AnnotationProperts
+            self.subViewType = .AnnotationProperts
         }
         if(!isShow) {
             self.isHidden = true
@@ -68,6 +68,24 @@ class KMRightSideViewController: NSViewController,CipherTextViewDelegate {
                 activeAnnotations.append(annotation as! CPDFAnnotation)
             }
         }
+        var isSameAnnotation: Bool = true
+        for tAnnotation in activeAnnotations {
+            if tAnnotation.className != selectedAnnotation?.className {
+                isSameAnnotation = false
+                break
+            }
+        }
+        if !isSameAnnotation {
+            self.annotationProperties.annotations = []
+            self.annotationProperties.isEmptyAnnotation = true
+            return
+        } else if selectedAnnotation is CPDFTextWidgetAnnotation || selectedAnnotation is CPDFChoiceWidgetAnnotation || selectedAnnotation is CPDFButtonWidgetAnnotation {
+            if pdfView.toolMode != .formToolMode {
+                self.annotationProperties.annotations = []
+                self.annotationProperties.isEmptyAnnotation = true
+                return
+            }
+        }
        
         let annotationType = pdfView.annotationType
         if KMAnnotationPropertiesViewController.height(with: selectedAnnotation) > 0 {

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

@@ -71,6 +71,10 @@ let LOCKED_KEY  = "locked"
     //自动滚动
     var autoFlowOptionsSheetController: KMAutoFlowOptionsSheetController?
     
+    //AI相关
+    var aiTipView: AITipIconView!
+    var aiTypeChooseView: AITypeChooseView!
+    
     //Search
     var searchIndex: Int = 0
     
@@ -259,6 +263,7 @@ let LOCKED_KEY  = "locked"
         
         if (self.document!.isLocked == false) {
             self.loadFunctionGuide()
+            self.loadAIIconView()
         }
         
         if (self.document == nil) {
@@ -726,6 +731,89 @@ let LOCKED_KEY  = "locked"
         return self._getPDFRedactController() != nil
     }
     
+    //MARK: - AI
+    func loadAIIconView() -> Void {
+        self.aiTipView = AITipIconView.createFromNib()
+        self.aiTipView.clickHandle = { [weak self] view in
+            self?.showAITypeChooseView()
+        }
+        self.aiTipView.frame = CGRectMake(CGRectGetWidth(self.view.frame)-84, CGRectGetHeight(self.view.frame)-84-64-50, 72, 72)
+        self.aiTipView.autoresizingMask = [.minXMargin, .minYMargin]
+        self.view.addSubview(self.aiTipView)
+
+    }
+    
+    func showAITypeChooseView() -> Void {
+        if AIInfoManager.default().aiInfo.infoDict.isEmpty == true {
+#if VERSION_DMG
+            KMPurchaseCompareWindowController.dmgPurchaseInstance().showWindow(nil)
+#else
+            AIPurchaseWindowController.currentWC().showWindow(nil)
+#endif
+            return
+        }
+        let controller = NSViewController.init()
+        let view = NSView.init()
+        controller.view = view
+        
+        var string: String = NSLocalizedString("AI Summarize", comment: "")
+        if string.count < NSLocalizedString("AI Rewrite", comment: "").count {
+            string = NSLocalizedString("AI Rewrite", comment: "")
+        }
+        if string.count < NSLocalizedString("AI Proofread", comment: "").count {
+            string = NSLocalizedString("AI Proofread", comment: "")
+        }
+        if string.count < NSLocalizedString("AI Translate", comment: "").count {
+            string = NSLocalizedString("AI Translate", comment: "")
+        }
+         
+        let font = NSFont.SFProTextRegularFont(13)
+        var style = NSMutableParagraphStyle.init()
+        style.alignment = .center
+        style.lineBreakMode = .byCharWrapping
+        let size: NSSize = string.boundingRect(with: NSSize(width: 1000, height: 100),
+                                               options: NSString.DrawingOptions(rawValue: 3),
+                                               attributes: [NSAttributedString.Key.font : NSFont.SFProTextRegularFont(13), NSAttributedString.Key.paragraphStyle : style]).size
+         
+        controller.view.frame = CGRectMake(0, 0, size.width+80, 160)
+        if self.aiTypeChooseView == nil {
+            self.aiTypeChooseView = AITypeChooseView.createFromNib()
+        }
+        self.aiTypeChooseView.clickHandle = { [weak self] view, type in
+            DispatchQueue.main.async {
+                let windowVC = AIConfigWindowController.currentWC()
+                windowVC.configType = type
+                if type == .summarize {
+                    windowVC.window?.setFrame(CGRectMake(0, 0, 800, 500), display: true)
+                } else if type == .reWriting {
+                    windowVC.window?.setFrame(CGRectMake(0, 0, 800, 460), display: true)
+                } else if type == .proofreading {
+                    windowVC.window?.setFrame(CGRectMake(0, 0, 800, 460), display: true)
+                } else if type == .translate {
+                    windowVC.window?.setFrame(CGRectMake(0, 0, 800, 545), display: true)
+                }
+                
+                windowVC.cancelHandle = { [weak self] windowVC in
+                    self?.view.window?.endSheet(windowVC.window!)
+                }
+                self?.view.window?.beginSheet(windowVC.window!)
+                windowVC.refreshUI()
+            }
+        }
+        self.aiTypeChooseView.frame = controller.view.bounds
+        self.aiTypeChooseView.autoresizingMask = [.width, .height]
+        controller.view.addSubview(self.aiTypeChooseView)
+        
+        let popover = NSPopover.init()
+        popover.contentViewController = controller
+        popover.animates = true
+        popover.behavior = .transient
+        var rect = self.aiTipView.bounds
+        rect.origin.y += 20
+        popover.show(relativeTo: rect, of: self.aiTipView, preferredEdge: .minY)
+
+    }
+    
     //MARK: - 引导
     func loadFunctionGuide() -> Void {
 
@@ -1837,6 +1925,9 @@ let LOCKED_KEY  = "locked"
     
     internal func documentDidUnlockNotification(_ sender: Notification) {
         if (self.listView.document != nil && self.listView.document.isEqual(to: sender.object)) {
+            
+            self.loadAIIconView()
+            
             if (self.myDocument == nil) {
                 return
             }

+ 2 - 0
PDF Office/PDF Master/Class/Purchase/Appstore/KMPurchaseCompareWindowController.h

@@ -12,6 +12,8 @@
 
 + (NSWindowController *)sharedInstance;
 
++ (NSWindowController *)DMGPurchaseInstance;
+
 - (IBAction)startModal:(id)sender;
 - (IBAction)endModal:(id)sender;
 

+ 9 - 0
PDF Office/PDF Master/Class/Purchase/Appstore/KMPurchaseCompareWindowController.m

@@ -320,6 +320,15 @@ static NSString *const KMPurchaseCompareCellIdentifier       = @"KMPurchaseCompa
 #endif
 }
 
++ (NSWindowController *)DMGPurchaseInstance {
+    static KMPurchaseCompareDMGWindowController *singleton = nil;
+    static dispatch_once_t pred;
+    dispatch_once(&pred, ^{
+        singleton = [[KMPurchaseCompareDMGWindowController alloc] init];
+    });
+    return singleton;
+}
+
 #pragma mark - FirstTrial WC
 + (KMPurchaseFirstTrialWindowController *)firstTrialWCCheck {
     //弹出 试用弹窗UI优化-新用户试用路径 新UI 情况三 点到付费功能

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

@@ -8244,6 +8244,7 @@
 		AD055E1A2B70B2460035F824 /* KMBookmark */ = {
 			isa = PBXGroup;
 			children = (
+				AD055E562B846C6B0035F824 /* Tool */,
 				AD055E512B7321EB0035F824 /* Manager */,
 				AD055E482B7234530035F824 /* View */,
 				AD055E1D2B70B3660035F824 /* Model */,
@@ -8288,6 +8289,13 @@
 			path = Manager;
 			sourceTree = "<group>";
 		};
+		AD055E562B846C6B0035F824 /* Tool */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			path = Tool;
+			sourceTree = "<group>";
+		};
 		AD0E8AAD2A31B6F300DBFD3C /* Appstore */ = {
 			isa = PBXGroup;
 			children = (

+ 185 - 42
PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -80,7 +80,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "2196"
             endingLineNumber = "2196"
-            landmarkName = "savePDFSettingToDefaults(_:)"
+            landmarkName = "removeAllAnnotation(_:)"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -321,6 +321,21 @@
                   endingLineNumber = "348"
                   offsetFromSymbolStart = "184">
                </Location>
+               <Location
+                  uuid = "A20B3568-4CD6-49FA-966A-0964A1226408 - 561cb8606b4505cb"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMLeftSideViewController.noteFilterAction(Swift.Optional&lt;Swift.AnyObject&gt;) -&gt; ()"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Note.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "348"
+                  endingLineNumber = "348"
+                  offsetFromSymbolStart = "112">
+               </Location>
             </Locations>
          </BreakpointContent>
       </BreakpointProxy>
@@ -334,8 +349,8 @@
             filePath = "PDF Master/Class/Home/ViewController/KMHomeViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "818"
-            endingLineNumber = "818"
+            startingLineNumber = "892"
+            endingLineNumber = "892"
             landmarkName = "checkRepeatTrialAlertController()"
             landmarkType = "7">
          </BreakpointContent>
@@ -350,8 +365,8 @@
             filePath = "PDF Master/Class/Home/ViewController/KMHomeViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "820"
-            endingLineNumber = "820"
+            startingLineNumber = "894"
+            endingLineNumber = "894"
             landmarkName = "checkRepeatTrialAlertController()"
             landmarkType = "7">
          </BreakpointContent>
@@ -366,8 +381,8 @@
             filePath = "PDF Master/Class/Home/ViewController/KMHomeViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "809"
-            endingLineNumber = "809"
+            startingLineNumber = "883"
+            endingLineNumber = "883"
             landmarkName = "checkRepeatTrialExpiredController()"
             landmarkType = "7">
          </BreakpointContent>
@@ -519,47 +534,143 @@
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "DB926723-14B1-4358-AF9B-3BC932A40699"
+            uuid = "BC05A97D-1C2F-491F-A408-09997148971E"
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift"
+            filePath = "PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/ComparativeView/Manager/KMComparativeManager.swift"
+            startingColumnNumber = "23"
+            endingColumnNumber = "23"
+            startingLineNumber = "35"
+            endingLineNumber = "35"
+            landmarkName = "parseData(filePath:completion:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+<<<<<<< HEAD
+=======
+            uuid = "F0CCC3F5-3111-410E-B407-409680679DED"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Snapshot.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "372"
+            endingLineNumber = "372"
+            landmarkName = "snapshotController(_:miniaturizedRect:)"
+            landmarkType = "9">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "BDED4DA9-5D62-4041-8D2D-504BE4517227"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Snapshot.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "150"
-            endingLineNumber = "150"
-            landmarkName = "_themeChanged(_:)"
+            startingLineNumber = "346"
+            endingLineNumber = "346"
+            landmarkName = "snapshotControllerDidFinishSetup(_:)"
+            landmarkType = "9">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "DE0FCC4E-9163-403E-9DC4-A8FAB6088ADF"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFTools/Snapshot/Window/KMSnapshotWindowController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "75"
+            endingLineNumber = "75"
+            landmarkName = "windowDidLoad()"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "DFE3447A-AA34-4D67-BF7F-76285FDA9D02"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFTools/Snapshot/Window/KMSnapshotWindowController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "572"
+            endingLineNumber = "572"
+            landmarkName = "setPdfDocument(_:goToPageNumber:rect:scaleFactor:autoFits:)"
             landmarkType = "7">
             <Locations>
                <Location
-                  uuid = "DB926723-14B1-4358-AF9B-3BC932A40699 - d41a0f6c4e43f42c"
+                  uuid = "DFE3447A-AA34-4D67-BF7F-76285FDA9D02 - e8c5db67957d933"
                   shouldBeEnabled = "Yes"
                   ignoreCount = "0"
                   continueAfterRunningActions = "No"
-                  symbolName = "PDF_Reaer_Pro.KMBrowserWindowController._themeChanged(Foundation.Notification) -&gt; ()"
+                  symbolName = "PDF_Reaer_Pro.KMSnapshotWindowController.setPdfDocument(_: __C.CPDFDocument, goToPageNumber: Swift.Int, rect: __C.CGRect, scaleFactor: CoreGraphics.CGFloat, autoFits: Swift.Bool) -&gt; ()"
                   moduleName = "PDF Reaer Pro"
                   usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/work/tangchao/git/PDFOffice/PDF%20Office/PDF%20Master/Class/ChromiumTabs/KMBrowserWindowController.swift"
+                  urlString = "file:///Users/kdanmobile/work/tangchao/git/PDFOffice/PDF%20Office/PDF%20Master/Class/PDFTools/Snapshot/Window/KMSnapshotWindowController.swift"
                   startingColumnNumber = "9223372036854775807"
                   endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "150"
-                  endingLineNumber = "150"
-                  offsetFromSymbolStart = "97">
+                  startingLineNumber = "572"
+                  endingLineNumber = "572"
+                  offsetFromSymbolStart = "3220">
                </Location>
                <Location
-                  uuid = "DB926723-14B1-4358-AF9B-3BC932A40699 - d41a0f6c4e43f42c"
+                  uuid = "DFE3447A-AA34-4D67-BF7F-76285FDA9D02 - e8c5db67957d933"
                   shouldBeEnabled = "Yes"
                   ignoreCount = "0"
                   continueAfterRunningActions = "No"
-                  symbolName = "PDF_Reaer_Pro.KMBrowserWindowController._themeChanged(Foundation.Notification) -&gt; ()"
+                  symbolName = "PDF_Reaer_Pro.KMSnapshotWindowController.setPdfDocument(_: __C.CPDFDocument, goToPageNumber: Swift.Int, rect: __C.CGRect, scaleFactor: CoreGraphics.CGFloat, autoFits: Swift.Bool) -&gt; ()"
                   moduleName = "PDF Reaer Pro"
                   usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/work/tangchao/git/PDFOffice/PDF%20Office/PDF%20Master/Class/ChromiumTabs/KMBrowserWindowController.swift"
+                  urlString = "file:///Users/kdanmobile/work/tangchao/git/PDFOffice/PDF%20Office/PDF%20Master/Class/PDFTools/Snapshot/Window/KMSnapshotWindowController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "572"
+                  endingLineNumber = "572"
+                  offsetFromSymbolStart = "3435">
+               </Location>
+               <Location
+                  uuid = "DFE3447A-AA34-4D67-BF7F-76285FDA9D02 - 2c4c8098d9425eeb"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMSnapshotWindowController.setPdfDocument(_: __C.CPDFDocument, goToPageNumber: Swift.Int, rect: __C.CGRect, scaleFactor: CoreGraphics.CGFloat, autoFits: Swift.Bool) -&gt; ()"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/PDFTools/Snapshot/Window/KMSnapshotWindowController.swift"
                   startingColumnNumber = "9223372036854775807"
                   endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "150"
-                  endingLineNumber = "150"
-                  offsetFromSymbolStart = "444">
+                  startingLineNumber = "572"
+                  endingLineNumber = "572"
+                  offsetFromSymbolStart = "2336">
+               </Location>
+               <Location
+                  uuid = "DFE3447A-AA34-4D67-BF7F-76285FDA9D02 - 2c4c8098d9425eeb"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMSnapshotWindowController.setPdfDocument(_: __C.CPDFDocument, goToPageNumber: Swift.Int, rect: __C.CGRect, scaleFactor: CoreGraphics.CGFloat, autoFits: Swift.Bool) -&gt; ()"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/PDFTools/Snapshot/Window/KMSnapshotWindowController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "572"
+                  endingLineNumber = "572"
+                  offsetFromSymbolStart = "2572">
                </Location>
             </Locations>
          </BreakpointContent>
@@ -567,22 +678,7 @@
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "BC05A97D-1C2F-491F-A408-09997148971E"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/ComparativeView/Manager/KMComparativeManager.swift"
-            startingColumnNumber = "23"
-            endingColumnNumber = "23"
-            startingLineNumber = "35"
-            endingLineNumber = "35"
-            landmarkName = "parseData(filePath:completion:)"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
+>>>>>>> 56792c7e38a7fc6df806ce4e63b67b5b4abe73f4
             uuid = "2B66DACB-5722-4DB0-91F0-074284BA7E5A"
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
@@ -606,10 +702,57 @@
             filePath = "PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2541"
-            endingLineNumber = "2541"
+            startingLineNumber = "2632"
+            endingLineNumber = "2632"
             landmarkName = "tableMenu(_:withTable:point:)"
             landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "CA4FC0A7-ECA3-4141-AE22-84D66385B822 - e67b12dd034d39f"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.tableMenu(_: __C.NSMenu, withTable: PDF_Reader_Pro.KMTableAnnotation, point: __C.CGPoint) -&gt; __C.NSMenu"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/ViewController/KMMainViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "2631"
+                  endingLineNumber = "2631"
+                  offsetFromSymbolStart = "268">
+               </Location>
+               <Location
+                  uuid = "CA4FC0A7-ECA3-4141-AE22-84D66385B822 - e67b12dd034d39f"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.tableMenu(_: __C.NSMenu, withTable: PDF_Reader_Pro.KMTableAnnotation, point: __C.CGPoint) -&gt; __C.NSMenu"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/ViewController/KMMainViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "2631"
+                  endingLineNumber = "2631"
+                  offsetFromSymbolStart = "456">
+               </Location>
+               <Location
+                  uuid = "CA4FC0A7-ECA3-4141-AE22-84D66385B822 - e67b12dd034d3be"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.tableMenu(_: __C.NSMenu, withTable: PDF_Reader_Pro.KMTableAnnotation, point: __C.CGPoint) -&gt; __C.NSMenu"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/ViewController/KMMainViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "2632"
+                  endingLineNumber = "2632"
+                  offsetFromSymbolStart = "456">
+               </Location>
+            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy