|
@@ -14,6 +14,17 @@ public enum KMOperationState {
|
|
|
case ended
|
|
|
}
|
|
|
|
|
|
+enum KMEditImagePropertyViewControllerChangeType {
|
|
|
+ case rotate
|
|
|
+ case flip
|
|
|
+ case add
|
|
|
+ case move
|
|
|
+}
|
|
|
+
|
|
|
+protocol KMEditImagePropertyViewControllerDelegate: NSObject {
|
|
|
+ func editImagePropertyViewControllerDidChanged(controller: KMEditImagePropertyViewController, type: KMEditImagePropertyViewControllerChangeType)
|
|
|
+}
|
|
|
+
|
|
|
class KMEditImagePropertyViewController: NSViewController {
|
|
|
|
|
|
@IBOutlet weak var titleLabel: NSTextField!
|
|
@@ -69,6 +80,7 @@ class KMEditImagePropertyViewController: NSViewController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ weak var delegate: KMEditImagePropertyViewControllerDelegate?
|
|
|
override func viewDidLoad() {
|
|
|
super.viewDidLoad()
|
|
|
|
|
@@ -402,6 +414,8 @@ extension KMEditImagePropertyViewController {
|
|
|
self.listView.rotate(with: imagesArea, rotate: 90)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ self.delegate?.editImagePropertyViewControllerDidChanged(controller: self, type: .rotate)
|
|
|
}
|
|
|
|
|
|
@IBAction func leftRotationImageAction(_ sender: Any) {
|
|
@@ -420,6 +434,8 @@ extension KMEditImagePropertyViewController {
|
|
|
self.listView.rotate(with: imagesArea, rotate: -90)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ self.delegate?.editImagePropertyViewControllerDidChanged(controller: self, type: .rotate)
|
|
|
}
|
|
|
|
|
|
@IBAction func flipHorizontalImageAction(_ sender: Any) {
|
|
@@ -441,6 +457,8 @@ extension KMEditImagePropertyViewController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ self.delegate?.editImagePropertyViewControllerDidChanged(controller: self, type: .flip)
|
|
|
}
|
|
|
|
|
|
@IBAction func flipVerticalImageAction(_ sender: Any) {
|
|
@@ -460,6 +478,7 @@ extension KMEditImagePropertyViewController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ self.delegate?.editImagePropertyViewControllerDidChanged(controller: self, type: .flip)
|
|
|
}
|
|
|
|
|
|
@IBAction func cutImageAction(_ sender: Any) {
|