├── .gitignore ├── AUTHORS ├── CMakeLists.txt ├── COPYING ├── INSTALL ├── README ├── cmake └── FindAnthy.cmake ├── icon ├── 22x22 │ └── status │ │ └── fcitx-anthy-symbol.png ├── 48x48 │ └── status │ │ └── fcitx-anthy.png ├── CMakeLists.txt └── scalable │ └── status │ ├── fcitx-anthy-period-japanese.svg │ ├── fcitx-anthy-period-latin.svg │ ├── fcitx-anthy-period-wide-japanese.svg │ ├── fcitx-anthy-period-wide-latin.svg │ └── fcitx-anthy-symbol.svg ├── po ├── CMakeLists.txt ├── ca.po ├── da.po ├── de.po ├── fcitx-anthy.pot ├── ja.po ├── ko.po ├── ru.po ├── zh_CN.po └── zh_TW.po ├── profile ├── 101kana.sty ├── CMakeLists.txt ├── atok.sty ├── azik.sty ├── canna.sty ├── msime.sty ├── nicola-a.sty ├── nicola-f.sty ├── nicola-j.sty ├── oasys100j.sty ├── qkana.sty ├── tron-dvorak.sty ├── tron-qwerty-jp.sty ├── tsuki-2-203-101.sty ├── tsuki-2-203-106.sty ├── vje-delta.sty └── wnn.sty └── src ├── CMakeLists.txt ├── action.cpp ├── action.h ├── anthy.conf.in ├── common.h ├── conversion.cpp ├── conversion.h ├── default_tables.cpp ├── default_tables.h ├── factory.cpp ├── factory.h ├── fcitx-anthy.conf.in ├── fcitx-anthy.desc ├── imengine.cpp ├── imengine.h ├── kana.cpp ├── kana.h ├── key2kana.cpp ├── key2kana.h ├── key2kana_base.h ├── key2kana_table.cpp ├── key2kana_table.h ├── nicola.cpp ├── nicola.h ├── preedit.cpp ├── preedit.h ├── reading.cpp ├── reading.h ├── style_file.cpp ├── style_file.h ├── utils.cpp └── utils.h /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | build*/ 3 | .* 4 | !.git* 5 | .git/ 6 | *.tar.* 7 | *.kdev4 8 | *.kate-swp 9 | *.orig 10 | tags 11 | astyle.sh 12 | cscope.* 13 | *.part 14 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Weng Xuetian 2 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.6) 2 | 3 | project(fcitx-anthy) 4 | 5 | set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) 6 | 7 | find_package(Fcitx 4.2.9.2 REQUIRED) 8 | find_package(PkgConfig REQUIRED) 9 | 10 | pkg_check_modules(AnthyUnicode IMPORTED_TARGET "anthy-unicode") 11 | 12 | if (AnthyUnicode_FOUND) 13 | set(ANTHY_TARGET PkgConfig::AnthyUnicode) 14 | else() 15 | pkg_check_modules(Anthy IMPORTED_TARGET "anthy" REQUIRED) 16 | set(ANTHY_TARGET PkgConfig::Anthy) 17 | endif() 18 | 19 | _fcitx_add_uninstall_target() 20 | 21 | set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -fvisibility=hidden ${CMAKE_C_FLAGS}") 22 | set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -fvisibility=hidden ${CMAKE_CXX_FLAGS}") 23 | set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed ${CMAKE_SHARED_LINKER_FLAGS}") 24 | set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--as-needed ${CMAKE_MODULE_LINKER_FLAGS}") 25 | 26 | if(NOT DEFINED LIB_INSTALL_DIR) 27 | set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib) 28 | endif() 29 | 30 | set(HAVE_CONFIG_H) 31 | 32 | set(libdir ${LIB_INSTALL_DIR}) 33 | 34 | add_subdirectory(po) 35 | add_subdirectory(src) 36 | add_subdirectory(icon) 37 | add_subdirectory(profile) 38 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | fcitx-anthy install instructions 2 | ================================================= 3 | 4 | To compile and install, go in the source directory and type: 5 | mkdir build; cd build 6 | cmake .. 7 | (If you want to install in a different path, use instead: 8 | cmake .. -DCMAKE_INSTALL_PREFIX=/install/path) 9 | make 10 | 11 | To install, become root if required: 12 | 13 | make install 14 | 15 | Once installed, you can restart fcitx and it will be enabled by default. 16 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | fcitx-anthy 2 | Anthy Wrapper for Fcitx. 3 | 4 | Ported from scim-anthy. -------------------------------------------------------------------------------- /cmake/FindAnthy.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find the ANTHY libraries 2 | # Once done this will define 3 | # 4 | # ANTHY_FOUND - system has ANTHY 5 | # ANTHY_INCLUDE_DIR - the ANTHY include directory 6 | # ANTHY_LIBRARIES - ANTHY library 7 | # 8 | # Copyright (c) 2012 CSSlayer 9 | # 10 | # Redistribution and use is allowed according to the terms of the BSD license. 11 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 12 | 13 | if(ANTHY_INCLUDE_DIR AND ANTHY_LIBRARIES) 14 | # Already in cache, be silent 15 | set(ANTHY_FIND_QUIETLY TRUE) 16 | endif(ANTHY_INCLUDE_DIR AND ANTHY_LIBRARIES) 17 | 18 | find_package(PkgConfig) 19 | pkg_check_modules(PC_LIBANTHY QUIET anthy) 20 | 21 | find_path(ANTHY_MAIN_INCLUDE_DIR 22 | NAMES anthy.h 23 | HINTS ${PC_LIBANTHY_INCLUDEDIR} 24 | PATH_SUFFIXES anthy) 25 | 26 | find_library(ANTHY_LIBRARIES 27 | NAMES anthy 28 | HINTS ${PC_LIBANTHY_LIBDIR}) 29 | 30 | set(ANTHY_INCLUDE_DIR "${ANTHY_MAIN_INCLUDE_DIR}") 31 | 32 | include(FindPackageHandleStandardArgs) 33 | find_package_handle_standard_args(ANTHY DEFAULT_MSG ANTHY_LIBRARIES ANTHY_MAIN_INCLUDE_DIR) 34 | 35 | mark_as_advanced(ANTHY_INCLUDE_DIR ANTHY_LIBRARIES) 36 | -------------------------------------------------------------------------------- /icon/22x22/status/fcitx-anthy-symbol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx-anthy/2be4380182b2b47b9f6fafa442405b33da7ce40e/icon/22x22/status/fcitx-anthy-symbol.png -------------------------------------------------------------------------------- /icon/48x48/status/fcitx-anthy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx-anthy/2be4380182b2b47b9f6fafa442405b33da7ce40e/icon/48x48/status/fcitx-anthy.png -------------------------------------------------------------------------------- /icon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(DIRECTORY 48x48 22x22 scalable DESTINATION share/icons/hicolor 2 | PATTERN ".*" EXCLUDE 3 | PATTERN "*~" EXCLUDE) 4 | 5 | 6 | install(FILES 48x48/status/fcitx-anthy.png DESTINATION share/fcitx/imicon RENAME anthy.png) 7 | -------------------------------------------------------------------------------- /icon/scalable/status/fcitx-anthy-period-japanese.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 22 | 24 | image/svg+xml 25 | 27 | 28 | 29 | 30 | 50 | 52 | 61 | 66 | 71 | 76 | 77 | 88 | 89 | 95 | 100 | 104 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /icon/scalable/status/fcitx-anthy-period-latin.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /icon/scalable/status/fcitx-anthy-period-wide-japanese.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /icon/scalable/status/fcitx-anthy-period-wide-latin.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /icon/scalable/status/fcitx-anthy-symbol.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 22 | 24 | image/svg+xml 25 | 27 | 28 | 29 | 30 | 31 | 51 | 59 | 60 | 62 | 71 | 76 | 81 | 86 | 87 | 96 | 101 | 106 | 111 | 112 | 121 | 130 | 139 | 144 | 149 | 154 | 155 | 165 | 166 | 169 | 175 | 180 | 186 | 192 | 198 | 204 | 205 | 206 | -------------------------------------------------------------------------------- /po/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB PO_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" *.po) 2 | 3 | foreach(po_file ${PO_FILES}) 4 | string(REPLACE ".po" "" po_lang "${po_file}") 5 | fcitx_translate_add_po_file("${po_lang}" "${po_file}") 6 | endforeach() 7 | fcitx_translate_set_pot_target(pot fcitx-anthy fcitx-anthy.pot) 8 | -------------------------------------------------------------------------------- /po/fcitx-anthy.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 11 | "POT-Creation-Date: 2016-02-22 10:02-0800\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: LANG\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=utf-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: src/factory.cpp:95 src/anthy.conf.in:3 src/fcitx-anthy.conf.in:3 21 | msgid "Anthy" 22 | msgstr "" 23 | 24 | #: src/imengine.cpp:509 25 | #, c-format 26 | msgid "(%d / %d)" 27 | msgstr "" 28 | 29 | #: src/imengine.cpp:577 src/fcitx-anthy.desc:27 30 | msgid "Hiragana" 31 | msgstr "" 32 | 33 | #: src/imengine.cpp:578 src/fcitx-anthy.desc:28 34 | msgid "Katakana" 35 | msgstr "" 36 | 37 | #: src/imengine.cpp:579 38 | msgid "Half width katakana" 39 | msgstr "" 40 | 41 | #: src/imengine.cpp:580 42 | msgid "Direct input" 43 | msgstr "" 44 | 45 | #: src/imengine.cpp:581 src/fcitx-anthy.desc:57 46 | msgid "Wide latin" 47 | msgstr "" 48 | 49 | #: src/imengine.cpp:585 src/fcitx-anthy.desc:38 50 | msgid "Romaji" 51 | msgstr "" 52 | 53 | #: src/imengine.cpp:586 src/fcitx-anthy.desc:39 54 | msgid "Kana" 55 | msgstr "" 56 | 57 | #: src/imengine.cpp:587 src/fcitx-anthy.desc:40 58 | msgid "Nicola" 59 | msgstr "" 60 | 61 | #: src/imengine.cpp:587 62 | msgid "Thumb shift" 63 | msgstr "" 64 | 65 | #: src/imengine.cpp:591 src/fcitx-anthy.desc:47 66 | msgid "Multi segment" 67 | msgstr "" 68 | 69 | #: src/imengine.cpp:592 src/fcitx-anthy.desc:48 70 | msgid "Single segment" 71 | msgstr "" 72 | 73 | #: src/imengine.cpp:593 74 | msgid "Convert as you type (Multi segment)" 75 | msgstr "" 76 | 77 | #: src/imengine.cpp:594 78 | msgid "Convert as you type (Single segment)" 79 | msgstr "" 80 | 81 | #: src/imengine.cpp:805 82 | msgid "Input Mode" 83 | msgstr "" 84 | 85 | #: src/imengine.cpp:806 86 | msgid "Typing Method" 87 | msgstr "" 88 | 89 | #: src/imengine.cpp:807 90 | msgid "Conversion Mode" 91 | msgstr "" 92 | 93 | #: src/imengine.cpp:808 94 | msgid "Period Style" 95 | msgstr "" 96 | 97 | #: src/imengine.cpp:809 98 | msgid "Symbol Style" 99 | msgstr "" 100 | 101 | #: src/fcitx-anthy.conf.in:4 102 | msgid "Anthy Wrapper For Fcitx" 103 | msgstr "" 104 | 105 | #: src/fcitx-anthy.desc:1 src/fcitx-anthy.desc:6 src/fcitx-anthy.desc:15 106 | #: src/fcitx-anthy.desc:22 src/fcitx-anthy.desc:33 src/fcitx-anthy.desc:42 107 | #: src/fcitx-anthy.desc:52 src/fcitx-anthy.desc:62 src/fcitx-anthy.desc:72 108 | #: src/fcitx-anthy.desc:77 src/fcitx-anthy.desc:82 src/fcitx-anthy.desc:87 109 | #: src/fcitx-anthy.desc:92 src/fcitx-anthy.desc:97 110 | msgid "General" 111 | msgstr "" 112 | 113 | #: src/fcitx-anthy.desc:3 114 | msgid "Page size" 115 | msgstr "" 116 | 117 | #: src/fcitx-anthy.desc:8 118 | msgid "Candidate List Layout" 119 | msgstr "" 120 | 121 | #: src/fcitx-anthy.desc:10 122 | msgid "Global" 123 | msgstr "" 124 | 125 | #: src/fcitx-anthy.desc:11 126 | msgid "Vertical" 127 | msgstr "" 128 | 129 | #: src/fcitx-anthy.desc:12 130 | msgid "Horizontal" 131 | msgstr "" 132 | 133 | #: src/fcitx-anthy.desc:17 134 | msgid "Number candidate of Triggers To Show Candidate Window" 135 | msgstr "" 136 | 137 | #: src/fcitx-anthy.desc:24 138 | msgid "Input mode" 139 | msgstr "" 140 | 141 | #: src/fcitx-anthy.desc:29 142 | msgid "Half Katakana" 143 | msgstr "" 144 | 145 | #: src/fcitx-anthy.desc:30 src/fcitx-anthy.desc:58 146 | msgid "Latin" 147 | msgstr "" 148 | 149 | #: src/fcitx-anthy.desc:31 150 | msgid "Wide Latin" 151 | msgstr "" 152 | 153 | #: src/fcitx-anthy.desc:35 154 | msgid "Typing method" 155 | msgstr "" 156 | 157 | #: src/fcitx-anthy.desc:44 158 | msgid "Conversion mode" 159 | msgstr "" 160 | 161 | #: src/fcitx-anthy.desc:49 162 | msgid "Multi segment immediate" 163 | msgstr "" 164 | 165 | #: src/fcitx-anthy.desc:50 166 | msgid "Single segment immediate" 167 | msgstr "" 168 | 169 | #: src/fcitx-anthy.desc:54 170 | msgid "Period style" 171 | msgstr "" 172 | 173 | #: src/fcitx-anthy.desc:59 src/fcitx-anthy.desc:67 174 | msgid "Japanese" 175 | msgstr "" 176 | 177 | #: src/fcitx-anthy.desc:60 178 | msgid "Wide latin Japanese" 179 | msgstr "" 180 | 181 | #: src/fcitx-anthy.desc:64 182 | msgid "Symbol style" 183 | msgstr "" 184 | 185 | #: src/fcitx-anthy.desc:68 186 | msgid "Wide bracket and wide slash" 187 | msgstr "" 188 | 189 | #: src/fcitx-anthy.desc:69 190 | msgid "Corner bracket and Middle Dot" 191 | msgstr "" 192 | 193 | #: src/fcitx-anthy.desc:70 194 | msgid "Corner bracket and wide slash" 195 | msgstr "" 196 | 197 | #: src/fcitx-anthy.desc:74 198 | msgid "Learn on manual commit" 199 | msgstr "" 200 | 201 | #: src/fcitx-anthy.desc:79 202 | msgid "Learn on auto commit" 203 | msgstr "" 204 | 205 | #: src/fcitx-anthy.desc:84 206 | msgid "Allow split" 207 | msgstr "" 208 | 209 | #: src/fcitx-anthy.desc:89 210 | msgid "Use direct key on predict" 211 | msgstr "" 212 | 213 | #: src/fcitx-anthy.desc:94 214 | msgid "Show candidates label" 215 | msgstr "" 216 | 217 | #: src/fcitx-anthy.desc:99 218 | msgid "Show input mode in input window when focus changes" 219 | msgstr "" 220 | 221 | #: src/fcitx-anthy.desc:102 src/fcitx-anthy.desc:107 src/fcitx-anthy.desc:112 222 | #: src/fcitx-anthy.desc:117 src/fcitx-anthy.desc:122 223 | msgid "Interface" 224 | msgstr "" 225 | 226 | #: src/fcitx-anthy.desc:104 227 | msgid "Show input mode" 228 | msgstr "" 229 | 230 | #: src/fcitx-anthy.desc:109 231 | msgid "Show typing method" 232 | msgstr "" 233 | 234 | #: src/fcitx-anthy.desc:114 235 | msgid "Show conversion mode" 236 | msgstr "" 237 | 238 | #: src/fcitx-anthy.desc:119 239 | msgid "Show period style" 240 | msgstr "" 241 | 242 | #: src/fcitx-anthy.desc:124 243 | msgid "Show symbol style" 244 | msgstr "" 245 | 246 | #: src/fcitx-anthy.desc:127 src/fcitx-anthy.desc:140 src/fcitx-anthy.desc:154 247 | #: src/fcitx-anthy.desc:166 src/fcitx-anthy.desc:180 src/fcitx-anthy.desc:185 248 | #: src/fcitx-anthy.desc:190 src/fcitx-anthy.desc:195 249 | msgid "KeyProfile" 250 | msgstr "" 251 | 252 | #: src/fcitx-anthy.desc:130 253 | msgid "Key binding profile" 254 | msgstr "" 255 | 256 | #: src/fcitx-anthy.desc:132 src/fcitx-anthy.desc:145 src/fcitx-anthy.desc:159 257 | #: src/fcitx-anthy.desc:171 258 | msgid "Default" 259 | msgstr "" 260 | 261 | #: src/fcitx-anthy.desc:133 src/fcitx-anthy.desc:146 262 | msgid "Atok" 263 | msgstr "" 264 | 265 | #: src/fcitx-anthy.desc:134 src/fcitx-anthy.desc:148 266 | msgid "Canna" 267 | msgstr "" 268 | 269 | #: src/fcitx-anthy.desc:135 src/fcitx-anthy.desc:149 270 | msgid "MS IME" 271 | msgstr "" 272 | 273 | #: src/fcitx-anthy.desc:136 src/fcitx-anthy.desc:150 274 | msgid "Vje Delta" 275 | msgstr "" 276 | 277 | #: src/fcitx-anthy.desc:137 src/fcitx-anthy.desc:151 278 | msgid "WNN" 279 | msgstr "" 280 | 281 | #: src/fcitx-anthy.desc:138 src/fcitx-anthy.desc:152 src/fcitx-anthy.desc:164 282 | #: src/fcitx-anthy.desc:178 283 | msgid "Custom" 284 | msgstr "" 285 | 286 | #: src/fcitx-anthy.desc:143 287 | msgid "Romaji Table" 288 | msgstr "" 289 | 290 | #: src/fcitx-anthy.desc:147 291 | msgid "Azik" 292 | msgstr "" 293 | 294 | #: src/fcitx-anthy.desc:157 295 | msgid "Kana Table" 296 | msgstr "" 297 | 298 | #: src/fcitx-anthy.desc:160 299 | msgid "101kana" 300 | msgstr "" 301 | 302 | #: src/fcitx-anthy.desc:161 303 | msgid "tsuki-2-203-101" 304 | msgstr "" 305 | 306 | #: src/fcitx-anthy.desc:162 307 | msgid "tsuki-2-203-106" 308 | msgstr "" 309 | 310 | #: src/fcitx-anthy.desc:163 311 | msgid "Quick Kana" 312 | msgstr "" 313 | 314 | #: src/fcitx-anthy.desc:169 315 | msgid "Nicola Table" 316 | msgstr "" 317 | 318 | #: src/fcitx-anthy.desc:172 319 | msgid "Nicola-A" 320 | msgstr "" 321 | 322 | #: src/fcitx-anthy.desc:173 323 | msgid "Nicola-F" 324 | msgstr "" 325 | 326 | #: src/fcitx-anthy.desc:174 327 | msgid "Nicola-J" 328 | msgstr "" 329 | 330 | #: src/fcitx-anthy.desc:175 331 | msgid "Oasys100J" 332 | msgstr "" 333 | 334 | #: src/fcitx-anthy.desc:176 335 | msgid "Tron Dvorak" 336 | msgstr "" 337 | 338 | #: src/fcitx-anthy.desc:177 339 | msgid "Tron Qwerty JP" 340 | msgstr "" 341 | 342 | #: src/fcitx-anthy.desc:183 343 | msgid "Custom Key Binding" 344 | msgstr "" 345 | 346 | #: src/fcitx-anthy.desc:188 347 | msgid "Custom Romaji Table" 348 | msgstr "" 349 | 350 | #: src/fcitx-anthy.desc:193 351 | msgid "Custom Kana Table" 352 | msgstr "" 353 | 354 | #: src/fcitx-anthy.desc:198 355 | msgid "Custom Nicola Table" 356 | msgstr "" 357 | 358 | #: src/fcitx-anthy.desc:200 src/fcitx-anthy.desc:205 src/fcitx-anthy.desc:210 359 | #: src/fcitx-anthy.desc:215 src/fcitx-anthy.desc:220 src/fcitx-anthy.desc:225 360 | #: src/fcitx-anthy.desc:230 src/fcitx-anthy.desc:235 src/fcitx-anthy.desc:240 361 | #: src/fcitx-anthy.desc:245 src/fcitx-anthy.desc:251 src/fcitx-anthy.desc:256 362 | #: src/fcitx-anthy.desc:261 src/fcitx-anthy.desc:266 src/fcitx-anthy.desc:271 363 | #: src/fcitx-anthy.desc:276 src/fcitx-anthy.desc:281 src/fcitx-anthy.desc:286 364 | #: src/fcitx-anthy.desc:291 src/fcitx-anthy.desc:296 src/fcitx-anthy.desc:301 365 | #: src/fcitx-anthy.desc:306 src/fcitx-anthy.desc:311 src/fcitx-anthy.desc:316 366 | #: src/fcitx-anthy.desc:321 src/fcitx-anthy.desc:326 src/fcitx-anthy.desc:331 367 | #: src/fcitx-anthy.desc:336 src/fcitx-anthy.desc:341 src/fcitx-anthy.desc:346 368 | #: src/fcitx-anthy.desc:351 src/fcitx-anthy.desc:356 src/fcitx-anthy.desc:361 369 | #: src/fcitx-anthy.desc:366 src/fcitx-anthy.desc:371 src/fcitx-anthy.desc:376 370 | #: src/fcitx-anthy.desc:381 src/fcitx-anthy.desc:386 src/fcitx-anthy.desc:391 371 | #: src/fcitx-anthy.desc:396 src/fcitx-anthy.desc:401 src/fcitx-anthy.desc:406 372 | #: src/fcitx-anthy.desc:411 src/fcitx-anthy.desc:416 src/fcitx-anthy.desc:421 373 | #: src/fcitx-anthy.desc:426 src/fcitx-anthy.desc:431 src/fcitx-anthy.desc:436 374 | #: src/fcitx-anthy.desc:441 src/fcitx-anthy.desc:446 src/fcitx-anthy.desc:451 375 | #: src/fcitx-anthy.desc:456 src/fcitx-anthy.desc:461 src/fcitx-anthy.desc:466 376 | #: src/fcitx-anthy.desc:471 src/fcitx-anthy.desc:476 src/fcitx-anthy.desc:481 377 | #: src/fcitx-anthy.desc:486 src/fcitx-anthy.desc:491 378 | msgid "Key" 379 | msgstr "" 380 | 381 | #: src/fcitx-anthy.desc:202 382 | msgid "Circle input mode" 383 | msgstr "" 384 | 385 | #: src/fcitx-anthy.desc:207 386 | msgid "Circle kana mode" 387 | msgstr "" 388 | 389 | #: src/fcitx-anthy.desc:212 390 | msgid "Circle latin and hiragana mode" 391 | msgstr "" 392 | 393 | #: src/fcitx-anthy.desc:217 394 | msgid "Circle typing method" 395 | msgstr "" 396 | 397 | #: src/fcitx-anthy.desc:222 398 | msgid "Latin mode" 399 | msgstr "" 400 | 401 | #: src/fcitx-anthy.desc:227 402 | msgid "Wide latin mode" 403 | msgstr "" 404 | 405 | #: src/fcitx-anthy.desc:232 406 | msgid "Hiragana mode" 407 | msgstr "" 408 | 409 | #: src/fcitx-anthy.desc:237 410 | msgid "Katakana mode" 411 | msgstr "" 412 | 413 | #: src/fcitx-anthy.desc:242 414 | msgid "Half Katakana mode" 415 | msgstr "" 416 | 417 | #: src/fcitx-anthy.desc:247 418 | msgid "Cancel pseudo ascii mode" 419 | msgstr "" 420 | 421 | #: src/fcitx-anthy.desc:253 422 | msgid "Insert space" 423 | msgstr "" 424 | 425 | #: src/fcitx-anthy.desc:258 426 | msgid "Insert Alternative space" 427 | msgstr "" 428 | 429 | #: src/fcitx-anthy.desc:263 430 | msgid "Insert Half Space" 431 | msgstr "" 432 | 433 | #: src/fcitx-anthy.desc:268 434 | msgid "Insert wide space" 435 | msgstr "" 436 | 437 | #: src/fcitx-anthy.desc:273 438 | msgid "BackSpace" 439 | msgstr "" 440 | 441 | #: src/fcitx-anthy.desc:278 442 | msgid "Delete" 443 | msgstr "" 444 | 445 | #: src/fcitx-anthy.desc:283 446 | msgid "Commit" 447 | msgstr "" 448 | 449 | #: src/fcitx-anthy.desc:288 450 | msgid "Commit Reverse Learn" 451 | msgstr "" 452 | 453 | #: src/fcitx-anthy.desc:293 454 | msgid "Convert" 455 | msgstr "" 456 | 457 | #: src/fcitx-anthy.desc:298 458 | msgid "Predict" 459 | msgstr "" 460 | 461 | #: src/fcitx-anthy.desc:303 462 | msgid "Cancel" 463 | msgstr "" 464 | 465 | #: src/fcitx-anthy.desc:308 466 | msgid "Cancel all" 467 | msgstr "" 468 | 469 | #: src/fcitx-anthy.desc:313 470 | msgid "Move Caret First" 471 | msgstr "" 472 | 473 | #: src/fcitx-anthy.desc:318 474 | msgid "Move caret last" 475 | msgstr "" 476 | 477 | #: src/fcitx-anthy.desc:323 478 | msgid "Move caret forward" 479 | msgstr "" 480 | 481 | #: src/fcitx-anthy.desc:328 482 | msgid "Move caret backward" 483 | msgstr "" 484 | 485 | #: src/fcitx-anthy.desc:333 486 | msgid "Select first segment" 487 | msgstr "" 488 | 489 | #: src/fcitx-anthy.desc:338 490 | msgid "Select last segment" 491 | msgstr "" 492 | 493 | #: src/fcitx-anthy.desc:343 494 | msgid "Select next segment" 495 | msgstr "" 496 | 497 | #: src/fcitx-anthy.desc:348 498 | msgid "Select previous segment" 499 | msgstr "" 500 | 501 | #: src/fcitx-anthy.desc:353 502 | msgid "Shrink segment" 503 | msgstr "" 504 | 505 | #: src/fcitx-anthy.desc:358 506 | msgid "Expand segment" 507 | msgstr "" 508 | 509 | #: src/fcitx-anthy.desc:363 510 | msgid "Commit first segment" 511 | msgstr "" 512 | 513 | #: src/fcitx-anthy.desc:368 514 | msgid "Commit selected segment" 515 | msgstr "" 516 | 517 | #: src/fcitx-anthy.desc:373 518 | msgid "Commit first segment reverse learn" 519 | msgstr "" 520 | 521 | #: src/fcitx-anthy.desc:378 522 | msgid "Commit selected segment reverse learn" 523 | msgstr "" 524 | 525 | #: src/fcitx-anthy.desc:383 526 | msgid "Select first candidate" 527 | msgstr "" 528 | 529 | #: src/fcitx-anthy.desc:388 530 | msgid "Select last candidate" 531 | msgstr "" 532 | 533 | #: src/fcitx-anthy.desc:393 534 | msgid "Select next candidate" 535 | msgstr "" 536 | 537 | #: src/fcitx-anthy.desc:398 538 | msgid "Alternative Select next candidate" 539 | msgstr "" 540 | 541 | #: src/fcitx-anthy.desc:403 542 | msgid "Select prev candidate" 543 | msgstr "" 544 | 545 | #: src/fcitx-anthy.desc:408 546 | msgid "Alternative Select prev candidate" 547 | msgstr "" 548 | 549 | #: src/fcitx-anthy.desc:413 550 | msgid "Candidates Page Up" 551 | msgstr "" 552 | 553 | #: src/fcitx-anthy.desc:418 554 | msgid "Candidates Page Down" 555 | msgstr "" 556 | 557 | #: src/fcitx-anthy.desc:423 558 | msgid "Convert char type forward" 559 | msgstr "" 560 | 561 | #: src/fcitx-anthy.desc:428 562 | msgid "Convert char type backward" 563 | msgstr "" 564 | 565 | #: src/fcitx-anthy.desc:433 566 | msgid "Convert To Hiragana" 567 | msgstr "" 568 | 569 | #: src/fcitx-anthy.desc:438 570 | msgid "Convert To Katakana" 571 | msgstr "" 572 | 573 | #: src/fcitx-anthy.desc:443 574 | msgid "Convert To Half" 575 | msgstr "" 576 | 577 | #: src/fcitx-anthy.desc:448 578 | msgid "Convert To Half Katakana" 579 | msgstr "" 580 | 581 | #: src/fcitx-anthy.desc:453 582 | msgid "Convert To Wide Latin" 583 | msgstr "" 584 | 585 | #: src/fcitx-anthy.desc:458 586 | msgid "Convert To Latin" 587 | msgstr "" 588 | 589 | #: src/fcitx-anthy.desc:463 590 | msgid "Reconvert" 591 | msgstr "" 592 | 593 | #: src/fcitx-anthy.desc:468 src/fcitx-anthy.desc:503 594 | msgid "Dict admin" 595 | msgstr "" 596 | 597 | #: src/fcitx-anthy.desc:473 598 | msgid "Add Word" 599 | msgstr "" 600 | 601 | #: src/fcitx-anthy.desc:478 602 | msgid "Left thumb key" 603 | msgstr "" 604 | 605 | #: src/fcitx-anthy.desc:483 606 | msgid "Right thumb key" 607 | msgstr "" 608 | 609 | #: src/fcitx-anthy.desc:488 610 | msgid "Ro key for kana layout" 611 | msgstr "" 612 | 613 | #: src/fcitx-anthy.desc:493 614 | msgid "Nicola time" 615 | msgstr "" 616 | 617 | #: src/fcitx-anthy.desc:496 src/fcitx-anthy.desc:501 618 | msgid "Command" 619 | msgstr "" 620 | 621 | #: src/fcitx-anthy.desc:498 622 | msgid "Add word" 623 | msgstr "" 624 | -------------------------------------------------------------------------------- /profile/101kana.sty: -------------------------------------------------------------------------------- 1 | # 2 | # 101kana.sty - Kana typing table for 101 keyboard. 3 | # Copyright (C) 2005 Takuro Ashie 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not write to the Free Software 17 | # Foundation Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # 19 | 20 | FormatVersion = 0.0.0 21 | Title = 101英語キーボード用かな配列 22 | Version = 0.0.0 23 | 24 | [KanaTable/FundamentalTable] 25 | # non modifiered keys 26 | ~=ろ 27 | 1=ぬ 28 | 2= ふ 29 | 3=あ 30 | 4=う 31 | 5=え 32 | 6=お 33 | 7=や 34 | 8=ゆ 35 | 9=よ 36 | 0=わ 37 | -= ほ 38 | \== へ 39 | 40 | q= た 41 | w= て 42 | e=い 43 | r= す 44 | t= か 45 | y=ん 46 | u=な 47 | i=に 48 | o=ら 49 | p= せ 50 | \[=゛ 51 | \]=゜ 52 | \\=む 53 | 54 | a= ち 55 | s= と 56 | d= し 57 | f= は 58 | g= き 59 | h= く 60 | j=ま 61 | k=の 62 | l=り 63 | ;=れ 64 | '= け 65 | 66 | z= つ 67 | x= さ 68 | c= そ 69 | v= ひ 70 | b= こ 71 | n=み 72 | m=も 73 | \,=ね 74 | .=る 75 | /=め 76 | 77 | # shift modifiered keys 78 | `=ろ 79 | !=ぬ 80 | @= ふ 81 | \#=ぁ 82 | $=ぅ 83 | %=ぇ 84 | ^=ぉ 85 | &=ゃ 86 | *=ゅ 87 | (=ょ 88 | )=を 89 | _=ー 90 | +=ゑ 91 | 92 | Q= た 93 | W= て 94 | E=ぃ 95 | R= す 96 | T=ヵ 97 | Y=ん 98 | U=な 99 | I=に 100 | O=ら 101 | P= せ 102 | {=「 103 | }=」 104 | |=む 105 | 106 | A= ち 107 | S= と 108 | D= し 109 | F= ゎ 110 | G= き 111 | H= く 112 | J=ま 113 | K=の 114 | L=り 115 | :=れ 116 | "=ヶ 117 | 118 | Z=っ 119 | X= さ 120 | C= そ 121 | V= ゐ 122 | B= こ 123 | N=み 124 | M=も 125 | ?=・ 126 | -------------------------------------------------------------------------------- /profile/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB STYLE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.sty) 2 | install(FILES ${STYLE_FILES} DESTINATION share/fcitx/anthy) 3 | -------------------------------------------------------------------------------- /profile/atok.sty: -------------------------------------------------------------------------------- 1 | # 2 | # atok.sty - Justsytem ATOK like style definition file for scim-anthy. 3 | # Copyright (C) 2005 Takuro Ashie 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not write to the Free Software 17 | # Foundation Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # 19 | 20 | FormatVersion = 0.0.0 21 | Title = ATOK 22 | Version = 0.0.0 23 | 24 | [KeyBindings] 25 | CircleInputModeKey = F10 26 | CircleKanaModeKey = 27 | CircleLatinHiraganaModeKey = HENKAN 28 | LatinModeKey = 29 | HiraganaModeKey = HIRAGANAKATAKANA 30 | KatakanaModeKey = SHIFT_HIRAGANAKATAKANA 31 | HalfKatakanaModeKey = 32 | CircleTypingMethodKey = ROMAJI ALT_ROMAJI 33 | 34 | ConvertKey = SPACE HENKAN 35 | PredictKey = TAB 36 | CancelKey = ESCAPE BACKSPACE 37 | CommitKey = ENTER CTRL_M 38 | ReconvertKey = SHIFT_HENKAN 39 | 40 | InsertSpaceKey = SPACE 41 | InsertAltSpaceKey = SHIFT_SPACE 42 | BackSpaceKey = BACKSPACE CTRL_H 43 | DeleteKey = DELETE CTRL_G 44 | 45 | MoveCaretBackwardKey = LEFT CTRL_K 46 | MoveCaretForwardKey = RIGHT CTRL_L 47 | MoveCaretFirstKey = CTRL_LEFT 48 | MoveCaretLastKey = CTRL_RIGHT 49 | 50 | SelectPrevSegmentKey = SHIFT_LEFT 51 | SelectNextSegmentKey = SHIFT_RIGHT 52 | SelectFirstSegmentKey = CTRL_LEFT 53 | SelectLastSegmentKey = CTRL_RIGHT 54 | ExpandSegmentKey = RIGHT CTRL_L 55 | ShrinkSegmentKey = LEFT CTRL_K 56 | CommitSelectedSegmentKey = DOWN 57 | 58 | CandidatesPageUpKey = SHIFT_HENKAN 59 | CandidatesPageDownKey = HENKAN 60 | SelectNextCandidateKey = SPACE TAB 61 | SelectNextCandidateKeyAlter = HENKAN 62 | SelectPrevCandidateKey = Up 63 | 64 | ConvertToHiraganaKey = F6 CTRL_U 65 | ConvertToKatakanaKey = F7 CTRL_I 66 | ConvertToHalfKey = F8 CTRL_O 67 | ConvertToHalfKatakanaKey = SHIFT_F8 68 | ConvertToWideLatinKey = F9 CTRL_P 69 | ConvertToLatinKey = F10 CTRL_SHIFT_@ 70 | 71 | AddWordKey = CTRL_F7 72 | 73 | 74 | # Override fundamental table 75 | [RomajiTable/FundamentalTable] 76 | - = ー 77 | #/ = ・ 78 | #[ = 「 79 | #] = 」 80 | a = あ 81 | ba = ば 82 | be = べ 83 | bi = び 84 | bo = ぼ 85 | bu = ぶ 86 | bya = びゃ 87 | bye = びぇ 88 | byi = びぃ 89 | byo = びょ 90 | byu = びゅ 91 | cha = ちゃ 92 | che = ちぇ 93 | chi = ち 94 | cho = ちょ 95 | chu = ちゅ 96 | cya = ちゃ 97 | cye = ちぇ 98 | cyi = ちぃ 99 | cyo = ちょ 100 | cyu = ちゅ 101 | da = だ 102 | de = で 103 | dha = でゃ 104 | dhe = でぇ 105 | dhi = でぃ 106 | dho = でょ 107 | dhu = でゅ 108 | di = ぢ 109 | do = ど 110 | du = づ 111 | dwu = どぅ 112 | dya = ぢゃ 113 | dye = ぢぇ 114 | dyi = ぢぃ 115 | dyo = ぢょ 116 | dyu = ぢゅ 117 | e = え 118 | fa = ふぁ 119 | fe = ふぇ 120 | fi = ふぃ 121 | fo = ふぉ 122 | fu = ふ 123 | fya = ふゃ 124 | fye = ふぇ 125 | fyi = ふぃ 126 | fyo = ふょ 127 | fyu = ふゅ 128 | ga = が 129 | ge = げ 130 | gi = ぎ 131 | go = ご 132 | gu = ぐ 133 | gwa = ぐぁ 134 | gya = ぎゃ 135 | gye = ぎぇ 136 | gyi = ぎぃ 137 | gyo = ぎょ 138 | gyu = ぎゅ 139 | ha = は 140 | he = へ 141 | hi = ひ 142 | ho = ほ 143 | hu = ふ 144 | hya = ひゃ 145 | hye = ひぇ 146 | hyi = ひぃ 147 | hyo = ひょ 148 | hyu = ひゅ 149 | i = い 150 | ja = じゃ 151 | je = じぇ 152 | ji = じ 153 | jo = じょ 154 | ju = じゅ 155 | jya = じゃ 156 | jye = じぇ 157 | jyi = じぃ 158 | jyo = じょ 159 | jyu = じゅ 160 | ka = か 161 | ke = け 162 | ki = き 163 | ko = こ 164 | ku = く 165 | kwa = くぁ 166 | kya = きゃ 167 | kye = きぇ 168 | kyi = きぃ 169 | kyo = きょ 170 | kyu = きゅ 171 | la = ぁ 172 | le = ぇ 173 | li = ぃ 174 | lka = ヵ 175 | lke = ヶ 176 | lo = ぉ 177 | ltsu = っ 178 | ltu = っ 179 | lu = ぅ 180 | lwa = ゎ 181 | lya = ゃ 182 | lye = ぇ 183 | lyi = ぃ 184 | lyo = ょ 185 | lyu = ゅ 186 | ma = ま 187 | me = め 188 | mi = み 189 | mo = も 190 | mu = む 191 | mya = みゃ 192 | mye = みぇ 193 | myi = みぃ 194 | myo = みょ 195 | myu = みゅ 196 | n' = ん 197 | na = な 198 | ne = ね 199 | ni = に 200 | n = ん 201 | nn = ん 202 | no = の 203 | nu = ぬ 204 | nya = にゃ 205 | nye = にぇ 206 | nyi = にぃ 207 | nyo = にょ 208 | nyu = にゅ 209 | o = お 210 | pa = ぱ 211 | pe = ぺ 212 | pi = ぴ 213 | po = ぽ 214 | pu = ぷ 215 | pya = ぴゃ 216 | pye = ぴぇ 217 | pyi = ぴぃ 218 | pyo = ぴょ 219 | pyu = ぴゅ 220 | ra = ら 221 | re = れ 222 | ri = り 223 | ro = ろ 224 | ru = る 225 | rya = りゃ 226 | rye = りぇ 227 | ryi = りぃ 228 | ryo = りょ 229 | ryu = りゅ 230 | sa = さ 231 | se = せ 232 | sha = しゃ 233 | she = しぇ 234 | shi = し 235 | sho = しょ 236 | shu = しゅ 237 | si = し 238 | so = そ 239 | su = す 240 | sya = しゃ 241 | sye = しぇ 242 | syi = しぃ 243 | syo = しょ 244 | syu = しゅ 245 | ta = た 246 | te = て 247 | tha = てゃ 248 | the = てぇ 249 | thi = てぃ 250 | tho = てょ 251 | thu = てゅ 252 | ti = ち 253 | to = と 254 | tsa = つぁ 255 | tse = つぇ 256 | tsi = つぃ 257 | tso = つぉ 258 | tsu = つ 259 | tu = つ 260 | twu = とぅ 261 | tya = ちゃ 262 | tye = ちぇ 263 | tyi = ちぃ 264 | tyo = ちょ 265 | tyu = ちゅ 266 | u = う 267 | va = う゛ぁ 268 | ve = う゛ぇ 269 | vi = う゛ぃ 270 | vo = う゛ぉ 271 | vu = う゛ 272 | wa = わ 273 | we = うぇ 274 | wi = うぃ 275 | wo = を 276 | wu = う 277 | wye = ゑ 278 | wyi = ゐ 279 | xa = ぁ 280 | xe = ぇ 281 | xi = ぃ 282 | xka = ヵ 283 | xke = ヶ 284 | xo = ぉ 285 | xtsu = っ 286 | xtu = っ 287 | xu = ぅ 288 | xwa = ゎ 289 | xya = ゃ 290 | xye = ぇ 291 | xyi = ぃ 292 | xyo = ょ 293 | xyu = ゅ 294 | ya = や 295 | ye = いぇ 296 | yi = い 297 | yo = よ 298 | yu = ゆ 299 | za = ざ 300 | ze = ぜ 301 | zi = じ 302 | zo = ぞ 303 | zu = ず 304 | zya = じゃ 305 | zye = じぇ 306 | zyi = じぃ 307 | zyo = じょ 308 | zyu = じゅ 309 | 310 | 311 | [PreeditStyle] 312 | 313 | 314 | [Setting] 315 | RomajiAllowSplit = false 316 | -------------------------------------------------------------------------------- /profile/azik.sty: -------------------------------------------------------------------------------- 1 | # 2 | # azik.sty - AZIK extended romaji table definition file. 3 | # Copyright (C) 2005 Takuro Ashie 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not write to the Free Software 17 | # Foundation Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # 19 | 20 | FormatVersion = 0.0.0 21 | Title = AZIK 22 | Version = 0.0.0 23 | 24 | # Override fundamental table 25 | [RomajiTable/FundamentalTable] 26 | # 清音 27 | a = あ 28 | i = い 29 | u = う 30 | e = え 31 | o = お 32 | 33 | ka = か 34 | ki = き 35 | ku = く 36 | ke = け 37 | ko = こ 38 | 39 | sa = さ 40 | si = し 41 | su = す 42 | se = せ 43 | so = そ 44 | 45 | ta = た 46 | ti = ち 47 | tu = つ 48 | te = て 49 | to = と 50 | 51 | na = な 52 | ni = に 53 | nu = ぬ 54 | ne = ね 55 | no = の 56 | 57 | ha = は 58 | hi = ひ 59 | hu = ふ 60 | he = へ 61 | ho = ほ 62 | 63 | fu = ふ 64 | 65 | ma = ま 66 | mi = み 67 | mu = む 68 | me = め 69 | mo = も 70 | 71 | ya = や 72 | yu = ゆ 73 | yo = よ 74 | 75 | ra = ら 76 | ri = り 77 | ru = る 78 | re = れ 79 | ro = ろ 80 | 81 | wa = わ 82 | wo = を 83 | 84 | # 撥音拡張 85 | kz = かん 86 | kn = かん 87 | kk = きん 88 | kj = くん 89 | kd = けん 90 | kl = こん 91 | 92 | sz = さん 93 | sn = さん 94 | sk = しん 95 | sj = すん 96 | sd = せん 97 | sl = そん 98 | 99 | tz = たん 100 | tn = たん 101 | tk = ちん 102 | tj = つん 103 | td = てん 104 | tl = とん 105 | 106 | nz = なん 107 | nn = ん 108 | nk = にん 109 | nj = ぬん 110 | nd = ねん 111 | nl = のん 112 | 113 | hz = はん 114 | hn = はん 115 | hk = ひん 116 | hj = ふん 117 | hd = へん 118 | hl = ほん 119 | 120 | fz = ふぁん 121 | fn = ふぁん 122 | fk = ふぃん 123 | fj = ふん 124 | fd = ふぇん 125 | fl = ふぉん 126 | 127 | mz = まん 128 | mk = みん 129 | mj = むん 130 | md = めん 131 | ml = もん 132 | 133 | yz = やん 134 | yn = やん 135 | yj = ゆん 136 | yl = よん 137 | 138 | rz = らん 139 | rn = らん 140 | rk = りん 141 | rj = るん 142 | rd = れん 143 | rl = ろん 144 | 145 | wz = わん 146 | wn = わん 147 | wk = うぃん 148 | wd = うぇん 149 | wl = うぉん 150 | 151 | # 二重母音拡張 152 | kq = かい 153 | kh = くう 154 | kw = けい 155 | kp = こう 156 | 157 | sq = さい 158 | sh = すう 159 | sw = せい 160 | sp = そう 161 | 162 | tq = たい 163 | th = つう 164 | tw = てい 165 | tp = とう 166 | 167 | nq = ない 168 | nh = ぬう 169 | nw = ねい 170 | np = のう 171 | 172 | hq = はい 173 | hh = ふう 174 | hw = へい 175 | hp = ほう 176 | 177 | fq = ふぁい 178 | fh = ふう 179 | fw = ふぇい 180 | fp = ふぉー 181 | 182 | mq = まい 183 | mh = むう 184 | mw = めい 185 | mp = もう 186 | 187 | yq = やい 188 | yh = ゆう 189 | yp = よう 190 | 191 | rq = らい 192 | rh = るう 193 | rw = れい 194 | rp = ろう 195 | 196 | wq = わい 197 | wp = うぉー 198 | 199 | # 撥音拡張互換キー 200 | kn = かん 201 | sn = さん 202 | tn = たん 203 | nn = ん 204 | hn = はん 205 | fn = ふぁん 206 | mn = もの 207 | yn = やん 208 | rn = らん 209 | wn = わん 210 | 211 | # 濁音、半濁音 撥音拡張、二重母音拡張 212 | ga = が 213 | gi = ぎ 214 | gu = ぐ 215 | ge = げ 216 | go = ご 217 | 218 | za = ざ 219 | zi = じ 220 | zu = ず 221 | ze = ぜ 222 | zo = ぞ 223 | 224 | da = だ 225 | di = ぢ 226 | du = づ 227 | de = で 228 | do = ど 229 | 230 | ba = ば 231 | bi = び 232 | bu = ぶ 233 | be = べ 234 | bo = ぼ 235 | 236 | pa = ぱ 237 | pi = ぴ 238 | pu = ぷ 239 | pe = ぺ 240 | po = ぽ 241 | 242 | gz = がん 243 | gn = がん 244 | gk = ぎん 245 | gj = ぐん 246 | gd = げん 247 | gl = ごん 248 | 249 | zz = ざん 250 | zn = ざん 251 | zk = じん 252 | zj = ずん 253 | zd = ぜん 254 | zl = ぞん 255 | 256 | dz = だん 257 | dn = だん 258 | dk = ぢん 259 | dj = づん 260 | dd = でん 261 | dl = どん 262 | 263 | bz = ばん 264 | bn = ばん 265 | bk = びん 266 | bj = ぶん 267 | bd = べん 268 | bl = ぼん 269 | 270 | pz = ぱん 271 | pn = ぱん 272 | pk = ぴん 273 | pj = ぷん 274 | pd = ぺん 275 | pl = ぽん 276 | 277 | gq = がい 278 | gh = ぐう 279 | gw = げい 280 | gp = ごう 281 | 282 | zq = ざい 283 | zh = ずう 284 | zw = ぜい 285 | zp = ぞう 286 | 287 | dq = だい 288 | dh = づう 289 | dw = でい 290 | dp = どう 291 | 292 | bq = ばい 293 | bh = ぶう 294 | bw = べい 295 | bp = ぼう 296 | 297 | pq = ぱい 298 | ph = ぷう 299 | pw = ぺい 300 | pp = ぽう 301 | 302 | zc = ざ 303 | zv = ざい 304 | zx = ぜい 305 | 306 | # 拗音、拗音互換 307 | kya = きゃ 308 | kyu = きゅ 309 | kye = きぇ 310 | kyo = きょ 311 | 312 | kga = きゃ 313 | kgu = きゅ 314 | kge = きぇ 315 | kgo = きょ 316 | 317 | sya = しゃ 318 | syu = しゅ 319 | sye = しぇ 320 | syo = しょ 321 | 322 | xa = しゃ 323 | xu = しゅ 324 | xe = しぇ 325 | xo = しょ 326 | 327 | tya = ちゃ 328 | tyu = ちゅ 329 | tye = ちぇ 330 | tyo = ちょ 331 | 332 | ca = ちゃ 333 | cu = ちゅ 334 | ce = ちぇ 335 | co = ちょ 336 | 337 | nya = にゃ 338 | nyu = にゅ 339 | nye = にぇ 340 | nyo = にょ 341 | 342 | nga = にゃ 343 | ngu = にゅ 344 | nge = にぇ 345 | ngo = にょ 346 | 347 | hya = ひゃ 348 | hyu = ひゅ 349 | hye = ひぇ 350 | hyo = ひょ 351 | 352 | hga = ひゃ 353 | hgu = ひゅ 354 | hge = ひぇ 355 | hgo = ひょ 356 | 357 | mya = みゃ 358 | myu = みゅ 359 | mye = みぇ 360 | myo = みょ 361 | 362 | mga = みゃ 363 | mgu = みゅ 364 | mge = みぇ 365 | mgo = みょ 366 | 367 | rya = りゃ 368 | ryu = りゅ 369 | rye = りぇ 370 | ryo = りょ 371 | 372 | kyz = きゃん 373 | kyn = きゃん 374 | kyj = きゅん 375 | kyd = きぇん 376 | kyl = きょん 377 | 378 | kgz = きゃん 379 | kgn = きゃん 380 | kgj = きゅん 381 | kgd = きぇん 382 | kgl = きょん 383 | 384 | syz = しゃん 385 | syn = しゃん 386 | syj = しゅん 387 | syd = しぇん 388 | syl = しょん 389 | 390 | xz = しゃん 391 | xn = しゃん 392 | xj = しゅん 393 | xd = しぇん 394 | xl = しょん 395 | 396 | tyz = ちゃん 397 | tyn = ちゃん 398 | tyj = ちゅん 399 | tyd = ちぇん 400 | tyl = ちょん 401 | 402 | cz = ちゃん 403 | cn = ちゃん 404 | cj = ちゅん 405 | cd = ちぇん 406 | cl = ちょん 407 | 408 | nyz = にゃん 409 | nyn = にゃん 410 | nyj = にゅん 411 | nyd = にぇん 412 | nyl = にょん 413 | 414 | ngz = にゃん 415 | ngn = にゃん 416 | ngj = にゅん 417 | ngd = にぇん 418 | ngl = にょん 419 | 420 | hyz = ひゃん 421 | hyn = ひゃん 422 | hyj = ひゅん 423 | hyd = ひぇん 424 | hyl = ひょん 425 | 426 | hgz = ひゃん 427 | hgn = ひゃん 428 | hgj = ひゅん 429 | hgd = ひぇん 430 | hgl = ひょん 431 | 432 | myz = みゃん 433 | myn = みゃん 434 | myj = みゅん 435 | myd = みぇん 436 | myl = みょん 437 | 438 | mgz = みゃん 439 | mgn = みゃん 440 | mgj = みゅん 441 | mgd = みぇん 442 | mgl = みょん 443 | 444 | ryz = りゃん 445 | ryn = りゃん 446 | ryj = りゅん 447 | ryd = りぇん 448 | ryl = りょん 449 | 450 | kyq = きゃい 451 | kyh = きゅう 452 | kyw = きぇい 453 | kyp = きょう 454 | 455 | kgq = きゃい 456 | kgh = きゅう 457 | kgw = きぇい 458 | kgp = きょう 459 | 460 | syq = しゃい 461 | syh = しゅう 462 | syw = しぇい 463 | syp = しょう 464 | 465 | xq = しゃい 466 | xh = しゅう 467 | xw = しぇい 468 | xp = しょう 469 | 470 | tyq = ちゃい 471 | tyh = ちゅう 472 | tyw = ちぇい 473 | typ = ちょう 474 | 475 | cq = ちゃい 476 | ch = ちゅう 477 | cw = ちぇい 478 | cp = ちょう 479 | 480 | nyq = にゃい 481 | nyh = にゅう 482 | nyw = にぇい 483 | nyp = にょう 484 | 485 | ngq = にゃい 486 | ngh = にゅう 487 | ngw = にぇい 488 | ngp = にょう 489 | 490 | hyq = ひゃい 491 | hyh = ひゅう 492 | hyw = ひぇい 493 | hyp = ひょう 494 | 495 | hgq = ひゃい 496 | hgh = ひゅう 497 | hgw = ひぇい 498 | hgp = ひょう 499 | 500 | myq = みゃい 501 | myh = みゅう 502 | myw = みぇい 503 | myp = みょう 504 | 505 | mgq = みゃい 506 | mgh = みゅう 507 | mgw = みぇい 508 | mgp = みょう 509 | 510 | ryq = りゃい 511 | ryh = りゅう 512 | ryw = りぇい 513 | ryp = りょう 514 | 515 | # 拗音 (濁音、半濁音) 516 | gya = ぎゃ 517 | gyu = ぎゅ 518 | gye = ぎぇ 519 | gyo = ぎょ 520 | 521 | zya = じゃ 522 | zyu = じゅ 523 | zye = じぇ 524 | zyo = じょ 525 | 526 | ja = じゃ 527 | ju = じゅ 528 | je = じぇ 529 | jo = じょ 530 | 531 | bya = びゃ 532 | byu = びゅ 533 | bye = びぇ 534 | byo = びょ 535 | 536 | pya = ぴゃ 537 | pyu = ぴゅ 538 | pye = ぴぇ 539 | pyo = ぴょ 540 | 541 | pga = ぴゃ 542 | pgu = ぴゅ 543 | pge = ぴぇ 544 | pgo = ぴょ 545 | 546 | gyz = ぎゃん 547 | gyn = ぎゃん 548 | gyj = ぎゅん 549 | gyd = ぎぇん 550 | gyl = ぎょん 551 | 552 | zyz = じゃん 553 | zyn = じゃん 554 | zyj = じゅん 555 | zyd = じぇん 556 | zyl = じょん 557 | 558 | jz = じゃん 559 | jn = じゃん 560 | jj = じゅん 561 | jd = じぇん 562 | jl = じょん 563 | 564 | byz = びゃん 565 | byn = びゃん 566 | byj = びゅん 567 | byd = びぇん 568 | byl = びょん 569 | 570 | pyz = ぴゃん 571 | pyn = ぴゃん 572 | pyj = ぴゅん 573 | pyd = ぴぇん 574 | pyl = ぴょん 575 | 576 | pgz = ぴゃん 577 | pgn = ぴゃん 578 | pgj = ぴゅん 579 | pgd = ぴぇん 580 | pgl = ぴょん 581 | 582 | gyq = ぎゃい 583 | gyh = ぎゅう 584 | gyw = ぎぇい 585 | gyp = ぎょう 586 | 587 | zyq = じゃい 588 | zyh = じゅう 589 | zyw = じぇい 590 | zyp = じょう 591 | 592 | jq = じゃい 593 | jh = じゅう 594 | jw = じぇい 595 | jp = じょう 596 | 597 | byq = びゃい 598 | byh = びゅう 599 | byw = びぇい 600 | byp = びょう 601 | 602 | pyq = ぴゃい 603 | pyh = ぴゅう 604 | pyw = ぴぇい 605 | pyp = ぴょう 606 | 607 | pgq = ぴゃい 608 | pgh = ぴゅう 609 | pgw = ぴぇい 610 | pgp = ぴょう 611 | 612 | # 拗音 (外来語、他) 613 | fa = ふぁ 614 | fi = ふぃ 615 | fu = ふ 616 | fe = ふぇ 617 | fo = ふぉ 618 | 619 | va = ヴぁ 620 | vi = ヴぃ 621 | vu = ヴ 622 | ve = ヴぇ 623 | vo = ヴぉ 624 | 625 | tgi = てぃ 626 | tgu = とぅ 627 | 628 | dci = でぃ 629 | dcu = どぅ 630 | 631 | wi = うぃ 632 | we = うぇ 633 | wo = を 634 | 635 | wso = うぉ 636 | 637 | la = ぁ 638 | li = ぃ 639 | lu = ぅ 640 | le = ぇ 641 | lo = ぉ 642 | 643 | lya = ゃ 644 | lyu = ゅ 645 | lyo = ょ 646 | 647 | # 促音、撥音、長音符 648 | ; = っ 649 | q = ん 650 | - = ー 651 | : = ー 652 | \[ = 「 653 | \] = 」 654 | 655 | # 特殊拡張 656 | kt = こと 657 | wt = わた 658 | km = かも 659 | sr = する 660 | rr = られ 661 | nb = ねば 662 | nt = にち 663 | st = した 664 | mn = もの 665 | tm = ため 666 | tr = たら 667 | zr = ざる 668 | bt = びと 669 | dt = だち 670 | tt = たち 671 | ms = ます 672 | dm = でも 673 | nr = なる 674 | mt = また 675 | gr = がら 676 | wr = われ 677 | ht = ひと 678 | ds = です 679 | kr = から 680 | yr = よる 681 | tb = たび 682 | gt = ごと 683 | -------------------------------------------------------------------------------- /profile/canna.sty: -------------------------------------------------------------------------------- 1 | # 2 | # canna.sty - Canna like style definition file for scim-anthy. 3 | # Copyright (C) 2005 Takuro Ashie 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not write to the Free Software 17 | # Foundation Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # 19 | 20 | FormatVersion = 0.0.0 21 | Title = Canna 22 | Version = 0.0.0 23 | 24 | [KeyBindings] 25 | CircleInputModeKey = 26 | CircleKanaModeKey = 27 | LatinModeKey = 28 | WideLatinModeKey = 29 | HiraganaModeKey = HIRAGANAKATAKANA 30 | KatakanaModeKey = SHIFT_HIRAGANAKATAKANA 31 | HalfKatakanaModeKey = 32 | CircleTypingMethodKey = ROMAJI ALT_ROMAJI 33 | 34 | ConvertKey = SPACE 35 | PredictKey = CTRL_Q 36 | CancelKey = ESCAPE CTRL_G 37 | CommitKey = ENTER CTRL_M 38 | 39 | InsertSpaceKey = SPACE 40 | InsertAltSpaceKey = 41 | BackSpaceKey = BACKSPACE CTRL_H 42 | DeleteKey = DELETE CTRL_D 43 | 44 | MoveCaretBackwardKey = LEFT CTRL_B 45 | MoveCaretForwardKey = RIGHT CTRL_F 46 | MoveCaretFirstKey = CTRL_A 47 | MoveCaretLastKey = CTRL_E 48 | 49 | SelectPrevSegmentKey = LEFT CTRL_B 50 | SelectNextSegmentKey = RIGHT CTRL_F 51 | SelectFirstSegmentKey = CTRL_A 52 | SelectLastSegmentKey = CTRL_E 53 | ExpandSegmentKey = CTRL_O 54 | ShrinkSegmentKey = TAB CTRL_I 55 | CommitSelectedSegmentKey = CTRL_K 56 | 57 | CandidatesPageUpKey = UP CTRL_P 58 | CandidatesPageDownKey = DOWN CTRL_N 59 | SelectNextCandidateKey = SPACE CTRL_Q 60 | SelectNextCandidateKeyAlter = RIGHT CTRL_F 61 | SelectPrevCandidateKey = LEFT CTRL_B 62 | 63 | 64 | ConvertCharTypeForwardKey = CTRL_N 65 | ConvertCharTypeBackwardKey = CTRL_P 66 | ConvertToHiraganaKey = 67 | ConvertToKatakanaKey = 68 | ConvertToHalfKey = 69 | ConvertToHalfKatakanaKey = 70 | ConvertToWideLatinKey = 71 | ConvertToLatinKey = 72 | # FIXME! 73 | #ConvertToUpperKey = CTRL_U 74 | #ConvertToLowerKey = CTRL_L 75 | 76 | AddWordKey = 77 | 78 | # Override fundamental table 79 | [RomajiTable/FundamentalTable] 80 | a = あ 81 | i = い 82 | u = う 83 | e = え 84 | o = お 85 | ka = か 86 | ki = き 87 | ku = く 88 | ke = け 89 | ko = こ 90 | sa = さ 91 | si = し 92 | su = す 93 | se = せ 94 | so = そ 95 | ta = た 96 | ti = ち 97 | tu = つ 98 | te = て 99 | to = と 100 | na = な 101 | ni = に 102 | nu = ぬ 103 | ne = ね 104 | no = の 105 | ha = は 106 | hi = ひ 107 | hu = ふ 108 | he = へ 109 | ho = ほ 110 | ma = ま 111 | mi = み 112 | mu = む 113 | me = め 114 | mo = も 115 | ya = や 116 | yi = い 117 | yu = ゆ 118 | ye = いぇ 119 | yo = よ 120 | ra = ら 121 | ri = り 122 | ru = る 123 | re = れ 124 | ro = ろ 125 | wa = わ 126 | wi = ヰ 127 | wu = う 128 | we = ヱ 129 | wo = を 130 | ga = が 131 | gi = ぎ 132 | gu = ぐ 133 | ge = げ 134 | go = ご 135 | za = ざ 136 | zi = じ 137 | zu = ず 138 | ze = ぜ 139 | zo = ぞ 140 | da = だ 141 | di = ぢ 142 | du = づ 143 | de = で 144 | do = ど 145 | ba = ば 146 | bi = び 147 | bu = ぶ 148 | be = べ 149 | bo = ぼ 150 | pa = ぱ 151 | pi = ぴ 152 | pu = ぷ 153 | pe = ぺ 154 | po = ぽ 155 | kya = きゃ 156 | kyi = きぃ 157 | kyu = きゅ 158 | kye = きぇ 159 | kyo = きょ 160 | gya = ぎゃ 161 | gyi = ぎぃ 162 | gyu = ぎゅ 163 | gye = ぎぇ 164 | gyo = ぎょ 165 | sya = しゃ 166 | syi = しぃ 167 | syu = しゅ 168 | sye = しぇ 169 | syo = しょ 170 | zya = じゃ 171 | zyi = じぃ 172 | zyu = じゅ 173 | zye = じぇ 174 | zyo = じょ 175 | tya = ちゃ 176 | tyi = ちぃ 177 | tyu = ちゅ 178 | tye = ちぇ 179 | tyo = ちょ 180 | nya = にゃ 181 | nyi = にぃ 182 | nyu = にゅ 183 | nye = にぇ 184 | nyo = にょ 185 | hya = ひゃ 186 | hyi = ひぃ 187 | hyu = ひゅ 188 | hye = ひぇ 189 | hyo = ひょ 190 | bya = びゃ 191 | byi = びぃ 192 | byu = びゅ 193 | bye = びぇ 194 | byo = びょ 195 | pya = ぴゃ 196 | pyi = ぴぃ 197 | pyu = ぴゅ 198 | pye = ぴぇ 199 | pyo = ぴょ 200 | mya = みゃ 201 | myi = みぃ 202 | myu = みゅ 203 | mye = みぇ 204 | myo = みょ 205 | rya = りゃ 206 | ryi = りぃ 207 | ryu = りゅ 208 | rye = りぇ 209 | ryo = りょ 210 | tsa = つぁ 211 | tyi = つぃ 212 | tyu = つ 213 | tye = つぇ 214 | tyo = つぉ 215 | sha = しゃ 216 | shi = し 217 | shu = しゅ 218 | she = しぇ 219 | sho = しょ 220 | tha = てぁ 221 | thi = てぃ 222 | thu = てゅ 223 | the = てぇ 224 | tho = てょ 225 | ja = じゃ 226 | ji = じ 227 | ju = じゅ 228 | je = じぇ 229 | jo = じょ 230 | cha = ちゃ 231 | chi = ち 232 | chu = ちゅ 233 | che = ちぇ 234 | cho = ちょ 235 | fa = ふぁ 236 | fi = ふぃ 237 | fu = ふ 238 | fe = ふぇ 239 | fo = ふぉ 240 | va = う゛ぁ 241 | vi = う゛ぃ 242 | vu = う゛ 243 | ve = う゛ぇ 244 | vo = う゛ぉ 245 | gwa = ぐぁ 246 | gwi = ぐぃ 247 | gwu = ぐぅ 248 | gwe = ぐぇ 249 | gwo = ぐぉ 250 | dya = ぢゃ 251 | dyi = ぢぃ 252 | dyu = ぢゅ 253 | dye = ぢぇ 254 | dyo = ぢょ 255 | dha = でゃ 256 | dhi = でぃ 257 | dhu = でゅ 258 | dhe = でぇ 259 | dho = でょ 260 | ca = か 261 | cu = く 262 | co = こ 263 | cya = ちゃ 264 | cyi = ちぃ 265 | cyu = ちぅ 266 | cye = ちぇ 267 | cyo = ちぉ 268 | jya = じゃ 269 | jyi = じぃ 270 | jyu = じゅ 271 | jye = じぇ 272 | jyo = じょ 273 | la = ら 274 | li = り 275 | lu = る 276 | le = れ 277 | lo = ろ 278 | lya = りゃ 279 | lyi = りぃ 280 | lyu = りゅ 281 | lye = りぇ 282 | lyo = りょ 283 | xa = ぁ 284 | xi = ぃ 285 | xu = ぅ 286 | xe = ぇ 287 | xo = ぉ 288 | xwa = ゎ 289 | xtu = っ 290 | xtsu = っ 291 | xya = ゃ 292 | xyu = ゅ 293 | xyo = ょ 294 | n = ん 295 | nn = ん 296 | mn = ん 297 | n' = ん 298 | @@ = 299 | - = ー 300 | #[ = 「 301 | #] = 」 302 | # = 、 303 | #. = 。 304 | @( = ( 305 | @) = ) 306 | @{ = { 307 | @} = } 308 | @[ = [ 309 | @] = ] 310 | @ = 311 | @. = . 312 | @~ = 〜 313 | @\ = \ 314 | @/ = ・ 315 | @- = ‐ 316 | @2 = ‥ 317 | @3 = … 318 | @|| = ‖ 319 | @| = | 320 | -------------------------------------------------------------------------------- /profile/msime.sty: -------------------------------------------------------------------------------- 1 | # 2 | # msime.sty - Microsoft IME like style definition file for scim-anthy. 3 | # Copyright (C) 2005 Takuro Ashie 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not write to the Free Software 17 | # Foundation Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # 19 | 20 | FormatVersion = 0.0.0 21 | Encoding = EUC-JP 22 | Title = Microsoft IME 23 | Version = 0.0.0 24 | 25 | [KeyBindings] 26 | CircleKanaModeKey = MUHENKAN 27 | LatinModeKey = 28 | WideLatinModeKey = 29 | HiraganaModeKey = HIRAGANAKATAKANA 30 | KatakanaModeKey = SHIFT_HIRAGANAKATAKANA 31 | HalfKatakanaModeKey = 32 | CircleTypingMethodKey = ALT_ROMAJI 33 | 34 | ConvertKey = SPACE SHIFT_SPACE HENKAN 35 | PredictKey = TAB 36 | CancelKey = BACKSPACE ESCAPE 37 | CommitKey = ENTER CTRL_ENTER 38 | ReconvertKey = HENKAN F13 39 | 40 | InsertSpaceKey = SPACE 41 | InsertAltSpaceKey = SHIFT_SPACE 42 | BackSpaceKey = BACKSPACE CTRL_H 43 | DeleteKey = DELETE CTRL_G 44 | 45 | MoveCaretFirstKey = HOME CTRL_LEFT 46 | MoveCaretLastKey = END CTRL_RIGHT 47 | MoveCaretForwardKey = RIGHT SHIFT_RIGHT 48 | MoveCaretBackwardKey = LEFT SHIFT_LEFT 49 | 50 | SelectFirstSegmentKey = HOME CTRL_LEFT 51 | SelectLastSegmentKey = END CTRL_RIGHT 52 | SelectNextSegmentKey = RIGHT CTRL_D 53 | SelectPrevSegmentKey = LEFT CTRL_S 54 | ShrinkSegmentKey = SHIFT_LEFT CTRL_E 55 | ExpandSegmentKey = SHIFT_RIGHT CTRL_L 56 | CommitFirstSegmentKey = SHIFT_DOWN 57 | CommitSelectedSegmentKey = CTRL_DOWN CTRL_N 58 | 59 | CandidatesPageUpKey = PGUP SHIFT_UP 60 | CandidatesPageDownKey = PGDN SHIFT_DOWN 61 | SelectFirstCandidateKey = HOME 62 | SelectLastCandidateKey = END 63 | SelectPrevCandidateKey = UP CTRL_E 64 | SelectPrevCandidateKeyAlter = SHIFT_SPACE SHIFT_HENKAN 65 | SelectNextCandidateKey = SPACE TAB 66 | SelectNextCandidateKeyAlter = HENKAN DOWN 67 | 68 | ConvertToHiraganaKey = CTRL_U F6 69 | ConvertToKatakanaKey = CTRL_I F7 70 | ConvertToHalfKey = CTRL_O F8 71 | ConvertToHalfKatakanaKey = SHIFT_F8 72 | ConvertToWideLatinKey = CTRL_P F9 73 | ConvertToLatinKey = CTRL_T F10 74 | 75 | 76 | # Override fundamental table 77 | [RomajiTable/FundamentalTable] 78 | - = ー 79 | #/ = ・ 80 | #[ = 「 81 | #] = 」 82 | la = ぁ 83 | xa = ぁ 84 | a = あ 85 | li = ぃ 86 | lyi = ぃ 87 | xi = ぃ 88 | xyi = ぃ 89 | i = い 90 | yi = い 91 | ye = いぇ 92 | lu = ぅ 93 | xu = ぅ 94 | u = う 95 | whu = う 96 | wu = う 97 | wha = うぁ 98 | whi = うぃ 99 | wi = うぃ 100 | we = うぇ 101 | whe = うぇ 102 | who = うぉ 103 | le = ぇ 104 | lye = ぇ 105 | xe = ぇ 106 | xye = ぇ 107 | e = え 108 | lo = ぉ 109 | xo = ぉ 110 | o = お 111 | ca = か 112 | ka = か 113 | ga = が 114 | ki = き 115 | kyi = きぃ 116 | kye = きぇ 117 | kya = きゃ 118 | kyu = きゅ 119 | kyo = きょ 120 | gi = ぎ 121 | gyi = ぎぃ 122 | gye = ぎぇ 123 | gya = ぎゃ 124 | gyu = ぎゅ 125 | gyo = ぎょ 126 | cu = く 127 | ku = く 128 | qu = く 129 | kwa = くぁ 130 | qa = くぁ 131 | qwa = くぁ 132 | qi = くぃ 133 | qwi = くぃ 134 | qyi = くぃ 135 | qwu = くぅ 136 | qe = くぇ 137 | qwe = くぇ 138 | qye = くぇ 139 | qo = くぉ 140 | qwo = くぉ 141 | qya = くゃ 142 | qyu = くゅ 143 | qyo = くょ 144 | gu = ぐ 145 | gwa = ぐぁ 146 | gwi = ぐぃ 147 | gwu = ぐぅ 148 | gwe = ぐぇ 149 | gwo = ぐぉ 150 | ke = け 151 | ge = げ 152 | co = こ 153 | ko = こ 154 | go = ご 155 | sa = さ 156 | za = ざ 157 | ci = し 158 | shi = し 159 | si = し 160 | syi = しぃ 161 | she = しぇ 162 | sye = しぇ 163 | sha = しゃ 164 | sya = しゃ 165 | shu = しゅ 166 | syu = しゅ 167 | sho = しょ 168 | syo = しょ 169 | ji = じ 170 | zi = じ 171 | jyi = じぃ 172 | zyi = じぃ 173 | je = じぇ 174 | jye = じぇ 175 | zye = じぇ 176 | ja = じゃ 177 | jya = じゃ 178 | zya = じゃ 179 | ju = じゅ 180 | jyu = じゅ 181 | zyu = じゅ 182 | jo = じょ 183 | jyo = じょ 184 | zyo = じょ 185 | su = す 186 | swa = すぁ 187 | swi = すぃ 188 | swu = すぅ 189 | swe = すぇ 190 | swo = すぉ 191 | zu = ず 192 | ce = せ 193 | se = せ 194 | ze = ぜ 195 | so = そ 196 | zo = ぞ 197 | ta = た 198 | da = だ 199 | chi = ち 200 | ti = ち 201 | cyi = ちぃ 202 | tyi = ちぃ 203 | che = ちぇ 204 | cye = ちぇ 205 | tye = ちぇ 206 | cha = ちゃ 207 | cya = ちゃ 208 | tya = ちゃ 209 | chu = ちゅ 210 | cyu = ちゅ 211 | tyu = ちゅ 212 | cho = ちょ 213 | cyo = ちょ 214 | tyo = ちょ 215 | di = ぢ 216 | dyi = ぢぃ 217 | dye = ぢぇ 218 | dya = ぢゃ 219 | dyu = ぢゅ 220 | dyo = ぢょ 221 | ltsu = っ 222 | ltu = っ 223 | xtsu = っ 224 | xtu = っ 225 | tsu = つ 226 | tu = つ 227 | tsa = つぁ 228 | tsi = つぃ 229 | tse = つぇ 230 | tso = つぉ 231 | du = づ 232 | te = て 233 | thi = てぃ 234 | the = てぇ 235 | tha = てゃ 236 | thu = てゅ 237 | tho = てょ 238 | de = で 239 | dhi = でぃ 240 | dhe = でぇ 241 | dha = でゃ 242 | dhu = でゅ 243 | dho = でょ 244 | to = と 245 | twa = とぁ 246 | twi = とぃ 247 | twu = とぅ 248 | twe = とぇ 249 | two = とぉ 250 | do = ど 251 | dwa = どぁ 252 | dwi = どぃ 253 | dwu = どぅ 254 | dwe = どぇ 255 | dwo = どぉ 256 | na = な 257 | ni = に 258 | nyi = にぃ 259 | nye = にぇ 260 | nya = にゃ 261 | nyu = にゅ 262 | nyo = にょ 263 | nu = ぬ 264 | ne = ね 265 | no = の 266 | ha = は 267 | ba = ば 268 | pa = ぱ 269 | hi = ひ 270 | hyi = ひぃ 271 | hye = ひぇ 272 | hya = ひゃ 273 | hyu = ひゅ 274 | hyo = ひょ 275 | bi = び 276 | byi = びぃ 277 | bye = びぇ 278 | bya = びゃ 279 | byu = びゅ 280 | byo = びょ 281 | pi = ぴ 282 | pyi = ぴぃ 283 | pye = ぴぇ 284 | pya = ぴゃ 285 | pyu = ぴゅ 286 | pyo = ぴょ 287 | fu = ふ 288 | hu = ふ 289 | fa = ふぁ 290 | fwa = ふぁ 291 | fi = ふぃ 292 | fwi = ふぃ 293 | fyi = ふぃ 294 | fwu = ふぅ 295 | fe = ふぇ 296 | fwe = ふぇ 297 | fye = ふぇ 298 | fo = ふぉ 299 | fwo = ふぉ 300 | fya = ふゃ 301 | fyu = ふゅ 302 | fyo = ふょ 303 | bu = ぶ 304 | pu = ぷ 305 | he = へ 306 | be = べ 307 | pe = ぺ 308 | ho = ほ 309 | bo = ぼ 310 | po = ぽ 311 | ma = ま 312 | mi = み 313 | myi = みぃ 314 | mye = みぇ 315 | mya = みゃ 316 | myu = みゅ 317 | myo = みょ 318 | mu = む 319 | me = め 320 | mo = も 321 | lya = ゃ 322 | xya = ゃ 323 | ya = や 324 | lyu = ゅ 325 | xyu = ゅ 326 | yu = ゆ 327 | lyo = ょ 328 | xyo = ょ 329 | yo = よ 330 | ra = ら 331 | ri = り 332 | ryi = りぃ 333 | rye = りぇ 334 | rya = りゃ 335 | ryu = りゅ 336 | ryo = りょ 337 | ru = る 338 | re = れ 339 | ro = ろ 340 | lwa = ゎ 341 | xwa = ゎ 342 | wa = わ 343 | wo = を 344 | n = ん 345 | nn = ん 346 | xn = ん 347 | vu = ヴ 348 | va = ヴぁ 349 | vi = ヴぃ 350 | vyi = ヴぃ 351 | ve = ヴぇ 352 | vye = ヴぇ 353 | vo = ヴぉ 354 | vya = ヴゃ 355 | vyu = ヴゅ 356 | vyo = ヴょ 357 | lka = ヵ 358 | xka = ヵ 359 | lke = ヶ 360 | xke = ヶ 361 | 362 | 363 | [PreeditStyle] 364 | 365 | 366 | [Setting] 367 | RomajiAllowSplit = true 368 | -------------------------------------------------------------------------------- /profile/nicola-a.sty: -------------------------------------------------------------------------------- 1 | # 2 | # nicola-a.sty - NICOLA A type layout definition file 3 | # Copyright (C) 2005 Hatuka*nezumi 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not write to the Free Software 17 | # Foundation Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # 19 | 20 | FormatVersion = 0.0.0 21 | Title = NICOLA A型配列 22 | Version = 0.0.0 23 | 24 | [NICOLATable/FundamentalTable] 25 | # non modifiered keys 26 | '=' 27 | 1=1,?,? 28 | 2=2,/,/ 29 | 3=3 30 | 4=4,「,「 31 | 5=5,」,」 32 | 6=6,[,[ 33 | 7=7,],] 34 | 8=8 35 | 9=9,(,( 36 | 0=0,),) 37 | -=− 38 | \=== 39 | 40 | q=。,ぁ,ゐ 41 | w=か,え,が 42 | e=た,り,だ 43 | r=こ,ゃ,ご 44 | t=さ,れ,ざ 45 | y=ら,ぱ,よ 46 | u=ち,ぢ,に 47 | i=く,ぐ,る 48 | o=つ,づ,ま 49 | p=,,ぴ,ぇ 50 | \[=、,, 51 | \]=゛,,゜ 52 | \\= 53 | 54 | a=う,を,ヴ 55 | s=し,あ,じ 56 | d=て,な,で 57 | f=け,ゅ,げ 58 | g=せ,も,ぜ 59 | h=は,ば,み 60 | j=と,ど,お 61 | k=き,ぎ,の 62 | l=い,ぽ,ょ 63 | ;=ん,,っ 64 | '= 65 | 66 | z=.,ぅ,ゑ 67 | x=ひ,ー,び 68 | c=す,ろ,ず 69 | v=ふ,や,ぶ 70 | b=へ,ぃ,べ 71 | n=め,ぷ,ぬ 72 | m=そ,ぞ,ゆ 73 | ,=ね,ぺ,む 74 | .=ほ,ぼ,わ 75 | /=・,ゎ,ぉ 76 | 77 | # shift modifiered keys 78 | ~=〜 79 | !=! 80 | @=@ 81 | \#=# 82 | $=$ 83 | %=% 84 | ^=^ 85 | &=& 86 | *=* 87 | (=( 88 | )=) 89 | _=_ 90 | +=+ 91 | 92 | H=ぱ 93 | X=ぴ 94 | V=ぷ 95 | B=ぺ 96 | >=ぽ 97 | -------------------------------------------------------------------------------- /profile/nicola-f.sty: -------------------------------------------------------------------------------- 1 | # 2 | # nicola-f.sty - NICOLA F type layout definition file 3 | # Copyright (C) 2005 Hatuka*nezumi 4 | # Copyright (C) 2005 MORIYAMA Masayuki 5 | # 6 | # This program is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 2 or (at your option) 9 | # any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; if not write to the Free Software 18 | # Foundation Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | # 20 | 21 | FormatVersion = 0.0.0 22 | Title = NICOLA F型配列 23 | Version = 0.0.0 24 | 25 | [NICOLATable/FundamentalTable] 26 | # non modifiered keys 27 | 1=1,?,? 28 | 2=2,/,/ 29 | 3=3,〜,〜 30 | 4=4,「,「 31 | 5=5,」,」 32 | 6=6,[,[ 33 | 7=7,],] 34 | 8=8,(,( 35 | 9=9,),) 36 | 0=0,『,『 37 | -=−,』,』 38 | ^=^,, 39 | \\=¥,, 40 | 41 | q=。,ぁ,ゐ 42 | w=か,え,が 43 | e=た,り,だ 44 | r=こ,ゃ,ご 45 | t=さ,れ,ざ 46 | y=ら,ぱ,よ 47 | u=ち,ぢ,に 48 | i=く,ぐ,る 49 | o=つ,づ,ま 50 | p=,,ぴ,ぇ 51 | @= 52 | \[=゛,,゜ 53 | 54 | a=う,を,ヴ 55 | s=し,あ,じ 56 | d=て,な,で 57 | f=け,ゅ,げ 58 | g=せ,も,ぜ 59 | h=は,ば,み 60 | j=と,ど,お 61 | k=き,ぎ,の 62 | l=い,ぽ,ょ 63 | ;=ん,,っ 64 | :=、,, 65 | \]= 66 | 67 | z=.,ぅ,ゑ 68 | x=ひ,ー,び 69 | c=す,ろ,ず 70 | v=ふ,や,ぶ 71 | b=へ,ぃ,べ 72 | n=め,ぷ,ぬ 73 | m=そ,ぞ,ゆ 74 | ,=ね,ぺ,む 75 | .=ほ,ぼ,わ 76 | /=・,ゎ,ぉ 77 | 78 | # shift modifiered keys 79 | !=! 80 | "=” 81 | \#=# 82 | $=$ 83 | %=% 84 | &=& 85 | '=’ 86 | (=( 87 | )=) 88 | 89 | \=== 90 | ~= ̄ 91 | |=| 92 | 93 | H=ぱ 94 | X=ぴ 95 | V=ぷ 96 | B=ぺ 97 | >=ぽ 98 | -------------------------------------------------------------------------------- /profile/nicola-j.sty: -------------------------------------------------------------------------------- 1 | # 2 | # nicola-j.sty - NICOLA J type layout definition file 3 | # Copyright (C) 2005 Hatuka*nezumi 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not write to the Free Software 17 | # Foundation Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # 19 | 20 | FormatVersion = 0.0.0 21 | Title = NICOLA J型配列 22 | Version = 0.0.0 23 | 24 | [NICOLATable/FundamentalTable] 25 | # non modifiered keys 26 | 1=1,?,? 27 | 2=2,/,/ 28 | 3=3,〜,〜 29 | 4=4,「,「 30 | 5=5,」,」 31 | 6=6,[,[ 32 | 7=7,],] 33 | 8=8,(,( 34 | 9=9,),) 35 | 0=0,『,『 36 | -=−,』,』 37 | ^=^,, 38 | \\=¥,, 39 | 40 | q=。,ぁ,ゐ 41 | w=か,え,が 42 | e=た,り,だ 43 | r=こ,ゃ,ご 44 | t=さ,れ,ざ 45 | y=ら,ぱ,よ 46 | u=ち,ぢ,に 47 | i=く,ぐ,る 48 | o=つ,づ,ま 49 | p=,,ぴ,ぇ 50 | @=、,, 51 | \[=゛,,゜ 52 | 53 | a=う,を,ヴ 54 | s=し,あ,じ 55 | d=て,な,で 56 | f=け,ゅ,げ 57 | g=せ,も,ぜ 58 | h=は,ば,み 59 | j=と,ど,お 60 | k=き,ぎ,の 61 | l=い,ぽ,ょ 62 | ;=ん,,っ 63 | := 64 | \]= 65 | 66 | z=.,ぅ,ゑ 67 | x=ひ,ー,び 68 | c=す,ろ,ず 69 | v=ふ,や,ぶ 70 | b=へ,ぃ,べ 71 | n=め,ぷ,ぬ 72 | m=そ,ぞ,ゆ 73 | ,=ね,ぺ,む 74 | .=ほ,ぼ,わ 75 | /=・,ゎ,ぉ 76 | 77 | # shift modifiered keys 78 | !=! 79 | "=” 80 | \#=# 81 | $=$ 82 | %=% 83 | &=& 84 | '=’ 85 | (=( 86 | )=) 87 | 88 | \=== 89 | ~= ̄ 90 | |=| 91 | 92 | H=ぱ 93 | X=ぴ 94 | V=ぷ 95 | B=ぺ 96 | >=ぽ 97 | -------------------------------------------------------------------------------- /profile/oasys100j.sty: -------------------------------------------------------------------------------- 1 | # 2 | # oasys100j.sty - OASYS 100J like layout definition file 3 | # Copyright (C) 2005 Hatuka*nezumi 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not write to the Free Software 17 | # Foundation Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # 19 | 20 | FormatVersion = 0.0.0 21 | Title = OASYS 100J互換配列 22 | Version = 0.0.0 23 | 24 | [NICOLATable/FundamentalTable] 25 | # non modifiered keys 26 | 1=1 ? ? 27 | 2=2 / / 28 | 3=3 〜 〜 29 | 4=4 「 「 30 | 5=5 」 」 31 | 6=6 [ [ 32 | 7=7 ] ] 33 | 8=8 ( ( 34 | 9=9 ) ) 35 | 0=0 『 『 36 | -=― 』 』 37 | ^=| ¥ ¥ 38 | \\= 39 | 40 | q=。 ぁ ゐ 41 | w=か え が 42 | e=た り だ 43 | r=こ ゃ ご 44 | t=さ れ ざ 45 | y=ら ぱ よ 46 | u=ち ぢ に 47 | i=く ぐ る 48 | o=つ づ ま 49 | p=, ぴ ぇ 50 | @=、 − − 51 | \[=゛ ゜ 52 | 53 | a=う を ヴ 54 | s=し あ じ 55 | d=て な で 56 | f=け ゅ げ 57 | g=せ も ぜ 58 | h=は ば み 59 | j=と ど お 60 | k=き ぎ の 61 | l=い ぽ ょ 62 | ;=ん っ 63 | := 64 | \]= 65 | 66 | z=. ぅ ゑ 67 | x=ひ ー び 68 | c=す ろ ず 69 | v=ふ や ぶ 70 | b=へ ぃ べ 71 | n=め ぷ ぬ 72 | m=そ ぞ ゆ 73 | =ね ぺ む 74 | .=ほ ぼ わ 75 | /=・ ゎ ぉ 76 | 77 | # shift modifiered keys 78 | !=! 79 | "=” 80 | \#=# 81 | $=$ 82 | %=% 83 | &=& 84 | '=’ 85 | (=( 86 | )=) 87 | 88 | \=== 89 | ~=“ 90 | |= 91 | 92 | H=ぱ 93 | X=ぴ 94 | V=ぷ 95 | B=ぺ 96 | >=ぽ 97 | -------------------------------------------------------------------------------- /profile/qkana.sty: -------------------------------------------------------------------------------- 1 | # 2 | # qkana.sty - Quick kana typing table 3 | # Copyright (C) 2015 Mellon 4 | # Based on 101英語キーボード用かな配列 by Takuro Ashie 5 | # 6 | # This program is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 2 or (at your option) 9 | # any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; if not write to the Free Software 18 | # Foundation Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | # 20 | 21 | FormatVersion = 0.0.0 22 | Title = Quick kana 23 | Version = 0.0.0 24 | 25 | [KanaTable/FundamentalTable] 26 | # non modifiered keys 27 | `=ろ 28 | 1=ぬ 29 | 2= ふ 30 | 3=あ 31 | 4=う 32 | 5=え 33 | 6=お 34 | 7=や 35 | 8=ゆ 36 | 9=よ 37 | 0=わ 38 | -= ほ 39 | \== へ 40 | 41 | q= た 42 | w= て 43 | e=い 44 | r= す 45 | t= か 46 | y=ん 47 | u=な 48 | i=に 49 | o=ら 50 | p= せ 51 | \[=゛ 52 | \]=゜ 53 | \\=む 54 | 55 | a= ち 56 | s= と 57 | d= し 58 | f= は 59 | g= き 60 | h= く 61 | j=ま 62 | k=の 63 | l=り 64 | ;=れ 65 | '= け 66 | 67 | z= つ 68 | x= さ 69 | c= そ 70 | v= ひ 71 | b= こ 72 | n=み 73 | m=も 74 | \,=ね 75 | .=る 76 | /=め 77 | 78 | # shift modifiered keys 79 | ~=を 80 | !=ぬ 81 | @=ぶ 82 | \#=ぁ 83 | $=ぅ 84 | %=ぇ 85 | ^=ぉ 86 | &=ゃ 87 | *=ゅ 88 | (=ょ 89 | )=を 90 | _=ぼ 91 | +=べ 92 | 93 | Q=だ 94 | W=で 95 | E=ぃ 96 | R=ず 97 | T=が 98 | Y=ん 99 | U=な 100 | I= ゐ 101 | O= ゎ 102 | P=ぜ 103 | {=「 104 | }=」 105 | |=ー 106 | 107 | A=ぢ 108 | S=ど 109 | D=じ 110 | F=ば 111 | G=ぎ 112 | H=ぐ 113 | J=ま 114 | K=ゑ 115 | L=ヵ 116 | :=ヶ 117 | "=げ 118 | 119 | Z=っ 120 | X=ざ 121 | C=ぞ 122 | V=び 123 | B= ご 124 | N=み 125 | M=も 126 | ?=・ 127 | -------------------------------------------------------------------------------- /profile/tron-dvorak.sty: -------------------------------------------------------------------------------- 1 | # 2 | # tron-dvorak.sty - TRON type layout definition file 3 | # Copyright (C) 2005 Okano Shinchi 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not write to the Free Software 17 | # Foundation Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # 19 | 20 | FormatVersion = 0.0.0 21 | Title = TRON配列 22 | Version = 0.0.0 23 | 24 | [NICOLATable/FundamentalTable] 25 | # non modifiered keys 26 | 1=1,…,〜 27 | 2=2,`,’ 28 | 3=3,“,” 29 | 4=4,「,」 30 | 5=5,『,』 31 | 6=6,<,> 32 | 7=7,(,) 33 | 8=8,{,} 34 | 9=9,[,] 35 | 0=0,\,| 36 | !=1,…,〜 37 | @=2,`,’ 38 | \#=3,“,” 39 | $=4,「,」 40 | %=5,『,』 41 | ^=6,<,> 42 | &=7,(,) 43 | *=8,{,} 44 | (=9,[,] 45 | )=0,\,| 46 | "=ら,ひ,び 47 | '=ら,ひ,び 48 | <=る,そ,ぞ 49 | ,=る,そ,ぞ 50 | >=こ,・,ご 51 | .=こ,・,ご 52 | p=は,ゃ,ば 53 | y=ょ,ほ,ぼ 54 | f=き,ぎ,え 55 | g=の,げ,け 56 | c=く,ぐ,め 57 | r=あ,,む 58 | l=れ,ゐ,ろ 59 | a=た,ぬ,だ 60 | o=と,ね,ど 61 | e=か,ゅ,が 62 | u=て,よ,で 63 | i=も,ふ,ぶ 64 | d=を,゛,お 65 | h=い,ぢ,ち 66 | t=う,ヴ,ー 67 | n=し,じ,み 68 | s=ん,ゑ,や 69 | ;=ま,ぇ,ヵ 70 | :=ま,ぇ,ヵ 71 | q=り,ぉ,ヶ 72 | j=に,せ,ぜ 73 | k=さ,ゆ,ざ 74 | x=な,へ,べ 75 | b=す,ず,わ 76 | m=つ,づ,ぃ 77 | w=、,\,,ぁ 78 | v=。,.,゜ 79 | z=っ,ゎ,ぅ 80 | 81 | +=−,+,÷ 82 | \==−,+,÷ 83 | \[==,#,% 84 | {==,#,% 85 | /=/,*,× 86 | ?=/,*,× 87 | 88 | \\=@,$,¥ 89 | |=@,$,¥ 90 | \]=_,!,! 91 | }=_,!,! 92 | -=_,?,? 93 | _=_,?,? 94 | -------------------------------------------------------------------------------- /profile/tron-qwerty-jp.sty: -------------------------------------------------------------------------------- 1 | # 2 | # tron-qwerty-jp.sty - TRON type layout definition file 3 | # Copyright (C) 2005 Okano Shinchi 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not write to the Free Software 17 | # Foundation Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # 19 | 20 | FormatVersion = 0.0.0 21 | Title = TRON-QWERTY-JP配列 22 | Version = 0.0.0 23 | 24 | [NICOLATable/FundamentalTable] 25 | # non modifiered keys 26 | 1=1,…,〜 27 | 2=2,`,’ 28 | 3=3,“,” 29 | 4=4,「,」 30 | 5=5,『,』 31 | 6=6,<,> 32 | 7=7,(,) 33 | 8=8,{,} 34 | 9=9,[,] 35 | 0=0,\,| 36 | !=1,…,〜 37 | "=2,`,’ 38 | \#=3,“,” 39 | $=4,「,」 40 | %=5,『,』 41 | &=6,<,> 42 | '=7,(,) 43 | (=8,{,} 44 | )=9,[,] 45 | ~=0,\,| 46 | q=ら,ひ,び 47 | w=る,そ,ぞ 48 | e=こ,・,ご 49 | r=は,ゃ,ば 50 | t=ょ,ほ,ぼ 51 | y=き,ぎ,え 52 | u=の,げ,け 53 | i=く,ぐ,め 54 | o=あ,,む 55 | #o=あ,ぷ,む 56 | p=れ,ゐ,ろ 57 | #p=れ,ぽ,ろ 58 | a=た,ぬ,だ 59 | s=と,ね,ど 60 | d=か,ゅ,が 61 | f=て,よ,で 62 | g=も,ふ,ぶ 63 | h=を,゛,お 64 | j=い,ぢ,ち 65 | k=う,ヴ,ー 66 | l=し,じ,み 67 | ;=ん,ゑ,や 68 | :=ん,ゑ,や 69 | #;=ん,ぱ,や 70 | #:=ん,ぱ,や 71 | z=ま,ぇ,ヵ 72 | #z=ま,ぇ,ぴ 73 | x=り,ぉ,ヶ 74 | #x=り,ぉ,ぺ 75 | c=に,せ,ぜ 76 | v=さ,ゆ,ざ 77 | b=な,へ,べ 78 | n=す,ず,わ 79 | m=つ,づ,ぃ 80 | ,=、,\,,ぁ 81 | <=、,\,,ぁ 82 | .=。,.,゜ 83 | >=。,.,゜ 84 | /=っ,ゎ,ぅ 85 | 86 | -=−,+,÷ 87 | \==−,+,÷ 88 | \[==,#,% 89 | {==,#,% 90 | \]=/,*,× 91 | }=/,*,× 92 | 93 | @=@,$,¥ 94 | `=@,$,¥ 95 | ^=_,!,! 96 | ~=_,!,! 97 | \\=_,?,? 98 | _=_,?,? 99 | -------------------------------------------------------------------------------- /profile/tsuki-2-203-101.sty: -------------------------------------------------------------------------------- 1 | # 2 | # tsuki-2-203_106.sty - Tsuki 2-236 style for 101 US keybord 3 | # Copyright (C) 2006 Tatsuki Sugiura 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not write to the Free Software 17 | # Foundation Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # 19 | 20 | FormatVersion = 0.0.0 21 | Title = 月 (2-263) 101US 22 | Version = 0.0.2 23 | 24 | # Override fundamental table 25 | [KanaTable/FundamentalTable] 26 | q= そ 27 | w= こ 28 | e= し 29 | r= て 30 | t=ょ 31 | y= つ 32 | u=ん 33 | i=い 34 | o=の 35 | p=り 36 | \[= ち 37 | a= は 38 | s= か 39 | f= と 40 | g= た 41 | h= く 42 | j=う 43 | l=゛ 44 | ;= き 45 | '=れ 46 | z= す 47 | x= け 48 | c=に 49 | v=な 50 | b= さ 51 | n=っ 52 | m=る 53 | ,=、 54 | .=。 55 | /=゜ 56 | \\=・ 57 | d\\=? 58 | kq=ぁ 59 | kw= ひ 60 | ke= ほ 61 | kr= ふ 62 | kt=め 63 | ka=ぃ 64 | ks=を 65 | kd=ら 66 | kf=あ 67 | kg=よ 68 | kz=ぅ 69 | kx= へ 70 | kc= せ 71 | kv=ゅ 72 | kb=ゃ 73 | dy=ぬ 74 | du=え 75 | di=み 76 | do=や 77 | dp=ぇ 78 | d\[=「 79 | dh=ま 80 | dj=お 81 | dk=も 82 | dl=わ 83 | d;=ゆ 84 | d'=」 85 | dn=む 86 | dm=ろ 87 | d,=ね 88 | d.=ー 89 | d/=ぉ 90 | -------------------------------------------------------------------------------- /profile/tsuki-2-203-106.sty: -------------------------------------------------------------------------------- 1 | # 2 | # tsuki-2-203_106.sty - Tsuki 2-236 style for 106/109 JP keybord 3 | # Copyright (C) 2006 Tatsuki Sugiura 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not write to the Free Software 17 | # Foundation Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # 19 | 20 | FormatVersion = 0.0.0 21 | Title = 月 (2-263) 106JP 22 | Version = 0.0.2 23 | 24 | # Override fundamental table 25 | [KanaTable/FundamentalTable] 26 | q= そ 27 | w= こ 28 | e= し 29 | r= て 30 | t=ょ 31 | y= つ 32 | u=ん 33 | i=い 34 | o=の 35 | p=り 36 | @= ち 37 | a= は 38 | s= か 39 | f= と 40 | g= た 41 | h= く 42 | j=う 43 | l=゛ 44 | ;= き 45 | :=れ 46 | z= す 47 | x= け 48 | c=に 49 | v=な 50 | b= さ 51 | n=っ 52 | m=る 53 | ,=、 54 | .=。 55 | /=゜ 56 | \\=・ 57 | d\\=? 58 | kq=ぁ 59 | kw= ひ 60 | ke= ほ 61 | kr= ふ 62 | kt=め 63 | ka=ぃ 64 | ks=を 65 | kd=ら 66 | kf=あ 67 | kg=よ 68 | kz=ぅ 69 | kx= へ 70 | kc= せ 71 | kv=ゅ 72 | kb=ゃ 73 | dy=ぬ 74 | du=え 75 | di=み 76 | do=や 77 | dp=ぇ 78 | d@=「 79 | dh=ま 80 | dj=お 81 | dk=も 82 | dl=わ 83 | d;=ゆ 84 | d:=」 85 | dn=む 86 | dm=ろ 87 | d,=ね 88 | d.=ー 89 | d/=ぉ 90 | 91 | -------------------------------------------------------------------------------- /profile/vje-delta.sty: -------------------------------------------------------------------------------- 1 | # 2 | # vje-delta.sty - VACS VJE-Delta like style definition file for scim-anthy. 3 | # Copyright (C) 2005 Takuro Ashie 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not write to the Free Software 17 | # Foundation Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # 19 | 20 | FormatVersion = 0.0.0 21 | Title = VJE-Delta 22 | Version = 0.0.0 23 | 24 | [KeyBindings] 25 | CircleInputModeKey = 26 | CircleKanaModeKey = 27 | LatinModeKey = 28 | WideLatinModeKey = 29 | HiraganaModeKey = CTRL_F6 CTRL_SHIFT_J 30 | KatakanaModeKey = CTRL_F7 CTRL_SHIFT_K 31 | HalfKatakanaModeKey = 32 | CircleTypingMethodKey = CTRL_F3 CTRL_SHIFT_R 33 | 34 | ConvertKey = SPACE HENKAN 35 | CancelKey = ESCAPE 36 | CancelAllKey = SHIFT_BACKSPACE CTRL_y CTRL_Y 37 | CommitKey = ENTER 38 | 39 | InsertSpaceKey = SPACE 40 | InsertAltSpaceKey = SHIFT_SPACE 41 | BackSpaceKey = BACKSPACE CTRL_H 42 | DeleteKey = DELETE CTRL_G 43 | 44 | MoveCaretBackwardKey = LEFT CTRL_S 45 | MoveCaretForwardKey = RIGHT CTRL_D 46 | MoveCaretFirstKey = 47 | MoveCaretLastKey = 48 | 49 | SelectPrevSegmentKey = LEFT CTRL_S 50 | SelectNextSegmentKey = RIGHT CTRL_D 51 | SelectFirstSegmentKey = PGUP CTRL_A 52 | SelectLastSegmentKey = PGDN CTRL_F 53 | ExpandSegmentKey = SHIFT_RIGHT CTRL_W 54 | ShrinkSegmentKey = SHIFT_LEFT CTRL_Q 55 | CommitSelectedSegmentKey = 56 | 57 | CandidatesPageUpKey = SHIFT_UP CTRL_E 58 | CandidatesPageDownKey = SHIFT_DOWN CTRL_X 59 | SelectNextCandidateKey = SPACE HENKAN 60 | SelectPrevCandidateKey = UP 61 | 62 | ConvertToHiraganaKey = F6 CTRL_J 63 | ConvertToKatakanaKey = F7 CTRL_K 64 | ConvertToHalfKey = F9 CTRL_O 65 | ConvertToHalfKatakanaKey = 66 | ConvertToWideLatinKey = F8 CTRL_L 67 | ConvertToLatinKey = 68 | 69 | AddWordKey = 70 | 71 | 72 | # Override fundamental table 73 | [RomajiTable/FundamentalTable] 74 | - = ー 75 | #[ = 「 76 | #] = 」 77 | a = あ 78 | i = い 79 | u = う 80 | e = え 81 | o = お 82 | xa = ぁ 83 | xi = ぃ 84 | xu = ぅ 85 | xe = ぇ 86 | xo = ぉ 87 | ka = か 88 | ki = き 89 | ku = く 90 | ke = け 91 | ko = こ 92 | xka = ヵ 93 | xke = ヶ 94 | kya = きゃ 95 | kyi = きぃ 96 | kyu = きゅ 97 | cu = きゅ 98 | kye = きぇ 99 | kyo = きょ 100 | kwa = くぁ 101 | qa = くぁ 102 | kwi = くぃ 103 | qi = くぃ 104 | kwe = くぇ 105 | qe = くぇ 106 | kwo = くぉ 107 | qo = くぉ 108 | qya = くゃ 109 | qyi = くぃ 110 | qyu = くゅ 111 | qye = くぇ 112 | quo = くょ 113 | sa = さ 114 | si = し 115 | shi = し 116 | ci = し 117 | su = す 118 | se = せ 119 | ce = せ 120 | so = そ 121 | sya = しゃ 122 | sha = しゃ 123 | syi = しぃ 124 | syu = しゅ 125 | shu = しゅ 126 | sye = しぇ 127 | she = しぇ 128 | syo = しょ 129 | sho = しょ 130 | ta = た 131 | ti = ち 132 | chi = ち 133 | tu = つ 134 | tsu = つ 135 | te = て 136 | to = と 137 | tya = ちゃ 138 | cya = ちゃ 139 | cha = ちゃ 140 | tyi = ちぃ 141 | cyi = ちぃ 142 | tyu = ちゅ 143 | cyu = ちゅ 144 | chu = ちゅ 145 | tye = ちぇ 146 | cye = ちぇ 147 | che = ちぇ 148 | tyo = ちょ 149 | cyo = ちょ 150 | cho = ちょ 151 | xtu = っ 152 | tsa = つぁ 153 | tsi = つぃ 154 | tse = つぇ 155 | tso = つぉ 156 | tha = てゃ 157 | thi = てぃ 158 | thu = てゅ 159 | the = てぇ 160 | tho = てょ 161 | twu = とぅ 162 | na = な 163 | ni = に 164 | nu = ぬ 165 | ne = ね 166 | no = の 167 | nya = にゃ 168 | nyi = にぃ 169 | nyu = にゅ 170 | nye = にぇ 171 | nyo = にょ 172 | ha = は 173 | hi = ひ 174 | hu = ふ 175 | fu = ふ 176 | he = へ 177 | ho = ほ 178 | hya = ひゃ 179 | hyi = ひぃ 180 | hyu = ひゅ 181 | hye = ひぇ 182 | hyo = ひょ 183 | fa = ふぁ 184 | fi = ふぃ 185 | fe = ふぇ 186 | fo = ふぉ 187 | fya = ふゃ 188 | fyi = ふぃ 189 | fyu = ふゅ 190 | fye = ふぇ 191 | fyo = ふょ 192 | ma = ま 193 | mi = み 194 | mu = む 195 | me = め 196 | mo = も 197 | mya = みゃ 198 | myi = みぃ 199 | myu = みゅ 200 | mye = みぇ 201 | myo = みょ 202 | ya = や 203 | yi = い 204 | yu = ゆ 205 | ye = いぇ 206 | yo = よ 207 | xya = ゃ 208 | xyi = ぃ 209 | xyu = ゅ 210 | xye = ぇ 211 | xyo = ょ 212 | la = ら 213 | ra = ら 214 | li = り 215 | ri = り 216 | lu = る 217 | ru = る 218 | le = れ 219 | re = れ 220 | lo = ろ 221 | ro = ろ 222 | lya = りゃ 223 | rya = りゃ 224 | lyi = りぃ 225 | ryi = りぃ 226 | lyu = りゅ 227 | ryu = りゅ 228 | lye = りぇ 229 | rye = りぇ 230 | lyo = りょ 231 | ryo = りょ 232 | wa = わ 233 | wi = うぃ 234 | wu = う 235 | we = うぇ 236 | wo = を 237 | xwa = ゎ 238 | wha = うぁ 239 | whi = うぃ 240 | whu = う 241 | whe = うぇ 242 | who = うぉ 243 | nn = ん 244 | n' = ん 245 | ga = が 246 | gi = ぎ 247 | gu = ぐ 248 | ge = げ 249 | go = ご 250 | gwa = ぐぁ 251 | gwi = ぐぃ 252 | gwu = ぐゅ 253 | gwe = ぐぇ 254 | gwo = ぐぉ 255 | gya = ぎゃ 256 | gyi = ぎぃ 257 | gyu = ぎゅ 258 | gye = ぎぇ 259 | gyo = ぎょ 260 | za = ざ 261 | zi = じ 262 | ji = じ 263 | zu = ず 264 | ze = ぜ 265 | zo = ぞ 266 | zya = じゃ 267 | ja = じゃ 268 | jya = じゃ 269 | zyi = じぃ 270 | ji = じぃ 271 | jyi = じぃ 272 | zyu = じゅ 273 | ju = じゅ 274 | jyu = じゅ 275 | zye = じぇ 276 | je = じぇ 277 | jye = じぇ 278 | zyo = じょ 279 | jo = じょ 280 | jyo = じょ 281 | da = だ 282 | di = ぢ 283 | du = づ 284 | de = で 285 | do = ど 286 | dya = ぢゃ 287 | dyi = でぃ 288 | dyu = ぢゅ 289 | dye = ぢぇ 290 | dyo = ぢょ 291 | dha = でゃ 292 | dhi = でぃ 293 | dhu = でゅ 294 | dhe = でぇ 295 | dho = でょ 296 | dwu = どぅ 297 | ba = ば 298 | bi = び 299 | bu = ぶ 300 | be = べ 301 | bo = ぼ 302 | bya = びゃ 303 | byi = びぃ 304 | byu = びゅ 305 | bye = びぇ 306 | byo = びょ 307 | pa = ぱ 308 | pi = ぴ 309 | pu = ぷ 310 | pe = ぺ 311 | po = ぽ 312 | pya = ぴゃ 313 | pyi = ぴぃ 314 | pyu = ぴゅ 315 | pye = ぴぇ 316 | pyo = ぴょ 317 | va = ヴぁ 318 | vi = ヴぃ 319 | vu = ヴぅ 320 | ve = ヴぇ 321 | vo = ヴぉ 322 | vya = ヴゃ 323 | vyi = ヴぃ 324 | vyu = ヴゅ 325 | vye = ヴぇ 326 | vyo = ヴょ 327 | -------------------------------------------------------------------------------- /profile/wnn.sty: -------------------------------------------------------------------------------- 1 | # 2 | # wnn.sty - Wnn like style definition file for scim-anthy. 3 | # Copyright (C) 2005 Takuro Ashie 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not write to the Free Software 17 | # Foundation Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # 19 | 20 | FormatVersion = 0.0.0 21 | Title = Wnn 22 | Version = 0.0.0 23 | 24 | [KeyBindings] 25 | CircleInputModeKey = 26 | CircleKanaModeKey = 27 | LatinModeKey = 28 | WideLatinModeKey = 29 | HiraganaModeKey = 30 | KatakanaModeKey = 31 | HalfKatakanaModeKey = 32 | CircleTypingMethodKey = 33 | 34 | ConvertKey = SPACE 35 | PredictKey = CTRL_Q 36 | CancelKey = ESCAPE CTRL_G 37 | CommitKey = CTRL_L CTRL_M 38 | 39 | InsertSpaceKey = SPACE 40 | InsertAltSpaceKey = 41 | BackSpaceKey = CTRL_H BACKSPACE 42 | DeleteKey = CTRL_D DELETE 43 | 44 | MoveCaretBackwardKey = CTRL_B LEFT 45 | MoveCaretForwardKey = CTRL_F RIGHT 46 | MoveCaretFirstKey = CTRL_A Alt+LEFT 47 | MoveCaretLastKey = CTRL_E Alt+RIGHT 48 | 49 | SelectPrevSegmentKey = CTRL_B LEFT 50 | SelectNextSegmentKey = CTRL_F RIGHT 51 | SelectFirstSegmentKey = CTRL_A Alt+LEFT 52 | SelectLastSegmentKey = CTRL_E Alt+RIGHT 53 | ExpandSegmentKey = CTRL_O F14 54 | ShrinkSegmentKey = CTRL_I F13 55 | CommitSelectedSegmentKey = 56 | 57 | CandidatesPageUpKey = Tab 58 | CandidatesPageDownKey = SHIFT_TAB 59 | SelectNextCandidateKey = SPACE CTRL_Q 60 | SelectNextCandidateKeyAlter = CTRL_P UP 61 | SelectPrevCandidateKey = CTRL_N DOWN 62 | 63 | ConvertToHiraganaKey = F6 64 | ConvertToKatakanaKey = F7 65 | ConvertToHalfKey = F8 66 | ConvertToHalfKatakanaKey = 67 | ConvertToWideLatinKey = F9 68 | ConvertToLatinKey = F10 69 | 70 | AddWordKey = 71 | 72 | # Override fundamental table 73 | [RomajiTable/FundamentalTable] 74 | - = ー 75 | #/ = ・ 76 | #[ = 「 77 | #] = 」 78 | z. = … 79 | z- = 〜 80 | a = あ 81 | i = い 82 | u = う 83 | e = え 84 | o = お 85 | ka = か 86 | ki = き 87 | ku = く 88 | ke = け 89 | ko = こ 90 | kya = きゃ 91 | kyi = きぃ 92 | kyu = きゅ 93 | kye = きぇ 94 | kyo = きょ 95 | sa = さ 96 | si = し 97 | su = す 98 | se = せ 99 | so = そ 100 | sya = しゃ 101 | syi = しぃ 102 | syu = しゅ 103 | sye = しぇ 104 | syo = しょ 105 | sha = しゃ 106 | shi = し 107 | shu = しゅ 108 | she = しぇ 109 | sho = しょ 110 | ta = た 111 | ti = ち 112 | tu = つ 113 | te = て 114 | to = と 115 | tya = ちゃ 116 | tyi = てぃ 117 | tyu = ちゅ 118 | tye = ちぇ 119 | tyo = ちょ 120 | tha = てゃ 121 | thi = てぃ 122 | thu = てゅ 123 | the = てぇ 124 | tho = てょ 125 | tsu = つ 126 | cha = ちゃ 127 | chi = ち 128 | chu = ちゅ 129 | che = ちぇ 130 | cho = ちょ 131 | na = な 132 | ni = に 133 | nu = ぬ 134 | ne = ね 135 | no = の 136 | nya = にゃ 137 | nyi = にぃ 138 | nyu = にゅ 139 | nye = にぇ 140 | nyo = にょ 141 | ha = は 142 | hi = ひ 143 | hu = ふ 144 | he = へ 145 | ho = ほ 146 | hya = ひゃ 147 | hyi = ひぃ 148 | hyu = ひゅ 149 | hye = ひぇ 150 | hyo = ひょ 151 | fa = ふぁ 152 | fi = ふぃ 153 | fu = ふ 154 | fe = ふぇ 155 | fo = ふぉ 156 | fya = ふゃ 157 | fyi = ふぃ 158 | fyu = ふゅ 159 | fye = ふぇ 160 | fyo = ふょ 161 | ma = ま 162 | mi = み 163 | mu = む 164 | me = め 165 | mo = も 166 | mya = みゃ 167 | myu = みゅ 168 | mye = みぇ 169 | myo = みょ 170 | ya = や 171 | yi = い 172 | yu = ゆ 173 | ye = いぇ 174 | yo = よ 175 | ra = ら 176 | ri = り 177 | ru = る 178 | re = れ 179 | ro = ろ 180 | la = ら 181 | li = り 182 | lu = る 183 | le = れ 184 | lo = ろ 185 | rya = りゃ 186 | ryi = りぃ 187 | ryu = りゅ 188 | rye = りぇ 189 | ryo = りょ 190 | lya = りゃ 191 | lyi = りぃ 192 | lyu = りゅ 193 | lye = りぇ 194 | lyo = りょ 195 | wa = わ 196 | wi = ゐ 197 | wu = う 198 | we = ゑ 199 | wo = を 200 | ga = が 201 | gi = ぎ 202 | gu = ぐ 203 | ge = げ 204 | go = ご 205 | gya = ぎゃ 206 | gyi = ぎぃ 207 | gyu = ぎゅ 208 | gye = ぎぇ 209 | gyo = ぎょ 210 | za = ざ 211 | zi = じ 212 | zu = ず 213 | ze = ぜ 214 | zo = ぞ 215 | zya = じゃ 216 | zyi = じぃ 217 | zyu = じゅ 218 | zye = じぇ 219 | zyo = じょ 220 | ja = じゃ 221 | ji = じ 222 | ju = じゅ 223 | je = じぇ 224 | jo = じょ 225 | da = だ 226 | di = ぢ 227 | du = づ 228 | de = で 229 | do = ど 230 | dya = ぢゃ 231 | dyi = でぃ 232 | dyu = ぢゅ 233 | dye = ぢぇ 234 | dyo = ぢょ 235 | dha = でゃ 236 | dhi = でぃ 237 | dhu = でゅ 238 | dhe = でぇ 239 | dho = でょ 240 | ba = ば 241 | bi = び 242 | bu = ぶ 243 | be = べ 244 | bo = ぼ 245 | bya = びゃ 246 | byi = びゅ 247 | byu = びゅ 248 | bye = びぇ 249 | byo = びょ 250 | pa = ぱ 251 | pi = ぴ 252 | pu = ぷ 253 | pe = ぺ 254 | po = ぽ 255 | pya = ぴゃ 256 | pyi = ぴぃ 257 | pyu = ぴゅ 258 | pye = ぴぇ 259 | pyo = ぴょ 260 | va = ヴぁ 261 | vi = ヴぃ 262 | vu = ヴ 263 | ve = ヴぇ 264 | vo = ヴぉ 265 | kwa = くゎ 266 | kwi = くぃ 267 | kwu = く 268 | kwe = くぇ 269 | kwo = くぉ 270 | gwa = ぐゎ 271 | gwi = ぐぃ 272 | gwu = ぐ 273 | gwe = ぐぇ 274 | gwo = ぐぉ 275 | tsa = つぁ 276 | tsi = つぃ 277 | tse = つぇ 278 | tso = つぉ 279 | n = ん 280 | n' = ん 281 | nn = ん 282 | xa = ぁ 283 | xi = ぃ 284 | xu = ぅ 285 | xe = ぇ 286 | xo = ぉ 287 | xya = ゃ 288 | xyu = ゅ 289 | xyo = ょ 290 | xtu = っ 291 | xwa = ゎ 292 | xti = てぃ 293 | xdi = でぃ 294 | xdu = どぅ 295 | xde = でぇ 296 | xdo = どぉ 297 | xwi = うぃ 298 | xwe = うぇ 299 | xwo = うぉ 300 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories (${FCITX4_FCITX_INCLUDE_DIRS}) 2 | include_directories (${FCITX4_FCITX_CONFIG_INCLUDE_DIRS}) 3 | include_directories (${FCITX4_FCITX_UTILS_INCLUDE_DIRS}) 4 | 5 | set( fcitx_anthy_sources 6 | action.cpp 7 | style_file.cpp 8 | conversion.cpp 9 | default_tables.cpp 10 | factory.cpp 11 | kana.cpp 12 | key2kana.cpp 13 | key2kana_table.cpp 14 | preedit.cpp 15 | reading.cpp 16 | utils.cpp 17 | conversion.cpp 18 | imengine.cpp 19 | nicola.cpp 20 | ) 21 | 22 | add_definitions( -DLOCALEDIR=\"${CMAKE_INSTALL_PREFIX}/share/locale\" ) 23 | 24 | fcitx_add_addon_full(anthy DESC SOURCES ${fcitx_anthy_sources} 25 | IM_CONFIG anthy.conf 26 | LINK_LIBS ${ANTHY_TARGET}) 27 | -------------------------------------------------------------------------------- /src/action.cpp: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2005 Takuro Ashie 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | #include "action.h" 25 | #include "utils.h" 26 | 27 | Action::Action () : 28 | m_name(""), 29 | m_pmf(NULL), 30 | m_key_bindings(NULL) 31 | { 32 | } 33 | 34 | 35 | Action::Action (const std::string &name, FcitxHotkey* hotkey, PMF pmf) 36 | : m_name (name), 37 | m_pmf (pmf), 38 | m_key_bindings(hotkey) 39 | { 40 | } 41 | 42 | bool 43 | Action::perform (AnthyInstance *performer) 44 | { 45 | if (m_pmf) 46 | return (performer->*m_pmf) (); 47 | 48 | return false; 49 | } 50 | 51 | bool 52 | Action::perform (AnthyInstance *performer, const KeyEvent &key) 53 | { 54 | if (!m_pmf) 55 | return false; 56 | 57 | if (match_key_event (key)) { 58 | if (m_pmf) 59 | return (performer->*m_pmf) (); 60 | } 61 | 62 | return false; 63 | } 64 | 65 | bool 66 | Action::match_key_event (const KeyEvent &key) 67 | { 68 | return util_match_key_event (m_key_bindings, key, FcitxKeyState_CapsLock); 69 | } 70 | 71 | bool 72 | Action::match_action_name (const char *name) 73 | { 74 | return (m_name.compare (name) == 0); 75 | } 76 | -------------------------------------------------------------------------------- /src/action.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2005 Takuro Ashie 4 | * Copyright (C) 2012 CSSlayer 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __FCITX_ANTHY_ACTION_H__ 22 | #define __FCITX_ANTHY_ACTION_H__ 23 | 24 | #include 25 | #include "common.h" 26 | 27 | class AnthyInstance; 28 | 29 | typedef bool (AnthyInstance::*PMF) (void); 30 | 31 | class Action 32 | { 33 | 34 | public: 35 | 36 | Action(); 37 | Action (const std::string &name, FcitxHotkey* hotkey, PMF pmf); 38 | 39 | public: 40 | bool perform (AnthyInstance *performer); 41 | bool perform (AnthyInstance *performer, 42 | const KeyEvent &key); 43 | 44 | bool match_action_name (const char *name); 45 | 46 | bool operator < (const Action& b) { 47 | return m_name < b.m_name; 48 | } 49 | 50 | bool match_key_event (const KeyEvent &key); 51 | 52 | std::string m_name; 53 | std::string m_desc; 54 | PMF m_pmf; 55 | FcitxHotkey* m_key_bindings; 56 | }; 57 | 58 | #endif /* __FCITX_ANTHY_ACTION_H__ */ 59 | -------------------------------------------------------------------------------- /src/anthy.conf.in: -------------------------------------------------------------------------------- 1 | [InputMethod] 2 | UniqueName=anthy 3 | _Name=Anthy 4 | IconName=anthy 5 | Priority=5 6 | LangCode=ja 7 | Parent=fcitx-anthy -------------------------------------------------------------------------------- /src/common.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2012 CSSlayer 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef __FCITX_ANTHY_COMMON_H__ 21 | #define __FCITX_ANTHY_COMMON_H__ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #define FCITX_ANTHY_CONFIG_DICT_ENCODING_DEFAULT "UTF-8" 29 | 30 | class KeyEvent { 31 | public: 32 | FcitxKeySym sym; 33 | unsigned int state; 34 | unsigned int keycode; 35 | bool is_release; 36 | 37 | KeyEvent() { 38 | sym = FcitxKey_None; 39 | state = FcitxKeyState_None; 40 | is_release = false; 41 | } 42 | 43 | unsigned char get_ascii_code() const { 44 | 45 | if (sym >= FcitxKey_space && sym <= FcitxKey_asciitilde) 46 | return (char) sym; 47 | 48 | if (sym >= FcitxKey_KP_0 && sym <= FcitxKey_KP_9) 49 | return (char) (sym - FcitxKey_KP_0 + FcitxKey_0); 50 | 51 | if (sym == FcitxKey_Return) 52 | return 0x0d; 53 | if (sym == FcitxKey_Linefeed) 54 | return 0x0a; 55 | if (sym == FcitxKey_Tab) 56 | return 0x09; 57 | if (sym == FcitxKey_BackSpace) 58 | return 0x08; 59 | if (sym == FcitxKey_Escape) 60 | return 0x1b; 61 | 62 | return 0; 63 | } 64 | 65 | bool operator == (const KeyEvent& event) const { 66 | return sym == event.sym && state == event.state; 67 | } 68 | 69 | bool empty() const { 70 | return sym == FcitxKey_None; 71 | } 72 | }; 73 | 74 | #define _(x) dgettext("fcitx-anthy", (x)) 75 | 76 | typedef std::vector KeyEventList; 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /src/conversion.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2005 Takuro Ashie 4 | * Copyright (C) 2012 CSSlayer 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __FCITX_ANTHY_CONVERSION_H__ 22 | #define __FCITX_ANTHY_CONVERSION_H__ 23 | 24 | #include 25 | #include 26 | #include "reading.h" 27 | 28 | class AnthyInstance; 29 | 30 | typedef enum { 31 | FCITX_ANTHY_CANDIDATE_DEFAULT = 0, 32 | FCITX_ANTHY_CANDIDATE_LATIN = -1, 33 | FCITX_ANTHY_CANDIDATE_WIDE_LATIN = -2, 34 | FCITX_ANTHY_CANDIDATE_HIRAGANA = -3, 35 | FCITX_ANTHY_CANDIDATE_KATAKANA = -4, 36 | FCITX_ANTHY_CANDIDATE_HALF_KATAKANA = -5, 37 | FCITX_ANTHY_CANDIDATE_HALF = -6, 38 | FCITX_ANTHY_LAST_SPECIAL_CANDIDATE = -7, 39 | } CandidateType; 40 | 41 | class ConversionSegment 42 | { 43 | public: 44 | ConversionSegment (std::string str, 45 | int cand_id, 46 | unsigned int reading_len); 47 | virtual ~ConversionSegment (); 48 | 49 | std::string & get_string (void); 50 | int get_candidate_id (void); 51 | unsigned int get_reading_length (void); 52 | 53 | void set (std::string str, 54 | int cand_id); 55 | void set_reading_length (unsigned int len); 56 | 57 | private: 58 | std::string m_string; 59 | int m_cand_id; 60 | unsigned int m_reading_len; 61 | }; 62 | typedef std::vector ConversionSegments; 63 | 64 | class Conversion 65 | { 66 | public: 67 | Conversion (AnthyInstance &anthy, Reading &reading); 68 | virtual ~Conversion (); 69 | 70 | // starting and finishing 71 | void convert (std::string source, 72 | CandidateType ctype, 73 | bool single_segment); 74 | void convert (CandidateType type 75 | = FCITX_ANTHY_CANDIDATE_DEFAULT, 76 | bool single_segment = false); 77 | void convert (const std::string &source, 78 | bool single_segment = false); 79 | void predict (void); 80 | void clear (int segment_id = -1); 81 | void commit (int segment_id = -1, 82 | bool learn = true); 83 | 84 | // getting status 85 | bool is_converting (void); 86 | bool is_predicting (void); 87 | 88 | std::string get (void); 89 | unsigned int get_length (void); 90 | unsigned int get_length_by_char (void); 91 | void update_preedit (void); 92 | 93 | // segments of the converted sentence 94 | int get_nr_segments (void); 95 | std::string get_segment_string (int segment_id = -1, 96 | int candidate_id 97 | = FCITX_ANTHY_LAST_SPECIAL_CANDIDATE); 98 | int get_selected_segment (void); 99 | void select_segment (int segment_id); 100 | int get_segment_size (int segment_id = -1); 101 | void resize_segment (int relative_size, 102 | int segment_id = -1); 103 | unsigned int get_segment_position (int segment_id = -1); 104 | 105 | // candidates for a segment or prediction 106 | void get_candidates (FcitxCandidateWordList* candList, 107 | int segment_id = -1); 108 | int get_selected_candidate (int segment_id = -1); 109 | void select_candidate (int candidate_id, 110 | int segment_id = -1); 111 | 112 | private: 113 | void get_reading_substr (std::string &string, 114 | int segment_id, 115 | int candidate_id, 116 | int seg_start, 117 | int seg_len); 118 | std::string get_prediction_string (int candidate_id); 119 | void join_all_segments (void); 120 | 121 | private: 122 | AnthyInstance &m_anthy; 123 | 124 | // convertors 125 | Reading &m_reading; 126 | anthy_context_t m_anthy_context; 127 | 128 | // status variables 129 | ConversionSegments m_segments; 130 | int m_start_id; // number of commited segments 131 | int m_cur_segment; // relative position from m_start_id 132 | bool m_predicting; 133 | }; 134 | 135 | 136 | #endif /* __FCITX_ANTHY_READING_H__ */ 137 | /* 138 | vi:ts=4:nowrap:ai:expandtab 139 | */ 140 | -------------------------------------------------------------------------------- /src/default_tables.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2004-2005 Takuro Ashie 4 | * Copyright (C) 2012 CSSlayer 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __FCITX_ANTHY_DEFAULT_TABLES_H__ 22 | #define __FCITX_ANTHY_DEFAULT_TABLES_H__ 23 | 24 | typedef struct _ConvRule 25 | { 26 | const char *string; 27 | const char *result; 28 | const char *cont; 29 | } ConvRule; 30 | 31 | typedef struct _HiraganaKatakanaRule 32 | { 33 | const char *hiragana; 34 | const char *katakana; 35 | const char *half_katakana; 36 | } HiraganaKatakanaRule; 37 | 38 | typedef struct _WideRule 39 | { 40 | const char *code; 41 | const char *wide; 42 | } WideRule; 43 | 44 | typedef struct _KeyCodeToCharRule 45 | { 46 | unsigned int code; 47 | const char *kana; 48 | } KeyCodeToCharRule; 49 | 50 | typedef struct _VoicedConsonantRule 51 | { 52 | const char *string; 53 | const char *voiced; 54 | const char *half_voiced; 55 | } VoicedConsonantRule; 56 | 57 | typedef struct _NicolaRule 58 | { 59 | const char *key; 60 | const char *single; 61 | const char *left_shift; 62 | const char *right_shift; 63 | } NicolaRule; 64 | 65 | // fundamental table 66 | extern ConvRule fcitx_anthy_romaji_typing_rule[]; 67 | extern ConvRule fcitx_anthy_romaji_double_consonant_rule[]; 68 | extern ConvRule fcitx_anthy_kana_typing_rule[]; 69 | extern ConvRule fcitx_anthy_kana_voiced_consonant_rule[]; 70 | 71 | // symbol & number 72 | extern ConvRule fcitx_anthy_half_symbol_rule[]; 73 | extern ConvRule fcitx_anthy_wide_symbol_rule[]; 74 | extern ConvRule fcitx_anthy_half_number_rule[]; 75 | extern ConvRule fcitx_anthy_wide_number_rule[]; 76 | 77 | // period table 78 | extern ConvRule fcitx_anthy_romaji_ja_period_rule[]; 79 | extern ConvRule fcitx_anthy_romaji_wide_period_rule[]; 80 | extern ConvRule fcitx_anthy_romaji_half_period_rule[]; 81 | 82 | extern ConvRule fcitx_anthy_kana_ja_period_rule[]; 83 | extern ConvRule fcitx_anthy_kana_wide_period_rule[]; 84 | extern ConvRule fcitx_anthy_kana_half_period_rule[]; 85 | 86 | // comma table 87 | extern ConvRule fcitx_anthy_romaji_ja_comma_rule[]; 88 | extern ConvRule fcitx_anthy_romaji_wide_comma_rule[]; 89 | extern ConvRule fcitx_anthy_romaji_half_comma_rule[]; 90 | 91 | extern ConvRule fcitx_anthy_kana_ja_comma_rule[]; 92 | extern ConvRule fcitx_anthy_kana_wide_comma_rule[]; 93 | extern ConvRule fcitx_anthy_kana_half_comma_rule[]; 94 | 95 | // bracket table 96 | extern ConvRule fcitx_anthy_romaji_ja_bracket_rule[]; 97 | extern ConvRule fcitx_anthy_romaji_wide_bracket_rule[]; 98 | 99 | extern ConvRule fcitx_anthy_kana_ja_bracket_rule[]; 100 | extern ConvRule fcitx_anthy_kana_wide_bracket_rule[]; 101 | 102 | // slash table 103 | extern ConvRule fcitx_anthy_romaji_ja_slash_rule[]; 104 | extern ConvRule fcitx_anthy_romaji_wide_slash_rule[]; 105 | 106 | extern ConvRule fcitx_anthy_kana_ja_slash_rule[]; 107 | extern ConvRule fcitx_anthy_kana_wide_slash_rule[]; 108 | 109 | // misc 110 | extern HiraganaKatakanaRule fcitx_anthy_hiragana_katakana_table[]; 111 | extern WideRule fcitx_anthy_wide_table[]; 112 | extern VoicedConsonantRule fcitx_anthy_voiced_consonant_table[]; 113 | 114 | // key code 115 | extern KeyCodeToCharRule fcitx_anthy_keypad_table[]; 116 | extern KeyCodeToCharRule fcitx_anthy_kana_table[]; 117 | 118 | // nicola 119 | extern NicolaRule fcitx_anthy_nicola_table[]; 120 | 121 | #endif /* __FCITX_ANTHY_DEFAULT_TABLES_H__ */ 122 | -------------------------------------------------------------------------------- /src/factory.cpp: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) Hiroyuki Ikezoe 4 | * Copyright (C) 2004 Takuro Ashie 5 | * Copyright (C) 2012 CSSlayer 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, or (at your option) 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, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | /* 23 | * The original code is scim_uim_imengine.cpp in scim-uim-0.1.3. 24 | * Copyright (C) 2004 James Su 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | #include "factory.h" 39 | #include "imengine.h" 40 | 41 | static void* FcitxAnthyCreate(FcitxInstance* instance); 42 | static void FcitxAnthyDestory(void* arg); 43 | static boolean FcitxAnthyInit(void* arg); 44 | static INPUT_RETURN_VALUE FcitxAnthyDoInput(void* arg, FcitxKeySym sym, unsigned int state); 45 | static INPUT_RETURN_VALUE FcitxAnthyDoReleaseInput(void* arg, FcitxKeySym sym, unsigned int state); 46 | static void FcitxAnthyReloadConfig(void* arg); 47 | static void FcitxAnthySave(void* arg); 48 | static void FcitxAnthyReset(void* arg); 49 | static void FcitxAnthyFocusIn(void* arg); 50 | static void FcitxAnthyResetIM(void* arg); 51 | static void FcitxAnthyOnClose(void* arg, FcitxIMCloseEventType event); 52 | static const char * FcitxAnthyGetSubModeName(void* arg); 53 | 54 | FCITX_DEFINE_PLUGIN(fcitx_anthy, ime2, FcitxIMClass2) = { 55 | FcitxAnthyCreate, 56 | FcitxAnthyDestory, 57 | NULL, 58 | NULL, 59 | NULL, 60 | NULL, 61 | NULL, 62 | NULL, 63 | }; 64 | 65 | void* FcitxAnthyCreate(FcitxInstance* instance) 66 | { 67 | if (anthy_init()) 68 | return NULL; 69 | 70 | AnthyInstance* anthy = new AnthyInstance(instance); 71 | if (!anthy->load_config()) { 72 | anthy_quit(); 73 | delete anthy; 74 | return NULL; 75 | } 76 | 77 | bindtextdomain("fcitx-anthy", LOCALEDIR); 78 | bind_textdomain_codeset("fcitx-anthy", "UTF-8"); 79 | 80 | FcitxIMIFace iface; 81 | memset(&iface, 0, sizeof(FcitxIMIFace)); 82 | iface.Init = FcitxAnthyInit; 83 | iface.ResetIM = FcitxAnthyResetIM; 84 | iface.DoInput = FcitxAnthyDoInput; 85 | iface.DoReleaseInput = FcitxAnthyDoReleaseInput; 86 | iface.ReloadConfig = FcitxAnthyReloadConfig; 87 | iface.Save = FcitxAnthySave; 88 | iface.OnClose = FcitxAnthyOnClose; 89 | iface.GetSubModeName = FcitxAnthyGetSubModeName; 90 | 91 | FcitxInstanceRegisterIMv2( 92 | instance, 93 | anthy, 94 | "anthy", 95 | _("Anthy"), 96 | "anthy", 97 | iface, 98 | 1, 99 | "ja" 100 | ); 101 | 102 | FcitxIMEventHook hk; 103 | hk.arg = anthy; 104 | hk.func = FcitxAnthyReset; 105 | FcitxInstanceRegisterResetInputHook(instance, hk); 106 | hk.func = FcitxAnthyFocusIn; 107 | FcitxInstanceRegisterInputFocusHook(instance, hk); 108 | 109 | return anthy; 110 | } 111 | 112 | void FcitxAnthyDestory(void* arg) 113 | { 114 | AnthyInstance* anthy = (AnthyInstance*) arg; 115 | delete anthy; 116 | 117 | anthy_quit(); 118 | } 119 | 120 | boolean FcitxAnthyInit(void* arg) 121 | { 122 | AnthyInstance* anthy = (AnthyInstance*) arg; 123 | anthy->init(); 124 | anthy->update_ui(); 125 | return true; 126 | } 127 | 128 | void FcitxAnthyResetIM(void* arg) 129 | { 130 | AnthyInstance* anthy = (AnthyInstance*) arg; 131 | anthy->reset_im(); 132 | anthy->update_ui(); 133 | } 134 | 135 | void FcitxAnthyReset(void* arg) 136 | { 137 | AnthyInstance* anthy = (AnthyInstance*) arg; 138 | anthy->reset(); 139 | anthy->update_ui(); 140 | } 141 | 142 | void FcitxAnthyShowIMInfo(void* arg) 143 | { 144 | AnthyInstance* anthy = (AnthyInstance*) arg; 145 | static FcitxInputContext* ic; 146 | 147 | // don't show the info again if ic is not changed, this is annoying 148 | // when cursor jumps within same application. 149 | FcitxInputContext* newic = FcitxInstanceGetCurrentIC(anthy->get_owner()); 150 | if (newic == ic) { 151 | return; 152 | } 153 | 154 | ic = newic; 155 | if (!ic) { 156 | return; 157 | } 158 | 159 | FcitxIM* im = FcitxInstanceGetCurrentIM(anthy->get_owner()); 160 | if (im && strcmp(im->uniqueName, "anthy") == 0) { 161 | FcitxInstanceShowCurrentIMInfo(anthy->get_owner()); 162 | } 163 | } 164 | 165 | void FcitxAnthyFocusIn(void* arg) 166 | { 167 | AnthyInstance* anthy = (AnthyInstance*) arg; 168 | FcitxInstance* instance = anthy->get_owner(); 169 | 170 | if (anthy->get_config()->m_show_input_mode_on_focus && 171 | !FcitxInstanceCheckTimeoutByFunc(instance, FcitxAnthyShowIMInfo)) { 172 | FcitxInstanceAddTimeout(instance, 100, FcitxAnthyShowIMInfo, anthy); 173 | } 174 | } 175 | 176 | void FcitxAnthySave(void* arg) 177 | { 178 | } 179 | 180 | INPUT_RETURN_VALUE FcitxAnthyDoInput(void* arg, FcitxKeySym sym, unsigned int state) 181 | { 182 | AnthyInstance* anthy = (AnthyInstance*) arg; 183 | KeyEvent event; 184 | FcitxInputState* input = FcitxInstanceGetInputState(anthy->get_owner()); 185 | event.sym = (FcitxKeySym) FcitxInputStateGetKeySym(input); 186 | event.is_release = false; 187 | event.keycode = FcitxInputStateGetKeyCode(input); 188 | event.state = FcitxInputStateGetKeyState(input) & FcitxKeyState_SimpleMask; 189 | bool result = anthy->process_key_event(event); 190 | anthy->update_ui(); 191 | if (result) 192 | return IRV_DO_NOTHING; 193 | else 194 | return IRV_TO_PROCESS; 195 | } 196 | 197 | INPUT_RETURN_VALUE FcitxAnthyDoReleaseInput(void* arg, FcitxKeySym sym, unsigned int state) 198 | { 199 | AnthyInstance* anthy = (AnthyInstance*) arg; 200 | KeyEvent event; 201 | FcitxInputState* input = FcitxInstanceGetInputState(anthy->get_owner()); 202 | event.sym = (FcitxKeySym) FcitxInputStateGetKeySym(input); 203 | event.keycode = FcitxInputStateGetKeyCode(input); 204 | event.is_release = true; 205 | event.state = FcitxInputStateGetKeyState(input) & FcitxKeyState_SimpleMask; 206 | bool result = anthy->process_key_event(event); 207 | anthy->update_ui(); 208 | if (result) 209 | return IRV_DO_NOTHING; 210 | else 211 | return IRV_TO_PROCESS; 212 | } 213 | 214 | void FcitxAnthyReloadConfig(void* arg) 215 | { 216 | AnthyInstance* anthy = (AnthyInstance*) arg; 217 | anthy->load_config(); 218 | anthy->configure(); 219 | anthy->update_ui(); 220 | } 221 | 222 | void FcitxAnthyOnClose(void* arg, FcitxIMCloseEventType event) 223 | { 224 | AnthyInstance* anthy = (AnthyInstance*) arg; 225 | anthy->auto_commit(event); 226 | } 227 | 228 | const char * FcitxAnthyGetSubModeName(void *arg) 229 | { 230 | AnthyInstance* anthy = (AnthyInstance*) arg; 231 | return anthy->get_input_mode_name(); 232 | } 233 | 234 | 235 | void 236 | SaveAnthyConfig(AnthyInstance* anthy) 237 | { 238 | anthy->save_config(); 239 | } 240 | 241 | boolean 242 | LoadAnthyConfig(AnthyInstance* anthy) 243 | { 244 | anthy->load_config(); 245 | return true; 246 | } 247 | 248 | void ConfigAnthy(AnthyInstance* anthy) { 249 | anthy->configure(); 250 | anthy->update_ui(); 251 | } 252 | -------------------------------------------------------------------------------- /src/factory.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2004 Hiroyuki Ikezoe 4 | * Copyright (C) 2004 Takuro Ashie 5 | * Copyright (C) 2012 CSSlayer 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, or (at your option) 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, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | /* 23 | * The original code is scim_uim_imengine.cpp in scim-uim-0.1.3. 24 | * Copyright (C) 2004 James Su 25 | */ 26 | 27 | #ifndef __FCITX_ANTHY_FACTORY_H__ 28 | #define __FCITX_ANTHY_FACTORY_H__ 29 | 30 | #include 31 | #include 32 | #include 33 | #include "action.h" 34 | #include "style_file.h" 35 | 36 | class Key2KanaTable; 37 | 38 | typedef enum { 39 | FCITX_ANTHY_MODE_HIRAGANA, 40 | FCITX_ANTHY_MODE_KATAKANA, 41 | FCITX_ANTHY_MODE_HALF_KATAKANA, 42 | FCITX_ANTHY_MODE_LATIN, 43 | FCITX_ANTHY_MODE_WIDE_LATIN, 44 | FCITX_ANTHY_MODE_LAST 45 | } InputMode; 46 | 47 | typedef enum { 48 | FCITX_ANTHY_SYMBOL_STYLE_JAPANESE, 49 | FCITX_ANTHY_SYMBOL_STYLE_WIDEBRACKET_WIDESLASH, 50 | FCITX_ANTHY_SYMBOL_STYLE_CORNERBRACKET_MIDDLEDOT, 51 | FCITX_ANTHY_SYMBOL_STYLE_CORNERBRACKET_WIDESLASH, 52 | FCITX_ANTHY_SYMBOL_STYLE_LAST 53 | } SymbolStyle; 54 | 55 | typedef enum { 56 | FCITX_ANTHY_PERIOD_COMMA_WIDELATIN, 57 | FCITX_ANTHY_PERIOD_COMMA_LATIN, 58 | FCITX_ANTHY_PERIOD_COMMA_JAPANESE, 59 | FCITX_ANTHY_PERIOD_COMMA_WIDELATIN_JAPANESE, 60 | FCITX_ANTHY_PERIOD_COMMA_LAST 61 | } PeriodCommaStyle; 62 | 63 | typedef enum { 64 | FCITX_ANTHY_CONVERSION_MULTI_SEGMENT, 65 | FCITX_ANTHY_CONVERSION_SINGLE_SEGMENT, 66 | FCITX_ANTHY_CONVERSION_MULTI_SEGMENT_IMMEDIATE, 67 | FCITX_ANTHY_CONVERSION_SINGLE_SEGMENT_IMMEDIATE, 68 | FCITX_ANTHY_CONVERSION_MODE_LAST 69 | } ConversionMode; 70 | 71 | typedef enum { 72 | FCITX_ANTHY_TYPING_METHOD_ROMAJI, 73 | FCITX_ANTHY_TYPING_METHOD_KANA, 74 | FCITX_ANTHY_TYPING_METHOD_NICOLA, 75 | FCITX_ANTHY_TYPING_METHOD_LAST 76 | } TypingMethod; 77 | 78 | typedef enum { 79 | FCITX_ANTHY_SPACE_TYPE_FOLLOWMODE, 80 | FCITX_ANTHY_SPACE_TYPE_WIDE 81 | } SpaceType; 82 | 83 | typedef enum { 84 | FCITX_ANTHY_TEN_KEY_TYPE_WIDE, 85 | FCITX_ANTHY_TEN_KEY_TYPE_HALF, 86 | FCITX_ANTHY_TEN_KEY_TYPE_FOLLOWMODE, 87 | } TenKeyType; 88 | 89 | struct AnthyKeyProfile { 90 | 91 | 92 | FcitxHotkey m_hk_CONVERT[2]; 93 | FcitxHotkey m_hk_PREDICT[2]; 94 | // candidates keys 95 | FcitxHotkey m_hk_CANDIDATES_PAGE_UP[2]; 96 | FcitxHotkey m_hk_CANDIDATES_PAGE_DOWN[2]; 97 | FcitxHotkey m_hk_SELECT_FIRST_CANDIDATE[2]; 98 | FcitxHotkey m_hk_SELECT_LAST_CANDIDATE[2]; 99 | FcitxHotkey m_hk_SELECT_NEXT_CANDIDATE[2]; 100 | FcitxHotkey m_hk_SELECT_PREV_CANDIDATE[2]; 101 | FcitxHotkey m_hk_SELECT_NEXT_CANDIDATE_ALTER[2]; 102 | FcitxHotkey m_hk_SELECT_PREV_CANDIDATE_ALTER[2]; 103 | 104 | // segment keys 105 | FcitxHotkey m_hk_SELECT_FIRST_SEGMENT[2]; 106 | FcitxHotkey m_hk_SELECT_LAST_SEGMENT[2]; 107 | FcitxHotkey m_hk_SELECT_NEXT_SEGMENT[2]; 108 | FcitxHotkey m_hk_SELECT_PREV_SEGMENT[2]; 109 | FcitxHotkey m_hk_SHRINK_SEGMENT[2]; 110 | FcitxHotkey m_hk_EXPAND_SEGMENT[2]; 111 | FcitxHotkey m_hk_COMMIT_FIRST_SEGMENT[2]; 112 | FcitxHotkey m_hk_COMMIT_SELECTED_SEGMENT[2]; 113 | FcitxHotkey m_hk_COMMIT_FIRST_SEGMENT_REVERSE_LEARN[2]; 114 | FcitxHotkey m_hk_COMMIT_SELECTED_SEGMENT_REVERSE_LEARN[2]; 115 | 116 | // direct convert keys 117 | FcitxHotkey m_hk_CONV_CHAR_TYPE_FORWARD[2]; 118 | FcitxHotkey m_hk_CONV_CHAR_TYPE_BACKWARD[2]; 119 | FcitxHotkey m_hk_CONV_TO_HIRAGANA[2]; 120 | FcitxHotkey m_hk_CONV_TO_KATAKANA[2]; 121 | FcitxHotkey m_hk_CONV_TO_HALF[2]; 122 | FcitxHotkey m_hk_CONV_TO_HALF_KATAKANA[2]; 123 | FcitxHotkey m_hk_CONV_TO_LATIN[2]; 124 | FcitxHotkey m_hk_CONV_TO_WIDE_LATIN[2]; 125 | 126 | // pseudo ascii mode 127 | FcitxHotkey m_hk_CANCEL_PSEUDO_ASCII_MODE[2]; 128 | 129 | // caret keys 130 | FcitxHotkey m_hk_MOVE_CARET_FIRST[2]; 131 | FcitxHotkey m_hk_MOVE_CARET_LAST[2]; 132 | FcitxHotkey m_hk_MOVE_CARET_FORWARD[2]; 133 | FcitxHotkey m_hk_MOVE_CARET_BACKWARD[2]; 134 | 135 | // edit keys 136 | FcitxHotkey m_hk_BACKSPACE[2]; 137 | FcitxHotkey m_hk_DELETE[2]; 138 | FcitxHotkey m_hk_COMMIT[2]; 139 | FcitxHotkey m_hk_COMMIT_REVERSE_LEARN[2]; 140 | FcitxHotkey m_hk_CANCEL[2]; 141 | FcitxHotkey m_hk_CANCEL_ALL[2]; 142 | FcitxHotkey m_hk_INSERT_SPACE[2]; 143 | FcitxHotkey m_hk_INSERT_ALT_SPACE[2]; 144 | FcitxHotkey m_hk_INSERT_HALF_SPACE[2]; 145 | FcitxHotkey m_hk_INSERT_WIDE_SPACE[2]; 146 | 147 | // mode keys 148 | FcitxHotkey m_hk_CIRCLE_INPUT_MODE[2]; 149 | FcitxHotkey m_hk_CIRCLE_KANA_MODE[2]; 150 | FcitxHotkey m_hk_CIRCLE_LATIN_HIRAGANA_MODE[2]; 151 | FcitxHotkey m_hk_CIRCLE_TYPING_METHOD[2]; 152 | FcitxHotkey m_hk_LATIN_MODE[2]; 153 | FcitxHotkey m_hk_WIDE_LATIN_MODE[2]; 154 | FcitxHotkey m_hk_HIRAGANA_MODE[2]; 155 | FcitxHotkey m_hk_KATAKANA_MODE[2]; 156 | FcitxHotkey m_hk_HALF_KATAKANA_MODE[2]; 157 | 158 | // dict keys 159 | FcitxHotkey m_hk_DICT_ADMIN[2]; 160 | FcitxHotkey m_hk_ADD_WORD[2]; 161 | 162 | // reconvert 163 | FcitxHotkey m_hk_RECONVERT[2]; 164 | }; 165 | 166 | struct FcitxAnthyConfig { 167 | FcitxGenericConfig gconfig; 168 | char* m_romaji_fundamental_table; 169 | char* m_kana_fundamental_table; 170 | char* m_nicola_fundamental_table; 171 | char* m_kana_layout_ro_key; 172 | char* m_add_word_command; 173 | char* m_dict_admin_command; 174 | boolean m_predict_on_input; 175 | boolean m_learn_on_auto_commit; 176 | boolean m_romaji_pseudo_ascii_blank_behavior; 177 | boolean m_romaji_pseudo_ascii_mode; 178 | boolean m_romaji_half_symbol; 179 | boolean m_romaji_half_number; 180 | boolean m_show_input_mode_label; 181 | boolean m_show_symbol_style_label; 182 | boolean m_show_period_style_label; 183 | boolean m_show_conv_mode_label; 184 | boolean m_show_typing_method_label; 185 | boolean m_learn_on_manual_commit; 186 | boolean m_show_add_word_label; 187 | boolean m_use_direct_key_on_predict; 188 | boolean m_show_candidates_label; 189 | boolean m_show_input_mode_on_focus; 190 | boolean m_romaji_allow_split; 191 | 192 | int m_nicola_time; 193 | 194 | FcitxCandidateLayoutHint m_candidate_layout; 195 | SpaceType m_space_type; 196 | InputMode m_input_mode; 197 | SymbolStyle m_symbol_style; 198 | PeriodCommaStyle m_period_comma_style; 199 | ConversionMode m_conversion_mode; 200 | TypingMethod m_typing_method; 201 | TenKeyType m_ten_key_type; 202 | 203 | int m_n_triggers_to_show_cand_win; 204 | 205 | FcitxHotkey m_left_thumb_keys[2]; 206 | FcitxHotkey m_right_thumb_keys[2]; 207 | char* m_key_theme_file; 208 | 209 | int m_page_size; 210 | 211 | AnthyKeyProfile m_key_default; 212 | AnthyKeyProfile m_key_profile; 213 | 214 | int m_key_profile_enum; 215 | int m_romaji_table_enum; 216 | int m_kana_table_enum; 217 | int m_nicola_table_enum; 218 | 219 | Key2KanaTable *m_custom_romaji_table; 220 | Key2KanaTable *m_custom_kana_table; 221 | Key2KanaTable *m_custom_nicola_table; 222 | }; 223 | 224 | #endif /* __FCITX_ANTHY_FACTORY_H__ */ 225 | /* 226 | vi:ts=4:nowrap:ai:expandtab 227 | */ 228 | -------------------------------------------------------------------------------- /src/fcitx-anthy.conf.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=fcitx-anthy 3 | _GeneralName=Anthy 4 | _Comment=Anthy Wrapper For Fcitx 5 | Category=InputMethod 6 | Enabled=True 7 | Library=fcitx-anthy.so 8 | Type=SharedLibrary 9 | Dependency= 10 | IMRegisterMethod=ConfigFile -------------------------------------------------------------------------------- /src/fcitx-anthy.desc: -------------------------------------------------------------------------------- 1 | [General/PageSize] 2 | Type=Integer 3 | Description=Page size 4 | DefaultValue=10 5 | 6 | [General/CandidateLayout] 7 | Type=Enum 8 | Description=Candidate List Layout 9 | EnumCount=3 10 | Enum0=Global 11 | Enum1=Vertical 12 | Enum2=Horizontal 13 | DefaultValue=Vertical 14 | 15 | [General/NTriggersToShowCandWin] 16 | Type=Integer 17 | Description=Number candidate of Triggers To Show Candidate Window 18 | DefaultValue=2 19 | Min=0 20 | Max=7 21 | 22 | [General/InputMode] 23 | Type=Enum 24 | Description=Input mode 25 | DefaultValue=Hiragana 26 | EnumCount=5 27 | Enum0=Hiragana 28 | Enum1=Katakana 29 | Enum2=Half Katakana 30 | Enum3=Latin 31 | Enum4=Wide Latin 32 | 33 | [General/TypingMethod] 34 | Type=Enum 35 | Description=Typing method 36 | DefaultValue=Romaji 37 | EnumCount=3 38 | Enum0=Romaji 39 | Enum1=Kana 40 | Enum2=Nicola 41 | 42 | [General/ConversionMode] 43 | Type=Enum 44 | Description=Conversion mode 45 | DefaultValue=Multi segment 46 | EnumCount=4 47 | Enum0=Multi segment 48 | Enum1=Single segment 49 | Enum2=Multi segment immediate 50 | Enum3=Single segment immediate 51 | 52 | [General/PeriodStyle] 53 | Type=Enum 54 | Description=Period style 55 | DefaultValue=Japanese 56 | EnumCount=4 57 | Enum0=Wide latin 58 | Enum1=Latin 59 | Enum2=Japanese 60 | Enum3=Wide latin Japanese 61 | 62 | [General/SymbolStyle] 63 | Type=Enum 64 | Description=Symbol style 65 | DefaultValue=Japanese 66 | EnumCount=4 67 | Enum0=Japanese 68 | Enum1=Wide bracket and wide slash 69 | Enum2=Corner bracket and Middle Dot 70 | Enum3=Corner bracket and wide slash 71 | 72 | [General/LearnOnManualCommit] 73 | Type=Boolean 74 | Description=Learn on manual commit 75 | DefaultValue=True 76 | 77 | [General/LearnOnAutoCommit] 78 | Type=Boolean 79 | Description=Learn on auto commit 80 | DefaultValue=True 81 | 82 | [General/AllowSplit] 83 | Type=Boolean 84 | Description=Allow split 85 | DefaultValue=True 86 | 87 | [General/UseDirectKeyOnPredict] 88 | Type=Boolean 89 | Description=Use direct key on predict 90 | DefaultValue=True 91 | 92 | [General/ShowCandidatesLabel] 93 | Type=Boolean 94 | Description=Show candidates label 95 | DefaultValue=True 96 | 97 | [General/ShowInputMode] 98 | Type=Boolean 99 | Description=Show input mode in input window when focus changes 100 | DefaultValue=True 101 | 102 | [Interface/ShowInputMode] 103 | Type=Boolean 104 | Description=Show input mode 105 | DefaultValue=True 106 | 107 | [Interface/ShowTypingMethod] 108 | Type=Boolean 109 | Description=Show typing method 110 | DefaultValue=True 111 | 112 | [Interface/ShowConversionMode] 113 | Type=Boolean 114 | Description=Show conversion mode 115 | DefaultValue=True 116 | 117 | [Interface/ShowPeriodStyle] 118 | Type=Boolean 119 | Description=Show period style 120 | DefaultValue=False 121 | 122 | [Interface/ShowSymbolStyle] 123 | Type=Boolean 124 | Description=Show symbol style 125 | DefaultValue=False 126 | 127 | [KeyProfile/KeyBindingProfile] 128 | Type=Enum 129 | DefaultValue=Default 130 | Description=Key binding profile 131 | EnumCount=7 132 | Enum0=Default 133 | Enum1=Atok 134 | Enum2=Canna 135 | Enum3=MS IME 136 | Enum4=Vje Delta 137 | Enum5=WNN 138 | Enum6=Custom 139 | 140 | [KeyProfile/RomajiTable] 141 | Type=Enum 142 | DefaultValue=Default 143 | Description=Romaji Table 144 | EnumCount=7 145 | Enum0=Default 146 | Enum1=Atok 147 | Enum2=Azik 148 | Enum3=Canna 149 | Enum4=MS IME 150 | Enum5=Vje Delta 151 | Enum6=WNN 152 | Enum7=Custom 153 | 154 | [KeyProfile/KanaTable] 155 | Type=Enum 156 | DefaultValue=Default 157 | Description=Kana Table 158 | EnumCount=6 159 | Enum0=Default 160 | Enum1=101kana 161 | Enum2=tsuki-2-203-101 162 | Enum3=tsuki-2-203-106 163 | Enum4=Quick Kana 164 | Enum5=Custom 165 | 166 | [KeyProfile/NicolaTable] 167 | Type=Enum 168 | DefaultValue=Default 169 | Description=Nicola Table 170 | EnumCount=8 171 | Enum0=Default 172 | Enum1=Nicola-A 173 | Enum2=Nicola-F 174 | Enum3=Nicola-J 175 | Enum4=Oasys100J 176 | Enum5=Tron Dvorak 177 | Enum6=Tron Qwerty JP 178 | Enum7=Custom 179 | 180 | [KeyProfile/CustomKeyBinding] 181 | Type=File 182 | DefaultValue= 183 | Description=Custom Key Binding 184 | 185 | [KeyProfile/CustomRomajiTable] 186 | Type=File 187 | DefaultValue= 188 | Description=Custom Romaji Table 189 | 190 | [KeyProfile/CustomKanaTable] 191 | Type=File 192 | DefaultValue= 193 | Description=Custom Kana Table 194 | 195 | [KeyProfile/CustomNicolaTable] 196 | Type=File 197 | DefaultValue= 198 | Description=Custom Nicola Table 199 | 200 | [Key/CircleInputModeKey] 201 | Type=Hotkey 202 | Description=Circle input mode 203 | DefaultValue=CTRL_, CTRL_< 204 | 205 | [Key/CircleKanaModeKey] 206 | Type=Hotkey 207 | Description=Circle kana mode 208 | DefaultValue=CTRL_. HIRAGANAKATAKANA 209 | 210 | [Key/CircleLatinHiraganaModeKey] 211 | Type=Hotkey 212 | Description=Circle latin and hiragana mode 213 | DefaultValue= 214 | 215 | [Key/CircleTypingMethodKey] 216 | Type=Hotkey 217 | Description=Circle typing method 218 | DefaultValue=ALT_ROMAJI CTRL_/ 219 | 220 | [Key/LatinModeKey] 221 | Type=Hotkey 222 | Description=Latin mode 223 | DefaultValue= 224 | 225 | [Key/WideLatinModeKey] 226 | Type=Hotkey 227 | Description=Wide latin mode 228 | DefaultValue= 229 | 230 | [Key/HiraganaModeKey] 231 | Type=Hotkey 232 | Description=Hiragana mode 233 | DefaultValue= 234 | 235 | [Key/KatakanaModeKey] 236 | Type=Hotkey 237 | Description=Katakana mode 238 | DefaultValue= 239 | 240 | [Key/HalfKatakanaModeKey] 241 | Type=Hotkey 242 | Description=Half Katakana mode 243 | DefaultValue= 244 | 245 | [Key/CancelPseudoAsciiModeKey] 246 | Type=Hotkey 247 | Description=Cancel pseudo ascii mode 248 | DefaultValue=ESCAPE 249 | 250 | 251 | [Key/InsertSpaceKey] 252 | Type=Hotkey 253 | Description=Insert space 254 | DefaultValue=SPACE 255 | 256 | [Key/InsertAltSpaceKey] 257 | Type=Hotkey 258 | Description=Insert Alternative space 259 | DefaultValue=SHIFT_SPACE 260 | 261 | [Key/InsertHalfSpaceKey] 262 | Type=Hotkey 263 | Description=Insert Half Space 264 | DefaultValue= 265 | 266 | [Key/InsertWideSpaceKey] 267 | Type=Hotkey 268 | Description=Insert wide space 269 | DefaultValue= 270 | 271 | [Key/BackSpaceKey] 272 | Type=Hotkey 273 | Description=BackSpace 274 | DefaultValue=BACKSPACE CTRL_H 275 | 276 | [Key/DeleteKey] 277 | Type=Hotkey 278 | Description=Delete 279 | DefaultValue=DELETE CTRL_D 280 | 281 | [Key/CommitKey] 282 | Type=Hotkey 283 | Description=Commit 284 | DefaultValue=ENTER CTRL_J 285 | 286 | [Key/CommitReverseLearnKey] 287 | Type=Hotkey 288 | Description=Commit Reverse Learn 289 | DefaultValue=SHIFT_ENTER 290 | 291 | [Key/ConvertKey] 292 | Type=Hotkey 293 | Description=Convert 294 | DefaultValue=SPACE HENKAN 295 | 296 | [Key/PredictKey] 297 | Type=Hotkey 298 | Description=Predict 299 | DefaultValue=TAB 300 | 301 | [Key/CancelKey] 302 | Type=Hotkey 303 | Description=Cancel 304 | DefaultValue=ESCAPE CTRL_G 305 | 306 | [Key/CancelAllKey] 307 | Type=Hotkey 308 | Description=Cancel all 309 | DefaultValue= 310 | 311 | [Key/MoveCaretFirstKey] 312 | Type=Hotkey 313 | Description=Move Caret First 314 | DefaultValue=CTRL_A HOME 315 | 316 | [Key/MoveCaretLastKey] 317 | Type=Hotkey 318 | Description=Move caret last 319 | DefaultValue=CTRL_E END 320 | 321 | [Key/MoveCaretForwardKey] 322 | Type=Hotkey 323 | Description=Move caret forward 324 | DefaultValue=RIGHT CTRL_F 325 | 326 | [Key/MoveCaretBackwardKey] 327 | Type=Hotkey 328 | Description=Move caret backward 329 | DefaultValue=LEFT CTRL_B 330 | 331 | [Key/SelectFirstSegmentKey] 332 | Type=Hotkey 333 | Description=Select first segment 334 | DefaultValue=CTRL_A HOME 335 | 336 | [Key/SelectLastSegmentKey] 337 | Type=Hotkey 338 | Description=Select last segment 339 | DefaultValue=CTRL_E END 340 | 341 | [Key/SelectNextSegmentKey] 342 | Type=Hotkey 343 | Description=Select next segment 344 | DefaultValue=RIGHT CTRL_F 345 | 346 | [Key/SelectPrevSegmentKey] 347 | Type=Hotkey 348 | Description=Select previous segment 349 | DefaultValue=LEFT CTRL_B 350 | 351 | [Key/ShrinkSegmentKey] 352 | Type=Hotkey 353 | Description=Shrink segment 354 | DefaultValue=SHIFT_LEFT CTRL_I 355 | 356 | [Key/ExpandSegmentKey] 357 | Type=Hotkey 358 | Description=Expand segment 359 | DefaultValue=SHIFT_RIGHT CTRL_O 360 | 361 | [Key/CommitFirstSegmentKey] 362 | Type=Hotkey 363 | Description=Commit first segment 364 | DefaultValue=SHIFT_DOWN 365 | 366 | [Key/CommitSelectedSegmentKey] 367 | Type=Hotkey 368 | Description=Commit selected segment 369 | DefaultValue=CTRL_DOWN 370 | 371 | [Key/CommitFirstSegmentReverseLearnKey] 372 | Type=Hotkey 373 | Description=Commit first segment reverse learn 374 | DefaultValue= 375 | 376 | [Key/CommitSelectedSegmentReverseLearnKey] 377 | Type=Hotkey 378 | Description=Commit selected segment reverse learn 379 | DefaultValue= 380 | 381 | [Key/SelectFirstCandidateKey] 382 | Type=Hotkey 383 | Description=Select first candidate 384 | DefaultValue=HOME 385 | 386 | [Key/SelectLastCandidateKey] 387 | Type=Hotkey 388 | Description=Select last candidate 389 | DefaultValue=END 390 | 391 | [Key/SelectNextCandidateKey] 392 | Type=Hotkey 393 | Description=Select next candidate 394 | DefaultValue=SPACE TAB 395 | 396 | [Key/SelectNextCandidateKeyAlter] 397 | Type=Hotkey 398 | Description=Alternative Select next candidate 399 | DefaultValue=HENKAN DOWN 400 | 401 | [Key/SelectPrevCandidateKey] 402 | Type=Hotkey 403 | Description=Select prev candidate 404 | DefaultValue=SHIFT_TAB UP 405 | 406 | [Key/SelectPrevCandidateKeyAlter] 407 | Type=Hotkey 408 | Description=Alternative Select prev candidate 409 | DefaultValue= 410 | 411 | [Key/CandidatesPageUpKey] 412 | Type=Hotkey 413 | Description=Candidates Page Up 414 | DefaultValue=PGUP 415 | 416 | [Key/CandidatesPageDownKey] 417 | Type=Hotkey 418 | Description=Candidates Page Down 419 | DefaultValue=PGDN 420 | 421 | [Key/ConvertCharTypeForwardKey] 422 | Type=Hotkey 423 | Description=Convert char type forward 424 | DefaultValue=MUHENKAN 425 | 426 | [Key/ConvertCharTypeBackwardKey] 427 | Type=Hotkey 428 | Description=Convert char type backward 429 | DefaultValue= 430 | 431 | [Key/ConvertToHiraganaKey] 432 | Type=Hotkey 433 | Description=Convert To Hiragana 434 | DefaultValue=F6 435 | 436 | [Key/ConvertToKatakanaKey] 437 | Type=Hotkey 438 | Description=Convert To Katakana 439 | DefaultValue=F7 440 | 441 | [Key/ConvertToHalfKey] 442 | Type=Hotkey 443 | Description=Convert To Half 444 | DefaultValue=F8 445 | 446 | [Key/ConvertToHalfKatakanaKey] 447 | Type=Hotkey 448 | Description=Convert To Half Katakana 449 | DefaultValue=SHIFT_F8 450 | 451 | [Key/ConvertToWideLatinKey] 452 | Type=Hotkey 453 | Description=Convert To Wide Latin 454 | DefaultValue=F9 455 | 456 | [Key/ConvertToLatinKey] 457 | Type=Hotkey 458 | Description=Convert To Latin 459 | DefaultValue=F10 460 | 461 | [Key/ReconvertKey] 462 | Type=Hotkey 463 | Description=Reconvert 464 | DefaultValue=SHIFT_HENKAN 465 | 466 | [Key/DictAdminKey] 467 | Type=Hotkey 468 | Description=Dict admin 469 | DefaultValue=F11 470 | 471 | [Key/AddWordKey] 472 | Type=Hotkey 473 | Description=Add Word 474 | DefaultValue=F12 475 | 476 | [Key/LeftThumbKey] 477 | Type=Hotkey 478 | Description=Left thumb key 479 | DefaultValue=MUHENKAN 480 | 481 | [Key/RightThumbKey] 482 | Type=Hotkey 483 | Description=Right thumb key 484 | DefaultValue=HENKAN SPACE 485 | 486 | [Key/KanaLayoutRoKey] 487 | Type=String 488 | Description=Ro key for kana layout 489 | DefaultValue=ろ 490 | 491 | [Key/NicolaTime] 492 | Type=Integer 493 | Description=Nicola time 494 | DefaultValue=200 495 | 496 | [Command/AddWord] 497 | Type=String 498 | Description=Add word 499 | DefaultValue=kasumi -a 500 | 501 | [Command/DictAdmin] 502 | Type=String 503 | Description=Dict admin 504 | DefaultValue=kasumi 505 | 506 | [DescriptionFile] 507 | LocaleDomain=fcitx-anthy 508 | -------------------------------------------------------------------------------- /src/imengine.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2004 Hiroyuki Ikezoe 4 | * Copyright (C) 2004 Takuro Ashie 5 | * Copyright (C) 2012 CSSlayer 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, or (at your option) 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, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | /* 23 | * The original code is scim_uim_imengine.cpp in scim-uim-0.1.3. 24 | * Copyright (C) 2004 James Su 25 | */ 26 | 27 | #ifndef __FCITX_ANTHY_IMENGINE_H__ 28 | #define __FCITX_ANTHY_IMENGINE_H__ 29 | 30 | #include 31 | #include 32 | #include "preedit.h" 33 | #include "key2kana_table.h" 34 | #include "factory.h" 35 | 36 | 37 | struct AnthyStatus { 38 | const char* icon; 39 | const char* label; 40 | const char* description; 41 | }; 42 | 43 | class AnthyInstance 44 | { 45 | public: 46 | AnthyInstance (FcitxInstance* instance); 47 | ~AnthyInstance (); 48 | bool load_config(); 49 | void save_config(); 50 | 51 | void configure(); 52 | 53 | bool process_key_event (const KeyEvent& key); 54 | void move_preedit_caret (unsigned int pos); 55 | void select_candidate (unsigned int item); 56 | void update_lookup_table_page_size(unsigned int page_size); 57 | void reset_im (void); 58 | void reset (void); 59 | void init (void); 60 | 61 | public: 62 | /* actions */ 63 | bool action_convert (void); 64 | bool action_predict (void); 65 | bool action_revert (void); 66 | bool action_cancel_all (void); 67 | bool action_commit_follow_preference (void); 68 | bool action_commit_reverse_preference (void); 69 | bool action_commit_first_segment (void); 70 | bool action_commit_selected_segment (void); 71 | bool action_commit_first_segment_reverse_preference 72 | (void); 73 | bool action_commit_selected_segment_reverse_preference 74 | (void); 75 | bool action_back (void); 76 | bool action_delete (void); 77 | bool action_insert_space (void); 78 | bool action_insert_alternative_space (void); 79 | bool action_insert_half_space (void); 80 | bool action_insert_wide_space (void); 81 | 82 | bool action_move_caret_backward (void); 83 | bool action_move_caret_forward (void); 84 | bool action_move_caret_first (void); 85 | bool action_move_caret_last (void); 86 | 87 | bool action_select_prev_segment (void); 88 | bool action_select_next_segment (void); 89 | bool action_select_first_segment (void); 90 | bool action_select_last_segment (void); 91 | bool action_shrink_segment (void); 92 | bool action_expand_segment (void); 93 | 94 | bool action_select_first_candidate (void); 95 | bool action_select_last_candidate (void); 96 | bool action_select_next_candidate (void); 97 | bool action_select_prev_candidate (void); 98 | bool action_candidates_page_up (void); 99 | bool action_candidates_page_down (void); 100 | 101 | bool action_convert_to_hiragana (void); 102 | bool action_convert_to_katakana (void); 103 | bool action_circle_latin_hiragana_mode (void); 104 | bool action_convert_to_half (void); 105 | bool action_convert_to_half_katakana (void); 106 | bool action_convert_to_latin (void); 107 | bool action_convert_to_wide_latin (void); 108 | bool action_convert_char_type_forward (void); 109 | bool action_convert_char_type_backward (void); 110 | bool action_reconvert (void); 111 | 112 | bool action_circle_input_mode (void); 113 | bool action_circle_kana_mode (void); 114 | bool action_circle_typing_method (void); 115 | 116 | bool action_latin_mode (void); 117 | bool action_wide_latin_mode (void); 118 | bool action_hiragana_mode (void); 119 | bool action_katakana_mode (void); 120 | bool action_half_katakana_mode (void); 121 | bool action_cancel_pseudo_ascii_mode (void); 122 | 123 | bool action_add_word (void); 124 | bool action_launch_dict_admin_tool (void); 125 | /* 126 | void actoin_register_word (void); 127 | */ 128 | 129 | public: 130 | TypingMethod 131 | get_typing_method (void); 132 | InputMode 133 | get_input_mode (void); 134 | ConversionMode 135 | get_conversion_mode (void) { return m_config.m_conversion_mode; } 136 | PeriodCommaStyle 137 | get_period_style (void) { return m_config.m_period_comma_style; } 138 | SymbolStyle 139 | get_symbol_style (void) { return m_config.m_symbol_style; } 140 | void set_input_mode (InputMode mode); 141 | void set_conversion_mode (ConversionMode mode); 142 | void set_typing_method (TypingMethod method); 143 | void set_period_style (PeriodCommaStyle period); 144 | void set_symbol_style (SymbolStyle symbol); 145 | void update_ui (void); 146 | 147 | int get_pseudo_ascii_mode (void); 148 | FcitxAnthyConfig* get_config() { return &m_config; } 149 | FcitxInstance* get_owner() { return m_owner; } 150 | FcitxMessages* get_preedit() { return m_preedit_msg; } 151 | FcitxMessages* get_client_preedit() { return m_client_preedit_msg; } 152 | FcitxInputState* get_input() { return m_input; } 153 | FcitxProfile* get_profile() { return m_profile; } 154 | bool support_client_preedit(); 155 | 156 | const char* get_input_mode_icon(); 157 | const char* get_typing_method_icon(); 158 | const char* get_conversion_mode_icon(); 159 | const char* get_period_style_icon(); 160 | const char* get_symbol_style_icon(); 161 | 162 | const char* get_input_mode_name(); 163 | 164 | bool action_select_candidate (unsigned int i); 165 | void reset_cursor(int cursor); 166 | void auto_commit(FcitxIMCloseEventType type); 167 | private: 168 | /* processing key event */ 169 | bool process_key_event_input (const KeyEvent &key); 170 | bool process_key_event_lookup_keybind (const KeyEvent &key); 171 | bool process_key_event_latin_mode (const KeyEvent &key); 172 | bool process_key_event_wide_latin_mode (const KeyEvent &key); 173 | 174 | /* utility */ 175 | void set_preedition (void); 176 | void set_aux_string (void); 177 | int set_lookup_table (void); 178 | void unset_lookup_table (void); 179 | void install_properties (void); 180 | void set_period_style (PeriodStyle period, 181 | CommaStyle comma); 182 | void set_symbol_style (BracketStyle bracket, 183 | SlashStyle slash); 184 | bool is_selecting_candidates (void); 185 | void select_candidate_no_direct (unsigned int item); 186 | bool convert_kana (CandidateType type); 187 | 188 | bool action_commit (bool learn, bool do_real_commit = true); 189 | 190 | bool is_single_segment (void); 191 | bool is_realtime_conversion (void); 192 | char* get_file_name(const std::string& name); 193 | 194 | private: // FIXME! 195 | bool is_nicola_thumb_shift_key (const KeyEvent &key); 196 | void commit_string(std::string str); 197 | void update_aux_string(const std::string& str); 198 | std::string get_key_profile(); 199 | std::string get_romaji_table(); 200 | std::string get_kana_table(); 201 | std::string get_nicola_table(); 202 | 203 | private: 204 | FcitxInstance* m_owner; 205 | 206 | /* for preedit */ 207 | Preedit m_preedit; 208 | bool m_preedit_string_visible; 209 | 210 | FcitxInputState* m_input; 211 | 212 | /* for candidates window */ 213 | FcitxCandidateWordList* m_lookup_table; 214 | bool m_lookup_table_visible; 215 | unsigned int m_n_conv_key_pressed; 216 | 217 | /* for toggling latin and wide latin */ 218 | InputMode m_prev_input_mode; 219 | 220 | /* for action */ 221 | KeyEvent m_last_key; 222 | 223 | FcitxAnthyConfig m_config; 224 | FcitxMessages* m_aux_up; 225 | FcitxMessages* m_aux_down; 226 | 227 | int m_cursor_pos; 228 | FcitxMessages* m_client_preedit_msg; 229 | FcitxMessages* m_preedit_msg; 230 | 231 | std::map m_actions; 232 | FcitxProfile* m_profile; 233 | bool m_status_installed; 234 | 235 | FcitxUIMenu m_input_mode_menu; 236 | FcitxUIMenu m_typing_method_menu; 237 | FcitxUIMenu m_conversion_mode_menu; 238 | FcitxUIMenu m_period_style_menu; 239 | FcitxUIMenu m_symbol_style_menu; 240 | int m_ui_update; 241 | }; 242 | #endif /* __FCITX_ANTHY_IMENGINE_H__ */ 243 | /* 244 | vi:ts=4:nowrap:ai:expandtab 245 | */ 246 | -------------------------------------------------------------------------------- /src/kana.cpp: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2005 Takuro Ashie 4 | * Copyright (C) 2012 CSSlayer 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #include 22 | 23 | #include "kana.h" 24 | #include "factory.h" 25 | #include "imengine.h" 26 | #include "default_tables.h" 27 | #include "utils.h" 28 | 29 | static bool 30 | has_voiced_consonant (std::string str) 31 | { 32 | VoicedConsonantRule *table = fcitx_anthy_voiced_consonant_table; 33 | 34 | for (unsigned int i = 0; table[i].string; i++) { 35 | if (!strcmp (str.c_str (), table[i].string) && 36 | table[i].voiced && *table[i].voiced) 37 | { 38 | return true; 39 | } 40 | } 41 | 42 | return false; 43 | } 44 | 45 | static bool 46 | has_half_voiced_consonant (std::string str) 47 | { 48 | VoicedConsonantRule *table = fcitx_anthy_voiced_consonant_table; 49 | 50 | for (unsigned int i = 0; table[i].string; i++) { 51 | if (!strcmp (str.c_str (), table[i].string) && 52 | table[i].half_voiced && *table[i].half_voiced) 53 | { 54 | return true; 55 | } 56 | } 57 | 58 | return false; 59 | } 60 | 61 | std::string 62 | to_voiced_consonant (std::string str) 63 | { 64 | VoicedConsonantRule *table = fcitx_anthy_voiced_consonant_table; 65 | 66 | for (unsigned int i = 0; table[i].string; i++) { 67 | if (!strcmp (str.c_str (), table[i].string)) 68 | return std::string (table[i].voiced); 69 | } 70 | 71 | return str; 72 | } 73 | 74 | std::string 75 | to_half_voiced_consonant (std::string str) 76 | { 77 | VoicedConsonantRule *table = fcitx_anthy_voiced_consonant_table; 78 | 79 | for (unsigned int i = 0; table[i].string; i++) { 80 | if (!strcmp (str.c_str (), table[i].string)) 81 | return std::string (table[i].half_voiced); 82 | } 83 | 84 | return str; 85 | } 86 | 87 | KanaConvertor::KanaConvertor (AnthyInstance &anthy) 88 | : m_anthy (anthy) 89 | { 90 | } 91 | 92 | KanaConvertor::~KanaConvertor () 93 | { 94 | } 95 | 96 | bool 97 | KanaConvertor::can_append (const KeyEvent & key, 98 | bool ignore_space) 99 | { 100 | // ignore key release. 101 | if (key.is_release) 102 | return false; 103 | 104 | // ignore short cut keys of apllication. 105 | if ((key.state & FcitxKeyState_Ctrl) || 106 | (key.state & FcitxKeyState_Alt) || 107 | (key.state & FcitxKeyState_Super)) 108 | { 109 | return false; 110 | } 111 | 112 | if (key.sym == FcitxKey_overline || 113 | (key.sym >= FcitxKey_kana_fullstop && 114 | key.sym <= FcitxKey_semivoicedsound)) 115 | { 116 | return true; 117 | } 118 | 119 | #if 0 120 | if (key.code == SCIM_KEY_KP_Equal || 121 | (key.code >= SCIM_KEY_KP_Multiply && 122 | key.code <= SCIM_KEY_KP_9)) 123 | { 124 | return true; 125 | } 126 | #endif 127 | 128 | return false; 129 | } 130 | 131 | bool 132 | KanaConvertor::append (const KeyEvent & key, 133 | std::string & result, 134 | std::string & pending, 135 | std::string &raw) 136 | { 137 | KeyCodeToCharRule *table = fcitx_anthy_keypad_table; 138 | 139 | // handle keypad code 140 | if (key.sym == FcitxKey_KP_Equal || 141 | (key.sym >= FcitxKey_KP_Multiply && 142 | key.sym <= FcitxKey_KP_9)) 143 | { 144 | TenKeyType ten_key_type = m_anthy.get_config()->m_ten_key_type; 145 | 146 | for (unsigned int i = 0; table[i].code; i++) { 147 | if (table[i].code == key.sym) { 148 | if (ten_key_type == FCITX_ANTHY_TEN_KEY_TYPE_WIDE) 149 | util_convert_to_wide (result, table[i].kana); 150 | else 151 | result = table[i].kana; 152 | raw = table[i].kana; 153 | 154 | return false; 155 | } 156 | } 157 | } 158 | 159 | table = fcitx_anthy_kana_table; 160 | 161 | // handle voiced sound 162 | if (key.sym == FcitxKey_voicedsound && 163 | !m_pending.empty () && has_voiced_consonant (m_pending)) 164 | { 165 | result = to_voiced_consonant (m_pending); 166 | raw = key.get_ascii_code (); 167 | m_pending = std::string (); 168 | return false; 169 | } 170 | 171 | // handle semi voiced sound 172 | if (key.sym == FcitxKey_semivoicedsound && 173 | !m_pending.empty () && has_half_voiced_consonant (m_pending)) 174 | { 175 | result = to_half_voiced_consonant (m_pending); 176 | raw = key.get_ascii_code (); 177 | m_pending = std::string (); 178 | return false; 179 | } 180 | 181 | // kana key code 182 | for (unsigned int i = 0; table[i].code; i++) { 183 | if (table[i].code == key.sym) { 184 | bool retval = m_pending.empty () ? false : true; 185 | 186 | if (has_voiced_consonant (table[i].kana)) { 187 | result = std::string (); 188 | pending = table[i].kana; 189 | m_pending = table[i].kana; 190 | } else { 191 | result = table[i].kana; 192 | m_pending = std::string (); 193 | } 194 | raw = key.get_ascii_code (); 195 | 196 | return retval; 197 | } 198 | } 199 | 200 | std::string s; 201 | s += key.get_ascii_code (); 202 | raw = s; 203 | 204 | return append (raw, result, pending); 205 | } 206 | 207 | bool 208 | KanaConvertor::append (const std::string & str, 209 | std::string & result, 210 | std::string & pending) 211 | { 212 | result = str; 213 | m_pending = std::string (); 214 | 215 | return false; 216 | } 217 | 218 | void 219 | KanaConvertor::clear (void) 220 | { 221 | m_pending = std::string (); 222 | } 223 | 224 | bool 225 | KanaConvertor::is_pending (void) 226 | { 227 | return !m_pending.empty (); 228 | } 229 | 230 | std::string 231 | KanaConvertor::get_pending (void) 232 | { 233 | return std::string (m_pending); 234 | } 235 | 236 | std::string 237 | KanaConvertor::flush_pending (void) 238 | { 239 | return std::string (); 240 | } 241 | 242 | void 243 | KanaConvertor::reset_pending (const std::string &result, const std::string &raw) 244 | { 245 | m_pending = std::string (); 246 | if (has_voiced_consonant (result)) 247 | m_pending = result; 248 | } 249 | /* 250 | vi:ts=4:nowrap:ai:expandtab 251 | */ 252 | -------------------------------------------------------------------------------- /src/kana.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2005 Takuro Ashie 4 | * Copyright (C) 2012 CSSlayer 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __FCITX_ANTHY_KANA_H__ 22 | #define __FCITX_ANTHY_KANA_H__ 23 | 24 | #include "key2kana_base.h" 25 | #include "default_tables.h" 26 | #include "key2kana_table.h" 27 | 28 | class AnthyInstance; 29 | 30 | class KanaConvertor : public Key2KanaConvertorBase 31 | { 32 | public: 33 | KanaConvertor (AnthyInstance & anthy); 34 | virtual ~KanaConvertor (); 35 | 36 | bool can_append (const KeyEvent & key, 37 | bool ignore_space = false); 38 | bool append (const KeyEvent & key, 39 | std::string & result, 40 | std::string & pending, 41 | std::string & raw); 42 | bool append (const std::string & raw, 43 | std::string & result, 44 | std::string & pending); 45 | void clear (void); 46 | 47 | bool is_pending (void); 48 | std::string get_pending (void); 49 | std::string flush_pending (void); 50 | void reset_pending (const std::string & result, 51 | const std::string & raw); 52 | 53 | private: 54 | AnthyInstance &m_anthy; 55 | 56 | // state 57 | std::string m_pending; 58 | }; 59 | 60 | #endif /* __FCITX_ANTHY_KANA_H__ */ 61 | /* 62 | vi:ts=4:nowrap:ai:expandtab 63 | */ 64 | -------------------------------------------------------------------------------- /src/key2kana.cpp: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2004 Hiroyuki Ikezoe 4 | * Copyright (C) 2004 Takuro Ashie 5 | * Copyright (C) 2012 CSSlayer 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, or (at your option) 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, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #include 23 | #include "key2kana.h" 24 | #include "factory.h" 25 | #include "imengine.h" 26 | #include "utils.h" 27 | 28 | Key2KanaConvertor::Key2KanaConvertor (AnthyInstance & anthy, 29 | Key2KanaTableSet & tables) 30 | : m_anthy (anthy), 31 | m_tables (tables), 32 | m_is_in_pseudo_ascii_mode (false) 33 | { 34 | set_case_sensitive (false); 35 | set_pseudo_ascii_mode (0); 36 | } 37 | 38 | Key2KanaConvertor::~Key2KanaConvertor () 39 | { 40 | } 41 | 42 | bool 43 | Key2KanaConvertor::can_append (const KeyEvent & key, 44 | bool ignore_space) 45 | { 46 | // ignore key release. 47 | if (key.is_release) 48 | return false; 49 | 50 | // ignore short cut keys of apllication. 51 | if ((key.state & FcitxKeyState_Ctrl) || 52 | (key.state & FcitxKeyState_Alt) || 53 | (key.state & FcitxKeyState_Super)) 54 | { 55 | return false; 56 | } 57 | 58 | if (isprint(key.get_ascii_code ()) && 59 | (ignore_space || !isspace(key.get_ascii_code ()))) 60 | return true; 61 | 62 | if (util_key_is_keypad (key)) 63 | return true; 64 | 65 | return false; 66 | } 67 | 68 | bool 69 | Key2KanaConvertor::append (const KeyEvent & key, 70 | std::string & result, 71 | std::string & pending, 72 | std::string &raw) 73 | { 74 | if (!can_append (key)) 75 | return false; 76 | 77 | m_last_key = key; 78 | 79 | util_keypad_to_string (raw, key); 80 | 81 | if (util_key_is_keypad (key)) { 82 | bool retval = false; 83 | std::string wide; 84 | TenKeyType ten_key_type = m_anthy.get_config()->m_ten_key_type; 85 | 86 | // convert key pad string to wide 87 | if ((ten_key_type == FCITX_ANTHY_TEN_KEY_TYPE_FOLLOWMODE && 88 | (m_anthy.get_input_mode () == FCITX_ANTHY_MODE_LATIN || 89 | m_anthy.get_input_mode () == FCITX_ANTHY_MODE_HALF_KATAKANA)) || 90 | ten_key_type == FCITX_ANTHY_TEN_KEY_TYPE_HALF) 91 | { 92 | wide = raw; 93 | } else { 94 | util_convert_to_wide (wide, raw); 95 | } 96 | 97 | // join to previous string 98 | if (!m_exact_match.is_empty()) { 99 | if (!m_exact_match.get_result(0).empty() && 100 | m_exact_match.get_result(1).empty()) 101 | { 102 | result = m_exact_match.get_result(0); 103 | } else { 104 | retval = true; /* commit prev pending */ 105 | } 106 | result += wide; 107 | } else { 108 | if (m_pending.length () > 0) 109 | retval = true; /* commit prev pending */ 110 | result = wide; 111 | } 112 | 113 | m_pending.clear (); 114 | m_exact_match.clear (); 115 | 116 | return retval; 117 | 118 | } else { 119 | // the key isn't keypad 120 | return append (raw, result, pending); 121 | } 122 | } 123 | 124 | static 125 | int split_string_list(std::vector& vec, const std::string& str) 126 | { 127 | int count = 0; 128 | 129 | std::string temp; 130 | std::string::const_iterator bg, ed; 131 | 132 | vec.clear (); 133 | 134 | bg = str.begin (); 135 | ed = str.begin (); 136 | 137 | while (bg != str.end () && ed != str.end ()) { 138 | for (; ed != str.end (); ++ed) { 139 | if (*ed == ',') 140 | break; 141 | } 142 | temp.assign (bg, ed); 143 | vec.push_back (temp); 144 | ++count; 145 | 146 | if (ed != str.end ()) 147 | bg = ++ ed; 148 | } 149 | return count; 150 | } 151 | 152 | static inline bool CheckLayout(FcitxInstance* instance) 153 | { 154 | char *layout = NULL, *variant = NULL; 155 | bool layout_is_jp = false; 156 | FcitxXkbGetCurrentLayout(instance, &layout, &variant); 157 | if (layout && strcmp(layout, "jp") == 0) 158 | layout_is_jp = true; 159 | 160 | fcitx_utils_free(layout); 161 | fcitx_utils_free(variant); 162 | 163 | return layout_is_jp; 164 | } 165 | 166 | bool 167 | Key2KanaConvertor::append (const std::string & str, 168 | std::string & result, std::string & pending) 169 | { 170 | std::string widestr = str; 171 | std::string matching_str = m_pending + widestr; 172 | Key2KanaRule exact_match; 173 | bool has_partial_match = false; 174 | bool retval = false; 175 | 176 | if (m_pseudo_ascii_mode != 0 && process_pseudo_ascii_mode (widestr)) { 177 | m_pending += widestr; 178 | pending = m_pending; 179 | return false; 180 | } 181 | if (!m_case_sensitive) { 182 | std::string half = matching_str; 183 | for (unsigned int i = 0; i < half.length (); i++) 184 | half[i] = tolower (half[i]); 185 | matching_str = half; 186 | } 187 | 188 | /* find matched table */ 189 | if ((m_anthy.get_typing_method () == FCITX_ANTHY_TYPING_METHOD_KANA) && 190 | (CheckLayout(m_anthy.get_owner())) && 191 | (m_last_key.sym == FcitxKey_backslash) && 192 | (!(m_last_key.keycode == 132 || m_last_key.keycode == 133)) && 193 | (m_anthy.get_config()->m_kana_layout_ro_key[0])) 194 | { 195 | // Special treatment for Kana "Ro" key. 196 | // This code is a temporary solution. It doesn't care some minor cases. 197 | std::vector kana_ro_result; 198 | split_string_list (kana_ro_result, 199 | m_anthy.get_config()->m_kana_layout_ro_key); 200 | Key2KanaRule kana_ro_rule("\\", kana_ro_result); 201 | result = kana_ro_rule.get_result (0); 202 | m_pending.clear (); 203 | m_exact_match.clear (); 204 | if (matching_str == "\\") { 205 | return false; 206 | } else { 207 | return true; 208 | } 209 | 210 | } else { 211 | std::vector &tables = m_tables.get_tables(); 212 | for (unsigned int j = 0; j < tables.size(); j++) { 213 | if (!tables[j]) 214 | continue; 215 | 216 | Key2KanaRules &rules = tables[j]->get_table (); 217 | 218 | for (unsigned int i = 0; i < rules.size(); i++) { 219 | /* matching */ 220 | std::string seq = rules[i].get_sequence (); 221 | if (!m_case_sensitive) { 222 | for (unsigned int j = 0; j < seq.length (); j++) 223 | seq[j] = tolower (seq[j]); 224 | } 225 | std::string romaji = seq; 226 | if (romaji.find (matching_str) == 0) { 227 | if (romaji.length () == matching_str.length ()) { 228 | /* exact match */ 229 | exact_match = rules[i]; 230 | } else { 231 | /* partial match */ 232 | has_partial_match = true; 233 | } 234 | } 235 | } 236 | } 237 | } 238 | 239 | /* return result */ 240 | if (has_partial_match) { 241 | m_exact_match = exact_match; 242 | result.clear (); 243 | m_pending += widestr; 244 | pending = m_pending; 245 | 246 | } else if (!exact_match.is_empty()) { 247 | if (!exact_match.get_result(1).empty()) 248 | m_exact_match = exact_match; 249 | else 250 | m_exact_match.clear (); 251 | m_pending = exact_match.get_result (1); 252 | result = exact_match.get_result (0); 253 | pending = m_pending; 254 | 255 | } else { 256 | if (!m_exact_match.is_empty()) { 257 | if (!m_exact_match.get_result(0).empty() && 258 | m_exact_match.get_result(1).empty()) 259 | { 260 | result = m_exact_match.get_result(0); 261 | } else { 262 | retval = true; /* commit prev pending */ 263 | } 264 | m_pending.clear (); 265 | m_exact_match.clear (); 266 | 267 | std::string tmp_result; 268 | append(str, tmp_result, pending); 269 | result += tmp_result; 270 | 271 | } else { 272 | if (m_pending.length () > 0) { 273 | retval = true; /* commit prev pending */ 274 | m_pending = widestr; 275 | pending = m_pending; 276 | 277 | } else { 278 | result = widestr; 279 | pending.clear(); 280 | m_pending.clear (); 281 | } 282 | } 283 | } 284 | 285 | return retval; 286 | } 287 | 288 | void 289 | Key2KanaConvertor::clear (void) 290 | { 291 | m_pending.clear (); 292 | m_exact_match.clear (); 293 | m_last_key = KeyEvent (); 294 | reset_pseudo_ascii_mode(); 295 | } 296 | 297 | bool 298 | Key2KanaConvertor::is_pending (void) 299 | { 300 | if (m_pending.length () > 0) 301 | return true; 302 | else 303 | return false; 304 | } 305 | 306 | std::string 307 | Key2KanaConvertor::get_pending (void) 308 | { 309 | return m_pending; 310 | } 311 | 312 | std::string 313 | Key2KanaConvertor::flush_pending (void) 314 | { 315 | std::string result; 316 | if (!m_exact_match.is_empty ()) { 317 | if (!m_exact_match.get_result(0).empty() && 318 | m_exact_match.get_result(1).empty()) 319 | { 320 | result = m_exact_match.get_result(0); 321 | } else if (!m_exact_match.get_result(1).empty()) { 322 | result += m_exact_match.get_result(1); 323 | } else if (m_pending.length () > 0) { 324 | result += m_pending; 325 | } 326 | } 327 | clear (); 328 | return result; 329 | } 330 | 331 | void 332 | Key2KanaConvertor::reset_pending (const std::string &result, const std::string &raw) 333 | { 334 | m_last_key = KeyEvent (); 335 | 336 | for (unsigned int i = 0; i < util_utf8_string_length(raw); i++) { 337 | std::string res, pend; 338 | append (util_utf8_string_substr(raw, i, 1), res, pend); 339 | } 340 | } 341 | 342 | bool 343 | Key2KanaConvertor::process_pseudo_ascii_mode (const std::string & wstr) 344 | { 345 | for (unsigned int i = 0; i < wstr.length (); i++) { 346 | if ((wstr[i] >= 'A' && wstr[i] <= 'Z') || 347 | isspace(wstr[i])) 348 | { 349 | m_is_in_pseudo_ascii_mode = true; 350 | } else if (wstr[i] & 0x80) { 351 | m_is_in_pseudo_ascii_mode = false; 352 | } 353 | } 354 | 355 | return m_is_in_pseudo_ascii_mode; 356 | } 357 | 358 | void 359 | Key2KanaConvertor::reset_pseudo_ascii_mode (void) 360 | { 361 | if (m_is_in_pseudo_ascii_mode) 362 | m_pending.clear(); 363 | m_is_in_pseudo_ascii_mode = false; 364 | } 365 | 366 | /* 367 | vi:ts=4:nowrap:ai:expandtab 368 | */ 369 | -------------------------------------------------------------------------------- /src/key2kana.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2004 Hiroyuki Ikezoe 4 | * Copyright (C) 2004 Takuro Ashie 5 | * Copyright (C) 2012 CSSlayer 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, or (at your option) 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, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef __FCITX_ANTHY_KEY2KANA_H__ 23 | #define __FCITX_ANTHY_KEY2KANA_H__ 24 | 25 | #include "key2kana_base.h" 26 | #include "default_tables.h" 27 | #include "key2kana_table.h" 28 | 29 | class AnthyInstance; 30 | 31 | class Key2KanaConvertor : public Key2KanaConvertorBase 32 | { 33 | public: 34 | Key2KanaConvertor (AnthyInstance & anthy, 35 | Key2KanaTableSet & tables); 36 | virtual ~Key2KanaConvertor (); 37 | 38 | bool can_append (const KeyEvent & key, 39 | bool ignore_space = false); 40 | bool append (const KeyEvent & key, 41 | std::string & result, 42 | std::string & pending, 43 | std::string & raw); 44 | void clear (void); 45 | 46 | bool is_pending (void); 47 | std::string get_pending (void); 48 | std::string flush_pending (void); 49 | void reset_pending (const std::string & result, 50 | const std::string & raw); 51 | void set_pseudo_ascii_mode (int mode) 52 | { m_pseudo_ascii_mode = mode; } 53 | bool is_pseudo_ascii_mode (void) 54 | { return m_is_in_pseudo_ascii_mode; } 55 | bool process_pseudo_ascii_mode (const std::string & wstr); 56 | void reset_pseudo_ascii_mode (void); 57 | 58 | private: 59 | bool append (const std::string & str, 60 | std::string & result, 61 | std::string & pending); 62 | 63 | private: 64 | AnthyInstance &m_anthy; 65 | Key2KanaTableSet &m_tables; 66 | 67 | // state 68 | KeyEvent m_last_key; 69 | std::string m_pending; 70 | Key2KanaRule m_exact_match; 71 | int m_pseudo_ascii_mode; 72 | bool m_is_in_pseudo_ascii_mode; 73 | bool m_reset_pseudo_ascii_mode; 74 | }; 75 | 76 | #endif /* __FCITX_ANTHY_KEY2KANA_H__ */ 77 | /* 78 | vi:ts=4:nowrap:ai:expandtab 79 | */ 80 | -------------------------------------------------------------------------------- /src/key2kana_base.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2004 Hiroyuki Ikezoe 4 | * Copyright (C) 2004 Takuro Ashie 5 | * Copyright (C) 2012 CSSlayer 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, or (at your option) 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, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef __FCITX_ANTHY_KEY2KANA_BASE_H__ 23 | #define __FCITX_ANTHY_KEY2KANA_BASE_H__ 24 | 25 | #include "common.h" 26 | 27 | class Key2KanaConvertorBase 28 | { 29 | public: 30 | Key2KanaConvertorBase () 31 | : m_case_sensitive (true) 32 | {}; 33 | virtual ~Key2KanaConvertorBase () {}; 34 | 35 | virtual bool can_append (const KeyEvent & key, 36 | bool ignore_space = false) = 0; 37 | virtual bool append (const KeyEvent & key, 38 | std::string & result, 39 | std::string & pending, 40 | std::string & raw) = 0; 41 | virtual bool append (const std::string & raw, 42 | std::string & result, 43 | std::string & pending) = 0; 44 | virtual void clear (void) = 0; 45 | 46 | virtual bool is_pending (void) = 0; 47 | virtual std::string get_pending (void) = 0; 48 | virtual std::string flush_pending (void) = 0; 49 | virtual void reset_pending (const std::string & result, 50 | const std::string & raw) = 0; 51 | 52 | virtual void reset_pseudo_ascii_mode (void) 53 | {} 54 | virtual bool process_pseudo_ascii_mode (const std::string & wstr) 55 | { return false; } 56 | 57 | virtual void set_case_sensitive (bool sensitive) 58 | { m_case_sensitive = sensitive; } 59 | virtual bool get_case_sensitive (void) 60 | { return m_case_sensitive; } 61 | 62 | protected: 63 | bool m_case_sensitive; 64 | }; 65 | 66 | #endif /* __FCITX_ANTHY_KEY2KANA_BASE_H__ */ 67 | /* 68 | vi:ts=4:nowrap:ai:expandtab 69 | */ 70 | -------------------------------------------------------------------------------- /src/key2kana_table.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2005 Takuro Ashie 4 | * Copyright (C) 2012 CSSlayer 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __FCITX_ANTHY_KEY2KANA_TABLE_H__ 22 | #define __FCITX_ANTHY_KEY2KANA_TABLE_H__ 23 | 24 | #include 25 | #include 26 | #include "default_tables.h" 27 | #include "factory.h" 28 | 29 | typedef enum { 30 | FCITX_ANTHY_PERIOD_JAPANESE, 31 | FCITX_ANTHY_PERIOD_WIDE, 32 | FCITX_ANTHY_PERIOD_HALF, 33 | } PeriodStyle; 34 | 35 | typedef enum { 36 | FCITX_ANTHY_COMMA_JAPANESE, 37 | FCITX_ANTHY_COMMA_WIDE, 38 | FCITX_ANTHY_COMMA_HALF, 39 | } CommaStyle; 40 | 41 | typedef enum { 42 | FCITX_ANTHY_BRACKET_JAPANESE, 43 | FCITX_ANTHY_BRACKET_WIDE, 44 | } BracketStyle; 45 | 46 | typedef enum { 47 | FCITX_ANTHY_SLASH_JAPANESE, 48 | FCITX_ANTHY_SLASH_WIDE, 49 | } SlashStyle; 50 | 51 | 52 | class Key2KanaRule; 53 | class Key2KanaTable; 54 | class Key2KanaTableSet; 55 | 56 | typedef std::vector Key2KanaRules; 57 | 58 | 59 | class Key2KanaRule 60 | { 61 | public: 62 | Key2KanaRule (); 63 | Key2KanaRule (std::string sequence, 64 | const std::vector &result); 65 | virtual ~Key2KanaRule (); 66 | 67 | std::string get_sequence (void); 68 | std::string get_result (unsigned int idx); 69 | 70 | void clear (void); 71 | 72 | bool is_empty (void); 73 | 74 | private: 75 | std::string m_sequence; 76 | std::vector m_result; 77 | }; 78 | 79 | 80 | class Key2KanaTable 81 | { 82 | public: 83 | Key2KanaTable (std::string name); 84 | Key2KanaTable (std::string name, 85 | ConvRule *table); 86 | Key2KanaTable (std::string name, 87 | NicolaRule *table); 88 | virtual ~Key2KanaTable (); 89 | 90 | Key2KanaRules & get_table (void) { return m_rules; } 91 | 92 | void append_rule (std::string sequence, 93 | const std::vector &result); 94 | void append_rule (std::string sequence, 95 | std::string result, 96 | std::string cont); 97 | void append_rule (std::string sequence, 98 | std::string normal, 99 | std::string left_shift, 100 | std::string right_shift); 101 | void clear (void); 102 | 103 | private: 104 | std::string m_name; 105 | Key2KanaRules m_rules; 106 | }; 107 | 108 | 109 | class Key2KanaTableSet 110 | { 111 | public: 112 | Key2KanaTableSet (); 113 | virtual ~Key2KanaTableSet (); 114 | 115 | std::vector & 116 | get_tables (void) { return m_all_tables; }; 117 | 118 | void set_typing_method (TypingMethod method, 119 | Key2KanaTable *fundamental_table = NULL); 120 | void set_symbol_width (bool half); 121 | void set_number_width (bool half); 122 | void set_period_style (PeriodStyle style); 123 | void set_comma_style (CommaStyle style); 124 | void set_bracket_style (BracketStyle style); 125 | void set_slash_style (SlashStyle style); 126 | 127 | TypingMethod 128 | get_typing_method (void) { return m_typing_method; } 129 | bool symbol_is_half (void) { return m_use_half_symbol; } 130 | bool number_is_half (void) { return m_use_half_number;} 131 | PeriodStyle 132 | get_period_style (void) { return m_period_style; } 133 | CommaStyle 134 | get_comma_style (void) { return m_comma_style; } 135 | BracketStyle 136 | get_bracket_style (void) { return m_bracket_style; } 137 | SlashStyle 138 | get_slash_style (void) { return m_slash_style; } 139 | 140 | #if 0 141 | void set_use_consonant_table (bool use); 142 | void set_use_symbol_table (bool use); 143 | void set_use_number_table (bool use); 144 | void set_use_period_table (bool use); 145 | void set_use_comma_table (bool use); 146 | 147 | bool get_use_consonant_table (void); 148 | bool get_use_symbol_table (void); 149 | bool get_use_number_table (void); 150 | bool get_use_period_table (void); 151 | bool get_use_comma_table (void); 152 | #endif 153 | 154 | private: 155 | void reset_tables (void); 156 | 157 | private: 158 | std::string m_name; 159 | 160 | // tables 161 | Key2KanaTable *m_fundamental_table; 162 | Key2KanaTable m_voiced_consonant_table; 163 | std::vector *m_additional_table; 164 | std::vector m_all_tables; 165 | 166 | // flags 167 | TypingMethod m_typing_method; 168 | PeriodStyle m_period_style; 169 | CommaStyle m_comma_style; 170 | BracketStyle m_bracket_style; 171 | SlashStyle m_slash_style; 172 | bool m_use_half_symbol; 173 | bool m_use_half_number; 174 | }; 175 | 176 | #endif /* __FCITX_ANTHY_KEY2KANA_TABLE_H__ */ 177 | /* 178 | vi:ts=4:nowrap:ai:expandtab 179 | */ 180 | -------------------------------------------------------------------------------- /src/nicola.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2004 Hiroyuki Ikezoe 4 | * Copyright (C) 2004 Takuro Ashie 5 | * Copyright (C) 2012 CSSlayer 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, or (at your option) 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, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef __FCITX_ANTHY_NICOLA_H__ 23 | #define __FCITX_ANTHY_NICOLA_H__ 24 | 25 | #include 26 | #include 27 | 28 | #include "key2kana_base.h" 29 | #include "key2kana_table.h" 30 | 31 | class AnthyInstance; 32 | 33 | typedef enum { 34 | FCITX_ANTHY_NICOLA_SHIFT_NONE, 35 | FCITX_ANTHY_NICOLA_SHIFT_LEFT, 36 | FCITX_ANTHY_NICOLA_SHIFT_RIGHT, 37 | } NicolaShiftType; 38 | 39 | class NicolaConvertor : public Key2KanaConvertorBase 40 | { 41 | public: 42 | NicolaConvertor (AnthyInstance & anthy, 43 | Key2KanaTableSet & tables); 44 | virtual ~NicolaConvertor (); 45 | 46 | bool can_append (const KeyEvent& key, 47 | bool ignore_space = false); 48 | bool append (const KeyEvent& key, 49 | std::string & result, 50 | std::string & pending, 51 | std::string & raw); 52 | bool append (const std::string & raw, 53 | std::string & result, 54 | std::string & pending); 55 | void clear (void); 56 | 57 | bool is_pending (void); 58 | std::string get_pending (void); 59 | std::string flush_pending (void); 60 | void reset_pending (const std::string & result, 61 | const std::string & raw); 62 | 63 | public: 64 | void process_timeout (void); 65 | 66 | private: 67 | void search (const KeyEvent& key, 68 | NicolaShiftType shift_type, 69 | std::string & result, 70 | std::string & raw); 71 | bool handle_voiced_consonant (std::string & result, 72 | std::string & pending); 73 | bool is_char_key (const KeyEvent& key); 74 | bool is_thumb_key (const KeyEvent& key); 75 | bool is_left_thumb_key (const KeyEvent& key); 76 | bool is_right_thumb_key (const KeyEvent& key); 77 | NicolaShiftType 78 | get_thumb_key_type (const KeyEvent& key); 79 | bool emit_key_event (const KeyEvent& key); 80 | void set_alarm (int time_msec); 81 | bool stop(); 82 | int thumb_key ( const KeyEvent& key); 83 | 84 | private: 85 | Key2KanaTableSet &m_tables; 86 | 87 | AnthyInstance &m_anthy; 88 | 89 | // state 90 | KeyEvent m_prev_char_key; 91 | 92 | KeyEvent m_repeat_char_key; 93 | 94 | uint32_t m_timer_id; 95 | bool m_processing_timeout; 96 | 97 | std::string m_pending; 98 | KeyEvent m_through_key_event; 99 | KeyEvent m_repeat_thumb_key; 100 | KeyEvent m_prev_thumb_key; 101 | }; 102 | 103 | #endif /* __FCITX_ANTHY_NICOLA_H__ */ 104 | /* 105 | vi:ts=4:nowrap:ai:expandtab 106 | */ 107 | -------------------------------------------------------------------------------- /src/preedit.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2004 Takuro Ashie 4 | * Copyright (C) 2012 CSSlayer 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __FCITX_ANTHY_PREEDIT_H__ 22 | #define __FCITX_ANTHY_PREEDIT_H__ 23 | 24 | #include 25 | #include "reading.h" 26 | #include "conversion.h" 27 | 28 | #define FCITX_ANTHY_PSEUDO_ASCII_TRIGGERED_CAPITALIZED (1 << 0) 29 | #define FCITX_ANTHY_PSEUDO_ASCII_TRIGGERED_COUPLE_OF_CAPITAL (1 << 1) 30 | 31 | class AnthyInstance; 32 | 33 | class Preedit 34 | { 35 | public: 36 | Preedit (AnthyInstance &anthy); 37 | virtual ~Preedit (); 38 | 39 | // getting status 40 | unsigned int get_length (void); 41 | unsigned int get_length_by_char (void); 42 | std::string get_string (void); 43 | void update_preedit (void); 44 | Reading &get_reading (void); 45 | 46 | bool is_preediting (void); 47 | bool is_converting (void); 48 | bool is_predicting (void); 49 | bool is_reconverting (void); 50 | 51 | // for handling the preedit string 52 | bool can_process_key_event (const KeyEvent & key); 53 | // return true if commiting is needed. 54 | bool process_key_event (const KeyEvent & key); 55 | bool append (const KeyEvent & key, 56 | const std::string & string); 57 | void erase (bool backward = true); 58 | void finish (void); 59 | 60 | // for handling the conversion string 61 | void convert (CandidateType type 62 | = FCITX_ANTHY_CANDIDATE_DEFAULT, 63 | bool single_segment = false); 64 | void convert (const std::string &source, 65 | bool single_segment = false); 66 | void revert (void); 67 | void commit (int segment_id = -1, 68 | bool lean = true); 69 | 70 | // for prediction 71 | void predict (void); 72 | 73 | // segments of the converted sentence 74 | int get_nr_segments (void); 75 | std::string get_segment_string (int segment_id = -1); 76 | int get_selected_segment (void); 77 | void select_segment (int segment_id); 78 | int get_segment_size (int segment_id = -1); 79 | void resize_segment (int relative_size, 80 | int segment_id = -1); 81 | 82 | // candidates for a segment 83 | void get_candidates (FcitxCandidateWordList *table, 84 | int segment_id = -1); 85 | int get_selected_candidate (int segment_id = -1); 86 | void select_candidate (int candidate_id, 87 | int segment_id = -1); 88 | 89 | // for handling the caret 90 | unsigned int get_caret_pos (void); 91 | void set_caret_pos_by_char (unsigned int pos); 92 | void move_caret (int len); 93 | 94 | // clear all or part of the string. 95 | void clear (int segment_id = -1); 96 | 97 | // preferences 98 | void set_input_mode (InputMode mode); 99 | InputMode get_input_mode (void); 100 | void set_typing_method (TypingMethod method); 101 | TypingMethod get_typing_method (void); 102 | void set_period_style (PeriodStyle style); 103 | PeriodStyle get_period_style (void); 104 | void set_comma_style (CommaStyle style); 105 | CommaStyle get_comma_style (void); 106 | void set_bracket_style (BracketStyle style); 107 | BracketStyle get_bracket_style (void); 108 | void set_slash_style (SlashStyle style); 109 | SlashStyle get_slash_style (void); 110 | void set_symbol_width (bool half); 111 | bool get_symbol_width (void); 112 | void set_number_width (bool half); 113 | bool get_number_width (void); 114 | void set_pseudo_ascii_mode (int mode); 115 | bool is_pseudo_ascii_mode (void); 116 | void reset_pseudo_ascii_mode(void); 117 | 118 | private: 119 | void get_reading_substr (std::string & substr, 120 | unsigned int start, 121 | unsigned int len, 122 | CandidateType type); 123 | bool is_comma_or_period (const std::string & str); 124 | 125 | private: 126 | AnthyInstance &m_anthy; 127 | 128 | // converter objects 129 | Reading m_reading; 130 | Conversion m_conversion; 131 | 132 | // mode flags 133 | InputMode m_input_mode; 134 | 135 | // source string for reconversion 136 | std::string m_source; 137 | }; 138 | 139 | #endif /* __FCITX_ANTHY_PREEDIT_H__ */ 140 | /* 141 | vi:ts=4:nowrap:ai:expandtab 142 | */ 143 | -------------------------------------------------------------------------------- /src/reading.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2005 Takuro Ashie 4 | * Copyright (C) 2012 CSSlayer 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __FCITX_ANTHY_READING_H__ 22 | #define __FCITX_ANTHY_READING_H__ 23 | 24 | #include "key2kana.h" 25 | #include "kana.h" 26 | #include "nicola.h" 27 | #include "factory.h" 28 | 29 | class AnthyInstance; 30 | 31 | typedef enum { 32 | FCITX_ANTHY_STRING_LATIN, 33 | FCITX_ANTHY_STRING_WIDE_LATIN, 34 | FCITX_ANTHY_STRING_HIRAGANA, 35 | FCITX_ANTHY_STRING_KATAKANA, 36 | FCITX_ANTHY_STRING_HALF_KATAKANA, 37 | } StringType; 38 | 39 | class Reading; 40 | class ReadingSegment; 41 | typedef std::vector ReadingSegments; 42 | 43 | class ReadingSegment 44 | { 45 | friend class Reading; 46 | 47 | public: 48 | ReadingSegment (void); 49 | virtual ~ReadingSegment (); 50 | 51 | const std::string & get (void) { return kana; } 52 | const std::string & get_raw (void) { return raw; } 53 | 54 | void split (ReadingSegments &segments); 55 | 56 | private: 57 | std::string raw; 58 | std::string kana; 59 | }; 60 | 61 | class Reading 62 | { 63 | public: 64 | Reading (AnthyInstance &anthy); 65 | virtual ~Reading (); 66 | 67 | bool can_process_key_event (const KeyEvent & key); 68 | bool process_key_event (const KeyEvent & key); 69 | void finish (void); 70 | void clear (void); 71 | 72 | std::string get_by_char (unsigned int start = 0, 73 | int length = -1, 74 | StringType type 75 | = FCITX_ANTHY_STRING_HIRAGANA); 76 | std::string get_raw_by_char (unsigned int start = 0, 77 | int length = -1); 78 | bool append (const KeyEvent & key, 79 | const std::string & string); 80 | void erase (unsigned int start = 0, 81 | int length = -1, 82 | bool allow_split = false); 83 | 84 | unsigned int get_length (void); 85 | unsigned int get_length_by_char (void); 86 | unsigned int get_caret_pos (void); 87 | unsigned int get_caret_pos_by_char (void); 88 | void set_caret_pos_by_char (unsigned int pos); 89 | void move_caret (int step, 90 | bool allow_split = false); 91 | 92 | void set_typing_method (TypingMethod method); 93 | TypingMethod get_typing_method (void); 94 | void set_period_style (PeriodStyle style); 95 | PeriodStyle get_period_style (void); 96 | void set_comma_style (CommaStyle style); 97 | CommaStyle get_comma_style (void); 98 | void set_bracket_style (BracketStyle style); 99 | BracketStyle get_bracket_style (void); 100 | void set_slash_style (SlashStyle style); 101 | SlashStyle get_slash_style (void); 102 | void set_symbol_width (bool half); 103 | bool get_symbol_width (void); 104 | void set_number_width (bool half); 105 | bool get_number_width (void); 106 | void set_pseudo_ascii_mode (int mode); 107 | bool is_pseudo_ascii_mode (void); 108 | void reset_pseudo_ascii_mode (void); 109 | 110 | private: 111 | void reset_pending (void); 112 | void split_segment (unsigned int seg_id); 113 | 114 | private: 115 | AnthyInstance &m_anthy; 116 | 117 | // tables 118 | Key2KanaTableSet m_key2kana_tables; 119 | Key2KanaTableSet m_nicola_tables; 120 | 121 | // convertors 122 | Key2KanaConvertor m_key2kana_normal; 123 | KanaConvertor m_kana; 124 | NicolaConvertor m_nicola; 125 | Key2KanaConvertorBase *m_key2kana; 126 | 127 | // state 128 | ReadingSegments m_segments; 129 | unsigned int m_segment_pos; 130 | unsigned int m_caret_offset; 131 | }; 132 | 133 | #endif /* __FCITX_ANTHY_READING_H__ */ 134 | /* 135 | vi:ts=4:nowrap:ai:expandtab 136 | */ 137 | -------------------------------------------------------------------------------- /src/style_file.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2005 Takuro Ashie 4 | * Copyright (C) 2012 CSSlayer 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __FCITX_ANTHY_STYLE_FILE_H__ 22 | #define __FCITX_ANTHY_STYLE_FILE_H__ 23 | 24 | #include 25 | #include 26 | 27 | class Key2KanaTable; 28 | class StyleLine; 29 | class StyleSection; 30 | class StyleFile; 31 | 32 | typedef std::vector StyleLines; 33 | typedef std::vector StyleSections; 34 | typedef std::vector StyleFiles; 35 | 36 | typedef enum { 37 | FCITX_ANTHY_STYLE_LINE_UNKNOWN, 38 | FCITX_ANTHY_STYLE_LINE_SPACE, 39 | FCITX_ANTHY_STYLE_LINE_COMMENT, 40 | FCITX_ANTHY_STYLE_LINE_SECTION, 41 | FCITX_ANTHY_STYLE_LINE_KEY, 42 | } StyleLineType; 43 | 44 | class StyleLine 45 | { 46 | public: 47 | StyleLine (StyleFile *style_file, 48 | std::string line); 49 | StyleLine (StyleFile *style_file, 50 | std::string key, 51 | std::string value); 52 | StyleLine (StyleFile *style_file, 53 | std::string key, 54 | std::vector &value); 55 | ~StyleLine (); 56 | 57 | public: 58 | StyleLineType get_type (void); 59 | void get_line (std::string &line) { line = m_line; } 60 | bool get_section (std::string §ion); 61 | bool get_key (std::string &key); 62 | bool get_value (std::string &value); 63 | void set_value (std::string value); 64 | bool get_value_array (std::vector &value); 65 | void set_value_array (std::vector &value); 66 | 67 | private: 68 | StyleFile *m_style_file; 69 | std::string m_line; 70 | StyleLineType m_type; 71 | }; 72 | 73 | class StyleFile 74 | { 75 | public: 76 | StyleFile (); 77 | ~StyleFile (); 78 | 79 | public: 80 | bool load (const char *filename); 81 | bool save (const char *filename); 82 | 83 | std::string get_title (void); 84 | std::string get_file_name (void); 85 | 86 | bool get_section_list (StyleSections §ions); 87 | bool get_entry_list (StyleLines &lines, 88 | std::string section); 89 | bool get_key_list (std::vector &keys, 90 | std::string section); 91 | bool get_string (std::string &value, 92 | std::string section, 93 | std::string key); 94 | bool get_string_array (std::vector &value, 95 | std::string section, 96 | std::string key); 97 | 98 | void set_string (std::string section, 99 | std::string key, 100 | std::string value); 101 | void set_string_array (std::string section, 102 | std::string key, 103 | std::vector &value); 104 | 105 | void delete_key (std::string section, 106 | std::string key); 107 | void delete_section (std::string section); 108 | 109 | public: // for getting specific data 110 | Key2KanaTable * 111 | get_key2kana_table (std::string section); 112 | 113 | private: 114 | void clear (void); 115 | void setup_default_entries (void); 116 | StyleLines * 117 | find_section (const std::string §ion); 118 | StyleLines & 119 | append_new_section (const std::string §ion); 120 | 121 | private: 122 | std::string m_filename; 123 | std::string m_format_version; 124 | std::string m_title; 125 | std::string m_version; 126 | 127 | StyleSections m_sections; 128 | }; 129 | 130 | #endif /* __FCITX_ANTHY_STYLE_FILE_H__ */ 131 | -------------------------------------------------------------------------------- /src/utils.cpp: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2005 Takuro Ashie 4 | * Copyright (C) 2012 CSSlayer 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include "utils.h" 29 | #include "default_tables.h" 30 | 31 | size_t 32 | util_utf8_string_length(const std::string& s) 33 | { 34 | return fcitx_utf8_strlen(s.c_str()); 35 | } 36 | 37 | std::string 38 | util_utf8_string_substr(const std::string& s, size_t start, size_t len) 39 | { 40 | char* cs = strdup(s.c_str()); 41 | char* startp = fcitx_utf8_get_nth_char(cs, start); 42 | char* endp = fcitx_utf8_get_nth_char(startp, len); 43 | std::string result(startp, endp - startp); 44 | free(cs); 45 | return result; 46 | } 47 | 48 | bool 49 | util_match_key_event (const FcitxHotkey* hotkey, const KeyEvent &key, 50 | uint32_t ignore_mask) 51 | { 52 | FcitxKeySym simpsym; 53 | unsigned int simpstate; 54 | FcitxHotkeyGetKey(key.sym, key.state, &simpsym, &simpstate); 55 | return FcitxHotkeyIsHotKey(simpsym, simpstate & ~ignore_mask, hotkey); 56 | } 57 | 58 | void 59 | util_split_string (std::string &str, std::vector &str_list, 60 | char *delim, int num) 61 | { 62 | std::string::size_type start = 0, end; 63 | 64 | for (int i = 0; (num > 0 && i < num) || start < str.length (); i++) { 65 | end = str.find (delim, start); 66 | if ((num > 0 && i == num - 1) || (end == std::string::npos)) 67 | end = str.length (); 68 | 69 | if (start < str.length ()) { 70 | str_list.push_back (str.substr (start, end - start)); 71 | start = end + strlen (delim); 72 | } else { 73 | str_list.push_back (std::string ()); 74 | } 75 | } 76 | } 77 | 78 | void 79 | util_convert_to_wide (std::string & wide, const std::string & str) 80 | { 81 | for (unsigned int i = 0; i < str.length (); i++) { 82 | int c = str[i]; 83 | char cc[2]; 84 | cc[0] = c; 85 | cc[1] = '\0'; 86 | bool found = false; 87 | 88 | for (unsigned int j = 0; fcitx_anthy_wide_table[j].code; j++) { 89 | if ( fcitx_anthy_wide_table[j].code && 90 | *fcitx_anthy_wide_table[j].code == c) 91 | { 92 | wide += fcitx_anthy_wide_table[j].wide; 93 | found = true; 94 | break; 95 | } 96 | } 97 | 98 | if (!found) 99 | wide += cc; 100 | } 101 | } 102 | 103 | void 104 | util_convert_to_half (std::string & half, const std::string & str) 105 | { 106 | for (unsigned int i = 0; i < util_utf8_string_length(str); i++) { 107 | std::string wide = util_utf8_string_substr(str, i, 1); 108 | bool found = false; 109 | 110 | for (unsigned int j = 0; fcitx_anthy_wide_table[j].code; j++) { 111 | if (fcitx_anthy_wide_table[j].wide && 112 | wide == fcitx_anthy_wide_table[j].wide) 113 | { 114 | half += fcitx_anthy_wide_table[j].code; 115 | found = true; 116 | break; 117 | } 118 | } 119 | 120 | if (!found) 121 | half += wide; 122 | } 123 | } 124 | 125 | void 126 | util_convert_to_katakana (std::string & kata, 127 | const std::string & hira, 128 | bool half) 129 | { 130 | for (unsigned int i = 0; i < util_utf8_string_length(hira); i++) { 131 | std::string tmpwide; 132 | bool found = false; 133 | 134 | HiraganaKatakanaRule *table = fcitx_anthy_hiragana_katakana_table; 135 | 136 | for (unsigned int j = 0; table[j].hiragana; j++) { 137 | tmpwide = table[j].hiragana; 138 | if (util_utf8_string_substr(hira, i, 1) == tmpwide) { 139 | if (half) 140 | kata += table[j].half_katakana; 141 | else 142 | kata += table[j].katakana; 143 | found = true; 144 | break; 145 | } 146 | } 147 | 148 | if (!found) 149 | kata += util_utf8_string_substr(hira, i, 1); 150 | } 151 | } 152 | 153 | bool 154 | util_key_is_keypad (const KeyEvent &key) 155 | { 156 | switch (key.sym) { 157 | case FcitxKey_KP_Equal: 158 | case FcitxKey_KP_Multiply: 159 | case FcitxKey_KP_Add: 160 | case FcitxKey_KP_Separator: 161 | case FcitxKey_KP_Subtract: 162 | case FcitxKey_KP_Decimal: 163 | case FcitxKey_KP_Divide: 164 | case FcitxKey_KP_0: 165 | case FcitxKey_KP_1: 166 | case FcitxKey_KP_2: 167 | case FcitxKey_KP_3: 168 | case FcitxKey_KP_4: 169 | case FcitxKey_KP_5: 170 | case FcitxKey_KP_6: 171 | case FcitxKey_KP_7: 172 | case FcitxKey_KP_8: 173 | case FcitxKey_KP_9: 174 | return true; 175 | default: 176 | return false; 177 | } 178 | } 179 | 180 | void 181 | util_keypad_to_string (std::string &str, const KeyEvent &key) 182 | { 183 | char raw[2]; 184 | 185 | switch (key.sym) { 186 | case FcitxKey_KP_Equal: 187 | raw[0] = '='; 188 | break; 189 | 190 | case FcitxKey_KP_Multiply: 191 | raw[0] = '*'; 192 | break; 193 | 194 | case FcitxKey_KP_Add: 195 | raw[0] = '+'; 196 | break; 197 | 198 | case FcitxKey_KP_Separator: 199 | raw[0] = ','; 200 | break; 201 | 202 | case FcitxKey_KP_Subtract: 203 | raw[0] = '-'; 204 | break; 205 | 206 | case FcitxKey_KP_Decimal: 207 | raw[0] = '.'; 208 | break; 209 | 210 | case FcitxKey_KP_Divide: 211 | raw[0] = '/'; 212 | break; 213 | 214 | case FcitxKey_KP_0: 215 | case FcitxKey_KP_1: 216 | case FcitxKey_KP_2: 217 | case FcitxKey_KP_3: 218 | case FcitxKey_KP_4: 219 | case FcitxKey_KP_5: 220 | case FcitxKey_KP_6: 221 | case FcitxKey_KP_7: 222 | case FcitxKey_KP_8: 223 | case FcitxKey_KP_9: 224 | raw[0] = '0' + key.sym - FcitxKey_KP_0; 225 | break; 226 | 227 | default: 228 | if (isprint (key.get_ascii_code())) 229 | raw[0] = key.get_ascii_code(); 230 | else 231 | raw[0] = '\0'; 232 | break; 233 | } 234 | 235 | raw[1] = '\0'; 236 | str = raw; 237 | } 238 | 239 | void 240 | util_launch_program (const char *command) 241 | { 242 | if (!command) return; 243 | 244 | /* split string */ 245 | unsigned int len = strlen (command); 246 | char tmp[len + 1]; 247 | strncpy (tmp, command, len); 248 | tmp[len] = '\0'; 249 | 250 | char *str = tmp; 251 | std::vector array; 252 | 253 | for (unsigned int i = 0; i < len + 1; i++) { 254 | if (!tmp[i] || isspace (tmp[i])) { 255 | if (*str) { 256 | tmp[i] = '\0'; 257 | array.push_back (str); 258 | } 259 | str = tmp + i + 1; 260 | } 261 | } 262 | 263 | if (array.size () <= 0) return; 264 | array.push_back (NULL); 265 | 266 | char **args = (char**) fcitx_utils_malloc0(sizeof(char*) * array.size()); 267 | for (unsigned int i = 0; i < array.size (); i++) 268 | args[i] = array[i]; 269 | 270 | fcitx_utils_start_process(args); 271 | 272 | free(args); 273 | } 274 | 275 | bool util_surrounding_get_safe_delta(uint from, uint to, int32_t *delta) { 276 | const int64_t kInt32AbsMax = 277 | llabs(static_cast(std::numeric_limits::max())); 278 | const int64_t kInt32AbsMin = 279 | llabs(static_cast(std::numeric_limits::min())); 280 | const int64_t kInt32SafeAbsMax = 281 | std::min(kInt32AbsMax, kInt32AbsMin); 282 | 283 | const int64_t diff = static_cast(from) - static_cast(to); 284 | if (llabs(diff) > kInt32SafeAbsMax) { 285 | return false; 286 | } 287 | 288 | *delta = static_cast(diff); 289 | return true; 290 | } 291 | 292 | // Returns true if |surrounding_text| contains |selected_text| 293 | // from |cursor_pos| to |*anchor_pos|. 294 | // Otherwise returns false. 295 | static bool search_anchor_pos_forward( 296 | const std::string &surrounding_text, 297 | const std::string &selected_text, 298 | size_t selected_chars_len, 299 | uint cursor_pos, 300 | uint *anchor_pos) { 301 | 302 | size_t len = fcitx_utf8_strlen(surrounding_text.c_str()); 303 | if (len < cursor_pos) { 304 | return false; 305 | } 306 | 307 | size_t offset = fcitx_utf8_get_nth_char(surrounding_text.c_str(), cursor_pos) - surrounding_text.c_str(); 308 | 309 | if (surrounding_text.compare(offset, selected_text.size(), selected_text) != 0) { 310 | return false; 311 | } 312 | *anchor_pos = cursor_pos + selected_chars_len; 313 | return true; 314 | } 315 | 316 | // Returns true if |surrounding_text| contains |selected_text| 317 | // from |*anchor_pos| to |cursor_pos|. 318 | // Otherwise returns false. 319 | bool search_anchor_pos_backward( 320 | const std::string &surrounding_text, 321 | const std::string &selected_text, 322 | size_t selected_chars_len, 323 | uint cursor_pos, 324 | uint *anchor_pos) { 325 | if (cursor_pos < selected_chars_len) { 326 | return false; 327 | } 328 | 329 | // Skip |iter| to (potential) anchor pos. 330 | const uint skip_count = cursor_pos - selected_chars_len; 331 | if (skip_count > cursor_pos) { 332 | return false; 333 | } 334 | size_t offset = fcitx_utf8_get_nth_char(surrounding_text.c_str(), skip_count) - surrounding_text.c_str(); 335 | 336 | if (surrounding_text.compare(offset, selected_text.size(), selected_text) != 0) { 337 | return false; 338 | } 339 | *anchor_pos = skip_count; 340 | return true; 341 | } 342 | 343 | bool util_surrounding_get_anchor_pos_from_selection( 344 | const std::string &surrounding_text, 345 | const std::string &selected_text, 346 | uint cursor_pos, 347 | uint *anchor_pos) { 348 | if (surrounding_text.empty()) { 349 | return false; 350 | } 351 | 352 | if (selected_text.empty()) { 353 | return false; 354 | } 355 | 356 | const size_t selected_chars_len = fcitx_utf8_strlen(selected_text.c_str()); 357 | 358 | if (search_anchor_pos_forward(surrounding_text, selected_text, 359 | selected_chars_len, 360 | cursor_pos, anchor_pos)) { 361 | return true; 362 | } 363 | 364 | return search_anchor_pos_backward(surrounding_text, selected_text, 365 | selected_chars_len, 366 | cursor_pos, anchor_pos); 367 | } 368 | -------------------------------------------------------------------------------- /src/utils.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2005 Takuro Ashie 4 | * Copyright (C) 2012 CSSlayer 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __FCITX_ANTHY_UTILS_H__ 22 | #define __FCITX_ANTHY_UTILS_H__ 23 | 24 | #include "common.h" 25 | 26 | size_t 27 | util_utf8_string_length(const std::string& s); 28 | 29 | std::string 30 | util_utf8_string_substr(const std::string& s, size_t start, size_t len); 31 | 32 | bool util_match_key_event (const FcitxHotkey* list, 33 | const KeyEvent &key, 34 | uint32_t ignore_mask = 0); 35 | void util_split_string (std::string &str, 36 | std::vector &str_list, 37 | char *delim, 38 | int num); 39 | void util_convert_to_wide (std::string &wide, 40 | const std::string &str); 41 | void util_convert_to_half (std::string &half, 42 | const std::string &str); 43 | void util_convert_to_katakana (std::string &kata, 44 | const std::string &hira, 45 | bool half = false); 46 | 47 | bool util_key_is_keypad (const KeyEvent &key); 48 | void util_keypad_to_string (std::string &str, 49 | const KeyEvent &key); 50 | void util_launch_program (const char *command); 51 | 52 | 53 | 54 | bool util_surrounding_get_safe_delta(uint from, uint to, int32_t *delta); 55 | 56 | bool util_surrounding_get_anchor_pos_from_selection( 57 | const std::string &surrounding_text, 58 | const std::string &selected_text, 59 | uint cursor_pos, 60 | uint *anchor_pos); 61 | 62 | #endif /* __FCITX_ANTHY_UTILS_H__ */ 63 | --------------------------------------------------------------------------------