Merge branch 'master' into 0.9.9.x
|
@ -0,0 +1,15 @@
|
|||
name: Build
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: macOS-latest
|
||||
env:
|
||||
DEVELOPER_DIR: /Applications/Xcode_12.app/Contents/Developer
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Clean
|
||||
run: xcodebuild -scheme McBopomofo -configuration Release clean
|
||||
- name: Build
|
||||
run: xcodebuild -scheme McBopomofo -configuration Release
|
|
@ -7,3 +7,7 @@ build
|
|||
project.xcworkspace
|
||||
xcuserdata
|
||||
Credits.rtf
|
||||
# the executable we used to count the occurance of a string in a file
|
||||
# that can be built by make -C Source/Data/bin/C_Version
|
||||
# C_count.occ.exe
|
||||
.idea
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objectVersion = 52;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
|
@ -14,7 +14,6 @@
|
|||
6A0D4ED315FC0D6400ABF4B3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A0D4EC815FC0D6400ABF4B3 /* main.m */; };
|
||||
6A0D4ED415FC0D6400ABF4B3 /* OVInputSourceHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A0D4ECA15FC0D6400ABF4B3 /* OVInputSourceHelper.m */; };
|
||||
6A0D4ED515FC0D6400ABF4B3 /* PreferencesWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A0D4ECC15FC0D6400ABF4B3 /* PreferencesWindowController.m */; };
|
||||
6A0D4ED615FC0D6400ABF4B3 /* UpdateNotificationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A0D4ECE15FC0D6400ABF4B3 /* UpdateNotificationController.m */; };
|
||||
6A0D4EFE15FC0DA600ABF4B3 /* VTCandidateController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A0D4EDA15FC0DA600ABF4B3 /* VTCandidateController.m */; };
|
||||
6A0D4EFF15FC0DA600ABF4B3 /* VTHorizontalCandidateController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A0D4EDC15FC0DA600ABF4B3 /* VTHorizontalCandidateController.m */; };
|
||||
6A0D4F0015FC0DA600ABF4B3 /* VTHorizontalCandidateView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A0D4EDE15FC0DA600ABF4B3 /* VTHorizontalCandidateView.m */; };
|
||||
|
@ -24,19 +23,16 @@
|
|||
6A0D4F0815FC0DA600ABF4B3 /* Bopomofo.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 6A0D4EEF15FC0DA600ABF4B3 /* Bopomofo.tiff */; };
|
||||
6A0D4F0915FC0DA600ABF4B3 /* Bopomofo@2x.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 6A0D4EF015FC0DA600ABF4B3 /* Bopomofo@2x.tiff */; };
|
||||
6A0D4F4515FC0EB100ABF4B3 /* Mandarin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6A0D4F2015FC0EB100ABF4B3 /* Mandarin.cpp */; };
|
||||
6A0D4F5215FC0EE100ABF4B3 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6A0D4F4C15FC0EE100ABF4B3 /* MainMenu.xib */; };
|
||||
6A0D4F5315FC0EE100ABF4B3 /* preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6A0D4F4E15FC0EE100ABF4B3 /* preferences.xib */; };
|
||||
6A0D4F5715FC0EF900ABF4B3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6A0D4F4815FC0EE100ABF4B3 /* InfoPlist.strings */; };
|
||||
6A0D4F5815FC0EF900ABF4B3 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6A0D4F4A15FC0EE100ABF4B3 /* Localizable.strings */; };
|
||||
6A187E2616004C5900466B2E /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6A187E2816004C5900466B2E /* MainMenu.xib */; };
|
||||
6A225A1F23679F2600F685C6 /* NotarizedArchives in Resources */ = {isa = PBXBuildFile; fileRef = 6A225A1E23679F2600F685C6 /* NotarizedArchives */; };
|
||||
6A225A232367A1D700F685C6 /* ArchiveUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A225A222367A1D700F685C6 /* ArchiveUtil.m */; };
|
||||
6A2E40F6253A69DA00D1AE1D /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6A2E40F5253A69DA00D1AE1D /* Images.xcassets */; };
|
||||
6A2E40F9253A6AA000D1AE1D /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6A2E40F5253A69DA00D1AE1D /* Images.xcassets */; };
|
||||
6A38BC1515FC117A00A8A51F /* data.txt in Resources */ = {isa = PBXBuildFile; fileRef = 6A38BBF615FC117A00A8A51F /* data.txt */; };
|
||||
6A38BC1D15FC11C700A8A51F /* UpdateNotificationController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6A38BC1F15FC11C700A8A51F /* UpdateNotificationController.xib */; };
|
||||
6A38BC2815FC158A00A8A51F /* InputMethodKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A38BC2715FC158A00A8A51F /* InputMethodKit.framework */; };
|
||||
6A38BC2A15FC161000A8A51F /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A38BC2915FC161000A8A51F /* Carbon.framework */; };
|
||||
6A719D0415FC5FD200C8B8E3 /* McBopomofo.iconset in Resources */ = {isa = PBXBuildFile; fileRef = 6A719D0315FC5FD200C8B8E3 /* McBopomofo.iconset */; };
|
||||
6A719D0515FC5FD200C8B8E3 /* McBopomofo.iconset in Resources */ = {isa = PBXBuildFile; fileRef = 6A719D0315FC5FD200C8B8E3 /* McBopomofo.iconset */; };
|
||||
6AA67FEB15FC5B0D00B5A308 /* BopomofoTextMenu.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 6AA67FE915FC5B0D00B5A308 /* BopomofoTextMenu.tiff */; };
|
||||
6AA67FEC15FC5B0D00B5A308 /* BopomofoTextMenu@2x.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 6AA67FEA15FC5B0D00B5A308 /* BopomofoTextMenu@2x.tiff */; };
|
||||
6ACA41CD15FC1D7500935EF6 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A0D4EA615FC0D2D00ABF4B3 /* Cocoa.framework */; };
|
||||
6ACA41F915FC1D9000935EF6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6ACA41E915FC1D9000935EF6 /* AppDelegate.m */; };
|
||||
6ACA41FA15FC1D9000935EF6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6ACA41EA15FC1D9000935EF6 /* InfoPlist.strings */; };
|
||||
|
@ -49,6 +45,10 @@
|
|||
6AE210B215FC63CC003659FE /* PlainBopomofo.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 6AE210B015FC63CC003659FE /* PlainBopomofo.tiff */; };
|
||||
6AE210B315FC63CC003659FE /* PlainBopomofo@2x.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 6AE210B115FC63CC003659FE /* PlainBopomofo@2x.tiff */; };
|
||||
6AE30A491F7F40B7008735BD /* UserOverrideModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6AE30A471F7F40B7008735BD /* UserOverrideModel.cpp */; };
|
||||
6AFF97F2253B299E007F1C49 /* OVNonModalAlertWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6AFF97F0253B299E007F1C49 /* OVNonModalAlertWindowController.xib */; };
|
||||
6AFF97F3253B299E007F1C49 /* OVNonModalAlertWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AFF97F1253B299E007F1C49 /* OVNonModalAlertWindowController.m */; };
|
||||
D427A9C125ED28CC005D43E0 /* OpenCCBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = D427A9C025ED28CC005D43E0 /* OpenCCBridge.swift */; };
|
||||
D48550A325EBE689006A204C /* OpenCC in Frameworks */ = {isa = PBXBuildFile; productRef = D48550A225EBE689006A204C /* OpenCC */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
|
@ -84,8 +84,6 @@
|
|||
6A0D4ECA15FC0D6400ABF4B3 /* OVInputSourceHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OVInputSourceHelper.m; sourceTree = "<group>"; };
|
||||
6A0D4ECB15FC0D6400ABF4B3 /* PreferencesWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreferencesWindowController.h; sourceTree = "<group>"; };
|
||||
6A0D4ECC15FC0D6400ABF4B3 /* PreferencesWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreferencesWindowController.m; sourceTree = "<group>"; };
|
||||
6A0D4ECD15FC0D6400ABF4B3 /* UpdateNotificationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UpdateNotificationController.h; sourceTree = "<group>"; };
|
||||
6A0D4ECE15FC0D6400ABF4B3 /* UpdateNotificationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UpdateNotificationController.m; sourceTree = "<group>"; };
|
||||
6A0D4ED915FC0DA600ABF4B3 /* VTCandidateController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VTCandidateController.h; sourceTree = "<group>"; };
|
||||
6A0D4EDA15FC0DA600ABF4B3 /* VTCandidateController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VTCandidateController.m; sourceTree = "<group>"; };
|
||||
6A0D4EDB15FC0DA600ABF4B3 /* VTHorizontalCandidateController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VTHorizontalCandidateController.h; sourceTree = "<group>"; };
|
||||
|
@ -149,12 +147,17 @@
|
|||
6A0D4F4215FC0EB100ABF4B3 /* OVWildcard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OVWildcard.h; sourceTree = "<group>"; };
|
||||
6A0D4F4915FC0EE100ABF4B3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Source/en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
6A0D4F4B15FC0EE100ABF4B3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Source/en.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
6A0D4F4F15FC0EE100ABF4B3 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = Source/en.lproj/preferences.xib; sourceTree = "<group>"; };
|
||||
6A0D4F5415FC0EF900ABF4B3 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "Source/zh-Hant.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
|
||||
6A0D4F5515FC0EF900ABF4B3 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "Source/zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
|
||||
6A0D4F5615FC0EF900ABF4B3 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "zh-Hant"; path = "Source/zh-Hant.lproj/preferences.xib"; sourceTree = "<group>"; };
|
||||
6A187E2716004C5900466B2E /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
6A15B32421A51F2300B92CD3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
6A15B32521A51F2300B92CD3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
6A15B32721A51F2300B92CD3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Source/Base.lproj/preferences.xib; sourceTree = "<group>"; };
|
||||
6A187E2916004C7300466B2E /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "zh-Hant"; path = "zh-Hant.lproj/MainMenu.xib"; sourceTree = "<group>"; };
|
||||
6A225A1E23679F2600F685C6 /* NotarizedArchives */ = {isa = PBXFileReference; lastKnownFileType = folder; path = NotarizedArchives; sourceTree = "<group>"; };
|
||||
6A225A212367A1D700F685C6 /* ArchiveUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArchiveUtil.h; sourceTree = "<group>"; };
|
||||
6A225A222367A1D700F685C6 /* ArchiveUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ArchiveUtil.m; sourceTree = "<group>"; };
|
||||
6A2E40F5253A69DA00D1AE1D /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
|
||||
6A38BBDE15FC117A00A8A51F /* 4_in_5.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 4_in_5.txt; sourceTree = "<group>"; };
|
||||
6A38BBDF15FC117A00A8A51F /* 4_in_6.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 4_in_6.txt; sourceTree = "<group>"; };
|
||||
6A38BBE015FC117A00A8A51F /* 5_in_6.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 5_in_6.txt; sourceTree = "<group>"; };
|
||||
|
@ -186,20 +189,13 @@
|
|||
6A38BBFB15FC117A00A8A51F /* phrase.occ */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = phrase.occ; sourceTree = "<group>"; };
|
||||
6A38BBFC15FC117A00A8A51F /* PhraseFreq.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PhraseFreq.txt; sourceTree = "<group>"; };
|
||||
6A38BBFD15FC117A00A8A51F /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
|
||||
6A38BC1E15FC11C700A8A51F /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "zh-Hant"; path = "zh-Hant.lproj/UpdateNotificationController.xib"; sourceTree = "<group>"; };
|
||||
6A38BC2015FC11CE00A8A51F /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/UpdateNotificationController.xib; sourceTree = "<group>"; };
|
||||
6A38BC2715FC158A00A8A51F /* InputMethodKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = InputMethodKit.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/InputMethodKit.framework; sourceTree = DEVELOPER_DIR; };
|
||||
6A38BC2915FC161000A8A51F /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Carbon.framework; sourceTree = DEVELOPER_DIR; };
|
||||
6A719D0315FC5FD200C8B8E3 /* McBopomofo.iconset */ = {isa = PBXFileReference; lastKnownFileType = folder.iconset; path = McBopomofo.iconset; sourceTree = "<group>"; };
|
||||
6AA67FE915FC5B0D00B5A308 /* BopomofoTextMenu.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = BopomofoTextMenu.tiff; sourceTree = "<group>"; };
|
||||
6AA67FEA15FC5B0D00B5A308 /* BopomofoTextMenu@2x.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "BopomofoTextMenu@2x.tiff"; sourceTree = "<group>"; };
|
||||
6ACA41CB15FC1D7500935EF6 /* McBopomofoInstaller.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = McBopomofoInstaller.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
6ACA41E815FC1D9000935EF6 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Source/Installer/AppDelegate.h; sourceTree = SOURCE_ROOT; };
|
||||
6ACA41E915FC1D9000935EF6 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Source/Installer/AppDelegate.m; sourceTree = SOURCE_ROOT; };
|
||||
6ACA41EB15FC1D9000935EF6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
6ACA41ED15FC1D9000935EF6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/License.rtf; sourceTree = "<group>"; };
|
||||
6ACA41EF15FC1D9000935EF6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
6ACA41F115FC1D9000935EF6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
6ACA41F215FC1D9000935EF6 /* Installer-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "Installer-Info.plist"; path = "Source/Installer/Installer-Info.plist"; sourceTree = SOURCE_ROOT; };
|
||||
6ACA41F315FC1D9000935EF6 /* Installer-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Installer-Prefix.pch"; path = "Source/Installer/Installer-Prefix.pch"; sourceTree = SOURCE_ROOT; };
|
||||
6ACA41F415FC1D9000935EF6 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Source/Installer/main.m; sourceTree = SOURCE_ROOT; };
|
||||
|
@ -212,6 +208,11 @@
|
|||
6AE210B115FC63CC003659FE /* PlainBopomofo@2x.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "PlainBopomofo@2x.tiff"; sourceTree = "<group>"; };
|
||||
6AE30A471F7F40B7008735BD /* UserOverrideModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserOverrideModel.cpp; sourceTree = "<group>"; };
|
||||
6AE30A481F7F40B7008735BD /* UserOverrideModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserOverrideModel.h; sourceTree = "<group>"; };
|
||||
6AFF97EF253B299E007F1C49 /* OVNonModalAlertWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OVNonModalAlertWindowController.h; sourceTree = "<group>"; };
|
||||
6AFF97F0253B299E007F1C49 /* OVNonModalAlertWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = OVNonModalAlertWindowController.xib; sourceTree = "<group>"; };
|
||||
6AFF97F1253B299E007F1C49 /* OVNonModalAlertWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OVNonModalAlertWindowController.m; sourceTree = "<group>"; };
|
||||
D427A9BF25ED28CC005D43E0 /* McBopomofo-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "McBopomofo-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
D427A9C025ED28CC005D43E0 /* OpenCCBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenCCBridge.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
@ -219,8 +220,8 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6A38BC2A15FC161000A8A51F /* Carbon.framework in Frameworks */,
|
||||
6A38BC2815FC158A00A8A51F /* InputMethodKit.framework in Frameworks */,
|
||||
D48550A325EBE689006A204C /* OpenCC in Frameworks */,
|
||||
6A0D4EA715FC0D2D00ABF4B3 /* Cocoa.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -258,7 +259,6 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
6A0D4EA915FC0D2D00ABF4B3 /* AppKit.framework */,
|
||||
6A38BC2915FC161000A8A51F /* Carbon.framework */,
|
||||
6A0D4EA615FC0D2D00ABF4B3 /* Cocoa.framework */,
|
||||
6A0D4EAB15FC0D2D00ABF4B3 /* Foundation.framework */,
|
||||
6A38BC2715FC158A00A8A51F /* InputMethodKit.framework */,
|
||||
|
@ -280,6 +280,8 @@
|
|||
6A0D4EC715FC0D6400ABF4B3 /* InputMethodController.mm */,
|
||||
6A0D4EC815FC0D6400ABF4B3 /* main.m */,
|
||||
6A0D4EF615FC0DA600ABF4B3 /* McBopomofo-Prefix.pch */,
|
||||
6AFF97EF253B299E007F1C49 /* OVNonModalAlertWindowController.h */,
|
||||
6AFF97F1253B299E007F1C49 /* OVNonModalAlertWindowController.m */,
|
||||
6A0D4EC915FC0D6400ABF4B3 /* OVInputSourceHelper.h */,
|
||||
6A0D4ECA15FC0D6400ABF4B3 /* OVInputSourceHelper.m */,
|
||||
6A0D4ECB15FC0D6400ABF4B3 /* PreferencesWindowController.h */,
|
||||
|
@ -288,6 +290,8 @@
|
|||
6A0D4ECE15FC0D6400ABF4B3 /* UpdateNotificationController.m */,
|
||||
6AE30A471F7F40B7008735BD /* UserOverrideModel.cpp */,
|
||||
6AE30A481F7F40B7008735BD /* UserOverrideModel.h */,
|
||||
D427A9C025ED28CC005D43E0 /* OpenCCBridge.swift */,
|
||||
D427A9BF25ED28CC005D43E0 /* McBopomofo-Bridging-Header.h */,
|
||||
);
|
||||
path = Source;
|
||||
sourceTree = "<group>";
|
||||
|
@ -314,11 +318,9 @@
|
|||
6A0D4EEE15FC0DA600ABF4B3 /* Images */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6A2E40F5253A69DA00D1AE1D /* Images.xcassets */,
|
||||
6A0D4EEF15FC0DA600ABF4B3 /* Bopomofo.tiff */,
|
||||
6A0D4EF015FC0DA600ABF4B3 /* Bopomofo@2x.tiff */,
|
||||
6AA67FE915FC5B0D00B5A308 /* BopomofoTextMenu.tiff */,
|
||||
6AA67FEA15FC5B0D00B5A308 /* BopomofoTextMenu@2x.tiff */,
|
||||
6A719D0315FC5FD200C8B8E3 /* McBopomofo.iconset */,
|
||||
6AE210B015FC63CC003659FE /* PlainBopomofo.tiff */,
|
||||
6AE210B115FC63CC003659FE /* PlainBopomofo@2x.tiff */,
|
||||
);
|
||||
|
@ -406,12 +408,12 @@
|
|||
6A0D4F4715FC0EB900ABF4B3 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6AFF97F0253B299E007F1C49 /* OVNonModalAlertWindowController.xib */,
|
||||
6A0D4EEE15FC0DA600ABF4B3 /* Images */,
|
||||
6A0D4EF515FC0DA600ABF4B3 /* McBopomofo-Info.plist */,
|
||||
6A0D4F4815FC0EE100ABF4B3 /* InfoPlist.strings */,
|
||||
6A0D4F4A15FC0EE100ABF4B3 /* Localizable.strings */,
|
||||
6A187E2816004C5900466B2E /* MainMenu.xib */,
|
||||
6A38BC1F15FC11C700A8A51F /* UpdateNotificationController.xib */,
|
||||
6A0D4F4E15FC0EE100ABF4B3 /* preferences.xib */,
|
||||
);
|
||||
name = Resources;
|
||||
|
@ -467,6 +469,9 @@
|
|||
6ACA41E715FC1D9000935EF6 /* Installer */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6A225A212367A1D700F685C6 /* ArchiveUtil.h */,
|
||||
6A225A222367A1D700F685C6 /* ArchiveUtil.m */,
|
||||
6A225A1E23679F2600F685C6 /* NotarizedArchives */,
|
||||
6ACA41E815FC1D9000935EF6 /* AppDelegate.h */,
|
||||
6ACA41E915FC1D9000935EF6 /* AppDelegate.m */,
|
||||
6ACA41EA15FC1D9000935EF6 /* InfoPlist.strings */,
|
||||
|
@ -514,6 +519,9 @@
|
|||
6A38BC2615FC131100A8A51F /* PBXTargetDependency */,
|
||||
);
|
||||
name = McBopomofo;
|
||||
packageProductDependencies = (
|
||||
D48550A225EBE689006A204C /* OpenCC */,
|
||||
);
|
||||
productName = McBopomofo;
|
||||
productReference = 6A0D4EA215FC0D2D00ABF4B3 /* McBopomofo.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
|
@ -525,6 +533,7 @@
|
|||
6ACA41C715FC1D7500935EF6 /* Sources */,
|
||||
6ACA41C815FC1D7500935EF6 /* Frameworks */,
|
||||
6ACA41C915FC1D7500935EF6 /* Resources */,
|
||||
6A225A2023679F5F00F685C6 /* ShellScript */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
|
@ -542,17 +551,26 @@
|
|||
6A0D4E9415FC0CFA00ABF4B3 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0500;
|
||||
LastUpgradeCheck = 1220;
|
||||
TargetAttributes = {
|
||||
6A0D4EA115FC0D2D00ABF4B3 = {
|
||||
LastSwiftMigration = 1240;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 6A0D4E9715FC0CFA00ABF4B3 /* Build configuration list for PBXProject "McBopomofo" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
"zh-Hant",
|
||||
Base,
|
||||
);
|
||||
mainGroup = 6A0D4E9215FC0CFA00ABF4B3;
|
||||
packageReferences = (
|
||||
D48550A125EBE689006A204C /* XCRemoteSwiftPackageReference "SwiftyOpenCC" */,
|
||||
);
|
||||
productRefGroup = 6A0D4EA315FC0D2D00ABF4B3 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
|
@ -569,17 +587,14 @@
|
|||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6A38BC1D15FC11C700A8A51F /* UpdateNotificationController.xib in Resources */,
|
||||
6A0D4F0815FC0DA600ABF4B3 /* Bopomofo.tiff in Resources */,
|
||||
6A0D4F0915FC0DA600ABF4B3 /* Bopomofo@2x.tiff in Resources */,
|
||||
6A0D4F5215FC0EE100ABF4B3 /* MainMenu.xib in Resources */,
|
||||
6A0D4F5315FC0EE100ABF4B3 /* preferences.xib in Resources */,
|
||||
6A0D4F5715FC0EF900ABF4B3 /* InfoPlist.strings in Resources */,
|
||||
6A0D4F5815FC0EF900ABF4B3 /* Localizable.strings in Resources */,
|
||||
6A2E40F6253A69DA00D1AE1D /* Images.xcassets in Resources */,
|
||||
6A38BC1515FC117A00A8A51F /* data.txt in Resources */,
|
||||
6AA67FEB15FC5B0D00B5A308 /* BopomofoTextMenu.tiff in Resources */,
|
||||
6AA67FEC15FC5B0D00B5A308 /* BopomofoTextMenu@2x.tiff in Resources */,
|
||||
6A719D0415FC5FD200C8B8E3 /* McBopomofo.iconset in Resources */,
|
||||
6AFF97F2253B299E007F1C49 /* OVNonModalAlertWindowController.xib in Resources */,
|
||||
6AE210B215FC63CC003659FE /* PlainBopomofo.tiff in Resources */,
|
||||
6AE210B315FC63CC003659FE /* PlainBopomofo@2x.tiff in Resources */,
|
||||
6AD7CBC815FE555000691B5B /* data-plain-bpmf.txt in Resources */,
|
||||
|
@ -592,16 +607,37 @@
|
|||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6ACA420215FC1E5200935EF6 /* McBopomofo.app in Resources */,
|
||||
6A2E40F9253A6AA000D1AE1D /* Images.xcassets in Resources */,
|
||||
6ACA41FA15FC1D9000935EF6 /* InfoPlist.strings in Resources */,
|
||||
6A225A1F23679F2600F685C6 /* NotarizedArchives in Resources */,
|
||||
6ACA41FB15FC1D9000935EF6 /* License.rtf in Resources */,
|
||||
6ACA41FC15FC1D9000935EF6 /* Localizable.strings in Resources */,
|
||||
6ACA41FD15FC1D9000935EF6 /* MainMenu.xib in Resources */,
|
||||
6A719D0515FC5FD200C8B8E3 /* McBopomofo.iconset in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
6A225A2023679F5F00F685C6 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "# Remove the README.md in the NotarizedArchives directory\nrm -f \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/NotarizedArchives/README.md\"\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
6A0D4E9E15FC0D2D00ABF4B3 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
|
@ -612,14 +648,15 @@
|
|||
6A0D4ED315FC0D6400ABF4B3 /* main.m in Sources */,
|
||||
6A0D4ED415FC0D6400ABF4B3 /* OVInputSourceHelper.m in Sources */,
|
||||
6A0D4ED515FC0D6400ABF4B3 /* PreferencesWindowController.m in Sources */,
|
||||
6A0D4ED615FC0D6400ABF4B3 /* UpdateNotificationController.m in Sources */,
|
||||
6A0D4EFE15FC0DA600ABF4B3 /* VTCandidateController.m in Sources */,
|
||||
6A0D4EFF15FC0DA600ABF4B3 /* VTHorizontalCandidateController.m in Sources */,
|
||||
6A0D4F0015FC0DA600ABF4B3 /* VTHorizontalCandidateView.m in Sources */,
|
||||
6AFF97F3253B299E007F1C49 /* OVNonModalAlertWindowController.m in Sources */,
|
||||
6A0D4F0115FC0DA600ABF4B3 /* VTVerticalCandidateController.m in Sources */,
|
||||
6AE30A491F7F40B7008735BD /* UserOverrideModel.cpp in Sources */,
|
||||
6A0D4F0215FC0DA600ABF4B3 /* VTVerticalCandidateTableView.m in Sources */,
|
||||
6A0D4F0315FC0DA600ABF4B3 /* VTVerticalKeyLabelStripView.m in Sources */,
|
||||
D427A9C125ED28CC005D43E0 /* OpenCCBridge.swift in Sources */,
|
||||
6A0D4F4515FC0EB100ABF4B3 /* Mandarin.cpp in Sources */,
|
||||
6A0421A815FEF3F50061ED63 /* FastLM.cpp in Sources */,
|
||||
);
|
||||
|
@ -630,6 +667,7 @@
|
|||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6ACA41F915FC1D9000935EF6 /* AppDelegate.m in Sources */,
|
||||
6A225A232367A1D700F685C6 /* ArchiveUtil.m in Sources */,
|
||||
6ACA41FF15FC1D9000935EF6 /* main.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -670,19 +708,11 @@
|
|||
path = ..;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6A0D4F4C15FC0EE100ABF4B3 /* MainMenu.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
);
|
||||
name = MainMenu.xib;
|
||||
path = /Users/lukhnos/projects/McBopomofo;
|
||||
sourceTree = "<absolute>";
|
||||
};
|
||||
6A0D4F4E15FC0EE100ABF4B3 /* preferences.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
6A0D4F4F15FC0EE100ABF4B3 /* en */,
|
||||
6A0D4F5615FC0EF900ABF4B3 /* zh-Hant */,
|
||||
6A15B32721A51F2300B92CD3 /* Base */,
|
||||
);
|
||||
name = preferences.xib;
|
||||
path = ..;
|
||||
|
@ -691,21 +721,12 @@
|
|||
6A187E2816004C5900466B2E /* MainMenu.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
6A187E2716004C5900466B2E /* en */,
|
||||
6A187E2916004C7300466B2E /* zh-Hant */,
|
||||
6A15B32521A51F2300B92CD3 /* Base */,
|
||||
);
|
||||
name = MainMenu.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6A38BC1F15FC11C700A8A51F /* UpdateNotificationController.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
6A38BC1E15FC11C700A8A51F /* zh-Hant */,
|
||||
6A38BC2015FC11CE00A8A51F /* en */,
|
||||
);
|
||||
name = UpdateNotificationController.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6ACA41EA15FC1D9000935EF6 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
|
@ -739,8 +760,8 @@
|
|||
6ACA41F015FC1D9000935EF6 /* MainMenu.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
6ACA41F115FC1D9000935EF6 /* en */,
|
||||
6ACA41F815FC1D9000935EF6 /* zh-Hant */,
|
||||
6A15B32421A51F2300B92CD3 /* Base */,
|
||||
);
|
||||
name = MainMenu.xib;
|
||||
path = Source/Installer;
|
||||
|
@ -752,12 +773,78 @@
|
|||
6A0D4E9915FC0CFA00ABF4B3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_CPLUSPLUSFLAGS = (
|
||||
"$(OTHER_CFLAGS)",
|
||||
"-fcxx-modules",
|
||||
);
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
6A0D4E9A15FC0CFA00ABF4B3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
OTHER_CPLUSPLUSFLAGS = (
|
||||
"$(OTHER_CFLAGS)",
|
||||
"-fcxx-modules",
|
||||
);
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
@ -765,13 +852,17 @@
|
|||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_IMPLICIT_SIGN_CONVERSION = NO;
|
||||
CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
|
||||
CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
|
@ -801,10 +892,18 @@
|
|||
GCC_WARN_UNUSED_LABEL = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = "Source/McBopomofo-Info.plist";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.openvanilla.inputmethod.McBopomofo;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = macosx;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Source/McBopomofo-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Debug;
|
||||
|
@ -813,13 +912,17 @@
|
|||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_IMPLICIT_SIGN_CONVERSION = NO;
|
||||
CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
|
||||
CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
|
@ -843,9 +946,16 @@
|
|||
GCC_WARN_UNUSED_LABEL = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = "Source/McBopomofo-Info.plist";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.openvanilla.inputmethod.McBopomofo;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = macosx;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Source/McBopomofo-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
|
@ -855,6 +965,7 @@
|
|||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
|
@ -873,7 +984,7 @@
|
|||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_CFLAGS = "";
|
||||
OTHER_LDFLAGS = "";
|
||||
|
@ -887,6 +998,7 @@
|
|||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
|
@ -897,7 +1009,7 @@
|
|||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
||||
OTHER_CFLAGS = "";
|
||||
OTHER_LDFLAGS = "";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
|
@ -909,9 +1021,12 @@
|
|||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
|
@ -925,13 +1040,15 @@
|
|||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = "Source/Installer/Installer-Info.plist";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.openvanilla.McBopomofo.${PRODUCT_NAME:rfc1034identifier}";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = macosx;
|
||||
WRAPPER_EXTENSION = app;
|
||||
|
@ -942,9 +1059,12 @@
|
|||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
|
@ -952,12 +1072,14 @@
|
|||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "Source/Installer/Installer-Prefix.pch";
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = "Source/Installer/Installer-Info.plist";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.openvanilla.McBopomofo.${PRODUCT_NAME:rfc1034identifier}";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = macosx;
|
||||
WRAPPER_EXTENSION = app;
|
||||
|
@ -1004,6 +1126,25 @@
|
|||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
|
||||
/* Begin XCRemoteSwiftPackageReference section */
|
||||
D48550A125EBE689006A204C /* XCRemoteSwiftPackageReference "SwiftyOpenCC" */ = {
|
||||
isa = XCRemoteSwiftPackageReference;
|
||||
repositoryURL = "https://github.com/ddddxxx/SwiftyOpenCC.git";
|
||||
requirement = {
|
||||
kind = revision;
|
||||
revision = 1d8105a0f7199c90af722bff62728050c858e777;
|
||||
};
|
||||
};
|
||||
/* End XCRemoteSwiftPackageReference section */
|
||||
|
||||
/* Begin XCSwiftPackageProductDependency section */
|
||||
D48550A225EBE689006A204C /* OpenCC */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
package = D48550A125EBE689006A204C /* XCRemoteSwiftPackageReference "SwiftyOpenCC" */;
|
||||
productName = OpenCC;
|
||||
};
|
||||
/* End XCSwiftPackageProductDependency section */
|
||||
};
|
||||
rootObject = 6A0D4E9415FC0CFA00ABF4B3 /* Project object */;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1240"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "6A0D4EA115FC0D2D00ABF4B3"
|
||||
BuildableName = "McBopomofo.app"
|
||||
BlueprintName = "McBopomofo"
|
||||
ReferencedContainer = "container:McBopomofo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "6A0D4EA115FC0D2D00ABF4B3"
|
||||
BuildableName = "McBopomofo.app"
|
||||
BlueprintName = "McBopomofo"
|
||||
ReferencedContainer = "container:McBopomofo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "6A0D4EA115FC0D2D00ABF4B3"
|
||||
BuildableName = "McBopomofo.app"
|
||||
BlueprintName = "McBopomofo"
|
||||
ReferencedContainer = "container:McBopomofo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
|
@ -0,0 +1,78 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1240"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "6ACA41CA15FC1D7500935EF6"
|
||||
BuildableName = "McBopomofoInstaller.app"
|
||||
BlueprintName = "McBopomofoInstaller"
|
||||
ReferencedContainer = "container:McBopomofo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "6ACA41CA15FC1D7500935EF6"
|
||||
BuildableName = "McBopomofoInstaller.app"
|
||||
BlueprintName = "McBopomofoInstaller"
|
||||
ReferencedContainer = "container:McBopomofo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "6ACA41CA15FC1D7500935EF6"
|
||||
BuildableName = "McBopomofoInstaller.app"
|
||||
BlueprintName = "McBopomofoInstaller"
|
||||
ReferencedContainer = "container:McBopomofo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
|
@ -1,5 +1,16 @@
|
|||
# OpenVanilla McBopomofo 小麥注音輸入法
|
||||
|
||||
## 開發流程
|
||||
|
||||
用 Xcode 開啟 `McBopomofo.xcodeproj`,選 "McBopomofo Installer" target,build
|
||||
完之後直接執行該安裝程式,就可以安裝小麥注音。
|
||||
|
||||
第一次安裝完,日後程式碼或詞庫有任何修改,只要重複上述流程,再次安裝小麥注音即可。
|
||||
|
||||
要注意的是 macOS 可能會限制同一次 login session 能 kill 同一個輸入法 process 的次數(
|
||||
安裝程式透過 process killing來讓新版的輸入法生效)。如果安裝若干次後,發現程式修改的結果並
|
||||
沒有出現,或甚至輸入法已無法再選用,只要登出目前帳號再重新登入即可。
|
||||
|
||||
## 軟體授權
|
||||
|
||||
本專案主要程式碼以及編譯後軟體採用 MIT License 釋出,使用者可自由使用、散播本軟體,惟散播本輸入法的原始碼時必須保持軟體完整原始碼、不得修改版權文字。
|
||||
|
|
|
@ -35,21 +35,20 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class PreferencesWindowController;
|
||||
@class UpdateNotificationController;
|
||||
|
||||
@interface AppDelegate : NSObject <NSApplicationDelegate>
|
||||
{
|
||||
@private
|
||||
NSWindow *_window;
|
||||
NSURLConnection *_updateCheckConnection;
|
||||
BOOL _currentUpdateCheckIsForced;
|
||||
NSMutableData *_receivingData;
|
||||
NSURL *_updateNextStepURL;
|
||||
PreferencesWindowController *_preferencesWindowController;
|
||||
UpdateNotificationController *_updateNotificationController;
|
||||
}
|
||||
|
||||
- (void)checkForUpdate;
|
||||
- (void)checkForUpdateForced:(BOOL)forced;
|
||||
- (void)showPreferences;
|
||||
|
||||
@property (assign, nonatomic) IBOutlet NSWindow *window;
|
||||
@property (weak, nonatomic) IBOutlet NSWindow *window;
|
||||
@end
|
||||
|
|
|
@ -33,18 +33,19 @@
|
|||
//
|
||||
|
||||
#import "AppDelegate.h"
|
||||
#import "UpdateNotificationController.h"
|
||||
#import "OVNonModalAlertWindowController.h"
|
||||
#import "PreferencesWindowController.h"
|
||||
|
||||
void LTLoadLanguageModel();
|
||||
extern void LTLoadLanguageModel(void);
|
||||
|
||||
static NSString *kCheckUpdateAutomatically = @"CheckUpdateAutomatically";
|
||||
static NSString *kNextUpdateCheckDateKey = @"NextUpdateCheckDate";
|
||||
static NSString *kUpdateInfoEndpointKey = @"UpdateInfoEndpoint";
|
||||
static NSString *kUpdateInfoSiteKey = @"UpdateInfoSite";
|
||||
static const NSTimeInterval kNextCheckInterval = 86400.0;
|
||||
static const NSTimeInterval kTimeoutInterval = 60.0;
|
||||
|
||||
@interface AppDelegate () <NSURLConnectionDataDelegate>
|
||||
@interface AppDelegate () <NSURLConnectionDataDelegate, OVNonModalAlertWindowControllerDelegate>
|
||||
@end
|
||||
|
||||
@implementation AppDelegate
|
||||
|
@ -52,16 +53,19 @@ static const NSTimeInterval kTimeoutInterval = 60.0;
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_preferencesWindowController release];
|
||||
[_updateCheckConnection release];
|
||||
[_updateNotificationController release];
|
||||
[super dealloc];
|
||||
_preferencesWindowController = nil;
|
||||
_updateCheckConnection = nil;
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)inNotification
|
||||
{
|
||||
LTLoadLanguageModel();
|
||||
|
||||
if (![[NSUserDefaults standardUserDefaults] objectForKey:kCheckUpdateAutomatically]) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kCheckUpdateAutomatically];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
|
||||
[self checkForUpdate];
|
||||
}
|
||||
|
||||
|
@ -77,8 +81,14 @@ static const NSTimeInterval kTimeoutInterval = 60.0;
|
|||
return;
|
||||
}
|
||||
|
||||
_currentUpdateCheckIsForced = forced;
|
||||
|
||||
// time for update?
|
||||
if (!forced) {
|
||||
if (![[NSUserDefaults standardUserDefaults] boolForKey:kCheckUpdateAutomatically]) {
|
||||
return;
|
||||
}
|
||||
|
||||
NSDate *now = [NSDate date];
|
||||
NSDate *date = [[NSUserDefaults standardUserDefaults] objectForKey:kNextUpdateCheckDateKey];
|
||||
if (![date isKindOfClass:[NSDate class]]) {
|
||||
|
@ -113,7 +123,6 @@ static const NSTimeInterval kTimeoutInterval = 60.0;
|
|||
#endif
|
||||
|
||||
if (_receivingData) {
|
||||
[_receivingData release];
|
||||
_receivingData = nil;
|
||||
}
|
||||
|
||||
|
@ -134,25 +143,39 @@ static const NSTimeInterval kTimeoutInterval = 60.0;
|
|||
|
||||
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
|
||||
{
|
||||
[_receivingData release];
|
||||
BOOL isForcedCheck = _currentUpdateCheckIsForced;
|
||||
|
||||
_receivingData = nil;
|
||||
[_updateCheckConnection release];
|
||||
_updateCheckConnection = nil;
|
||||
_currentUpdateCheckIsForced = NO;
|
||||
|
||||
if (isForcedCheck) {
|
||||
[[OVNonModalAlertWindowController sharedInstance] showWithTitle:NSLocalizedString(@"Update Check Failed", nil) content:[NSString stringWithFormat:NSLocalizedString(@"There may be no internet connection or the server failed to respond.\n\nError message: %@", nil), [error localizedDescription]] confirmButtonTitle:NSLocalizedString(@"Dismiss", nil) cancelButtonTitle:nil cancelAsDefault:NO delegate:nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)showNoUpdateAvailableAlert
|
||||
{
|
||||
[[OVNonModalAlertWindowController sharedInstance] showWithTitle:NSLocalizedString(@"Check for Update Completed", nil) content:NSLocalizedString(@"You are already using the latest version of McBopomofo.", nil) confirmButtonTitle:NSLocalizedString(@"OK", nil) cancelButtonTitle:nil cancelAsDefault:NO delegate:nil];
|
||||
}
|
||||
|
||||
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
|
||||
{
|
||||
id plist = [NSPropertyListSerialization propertyListFromData:_receivingData mutabilityOption:NSPropertyListImmutable format:NULL errorDescription:NULL];
|
||||
id plist = [NSPropertyListSerialization propertyListWithData:_receivingData options:NSPropertyListImmutable format:NULL error:NULL];
|
||||
#if DEBUG
|
||||
NSLog(@"plist %@",plist);
|
||||
#endif
|
||||
|
||||
[_receivingData release];
|
||||
BOOL isForcedCheck = _currentUpdateCheckIsForced;
|
||||
|
||||
_receivingData = nil;
|
||||
[_updateCheckConnection release];
|
||||
_updateCheckConnection = nil;
|
||||
_currentUpdateCheckIsForced = NO;
|
||||
|
||||
if (!plist) {
|
||||
if (isForcedCheck) {
|
||||
[self showNoUpdateAvailableAlert];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -161,6 +184,9 @@ static const NSTimeInterval kTimeoutInterval = 60.0;
|
|||
NSLog(@"the remoteversion is %@",remoteVersion);
|
||||
#endif
|
||||
if (!remoteVersion) {
|
||||
if (isForcedCheck) {
|
||||
[self showNoUpdateAvailableAlert];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -172,41 +198,74 @@ static const NSTimeInterval kTimeoutInterval = 60.0;
|
|||
NSComparisonResult result = [currentVersion compare:remoteVersion options:NSNumericSearch];
|
||||
|
||||
if (result != NSOrderedAscending) {
|
||||
if (isForcedCheck) {
|
||||
[self showNoUpdateAvailableAlert];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
NSString *siteInfoURLString = [plist objectForKey:kUpdateInfoSiteKey];
|
||||
if (!siteInfoURLString) {
|
||||
if (isForcedCheck) {
|
||||
[self showNoUpdateAvailableAlert];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
NSURL *siteInfoURL = [NSURL URLWithString:siteInfoURLString];
|
||||
if (!siteInfoURL) {
|
||||
if (isForcedCheck) {
|
||||
[self showNoUpdateAvailableAlert];
|
||||
}
|
||||
return;
|
||||
}
|
||||
_updateNextStepURL = siteInfoURL;
|
||||
|
||||
NSDictionary *versionDescriptions = [plist objectForKey:@"Description"];
|
||||
NSString *versionDescription = @"";
|
||||
if ([versionDescriptions isKindOfClass:[NSDictionary class]]) {
|
||||
NSString *locale = @"en";
|
||||
NSArray *supportedLocales = [NSArray arrayWithObjects:@"en", @"zh-Hant", @"zh-Hans", nil];
|
||||
NSArray *preferredTags = [NSBundle preferredLocalizationsFromArray:supportedLocales];
|
||||
if ([preferredTags count]) {
|
||||
locale = [preferredTags objectAtIndex:0];
|
||||
}
|
||||
versionDescription = [versionDescriptions objectForKey:locale];
|
||||
if (!versionDescription) {
|
||||
versionDescription = [versionDescriptions objectForKey:@"en"];
|
||||
}
|
||||
|
||||
if (_updateNotificationController) {
|
||||
[_updateNotificationController release], _updateNotificationController = nil;
|
||||
if (!versionDescription) {
|
||||
versionDescription = @"";
|
||||
}
|
||||
else {
|
||||
versionDescription = [@"\n\n" stringByAppendingString:versionDescription];
|
||||
}
|
||||
}
|
||||
|
||||
_updateNotificationController = [[UpdateNotificationController alloc] initWithWindowNibName:@"UpdateNotificationController"];
|
||||
NSString *content = [NSString stringWithFormat:NSLocalizedString(@"You're currently using McBopomofo %@ (%@), a new version %@ (%@) is now available. Do you want to visit McBopomofo's website to download the version?%@", nil), [infoDict objectForKey:@"CFBundleShortVersionString"], currentVersion, [plist objectForKey:@"CFBundleShortVersionString"], remoteVersion, versionDescription];
|
||||
|
||||
_updateNotificationController.siteURL = siteInfoURL;
|
||||
_updateNotificationController.infoText = [NSString stringWithFormat:NSLocalizedString(@"You are running version %@ (%@), and the new version %@ (%@) is now available.\n\nVisit the website to download it?", @""),
|
||||
[infoDict objectForKey:@"CFBundleShortVersionString"],
|
||||
[infoDict objectForKey:(id)kCFBundleVersionKey],
|
||||
[plist objectForKey:@"CFBundleShortVersionString"],
|
||||
[plist objectForKey:(id)kCFBundleVersionKey],
|
||||
nil];
|
||||
|
||||
[_updateNotificationController showWindow:self];
|
||||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
||||
[[OVNonModalAlertWindowController sharedInstance] showWithTitle:NSLocalizedString(@"New Version Available", nil) content:content confirmButtonTitle:NSLocalizedString(@"Visit Website", nil) cancelButtonTitle:NSLocalizedString(@"Not Now", nil) cancelAsDefault:NO delegate:self];
|
||||
}
|
||||
|
||||
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
|
||||
{
|
||||
[_receivingData appendData:data];
|
||||
}
|
||||
|
||||
- (void)nonModalAlertWindowControllerDidConfirm:(OVNonModalAlertWindowController *)controller
|
||||
{
|
||||
if (_updateNextStepURL) {
|
||||
[[NSWorkspace sharedWorkspace] openURL:_updateNextStepURL];
|
||||
}
|
||||
|
||||
_updateNextStepURL = nil;
|
||||
}
|
||||
|
||||
- (void)nonModalAlertWindowControllerDidCancel:(OVNonModalAlertWindowController *)controller
|
||||
{
|
||||
_updateNextStepURL = nil;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -0,0 +1,295 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14460.31"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||
<connections>
|
||||
<outlet property="delegate" destination="494" id="495"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application"/>
|
||||
<menu title="AMainMenu" systemMenu="main" id="29">
|
||||
<items>
|
||||
<menuItem title="McBopomofo" id="56">
|
||||
<menu key="submenu" title="McBopomofo" systemMenu="apple" id="57">
|
||||
<items>
|
||||
<menuItem title="About McBopomofo" id="58">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="-2" id="142"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="236">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Services" id="131">
|
||||
<menu key="submenu" title="Services" systemMenu="services" id="130"/>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="144">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Hide McBopomofo" keyEquivalent="h" id="134">
|
||||
<connections>
|
||||
<action selector="performClose:" target="-1" id="536"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Hide Others" keyEquivalent="h" id="145">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="hideOtherApplications:" target="-1" id="368"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Show All" id="150">
|
||||
<connections>
|
||||
<action selector="unhideAllApplications:" target="-1" id="370"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="File" id="83">
|
||||
<menu key="submenu" title="File" id="81">
|
||||
<items>
|
||||
<menuItem title="Close" keyEquivalent="w" id="73">
|
||||
<connections>
|
||||
<action selector="performClose:" target="-1" id="535"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Edit" id="217">
|
||||
<menu key="submenu" title="Edit" id="205">
|
||||
<items>
|
||||
<menuItem title="Undo" keyEquivalent="z" id="207">
|
||||
<connections>
|
||||
<action selector="undo:" target="-1" id="223"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Redo" keyEquivalent="Z" id="215">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="redo:" target="-1" id="231"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="206">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Cut" keyEquivalent="x" id="199">
|
||||
<connections>
|
||||
<action selector="cut:" target="-1" id="228"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Copy" keyEquivalent="c" id="197">
|
||||
<connections>
|
||||
<action selector="copy:" target="-1" id="224"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste" keyEquivalent="v" id="203">
|
||||
<connections>
|
||||
<action selector="paste:" target="-1" id="226"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste and Match Style" keyEquivalent="V" id="485">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteAsPlainText:" target="-1" id="486"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Delete" id="202">
|
||||
<connections>
|
||||
<action selector="delete:" target="-1" id="235"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Select All" keyEquivalent="a" id="198">
|
||||
<connections>
|
||||
<action selector="selectAll:" target="-1" id="232"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="214">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Find" id="218">
|
||||
<menu key="submenu" title="Find" id="220">
|
||||
<items>
|
||||
<menuItem title="Find…" tag="1" keyEquivalent="f" id="209">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="241"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="208">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="487"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="213">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="488"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="221">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="489"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Jump to Selection" keyEquivalent="j" id="210">
|
||||
<connections>
|
||||
<action selector="centerSelectionInVisibleArea:" target="-1" id="245"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Spelling and Grammar" id="216">
|
||||
<menu key="submenu" title="Spelling and Grammar" id="200">
|
||||
<items>
|
||||
<menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="204">
|
||||
<connections>
|
||||
<action selector="showGuessPanel:" target="-1" id="230"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Document Now" keyEquivalent=";" id="201">
|
||||
<connections>
|
||||
<action selector="checkSpelling:" target="-1" id="225"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="453"/>
|
||||
<menuItem title="Check Spelling While Typing" id="219">
|
||||
<connections>
|
||||
<action selector="toggleContinuousSpellChecking:" target="-1" id="222"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Grammar With Spelling" id="346">
|
||||
<connections>
|
||||
<action selector="toggleGrammarChecking:" target="-1" id="347"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Correct Spelling Automatically" id="454">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticSpellingCorrection:" target="-1" id="456"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Substitutions" id="348">
|
||||
<menu key="submenu" title="Substitutions" id="349">
|
||||
<items>
|
||||
<menuItem title="Show Substitutions" id="457">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontSubstitutionsPanel:" target="-1" id="458"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="459"/>
|
||||
<menuItem title="Smart Copy/Paste" tag="1" keyEquivalent="f" id="350">
|
||||
<connections>
|
||||
<action selector="toggleSmartInsertDelete:" target="-1" id="355"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Quotes" tag="2" keyEquivalent="g" id="351">
|
||||
<connections>
|
||||
<action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="356"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Dashes" id="460">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticDashSubstitution:" target="-1" id="461"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Links" tag="3" keyEquivalent="G" id="354">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticLinkDetection:" target="-1" id="357"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Text Replacement" id="462">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticTextReplacement:" target="-1" id="463"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Transformations" id="450">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Transformations" id="451">
|
||||
<items>
|
||||
<menuItem title="Make Upper Case" id="452">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="uppercaseWord:" target="-1" id="464"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Make Lower Case" id="465">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="lowercaseWord:" target="-1" id="468"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Capitalize" id="466">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="capitalizeWord:" target="-1" id="467"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Speech" id="211">
|
||||
<menu key="submenu" title="Speech" id="212">
|
||||
<items>
|
||||
<menuItem title="Start Speaking" id="196">
|
||||
<connections>
|
||||
<action selector="startSpeaking:" target="-1" id="233"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Stop Speaking" id="195">
|
||||
<connections>
|
||||
<action selector="stopSpeaking:" target="-1" id="227"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Window" id="19">
|
||||
<menu key="submenu" title="Window" systemMenu="window" id="24">
|
||||
<items>
|
||||
<menuItem title="Minimize" keyEquivalent="m" id="23">
|
||||
<connections>
|
||||
<action selector="performMiniaturize:" target="-1" id="37"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Zoom" id="239">
|
||||
<connections>
|
||||
<action selector="performZoom:" target="-1" id="240"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="92">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Bring All to Front" id="5">
|
||||
<connections>
|
||||
<action selector="arrangeInFront:" target="-1" id="39"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
<customObject id="494" customClass="AppDelegate"/>
|
||||
<customObject id="420" customClass="NSFontManager"/>
|
||||
</objects>
|
||||
</document>
|
|
@ -1,42 +1,44 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="13D65" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="19455" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment defaultVersion="1060" identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19455"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="PreferencesWindowController">
|
||||
<connections>
|
||||
<outlet property="basisKeyboardLayoutButton" destination="124" id="135"/>
|
||||
<outlet property="fontSizePopUpButton" destination="90" id="108"/>
|
||||
<outlet property="selectionKeyComboBox" destination="uHU-aL-du7" id="cEx-Ui-Phc"/>
|
||||
<outlet property="window" destination="1" id="30"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application"/>
|
||||
<window title="Bopomofo Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" oneShot="NO" animationBehavior="default" id="1" userLabel="Window - Preferences">
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window title="Bopomofo Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" animationBehavior="default" id="1" userLabel="Window - Preferences">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="401" y="295" width="460" height="266"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1366" height="746"/>
|
||||
<rect key="contentRect" x="401" y="295" width="462" height="344"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
|
||||
<view key="contentView" id="2">
|
||||
<rect key="frame" x="0.0" y="0.0" width="460" height="266"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="462" height="344"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<popUpButton verticalHuggingPriority="750" id="3">
|
||||
<rect key="frame" x="226" y="222" width="132" height="26"/>
|
||||
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3">
|
||||
<rect key="frame" x="225" y="300" width="132" height="26"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Hanyu Pinyin" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="4" imageScaling="proportionallyDown" inset="2" selectedItem="10" id="4">
|
||||
<popUpButtonCell key="cell" type="push" title="Standard" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="6" id="4">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<font key="font" metaFont="menu"/>
|
||||
<menu key="menu" title="OtherViews" id="5">
|
||||
<items>
|
||||
<menuItem title="Standard" id="6"/>
|
||||
<menuItem title="Standard" state="on" id="6"/>
|
||||
<menuItem title="ETen" tag="1" id="7"/>
|
||||
<menuItem title="Hsu" tag="2" id="8"/>
|
||||
<menuItem title="ETen26" tag="3" id="9"/>
|
||||
<menuItem title="IBM" tag="5" id="137"/>
|
||||
<menuItem title="Hanyu Pinyin" state="on" tag="4" id="10"/>
|
||||
<menuItem title="Hanyu Pinyin" tag="4" id="10"/>
|
||||
</items>
|
||||
</menu>
|
||||
<connections>
|
||||
|
@ -44,8 +46,8 @@
|
|||
</connections>
|
||||
</popUpButtonCell>
|
||||
</popUpButton>
|
||||
<textField verticalHuggingPriority="750" id="11">
|
||||
<rect key="frame" x="39" y="228" width="183" height="17"/>
|
||||
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="11">
|
||||
<rect key="frame" x="38" y="306" width="183" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Bopomofo Keyboard Layout:" id="12">
|
||||
<font key="font" metaFont="system"/>
|
||||
|
@ -53,20 +55,20 @@
|
|||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" id="124">
|
||||
<rect key="frame" x="226" y="181" width="156" height="26"/>
|
||||
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="124">
|
||||
<rect key="frame" x="225" y="269" width="156" height="26"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="127">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<font key="font" metaFont="menu"/>
|
||||
<menu key="menu" title="OtherViews" id="128"/>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="updateBasisKeyboardLayoutAction:" target="-2" id="136"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField verticalHuggingPriority="750" id="125">
|
||||
<rect key="frame" x="17" y="186" width="205" height="17"/>
|
||||
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="125">
|
||||
<rect key="frame" x="16" y="275" width="205" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Alphanumeric Keyboard Layout:" id="126">
|
||||
<font key="font" metaFont="system"/>
|
||||
|
@ -74,8 +76,8 @@
|
|||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" id="13">
|
||||
<rect key="frame" x="67" y="149" width="155" height="17"/>
|
||||
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="13">
|
||||
<rect key="frame" x="66" y="178" width="155" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Show Candidate Phrase:" id="14">
|
||||
<font key="font" metaFont="system"/>
|
||||
|
@ -83,8 +85,8 @@
|
|||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" id="23">
|
||||
<rect key="frame" x="84" y="103" width="138" height="17"/>
|
||||
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="23">
|
||||
<rect key="frame" x="83" y="132" width="138" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Candidate List Style:" id="24">
|
||||
<font key="font" metaFont="system"/>
|
||||
|
@ -92,8 +94,8 @@
|
|||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" id="28">
|
||||
<rect key="frame" x="88" y="56" width="134" height="17"/>
|
||||
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="28">
|
||||
<rect key="frame" x="87" y="85" width="134" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Candidate Text Size:" id="29">
|
||||
<font key="font" metaFont="system"/>
|
||||
|
@ -101,8 +103,8 @@
|
|||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<matrix verticalHuggingPriority="750" tag="1" allowsEmptySelection="NO" id="15">
|
||||
<rect key="frame" x="228" y="128" width="213" height="38"/>
|
||||
<matrix verticalHuggingPriority="750" fixedFrame="YES" tag="1" allowsEmptySelection="NO" translatesAutoresizingMaskIntoConstraints="NO" id="15">
|
||||
<rect key="frame" x="228" y="157" width="213" height="38"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
<size key="cellSize" width="206" height="18"/>
|
||||
|
@ -127,8 +129,8 @@
|
|||
<binding destination="32" name="selectedTag" keyPath="values.SelectPhraseAfterCursorAsCandidate" id="104"/>
|
||||
</connections>
|
||||
</matrix>
|
||||
<matrix verticalHuggingPriority="750" allowsEmptySelection="NO" id="19">
|
||||
<rect key="frame" x="228" y="82" width="207" height="38"/>
|
||||
<matrix verticalHuggingPriority="750" fixedFrame="YES" allowsEmptySelection="NO" translatesAutoresizingMaskIntoConstraints="NO" id="19">
|
||||
<rect key="frame" x="228" y="111" width="207" height="38"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
<size key="cellSize" width="88" height="18"/>
|
||||
|
@ -153,12 +155,12 @@
|
|||
<binding destination="32" name="selectedTag" keyPath="values.UseHorizontalCandidateList" id="105"/>
|
||||
</connections>
|
||||
</matrix>
|
||||
<popUpButton verticalHuggingPriority="750" id="90">
|
||||
<rect key="frame" x="226" y="50" width="86" height="26"/>
|
||||
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="90">
|
||||
<rect key="frame" x="225" y="77" width="86" height="26"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<popUpButtonCell key="cell" type="push" title="18" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="18" imageScaling="proportionallyDown" inset="2" selectedItem="96" id="91">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<font key="font" metaFont="menu"/>
|
||||
<menu key="menu" title="OtherViews" id="92">
|
||||
<items>
|
||||
<menuItem title="12" tag="12" id="93"/>
|
||||
|
@ -176,8 +178,8 @@
|
|||
<binding destination="32" name="selectedTag" keyPath="values.CandidateListTextSize" id="107"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<button id="109">
|
||||
<rect key="frame" x="226" y="18" width="217" height="18"/>
|
||||
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="109">
|
||||
<rect key="frame" x="226" y="215" width="217" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="Space key chooses candidate" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="110">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
|
@ -187,8 +189,46 @@
|
|||
<binding destination="32" name="value" keyPath="values.ChooseCandidateUsingSpaceKey" id="112"/>
|
||||
</connections>
|
||||
</button>
|
||||
<comboBox verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="uHU-aL-du7">
|
||||
<rect key="frame" x="228" y="242" width="209" height="25"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" completes="NO" numberOfVisibleItems="5" id="jQC-12-UuK">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<objectValues>
|
||||
<string>Item 1</string>
|
||||
<string>Item 2</string>
|
||||
<string>Item 3</string>
|
||||
</objectValues>
|
||||
</comboBoxCell>
|
||||
<connections>
|
||||
<action selector="changeSelectionKeyAction:" target="-2" id="REj-7y-bbQ"/>
|
||||
</connections>
|
||||
</comboBox>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ETa-09-qWI">
|
||||
<rect key="frame" x="38" y="248" width="183" height="16"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="Selection Keys:" id="FnD-oH-El5">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Fc2-qh-r1H">
|
||||
<rect key="frame" x="226" y="19" width="218" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="Check for updates automatically" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="Z9t-P0-BLF">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="32" name="value" keyPath="values.CheckUpdateAutomatically" id="6WP-5h-sHG"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
</view>
|
||||
<point key="canvasLocation" x="142" y="186"/>
|
||||
</window>
|
||||
<userDefaultsController representsSharedInstance="YES" id="32"/>
|
||||
</objects>
|
|
@ -38,7 +38,7 @@
|
|||
@interface VTCandidateController : NSWindowController
|
||||
{
|
||||
@protected
|
||||
id<VTCandidateControllerDelegate> _delegate;
|
||||
__weak id<VTCandidateControllerDelegate> _delegate;
|
||||
NSArray *_keyLabels;
|
||||
NSFont *_keyLabelFont;
|
||||
NSFont *_candidateFont;
|
||||
|
@ -56,7 +56,7 @@
|
|||
|
||||
- (NSUInteger)candidateIndexAtKeyLabelIndex:(NSUInteger)index;
|
||||
|
||||
@property (assign, weak, nonatomic) id<VTCandidateControllerDelegate> delegate;
|
||||
@property (weak, nonatomic) id<VTCandidateControllerDelegate> delegate;
|
||||
@property (assign, nonatomic) NSUInteger selectedCandidateIndex;
|
||||
|
||||
@property (assign, nonatomic) BOOL visible;
|
||||
|
|
|
@ -36,10 +36,9 @@
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_keyLabels release];
|
||||
[_keyLabelFont release];
|
||||
[_candidateFont release];
|
||||
[super dealloc];
|
||||
_keyLabels = nil;
|
||||
_keyLabelFont = nil;
|
||||
_candidateFont = nil;
|
||||
}
|
||||
|
||||
- (id)initWithWindow:(NSWindow *)window
|
||||
|
@ -47,11 +46,10 @@
|
|||
self = [super initWithWindow:window];
|
||||
if (self) {
|
||||
// populate the default values
|
||||
_keyLabels = [[NSArray arrayWithObjects:@"1", @"2", @"3", @"4", @"5", @"6", @"7", @"8", @"9", nil] retain];
|
||||
_keyLabelFont = [[NSFont systemFontOfSize:14.0] retain];
|
||||
_candidateFont = [[NSFont systemFontOfSize:18.0] retain];
|
||||
_keyLabels = @[@"1", @"2", @"3", @"4", @"5", @"6", @"7", @"8", @"9"];
|
||||
_keyLabelFont = [NSFont systemFontOfSize:14.0];
|
||||
_candidateFont = [NSFont systemFontOfSize:18.0];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,10 +40,9 @@
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_candidateView release];
|
||||
[_prevPageButton release];
|
||||
[_nextPageButton release];
|
||||
[super dealloc];
|
||||
_candidateView = nil;
|
||||
_prevPageButton = nil;
|
||||
_nextPageButton = nil;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
|
@ -51,7 +50,7 @@
|
|||
NSRect contentRect = NSMakeRect(128.0, 128.0, 0.0, 0.0);
|
||||
NSUInteger styleMask = NSBorderlessWindowMask | NSNonactivatingPanelMask;
|
||||
|
||||
NSPanel *panel = [[[NSPanel alloc] initWithContentRect:contentRect styleMask:styleMask backing:NSBackingStoreBuffered defer:NO] autorelease];
|
||||
NSPanel *panel = [[NSPanel alloc] initWithContentRect:contentRect styleMask:styleMask backing:NSBackingStoreBuffered defer:NO];
|
||||
[panel setLevel:kCGPopUpMenuWindowLevel];
|
||||
[panel setHasShadow:YES];
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
NSUInteger _highlightedIndex;
|
||||
NSUInteger _trackingHighlightedIndex;
|
||||
SEL _action;
|
||||
id _target;
|
||||
__weak id _target;
|
||||
}
|
||||
|
||||
- (void)setKeyLabels:(NSArray *)labels displayedCandidates:(NSArray *)candidates;
|
||||
|
@ -50,5 +50,5 @@
|
|||
@property (readonly, nonatomic) NSSize sizeForView;
|
||||
@property (assign, nonatomic) NSUInteger highlightedIndex;
|
||||
@property (assign, nonatomic) SEL action;
|
||||
@property (weak, assign, nonatomic) id target;
|
||||
@property (weak, nonatomic) id target;
|
||||
@end
|
||||
|
|
|
@ -39,26 +39,18 @@ NS_INLINE CGFloat max(CGFloat a, CGFloat b) { return a > b ? a : b; }
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_keyLabels release];
|
||||
[_displayedCandidates release];
|
||||
[_keyLabelAttrDict release];
|
||||
[_candidateAttrDict release];
|
||||
[_elementWidths release];
|
||||
[super dealloc];
|
||||
_keyLabels = nil;
|
||||
_displayedCandidates = nil;
|
||||
_keyLabelAttrDict = nil;
|
||||
_candidateAttrDict = nil;
|
||||
_elementWidths = nil;
|
||||
}
|
||||
|
||||
- (void)setKeyLabels:(NSArray *)labels displayedCandidates:(NSArray *)candidates
|
||||
{
|
||||
NSUInteger count = min([labels count], [candidates count]);
|
||||
id tmp;
|
||||
|
||||
tmp = _keyLabels;
|
||||
_keyLabels = [[labels subarrayWithRange:NSMakeRange(0, count)] retain];
|
||||
[tmp release];
|
||||
|
||||
tmp = _displayedCandidates;
|
||||
_displayedCandidates = [[candidates subarrayWithRange:NSMakeRange(0, count)] retain];
|
||||
[tmp release];
|
||||
_keyLabels = [labels subarrayWithRange:NSMakeRange(0, count)];
|
||||
_displayedCandidates = [candidates subarrayWithRange:NSMakeRange(0, count)];
|
||||
|
||||
NSMutableArray *newWidths = [NSMutableArray array];
|
||||
|
||||
|
@ -72,32 +64,24 @@ NS_INLINE CGFloat max(CGFloat a, CGFloat b) { return a > b ? a : b; }
|
|||
[newWidths addObject:[NSNumber numberWithDouble:width]];
|
||||
}
|
||||
|
||||
tmp = _elementWidths;
|
||||
_elementWidths = [newWidths retain];
|
||||
[tmp release];
|
||||
_elementWidths = newWidths;
|
||||
}
|
||||
|
||||
- (void)setKeyLabelFont:(NSFont *)labelFont candidateFont:(NSFont *)candidateFont
|
||||
{
|
||||
NSMutableParagraphStyle *paraStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease];
|
||||
NSMutableParagraphStyle *paraStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
|
||||
[paraStyle setAlignment:NSCenterTextAlignment];
|
||||
|
||||
id tmp;
|
||||
tmp = _keyLabelAttrDict;
|
||||
_keyLabelAttrDict = [[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
_keyLabelAttrDict = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
labelFont, NSFontAttributeName,
|
||||
paraStyle, NSParagraphStyleAttributeName,
|
||||
[NSColor textColor], NSForegroundColorAttributeName,
|
||||
nil] retain];
|
||||
[tmp release];
|
||||
|
||||
tmp = _candidateAttrDict;
|
||||
_candidateAttrDict = [[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSColor blackColor], NSForegroundColorAttributeName,
|
||||
nil];
|
||||
_candidateAttrDict = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
candidateFont, NSFontAttributeName,
|
||||
paraStyle, NSParagraphStyleAttributeName,
|
||||
[NSColor textColor], NSForegroundColorAttributeName,
|
||||
nil] retain];
|
||||
[tmp release];
|
||||
nil];
|
||||
|
||||
CGFloat labelFontSize = [labelFont pointSize];
|
||||
CGFloat candidateFontSize = [candidateFont pointSize];
|
||||
|
@ -131,13 +115,13 @@ NS_INLINE CGFloat max(CGFloat a, CGFloat b) { return a > b ? a : b; }
|
|||
|
||||
- (void)drawRect:(NSRect)dirtyRect
|
||||
{
|
||||
NSColor *white = [NSColor whiteColor];
|
||||
NSColor *backgroundColor = [NSColor controlBackgroundColor];
|
||||
NSColor *darkGray = [NSColor colorWithDeviceWhite:0.7 alpha:1.0];
|
||||
NSColor *lightGray = [NSColor colorWithDeviceWhite:0.8 alpha:1.0];
|
||||
|
||||
NSRect bounds = [self bounds];
|
||||
|
||||
[white setFill];
|
||||
[backgroundColor setFill];
|
||||
[NSBezierPath fillRect:bounds];
|
||||
|
||||
[[NSColor darkGrayColor] setStroke];
|
||||
|
@ -165,11 +149,11 @@ NS_INLINE CGFloat max(CGFloat a, CGFloat b) { return a > b ? a : b; }
|
|||
if (index == _highlightedIndex) {
|
||||
[[NSColor selectedTextBackgroundColor] setFill];
|
||||
|
||||
activeCandidateAttr = [[_candidateAttrDict mutableCopy] autorelease];
|
||||
activeCandidateAttr = [_candidateAttrDict mutableCopy];
|
||||
[(NSMutableDictionary *)activeCandidateAttr setObject:[NSColor selectedTextColor] forKey:NSForegroundColorAttributeName];
|
||||
}
|
||||
else {
|
||||
[white setFill];
|
||||
[backgroundColor setFill];
|
||||
}
|
||||
|
||||
[NSBezierPath fillRect:candidateRect];
|
||||
|
@ -230,9 +214,12 @@ NS_INLINE CGFloat max(CGFloat a, CGFloat b) { return a > b ? a : b; }
|
|||
_trackingHighlightedIndex = 0;
|
||||
[self setNeedsDisplay:YES];
|
||||
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Warc-performSelector-leaks"
|
||||
if (triggerAction && _target && _action) {
|
||||
[_target performSelector:_action withObject:self];
|
||||
}
|
||||
# pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -36,6 +36,11 @@ NS_INLINE CGFloat max(CGFloat a, CGFloat b) { return a > b ? a : b; }
|
|||
static const CGFloat kCandidateTextPadding = 24.0;
|
||||
static const CGFloat kCandidateTextLeftMargin = 8.0;
|
||||
|
||||
#if defined(__MAC_10_16)
|
||||
static const CGFloat kCandidateTextPaddingWithMandatedTableViewPadding = 18.0;
|
||||
static const CGFloat kCandidateTextLeftMarginWithMandatedTableViewPadding = 0.0;
|
||||
#endif
|
||||
|
||||
@interface VTVerticalCandidateController (Private) <NSTableViewDataSource, NSTableViewDelegate>
|
||||
- (void)rowDoubleClicked:(id)sender;
|
||||
- (BOOL)scrollPageByOne:(BOOL)forward;
|
||||
|
@ -44,31 +49,26 @@ static const CGFloat kCandidateTextLeftMargin = 8.0;
|
|||
@end
|
||||
|
||||
@implementation VTVerticalCandidateController
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_candidateTextParagraphStyle release];
|
||||
[_keyLabelStripView release];
|
||||
[_scrollView release];
|
||||
[_tableView release];
|
||||
[super dealloc];
|
||||
// Total padding added to the left and the right of the table view cell text.
|
||||
CGFloat _candidateTextPadding;
|
||||
|
||||
// The indent of the table view cell text from the left.
|
||||
CGFloat _candidateTextLeftMargin;
|
||||
}
|
||||
|
||||
|
||||
- (id)init
|
||||
{
|
||||
NSRect contentRect = NSMakeRect(128.0, 128.0, 0.0, 0.0);
|
||||
NSUInteger styleMask = NSBorderlessWindowMask | NSNonactivatingPanelMask;
|
||||
|
||||
NSPanel *panel = [[[NSPanel alloc] initWithContentRect:contentRect styleMask:styleMask backing:NSBackingStoreBuffered defer:NO] autorelease];
|
||||
NSPanel *panel = [[NSPanel alloc] initWithContentRect:contentRect styleMask:styleMask backing:NSBackingStoreBuffered defer:NO];
|
||||
[panel setLevel:kCGPopUpMenuWindowLevel];
|
||||
[panel setHasShadow:YES];
|
||||
|
||||
self = [self initWithWindow:panel];
|
||||
if (self) {
|
||||
_candidateTextParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
|
||||
[_candidateTextParagraphStyle setFirstLineHeadIndent:kCandidateTextLeftMargin];
|
||||
[_candidateTextParagraphStyle setLineBreakMode:NSLineBreakByClipping];
|
||||
|
||||
contentRect.origin = NSMakePoint(0.0, 0.0);
|
||||
|
||||
NSRect stripRect = contentRect;
|
||||
|
@ -92,10 +92,13 @@ static const CGFloat kCandidateTextLeftMargin = 8.0;
|
|||
[_tableView setDataSource:self];
|
||||
[_tableView setDelegate:self];
|
||||
|
||||
NSTableColumn *column = [[[NSTableColumn alloc] initWithIdentifier:@"candidate"] autorelease];
|
||||
[column setDataCell:[[[NSTextFieldCell alloc] init] autorelease]];
|
||||
NSTableColumn *column = [[NSTableColumn alloc] initWithIdentifier:@"candidate"];
|
||||
[column setDataCell:[[NSTextFieldCell alloc] init]];
|
||||
[column setEditable:NO];
|
||||
|
||||
_candidateTextPadding = kCandidateTextPadding;
|
||||
_candidateTextLeftMargin = kCandidateTextLeftMargin;
|
||||
|
||||
[_tableView addTableColumn:column];
|
||||
[_tableView setIntercellSpacing:NSMakeSize(0.0, 1.0)];
|
||||
[_tableView setHeaderView:nil];
|
||||
|
@ -104,8 +107,20 @@ static const CGFloat kCandidateTextLeftMargin = 8.0;
|
|||
[_tableView setDoubleAction:@selector(rowDoubleClicked:)];
|
||||
[_tableView setTarget:self];
|
||||
|
||||
#if defined(__MAC_10_16)
|
||||
if (@available(macOS 10.16, *)) {
|
||||
[_tableView setStyle:NSTableViewStyleFullWidth];
|
||||
_candidateTextPadding = kCandidateTextPaddingWithMandatedTableViewPadding;
|
||||
_candidateTextLeftMargin = kCandidateTextLeftMarginWithMandatedTableViewPadding;
|
||||
}
|
||||
#endif
|
||||
|
||||
[_scrollView setDocumentView:_tableView];
|
||||
[[panel contentView] addSubview:_scrollView];
|
||||
|
||||
_candidateTextParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
|
||||
[_candidateTextParagraphStyle setFirstLineHeadIndent:_candidateTextLeftMargin];
|
||||
[_candidateTextParagraphStyle setLineBreakMode:NSLineBreakByClipping];
|
||||
}
|
||||
|
||||
return self;
|
||||
|
@ -113,7 +128,7 @@ static const CGFloat kCandidateTextLeftMargin = 8.0;
|
|||
|
||||
- (void)reloadData
|
||||
{
|
||||
_maxCandidateAttrStringWidth = ceil([_candidateFont pointSize] * 2.0 + kCandidateTextPadding);
|
||||
_maxCandidateAttrStringWidth = ceil([_candidateFont pointSize] * 2.0 + _candidateTextPadding);
|
||||
|
||||
[_tableView reloadData];
|
||||
[self layoutCandidateView];
|
||||
|
@ -215,13 +230,13 @@ static const CGFloat kCandidateTextLeftMargin = 8.0;
|
|||
candidate = [_delegate candidateController:self candidateAtIndex:row];
|
||||
}
|
||||
|
||||
NSAttributedString *attrString = [[[NSAttributedString alloc] initWithString:candidate attributes:[NSDictionary dictionaryWithObjectsAndKeys:_candidateFont, NSFontAttributeName, _candidateTextParagraphStyle, NSParagraphStyleAttributeName, nil]] autorelease];
|
||||
NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:candidate attributes:[NSDictionary dictionaryWithObjectsAndKeys:_candidateFont, NSFontAttributeName, _candidateTextParagraphStyle, NSParagraphStyleAttributeName, nil]];
|
||||
|
||||
// we do more work than what this method is expected to; normally not a good practice, but for the amount of data (9 to 10 rows max), we can afford the overhead
|
||||
|
||||
// expand the window width if text overflows
|
||||
NSRect boundingRect = [attrString boundingRectWithSize:NSMakeSize(10240.0, 10240.0) options:NSStringDrawingUsesLineFragmentOrigin];
|
||||
CGFloat textWidth = boundingRect.size.width + kCandidateTextPadding;
|
||||
CGFloat textWidth = boundingRect.size.width + _candidateTextPadding;
|
||||
if (textWidth > _maxCandidateAttrStringWidth) {
|
||||
_maxCandidateAttrStringWidth = textWidth;
|
||||
[self layoutCandidateView];
|
||||
|
@ -379,16 +394,8 @@ static const CGFloat kCandidateTextLeftMargin = 8.0;
|
|||
|
||||
NSScroller *verticalScroller = [_scrollView verticalScroller];
|
||||
[verticalScroller setControlSize:controlSize];
|
||||
|
||||
// calling >=10.7 only API
|
||||
if ([verticalScroller respondsToSelector:@selector(setScrollerStyle:)]) {
|
||||
[verticalScroller setScrollerStyle:NSScrollerStyleLegacy];
|
||||
scrollerWidth = [NSScroller scrollerWidthForControlSize:controlSize scrollerStyle:NSScrollerStyleLegacy];
|
||||
}
|
||||
else {
|
||||
// not on >=10.7
|
||||
scrollerWidth = [NSScroller scrollerWidthForControlSize:controlSize];
|
||||
}
|
||||
[verticalScroller setScrollerStyle:NSScrollerStyleLegacy];
|
||||
scrollerWidth = [NSScroller scrollerWidthForControlSize:controlSize scrollerStyle:NSScrollerStyleLegacy];
|
||||
}
|
||||
|
||||
_keyLabelStripView.keyLabelFont = _keyLabelFont;
|
||||
|
|
|
@ -35,9 +35,8 @@
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_keyLabelFont release];
|
||||
[_keyLabels release];
|
||||
[super dealloc];
|
||||
_keyLabelFont = nil;
|
||||
_keyLabels = nil;
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(NSRect)frameRect
|
||||
|
@ -71,7 +70,7 @@
|
|||
NSColor *darkGray = [NSColor colorWithDeviceWhite:0.7 alpha:1.0];
|
||||
NSColor *lightGray = [NSColor colorWithDeviceWhite:0.8 alpha:1.0];
|
||||
|
||||
NSMutableParagraphStyle *style = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease];
|
||||
NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
|
||||
[style setAlignment:NSCenterTextAlignment];
|
||||
|
||||
NSDictionary *textAttr = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <fstream>
|
||||
#include <unistd.h>
|
||||
|
||||
using namespace Formosa::Gramambular;
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ namespace Formosa {
|
|||
size_t width() const;
|
||||
vector<NodeAnchor> nodesEndingAt(size_t inLocation);
|
||||
vector<NodeAnchor> nodesCrossingOrEndingAt(size_t inLocation);
|
||||
void fixNodeSelectedCandidate(size_t location, const string& value);
|
||||
|
||||
const string dumpDOT();
|
||||
|
||||
|
@ -175,6 +176,24 @@ namespace Formosa {
|
|||
return result;
|
||||
}
|
||||
|
||||
// For nodes found at the location, fix their currently-selected candidate using the supplied string value.
|
||||
inline void Grid::fixNodeSelectedCandidate(size_t location, const string& value)
|
||||
{
|
||||
vector<NodeAnchor> nodes = nodesCrossingOrEndingAt(location);
|
||||
for (auto nodeAnchor : nodes) {
|
||||
auto candidates = nodeAnchor.node->candidates();
|
||||
|
||||
// Reset the candidate-fixed state of every node at the location.
|
||||
const_cast<Node*>(nodeAnchor.node)->resetCandidate();
|
||||
|
||||
for (size_t i = 0, c = candidates.size(); i < c; ++i) {
|
||||
if (candidates[i].value == value) {
|
||||
const_cast<Node*>(nodeAnchor.node)->selectCandidateAtIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline const string Grid::dumpDOT()
|
||||
{
|
||||
|
|
|
@ -47,6 +47,7 @@ namespace Formosa {
|
|||
const vector<KeyValuePair>& candidates() const;
|
||||
void selectCandidateAtIndex(size_t inIndex = 0, bool inFix = true);
|
||||
void selectFloatingCandidateAtIndex(size_t index, double score);
|
||||
void resetCandidate();
|
||||
|
||||
const string& key() const;
|
||||
double score() const;
|
||||
|
@ -178,6 +179,15 @@ namespace Formosa {
|
|||
m_score = score;
|
||||
}
|
||||
|
||||
inline void Node::resetCandidate()
|
||||
{
|
||||
m_selectedUnigramIndex = 0;
|
||||
m_candidateFixed = 0;
|
||||
if (m_unigrams.size()) {
|
||||
m_score = m_unigrams[0].score;
|
||||
}
|
||||
}
|
||||
|
||||
inline const string& Node::key() const
|
||||
{
|
||||
return m_key;
|
||||
|
|
|
@ -1,229 +0,0 @@
|
|||
//
|
||||
// AppIconRendererView.m
|
||||
//
|
||||
// Copyright (c) 2011 The McBopomofo Project.
|
||||
//
|
||||
// Contributors:
|
||||
// Mengjuei Hsieh (@mjhsieh)
|
||||
// Weizhong Yang (@zonble)
|
||||
//
|
||||
// Based on the Syrup Project and the Formosana Library
|
||||
// by Lukhnos Liu (@lukhnos).
|
||||
//
|
||||
// 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:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// 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 "AppIconRendererView.h"
|
||||
|
||||
|
||||
@implementation AppIconRendererView
|
||||
|
||||
- (id)initWithFrame:(NSRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
// Initialization code here.
|
||||
|
||||
// CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray();
|
||||
// CGContextRef context = CGBitmapContextCreate(NULL, frame.size.width, frame.size.height, 8, frame.size.width, colorSpace, 0);
|
||||
// CGColorSpaceRelease(colorSpace);
|
||||
|
||||
// imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:frame.size.width pixelsHigh:frame.size.height bitsPerSample:8 samplesPerPixel:1 hasAlpha:NO isPlanar:NO colorSpaceName:NSDeviceWhiteColorSpace bytesPerRow:0 bitsPerPixel:0];
|
||||
|
||||
NSRect bounds = [self bounds];
|
||||
|
||||
image = [[NSImage alloc] initWithSize:frame.size];
|
||||
[image lockFocus];
|
||||
|
||||
[[NSColor blackColor] setFill];
|
||||
[NSBezierPath fillRect:bounds];
|
||||
|
||||
|
||||
CIContext *imageContext = [[NSGraphicsContext currentContext] CIContext];
|
||||
|
||||
CIFilter *filter = [CIFilter filterWithName:@"CIRandomGenerator"];
|
||||
[filter setDefaults];
|
||||
|
||||
// CIContext *imageContext = [CIContext contextWithCGContext:context options:nil];
|
||||
|
||||
CIImage *output = [filter valueForKey:@"outputImage"];
|
||||
|
||||
CIFilter *mono = [CIFilter filterWithName:@"CIColorMonochrome"];
|
||||
[mono setDefaults];
|
||||
[mono setValue:output forKey:@"inputImage"];
|
||||
|
||||
CIColor *color = [[[CIColor alloc] initWithColor:[NSColor blackColor]] autorelease];
|
||||
|
||||
[mono setValue:color forKey:@"inputColor"];
|
||||
[mono setValue:[NSNumber numberWithDouble:1.0] forKey:@"inputIntensity"];
|
||||
output = [mono valueForKey:@"outputImage"];
|
||||
|
||||
CIFilter *blur = [CIFilter filterWithName:@"CIMotionBlur"];
|
||||
[blur setDefaults];
|
||||
[blur setValue:output forKey:@"inputImage"];
|
||||
[blur setValue:[NSNumber numberWithDouble:25.0] forKey:@"inputRadius"];
|
||||
[blur setValue:[NSNumber numberWithDouble:0.0] forKey:@"inputAngle"];
|
||||
output = [blur valueForKey:@"outputImage"];
|
||||
|
||||
|
||||
[imageContext drawImage:output inRect:[self bounds] fromRect:[self bounds]];
|
||||
|
||||
|
||||
NSColor *transWhite = [NSColor colorWithDeviceWhite:0.9 alpha:0.2];
|
||||
NSColor *transBlack = [NSColor colorWithDeviceWhite:0.5 alpha:0.3];
|
||||
|
||||
NSGradient *gradient = // [[[NSGradient alloc] initWithStartingColor:transBlack endingColor:transWhite] autorelease];
|
||||
[[[NSGradient alloc] initWithColorsAndLocations:
|
||||
transBlack, 0.0,
|
||||
// [NSColor darkGrayColor], 0.1,
|
||||
transWhite, 0.5,
|
||||
// [NSColor darkGrayColor], 0.9,
|
||||
transBlack, 1.0,
|
||||
nil] autorelease];
|
||||
// bounds.size.width /= 2;
|
||||
[gradient drawInRect:bounds angle:0.0];
|
||||
|
||||
// bounds.origin.x += bounds.size.width;
|
||||
// [gradient drawInRect:bounds angle:180.0];
|
||||
|
||||
// CGBitmapContextCreateImage(context);
|
||||
|
||||
// CGColorSpaceRef colorColorSpace = CGColorSpaceCreateDeviceRGB();
|
||||
// CGImageRef tmpImage = CGBitmapContextCreateImage(context);
|
||||
// image = CGImageCreateCopyWithColorSpace(tmpImage, colorColorSpace);
|
||||
// CGImageRelease(tmpImage);
|
||||
// CGColorSpaceRelease(colorColorSpace);
|
||||
|
||||
|
||||
|
||||
// CGContextRelease(context);
|
||||
|
||||
[image unlockFocus];
|
||||
|
||||
// NSLog(@"%@", [image representations]);
|
||||
|
||||
// [image addRepresentation:imageRep];
|
||||
// NSLog(@"%@", [image representations]);
|
||||
|
||||
// for (NSBitmapImageRep *rep in [image representations]) {
|
||||
// [rep setColorSpaceName:NSDeviceWhiteColorSpace];
|
||||
// }
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
// CGImageRelease(image);
|
||||
[image release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)drawRect:(NSRect)dirtyRect
|
||||
{
|
||||
NSRect boundRect = [self bounds];
|
||||
CGFloat radius = 1.0;
|
||||
|
||||
if (boundRect.size.width > 16.0 && boundRect.size.width <= 32.0) {
|
||||
boundRect.origin.x += 1.0;
|
||||
boundRect.origin.y += 1.0;
|
||||
boundRect.size.width -= 2.0;
|
||||
boundRect.size.height -= 2.0;
|
||||
radius = 2.0;
|
||||
}
|
||||
else if (boundRect.size.width > 32.0) {
|
||||
boundRect.origin.x += 5.0;
|
||||
boundRect.origin.y += 5.0;
|
||||
boundRect.size.width -= 10.0;
|
||||
boundRect.size.height -= 10.0;
|
||||
radius = 7.0;
|
||||
}
|
||||
|
||||
NSShadow *imageShadow = [[[NSShadow alloc] init] autorelease];
|
||||
[imageShadow setShadowOffset:NSMakeSize(1.0, -1.0)];
|
||||
[imageShadow setShadowColor:[NSColor darkGrayColor]];
|
||||
[imageShadow setShadowBlurRadius:radius / 2];
|
||||
|
||||
|
||||
NSBezierPath *clipPath = [NSBezierPath bezierPathWithRoundedRect:boundRect xRadius:radius yRadius:radius];
|
||||
[[NSGraphicsContext currentContext] saveGraphicsState];
|
||||
[imageShadow set];
|
||||
[[NSColor whiteColor] setFill];
|
||||
[clipPath fill];
|
||||
[[NSGraphicsContext currentContext] restoreGraphicsState];
|
||||
|
||||
[clipPath setClip];
|
||||
|
||||
[image drawInRect:boundRect fromRect:boundRect operation:NSCompositeCopy fraction:1.0];
|
||||
|
||||
NSString *text = @"ㄅ";
|
||||
|
||||
if ([self bounds].size.width >= 32.0) {
|
||||
text = @"ㄅㄆ\nㄇㄈ";
|
||||
}
|
||||
|
||||
NSFont *font = [NSFont fontWithName:@"LiSong Pro" size:boundRect.size.width * 0.40];
|
||||
|
||||
NSShadow *shadow = [[[NSShadow alloc] init] autorelease];
|
||||
[shadow setShadowColor:[NSColor blackColor]];
|
||||
[shadow setShadowOffset:NSMakeSize(1.0, 1.0)];
|
||||
// [shadow setShadowBlurRadius:2.0];
|
||||
// [NSFont boldSystemFontOfSize:48.0];
|
||||
|
||||
|
||||
NSColor *textColor = [NSColor whiteColor];
|
||||
|
||||
NSMutableDictionary *attr = [NSMutableDictionary dictionaryWithObjectsAndKeys:
|
||||
font, NSFontAttributeName,
|
||||
textColor, NSForegroundColorAttributeName,
|
||||
shadow, NSShadowAttributeName,
|
||||
nil];
|
||||
|
||||
NSAttributedString *attrStr = [[[NSAttributedString alloc] initWithString:text attributes:attr] autorelease];
|
||||
|
||||
NSRect textRect = [attrStr boundingRectWithSize:boundRect.size options:NSStringDrawingUsesLineFragmentOrigin];
|
||||
|
||||
textRect.origin.x = boundRect.origin.x + (boundRect.size.width - textRect.size.width) / 2.0;
|
||||
textRect.origin.y = boundRect.origin.y + (boundRect.size.height - textRect.size.height) / 2.0;
|
||||
|
||||
textRect.origin.y += boundRect.size.height * 0.025;
|
||||
|
||||
[attrStr drawInRect:textRect];
|
||||
|
||||
|
||||
// NSBitmapImageRep *imageRep = [[[NSBitmapImageRep alloc] initWithCGImage:image] autorelease];
|
||||
//
|
||||
// [imageRep colorizeByMappingGray:0.2 toColor:[NSColor greenColor] blackMapping:[NSColor darkGrayColor] whiteMapping:[NSColor redColor]];
|
||||
|
||||
// NSImage *img = [[NSImage alloc] initWithCGImage:image size:NSZeroSize];
|
||||
// NSLog(@"%@", [img representations]);
|
||||
//
|
||||
// [img drawInRect:[self bounds] fromRect:[self bounds] operation:NSCompositeCopy fraction:1.0];
|
||||
// [img release];
|
||||
|
||||
// [image drawRepresentation:imageRep inRect:[self bounds]];
|
||||
// [imageRep draw];
|
||||
// [imageRep drawInRect:[self bounds] fromRect:[self bounds] operation:NSCompositeCopy fraction:1.0 respectFlipped:YES hints:nil];
|
||||
}
|
||||
|
||||
@end
|
|
@ -1,14 +0,0 @@
|
|||
//
|
||||
// BopomofoIconRenderView.h
|
||||
// Lettuce
|
||||
//
|
||||
// Created by Lukhnos D. Liu on 9/3/12.
|
||||
//
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface BopomofoIconRenderView : NSView
|
||||
@property (assign, nonatomic) BOOL textMenuIcon;
|
||||
@property (assign, nonatomic) BOOL plainBopomofoIcon;
|
||||
@end
|
|
@ -1,115 +0,0 @@
|
|||
//
|
||||
// BopomofoIconRenderView.m
|
||||
// Lettuce
|
||||
//
|
||||
// Created by Lukhnos D. Liu on 9/3/12.
|
||||
//
|
||||
//
|
||||
|
||||
#import "BopomofoIconRenderView.h"
|
||||
|
||||
@implementation BopomofoIconRenderView
|
||||
- (void)drawRect:(NSRect)dirtyRect
|
||||
{
|
||||
NSAffineTransform *transform = [NSAffineTransform transform];
|
||||
[transform scaleBy:[self bounds].size.width / 16.0];
|
||||
[transform concat];
|
||||
|
||||
NSRect boundsRect = NSMakeRect(0.0, 0.0, 16.0, 16.0);
|
||||
|
||||
if ([self bounds].size.width > 16.0) {
|
||||
boundsRect.origin.x += 0.5;
|
||||
}
|
||||
|
||||
boundsRect.size.width -= 1.0;
|
||||
|
||||
NSBezierPath *backgroundPath = [NSBezierPath bezierPathWithRoundedRect:boundsRect xRadius:2.0 yRadius:2.0];
|
||||
if (self.textMenuIcon) {
|
||||
[[NSColor colorWithDeviceWhite:0.95 alpha:1.0] setFill];
|
||||
[[NSColor colorWithDeviceWhite:0.6 alpha:1.0] setStroke];
|
||||
[backgroundPath fill];
|
||||
|
||||
NSRect innerBoundRect = boundsRect;
|
||||
innerBoundRect.size.width -= 1.0;
|
||||
innerBoundRect.size.height -= 1.0;
|
||||
innerBoundRect.origin.x += 0.5;
|
||||
innerBoundRect.origin.y += 0.5;
|
||||
backgroundPath = [NSBezierPath bezierPathWithRoundedRect:innerBoundRect xRadius:2.0 yRadius:2.0];
|
||||
[backgroundPath stroke];
|
||||
|
||||
[NSGraphicsContext saveGraphicsState];
|
||||
NSBezierPath *coveringPath = [NSBezierPath bezierPath];
|
||||
[coveringPath appendBezierPathWithArcWithCenter:NSMakePoint(16.0, 1.0) radius:14.0 startAngle:0.0 endAngle:360.0];
|
||||
[coveringPath setClip];
|
||||
|
||||
[[NSColor colorWithDeviceWhite:0.3 alpha:1.0] setStroke];
|
||||
backgroundPath = [NSBezierPath bezierPathWithRoundedRect:innerBoundRect xRadius:2.0 yRadius:2.0];
|
||||
[backgroundPath stroke];
|
||||
[NSGraphicsContext restoreGraphicsState];
|
||||
}
|
||||
else {
|
||||
if (self.plainBopomofoIcon) {
|
||||
if ([self bounds].size.width > 16.0) {
|
||||
[[NSColor colorWithDeviceWhite:0.3 alpha:1.0] setFill];
|
||||
}
|
||||
else {
|
||||
[[NSColor colorWithDeviceWhite:0.1 alpha:1.0] setFill];
|
||||
}
|
||||
}
|
||||
else {
|
||||
[[NSColor colorWithDeviceWhite:0.3 alpha:1.0] setFill];
|
||||
}
|
||||
[backgroundPath fill];
|
||||
}
|
||||
|
||||
|
||||
CGFloat fontSize = ([self bounds].size.width > 16.0) ? 14.0 : 13.0;
|
||||
NSString *text = @"ㄅ";
|
||||
NSString *fontName = @"BiauKai";
|
||||
|
||||
NSColor *textColor = nil;
|
||||
|
||||
if (self.textMenuIcon) {
|
||||
textColor = [NSColor blackColor];
|
||||
}
|
||||
else if (self.plainBopomofoIcon) {
|
||||
textColor = [NSColor colorWithDeviceWhite:0.95 alpha:1.0];
|
||||
}
|
||||
else {
|
||||
textColor = [NSColor colorWithDeviceWhite:1.0 alpha:1.0];
|
||||
}
|
||||
|
||||
NSMutableDictionary *attrDict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
|
||||
textColor, NSForegroundColorAttributeName,
|
||||
[NSFont fontWithName:fontName size:fontSize], NSFontAttributeName,
|
||||
nil];
|
||||
NSMutableAttributedString *attrString = [[[NSMutableAttributedString alloc] initWithString:text attributes:attrDict] autorelease];
|
||||
|
||||
NSRect textBounds = [attrString boundingRectWithSize:boundsRect.size options:NSStringDrawingUsesLineFragmentOrigin];
|
||||
|
||||
NSPoint textOrigin;
|
||||
textOrigin.x = boundsRect.origin.x + (boundsRect.size.width - textBounds.size.width) / 2.0;
|
||||
textOrigin.y = boundsRect.origin.y;
|
||||
|
||||
[attrString drawAtPoint:textOrigin];
|
||||
|
||||
if (self.plainBopomofoIcon) {
|
||||
NSBezierPath *coveringPath = [NSBezierPath bezierPath];
|
||||
[coveringPath appendBezierPathWithArcWithCenter:NSMakePoint(16.0, -3.0) radius:13.0 startAngle:0.0 endAngle:360.0];
|
||||
[coveringPath setClip];
|
||||
|
||||
if (!([self bounds].size.width > 16.0)) {
|
||||
[[NSColor colorWithDeviceWhite:0.6 alpha:1.0] setFill];
|
||||
}
|
||||
else {
|
||||
[[NSColor colorWithDeviceWhite:0.65 alpha:1.0] setFill];
|
||||
}
|
||||
|
||||
[backgroundPath fill];
|
||||
|
||||
[attrDict setObject:[NSColor colorWithDeviceWhite:1.0 alpha:1.0] forKey:NSForegroundColorAttributeName];
|
||||
[attrString setAttributes:attrDict range:NSMakeRange(0, [text length])];
|
||||
[attrString drawAtPoint:textOrigin];
|
||||
}
|
||||
}
|
||||
@end
|
|
@ -1,34 +0,0 @@
|
|||
<?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>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2011-2012 Mengjuei Hsieh et al.</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.openvanilla.McBopomofo.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>MICM</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,7 +0,0 @@
|
|||
//
|
||||
// Prefix header for all source files of the 'IconMaker' target in the 'IconMaker' project
|
||||
//
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
|
@ -1,282 +0,0 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
6AA67F9E15FC429D00B5A308 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6AA67F9D15FC429D00B5A308 /* Cocoa.framework */; };
|
||||
6AA67FD315FC430F00B5A308 /* AppIconRendererView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AA67FC015FC430F00B5A308 /* AppIconRendererView.m */; };
|
||||
6AA67FD415FC430F00B5A308 /* BopomofoIconRenderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AA67FC215FC430F00B5A308 /* BopomofoIconRenderView.m */; };
|
||||
6AA67FD715FC430F00B5A308 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6AA67FC815FC430F00B5A308 /* MainMenu.xib */; };
|
||||
6AA67FD915FC430F00B5A308 /* IconMakerAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AA67FCD15FC430F00B5A308 /* IconMakerAppDelegate.m */; };
|
||||
6AA67FDA15FC430F00B5A308 /* ImageZoomInView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AA67FCF15FC430F00B5A308 /* ImageZoomInView.m */; };
|
||||
6AA67FDB15FC430F00B5A308 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AA67FD015FC430F00B5A308 /* main.m */; };
|
||||
6AA67FDC15FC430F00B5A308 /* TISIconRendererView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AA67FD215FC430F00B5A308 /* TISIconRendererView.m */; };
|
||||
6AA67FE215FC43BC00B5A308 /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6AA67FE115FC43BC00B5A308 /* Quartz.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
6AA67F9915FC429D00B5A308 /* IconMaker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = IconMaker.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
6AA67F9D15FC429D00B5A308 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
|
||||
6AA67FBF15FC430F00B5A308 /* AppIconRendererView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppIconRendererView.h; sourceTree = "<group>"; };
|
||||
6AA67FC015FC430F00B5A308 /* AppIconRendererView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppIconRendererView.m; sourceTree = "<group>"; };
|
||||
6AA67FC115FC430F00B5A308 /* BopomofoIconRenderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BopomofoIconRenderView.h; sourceTree = "<group>"; };
|
||||
6AA67FC215FC430F00B5A308 /* BopomofoIconRenderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BopomofoIconRenderView.m; sourceTree = "<group>"; };
|
||||
6AA67FC915FC430F00B5A308 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = MainMenu.xib; sourceTree = "<group>"; };
|
||||
6AA67FCA15FC430F00B5A308 /* IconMaker-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "IconMaker-Info.plist"; sourceTree = "<group>"; };
|
||||
6AA67FCB15FC430F00B5A308 /* IconMaker-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IconMaker-Prefix.pch"; sourceTree = "<group>"; };
|
||||
6AA67FCC15FC430F00B5A308 /* IconMakerAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IconMakerAppDelegate.h; sourceTree = "<group>"; };
|
||||
6AA67FCD15FC430F00B5A308 /* IconMakerAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IconMakerAppDelegate.m; sourceTree = "<group>"; };
|
||||
6AA67FCE15FC430F00B5A308 /* ImageZoomInView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageZoomInView.h; sourceTree = "<group>"; };
|
||||
6AA67FCF15FC430F00B5A308 /* ImageZoomInView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageZoomInView.m; sourceTree = "<group>"; };
|
||||
6AA67FD015FC430F00B5A308 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
6AA67FD115FC430F00B5A308 /* TISIconRendererView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TISIconRendererView.h; sourceTree = "<group>"; };
|
||||
6AA67FD215FC430F00B5A308 /* TISIconRendererView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TISIconRendererView.m; sourceTree = "<group>"; };
|
||||
6AA67FE115FC43BC00B5A308 /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
6AA67F9615FC429D00B5A308 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6AA67FE215FC43BC00B5A308 /* Quartz.framework in Frameworks */,
|
||||
6AA67F9E15FC429D00B5A308 /* Cocoa.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
6AA67F8E15FC429D00B5A308 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6AA67FBF15FC430F00B5A308 /* AppIconRendererView.h */,
|
||||
6AA67FC015FC430F00B5A308 /* AppIconRendererView.m */,
|
||||
6AA67FC115FC430F00B5A308 /* BopomofoIconRenderView.h */,
|
||||
6AA67FC215FC430F00B5A308 /* BopomofoIconRenderView.m */,
|
||||
6AA67FCC15FC430F00B5A308 /* IconMakerAppDelegate.h */,
|
||||
6AA67FCD15FC430F00B5A308 /* IconMakerAppDelegate.m */,
|
||||
6AA67FCE15FC430F00B5A308 /* ImageZoomInView.h */,
|
||||
6AA67FCF15FC430F00B5A308 /* ImageZoomInView.m */,
|
||||
6AA67FD015FC430F00B5A308 /* main.m */,
|
||||
6AA67FD115FC430F00B5A308 /* TISIconRendererView.h */,
|
||||
6AA67FD215FC430F00B5A308 /* TISIconRendererView.m */,
|
||||
6AE210AF15FC6388003659FE /* Resources */,
|
||||
6AA67F9C15FC429D00B5A308 /* Frameworks */,
|
||||
6AA67F9A15FC429D00B5A308 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6AA67F9A15FC429D00B5A308 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6AA67F9915FC429D00B5A308 /* IconMaker.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6AA67F9C15FC429D00B5A308 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6AA67F9D15FC429D00B5A308 /* Cocoa.framework */,
|
||||
6AA67FE115FC43BC00B5A308 /* Quartz.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6AE210AF15FC6388003659FE /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6AA67FCA15FC430F00B5A308 /* IconMaker-Info.plist */,
|
||||
6AA67FCB15FC430F00B5A308 /* IconMaker-Prefix.pch */,
|
||||
6AA67FC815FC430F00B5A308 /* MainMenu.xib */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
6AA67F9815FC429D00B5A308 /* IconMaker */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 6AA67FB715FC429D00B5A308 /* Build configuration list for PBXNativeTarget "IconMaker" */;
|
||||
buildPhases = (
|
||||
6AA67F9515FC429D00B5A308 /* Sources */,
|
||||
6AA67F9615FC429D00B5A308 /* Frameworks */,
|
||||
6AA67F9715FC429D00B5A308 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = IconMaker;
|
||||
productName = IconMaker;
|
||||
productReference = 6AA67F9915FC429D00B5A308 /* IconMaker.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
6AA67F9015FC429D00B5A308 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0440;
|
||||
ORGANIZATIONNAME = OpenVanilla;
|
||||
};
|
||||
buildConfigurationList = 6AA67F9315FC429D00B5A308 /* Build configuration list for PBXProject "IconMaker" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 6AA67F8E15FC429D00B5A308;
|
||||
productRefGroup = 6AA67F9A15FC429D00B5A308 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
6AA67F9815FC429D00B5A308 /* IconMaker */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
6AA67F9715FC429D00B5A308 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6AA67FD715FC430F00B5A308 /* MainMenu.xib in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
6AA67F9515FC429D00B5A308 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6AA67FD315FC430F00B5A308 /* AppIconRendererView.m in Sources */,
|
||||
6AA67FD415FC430F00B5A308 /* BopomofoIconRenderView.m in Sources */,
|
||||
6AA67FD915FC430F00B5A308 /* IconMakerAppDelegate.m in Sources */,
|
||||
6AA67FDA15FC430F00B5A308 /* ImageZoomInView.m in Sources */,
|
||||
6AA67FDB15FC430F00B5A308 /* main.m in Sources */,
|
||||
6AA67FDC15FC430F00B5A308 /* TISIconRendererView.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
6AA67FC815FC430F00B5A308 /* MainMenu.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
6AA67FC915FC430F00B5A308 /* en */,
|
||||
);
|
||||
name = MainMenu.xib;
|
||||
path = en.lproj;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
6AA67FB515FC429D00B5A308 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
6AA67FB615FC429D00B5A308 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
6AA67FB815FC429D00B5A308 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "IconMaker-Prefix.pch";
|
||||
INFOPLIST_FILE = "IconMaker-Info.plist";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
6AA67FB915FC429D00B5A308 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "IconMaker-Prefix.pch";
|
||||
INFOPLIST_FILE = "IconMaker-Info.plist";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
6AA67F9315FC429D00B5A308 /* Build configuration list for PBXProject "IconMaker" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
6AA67FB515FC429D00B5A308 /* Debug */,
|
||||
6AA67FB615FC429D00B5A308 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
6AA67FB715FC429D00B5A308 /* Build configuration list for PBXNativeTarget "IconMaker" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
6AA67FB815FC429D00B5A308 /* Debug */,
|
||||
6AA67FB915FC429D00B5A308 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 6AA67F9015FC429D00B5A308 /* Project object */;
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
//
|
||||
// IconMakerAppDelegate.h
|
||||
//
|
||||
// Copyright (c) 2011 The McBopomofo Project.
|
||||
//
|
||||
// Contributors:
|
||||
// Mengjuei Hsieh (@mjhsieh)
|
||||
// Weizhong Yang (@zonble)
|
||||
//
|
||||
// Based on the Syrup Project and the Formosana Library
|
||||
// by Lukhnos Liu (@lukhnos).
|
||||
//
|
||||
// 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:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// 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/Cocoa.h>
|
||||
#import "TISIconRendererView.h"
|
||||
#import "BopomofoIconRenderView.h"
|
||||
|
||||
@interface IconMakerAppDelegate : NSObject <NSApplicationDelegate>
|
||||
@property (assign) IBOutlet NSWindow *window;
|
||||
@property (assign) IBOutlet TISIconRendererView *selectedTISIconRendererView;
|
||||
@property (assign) IBOutlet TISIconRendererView *faviconRenderView;
|
||||
@property (assign) IBOutlet BopomofoIconRenderView *bopomofoIconRenderView;
|
||||
@property (assign) IBOutlet BopomofoIconRenderView *bopomofoIconRenderView2x;
|
||||
@end
|
|
@ -1,112 +0,0 @@
|
|||
//
|
||||
// IconMakerAppDelegate.m
|
||||
//
|
||||
// Copyright (c) 2011 The McBopomofo Project.
|
||||
//
|
||||
// Contributors:
|
||||
// Mengjuei Hsieh (@mjhsieh)
|
||||
// Weizhong Yang (@zonble)
|
||||
//
|
||||
// Based on the Syrup Project and the Formosana Library
|
||||
// by Lukhnos Liu (@lukhnos).
|
||||
//
|
||||
// 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:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// 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 "IconMakerAppDelegate.h"
|
||||
|
||||
@implementation IconMakerAppDelegate
|
||||
|
||||
- (void)makeIconForObject:(id)object size:(NSSize)size filename:(NSString *)name
|
||||
{
|
||||
NSRect rect;
|
||||
rect.origin = NSZeroPoint;
|
||||
rect.size = size;
|
||||
|
||||
NSView *view = nil;
|
||||
if ([object isKindOfClass:[NSView class]]) {
|
||||
view = object;
|
||||
[view setFrame:NSMakeRect(0.0, 0.0, size.width, size.height)];
|
||||
}
|
||||
else if ([object isKindOfClass:[NSString class]]) {
|
||||
view = [[[NSClassFromString(object) alloc] initWithFrame:rect] autorelease];
|
||||
}
|
||||
|
||||
NSImage *image = [[[NSImage alloc] initWithSize:size] autorelease];
|
||||
[image lockFocus];
|
||||
[view drawRect:rect];
|
||||
[image unlockFocus];
|
||||
NSData *data = [image TIFFRepresentation];
|
||||
[data writeToFile:name atomically:YES];
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
||||
{
|
||||
// Insert code here to initialize your application
|
||||
self.selectedTISIconRendererView.selected = YES;
|
||||
[self.selectedTISIconRendererView setNeedsDisplay:YES];
|
||||
|
||||
self.faviconRenderView.favicon = YES;
|
||||
self.faviconRenderView.selected = YES;
|
||||
NSRect oldFrame = [self.faviconRenderView frame];
|
||||
[self makeIconForObject:self.faviconRenderView size:NSMakeSize(16, 16) filename:@"/tmp/BopomofoFavicon.tiff"];
|
||||
[self.faviconRenderView setFrame:oldFrame];
|
||||
[self.faviconRenderView setNeedsDisplay:YES];
|
||||
|
||||
self.bopomofoIconRenderView.textMenuIcon = NO;
|
||||
self.bopomofoIconRenderView.plainBopomofoIcon = NO;
|
||||
self.bopomofoIconRenderView2x.textMenuIcon = NO;
|
||||
self.bopomofoIconRenderView2x.plainBopomofoIcon = NO;
|
||||
[self.bopomofoIconRenderView setNeedsDisplay:YES];
|
||||
[self.bopomofoIconRenderView2x setNeedsDisplay:YES];
|
||||
|
||||
BopomofoIconRenderView *iconRenderView = [[[BopomofoIconRenderView alloc] init] autorelease];
|
||||
iconRenderView.textMenuIcon = NO;
|
||||
iconRenderView.plainBopomofoIcon = NO;
|
||||
[self makeIconForObject:iconRenderView size:NSMakeSize(16, 16) filename:@"/tmp/Bopomofo.tiff"];
|
||||
[self makeIconForObject:iconRenderView size:NSMakeSize(32, 32) filename:@"/tmp/Bopomofo@2x.tiff"];
|
||||
|
||||
iconRenderView.textMenuIcon = NO;
|
||||
iconRenderView.plainBopomofoIcon = YES;
|
||||
[self makeIconForObject:iconRenderView size:NSMakeSize(16, 16) filename:@"/tmp/PlainBopomofo.tiff"];
|
||||
[self makeIconForObject:iconRenderView size:NSMakeSize(32, 32) filename:@"/tmp/PlainBopomofo@2x.tiff"];
|
||||
|
||||
iconRenderView.plainBopomofoIcon = NO;
|
||||
iconRenderView.textMenuIcon = YES;
|
||||
[self makeIconForObject:iconRenderView size:NSMakeSize(16, 16) filename:@"/tmp/BopomofoTextMenu.tiff"];
|
||||
[self makeIconForObject:iconRenderView size:NSMakeSize(32, 32) filename:@"/tmp/BopomofoTextMenu@2x.tiff"];
|
||||
|
||||
[self makeIconForObject:iconRenderView size:NSMakeSize(16, 16) filename:@"/tmp/icon_16x16.tiff"];
|
||||
[self makeIconForObject:iconRenderView size:NSMakeSize(32, 32) filename:@"/tmp/icon_16x16@2x.tiff"];
|
||||
[self makeIconForObject:iconRenderView size:NSMakeSize(32, 32) filename:@"/tmp/icon_32x32.tiff"];
|
||||
[self makeIconForObject:iconRenderView size:NSMakeSize(64, 64) filename:@"/tmp/icon_32x32@2x.tiff"];
|
||||
[self makeIconForObject:@"AppIconRendererView" size:NSMakeSize(128, 128) filename:@"/tmp/icon_128x128.tiff"];
|
||||
[self makeIconForObject:@"AppIconRendererView" size:NSMakeSize(256, 256) filename:@"/tmp/icon_128x128@2x.tiff"];
|
||||
[self makeIconForObject:@"AppIconRendererView" size:NSMakeSize(256, 256) filename:@"/tmp/icon_256x256.tiff"];
|
||||
[self makeIconForObject:@"AppIconRendererView" size:NSMakeSize(512, 512) filename:@"/tmp/icon_256x256@2x.tiff"];
|
||||
[self makeIconForObject:@"AppIconRendererView" size:NSMakeSize(512, 512) filename:@"/tmp/icon_512x512.tiff"];
|
||||
[self makeIconForObject:@"AppIconRendererView" size:NSMakeSize(1024, 1024) filename:@"/tmp/icon_512x512@2x.tiff"];
|
||||
|
||||
NSRunAlertPanel(@"Icons Generated", @"TIFF files are placed in /tmp", @"Dismiss", nil, nil);
|
||||
}
|
||||
|
||||
@end
|
|
@ -1,42 +0,0 @@
|
|||
//
|
||||
// ImageZoomInView.h
|
||||
//
|
||||
// Copyright (c) 2011 The McBopomofo Project.
|
||||
//
|
||||
// Contributors:
|
||||
// Mengjuei Hsieh (@mjhsieh)
|
||||
// Weizhong Yang (@zonble)
|
||||
//
|
||||
// Based on the Syrup Project and the Formosana Library
|
||||
// by Lukhnos Liu (@lukhnos).
|
||||
//
|
||||
// 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:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// 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/Cocoa.h>
|
||||
|
||||
@interface ImageZoomInView : NSView
|
||||
{
|
||||
NSRect imageBoundRect;
|
||||
}
|
||||
@property (nonatomic, retain) NSImage *image;
|
||||
@end
|
|
@ -1,77 +0,0 @@
|
|||
//
|
||||
// ImageZoomInView.m
|
||||
//
|
||||
// Copyright (c) 2011 The McBopomofo Project.
|
||||
//
|
||||
// Contributors:
|
||||
// Mengjuei Hsieh (@mjhsieh)
|
||||
// Weizhong Yang (@zonble)
|
||||
//
|
||||
// Based on the Syrup Project and the Formosana Library
|
||||
// by Lukhnos Liu (@lukhnos).
|
||||
//
|
||||
// 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:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// 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 "ImageZoomInView.h"
|
||||
#import "TISIconRendererView.h"
|
||||
|
||||
@implementation ImageZoomInView
|
||||
@synthesize image;
|
||||
|
||||
- (id)initWithFrame:(NSRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
// Initialization code here.
|
||||
|
||||
image = [[NSImage alloc] initWithSize:NSMakeSize(16.0, 16.0)];
|
||||
[image lockFocus];
|
||||
imageBoundRect = NSMakeRect(0.0, 0.0, 16.0, 16.0);
|
||||
|
||||
// [[NSColor clearColor] setFill];
|
||||
// [NSBezierPath fillRect:imageBoundRect];
|
||||
|
||||
TISIconRendererView *rendererView = [[TISIconRendererView alloc] initWithFrame:imageBoundRect];
|
||||
[rendererView drawRect:imageBoundRect];
|
||||
[image unlockFocus];
|
||||
}
|
||||
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[image release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)drawRect:(NSRect)dirtyRect
|
||||
{
|
||||
[[NSColor blackColor] setStroke];
|
||||
[NSBezierPath strokeRect:[self bounds]];
|
||||
|
||||
[image drawInRect:[self bounds] fromRect:imageBoundRect operation:NSCompositeSourceOver fraction:1.0];
|
||||
}
|
||||
|
||||
@end
|
|
@ -1,40 +0,0 @@
|
|||
//
|
||||
// TISIconRendererView.h
|
||||
//
|
||||
// Copyright (c) 2011 The McBopomofo Project.
|
||||
//
|
||||
// Contributors:
|
||||
// Mengjuei Hsieh (@mjhsieh)
|
||||
// Weizhong Yang (@zonble)
|
||||
//
|
||||
// Based on the Syrup Project and the Formosana Library
|
||||
// by Lukhnos Liu (@lukhnos).
|
||||
//
|
||||
// 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:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// 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/Cocoa.h>
|
||||
|
||||
@interface TISIconRendererView : NSView
|
||||
@property (nonatomic, assign) BOOL favicon;
|
||||
@property (nonatomic, assign) BOOL selected;
|
||||
@end
|
|
@ -1,116 +0,0 @@
|
|||
//
|
||||
// TISIconRendererView.m
|
||||
//
|
||||
// Copyright (c) 2011 The McBopomofo Project.
|
||||
//
|
||||
// Contributors:
|
||||
// Mengjuei Hsieh (@mjhsieh)
|
||||
// Weizhong Yang (@zonble)
|
||||
//
|
||||
// Based on the Syrup Project and the Formosana Library
|
||||
// by Lukhnos Liu (@lukhnos).
|
||||
//
|
||||
// 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:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// 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 "TISIconRendererView.h"
|
||||
|
||||
@implementation TISIconRendererView
|
||||
@synthesize selected;
|
||||
@synthesize favicon;
|
||||
|
||||
- (void)drawRect:(NSRect)dirtyRect
|
||||
{
|
||||
NSRect boundsRect = [self bounds];
|
||||
|
||||
if (favicon) {
|
||||
boundsRect.origin.x += 0.0;
|
||||
boundsRect.origin.y += 1.0;
|
||||
boundsRect.size.width -= 1.0;
|
||||
boundsRect.size.height -= 2.0;
|
||||
|
||||
NSBezierPath *roundRectPath = [NSBezierPath bezierPathWithRoundedRect:boundsRect xRadius:1 yRadius:2];
|
||||
[[NSColor grayColor] setFill];
|
||||
[roundRectPath fill];
|
||||
|
||||
boundsRect.origin.x += 0.0;
|
||||
boundsRect.origin.y += 1.0;
|
||||
boundsRect.size.width -= 1.0;
|
||||
boundsRect.size.height -= 1.0;
|
||||
|
||||
}
|
||||
else {
|
||||
boundsRect.origin.x += 0.0;
|
||||
boundsRect.origin.y += 1.0;
|
||||
boundsRect.size.width -= 1.0;
|
||||
boundsRect.size.height -= 1.0;
|
||||
}
|
||||
|
||||
NSInteger fontSize = 16;
|
||||
if (favicon) {
|
||||
fontSize = 11;
|
||||
}
|
||||
|
||||
NSString *text = @"ㄅ";
|
||||
NSString *fontName = @"LiSong Pro";
|
||||
|
||||
NSColor *textColor = nil;
|
||||
NSColor *shadowColor = nil;
|
||||
if (!selected) {
|
||||
textColor = [NSColor blackColor];
|
||||
shadowColor = [NSColor colorWithDeviceWhite:0.9 alpha:0.9];
|
||||
}
|
||||
else {
|
||||
shadowColor = [NSColor darkGrayColor];
|
||||
textColor = [NSColor colorWithDeviceWhite:1.0 alpha:1.0];
|
||||
}
|
||||
|
||||
NSShadow *textShadow = [[NSShadow alloc] init];
|
||||
[textShadow setShadowColor:shadowColor];
|
||||
[textShadow setShadowOffset:NSMakeSize(-1, -1)];
|
||||
|
||||
NSMutableDictionary *attrDict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
|
||||
textColor, NSForegroundColorAttributeName,
|
||||
textShadow, NSShadowAttributeName,
|
||||
[NSFont fontWithName:fontName size:fontSize], NSFontAttributeName,
|
||||
nil];
|
||||
NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:text attributes:attrDict];
|
||||
|
||||
NSRect textBounds = [attrString boundingRectWithSize:boundsRect.size options:NSStringDrawingUsesLineFragmentOrigin];
|
||||
|
||||
NSPoint textOrigin;
|
||||
textOrigin.x = boundsRect.origin.x + (boundsRect.size.width - textBounds.size.width) / 2.0;
|
||||
|
||||
if (favicon) {
|
||||
textOrigin.x += 1;
|
||||
textOrigin.y = boundsRect.origin.y;
|
||||
}
|
||||
else {
|
||||
textOrigin.y = boundsRect.origin.y - 2;
|
||||
}
|
||||
|
||||
attrString = [[NSAttributedString alloc] initWithString:text attributes:attrDict];
|
||||
[attrString drawAtPoint:textOrigin];
|
||||
|
||||
}
|
||||
|
||||
@end
|
|
@ -1,40 +0,0 @@
|
|||
//
|
||||
// main.m
|
||||
//
|
||||
// Copyright (c) 2011 The McBopomofo Project.
|
||||
//
|
||||
// Contributors:
|
||||
// Mengjuei Hsieh (@mjhsieh)
|
||||
// Weizhong Yang (@zonble)
|
||||
//
|
||||
// Based on the Syrup Project and the Formosana Library
|
||||
// by Lukhnos Liu (@lukhnos).
|
||||
//
|
||||
// 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:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// 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/Cocoa.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, (const char **)argv);
|
||||
}
|
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.5 KiB |
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "64X64.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "128X128.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "192x192.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 869 B |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 1.5 KiB |
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "16X16.png",
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "16x16"
|
||||
},
|
||||
{
|
||||
"filename" : "32X32.png",
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "16x16"
|
||||
},
|
||||
{
|
||||
"filename" : "32X32.png",
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "32x32"
|
||||
},
|
||||
{
|
||||
"filename" : "64X64.png",
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "32x32"
|
||||
},
|
||||
{
|
||||
"filename" : "128X128.png",
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "128x128"
|
||||
},
|
||||
{
|
||||
"filename" : "256X256.png",
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "128x128"
|
||||
},
|
||||
{
|
||||
"filename" : "256X256.png",
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "256x256"
|
||||
},
|
||||
{
|
||||
"filename" : "512X512.png",
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "256x256"
|
||||
},
|
||||
{
|
||||
"filename" : "512X512.png",
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "512x512"
|
||||
},
|
||||
{
|
||||
"filename" : "1024X1024.png",
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "512x512"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 107 KiB |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 107 KiB |
Before Width: | Height: | Size: 351 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 6.2 KiB |
|
@ -72,6 +72,9 @@
|
|||
|
||||
// current input mode
|
||||
NSString *_inputMode;
|
||||
|
||||
// if Chinese conversion is enabled
|
||||
BOOL _chineseConversionEnabled;
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
|
@ -41,6 +41,9 @@
|
|||
#import "AppDelegate.h"
|
||||
#import "VTHorizontalCandidateController.h"
|
||||
#import "VTVerticalCandidateController.h"
|
||||
#import "McBopomofo-Swift.h"
|
||||
|
||||
//@import SwiftUI;
|
||||
|
||||
// C++ namespace usages
|
||||
using namespace std;
|
||||
|
@ -74,6 +77,8 @@ static NSString *const kSelectPhraseAfterCursorAsCandidatePreferenceKey = @"Sele
|
|||
static NSString *const kUseHorizontalCandidateListPreferenceKey = @"UseHorizontalCandidateList";
|
||||
static NSString *const kComposingBufferSizePreferenceKey = @"ComposingBufferSize";
|
||||
static NSString *const kChooseCandidateUsingSpaceKey = @"ChooseCandidateUsingSpaceKey";
|
||||
static NSString *const kChineseConversionEnabledKey = @"ChineseConversionEnabledKey";
|
||||
static NSString *const kDisableUserCandidateSelectionLearning = @"DisableUserCandidateSelectionLearning";
|
||||
|
||||
// advanced (usually optional) settings
|
||||
static NSString *const kCandidateTextFontName = @"CandidateTextFontName";
|
||||
|
@ -117,6 +122,12 @@ static const int kUserOverrideModelCapacity = 500;
|
|||
static const double kObservedOverrideHalflife = 5400.0; // 1.5 hr.
|
||||
McBopomofo::UserOverrideModel gUserOverrideModel(kUserOverrideModelCapacity, kObservedOverrideHalflife);
|
||||
|
||||
// https://clang-analyzer.llvm.org/faq.html
|
||||
__attribute__((annotate("returns_localized_nsstring")))
|
||||
static inline NSString *LocalizationNotNeeded(NSString *s) {
|
||||
return s;
|
||||
}
|
||||
|
||||
// private methods
|
||||
@interface McBopomofoInputMethodController () <VTCandidateControllerDelegate>
|
||||
+ (VTHorizontalCandidateController *)horizontalCandidateController;
|
||||
|
@ -183,15 +194,8 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
if (_builder) {
|
||||
delete _builder;
|
||||
}
|
||||
|
||||
[_composingBuffer release];
|
||||
|
||||
[_candidates release];
|
||||
|
||||
// the two client pointers are weak pointers (i.e. we don't retain them)
|
||||
// therefore we don't do anything about it
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id)initWithServer:(IMKServer *)server delegate:(id)delegate client:(id)client
|
||||
|
@ -218,6 +222,7 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
_composingBuffer = [[NSMutableString alloc] init];
|
||||
|
||||
_inputMode = kBopomofoModeIdentifier;
|
||||
_chineseConversionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:kChineseConversionEnabledKey];
|
||||
}
|
||||
|
||||
return self;
|
||||
|
@ -226,16 +231,43 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
- (NSMenu *)menu
|
||||
{
|
||||
// a menu instance (autoreleased) is requested every time the user click on the input menu
|
||||
NSMenu *menu = [[[NSMenu alloc] initWithTitle:@"Input Method Menu"] autorelease];
|
||||
NSMenuItem *preferenceMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"McBopomofo Preferences", @"") action:@selector(showPreferences:) keyEquivalent:@""] autorelease];
|
||||
NSMenu *menu = [[NSMenu alloc] initWithTitle:LocalizationNotNeeded(@"Input Method Menu")];
|
||||
NSMenuItem *preferenceMenuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"McBopomofo Preferences", @"") action:@selector(showPreferences:) keyEquivalent:@""];
|
||||
[menu addItem:preferenceMenuItem];
|
||||
|
||||
#if DEBUG
|
||||
NSMenuItem *updateCheckItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Check for Updates…", @"") action:@selector(checkForUpdate:) keyEquivalent:@""] autorelease];
|
||||
[menu addItem:updateCheckItem];
|
||||
#endif
|
||||
// If Option key is pressed, show the learning-related menu
|
||||
|
||||
NSMenuItem *aboutMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"About McBopomofo…", @"") action:@selector(showAbout:) keyEquivalent:@""] autorelease];
|
||||
#if DEBUG
|
||||
//I think the following line is 10.6+ specific
|
||||
if ([[NSEvent class] respondsToSelector:@selector(modifierFlags)] && ([NSEvent modifierFlags] & NSAlternateKeyMask)) {
|
||||
|
||||
BOOL learningEnabled = ![[NSUserDefaults standardUserDefaults] boolForKey:kDisableUserCandidateSelectionLearning];
|
||||
|
||||
NSMenuItem *learnMenuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Enable Selection Learning", @"") action:@selector(toggleLearning:) keyEquivalent:@""];
|
||||
learnMenuItem.state = learningEnabled ? NSControlStateValueOn : NSControlStateValueOff;
|
||||
[menu addItem:learnMenuItem];
|
||||
|
||||
if (learningEnabled) {
|
||||
NSString *clearMenuItemTitle = [NSString stringWithFormat:NSLocalizedString(@"Clear Learning Dictionary (%ju Items)", @""), (uintmax_t)[gCandidateLearningDictionary count]];
|
||||
NSMenuItem *clearMenuItem = [[NSMenuItem alloc] initWithTitle:clearMenuItemTitle action:@selector(clearLearningDictionary:) keyEquivalent:@""];
|
||||
[menu addItem:clearMenuItem];
|
||||
|
||||
|
||||
NSMenuItem *dumpMenuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Dump Learning Data to Console", @"") action:@selector(dumpLearningDictionary:) keyEquivalent:@""];
|
||||
[menu addItem:dumpMenuItem];
|
||||
}
|
||||
}
|
||||
#endif //DEBUG
|
||||
|
||||
NSMenuItem *chineseConversionMenuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Chinese Conversion", @"") action:@selector(toggleChineseConverter:) keyEquivalent:@"G"];
|
||||
chineseConversionMenuItem.keyEquivalentModifierMask = NSEventModifierFlagCommand | NSEventModifierFlagControl;
|
||||
chineseConversionMenuItem.state = _chineseConversionEnabled ? NSControlStateValueOn : NSControlStateValueOff;
|
||||
[menu addItem:chineseConversionMenuItem];
|
||||
|
||||
NSMenuItem *updateCheckItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Check for Updates…", @"") action:@selector(checkForUpdate:) keyEquivalent:@""];
|
||||
[menu addItem:updateCheckItem];
|
||||
|
||||
NSMenuItem *aboutMenuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"About McBopomofo…", @"") action:@selector(showAbout:) keyEquivalent:@""];
|
||||
[menu addItem:aboutMenuItem];
|
||||
|
||||
return menu;
|
||||
|
@ -389,8 +421,13 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
return;
|
||||
}
|
||||
|
||||
NSString *buffer = _composingBuffer;
|
||||
if (_chineseConversionEnabled) {
|
||||
buffer = [OpenCCBridge convert:_composingBuffer];
|
||||
}
|
||||
|
||||
// commit the text, clear the state
|
||||
[client insertText:_composingBuffer replacementRange:NSMakeRange(NSNotFound, NSNotFound)];
|
||||
[client insertText:buffer replacementRange:NSMakeRange(NSNotFound, NSNotFound)];
|
||||
_builder->clear();
|
||||
_walkedNodes.clear();
|
||||
[_composingBuffer setString:@""];
|
||||
|
@ -453,10 +490,9 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
|
||||
// we must use NSAttributedString so that the cursor is visible --
|
||||
// can't just use NSString
|
||||
NSDictionary *attrDict = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithInt:NSUnderlineStyleSingle], NSUnderlineStyleAttributeName,
|
||||
[NSNumber numberWithInt:0], NSMarkedClauseSegmentAttributeName, nil];
|
||||
NSMutableAttributedString *attrString = [[[NSMutableAttributedString alloc] initWithString:composedText attributes:attrDict] autorelease];
|
||||
NSDictionary *attrDict = @{NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle),
|
||||
NSMarkedClauseSegmentAttributeName: @0};
|
||||
NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:composedText attributes:attrDict];
|
||||
|
||||
// the selection range is where the cursor is, with the length being 0 and replacement range NSNotFound,
|
||||
// i.e. the client app needs to take care of where to put ths composing buffer
|
||||
|
@ -589,6 +625,11 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
return NO;
|
||||
}
|
||||
|
||||
// if ASCII but not printable, don't use insertText:replacementRange: as many apps don't handle non-ASCII char insertions.
|
||||
if (charCode < 0x80 && !isprint(charCode)) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
// when shift is pressed, don't do further processing, since it outputs capital letter anyway.
|
||||
NSString *popedText = [inputText lowercaseString];
|
||||
[client insertText:popedText replacementRange:NSMakeRange(NSNotFound, NSNotFound)];
|
||||
|
@ -974,7 +1015,12 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
}
|
||||
}
|
||||
|
||||
if (charCode == 27) {
|
||||
BOOL cancelCandidateKey =
|
||||
(charCode == 27) ||
|
||||
((_inputMode == kPlainBopomofoModeIdentifier) &&
|
||||
(charCode == 8 || keyCode == kDeleteKeyCode));
|
||||
|
||||
if (cancelCandidateKey) {
|
||||
gCurrentCandidateController.visible = NO;
|
||||
[_candidates removeAllObjects];
|
||||
|
||||
|
@ -995,6 +1041,7 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
if (!updated) {
|
||||
[self beep];
|
||||
}
|
||||
[self updateClientComposingBuffer:_currentCandidateClient];
|
||||
return YES;
|
||||
}
|
||||
else if (keyCode == kPageUpKeyCode) {
|
||||
|
@ -1002,6 +1049,7 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
if (!updated) {
|
||||
[self beep];
|
||||
}
|
||||
[self updateClientComposingBuffer:_currentCandidateClient];
|
||||
return YES;
|
||||
}
|
||||
else if (keyCode == kLeftKeyCode) {
|
||||
|
@ -1010,10 +1058,12 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
if (!updated) {
|
||||
[self beep];
|
||||
}
|
||||
[self updateClientComposingBuffer:_currentCandidateClient];
|
||||
return YES;
|
||||
}
|
||||
else {
|
||||
[self beep];
|
||||
[self updateClientComposingBuffer:_currentCandidateClient];
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
@ -1023,10 +1073,12 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
if (!updated) {
|
||||
[self beep];
|
||||
}
|
||||
[self updateClientComposingBuffer:_currentCandidateClient];
|
||||
return YES;
|
||||
}
|
||||
else {
|
||||
[self beep];
|
||||
[self updateClientComposingBuffer:_currentCandidateClient];
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
@ -1036,6 +1088,7 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
if (!updated) {
|
||||
[self beep];
|
||||
}
|
||||
[self updateClientComposingBuffer:_currentCandidateClient];
|
||||
return YES;
|
||||
}
|
||||
else {
|
||||
|
@ -1043,6 +1096,7 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
if (!updated) {
|
||||
[self beep];
|
||||
}
|
||||
[self updateClientComposingBuffer:_currentCandidateClient];
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
@ -1052,6 +1106,7 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
if (!updated) {
|
||||
[self beep];
|
||||
}
|
||||
[self updateClientComposingBuffer:_currentCandidateClient];
|
||||
return YES;
|
||||
}
|
||||
else {
|
||||
|
@ -1059,6 +1114,7 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
if (!updated) {
|
||||
[self beep];
|
||||
}
|
||||
[self updateClientComposingBuffer:_currentCandidateClient];
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
@ -1071,6 +1127,7 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
gCurrentCandidateController.selectedCandidateIndex = 0;
|
||||
}
|
||||
|
||||
[self updateClientComposingBuffer:_currentCandidateClient];
|
||||
return YES;
|
||||
}
|
||||
else if (keyCode == kEndKeyCode && [_candidates count] > 0) {
|
||||
|
@ -1081,6 +1138,7 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
gCurrentCandidateController.selectedCandidateIndex = [_candidates count] - 1;
|
||||
}
|
||||
|
||||
[self updateClientComposingBuffer:_currentCandidateClient];
|
||||
return YES;
|
||||
}
|
||||
else {
|
||||
|
@ -1112,6 +1170,7 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
}
|
||||
|
||||
[self beep];
|
||||
[self updateClientComposingBuffer:_currentCandidateClient];
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
@ -1345,6 +1404,30 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
||||
}
|
||||
|
||||
- (void)toggleLearning:(id)sender
|
||||
{
|
||||
BOOL toggle = ![[NSUserDefaults standardUserDefaults] boolForKey:kDisableUserCandidateSelectionLearning];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setBool:toggle forKey:kDisableUserCandidateSelectionLearning];
|
||||
}
|
||||
|
||||
- (void)toggleChineseConverter:(id)sender
|
||||
{
|
||||
_chineseConversionEnabled = !_chineseConversionEnabled;
|
||||
[[NSUserDefaults standardUserDefaults] setBool:_chineseConversionEnabled forKey:kChineseConversionEnabledKey];
|
||||
}
|
||||
|
||||
- (void)clearLearningDictionary:(id)sender
|
||||
{
|
||||
[gCandidateLearningDictionary removeAllObjects];
|
||||
[self _performDeferredSaveUserCandidatesDictionary];
|
||||
}
|
||||
|
||||
- (void)dumpLearningDictionary:(id)sender
|
||||
{
|
||||
NSLog(@"%@", gCandidateLearningDictionary);
|
||||
}
|
||||
|
||||
- (NSUInteger)candidateCountForController:(VTCandidateController *)controller
|
||||
{
|
||||
return [_candidates count];
|
||||
|
@ -1366,6 +1449,7 @@ static void OverrideCandidate(const vector<NodeAnchor>& nodes, const string& can
|
|||
if (_inputMode != kPlainBopomofoModeIdentifier) {
|
||||
_uom->observe(_walkedNodes, cursorIndex, selectedValue, [[NSDate date] timeIntervalSince1970]);
|
||||
}
|
||||
_builder->grid().fixNodeSelectedCandidate(cursorIndex, selectedValue);
|
||||
|
||||
vector<NodeAnchor> nodes = _builder->grid().nodesCrossingOrEndingAt(cursorIndex);
|
||||
OverrideCandidate(nodes, selectedValue, true, 0.0);
|
||||
|
@ -1433,7 +1517,7 @@ void LTLoadLanguageModel()
|
|||
|
||||
// TODO: Change this
|
||||
NSString *userDictFile = [userDictPath stringByAppendingPathComponent:@"UserCandidatesCache.plist"];
|
||||
gUserCandidatesDictionaryPath = [userDictFile retain];
|
||||
gUserCandidatesDictionaryPath = userDictFile;
|
||||
|
||||
exists = [[NSFileManager defaultManager] fileExistsAtPath:userDictFile isDirectory:&isDir];
|
||||
if (exists && !isDir) {
|
||||
|
@ -1442,9 +1526,7 @@ void LTLoadLanguageModel()
|
|||
return;
|
||||
}
|
||||
|
||||
NSString *errorStr = nil;
|
||||
NSPropertyListFormat format;
|
||||
id plist = [NSPropertyListSerialization propertyListFromData:data mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&errorStr];
|
||||
id plist = [NSPropertyListSerialization propertyListWithData:data options:NSPropertyListImmutable format:NULL error:NULL];
|
||||
if (plist && [plist isKindOfClass:[NSDictionary class]]) {
|
||||
[gCandidateLearningDictionary setDictionary:(NSDictionary *)plist];
|
||||
NSLog(@"User dictionary read, item count: %ju", (uintmax_t)[gCandidateLearningDictionary count]);
|
||||
|
|
|
@ -26,26 +26,28 @@
|
|||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "ArchiveUtil.h"
|
||||
|
||||
@interface AppDelegate : NSWindowController <NSApplicationDelegate>
|
||||
{
|
||||
@protected
|
||||
ArchiveUtil *_archiveUtil;
|
||||
NSString *_installingVersion;
|
||||
BOOL _upgrading;
|
||||
NSButton *_installButton;
|
||||
NSButton *_cancelButton;
|
||||
NSTextView *_textView;
|
||||
NSWindow *_progressSheet;
|
||||
NSProgressIndicator *_progressIndicator;
|
||||
NSButton *__weak _installButton;
|
||||
NSButton *__weak _cancelButton;
|
||||
NSTextView *__unsafe_unretained _textView;
|
||||
NSWindow *__weak _progressSheet;
|
||||
NSProgressIndicator *__weak _progressIndicator;
|
||||
NSDate *_translocationRemovalStartTime;
|
||||
NSInteger _currentVersionNumber;
|
||||
}
|
||||
- (IBAction)agreeAndInstallAction:(id)sender;
|
||||
- (IBAction)cancelAction:(id)sender;
|
||||
|
||||
@property (assign) IBOutlet NSButton *installButton;
|
||||
@property (assign) IBOutlet NSButton *cancelButton;
|
||||
@property (assign) IBOutlet NSTextView *textView;
|
||||
@property (assign) IBOutlet NSWindow *progressSheet;
|
||||
@property (assign) IBOutlet NSProgressIndicator *progressIndicator;
|
||||
@property (weak) IBOutlet NSButton *installButton;
|
||||
@property (weak) IBOutlet NSButton *cancelButton;
|
||||
@property (unsafe_unretained) IBOutlet NSTextView *textView;
|
||||
@property (weak) IBOutlet NSWindow *progressSheet;
|
||||
@property (weak) IBOutlet NSProgressIndicator *progressIndicator;
|
||||
@end
|
||||
|
|
|
@ -38,6 +38,16 @@ static NSString *const kTargetFullBinPartialPath = @"~/Library/Input Methods/McB
|
|||
static const NSTimeInterval kTranslocationRemovalTickInterval = 0.5;
|
||||
static const NSTimeInterval kTranslocationRemovalDeadline = 60.0;
|
||||
|
||||
/// A simple replacement for the deprecated NSRunAlertPanel.
|
||||
void RunAlertPanel(NSString *title, NSString *message, NSString *buttonTitle) {
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
[alert setAlertStyle:NSAlertStyleInformational];
|
||||
[alert setMessageText:title];
|
||||
[alert setInformativeText:message];
|
||||
[alert addButtonWithTitle:buttonTitle];
|
||||
[alert runModal];
|
||||
}
|
||||
|
||||
@implementation AppDelegate
|
||||
@synthesize installButton = _installButton;
|
||||
@synthesize cancelButton = _cancelButton;
|
||||
|
@ -45,26 +55,25 @@ static const NSTimeInterval kTranslocationRemovalDeadline = 60.0;
|
|||
@synthesize progressSheet = _progressSheet;
|
||||
@synthesize progressIndicator = _progressIndicator;
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_installingVersion release];
|
||||
[_translocationRemovalStartTime release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
||||
{
|
||||
_installingVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:(id)kCFBundleVersionKey];
|
||||
NSString *versionString = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
|
||||
|
||||
_archiveUtil = [[ArchiveUtil alloc] initWithAppName:kTargetBin targetAppBundleName:kTargetBundle];
|
||||
[_archiveUtil validateIfNotarizedArchiveExists];
|
||||
|
||||
[self.cancelButton setNextKeyView:self.installButton];
|
||||
[self.installButton setNextKeyView:self.cancelButton];
|
||||
[[self window] setDefaultButtonCell:[self.installButton cell]];
|
||||
|
||||
NSAttributedString *attrStr = [[[NSAttributedString alloc] initWithRTF:[NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"License" ofType:@"rtf"]] documentAttributes:NULL] autorelease];
|
||||
NSAttributedString *attrStr = [[NSAttributedString alloc] initWithRTF:[NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"License" ofType:@"rtf"]] documentAttributes:NULL];
|
||||
|
||||
[[self.textView textStorage] setAttributedString:attrStr];
|
||||
|
||||
NSBundle *installingBundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:kTargetBin ofType:kTargetType]];
|
||||
_installingVersion = [[[installingBundle infoDictionary] objectForKey:(id)kCFBundleVersionKey] retain];
|
||||
NSString *versionString = [[installingBundle infoDictionary] objectForKey:@"CFBundleShortVersionString"];
|
||||
NSMutableAttributedString *mutableAttrStr = [attrStr mutableCopy];
|
||||
[mutableAttrStr addAttribute:NSForegroundColorAttributeName value:[NSColor controlTextColor] range:NSMakeRange(0, [mutableAttrStr length])];
|
||||
[[self.textView textStorage] setAttributedString:mutableAttrStr];
|
||||
[self.textView setSelectedRange:NSMakeRange(0, 0)];
|
||||
|
||||
[[self window] setTitle:[NSString stringWithFormat:NSLocalizedString(@"%@ (for version %@, r%@)", nil), [[self window] title], versionString, _installingVersion]];
|
||||
|
||||
|
@ -128,8 +137,7 @@ static const NSTimeInterval kTranslocationRemovalDeadline = 60.0;
|
|||
});
|
||||
}];
|
||||
|
||||
[_translocationRemovalStartTime release];
|
||||
_translocationRemovalStartTime = [[NSDate date] retain];
|
||||
_translocationRemovalStartTime = [NSDate date];
|
||||
[NSTimer scheduledTimerWithTimeInterval:kTranslocationRemovalTickInterval target:self selector:@selector(timerTick:) userInfo:nil repeats:YES];
|
||||
return;
|
||||
}
|
||||
|
@ -156,10 +164,16 @@ static const NSTimeInterval kTranslocationRemovalDeadline = 60.0;
|
|||
|
||||
- (void)installInputMethodWithWarning:(BOOL)warning
|
||||
{
|
||||
NSTask *cpTask = [NSTask launchedTaskWithLaunchPath:@"/bin/cp" arguments:[NSArray arrayWithObjects:@"-R", [[NSBundle mainBundle] pathForResource:kTargetBin ofType:kTargetType], [kDestinationPartial stringByExpandingTildeInPath], nil]];
|
||||
// If the unzipped archive does not exist, this must be a dev-mode installer.
|
||||
NSString *targetBundle = [_archiveUtil unzipNotarizedArchive];
|
||||
if (!targetBundle) {
|
||||
targetBundle = [[NSBundle mainBundle] pathForResource:kTargetBin ofType:kTargetType];
|
||||
}
|
||||
|
||||
NSTask *cpTask = [NSTask launchedTaskWithLaunchPath:@"/bin/cp" arguments:[NSArray arrayWithObjects:@"-R", targetBundle, [kDestinationPartial stringByExpandingTildeInPath], nil]];
|
||||
[cpTask waitUntilExit];
|
||||
if ([cpTask terminationStatus] != 0) {
|
||||
NSRunAlertPanel(NSLocalizedString(@"Install Failed", nil), NSLocalizedString(@"Cannot copy the file to the destination.", nil), NSLocalizedString(@"Cancel", nil), nil, nil);
|
||||
RunAlertPanel(NSLocalizedString(@"Install Failed", nil), NSLocalizedString(@"Cannot copy the file to the destination.", nil), NSLocalizedString(@"Cancel", nil));
|
||||
[NSApp terminate:self];
|
||||
}
|
||||
|
||||
|
@ -167,14 +181,14 @@ static const NSTimeInterval kTranslocationRemovalDeadline = 60.0;
|
|||
NSTask *installTask = [NSTask launchedTaskWithLaunchPath:[kTargetFullBinPartialPath stringByExpandingTildeInPath] arguments:installArgs];
|
||||
[installTask waitUntilExit];
|
||||
if ([installTask terminationStatus] != 0) {
|
||||
NSRunAlertPanel(NSLocalizedString(@"Install Failed", nil), NSLocalizedString(@"Cannot activate the input method.", nil), NSLocalizedString(@"Cancel", nil), nil, nil);
|
||||
RunAlertPanel(NSLocalizedString(@"Install Failed", nil), NSLocalizedString(@"Cannot activate the input method.", nil), NSLocalizedString(@"Cancel", nil));
|
||||
[NSApp terminate:self];
|
||||
}
|
||||
|
||||
if (warning) {
|
||||
NSRunAlertPanel(NSLocalizedString(@"Attention", nil), NSLocalizedString(@"McBopomofo is upgraded, but please log out or reboot for the new version to be fully functional.", nil), NSLocalizedString(@"OK", nil), nil, nil);
|
||||
RunAlertPanel(NSLocalizedString(@"Attention", nil), NSLocalizedString(@"McBopomofo is upgraded, but please log out or reboot for the new version to be fully functional.", nil), NSLocalizedString(@"OK", nil));
|
||||
} else {
|
||||
NSRunAlertPanel(NSLocalizedString(@"Installation Successful", nil), NSLocalizedString(@"McBopomofo is ready to use.", nil), NSLocalizedString(@"OK", nil), nil, nil);
|
||||
RunAlertPanel(NSLocalizedString(@"Installation Successful", nil), NSLocalizedString(@"McBopomofo is ready to use.", nil), NSLocalizedString(@"OK", nil));
|
||||
}
|
||||
|
||||
[[NSApplication sharedApplication] performSelector:@selector(terminate:) withObject:self afterDelay:0.1];
|
||||
|
@ -202,9 +216,22 @@ static const NSTimeInterval kTranslocationRemovalDeadline = 60.0;
|
|||
entryCount = getfsstat(bufs, entryCount * entrySize, MNT_NOWAIT);
|
||||
for (int i = 0; i < entryCount; i++) {
|
||||
if (!strcmp(bundleAbsPath, bufs[i].f_mntfromname)) {
|
||||
free(bufs);
|
||||
|
||||
// getfsstat() may return us a cached result, and so we need to get the stat of the mounted fs.
|
||||
// If statfs() returns an error, the mounted fs is already gone.
|
||||
struct statfs stat;
|
||||
int checkResult = statfs(bundleAbsPath, &stat);
|
||||
if (checkResult != 0) {
|
||||
// Meaning the app's bundle is not mounted, that is it's not translocated.
|
||||
// It also means that the app is not loaded.
|
||||
return NO;
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
free(bufs);
|
||||
return NO;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,14 +1,4 @@
|
|||
//
|
||||
// AppIconRendererView.h
|
||||
//
|
||||
// Copyright (c) 2011 The McBopomofo Project.
|
||||
//
|
||||
// Contributors:
|
||||
// Mengjuei Hsieh (@mjhsieh)
|
||||
// Weizhong Yang (@zonble)
|
||||
//
|
||||
// Based on the Syrup Project and the Formosana Library
|
||||
// by Lukhnos Liu (@lukhnos).
|
||||
// Copyright (c) 2011-2019 The McBopomofo Project.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
|
@ -30,14 +20,20 @@
|
|||
// 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/Cocoa.h>
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface AppIconRendererView : NSView {
|
||||
// CGImageRef image;
|
||||
NSImage *image;
|
||||
@interface ArchiveUtil : NSObject {
|
||||
NSString *_appName;
|
||||
NSString *_targetAppBundleName;
|
||||
}
|
||||
- (instancetype _Nonnull)initWithAppName:(NSString *_Nonnull)name
|
||||
targetAppBundleName:(NSString *_Nonnull)invalidAppBundleName;
|
||||
|
||||
// Returns YES if (1) a zip file under
|
||||
// Resources/NotarizedArchives/$_appName-$bundleVersion.zip exists, and (2) if
|
||||
// Resources/$_invalidAppBundleName does not exist.
|
||||
- (BOOL)validateIfNotarizedArchiveExists;
|
||||
|
||||
- (NSString *_Nullable)unzipNotarizedArchive;
|
||||
@end
|
|
@ -0,0 +1,132 @@
|
|||
// Copyright (c) 2011-2019 The McBopomofo Project.
|
||||
//
|
||||
// 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:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// 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 "ArchiveUtil.h"
|
||||
|
||||
@implementation ArchiveUtil
|
||||
- (instancetype)initWithAppName:(NSString *)name
|
||||
targetAppBundleName:(NSString *)targetAppBundleName {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_appName = name;
|
||||
_targetAppBundleName = targetAppBundleName;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)delloc {
|
||||
_appName = nil;
|
||||
_targetAppBundleName = nil;
|
||||
}
|
||||
|
||||
- (BOOL)validateIfNotarizedArchiveExists {
|
||||
NSString *resourePath = [[NSBundle mainBundle] resourcePath];
|
||||
NSString *devModeAppBundlePath =
|
||||
[resourePath stringByAppendingPathComponent:_targetAppBundleName];
|
||||
|
||||
NSArray<NSString *> *notarizedArchivesContent =
|
||||
[[NSFileManager defaultManager] subpathsAtPath:[self notarizedArchivesPath]];
|
||||
NSInteger count = [notarizedArchivesContent count];
|
||||
BOOL notarizedArchiveExists =
|
||||
[[NSFileManager defaultManager] fileExistsAtPath:[self notarizedArchive]];
|
||||
BOOL devModeAppBundleExists =
|
||||
[[NSFileManager defaultManager] fileExistsAtPath:devModeAppBundlePath];
|
||||
|
||||
if (count > 0) {
|
||||
// Not a valid distribution package.
|
||||
if (count != 1 || !notarizedArchiveExists || devModeAppBundleExists) {
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
[alert setAlertStyle:NSAlertStyleInformational];
|
||||
[alert setMessageText:@"Internal Error"];
|
||||
[alert
|
||||
setInformativeText:
|
||||
[NSString stringWithFormat:@"devMode installer, expected archive name: %@, "
|
||||
@"archive exists: %d, devMode app bundle exists: %d",
|
||||
[self notarizedArchive], notarizedArchiveExists,
|
||||
devModeAppBundleExists]];
|
||||
[alert addButtonWithTitle:@"Terminate"];
|
||||
[alert runModal];
|
||||
|
||||
[[NSApplication sharedApplication] terminate:nil];
|
||||
} else {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
if (!devModeAppBundleExists) {
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
[alert setAlertStyle:NSAlertStyleInformational];
|
||||
[alert setMessageText:@"Internal Error"];
|
||||
[alert
|
||||
setInformativeText:[NSString stringWithFormat:@"Dev target bundle does not exist: %@",
|
||||
devModeAppBundlePath]];
|
||||
[alert addButtonWithTitle:@"Terminate"];
|
||||
[alert runModal];
|
||||
[[NSApplication sharedApplication] terminate:nil];
|
||||
}
|
||||
|
||||
// Notarized archive does not exist, but it's ok.
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (NSString *)unzipNotarizedArchive {
|
||||
if (![self validateIfNotarizedArchiveExists]) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSString *tempFilePath =
|
||||
[NSTemporaryDirectory() stringByAppendingPathComponent:[[NSUUID UUID] UUIDString]];
|
||||
NSArray *arguments = @[ [self notarizedArchive], @"-d", tempFilePath ];
|
||||
|
||||
NSTask *unzipTask = [[NSTask alloc] init];
|
||||
[unzipTask setLaunchPath:@"/usr/bin/unzip"];
|
||||
[unzipTask setCurrentDirectoryPath:[[NSBundle mainBundle] resourcePath]];
|
||||
[unzipTask setArguments:arguments];
|
||||
[unzipTask launch];
|
||||
[unzipTask waitUntilExit];
|
||||
|
||||
NSAssert(unzipTask.terminationStatus == 0, @"Must successfully unzipped");
|
||||
|
||||
NSString *result = [tempFilePath stringByAppendingPathComponent:_targetAppBundleName];
|
||||
NSAssert([[NSFileManager defaultManager] fileExistsAtPath:result],
|
||||
@"App bundle must be unzipped at %@", result);
|
||||
return result;
|
||||
}
|
||||
|
||||
- (NSString *)notarizedArchivesPath {
|
||||
NSString *resourePath = [[NSBundle mainBundle] resourcePath];
|
||||
NSString *notarizedArchivesPath =
|
||||
[resourePath stringByAppendingPathComponent:@"NotarizedArchives"];
|
||||
return notarizedArchivesPath;
|
||||
}
|
||||
|
||||
- (NSString *)notarizedArchive {
|
||||
NSString *bundleVersion =
|
||||
[[[NSBundle mainBundle] infoDictionary] objectForKey:(id)kCFBundleVersionKey];
|
||||
NSString *notarizedArchiveBasename =
|
||||
[NSString stringWithFormat:@"%@-r%@.zip", _appName, bundleVersion];
|
||||
NSString *notarizedArchive =
|
||||
[[self notarizedArchivesPath] stringByAppendingPathComponent:notarizedArchiveBasename];
|
||||
return notarizedArchive;
|
||||
}
|
||||
@end
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment version="1060" identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="12120"/>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14460.31"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
|
@ -12,7 +12,7 @@
|
|||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<menu title="AMainMenu" systemMenu="main" id="29">
|
||||
<items>
|
||||
<menuItem title="McBopomofo Installer" id="56">
|
||||
|
@ -94,20 +94,20 @@
|
|||
<scrollView horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="536">
|
||||
<rect key="frame" x="20" y="60" width="600" height="251"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<clipView key="contentView" id="vR5-yR-zjT">
|
||||
<clipView key="contentView" drawsBackground="NO" id="vR5-yR-zjT">
|
||||
<rect key="frame" x="1" y="1" width="583" height="249"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textView editable="NO" importsGraphics="NO" usesFontPanel="YES" findStyle="panel" continuousSpellChecking="YES" allowsUndo="YES" usesRuler="YES" allowsNonContiguousLayout="YES" spellingCorrection="YES" smartInsertDelete="YES" id="537">
|
||||
<textView editable="NO" importsGraphics="NO" verticallyResizable="YES" usesFontPanel="YES" findStyle="panel" continuousSpellChecking="YES" allowsUndo="YES" usesRuler="YES" allowsNonContiguousLayout="YES" spellingCorrection="YES" smartInsertDelete="YES" id="537">
|
||||
<rect key="frame" x="0.0" y="0.0" width="583" height="249"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<size key="minSize" width="583" height="249"/>
|
||||
<size key="maxSize" width="598" height="10000000"/>
|
||||
<size key="maxSize" width="600" height="10000000"/>
|
||||
<color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
</textView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="538">
|
||||
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
|
||||
|
@ -143,7 +143,7 @@ Gw
|
|||
<action selector="cancelAction:" target="494" id="707"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="NO" id="623">
|
||||
<textField verticalHuggingPriority="750" id="623">
|
||||
<rect key="frame" x="17" y="323" width="559" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Welcome to the McBopomofo Installer! Please read the following Software Licence:" id="624">
|
||||
|
@ -152,7 +152,7 @@ Gw
|
|||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="NO" id="688">
|
||||
<textField verticalHuggingPriority="750" id="688">
|
||||
<rect key="frame" x="17" y="19" width="337" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="By installing the software I agree to the terms above." id="689">
|
||||
|
@ -178,7 +178,7 @@ Gw
|
|||
</connections>
|
||||
</customObject>
|
||||
<customObject id="420" customClass="NSFontManager"/>
|
||||
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="gHl-Hx-eQn">
|
||||
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="gHl-Hx-eQn">
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="283" y="305" width="480" height="180"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
|
||||
|
@ -190,7 +190,7 @@ Gw
|
|||
<rect key="frame" x="20" y="67" width="440" height="20"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
|
||||
</progressIndicator>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="NO" id="VDL-Yq-heb">
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="VDL-Yq-heb">
|
||||
<rect key="frame" x="18" y="94" width="444" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Stopping the old version. This may take up to one minute…" id="nTo-dx-qfZ">
|
|
@ -6,10 +6,8 @@
|
|||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>McBopomofo.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.openvanilla.McBopomofo.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
|
@ -17,11 +15,13 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.9.9.2</string>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>MBIN</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>794</string>
|
||||
<string>846</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>LSHasLocalizedDisplayName</key>
|
||||
<true/>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Place the notarized archive here for producing the release installer.
|
|
@ -1,4 +1,4 @@
|
|||
/* Localized versions of Info.plist keys */
|
||||
|
||||
CFBundleName = "Install McBopomofo";
|
||||
NSHumanReadableCopyright = "Copyright © 2011-2017 Mengjuei Hsieh et al.\nAll Rights Reserved.";
|
||||
NSHumanReadableCopyright = "Copyright © 2011-2020 Mengjuei Hsieh et al.\nAll Rights Reserved.";
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
\f0\b\fs36 \cf0 McBopomofo License Agreement
|
||||
\f1\b0\fs24 \
|
||||
\
|
||||
Copyright \'a9 2011-2017 Mengjuei Hsieh et al.\
|
||||
Copyright \'a9 2011-2020 Mengjuei Hsieh et al.\
|
||||
\
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \'93Software\'94), 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,5 +1,5 @@
|
|||
/* Localized versions of Info.plist keys */
|
||||
|
||||
CFBundleName = "安裝小麥注音";
|
||||
NSHumanReadableCopyright = "Copyright © 2011-2017 Mengjuei Hsieh et al.\nAll Rights Reserved.";
|
||||
NSHumanReadableCopyright = "Copyright © 2011-2020 Mengjuei Hsieh et al.\nAll Rights Reserved.";
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
\f0\b\fs36 \cf0 McBopomofo License Agreement
|
||||
\f1\b0\fs24 \
|
||||
\
|
||||
Copyright \'a9 2011-2017 Mengjuei Hsieh et al.\
|
||||
Copyright \'a9 2011-2020 Mengjuei Hsieh et al.\
|
||||
|
||||
\f2 \'b5\'db\'a7\'40\'c5\'76\'a7\'51\'a9\'d2\'a6\'b3
|
||||
\f1 \'a9 2011-2017 Mengjuei Hsieh
|
||||
\f1 \'a9 2011-2020 Mengjuei Hsieh
|
||||
\f2 \'b5\'a5\'a4\'48
|
||||
\f1 \
|
||||
\
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment version="1060" identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="12120"/>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14460.31"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
|
@ -12,7 +12,7 @@
|
|||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<menu title="AMainMenu" systemMenu="main" id="29">
|
||||
<items>
|
||||
<menuItem title="安裝小麥注音" id="56">
|
||||
|
@ -94,20 +94,20 @@
|
|||
<scrollView horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="536">
|
||||
<rect key="frame" x="20" y="60" width="600" height="251"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<clipView key="contentView" id="c84-Fy-j39">
|
||||
<clipView key="contentView" drawsBackground="NO" id="c84-Fy-j39">
|
||||
<rect key="frame" x="1" y="1" width="583" height="249"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textView editable="NO" importsGraphics="NO" usesFontPanel="YES" findStyle="panel" continuousSpellChecking="YES" allowsUndo="YES" usesRuler="YES" allowsNonContiguousLayout="YES" spellingCorrection="YES" smartInsertDelete="YES" id="537">
|
||||
<textView editable="NO" importsGraphics="NO" verticallyResizable="YES" usesFontPanel="YES" findStyle="panel" continuousSpellChecking="YES" allowsUndo="YES" usesRuler="YES" allowsNonContiguousLayout="YES" spellingCorrection="YES" smartInsertDelete="YES" id="537">
|
||||
<rect key="frame" x="0.0" y="0.0" width="583" height="249"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<size key="minSize" width="583" height="249"/>
|
||||
<size key="maxSize" width="598" height="10000000"/>
|
||||
<size key="maxSize" width="600" height="10000000"/>
|
||||
<color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
</textView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="538">
|
||||
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
|
||||
|
@ -143,7 +143,7 @@ Gw
|
|||
<action selector="cancelAction:" target="494" id="707"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="NO" id="623">
|
||||
<textField verticalHuggingPriority="750" id="623">
|
||||
<rect key="frame" x="17" y="323" width="559" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="歡迎您安裝「小麥注音輸入法」!在安裝之前,請您閱讀本軟體的使用授權:" id="624">
|
||||
|
@ -152,7 +152,7 @@ Gw
|
|||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="NO" id="688">
|
||||
<textField verticalHuggingPriority="750" id="688">
|
||||
<rect key="frame" x="17" y="19" width="337" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="點選「同意安裝」,表示您同意本軟體的使用授權。" id="689">
|
||||
|
@ -178,7 +178,7 @@ Gw
|
|||
</connections>
|
||||
</customObject>
|
||||
<customObject id="420" customClass="NSFontManager"/>
|
||||
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="Pxv-O2-I1W">
|
||||
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="Pxv-O2-I1W">
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="283" y="305" width="480" height="180"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
|
||||
|
@ -190,7 +190,7 @@ Gw
|
|||
<rect key="frame" x="20" y="67" width="440" height="20"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
|
||||
</progressIndicator>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="NO" id="6mo-HZ-Dbl">
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="6mo-HZ-Dbl">
|
||||
<rect key="frame" x="18" y="94" width="444" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="等待舊版完全停用,大約需要一分鐘…" id="T73-Ph-Unt">
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
//
|
||||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||
//
|
||||
|
|
@ -1,108 +1,146 @@
|
|||
<?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>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>McBopomofo.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.openvanilla.inputmethod.McBopomofo</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.9.9.2</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>BPMF</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>794</string>
|
||||
<key>ComponentInputModeDict</key>
|
||||
<dict>
|
||||
<key>tsInputModeListKey</key>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>BPMF</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>846</string>
|
||||
<key>ComponentInputModeDict</key>
|
||||
<dict>
|
||||
<key>org.openvanilla.inputmethod.McBopomofo.Bopomofo</key>
|
||||
<key>tsInputModeListKey</key>
|
||||
<dict>
|
||||
<key>tsInputModeAlternateMenuIconFileKey</key>
|
||||
<string>Bopomofo.tiff</string>
|
||||
<key>tsInputModeDefaultStateKey</key>
|
||||
<true/>
|
||||
<key>tsInputModeIsVisibleKey</key>
|
||||
<true/>
|
||||
<key>tsInputModeMenuIconFileKey</key>
|
||||
<string>Bopomofo.tiff</string>
|
||||
<key>tsInputModePaletteIconFileKey</key>
|
||||
<string>Bopomofo.tiff</string>
|
||||
<key>tsInputModePrimaryInScriptKey</key>
|
||||
<true/>
|
||||
<key>tsInputModeScriptKey</key>
|
||||
<string>smUnicodeScript</string>
|
||||
</dict>
|
||||
<key>org.openvanilla.inputmethod.McBopomofo.PlainBopomofo</key>
|
||||
<dict>
|
||||
<key>tsInputModeAlternateMenuIconFileKey</key>
|
||||
<string>PlainBopomofo.tiff</string>
|
||||
<key>tsInputModeDefaultStateKey</key>
|
||||
<true/>
|
||||
<key>tsInputModeIsVisibleKey</key>
|
||||
<true/>
|
||||
<key>tsInputModeMenuIconFileKey</key>
|
||||
<string>PlainBopomofo.tiff</string>
|
||||
<key>tsInputModePaletteIconFileKey</key>
|
||||
<string>PlainBopomofo.tiff</string>
|
||||
<key>tsInputModePrimaryInScriptKey</key>
|
||||
<true/>
|
||||
<key>tsInputModeScriptKey</key>
|
||||
<string>smUnicodeScript</string>
|
||||
<key>org.openvanilla.inputmethod.McBopomofo.Bopomofo</key>
|
||||
<dict>
|
||||
<key>TISDoubleSpaceSubstitution</key>
|
||||
<string>。</string>
|
||||
<key>tsInputModeAlternateMenuIconFileKey</key>
|
||||
<string>Bopomofo.tiff</string>
|
||||
<key>tsInputModeCharacterRepertoireKey</key>
|
||||
<array>
|
||||
<string>Hant</string>
|
||||
<string>Han</string>
|
||||
</array>
|
||||
<key>tsInputModeDefaultStateKey</key>
|
||||
<true />
|
||||
<key>tsInputModeIsVisibleKey</key>
|
||||
<true />
|
||||
<key>tsInputModeKeyEquivalentModifiersKey</key>
|
||||
<integer>4608</integer>
|
||||
<key>tsInputModeMenuIconFileKey</key>
|
||||
<string>Bopomofo.tiff</string>
|
||||
<key>tsInputModePaletteIconFileKey</key>
|
||||
<string>Bopomofo.tiff</string>
|
||||
<key>tsInputModePrimaryInScriptKey</key>
|
||||
<true />
|
||||
<key>tsInputModeScriptKey</key>
|
||||
<string>smTradChinese</string>
|
||||
<key>TISIntendedLanguage</key>
|
||||
<string>zh-Hant</string>
|
||||
<key>tsInputModeCharacterRepertoireKey</key>
|
||||
<array>
|
||||
<string>Hant</string>
|
||||
<string>Han</string>
|
||||
</array>
|
||||
<key>tsInputModeKeyEquivalentModifiersKey</key>
|
||||
<integer>4608</integer>
|
||||
</dict>
|
||||
<key>org.openvanilla.inputmethod.McBopomofo.PlainBopomofo</key>
|
||||
<dict>
|
||||
<key>TISDoubleSpaceSubstitution</key>
|
||||
<string>。</string>
|
||||
<key>tsInputModeAlternateMenuIconFileKey</key>
|
||||
<string>PlainBopomofo.tiff</string>
|
||||
<key>tsInputModeCharacterRepertoireKey</key>
|
||||
<array>
|
||||
<string>Hant</string>
|
||||
<string>Han</string>
|
||||
</array>
|
||||
<key>tsInputModeDefaultStateKey</key>
|
||||
<true />
|
||||
<key>tsInputModeIsVisibleKey</key>
|
||||
<true />
|
||||
<key>tsInputModeKeyEquivalentModifiersKey</key>
|
||||
<integer>4608</integer>
|
||||
<key>tsInputModeMenuIconFileKey</key>
|
||||
<string>PlainBopomofo.tiff</string>
|
||||
<key>tsInputModePaletteIconFileKey</key>
|
||||
<string>PlainBopomofo.tiff</string>
|
||||
<key>tsInputModePrimaryInScriptKey</key>
|
||||
<true />
|
||||
<key>tsInputModeScriptKey</key>
|
||||
<string>smTradChinese</string>
|
||||
<key>TISIntendedLanguage</key>
|
||||
<string>zh-Hant</string>
|
||||
<key>tsInputModeCharacterRepertoireKey</key>
|
||||
<array>
|
||||
<string>Hant</string>
|
||||
<string>Han</string>
|
||||
</array>
|
||||
<key>tsInputModeKeyEquivalentModifiersKey</key>
|
||||
<integer>4608</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>tsVisibleInputModeOrderedArrayKey</key>
|
||||
<array>
|
||||
<string>org.openvanilla.inputmethod.McBopomofo.Bopomofo</string>
|
||||
<string>org.openvanilla.inputmethod.McBopomofo.PlainBopomofo</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>tsVisibleInputModeOrderedArrayKey</key>
|
||||
<key>InputMethodConnectionName</key>
|
||||
<string>McBopomofo_1_Connection</string>
|
||||
<key>InputMethodServerControllerClass</key>
|
||||
<string>McBopomofoInputMethodController</string>
|
||||
<key>InputMethodServerDelegateClass</key>
|
||||
<string>McBopomofoInputMethodController</string>
|
||||
<key>InputMethodServerPreferencesWindowControllerClass</key>
|
||||
<string>PreferencesWindowController</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>LSHasLocalizedDisplayName</key>
|
||||
<true />
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>LSUIElement</key>
|
||||
<true />
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2011-2020 Mengjuei Hsieh et al.</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>TICapsLockLanguageSwitchCapable</key>
|
||||
<true />
|
||||
<key>TISInputSourceID</key>
|
||||
<string>org.openvanilla.inputmethod.McBopomofo</string>
|
||||
<key>TISIntendedLanguage</key>
|
||||
<string>zh-Hant</string>
|
||||
<key>TISParticipatesInTouchBar</key>
|
||||
<false />
|
||||
<key>UpdateInfoEndpoint</key>
|
||||
<string>https://mcbopomofo.openvanilla.org/updates/Info.plist</string>
|
||||
<key>UpdateInfoSite</key>
|
||||
<string>https://mcbopomofo.openvanilla.org/</string>
|
||||
<key>tsInputMethodCharacterRepertoireKey</key>
|
||||
<array>
|
||||
<string>org.openvanilla.inputmethod.McBopomofo.Bopomofo</string>
|
||||
<string>org.openvanilla.inputmethod.McBopomofo.PlainBopomofo</string>
|
||||
<string>Hant</string>
|
||||
<string>Hans</string>
|
||||
</array>
|
||||
<key>tsInputMethodIconFileKey</key>
|
||||
<string>Bopomofo.tiff</string>
|
||||
</dict>
|
||||
<key>InputMethodConnectionName</key>
|
||||
<string>McBopomofo_1_Connection</string>
|
||||
<key>InputMethodServerControllerClass</key>
|
||||
<string>McBopomofoInputMethodController</string>
|
||||
<key>InputMethodServerDelegateClass</key>
|
||||
<string>McBopomofoInputMethodController</string>
|
||||
<key>InputMethodServerPreferencesWindowControllerClass</key>
|
||||
<string>PreferencesWindowController</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>LSHasLocalizedDisplayName</key>
|
||||
<true/>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.5</string>
|
||||
<key>LSUIElement</key>
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2011-2017 Mengjuei Hsieh et al.</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>TISInputSourceID</key>
|
||||
<string>org.openvanilla.inputmethod.McBopomofo</string>
|
||||
<key>TISIntendedLanguage</key>
|
||||
<string>zh-Hant</string>
|
||||
<key>UpdateInfoEndpoint</key>
|
||||
<string>https://mcbopomofo.openvanilla.org/updates/Info.plist</string>
|
||||
<key>UpdateInfoSite</key>
|
||||
<string>https://mcbopomofo.openvanilla.org/</string>
|
||||
<key>tsInputMethodCharacterRepertoireKey</key>
|
||||
<array>
|
||||
<string>Hant</string>
|
||||
<string>Hans</string>
|
||||
</array>
|
||||
<key>tsInputMethodIconFileKey</key>
|
||||
<string>BopomofoTextMenu.tiff</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -31,7 +31,7 @@
|
|||
+ (NSArray *)allInstalledInputSources
|
||||
{
|
||||
CFArrayRef list = TISCreateInputSourceList(NULL, true);
|
||||
return [NSMakeCollectable(list) autorelease];
|
||||
return (__bridge NSArray *)list;
|
||||
}
|
||||
|
||||
+ (TISInputSourceRef)inputSourceForProperty:(CFStringRef)inPropertyKey stringValue:(NSString *)inValue
|
||||
|
@ -39,16 +39,15 @@
|
|||
CFTypeID stringID = CFStringGetTypeID();
|
||||
|
||||
for (id source in [self allInstalledInputSources]) {
|
||||
CFTypeRef property = TISGetInputSourceProperty((TISInputSourceRef)source, inPropertyKey);
|
||||
CFTypeRef property = TISGetInputSourceProperty((__bridge TISInputSourceRef)source, inPropertyKey);
|
||||
if (!property || CFGetTypeID(property) != stringID) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (inValue && [inValue compare:(NSString *)property] == NSOrderedSame) {
|
||||
return (TISInputSourceRef)source;
|
||||
if (inValue && [inValue compare:(__bridge NSString *)property] == NSOrderedSame) {
|
||||
return (__bridge TISInputSourceRef)source;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -74,9 +73,9 @@
|
|||
BOOL enabled = NO;
|
||||
|
||||
for (id source in [self allInstalledInputSources]) {
|
||||
TISInputSourceRef inputSource = (TISInputSourceRef)source;
|
||||
NSString *bundleID = (NSString *)TISGetInputSourceProperty(inputSource, kTISPropertyBundleID);
|
||||
NSString *mode = (NSString *)TISGetInputSourceProperty(inputSource, kTISPropertyInputModeID);
|
||||
TISInputSourceRef inputSource = (__bridge TISInputSourceRef)source;
|
||||
NSString *bundleID = (__bridge NSString *)TISGetInputSourceProperty(inputSource, kTISPropertyBundleID);
|
||||
NSString *mode = (NSString *)CFBridgingRelease(TISGetInputSourceProperty(inputSource, kTISPropertyInputModeID));
|
||||
if (mode && [bundleID isEqualToString:inID]) {
|
||||
BOOL modeEnabled = [self enableInputSource:inputSource];
|
||||
if (!modeEnabled) {
|
||||
|
@ -98,7 +97,7 @@
|
|||
|
||||
+ (BOOL)registerInputSource:(NSURL *)inBundleURL
|
||||
{
|
||||
OSStatus status = TISRegisterInputSource((CFURLRef)inBundleURL);
|
||||
OSStatus status = TISRegisterInputSource((__bridge CFURLRef)inBundleURL);
|
||||
return status == noErr;
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
//
|
||||
// OVNonModalAlertWindowController.h
|
||||
// OpenVanilla
|
||||
//
|
||||
// Created by Lukhnos Liu on 10/17/12.
|
||||
// Copyright (c) 2012 The OpenVanilla Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class OVNonModalAlertWindowController;
|
||||
|
||||
@protocol OVNonModalAlertWindowControllerDelegate <NSObject>
|
||||
- (void)nonModalAlertWindowControllerDidConfirm:(OVNonModalAlertWindowController *)controller;
|
||||
|
||||
@optional
|
||||
- (void)nonModalAlertWindowControllerDidCancel:(OVNonModalAlertWindowController *)controller;
|
||||
@end
|
||||
|
||||
@interface OVNonModalAlertWindowController : NSWindowController
|
||||
|
||||
+ (OVNonModalAlertWindowController *)sharedInstance;
|
||||
- (void)showWithTitle:(NSString *)title content:(NSString *)content confirmButtonTitle:(NSString *)confirmTitle cancelButtonTitle:(NSString *)cancelButtonTitle cancelAsDefault:(BOOL)cancelAsDefault delegate:(id<OVNonModalAlertWindowControllerDelegate>)delegate;
|
||||
- (IBAction)confirmButtonAction:(id)sender;
|
||||
- (IBAction)cancelButtonAction:(id)sender;
|
||||
@property (assign, nonatomic) IBOutlet NSTextField *titleTextField;
|
||||
@property (assign, nonatomic) IBOutlet NSTextField *contentTextField;
|
||||
@property (assign, nonatomic) IBOutlet NSButton *confirmButton;
|
||||
@property (assign, nonatomic) IBOutlet NSButton *cancelButton;
|
||||
@property (assign, nonatomic) id<OVNonModalAlertWindowControllerDelegate> delegate;
|
||||
@end
|
|
@ -0,0 +1,131 @@
|
|||
//
|
||||
// OVNonModalAlertWindowController.m
|
||||
// OpenVanilla
|
||||
//
|
||||
// Created by Lukhnos Liu on 10/17/12.
|
||||
// Copyright (c) 2012 The OpenVanilla Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import "OVNonModalAlertWindowController.h"
|
||||
|
||||
@implementation OVNonModalAlertWindowController
|
||||
@synthesize titleTextField = _titleTextField;
|
||||
@synthesize contentTextField = _contentTextField;
|
||||
@synthesize confirmButton = _confirmButton;
|
||||
@synthesize cancelButton = _cancelButton;
|
||||
@synthesize delegate = _delegate;
|
||||
|
||||
+ (OVNonModalAlertWindowController *)sharedInstance
|
||||
{
|
||||
static OVNonModalAlertWindowController *instance;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
instance = [[OVNonModalAlertWindowController alloc] initWithWindowNibName:@"OVNonModalAlertWindowController"];
|
||||
[instance window];
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
|
||||
// Suppress the use of the MIN/MAX macros
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wgnu-statement-expression"
|
||||
|
||||
- (void)showWithTitle:(NSString *)title content:(NSString *)content confirmButtonTitle:(NSString *)confirmTitle cancelButtonTitle:(NSString *)cancelButtonTitle cancelAsDefault:(BOOL)cancelAsDefault delegate:(id <OVNonModalAlertWindowControllerDelegate>)delegate;
|
||||
{
|
||||
// cancel previous alert
|
||||
if (self.window.visible) {
|
||||
if ([_delegate respondsToSelector:@selector(nonModalAlertWindowControllerDidCancel:)]) {
|
||||
[_delegate nonModalAlertWindowControllerDidCancel:self];
|
||||
}
|
||||
}
|
||||
|
||||
_delegate = delegate;
|
||||
|
||||
NSRect oldFrame = self.confirmButton.frame;
|
||||
[self.confirmButton setTitle:confirmTitle];
|
||||
[self.confirmButton sizeToFit];
|
||||
|
||||
NSRect newFrame = self.confirmButton.frame;
|
||||
|
||||
newFrame.size.width = MAX(90.0, (newFrame.size.width + 10.0));
|
||||
newFrame.origin.x += (oldFrame.size.width - newFrame.size.width);
|
||||
[self.confirmButton setFrame:newFrame];
|
||||
|
||||
if (cancelButtonTitle) {
|
||||
[self.cancelButton setTitle:cancelButtonTitle];
|
||||
[self.cancelButton sizeToFit];
|
||||
NSRect adjustedFrame = self.cancelButton.frame;
|
||||
adjustedFrame.size.width = MAX(90.0, (adjustedFrame.size.width + 10.0));
|
||||
adjustedFrame.origin.x = newFrame.origin.x - adjustedFrame.size.width;
|
||||
self.cancelButton.frame = adjustedFrame;
|
||||
self.cancelButton.hidden = NO;
|
||||
}
|
||||
else {
|
||||
self.cancelButton.hidden = YES;
|
||||
}
|
||||
|
||||
self.cancelButton.nextKeyView = self.confirmButton;
|
||||
self.confirmButton.nextKeyView = self.cancelButton;
|
||||
|
||||
if (cancelButtonTitle) {
|
||||
if (cancelAsDefault) {
|
||||
[self.window setDefaultButtonCell:self.cancelButton.cell];
|
||||
}
|
||||
else {
|
||||
self.cancelButton.keyEquivalent = @" ";
|
||||
[self.window setDefaultButtonCell:self.confirmButton.cell];
|
||||
}
|
||||
}
|
||||
else {
|
||||
[[self window] setDefaultButtonCell:self.confirmButton.cell];
|
||||
}
|
||||
|
||||
self.titleTextField.stringValue = title;
|
||||
|
||||
oldFrame = [self.contentTextField frame];
|
||||
self.contentTextField.stringValue = content;
|
||||
|
||||
NSRect infiniteHeightFrame = oldFrame;
|
||||
infiniteHeightFrame.size.width -= 4.0;
|
||||
infiniteHeightFrame.size.height = 10240;
|
||||
newFrame = [content boundingRectWithSize:infiniteHeightFrame.size options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName: self.contentTextField.font}];
|
||||
newFrame.size.width = MAX(newFrame.size.width, oldFrame.size.width);
|
||||
newFrame.size.height += 4.0;
|
||||
newFrame.origin = oldFrame.origin;
|
||||
newFrame.origin.y -= (newFrame.size.height - oldFrame.size.height);
|
||||
[self.contentTextField setFrame:newFrame];
|
||||
|
||||
NSRect windowFrame = [[self window] frame];
|
||||
windowFrame.size.height += (newFrame.size.height - oldFrame.size.height);
|
||||
|
||||
self.window.level = CGShieldingWindowLevel() + 1;
|
||||
[self.window setFrame:windowFrame display:YES];
|
||||
[self.window center];
|
||||
[self.window makeKeyAndOrderFront:self];
|
||||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
- (IBAction)confirmButtonAction:(id)sender
|
||||
{
|
||||
[_delegate nonModalAlertWindowControllerDidConfirm:self];
|
||||
[self.window orderOut:self];
|
||||
}
|
||||
|
||||
- (IBAction)cancelButtonAction:(id)sender
|
||||
{
|
||||
[self cancel:sender];
|
||||
}
|
||||
|
||||
- (void)cancel:(id)sender
|
||||
{
|
||||
if ([_delegate respondsToSelector:@selector(nonModalAlertWindowControllerDidCancel:)]) {
|
||||
[_delegate nonModalAlertWindowControllerDidCancel:self];
|
||||
}
|
||||
|
||||
_delegate = nil;
|
||||
[self.window orderOut:self];
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,85 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17156" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17156"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="OVNonModalAlertWindowController">
|
||||
<connections>
|
||||
<outlet property="cancelButton" destination="71" id="83"/>
|
||||
<outlet property="confirmButton" destination="5" id="82"/>
|
||||
<outlet property="contentTextField" destination="59" id="79"/>
|
||||
<outlet property="titleTextField" destination="39" id="78"/>
|
||||
<outlet property="window" destination="1" id="3"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" visibleAtLaunch="NO" animationBehavior="default" id="1">
|
||||
<windowStyleMask key="styleMask" titled="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="196" y="240" width="420" height="130"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
|
||||
<view key="contentView" id="2">
|
||||
<rect key="frame" x="0.0" y="0.0" width="420" height="130"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5">
|
||||
<rect key="frame" x="314" y="13" width="92" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Button" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="6">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="confirmButtonAction:" target="-2" id="85"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="71">
|
||||
<rect key="frame" x="222" y="13" width="92" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Button" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="73">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="cancelButtonAction:" target="-2" id="86"/>
|
||||
</connections>
|
||||
</button>
|
||||
<imageView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="12">
|
||||
<rect key="frame" x="24" y="50" width="64" height="64"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="AlertIcon" id="13"/>
|
||||
</imageView>
|
||||
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="39">
|
||||
<rect key="frame" x="103" y="97" width="300" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Lorem ipsum" id="40">
|
||||
<font key="font" metaFont="systemBold"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" preferredMaxLayoutWidth="296" translatesAutoresizingMaskIntoConstraints="NO" id="59">
|
||||
<rect key="frame" x="103" y="72" width="300" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Lorem ipsum" id="60">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="-2" id="4"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="140" y="146"/>
|
||||
</window>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="AlertIcon" width="64" height="64"/>
|
||||
</resources>
|
||||
</document>
|
|
@ -0,0 +1,22 @@
|
|||
import Foundation
|
||||
import OpenCC
|
||||
|
||||
// Since SwiftyOpenCC only provide Swift classes, we create an NSObject subclass
|
||||
// in Swift in order to bridge the Swift classes into our Objective-C++ project.
|
||||
class OpenCCBridge : NSObject {
|
||||
private static let shared = OpenCCBridge()
|
||||
private var conveter: ChineseConverter?
|
||||
|
||||
override init() {
|
||||
try? conveter = ChineseConverter(options: .simplify)
|
||||
super.init()
|
||||
}
|
||||
|
||||
@objc static func convert(_ string:String) -> String? {
|
||||
return shared.conveter?.convert(string)
|
||||
}
|
||||
|
||||
private func convert(_ string:String) -> String? {
|
||||
return conveter?.convert(string)
|
||||
}
|
||||
}
|
|
@ -36,10 +36,15 @@
|
|||
@interface PreferencesWindowController : NSWindowController
|
||||
{
|
||||
@private
|
||||
NSPopUpButton *_fontSizePopUpButton;
|
||||
NSPopUpButton *_basisKeyboardLayoutButton;
|
||||
NSPopUpButton *__weak _fontSizePopUpButton;
|
||||
NSPopUpButton *__weak _basisKeyboardLayoutButton;
|
||||
NSComboBox *__weak _selectionKeyComboBox;
|
||||
}
|
||||
|
||||
- (IBAction)updateBasisKeyboardLayoutAction:(id)sender;
|
||||
@property (assign, nonatomic) IBOutlet NSPopUpButton *fontSizePopUpButton;
|
||||
@property (assign, nonatomic) IBOutlet NSPopUpButton *basisKeyboardLayoutButton;
|
||||
- (IBAction)changeSelectionKeyAction:(id)sender;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet NSPopUpButton *fontSizePopUpButton;
|
||||
@property (weak, nonatomic) IBOutlet NSPopUpButton *basisKeyboardLayoutButton;
|
||||
@property (weak, nonatomic) IBOutlet NSComboBox *selectionKeyComboBox;
|
||||
@end
|
||||
|
|
|
@ -35,10 +35,13 @@
|
|||
#import <Carbon/Carbon.h>
|
||||
|
||||
static NSString *const kBasisKeyboardLayoutPreferenceKey = @"BasisKeyboardLayout"; // alphanumeric ("ASCII") input basis
|
||||
static NSString *const kCandidateKeys = @"CandidateKeys";
|
||||
static NSString *const kDefaultKeys = @"123456789";
|
||||
|
||||
@implementation PreferencesWindowController
|
||||
@synthesize fontSizePopUpButton = _fontSizePopUpButton;
|
||||
@synthesize basisKeyboardLayoutButton = _basisKeyboardLayoutButton;
|
||||
@synthesize selectionKeyComboBox = _selectionKeyComboBox;
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
|
@ -46,7 +49,7 @@ static NSString *const kBasisKeyboardLayoutPreferenceKey = @"BasisKeyboardLayout
|
|||
NSMenuItem *usKeyboardLayoutItem = nil;
|
||||
NSMenuItem *chosenItem = nil;
|
||||
|
||||
[[self.basisKeyboardLayoutButton menu] removeAllItems];
|
||||
[self.basisKeyboardLayoutButton.menu removeAllItems];
|
||||
|
||||
NSString *basisKeyboardLayoutID = [[NSUserDefaults standardUserDefaults] stringForKey:kBasisKeyboardLayoutPreferenceKey];
|
||||
|
||||
|
@ -68,12 +71,12 @@ static NSString *const kBasisKeyboardLayoutPreferenceKey = @"BasisKeyboardLayout
|
|||
continue;
|
||||
}
|
||||
|
||||
NSString *sourceID = (NSString *)TISGetInputSourceProperty(source, kTISPropertyInputSourceID);
|
||||
NSString *localizedName = (NSString *)TISGetInputSourceProperty(source, kTISPropertyLocalizedName);
|
||||
NSString *sourceID = (__bridge NSString *)TISGetInputSourceProperty(source, kTISPropertyInputSourceID);
|
||||
NSString *localizedName = (__bridge NSString *)TISGetInputSourceProperty(source, kTISPropertyLocalizedName);
|
||||
|
||||
NSMenuItem *item = [[[NSMenuItem alloc] init] autorelease];
|
||||
[item setTitle:localizedName];
|
||||
[item setRepresentedObject:sourceID];
|
||||
NSMenuItem *item = [[NSMenuItem alloc] init];
|
||||
item.title = localizedName;
|
||||
item.representedObject = sourceID;
|
||||
|
||||
if ([sourceID isEqualToString:@"com.apple.keylayout.US"]) {
|
||||
usKeyboardLayoutItem = item;
|
||||
|
@ -84,11 +87,26 @@ static NSString *const kBasisKeyboardLayoutPreferenceKey = @"BasisKeyboardLayout
|
|||
chosenItem = item;
|
||||
}
|
||||
|
||||
[[self.basisKeyboardLayoutButton menu] addItem:item];
|
||||
[self.basisKeyboardLayoutButton.menu addItem:item];
|
||||
}
|
||||
|
||||
[self.basisKeyboardLayoutButton selectItem:(chosenItem ? chosenItem : usKeyboardLayoutItem)];
|
||||
CFRelease(list);
|
||||
|
||||
self.selectionKeyComboBox.usesDataSource = NO;
|
||||
[self.selectionKeyComboBox removeAllItems];
|
||||
[self.selectionKeyComboBox addItemsWithObjectValues:@[
|
||||
kDefaultKeys,
|
||||
@"asdfghjkl",
|
||||
@"asdfzxcvb"
|
||||
]];
|
||||
|
||||
NSString *ckeys = [[NSUserDefaults standardUserDefaults] stringForKey:kCandidateKeys];
|
||||
if (!ckeys || [ckeys stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]].length == 0) {
|
||||
ckeys = kDefaultKeys;
|
||||
}
|
||||
|
||||
[self.selectionKeyComboBox setStringValue:ckeys];
|
||||
}
|
||||
|
||||
- (IBAction)updateBasisKeyboardLayoutAction:(id)sender
|
||||
|
@ -98,4 +116,24 @@ static NSString *const kBasisKeyboardLayoutPreferenceKey = @"BasisKeyboardLayout
|
|||
[[NSUserDefaults standardUserDefaults] setObject:sourceID forKey:kBasisKeyboardLayoutPreferenceKey];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)changeSelectionKeyAction:(id)sender
|
||||
{
|
||||
NSString *keys = [[sender stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
if (keys.length != 9 ||
|
||||
![keys canBeConvertedToEncoding:NSASCIIStringEncoding]) {
|
||||
[self.selectionKeyComboBox setStringValue:kDefaultKeys];
|
||||
[[NSUserDefaults standardUserDefaults] removeObjectForKey:kCandidateKeys];
|
||||
NSBeep();
|
||||
return;
|
||||
}
|
||||
|
||||
[self.selectionKeyComboBox setStringValue:keys];
|
||||
if ([keys isEqualToString:kDefaultKeys]) {
|
||||
[[NSUserDefaults standardUserDefaults] removeObjectForKey:kCandidateKeys];
|
||||
} else {
|
||||
[[NSUserDefaults standardUserDefaults] setObject:keys forKey:kCandidateKeys];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CFBundleName = "McBopomofo";
|
||||
CFBundleDisplayName = "McBopomofo";
|
||||
NSHumanReadableCopyright = "Copyright © 2011-2017 Mengjuei Hsieh et al.\nAll Rights Reserved.";
|
||||
NSHumanReadableCopyright = "Copyright © 2011-2020 Mengjuei Hsieh et al.\nAll Rights Reserved.";
|
||||
"org.openvanilla.inputmethod.McBopomofo.Bopomofo" = "Bopomofo";
|
||||
"org.openvanilla.inputmethod.McBopomofo.PlainBopomofo" = "Plain Bopomofo";
|
||||
|
||||
|
|
|
@ -16,14 +16,37 @@
|
|||
/* No comment provided by engineer. */
|
||||
"Check Later" = "Check Later";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Check for Updates…" = "Check for Updates…";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Check for Update Completed" = "Check for Update Completed";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"You are already using the latest version of McBopomofo." = "You are already using the latest version of McBopomofo.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Update Check Failed" = "Update Check Failed";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"There may be no internet connection or the server failed to respond.\n\nError message: %@" = "There may be no internet connection or the server failed to respond.\n\nError message: %@";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"OK" = "OK";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Dismiss" = "Dismiss";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"New Version Available" = "New Version Available";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Not Now" = "Not Now";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Visit Website" = "Visit Website";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"You are running version %@ (%@), and the new version %@ (%@) is now available.\n\nVisit the website to download it?" = "You are running version %1$@ (%2$@), and the new version %3$@ (%4$@) is now available.\n\nVisit the website to download it?";
|
||||
"You're currently using McBopomofo %@ (%@), a new version %@ (%@) is now available. Do you want to visit McBopomofo's website to download the version?%@" = "You're currently using McBopomofo %@ (%@), a new version %@ (%@) is now available. Do you want to visit McBopomofo's website to download the version?%@";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Check for Updates…" = "Check for Updates…";
|
||||
"Chinese Conversion" = "Chinese Conversion";
|
||||
|
|
|
@ -1,452 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1070</int>
|
||||
<string key="IBDocument.SystemVersion">11A2063</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1910</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.1</string>
|
||||
<string key="IBDocument.HIToolboxVersion">566.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">1910</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSTextField</string>
|
||||
<string>NSView</string>
|
||||
<string>NSWindowTemplate</string>
|
||||
<string>NSTextFieldCell</string>
|
||||
<string>NSButtonCell</string>
|
||||
<string>NSButton</string>
|
||||
<string>NSCustomObject</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSCustomObject" id="1001">
|
||||
<string key="NSClassName">UpdateNotificationController</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="1003">
|
||||
<string key="NSClassName">FirstResponder</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="1004">
|
||||
<string key="NSClassName">NSApplication</string>
|
||||
</object>
|
||||
<object class="NSWindowTemplate" id="1005">
|
||||
<int key="NSWindowStyleMask">3</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{503, 500}, {433, 153}}</string>
|
||||
<int key="NSWTFlags">544735232</int>
|
||||
<string key="NSWindowTitle">New Version Available</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
<nil key="NSViewClass"/>
|
||||
<nil key="NSUserInterfaceItemIdentifier"/>
|
||||
<object class="NSView" key="NSWindowView" id="1006">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSButton" id="562191803">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">289</int>
|
||||
<string key="NSFrame">{{283, 12}, {136, 32}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="1033553056">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">134217728</int>
|
||||
<string key="NSContents">Visit</string>
|
||||
<object class="NSFont" key="NSSupport" id="161901745">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">13</double>
|
||||
<int key="NSfFlags">1044</int>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="562191803"/>
|
||||
<int key="NSButtonFlags">-2038284033</int>
|
||||
<int key="NSButtonFlags2">129</int>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string type="base64-UTF8" key="NSKeyEquivalent">DQ</string>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
<int key="NSPeriodicInterval">25</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSButton" id="1017432015">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">289</int>
|
||||
<string key="NSFrame">{{147, 12}, {136, 32}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="562191803"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="619506567">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">134217728</int>
|
||||
<string key="NSContents">Later</string>
|
||||
<reference key="NSSupport" ref="161901745"/>
|
||||
<reference key="NSControlView" ref="1017432015"/>
|
||||
<int key="NSButtonFlags">-2038284033</int>
|
||||
<int key="NSButtonFlags2">129</int>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
<int key="NSPeriodicInterval">25</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="373944060">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 48}, {399, 85}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="1017432015"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="171705107">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">272629760</int>
|
||||
<string key="NSContents">Version Info Text</string>
|
||||
<object class="NSFont" key="NSSupport">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">13</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="373944060"/>
|
||||
<object class="NSColor" key="NSBackgroundColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSColor" key="NSTextColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlTextColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{433, 153}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="373944060"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1366, 746}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">laterAction:</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="1017432015"/>
|
||||
</object>
|
||||
<int key="connectionID">7</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">visitButton</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="562191803"/>
|
||||
</object>
|
||||
<int key="connectionID">9</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">window</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="1005"/>
|
||||
</object>
|
||||
<int key="connectionID">10</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">visitAction:</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="562191803"/>
|
||||
</object>
|
||||
<int key="connectionID">12</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">laterButton</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="1017432015"/>
|
||||
</object>
|
||||
<int key="connectionID">17</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">infoTextField</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="373944060"/>
|
||||
</object>
|
||||
<int key="connectionID">18</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="1005"/>
|
||||
<reference key="destination" ref="1001"/>
|
||||
</object>
|
||||
<int key="connectionID">11</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<object class="NSArray" key="object" id="1002">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="1001"/>
|
||||
<reference key="parent" ref="1002"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="1003"/>
|
||||
<reference key="parent" ref="1002"/>
|
||||
<string key="objectName">First Responder</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-3</int>
|
||||
<reference key="object" ref="1004"/>
|
||||
<reference key="parent" ref="1002"/>
|
||||
<string key="objectName">Application</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1</int>
|
||||
<reference key="object" ref="1005"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="1006"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1002"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">2</int>
|
||||
<reference key="object" ref="1006"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="373944060"/>
|
||||
<reference ref="562191803"/>
|
||||
<reference ref="1017432015"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1005"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">3</int>
|
||||
<reference key="object" ref="562191803"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="1033553056"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1006"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="1033553056"/>
|
||||
<reference key="parent" ref="562191803"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">5</int>
|
||||
<reference key="object" ref="1017432015"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="619506567"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1006"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">6</int>
|
||||
<reference key="object" ref="619506567"/>
|
||||
<reference key="parent" ref="1017432015"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">15</int>
|
||||
<reference key="object" ref="373944060"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="171705107"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1006"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">16</int>
|
||||
<reference key="object" ref="171705107"/>
|
||||
<reference key="parent" ref="373944060"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.IBPluginDependency</string>
|
||||
<string>-2.IBPluginDependency</string>
|
||||
<string>-3.IBPluginDependency</string>
|
||||
<string>1.IBNSWindowAutoPositionCentersHorizontal</string>
|
||||
<string>1.IBNSWindowAutoPositionCentersVertical</string>
|
||||
<string>1.IBPluginDependency</string>
|
||||
<string>1.IBWindowTemplateEditedContentRect</string>
|
||||
<string>1.NSWindowTemplate.visibleAtLaunch</string>
|
||||
<string>15.IBPluginDependency</string>
|
||||
<string>16.IBPluginDependency</string>
|
||||
<string>2.IBPluginDependency</string>
|
||||
<string>3.IBPluginDependency</string>
|
||||
<string>4.IBPluginDependency</string>
|
||||
<string>5.IBPluginDependency</string>
|
||||
<string>6.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO"/>
|
||||
<boolean value="NO"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{357, 418}, {480, 270}}</string>
|
||||
<boolean value="NO"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="1002"/>
|
||||
<reference key="dict.values" ref="1002"/>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="1002"/>
|
||||
<reference key="dict.values" ref="1002"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">18</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UpdateNotificationController</string>
|
||||
<string key="superclassName">NSWindowController</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>laterAction:</string>
|
||||
<string>visitAction:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>laterAction:</string>
|
||||
<string>visitAction:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">laterAction:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">visitAction:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>infoTextField</string>
|
||||
<string>laterButton</string>
|
||||
<string>visitButton</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSTextField</string>
|
||||
<string>NSButton</string>
|
||||
<string>NSButton</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>infoTextField</string>
|
||||
<string>laterButton</string>
|
||||
<string>visitButton</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">infoTextField</string>
|
||||
<string key="candidateClassName">NSTextField</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">laterButton</string>
|
||||
<string key="candidateClassName">NSButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">visitButton</string>
|
||||
<string key="candidateClassName">NSButton</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/UpdateNotificationController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
</data>
|
||||
</archive>
|
|
@ -39,7 +39,7 @@ static NSString *const kConnectionName = @"McBopomofo_1_Connection";
|
|||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
@autoreleasepool {
|
||||
|
||||
// register and enable the input source (along with all its input modes)
|
||||
if (argc > 1 && !strcmp(argv[1], "install")) {
|
||||
|
@ -64,7 +64,6 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (!status) {
|
||||
NSLog(@"Fatal error: Cannot register input source %@ at %@.", bundleID, [bundleURL absoluteString]);
|
||||
[pool drain];
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -72,7 +71,6 @@ int main(int argc, char *argv[])
|
|||
// if it still doesn't register successfully, bail.
|
||||
if (!inputSource) {
|
||||
NSLog(@"Fatal error: Cannot find input source %@ after registration.", bundleID);
|
||||
[pool drain];
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -84,12 +82,10 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (!status) {
|
||||
NSLog(@"Fatal error: Cannot enable input source %@.", bundleID);
|
||||
[pool drain];
|
||||
return -1;
|
||||
}
|
||||
if (![OVInputSourceHelper inputSourceEnabled:inputSource]){
|
||||
NSLog(@"Fatal error: Cannot enable input source %@.", bundleID);
|
||||
[pool drain];
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -110,26 +106,22 @@ int main(int argc, char *argv[])
|
|||
NSString *mainNibName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"NSMainNibFile"];
|
||||
if (!mainNibName) {
|
||||
NSLog(@"Fatal error: NSMainNibFile key not defined in Info.plist.");
|
||||
[pool drain];
|
||||
return -1;
|
||||
}
|
||||
|
||||
BOOL loadResult = [NSBundle loadNibNamed:mainNibName owner:[NSApplication sharedApplication]];
|
||||
BOOL loadResult = [[NSBundle mainBundle] loadNibNamed:mainNibName owner:[NSApplication sharedApplication] topLevelObjects:NULL];
|
||||
if (!loadResult) {
|
||||
NSLog(@"Fatal error: Cannot load %@.", mainNibName);
|
||||
[pool drain];
|
||||
return -1;
|
||||
}
|
||||
|
||||
IMKServer *server = [[IMKServer alloc] initWithName:kConnectionName bundleIdentifier:[[NSBundle mainBundle] bundleIdentifier]];
|
||||
if (!server) {
|
||||
NSLog(@"Fatal error: Cannot initialize input method server with connection %@.", kConnectionName);
|
||||
[pool drain];
|
||||
return -1;
|
||||
}
|
||||
|
||||
[[NSApplication sharedApplication] run];
|
||||
[server release];
|
||||
[pool drain];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
CFBundleName = "小麥注音";
|
||||
CFBundleDisplayName = "小麥注音";
|
||||
NSHumanReadableCopyright = "Copyright © 2011-2017 Mengjuei Hsieh et al.\nAll Rights Reserved.";
|
||||
NSHumanReadableCopyright = "Copyright © 2011-2020 Mengjuei Hsieh et al.\nAll Rights Reserved.";
|
||||
"org.openvanilla.inputmethod.McBopomofo.Bopomofo" = "小麥注音";
|
||||
"org.openvanilla.inputmethod.McBopomofo.PlainBopomofo" = "傳統注音";
|
||||
|
|
|
@ -16,14 +16,37 @@
|
|||
/* No comment provided by engineer. */
|
||||
"Check Later" = "晚點再通知我";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"New Version Available" = "New Version Available";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Visit Website" = "開啟網站";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"You are running version %@ (%@), and the new version %@ (%@) is now available.\n\nVisit the website to download it?" = "目前的輸入法版本是 %1$@ 版 (%2$@),目前最新版本已經到第 %3$@ 版 (%4$@)。\n\n是否要前往輸入法網站,下載最新版本?";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Check for Updates…" = "檢查是否有新版…";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Check for Update Completed" = "新版檢查完畢";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"You are already using the latest version of McBopomofo." = "目前使用的已經是最新版本。";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Update Check Failed" = "無法檢查新版";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"There may be no internet connection or the server failed to respond.\n\nError message: %@" = "網路連線失敗,或是伺服器沒有回應。\n\n錯誤說明:%@";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"OK" = "好";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Dismiss" = "關閉本視窗";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"New Version Available" = "有新版可下載";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Not Now" = "以後再說";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Visit Website" = "前往網站";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"You're currently using McBopomofo %@ (%@), a new version %@ (%@) is now available. Do you want to visit McBopomofo's website to download the version?%@" = "目前使用的小麥注音版本是 %1$@ (%2$@),網路上有更新版本 %3$@ (%4$@) 可供下載。是否要前往小麥注音網站下載新版來安裝?%5$@";
|
||||
|
||||
"Chinese Conversion" = "簡繁轉換";
|
||||
|
|
|
@ -1,452 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1070</int>
|
||||
<string key="IBDocument.SystemVersion">11A2063</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1910</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.1</string>
|
||||
<string key="IBDocument.HIToolboxVersion">566.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">1910</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSTextField</string>
|
||||
<string>NSView</string>
|
||||
<string>NSWindowTemplate</string>
|
||||
<string>NSTextFieldCell</string>
|
||||
<string>NSButtonCell</string>
|
||||
<string>NSButton</string>
|
||||
<string>NSCustomObject</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSCustomObject" id="1001">
|
||||
<string key="NSClassName">UpdateNotificationController</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="1003">
|
||||
<string key="NSClassName">FirstResponder</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="1004">
|
||||
<string key="NSClassName">NSApplication</string>
|
||||
</object>
|
||||
<object class="NSWindowTemplate" id="1005">
|
||||
<int key="NSWindowStyleMask">3</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{503, 500}, {433, 153}}</string>
|
||||
<int key="NSWTFlags">544735232</int>
|
||||
<string key="NSWindowTitle">New Version Available</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
<nil key="NSViewClass"/>
|
||||
<nil key="NSUserInterfaceItemIdentifier"/>
|
||||
<object class="NSView" key="NSWindowView" id="1006">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSButton" id="562191803">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">289</int>
|
||||
<string key="NSFrame">{{283, 12}, {136, 32}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="1033553056">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">134217728</int>
|
||||
<string key="NSContents">Visit</string>
|
||||
<object class="NSFont" key="NSSupport" id="161901745">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">13</double>
|
||||
<int key="NSfFlags">1044</int>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="562191803"/>
|
||||
<int key="NSButtonFlags">-2038284033</int>
|
||||
<int key="NSButtonFlags2">129</int>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string type="base64-UTF8" key="NSKeyEquivalent">DQ</string>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
<int key="NSPeriodicInterval">25</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSButton" id="1017432015">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">289</int>
|
||||
<string key="NSFrame">{{147, 12}, {136, 32}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="562191803"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="619506567">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">134217728</int>
|
||||
<string key="NSContents">Later</string>
|
||||
<reference key="NSSupport" ref="161901745"/>
|
||||
<reference key="NSControlView" ref="1017432015"/>
|
||||
<int key="NSButtonFlags">-2038284033</int>
|
||||
<int key="NSButtonFlags2">129</int>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
<int key="NSPeriodicInterval">25</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="373944060">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 48}, {399, 85}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="1017432015"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="171705107">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">272629760</int>
|
||||
<string key="NSContents">Version Info Text</string>
|
||||
<object class="NSFont" key="NSSupport">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">13</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="373944060"/>
|
||||
<object class="NSColor" key="NSBackgroundColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSColor" key="NSTextColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlTextColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{433, 153}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="373944060"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1366, 746}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">laterAction:</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="1017432015"/>
|
||||
</object>
|
||||
<int key="connectionID">7</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">visitButton</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="562191803"/>
|
||||
</object>
|
||||
<int key="connectionID">9</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">window</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="1005"/>
|
||||
</object>
|
||||
<int key="connectionID">10</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">visitAction:</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="562191803"/>
|
||||
</object>
|
||||
<int key="connectionID">12</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">laterButton</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="1017432015"/>
|
||||
</object>
|
||||
<int key="connectionID">17</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">infoTextField</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="373944060"/>
|
||||
</object>
|
||||
<int key="connectionID">18</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="1005"/>
|
||||
<reference key="destination" ref="1001"/>
|
||||
</object>
|
||||
<int key="connectionID">11</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<object class="NSArray" key="object" id="1002">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="1001"/>
|
||||
<reference key="parent" ref="1002"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="1003"/>
|
||||
<reference key="parent" ref="1002"/>
|
||||
<string key="objectName">First Responder</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-3</int>
|
||||
<reference key="object" ref="1004"/>
|
||||
<reference key="parent" ref="1002"/>
|
||||
<string key="objectName">Application</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1</int>
|
||||
<reference key="object" ref="1005"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="1006"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1002"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">2</int>
|
||||
<reference key="object" ref="1006"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="373944060"/>
|
||||
<reference ref="562191803"/>
|
||||
<reference ref="1017432015"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1005"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">3</int>
|
||||
<reference key="object" ref="562191803"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="1033553056"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1006"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="1033553056"/>
|
||||
<reference key="parent" ref="562191803"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">5</int>
|
||||
<reference key="object" ref="1017432015"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="619506567"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1006"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">6</int>
|
||||
<reference key="object" ref="619506567"/>
|
||||
<reference key="parent" ref="1017432015"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">15</int>
|
||||
<reference key="object" ref="373944060"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="171705107"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1006"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">16</int>
|
||||
<reference key="object" ref="171705107"/>
|
||||
<reference key="parent" ref="373944060"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.IBPluginDependency</string>
|
||||
<string>-2.IBPluginDependency</string>
|
||||
<string>-3.IBPluginDependency</string>
|
||||
<string>1.IBNSWindowAutoPositionCentersHorizontal</string>
|
||||
<string>1.IBNSWindowAutoPositionCentersVertical</string>
|
||||
<string>1.IBPluginDependency</string>
|
||||
<string>1.IBWindowTemplateEditedContentRect</string>
|
||||
<string>1.NSWindowTemplate.visibleAtLaunch</string>
|
||||
<string>15.IBPluginDependency</string>
|
||||
<string>16.IBPluginDependency</string>
|
||||
<string>2.IBPluginDependency</string>
|
||||
<string>3.IBPluginDependency</string>
|
||||
<string>4.IBPluginDependency</string>
|
||||
<string>5.IBPluginDependency</string>
|
||||
<string>6.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO"/>
|
||||
<boolean value="NO"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{357, 418}, {480, 270}}</string>
|
||||
<boolean value="NO"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="1002"/>
|
||||
<reference key="dict.values" ref="1002"/>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="1002"/>
|
||||
<reference key="dict.values" ref="1002"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">18</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UpdateNotificationController</string>
|
||||
<string key="superclassName">NSWindowController</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>laterAction:</string>
|
||||
<string>visitAction:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>laterAction:</string>
|
||||
<string>visitAction:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">laterAction:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">visitAction:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>infoTextField</string>
|
||||
<string>laterButton</string>
|
||||
<string>visitButton</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSTextField</string>
|
||||
<string>NSButton</string>
|
||||
<string>NSButton</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>infoTextField</string>
|
||||
<string>laterButton</string>
|
||||
<string>visitButton</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">infoTextField</string>
|
||||
<string key="candidateClassName">NSTextField</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">laterButton</string>
|
||||
<string key="candidateClassName">NSButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">visitButton</string>
|
||||
<string key="candidateClassName">NSButton</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/UpdateNotificationController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
</data>
|
||||
</archive>
|