Преглед на файлове

【幻灯片】补充幻灯片UI及操作

dinglingui преди 5 месеца
родител
ревизия
4d4cb085ec
променени са 100 файла, в които са добавени 3854 реда и са изтрити 5 реда
  1. 4 1
      PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController+Actions.swift
  2. 169 0
      PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/KMPresentationTopViewController.swift
  3. 199 0
      PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/KMPresentationTopViewController.xib
  4. 6 0
      PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/Contents.json
  5. 12 0
      PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameDelete.imageset/Contents.json
  6. 103 0
      PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameDelete.imageset/delete.pdf
  7. 12 0
      PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameExit.imageset/Contents.json
  8. 76 0
      PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameExit.imageset/backward.pdf
  9. 12 0
      PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameType.imageset/Contents.json
  10. BIN
      PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameType.imageset/Group 460.pdf
  11. 12 0
      PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameTypeSeletion.imageset/Contents.json
  12. BIN
      PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameTypeSeletion.imageset/Group 460.pdf
  13. 12 0
      PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameUndo.imageset/Contents.json
  14. 84 0
      PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameUndo.imageset/Item.pdf
  15. 16 1
      PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.h
  16. 44 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.m
  17. 32 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m
  18. 2 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Tool.h
  19. 15 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Tool.m
  20. 1 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Headers
  21. 1 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/KMDrawViewSDK_Mac
  22. 1 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Modules
  23. 1 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Resources
  24. 27 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/ESContextTypes.h
  25. 99 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/ESRenderTypes.h
  26. 23 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/ESShaderTools.h
  27. 29 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/ImageRenderFSHs.h
  28. 147 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/KMBrushManager.h
  29. 708 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/KMDrawView.h
  30. 18 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/KMDrawViewSDK_Mac.h
  31. 258 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/KMDrawViewTypes.h
  32. 105 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/KMDrawViewVersion.h
  33. 70 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/LineProcess.h
  34. 308 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/LineProcessTypes.h
  35. 164 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/Recognise.h
  36. 23 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/TextureTypes.h
  37. 45 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/Tools.h
  38. 19 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/UIColor+Mac.h
  39. 35 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/UIImage+Mac.h
  40. 19 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/UIView+Mac.h
  41. 66 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/matrix.h
  42. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/KMDrawViewSDK_Mac
  43. 6 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Modules/module.modulemap
  44. 48 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Info.plist
  45. 12 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/BaseLine_Mac.fsh
  46. 21 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/BaseLine_Mac.vsh
  47. 42 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/ImageRender_Mac(behand).fsh
  48. 46 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/ImageRender_Mac(brightness).fsh
  49. 42 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/ImageRender_Mac(erase).fsh
  50. 50 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/ImageRender_Mac(multiply).fsh
  51. 42 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/ImageRender_Mac(normal).fsh
  52. 42 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/ImageRender_Mac(replace).fsh
  53. 27 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/ImageRender_Mac(reset).fsh
  54. 55 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/ImageRender_Mac(tarnish).fsh
  55. 41 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/ImageRender_Mac.vsh
  56. 131 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/Line_Mac.fsh
  57. 51 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/Line_Mac.vsh
  58. 61 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/Root.plist
  59. 20 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/Smudge_Mac(Show).fsh
  60. 25 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/Smudge_Mac(Show).vsh
  61. 40 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/Smudge_Mac(Smudge).fsh
  62. 52 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/Smudge_Mac(Smudge).vsh
  63. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/en.lproj/Root.strings
  64. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_1.png
  65. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_10.png
  66. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_11.png
  67. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_12.png
  68. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_13.png
  69. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_14.png
  70. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_15.png
  71. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_16.png
  72. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_17.png
  73. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_18.png
  74. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_19.png
  75. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_2.png
  76. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_20.png
  77. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_21.png
  78. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_25.png
  79. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_27.png
  80. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_28.png
  81. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_29.png
  82. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_3.png
  83. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_30.png
  84. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_31.png
  85. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_32.png
  86. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_33.png
  87. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_34.png
  88. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_35.png
  89. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_4.png
  90. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_40.png
  91. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_42.png
  92. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_46.png
  93. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_5.png
  94. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_6.png
  95. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_7.png
  96. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_8.png
  97. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/实边椭圆 45 1.png
  98. 1 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/Current
  99. 22 3
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMColorPickerView.swift
  100. 0 0
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.xib

+ 4 - 1
PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController+Actions.swift

@@ -116,9 +116,12 @@ extension KMBrowserWindowController {
                 make?.top.mas_equalTo()(0)
                 make?.bottom.mas_equalTo()(0)
             }
-            
+            (v as? CPDFListView)?.isPresentationMode = false
             (v as? CPDFListView)?.layoutDocumentView()
             (v as? CPDFListView)?.requiresDisplay()
+            if (v as? CPDFListView)?.isEnterPresentationDrawMode() == true {
+                (v as? CPDFListView)?.exitPresentationDrawMode()
+            }
         }
 
         if let mainVc = (self.document as? KMMainDocument)?.mainViewController {

+ 169 - 0
PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/KMPresentationTopViewController.swift

@@ -0,0 +1,169 @@
+//
+//  KMPresentationTopViewController.swift
+//  PDF Reader Pro
+//
+//  Created by 丁林圭 on 2024/9/23.
+//
+
+import Cocoa
+
+@objc public protocol KMPresentationTopViewControllerDelegate: AnyObject {
+    @objc optional func presentationTopViewExit(_ presentationTopViewController: KMPresentationTopViewController, withButton: NSButton)
+    
+    @objc optional func presentationTopViewUndo(_ presentationTopViewController: KMPresentationTopViewController, withButton: NSButton)
+
+    @objc optional func presentationTopViewClear(_ presentationTopViewController: KMPresentationTopViewController, withButton: NSButton)
+    
+    @objc optional func presentationTopViewType(_ presentationTopViewController: KMPresentationTopViewController, withButton: NSButton,isSeletion:Bool)
+    
+    @objc optional func presentationTopViewDrawColor(_ presentationTopViewController: KMPresentationTopViewController, withView: NSView,color:NSColor?)
+
+}
+
+
+public class KMPresentationTopViewController: NSViewController, KMDrawViewDelegate {
+    
+    @IBOutlet var pageNubLabel: NSTextField!
+    @IBOutlet var backButton: NSButton!
+    @IBOutlet var forwardButton: NSButton!
+
+    @IBOutlet var undoButton: NSButton!
+    @IBOutlet var exitButton: NSButton!
+    @IBOutlet var deleteButton: NSButton!
+    @IBOutlet var typeButton: NSButton!
+    
+    public weak var pdfView: CPDFListView?
+    
+    public var isSelectionPre: Bool = true
+
+    weak var delegate: KMPresentationTopViewControllerDelegate?
+
+    @IBOutlet private weak var textColorPickerView: KMColorPickerView!
+
+    deinit {
+        textColorPickerView.target = nil
+        textColorPickerView.action = nil
+        
+        NSColorPanel.shared.setTarget(nil)
+        NSColorPanel.shared.setAction(nil)
+    }
+
+    public override func viewDidLoad() {
+        super.viewDidLoad()
+        
+        pageNubLabel.stringValue =  "\((pdfView?.currentPageIndex ?? 0) + 1)/\(pdfView?.document.pageCount ?? 0)"
+        
+        NotificationCenter.default.addObserver(self, selector: #selector(pageChangedNotification(_:)), name: NSNotification.Name.CPDFViewPageChanged, object: self.pdfView)
+        
+        textColorPickerView.isCallColorPanelAction = true
+        textColorPickerView.noContentString = true
+        textColorPickerView.annotationType = .inkColors
+        textColorPickerView.isFillColor = true
+        textColorPickerView.isOrderWindowAbove = true
+        
+        self.view.wantsLayer = true
+        self.view.layer?.backgroundColor = .white
+        
+        if(isSelectionPre == false) {
+            typeButton.image = NSImage(named: "KMPresentationImageNameType")
+        } else {
+            typeButton.image = NSImage(named: "KMPresentationImageNameTypeSeletion")
+        }
+
+        updatePageState()
+        
+        pdfView?.presentationDrawView.delegate = self
+        undoButton.isEnabled = false
+
+
+    }
+    
+    // MARK: - Private
+   private func updatePageState() {
+       if(pdfView?.canGoToNextPage() == true) {
+           backButton.isEnabled = true
+        } else {
+            backButton.isEnabled = false
+        }
+        
+       if(pdfView?.canGoToPreviousPage() == true) {
+           forwardButton.isEnabled = true
+        } else {
+            forwardButton.isEnabled = false
+        }
+       
+    }
+    
+    // MARK: - Action
+    @IBAction func buttonItemClicked_BackPage(_ sender: NSButton) {
+        updatePageState()
+        if(pdfView?.canGoToNextPage() == true) {
+            pdfView?.goToNextPage(sender)
+            let presentationDrawView = pdfView?.presentationDrawView
+
+            presentationDrawView?.clear()
+        }
+    }
+    
+    @IBAction func buttonItemClicked_ForwardPage(_ sender: NSButton) {
+        updatePageState()
+        if(pdfView?.canGoToPreviousPage() == true) {
+            pdfView?.goToPreviousPage(sender)
+            let presentationDrawView = pdfView?.presentationDrawView
+
+            presentationDrawView?.clear()
+        }
+    }
+    
+    @IBAction func buttonItemClicked_Undo(_ sender: NSButton) {
+        delegate?.presentationTopViewUndo?(self, withButton: sender)
+    }
+    
+    @IBAction func buttonItemClicked_Exit(_ sender: NSButton) {
+        delegate?.presentationTopViewExit?(self, withButton: sender)
+    }
+    
+    @IBAction func buttonItemClicked_Delete(_ sender: NSButton) {
+        delegate?.presentationTopViewClear?(self, withButton: sender)
+    }
+    
+    @IBAction func buttonItemClicked_Type(_ sender: NSButton) {
+        if(isSelectionPre == true) {
+            typeButton.image = NSImage(named: "KMPresentationImageNameType")
+            isSelectionPre = false
+        } else {
+            typeButton.image = NSImage(named: "KMPresentationImageNameTypeSeletion")
+            isSelectionPre = true
+
+        }
+        textColorPickerView.decSelectionColorView()
+        delegate?.presentationTopViewType?(self, withButton: sender, isSeletion: isSelectionPre)
+    }
+    
+    @IBAction func drawColorPickerViewAction(_ sender: Any) {
+         let borderColor = textColorPickerView.color
+        delegate?.presentationTopViewDrawColor?(self, withView: textColorPickerView, color: borderColor)
+
+    }
+    
+    // MARK: - Notification
+    @objc func pageChangedNotification(_ notification: Notification) {
+        guard let pdfview = notification.object as? CPDFView else {
+            return
+        }
+        if pdfview.document == self.pdfView?.document {
+            pageNubLabel.stringValue =  "\((pdfView?.currentPageIndex ?? 0) + 1)/\(pdfView?.document.pageCount ?? 0)"
+            updatePageState()
+        }
+    }
+    
+    // MARK: - KMDrawView
+    public func drawView(_ drawView: KMDrawView!, didUpdateUndoStatus enable: Bool) {
+        undoButton.isEnabled = enable
+    }
+    
+    public func drawView(_ drawView: KMDrawView!, didDrawEnd point: CGPoint) {
+        
+    }
+
+}

+ 199 - 0
PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/KMPresentationTopViewController.xib

@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMPresentationTopViewController" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <connections>
+                <outlet property="backButton" destination="2vg-aX-HHv" id="C9f-PA-1Je"/>
+                <outlet property="deleteButton" destination="3qv-mc-BdY" id="s3W-rc-wOn"/>
+                <outlet property="exitButton" destination="xY2-DM-OMi" id="SUZ-GB-6kL"/>
+                <outlet property="forwardButton" destination="hHt-4X-C0b" id="qI0-wr-guW"/>
+                <outlet property="pageNubLabel" destination="RfC-Iw-PQv" id="dbr-PK-WKL"/>
+                <outlet property="textColorPickerView" destination="ozl-Q7-czB" id="RfW-CL-eGB"/>
+                <outlet property="typeButton" destination="uik-cR-1me" id="BFe-H6-Njl"/>
+                <outlet property="undoButton" destination="LN3-fE-ZXk" id="MYX-JF-c9n"/>
+                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="Hz6-mo-xeY">
+            <rect key="frame" x="0.0" y="0.0" width="741" height="42"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <button translatesAutoresizingMaskIntoConstraints="NO" id="xY2-DM-OMi">
+                    <rect key="frame" x="12" y="9" width="40" height="24"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="40" id="TgB-0K-ORY"/>
+                        <constraint firstAttribute="height" constant="24" id="Z6D-2a-1e0"/>
+                    </constraints>
+                    <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMPresentationImageNameExit" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="FqK-vA-X7Y">
+                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                        <font key="font" metaFont="system"/>
+                    </buttonCell>
+                    <connections>
+                        <action selector="buttonItemClicked_Exit:" target="-2" id="R22-RA-GkE"/>
+                    </connections>
+                </button>
+                <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="S53-CS-pdQ">
+                    <rect key="frame" x="202" y="5" width="337" height="32"/>
+                    <view key="contentView" id="v7d-h8-QAq">
+                        <rect key="frame" x="0.0" y="0.0" width="337" height="32"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <button translatesAutoresizingMaskIntoConstraints="NO" id="LN3-fE-ZXk">
+                                <rect key="frame" x="0.0" y="-4" width="40" height="40"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="40" id="bE3-uA-bhc"/>
+                                    <constraint firstAttribute="height" constant="40" id="ibH-Xu-ehr"/>
+                                </constraints>
+                                <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMPresentationImageNameUndo" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="ESZ-vM-7YS">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                </buttonCell>
+                                <connections>
+                                    <action selector="buttonItemClicked_Undo:" target="-2" id="beT-Lq-qYg"/>
+                                </connections>
+                            </button>
+                            <box horizontalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="lMN-HQ-d5h">
+                                <rect key="frame" x="48" y="0.0" width="5" height="32"/>
+                            </box>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="ozl-Q7-czB" customClass="KMColorPickerView" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                                <rect key="frame" x="55" y="0.0" width="220" height="32"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="32" id="CMY-uX-n1C"/>
+                                    <constraint firstAttribute="width" constant="220" id="ttc-sa-I9b"/>
+                                </constraints>
+                                <connections>
+                                    <action selector="drawColorPickerViewAction:" target="-2" id="lXX-nx-mar"/>
+                                </connections>
+                            </customView>
+                            <button translatesAutoresizingMaskIntoConstraints="NO" id="3qv-mc-BdY">
+                                <rect key="frame" x="287" y="6" width="20" height="20"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="20" id="u8d-2p-TVT"/>
+                                    <constraint firstAttribute="height" constant="20" id="uc8-ci-Z0S"/>
+                                </constraints>
+                                <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMPresentationImageNameDelete" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="XnW-uy-Bbj">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                </buttonCell>
+                                <connections>
+                                    <action selector="buttonItemClicked_Delete:" target="-2" id="CSW-DP-SOg"/>
+                                </connections>
+                            </button>
+                            <button translatesAutoresizingMaskIntoConstraints="NO" id="uik-cR-1me">
+                                <rect key="frame" x="317" y="6" width="20" height="20"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="20" id="3co-RJ-gnz"/>
+                                    <constraint firstAttribute="height" constant="20" id="wxB-bB-9NJ"/>
+                                </constraints>
+                                <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMPresentationImageNameTypeSeletion" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="JHz-Q8-Z3G">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                </buttonCell>
+                                <connections>
+                                    <action selector="buttonItemClicked_Type:" target="-2" id="yXU-lZ-eDp"/>
+                                </connections>
+                            </button>
+                        </subviews>
+                        <constraints>
+                            <constraint firstItem="ozl-Q7-czB" firstAttribute="leading" secondItem="lMN-HQ-d5h" secondAttribute="leading" constant="5" id="5Bf-gR-B4J"/>
+                            <constraint firstAttribute="bottom" secondItem="ozl-Q7-czB" secondAttribute="bottom" id="8Ma-jF-IdK"/>
+                            <constraint firstItem="uik-cR-1me" firstAttribute="leading" secondItem="3qv-mc-BdY" secondAttribute="trailing" constant="10" symbolic="YES" id="9SH-tg-oTn"/>
+                            <constraint firstAttribute="trailing" secondItem="uik-cR-1me" secondAttribute="trailing" id="Aah-u0-Vlm"/>
+                            <constraint firstItem="3qv-mc-BdY" firstAttribute="centerY" secondItem="v7d-h8-QAq" secondAttribute="centerY" id="LOy-EB-vXc"/>
+                            <constraint firstItem="ozl-Q7-czB" firstAttribute="top" secondItem="v7d-h8-QAq" secondAttribute="top" id="MAH-lS-zlm"/>
+                            <constraint firstItem="ozl-Q7-czB" firstAttribute="centerY" secondItem="v7d-h8-QAq" secondAttribute="centerY" id="Nkm-jP-7VV"/>
+                            <constraint firstItem="lMN-HQ-d5h" firstAttribute="leading" secondItem="LN3-fE-ZXk" secondAttribute="trailing" constant="10" id="SXa-Xe-HVi"/>
+                            <constraint firstItem="uik-cR-1me" firstAttribute="centerY" secondItem="v7d-h8-QAq" secondAttribute="centerY" id="VFn-4N-hbU"/>
+                            <constraint firstItem="LN3-fE-ZXk" firstAttribute="leading" secondItem="v7d-h8-QAq" secondAttribute="leading" id="ZWO-j8-7zr"/>
+                            <constraint firstAttribute="bottom" secondItem="lMN-HQ-d5h" secondAttribute="bottom" id="fr3-Ag-NWE"/>
+                            <constraint firstItem="3qv-mc-BdY" firstAttribute="leading" secondItem="ozl-Q7-czB" secondAttribute="trailing" constant="12" id="jIB-ZM-LwC"/>
+                            <constraint firstItem="lMN-HQ-d5h" firstAttribute="top" secondItem="v7d-h8-QAq" secondAttribute="top" id="lQq-p4-4jT"/>
+                            <constraint firstItem="LN3-fE-ZXk" firstAttribute="centerY" secondItem="v7d-h8-QAq" secondAttribute="centerY" id="sMZ-Ub-5wP"/>
+                        </constraints>
+                    </view>
+                </box>
+                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hHt-4X-C0b">
+                    <rect key="frame" x="593" y="9" width="20" height="25"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="20" id="47D-JB-MvJ"/>
+                        <constraint firstAttribute="width" constant="20" id="uDI-nc-Wnx"/>
+                    </constraints>
+                    <buttonCell key="cell" type="bevel" bezelStyle="circular" image="NSGoLeftTemplate" imagePosition="overlaps" alignment="center" imageScaling="proportionallyDown" inset="2" id="8yU-nc-Xff">
+                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                        <font key="font" metaFont="system"/>
+                    </buttonCell>
+                    <connections>
+                        <action selector="buttonItemClicked_ForwardPage:" target="-2" id="jAJ-7Z-Idx"/>
+                    </connections>
+                </button>
+                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2vg-aX-HHv">
+                    <rect key="frame" x="713" y="9" width="20" height="25"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="20" id="bIi-KW-B9j"/>
+                        <constraint firstAttribute="height" constant="20" id="mBV-qF-zbf"/>
+                    </constraints>
+                    <buttonCell key="cell" type="bevel" bezelStyle="circular" image="NSGoRightTemplate" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="cgb-NS-Bt7">
+                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                        <font key="font" metaFont="system"/>
+                    </buttonCell>
+                    <connections>
+                        <action selector="buttonItemClicked_BackPage:" target="-2" id="maf-f0-RYx"/>
+                    </connections>
+                </button>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="Szf-SI-07l">
+                    <rect key="frame" x="643" y="10" width="40" height="22"/>
+                    <subviews>
+                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="RfC-Iw-PQv">
+                            <rect key="frame" x="-2" y="3" width="44" height="16"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="40" id="1s7-I6-Ujw"/>
+                            </constraints>
+                            <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="/ 0" id="ZGE-6y-SJf">
+                                <font key="font" metaFont="system"/>
+                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                            </textFieldCell>
+                        </textField>
+                    </subviews>
+                    <constraints>
+                        <constraint firstAttribute="bottom" secondItem="RfC-Iw-PQv" secondAttribute="bottom" constant="3" id="LlE-0S-wME"/>
+                        <constraint firstAttribute="trailing" secondItem="RfC-Iw-PQv" secondAttribute="trailing" id="Plo-If-t5o"/>
+                        <constraint firstItem="RfC-Iw-PQv" firstAttribute="leading" secondItem="Szf-SI-07l" secondAttribute="leading" id="i0E-TI-CoG"/>
+                        <constraint firstItem="RfC-Iw-PQv" firstAttribute="top" secondItem="Szf-SI-07l" secondAttribute="top" constant="3" id="uIa-qF-8FX"/>
+                        <constraint firstItem="RfC-Iw-PQv" firstAttribute="centerY" secondItem="Szf-SI-07l" secondAttribute="centerY" id="zVE-Ii-TvD"/>
+                    </constraints>
+                </customView>
+            </subviews>
+            <constraints>
+                <constraint firstItem="Szf-SI-07l" firstAttribute="centerY" secondItem="Hz6-mo-xeY" secondAttribute="centerY" id="4O0-vM-PKi"/>
+                <constraint firstItem="S53-CS-pdQ" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="5mn-rr-LsD"/>
+                <constraint firstItem="xY2-DM-OMi" firstAttribute="centerY" secondItem="Hz6-mo-xeY" secondAttribute="centerY" id="858-gX-9o2"/>
+                <constraint firstItem="Szf-SI-07l" firstAttribute="leading" secondItem="hHt-4X-C0b" secondAttribute="trailing" constant="30" id="DKd-fT-6cK"/>
+                <constraint firstItem="2vg-aX-HHv" firstAttribute="centerY" secondItem="Hz6-mo-xeY" secondAttribute="centerY" id="Lf8-Tg-bom"/>
+                <constraint firstAttribute="trailing" secondItem="2vg-aX-HHv" secondAttribute="trailing" constant="8" id="Q9Z-y5-BOf"/>
+                <constraint firstItem="hHt-4X-C0b" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="S53-CS-pdQ" secondAttribute="trailing" id="Ysn-r0-cc7"/>
+                <constraint firstItem="2vg-aX-HHv" firstAttribute="leading" secondItem="Szf-SI-07l" secondAttribute="trailing" constant="30" id="bKW-yv-ahl"/>
+                <constraint firstItem="S53-CS-pdQ" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="5" id="d5V-mm-aia"/>
+                <constraint firstItem="xY2-DM-OMi" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="dCy-Tc-In8"/>
+                <constraint firstItem="hHt-4X-C0b" firstAttribute="centerY" secondItem="Hz6-mo-xeY" secondAttribute="centerY" id="jYr-fI-U8y"/>
+                <constraint firstAttribute="bottom" secondItem="S53-CS-pdQ" secondAttribute="bottom" constant="5" id="nCQ-Re-mhw"/>
+            </constraints>
+            <point key="canvasLocation" x="-122" y="148.5"/>
+        </customView>
+    </objects>
+    <resources>
+        <image name="KMPresentationImageNameDelete" width="20" height="20"/>
+        <image name="KMPresentationImageNameExit" width="24" height="24"/>
+        <image name="KMPresentationImageNameTypeSeletion" width="20" height="20"/>
+        <image name="KMPresentationImageNameUndo" width="40" height="40"/>
+        <image name="NSGoLeftTemplate" width="10" height="14"/>
+        <image name="NSGoRightTemplate" width="10" height="14"/>
+    </resources>
+</document>

+ 6 - 0
PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 12 - 0
PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameDelete.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "delete.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 103 - 0
PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameDelete.imageset/delete.pdf

@@ -0,0 +1,103 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 1.000000 1.500000 cm
+0.152276 0.234759 0.385445 scn
+13.000000 17.000000 m
+13.000000 14.000000 l
+18.000000 14.000000 l
+18.000000 13.000000 l
+15.500000 13.000000 l
+15.500000 0.000000 l
+2.500000 0.000000 l
+2.500000 13.000000 l
+0.000000 13.000000 l
+0.000000 14.000000 l
+5.000000 14.000000 l
+5.000000 17.000000 l
+13.000000 17.000000 l
+h
+3.500000 13.000000 m
+3.500000 1.000000 l
+14.500000 1.000000 l
+14.500000 13.000000 l
+3.500000 13.000000 l
+h
+12.000000 16.000000 m
+12.000000 14.000000 l
+6.000000 14.000000 l
+6.000000 16.000000 l
+12.000000 16.000000 l
+h
+7.500000 10.500000 m
+7.500000 3.500000 l
+6.500000 3.500000 l
+6.500000 10.500000 l
+7.500000 10.500000 l
+h
+11.500000 3.500000 m
+11.500000 10.500000 l
+10.500000 10.500000 l
+10.500000 3.500000 l
+11.500000 3.500000 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  837
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000927 00000 n
+0000000949 00000 n
+0000001122 00000 n
+0000001196 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1255
+%%EOF

+ 12 - 0
PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameExit.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "backward.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 76 - 0
PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameExit.imageset/backward.pdf

@@ -0,0 +1,76 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 0.000000 -1.000000 3.792968 18.353516 cm
+0.056471 0.065882 0.080000 scn
+7.060660 11.999925 m
+6.353553 12.707031 l
+0.000000 6.353478 l
+6.353553 -0.000075 l
+7.060660 0.707031 l
+1.914116 5.853478 l
+16.207108 5.853478 l
+16.207108 6.853478 l
+1.914116 6.853478 l
+7.060660 11.999925 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  335
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 24.000000 24.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000425 00000 n
+0000000447 00000 n
+0000000620 00000 n
+0000000694 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+753
+%%EOF

+ 12 - 0
PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameType.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "Group 460.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameType.imageset/Group 460.pdf


+ 12 - 0
PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameTypeSeletion.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "Group 460.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameTypeSeletion.imageset/Group 460.pdf


+ 12 - 0
PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameUndo.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "Item.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 84 - 0
PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/PresentImage.xcassets/KMPresentationImageNameUndo.imageset/Item.pdf

@@ -0,0 +1,84 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 10.794922 10.624756 cm
+0.000000 0.000000 0.000000 scn
+6.629126 18.611477 m
+5.745243 19.495361 l
+0.000000 13.750118 l
+5.745243 8.004875 l
+6.629126 8.888760 l
+2.392492 13.125118 l
+10.767451 13.125118 l
+11.039236 13.119009 l
+14.192275 12.976955 16.704952 10.375720 16.704952 7.187618 c
+16.704952 3.908427 14.046642 1.250118 10.767451 1.250118 c
+1.079951 1.250118 l
+1.079951 0.000118 l
+10.767451 0.000118 l
+11.043146 0.005308 l
+14.884930 0.150198 17.954952 3.310387 17.954952 7.187618 c
+17.954952 11.157165 14.736998 14.375118 10.767451 14.375118 c
+2.392492 14.375118 l
+6.629126 18.611477 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  663
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 40.000000 40.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000753 00000 n
+0000000775 00000 n
+0000000948 00000 n
+0000001022 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1081
+%%EOF

+ 16 - 1
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.h

@@ -13,7 +13,7 @@
 #import <ComPDFKit/ComPDFKit.h>
 #import <Foundation/Foundation.h>
 #import <QuartzCore/QuartzCore.h>
-
+#import <KMDrawViewSDK_Mac/KMDrawViewSDK_Mac.h>
 #define SKAnnotationKey @"SKAnnotation"
 
 extern NSString *SKPasteboardTypeLineStyle;
@@ -230,6 +230,10 @@ enum {
 @property (nonatomic, retain) CPDFAreaMeasureInfo *polygonAreaMeasureInfo;
 @property (nonatomic, retain) CPDFAreaMeasureInfo *squareAreaMeasureInfo;
 
+@property (nonatomic, assign) BOOL isPresentationMode;
+
+@property (nonatomic, strong) KMDrawView *presentationDrawView;
+
 - (CPDFAnnotation *)addAnnotationWithType:(CAnnotationType)annotationType selection:(CPDFSelection *)selection page:(CPDFPage *)page bounds:(NSRect)bounds;
 - (void)addAnnotationWithAnnotation:(CPDFAnnotation *)annotation toPage:(CPDFPage *)page;
 
@@ -283,6 +287,17 @@ enum {
 - (void)setPageBackgroundColorWithColor:(NSColor *)color viewMode:(KMPDFViewMode)viewMode;
 
 - (BOOL)writeSelectionToPasteboard:(NSPasteboard *)pboard types:(NSArray *)types;
+
+- (void)enterPresentationDrawMode;
+
+- (BOOL)isEnterPresentationDrawMode;
+
+- (void)changePresentationDrawModelColor:(NSColor *)color;
+
+- (void)resetPresentationDrawMode;
+
+- (void)exitPresentationDrawMode;
+
 @end
 
 @protocol CPDFListViewDelegate <NSObject>

+ 44 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.m

@@ -236,6 +236,26 @@ NSNotificationName const CPDFListViewDisplayModeChangeNotification = @"CPDFListV
 
 #pragma mark - Setter & Get
 
+- (KMDrawView *)presentationDrawView {
+    if(!_presentationDrawView) {
+        float scale = 1.4;
+        _presentationDrawView = [[KMDrawView alloc] initWithFrame:CGRectMake(0, 0,
+                                                                     scale * self.bounds.size.width,
+                                                                     scale * self.bounds.size.height)];
+        _presentationDrawView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
+        _presentationDrawView.autoMark = YES;
+        [_presentationDrawView resetUndoManager];
+        [self addSubview:_presentationDrawView];
+        _presentationDrawView.frame = self.bounds;
+        
+        _presentationDrawView.renderColor = [NSColor blackColor];
+        _presentationDrawView.radius = 100;
+        _presentationDrawView.hidden = YES;
+
+    }
+    return _presentationDrawView;
+}
+
 - (void)setDocument:(CPDFDocument *)document {
     @synchronized (self) {
         self.selectionRect = NSZeroRect;
@@ -1473,6 +1493,30 @@ NSNotificationName const CPDFListViewDisplayModeChangeNotification = @"CPDFListV
     return YES;
 }
 
+- (void)enterPresentationDrawMode {
+    self.presentationDrawView.hidden = NO;
+    [self.presentationDrawView clear];
+
+    [_presentationDrawView resetUndoManager];
+}
+
+- (BOOL)isEnterPresentationDrawMode {
+    return !self.presentationDrawView.isHidden;
+}
+
+- (void)changePresentationDrawModelColor:(NSColor *)color {
+    _presentationDrawView.renderColor = color;
+}
+
+- (void)resetPresentationDrawMode {
+    [_presentationDrawView resetUndoManager];
+    [_presentationDrawView clear];
+}
+
+- (void)exitPresentationDrawMode {
+    self.presentationDrawView.hidden = YES;
+}
+
 #pragma mark Zooming
 
 - (void)zoomToRect:(NSRect)rect onPage:(CPDFPage *)page {

+ 32 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m

@@ -284,6 +284,29 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
 }
 
 - (void)mouseMoved:(NSEvent *)event {
+    if(self.isPresentationMode) {
+        if(self.presentationDrawView.isHidden == NO) {
+            NSImage *cursorImage = [[NSImage imageNamed:@"CPDFListViewImageNameCursorsLinkDestination"] copy];
+            NSCursor * cursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:NSMakePoint(8.0, 8.0)];
+            [cursor set];
+        } else {
+            NSImage *cursorImage = [CPDFListView dotImageWithColor:[NSColor redColor] size:CGSizeMake(20, 20)];
+            NSCursor * cursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:NSMakePoint(8.0, 8.0)];
+            [cursor set];
+        }
+        return;
+    } else {
+        if(self.presentationDrawView.isHidden == NO) {
+            NSImage *cursorImage = [[NSImage imageNamed:@"CPDFListViewImageNameCursorsLinkDestination"] copy];
+            NSCursor * cursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:NSMakePoint(8.0, 8.0)];
+            [cursor set];
+            
+            return;
+        }
+    }
+    
+    
+    
     if (self.isEditing) {
 //        [super mouseMoved:event];
         return;
@@ -608,6 +631,15 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
 #pragma mark - NSMenu
 
 - (NSMenu *)menuForEvent:(NSEvent *)event {
+    if(self.isPresentationMode) {
+        return nil;
+    } else {
+        if(self.presentationDrawView.isHidden == NO) {
+            return nil;
+        }
+    }
+    
+
     [self endMeasureModeAddAnnotation];
     if (self.annotationType == CAnnotationTypeInk || self.annotationType == CAnnotationTypeEraser) {
         return nil;

+ 2 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Tool.h

@@ -93,5 +93,7 @@ typedef NS_ENUM(NSInteger, CAnnotationAlignState) {
 
 - (void)endMeasureModeAddAnnotation;
 
++ (NSImage *)dotImageWithColor:(NSColor*)color size:(CGSize)size;
+
 @end
 

+ 15 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Tool.m

@@ -467,6 +467,21 @@
     }
 }
 
++ (NSImage *)dotImageWithColor:(NSColor *)color size:(CGSize)size {
+    NSImage *image = [[NSImage alloc] initWithSize:size];
+       [image lockFocus];
+       
+       // 创建一个圆形路径
+       NSBezierPath *path = [NSBezierPath bezierPathWithOvalInRect:NSMakeRect(0, 0, size.width, size.height)];
+       
+       // 填充颜色
+       [color setFill];
+       [path fill];
+       
+       [image unlockFocus];
+       return image;}
+
+
 - (void)dragAnnotationReferenceLine:(CPDFAnnotation *)annotation {
     [self removeShapeLayer];
     

+ 1 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Headers

@@ -0,0 +1 @@
+Versions/Current/Headers

+ 1 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/KMDrawViewSDK_Mac

@@ -0,0 +1 @@
+Versions/Current/KMDrawViewSDK_Mac

+ 1 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Modules

@@ -0,0 +1 @@
+Versions/Current/Modules

+ 1 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Resources

@@ -0,0 +1 @@
+Versions/Current/Resources

+ 27 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/ESContextTypes.h

@@ -0,0 +1,27 @@
+//
+//  ESContextTypes.h
+//  KMDrawViewDemo
+//
+//  Created by zhudongyong on 14-3-15.
+//  Copyright (c) 2014年 kdanmobile. All rights reserved.
+//
+
+#ifndef KMDrawViewDemo_ESContextTypes_h
+#define KMDrawViewDemo_ESContextTypes_h
+
+typedef NS_ENUM(NSUInteger, ESBlendType) {
+    ESBlendTypeErase,
+    ESBlendTypeRenderLine,
+    ESBlendTypeSetImage,
+    ESBlendTypePasteImage
+};
+
+typedef NS_ENUM(NSUInteger, ESRenderLayerType) {
+    ESRenderLayerTypeImage        = 0,
+    ESRenderLayerTypeBaseLine     = 1,
+    ESRenderLayerTypeSubLine      = 2,
+    ESRenderLayerTypeSmudge       = 3,
+    ESRenderLayerTypeCount
+};
+
+#endif

+ 99 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/ESRenderTypes.h

@@ -0,0 +1,99 @@
+//
+//  ESRenderTypes.h
+//  KMDrawViewDemo
+//
+//  Created by zhudongyong on 14-3-15.
+//  Copyright (c) 2014年 kdanmobile. All rights reserved.
+//
+
+#ifndef KMDrawViewDemo_ESRenderTypes_h
+#define KMDrawViewDemo_ESRenderTypes_h
+
+#import <Foundation/Foundation.h>
+#if !TARGET_OS_IOS
+#import <Cocoa/Cocoa.h>
+#endif
+
+#if !TARGET_OS_IOS
+
+typedef struct {
+    GLfloat x,y;
+} Vector2;
+
+typedef struct {
+    GLfloat x,y,z,w;
+} Vector4;
+
+typedef struct {
+    Vector4 position;
+    Vector2 textureCoord;
+}LineBuffer;
+
+typedef struct {
+    Vector4 position;
+    Vector2 textureCoord;
+    Vector2 bgCoord;
+}SmudgeBuffer;
+#endif
+
+typedef enum {
+    ESBrushTypeNormal           = 0x0000,   //常规画笔
+//    ESBrushTypePencil           = 0x0001,   //铅笔工具
+//    ESBrushTypeColorReplace     = 0x0002,   //颜色替换工具
+    ESBrushTypeSmudge           = 0x0003,    //涂抹工具
+    ESBrushTypeLeaf             = 0x0004,   //柳叶笔
+}ESBrushType;
+
+typedef enum {
+    ESLineProcessTypeNone       = 0x0000,
+    ESLineProcessTypeLineWidth  = 0x0001,
+    ESLineProcessTypeFlow       = 0x0002,
+    ESLineProcessTypeAll        = ESLineProcessTypeLineWidth | ESLineProcessTypeFlow,
+}ESLineProcessType;
+
+typedef enum {
+    ESLayerBlendTypeUnknow              = 0x0000,//Use Redifine
+    //-------------------------
+    //正常
+    ESLayerBlendTypeNormal              = 0x0001,//C = D * (1 - As) + S
+    //替换
+    ESLayerBlendTypeReplace             = 0x0002,//C = S
+    //溶解
+    ESLayerBlendTypeDissolution         = 0x0003,//
+    //背后
+    ESLayerBlendTypeBehind              = 0x0004,//C = S * (1 - Ad) + D
+    //清除
+    ESLayerBlendTypeErase               = 0x0005,//C = D * (1 - As)
+    
+    //-------------------------
+    //变暗
+    ESLayerBlendTypeTarnish             = 0x0006,//C = MIN(S, D)
+    //变亮
+    ESLayerBlendTypeBrightness          = 0x0007,//C = MAX(S, D)
+    //正片叠底
+    ESLayerBlendTypeMultiply            = 0x0008,//C = S * D
+    //复位
+    ESLayerBlendTypeReset               = 0x0009,//C = D
+}ESLayerBlendType;
+
+
+#if TARGET_OS_IOS
+#pragma mark - Shaders
+//Base Line Render Shaders
+extern NSString *const kBaseRenderVertexShaderString;
+extern NSString *const kBaseRenderFrangmentShaderString1;
+extern NSString *const kBaseRenderFrangmentShaderString2;
+
+//Line Render Shaders
+extern NSString *const kLineRenderNormalVertexShaderString;
+extern NSString *const kLineRenderNormalFrangmentShaderString;
+
+//Smudge Render Shaders
+extern NSString *const kSmudgeRenderSmudgeVertexShaderString;
+extern NSString *const kSmudgeRenderSmudgeFrangmentShaderString;
+
+//Image Render Shaders
+extern NSString *const kImageRenderVertexShaderString;
+#endif
+
+#endif

+ 23 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/ESShaderTools.h

@@ -0,0 +1,23 @@
+//
+//  ESShaderTools.h
+//  KMDrawViewDemo
+//
+//  Created by dongyongzhu on 16/2/25.
+//  Copyright © 2016年 kdanmobile. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface ESShaderTools : NSObject
+
+/** 通过MainBundle 内文件名加载着色器代码
+ NOTE:必须是相对主Bundle的名称
+ */
++ (NSString *)readFile:(NSString *)name;
+
+/** 通过MainBundle内文件路径加载着色器代码
+ NOTE:必须是相对主Bundle的文件路径
+ */
++ (NSString *)readFileWithPath:(NSString*)path;
+
+@end

+ 29 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/ImageRenderFSHs.h

@@ -0,0 +1,29 @@
+//
+//  ImageRenderFSHs.h
+//  KMDrawViewDemo
+//
+//  Created by dongyongzhu on 15/12/21.
+//  Copyright © 2015年 kdanmobile. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#define String(x) #x
+#define ShaderString(text) @ String(text)
+
+#define AvailableShaderString(ShaderString, DefaultShaderString) (ShaderString?ShaderString:DefaultShaderString)
+
+#define AdjustShaderString(string)  [string stringByReplacingOccurrencesOfString:@"_Bool" withString:@"bool"]
+
+@interface ImageRenderFSH : NSObject
+
++ (NSString *)behindFSHString;
++ (NSString *)brightnessFSHString;
++ (NSString *)eraseFSHString;
++ (NSString *)multiplyFSHString;
++ (NSString *)normalFSHString;
++ (NSString *)replaceFSHString;;
++ (NSString *)resetFSHString;
++ (NSString *)tarnishFSHString;
+
+@end

+ 147 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/KMBrushManager.h

@@ -0,0 +1,147 @@
+//
+//  KMBrushManager.h
+//  GreatPainter
+//
+//  Created by kdanmobile13 on 13-1-29.
+//  Copyright (c) 2013年 Liuyu. All rights reserved.
+//
+
+#ifndef KM_Brush_Manager
+#define KM_Brush_Manager
+
+#import <Foundation/Foundation.h>
+
+#if TARGET_OS_IOS
+#import <UIKit/UIKit.h>
+#else
+#import <AppKit/AppKit.h>
+#import "UIColor+Mac.h"
+#import "UIImage+Mac.h"
+#endif//TARGET_OS_IOS
+
+#import "KMDrawView.h"
+
+
+#pragma mark - Data Parse
+extern NSString *const kBrushNameKey;
+extern NSString *const kBrushVersionKey;
+extern NSString *const kBrushParamsKey;
+extern NSString *const kBrushCreatorNameKey;
+extern NSString *const kBrushCreatTimeKey;
+
+extern NSString *const kBrushParamMethodValueKey;
+extern NSString *const kBrushParamIDValueKey;
+extern NSString *const kBrushParamPropertyValueKey;
+extern NSString *const kBrushParamPropertyTypeKey;
+
+
+#define ParamIDOfParam(param)               [[param valueForKey:kBrushParamIDValueKey] integerValue]
+#define ParamMethodOfParam(param)           [param valueForKey:kBrushParamMethodValueKey]
+#define ParamPropertyValueOfParam(param)    [param valueForKey:kBrushParamPropertyValueKey]
+#define ParamTypeOfParam(param)             [[param valueForKey:kBrushParamPropertyTypeKey] integerValue]
+
+
+@interface KMBrushManager : NSObject
+
+/** 获取DrawView的笔刷配置
+ @param drawView    指定待保存参数的绘图控件
+ @return 参数列表
+ */
++ (NSArray*)paramsOfDrawView:(KMDrawView*)drawView;
+
+//Save 绘图控件当前笔刷参数
+/** 保存笔刷
+ @param drawView    指定待保存参数的绘图控件
+ @param brushName   参数对应笔刷名称
+ @param path        笔刷保存文件名
+ */
++ (void)saveParamsWithDrawView:(KMDrawView*)drawView
+                      withName:(NSString*)brushName
+                        inPath:(NSString*)path;
+
+//设置参数,kbrPath 为 kbr(KdanMobile Brush Resource)笔刷文件路径
+/** 设置绘图控件参数为 kbr 文件内最后一组笔刷参数
+ @param drawView    待设置绘图控件
+ @param kbrPath     kbr(KdanMobile Brush Resource)笔刷文件路径
+ @return 当绘图控件不存在或笔刷文件不存在(或读取失败)导致参数设置失败则返回NO,否则返回YES
+ @note `kbrPath`中笔刷配置参数中缺省项,则采用绘图控件对应参数默认值
+ */
++ (BOOL)resetDrawView:(KMDrawView*)drawView
+          withKBRFile:(NSString*)kbrPath;
+
+//设置笔刷参数,`params`参数中缺省项,则采用绘图控件对应参数默认值
+/** 设置绘图控件参数为 kbr 文件内最后一组笔刷参数
+ @param drawView    待设置绘图控件
+ @param params      kbr(KdanMobile Brush Resource)笔刷相关配置参数
+ @param version     参数版本
+ @return 当绘图控件不存在或笔刷文件不存在(或读取失败)导致参数设置失败则返回NO,否则返回YES
+ @note `params`参数中缺省项,则采用绘图控件对应参数默认值
+ */
++ (BOOL)resetDrawView:(KMDrawView *)drawView
+           withParams:(NSArray*)params
+              version:(int32_t)version;
+
+//Save Params
+/** 保存笔刷
+ @param params          笔刷参数字典
+ @param brushName   参数对应笔刷名称
+ @param path               笔刷保存文件名
+ */
++ (void)saveParams:(NSArray*)params
+           version:(int32_t)version
+          withName:(NSString*)brushName
+            inPath:(NSString*)path;
+
+//Save Params
+/** 保存笔刷
+ @param params              笔刷参数字典
+ @param brushName       参数对应笔刷名称
+ @param creatorName   参数对应笔刷创建者
+ @param creatTime       参数对应笔刷创建时间
+ @param path                   笔刷保存文件名
+ */
++ (void)saveParams:(NSArray*)params
+           version:(int32_t)version
+          withName:(NSString*)brushName
+   withCreatorName:(NSString*)creatorName
+     withCreatTime:(NSString*)creatTime
+            inPath:(NSString*)path;
+
+//笔刷信息读取
+/** 读取`kbrPath`所对应的kbr(KdanMobile Brush Resource)文件笔刷参数
+ @param kbrPath   指定读取笔刷的kbr(KdanMobile Brush Resource)笔刷参数文件
+ @return `kbrPath`笔刷文件内所有笔刷,格式如下
+ *************************************************************** 
+ brushes<NSArray> - item 1<NSDictionary> -- brushName<NSString:kBrushNameKey>
+                  |                      |
+                  |                      -- params<NSArray:kBrushParamsKey> - item 1<NSDictionary> - idValue<NSNumber:kBrushParamIDValueKey>
+                  |                                                         |                      |
+                  |                                                         |                      - propertyValue<id:kBrushParamPropertyValueKey>
+                  |                                                         |                      |
+                  |                                                         |                      - propertyType<NSNumber:kBrushParamPropertyTypeKey>
+                  |                                                         .                      |
+                  |                                                         .                      - MethodValue<NSString:kBrushParamMethodValueKey>
+                  - item 2 ...                                              .
+                  .                                                         - item n<NSDictionary>
+                  .
+                  .item 3<NSDictionary> -- creatorName<NSString:kBrushCreatorNameKey>
+                  .
+                  .item 4<NSDictionary> -- creatTime<NSString:kBrushCreatTimeKey>
+                  .
+                  - item n
+ ***************************************************************
+ */
++ (NSArray*)brushesWithKBRPath:(NSString*)kbrPath
+                       version:(int32_t*)version;
+
+//Param Value
+/**
+ */
++ (NSDictionary*)paramWithID:(NSUInteger)idValue
+                      method:(NSString*)methodValue
+               propertyValue:(id)propertyValue
+                propertyType:(NSUInteger)type;
+
+@end
+
+#endif//KM_Brush_Manager

+ 708 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/KMDrawView.h

@@ -0,0 +1,708 @@
+//
+//  KMDrawView.h
+//  KMDrawViewDemo
+//
+//  Created by zhudongyong on 13-9-23.
+//  Copyright (c) 2013年 kdanmobile. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "LineProcessTypes.h"
+#import "Recognise.h"
+#import "ESRenderTypes.h"
+#import "KMDrawViewTypes.h"
+#import "ESContextTypes.h"
+#import "TextureTypes.h"
+#import "ESShaderTools.h"
+
+#if TARGET_OS_IOS
+#import <UIKit/UIKit.h>
+#if kDigitPenEnable
+#import "PenManager.h"
+#endif//kDigitPenEnable
+#else
+#import <AppKit/AppKit.h>
+#import "UIImage+Mac.h"
+#import "UIColor+Mac.h"
+#import "UIView+Mac.h"
+#endif
+
+
+@protocol KMDrawViewDelegate;
+
+//控制参数校准
+typedef float (^ParameterAdjust)(float originValue);
+
+@interface KMDrawView : UIView
+#if kDigitPenEnable
+<PenManagerTouchEventDelegate>
+#endif
+
+#if TARGET_OS_IOS
+@property (nonatomic, readonly) UIView *touchRefView;//手势点转换View
+#endif
+
+#pragma mark - Normal
+/** 当前控件被缩放比例
+ */
+@property (nonatomic, readonly) CGSize scale;
+
+/** 当前控件初始数据大小
+ */
+@property (nonatomic, readonly) CGSize bufferSize;
+
+/** 默认自动校准被Cancel的Line,Default is true.
+ */
+@property (nonatomic) BOOL adjustCancelLine;
+
+/** 触点越界(超过KMDrawView边界),是否需要关闭线条渲染,Default is true.
+ */
+@property (nonatomic, readwrite) BOOL   shoudCancelDrawForPointBounds;
+
+/** 触点是否越界
+ */
+@property (nonatomic, readonly)  BOOL   pointBounds;
+
+#if PreModelEnable
+/** 效果预览模式,涂抹等效果时也能看到相应笔刷效果
+ */
+@property (nonatomic) BOOL      isDebug;
+#endif
+
+/** 硬件压感控制
+ */
+@property (nonatomic) BOOL      enableDevicePress;
+
+/** 压感常规值 (0,1),  `enableDevicePress` 为YES时生效。
+ */
+@property (nonatomic) float     normalPress; //default is 0.9
+
+#if EnableRecogition
+#pragma mark - Shape Recognize
+/** 设置是否开启图形识别功能,默认为关闭状态。
+ @note 目前该功能尚不可用,建议不要开启。
+ @since Available in iOS 4.3 and later.
+ */
+@property (nonatomic, readwrite) BOOL       enableRecogition;   //图形识别开关
+
+@property (nonatomic, readwrite) float      recogPointScale;    //Scale
+
+/** 设置图形识别种类`ShapeType`,默认支持ShapeTypeLine(直线)、ShapeTypeTriangle(三角形)、ShapeTypeCircle(圆)、
+ ShapeTypeEllipse(椭圆)、ShapeTypeDiarec(矩形)、ShapeTypeArrow(箭头)、ShapeTypeParallelogram(平行四边形)
+ @since Available in iOS 4.3 and later.
+ */
+@property (nonatomic, readwrite) ShapeType shapesMark;         //图形种类
+#endif//EnableRecogition
+
+
+
+/// 笔刷类型
+#pragma mark - Brush Type Setting
+//铅笔笔刷
+@property (nonatomic) ESBrushType   brushType;
+
+#pragma mark - 柳叶笔高斯模糊边缘半径
+@property (nonatomic) float gaussianRadius;
+
+/// 混合模式
+#pragma mark - Blend Type Setting
+//混合模式
+@property (nonatomic) ESLayerBlendType blendType;
+
+//混合着色器
+@property (nonatomic, copy) NSString *blendFragmentShaderString;
+#if TARGET_OS_IOS
+#pragma mark Shaders
+//主线 顶点着色器
+@property (nonatomic, copy) NSString *baselineVertexShaderString;
+//主线 片段着色器
+@property (nonatomic, copy) NSString *baselineFragmentShaderString;
+//子线 顶点着色器
+@property (nonatomic, copy) NSString *sublineVertexShaderString;
+//子线 片段着色器
+@property (nonatomic, copy) NSString *sublineFragmentShaderString;
+#endif
+
+
+/// 常用参数
+#pragma mark - Common Parameters Setting
+//颜色
+@property (nonatomic, retain) UIColor *renderColor;
+//不透明度, [0, 1], default is 1.
+@property (nonatomic) float opacity;
+/** 线半径
+ */
+@property (nonatomic) float radius;
+//流量, [0, 1], default is 1.
+@property (nonatomic) float flow;
+/** 点延迟
+ */
+@property (nonatomic) NSUInteger  trackNum;
+
+///涂抹类型笔刷
+#pragma mark - Smudge Parameters
+//潮湿
+@property (nonatomic) float moistQuantity;
+//载入
+@property (nonatomic) float loadQuantity;
+//混合
+@property (nonatomic) float mixQuantity;
+//涂抹渐隐控制
+@property (nonatomic) BOOL  smudgeControl;
+//控制值
+@property (nonatomic) float smudgeControlValue;
+
+
+/// 笔刷纹理
+#pragma mark - Texture
+//纹理类型,除TextureTypeNormal外均为矢量纹理
+@property (nonatomic) TextureType   textureType;
+
+//硬度
+@property (nonatomic) float         hardness;
+
+/** 矢量笔刷相关控制参数
+ TextureTypeNormal      无
+ TextureTypeCircle       无
+ TextureTypeRing         圆环半径
+ TextureTypeRectangle    宽高比
+ */
+@property (nonatomic) float         textureControlValue;
+
+/**笔刷贴图,纹理
+ */
+//@property (nonatomic, retain) UIImage   *textureImage;
+@property (nonatomic, retain) NSArray   *textureImages;
+
+///Flip
+/** X 方向翻转
+ */
+@property (nonatomic) BOOL flipX;
+/** Y 方向翻转
+ */
+@property (nonatomic) BOOL flipY;
+
+#pragma mark - Mask
+/// 遮罩
+/** 是否允许遮罩
+ */
+@property (nonatomic) BOOL needMaskTexture;
+/** 遮罩纹理
+ */
+@property  (nonatomic) float    maskScale;
+/** 遮罩纹理
+ */
+@property (nonatomic, strong) UIImage *maskImage;
+
+
+///常规参数设置
+#pragma mark - Base Setting
+
+/** 是否开启点间距控制,关闭则仅画获取到的Touch点
+ */
+@property (nonatomic) BOOL pointsDistanceEnabled;
+/** 点间距 [0.01, n]
+ */
+@property (nonatomic) float pointsDistance;
+//Smooth:平滑
+@property (nonatomic) BOOL smoothEnabled;
+/** 速度敏感因子
+ */
+@property (nonatomic) float speedSencitive;
+/** 触控灵敏度
+ */
+@property (nonatomic) float sensitivity;
+//真彩纹理
+@property (nonatomic) BOOL colorFul;
+//细尺寸处理方式
+@property (nonatomic, readwrite) ESLineProcessType  lineProcessType;
+
+
+///控制
+#pragma mark - 控制
+#pragma mark 尺寸控制
+/** 最小半径
+ */
+@property (nonatomic) float minRadius;
+/** 最小半径
+ */
+@property (nonatomic) float maxRadius;
+/** 初始半径
+ */
+@property (nonatomic) float startRadius;
+/** 起始点控制
+ */
+@property (nonatomic) float strokeControlValue;
+/** 线条结束点半径
+ */
+@property (nonatomic) float endRadius;
+/** 半径抖动,(0, 1]
+ */
+@property (nonatomic) float radiusTingle;
+/** 半径控制
+ */
+@property (nonatomic) LPControlParams radiusControl;
+
+#pragma mark 位置控制
+//两轴
+@property (nonatomic) BOOL disTwoAxes;
+//散布
+@property (nonatomic) float distribution;
+/** 散布控制
+ */
+@property (nonatomic) LPControlParams distributionControl;
+
+#pragma mark 渲染数量控制
+//数量
+@property (nonatomic) float distributionCount;
+//数量抖动
+@property (nonatomic) float distributionCountTingle;
+//散布数量控制
+@property (nonatomic) LPControlParams distributionCountControl;
+
+#pragma mark - 角度控制
+//***************** 线半径 *****************
+/** 纹理角度, [-M_PI, M_PI], default is 0.0 .
+ */
+@property (nonatomic) float radian;
+/** 线条初始方向
+ */
+@property (nonatomic) BOOL startRadianEnable;
+/** 纹理方向跟随线条方向
+ */
+@property (nonatomic) BOOL moveRadianEnable;
+
+//***************** Flip Tingle *****************
+/** X 方向翻转抖动
+ */
+@property (nonatomic) BOOL flipXTingle;
+/** Y 方向翻转抖动
+ */
+@property (nonatomic) BOOL flipYTingle;
+///角度控制
+//***************** 角度控制 *****************
+/** 角度抖动, [0, 1], default is 0.0 .
+ */
+@property (nonatomic) float radianTingle;
+//角度控制
+@property (nonatomic) LPControlParams radianControl;
+
+#pragma mark - 圆度控制
+/** 圆度, (0.1, 1], default is 1.0 .
+ */
+@property (nonatomic) float roundness;
+/** 圆度抖动,(0, 1],default is 0.0 .
+ */
+@property (nonatomic) float roundnessTingle;
+/** 最小圆度,[0, 1], default is 0.
+ */
+@property (nonatomic) float minRoundness;
+/** 圆度控制
+ */
+@property (nonatomic) LPControlParams roundnessControl;
+
+#pragma mark - 流量控制
+/** 最小流量, [0, 1], default is 0.01
+ */
+@property (nonatomic) float minFlow;
+/** 最大流量, [0, 1], default is 0.01
+ */
+@property (nonatomic) float maxFlow;
+/** 流量抖动, [0, 1], default is 0.
+ */
+@property (nonatomic) float flowTingle;
+/** 流量控制
+ */
+@property (nonatomic) LPControlParams flowControl;
+/** 衰减,[0,1000]
+ */
+@property (nonatomic) float decay;
+
+#pragma mark - 纹理控制
+//纹理抖动
+@property (nonatomic) BOOL textureTingleEnabled;
+//纹理控制
+@property (nonatomic) LPControlParams textureControl;
+
+#pragma mark - 颜色控制
+//背景色
+@property (nonatomic, retain) UIColor *backRenderColor;
+/**  前景/背景动态, [0, 1], default is 0
+ */
+@property (nonatomic) float colorTingle;
+/** 颜色抖动控制
+ */
+@property (nonatomic) LPControlParams colorControl;
+
+#pragma mark - HSB 抖动
+/** hue 抖动, [0, 1], default is 0.
+ */
+@property (nonatomic) float hueTingle;
+/** 饱和度抖动, [0, 1], default is 0.
+ */
+@property (nonatomic) float saturationTingle;
+/** 亮度抖动, [0, 1], default is 0.
+ */
+@property (nonatomic) float brightnessTingle;
+
+#pragma mark - 双重画笔
+@property (nonatomic) BOOL repeatedlyRenderEnabled;
+@property (nonatomic, retain) UIImage   *slTextureImage;
+// radius
+@property (nonatomic) float slRadius;
+// pointsDistance
+@property (nonatomic) float slPointsDistance;
+// distribution
+@property (nonatomic) float slDistribution;
+//两轴
+@property (nonatomic) BOOL slDistbTwoAxes;
+//数量
+@property (nonatomic) float slDistbCount;
+//半径关联类型
+@property (nonatomic) ESRadiusRelationType slRadiusRelationType;
+//关联值
+@property (nonatomic) float relationValue;
+
+#pragma mark - Undo
+/** 被修改过的标志(自上次保存后,是否有执行过编辑、画点、贴图等操作)
+ @since Available in iOS 4.3 and later.
+ */
+@property (nonatomic, readonly) BOOL    edited;     //上次Mark后是否被编辑过
+
+/** 是否开启自动Mark功能,默认为NO
+ @note 开启后,`EAGLView`将自动保存每一笔操作
+ @since Available in iOS 4.3 and later.
+ */
+@property (nonatomic, readwrite) BOOL   autoMark;   //是否自动Mark,默认为NO
+
+/** 是否需要绘制Touches Cancel的线条
+ */
+@property (nonatomic, readwrite) BOOL   needCancelLine; //AutoMark为真是起作用
+
+/** Mark 图片的时间间隔,默认为0,即每一笔结束都将执行
+ @since Available in iOS 4.3 and later.
+ */
+@property (nonatomic, readwrite) float  markTimeInterval;//保存时间间隔,默认为0秒
+
+/** 设定Undo 缓存文件目录,默认为“/Library/Cache/TempDirectory”,在Reset/变更目录/程序结束后,将清空该目录
+ @since Available in iOS 4.3 and later.
+ */
+@property (nonatomic, assign) NSString  *tempDirectory;//undo redo缓存文件存储目录
+
+
+@property (nonatomic, assign) id<KMDrawViewDelegate> delegate;
+
+
+#if TARGET_OS_IOS
+- (void)setBaselineVertexShaderString:(NSString *)baselineVertexShaderString
+                 fragmentShaderString:(NSString *)baselineFragmentShaderString;
+- (void)setSublineVertexShaderString:(NSString *)sublineVertexShaderString
+                 fragmentShaderString:(NSString *)sublineFragmentShaderString;
+#endif
+
+//Draw
+- (void)clear;
+- (void)clearOnline:(BOOL)online;
+- (void)clearWithColor:(UIColor*)color online:(BOOL)online;
+
+@end
+
+
+@interface KMDrawView (KMDrawViewDrawing)
+
+- (BOOL)isLining;
+
+/// 画线
+/** 绘制指定数目的一组点
+ */
+- (CGRect)drawPoints:(LPPoint*)points count:(NSUInteger)count;
+- (CGRect)drawPoints:(LPPoint*)points count:(NSUInteger)count layerType:(ESRenderLayerType)layerType;
+
+/** 开始绘一条线
+ @param point       CGPoint类型,所捕获的点坐标
+ @param pressure    float类型,所捕获的点对应的压力值
+ @param altitude    float类型,所捕获的点对应的触控笔斜度值
+ @param online      是否在线渲染,当为YES时,渲染出来即可见
+ */
+- (void)drawingWithBeginPoint:(CGPoint)point
+                     pressure:(float)pressure
+                     altitude:(float)altitude
+                       online:(BOOL)online;
+- (void)drawingWithBeginPoint:(CGPoint)point;
+- (void)drawingWithBeginPoint:(CGPoint)point
+                       online:(BOOL)online;
+- (void)drawingWithBeginPoint:(CGPoint)point
+                     pressure:(float)pressure
+                       online:(BOOL)online;
+
+/** 获取到一个TouchMove消息
+ @param point       CGPoint类型,所捕获的点坐标
+ @param pressure    float类型,所捕获的点对应的压力值
+ @param altitude    float类型,所捕获的点对应的触控笔斜度值
+ @param online      是否在线渲染,当为YES时,渲染出来即可见
+ */
+- (void)drawingWithMoveToPoint:(CGPoint)point
+                      pressure:(float)pressure
+                      altitude:(float)altitude
+                        online:(BOOL)online;
+- (void)drawingWithMoveToPoint:(CGPoint)point;
+- (void)drawingWithMoveToPoint:(CGPoint)point
+                        online:(BOOL)online;
+- (void)drawingWithMoveToPoint:(CGPoint)point
+                      pressure:(float)pressure
+                        online:(BOOL)online;
+
+/** 获取到一个TouchEnd消息
+ @param point       CGPoint类型,所捕获的点坐标
+ @param pressure    float类型,所捕获的点对应的压力值
+ @param altitude    float类型,所捕获的点对应的触控笔斜度值
+ @param online      是否在线渲染,当为YES时,渲染出来即可见
+ */
+- (void)drawingWithEndPoint:(CGPoint)point
+                   pressure:(float)pressure
+                   altitude:(float)altitude
+                     online:(BOOL)online;
+- (void)drawingWithEndPoint:(CGPoint)point;
+- (void)drawingWithEndPoint:(CGPoint)point
+                     online:(BOOL)online;
+- (void)drawingWithEndPoint:(CGPoint)point
+                   pressure:(float)pressure
+                     online:(BOOL)online;
+
+@end
+
+
+#pragma mark - Image
+@interface KMDrawView (Image)
+
+/// 获取图片
+
+//获取已绘制图片
+- (UIImage*)image;
+
+/** 获取指定区域图片
+ @param rect 设定待获取图片的区域
+ @return 获取指定区域的图片
+ @since Available in iOS 4.3 and later.
+ */
+- (UIImage*)imageWithRect:(CGRect)rect;
+
+/** 获取指定区域图片
+ @param rect 设定待获取图片的区域
+ @return 获取指定区域的图片
+ @since Available in iOS 4.3 and later.
+ */
+- (CGImageRef)newCGImageWithRect:(CGRect)rect;
+
+/** 获取指定区域图片数据,获取指定区域的图片数据,RGBA类型
+ @param data Input 指定待读入的数据地址
+ @param rect 设定待获取图片数据的区域
+ @since Available in iOS 4.3 and later.
+ */
+- (void)readData:(void*)data rect:(CGRect)rect;
+- (void)readData:(void*)data bufferRect:(CGRect)rect;
+//
+///** 获取RGB数据, pix * 3
+// @param data Input 指定待读入的数据地址
+// @param rect 设定待获取图片数据的区域
+// @return 获取指定区域的图片数据,RGBA类型
+// @since Available in iOS 4.3 and later.
+// */
+//- (void)readRGBData:(void*)data rect:(CGRect)rect;
+//
+///** 获取Alpha数据 pix * 1
+// @param data Input 指定待读入的数据地址
+// @param rect 设定待获取图片数据的区域
+// @return 获取指定区域的图片数据,RGBA类型
+// @since Available in iOS 4.3 and later.
+// */
+//- (void)readAlphaData:(void*)data rect:(CGRect)rect;
+//
+
+/// 贴(设置)图片
+
+/** 用Cover方式在原有图像上面贴图
+ @param image 待贴图的图片,如果图片为空,则不会做任何事情。
+ @param rect 待贴图的位置及区域
+ @since Available in iOS 4.3 and later.
+ */
+- (void)drawImage:(UIImage*)image inRect:(CGRect)rect;
+
+/** 采用Cover方式使用Image数据在原有图像上面贴图
+ @param imageData 待贴图的图片的数据,是从`CGContextRef`拿出来的RGBA bytes数据,如果数据为空,则不会做任何事情。
+ @param dataSize 待贴图的图片的尺寸(宽、高)。
+ @param rect 待贴图的位置及区域
+ @note 在不考虑其它(图片转数据)因素,同样大小的图片,采用`drawData:dataSize:rect:`方法效率比`drawImage:rect:`更好。例如内嵌的`ImageUndoManager`采用数据比采用`UIImage`快近20倍。
+ @since Available in iOS 4.3 and later.
+ */
+- (void)drawData:(unsigned char*)imageData dataSize:(CGSize)dataSize inRect:(CGRect)rect;
+
+/** 采用Cover方式使用Image在原有图像上面贴旋转图
+ @param image 待贴图的图片,如果image为空,则不会做任何事情。
+ @param size 待贴图的区域的大小。
+ @param center 待贴图的中心位置。
+ @param radian 图片旋转角度。如果角度为 0 时,效果同`drawImage:rect:`。
+ @since Available in iOS 4.3 and later.
+ */
+- (void)drawImage:(UIImage *)image inSize:(CGSize)size atCenter:(CGPoint)center radian:(float)radian;
+
+- (void)drawImage:(UIImage *)image inSize:(CGSize)size atCenter:(CGPoint)center radian:(float)radian anchorPoint:(CGPoint)archoPoint;
+
+/** 采用Cover方式使用Image数据在原有图像上面贴旋转图
+ @param imageData 待贴图的图片的数据,是从`CGContextRef`拿出来的RGBA bytes数据,如果数据为空,则不会做任何事情。
+ @param dataSize 待贴图的图片的尺寸(宽、高)。
+ @param size 待贴图的区域的大小。
+ @param center 待贴图的中心位置。
+ @param radian 图片旋转角度。如果角度为0时,效果同`drawData:dataSize:rect:`。
+ @since Available in iOS 4.3 and later.
+ */
+- (void)drawData:(unsigned char*)imageData dataSize:(CGSize)dataSize inSize:(CGSize)size atCenter:(CGPoint)center radian:(float)radian;
+
+/** 用Replace方式替换原图
+ @param image 待贴图的图片,如果图片为空,则不会做任何事情。
+ @param rect 待替换的位置及区域
+ @since Available in iOS 4.3 and later.
+ */
+- (void)setImage:(UIImage*)image inRect:(CGRect)rect;
+- (void)setImage:(UIImage*)image inBufferRect:(CGRect)bufferRect;
+
+/** 采用Replace方式使用Image数据替换指定区域的图片
+ @param imageData 待贴图的图片的数据,是从`CGContextRef`拿出来的RGBA bytes数据,如果数据为空,则不会做任何事情。
+ @param dataSize 待贴图的图片的尺寸(宽、高)。
+ @param rect 待贴图的位置及区域
+ @since Available in iOS 4.3 and later.
+ */
+- (void)setData:(unsigned char*)imageData dataSize:(CGSize)dataSize inRect:(CGRect)rect;
+- (void)setData:(unsigned char*)imageData
+       dataSize:(CGSize)dataSize
+         inRect:(CGRect)rect
+         isUndo:(BOOL)undo;
+
+/** 采用Replace方式使用Image替换原有旋转矩形区域内的图
+ @param image 待贴图的图片,如果image为空,则不会做任何事情。
+ @param size 待贴图的区域的大小。
+ @param center 待贴图的中心位置。
+ @param radian 图片旋转角度。如果角度为0时,效果同`setImage:rect:`。
+ @since Available in iOS 4.3 and later.
+ */
+- (void)setImage:(UIImage *)image inSize:(CGSize)size atCenter:(CGPoint)center radian:(float)radian;
+
+/** 采用Replace方式使用Image数据替换旋转矩形区域内的图
+ @param imageData 待贴图的图片的数据,是从`CGContextRef`拿出来的RGBA bytes数据,如果数据为空,则不会做任何事情。
+ @param dataSize 待贴图的图片的尺寸(宽、高)。
+ @param size 待贴图的区域的大小。
+ @param center 待贴图的中心位置。
+ @param radian 图片旋转角度。如果角度为0时,效果同`setData:dataSize:rect:`。
+ @since Available in iOS 4.3 and later.
+ */
+- (void)setData:(unsigned char *)imageData dataSize:(CGSize)dataSize inSize:(CGSize)size atCenter:(CGPoint)center radian:(float)radian;
+
+@end
+
+#pragma mark - UndoManager
+@interface KMDrawView (UndoManager)
+
+/* 标记当前图片
+ */
+- (NSData*)markAction;
+
+/* 最新Mark的图片
+ */
+- (UIImage*)currentImage;
+
+/** 检测是否可以Undo
+ @return 可以Undo则返回YES,反之返回NO
+ @since Available in iOS 4.3 and later.
+ */
+- (BOOL)canUndo;
+
+/** 撤销上一步操作
+ @since Available in iOS 4.3 and later.
+ */
+- (NSData*)undo;
+
+/** 检测是否可以Redo
+ @return 可以Redo则返回YES,反之返回NO
+ @since Available in iOS 4.3 and later.
+ */
+- (BOOL)canRedo;
+
+/** 重做最后一次撤销的操作
+ @since Available in iOS 4.3 and later.
+ */
+- (NSData*)redo;
+
+/** 重置 Undo Manager
+ @since Available in iOS 4.3 and later.
+ */
+- (NSData*)resetUndoManager;
+
+- (NSData*)loadUndoManager;
+
+@end
+
+
+#if EnableRecogition
+#pragma mark - Recogition
+@interface KMDrawView (Recogition)
+
+- (void)freeShapeMemory:(OutputShape)shape;
+
+- (BOOL)drawShape:(OutputShape)shape;
+
+@end
+#endif
+
+
+#pragma mark - DataSave
+@interface KMDrawView (DataSave)
+
+@end
+
+
+#pragma mark - Radius Adjust
+@interface KMDrawView (Radius)
+
+- (float)inRadiusForRadius:(float)radius;
+
+- (float)radiusForInRadius:(float)inRadius;
+
+@end
+
+@interface KMDrawView (BrushSetting)
+
+- (void)resetParams;
+
+- (BOOL)resetWithParams:(NSArray*)params
+                version:(int32_t)version;
+
+- (BOOL)resetWithKBRPath:(NSString*)kbrPath;
+
+@end
+
+#pragma mark - KMDrawViewDelegate
+@protocol KMDrawViewDelegate <NSObject>
+@optional
+/// 触控点控制
+//Begin 点修正
+- (CGPoint)drawView:(KMDrawView *)drawView shouldDrawBegin:(CGPoint)point;
+//Move 点修正
+- (CGPoint)drawView:(KMDrawView *)drawView shouldDrawMove:(CGPoint)point;
+//End 点修正
+- (CGPoint)drawView:(KMDrawView *)drawView shouldDrawEnd:(CGPoint)point;
+
+/// 触控点反馈
+- (void)drawView:(KMDrawView *)drawView willDrawBegin:(CGPoint)point;
+- (void)drawView:(KMDrawView *)drawView didDrawBegin:(CGPoint)point;
+
+- (void)drawView:(KMDrawView *)drawView willDrawMove:(CGPoint)point;
+- (void)drawView:(KMDrawView *)drawView didDrawMove:(CGPoint)point;
+
+- (void)drawView:(KMDrawView *)drawView willDrawEnd:(CGPoint)point;
+- (void)drawView:(KMDrawView *)drawView didDrawEnd:(CGPoint)point;
+
+/// Undo/Redo 状态反馈
+- (void)drawView:(KMDrawView *)drawView didUpdateUndoStatus:(BOOL)enable;
+- (void)drawView:(KMDrawView *)drawView didUpdateRedoStatus:(BOOL)enable;
+
+@end

+ 18 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/KMDrawViewSDK_Mac.h

@@ -0,0 +1,18 @@
+//
+//  KMDrawViewSDK_Mac.h
+//  KMDrawViewSDK_Mac
+//
+//  Created by 朱东勇 on 2017/10/18.
+//  Copyright © 2017年 kdanmobile. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+//! Project version number for KMDrawViewSDK_Mac.
+FOUNDATION_EXPORT double KMDrawViewSDK_MacVersionNumber;
+
+//! Project version string for KMDrawViewSDK_Mac.
+FOUNDATION_EXPORT const unsigned char KMDrawViewSDK_MacVersionString[];
+
+#import "KMBrushManager.h"
+#import "KMDrawView.h"

+ 258 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/KMDrawViewTypes.h

@@ -0,0 +1,258 @@
+//
+//  KMDrawViewTypes.h
+//  KMEAGLViewDemo
+//
+//  Created by zhudongyong on 13-9-23.
+//  Copyright (c) 2013年 kdanmobile. All rights reserved.
+//
+
+#ifndef KMEAGLViewDemo_KMDrawViewTypes_h
+#define KMEAGLViewDemo_KMDrawViewTypes_h
+
+/// 框架导出 宏定义
+#pragma mark - 框架导出 宏定义
+// 绘图图形识别
+#define EnableRecogition    1 //开启图形识别
+// 数位笔&触控笔支持
+#define kDigitPenEnable     (1 && TARGET_OS_IOS)//(数位笔)
+// 平台捆绑
+#define kPlatformBinding    0
+
+///数位笔相关配置
+#if kDigitPenEnable
+//是否支持 Adoint 公司触控笔
+#define kEnableJotPen       1
+//是否支持 Pogo 公司触控笔
+#define kEnablePogoPen      1
+//是否支持 Hex3 公司触控笔
+#define kEnableJajaPen      0
+//是否支持 Wacom 触控笔
+#define kEnableWacomPen     1
+
+#if kEnableJotPen
+//防误触功能,JotTouch
+#define kRejectModeEnable   1
+#endif//kEnableJotPen
+
+#endif//kDigitPenEnable
+
+
+/// 后台打印信息 宏定义
+#pragma mark - 后台打印信息 宏定义
+#ifndef KMPLog
+#if DEBUG
+#define KMPLog(...) NSLog(__VA_ARGS__)
+#else
+#define KMPLog(...) {}
+#endif//DEBUG
+#endif//KMPLog
+
+#ifndef KMPPrintf
+#if DEBUG
+#define KMPPrintf(...) printf(__VA_ARGS__)
+#else
+#define KMPPrintf(...) {}
+#endif//DEBUG
+#endif//KMPPrintf
+
+
+///形状识别 Shape Recognizer
+#if EnableRecogition
+#pragma mark - Shape Recognizer
+/**
+ //ShapeTypeLine            :<LineOutput>       line
+ //ShapeTypeTriangle        :<TriangleOutput>   triangle
+ //ShapeTypeCircle          :<CircleOutput>     circle
+ //ShapeTypeEllipse         :<EllipseOutput>    ellipse
+ //ShapeTypeDiarec          :<DiaRecOutput>     diarec
+ //ShapeTypeFoldLine        :<FoldLineType>     foldLineOutput
+ //ShapeTypeCurve           :<CurveType>        curveOutput
+ //ShapeTypeArrow           :<ArrowType>        arrowOutput
+ //ShapeTypeParallelogram   :<TypeParallelogram>   parallelogram
+ */
+typedef enum {
+    ShapeTypeUnknow         = 0,     //未知图形
+    ShapeTypeLine           = 0x0001,//直线
+    ShapeTypeTriangle       = 0x0002,//三角形
+    ShapeTypeCircle         = 0x0004,//圆
+    ShapeTypeEllipse        = 0x0008,//椭圆
+    ShapeTypeDiarec         = 0x0010,//矩形
+    ShapeTypeFoldLine       = 0x0020,//多段线
+    ShapeTypeDiamond        = 0x0040,//不规则四边形
+    ShapeTypeCurve          = 0x0080,//曲线
+    ShapeTypeArrow          = 0x0100,//箭头
+    ShapeTypeParallelogram  = 0x0200,//平行四边形
+    ShapeTypeArrowsystem    = 0x0400,//坐标系
+    ShapeTypeAllShapes      = 0xffff,//所有图形
+}ShapeType;
+#endif
+
+
+/** 角度控制类型,用于控制图形绘制线条上点的角度变化的控制方式
+ ESRadianControlTypeNone              不对线条上的点进行旋转角度控制
+ ESRadianControlTypeDissolving        对线条上的点旋转角度进行渐隐控制
+ ESRadianControlTypeIncreasing        对线条上的点旋转角度进行渐增控制
+ ESRadianControlTypeMixPressure       对线条上的点旋转角度进行压力速度混合控制
+ ESRadianControlTypeOppMixPressure    线条粗细随着压力变大,画线速度变慢,线越细。反之越粗。
+ ESRadianControlTypeStartRadian
+ ESRadianControlTypeMoveRadian
+ ESRadianControlTypeMixAltitude
+ ESRadianControlTypeOppMixAltitude
+ ESRadianControlTypePurePressure
+ ESRadianControlTypeOppPurePressure
+ ESRadianControlTypePureAltitude
+ ESRadianControlTypeOppPureAltitude
+ ESRadianControlTypePenWheel
+ ESRadianControlTypeRotate
+ */
+typedef NS_ENUM(NSUInteger, ESRadianControlType) {
+    ESRadianControlTypeNone             = 0,    //关闭
+    ESRadianControlTypeDissolving       = 1,    //渐隐
+    ESRadianControlTypeIncreasing       = 2,    //渐强
+    ESRadianControlTypeMixPressure      = 3,    //混合压力控制
+    ESRadianControlTypeOppMixPressure   = 4,    //混合压力控制反向
+    ESRadianControlTypeStartRadian      = 5,    //初始方向
+    ESRadianControlTypeMoveRadian       = 6,    //线条方向
+    ESRadianControlTypeMixAltitude      = 7,    //混合斜度,需触控笔支持
+    ESRadianControlTypeOppMixAltitude   = 8,    //混合斜度反向,需触控笔支持
+    ESRadianControlTypePurePressure     = 9,    //纯压力控制
+    ESRadianControlTypeOppPurePressure  = 10,   //纯压力控制反向
+    ESRadianControlTypePureAltitude     = 11,   //纯斜度,需触控笔支持
+    ESRadianControlTypeOppPureAltitude  = 12,   //纯斜度反向,需触控笔支持
+#if !TARGET_OS_IOS
+    ESRadianControlTypePenWheel         = 13,    //光笔轮,需触控笔支持
+    ESRadianControlTypeRotate           = 14,    //旋转,需触控笔支持
+#endif
+};
+
+typedef NS_ENUM(NSUInteger, ESRoundnessControlType) {
+    ESRoundnessControlTypeNone              = 0,    //关闭
+    ESRoundnessControlTypeDissolving        = 1,    //渐隐
+    ESRoundnessControlTypeIncreasing        = 2,    //渐强
+    ESRoundnessControlTypeMixPressure       = 3,    //混合压力控制
+    ESRoundnessControlTypeOppMixPressure    = 4,    //混合压力控制反向
+    ESRoundnessControlTypeMixAltitude       = 5,    //混合斜度,需触控笔支持
+    ESRoundnessControlTypeOppMixAltitude    = 6,    //混合斜度反向,需触控笔支持
+    ESRoundnessControlTypePurePressure      = 7,    //纯压力控制
+    ESRoundnessControlTypeOppPurePressure   = 8,    //纯压力控制反向
+    ESRoundnessControlTypePureAltitude      = 9,    //纯斜度,需触控笔支持
+    ESRoundnessControlTypeOppPureAltitude   = 10,   //纯斜度反向,需触控笔支持
+#if !TARGET_OS_IOS
+    ESRoundnessControlTypePenWheel          = 11,    //光笔轮,需触控笔支持
+    ESRoundnessControlTypeRotate            = 12,    //旋转,需触控笔支持
+#endif
+};
+
+typedef NS_ENUM(NSUInteger, ESColorControlType) {
+    ESColorControlTypeNone              = 0,        //关闭
+    ESColorControlTypeDissolving        = 1,        //渐隐
+    ESColorControlTypeIncreasing        = 2,        //渐强
+    ESColorControlTypeMixPressure       = 3,        //混合压力控制
+    ESColorControlTypeOppMixPressure    = 4,        //混合压力控制反向
+    ESColorControlTypeMixAltitude       = 5,        //混合斜度,需触控笔支持
+    ESColorControlTypeOppMixAltitude    = 6,        //混合斜度反向,需触控笔支持
+    ESColorControlTypePurePressure      = 7,        //纯压力控制
+    ESColorControlTypeOppPurePressure   = 8,        //纯压力控制反向
+    ESColorControlTypePureAltitude      = 9,        //纯斜度,需触控笔支持
+    ESColorControlTypeOppPureAltitude   = 10,       //纯斜度反向,需触控笔支持
+#if !TARGET_OS_IOS
+    ESColorControlTypePenWheel          = 11,        //光笔轮,需触控笔支持
+    ESColorControlTypeRotate            = 12,        //旋转,需触控笔支持
+#endif
+};
+
+typedef NS_ENUM(NSUInteger, ESDistributionControlType) {
+    ESDistributionControlTypeNone               = 0,   //关闭
+    ESDistributionControlTypeDissolving         = 1,   //渐隐
+    ESDistributionControlTypeIncreasing         = 2,   //渐强
+    ESDistributionControlTypeMixPressure        = 3,   //混合压力控制
+    ESDistributionControlTypeOppMixPressure     = 4,   //混合压力控制反向
+    ESDistributionControlTypeMixAltitude        = 5,   //斜度混合,需触控笔支持
+    ESDistributionControlTypeOppMixAltitude     = 6,   //斜度混合反向,需触控笔支持
+    ESDistributionControlTypePurePressure       = 7,   //纯压力控制
+    ESDistributionControlTypeOppPurePressure    = 8,   //纯压力控制反向
+    ESDistributionControlTypePureAltitude       = 9,   //纯斜度,需触控笔支持
+    ESDistributionControlTypeOppPureAltitude    = 10,  //纯斜度反向,需触控笔支持
+#if !TARGET_OS_IOS
+    ESDistributionControlTypePenWheel           = 11,   //光笔轮,需触控笔支持
+    ESDistributionControlTypeRotate             = 12,   //旋转,需触控笔支持
+#endif
+};
+
+typedef NS_ENUM(NSUInteger, ESDistributionCountControlType) {
+    ESDistributionCountControlTypeNone              = 0,      //关闭
+    ESDistributionCountControlTypeDissolving        = 1,      //渐隐
+    ESDistributionCountControlTypeIncreasing        = 2,      //渐强
+    ESDistributionCountControlTypeMixPressure       = 3,      //压力混合控制
+    ESDistributionCountControlTypeOppMixPressure    = 4,      //压力混合控制反向
+    ESDistributionCountControlTypeMixAltitude       = 5,      //斜度混合,需触控笔支持
+    ESDistributionCountControlTypeOppMixAltitude    = 6,      //斜度混合反向,需触控笔支持
+    ESDistributionCountControlTypePurePressure      = 7,      //纯压力控制
+    ESDistributionCountControlTypeOppPurePressure   = 8,      //纯压力控制反向
+    ESDistributionCountControlTypePureAltitude      = 9,      //纯斜度,需触控笔支持
+    ESDistributionCountControlTypeOppPureAltitude   = 10,     //纯斜度反向,需触控笔支持
+#if !TARGET_OS_IOS
+    ESDistributionCountControlTypePenWheel          = 11,      //光笔轮,需触控笔支持
+    ESDistributionCountControlTypeRotate            = 12,      //旋转,需触控笔支持
+#endif
+};
+
+typedef NS_ENUM(NSUInteger, ESLineFrontTextureControlType) {
+    ESLineFrontTextureControlTypeNone               = 0,     //关闭
+    ESLineFrontTextureControlTypeDissoloving        = 1,     //渐隐
+    ESLineFrontTextureControlTypeIncreasing         = 2,     //渐强
+    ESLineFrontTextureControlTypeMixPressure        = 3,     //压力混合控制
+    ESLineFrontTextureControlTypeOppMixPressure     = 4,     //压力混合控制反向
+    ESLineFrontTextureControlTypeMixAltitude        = 5,     //斜度混合,需触控笔支持
+    ESLineFrontTextureControlTypeOppMixAltitude     = 6,     //斜度混合反向,需触控笔支持
+    ESLineFrontTextureControlTypePurePressure       = 7,     //纯压力控制
+    ESLineFrontTextureControlTypeOppPurePressure    = 8,     //纯压力控制反向
+    ESLineFrontTextureControlTypePureAltitude       = 9,     //纯斜度,需触控笔支持
+    ESLineFrontTextureControlTypeOppPureAltitude    = 10,    //纯斜度反向,需触控笔支持
+#if !TARGET_OS_IOS
+    ESLineFrontTextureControlTypePenWheel           = 11,     //光笔轮,需触控笔支持
+    ESLineFrontTextureControlTypeRotate             = 12,     //旋转,需触控笔支持
+#endif
+};
+
+typedef NS_ENUM(NSUInteger, ESOpacityControlType) {
+    ESOpacityControlTypeNone            = 0,    //关闭
+    ESOpacityControlTypeDissolving      = 1,    //渐隐
+    ESOpacityControlTypeIncreasing      = 2,    //渐强
+    ESOpacityControlTypeMixPressure     = 3,    //压力混合控制
+    ESOpacityControlTypeOppMixPressure  = 4,    //压力混合控制反向
+    ESOpacityControlTypeMixAltitude     = 5,    //斜度混合,需触控笔支持
+    ESOpacityControlTypeOppMixAltitude  = 6,    //斜度混合反向,需触控笔支持
+    ESOpacityControlTypePurePressure    = 7,    //纯压力控制
+    ESOpacityControlTypeOppPurePressure = 8,    //纯压力控制反向
+    ESOpacityControlTypePureAltitude    = 9,    //纯斜度控制,需触控笔支持
+    ESOpacityControlTypeOppPureAltitude = 10,   //纯斜度控制反向,需触控笔支持
+#if !TARGET_OS_IOS
+    ESOpacityControlTypePenWheel        = 11,    //光笔轮,需触控笔支持
+#endif
+};
+
+typedef NS_ENUM(NSUInteger, ESFlowControlType) {
+    ESFlowControlTypeNone               = 0,   //关闭
+    ESFlowControlTypeDissolving         = 1,   //渐隐
+    ESFlowControlTypeIncreasing         = 2,   //渐强
+    ESFlowControlTypeMixPressure        = 3,   //压力混合控制
+    ESFlowControlTypeOppMixPressure     = 4,   //压力混合控制反向
+    ESFlowControlTypeMixAltitude        = 5,   //斜度混合控制,需触控笔支持
+    ESFlowControlTypeOppMixAltitude     = 6,   //斜度混合控制反向,需触控笔支持
+    ESFlowControlTypePurePressure       = 7,   //纯压力控制
+    ESFlowControlTypeOppPurePressure    = 8,   //纯压力控制反向
+    ESFlowControlTypePureAltitude       = 9,   //纯斜度控制,需触控笔支持
+    ESFlowControlTypeOppPureAltitude    = 10,  //纯斜度控制反向,需触控笔支持
+#if !TARGET_OS_IOS
+    ESFlowControlTypePenWheel           = 11,   //光笔轮,需触控笔支持
+#endif
+};
+
+typedef NS_ENUM(NSUInteger, ESRadiusRelationType) {
+    ESRadiusRelationTypeNone,           //无关联
+    ESRadiusRelationTypeDifferential,   //差值关联
+    ESRadiusRelationTypeRatio,          //比值关联
+};
+
+#endif

+ 105 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/KMDrawViewVersion.h

@@ -0,0 +1,105 @@
+//
+//  KMDrawViewVersion.h
+//  KMEAGLViewDemo
+//
+//  Created by zhudongyong on 13-9-23.
+//  Copyright (c) 2013年 kdanmobile. All rights reserved.
+//
+
+#ifndef KMDrawViewVersion_h
+#define KMDrawViewVersion_h
+
+/** Init Version
+ */
+#define kMDrawViewVersion_1_0_0     @"1.0.0"
+
+/** 
+ Modify
+ 1.调整绘图模块结构
+ 2.调整涂抹部分结构
+ 3.修正iPad Air 上卡顿问题
+ 4.效率大幅提升
+ */
+#define kMDrawViewVersion_1_1_0     @"1.1.0"
+
+/** 
+ Modify
+ 1.调整涂抹功能结构
+ 2.大幅提升涂抹功能效率
+ 3.增加尺寸可变纹理,以支持细线抗锯齿
+ */
+#define KMDrawViewVersion_1_1_1     @"1.1.1"
+
+/** Modify 2014.12.11 by zhudongyong
+ 1.Pogo SDK 升级到 2.0
+ 2.触控笔支持独立设置是否支持
+ */
+#define KMDrawViewVersion_1_2_1     @"1.2.1"
+
+/** Modify by zhudongyong at 2015.01.09
+ 1.修正创建多个KMDrawView且其中一个先释放,释放后会造成其它KMDrawView 在Undo时会造成数据丢失。
+ */
+#define KMDrawViewVersion_1_2_2     @"1.2.2"
+
+/** Modify by zhudongyong at 2015.01.16
+ 1.修正KMDrawView在iOS 8上画图偶尔会Crash问题
+ */
+#define KMDrawViewVersion_1_2_3     @"1.2.3"
+
+/** Modify by zhudongyong at 2015.8.1
+ 1.修正KMDrawView初始化数据失败造成的系列Crash
+ */
+#define KMDrawViewVersion_1_2_4     @"1.2.4"
+
+/** Modify by zhudongyong at 2015.10.31
+ 1.绘图模块iPhone 6S & iPhone 6S Plus 硬件压力支持;
+ 2.绘图模块触控点半径支持;
+ 3.绘图模块渲染Crash问题修正;
+ 4.绘图模块iOS 9兼容;
+ */
+#define KMDrawViewVersion_1_3_0     @"1.3.0"
+
+/** Modify by zhudongyong at 2016.03.10
+ 1.绘图模块Apple Pencil斜度支持
+ 2.绘图模块着色器支持外部设置
+ 3.笔刷部分支持着色器设置
+ */
+#define KMDrawViewVersion_1_4_0     @"1.4.0"
+
+/** Modify by zhudongyong at 2016.04.14
+ 1.绘图模块Adonit SDK 升级到V3.1
+ 2.绘图模块自定图层渲染着色器兼容问题
+ */
+#define KMDrawViewVersion_1_4_1     @"1.4.1"
+
+/** Modify by zhudongyong at 2016.06.13
+ 1.Adonit SDK 升级到V3.1正式版本
+ 2.片段着色器算法修正
+ 3.图像绘制过程点信息导出
+ */
+#define KMDrawViewVersion_1_4_2     @"1.4.2"
+
+/** Modify by zhudongyong at 2016.06.13
+ 1.Wacom SDK 升级到V2.1.2
+ */
+#define KMDrawViewVersion_1_4_3     @"1.4.3"
+
+/** Modify by zhudongyong at 2017.10.18
+ 1.Mac SDK 支持;
+ 2.Image 着色器增加识别标识
+ */
+#define KMDrawViewVersion_1_5_0     @"1.5.0"
+
+/** Modify by zhudongyong at 2017.11.28
+ 1.涂抹相关着色器优化
+ */
+#define KMDrawViewVersion_1_5_1     @"1.5.1"
+
+/** Modify by zhudongyong at 2018.03.12
+ 1.绘图模块缩放部分优化
+ */
+#define KMDrawViewVersion_1_5_2     @"1.5.2"
+
+#define kMDrawViewLatestVersion     KMDrawViewVersion_1_5_2
+
+#endif

+ 70 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/LineProcess.h

@@ -0,0 +1,70 @@
+//
+//  LineProcess.h
+//  EAGLViewDemo
+//
+//  Created by zhudongyong on 13-9-9.
+//  Copyright (c) 2013年 zhudongyong. All rights reserved.
+//
+
+/** LineProcess 是绘图模块中用于点、线处理的一套算法库,能对里面的参数进行不同设置进而产生完全不同的效果
+ */
+
+#ifndef EAGLViewDemo_LineProcess_h
+#define EAGLViewDemo_LineProcess_h
+
+#import <stdio.h>
+#import <stdlib.h>
+#import <math.h>
+#import <time.h>
+#import "LineProcessTypes.h"
+
+/** 属性设置
+ @param type    待设置的参数类型
+ @param value   待设置的值
+ */
+LPVoid lpSetPropertyi(LPPropertyType type, int value);
+LPVoid lpSetPropertyd(LPPropertyType type, double value);
+LPVoid lpSetPropertyf(LPPropertyType type, float value);
+LPVoid lpSetPropertyb(LPPropertyType type, bool value);
+
+/** 参数值获取
+ @param type    待获取的参数类型
+ @return `type`所对应参数的值
+ */
+int     lpGetPropertyi(LPPropertyType type);
+double  lpGetPropertyd(LPPropertyType type);
+float   lpGetPropertyf(LPPropertyType type);
+bool    lpGetPropertyb(LPPropertyType type);
+
+/** 设置参数对象
+ @param obj 要设置的参数对象
+ @return 之前的参数对象
+ */
+LPParaObj* lpSetParaObj(LPParaObj *obj);
+
+/** 获取当前线条最后一小段处理后的点、尺寸值、备用属性值
+ @param points  指向各点位置数组的指针地址
+        - sizes   指向各点尺寸数组的指针地址
+        - values  指向各点备用属性值数组的指针地址
+ @return 处理所得到的点的数据
+ */
+LPUInteger lpGetLastLineSegmentPoints1V(LPPoint **points);
+
+/** 开始处理一条新线
+ @param position    新线条的起点
+ */
+LPVoid  lpStartLine(LPPosition position);
+LPVoid  lpStartLineWithPressure(LPPosition position, LPFloat pressure);
+LPVoid  lpStartLineWithParams(LPPosition position, LPFloat pressure, LPFloat ascent);
+
+LPUInteger lpAppendingLine(LPPosition position, bool isEnd);
+LPUInteger lpAppendingLineWithPressure(LPPosition position, bool isEnd, LPFloat pressure);
+LPUInteger lpAppendingLineWithParams(LPPosition position, bool isEnd, LPFloat pressure, LPFloat ascent);
+/**
+ 1:lpStartLine 0     {0,0}
+ 2:lpAppendingLine 1-2:n {10, 10}
+ 3:lpAppendingLine 2-3:n
+ lpAppendingLine
+ */
+
+#endif

+ 308 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/LineProcessTypes.h

@@ -0,0 +1,308 @@
+//
+//  LineProcessTypes.h
+//  KMDrawViewDemo
+//
+//  Created by zhudongyong on 14-3-15.
+//  Copyright (c) 2014年 kdanmobile. All rights reserved.
+//
+
+#ifndef KMDrawViewDemo_LineProcessTypes_h
+#define KMDrawViewDemo_LineProcessTypes_h
+
+#include <string.h>
+#include <stdbool.h> //C99
+#include <stddef.h>
+#include <float.h>
+
+//typedef enum {false, true} bool;
+
+#define PreModelEnable      1
+
+typedef float LPFloat;
+typedef void LPVoid;
+typedef unsigned int LPUInteger;
+typedef double LPDouble;
+typedef int LPInteger;
+typedef bool LPBool;
+
+#define LPEPS (1e-3)
+#define LQ(a,b) ((a)<(b)+LPEPS)
+#define EQ(a,b) (fabs((a)-(b))<LPEPS)
+#define GQ(a,b) ((a)>(b)-LPEPS)
+
+
+/** 点控制参数
+ */
+struct LPControlParams {
+    LPFloat pressure;   //压力控制值
+    LPFloat altitude;   //斜度altitudeAngle
+    LPFloat speed;      //速度控制值
+};
+typedef struct LPControlParams LPControlParams;
+
+#define FLOAT_ZERO              0.0000
+#define isZero(value)           (fabs(value) <= FLOAT_ZERO)
+#define isControlDisable(ctl)   (isZero(ctl.pressure) && isZero(ctl.altitude) && isZero(ctl.speed))
+
+
+/** Point 类型,与iOS 平台 CGPoint 一致
+ */
+struct LPPosition {
+    LPFloat x;
+    LPFloat y;
+};
+typedef struct LPPosition LPPosition;
+
+/**
+ */
+struct LPPoint {
+    LPPosition      position;
+    LPFloat         size;
+    LPControlParams controlParams;
+};
+typedef struct LPPoint LPPoint;
+
+typedef struct _LPTrace
+{
+    LPPoint*    points;
+    LPUInteger  number;
+    LPUInteger  volume;
+}LPTrace;
+
+
+
+
+
+/*输入信息*/
+typedef enum {LPStateBegin, LPStateBegining, LPStateDrawing, LPStateEnd} LPState;
+
+
+
+typedef enum {
+    LPControlTypeNone = 0,
+    LPControlTypeDisappear,     //渐隐,渐渐变小
+    LPControlTypeEnhance,       //渐显,渐渐变大
+    LPControlTypeMixPressure,   //混合压力,压力和速度混合控制
+    LPControlTypeInvMixPressure,//反向混合压力, 压力和速度混合控制
+    LPControlTypeMixAltitude,   //混合斜度,压力和斜度混合控制
+    LPControlTypeOppMixAltitude,//反向混合斜度,压力和斜度混合控制
+    LPControlTypePurePressure,  //压力控制
+    LPControlTypeInvPurePressure,//反向压力控制
+    LPControlTypePureAltitude,  //斜度控制
+    LPControlTypeOppPureAltitude,//反向斜度控制
+    LPControlTypeMixParams,      //压力斜度控制
+}LPControlType;
+
+
+typedef struct _LPParaObj
+{
+    //点大小,单位为像素
+    LPFloat radius;
+    
+    //是否有压力输入
+    LPBool pressureEnabled;
+    
+    //是否有斜度输入&处理
+    LPBool altitudeEnabled;
+    
+    //点间距开关,默认开
+    LPBool pointsDistanceEnabled;
+    
+    //点间距占点大小的百分比,默认为25%,范围为[1%,1000%]
+    LPFloat pointsDistancePercent;
+    
+    //点大小抖动的范围占点大小的百分比,默认为0%,此时不抖动,范围为[0,100%],最高只能在一个点大小范围内抖动
+    LPFloat radiusJitterPercent;
+//    
+//    //点的大小的动态控制类型,默认为关闭
+//    LPControlType radiusControlType;
+//    
+//    //点大小的动态控制值
+//    LPUInteger radiusControlValue;
+    // 点大小动态控制
+    LPControlParams radiusControl;
+    
+    //最小直径占点大小的百分比,默认为100%,范围为[0,100%]
+    LPFloat minRadiusPercent;
+    
+    //最大直径占点大小的百分比,默认为100%,范围为[0, 1]
+    LPFloat maxRadiusPercent;
+    
+    //平滑选项,默认为关闭状态,控制是否用贝塞尔曲线进行平滑
+    LPBool smoothEnabled;
+    
+    //速度控制敏感因子,范围为[0.0,1.0],默认为0.5
+    LPFloat speedSensitive;
+    
+    //速度控制缩放量级,范围为[10,300],默认为40,和敏感因子一起控制速度引起的点大小
+    LPFloat speedScale;
+    
+    //起始点尺寸占尺寸的百分比,默认为1,范围为[0,5],最高为5倍点大小
+    LPFloat startRadiusPercent;
+    
+    //末点尺寸占尺寸的百分比,默认为1,范围为[0,5],最高为5倍大小
+    LPFloat endRadiusPercent;
+    
+    //控制鼠标跟踪的速度,范围为[0,10],默认为0,代表即时跟踪鼠标
+    LPInteger trackParam;
+    
+    //持续距离
+    LPFloat startDurDistance;
+    
+    
+    /**
+     下面是中间状态
+     */
+    //当前画线的状态,默认为画线起始状态
+    LPState state;
+    
+    //上一个鼠标点的位置
+    LPPosition lastTouchPosition;
+    
+    //上一段的点的位置
+    LPPosition lastSegPosition;
+    
+    //上一段的中点的位置(在上一个点之前)
+    LPPosition lastSegMidPosition;
+    
+    //上一次画线所剩余的距离
+    LPFloat offsetDistance;
+    
+    //该线的当前总距离
+    LPFloat totalDistance;
+    
+    //该线的当前总点数
+    LPUInteger totalPointNum;
+    
+    //最后一个画出的点的大小
+    LPFloat lastPointRadius;
+    
+    //上一段的平均压力[0,1]
+    LPFloat lastSegPressure;
+    
+    //上一段的角度大小[0,1],折算成对应的角度[90, 0]
+    LPFloat lastSegAltitude;
+    
+    //上一段的速度大小[0,1]
+    LPFloat lastSegSpeed;
+//    
+//    //
+//    LPFloat lastSegValue;
+//    
+    //当前段的鼠标事件次数
+    LPInteger mouseTouchNum;
+    
+    //当前段的总距离
+    LPFloat segTotalDistance;
+    
+    //当前段的总压力
+    LPFloat segTotalPressure;
+    
+    //当前段的总压力
+    LPFloat segTotalAltitude;
+    
+    //上一段的长度
+    LPFloat lastSegDistance;
+    
+    //最小点间距
+    LPFloat minPointDistance;
+}LPParaObj;
+
+
+
+
+typedef enum {
+    /** 线条处理参数:未知参数类型
+     */
+    LPPropertyTypeUnknow                = 0,
+    
+    /** 线条处理参数:半径,一个float类型的参数
+     */
+    LPPropertyTypeRadius,
+    
+    /** 线条处理参数:点间距开关,一个bool型的参数
+     */
+    LPPropertyTypePointsDistanceEnabled,
+    
+    /** 线条处理参数:间距,一个float类型的参数,代表每两个点之间的间距为点得直径得百分比
+     */
+    LPPropertyTypePointsDistancePercent,
+    
+    /** 线条处理参数:形状动态开关,一个bool类型的值
+     */
+    LPPropertyTypeRadiusJitterSwitch,
+    
+    /** 线条处理参数:大小抖动,一个float类型的参数,是一个百分数,代表抖动的值为半径的百分比
+     */
+    LPPropertyTypeRadiusJitterPercent,
+    
+//    /** 线条处理参数:大小动态控制类型,一个int类型的参数
+//     */
+//    LPPropertyTypeRadiusControlType,
+//    
+//    /** 线条处理参数:大小动态控制值,一个无符号int类型的参数
+//     */
+//    LPPropertyTypeRadiusControlValue,
+    
+    /** 半径速度控制值
+     */
+    LPPropertyTypeRadiusSpeedControl,
+    /** 半径压力控制值
+     */
+    LPPropertyTypeRadiusPressControl,
+    /** 半径斜度控制值
+     */
+    LPPropertyTypeRadiusAltitudeControl,
+    
+    
+    /** 线条处理参数:最小直径
+     */
+    LPPropertyTypeMinRadiusPercent,
+    
+    /** 线条处理参数:最大直径
+     */
+    LPPropertyTypeMaxRadiusPercent,
+    
+    /** 线条处理参数:平滑选项,一个bool型的参数
+     */
+    LPPropertyTypeSmoothEnabled,
+    
+    /** 线条处理参数:控制是否反向,一个bool型的参数
+     */
+    LPPropertyTypeInverControl,
+    
+    /** 线条处理参数:速度敏感因子,一个float型的参数
+     */
+    LPPropertyTypeSpeedSensitive,
+    
+    /** 线条处理参数:速度缩放量级,一个float型的参数
+     */
+    LPPropertyTypeSpeedScale,
+    
+    /** 线条处理参数:起始点大小所占百分比,一个float型的参数
+     */
+    LPPropertyTypeStartRadiusPercent,
+    
+    /** 线条处理参数:末点大小所占百分比,一个float型的参数
+     */
+    LPPropertyTypeEndRadiusPercent,
+    
+    /** 线条处理参数:减慢鼠标跟踪速度参数,一个int型的参数
+     */
+    LPPropertyTypeTrackParam,
+    
+    /** 线条处理参数:持续距离,一个float型的参数
+     */
+    LPPropertyTypestartDurDistance,
+    
+    /** 线条处理参数:压力速度控制方式,一个无符号int型参数
+     */
+    LPPropertyTypeStyle,
+    
+    /** 线条最小点间距,默认为0.5
+     */
+    LPPropertyTypeMinPointDistance,
+}LPPropertyType;
+
+
+#endif

+ 164 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/Recognise.h

@@ -0,0 +1,164 @@
+#ifndef _RECOGNISE_H
+#define _RECOGNISE_H
+#ifndef NOMINMAX
+
+#ifndef max
+#define max(a,b)            (((a) > (b)) ? (a) : (b))
+#endif
+
+#ifndef min
+#define min(a,b)            (((a) < (b)) ? (a) : (b))
+#endif
+
+#endif  /* NOMINMAX */
+#ifndef PI
+#define PI 3.1415926
+#endif
+
+#define _DEBUG 1 
+typedef struct
+{
+	float x;
+	float y;
+}CvPoint;
+
+typedef enum       // the shape of drawing
+{
+	LINE,
+	TRIANGLE,
+	RECTANGLE,
+	CIRCLE,
+	ELLIPSE,
+	DIAMOND,
+    FOLDLINE,
+    CURVE,
+    ARROW,
+    PARALLELOGRAM,
+	UNKONWN,
+}Shape;
+
+typedef struct    //Triangle's output
+{
+	CvPoint ptA;
+	CvPoint ptB;
+	CvPoint ptC;
+}TriangleOutput;
+
+typedef struct      //line ‰≥ˆ∑µªÿ÷µΩ·ππ
+{
+	CvPoint begin;
+	CvPoint end;
+}LineOutput;
+
+typedef struct		//Circle's output
+{
+	CvPoint center;
+	int radius;
+}CircleOutput;
+
+typedef struct	  //Ellipse's output
+{
+	float width;
+	float height;
+	CvPoint center;
+	double radian;
+}EllipseOutput;
+
+typedef struct    //diamond and rectangle's output
+{
+	CvPoint ptA;
+	CvPoint ptB;
+	CvPoint ptC;
+	CvPoint ptD;
+	double radian;	
+}DiaRecOutput;
+
+typedef struct
+{
+	CvPoint ptA;
+	CvPoint ptB;
+	CvPoint ptC;
+	CvPoint ptD;
+	double thetaRotating;  //ª°∂»
+}RectangleOutPut;
+
+typedef struct
+{
+    CvPoint* inflexionPoint;
+    int iNumInflexionPoint;
+    
+} FoldLineType;
+
+typedef struct
+{
+    CvPoint lineBegin;
+    CvPoint lineEnd;
+    CvPoint inflexionLine_1;
+    CvPoint inflexionLine_2;
+}ArrowType;
+
+/*
+ #### function: define the struct of curve;
+      parameter: the coefficient of curve equation  
+ */
+typedef struct
+{
+    float coefficientA;
+    float coefficientB;
+    float coefficientC;
+    float coefficientD;
+    float coefficientE;
+    float coefficientF;    
+}CurveType;
+
+typedef struct
+{
+    CvPoint pointA;
+    CvPoint pointB;
+    CvPoint pointC;
+    CvPoint pointD;
+}TypeParallelogram;
+
+//output 
+typedef struct {
+	Shape shape;
+    union Output {
+        LineOutput          line;
+        TriangleOutput      triangle;
+        CircleOutput        circle;
+        EllipseOutput       ellipse;
+        DiaRecOutput        diarec;
+        FoldLineType        foldLineOutput;
+        CurveType           curveOutput;
+        ArrowType           arrowOutput;
+        TypeParallelogram   parallelogram;
+	} output;
+}OutputShape;
+
+typedef struct{   //triangle'output and its return value
+	CvPoint ptA;
+	CvPoint ptB;
+	CvPoint ptC;
+	double area;
+}Triangle_1;
+
+typedef struct     //struct of rectangle
+{
+	CvPoint ptA;
+	CvPoint ptB;
+	CvPoint ptC;
+	CvPoint ptD;
+	double  area;
+}RectangleMax;
+
+typedef struct{                  //保存所有的点,为多笔画识别做准备
+    CvPoint* points;
+    int      numberPoints;
+} PointsSave;
+
+
+extern PointsSave pointsSave[100];
+extern OutputShape shapeResult[10];    //用来保存每次的识别结果。
+
+
+#endif

+ 23 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/TextureTypes.h

@@ -0,0 +1,23 @@
+//
+//  TextureTypes.h
+//  KMDrawViewDemo
+//
+//  Created by zhudongyong on 14-4-17.
+//  Copyright (c) 2014年 kdanmobile. All rights reserved.
+//
+
+#ifndef KMDrawViewDemo_TextureTypes_h
+#define KMDrawViewDemo_TextureTypes_h
+
+typedef NS_ENUM(int32_t, TextureType) {
+    TextureTypeNormal,      //普通纹理  :半径
+    TextureTypeCircle,      //圆形纹理  :半径、硬度
+    TextureTypeRing,        //环形纹理  :半径、硬度、宽度
+    TextureTypeRectangle,   //矩形纹理  :半径、硬度、宽高比
+//    TextureTypePolygon, //多边纹理  :半径、硬度、边数目
+//    TextureTypeAngular, //角角纹理  :半径、硬度、角数目
+    TextureTypeCount,
+};
+
+
+#endif

+ 45 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/Tools.h

@@ -0,0 +1,45 @@
+//
+//  Tools.h
+//  EAGLViewDemo
+//
+//  Created by zhudongyong on 12-11-14.
+//  Copyright (c) 2012年 zhudongyong. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <CoreGraphics/CoreGraphics.h>
+#import <QuartzCore/CALayer.h>
+#import "math.h"
+
+#define CompareString(str1,str2)    strcmp([str1 UTF8String], [str2 UTF8String])
+
+#define MINFLOAT    0.0000
+#define MINDOUBLE   0.000000000000
+
+#pragma mark - C method
+CGPoint* CreateArc(int segments, float x, float y, float width, float height, float r, float startAngle, float endAngle);
+
+CGPoint* CreateEllipses(int segments, float x, float y, float width, float height, float radian);
+
+NSUInteger ExponentialWithInter(int value);
+
+CGRect RectWithSize(CGSize size);
+
+CGSize CGSizeApplyRotation(CGSize size, float radian);
+
+float RadianF(CGPoint p1, CGPoint p2);
+
+long double RadianLD(CGPoint p1, CGPoint p2);
+
+#pragma mark - Object-c method
+@interface Tools : NSObject
+
++ (NSString*)dateString;
+
++ (NSInteger)randInteger;
+
++ (int)randValueBegin:(int)begin end:(int)end;
+
++ (int)string:(NSString*)str1 isThanString:(NSString*)str2;
+
+@end

+ 19 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/UIColor+Mac.h

@@ -0,0 +1,19 @@
+//
+//  UIColor+Mac.h
+//  KMDrawViewDemo
+//
+//  Created by 朱东勇 on 2017/10/10.
+//  Copyright © 2017年 kdanmobile. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#if !TARGET_OS_IOS
+#import <AppKit/AppKit.h>
+
+typedef NSColor UIColor;
+
+@interface NSColor (Mac)
+
+@end
+#endif

+ 35 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/UIImage+Mac.h

@@ -0,0 +1,35 @@
+//
+//  UIImage+Tools.h
+//  KMDrawViewDemo
+//
+//  Created by 朱东勇 on 2017/10/10.
+//  Copyright © 2017年 kdanmobile. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#if !TARGET_OS_IOS
+#import <AppKit/AppKit.h>
+
+typedef NSImage UIImage;
+
+@interface NSImage (Mac)
+
++ (NSImage*)imageWithCGImage:(CGImageRef)cgImage;
+
++ (NSImage*)imageWithData:(NSData*)data;
+
++ (NSImage*)imageWithContentsOfFile:(NSString*)file;
+
+- (NSData*)dataOfImageType:(NSBitmapImageFileType)type;
+
+- (NSData*)dataOfPNGFile;
+
+- (NSData*)dataOfJPEGFile;
+
+- (CGImageRef)CGImage;
+
+@end
+
+NSData* UIImagePNGRepresentation(UIImage *image);
+
+#endif//!TARGET_OS_IOS

+ 19 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/UIView+Mac.h

@@ -0,0 +1,19 @@
+//
+//  UIView+Mac.h
+//  KMDrawViewDemo_Mac
+//
+//  Created by 朱东勇 on 2017/10/10.
+//  Copyright © 2017年 kdanmobile. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+#if !TARGET_OS_IOS
+#import <AppKit/AppKit.h>
+
+typedef NSView UIView;
+
+@interface NSView (Mac)
+
+@end
+#endif

+ 66 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Headers/matrix.h

@@ -0,0 +1,66 @@
+/*
+ 
+ File: matrix.h
+ 
+ Abstract: simple 4x4 matrix computations
+ 
+ Version: 1.0
+ 
+ Disclaimer: IMPORTANT:  This Apple software is supplied to you by Apple Inc.
+ ("Apple") in consideration of your agreement to the following terms, and your
+ use, installation, modification or redistribution of this Apple software
+ constitutes acceptance of these terms.  If you do not agree with these terms,
+ please do not use, install, modify or redistribute this Apple software.
+ 
+ In consideration of your agreement to abide by the following terms, and subject
+ to these terms, Apple grants you a personal, non-exclusive license, under
+ Apple's copyrights in this original Apple software (the "Apple Software"), to
+ use, reproduce, modify and redistribute the Apple Software, with or without
+ modifications, in source and/or binary forms; provided that if you redistribute
+ the Apple Software in its entirety and without modifications, you must retain
+ this notice and the following text and disclaimers in all such redistributions
+ of the Apple Software.
+ Neither the name, trademarks, service marks or logos of Apple Inc. may be used
+ to endorse or promote products derived from the Apple Software without specific
+ prior written permission from Apple.  Except as expressly stated in this notice,
+ no other rights or licenses, express or implied, are granted by Apple herein,
+ including but not limited to any patent rights that may be infringed by your
+ derivative works or by other works in which the Apple Software may be
+ incorporated.
+ 
+ The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO
+ WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
+ WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
+ COMBINATION WITH YOUR PRODUCTS.
+ 
+ IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR
+ DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF
+ CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
+ APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ 
+ Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ 
+*/
+
+#ifndef MATRIX_H
+#define MATRIX_H
+
+void mat4f_LoadIdentity(float* m);
+void mat4f_LoadScale(float* s, float* m);
+
+void mat4f_LoadXRotation(float radians, float* mout);
+void mat4f_LoadYRotation(float radians, float* mout);
+void mat4f_LoadZRotation(float radians, float* mout);
+
+void mat4f_LoadTranslation(float* t, float* mout);
+
+void mat4f_LoadPerspective(float fov_radians, float aspect, float zNear, float zFar, float* mout);
+void mat4f_LoadOrtho(float left, float right, float bottom, float top, float near, float far, float* mout);
+
+void mat4f_MultiplyMat4f(const float* a, const float* b, float* mout);
+
+#endif /* MATRIX_H */

BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/KMDrawViewSDK_Mac


+ 6 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Modules/module.modulemap

@@ -0,0 +1,6 @@
+framework module KMDrawViewSDK_Mac {
+  umbrella header "KMDrawViewSDK_Mac.h"
+  export *
+
+  module * { export * }
+}

+ 48 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Info.plist

@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>BuildMachineOSBuild</key>
+	<string>24A335</string>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleExecutable</key>
+	<string>KMDrawViewSDK_Mac</string>
+	<key>CFBundleIdentifier</key>
+	<string>com.innovator.KMDrawViewSDK-Mac</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>KMDrawViewSDK_Mac</string>
+	<key>CFBundlePackageType</key>
+	<string>FMWK</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.5.1</string>
+	<key>CFBundleSupportedPlatforms</key>
+	<array>
+		<string>MacOSX</string>
+	</array>
+	<key>CFBundleVersion</key>
+	<string>1</string>
+	<key>DTCompiler</key>
+	<string>com.apple.compilers.llvm.clang.1_0</string>
+	<key>DTPlatformBuild</key>
+	<string>24A336</string>
+	<key>DTPlatformName</key>
+	<string>macosx</string>
+	<key>DTPlatformVersion</key>
+	<string>15.0</string>
+	<key>DTSDKBuild</key>
+	<string>24A336</string>
+	<key>DTSDKName</key>
+	<string>macosx15.0</string>
+	<key>DTXcode</key>
+	<string>1600</string>
+	<key>DTXcodeBuild</key>
+	<string>16A242d</string>
+	<key>LSMinimumSystemVersion</key>
+	<string>10.9</string>
+	<key>NSHumanReadableCopyright</key>
+	<string>Copyright © 2017年 kdanmobile. All rights reserved.</string>
+</dict>
+</plist>

+ 12 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/BaseLine_Mac.fsh

@@ -0,0 +1,12 @@
+#version 150
+// define default precision for float, vec, mat.
+//lowp/mediump/highp
+//precision mediump float;//定义显示质量
+
+in vec4    v_colorVarying; //输出渲染颜色
+out vec4   fragColor;
+
+void main()
+{
+    fragColor = v_colorVarying;
+}

+ 21 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/BaseLine_Mac.vsh

@@ -0,0 +1,21 @@
+#version 150
+//input
+in vec4  a_position;    //顶点属性
+uniform vec2  a_center;      //渲染中心点
+uniform float a_pointSize;   //点尺寸
+uniform vec4  a_color;       //颜色属性
+
+uniform vec2    u_viewSize;    //渲染视图的尺寸
+
+//output
+out vec4    v_colorVarying; //输出渲染颜色
+
+void main()
+{
+    vec4 curPos = vec4(a_position.xy * a_pointSize + a_center, a_position.zw);
+    
+    //画点
+    gl_Position = vec4((curPos.xy*2.0/u_viewSize.xy-1.0)*vec2(1.0, -1.0), curPos.zw);
+    
+    v_colorVarying = a_color;
+}

+ 42 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/ImageRender_Mac(behand).fsh

@@ -0,0 +1,42 @@
+#version 150
+//Mark behindFSHString 着色器标识,勿删
+// define default precision for float, vec, mat.
+//lowp/mediump/highp
+precision highp float;//定义显示质量
+
+uniform float       u_opacity;      //不透明度
+
+uniform sampler2D   u_bgTexture;         //底图纹理
+uniform sampler2D   u_lineTexture;       //线条纹理
+uniform sampler2D   u_subLineTexture;    //子线纹理
+uniform bool        u_useSubLine;
+
+in vec2        v_lineCoord;     //输出笔刷纹理位置
+in vec2        v_bgCoord;       //底图纹理位置
+//in vec4        v_colorVarying;  //输出渲染颜色
+
+out vec4            fragColor;
+
+void main()
+{
+    vec4 bgColor = texture(u_bgTexture, v_bgCoord);
+    vec4 lineColor = texture(u_lineTexture, v_lineCoord);
+    
+    if (lineColor.a < 0.001)
+        discard;
+    
+    if (u_useSubLine) {
+        vec4 subLineColor = texture(u_subLineTexture, v_lineCoord);
+        if (subLineColor.a < 0.001)
+            discard;
+        lineColor *= subLineColor.a;
+    }
+    
+    lineColor *= u_opacity;
+    
+    if (lineColor.a < 0.0001) 
+        discard;
+    
+    //C = S * (1 - Ad) + D
+    fragColor = lineColor*(1.0 - bgColor.a) + bgColor;
+}

+ 46 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/ImageRender_Mac(brightness).fsh

@@ -0,0 +1,46 @@
+#version 150
+//Mark brightnessFSHString 着色器标识,勿删
+// define default precision for float, vec, mat.
+//lowp/mediump/highp
+precision highp float;//定义显示质量
+
+uniform float       u_opacity;      //不透明度
+
+uniform sampler2D   u_bgTexture;         //底图纹理
+uniform sampler2D   u_lineTexture;       //线条纹理
+uniform sampler2D   u_subLineTexture;    //子线纹理
+uniform bool        u_useSubLine;
+
+in vec2        v_lineCoord;     //输出笔刷纹理位置
+in vec2        v_bgCoord;       //底图纹理位置
+//in vec4        v_colorVarying;  //输出渲染颜色
+
+out vec4            fragColor;
+
+void main()
+{
+    vec4 bgColor = texture(u_bgTexture, v_bgCoord);
+    vec4 lineColor = texture(u_lineTexture, v_lineCoord);
+    
+    if (lineColor.a < 0.001)
+        discard;
+    
+    if (u_useSubLine) {
+        vec4 subLineColor = texture(u_subLineTexture, v_lineCoord);
+        if (subLineColor.a < 0.001)
+            discard;
+        lineColor *= subLineColor.a;
+    }
+    
+    lineColor *= u_opacity;
+    
+    if (lineColor.a < 0.0001)
+        discard;
+    
+    //C = MAX(S, D)
+    fragColor = vec4(max(lineColor.r, bgColor.r),
+                        max(lineColor.g, bgColor.g),
+                        max(lineColor.b, bgColor.b),
+                        mix(bgColor.a, 1.0, lineColor.a));
+    //                            bgColor.a*(1.0 - lineColor.a) + lineColor.a);
+}

+ 42 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/ImageRender_Mac(erase).fsh

@@ -0,0 +1,42 @@
+#version 150
+//Mark eraseFSHString 着色器标识,勿删
+// define default precision for float, vec, mat.
+//lowp/mediump/highp
+precision highp float;//定义显示质量
+
+uniform float       u_opacity;      //不透明度
+
+uniform sampler2D   u_bgTexture;         //底图纹理
+uniform sampler2D   u_lineTexture;       //线条纹理
+uniform sampler2D   u_subLineTexture;    //子线纹理
+uniform bool        u_useSubLine;
+
+in vec2        v_lineCoord;     //输出笔刷纹理位置
+in vec2        v_bgCoord;       //底图纹理位置
+//in vec4        v_colorVarying;  //输出渲染颜色
+
+out vec4            fragColor;
+
+void main()
+{
+    vec4 bgColor = texture(u_bgTexture, v_bgCoord);
+    vec4 lineColor = texture(u_lineTexture, v_lineCoord);
+    
+    if (lineColor.a < 0.001)
+        discard;
+    
+    if (u_useSubLine) {
+        vec4 subLineColor = texture(u_subLineTexture, v_lineCoord);
+        if (subLineColor.a < 0.001)
+            discard;
+        lineColor *= subLineColor.a;
+    }
+    
+    lineColor *= u_opacity;
+    
+    if (lineColor.a < 0.0001) 
+        discard;
+    
+    //C = D * (1 - As)
+    fragColor = bgColor*(1.0 - lineColor.a);
+}

+ 50 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/ImageRender_Mac(multiply).fsh

@@ -0,0 +1,50 @@
+#version 150
+//Mark multiplyFSHString 着色器标识,勿删
+// define default precision for float, vec, mat.
+//lowp/mediump/highp
+precision highp float;//定义显示质量
+
+uniform float       u_opacity;      //不透明度
+
+uniform sampler2D   u_bgTexture;         //底图纹理
+uniform sampler2D   u_lineTexture;       //线条纹理
+uniform sampler2D   u_subLineTexture;    //子线纹理
+uniform bool        u_useSubLine;
+
+in vec2        v_lineCoord;     //输出笔刷纹理位置
+in vec2        v_bgCoord;       //底图纹理位置
+//in vec4        v_colorVarying;  //输出渲染颜色
+
+out vec4            fragColor;
+
+void main()
+{
+    vec4 bgColor = texture(u_bgTexture, v_bgCoord);
+    vec4 lineColor = texture(u_lineTexture, v_lineCoord);
+    
+    if (lineColor.a < 0.0001)
+        discard;
+    
+    if (u_useSubLine) {
+        vec4 subLineColor = texture(u_subLineTexture, v_lineCoord);
+        if (subLineColor.a < 0.0001)
+            discard;
+        lineColor *= subLineColor.a;
+    }
+    
+    lineColor *= u_opacity;
+    
+    if (lineColor.a < 0.0001)
+        discard;
+    
+    float s_la = 1.0 - lineColor.a;
+    float s_ba = 1.0 - bgColor.a;
+    float ra = mix(bgColor.a, 1.0, lineColor.a);
+    //bgColor.a * s_la + lineColor.a;
+    vec4 resultColor = (s_ba + bgColor) * (s_la + lineColor);
+    
+    fragColor = vec4(resultColor.r - (1.0 - ra),
+                        resultColor.g - (1.0 - ra),
+                        resultColor.b - (1.0 - ra),
+                        ra);
+}

+ 42 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/ImageRender_Mac(normal).fsh

@@ -0,0 +1,42 @@
+#version 150
+//Mark normalFSHString 着色器标识,勿删
+// define default precision for float, vec, mat.
+//lowp/mediump/highp
+precision highp float;//定义显示质量
+
+uniform float       u_opacity;      //不透明度
+
+uniform sampler2D   u_bgTexture;         //底图纹理
+uniform sampler2D   u_lineTexture;       //线条纹理
+uniform sampler2D   u_subLineTexture;    //子线纹理
+uniform bool        u_useSubLine;
+
+in vec2        v_lineCoord;     //输出笔刷纹理位置
+in vec2        v_bgCoord;       //底图纹理位置
+//in vec4        v_colorVarying;  //输出渲染颜色
+
+out vec4            fragColor;
+
+void main()
+{
+    vec4 bgColor = texture(u_bgTexture, v_bgCoord);
+    vec4 lineColor = texture(u_lineTexture, v_lineCoord);
+    //
+    //        if (lineColor.a < 0.0001)
+    //            discard;
+    //
+    if (u_useSubLine) {
+        vec4 subLineColor = texture(u_subLineTexture, v_lineCoord);
+        //            if (subLineColor.a < 0.01)
+        //                discard;
+        lineColor *= subLineColor.a;
+    }
+    
+    lineColor *= u_opacity;
+    //
+    //        if (lineColor.a < 0.01)
+    //            discard;
+    //
+    //C = D * (1 - As) + S
+    fragColor = bgColor*(1.0 - lineColor.a) + lineColor;
+}

+ 42 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/ImageRender_Mac(replace).fsh

@@ -0,0 +1,42 @@
+#version 150
+//Mark replaceFSHString 着色器标识,勿删
+// define default precision for float, vec, mat.
+//lowp/mediump/highp
+precision highp float;//定义显示质量
+
+uniform float       u_opacity;      //不透明度
+
+uniform sampler2D   u_bgTexture;         //底图纹理
+uniform sampler2D   u_lineTexture;       //线条纹理
+uniform sampler2D   u_subLineTexture;    //子线纹理
+uniform bool        u_useSubLine;
+
+in vec2        v_lineCoord;     //输出笔刷纹理位置
+in vec2        v_bgCoord;       //底图纹理位置
+//in vec4        v_colorVarying;  //输出渲染颜色
+
+out vec4            fragColor;
+
+void main()
+{
+    vec4 bgColor = texture(u_bgTexture, v_bgCoord);
+    vec4 lineColor = texture(u_lineTexture, v_lineCoord);
+    
+    //    if (lineColor.a < 0.001)
+    //        discard;
+    //
+    if (u_useSubLine) {
+        vec4 subLineColor = texture(u_subLineTexture, v_lineCoord);
+        if (subLineColor.a < 0.001)
+            discard;
+        lineColor *= subLineColor.a;
+    }
+    
+    lineColor *= u_opacity;
+    //
+    //        if (lineColor.a < 0.0001)
+    //            discard;
+    //
+    //C = S
+    fragColor = lineColor;
+}

+ 27 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/ImageRender_Mac(reset).fsh

@@ -0,0 +1,27 @@
+#version 150
+//Mark resetFSHString 着色器标识,勿删
+// define default precision for float, vec, mat.
+//lowp/mediump/highp
+precision highp float;//定义显示质量
+
+uniform float       u_opacity;      //不透明度
+
+uniform sampler2D   u_bgTexture;         //底图纹理
+uniform sampler2D   u_lineTexture;       //线条纹理
+uniform sampler2D   u_subLineTexture;    //子线纹理
+uniform bool        u_useSubLine;
+
+in vec2        v_lineCoord;     //输出笔刷纹理位置
+in vec2        v_bgCoord;       //底图纹理位置
+//in vec4        v_colorVarying;  //输出渲染颜色
+
+out vec4            fragColor;
+
+void main()
+{
+    vec4 bgColor = texture(u_bgTexture, v_bgCoord);
+    vec2 coord = v_lineCoord;
+    
+    //C = D * (1 - As) + S
+    fragColor = bgColor;
+}

+ 55 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/ImageRender_Mac(tarnish).fsh

@@ -0,0 +1,55 @@
+#version 150
+//Mark tarnishFSHString 着色器标识,勿删
+// define default precision for float, vec, mat.
+//lowp/mediump/highp
+precision highp float;//定义显示质量
+
+uniform float       u_opacity;      //不透明度
+
+uniform sampler2D   u_bgTexture;         //底图纹理
+uniform sampler2D   u_lineTexture;       //线条纹理
+uniform sampler2D   u_subLineTexture;    //子线纹理
+uniform sampler2D   u_maskTexture;       //遮罩纹理
+uniform bool        u_useSubLine;
+
+in      vec2        v_lineCoord;     //输出笔刷纹理位置
+in      vec2        v_bgCoord;       //底图纹理位置
+//in      vec4        v_colorVarying;  //输出渲染颜色
+
+out     vec4        fragColor;
+
+void main()
+{
+    vec4 bgColor = texture(u_bgTexture, v_bgCoord);
+    vec4 lineColor = texture(u_lineTexture, v_lineCoord);
+    
+    if (lineColor.a < 0.001)
+        discard;
+    
+    if (u_useSubLine) {
+        vec4 subLineColor = texture(u_subLineTexture, v_lineCoord);
+        if (subLineColor.a < 0.001)
+            discard;
+        lineColor *= subLineColor.a;
+    }
+    
+    lineColor *= u_opacity;
+    
+    if (lineColor.a < 0.0001)
+        discard;
+    
+    float s_la = 1.0 - lineColor.a;
+    float s_ba = 1.0 - bgColor.a;
+    float ra = bgColor.a * s_la + lineColor.a;
+    //C = MIN(S, D)
+    
+    vec4 resultColor = vec4(min((s_ba + bgColor.r), (s_la + lineColor.r)),
+                            min((s_ba + bgColor.g), (s_la + lineColor.g)),
+                            min((s_ba + bgColor.b), (s_la + lineColor.b)),
+                            1.0);
+    
+    fragColor = vec4(resultColor.r - (1.0 - ra),
+                        resultColor.g - (1.0 - ra),
+                        resultColor.b - (1.0 - ra),
+                        ra);
+}

+ 41 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/ImageRender_Mac.vsh

@@ -0,0 +1,41 @@
+#version 150
+//input
+in vec4     a_position;    //顶点属性
+uniform vec2     a_center;      //渲染中心点
+// attribute vec4     a_color;       //颜色属性
+
+uniform vec2     a_flip;        //旋转
+uniform float    a_radian;      //旋转角度
+//uniform vec4     a_color;        //渲染颜色
+
+//Texture
+in vec2     a_texCoord;  //笔刷纹理位置
+// attribute vec2     a_bgCoord;   //底图纹理位置
+
+uniform vec2       u_viewSize;
+uniform vec2       u_bgTextureSize;
+
+//varying value
+out vec2       v_lineCoord;        //输出笔刷纹理位置
+out vec2       v_bgCoord;          //底图纹理位置
+//out vec4       v_colorVarying;     //输出渲染颜色
+
+void main()
+{
+    vec4 curPos = a_position*vec4(a_flip, vec2(1.0));
+    
+    if (a_radian > 0.0001 || a_radian < -0.0001) {
+        //生成旋转矩阵
+        vec2 rotate = vec2(sin(a_radian), cos(a_radian));
+        mat2 rotateMatrix = mat2(rotate.y,rotate.x,-rotate.x,rotate.y);
+        curPos = vec4(curPos.xy*rotateMatrix, curPos.z, curPos.w);
+    }
+    
+    //画矩形
+    curPos = vec4(curPos.xy+a_center.xy, curPos.zw);
+    gl_Position = vec4((curPos.xy*2.0/u_viewSize-1.0)*vec2(1.0, -1.0), curPos.zw);
+    
+    v_lineCoord    = a_texCoord;
+    v_bgCoord      = vec2(curPos.x, u_viewSize.y - curPos.y)/u_bgTextureSize;
+//    v_colorVarying = a_color;
+}

+ 131 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/Line_Mac.fsh

@@ -0,0 +1,131 @@
+#version 150
+// define default precision for float, vec, mat.
+//lowp/mediump/highp
+precision highp float;             //定义显示质量
+
+uniform sampler2D  u_brushTexture; //线条纹理
+
+uniform int        u_colorful;     //多彩
+uniform float      u_hueTingle;
+uniform float      u_saturationTingle;
+uniform float      u_brightnessTingle;
+uniform float      u_rand;
+
+//遮罩
+uniform bool        u_useMask;             //使用遮罩
+uniform sampler2D   u_maskTexture;         //遮罩纹理
+uniform vec4        u_maskBaseCoord;       //Mask固定坐标
+
+in vec2        v_maskCoord;           //Mask纹理位置
+in vec4       v_colorVarying;//输出渲染颜色
+in vec2       v_texCoord;    //输出笔刷纹理位置
+out vec4      fragColor;
+
+//RGB to HSV
+vec4 RGB2HSV(vec4 rgba) {
+    vec4 vxli;
+    
+    vxli.g = min(rgba.r, rgba.g);
+    vxli.g = min(vxli.g, rgba.b);
+    
+    vxli.r = max(rgba.r, rgba.g);
+    vxli.r = max(vxli.r, rgba.b);
+    
+    if(vxli.r == vxli.g)
+        return vec4(0.0, 0.0, vxli.r, rgba.a);
+    
+    vxli.b = (rgba.r == vxli.g) ? rgba.g - rgba.b : ((rgba.g == vxli.g) ? rgba.b - rgba.r : rgba.r - rgba.g);
+    vxli.a = (rgba.r == vxli.g) ? 3.0 : ((rgba.g == vxli.g) ? 5.0 : 1.0);
+    
+    return vec4(((vxli.a - vxli.b /(vxli.r - vxli.g))/6.0), (vxli.r - vxli.g)/vxli.r, vxli.r, rgba.a);
+}
+
+vec4 HSV2RGB(vec4 HSV) {
+    float h = HSV.r * 6.0;
+    float s = HSV.g;
+    float v = HSV.b;
+    vec4 mnki;
+    
+    if (h == 0.0) h=.01;
+    if(h == 0.0)
+        return vec4(v, v, v, HSV.a);
+    mnki.a = floor(h);
+    mnki.b = h - mnki.a;
+    if(!(mnki.a > 0.0)) mnki.b = 1.0 - mnki.b; // if i is even
+    mnki.r = v * (1.0 - s);
+    mnki.g = v * (1.0 - s * mnki.b);
+    if (mnki.a == 6.0 || mnki.a == 0.0)
+        return vec4(v, mnki.g, mnki.r, HSV.a);
+    else if (mnki.a == 1.0)
+        return vec4(mnki.g, v, mnki.r, HSV.a);
+    else if (mnki.a == 2.0)
+        return vec4(mnki.r, v, mnki.g, HSV.a);
+    else if (mnki.a == 3.0)
+        return vec4(mnki.r, mnki.g, v, HSV.a);
+    else if (mnki.a == 4.0)
+        return vec4(mnki.g, mnki.r, v, HSV.a);
+    else if (mnki.a == 5.0)
+        return vec4(v, mnki.r, mnki.g, HSV.a);
+    
+    return vec4(0.0, 0.0, 0.0, HSV.a);
+}
+
+vec4 hsvTingle(vec4 rgba) {
+    if (rgba.a < 0.001 ||
+        (u_hueTingle < 0.001 &&
+         u_saturationTingle < 0.001 &&
+         u_brightnessTingle < 0.001))
+        return rgba;
+    
+    vec4 hsvType = RGB2HSV(rgba);
+    
+    if (u_hueTingle > 0.001) {
+        float randValue = (u_rand - 0.5) * u_hueTingle;
+        hsvType.r += randValue;
+        if (hsvType.r >= 1.0) {
+            hsvType.r -= 1.0;
+        }else if (hsvType.r < 0.0) {
+            hsvType.r += 1.0;
+        }
+    }
+    if (u_saturationTingle > 0.001) {
+        float randValue = (u_rand - hsvType.g) * u_saturationTingle;
+        hsvType.g += randValue;
+    }
+    if (u_brightnessTingle > 0.001) {
+        float randValue = (u_rand - hsvType.b) * u_brightnessTingle;
+        hsvType.b += randValue;
+    }
+    
+    return HSV2RGB(hsvType);
+}
+
+void main()
+{
+    vec4 textureColor = texture(u_brushTexture, v_texCoord);
+    
+    //     if (textureColor.a <= 0.0001)
+    //         discard;
+    //
+    if (u_colorful == 0) {
+        textureColor = v_colorVarying*textureColor.a;
+    }else {
+        textureColor = v_colorVarying.a*textureColor;
+        textureColor = hsvTingle(textureColor);
+    }
+    
+    if (u_useMask) {
+        vec2 maskCoord = mod(v_maskCoord.xy, vec2(1.0));
+        maskCoord.y = 1.0 - maskCoord.y;
+        maskCoord = u_maskBaseCoord.xy + maskCoord*u_maskBaseCoord.zw;
+        vec4 maskColor = texture(u_maskTexture, maskCoord);
+        //0.21 * r + 0.71 * g + 0.07 * b
+        textureColor *= 1.0 - (0.21 * maskColor.r + 0.71 * maskColor.g + 0.07 * maskColor.b);
+//        textureColor *= (pow(maskCoord.x, 2.0) + pow(maskCoord.y, 2.0))/2.0;
+    }
+    //
+    //     if (textureColor.a <= 0.0001)
+    //         discard;
+    //
+    fragColor = textureColor;
+}

+ 51 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/Line_Mac.vsh

@@ -0,0 +1,51 @@
+#version 150
+//input
+in vec4     a_position;    //顶点属性
+uniform vec2     a_center;      //渲染中心点
+uniform float    a_pointSize;   //点尺寸
+uniform vec4     a_color;       //颜色属性
+
+uniform vec2     a_flip;        //旋转
+uniform float    a_radian;      //旋转角度
+
+//Texture
+in vec2     a_texCoord;     //笔刷纹理位置
+
+// uniform mat4       u_ortho;
+// uniform mat4       u_scale;
+// uniform mat4       u_rotate;
+
+uniform vec2       u_viewSize;
+uniform float      u_roundness;    //圆度,(0,1]
+//
+uniform float      u_flow;         //流量
+
+//遮罩
+uniform vec2       u_maskSize;
+
+out vec2       v_maskCoord;        //Mask纹理位置
+//varying value
+out vec4       v_colorVarying;//输出渲染颜色
+out vec2       v_texCoord;    //输出笔刷纹理位置
+
+void main()
+{
+    vec4 curPos = a_position*vec4(vec2(a_pointSize, a_pointSize*(u_roundness*0.9 + 0.1))*a_flip, vec2(1.0));
+    
+    if (a_radian > 0.0001 || a_radian < -0.0001) {
+        //生成旋转矩阵
+        vec2 rotate = vec2(sin(a_radian), cos(a_radian));
+        mat2 rotateMatrix = mat2(rotate.y,rotate.x,-rotate.x,rotate.y);
+        curPos = vec4(curPos.xy*rotateMatrix, curPos.z, curPos.w);
+    }
+    
+    //画矩形
+    curPos = vec4((curPos.xy+a_center.xy)/u_viewSize.xy, curPos.zw);
+    gl_Position = vec4((curPos.xy*2.0-1.0)*vec2(1.0, -1.0), curPos.zw);
+    
+    v_colorVarying = a_color*u_flow;
+    v_texCoord     = a_texCoord;
+    
+    v_maskCoord = curPos.xy*u_viewSize.xy/u_maskSize;
+}
+

+ 61 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/Root.plist

@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>StringsTable</key>
+	<string>Root</string>
+	<key>PreferenceSpecifiers</key>
+	<array>
+		<dict>
+			<key>Type</key>
+			<string>PSGroupSpecifier</string>
+			<key>Title</key>
+			<string>Group</string>
+		</dict>
+		<dict>
+			<key>Type</key>
+			<string>PSTextFieldSpecifier</string>
+			<key>Title</key>
+			<string>Name</string>
+			<key>Key</key>
+			<string>name_preference</string>
+			<key>DefaultValue</key>
+			<string></string>
+			<key>IsSecure</key>
+			<false/>
+			<key>KeyboardType</key>
+			<string>Alphabet</string>
+			<key>AutocapitalizationType</key>
+			<string>None</string>
+			<key>AutocorrectionType</key>
+			<string>No</string>
+		</dict>
+		<dict>
+			<key>Type</key>
+			<string>PSToggleSwitchSpecifier</string>
+			<key>Title</key>
+			<string>Enabled</string>
+			<key>Key</key>
+			<string>enabled_preference</string>
+			<key>DefaultValue</key>
+			<true/>
+		</dict>
+		<dict>
+			<key>Type</key>
+			<string>PSSliderSpecifier</string>
+			<key>Key</key>
+			<string>slider_preference</string>
+			<key>DefaultValue</key>
+			<real>0.5</real>
+			<key>MinimumValue</key>
+			<integer>0</integer>
+			<key>MaximumValue</key>
+			<integer>1</integer>
+			<key>MinimumValueImage</key>
+			<string></string>
+			<key>MaximumValueImage</key>
+			<string></string>
+		</dict>
+	</array>
+</dict>
+</plist>

+ 20 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/Smudge_Mac(Show).fsh

@@ -0,0 +1,20 @@
+#version 150
+// define default precision for float, vec, mat.
+//lowp/mediump/highp
+precision highp float;             //定义显示质量
+
+uniform sampler2D  u_brushTexture; //线条纹理
+
+in vec2       v_texCoord;    //输出笔刷纹理位置
+
+out vec4         fragColor;
+
+void main()
+{
+    vec4 textureColor = texture(u_brushTexture, v_texCoord);
+    
+    if (textureColor.a < 0.001)
+        discard;
+    
+    fragColor = textureColor;
+}

+ 25 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/Smudge_Mac(Show).vsh

@@ -0,0 +1,25 @@
+#version 150
+//input
+in vec4     a_position;    //顶点属性
+uniform vec2     a_center;      //渲染中心点
+uniform float    a_pointSize;   //点尺寸
+
+//Texture
+in vec2     a_texCoord;     //笔刷纹理位置
+
+uniform vec2       u_viewSize;
+uniform float      u_roundness;    //圆度,(0,1]
+
+//varying value
+out vec2       v_texCoord;    //输出笔刷纹理位置
+
+void main()
+{
+    vec4 curPos = a_position*vec4(vec2(1.0, -1.0), vec2(1.0));
+    
+    //画矩形
+    curPos = vec4(curPos.xy+a_center.xy, curPos.zw);
+    gl_Position = vec4((curPos.xy/u_viewSize*2.0-1.0)*vec2(1.0, -1.0), curPos.zw);
+    
+    v_texCoord     = a_texCoord;
+}

+ 40 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/Smudge_Mac(Smudge).fsh

@@ -0,0 +1,40 @@
+#version 150
+// define default precision for float, vec, mat.
+//lowp/mediump/highp
+precision highp float;             //定义显示质量
+
+uniform sampler2D  u_brushTexture; //线条纹理
+
+uniform sampler2D  u_bgTexture;    //背景纹理
+uniform float      u_moistQuantity;//潮湿
+uniform float      u_loadQuantity; //载入
+uniform float      u_mixQuantity;  //混合
+
+in      vec4       v_colorVarying;//输出渲染颜色
+in      vec2       v_texCoord;    //输出笔刷纹理位置
+in      vec2       v_bgCoord;     //底图纹理位置
+
+out vec4            fragColor;
+
+void main()
+{
+    vec4 textureColor = texture(u_brushTexture, v_texCoord);
+    
+    if (textureColor.a <= 0.01)
+        discard;
+    
+    vec4 bgColor = texture(u_bgTexture, v_bgCoord);
+    
+    //     bgColor = bgColor * u_moistQuantity * textureColor.a;
+    float quantity = u_mixQuantity;
+    if (quantity < 1.0) {
+        quantity = sqrt(sqrt(sqrt(u_mixQuantity)));
+    }
+    
+    bgColor = (bgColor * u_moistQuantity * quantity + v_colorVarying * (1.0 - quantity)) * textureColor.a;
+    
+    if (bgColor.a < 0.01)
+        discard;
+    
+    fragColor = bgColor;
+}

+ 52 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/Smudge_Mac(Smudge).vsh

@@ -0,0 +1,52 @@
+#version 150
+//input
+in vec4     a_position;    //顶点属性
+uniform vec2     a_center;      //渲染中心点
+uniform float    a_pointSize;   //点尺寸
+uniform vec4     a_color;       //颜色属性
+
+uniform vec2     a_flip;        //旋转
+uniform float    a_radian;      //旋转角度
+
+//Texture
+in vec2     a_texCoord;     //笔刷纹理位置
+
+in vec2     a_bgCoord; //已绘制线条纹理位置
+
+
+uniform vec2       u_viewSize;
+uniform float      u_roundness;    //圆度,(0,1]
+//
+uniform float      u_flow;         //流量
+
+//varying value
+out vec4       v_colorVarying;//输出渲染颜色
+out vec2       v_texCoord;    //输出笔刷纹理位置
+out vec2       v_bgCoord;//已绘制线条纹理
+
+void main()
+{
+    vec2 flip = vec2(1.0);
+    if ((1.0 - u_roundness) > 0.001)
+        flip = vec2((1.0, (u_roundness*0.9 + 0.1)));
+    if ((1.0 - a_flip.x) > 0.001 &&
+        (1.0 - a_flip.y) > 0.001)
+        flip = flip * a_flip;
+    
+    vec4 curPos = a_position*vec4(a_pointSize * flip, vec2(1.0));
+    
+    if (a_radian > 0.0001 || a_radian < -0.0001) {
+        //生成旋转矩阵
+        vec2 rotate = vec2(sin(a_radian), cos(a_radian));
+        mat2 rotateMatrix = mat2(rotate.y,rotate.x,-rotate.x,rotate.y);
+        curPos = vec4(curPos.xy*rotateMatrix, curPos.z, curPos.w);
+    }
+    
+    curPos     = vec4(curPos.xy+a_center.xy, curPos.zw);
+    gl_Position = vec4((curPos.xy/u_viewSize*2.0-1.0)*vec2(1.0, -1.0), curPos.zw);
+    
+    v_colorVarying = a_color*u_flow;
+    v_texCoord     = a_texCoord;
+    
+    v_bgCoord      = a_bgCoord;
+}

BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Shaders.bundle/en.lproj/Root.strings


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_1.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_10.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_11.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_12.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_13.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_14.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_15.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_16.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_17.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_18.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_19.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_2.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_20.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_21.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_25.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_27.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_28.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_29.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_3.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_30.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_31.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_32.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_33.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_34.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_35.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_4.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_40.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_42.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_46.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_5.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_6.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_7.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/PS_brush_8.png


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/A/Resources/Texture.bundle/实边椭圆 45 1.png


+ 1 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/KMDrawViewSDK_Mac.framework/Versions/Current

@@ -0,0 +1 @@
+A

+ 22 - 3
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMColorPickerView.swift

@@ -37,7 +37,8 @@ class KMColorPickerView: NSControl {
     var noContentString: Bool = false
     var hideColorPanelAlpha: Bool = false
     var isVerticalMode: Bool = false
-    
+    var isOrderWindowAbove: Bool = false
+
     var buttons: [NSButton] = []
     var customColorButton: NSButton =  NSButton()
     var customColorLayer: CALayer = CALayer()
@@ -306,6 +307,22 @@ class KMColorPickerView: NSControl {
         }
     }
     
+    public func decSelectionColorView() {
+        for i in 0..<min(self.colors.count, 4) {
+            let button = buttons[i]
+            button.layer?.borderColor = .clear
+            button.layer?.borderWidth = 0.0
+        }
+        customColorButton.layer?.borderWidth = 0.0
+
+        if NSColorPanel.shared.isVisible {
+            NSColorPanel.shared.orderOut(nil)
+        }
+        NSColorPanel.shared.setTarget(nil)
+        NSColorPanel.shared.setAction(nil)
+
+    }
+    
     func isTheSameColor(_ color1: NSColor, anotherColor color2: NSColor) -> Bool {
         let component = color1.cgColor.components
         let component1 = color2.cgColor.components
@@ -391,8 +408,10 @@ class KMColorPickerView: NSControl {
                 accessoryView.state = isFillColor ? .on : .off
             }
         }
-        
-        if isFillColor {
+        if(isOrderWindowAbove) {
+            self.window?.addChildWindow(NSColorPanel.shared, ordered: .above)
+            NSColorPanel.shared.orderFront(nil)
+        } else if isFillColor {
             NSColorPanel.shared.orderFront(nil)
         } else {
             if isFreeText {

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


Някои файлове не бяха показани, защото твърде много файлове са промени