diff --git a/Packages/vChewing_PopupCompositionBuffer/.gitignore b/Packages/vChewing_PopupCompositionBuffer/.gitignore new file mode 100644 index 00000000..3b298120 --- /dev/null +++ b/Packages/vChewing_PopupCompositionBuffer/.gitignore @@ -0,0 +1,9 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj +xcuserdata/ +DerivedData/ +.swiftpm/config/registries.json +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +.netrc diff --git a/Packages/vChewing_PopupCompositionBuffer/Package.swift b/Packages/vChewing_PopupCompositionBuffer/Package.swift new file mode 100644 index 00000000..e8ac4343 --- /dev/null +++ b/Packages/vChewing_PopupCompositionBuffer/Package.swift @@ -0,0 +1,26 @@ +// swift-tools-version:5.3 +import PackageDescription + +let package = Package( + name: "PopupCompositionBuffer", + platforms: [ + .macOS(.v10_11) + ], + products: [ + .library( + name: "PopupCompositionBuffer", + targets: ["PopupCompositionBuffer"] + ) + ], + dependencies: [ + .package(path: "../vChewing_Shared") + ], + targets: [ + .target( + name: "PopupCompositionBuffer", + dependencies: [ + .product(name: "Shared", package: "vChewing_Shared") + ] + ) + ] +) diff --git a/Packages/vChewing_PopupCompositionBuffer/README.md b/Packages/vChewing_PopupCompositionBuffer/README.md new file mode 100644 index 00000000..eb32ca75 --- /dev/null +++ b/Packages/vChewing_PopupCompositionBuffer/README.md @@ -0,0 +1,13 @@ +# NotifierUI + +威注音的浮動組字窗。 + +``` +// (c) 2021 and onwards The vChewing Project (MIT-NTL License). +// ==================== +// This code is released under the MIT license (SPDX-License-Identifier: MIT) +// ... with NTL restriction stating that: +// 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 defined in MIT License. +``` diff --git a/Source/Modules/UIModules/PopupCompositionBufferUI/ctlPopupCompositionBuffer.swift b/Packages/vChewing_PopupCompositionBuffer/Sources/PopupCompositionBuffer/PopupCompositionBuffer.swift similarity index 98% rename from Source/Modules/UIModules/PopupCompositionBufferUI/ctlPopupCompositionBuffer.swift rename to Packages/vChewing_PopupCompositionBuffer/Sources/PopupCompositionBuffer/PopupCompositionBuffer.swift index bbb2ea97..3d4a0780 100644 --- a/Source/Modules/UIModules/PopupCompositionBufferUI/ctlPopupCompositionBuffer.swift +++ b/Packages/vChewing_PopupCompositionBuffer/Sources/PopupCompositionBuffer/PopupCompositionBuffer.swift @@ -6,9 +6,10 @@ // marks, or product names of Contributor, except as required to fulfill notice // requirements defined in MIT License. +import Cocoa import Shared -public class ctlPopupCompositionBuffer: NSWindowController { +public class PopupCompositionBuffer: NSWindowController { public var isTypingDirectionVertical = false { didSet { if #unavailable(macOS 10.14) { diff --git a/Source/Modules/ctlInputMethod_Core.swift b/Source/Modules/ctlInputMethod_Core.swift index 258a035e..17667e37 100644 --- a/Source/Modules/ctlInputMethod_Core.swift +++ b/Source/Modules/ctlInputMethod_Core.swift @@ -10,6 +10,7 @@ import IMKUtils import NotifierUI +import PopupCompositionBuffer import Shared import ShiftKeyUpChecker import Tekkon @@ -36,7 +37,7 @@ class ctlInputMethod: IMKInputController { static var tooltipInstance = TooltipUI() /// 浮動組字窗的共用副本。 - static var popupCompositionBuffer = ctlPopupCompositionBuffer() + static var popupCompositionBuffer = PopupCompositionBuffer() // MARK: - diff --git a/Source/Modules/ctlInputMethod_HandleStates.swift b/Source/Modules/ctlInputMethod_HandleStates.swift index b21f2e69..b390d376 100644 --- a/Source/Modules/ctlInputMethod_HandleStates.swift +++ b/Source/Modules/ctlInputMethod_HandleStates.swift @@ -8,6 +8,7 @@ // marks, or product names of Contributor, except as required to fulfill notice // requirements defined in MIT License. +import PopupCompositionBuffer import Shared // MARK: - 狀態調度 (State Handling) diff --git a/vChewing.xcodeproj/project.pbxproj b/vChewing.xcodeproj/project.pbxproj index 1095950c..1992f12e 100644 --- a/vChewing.xcodeproj/project.pbxproj +++ b/vChewing.xcodeproj/project.pbxproj @@ -20,7 +20,6 @@ 5B40113C28D71C0100A9D4CB /* Uninstaller in Frameworks */ = {isa = PBXBuildFile; productRef = 5B40113B28D71C0100A9D4CB /* Uninstaller */; }; 5B62A33D27AE7CC100A19448 /* ctlAboutWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B62A33C27AE7CC100A19448 /* ctlAboutWindow.swift */; }; 5B62A34727AE7CD900A19448 /* ctlCandidate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B62A34027AE7CD900A19448 /* ctlCandidate.swift */; }; - 5B630A3C28CC97020010D076 /* ctlPopupCompositionBuffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B630A3B28CC97020010D076 /* ctlPopupCompositionBuffer.swift */; }; 5B6C141228A9D4B30098ADF8 /* ctlInputMethod_HandleEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B6C141128A9D4B30098ADF8 /* ctlInputMethod_HandleEvent.swift */; }; 5B73FB5E27B2BE1300E9BF49 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5B73FB6027B2BE1300E9BF49 /* InfoPlist.strings */; }; 5B782EC4280C243C007276DE /* KeyHandler_HandleCandidate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B782EC3280C243C007276DE /* KeyHandler_HandleCandidate.swift */; }; @@ -58,6 +57,7 @@ 5BC447A628656A1900EDC323 /* Placeholder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BC447A228656A1900EDC323 /* Placeholder.swift */; }; 5BC5E01E28DDE4770094E427 /* NotifierUI in Frameworks */ = {isa = PBXBuildFile; productRef = 5BC5E01D28DDE4770094E427 /* NotifierUI */; }; 5BC5E02128DDEFE00094E427 /* TooltipUI in Frameworks */ = {isa = PBXBuildFile; productRef = 5BC5E02028DDEFE00094E427 /* TooltipUI */; }; + 5BC5E02428DE07860094E427 /* PopupCompositionBuffer in Frameworks */ = {isa = PBXBuildFile; productRef = 5BC5E02328DE07860094E427 /* PopupCompositionBuffer */; }; 5BCCAFF828DB19A300AB1B27 /* PrefMgr_Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BCCAFF728DB19A300AB1B27 /* PrefMgr_Extension.swift */; }; 5BD0113D2818543900609769 /* KeyHandler_Core.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BD0113C2818543900609769 /* KeyHandler_Core.swift */; }; 5BD05BCA27B2A43D004C4F1D /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6A2E40F5253A69DA00D1AE1D /* Images.xcassets */; }; @@ -205,7 +205,6 @@ 5B40113A28D71B8700A9D4CB /* vChewing_Uninstaller */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = vChewing_Uninstaller; path = Packages/vChewing_Uninstaller; sourceTree = ""; }; 5B62A33C27AE7CC100A19448 /* ctlAboutWindow.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; fileEncoding = 4; indentWidth = 2; lineEnding = 0; path = ctlAboutWindow.swift; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; 5B62A34027AE7CD900A19448 /* ctlCandidate.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; fileEncoding = 4; indentWidth = 2; lineEnding = 0; path = ctlCandidate.swift; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; - 5B630A3B28CC97020010D076 /* ctlPopupCompositionBuffer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ctlPopupCompositionBuffer.swift; sourceTree = ""; }; 5B65B919284D0185007C558B /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 5B6C141128A9D4B30098ADF8 /* ctlInputMethod_HandleEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ctlInputMethod_HandleEvent.swift; sourceTree = ""; }; 5B73FB5427B2BD6900E9BF49 /* PhraseEditor-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "PhraseEditor-Info.plist"; path = "UserPhraseEditor/PhraseEditor-Info.plist"; sourceTree = SOURCE_ROOT; }; @@ -246,6 +245,7 @@ 5BC447AB2865BEF500EDC323 /* AUTHORS */ = {isa = PBXFileReference; lastKnownFileType = text; path = AUTHORS; sourceTree = ""; }; 5BC5E01C28DDE4270094E427 /* vChewing_NotifierUI */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = vChewing_NotifierUI; path = Packages/vChewing_NotifierUI; sourceTree = ""; }; 5BC5E01F28DDEFD80094E427 /* vChewing_TooltipUI */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = vChewing_TooltipUI; path = Packages/vChewing_TooltipUI; sourceTree = ""; }; + 5BC5E02228DE07250094E427 /* vChewing_PopupCompositionBuffer */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = vChewing_PopupCompositionBuffer; path = Packages/vChewing_PopupCompositionBuffer; sourceTree = ""; }; 5BCCAFF728DB19A300AB1B27 /* PrefMgr_Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrefMgr_Extension.swift; sourceTree = ""; }; 5BD0113C2818543900609769 /* KeyHandler_Core.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; fileEncoding = 4; lineEnding = 0; path = KeyHandler_Core.swift; sourceTree = ""; usesTabs = 0; }; 5BD05BB827B2A429004C4F1D /* vChewingPhraseEditor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = vChewingPhraseEditor.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -337,6 +337,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 5BC5E02428DE07860094E427 /* PopupCompositionBuffer in Frameworks */, 5BDB7A4528D4824A001AC277 /* ShiftKeyUpChecker in Frameworks */, 5BFC63CC28D49BBC004A77B7 /* UpdateSputnik in Frameworks */, 5BDB7A4128D4824A001AC277 /* Megrez in Frameworks */, @@ -436,7 +437,6 @@ isa = PBXGroup; children = ( 5B62A33E27AE7CD900A19448 /* CandidateUI */, - 5B630A3A28CC96D80010D076 /* PopupCompositionBufferUI */, 5BA9FD0927FED9F3002DE248 /* PrefUI */, ); path = UIModules; @@ -486,14 +486,6 @@ name = Data; sourceTree = ""; }; - 5B630A3A28CC96D80010D076 /* PopupCompositionBufferUI */ = { - isa = PBXGroup; - children = ( - 5B630A3B28CC97020010D076 /* ctlPopupCompositionBuffer.swift */, - ); - path = PopupCompositionBufferUI; - sourceTree = ""; - }; 5BA9FD0927FED9F3002DE248 /* PrefUI */ = { isa = PBXGroup; children = ( @@ -581,6 +573,7 @@ 5BDB7A3328D47587001AC277 /* vChewing_Megrez */, 5BC5E01C28DDE4270094E427 /* vChewing_NotifierUI */, 5B98114628D6198000CBC605 /* vChewing_PinyinPhonaConverter */, + 5BC5E02228DE07250094E427 /* vChewing_PopupCompositionBuffer */, 5B963C9E28D5C14600DCEE88 /* vChewing_Shared */, 5B963CA128D5C22D00DCEE88 /* vChewing_SwiftExtension */, 5BDB7A3628D47587001AC277 /* vChewing_Tekkon */, @@ -783,6 +776,7 @@ 5B40113B28D71C0100A9D4CB /* Uninstaller */, 5BC5E01D28DDE4770094E427 /* NotifierUI */, 5BC5E02028DDEFE00094E427 /* TooltipUI */, + 5BC5E02328DE07860094E427 /* PopupCompositionBuffer */, ); productName = vChewing; productReference = 6A0D4EA215FC0D2D00ABF4B3 /* vChewing.app */; @@ -1075,7 +1069,6 @@ 5BA9FD1127FEDB6B002DE248 /* ctlPrefUI.swift in Sources */, 5B8457A12871ADBE00C93B01 /* ChineseConverterBridge.swift in Sources */, 5BA9FD1327FEDB6B002DE248 /* suiPrefPaneDictionary.swift in Sources */, - 5B630A3C28CC97020010D076 /* ctlPopupCompositionBuffer.swift in Sources */, 5BFDF011289635C100417BBC /* ctlCandidateIMK.swift in Sources */, 5B62A34727AE7CD900A19448 /* ctlCandidate.swift in Sources */, 5BB802DA27FABA8300CF1C19 /* ctlInputMethod_Menu.swift in Sources */, @@ -1785,6 +1778,10 @@ isa = XCSwiftPackageProductDependency; productName = TooltipUI; }; + 5BC5E02328DE07860094E427 /* PopupCompositionBuffer */ = { + isa = XCSwiftPackageProductDependency; + productName = PopupCompositionBuffer; + }; 5BDB7A3828D4824A001AC277 /* BookmarkManager */ = { isa = XCSwiftPackageProductDependency; productName = BookmarkManager;