From c9ce0f908b8ba75ab6281136d7dc42d37bfcf949 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Tue, 8 Feb 2022 21:17:38 +0800 Subject: [PATCH] Reset // Implementing UserPhrase Editor. --- .../Modules/IMEModules/ctlInputMethod.swift | 2 +- UserPhraseEditor/AppDelegate.swift | 50 ++ UserPhraseEditor/Content.swift | 41 + UserPhraseEditor/Document.swift | 125 +++ UserPhraseEditor/PhraseEditor-Info.plist | 29 + .../Resources/Base.lproj/Main.storyboard | 730 ++++++++++++++++++ .../Resources/Base.lproj/frmAboutWindow.xib | 206 +++++ .../Resources/en.lproj/InfoPlist.strings | 4 + .../Resources/en.lproj/frmAboutWindow.strings | 27 + UserPhraseEditor/ViewController.swift | 59 ++ UserPhraseEditor/WindowController.swift | 35 + UserPhraseEditor/ctlAboutWindow.swift | 46 ++ .../vChewingPhraseEditor.entitlements | 10 + vChewing.xcodeproj/project.pbxproj | 253 ++++++ .../xcschemes/vChewingPhraseEditor.xcscheme | 78 ++ 15 files changed, 1694 insertions(+), 1 deletion(-) create mode 100644 UserPhraseEditor/AppDelegate.swift create mode 100644 UserPhraseEditor/Content.swift create mode 100644 UserPhraseEditor/Document.swift create mode 100755 UserPhraseEditor/PhraseEditor-Info.plist create mode 100755 UserPhraseEditor/Resources/Base.lproj/Main.storyboard create mode 100644 UserPhraseEditor/Resources/Base.lproj/frmAboutWindow.xib create mode 100644 UserPhraseEditor/Resources/en.lproj/InfoPlist.strings create mode 100644 UserPhraseEditor/Resources/en.lproj/frmAboutWindow.strings create mode 100644 UserPhraseEditor/ViewController.swift create mode 100644 UserPhraseEditor/WindowController.swift create mode 100644 UserPhraseEditor/ctlAboutWindow.swift create mode 100644 UserPhraseEditor/vChewingPhraseEditor.entitlements create mode 100644 vChewing.xcodeproj/xcshareddata/xcschemes/vChewingPhraseEditor.xcscheme diff --git a/Source/Modules/IMEModules/ctlInputMethod.swift b/Source/Modules/IMEModules/ctlInputMethod.swift index 0053b5fc..3a690edb 100644 --- a/Source/Modules/IMEModules/ctlInputMethod.swift +++ b/Source/Modules/IMEModules/ctlInputMethod.swift @@ -245,7 +245,7 @@ class ctlInputMethod: IMKInputController { if !checkIfUserFilesExist() { return } - NSWorkspace.shared.openFile(path, withApplication: "TextEdit") + NSWorkspace.shared.openFile(path, withApplication: "vChewingPhraseEditor") } @objc func openUserPhrases(_ sender: Any?) { diff --git a/UserPhraseEditor/AppDelegate.swift b/UserPhraseEditor/AppDelegate.swift new file mode 100644 index 00000000..895e5327 --- /dev/null +++ b/UserPhraseEditor/AppDelegate.swift @@ -0,0 +1,50 @@ +// Copyright (c) 2021 and onwards The vChewing Project (MIT-NTL License). +/* +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +2. No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, + except as required to fulfill notice requirements above. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +import Cocoa + +@NSApplicationMain +class AppDelegate: NSObject, NSApplicationDelegate { + + private var ctlAboutWindowInstance: ctlAboutWindow? // New About Window + + func applicationDidFinishLaunching(_ aNotification: Notification) { + // Insert code here to initialize your application + } + + func applicationWillTerminate(_ aNotification: Notification) { + // Insert code here to tear down your application + } + + func applicationShouldTerminate(_ sender: NSApplication)-> NSApplication.TerminateReply { + return .terminateNow + } + // New About Window + @objc func showAbout() { + if (ctlAboutWindowInstance == nil) { + ctlAboutWindowInstance = ctlAboutWindow.init(windowNibName: "frmAboutWindow") + } + ctlAboutWindowInstance?.window?.center() + ctlAboutWindowInstance?.window?.orderFrontRegardless() // 逼著關於視窗往最前方顯示 + } + // Call the New About Window + @IBAction func about(_ sender: Any) { + (NSApp.delegate as? AppDelegate)?.showAbout() + NSApplication.shared.activate(ignoringOtherApps: true) + } +} diff --git a/UserPhraseEditor/Content.swift b/UserPhraseEditor/Content.swift new file mode 100644 index 00000000..50155a53 --- /dev/null +++ b/UserPhraseEditor/Content.swift @@ -0,0 +1,41 @@ +// Copyright (c) 2021 and onwards The vChewing Project (MIT-NTL License). +/* +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +2. No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, + except as required to fulfill notice requirements above. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +import Foundation +import Cocoa + +class Content: NSObject { + @objc dynamic var contentString = "" + + public init(contentString: String) { + self.contentString = contentString + } + +} + +extension Content { + + func read(from data: Data) { + contentString = String(bytes: data, encoding: .utf8)! + } + + func data() -> Data? { + return contentString.data(using: .utf8) + } + +} diff --git a/UserPhraseEditor/Document.swift b/UserPhraseEditor/Document.swift new file mode 100644 index 00000000..9aaef1d5 --- /dev/null +++ b/UserPhraseEditor/Document.swift @@ -0,0 +1,125 @@ +// Copyright (c) 2021 and onwards The vChewing Project (MIT-NTL License). +/* +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +2. No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, + except as required to fulfill notice requirements above. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +import Cocoa + +class Document: NSDocument { + + @objc var content = Content(contentString: "") + var contentViewController: ViewController! + + override init() { + super.init() + // Add your subclass-specific initialization here. + } + + // MARK: - Enablers + + // This enables auto save. + override class var autosavesInPlace: Bool { + return true + } + + // This enables asynchronous-writing. + override func canAsynchronouslyWrite(to url: URL, ofType typeName: String, for saveOperation: NSDocument.SaveOperationType) -> Bool { + return true + } + + // This enables asynchronous reading. + override class func canConcurrentlyReadDocuments(ofType: String) -> Bool { + return ofType == "public.plain-text" + } + + // MARK: - User Interface + + /// - Tag: makeWindowControllersExample + override func makeWindowControllers() { + // Returns the storyboard that contains your document window. + let storyboard = NSStoryboard(name: NSStoryboard.Name("Main"), bundle: nil) + if let windowController = + storyboard.instantiateController( + withIdentifier: NSStoryboard.SceneIdentifier("Document Window Controller")) as? NSWindowController { + addWindowController(windowController) + + // Set the view controller's represented object as your document. + if let contentVC = windowController.contentViewController as? ViewController { + contentVC.representedObject = content + contentViewController = contentVC + } + } + } + + // MARK: - Reading and Writing + + /// - Tag: readExample + override func read(from data: Data, ofType typeName: String) throws { + content.read(from: data) + } + + /// - Tag: writeExample + override func data(ofType typeName: String) throws -> Data { + return content.data()! + } + + // MARK: - Printing + + func thePrintInfo() -> NSPrintInfo { + let thePrintInfo = NSPrintInfo() + thePrintInfo.horizontalPagination = .fit + thePrintInfo.isHorizontallyCentered = false + thePrintInfo.isVerticallyCentered = false + + // One inch margin all the way around. + thePrintInfo.leftMargin = 72.0 + thePrintInfo.rightMargin = 72.0 + thePrintInfo.topMargin = 72.0 + thePrintInfo.bottomMargin = 72.0 + + printInfo.dictionary().setObject(NSNumber(value: true), + forKey: NSPrintInfo.AttributeKey.headerAndFooter as NSCopying) + + return thePrintInfo + } + + @objc + func printOperationDidRun( + _ printOperation: NSPrintOperation, success: Bool, contextInfo: UnsafeMutableRawPointer?) { + // Printing finished... + } + + @IBAction override func printDocument(_ sender: Any?) { + // Print the NSTextView. + + // Create a copy to manipulate for printing. + let pageSize = NSSize(width: (printInfo.paperSize.width), height: (printInfo.paperSize.height)) + let textView = NSTextView(frame: NSRect(x: 0.0, y: 0.0, width: pageSize.width, height: pageSize.height)) + + // Make sure we print on a white background. + textView.appearance = NSAppearance(named: .aqua) + + // Copy the attributed string. + textView.textStorage?.append(NSAttributedString(string: content.contentString)) + + let printOperation = NSPrintOperation(view: textView) + printOperation.runModal( + for: windowControllers[0].window!, + delegate: self, + didRun: #selector(printOperationDidRun(_:success:contextInfo:)), contextInfo: nil) + } + +} diff --git a/UserPhraseEditor/PhraseEditor-Info.plist b/UserPhraseEditor/PhraseEditor-Info.plist new file mode 100755 index 00000000..1d51c9ea --- /dev/null +++ b/UserPhraseEditor/PhraseEditor-Info.plist @@ -0,0 +1,29 @@ + + + + + CFBundleDocumentTypes + + + CFBundleTypeIconFile + + CFBundleTypeName + Plain Text + CFBundleTypeRole + Editor + LSItemContentTypes + + public.plain-text + + LSTypeIsPackage + 0 + NSDocumentClass + $(PRODUCT_MODULE_NAME).Document + + + CFBundleIconFile + + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + + diff --git a/UserPhraseEditor/Resources/Base.lproj/Main.storyboard b/UserPhraseEditor/Resources/Base.lproj/Main.storyboard new file mode 100755 index 00000000..961f9c8b --- /dev/null +++ b/UserPhraseEditor/Resources/Base.lproj/Main.storyboard @@ -0,0 +1,730 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UserPhraseEditor/Resources/Base.lproj/frmAboutWindow.xib b/UserPhraseEditor/Resources/Base.lproj/frmAboutWindow.xib new file mode 100644 index 00000000..f824e650 --- /dev/null +++ b/UserPhraseEditor/Resources/Base.lproj/frmAboutWindow.xib @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + vChewing Phrase Editor developed by Shiki Suen. +vChewing Phrase Database Maintained by Shiki Suen. + + + + + + + + + + + + + + + + + + + + + + + DISCLAIMER: The vChewing project, having no relationship of cooperation or affiliation with the OpenVanilla project, is not responsible for the phrase database shipped in the original McBopomofo project. Certain geopolitical and ideological contents, which are potentially harmful to the global spread of this software, have been removed from vChewing official phrase database. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UserPhraseEditor/Resources/en.lproj/InfoPlist.strings b/UserPhraseEditor/Resources/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..b4cee526 --- /dev/null +++ b/UserPhraseEditor/Resources/en.lproj/InfoPlist.strings @@ -0,0 +1,4 @@ +CFBundleName = "vChewing Phrase Editor"; +CFBundleDisplayName = "vChewing Phrase Editor"; +NSHumanReadableCopyright = "© 2021-2022 vChewing Project."; +CFEULAContent = "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\n1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n2. No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements above.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"; diff --git a/UserPhraseEditor/Resources/en.lproj/frmAboutWindow.strings b/UserPhraseEditor/Resources/en.lproj/frmAboutWindow.strings new file mode 100644 index 00000000..4447f0fe --- /dev/null +++ b/UserPhraseEditor/Resources/en.lproj/frmAboutWindow.strings @@ -0,0 +1,27 @@ + +/* Class = "NSButtonCell"; title = "OK"; ObjectID = "btnConfirm"; */ +"btnConfirm.title" = "OK"; + +/* Class = "NSTextFieldCell"; title = "vChewing Phrase Editor for macOS"; ObjectID = "lblAppTitle"; */ +"lblAppTitle.title" = "vChewing Phrase Editor for macOS"; + +/* Class = "NSTextFieldCell"; title = "Placeholder for showing copyright information."; ObjectID = "lblCopyright"; */ +"lblCopyright.title" = "Placeholder for showing copyright information."; + +/* Class = "NSTextFieldCell"; title = "vChewing Phrase Editor developed by Shiki Suen.\nvChewing Phrase Database Maintained by Shiki Suen."; ObjectID = "lblCredits"; */ +"lblCredits.title" = "vChewing Phrase Editor developed by Shiki Suen.\nvChewing Phrase Database Maintained by Shiki Suen."; + +/* Class = "NSTextFieldCell"; title = "DISCLAIMER: The vChewing project, having no relationship of cooperation or affiliation with the OpenVanilla project, is not responsible for the phrase database shipped in the original McBopomofo project. Certain geopolitical and ideological contents, which are potentially harmful to the global spread of this software, have been removed from vChewing official phrase database."; ObjectID = "lblDisclaimer"; */ +"lblDisclaimer.title" = "DISCLAIMER: The vChewing project, having no relationship of cooperation or affiliation with the OpenVanilla project, is not responsible for the phrase database shipped in the original McBopomofo project. Certain geopolitical and ideological contents, which are potentially harmful to the global spread of this software, have been removed from vChewing official phrase database."; + +/* Class = "NSTextFieldCell"; title = "MIT-NTL License:"; ObjectID = "lblLicense"; */ +"lblLicense.title" = "MIT-NTL License:"; + +/* Class = "NSTextFieldCell"; title = "A subproduct of the vChewing Input Method for macOS."; ObjectID = "lblProjectDescription"; */ +"lblProjectDescription.title" = "A subproduct of the vChewing Input Method for macOS."; + +/* Class = "NSTextFieldCell"; title = "version_placeholder"; ObjectID = "lblVersionString"; */ +"lblVersionString.title" = "version_placeholder"; + +/* Class = "NSWindow"; title = "About vChewing Phrase Editor for macOS"; ObjectID = "ttlAboutWindow"; */ +"ttlAboutWindow.title" = "About vChewing Phrase Editor for macOS"; diff --git a/UserPhraseEditor/ViewController.swift b/UserPhraseEditor/ViewController.swift new file mode 100644 index 00000000..20831686 --- /dev/null +++ b/UserPhraseEditor/ViewController.swift @@ -0,0 +1,59 @@ +// Copyright (c) 2021 and onwards The vChewing Project (MIT-NTL License). +/* +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +2. No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, + except as required to fulfill notice requirements above. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +import Cocoa + +class ViewController: NSViewController, NSTextViewDelegate { + + /// - Tag: setRepresentedObjectExample + override var representedObject: Any? { + didSet { + // Pass down the represented object to all of the child view controllers. + for child in children { + child.representedObject = representedObject + } + } + } + + weak var document: Document? { + if let docRepresentedObject = representedObject as? Document { + return docRepresentedObject + } + return nil + } + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + } + + override func viewDidAppear() { + super.viewDidAppear() + } + + // MARK: - NSTextViewDelegate + + func textDidBeginEditing(_ notification: Notification) { + document?.objectDidBeginEditing(self) + } + + func textDidEndEditing(_ notification: Notification) { + document?.objectDidEndEditing(self) + } + +} diff --git a/UserPhraseEditor/WindowController.swift b/UserPhraseEditor/WindowController.swift new file mode 100644 index 00000000..3d101202 --- /dev/null +++ b/UserPhraseEditor/WindowController.swift @@ -0,0 +1,35 @@ +// Copyright (c) 2021 and onwards The vChewing Project (MIT-NTL License). +/* +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +2. No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, + except as required to fulfill notice requirements above. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +import Cocoa + +class WindowController: NSWindowController, NSWindowDelegate { + + override func windowDidLoad() { + super.windowDidLoad() + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + /** NSWindows loaded from the storyboard will be cascaded + based on the original frame of the window in the storyboard. + */ + shouldCascadeWindows = true + } + +} diff --git a/UserPhraseEditor/ctlAboutWindow.swift b/UserPhraseEditor/ctlAboutWindow.swift new file mode 100644 index 00000000..4fd33f79 --- /dev/null +++ b/UserPhraseEditor/ctlAboutWindow.swift @@ -0,0 +1,46 @@ +// Copyright (c) 2011 and onwards The OpenVanilla Project (MIT License). +// All possible vChewing-specific modifications are (c) 2021 and onwards The vChewing Project (MIT-NTL License). +/* +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +2. No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, + except as required to fulfill notice requirements above. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +import Cocoa + +@objc(AboutWindow) class ctlAboutWindow: NSWindowController { + @IBOutlet weak var appVersionLabel: NSTextField! + @IBOutlet weak var appCopyrightLabel: NSTextField! + @IBOutlet var appEULAContent: NSTextView! + + override func windowDidLoad() { + super.windowDidLoad() + + window?.standardWindowButton(.closeButton)?.isHidden = true + window?.standardWindowButton(.miniaturizeButton)?.isHidden = true + window?.standardWindowButton(.zoomButton)?.isHidden = true + guard let installingVersion = Bundle.main.infoDictionary?[kCFBundleVersionKey as String] as? String, + let versionString = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String else { + return + } + if let copyrightLabel = Bundle.main.localizedInfoDictionary?["NSHumanReadableCopyright"] as? String { + appCopyrightLabel.stringValue = copyrightLabel + } + if let eulaContent = Bundle.main.localizedInfoDictionary?["CFEULAContent"] as? String { + appEULAContent.string = eulaContent + } + appVersionLabel.stringValue = String(format: "%@ Build %@", versionString, installingVersion) + } + +} diff --git a/UserPhraseEditor/vChewingPhraseEditor.entitlements b/UserPhraseEditor/vChewingPhraseEditor.entitlements new file mode 100644 index 00000000..19afff14 --- /dev/null +++ b/UserPhraseEditor/vChewingPhraseEditor.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-write + + + diff --git a/vChewing.xcodeproj/project.pbxproj b/vChewing.xcodeproj/project.pbxproj index 095ec3b3..2082859f 100644 --- a/vChewing.xcodeproj/project.pbxproj +++ b/vChewing.xcodeproj/project.pbxproj @@ -30,6 +30,7 @@ 5B62A34A27AE7CD900A19448 /* NotifierController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B62A34527AE7CD900A19448 /* NotifierController.swift */; }; 5B62A35227AE822400A19448 /* OpenCC in Frameworks */ = {isa = PBXBuildFile; productRef = 5B62A35127AE822400A19448 /* OpenCC */; }; 5B62A35327AE89C400A19448 /* InputSourceHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B62A33127AE792F00A19448 /* InputSourceHelper.swift */; }; + 5B73FB5E27B2BE1300E9BF49 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5B73FB6027B2BE1300E9BF49 /* InfoPlist.strings */; }; 5B7BC4B027AFFBE800F66C24 /* frmPrefWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5B7BC4AE27AFFBE800F66C24 /* frmPrefWindow.xib */; }; 5BBBB75F27AED54C0023B93A /* Beep.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 5BBBB75D27AED54C0023B93A /* Beep.m4a */; }; 5BBBB76027AED54C0023B93A /* Fart.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 5BBBB75E27AED54C0023B93A /* Fart.m4a */; }; @@ -41,6 +42,15 @@ 5BBBB77627AED70B0023B93A /* MenuIcon-TCVIM.png in Resources */ = {isa = PBXBuildFile; fileRef = 5BBBB77227AED70B0023B93A /* MenuIcon-TCVIM.png */; }; 5BBBB77A27AEDC690023B93A /* clsSFX.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BBBB77927AEDC690023B93A /* clsSFX.swift */; }; 5BD05B8127B22F3C004C4F1D /* char-kanji-cns.txt in Resources */ = {isa = PBXBuildFile; fileRef = 5BD05B8027B22F3C004C4F1D /* char-kanji-cns.txt */; }; + 5BD05BCA27B2A43D004C4F1D /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6A2E40F5253A69DA00D1AE1D /* Images.xcassets */; }; + 5BD05C5D27B2BBA9004C4F1D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5BD05C5B27B2BBA9004C4F1D /* Main.storyboard */; }; + 5BD05C6627B2BBEF004C4F1D /* Document.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BD05C6127B2BBEF004C4F1D /* Document.swift */; }; + 5BD05C6727B2BBEF004C4F1D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BD05C6227B2BBEF004C4F1D /* AppDelegate.swift */; }; + 5BD05C6827B2BBEF004C4F1D /* Content.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BD05C6327B2BBEF004C4F1D /* Content.swift */; }; + 5BD05C6927B2BBEF004C4F1D /* WindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BD05C6427B2BBEF004C4F1D /* WindowController.swift */; }; + 5BD05C6A27B2BBEF004C4F1D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BD05C6527B2BBEF004C4F1D /* ViewController.swift */; }; + 5BE78BD927B3775B005EA1BE /* ctlAboutWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BE78BD827B37750005EA1BE /* ctlAboutWindow.swift */; }; + 5BE78BDD27B3776D005EA1BE /* frmAboutWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BE78BDA27B37764005EA1BE /* frmAboutWindow.xib */; }; 6A0D4F4515FC0EB100ABF4B3 /* Mandarin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6A0D4F2015FC0EB100ABF4B3 /* Mandarin.cpp */; }; 6A187E2616004C5900466B2E /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6A187E2816004C5900466B2E /* MainMenu.xib */; }; 6A225A1F23679F2600F685C6 /* NotarizedArchives in Resources */ = {isa = PBXBuildFile; fileRef = 6A225A1E23679F2600F685C6 /* NotarizedArchives */; }; @@ -75,6 +85,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 5B0AF8B227B2C4E20096FE54 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6A0D4E9415FC0CFA00ABF4B3 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 5BD05BB727B2A429004C4F1D; + remoteInfo = vChewingPhraseEditor; + }; 6A38BC2515FC131100A8A51F /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 6A0D4E9415FC0CFA00ABF4B3 /* Project object */; @@ -129,6 +146,8 @@ 5B62A34127AE7CD900A19448 /* VerticalCandidateController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VerticalCandidateController.swift; sourceTree = ""; }; 5B62A34327AE7CD900A19448 /* TooltipController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TooltipController.swift; sourceTree = ""; }; 5B62A34527AE7CD900A19448 /* NotifierController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotifierController.swift; sourceTree = ""; }; + 5B73FB5427B2BD6900E9BF49 /* PhraseEditor-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "PhraseEditor-Info.plist"; path = "UserPhraseEditor/PhraseEditor-Info.plist"; sourceTree = SOURCE_ROOT; }; + 5B73FB5F27B2BE1300E9BF49 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 5B7BC4AF27AFFBE800F66C24 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Source/WindowNIBs/Base.lproj/frmPrefWindow.xib; sourceTree = ""; }; 5B7BC4B227AFFC0B00F66C24 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Source/WindowNIBs/en.lproj/frmPrefWindow.strings; sourceTree = ""; }; 5BBBB75D27AED54C0023B93A /* Beep.m4a */ = {isa = PBXFileReference; lastKnownFileType = file; path = Beep.m4a; sourceTree = ""; }; @@ -142,6 +161,17 @@ 5BBBB77727AEDB290023B93A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/MainMenu.strings; sourceTree = ""; }; 5BBBB77927AEDC690023B93A /* clsSFX.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = clsSFX.swift; sourceTree = ""; }; 5BD05B8027B22F3C004C4F1D /* char-kanji-cns.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "char-kanji-cns.txt"; path = "Data/components/common/char-kanji-cns.txt"; sourceTree = ""; }; + 5BD05BB827B2A429004C4F1D /* vChewingPhraseEditor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = vChewingPhraseEditor.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 5BD05BC627B2A42A004C4F1D /* vChewingPhraseEditor.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = vChewingPhraseEditor.entitlements; sourceTree = ""; }; + 5BD05C5C27B2BBA9004C4F1D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 5BD05C6127B2BBEF004C4F1D /* Document.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Document.swift; sourceTree = ""; }; + 5BD05C6227B2BBEF004C4F1D /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 5BD05C6327B2BBEF004C4F1D /* Content.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Content.swift; sourceTree = ""; }; + 5BD05C6427B2BBEF004C4F1D /* WindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WindowController.swift; sourceTree = ""; }; + 5BD05C6527B2BBEF004C4F1D /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 5BE78BD827B37750005EA1BE /* ctlAboutWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ctlAboutWindow.swift; sourceTree = ""; }; + 5BE78BDB27B37764005EA1BE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/frmAboutWindow.xib; sourceTree = ""; }; + 5BE78BDF27B37968005EA1BE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/frmAboutWindow.strings; sourceTree = ""; }; 6A0D4EA215FC0D2D00ABF4B3 /* vChewing.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = vChewing.app; sourceTree = BUILT_PRODUCTS_DIR; }; 6A0D4EF515FC0DA600ABF4B3 /* IME-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "IME-Info.plist"; sourceTree = ""; }; 6A0D4EF615FC0DA600ABF4B3 /* vChewing-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "vChewing-Prefix.pch"; sourceTree = ""; }; @@ -206,6 +236,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 5BD05BB527B2A429004C4F1D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 6A0D4E9F15FC0D2D00ABF4B3 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -486,12 +523,39 @@ path = Resources; sourceTree = ""; }; + 5BD05BB927B2A429004C4F1D /* UserPhraseEditor */ = { + isa = PBXGroup; + children = ( + 5BE78BD827B37750005EA1BE /* ctlAboutWindow.swift */, + 5BD05C5A27B2BB6E004C4F1D /* Resources */, + 5BD05BC627B2A42A004C4F1D /* vChewingPhraseEditor.entitlements */, + 5BD05C6227B2BBEF004C4F1D /* AppDelegate.swift */, + 5BD05C6327B2BBEF004C4F1D /* Content.swift */, + 5BD05C6127B2BBEF004C4F1D /* Document.swift */, + 5BD05C6527B2BBEF004C4F1D /* ViewController.swift */, + 5BD05C6427B2BBEF004C4F1D /* WindowController.swift */, + 5B73FB5427B2BD6900E9BF49 /* PhraseEditor-Info.plist */, + ); + path = UserPhraseEditor; + sourceTree = ""; + }; + 5BD05C5A27B2BB6E004C4F1D /* Resources */ = { + isa = PBXGroup; + children = ( + 5BE78BDA27B37764005EA1BE /* frmAboutWindow.xib */, + 5B73FB6027B2BE1300E9BF49 /* InfoPlist.strings */, + 5BD05C5B27B2BBA9004C4F1D /* Main.storyboard */, + ); + path = Resources; + sourceTree = ""; + }; 6A0D4E9215FC0CFA00ABF4B3 = { isa = PBXGroup; children = ( 6ACA41E715FC1D9000935EF6 /* Installer */, 6A0D4EC215FC0D3C00ABF4B3 /* Source */, D427F766278C9CBD004A2160 /* Packages */, + 5BD05BB927B2A429004C4F1D /* UserPhraseEditor */, 6A0D4EA315FC0D2D00ABF4B3 /* Products */, D47D73C127A7200500255A50 /* Frameworks */, ); @@ -502,6 +566,7 @@ children = ( 6A0D4EA215FC0D2D00ABF4B3 /* vChewing.app */, 6ACA41CB15FC1D7500935EF6 /* vChewingInstaller.app */, + 5BD05BB827B2A429004C4F1D /* vChewingPhraseEditor.app */, ); name = Products; sourceTree = ""; @@ -613,6 +678,23 @@ /* End PBXLegacyTarget section */ /* Begin PBXNativeTarget section */ + 5BD05BB727B2A429004C4F1D /* vChewingPhraseEditor */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5BD05BC927B2A42A004C4F1D /* Build configuration list for PBXNativeTarget "vChewingPhraseEditor" */; + buildPhases = ( + 5BD05BB427B2A429004C4F1D /* Sources */, + 5BD05BB527B2A429004C4F1D /* Frameworks */, + 5BD05BB627B2A429004C4F1D /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = vChewingPhraseEditor; + productName = vChewingPhraseEditor; + productReference = 5BD05BB827B2A429004C4F1D /* vChewingPhraseEditor.app */; + productType = "com.apple.product-type.application"; + }; 6A0D4EA115FC0D2D00ABF4B3 /* vChewing */ = { isa = PBXNativeTarget; buildConfigurationList = 6A0D4EC015FC0D2E00ABF4B3 /* Build configuration list for PBXNativeTarget "vChewing" */; @@ -624,6 +706,7 @@ buildRules = ( ); dependencies = ( + 5B0AF8B327B2C4E20096FE54 /* PBXTargetDependency */, 6A38BC2615FC131100A8A51F /* PBXTargetDependency */, ); name = vChewing; @@ -664,6 +747,10 @@ LastSwiftUpdateCheck = 1320; LastUpgradeCheck = 1310; TargetAttributes = { + 5BD05BB727B2A429004C4F1D = { + CreatedOnToolsVersion = 13.2; + LastSwiftMigration = 1320; + }; 6A0D4EA115FC0D2D00ABF4B3 = { LastSwiftMigration = 1240; }; @@ -689,12 +776,24 @@ targets = ( 6A0D4EA115FC0D2D00ABF4B3 /* vChewing */, 6ACA41CA15FC1D7500935EF6 /* vChewingInstaller */, + 5BD05BB727B2A429004C4F1D /* vChewingPhraseEditor */, 6A38BC2115FC12FD00A8A51F /* Data */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 5BD05BB627B2A429004C4F1D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5BD05BCA27B2A43D004C4F1D /* Images.xcassets in Resources */, + 5B73FB5E27B2BE1300E9BF49 /* InfoPlist.strings in Resources */, + 5BD05C5D27B2BBA9004C4F1D /* Main.storyboard in Resources */, + 5BE78BDD27B3776D005EA1BE /* frmAboutWindow.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 6A0D4EA015FC0D2D00ABF4B3 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -754,6 +853,19 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 5BD05BB427B2A429004C4F1D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5BD05C6A27B2BBEF004C4F1D /* ViewController.swift in Sources */, + 5BD05C6727B2BBEF004C4F1D /* AppDelegate.swift in Sources */, + 5BD05C6927B2BBEF004C4F1D /* WindowController.swift in Sources */, + 5BD05C6627B2BBEF004C4F1D /* Document.swift in Sources */, + 5BD05C6827B2BBEF004C4F1D /* Content.swift in Sources */, + 5BE78BD927B3775B005EA1BE /* ctlAboutWindow.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 6A0D4E9E15FC0D2D00ABF4B3 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -813,6 +925,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 5B0AF8B327B2C4E20096FE54 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 5BD05BB727B2A429004C4F1D /* vChewingPhraseEditor */; + targetProxy = 5B0AF8B227B2C4E20096FE54 /* PBXContainerItemProxy */; + }; 6A38BC2615FC131100A8A51F /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 6A38BC2115FC12FD00A8A51F /* Data */; @@ -826,6 +943,14 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ + 5B73FB6027B2BE1300E9BF49 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 5B73FB5F27B2BE1300E9BF49 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; 5B7BC4AE27AFFBE800F66C24 /* frmPrefWindow.xib */ = { isa = PBXVariantGroup; children = ( @@ -852,6 +977,23 @@ name = frmAboutWindow.xib; sourceTree = ""; }; + 5BD05C5B27B2BBA9004C4F1D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 5BD05C5C27B2BBA9004C4F1D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 5BE78BDA27B37764005EA1BE /* frmAboutWindow.xib */ = { + isa = PBXVariantGroup; + children = ( + 5BE78BDB27B37764005EA1BE /* Base */, + 5BE78BDF27B37968005EA1BE /* en */, + ); + name = frmAboutWindow.xib; + sourceTree = ""; + }; 6A187E2816004C5900466B2E /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( @@ -906,6 +1048,108 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 5BD05BC727B2A42A004C4F1D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = vChewingPhraseEditor/vChewingPhraseEditor.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1919; + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "UserPhraseEditor/PhraseEditor-Info.plist"; + INFOPLIST_KEY_NSHumanReadableCopyright = "© 2021-2022 vChewing Project."; + INFOPLIST_KEY_NSMainStoryboardFile = Main; + INFOPLIST_KEY_NSPrincipalClass = NSApplication; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.11.5; + MARKETING_VERSION = 1.3.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.atelierInmu.vChewing.vChewingPhraseEditor; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 5BD05BC827B2A42A004C4F1D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = vChewingPhraseEditor/vChewingPhraseEditor.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1919; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "UserPhraseEditor/PhraseEditor-Info.plist"; + INFOPLIST_KEY_NSHumanReadableCopyright = "© 2021-2022 vChewing Project."; + INFOPLIST_KEY_NSMainStoryboardFile = Main; + INFOPLIST_KEY_NSPrincipalClass = NSApplication; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.11.5; + MARKETING_VERSION = 1.3.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.atelierInmu.vChewing.vChewingPhraseEditor; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; 6A0D4E9915FC0CFA00ABF4B3 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1257,6 +1501,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 5BD05BC927B2A42A004C4F1D /* Build configuration list for PBXNativeTarget "vChewingPhraseEditor" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5BD05BC727B2A42A004C4F1D /* Debug */, + 5BD05BC827B2A42A004C4F1D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 6A0D4E9715FC0CFA00ABF4B3 /* Build configuration list for PBXProject "vChewing" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/vChewing.xcodeproj/xcshareddata/xcschemes/vChewingPhraseEditor.xcscheme b/vChewing.xcodeproj/xcshareddata/xcschemes/vChewingPhraseEditor.xcscheme new file mode 100644 index 00000000..2a9821d5 --- /dev/null +++ b/vChewing.xcodeproj/xcshareddata/xcschemes/vChewingPhraseEditor.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +