1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- //
- // KMCompareContentWindowController.swift
- // PDF Reader Pro
- //
- // Created by lizhe on 2023/11/20.
- //
- import Cocoa
- class KMCompareContentWindowController: NSWindowController {
- @IBOutlet weak var contentView: KMCompareContentView!
-
- var results: [CPDFCompareResults] = []
- var pdfDocument: CPDFDocument?
- var pdfOldDocumnet: CPDFDocument?
- var hideCloseInfo: Bool = false
-
- var saveHandle: ((KMCompareContentWindowController) -> Void)?
- var closeHandle: ((KMCompareContentWindowController) -> Void)?
-
- convenience init(document: CPDFDocument, oldDocument: CPDFDocument, results: [CPDFCompareResults]) {
- self.init(windowNibName: "KMCompareContentWindowController")
- self.results = results
- self.pdfOldDocumnet = oldDocument
- self.pdfDocument = document
-
- // contentView.oldDocument = oldDocument
- // contentView.document = document
- // contentView.compareResults = results
- }
-
- override func windowDidLoad() {
- super.windowDidLoad()
- guard let pdfOldDocumnet = pdfOldDocumnet else { return }
- guard let pdfDocument = pdfDocument else { return }
-
- contentView.oldDocument = pdfOldDocumnet
- contentView.document = pdfDocument
- contentView.compareResults = results
- contentView.closeHandle = {[unowned self] view in
- self.closeHandle?(self)
- }
-
- contentView.saveHandle = {[unowned self] view in
- self.saveHandle?(self)
- }
- }
-
- }
|