├── src ├── engine │ ├── tests │ │ ├── keymap_patch.conf │ │ ├── SKK-JISYO.S1 │ │ ├── SKK-JISYO.S2 │ │ ├── period.rule │ │ ├── SKK-JISYO.TEST │ │ ├── kana-rule.conf │ │ ├── dict.file │ │ ├── skk.jisyo │ │ ├── skk-jisyo.utf8 │ │ ├── SKK-JISYO.TEST.UTF8 │ │ ├── MockMessenger.h │ │ ├── TestEvent.h │ │ ├── MockAnnotator.h │ │ ├── utf8util_TEST.cpp │ │ ├── MockDynamicCompletor.h │ │ ├── SKKGadgetDictionary_TEST.cpp │ │ ├── MockClipboard.h │ │ ├── MockRegistrationObserver.h │ │ ├── SKKDictionaryFactory_TEST.cpp │ │ ├── socketutil_TEST.cpp │ │ ├── SKKCandidate_TEST.cpp │ │ ├── SKKInlineSelector_TEST.cpp │ │ ├── SKKNumericConverter_TEST.cpp │ │ ├── MockCandidateWindow.h │ │ ├── SKKDictionaryFile_TEST.cpp │ │ ├── MockConfig.h │ │ ├── MockCompletionHelper.h │ │ ├── SKKAutoUpdateDictionary_TEST.cpp │ │ ├── SKKWindowSelector_TEST.cpp │ │ ├── SKKCommonDictionary_TEST.cpp │ │ ├── SKKDictionaryKeeper_TEST.cpp │ │ ├── calculator_TEST.cpp │ │ ├── SKKCandidateParser_TEST.cpp │ │ ├── SKKSelector_TEST.cpp │ │ ├── MockFrontEnd.h │ │ ├── pthreadutil_TEST.cpp │ │ ├── SKKCompleter_TEST.cpp │ │ ├── keymap.conf │ │ ├── MockInputSessionParameter.h │ │ ├── TestResult.h │ │ ├── stringutil_TEST.cpp │ │ └── SKKInputQueue_TEST.cpp │ ├── session │ │ ├── SKKInputMode.h │ │ ├── SKKUndoContext.h │ │ ├── SKKInputModeSelector.h │ │ ├── SKKInputContext.h │ │ ├── SKKOutputBuffer.h │ │ ├── SKKRegistration.h │ │ ├── SKKInputEnvironment.h │ │ └── SKKInputEnvironment.cpp │ ├── dictionary │ │ ├── SKKAutoUpdateDictionary.h │ │ ├── SKKCommonDictionary.h │ │ ├── SKKCompletionHelper.h │ │ ├── SKKUserDictionary.h │ │ ├── SKKProxyDictionary.h │ │ ├── SKKDistributedUserDictionary.h │ │ └── SKKBaseDictionary.h │ ├── entry │ │ ├── SKKOkuriHint.h │ │ └── SKKCandidate.cpp │ ├── backend │ │ ├── SKKDictionaryCache.h │ │ ├── SKKCandidateFilter.h │ │ ├── SKKDictionaryKey.h │ │ ├── SKKNumericConverter.h │ │ └── SKKDictionaryCache.cpp │ ├── skkserv │ │ └── skkserv.h │ ├── editor │ │ ├── SKKPrimaryEditor.h │ │ ├── SKKCandidateEditor.h │ │ ├── SKKComposingEditor.h │ │ ├── SKKEntryRemoveEditor.h │ │ ├── SKKTextBuffer.h │ │ ├── SKKRegisterEditor.h │ │ ├── SKKOkuriEditor.h │ │ └── SKKPrimaryEditor.cpp │ ├── selector │ │ ├── SKKInlineSelector.h │ │ ├── SKKBaseSelector.h │ │ └── SKKInlineSelector.cpp │ ├── state │ │ ├── SKKStateRecursiveRegister-inl.h │ │ └── SKKStateMachine.h │ ├── keymap │ │ ├── SKKKeymap.h │ │ └── SKKKeyState.h │ ├── completer │ │ └── SKKCompleter.h │ └── trie │ │ └── SKKRomanKanaConverter.h └── bridge │ ├── SKKClipboard.h │ ├── SKKMessenger.h │ ├── SKKAnnotator.h │ ├── SKKInputModeListener.h │ ├── SKKDynamicCompletor.h │ ├── SKKFrontEnd.h │ ├── SKKInputSessionParameter.h │ ├── SKKCandidateWindow.h │ └── SKKWidget.h ├── data ├── config │ ├── act.rule │ ├── azik.rule │ ├── comma.rule │ ├── azik_us.rule │ ├── old-kana.rule │ ├── period.rule │ ├── kana-rule.conf │ ├── yakumono-ippai.rule │ ├── act.conf │ ├── azik.conf │ ├── sub-rule.desc │ └── keymap.conf └── icons │ ├── AquaSKK.graffle │ ├── Mini-Ascii.tiff │ ├── AquaSKK-Ascii.png │ ├── Mini-Ascii@2x.tiff │ ├── Mini-Hirakana.tiff │ ├── Mini-Katakana.tiff │ ├── AquaSKK-Ascii@2x.png │ ├── AquaSKK-Hirakana.png │ ├── AquaSKK-Katakana.png │ ├── Mini-Hirakana@2x.tiff │ ├── Mini-Katakana@2x.tiff │ ├── AquaSKK-Hirakana@2x.png │ ├── AquaSKK-InputMethod.tif │ ├── AquaSKK-Jisx0201Kana.png │ ├── AquaSKK-Katakana@2x.png │ ├── Mini-Jisx0201Kana.tiff │ ├── Mini-Jisx0208Latin.tiff │ ├── AquaSKK-Jisx0208Latin.png │ ├── Mini-Jisx0201Kana@2x.tiff │ ├── Mini-Jisx0208Latin@2x.tiff │ ├── AquaSKK-InputMethod@2x.tiff │ ├── AquaSKK-Jisx0201Kana@2x.png │ └── AquaSKK-Jisx0208Latin@2x.png ├── doc ├── ClassDiagram01.png ├── ClassDiagram02.png ├── ClassDiagram03.png ├── ClassDiagram04.png └── ClassDiagram.graffle ├── README ├── AUTHORS ├── platform └── mac │ ├── proj │ ├── AquaSKK │ │ └── Images.xcassets │ │ │ ├── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ ├── Icon-16.png │ │ │ ├── Icon-32.png │ │ │ ├── Icon-128.png │ │ │ ├── Icon-16@2x.png │ │ │ ├── Icon-256.png │ │ │ ├── Icon-32@2x.png │ │ │ ├── Icon-512.png │ │ │ ├── Icon-128@2x.png │ │ │ ├── Icon-256@2x.png │ │ │ ├── Icon-512@2x.png │ │ │ └── Contents.json │ ├── build │ │ └── AquaSKK.build │ │ │ └── AquaSKK.pbxindex │ │ │ ├── cdecls.pbxbtree │ │ │ ├── decls.pbxbtree │ │ │ ├── files.pbxbtree │ │ │ ├── pbxindex.header │ │ │ ├── refs.pbxbtree │ │ │ ├── imports.pbxbtree │ │ │ ├── categories.pbxbtree │ │ │ ├── protocols.pbxbtree │ │ │ ├── subclasses.pbxbtree │ │ │ ├── symbols0.pbxsymbols │ │ │ └── strings.pbxstrings │ │ │ ├── control │ │ │ └── strings │ ├── aquaskk_Prefix.pch │ ├── AquaSKK.xcodeproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcuserdata │ │ │ │ └── t_suwa.xcuserdatad │ │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcuserdata │ │ │ └── t_suwa.xcuserdatad │ │ │ ├── xcdebugger │ │ │ └── Breakpoints.xcbkptlist │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ ├── InfoPlist.strings │ ├── AquaSKK.pmdoc │ │ ├── index.xml │ │ └── 01aquaskk.xml │ ├── AquaSKK.xib │ ├── contents │ │ ├── Welcome.rtf │ │ └── License.rtf │ └── AquaSKKPreferences-Info.plist │ ├── src │ ├── preferences │ │ ├── BlacklistApps.m │ │ ├── BlacklistApps.h │ │ ├── PathFormatter.h │ │ ├── main.mm │ │ ├── DictionaryTypeTransformer.h │ │ ├── SubRuleDescriptions.h │ │ ├── DictionarySet.h │ │ └── PathFormatter.mm │ ├── server │ │ ├── main.mm │ │ ├── SKKServerProxy.h │ │ ├── MacClipboard.h │ │ ├── SKKPythonRunner.h │ │ ├── SKKPythonRunner.cpp │ │ ├── SKKServer.h │ │ ├── MacClipboard.mm │ │ ├── SKKSupervisor.h │ │ ├── MacMessenger.h │ │ ├── ObjCUtil.h │ │ ├── BlacklistApps.h │ │ ├── MacInputModeMenu.mm │ │ ├── MacInputModeMenu.h │ │ ├── MacInputModeWindow.h │ │ ├── MacKotoeriDictionary.h │ │ ├── MacAnnotator.h │ │ ├── SKKInputController.h │ │ ├── SKKInputMenu.h │ │ ├── SKKPreProcessor.h │ │ ├── MacConfig.h │ │ ├── SKKLayoutManager.h │ │ ├── MacDynamicCompletor.h │ │ ├── MacFrontEnd.h │ │ ├── MacMessenger.mm │ │ ├── SKKServerProxy.mm │ │ ├── MacCandidateWindow.h │ │ └── MacInputSessionParameter.h │ └── gui │ │ ├── MessengerView.h │ │ ├── CompletionView.h │ │ ├── MessengerWindow.h │ │ ├── CompletionWindow.h │ │ ├── CandidatePageIndicator.h │ │ ├── AnnotationWindow.h │ │ ├── AnnotationView.h │ │ ├── CandidateCell.h │ │ ├── InputModeWindow.h │ │ ├── CandidateView.h │ │ └── CandidateWindow.h │ ├── pkg │ ├── aquaskk.plist │ └── distribution.xml │ └── plist │ └── BlacklistApps.plist ├── .travis.yml ├── .gitignore ├── ChangeLog ├── .github └── workflows │ └── main.yml └── README.md /src/engine/tests/keymap_patch.conf: -------------------------------------------------------------------------------- 1 | NotToggleKana q 2 | UpperCases " 3 | -------------------------------------------------------------------------------- /data/config/act.rule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/config/act.rule -------------------------------------------------------------------------------- /data/config/azik.rule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/config/azik.rule -------------------------------------------------------------------------------- /data/config/comma.rule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/config/comma.rule -------------------------------------------------------------------------------- /doc/ClassDiagram01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/doc/ClassDiagram01.png -------------------------------------------------------------------------------- /doc/ClassDiagram02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/doc/ClassDiagram02.png -------------------------------------------------------------------------------- /doc/ClassDiagram03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/doc/ClassDiagram03.png -------------------------------------------------------------------------------- /doc/ClassDiagram04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/doc/ClassDiagram04.png -------------------------------------------------------------------------------- /data/config/azik_us.rule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/config/azik_us.rule -------------------------------------------------------------------------------- /data/config/old-kana.rule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/config/old-kana.rule -------------------------------------------------------------------------------- /data/config/period.rule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/config/period.rule -------------------------------------------------------------------------------- /doc/ClassDiagram.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/doc/ClassDiagram.graffle -------------------------------------------------------------------------------- /data/config/kana-rule.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/config/kana-rule.conf -------------------------------------------------------------------------------- /data/icons/AquaSKK.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/AquaSKK.graffle -------------------------------------------------------------------------------- /data/icons/Mini-Ascii.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/Mini-Ascii.tiff -------------------------------------------------------------------------------- /data/icons/AquaSKK-Ascii.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/AquaSKK-Ascii.png -------------------------------------------------------------------------------- /data/icons/Mini-Ascii@2x.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/Mini-Ascii@2x.tiff -------------------------------------------------------------------------------- /data/icons/Mini-Hirakana.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/Mini-Hirakana.tiff -------------------------------------------------------------------------------- /data/icons/Mini-Katakana.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/Mini-Katakana.tiff -------------------------------------------------------------------------------- /src/engine/tests/SKK-JISYO.S1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/src/engine/tests/SKK-JISYO.S1 -------------------------------------------------------------------------------- /src/engine/tests/SKK-JISYO.S2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/src/engine/tests/SKK-JISYO.S2 -------------------------------------------------------------------------------- /src/engine/tests/period.rule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/src/engine/tests/period.rule -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | AquaSKK は Mac OS X 用のかな漢字変換プログラムです。多機能エディタ GNU 2 | Emacs で動作する「SKK」の長所を継承し、シンプルで快適な日本語入力環境の 3 | 提供を目指します。 4 | -------------------------------------------------------------------------------- /data/config/yakumono-ippai.rule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/config/yakumono-ippai.rule -------------------------------------------------------------------------------- /data/icons/AquaSKK-Ascii@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/AquaSKK-Ascii@2x.png -------------------------------------------------------------------------------- /data/icons/AquaSKK-Hirakana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/AquaSKK-Hirakana.png -------------------------------------------------------------------------------- /data/icons/AquaSKK-Katakana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/AquaSKK-Katakana.png -------------------------------------------------------------------------------- /data/icons/Mini-Hirakana@2x.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/Mini-Hirakana@2x.tiff -------------------------------------------------------------------------------- /data/icons/Mini-Katakana@2x.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/Mini-Katakana@2x.tiff -------------------------------------------------------------------------------- /src/engine/tests/SKK-JISYO.TEST: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/src/engine/tests/SKK-JISYO.TEST -------------------------------------------------------------------------------- /src/engine/tests/kana-rule.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/src/engine/tests/kana-rule.conf -------------------------------------------------------------------------------- /data/icons/AquaSKK-Hirakana@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/AquaSKK-Hirakana@2x.png -------------------------------------------------------------------------------- /data/icons/AquaSKK-InputMethod.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/AquaSKK-InputMethod.tif -------------------------------------------------------------------------------- /data/icons/AquaSKK-Jisx0201Kana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/AquaSKK-Jisx0201Kana.png -------------------------------------------------------------------------------- /data/icons/AquaSKK-Katakana@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/AquaSKK-Katakana@2x.png -------------------------------------------------------------------------------- /data/icons/Mini-Jisx0201Kana.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/Mini-Jisx0201Kana.tiff -------------------------------------------------------------------------------- /data/icons/Mini-Jisx0208Latin.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/Mini-Jisx0208Latin.tiff -------------------------------------------------------------------------------- /data/icons/AquaSKK-Jisx0208Latin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/AquaSKK-Jisx0208Latin.png -------------------------------------------------------------------------------- /data/icons/Mini-Jisx0201Kana@2x.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/Mini-Jisx0201Kana@2x.tiff -------------------------------------------------------------------------------- /data/icons/Mini-Jisx0208Latin@2x.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/Mini-Jisx0208Latin@2x.tiff -------------------------------------------------------------------------------- /data/icons/AquaSKK-InputMethod@2x.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/AquaSKK-InputMethod@2x.tiff -------------------------------------------------------------------------------- /data/icons/AquaSKK-Jisx0201Kana@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/AquaSKK-Jisx0201Kana@2x.png -------------------------------------------------------------------------------- /data/icons/AquaSKK-Jisx0208Latin@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/data/icons/AquaSKK-Jisx0208Latin@2x.png -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Original author: 2 | phonohawk 3 | 4 | Developers: 5 | Tomotaka SUWA 6 | S.Abe 7 | -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /src/engine/tests/dict.file: -------------------------------------------------------------------------------- 1 | ;; okuri-ari entries. 2 | うけとt /受け取/受取/ 3 | いあw /居合/ 4 | ;; okuri-nasi entries. 5 | かんじ /漢字/官寺/寛治/ 6 | かいはつ /開発/ 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode12.5 3 | 4 | script: 5 | - cd platform/mac 6 | - make debug 7 | - make test 8 | - make release 9 | -------------------------------------------------------------------------------- /src/engine/tests/skk.jisyo: -------------------------------------------------------------------------------- 1 | ;; okuri-ari entries. 2 | あr /有/[り/有/]/ 3 | ;; okuri-nasi entries. 4 | あ // 5 | こう /高/ 6 | こうもり /蝙蝠/ 7 | a // 8 | ん // 9 | か // 10 | あゎ // 11 | -------------------------------------------------------------------------------- /platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/cdecls.pbxbtree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/cdecls.pbxbtree -------------------------------------------------------------------------------- /platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/decls.pbxbtree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/decls.pbxbtree -------------------------------------------------------------------------------- /platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/files.pbxbtree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/files.pbxbtree -------------------------------------------------------------------------------- /platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/pbxindex.header: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/pbxindex.header -------------------------------------------------------------------------------- /platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/refs.pbxbtree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/refs.pbxbtree -------------------------------------------------------------------------------- /data/config/act.conf: -------------------------------------------------------------------------------- 1 | NotToggleKana q 2 | NotToggleJisx0201Kana ctrl::q 3 | NotEnterJapanese Q 4 | 5 | ToggleKana \ 6 | ToggleJisx0201Kana ctrl::\ 7 | EnterJapanese | 8 | UpperCases Q||" 9 | -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-16.png -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-32.png -------------------------------------------------------------------------------- /platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/imports.pbxbtree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/imports.pbxbtree -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-128.png -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-16@2x.png -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-256.png -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-32@2x.png -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-512.png -------------------------------------------------------------------------------- /platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/categories.pbxbtree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/categories.pbxbtree -------------------------------------------------------------------------------- /platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/protocols.pbxbtree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/protocols.pbxbtree -------------------------------------------------------------------------------- /platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/subclasses.pbxbtree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/subclasses.pbxbtree -------------------------------------------------------------------------------- /platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/symbols0.pbxsymbols: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/symbols0.pbxsymbols -------------------------------------------------------------------------------- /src/engine/tests/skk-jisyo.utf8: -------------------------------------------------------------------------------- 1 | ;; okuri-ari entries. 2 | おくりあr /送り有/ 3 | ;; okuri-nasi entries. 4 | # /456/ 5 | かんじ /漢字/ 6 | たんごとうろく /単語登録/ 7 | ほかん1 /補完1/ 8 | ほかん2 /補完2/ 9 | ほかん3 /補完3/ 10 | -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-128@2x.png -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-256@2x.png -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Icon-512@2x.png -------------------------------------------------------------------------------- /platform/mac/proj/aquaskk_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'aquaskk' target in the 'aquaskk' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/strings.pbxstrings/control: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/strings.pbxstrings/control -------------------------------------------------------------------------------- /platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/strings.pbxstrings/strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/build/AquaSKK.build/AquaSKK.pbxindex/strings.pbxstrings/strings -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /platform/mac/proj/build/ 2 | **/*.xcodeproj/* 3 | !**/*.xcodeproj/project.pbxproj 4 | !*.xcodeproj/default.* 5 | !**/*.xcodeproj/default.* 6 | .depend 7 | *.o 8 | *.a 9 | src/engine/tests/*_TEST 10 | -------------------------------------------------------------------------------- /platform/mac/src/preferences/BlacklistApps.m: -------------------------------------------------------------------------------- 1 | // 2 | // BlacklistApps.m 3 | // AquaSKK 4 | // 5 | // Created by mzp on 4/24/16. 6 | // 7 | // 8 | 9 | #import "BlacklistApps.h" 10 | 11 | @implementation BlacklistApps 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /src/engine/tests/SKK-JISYO.TEST.UTF8: -------------------------------------------------------------------------------- 1 | ;; okuri-ari entries. 2 | よi /良/好/酔/善/ 3 | おおk /(skk-ignore-dic-word "多")/大/ 4 | ;; okuri-nasi entries. 5 | いこう /以降/移行/意向/遺構/遺稿/威光/移項/衣桁/偉功/異香/偉効/胃腔/維綱/ 6 | かんじ /漢字/寛治/官寺/ 7 | むし /蒸し/(skk-ignore-dic-word "無視")/虫/ 8 | -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /platform/mac/src/preferences/BlacklistApps.h: -------------------------------------------------------------------------------- 1 | // 2 | // BlacklistApps.h 3 | // AquaSKK 4 | // 5 | // Created by mzp on 4/24/16. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface BlacklistApps : NSArrayController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | 2009-09-21 Tomotaka SUWA 2 | 3 | * AquaSKK 4.0 リリース 4 | 5 | 2008-06-26 Tomotaka SUWA 6 | 7 | * IMK 版のコードをリポジトリに反映 8 | 9 | 2007-12-15 Tomotaka SUWA 10 | 11 | * IMK 版 AquaSKK の開発に着手 12 | -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK.xcodeproj/project.xcworkspace/xcuserdata/t_suwa.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codefirst/aquaskk/HEAD/platform/mac/proj/AquaSKK.xcodeproj/project.xcworkspace/xcuserdata/t_suwa.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /data/config/azik.conf: -------------------------------------------------------------------------------- 1 | NotToggleKana q 2 | NotToggleJisx0201Kana ctrl::q 3 | NotEnterJapanese Q 4 | 5 | ToggleKana keycode::21 6 | ToggleJisx0201Kana ctrl::keycode::21 7 | EnterJapanese shift::keycode::21 8 | UpperCases Q||shift::keycode::29 9 | InputChars shift::keycode::29||keycode::21 10 | -------------------------------------------------------------------------------- /src/engine/tests/MockMessenger.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | 3 | #ifndef MockMessenger_h 4 | #define MockMessenger_h 5 | 6 | #include "SKKMessenger.h" 7 | 8 | class MockMessenger : public SKKMessenger { 9 | virtual void SendMessage(const std::string& msg) {} 10 | virtual void Beep() {} 11 | }; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/engine/tests/TestEvent.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | 3 | #ifndef TestEvent_h 4 | #define TestEvent_h 5 | 6 | // SKKInputSession テスト用の入力イベント 7 | struct TestEvent { 8 | int code; 9 | int mods; 10 | std::string selection; 11 | std::string yank; 12 | 13 | TestEvent() : code(0), mods(0) {} 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /platform/mac/proj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | CFBundleName = "AquaSKK"; 2 | com.apple.inputmethod.Japanese = "AquaSKK 統合"; 3 | com.apple.inputmethod.Japanese.Hiragana = "ひらかな"; 4 | com.apple.inputmethod.Japanese.Katakana = "カタカナ"; 5 | com.apple.inputmethod.Japanese.HalfWidthKana = "半角カナ"; 6 | com.apple.inputmethod.Japanese.FullWidthRoman = "全角英数"; 7 | com.apple.inputmethod.Roman = "ASCII"; 8 | -------------------------------------------------------------------------------- /src/engine/tests/MockAnnotator.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | 3 | #ifndef MockAnnotator_h 4 | #define MockAnnotator_h 5 | 6 | #include "SKKAnnotator.h" 7 | 8 | class MockAnnotator : public SKKAnnotator { 9 | virtual void SKKWidgetShow() {} 10 | virtual void SKKWidgetHide() {} 11 | virtual void Update(const SKKCandidate& candidate, int cursor) {} 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /data/config/sub-rule.desc: -------------------------------------------------------------------------------- 1 | ### 2 | ### sub-rule.desc -- 補助ルールの説明 3 | ### 4 | 5 | period.rule 句点をピリオド(.)にする 6 | comma.rule 読点をカンマ(,)にする 7 | azik.rule azik.conf 拡張ローマ字入力「AZIK」を使う(JIS配列用) 8 | azik_us.rule azik.conf 拡張ローマ字入力「AZIK」を使う(US配列用) 9 | act.rule act.conf 拡張ローマ字入力「ACT」を使う 10 | yakumono-ippai.rule SKK日本語入力FEP/Egg互換の記号入力を使う 11 | old-kana.rule 旧かな用ルールを使う(wi,we,kwa,gwa) 12 | -------------------------------------------------------------------------------- /src/engine/tests/utf8util_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "utf8util.h" 3 | 4 | int main() { 5 | std::string str = "ABCいろは日本語ABC"; 6 | 7 | assert(utf8::length(str) == 12); 8 | assert(utf8::left(str, -6) == "ABCいろは"); 9 | assert(utf8::right(str, -6) == "日本語ABC"); 10 | assert(utf8::common_prefix("1漢字2", "1漢字3") == "1漢字"); 11 | assert(utf8::common_prefix("いろは", "あいう") == ""); 12 | } 13 | -------------------------------------------------------------------------------- /src/engine/tests/MockDynamicCompletor.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | 3 | #ifndef MockDynamicCompletor_h 4 | #define MockDynamicCompletor_h 5 | 6 | #include "SKKDynamicCompletor.h" 7 | 8 | class MockDynamicCompletor : public SKKDynamicCompletor { 9 | virtual void SKKWidgetShow() {} 10 | virtual void SKKWidgetHide() {} 11 | virtual void Update(const std::string& completion, int commonPrefixSize, int cursorOffset) {} 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/engine/tests/SKKGadgetDictionary_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "SKKGadgetDictionary.h" 3 | 4 | int main() { 5 | SKKGadgetDictionary dict; 6 | 7 | dict.Initialize("hoge"); 8 | 9 | SKKCandidateSuite suite; 10 | dict.Find(SKKEntry("today"), suite); 11 | dict.Find(SKKEntry("now"), suite); 12 | dict.Find(SKKEntry("=(32768+64)*1024"), suite); 13 | 14 | std::cerr << suite.ToString() << std::endl; 15 | } 16 | -------------------------------------------------------------------------------- /src/engine/tests/MockClipboard.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | 3 | #ifndef MockClipboard_h 4 | #define MockClipboard_h 5 | 6 | #include "SKKClipboard.h" 7 | 8 | class MockClipboard : public SKKClipboard { 9 | std::string str_; 10 | 11 | virtual const std::string PasteString() { 12 | return str_; 13 | } 14 | 15 | public: 16 | void SetString(const std::string& str) { 17 | str_ = str; 18 | } 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/engine/tests/MockRegistrationObserver.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | 3 | #ifndef MockRegistrationObserver_h 4 | #define MockRegistrationObserver_h 5 | 6 | #include "SKKRegistrationObserver.h" 7 | 8 | class MockRegistrationObserver : public SKKRegistrationObserver { 9 | virtual void SKKRegistrationBegin(SKKBaseEditor* bottom) { delete bottom; } 10 | virtual void SKKRegistrationFinish(const std::string& word) {} 11 | virtual void SKKRegistrationCancel() {} 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK.xcodeproj/project.xcworkspace/xcuserdata/t_suwa.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/engine/tests/SKKDictionaryFactory_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "SKKDictionaryFactory.h" 3 | #include "SKKBaseDictionary.h" 4 | #include "SKKCommonDictionary.h" 5 | 6 | int main() { 7 | SKKRegisterFactoryMethod(0); 8 | 9 | auto& factory = SKKDictionaryFactory::theInstance(); 10 | auto* dict = factory.Create(0, "SKK-JISYO.TEST"); 11 | 12 | SKKCandidateSuite suite; 13 | dict->Find(SKKEntry("かんじ"), suite); 14 | assert(suite.ToString() == "/漢字/寛治/官寺/"); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /src/engine/tests/socketutil_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include "socketutil.h" 2 | 3 | int main() { 4 | net::socket::endpoint ep1("localhost", "http"); 5 | assert(ep1.node() == "localhost" && ep1.service() == "http"); 6 | 7 | net::socket::endpoint ep2("localhost", 80); 8 | assert(ep2.node() == "localhost" && ep2.service() == "80"); 9 | 10 | ep1.parse("localhost:80", "8080"); 11 | assert(ep1.node() == "localhost" && ep1.service() == "80"); 12 | 13 | ep1.parse("localhost", "8080"); 14 | assert(ep1.node() == "localhost" && ep1.service() == "8080"); 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/engine/tests/SKKCandidate_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "SKKCandidate.h" 3 | 4 | int main() { 5 | SKKCandidate c1; 6 | 7 | assert(c1.IsEmpty() && c1.ToString() == ""); 8 | 9 | std::string src("候補;アノテーション"); 10 | SKKCandidate c2(src); 11 | 12 | assert(c2.Word() == "候補" && c2.Annotation() == "アノテーション"); 13 | assert(c2.ToString() == src); 14 | 15 | c1 = c2; 16 | 17 | assert(c1.ToString() == src && c1 == c2); 18 | 19 | std::string variant("数値変換"); 20 | c1.SetVariant(variant); 21 | 22 | assert(c1.Variant() == variant && c1 != c2); 23 | 24 | assert(SKKCandidate::Encode("[/;") == "[5b][2f][3b]"); 25 | assert(SKKCandidate::Decode("[5b][2f][3b]") == "[/;"); 26 | } 27 | -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK.pmdoc/index.xml: -------------------------------------------------------------------------------- 1 | AquaSKK/Volumes/LaCie/Users/t_suwa/svn/aquaskk/proj/AquaSKK.pkgjp.sourceforge.aquaskk01aquaskk.xmlproperties.anywhereDomainproperties.systemDomainproperties.title -------------------------------------------------------------------------------- /src/engine/tests/SKKInlineSelector_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "SKKInlineSelector.h" 3 | 4 | int main() { 5 | SKKCandidateContainer container; 6 | SKKInlineSelector selector; 7 | 8 | container.push_back(SKKCandidate("候補1")); 9 | container.push_back(SKKCandidate("候補2")); 10 | container.push_back(SKKCandidate("候補3")); 11 | 12 | selector.Initialize(container, 3); 13 | 14 | assert(!selector.IsEmpty() && !selector.Prev() && selector.Current().ToString() == "候補1"); 15 | assert(selector.Next() && selector.Current().ToString() == "候補2"); 16 | assert(selector.Next() && !selector.Next() && selector.Current().ToString() == "候補3"); 17 | assert(selector.Prev() && selector.Current().ToString() == "候補2"); 18 | } 19 | -------------------------------------------------------------------------------- /src/engine/tests/SKKNumericConverter_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include "SKKNumericConverter.h" 2 | #include "SKKCandidate.h" 3 | #include 4 | #include 5 | 6 | int main() { 7 | SKKNumericConverter converter; 8 | 9 | // 数値変換の対象外 10 | assert(!converter.Setup("abc")); 11 | assert(converter.OriginalKey() == "abc"); 12 | assert(converter.NormalizedKey() == "abc"); 13 | 14 | // 数値変換対象 15 | assert(converter.Setup("0-1-2-1234-4-1234-34")); 16 | assert(converter.NormalizedKey() == "#-#-#-#-#-#-#"); 17 | 18 | SKKCandidate candidate("#0-#1-#2-#3-#4-#5-#9"); 19 | converter.Apply(candidate); 20 | 21 | //std::cerr << candidate.Variant() << std::endl; 22 | assert(candidate.Variant() == "0-1-二-千二百三十四-4-壱阡弐百参拾四-3四"); 23 | } 24 | -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/engine/tests/MockCandidateWindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MockCandidateWindow_h 2 | #define MockCandidateWindow_h 3 | 4 | #include "SKKCandidateWindow.h" 5 | 6 | class MockCandidateWindow : public SKKCandidateWindow { 7 | virtual void SKKWidgetShow() {} 8 | virtual void SKKWidgetHide() {} 9 | 10 | public: 11 | virtual void Setup(SKKCandidateIterator begin, 12 | SKKCandidateIterator end, 13 | std::vector& pages) { 14 | pages.push_back(end - begin); 15 | } 16 | 17 | virtual void Update(SKKCandidateIterator begin, 18 | SKKCandidateIterator end, 19 | int cursor, int page_pos, int page_max) {} 20 | 21 | virtual int LabelIndex(char label) { return 0; } 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK.xcodeproj/xcuserdata/t_suwa.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/engine/tests/SKKDictionaryFile_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "SKKDictionaryFile.h" 3 | 4 | int main() { 5 | SKKDictionaryEntryContainer okuriAri; 6 | SKKDictionaryEntryContainer okuriNasi; 7 | 8 | okuriAri.push_back(SKKDictionaryEntry("うけとt", "/受け取/受取/")); 9 | okuriAri.push_back(SKKDictionaryEntry("いあw", "/居合/")); 10 | 11 | okuriNasi.push_back(SKKDictionaryEntry("かんじ", "/漢字/官寺/寛治/")); 12 | okuriNasi.push_back(SKKDictionaryEntry("かいはつ", "/開発/")); 13 | 14 | SKKDictionaryFile file; 15 | 16 | file.OkuriAri() = okuriAri; 17 | file.OkuriNasi() = okuriNasi; 18 | 19 | file.Save("dict.file"); 20 | 21 | file.OkuriAri().clear(); 22 | file.OkuriNasi().clear(); 23 | 24 | file.Load("dict.file"); 25 | 26 | assert(file.OkuriAri() == okuriAri && file.OkuriNasi() == okuriNasi); 27 | } 28 | -------------------------------------------------------------------------------- /src/engine/tests/MockConfig.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | 3 | #ifndef MockConfig_h 4 | #define MockConfig_h 5 | 6 | #include "SKKConfig.h" 7 | 8 | class MockConfig : public SKKConfig { 9 | virtual bool FixIntermediateConversion() { return true; } 10 | virtual bool EnableDynamicCompletion() { return false; } 11 | virtual int DynamicCompletionRange() { return 0; } 12 | virtual bool EnableAnnotation() { return false; } 13 | virtual bool DisplayShortestMatchOfKanaConversions() { return false; } 14 | virtual bool SuppressNewlineOnCommit() { return true; } 15 | virtual int MaxCountOfInlineCandidates() { return 5; } 16 | virtual bool HandleRecursiveEntryAsOkuri() { return false; } 17 | virtual bool InlineBackSpaceImpliesCommit() { return false; } 18 | virtual bool DeleteOkuriWhenQuit() { return true; } 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/engine/tests/MockCompletionHelper.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | 3 | #ifndef MockCompletionHelper_h 4 | #define MockCompletionHelper_h 5 | 6 | #include "SKKCompletionHelper.h" 7 | 8 | class MockCompletionHelper : public SKKCompletionHelper { 9 | std::vector result_; 10 | std::string entry_; 11 | 12 | public: 13 | void Initialize(const std::string& entry) { 14 | entry_ = entry; 15 | result_.clear(); 16 | } 17 | 18 | std::vector& Result() { 19 | return result_; 20 | } 21 | 22 | virtual const std::string& Entry() const { 23 | return entry_; 24 | } 25 | 26 | virtual void Add(const std::string& completion) { 27 | result_.push_back(completion); 28 | } 29 | 30 | virtual bool CanContinue() const { 31 | return true; 32 | } 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | workflow_dispatch: 9 | 10 | jobs: 11 | build: 12 | runs-on: macos-12 13 | steps: 14 | - uses: actions/checkout@v2 15 | - run: sudo xcode-select -s /Applications/Xcode_13.4.1.app 16 | - run: make debug 17 | working-directory: platform/mac 18 | test: 19 | runs-on: macos-12 20 | steps: 21 | - uses: actions/checkout@v2 22 | - run: sudo xcode-select -s /Applications/Xcode_13.4.1.app 23 | - run: make test 24 | working-directory: platform/mac 25 | release: 26 | runs-on: macos-12 27 | steps: 28 | - uses: actions/checkout@v2 29 | - run: sudo xcode-select -s /Applications/Xcode_13.4.1.app 30 | - run: make release 31 | working-directory: platform/mac 32 | -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK.xcodeproj/xcuserdata/t_suwa.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AquaSKK.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | AquaSKKPreferences.xcscheme 13 | 14 | orderHint 15 | 1 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | D3FC32200DD1B09C006A3F5A 21 | 22 | primary 23 | 24 | 25 | D3FC322F0DD1B102006A3F5A 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/engine/tests/SKKAutoUpdateDictionary_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "SKKAutoUpdateDictionary.h" 4 | 5 | int main() { 6 | const char* path1 = "SKK-JISYO.S1"; 7 | const char* path2 = "SKK-JISYO.S2"; 8 | SKKAutoUpdateDictionary dict1, dict2; 9 | SKKCandidateSuite suite; 10 | 11 | remove(path1); 12 | remove(path2); 13 | 14 | dict1.Initialize("openlab.ring.gr.jp /skk/skk/dic/SKK-JISYO.S SKK-JISYO.S1"); 15 | dict2.Initialize("openlab.ring.gr.jp:80 /skk/skk/dic/SKK-JISYO.S SKK-JISYO.S2"); 16 | 17 | dict1.Find(SKKEntry("dummy", "d"), suite); 18 | dict2.Find(SKKEntry("dummy", "d"), suite); 19 | 20 | struct stat st1, st2; 21 | 22 | stat(path1, &st1); 23 | stat(path2, &st2); 24 | 25 | assert(st1.st_size == st2.st_size); 26 | 27 | assert(dict1.ReverseLookup("逆") == "ぎゃく"); 28 | assert(dict2.ReverseLookup("逆") == "ぎゃく"); 29 | } 30 | -------------------------------------------------------------------------------- /src/engine/tests/SKKWindowSelector_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "SKKWindowSelector.h" 3 | #include "SKKCandidateWindow.h" 4 | 5 | #include "MockCandidateWindow.h" 6 | 7 | int main() { 8 | SKKCandidateContainer container; 9 | MockCandidateWindow test_window; 10 | SKKWindowSelector selector(&test_window); 11 | 12 | container.push_back(SKKCandidate("候補1")); 13 | container.push_back(SKKCandidate("候補2")); 14 | container.push_back(SKKCandidate("候補3")); 15 | container.push_back(SKKCandidate("候補4")); 16 | container.push_back(SKKCandidate("候補5")); 17 | container.push_back(SKKCandidate("候補6")); 18 | 19 | selector.Initialize(container, 3); 20 | 21 | assert(!selector.IsEmpty() && !selector.Prev() && selector.Current().ToString() == "候補4"); 22 | 23 | selector.CursorRight(); 24 | selector.CursorRight(); 25 | 26 | assert(selector.Current().ToString() == "候補6"); 27 | } 28 | -------------------------------------------------------------------------------- /src/engine/tests/SKKCommonDictionary_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "SKKCommonDictionary.h" 3 | 4 | void test(SKKBaseDictionary& dict) { 5 | SKKCandidateSuite suite; 6 | 7 | dict.Find(SKKEntry("NOT_EXIST", "d"), suite); 8 | assert(suite.IsEmpty()); 9 | 10 | dict.Find(SKKEntry("よi", "い"), suite); 11 | assert(suite.ToString() == "/良/好/酔/善/"); 12 | 13 | suite.Clear(); 14 | dict.Find(SKKEntry("NOT_EXIST"), suite); 15 | assert(suite.IsEmpty()); 16 | 17 | dict.Find(SKKEntry("かんじ"), suite); 18 | assert(suite.ToString() == "/漢字/寛治/官寺/"); 19 | 20 | assert(dict.ReverseLookup("漢字") == "かんじ"); 21 | } 22 | 23 | int main() { 24 | SKKCommonDictionary dict; 25 | 26 | dict.Initialize("SKK-JISYO.TEST"); 27 | 28 | test(dict); 29 | 30 | SKKCommonDictionaryUTF8 utf8; 31 | 32 | utf8.Initialize("SKK-JISYO.TEST.UTF8"); 33 | 34 | test(utf8); 35 | 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /platform/mac/pkg/aquaskk.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | BundleHasStrictIdentifier 7 | 8 | BundleIsRelocatable 9 | 10 | BundleIsVersionChecked 11 | 12 | BundleOverwriteAction 13 | upgrade 14 | ChildBundles 15 | 16 | 17 | BundleHasStrictIdentifier 18 | 19 | BundleOverwriteAction 20 | 21 | RootRelativeBundlePath 22 | Library/Input Methods/AquaSKK.app/Contents/SharedSupport/AquaSKKPreferences.app 23 | 24 | 25 | RootRelativeBundlePath 26 | Library/Input Methods/AquaSKK.app 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /platform/mac/pkg/distribution.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | AquaSKK 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | aquaskk-pkg.pkg 21 | 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | aquaskk 2 | ======= 3 | 4 | An input method without morphological analysis. 5 | 6 | ## How to build 7 | 8 | ### Build package/dmg 9 | ``` 10 | $ cd aquaskk/platform/mac 11 | $ make pkg 12 | $ make dmg 13 | ``` 14 | 15 | ### Install debug build 16 | After install AquaSKK package, you could replace `AquaSKK.app` with debug build. 17 | 18 | ``` 19 | $ cd aquaskk/platform/mac 20 | $ make install 21 | ``` 22 | 23 | You might need logout/login to start new AquaSKK process. 24 | 25 | ### Install release build 26 | After install AquaSKK package, you could replace `AquaSKK.app` with release build. 27 | 28 | ``` 29 | $ cd aquaskk/platform/mac 30 | $ make install-rc 31 | ``` 32 | 33 | You might need logout/login to start new AquaSKK process. 34 | 35 | # Troubleshoot 36 | ## Use with iTerm2/Apple Terminal.app 37 | see http://mzp.hatenablog.com/entry/2015/03/15/213219 38 | 39 | ## Use with JetBrains products 40 | see http://mzp.hatenablog.com/entry/2016/10/29/095435 41 | -------------------------------------------------------------------------------- /platform/mac/src/preferences/PathFormatter.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | */ 21 | 22 | #import 23 | 24 | @interface PathFormatter : NSFormatter 25 | @end 26 | -------------------------------------------------------------------------------- /src/engine/tests/SKKDictionaryKeeper_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "SKKDictionaryKeeper.h" 3 | #include "MockCompletionHelper.h" 4 | 5 | class DebugLoader : public SKKDictionaryLoader { 6 | std::string path_; 7 | 8 | virtual bool NeedsUpdate() { 9 | return true; 10 | } 11 | 12 | virtual const std::string& FilePath() const { 13 | return path_; 14 | } 15 | 16 | public: 17 | virtual void Initialize(const std::string& path) { 18 | path_ = path; 19 | } 20 | 21 | virtual int Interval() const { return 5; } 22 | 23 | virtual int Timeout() const { return 5; } 24 | }; 25 | 26 | int main() { 27 | DebugLoader loader; 28 | SKKDictionaryKeeper keeper; 29 | MockCompletionHelper helper; 30 | 31 | loader.Initialize("SKK-JISYO.TEST"); 32 | keeper.Initialize(&loader); 33 | 34 | assert(keeper.ReverseLookup("官寺") == "かんじ"); 35 | 36 | helper.Initialize("か"); 37 | keeper.Complete(helper); 38 | 39 | assert(helper.Result()[0] == "かんじ"); 40 | } 41 | -------------------------------------------------------------------------------- /src/engine/tests/calculator_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include "calculator.h" 2 | #include 3 | #include 4 | 5 | int main() { 6 | calculator::engine calc; 7 | 8 | assert(calc.run("100") == 100); 9 | assert(calc.run("1+2") == 3); 10 | assert(calc.run("1.2-0.2") == 1); 11 | assert(calc.run("4*.3") == 1.2); 12 | assert(calc.run("300/50") == 6); 13 | assert(calc.run("4%2") == 0); 14 | assert(calc.run("9.6/2") == 4.8); 15 | assert(calc.run("3+2*5") == 13); 16 | assert(calc.run("(3+2)*5") == 25); 17 | try { 18 | calc.run("1/0"); 19 | assert("divide by ZERO" && false); 20 | } catch(...) { 21 | } 22 | 23 | try { 24 | calc.run("("); 25 | assert("')' expected" && false); 26 | } catch(...) { 27 | } 28 | 29 | try { 30 | calc.run("a"); 31 | assert("invalid characer" && false); 32 | } catch(...) { 33 | } 34 | 35 | try { 36 | calc.run(""); 37 | assert("no data found" && false); 38 | } catch(...) { 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /platform/mac/src/server/main.mm: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #include 24 | 25 | int main(int argc, const char** argv) { 26 | return NSApplicationMain(argc, argv); 27 | } 28 | -------------------------------------------------------------------------------- /platform/mac/src/preferences/main.mm: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #include "PreferenceController.h" 24 | 25 | int main(int argc, const char** argv) { 26 | return NSApplicationMain(argc, argv); 27 | } 28 | -------------------------------------------------------------------------------- /platform/mac/plist/BlacklistApps.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | bundleIdentifier 7 | com.microsoft.powerpoint 8 | insertMarkedText 9 | 10 | 11 | 12 | bundleIdentifier 13 | com.jetbrains 14 | insertEmptyString 15 | 16 | insertMarkedText 17 | 18 | syncInputSource 19 | 20 | 21 | 22 | bundleIdentifier 23 | com.google.android.studio 24 | insertEmptyString 25 | 26 | insertMarkedText 27 | 28 | syncInputSource 29 | 30 | 31 | 32 | bundleIdentifier 33 | jp.naver.line.mac 34 | insertEmptyString 35 | 36 | insertMarkedText 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/engine/tests/SKKCandidateParser_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "SKKCandidateParser.h" 3 | 4 | int main() { 5 | SKKCandidateParser parser; 6 | 7 | parser.Parse("//"); 8 | assert(parser.Candidates().empty() && parser.Hints().empty()); 9 | 10 | parser.Parse("/候補1/"); 11 | assert(parser.Candidates().size() == 1 && parser.Candidates()[0] == SKKCandidate("候補1")); 12 | 13 | parser.Parse("/候補1/候補2;アノテーション/候補3/"); 14 | assert(parser.Candidates().size() == 3 && parser.Candidates()[1] == SKKCandidate("候補2")); 15 | 16 | parser.Parse("/候補1/[おくり/候補1/]/"); 17 | SKKOkuriHint hint; 18 | hint.first = "おくり"; 19 | hint.second.push_back(std::string("候補1")); 20 | assert(parser.Candidates().size() == 1 && parser.Hints().size() == 1 && parser.Hints()[0] == hint); 21 | 22 | parser.Parse("/候補;[]][アノテーション/"); 23 | assert(parser.Candidates().size() == 1 && parser.Hints().empty()); 24 | 25 | parser.Parse("//[]/[///]/[おくり/候補1/候補2/]//"); 26 | assert(parser.Candidates().empty() && parser.Hints().size() == 1 27 | && parser.Hints()[0].second[1] == SKKCandidate("候補2")); 28 | } 29 | -------------------------------------------------------------------------------- /platform/mac/src/server/SKKServerProxy.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKServerProxy_h 24 | #define SKKServerProxy_h 25 | 26 | #include "SKKSupervisor.h" 27 | 28 | @interface SKKServerProxy : NSObject { 29 | id proxy_; 30 | } 31 | @end 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/engine/tests/SKKSelector_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "SKKSelector.h" 3 | #include "SKKCandidateWindow.h" 4 | #include "SKKBackEnd.h" 5 | #include "SKKCommonDictionary.h" 6 | #include "SKKDictionaryFactory.h" 7 | 8 | #include "MockFrontEnd.h" 9 | #include "MockCandidateWindow.h" 10 | 11 | class MockBuddy : public SKKSelectorBuddy { 12 | SKKCandidate candidate_; 13 | 14 | virtual const SKKEntry SKKSelectorQueryEntry() { 15 | return SKKEntry("かんじ"); 16 | } 17 | 18 | virtual void SKKSelectorUpdate(const SKKCandidate& candidate) { 19 | candidate_ = candidate; 20 | } 21 | 22 | public: 23 | SKKCandidate& Current() { return candidate_; } 24 | }; 25 | 26 | int main() { 27 | MockCandidateWindow test_window; 28 | MockBuddy buddy; 29 | SKKSelector selector(&buddy, &test_window); 30 | SKKDictionaryKeyContainer dicts; 31 | 32 | SKKRegisterFactoryMethod(0); 33 | dicts.push_back(SKKDictionaryKey(0, "SKK-JISYO.TEST")); 34 | SKKBackEnd::theInstance().Initialize("skk-jisyo.utf8", dicts); 35 | 36 | assert(selector.Execute(3) && buddy.Current().ToString() == "漢字"); 37 | } 38 | -------------------------------------------------------------------------------- /platform/mac/src/server/MacClipboard.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef MacClipboard_h 24 | #define MacClipboard_h 25 | 26 | #include "SKKClipboard.h" 27 | 28 | class MacClipboard : public SKKClipboard { 29 | public: 30 | virtual const std::string PasteString(); 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /platform/mac/src/server/SKKPythonRunner.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2010 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKPythonRunner_h 24 | #define SKKPythonRunner_h 25 | 26 | class SKKPythonRunner { 27 | public: 28 | SKKPythonRunner(); 29 | 30 | ~SKKPythonRunner(); 31 | 32 | void Run(const char* path); 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /platform/mac/proj/contents/Welcome.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg932\cocoartf1038 2 | {\fonttbl\f0\fnil\fcharset0 Menlo-Regular;\f1\fnil\fcharset128 HiraKakuProN-W3;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \paperw11900\paperh16840\margl1440\margr1440\vieww9000\viewh8400\viewkind0 5 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural 6 | 7 | \f0\fs28 \cf0 AquaSKK 8 | \f1 \'82\'cd 9 | \f0 Mac OS X 10 | \f1 \'97\'70\'82\'cc\'82\'a9\'82\'c8\'8a\'bf\'8e\'9a\'95\'cf\'8a\'b7\'83\'76\'83\'8d\'83\'4f\'83\'89\'83\'80\'82\'c5\'82\'b7\'81\'42 11 | \f0 \ 12 | \ 13 | 14 | \f1 \'91\'bd\'8b\'40\'94\'5c\'83\'47\'83\'66\'83\'42\'83\'5e 15 | \f0 {\field{\*\fldinst{HYPERLINK "http://www.gnu.org/software/emacs/"}}{\fldrslt GNU Emacs}} 16 | \f1 \'97\'70\'82\'c9\'8a\'4a\'94\'ad\'82\'b3\'82\'ea\'82\'bd {\field{\*\fldinst{HYPERLINK "http://openlab.ring.gr.jp/skk/index-j.html"}}{\fldrslt 17 | \f0 SKK}} \'82\'cc\'8e\'76\'91\'7a\'82\'f0\'8e\'f3\'82\'af\'8c\'70\'82\'ac\'81\'41\'83\'56\'83\'93\'83\'76\'83\'8b\'82\'c5\'89\'f5\'93\'4b\'82\'c8\'93\'fa\'96\'7b\'8c\'ea\'93\'fc\'97\'cd\'8a\'c2\'8b\'ab\'82\'f0\'96\'da\'8e\'77\'82\'b5\'82\'dc\'82\'b7\'81\'42} -------------------------------------------------------------------------------- /src/bridge/SKKClipboard.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKClipboard_h 24 | #define SKKClipboard_h 25 | 26 | #include 27 | 28 | class SKKClipboard { 29 | public: 30 | virtual ~SKKClipboard() {} 31 | 32 | // クリップボードの文字列取得 33 | virtual const std::string PasteString() = 0; 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKKPreferences-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ja_JP 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleGetInfoString 10 | Copyright © 2014-2018, codefirst 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 4.7.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 2021-05-26 23 | LSApplicationCategoryType 24 | public.app-category.utilities 25 | LSUIElement 26 | 1 27 | NSMainNibFile 28 | Preferences 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/engine/session/SKKInputMode.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKInputMode_h 24 | #define SKKInputMode_h 25 | 26 | enum SKKInputMode { 27 | HirakanaInputMode, 28 | KatakanaInputMode, 29 | Jisx0201KanaInputMode, 30 | AsciiInputMode, 31 | Jisx0208LatinInputMode, 32 | InvalidInputMode 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /platform/mac/src/gui/MessengerView.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef MessengerView_h 24 | #define MessengerView_h 25 | 26 | @interface MessengerView : NSView { 27 | NSDictionary* attributes_; 28 | NSImage* icon_; 29 | NSString* message_; 30 | } 31 | 32 | - (void)setMessage:(NSString*)message; 33 | 34 | @end 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /platform/mac/src/server/SKKPythonRunner.cpp: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2010 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #include "SKKPythonRunner.h" 24 | #include 25 | #include 26 | 27 | void SKKPythonRunner::Run(const char* path) { 28 | FILE* fp = fopen(path, "r"); 29 | 30 | Py_Initialize(); 31 | PyRun_SimpleFile(fp, path); 32 | Py_Finalize(); 33 | 34 | fclose(fp); 35 | } 36 | -------------------------------------------------------------------------------- /src/engine/dictionary/SKKAutoUpdateDictionary.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2007,2010 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKAutoUpdateDictionary_h 24 | #define SKKAutoUpdateDictionary_h 25 | 26 | #include "SKKDictionaryTemplate.h" 27 | #include "SKKHttpDictionaryLoader.h" 28 | 29 | // SKK 自動更新辞書 30 | 31 | typedef SKKDictionaryTemplate SKKAutoUpdateDictionary; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/bridge/SKKMessenger.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKMessenger_h 24 | #define SKKMessenger_h 25 | 26 | #include 27 | 28 | class SKKMessenger { 29 | public: 30 | virtual ~SKKMessenger() {} 31 | 32 | // メッセージの送信 33 | virtual void SendMessage(const std::string& msg) = 0; 34 | 35 | // ビープの再生 36 | virtual void Beep() = 0; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/engine/tests/MockFrontEnd.h: -------------------------------------------------------------------------------- 1 | #ifndef MockFrontEnd_h 2 | #define MockFrontEnd_h 3 | 4 | #include "SKKFrontEnd.h" 5 | #include "SKKInputModeListener.h" 6 | #include "TestResult.h" 7 | #include 8 | 9 | class MockFrontEnd : public SKKFrontEnd, public SKKInputModeListener { 10 | TestResult result_; 11 | std::string selected_string_; 12 | 13 | virtual void InsertString(const std::string& str) { 14 | result_.fixed += str; 15 | } 16 | 17 | virtual void ComposeString(const std::string& str, int cursorOffset) { 18 | result_.marked = str; 19 | result_.pos = cursorOffset; 20 | } 21 | 22 | virtual void ComposeString(const std::string& str, int convertFrom, int convertTo) { 23 | result_.marked = str; 24 | result_.pos = 0; 25 | } 26 | 27 | virtual std::string SelectedString() { 28 | return selected_string_; 29 | } 30 | 31 | virtual void SelectInputMode(SKKInputMode mode) { 32 | result_.mode = mode; 33 | } 34 | 35 | virtual void SKKWidgetShow() {} 36 | virtual void SKKWidgetHide() {} 37 | 38 | public: 39 | void SetSelectedString(const std::string& str) { selected_string_ = str; } 40 | operator TestResult&() { return result_; } 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/engine/tests/pthreadutil_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include "pthreadutil.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | class debugtask : public pthread::task { 8 | std::string str_; 9 | int loop_; 10 | pthread::mutex& mutex_; 11 | 12 | public: 13 | debugtask(const std::string& str, int loop, pthread::mutex& mutex) 14 | : str_(str), loop_(loop), mutex_(mutex) {} 15 | 16 | virtual ~debugtask() { 17 | pthread::lock scope(mutex_); 18 | std::cerr << "delete: " << str_ << std::endl; 19 | } 20 | 21 | virtual bool run() { 22 | for(int index = 0; index < loop_; ++ index) { 23 | do { 24 | pthread::lock scope(mutex_); 25 | std::cerr << "run :" << str_ << std::endl; 26 | } while(0); 27 | 28 | sleep(1); 29 | } 30 | 31 | return true; 32 | } 33 | }; 34 | 35 | int main() { 36 | pthread::pool pool(1); 37 | pthread::mutex mutex; 38 | 39 | #if 0 40 | pool.enqueue(new debugtask("1", 3, mutex)); 41 | pool.enqueue(new debugtask("2", 3, mutex)); 42 | pool.enqueue(new debugtask("3", 3, mutex)); 43 | pool.enqueue(new debugtask("4", 3, mutex)); 44 | #endif 45 | } 46 | -------------------------------------------------------------------------------- /src/engine/entry/SKKOkuriHint.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2007 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKOkuriHint_h 24 | #define SKKOkuriHint_h 25 | 26 | #include "SKKCandidate.h" 27 | 28 | // 送りヒントは「かな」と「変換候補」のペアで管理する 29 | typedef std::pair SKKOkuriHint; 30 | typedef std::deque SKKOkuriHintContainer; 31 | typedef SKKOkuriHintContainer::iterator SKKOkuriHintIterator; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /platform/mac/src/preferences/DictionaryTypeTransformer.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2010 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | */ 21 | 22 | #import 23 | 24 | #ifndef DictionaryTypeTransformer_h 25 | #define DictionaryTypeTransformer_h 26 | 27 | @interface DictionaryTypeTransformer : NSValueTransformer { 28 | NSArray* dictionaryTypes_; 29 | } 30 | 31 | - (id)initWithDictionaryTypes:(NSArray*)dictionaryTypes; 32 | 33 | @end 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /platform/mac/src/server/SKKServer.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKServer_h 24 | #define SKKServer_h 25 | 26 | #include 27 | #include 28 | #include "SKKSupervisor.h" 29 | 30 | @interface SKKServer : NSObject { 31 | IMKServer* imkserver_; 32 | NSConnection* connection_; 33 | class skkserv* skkserv_; 34 | } 35 | 36 | @end 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/bridge/SKKAnnotator.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKAnnotator_h 24 | #define SKKAnnotator_h 25 | 26 | #include "SKKWidget.h" 27 | #include "SKKCandidate.h" 28 | 29 | class SKKAnnotator : public SKKWidget { 30 | public: 31 | virtual ~SKKAnnotator() {} 32 | 33 | // 註釈の更新(candidate=候補, cursor=カーソル位置) 34 | virtual void Update(const SKKCandidate& candidate, int cursorOffset) = 0; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /platform/mac/src/gui/CompletionView.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef CompletionView_h 24 | #define CompletionView_h 25 | 26 | @interface CompletionView : NSView { 27 | NSAttributedString* completion_; 28 | NSColor* strokeColor_; 29 | NSColor* backgroundColor_; 30 | NSAttributedString* guide_; 31 | NSSize guideSize_; 32 | } 33 | 34 | - (void)setCompletion:(NSAttributedString*)completion; 35 | 36 | @end 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /platform/mac/src/gui/MessengerWindow.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef MessengerWindow_h 24 | #define MessengerWindow_h 25 | 26 | @class MessengerView; 27 | 28 | @interface MessengerWindow : NSObject { 29 | NSWindow* window_; 30 | MessengerView* view_; 31 | } 32 | 33 | + (MessengerWindow*)sharedWindow; 34 | - (void)showMessage:(NSString*)message at:(NSPoint)topleft level:(int)level; 35 | - (void)hide; 36 | 37 | @end 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /platform/mac/src/server/MacClipboard.mm: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #include "MacClipboard.h" 24 | 25 | const std::string MacClipboard::PasteString() { 26 | NSPasteboard* pasteboard = [NSPasteboard generalPasteboard]; 27 | 28 | if([[pasteboard types] containsObject:NSStringPboardType] == YES) { 29 | NSString* str = [pasteboard stringForType:NSStringPboardType]; 30 | return [str UTF8String]; 31 | } 32 | 33 | return ""; 34 | } 35 | -------------------------------------------------------------------------------- /platform/mac/src/server/SKKSupervisor.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKSupervisor_h 24 | #define SKKSupervisor_h 25 | 26 | #define SKKSupervisorConnectionName @"SKKSupervisorConnection" 27 | 28 | // AquaSKK 制御用プロトコル 29 | 30 | @protocol SKKSupervisor 31 | - (void)reloadBlacklistApps; 32 | - (void)reloadUserDefaults; 33 | - (void)reloadDictionarySet; 34 | - (void)reloadComponents; 35 | - (NSArray*)createDictionaryTypes; 36 | @end 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /platform/mac/src/server/MacMessenger.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef MacMessenger_h 24 | #define MacMessenger_h 25 | 26 | #include "SKKMessenger.h" 27 | #include "SKKLayoutManager.h" 28 | 29 | class MacMessenger : public SKKMessenger { 30 | SKKLayoutManager* layout_; 31 | 32 | public: 33 | MacMessenger(SKKLayoutManager* layout); 34 | 35 | virtual void SendMessage(const std::string& msg); 36 | virtual void Beep(); 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/engine/tests/SKKCompleter_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "SKKCompleter.h" 3 | #include "SKKBackEnd.h" 4 | 5 | class TestBuddy : public SKKCompleterBuddy { 6 | std::string query_; 7 | 8 | virtual const std::string SKKCompleterQueryString() { 9 | return query_; 10 | } 11 | 12 | virtual void SKKCompleterUpdate(const std::string& entry) { 13 | query_ = entry; 14 | } 15 | 16 | public: 17 | void SetQuery(const std::string& str) { 18 | query_ = str; 19 | } 20 | 21 | const std::string& Entry() const { 22 | return query_; 23 | } 24 | }; 25 | 26 | int main() { 27 | TestBuddy buddy; 28 | SKKCompleter completer(&buddy); 29 | SKKDictionaryKeyContainer dicts; 30 | 31 | auto& backend = SKKBackEnd::theInstance(); 32 | 33 | backend.Initialize("skk-jisyo.utf8", dicts); 34 | 35 | buddy.SetQuery("ほかん"); 36 | 37 | assert(completer.Execute() && buddy.Entry() == "ほかん1"); 38 | 39 | completer.Next(); 40 | completer.Next(); 41 | 42 | assert(buddy.Entry() == "ほかん3"); 43 | 44 | backend.Register(SKKEntry("とぐるほかん"), SKKCandidate()); 45 | 46 | buddy.SetQuery("とぐる"); 47 | assert(completer.Execute() && buddy.Entry() == "とぐるほかん"); 48 | 49 | backend.Remove(SKKEntry("とぐるほかん"), SKKCandidate()); 50 | assert(!completer.Execute()); 51 | } 52 | -------------------------------------------------------------------------------- /platform/mac/src/gui/CompletionWindow.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef CompletionWindow_h 24 | #define CompletionWindow_h 25 | 26 | @class CompletionView; 27 | 28 | @interface CompletionWindow : NSObject { 29 | NSWindow* window_; 30 | CompletionView* view_; 31 | } 32 | 33 | + (CompletionWindow*)sharedWindow; 34 | - (void)showCompletion:(NSAttributedString*)completion at:(NSPoint)topleft level:(int)level; 35 | - (void)hide; 36 | 37 | @end 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /platform/mac/src/gui/CandidatePageIndicator.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef CandidatePageIndicator_h 24 | #define CandidatePageIndicator_h 25 | 26 | #include 27 | 28 | @interface CandidatePageIndicator : NSObject { 29 | NSMutableDictionary* attributes_; 30 | NSAttributedString* indicator_; 31 | NSBezierPath* plate_; 32 | } 33 | 34 | - (void)setPage:(NSRange)page; 35 | - (void)drawAtPoint:(NSPoint)point; 36 | - (NSSize)size; 37 | 38 | @end 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /platform/mac/src/server/ObjCUtil.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef ObjCUtil_h 24 | #define ObjCUtil_h 25 | 26 | #include 27 | 28 | namespace ObjC { 29 | class RAIIPool { 30 | NSAutoreleasePool* pool_; 31 | 32 | public: 33 | RAIIPool() { 34 | pool_ = [[NSAutoreleasePool alloc] init]; 35 | } 36 | 37 | ~RAIIPool() { 38 | if(pool_) [pool_ release]; 39 | } 40 | }; 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/bridge/SKKInputModeListener.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKInputModeListener_h 24 | #define SKKInputModeListener_h 25 | 26 | #include 27 | #include "SKKInputMode.h" 28 | #include "SKKWidget.h" 29 | 30 | class SKKInputModeListener : public SKKWidget { 31 | public: 32 | virtual ~SKKInputModeListener() {} 33 | 34 | virtual void SelectInputMode(SKKInputMode mode) = 0; 35 | }; 36 | 37 | typedef std::vector SKKInputModeListenerCollection; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /platform/mac/src/server/BlacklistApps.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef BlacklistApps_h 24 | #define BlacklistApps_h 25 | 26 | #import 27 | 28 | @interface BlacklistApps : NSObject { 29 | NSArray* blacklistApps_; 30 | } 31 | - (void)load:(NSArray*)blacklistApps; 32 | - (BOOL)isInsertEmptyString:(NSBundle *)bundle; 33 | - (BOOL)isInsertMarkedText:(NSString *)bundleIdentifier; 34 | - (BOOL)isSyncInputSource:(NSBundle *)bundle; 35 | + (BlacklistApps*)sharedManager; 36 | @end 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/engine/backend/SKKDictionaryCache.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKDictionaryCache_h 24 | #define SKKDictionaryCache_h 25 | 26 | #include 27 | #include "SKKDictionaryKey.h" 28 | 29 | class SKKBaseDictionary; 30 | 31 | class SKKDictionaryCache { 32 | std::map cache_; 33 | 34 | public: 35 | ~SKKDictionaryCache(); 36 | 37 | SKKBaseDictionary* Get(const SKKDictionaryKey& key); 38 | void Clear(const SKKDictionaryKey& key); 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/engine/backend/SKKCandidateFilter.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2009 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKCandidateFilter_h 24 | #define SKKCandidateFilter_h 25 | 26 | #include "SKKCandidate.h" 27 | #include 28 | 29 | // skk-ignore-dic-word 対応 30 | struct SKKIgnoreDicWord : public std::unary_function { 31 | bool operator()(const SKKCandidate& candidate) const { 32 | const std::string& str = candidate.Word(); 33 | 34 | return str.find("(skk-ignore-dic-word ") == 0; 35 | } 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/engine/backend/SKKDictionaryKey.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2007-2009 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKDictionaryKey_h 24 | #define SKKDictionaryKey_h 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | // ====================================================================== 31 | // 辞書のキー(辞書の型と場所のペア) 32 | // ====================================================================== 33 | typedef std::pair SKKDictionaryKey; 34 | typedef std::vector SKKDictionaryKeyContainer; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/engine/skkserv/skkserv.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2002 phonohawk 6 | Copyright (C) 2006-2008 Tomotaka SUWA 7 | 8 | This program is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 2 of the License, or 11 | any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | 22 | */ 23 | 24 | #include 25 | #include "socketutil.h" 26 | 27 | class skkserv { 28 | pthread_t thread_; 29 | net::socket::tcpserver server_; 30 | net::socket::monitor incoming_; 31 | bool localonly_; 32 | 33 | static void* listener(void* param); 34 | static void* worker(void* param); 35 | 36 | void accept(); 37 | 38 | public: 39 | skkserv(unsigned short port, bool localonly); 40 | 41 | ~skkserv(); 42 | }; 43 | -------------------------------------------------------------------------------- /platform/mac/src/gui/AnnotationWindow.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef AnnotationWindow_h 24 | #define AnnotationWindow_h 25 | 26 | @class AnnotationView; 27 | 28 | @interface AnnotationWindow : NSObject { 29 | NSWindow* window_; 30 | AnnotationView* view_; 31 | } 32 | 33 | + (AnnotationWindow*)sharedWindow; 34 | - (NSWindow*)window; 35 | - (void)setAnnotation:(NSString*)definition optional:(NSString*)annotation; 36 | - (void)showAt:(NSPoint)origin level:(int)level; 37 | - (void)hide; 38 | 39 | @end 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /platform/mac/src/server/MacInputModeMenu.mm: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #include "MacInputModeMenu.h" 24 | #include "SKKInputMenu.h" 25 | 26 | MacInputModeMenu::MacInputModeMenu(SKKInputMenu* menu) : menu_(menu), active_(false) {} 27 | 28 | void MacInputModeMenu::SelectInputMode(SKKInputMode mode) { 29 | if(active_) { 30 | [menu_ updateMenu:mode]; 31 | } 32 | } 33 | 34 | void MacInputModeMenu::SKKWidgetShow() { 35 | active_ = true; 36 | } 37 | 38 | void MacInputModeMenu::SKKWidgetHide() { 39 | active_ = false; 40 | } 41 | -------------------------------------------------------------------------------- /src/engine/dictionary/SKKCommonDictionary.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2002 phonohawk 6 | Copyright (C) 2005-2010 Tomotaka SUWA 7 | 8 | This program is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 2 of the License, or 11 | any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | 22 | */ 23 | 24 | #ifndef SKKCommonDictionary_h 25 | #define SKKCommonDictionary_h 26 | 27 | #include "SKKDictionaryTemplate.h" 28 | #include "SKKLocalDictionaryLoader.h" 29 | 30 | // SKK 共有辞書 31 | 32 | // EUC-JP 版 33 | typedef SKKDictionaryTemplate SKKCommonDictionary; 34 | 35 | // UTF-8 版 36 | typedef SKKDictionaryTemplate SKKCommonDictionaryUTF8; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/engine/dictionary/SKKCompletionHelper.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2010 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKCompletionHelper_h 24 | #define SKKCompletionHelper_h 25 | 26 | #include 27 | 28 | // 見出し語補完ヘルパー 29 | 30 | class SKKCompletionHelper { 31 | public: 32 | virtual ~SKKCompletionHelper() {} 33 | 34 | // 見出し語 35 | virtual const std::string& Entry() const = 0; 36 | 37 | // 補完継続可否 38 | virtual bool CanContinue() const = 0; 39 | 40 | // 補完候補の追加 41 | virtual void Add(const std::string& completion) = 0; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/engine/dictionary/SKKUserDictionary.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2002 phonohawk 6 | Copyright (C) 2005-2010 Tomotaka SUWA 7 | 8 | This program is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 2 of the License, or 11 | any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | 22 | */ 23 | 24 | #ifndef SKKUserDictionary_h 25 | #define SKKUserDictionary_h 26 | 27 | #include "SKKBaseDictionary.h" 28 | 29 | class SKKUserDictionary: public SKKBaseDictionary { 30 | public: 31 | virtual void Register(const SKKEntry& entry, const SKKCandidate& candidate) = 0; 32 | virtual void Remove(const SKKEntry& entry, const SKKCandidate& candidate) = 0; 33 | virtual void SetPrivateMode(bool flag) = 0; 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /platform/mac/src/server/MacInputModeMenu.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef MacInputModeMenu_h 24 | #define MacInputModeMenu_h 25 | 26 | #include "SKKInputModeListener.h" 27 | 28 | @class SKKInputMenu; 29 | 30 | class MacInputModeMenu : public SKKInputModeListener { 31 | SKKInputMenu* menu_; 32 | bool active_; 33 | 34 | virtual void SKKWidgetShow(); 35 | virtual void SKKWidgetHide(); 36 | 37 | public: 38 | MacInputModeMenu(SKKInputMenu* menu); 39 | 40 | virtual void SelectInputMode(SKKInputMode mode); 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /platform/mac/src/gui/AnnotationView.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef AnnotationView_h 24 | #define AnnotationView_h 25 | 26 | @interface AnnotationView : NSView { 27 | NSTextView* textView_; 28 | NSColor* strokeColor_; 29 | NSMutableParagraphStyle* blockStyle_; 30 | NSMutableParagraphStyle* listStyle_; 31 | NSAttributedString* definitiveHeader_; 32 | NSAttributedString* annotationHeader_; 33 | } 34 | 35 | - (void)setAnnotation:(NSString*)definition optional:(NSString*)annotation; 36 | - (BOOL)hasAnnotation; 37 | 38 | @end 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /src/bridge/SKKDynamicCompletor.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKDynamicCompletor_h 24 | #define SKKDynamicCompletor_h 25 | 26 | #include "SKKWidget.h" 27 | #include 28 | 29 | class SKKDynamicCompletor : public SKKWidget { 30 | public: 31 | virtual ~SKKDynamicCompletor() {} 32 | 33 | // 更新 34 | // completion="\n" で結合された見出し語候補 35 | // commonPrefixLength=各見出し語候補の共通プレフィクス長 36 | // cursorOffset=カーソル位置 37 | virtual void Update(const std::string& completion, 38 | int commonPrefixLength, int cursorOffset) = 0; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/engine/editor/SKKPrimaryEditor.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKPrimaryEditor_h 24 | #define SKKPrimaryEditor_h 25 | 26 | #include "SKKBaseEditor.h" 27 | 28 | class SKKPrimaryEditor : public SKKBaseEditor { 29 | public: 30 | SKKPrimaryEditor(SKKInputContext* context); 31 | 32 | virtual void ReadContext(); 33 | virtual void Input(const std::string& ascii); 34 | virtual void Input(const std::string& fixed, const std::string& input, char code); 35 | virtual void Input(SKKBaseEditor::Event event); 36 | virtual void Commit(std::string& queue); 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /platform/mac/src/preferences/SubRuleDescriptions.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2009 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SubRuleDescriptions_h 24 | #define SubRuleDescriptions_h 25 | 26 | #include 27 | #include 28 | 29 | class SubRuleDescriptions { 30 | std::map description_; 31 | std::map keymap_; 32 | 33 | void add(const std::string& line); 34 | 35 | public: 36 | SubRuleDescriptions(const char* folder); 37 | 38 | const char* Description(const char* rule_path); 39 | const char* Keymap(const char* rule_path); 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /platform/mac/src/gui/CandidateCell.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef CandidateCell_h 24 | #define CandidateCell_h 25 | 26 | #include 27 | 28 | @interface CandidateCell : NSObject { 29 | NSMutableDictionary* attributes_; 30 | NSMutableAttributedString* entry_; 31 | NSSize size_; 32 | } 33 | 34 | - (id)initWithFont:(NSFont*)font; 35 | - (void)setString:(NSString*)string withLabel:(char)label; 36 | - (void)drawAtPoint:(NSPoint)point withFocus:(BOOL)focus; 37 | - (void)drawAtPoint:(NSPoint)point withSize:(NSSize)size; 38 | - (NSSize)size; 39 | - (NSSize)defaultSize; 40 | 41 | @end 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/engine/selector/SKKInlineSelector.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKInlineSelector_h 24 | #define SKKInlineSelector_h 25 | 26 | #include "SKKBaseSelector.h" 27 | 28 | class SKKInlineSelector : public SKKBaseSelector { 29 | Range range_; 30 | int pos_; 31 | 32 | int minPosition() const; 33 | int maxPosition() const; 34 | 35 | public: 36 | void Initialize(SKKCandidateContainer& container, unsigned inlineCount); 37 | 38 | virtual bool Next(); 39 | virtual bool Prev(); 40 | 41 | virtual const SKKCandidate& Current() const; 42 | 43 | virtual bool IsEmpty() const; 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/engine/backend/SKKNumericConverter.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2006-2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKNumericConverter_h 24 | #define SKKNumericConverter_h 25 | 26 | #include 27 | #include 28 | 29 | class SKKCandidate; 30 | 31 | // 数値変換用ユーティリティクラス 32 | class SKKNumericConverter { 33 | std::string original_; 34 | std::string normalized_; 35 | std::vector params_; 36 | 37 | public: 38 | bool Setup(const std::string& query); 39 | 40 | const std::string& OriginalKey() const; 41 | const std::string& NormalizedKey() const; 42 | 43 | void Apply(SKKCandidate& candidate) const; 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/engine/session/SKKUndoContext.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2009 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKUndoContext_h 24 | #define SKKUndoContext_h 25 | 26 | #include 27 | 28 | class SKKFrontEnd; 29 | 30 | class SKKUndoContext { 31 | SKKFrontEnd* frontend_; 32 | std::string entry_; 33 | std::string candidate_; 34 | 35 | public: 36 | SKKUndoContext(SKKFrontEnd* frontend); 37 | 38 | enum UndoResult { UndoFailed, UndoKanaEntry, UndoAsciiEntry }; 39 | UndoResult Undo(); 40 | bool IsActive() const; 41 | void Clear(); 42 | const std::string& Entry() const; 43 | const std::string& Candidate() const; 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/engine/tests/keymap.conf: -------------------------------------------------------------------------------- 1 | ### 2 | ### keymap.conf 3 | ### 4 | 5 | # ====================================================================== 6 | # event section 7 | # ====================================================================== 8 | 9 | SKK_JMODE ctrl::j 10 | SKK_ENTER group::hex::0x03,0x0a,0x0d||ctrl::m 11 | SKK_CANCEL ctrl::g 12 | SKK_BACKSPACE hex::0x08 13 | SKK_BACKSPACE ctrl::h 14 | SKK_DELETE hex::0x7f||ctrl::d 15 | SKK_TAB hex::0x09||ctrl::i 16 | SKK_PASTE ctrl::y||meta::v 17 | SKK_UNDO ctrl::/ 18 | SKK_LEFT hex::0x1c||ctrl::b 19 | SKK_RIGHT hex::0x1d||ctrl::f 20 | SKK_UP hex::0x1e||ctrl::p||ctrl::a 21 | SKK_DOWN hex::0x1f||ctrl::n||ctrl::e 22 | 23 | # ====================================================================== 24 | # attribute section(for SKK_CHAR) 25 | # ====================================================================== 26 | 27 | ToggleKana q 28 | ToggleJisx0201Kana ctrl::q 29 | SwitchToAscii l 30 | SwitchToJisx0208Latin L 31 | 32 | EnterAbbrev / 33 | EnterJapanese Q 34 | #EnterJapanese keycode::0x66 # EISU 35 | #EnterJapanese keycode::0x68 # KANA 36 | NextCompletion . 37 | PrevCompletion , 38 | NextCandidate hex::0x20 39 | PrevCandidate x||shift::hex::0x20 40 | RemoveTrigger X 41 | 42 | UpperCases group::A-K,M-P,R-W,Z,l 43 | 44 | Direct group::keycode::0x41,0x43,0x45,0x4b,0x4e,0x51-0x59,0x5b,0x5c,0x5f 45 | InputChars group::hex::0x20-0x7e 46 | CompConversion alt::hex::0x20||shift::hex::0x20 47 | StickyKey ; -------------------------------------------------------------------------------- /src/engine/editor/SKKCandidateEditor.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKCandidateEditor_h 24 | #define SKKCandidateEditor_h 25 | 26 | #include "SKKBaseEditor.h" 27 | #include "SKKEntry.h" 28 | #include "SKKCandidate.h" 29 | 30 | class SKKCandidateEditor : public SKKBaseEditor { 31 | SKKEntry entry_; 32 | SKKCandidate candidate_; 33 | 34 | void update(); 35 | 36 | public: 37 | SKKCandidateEditor(SKKInputContext* context); 38 | 39 | virtual void ReadContext(); 40 | virtual void WriteContext(); 41 | virtual void Commit(std::string& queue); 42 | 43 | void SetCandidate(const SKKCandidate& candidate); 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /platform/mac/src/server/MacInputModeWindow.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef MacInputModeWindow_h 24 | #define MacInputModeWindow_h 25 | 26 | #include "SKKInputModeListener.h" 27 | 28 | class SKKLayoutManager; 29 | 30 | @class InputModeWindow; 31 | @class SKKModeTips; 32 | 33 | class MacInputModeWindow : public SKKInputModeListener { 34 | SKKModeTips* tips_; 35 | 36 | bool enabled() const; 37 | 38 | virtual void SKKWidgetShow(); 39 | virtual void SKKWidgetHide(); 40 | 41 | public: 42 | MacInputModeWindow(SKKLayoutManager* layout); 43 | ~MacInputModeWindow(); 44 | 45 | virtual void SelectInputMode(SKKInputMode mode); 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/engine/state/SKKStateRecursiveRegister-inl.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | // ====================================================================== 24 | // level 1:単語登録 25 | // ====================================================================== 26 | State SKKState::RecursiveRegister(const Event& event) { 27 | switch(event) { 28 | case ENTRY_EVENT: 29 | editor_->SetStateRegistration(); 30 | messenger_->Beep(); 31 | return 0; 32 | 33 | case SKK_ENTER: 34 | return State::Transition(&SKKState::KanaInput); 35 | 36 | case SKK_CANCEL: 37 | return State::DeepHistory(&SKKState::Composing); 38 | } 39 | 40 | return &SKKState::TopState; 41 | } 42 | -------------------------------------------------------------------------------- /platform/mac/src/gui/InputModeWindow.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef InputModeWindow_h 24 | #define InputModeWindow_h 25 | 26 | #include "SKKInputMode.h" 27 | #include 28 | 29 | @interface InputModeWindow : NSObject { 30 | NSWindow* window_; 31 | SKKInputMode inputMode_; 32 | NSDictionary* modeIcons_; 33 | CALayer* rootLayer_; 34 | CABasicAnimation* animation_; 35 | } 36 | 37 | + (InputModeWindow*)sharedWindow; 38 | - (void)setModeIcons:(NSDictionary*)icons; 39 | - (void)changeMode:(SKKInputMode)mode; 40 | - (SKKInputMode)currentInputMode; 41 | - (void)showAt:(NSPoint)topleft level:(int)level; 42 | - (void)hide; 43 | 44 | @end 45 | 46 | #endif 47 | 48 | -------------------------------------------------------------------------------- /platform/mac/src/server/MacKotoeriDictionary.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2002 phonohawk 6 | Copyright (C) 2005-2010 Tomotaka SUWA 7 | 8 | This program is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 2 of the License, or 11 | any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | 22 | */ 23 | /* 24 | Directory Maneger対応 2002.09.25 Shin_ichi Abe. 25 | */ 26 | 27 | #ifndef MacKotoeriDictionary_h 28 | #define MacKotoeriDictionary_h 29 | 30 | #include "SKKBaseDictionary.h" 31 | 32 | class KotoeriImpl; 33 | 34 | class MacKotoeriDictionary : public SKKBaseDictionary { 35 | std::auto_ptr impl_; 36 | 37 | public: 38 | MacKotoeriDictionary(); 39 | virtual ~MacKotoeriDictionary(); 40 | 41 | virtual void Initialize(const std::string& location); 42 | 43 | virtual void Find(const SKKEntry& entry, SKKCandidateSuite& result); 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /platform/mac/src/gui/CandidateView.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef CandidateView_h 24 | #define CandidateView_h 25 | 26 | #include 27 | 28 | @class CandidatePageIndicator; 29 | 30 | @interface CandidateView : NSView { 31 | NSMutableArray* candidateCells_; 32 | CandidatePageIndicator* indicator_; 33 | NSFont* cellFont_; 34 | NSString* labels_; 35 | int selected_; 36 | } 37 | 38 | + (unsigned)cellSpacing; 39 | 40 | - (void)prepareWithFont:(NSFont*)font labels:(NSString*)labels; 41 | - (NSSize)contentSize; 42 | - (void)setCandidates:(NSArray*)candidates selectedIndex:(int)cursor; 43 | - (void)setPage:(NSRange)page; 44 | - (id)newCandidateCell; 45 | 46 | @end 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/bridge/SKKFrontEnd.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKFrontEnd_h 24 | #define SKKFrontEnd_h 25 | 26 | #include 27 | 28 | // クライアントインタフェース 29 | class SKKFrontEnd { 30 | public: 31 | virtual ~SKKFrontEnd() {} 32 | 33 | // 確定文字入力 34 | virtual void InsertString(const std::string& str) = 0; 35 | 36 | // 未確定文字入力(カーソル位置は末尾からのオフセット) 37 | virtual void ComposeString(const std::string& str, int cursorOffset = 0) = 0; 38 | 39 | // 未確定文字入力 40 | // candidateStart=変換候補の開始位置, candidateLength=変換候補の長さ 41 | virtual void ComposeString(const std::string& str, int candidateStart, int candidateLength) = 0; 42 | 43 | // 選択中の文字列 44 | virtual std::string SelectedString() = 0; 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/engine/state/SKKStateMachine.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKStateMachine_h 24 | #define SKKStateMachine_h 25 | 26 | #include "SKKState.h" 27 | 28 | #ifndef SKK_DEBUG 29 | typedef GenericStateMachine SKKStateMachine; 30 | #else 31 | 32 | #include 33 | 34 | template 35 | struct DebugInspector { 36 | std::string buf_; 37 | 38 | public: 39 | void operator()(const Handler handler, const Event& event) { 40 | if(event == 0) return; 41 | 42 | SKKState::ToString(handler, event, buf_); 43 | 44 | std::cout << buf_ << std::endl; 45 | } 46 | }; 47 | 48 | typedef GenericStateMachine SKKStateMachine; 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /platform/mac/src/gui/CandidateWindow.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef CandidateWindow_h 24 | #define CandidateWindow_h 25 | 26 | #include 27 | 28 | @class CandidateView; 29 | 30 | @interface CandidateWindow : NSObject { 31 | NSWindow* window_; 32 | CandidateView* view_; 33 | NSString* labels_; 34 | } 35 | 36 | + (CandidateWindow*)sharedWindow; 37 | - (NSWindow*)window; 38 | - (void)prepareWithFont:(NSFont*)font labels:(NSString*)labels; 39 | - (void)setCandidates:(NSArray*)candidates selectedIndex:(int)cursor; 40 | - (void)setPage:(NSRange)page; 41 | - (void)showAt:(NSPoint)origin level:(int)level; 42 | - (void)hide; 43 | - (int)indexOfLabel:(char)label; 44 | - (id)newCandidateCell; 45 | 46 | @end 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /platform/mac/src/server/MacAnnotator.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef MacAnnotator_h 24 | #define MacAnnotator_h 25 | 26 | #include "SKKAnnotator.h" 27 | #include "SKKLayoutManager.h" 28 | 29 | @class AnnotationWindow; 30 | 31 | class MacAnnotator : public SKKAnnotator { 32 | SKKLayoutManager* layout_; 33 | NSString* definition_; 34 | NSString* optional_; 35 | AnnotationWindow* window_; 36 | SKKCandidate candidate_; 37 | int cursor_; 38 | 39 | void release(NSString*& str); 40 | 41 | virtual void SKKWidgetShow(); 42 | virtual void SKKWidgetHide(); 43 | 44 | public: 45 | MacAnnotator(SKKLayoutManager* layout); 46 | 47 | virtual void Update(const SKKCandidate& candidate, int cursorOffset); 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/engine/session/SKKInputModeSelector.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2009 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKInputModeSelector_h 24 | #define SKKInputModeSelector_h 25 | 26 | #include 27 | #include "SKKWidget.h" 28 | #include "SKKInputMode.h" 29 | #include "SKKInputModeListener.h" 30 | 31 | class SKKInputModeSelector : public SKKWidget { 32 | SKKInputModeListenerCollection* listeners_; 33 | SKKInputMode mode_; 34 | bool needsUpdate_; 35 | 36 | virtual void SKKWidgetShow(); 37 | virtual void SKKWidgetHide(); 38 | 39 | public: 40 | SKKInputModeSelector(SKKInputModeListenerCollection* listeners); 41 | 42 | void Select(SKKInputMode mode); 43 | void Notify(); 44 | void Refresh(); 45 | 46 | operator SKKInputMode() const; 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "Icon-16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "Icon-16@2x.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "Icon-32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "Icon-32@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "Icon-128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "Icon-128@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "Icon-256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "Icon-256@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "Icon-512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "Icon-512@2x.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /platform/mac/src/server/SKKInputController.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2007-2013 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKInputController_h 24 | #define SKKInputController_h 25 | 26 | #import 27 | #include "SKKInputMenu.h" 28 | #include "SKKServerProxy.h" 29 | #include "SKKInputMenu.h" 30 | 31 | class SKKLayoutManager; 32 | class SKKInputSession; 33 | class MacInputModeWindow; 34 | 35 | @interface SKKInputController : IMKInputController { 36 | id client_; 37 | NSTextInputContext* context_; 38 | BOOL activated_; 39 | 40 | SKKServerProxy* proxy_; 41 | SKKInputMenu* menu_; 42 | SKKLayoutManager* layout_; 43 | SKKInputSession* session_; 44 | MacInputModeWindow* modeIcon_; 45 | } 46 | @end 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /platform/mac/src/server/SKKInputMenu.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKInputMenu_h 24 | #define SKKInputMenu_h 25 | 26 | #include "SKKInputMode.h" 27 | #include 28 | 29 | @interface SKKInputMenu : NSObject { 30 | id client_; 31 | BOOL activation_; 32 | SKKInputMode currentInputMode_; 33 | } 34 | 35 | - (id)initWithClient:(id)client; 36 | - (void)updateMenu:(SKKInputMode)mode; 37 | - (NSString*)convertInputModeToId:(SKKInputMode)mode; 38 | - (int)convertIdToEventId:(NSString*)identifier; 39 | - (void)activation; 40 | - (void)deactivation; 41 | - (SKKInputMode)convertIdToInputMode:(NSString*)identifier; 42 | - (SKKInputMode)currentInputMode; 43 | - (SKKInputMode)unifiedInputMode; 44 | 45 | @end 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/engine/tests/MockInputSessionParameter.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | 3 | #ifndef MockInputSessionParameter_h 4 | #define MockInputSessionParameter_h 5 | 6 | #include "SKKInputSessionParameter.h" 7 | #include "MockConfig.h" 8 | #include "MockFrontEnd.h" 9 | #include "MockMessenger.h" 10 | #include "MockClipboard.h" 11 | #include "MockCandidateWindow.h" 12 | #include "MockAnnotator.h" 13 | #include "MockDynamicCompletor.h" 14 | 15 | class MockInputSessionParameter : public SKKInputSessionParameter { 16 | MockConfig config_; 17 | MockFrontEnd* frontend_; 18 | MockMessenger messenger_; 19 | MockClipboard clipboard_; 20 | MockCandidateWindow candidate_; 21 | MockAnnotator annotator_; 22 | MockDynamicCompletor completor_; 23 | 24 | public: 25 | MockInputSessionParameter() : frontend_(new MockFrontEnd()) {} 26 | 27 | virtual SKKConfig* Config() { return &config_; } 28 | virtual SKKFrontEnd* FrontEnd() { return frontend_; } 29 | virtual SKKMessenger* Messenger() { return &messenger_; } 30 | virtual SKKClipboard* Clipboard() { return &clipboard_; } 31 | virtual SKKCandidateWindow* CandidateWindow() { return &candidate_; } 32 | virtual SKKAnnotator* Annotator() { return &annotator_; } 33 | virtual SKKDynamicCompletor* DynamicCompletor() { return &completor_; } 34 | 35 | SKKInputModeListener* Listener() { return frontend_; } 36 | TestResult& Result() { return *frontend_; } 37 | void SetSelectedString(const std::string& str) { frontend_->SetSelectedString(str); } 38 | void SetYankString(const std::string& str) { clipboard_.SetString(str); } 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /platform/mac/src/server/SKKPreProcessor.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2007 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKPreProcessor_h 24 | #define SKKPreProcessor_h 25 | 26 | #include 27 | #include "SKKKeymap.h" 28 | 29 | // キー入力前処理クラス 30 | class SKKPreProcessor { 31 | SKKKeymap keymap_; 32 | 33 | SKKPreProcessor(); 34 | SKKPreProcessor(const SKKPreProcessor&); 35 | SKKPreProcessor& operator=(const SKKPreProcessor&); 36 | 37 | public: 38 | // シングルトン 39 | static SKKPreProcessor& theInstance(); 40 | 41 | // キーマップのロード 42 | void Initialize(const std::string& path); 43 | 44 | // キーマップの追加ロード 45 | void Patch(const std::string& path); 46 | 47 | // NSEvent → SKKEvent 変換 48 | SKKEvent Execute(const NSEvent* event); 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/engine/session/SKKInputContext.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2009 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKInputContext_h 24 | #define SKKInputContext_h 25 | 26 | #include "SKKOutputBuffer.h" 27 | #include "SKKEntry.h" 28 | #include "SKKCandidate.h" 29 | #include "SKKUndoContext.h" 30 | #include "SKKRegistration.h" 31 | 32 | // 入力コンテキスト 33 | class SKKInputContext { 34 | public: 35 | SKKEntry entry; 36 | SKKCandidate candidate; 37 | SKKOutputBuffer output; 38 | SKKUndoContext undo; 39 | SKKRegistration registration; 40 | 41 | bool event_handled; 42 | bool needs_setback; 43 | bool dynamic_completion; 44 | bool annotation; 45 | 46 | SKKInputContext(SKKFrontEnd* frontend) 47 | : output(frontend), undo(frontend), dynamic_completion(false) {} 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/engine/editor/SKKComposingEditor.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKComposingEditor_h 24 | #define SKKComposingEditor_h 25 | 26 | #include "SKKBaseEditor.h" 27 | #include "SKKTextBuffer.h" 28 | 29 | class SKKComposingEditor : public SKKBaseEditor { 30 | SKKTextBuffer composing_; 31 | 32 | void update(); 33 | 34 | public: 35 | SKKComposingEditor(SKKInputContext* context); 36 | 37 | virtual void ReadContext(); 38 | virtual void WriteContext(); 39 | virtual void Input(const std::string& ascii); 40 | virtual void Input(const std::string& fixed, const std::string& input, char code); 41 | virtual void Input(Event event); 42 | virtual void Commit(std::string& queue); 43 | 44 | void SetEntry(const std::string& entry); 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/engine/keymap/SKKKeymap.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2007 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKKeymap_h 24 | #define SKKKeymap_h 25 | 26 | #include 27 | #include 28 | #include "SKKEvent.h" 29 | 30 | // キーマップ 31 | class SKKKeymap { 32 | typedef std::map Keymap; 33 | 34 | Keymap events_; 35 | Keymap attributes_; 36 | Keymap option_; 37 | 38 | Keymap::iterator find(int charcode, int keycode, int mods, Keymap& keymap); 39 | void load(const std::string& path_to_config, bool initialize); 40 | 41 | public: 42 | // 初期化 43 | void Initialize(const std::string& path_to_config); 44 | 45 | // 追加の読み込み 46 | void Patch(const std::string& path_to_config); 47 | 48 | // 検索 49 | SKKEvent Fetch(int charcode, int keycode, int mods); 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/engine/dictionary/SKKProxyDictionary.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2006-2010 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKProxyDictionary_h 24 | #define SKKProxyDictionary_h 25 | 26 | #include "SKKBaseDictionary.h" 27 | #include "socketutil.h" 28 | 29 | // 外部 skkserv 辞書 30 | class SKKProxyDictionary: public SKKBaseDictionary { 31 | net::socket::endpoint remote_; 32 | net::socket::tcpstream session_; 33 | bool active_; 34 | 35 | bool connect(); 36 | bool send(const SKKEntry& entry); 37 | bool ready(); 38 | void recv(SKKCandidateSuite& result); 39 | 40 | public: 41 | SKKProxyDictionary(); 42 | virtual ~SKKProxyDictionary(); 43 | 44 | virtual void Initialize(const std::string& path); 45 | 46 | virtual void Find(const SKKEntry& entry, SKKCandidateSuite& result); 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/engine/session/SKKOutputBuffer.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2009 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKOutputBuffer_h 24 | #define SKKOutputBuffer_h 25 | 26 | #include 27 | 28 | class SKKFrontEnd; 29 | 30 | // 出力バッファ 31 | class SKKOutputBuffer { 32 | SKKFrontEnd* frontend_; 33 | std::string composing_; 34 | std::string last_; 35 | int cursor_; 36 | int mark_; 37 | int start_; 38 | int length_; 39 | 40 | public: 41 | SKKOutputBuffer(SKKFrontEnd* frontend); 42 | 43 | void Fix(const std::string& str); 44 | void Compose(const std::string& str, int cursor = 0); 45 | void Convert(const std::string& str); 46 | void Clear(); 47 | 48 | void SetMark(); 49 | int GetMark() const; 50 | 51 | void Output(); 52 | 53 | bool IsComposing() const; 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /platform/mac/src/preferences/DictionarySet.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2006-2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | */ 21 | 22 | #import 23 | 24 | @interface DictionarySet : NSArrayController { 25 | IBOutlet NSWindow* prefView; 26 | IBOutlet NSTableView* tableView; 27 | } 28 | 29 | - (IBAction)browseLocation:(id)sender; 30 | - (BOOL)tableView:(NSTableView*)tableView 31 | writeRowsWithIndexes:(NSIndexSet*)rowIndexes 32 | toPasteboard:(NSPasteboard*)pboard; 33 | - (NSDragOperation)tableView:(NSTableView*)tableView 34 | validateDrop:(id )info 35 | proposedRow:(int)row 36 | proposedDropOperation:(NSTableViewDropOperation)op; 37 | - (BOOL)tableView:(NSTableView*)tableView 38 | acceptDrop:(id )info 39 | row:(int)row 40 | dropOperation:(NSTableViewDropOperation)op; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /src/bridge/SKKInputSessionParameter.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKInputSessionParameter_h 24 | #define SKKInputSessionParameter_h 25 | 26 | class SKKConfig; 27 | class SKKFrontEnd; 28 | class SKKMessenger; 29 | class SKKClipboard; 30 | class SKKCandidateWindow; 31 | class SKKAnnotator; 32 | class SKKDynamicCompletor; 33 | 34 | class SKKInputSessionParameter { 35 | public: 36 | virtual ~SKKInputSessionParameter() {} 37 | 38 | virtual SKKConfig* Config() = 0; 39 | virtual SKKFrontEnd* FrontEnd() = 0; 40 | virtual SKKMessenger* Messenger() = 0; 41 | virtual SKKClipboard* Clipboard() = 0; 42 | virtual SKKCandidateWindow* CandidateWindow() = 0; 43 | virtual SKKAnnotator* Annotator() = 0; 44 | virtual SKKDynamicCompletor* DynamicCompletor() = 0; 45 | }; 46 | 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /src/engine/tests/TestResult.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | 3 | #ifndef TestResult_h 4 | #define TestResult_h 5 | 6 | #include "SKKInputMode.h" 7 | #include 8 | #include 9 | 10 | // SKKInputSession テスト用のテスト結果 11 | struct TestResult { 12 | std::string fixed; 13 | std::string marked; 14 | SKKInputMode mode; 15 | int pos; 16 | bool ret; 17 | 18 | TestResult() : mode(InvalidInputMode), pos(0), ret(true) {} 19 | TestResult(const std::string& fixed, 20 | const std::string& marked, 21 | SKKInputMode mode = InvalidInputMode, 22 | bool ret = true, 23 | int pos = 0) 24 | : fixed(fixed), marked(marked), mode(mode), pos(pos), ret(ret) {} 25 | 26 | void Clear() { 27 | fixed = marked = ""; 28 | pos = 0; 29 | } 30 | 31 | void Dump(const std::string& msg) { 32 | std::cerr << msg 33 | << "fixed=" << fixed << ", " 34 | << "marked=" << marked << ", " 35 | << "pos=" << pos << ", " 36 | << "mode=" << mode << ", " 37 | << "ret=" << ret << ", " 38 | << std::endl; 39 | } 40 | 41 | friend bool operator==(const TestResult& left, const TestResult& right) { 42 | return left.fixed == right.fixed 43 | && left.marked == right.marked 44 | && left.mode == right.mode 45 | && left.pos == right.pos 46 | && left.ret == right.ret; 47 | } 48 | 49 | friend bool operator!=(const TestResult& left, const TestResult& right) { 50 | return !(left == right); 51 | } 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/engine/editor/SKKEntryRemoveEditor.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKEntryRemoveEditor_h 24 | #define SKKEntryRemoveEditor_h 25 | 26 | #include "SKKBaseEditor.h" 27 | #include "SKKEntry.h" 28 | #include "SKKCandidate.h" 29 | 30 | class SKKEntryRemoveEditor : public SKKBaseEditor { 31 | std::string input_; 32 | std::string prompt_; 33 | SKKEntry entry_; 34 | SKKCandidate candidate_; 35 | 36 | public: 37 | SKKEntryRemoveEditor(SKKInputContext* context); 38 | 39 | virtual void ReadContext(); 40 | virtual void WriteContext(); 41 | virtual void Input(const std::string& ascii); 42 | virtual void Input(const std::string& fixed, const std::string& input, char code); 43 | virtual void Input(Event event); 44 | virtual void Commit(std::string& queue); 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /platform/mac/src/server/MacConfig.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2009 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef MacConfig_h 24 | #define MacConfig_h 25 | 26 | #include "SKKConfig.h" 27 | 28 | class MacConfig : public SKKConfig { 29 | int integerConfig(NSString* key); 30 | bool boolConfig(NSString* key); 31 | 32 | public: 33 | MacConfig(); 34 | 35 | virtual bool FixIntermediateConversion(); 36 | virtual bool EnableDynamicCompletion(); 37 | virtual int DynamicCompletionRange(); 38 | virtual bool EnableAnnotation(); 39 | virtual bool DisplayShortestMatchOfKanaConversions(); 40 | virtual bool SuppressNewlineOnCommit(); 41 | virtual int MaxCountOfInlineCandidates(); 42 | virtual bool HandleRecursiveEntryAsOkuri(); 43 | virtual bool InlineBackSpaceImpliesCommit(); 44 | virtual bool DeleteOkuriWhenQuit(); 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/engine/selector/SKKBaseSelector.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKBaseSelector_h 24 | #define SKKBaseSelector_h 25 | 26 | #include "SKKCandidate.h" 27 | #include "subrange.h" 28 | 29 | // 基底候補選択クラス 30 | class SKKBaseSelector { 31 | public: 32 | typedef subrange Range; 33 | typedef Range::iterator RangeIterator; 34 | 35 | virtual ~SKKBaseSelector() {} 36 | 37 | // 候補移動 38 | virtual bool Next() = 0; 39 | virtual bool Prev() = 0; 40 | 41 | // 現在の候補 42 | virtual const SKKCandidate& Current() const = 0; 43 | 44 | // 選択可能な候補があるかどうか 45 | virtual bool IsEmpty() const = 0; 46 | 47 | // カーソル移動 48 | virtual void CursorLeft() {} 49 | virtual void CursorRight() {} 50 | virtual void CursorUp() {} 51 | virtual void CursorDown() {} 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /platform/mac/src/server/SKKLayoutManager.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2009 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKLayoutManager_h 24 | #define SKKLayoutManager_h 25 | 26 | #include 27 | #include 28 | 29 | class SKKLayoutManager { 30 | id client_; 31 | 32 | BOOL putUpward() const; 33 | NSRect inputFrame(int index) const; 34 | NSRect screenFrame(const NSRect& input) const; 35 | NSPoint fit(const NSRect& screen, const NSRect& window) const; 36 | int margin() const; 37 | 38 | public: 39 | SKKLayoutManager(id client); 40 | 41 | // 入力位置の原点 42 | NSPoint InputOrigin(int index = 0) const; 43 | 44 | // 各ウィンドウ向け原点 45 | NSPoint CandidateWindowOrigin() const; 46 | NSPoint AnnotationWindowOrigin(int mark) const; 47 | 48 | int WindowLevel() const; 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /data/config/keymap.conf: -------------------------------------------------------------------------------- 1 | ### 2 | ### keymap.conf 3 | ### 4 | 5 | # ====================================================================== 6 | # event section 7 | # ====================================================================== 8 | 9 | SKK_JMODE ctrl::j 10 | SKK_ENTER group::hex::0x03,0x0a,0x0d||ctrl::m 11 | SKK_CANCEL ctrl::g||hex::0x1b 12 | SKK_BACKSPACE hex::0x08||ctrl::h 13 | SKK_DELETE hex::0x7f||ctrl::d 14 | SKK_TAB hex::0x09||ctrl::i 15 | SKK_PASTE ctrl::y 16 | SKK_LEFT hex::0x1c||ctrl::b||keycode::7b 17 | SKK_RIGHT hex::0x1d||ctrl::f||keycode::7c 18 | SKK_UP hex::0x1e||ctrl::a||keycode::7e 19 | SKK_DOWN hex::0x1f||ctrl::e||keycode::7d 20 | SKK_PING ctrl::l 21 | SKK_UNDO ctrl::/ 22 | 23 | # ====================================================================== 24 | # attribute section(for SKK_CHAR) 25 | # ====================================================================== 26 | 27 | ToggleKana q 28 | ToggleJisx0201Kana ctrl::q 29 | SwitchToAscii l 30 | SwitchToJisx0208Latin L 31 | 32 | EnterAbbrev / 33 | EnterJapanese Q 34 | NextCompletion . 35 | PrevCompletion , 36 | NextCandidate hex::0x20||ctrl::n 37 | PrevCandidate x||ctrl::p 38 | RemoveTrigger X 39 | 40 | UpperCases group::A-K,M-P,R-Z 41 | Direct group::keycode::0x41,0x43,0x45,0x4b,0x4e,0x51-0x59,0x5b,0x5c,0x5f 42 | InputChars group::hex::0x20-0x7e 43 | 44 | CompConversion alt::hex::0x20||shift::hex::0x20 45 | 46 | # ====================================================================== 47 | # handle option 48 | # ====================================================================== 49 | 50 | AlwaysHandled group::keycode::0x66,0x68 51 | PseudoHandled ctrl::l 52 | -------------------------------------------------------------------------------- /platform/mac/src/server/MacDynamicCompletor.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef MacDynamicCompletor_h 24 | #define MacDynamicCompletor_h 25 | 26 | #include "SKKDynamicCompletor.h" 27 | #include "SKKLayoutManager.h" 28 | 29 | @class CompletionWindow; 30 | 31 | class MacDynamicCompletor : public SKKDynamicCompletor { 32 | SKKLayoutManager* layout_; 33 | CompletionWindow* window_; 34 | std::string completion_; 35 | int commonPrefixLength_; 36 | int cursorOffset_; 37 | 38 | NSAttributedString* makeAttributedString(); 39 | 40 | virtual void SKKWidgetShow(); 41 | virtual void SKKWidgetHide(); 42 | 43 | public: 44 | MacDynamicCompletor(SKKLayoutManager* layout); 45 | 46 | virtual void Update(const std::string& completion, 47 | int commonPrefixLength, int cursorOffset); 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /platform/mac/src/server/MacFrontEnd.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef MacFrontEnd_h 24 | #define MacFrontEnd_h 25 | 26 | #include 27 | #include "SKKFrontEnd.h" 28 | 29 | class MacFrontEnd : public SKKFrontEnd { 30 | id client_; 31 | 32 | NSRange notFound() const; 33 | NSMutableAttributedString* createMarkedText(const std::string& str, int cursorOffset); 34 | 35 | void workaroundForBlacklistApp(NSString* string); 36 | bool isBlacklistApp() const; 37 | 38 | public: 39 | MacFrontEnd(id client); 40 | 41 | virtual void InsertString(const std::string& str); 42 | virtual void ComposeString(const std::string& str, int cursorOffset = 0); 43 | virtual void ComposeString(const std::string& str, int candidateStart, int candidateLength); 44 | virtual std::string SelectedString(); 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/bridge/SKKCandidateWindow.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKCandidateWindow_h 24 | #define SKKCandidateWindow_h 25 | 26 | #include 27 | #include "SKKWidget.h" 28 | #include "SKKCandidate.h" 29 | 30 | class SKKCandidateWindow : public SKKWidget { 31 | public: 32 | virtual ~SKKCandidateWindow() {} 33 | 34 | // 各ページ毎に表示可能な候補数を求める 35 | virtual void Setup(SKKCandidateIterator begin, SKKCandidateIterator end, std::vector& pages) = 0; 36 | 37 | // 更新 38 | // 39 | // begin,end=候補の範囲 40 | // cursor=カーソル位置 41 | // page_pos=現在ページ位置 42 | // page_max=全ページ数 43 | virtual void Update(SKKCandidateIterator begin, SKKCandidateIterator end, 44 | int cursor, int page_pos, int page_max) = 0; 45 | 46 | // 候補ラベルのインデックス取得(一致しない場合には -1) 47 | virtual int LabelIndex(char label) = 0; 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/bridge/SKKWidget.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKWidget_h 24 | #define SKKWidget_h 25 | 26 | // ユーザーインタフェース用基底クラス 27 | class SKKWidget { 28 | bool visible_; 29 | 30 | // 派生クラスで実装すべきメソッド(NVI パターン) 31 | virtual void SKKWidgetShow() = 0; 32 | virtual void SKKWidgetHide() = 0; 33 | 34 | public: 35 | SKKWidget(bool visible = false) : visible_(visible) {} 36 | virtual ~SKKWidget() {} 37 | 38 | void Show() { 39 | visible_ = true; 40 | SKKWidgetShow(); 41 | } 42 | 43 | void Hide() { 44 | visible_ = false; 45 | SKKWidgetHide(); 46 | } 47 | 48 | void Activate() { 49 | if(visible_) { 50 | SKKWidgetShow(); 51 | } 52 | } 53 | 54 | void Deactivate() { 55 | if(visible_) { 56 | SKKWidgetHide(); 57 | } 58 | } 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /src/engine/tests/stringutil_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include "stringutil.h" 2 | #include 3 | #include 4 | #include 5 | 6 | int main() { 7 | string::splitter splitter; 8 | std::string str; 9 | 10 | splitter.split("a,b,c,d"); 11 | 12 | assert(splitter >> str && str == "a"); 13 | assert(splitter >> str && str == "b"); 14 | assert(splitter >> str && str == "c"); 15 | assert(splitter >> str && str == "d"); 16 | assert(!(splitter >> str)); 17 | 18 | splitter.split("abc::def::ghi", "::"); 19 | 20 | assert(splitter >> str && str == "abc"); 21 | assert(splitter >> str && str == "def"); 22 | assert(splitter >> str && str == "ghi"); 23 | assert(!(splitter >> str)); 24 | 25 | splitter.split("::abc:,def:,ghi::", "::"); 26 | assert(splitter >> str && str == "abc:,def:,ghi"); 27 | assert(!(splitter >> str)); 28 | 29 | splitter.split("abc def", " "); 30 | assert(splitter >> str && str == "abc"); 31 | assert(splitter >> str && str == "def"); 32 | assert(!(splitter >> str)); 33 | 34 | str = "begin%20%20first%2second%0third20%end"; 35 | string::translate(str, "%20", " "); 36 | assert(str == "begin first%2second%0third20%end"); 37 | 38 | std::vector a; 39 | 40 | a.push_back("abc"); 41 | a.push_back("def"); 42 | a.push_back("ghi"); 43 | a.push_back("jkl"); 44 | 45 | assert(string::join(a) == "abc def ghi jkl"); 46 | assert(string::join(a, "/") == "abc/def/ghi/jkl"); 47 | 48 | splitter.split("abc 123 3.14"); 49 | int ivalue; 50 | double dvalue; 51 | assert(splitter >> str && str == "abc"); 52 | assert(splitter >> ivalue && ivalue == 123); 53 | assert(splitter >> dvalue && dvalue == 3.14); 54 | } 55 | -------------------------------------------------------------------------------- /src/engine/editor/SKKTextBuffer.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKTextBuffer_h 24 | #define SKKTextBuffer_h 25 | 26 | #include 27 | 28 | // カーソル移動をサポートするテキストバッファ 29 | class SKKTextBuffer { 30 | std::string buf_; 31 | int cursor_; 32 | 33 | int minCursorPosition() const; 34 | int maxCursorPosition() const; 35 | 36 | public: 37 | SKKTextBuffer(); 38 | 39 | void Insert(const std::string& str); 40 | void BackSpace(); 41 | void Delete(); 42 | void Clear(); 43 | 44 | void CursorLeft(); 45 | void CursorRight(); 46 | void CursorUp(); 47 | void CursorDown(); 48 | 49 | int CursorPosition() const; 50 | 51 | bool IsEmpty() const; 52 | 53 | bool operator==(const std::string& str) const; 54 | 55 | std::string String() const; 56 | std::string LeftString() const; 57 | std::string RightString() const; 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /platform/mac/proj/AquaSKK.pmdoc/01aquaskk.xml: -------------------------------------------------------------------------------- 1 | jp.sourceforge.aquaskk.pkg1build/Release/AquaSKK.app/Library/Input Methodsparentscripts.scriptsDirectoryPath.isRelativeTypescripts.postinstall.isRelativeTypepostInstallinstallTo.isAbsoluteTypeinstallTo.isRelativeTyperelocatableinstallFrom.isRelativeTypeinstallTo.pathinstallToidentifierscript/postflightscript01aquaskk-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ -------------------------------------------------------------------------------- /src/engine/dictionary/SKKDistributedUserDictionary.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2010 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKDistributedUserDictionary_h 24 | #define SKKDistributedUserDictionary_h 25 | 26 | #include "SKKUserDictionary.h" 27 | #include "socketutil.h" 28 | 29 | class SKKDistributedUserDictionary : public SKKUserDictionary { 30 | net::socket::tcpstream server_; 31 | 32 | public: 33 | // path の形式は port 34 | virtual void Initialize(const std::string& path); 35 | 36 | virtual void Find(const SKKEntry& entry, SKKCandidateSuite& result); 37 | virtual std::string ReverseLookup(const std::string& candidate); 38 | virtual void Complete(SKKCompletionHelper& helper); 39 | 40 | virtual void Register(const SKKEntry& entry, const SKKCandidate& candidate); 41 | virtual void Remove(const SKKEntry& entry, const SKKCandidate& candidate); 42 | 43 | virtual void SetPrivateMode(bool flag); 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /platform/mac/src/preferences/PathFormatter.mm: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | */ 21 | 22 | #include "PathFormatter.h" 23 | 24 | @implementation PathFormatter 25 | 26 | - (NSString*)stringForObjectValue:(id)object { 27 | if(![object isKindOfClass:[NSString class]]) { 28 | return nil; 29 | } 30 | 31 | return [object stringByAbbreviatingWithTildeInPath]; 32 | } 33 | 34 | - (BOOL)getObjectValue:(id*)objptr 35 | forString:(NSString*)string 36 | errorDescription:(NSString**)error { 37 | *objptr = [NSString stringWithString:string]; 38 | 39 | return YES; 40 | } 41 | 42 | - (NSAttributedString*)newAttributedStringForObjectValue:(id)object 43 | withDefaultAttributes:(NSDictionary*)attributes { 44 | return [[NSAttributedString alloc] initWithString:[self stringForObjectValue:object] 45 | attributes:attributes]; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /src/engine/editor/SKKRegisterEditor.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKRegisterFilter_h 24 | #define SKKRegisterFilter_h 25 | 26 | #include "SKKBaseEditor.h" 27 | #include "SKKEntry.h" 28 | #include "SKKTextBuffer.h" 29 | 30 | class SKKRegisterEditor : public SKKBaseEditor { 31 | std::string prompt_; 32 | SKKEntry entry_; 33 | SKKTextBuffer word_; 34 | 35 | SKKRegisterEditor(); 36 | SKKRegisterEditor(const SKKRegisterEditor&); 37 | SKKRegisterEditor& operator=(const SKKRegisterEditor&); 38 | 39 | public: 40 | SKKRegisterEditor(SKKInputContext* context); 41 | 42 | virtual void ReadContext(); 43 | virtual void WriteContext(); 44 | virtual void Input(const std::string& ascii); 45 | virtual void Input(const std::string& fixed, const std::string& input, char code); 46 | virtual void Input(Event event); 47 | virtual void Commit(std::string& queue); 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /platform/mac/src/server/MacMessenger.mm: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #include "MacMessenger.h" 24 | #include "MessengerWindow.h" 25 | #include "SKKConstVars.h" 26 | #include "SKKFrontEnd.h" 27 | #include "ObjCUtil.h" 28 | 29 | MacMessenger::MacMessenger(SKKLayoutManager* layout) : layout_(layout) {} 30 | 31 | void MacMessenger::SendMessage(const std::string& msg) { 32 | ObjC::RAIIPool pool; 33 | 34 | MessengerWindow* window = [MessengerWindow sharedWindow]; 35 | 36 | NSString* str = [NSString stringWithUTF8String:msg.c_str()]; 37 | NSPoint topleft = layout_->InputOrigin(); 38 | 39 | topleft.y -= 2; 40 | 41 | [window showMessage:str at:topleft level:layout_->WindowLevel()]; 42 | } 43 | 44 | void MacMessenger::Beep() { 45 | NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; 46 | 47 | if([defaults boolForKey:SKKUserDefaultKeys::beep_on_registration] == YES) { 48 | NSBeep(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/engine/session/SKKRegistration.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2009 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKRegistration_h 24 | #define SKKRegistration_h 25 | 26 | #include 27 | 28 | class SKKRegistration { 29 | public: 30 | enum State { None, Started, Finished, Aborted }; 31 | 32 | SKKRegistration() : state_(None) {} 33 | 34 | void Start() { 35 | state_ = Started; 36 | } 37 | 38 | void Finish(const std::string& str) { 39 | state_ = Finished; 40 | word_ = str; 41 | } 42 | 43 | void Abort() { 44 | state_ = Aborted; 45 | word_.clear(); 46 | } 47 | 48 | void Clear() { 49 | state_ = None; 50 | word_.clear(); 51 | } 52 | 53 | operator State() const { 54 | return state_; 55 | } 56 | 57 | const std::string& Word() const { 58 | return word_; 59 | } 60 | 61 | private: 62 | State state_; 63 | std::string word_; 64 | }; 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /src/engine/entry/SKKCandidate.cpp: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #include "SKKCandidate.h" 24 | 25 | static std::string org_table[] = { "[", "/", ";", "" }; 26 | static std::string enc_table[] = { "[5b]", "[2f]", "[3b]", "" }; 27 | 28 | static std::string translate(const std::string& str, const std::string* from, const std::string* to) { 29 | std::string result(str); 30 | 31 | for(int index = 0; !from[index].empty(); ++ index) { 32 | for(std::string::size_type pos = 0; 33 | (pos = result.find(from[index], pos)) != std::string::npos; 34 | pos += to[index].size()) { 35 | result.replace(pos, from[index].size(), to[index]); 36 | } 37 | } 38 | 39 | return result; 40 | } 41 | 42 | std::string SKKCandidate::Encode(const std::string& src) { 43 | return translate(src, org_table, enc_table); 44 | } 45 | 46 | std::string SKKCandidate::Decode(const std::string& src) { 47 | return translate(src, enc_table, org_table); 48 | } 49 | -------------------------------------------------------------------------------- /src/engine/backend/SKKDictionaryCache.cpp: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #include "SKKDictionaryCache.h" 24 | #include "SKKDictionaryFactory.h" 25 | #include "SKKBaseDictionary.h" 26 | 27 | namespace { 28 | struct DeleteDictionary { 29 | void operator()(const std::pair& entry) const { 30 | delete entry.second; 31 | } 32 | }; 33 | } 34 | 35 | SKKDictionaryCache::~SKKDictionaryCache() { 36 | std::for_each(cache_.begin(), cache_.end(), DeleteDictionary()); 37 | } 38 | 39 | SKKBaseDictionary* SKKDictionaryCache::Get(const SKKDictionaryKey& key) { 40 | if(cache_.find(key) == cache_.end()) { 41 | cache_[key] = SKKDictionaryFactory::theInstance().Create(key.first, key.second); 42 | } 43 | 44 | return cache_[key]; 45 | } 46 | 47 | void SKKDictionaryCache::Clear(const SKKDictionaryKey& key) { 48 | if(cache_.find(key) != cache_.end()) { 49 | delete cache_[key]; 50 | cache_.erase(key); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/engine/tests/SKKInputQueue_TEST.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "SKKInputQueue.h" 4 | #include "SKKRomanKanaConverter.h" 5 | 6 | class TestInputQueueObserver : public SKKInputQueueObserver { 7 | State state_; 8 | 9 | public: 10 | virtual void SKKInputQueueUpdate(const State& state) { 11 | state_.fixed += state.fixed; 12 | state_.queue = state.queue; 13 | } 14 | 15 | void Clear() { 16 | state_ = State(); 17 | } 18 | 19 | bool Test(const std::string& fixed, const std::string& queue) { 20 | return state_.fixed == fixed && state_.queue == queue; 21 | } 22 | 23 | void Dump() { 24 | std::cerr << "fixed=" << state_.fixed << ", queue=" << state_.queue << std::endl; 25 | } 26 | }; 27 | 28 | int main() { 29 | auto& converter = SKKRomanKanaConverter::theInstance(); 30 | converter.Initialize("kana-rule.conf"); 31 | 32 | TestInputQueueObserver observer; 33 | SKKInputQueue queue(&observer); 34 | 35 | queue.AddChar('a'); 36 | assert(observer.Test("あ", "")); 37 | 38 | observer.Clear(); 39 | queue.AddChar('k'); 40 | assert(observer.Test("", "k")); 41 | queue.AddChar('y'); 42 | assert(observer.Test("", "ky")); 43 | queue.RemoveChar(); 44 | assert(observer.Test("", "k")); 45 | queue.AddChar('i'); 46 | assert(observer.Test("き", "")); 47 | 48 | observer.Clear(); 49 | queue.AddChar('n'); 50 | assert(observer.Test("", "n")); 51 | queue.Terminate(); 52 | assert(observer.Test("ん", "")); 53 | 54 | queue.AddChar('n'); 55 | assert(queue.CanConvert('i')); 56 | 57 | queue.Terminate(); 58 | observer.Clear(); 59 | queue.AddChar('o'); 60 | queue.AddChar('w'); 61 | queue.AddChar('s'); 62 | queue.AddChar('a'); 63 | assert(observer.Test("おさ", "")); 64 | } 65 | -------------------------------------------------------------------------------- /platform/mac/src/server/SKKServerProxy.mm: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #include "SKKServerProxy.h" 24 | 25 | @implementation SKKServerProxy 26 | 27 | - (id)init { 28 | self = [super init]; 29 | 30 | proxy_ = [[NSConnection 31 | rootProxyForConnectionWithRegisteredName:SKKSupervisorConnectionName 32 | host:nil] retain]; 33 | [proxy_ setProtocolForProxy:@protocol(SKKSupervisor)]; 34 | 35 | return self; 36 | } 37 | 38 | - (void)dealloc { 39 | [proxy_ release]; 40 | [super dealloc]; 41 | } 42 | 43 | - (void)reloadBlacklistApps { 44 | [proxy_ reloadBlacklistApps]; 45 | } 46 | 47 | - (void)reloadUserDefaults { 48 | [proxy_ reloadUserDefaults]; 49 | } 50 | 51 | - (void)reloadDictionarySet { 52 | [proxy_ reloadDictionarySet]; 53 | } 54 | 55 | - (void)reloadComponents { 56 | [proxy_ reloadComponents]; 57 | } 58 | 59 | - (NSArray*)createDictionaryTypes { 60 | return [proxy_ createDictionaryTypes]; 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /src/engine/completer/SKKCompleter.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKCompleter_h 24 | #define SKKCompleter_h 25 | 26 | #include 27 | #include 28 | 29 | // 補完サポートクラス 30 | struct SKKCompleterBuddy { 31 | virtual ~SKKCompleterBuddy() {} 32 | 33 | // 見出し語の取得 34 | virtual const std::string SKKCompleterQueryString() = 0; 35 | 36 | // 現在の見出し語の通知 37 | virtual void SKKCompleterUpdate(const std::string& entry) = 0; 38 | }; 39 | 40 | class SKKCompleter { 41 | SKKCompleterBuddy* buddy_; 42 | std::vector completions_; 43 | int pos_; 44 | 45 | bool complete(int limit); 46 | void notify(); 47 | int minPosition() const; 48 | int maxPosition() const; 49 | 50 | public: 51 | SKKCompleter(SKKCompleterBuddy* buddy); 52 | 53 | // 見出し語の補完 54 | bool Execute(int limit = 0); 55 | 56 | // 補完候補の削除 57 | bool Remove(); 58 | 59 | // 移動 60 | void Next(); 61 | void Prev(); 62 | }; 63 | 64 | #endif 65 | 66 | -------------------------------------------------------------------------------- /src/engine/editor/SKKOkuriEditor.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKOkuriEditor_h 24 | #define SKKOkuriEditor_h 25 | 26 | #include "SKKBaseEditor.h" 27 | 28 | class SKKOkuriListener { 29 | public: 30 | virtual ~SKKOkuriListener() {} 31 | 32 | virtual void SKKOkuriListenerAppendEntry(const std::string& fixed) = 0; 33 | }; 34 | 35 | class SKKOkuriEditor : public SKKBaseEditor { 36 | SKKOkuriListener* listener_; 37 | bool first_; 38 | std::string prefix_; 39 | std::string okuri_; 40 | std::string input_; 41 | 42 | void update(); 43 | 44 | public: 45 | SKKOkuriEditor(SKKInputContext* context, SKKOkuriListener* listener); 46 | 47 | virtual void ReadContext(); 48 | virtual void WriteContext(); 49 | virtual void Input(const std::string& fixed, const std::string& input, char code); 50 | virtual void Input(SKKBaseEditor::Event event); 51 | virtual void Commit(std::string& queue); 52 | 53 | bool IsOkuriComplete() const; 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/engine/session/SKKInputEnvironment.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2009 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKInputEnvironment_h 24 | #define SKKInputEnvironment_h 25 | 26 | #include "SKKInputContext.h" 27 | #include "SKKInputSessionParameter.h" 28 | #include "SKKInputModeSelector.h" 29 | #include "SKKBaseEditor.h" 30 | #include 31 | 32 | class SKKInputEnvironment { 33 | SKKInputContext* context_; 34 | SKKInputSessionParameter* param_; 35 | SKKInputModeSelector selector_; 36 | std::auto_ptr bottom_; 37 | 38 | public: 39 | SKKInputEnvironment(SKKInputContext* context, 40 | SKKInputSessionParameter* param, 41 | SKKInputModeListenerCollection* listeners, 42 | SKKBaseEditor* bottom); 43 | 44 | SKKConfig* Config(); 45 | SKKInputContext* InputContext(); 46 | SKKInputSessionParameter* InputSessionParameter(); 47 | SKKInputModeSelector* InputModeSelector(); 48 | SKKBaseEditor* BaseEditor(); 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/engine/session/SKKInputEnvironment.cpp: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2009 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #include "SKKInputEnvironment.h" 24 | 25 | SKKInputEnvironment::SKKInputEnvironment(SKKInputContext* context, 26 | SKKInputSessionParameter* param, 27 | SKKInputModeListenerCollection* listeners, 28 | SKKBaseEditor* bottom) 29 | : context_(context) 30 | , param_(param) 31 | , selector_(listeners) 32 | , bottom_(bottom) 33 | {} 34 | 35 | SKKConfig* SKKInputEnvironment::Config() { 36 | return param_->Config(); 37 | } 38 | 39 | SKKInputContext* SKKInputEnvironment::InputContext() { 40 | return context_; 41 | } 42 | 43 | SKKInputSessionParameter* SKKInputEnvironment::InputSessionParameter() { 44 | return param_; 45 | } 46 | 47 | SKKInputModeSelector* SKKInputEnvironment::InputModeSelector() { 48 | return &selector_; 49 | } 50 | 51 | SKKBaseEditor* SKKInputEnvironment::BaseEditor() { 52 | return bottom_.get(); 53 | } 54 | -------------------------------------------------------------------------------- /src/engine/selector/SKKInlineSelector.cpp: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #include "SKKInlineSelector.h" 24 | #include 25 | 26 | void SKKInlineSelector::Initialize(SKKCandidateContainer& container, unsigned inlineCount) { 27 | range_.set(container, 0, inlineCount); 28 | pos_ = 0; 29 | } 30 | 31 | bool SKKInlineSelector::Next() { 32 | if(IsEmpty() || pos_ == maxPosition()) { 33 | return false; 34 | } 35 | 36 | ++ pos_; 37 | return true; 38 | } 39 | 40 | bool SKKInlineSelector::Prev() { 41 | if(IsEmpty() || pos_ == minPosition()) { 42 | return false; 43 | } 44 | 45 | -- pos_; 46 | return true; 47 | } 48 | 49 | const SKKCandidate& SKKInlineSelector::Current() const { 50 | assert(!IsEmpty()); 51 | 52 | return range_[pos_]; 53 | } 54 | 55 | bool SKKInlineSelector::IsEmpty() const { 56 | return range_.empty(); 57 | } 58 | 59 | int SKKInlineSelector::minPosition() const { 60 | return 0; 61 | } 62 | 63 | int SKKInlineSelector::maxPosition() const { 64 | return range_.size() - 1; 65 | } 66 | -------------------------------------------------------------------------------- /platform/mac/src/server/MacCandidateWindow.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef MacCandidateWindowMacOSX_h 24 | #define MacCandidateWindowMacOSX_h 25 | 26 | #include "SKKCandidateWindow.h" 27 | #include "SKKLayoutManager.h" 28 | 29 | @class CandidateWindow; 30 | 31 | class MacCandidateWindow : public SKKCandidateWindow { 32 | SKKLayoutManager* layout_; 33 | bool putUpward_; 34 | NSMutableArray* candidates_; 35 | NSRange page_; 36 | int cursor_; 37 | int cellCount_; 38 | CandidateWindow* window_; 39 | 40 | void reloadUserDefaults(); 41 | virtual void SKKWidgetShow(); 42 | virtual void SKKWidgetHide(); 43 | 44 | public: 45 | MacCandidateWindow(SKKLayoutManager* layout); 46 | virtual ~MacCandidateWindow(); 47 | 48 | virtual void Setup(SKKCandidateIterator begin, SKKCandidateIterator end, std::vector& pages); 49 | virtual void Update(SKKCandidateIterator begin, SKKCandidateIterator end, 50 | int cursor, int page_pos, int page_max); 51 | virtual int LabelIndex(char label); 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/engine/dictionary/SKKBaseDictionary.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2007-2010 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKBaseDictionary_h 24 | #define SKKBaseDictionary_h 25 | 26 | #include 27 | #include 28 | #include 29 | #include "SKKEntry.h" 30 | #include "SKKCandidateSuite.h" 31 | #include "SKKCompletionHelper.h" 32 | 33 | // ====================================================================== 34 | // 抽象辞書クラス(文字列は UTF-8) 35 | // ====================================================================== 36 | class SKKBaseDictionary { 37 | public: 38 | virtual ~SKKBaseDictionary() {}; 39 | 40 | // 辞書の初期化 41 | // 42 | // location の書式は各辞書の実装で定義する 43 | // 44 | virtual void Initialize(const std::string& location) = 0; 45 | 46 | // 候補検索 47 | virtual void Find(const SKKEntry& entry, SKKCandidateSuite& result) = 0; 48 | 49 | // 見出し語検索 50 | virtual std::string ReverseLookup(const std::string& candidate) { 51 | return ""; 52 | } 53 | 54 | // 見出し語補完 55 | virtual void Complete(SKKCompletionHelper& helper) {} 56 | }; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /platform/mac/proj/contents/License.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg932\cocoartf1038 2 | {\fonttbl\f0\fnil\fcharset0 Menlo-Regular;\f1\fnil\fcharset128 HiraKakuProN-W3;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \paperw11900\paperh16840\margl1440\margr1440\vieww9000\viewh8400\viewkind0 5 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural 6 | 7 | \f0\fs28 \cf0 AquaSKK 8 | \f1 \'82\'cd\'96\'b3\'97\'bf\'82\'c5\'97\'98\'97\'70\'82\'c5\'82\'ab\'82\'dc\'82\'b7\'81\'42\'83\'89\'83\'43\'83\'5a\'83\'93\'83\'58\'82\'cd 9 | \f0 GNU GPLv2 10 | \f1 \'82\'c5\'82\'b7\'81\'42 11 | \f0 \ 12 | \ 13 | AquaSKK 14 | \f1 \'82\'cc{\field{\*\fldinst{HYPERLINK "https://github.com/codefirst/aquaskk"}}{\fldrslt \'83\'5c\'81\'5b\'83\'58\'83\'52\'81\'5b\'83\'68\'82\'cd\'8c\'f6\'8a\'4a}}\'82\'b3\'82\'ea\'82\'c4\'82\'a8\'82\'e8\'81\'41\'92\'4e\'82\'c5\'82\'e0\'8e\'a9\'97\'52\'82\'c9\'89\'fc\'95\'cf\'82\'b7\'82\'e9\'82\'b1\'82\'c6\'82\'aa\'82\'c5\'82\'ab\'82\'dc\'82\'b7\'82\'aa\'81\'41\'89\'fc\'95\'cf\'94\'c5\'82\'f0\'94\'7a\'95\'7a\'82\'b7\'82\'e9\'8f\'ea\'8d\'87\'82\'c9\'82\'cd\'81\'41\'89\'fc\'95\'cf\'82\'b5\'82\'bd\'83\'5c\'81\'5b\'83\'58\'83\'52\'81\'5b\'83\'68\'82\'e0\'94\'7a\'95\'7a\'82\'e0\'82\'b5\'82\'ad\'82\'cd\'8c\'f6\'8a\'4a\'82\'b7\'82\'e9\'8b\'60\'96\'b1\'82\'aa\'90\'b6\'82\'b6\'82\'dc\'82\'b7\'81\'42 15 | \f0 \ 16 | \ 17 | 18 | \f1 \'83\'89\'83\'43\'83\'5a\'83\'93\'83\'58\'82\'cc\'90\'b3\'8a\'6d\'82\'c8\'93\'e0\'97\'65\'82\'c9\'82\'c2\'82\'a2\'82\'c4\'82\'cd\'81\'41\'88\'c8\'89\'ba\'82\'f0\'82\'b2\'97\'97\'89\'ba\'82\'b3\'82\'a2\'81\'42 19 | \f0 \ 20 | \ 21 | 22 | \f1 \'81\'45{\field{\*\fldinst{HYPERLINK "http://www.gnu.org/licenses/old-licenses/gpl-2.0.html"}}{\fldrslt 23 | \f0 GNU General Public License, version 2}} 24 | \f0 \ 25 | 26 | \f1 \'81\'45{\field{\*\fldinst{HYPERLINK "http://www.opensource.jp/gpl/gpl.ja.html.euc-jp"}}{\fldrslt \'94\'f1\'8c\'f6\'8e\'ae\'82\'c8\'93\'fa\'96\'7b\'8c\'ea\'96\'f3}} 27 | \f0 \ 28 | } -------------------------------------------------------------------------------- /src/engine/keymap/SKKKeyState.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2007 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKKeyState_h 24 | #define SKKKeyState_h 25 | 26 | // 以下のようなキー状態を作り出すユーティリティクラス 27 | // 28 | // 31 23 15 7 0 bit 29 | // +--------+--------+--------+--------+ 30 | // + 未使用 |modifier|key code| ascii | 31 | // +--------+--------+--------+--------+ 32 | // 33 | // modifier は shift, ctrl, alt(=opt), meta(=cmd) 34 | // 35 | class SKKKeyState { 36 | int state_; 37 | 38 | SKKKeyState(); 39 | SKKKeyState(int charcode, int keycode, short mods) { 40 | state_ = (mods << 16) | ((0xff & keycode) << 8) | (0xff & charcode); 41 | } 42 | 43 | public: 44 | enum Modifier { 45 | SHIFT = (1 << 1), 46 | CTRL = (1 << 2), 47 | ALT = (1 << 3), 48 | META = (1 << 4) 49 | }; 50 | 51 | static SKKKeyState KeyCode(int code, int mods) { 52 | return SKKKeyState(0, code, mods); 53 | } 54 | 55 | static SKKKeyState CharCode(int code, int mods) { 56 | return SKKKeyState(code, 0, mods); 57 | } 58 | 59 | operator int() const { 60 | return state_; 61 | } 62 | }; 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /src/engine/editor/SKKPrimaryEditor.cpp: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #include "SKKPrimaryEditor.h" 24 | #include "SKKInputContext.h" 25 | 26 | SKKPrimaryEditor::SKKPrimaryEditor(SKKInputContext* context) 27 | : SKKBaseEditor(context) {} 28 | 29 | void SKKPrimaryEditor::ReadContext() { 30 | context()->entry = SKKEntry(); 31 | 32 | SKKRegistration& registration = context()->registration; 33 | 34 | if(registration == SKKRegistration::Finished) { 35 | context()->output.Fix(registration.Word()); 36 | registration.Clear(); 37 | } 38 | } 39 | 40 | void SKKPrimaryEditor::Input(const std::string& ascii) { 41 | context()->event_handled = false; 42 | } 43 | 44 | void SKKPrimaryEditor::Input(const std::string& fixed, const std::string&, char) { 45 | context()->output.Fix(fixed); 46 | } 47 | 48 | void SKKPrimaryEditor::Input(SKKBaseEditor::Event event) { 49 | context()->event_handled = false; 50 | } 51 | 52 | void SKKPrimaryEditor::Commit(std::string& queue) { 53 | context()->output.Fix(queue); 54 | queue.clear(); 55 | 56 | context()->entry = SKKEntry(); 57 | } 58 | -------------------------------------------------------------------------------- /src/engine/trie/SKKRomanKanaConverter.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2007 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef SKKRomanKanaConverter_h 24 | #define SKKRomanKanaConverter_h 25 | 26 | #include 27 | #include "SKKTrie.h" 28 | #include "SKKInputMode.h" 29 | 30 | // 変換結果 31 | struct SKKRomanKanaConversionResult { 32 | std::string output; 33 | std::string next; 34 | std::string intermediate; 35 | }; 36 | 37 | class SKKRomanKanaConverter { 38 | SKKTrie root_; 39 | 40 | SKKRomanKanaConverter(); 41 | SKKRomanKanaConverter(const SKKRomanKanaConverter&); 42 | 43 | void load(const std::string& path, bool initialize); 44 | 45 | public: 46 | static SKKRomanKanaConverter& theInstance(); 47 | 48 | void Initialize(const std::string& path); 49 | 50 | void Patch(const std::string& path); 51 | 52 | // ローマ字かな変換 53 | // 54 | // 引数: 55 | // mode=入力モード 56 | // in=ローマ字文字列 57 | // result=変換結果 58 | // 59 | // 戻り値: 60 | // true=変換された、false=変換されなかった 61 | // 62 | bool Convert(SKKInputMode mode, const std::string& str, SKKRomanKanaConversionResult& result); 63 | }; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /platform/mac/src/server/MacInputSessionParameter.h: -------------------------------------------------------------------------------- 1 | /* -*- ObjC -*- 2 | 3 | MacOS X implementation of the SKK input method. 4 | 5 | Copyright (C) 2008 Tomotaka SUWA 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | */ 22 | 23 | #ifndef MacInputSessionParameter_h 24 | #define MacInputSessionParameter_h 25 | 26 | #include "SKKInputSessionParameter.h" 27 | #include "SKKLayoutManager.h" 28 | #include 29 | 30 | class MacInputSessionParameter : public SKKInputSessionParameter { 31 | std::auto_ptr config_; 32 | std::auto_ptr frontend_; 33 | std::auto_ptr messenger_; 34 | std::auto_ptr clipboard_; 35 | std::auto_ptr candidateWindow_; 36 | std::auto_ptr annotator_; 37 | std::auto_ptr completor_; 38 | 39 | public: 40 | MacInputSessionParameter(id client, SKKLayoutManager* layout); 41 | 42 | virtual SKKConfig* Config(); 43 | virtual SKKFrontEnd* FrontEnd(); 44 | virtual SKKMessenger* Messenger(); 45 | virtual SKKClipboard* Clipboard(); 46 | virtual SKKCandidateWindow* CandidateWindow(); 47 | virtual SKKAnnotator* Annotator(); 48 | virtual SKKDynamicCompletor* DynamicCompletor(); 49 | }; 50 | 51 | #endif 52 | --------------------------------------------------------------------------------