KMSystemMenu.swift 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. //
  2. // KMSystemMenu.swift
  3. // PDF Master
  4. //
  5. // Created by tangchao on 2023/4/24.
  6. //
  7. import Cocoa
  8. protocol KMSystemFileMenuProtocol {
  9. func menuItemClick_saveAsFlattenedPDF(_ sender: Any)
  10. func menuItemClick_mergePDF(_ sender: Any)
  11. func menuItemClick_Compress(_ sender: Any)
  12. func menuItemClick_Convert(_ sender: Any)
  13. func menuItemAction_ConvertToWord(_ sender: Any)
  14. func menuItemAction_ConvertToExcel(_ sender: Any)
  15. func menuItemAction_ConvertToPPT(_ sender: Any)
  16. func menuItemAction_ConvertToRTF(_ sender: Any)
  17. func menuItemAction_ConvertToHTML(_ sender: Any)
  18. func menuItemAction_ConvertToText(_ sender: Any)
  19. func menuItemAction_ConvertToCSV(_ sender: Any)
  20. func menuItemAction_ConvertToImage(_ sender: Any)
  21. func menuItemClick_SettingPassword(_ sender: Any)
  22. func menuItemClick_RemovePassword(_ sender: Any)
  23. func menuItemAction_closeWindow(_ sender: Any)
  24. func menuItemAction_closeAllWindows(_ sender: Any)
  25. func menuItemAction_closeTagPage(_ sender: Any)
  26. func menuItemAction_showInFinder(_ sender: Any)
  27. func menuItemAction_property(_ sender: Any)
  28. func menuItemAction_print(_ sender: Any)
  29. }
  30. extension KMSystemFileMenuProtocol {
  31. func menuItemClick_Convert(_ sender: Any) {}
  32. }
  33. @objc protocol KMSystemEditMenuProtocol {
  34. @objc optional func undo(_ sender: Any?)
  35. @objc optional func redo(_ sender: Any?)
  36. @objc optional func cut(_ sender: Any?)
  37. @objc optional func copy(_ sender: Any?)
  38. @objc optional func paste(_ sender: Any?)
  39. @objc optional func delete(_ sender: Any?)
  40. @objc optional func menuItemAction_find(_ sender: Any)
  41. }
  42. protocol KMSystemAnnotationMenuProtocol: NSObjectProtocol {
  43. func menuItemAction_highlight(_ sender: Any)
  44. func menuItemAction_underline(_ sender: Any)
  45. func menuItemAction_deleteLine(_ sender: Any)
  46. func menuItemAction_freehand(_ sender: Any)
  47. func menuItemAction_text(_ sender: Any)
  48. func menuItemAction_note(_ sender: Any)
  49. func menuItemAction_squre(_ sender: Any)
  50. func menuItemAction_circle(_ sender: Any)
  51. func menuItemAction_arrow(_ sender: Any)
  52. func menuItemAction_line(_ sender: Any)
  53. // link
  54. func menuItemAction_link(_ sender: Any)
  55. func menuItemAction_linkPage(_ sender: Any)
  56. func menuItemAction_linkHttps(_ sender: Any)
  57. func menuItemAction_linkEmail(_ sender: Any)
  58. // stamp
  59. func menuItemAction_stamp(_ sender: Any)
  60. func menuItemAction_stampStandard(_ sender: Any)
  61. func menuItemAction_stampDynamic(_ sender: Any)
  62. func menuItemAction_stampCustom(_ sender: Any)
  63. func menuItemAction_signure(_ sender: Any)
  64. func menuItemAction_hiddenAllAnnotation(_ sender: Any)
  65. func menuItemAction_clearAllAnnotation(_ sender: Any)
  66. }
  67. extension KMSystemAnnotationMenuProtocol {
  68. func menuItemAction_linkHttps(_ sender: Any) {}
  69. func menuItemAction_linkEmail(_ sender: Any) {}
  70. func menuItemAction_stampStandard(_ sender: Any) {}
  71. func menuItemAction_stampDynamic(_ sender: Any) {}
  72. func menuItemAction_stampCustom(_ sender: Any) {}
  73. }
  74. protocol KMSystemGotoMenuProtocol {
  75. func menuItemAction_nextPage(_ sender: Any)
  76. func menuItemAction_forwardPage(_ sender: Any)
  77. func menuItemAction_firstPage(_ sender: Any)
  78. func menuItemAction_lastPage(_ sender: Any)
  79. func menuItemAction_forward(_ sender: Any)
  80. func menuItemAction_goback(_ sender: Any)
  81. func menuItemAction_gotoPage(_ sender: Any)
  82. }
  83. protocol KMSystemToolMenuProtocol {
  84. func menuItemAction_textTool(_ sender: Any)
  85. func menuItemAction_scrolTool(_ sender: Any)
  86. func menuItemAction_zoomOutTool(_ sender: Any)
  87. func menuItemAction_selectTool(_ sender: Any)
  88. func menuItemAction_redact(_ sender: Any)
  89. func menuItemAction_warkmark(_ sender: Any)
  90. func menuItemAction_background(_ sender: Any)
  91. func menuItemAction_headerfooter(_ sender: Any)
  92. func menuItemAction_bates(_ sender: Any)
  93. func menuItemAction_batch(_ sender: Any)
  94. }
  95. extension KMSystemToolMenuProtocol {
  96. func menuItemAction_textTool(_ sender: Any) {}
  97. func menuItemAction_redact(_ sender: Any) {}
  98. func menuItemAction_warkmark(_ sender: Any) {}
  99. func menuItemAction_background(_ sender: Any) {}
  100. func menuItemAction_headerfooter(_ sender: Any) {}
  101. func menuItemAction_bates(_ sender: Any) {}
  102. func menuItemAction_batch(_ sender: Any) {}
  103. }
  104. protocol KMSystemWindowMenuRrotocol {
  105. func menuItemAction_showForwardTagPage(_ sender: Any)
  106. func menuItemAction_showNextTagPage(_ sender: Any)
  107. func menuItemAction_newTagPageToNewWindow(_ sender: Any)
  108. func menuItemAction_mergeAllWindow(_ sender: Any)
  109. func menuItemAction_currentWindowName(_ sender: Any)
  110. }
  111. extension KMSystemWindowMenuRrotocol {
  112. func menuItemAction_currentWindowName(_ sender: Any) {}
  113. }
  114. protocol KMSystemViewMenuProtocol {
  115. // scale
  116. func menuItemAction_adjustWidth(_ sender: Any)
  117. func menuItemAction_adjustPage(_ sender: Any)
  118. func menuItemAction_size(_ sender: Any)
  119. func menuItemAction_zoomOut(_ sender: Any)
  120. func menuItemAction_zoomIn(_ sender: Any)
  121. // page show
  122. func menuItemAction_singlePage(_ sender: Any)
  123. func menuItemAction_singlePageContinue(_ sender: Any)
  124. func menuItemAction_doublePage(_ sender: Any)
  125. func menuItemAction_doublePageContinue(_ sender: Any)
  126. func menuItemAction_bookMode(_ sender: Any)
  127. func menuItemAction_readMode(_ sender: Any)
  128. func menuItemAction_showSplitPage(_ sender: Any)
  129. func menuItemAction_autoScrol(_ sender: Any)
  130. func menuItemAction_autoScrolSetting(_ sender: Any)
  131. // rotate
  132. func menuItemAction_rotateLeft(_ sender: Any)
  133. func menuItemAction_rotateRight(_ sender: Any)
  134. func menuItemAction_rotateAllPageLeft(_ sender: Any)
  135. func menuItemAction_rotateAllPageRight(_ sender: Any)
  136. // split screen
  137. func menuItemAction_splitScreenVerti(_ sender: Any)
  138. func menuItemAction_splitScreenHorti(_ sender: Any)
  139. func menuItemAction_splitScreenNo(_ sender: Any)
  140. func menuItemAction_view_readMode(_ sender: Any)
  141. func menuItemAction_enterFullScreen(_ sender: Any)
  142. func menuItemAction_hiddenLeftSide(_ sender: Any)
  143. func menuItemAction_hiddenRightSide(_ sender: Any)
  144. func menuItemAction_thumai(_ sender: Any)
  145. func menuItemAction_outline(_ sender: Any)
  146. func menuItemAction_bookmark(_ sender: Any)
  147. func menuItemAction_annotation(_ sender: Any)
  148. func menuItemAction_search(_ sender: Any)
  149. func menuItemAction_topic(_ sender: Any)
  150. func menuItemAction_hiddenPageIndicator(_ sender: Any)
  151. }
  152. extension KMSystemViewMenuProtocol {
  153. func menuItemAction_autoScrol(_ sender: Any) {}
  154. func menuItemAction_autoScrolSetting(_ sender: Any) {}
  155. func menuItemAction_splitScreenVerti(_ sender: Any) {}
  156. func menuItemAction_splitScreenHorti(_ sender: Any) {}
  157. func menuItemAction_splitScreenNo(_ sender: Any) {}
  158. func menuItemAction_enterFullScreen(_ sender: Any) {}
  159. func menuItemAction_topic(_ sender: Any) {}
  160. }
  161. extension KMSystemMenu.File {
  162. public static let saveAsFlattenedPDFSelector = NSSelectorFromString("menuItemClick_saveAsFlattenedPDF:")
  163. public static let mergePDFSelector = NSSelectorFromString("menuItemClick_mergePDF:")
  164. public static let compressSelector = NSSelectorFromString("menuItemClick_Compress:")
  165. public static let convertSelector = NSSelectorFromString("menuItemClick_Convert:")
  166. public static let convertToWordSelector = NSSelectorFromString("menuItemAction_ConvertToWord:")
  167. public static let convertToExcelSelector = NSSelectorFromString("menuItemAction_ConvertToExcel:")
  168. public static let convertToPPTSelector = NSSelectorFromString("menuItemAction_ConvertToPPT:")
  169. public static let convertToRTFSelector = NSSelectorFromString("menuItemAction_ConvertToRTF:")
  170. public static let convertToHTMLSelector = NSSelectorFromString("menuItemAction_ConvertToHTML:")
  171. public static let convertToTextSelector = NSSelectorFromString("menuItemAction_ConvertToText:")
  172. public static let convertToCSVSelector = NSSelectorFromString("menuItemAction_ConvertToCSV:")
  173. public static let convertToImageSelector = NSSelectorFromString("menuItemAction_ConvertToImage:")
  174. public static let settingPasswordSelector = NSSelectorFromString("menuItemClick_SettingPassword:")
  175. public static let removePasswordSelector = NSSelectorFromString("menuItemClick_RemovePassword:")
  176. public static let closeWindowSelector = NSSelectorFromString("menuItemAction_closeWindow:")
  177. public static let closeAllWindowsSelector = NSSelectorFromString("menuItemAction_closeAllWindows:")
  178. public static let closeTagPageSelector = NSSelectorFromString("menuItemAction_closeTagPage:")
  179. public static let showInFinderSelector = NSSelectorFromString("menuItemAction_showInFinder:")
  180. public static let propertySelector = NSSelectorFromString("menuItemAction_property:")
  181. public static let printSelector = NSSelectorFromString("menuItemAction_print:")
  182. public static func actions() -> [Selector] {
  183. return [self.saveAsFlattenedPDFSelector, self.mergePDFSelector, self.compressSelector,
  184. // convert
  185. self.convertSelector, self.convertToWordSelector, self.convertToExcelSelector, self.convertToPPTSelector,
  186. self.convertToRTFSelector, self.convertToHTMLSelector, self.convertToTextSelector, self.convertToCSVSelector,
  187. self.convertToImageSelector,
  188. // secure
  189. self.settingPasswordSelector, self.removePasswordSelector,
  190. // other
  191. self.closeWindowSelector, self.closeAllWindowsSelector, self.closeTagPageSelector,
  192. self.showInFinderSelector, self.propertySelector,
  193. self.printSelector]
  194. }
  195. }
  196. extension KMSystemMenu.Edit {
  197. public static let undoSelector = NSSelectorFromString("undo:")
  198. public static let redoSelector = NSSelectorFromString("redo:")
  199. public static let cutSelector = NSSelectorFromString("cut:")
  200. public static let copySelector = NSSelectorFromString("copy:")
  201. public static let pasteSelector = NSSelectorFromString("paste:")
  202. public static let deleteSelector = NSSelectorFromString("delete:")
  203. public static let findSelector = NSSelectorFromString("menuItemAction_find:")
  204. public static func actions() -> [Selector] {
  205. return [self.undoSelector, self.redoSelector,
  206. self.cutSelector, self.copySelector, self.pasteSelector, self.deleteSelector,
  207. self.findSelector]
  208. }
  209. }
  210. extension KMSystemMenu.View {
  211. // scale
  212. public static let adjustWidthSelector = NSSelectorFromString("menuItemAction_adjustWidth:")
  213. public static let adjustPageSelector = NSSelectorFromString("menuItemAction_adjustPage:")
  214. public static let sizeSelector = NSSelectorFromString("menuItemAction_size:")
  215. public static let zoomOutSelector = NSSelectorFromString("menuItemAction_zoomOut:")
  216. public static let zoomInSelector = NSSelectorFromString("menuItemAction_zoomIn:")
  217. // page show
  218. public static let singlePageSelector = NSSelectorFromString("menuItemAction_singlePage:")
  219. public static let singlePageContinueSelector = NSSelectorFromString("menuItemAction_singlePageContinue:")
  220. public static let doublePageSelector = NSSelectorFromString("menuItemAction_doublePage:")
  221. public static let doublePageContinueSelector = NSSelectorFromString("menuItemAction_doublePageContinue:")
  222. public static let bookModeSelector = NSSelectorFromString("menuItemAction_bookMode:")
  223. public static let readModeSelector = NSSelectorFromString("menuItemAction_readMode:")
  224. public static let showSplitPageSelector = NSSelectorFromString("menuItemAction_showSplitPage:")
  225. public static let autoScrolSelector = NSSelectorFromString("menuItemAction_autoScrol:")
  226. public static let autoScrolSettingSelector = NSSelectorFromString("menuItemAction_autoScrolSetting:")
  227. // rotate
  228. public static let rotateLeftSelector = NSSelectorFromString("menuItemAction_rotateLeft:")
  229. public static let rotateRightSelector = NSSelectorFromString("menuItemAction_rotateRight:")
  230. public static let rotateAllPageLeftSelector = NSSelectorFromString("menuItemAction_rotateAllPageLeft:")
  231. public static let rotateAllPageRightSelector = NSSelectorFromString("menuItemAction_rotateAllPageRight:")
  232. // split screen
  233. public static let splitScreenVertiSelector = NSSelectorFromString("menuItemAction_splitScreenVerti:")
  234. public static let splitScreenHortiSelector = NSSelectorFromString("menuItemAction_splitScreenHorti:")
  235. public static let splitScreenNoSelector = NSSelectorFromString("menuItemAction_splitScreenNo:")
  236. public static let viewReadModeSelector = NSSelectorFromString("menuItemAction_view_readMode:")
  237. public static let enterFullScreenSelector = NSSelectorFromString("menuItemAction_enterFullScreen:")
  238. public static let hiddenLeftSideSelector = NSSelectorFromString("menuItemAction_hiddenLeftSide:")
  239. public static let hiddenRightSideSelector = NSSelectorFromString("menuItemAction_hiddenRightSide:")
  240. public static let thumaiSelector = NSSelectorFromString("menuItemAction_thumai:")
  241. public static let outlineSelector = NSSelectorFromString("menuItemAction_outline:")
  242. public static let bookmarkSelector = NSSelectorFromString("menuItemAction_bookmark:")
  243. public static let annotationSelector = NSSelectorFromString("menuItemAction_annotation:")
  244. public static let searchSelector = NSSelectorFromString("menuItemAction_search:")
  245. public static let topicSelector = NSSelectorFromString("menuItemAction_topic:")
  246. public static let hiddenPageIndicatorSelector = NSSelectorFromString("menuItemAction_hiddenPageIndicator:")
  247. public static func actions() -> [Selector] {
  248. return [self.adjustWidthSelector, self.adjustPageSelector, self.sizeSelector, self.zoomOutSelector, self.zoomInSelector,
  249. // page show
  250. self.singlePageSelector, self.singlePageContinueSelector, self.doublePageSelector, self.doublePageContinueSelector,
  251. self.bookModeSelector, self.readModeSelector, self.showSplitPageSelector, self.autoScrolSelector,
  252. self.autoScrolSettingSelector,
  253. // rotate
  254. self.rotateLeftSelector, self.rotateRightSelector, self.rotateAllPageLeftSelector, self.rotateAllPageRightSelector,
  255. // split screen
  256. self.splitScreenVertiSelector, self.splitScreenHortiSelector, self.splitScreenNoSelector,
  257. self.viewReadModeSelector, self.enterFullScreenSelector,
  258. self.hiddenLeftSideSelector, self.hiddenRightSideSelector,
  259. self.thumaiSelector, self.outlineSelector, self.bookmarkSelector, self.annotationSelector,
  260. self.searchSelector, self.topicSelector, self.hiddenPageIndicatorSelector]
  261. }
  262. }
  263. extension KMSystemMenu.Annotation {
  264. public static let highlightSelector = NSSelectorFromString("menuItemAction_highlight:")
  265. public static let underlineSelector = NSSelectorFromString("menuItemAction_underline:")
  266. public static let strikeOutSelector = NSSelectorFromString("menuItemAction_deleteLine:")
  267. public static let freehandSelector = NSSelectorFromString("menuItemAction_freehand:")
  268. public static let textSelector = NSSelectorFromString("menuItemAction_text:")
  269. public static let noteSelector = NSSelectorFromString("menuItemAction_note:")
  270. public static let squreSelector = NSSelectorFromString("menuItemAction_squre:")
  271. public static let circleSelector = NSSelectorFromString("menuItemAction_circle:")
  272. public static let arrowSelector = NSSelectorFromString("menuItemAction_arrow:")
  273. public static let lineSelector = NSSelectorFromString("menuItemAction_line:")
  274. public static let linkSelector = NSSelectorFromString("menuItemAction_link:")
  275. public static let linkPageSelector = NSSelectorFromString("menuItemAction_linkPage:")
  276. public static let linkHttpsSelector = NSSelectorFromString("menuItemAction_linkHttps:")
  277. public static let linkEmailSelector = NSSelectorFromString("menuItemAction_linkEmail:")
  278. public static let stampSelector = NSSelectorFromString("menuItemAction_stamp:")
  279. public static let stampStandardSelector = NSSelectorFromString("menuItemAction_stampStandard:")
  280. public static let stampDynamicSelector = NSSelectorFromString("menuItemAction_stampDynamic:")
  281. public static let stampCustomSelector = NSSelectorFromString("menuItemAction_stampCustom:")
  282. public static let signureSelector = NSSelectorFromString("menuItemAction_signure:")
  283. public static let hiddenAllSelector = NSSelectorFromString("menuItemAction_hiddenAllAnnotation:")
  284. public static let clearAllSelector = NSSelectorFromString("menuItemAction_clearAllAnnotation:")
  285. public static func actions() -> [Selector] {
  286. return [self.highlightSelector, self.underlineSelector, self.strikeOutSelector, self.freehandSelector,
  287. self.textSelector, self.noteSelector, self.squreSelector, self.circleSelector,
  288. self.arrowSelector, self.lineSelector,
  289. // link
  290. self.linkSelector, self.linkPageSelector, self.linkHttpsSelector, self.linkEmailSelector,
  291. // stamp
  292. self.stampSelector, self.stampStandardSelector, self.stampDynamicSelector, self.stampCustomSelector,
  293. // other
  294. self.signureSelector, self.hiddenAllSelector, self.clearAllSelector]
  295. }
  296. }
  297. extension KMSystemMenu.Goto {
  298. public static let nextPageSelector = NSSelectorFromString("menuItemAction_nextPage:")
  299. public static let forwardPageSelector = NSSelectorFromString("menuItemAction_forwardPage:")
  300. public static let firstPageSelector = NSSelectorFromString("menuItemAction_firstPage:")
  301. public static let lastPageSelector = NSSelectorFromString("menuItemAction_lastPage:")
  302. public static let forwardSelector = NSSelectorFromString("menuItemAction_forward:")
  303. public static let gobackSelector = NSSelectorFromString("menuItemAction_goback:")
  304. public static let gotoPageSelector = NSSelectorFromString("menuItemAction_gotoPage:")
  305. public static func actions() -> [Selector] {
  306. return [self.nextPageSelector, self.forwardPageSelector, self.firstPageSelector, self.lastPageSelector,
  307. self.forwardSelector, self.gobackSelector, self.gotoPageSelector]
  308. }
  309. }
  310. extension KMSystemMenu.Tool {
  311. public static let textToolSelector = NSSelectorFromString("menuItemAction_textTool:")
  312. public static let scrolToolSelector = NSSelectorFromString("menuItemAction_scrolTool:")
  313. public static let zoomToolSelector = NSSelectorFromString("menuItemAction_zoomOutTool:")
  314. public static let selectToolSelector = NSSelectorFromString("menuItemAction_selectTool:")
  315. public static let redactSelector = NSSelectorFromString("menuItemAction_redact:")
  316. public static let warkmarkSelector = NSSelectorFromString("menuItemAction_warkmark:")
  317. public static let backgroundSelector = NSSelectorFromString("menuItemAction_background:")
  318. public static let headerfooterSelector = NSSelectorFromString("menuItemAction_headerfooter:")
  319. public static let batesSelector = NSSelectorFromString("menuItemAction_bates:")
  320. public static let batchSelector = NSSelectorFromString("menuItemAction_batch:")
  321. public static func actions() -> [Selector] {
  322. return [self.textToolSelector, self.scrolToolSelector, self.zoomToolSelector, self.selectToolSelector,
  323. self.redactSelector, self.warkmarkSelector, self.backgroundSelector, self.headerfooterSelector,
  324. self.batesSelector, self.batchSelector]
  325. }
  326. }
  327. extension KMSystemMenu.Window {
  328. public static let showForwardTagPageSelector = NSSelectorFromString("menuItemAction_showForwardTagPage:")
  329. public static let showNextTagPageSelector = NSSelectorFromString("menuItemAction_showNextTagPage:")
  330. public static let newTagPageToNewWindowSelector = NSSelectorFromString("menuItemAction_newTagPageToNewWindow:")
  331. public static let mergeAllWindowSelector = NSSelectorFromString("menuItemAction_mergeAllWindow:")
  332. public static let currentWindowNameSelector = NSSelectorFromString("menuItemAction_currentWindowName:")
  333. public static func actions() -> [Selector] {
  334. return [self.showForwardTagPageSelector, self.showNextTagPageSelector,
  335. self.newTagPageToNewWindowSelector, self.mergeAllWindowSelector,
  336. self.currentWindowNameSelector]
  337. }
  338. }
  339. class KMSystemMenu: NSObject {
  340. public struct File {
  341. }
  342. public struct Edit {
  343. }
  344. public struct View {
  345. }
  346. public struct Annotation {
  347. }
  348. public struct Goto {
  349. }
  350. public struct Tool {
  351. }
  352. public struct Window {
  353. }
  354. public static func isFileSelector(sel: Selector) -> Bool {
  355. return KMSystemMenu.File.actions().contains(sel)
  356. }
  357. public static func isEditSelector(sel: Selector) -> Bool {
  358. return KMSystemMenu.Edit.actions().contains(sel)
  359. }
  360. public static func isViewSelector(sel: Selector) -> Bool {
  361. return KMSystemMenu.View.actions().contains(sel)
  362. }
  363. public static func isAnnotationSelector(sel: Selector) -> Bool {
  364. return KMSystemMenu.Annotation.actions().contains(sel)
  365. }
  366. public static func isGotoSelector(sel: Selector) -> Bool {
  367. return KMSystemMenu.Goto.actions().contains(sel)
  368. }
  369. public static func isToolSelector(sel: Selector) -> Bool {
  370. return KMSystemMenu.Tool.actions().contains(sel)
  371. }
  372. public static func isWindowSelector(sel: Selector) -> Bool {
  373. return KMSystemMenu.Window.actions().contains(sel)
  374. }
  375. }