├── .clang-format ├── .github └── workflows │ └── check.yml ├── .gitignore ├── CMakeLists.txt ├── ChangeLog ├── LICENSES ├── GPL-2.0-or-later.txt └── LGPL-2.0-or-later.txt ├── Messages.sh ├── README ├── data ├── 128x128 │ └── apps │ │ ├── fcitx-unikey.png │ │ └── org.fcitx.Fcitx5.fcitx-unikey.png ├── 16x16 │ └── apps │ │ ├── fcitx-unikey.png │ │ └── org.fcitx.Fcitx5.fcitx-unikey.png ├── 22x22 │ └── apps │ │ ├── fcitx-unikey.png │ │ └── org.fcitx.Fcitx5.fcitx-unikey.png ├── 24x24 │ └── apps │ │ ├── fcitx-unikey.png │ │ └── org.fcitx.Fcitx5.fcitx-unikey.png ├── 48x48 │ └── apps │ │ ├── fcitx-unikey.png │ │ └── org.fcitx.Fcitx5.fcitx-unikey.png └── CMakeLists.txt ├── keymap-editor ├── CMakeLists.txt ├── actions.cpp ├── actions.h ├── editor.cpp ├── editor.h ├── editor.ui ├── keymap-editor.json ├── main.cpp ├── main.h ├── model.cpp └── model.h ├── macro-editor ├── CMakeLists.txt ├── dialog.cpp ├── dialog.h ├── dialog.ui ├── editor.cpp ├── editor.h ├── editor.ui ├── macro-editor.json ├── main.cpp ├── main.h ├── model.cpp └── model.h ├── org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in ├── po ├── CMakeLists.txt ├── LINGUAS ├── ca.po ├── da.po ├── de.po ├── fcitx5-unikey.pot ├── fr.po ├── he.po ├── ja.po ├── ko.po ├── ru.po ├── tr.po ├── vi.po ├── zh_CN.po └── zh_TW.po ├── src ├── CMakeLists.txt ├── unikey-addon.conf.in.in ├── unikey-config.h ├── unikey-im.cpp ├── unikey-im.h └── unikey.conf.in ├── test ├── CMakeLists.txt ├── addon │ └── CMakeLists.txt ├── inputmethod │ └── CMakeLists.txt ├── testdir.h.in └── testunikey.cpp └── unikey ├── CMakeLists.txt ├── README ├── byteio.cpp ├── byteio.h ├── charset.cpp ├── charset.h ├── convert.cpp ├── data.cpp ├── data.h ├── inputproc.cpp ├── inputproc.h ├── keycons.h ├── mactab.cpp ├── mactab.h ├── pattern.cpp ├── pattern.h ├── ukengine.cpp ├── ukengine.h ├── unikeyinputcontext.cpp ├── unikeyinputcontext.h ├── usrkeymap.cpp ├── usrkeymap.h ├── vnconv.h └── vnlexi.h /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | # BasedOnStyle: LLVM 4 | AccessModifierOffset: -4 5 | ConstructorInitializerIndentWidth: 4 6 | AlignEscapedNewlinesLeft: false 7 | AlignTrailingComments: true 8 | AllowAllParametersOfDeclarationOnNextLine: true 9 | AllowShortBlocksOnASingleLine: false 10 | AllowShortIfStatementsOnASingleLine: false 11 | AllowShortLoopsOnASingleLine: false 12 | AllowShortFunctionsOnASingleLine: All 13 | AlwaysBreakTemplateDeclarations: true 14 | AlwaysBreakBeforeMultilineStrings: false 15 | BreakBeforeBinaryOperators: false 16 | BreakBeforeTernaryOperators: true 17 | BreakConstructorInitializersBeforeComma: false 18 | BinPackParameters: true 19 | ColumnLimit: 80 20 | ConstructorInitializerAllOnOneLineOrOnePerLine: false 21 | DerivePointerAlignment: false 22 | ExperimentalAutoDetectBinPacking: false 23 | IndentCaseLabels: false 24 | IndentWrappedFunctionNames: false 25 | IndentFunctionDeclarationAfterType: false 26 | MaxEmptyLinesToKeep: 1 27 | KeepEmptyLinesAtTheStartOfBlocks: true 28 | NamespaceIndentation: None 29 | ObjCSpaceAfterProperty: false 30 | ObjCSpaceBeforeProtocolList: true 31 | PenaltyBreakBeforeFirstCallParameter: 19 32 | PenaltyBreakComment: 300 33 | PenaltyBreakString: 1000 34 | PenaltyBreakFirstLessLess: 120 35 | PenaltyExcessCharacter: 1000000 36 | PenaltyReturnTypeOnItsOwnLine: 60 37 | PointerAlignment: Right 38 | SpacesBeforeTrailingComments: 1 39 | Cpp11BracedListStyle: true 40 | Standard: Cpp11 41 | IndentWidth: 4 42 | TabWidth: 4 43 | UseTab: Never 44 | BreakBeforeBraces: Attach 45 | SpacesInParentheses: false 46 | SpacesInAngles: false 47 | SpaceInEmptyParentheses: false 48 | SpacesInCStyleCastParentheses: false 49 | SpacesInContainerLiterals: true 50 | SpaceBeforeAssignmentOperators: true 51 | ContinuationIndentWidth: 4 52 | CommentPragmas: '^ IWYU pragma:' 53 | ForEachMacros: [ Q_FOREACH, BOOST_FOREACH ] 54 | SpaceBeforeParens: ControlStatements 55 | DisableFormat: false 56 | SortIncludes: true 57 | ... 58 | 59 | -------------------------------------------------------------------------------- /.github/workflows/check.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | push: 4 | branches: 5 | - master 6 | pull_request: 7 | branches: 8 | - master 9 | jobs: 10 | clang-format: 11 | name: Check clang-format 12 | runs-on: ubuntu-latest 13 | container: archlinux:latest 14 | steps: 15 | - name: Install dependencies 16 | run: | 17 | pacman -Syu --noconfirm git clang diffutils 18 | git config --global --add safe.directory $GITHUB_WORKSPACE 19 | - uses: actions/checkout@v4 20 | - uses: fcitx/github-actions@clang-format 21 | check: 22 | name: Build and test 23 | needs: clang-format 24 | runs-on: ubuntu-latest 25 | container: archlinux:latest 26 | strategy: 27 | fail-fast: false 28 | matrix: 29 | compiler: [gcc, clang] 30 | include: 31 | - compiler: gcc 32 | cxx_compiler: g++ 33 | - compiler: clang 34 | cxx_compiler: clang++ 35 | env: 36 | CC: ${{ matrix.compiler }} 37 | CXX: ${{ matrix.cxx_compiler }} 38 | steps: 39 | - name: Install dependencies 40 | run: | 41 | pacman -Syu --noconfirm base-devel clang cmake ninja extra-cmake-modules fmt libuv boost git qt6-base qt6-wayland libxkbcommon 42 | - uses: actions/checkout@v4 43 | with: 44 | repository: fcitx/fcitx5 45 | path: fcitx5 46 | - name: Cache fcitx5 data files 47 | uses: actions/cache@v4 48 | with: 49 | path: 'fcitx5/**/*.tar.*' 50 | key: ${{ runner.os }}-${{ hashFiles('fcitx5/src/modules/spell/CMakeLists.txt') 51 | }} 52 | - name: Build and Install fcitx5 53 | uses: fcitx/github-actions@cmake 54 | with: 55 | path: fcitx5 56 | cmake-option: >- 57 | -DENABLE_KEYBOARD=Off -DENABLE_X11=Off -DENABLE_WAYLAND=Off -DENABLE_ENCHANT=Off 58 | -DENABLE_DBUS=Off -DENABLE_SERVER=Off -DENABLE_EMOJI=Off -DUSE_SYSTEMD=Off 59 | - uses: actions/checkout@v4 60 | with: 61 | repository: fcitx/fcitx5-qt 62 | path: fcitx5-qt 63 | - name: Build and Install fcitx5-qt 64 | uses: fcitx/github-actions@cmake 65 | with: 66 | repository: fcitx/fcitx5-qt 67 | path: fcitx5-qt 68 | cmake-option: >- 69 | -DENABLE_QT4=Off -DENABLE_QT5=Off -DENABLE_QT6=On 70 | - uses: actions/checkout@v4 71 | with: 72 | path: fcitx5-unikey 73 | - name: Init CodeQL 74 | uses: github/codeql-action/init@v3 75 | with: 76 | languages: cpp 77 | source-root: fcitx5-unikey 78 | - name: Build and Install fcitx5-unikey 79 | uses: fcitx/github-actions@cmake 80 | with: 81 | path: fcitx5-unikey 82 | - name: Test 83 | run: | 84 | ctest --test-dir fcitx5-unikey/build 85 | - name: CodeQL Analysis 86 | uses: github/codeql-action/analyze@v2 87 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build*/ 2 | .* 3 | !.git* 4 | .git/ 5 | *.tar.* 6 | *.kdev4 7 | .kdev_include_paths 8 | .directory 9 | *.kate-swp 10 | *.orig 11 | *~ 12 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.6) 2 | 3 | project(fcitx5-unikey VERSION 5.1.6) 4 | 5 | set(REQUIRED_FCITX_VERSION 5.1.13) 6 | find_package(ECM 1.0.0 REQUIRED) 7 | set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) 8 | include(FeatureSummary) 9 | include(GNUInstallDirs) 10 | include(ECMUninstallTarget) 11 | 12 | option(ENABLE_QT "Enable Qt based macro editor" On) 13 | option(ENABLE_TEST "Build Test" On) 14 | option(ENABLE_COVERAGE "Build the project with gcov support (Need ENABLE_TEST=On)" Off) 15 | 16 | find_package(PkgConfig REQUIRED) 17 | find_package(Fcitx5Core ${REQUIRED_FCITX_VERSION} REQUIRED) 18 | find_package(Fcitx5Module REQUIRED COMPONENTS TestFrontend) 19 | find_package(Gettext REQUIRED) 20 | 21 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") 22 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") 23 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") 24 | 25 | include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake") 26 | add_definitions(-DFCITX_GETTEXT_DOMAIN=\"fcitx5-unikey\") 27 | fcitx5_add_i18n_definition() 28 | 29 | if (ENABLE_QT) 30 | set(QT_MAJOR_VERSION 6) 31 | find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) 32 | find_package(Fcitx5Qt${QT_MAJOR_VERSION}WidgetsAddons 5.0.12 REQUIRED) 33 | add_subdirectory(macro-editor) 34 | add_subdirectory(keymap-editor) 35 | endif (ENABLE_QT) 36 | 37 | add_subdirectory(po) 38 | add_subdirectory(unikey) 39 | add_subdirectory(src) 40 | add_subdirectory(data) 41 | 42 | if (ENABLE_TEST) 43 | enable_testing() 44 | add_subdirectory(test) 45 | 46 | if (ENABLE_COVERAGE) 47 | add_custom_target(coverage 48 | COMMAND "${CMAKE_CTEST_COMMAND}" 49 | COMMAND lcov --gcov-tool "${GCOV_TOOL}" --no-external --capture --directory ./ -b "${CMAKE_CURRENT_SOURCE_DIR}" --output-file coverage.info 50 | COMMAND genhtml coverage.info --output-directory "coverage_pages" 51 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) 52 | endif() 53 | endif () 54 | 55 | fcitx5_translate_desktop_file(org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in 56 | org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml XML) 57 | 58 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml" DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo) 59 | 60 | feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) 61 | 62 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | 2013-07-15: CSSlayer 2 | * 0.2.2 3 | - Fix unikey doesn't show in list 4 | - fix icon install path 5 | -------------------------------------------------------------------------------- /Messages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | gen_pot cxx:appdata:ui:desktop fcitx5-unikey po . 4 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Unikey (Vietnamese Input Method) engine support for Fcitx 2 | 3 | Released under mixed GPLv2+ 4 | 5 | Install: 6 | $ mkdir build && cd build 7 | $ cmake -DCMAKE_INSTALL_PREFIX=[prefix to fcitx5] .. 8 | $ make 9 | # make install 10 | -------------------------------------------------------------------------------- /data/128x128/apps/fcitx-unikey.png: -------------------------------------------------------------------------------- 1 | org.fcitx.Fcitx5.fcitx-unikey.png -------------------------------------------------------------------------------- /data/128x128/apps/org.fcitx.Fcitx5.fcitx-unikey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5-unikey/5229cd86492c5c71b2d3112da89ff2464a0c7f26/data/128x128/apps/org.fcitx.Fcitx5.fcitx-unikey.png -------------------------------------------------------------------------------- /data/16x16/apps/fcitx-unikey.png: -------------------------------------------------------------------------------- 1 | org.fcitx.Fcitx5.fcitx-unikey.png -------------------------------------------------------------------------------- /data/16x16/apps/org.fcitx.Fcitx5.fcitx-unikey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5-unikey/5229cd86492c5c71b2d3112da89ff2464a0c7f26/data/16x16/apps/org.fcitx.Fcitx5.fcitx-unikey.png -------------------------------------------------------------------------------- /data/22x22/apps/fcitx-unikey.png: -------------------------------------------------------------------------------- 1 | org.fcitx.Fcitx5.fcitx-unikey.png -------------------------------------------------------------------------------- /data/22x22/apps/org.fcitx.Fcitx5.fcitx-unikey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5-unikey/5229cd86492c5c71b2d3112da89ff2464a0c7f26/data/22x22/apps/org.fcitx.Fcitx5.fcitx-unikey.png -------------------------------------------------------------------------------- /data/24x24/apps/fcitx-unikey.png: -------------------------------------------------------------------------------- 1 | org.fcitx.Fcitx5.fcitx-unikey.png -------------------------------------------------------------------------------- /data/24x24/apps/org.fcitx.Fcitx5.fcitx-unikey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5-unikey/5229cd86492c5c71b2d3112da89ff2464a0c7f26/data/24x24/apps/org.fcitx.Fcitx5.fcitx-unikey.png -------------------------------------------------------------------------------- /data/48x48/apps/fcitx-unikey.png: -------------------------------------------------------------------------------- 1 | org.fcitx.Fcitx5.fcitx-unikey.png -------------------------------------------------------------------------------- /data/48x48/apps/org.fcitx.Fcitx5.fcitx-unikey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5-unikey/5229cd86492c5c71b2d3112da89ff2464a0c7f26/data/48x48/apps/org.fcitx.Fcitx5.fcitx-unikey.png -------------------------------------------------------------------------------- /data/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(DIRECTORY 128x128 16x16 22x22 24x24 48x48 DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor" 2 | PATTERN .* EXCLUDE 3 | PATTERN *~ EXCLUDE) 4 | -------------------------------------------------------------------------------- /keymap-editor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | set(KEYMAP_EDITOR_SRCS 4 | main.cpp 5 | editor.cpp 6 | model.cpp 7 | actions.cpp 8 | ) 9 | 10 | add_library(fcitx5-unikey-keymap-editor 11 | MODULE ${KEYMAP_EDITOR_SRCS}) 12 | set_target_properties(fcitx5-unikey-keymap-editor PROPERTIES 13 | AUTOMOC TRUE 14 | AUTOUIC TRUE 15 | AUTOUIC_OPTIONS "-tr=fcitx::tr2fcitx;--include=fcitxqti18nhelper.h" 16 | ) 17 | target_link_libraries(fcitx5-unikey-keymap-editor 18 | Qt${QT_MAJOR_VERSION}::Core 19 | Qt${QT_MAJOR_VERSION}::Widgets 20 | Fcitx5Qt${QT_MAJOR_VERSION}::WidgetsAddons 21 | unikey-lib 22 | ) 23 | 24 | install(TARGETS fcitx5-unikey-keymap-editor DESTINATION ${CMAKE_INSTALL_LIBDIR}/fcitx5/qt${QT_MAJOR_VERSION}) 25 | 26 | -------------------------------------------------------------------------------- /keymap-editor/actions.cpp: -------------------------------------------------------------------------------- 1 | #include "actions.h" 2 | #include "inputproc.h" 3 | #include 4 | #include 5 | #include 6 | 7 | namespace fcitx::unikey { 8 | 9 | const std::vector> &actionNames() { 10 | static const auto names = []() { 11 | std::vector> result; 12 | const std::tuple UkEvNameList[] = { 13 | {N_("Remove existing tone"), vneTone0, AC_Tone}, 14 | {N_("Tone ' (acute)"), vneTone1, AC_Tone}, 15 | {N_("Tone ` (grave)"), vneTone2, AC_Tone}, 16 | {N_("Tone ◌̉ (hook above)"), vneTone3, AC_Tone}, 17 | {N_("Tone ~ (tilde)"), vneTone4, AC_Tone}, 18 | {N_("Tone . (dot below)"), vneTone5, AC_Tone}, 19 | {N_("Escape key"), vneEscChar, AC_Tone}, 20 | {N_("Circumflex for all applicable characters"), vneRoofAll, 21 | AC_ChrComp}, 22 | {N_("Circumflex: A becomes A^"), vneRoof_a, AC_ChrComp}, 23 | {N_("Circumflex: E becomes E^"), vneRoof_e, AC_ChrComp}, 24 | {N_("Circumflex: O becomes O^"), vneRoof_o, AC_ChrComp}, 25 | {N_("Horn-Breve: U, O, A, become U+, O+, A("), vneHookAll, 26 | AC_ChrComp}, 27 | {N_("Horn: U, O become U+, O+"), vneHook_uo, AC_ChrComp}, 28 | {N_("Horn: U becomes U+"), vneHook_u, AC_ChrComp}, 29 | {N_("Horn: O becomes O+"), vneHook_o, AC_ChrComp}, 30 | {N_("Breve: A becomes A("), vneBowl, AC_ChrComp}, 31 | {N_("Stroke: D becomes -D"), vneDd, AC_ChrComp}, 32 | {N_("Horn-Breve: U, O, A, become U+, O+, A(, or create U+"), 33 | vne_telex_w, AC_ChrComp}, 34 | {N_("D with stroke [-D]"), vneCount + vnl_DD, AC_Viet}, 35 | {N_("d with stroke [-d]"), vneCount + vnl_dd, AC_Viet}, 36 | {N_("A with circumflex [A^]"), vneCount + vnl_Ar, AC_Viet}, 37 | {N_("a with circumflex [a^]"), vneCount + vnl_ar, AC_Viet}, 38 | {N_("A with breve [A(]"), vneCount + vnl_Ab, AC_Viet}, 39 | {N_("a with breve [a(]"), vneCount + vnl_ab, AC_Viet}, 40 | {N_("E with circumflex [E^]"), vneCount + vnl_Er, AC_Viet}, 41 | {N_("e with circumflex [e^]"), vneCount + vnl_er, AC_Viet}, 42 | {N_("O with circumflex [O^]"), vneCount + vnl_Or, AC_Viet}, 43 | {N_("o with circumflex [o^]"), vneCount + vnl_or, AC_Viet}, 44 | {N_("O with horn [O+]"), vneCount + vnl_Oh, AC_Viet}, 45 | {N_("o with horn [o+]"), vneCount + vnl_oh, AC_Viet}, 46 | {N_("U with horn [U+]"), vneCount + vnl_Uh, AC_Viet}, 47 | {N_("u with horn [u+]"), vneCount + vnl_uh, AC_Viet}}; 48 | result.reserve(FCITX_ARRAY_SIZE(UkEvNameList)); 49 | for (const auto &item : UkEvNameList) { 50 | result.push_back(item); 51 | } 52 | return result; 53 | }(); 54 | return names; 55 | } 56 | 57 | static const std::string emptyString; 58 | const std::string &actionName(int action) { 59 | static const auto actionToNameMap = []() { 60 | std::unordered_map result; 61 | for (const auto &[name, action, _] : actionNames()) { 62 | result[action] = name; 63 | } 64 | return result; 65 | }(); 66 | 67 | if (auto iter = actionToNameMap.find(action); 68 | iter != actionToNameMap.end()) { 69 | return iter->second; 70 | } 71 | return emptyString; 72 | } 73 | 74 | int actionCategory(int action) { 75 | switch (action) { 76 | case vneTone0: 77 | case vneTone1: 78 | case vneTone2: 79 | case vneTone3: 80 | case vneTone4: 81 | case vneTone5: 82 | case vneEscChar: 83 | return AC_Tone; 84 | case vneRoofAll: 85 | case vneRoof_a: 86 | case vneRoof_e: 87 | case vneRoof_o: 88 | case vneHookAll: 89 | case vneHook_uo: 90 | case vneHook_u: 91 | case vneHook_o: 92 | case vneBowl: 93 | case vneDd: 94 | case vne_telex_w: 95 | return AC_ChrComp; 96 | case vneCount + vnl_DD: 97 | case vneCount + vnl_dd: 98 | case vneCount + vnl_Ar: 99 | case vneCount + vnl_ar: 100 | case vneCount + vnl_Ab: 101 | case vneCount + vnl_ab: 102 | case vneCount + vnl_Er: 103 | case vneCount + vnl_er: 104 | case vneCount + vnl_Or: 105 | case vneCount + vnl_or: 106 | case vneCount + vnl_Oh: 107 | case vneCount + vnl_oh: 108 | case vneCount + vnl_Uh: 109 | case vneCount + vnl_uh: 110 | return AC_Viet; 111 | } 112 | return -1; 113 | } 114 | 115 | } // namespace fcitx::unikey 116 | -------------------------------------------------------------------------------- /keymap-editor/actions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2012-2018 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #ifndef _KEYMAP_EDITOR_ACTIONS_H_ 8 | #define _KEYMAP_EDITOR_ACTIONS_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | namespace fcitx::unikey { 15 | 16 | enum ActionCategory { AC_Tone, AC_ChrComp, AC_Viet }; 17 | 18 | const std::vector> &actionNames(); 19 | const std::string &actionName(int action); 20 | int actionCategory(int action); 21 | 22 | } // namespace fcitx::unikey 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /keymap-editor/editor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2012-2018 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #include "editor.h" 8 | #include "actions.h" 9 | #include "keycons.h" 10 | #include "model.h" 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | namespace fcitx::unikey { 32 | 33 | KeymapEditor::KeymapEditor(QWidget *parent) : FcitxQtConfigUIWidget(parent) { 34 | setupUi(this); 35 | 36 | keySequenceEdit->setKeycodeAllowed(false); 37 | keySequenceEdit->setModifierAllowed(false); 38 | keySequenceEdit->setModifierlessAllowed(true); 39 | 40 | connect(addButton, &QPushButton::clicked, this, &KeymapEditor::addKeymap); 41 | connect(moveUpButton, &QPushButton::clicked, this, [this]() { 42 | if (auto index = keymapView->currentIndex(); index.isValid()) { 43 | model_->moveUp(index.row()); 44 | } 45 | }); 46 | connect(moveDownButton, &QPushButton::clicked, this, [this]() { 47 | if (auto index = keymapView->currentIndex(); index.isValid()) { 48 | model_->moveDown(index.row()); 49 | } 50 | }); 51 | connect(deleteButton, &QPushButton::clicked, this, 52 | &KeymapEditor::deleteKeymap); 53 | connect(clearButton, &QPushButton::clicked, this, 54 | &KeymapEditor::deleteAllKeymap); 55 | connect(importButton, &QPushButton::clicked, this, 56 | &KeymapEditor::importKeymap); 57 | connect(exportButton, &QPushButton::clicked, this, 58 | &KeymapEditor::exportKeymap); 59 | 60 | inputMethodBox->addItem(_("Telex"), UkTelex); 61 | inputMethodBox->addItem(_("VNI"), UkVni); 62 | inputMethodBox->addItem(_("VIQR"), UkViqr); 63 | inputMethodBox->addItem(_("Microsoft Vietnamese"), UkMsVi); 64 | inputMethodBox->addItem(_("Simple Telex"), UkSimpleTelex); 65 | inputMethodBox->addItem(_("Simple Telex2"), UkSimpleTelex2); 66 | 67 | categoryBox->addItem(_("Tone marks")); 68 | categoryBox->addItem(_("Character complements")); 69 | categoryBox->addItem(_("Vietnamese characters")); 70 | 71 | for (const auto &[text, action, category] : actionNames()) { 72 | QStandardItem *item = 73 | new QStandardItem(QString::fromStdString(_(text))); 74 | item->setData(action, Qt::UserRole); 75 | item->setData(category, Qt::UserRole + 1); 76 | actionModel_.insertRow(actionModel_.rowCount(), item); 77 | } 78 | 79 | filteredActionModel_.setSourceModel(&actionModel_); 80 | 81 | actionBox->setModel(&filteredActionModel_); 82 | connect(categoryBox, qOverload(&QComboBox::currentIndexChanged), 83 | &filteredActionModel_, &ActionFilterModel::setCategory); 84 | connect(categoryBox, qOverload(&QComboBox::currentIndexChanged), this, 85 | [this]() { actionBox->setCurrentIndex(0); }); 86 | categoryBox->setCurrentIndex(0); 87 | 88 | model_ = new KeymapModel(this); 89 | keymapView->horizontalHeader()->setStretchLastSection(true); 90 | keymapView->verticalHeader()->setVisible(false); 91 | keymapView->setModel(model_); 92 | connect(keymapView->selectionModel(), &QItemSelectionModel::currentChanged, 93 | this, &KeymapEditor::itemFocusChanged); 94 | connect(model_, &QAbstractItemModel::rowsMoved, this, 95 | &KeymapEditor::itemFocusChanged); 96 | connect(model_, &KeymapModel::needSaveChanged, this, 97 | &KeymapEditor::changed); 98 | connect(keySequenceEdit, &FcitxQtKeySequenceWidget::keySequenceChanged, 99 | this, [this]() { addButton->setEnabled(keySequenceValid()); }); 100 | 101 | load(); 102 | itemFocusChanged(); 103 | addButton->setEnabled(keySequenceValid()); 104 | 105 | connect(loadButton, &QPushButton::clicked, this, 106 | [this]() { model_->load(inputMethodBox->currentData().toInt()); }); 107 | } 108 | 109 | KeymapEditor::~KeymapEditor() {} 110 | 111 | QString KeymapEditor::icon() { return "fcitx-unikey"; } 112 | 113 | QString KeymapEditor::title() { return _("Unikey Keymap Editor"); } 114 | 115 | void KeymapEditor::itemFocusChanged() { 116 | bool hasSelection = keymapView->currentIndex().isValid(); 117 | deleteButton->setEnabled(hasSelection); 118 | moveUpButton->setEnabled(hasSelection && 119 | keymapView->currentIndex().row() > 0); 120 | moveDownButton->setEnabled(hasSelection && 121 | keymapView->currentIndex().row() + 1 < 122 | model_->rowCount()); 123 | if (hasSelection) { 124 | auto chr = model_->index(keymapView->currentIndex().row(), 0) 125 | .data(Qt::UserRole) 126 | .toChar(); 127 | keySequenceEdit->setKeySequence( 128 | QList() << Key(KeySym(chr.unicode()), KeyStates(), 0)); 129 | auto action = model_->index(keymapView->currentIndex().row(), 1) 130 | .data(Qt::UserRole) 131 | .toInt(); 132 | auto category = actionCategory(action); 133 | if (category >= 0) { 134 | categoryBox->setCurrentIndex(category); 135 | for (int i = 0; i < filteredActionModel_.rowCount(); i++) { 136 | if (auto index = filteredActionModel_.index(i, 0); 137 | index.data(Qt::UserRole) == action) { 138 | actionBox->setCurrentIndex(i); 139 | } 140 | } 141 | } 142 | } 143 | } 144 | 145 | bool KeymapEditor::keySequenceValid() const { 146 | if (keySequenceEdit->keySequence().empty()) { 147 | return false; 148 | } 149 | auto key = keySequenceEdit->keySequence()[0]; 150 | return key.isValid() && key.isSimple(); 151 | } 152 | 153 | void KeymapEditor::deleteKeymap() { 154 | if (!keymapView->currentIndex().isValid()) { 155 | return; 156 | } 157 | int row = keymapView->currentIndex().row(); 158 | model_->deleteItem(row); 159 | } 160 | 161 | void KeymapEditor::deleteAllKeymap() { model_->deleteAllItem(); } 162 | 163 | void KeymapEditor::addKeymap() { 164 | if (!keySequenceValid()) { 165 | return; 166 | } 167 | auto action = actionBox->currentData(Qt::UserRole); 168 | if (!action.isValid()) { 169 | return; 170 | } 171 | auto key = keySequenceEdit->keySequence()[0]; 172 | unsigned char chr = key.sym() & 0xff; 173 | 174 | auto index = model_->addItem(chr, action.toInt()); 175 | keymapView->setCurrentIndex(index); 176 | } 177 | 178 | void KeymapEditor::load() { model_->load(); } 179 | 180 | void KeymapEditor::save() { model_->save(); } 181 | 182 | void KeymapEditor::importKeymap() { 183 | QFileDialog *dialog = new QFileDialog(this); 184 | dialog->setAttribute(Qt::WA_DeleteOnClose, true); 185 | dialog->setFileMode(QFileDialog::ExistingFile); 186 | dialog->setAcceptMode(QFileDialog::AcceptOpen); 187 | dialog->open(); 188 | connect(dialog, &QFileDialog::accepted, this, 189 | &KeymapEditor::importFileSelected); 190 | } 191 | 192 | void KeymapEditor::importFileSelected() { 193 | const QFileDialog *dialog = 194 | qobject_cast(QObject::sender()); 195 | if (dialog->selectedFiles().isEmpty()) { 196 | return; 197 | } 198 | QString file = dialog->selectedFiles()[0]; 199 | model_->load(file); 200 | } 201 | 202 | void KeymapEditor::exportKeymap() { 203 | QFileDialog *dialog = new QFileDialog(this); 204 | dialog->setAttribute(Qt::WA_DeleteOnClose, true); 205 | dialog->setAcceptMode(QFileDialog::AcceptSave); 206 | dialog->open(); 207 | connect(dialog, &QFileDialog::accepted, this, 208 | &KeymapEditor::exportFileSelected); 209 | } 210 | 211 | void KeymapEditor::exportFileSelected() { 212 | const QFileDialog *dialog = 213 | qobject_cast(QObject::sender()); 214 | if (dialog->selectedFiles().length() <= 0) { 215 | return; 216 | } 217 | QString file = dialog->selectedFiles()[0]; 218 | model_->save(file); 219 | } 220 | 221 | } // namespace fcitx::unikey 222 | -------------------------------------------------------------------------------- /keymap-editor/editor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2022-2022 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #ifndef _KEYMAP_EDITOR_EDITOR_H_ 8 | #define _KEYMAP_EDITOR_EDITOR_H_ 9 | 10 | #include "ui_editor.h" 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | class CKeymapTable; 17 | 18 | namespace fcitx { 19 | namespace unikey { 20 | 21 | class ActionFilterModel : public QSortFilterProxyModel { 22 | Q_OBJECT 23 | public Q_SLOTS: 24 | void setCategory(int category) { 25 | category_ = category; 26 | invalidate(); 27 | } 28 | 29 | protected: 30 | bool filterAcceptsRow(int sourceRow, 31 | const QModelIndex &sourceParent) const override { 32 | const QModelIndex index = 33 | sourceModel()->index(sourceRow, 0, sourceParent); 34 | return index.data(Qt::UserRole + 1) == category_; 35 | } 36 | 37 | private: 38 | int category_ = 0; 39 | }; 40 | 41 | class KeymapModel; 42 | class KeymapEditor : public FcitxQtConfigUIWidget, public Ui::Editor { 43 | Q_OBJECT 44 | public: 45 | explicit KeymapEditor(QWidget *parent = 0); 46 | virtual ~KeymapEditor(); 47 | void load() override; 48 | void save() override; 49 | QString title() override; 50 | QString icon() override; 51 | 52 | static QString getData(CKeymapTable *table, int i, bool iskey); 53 | private slots: 54 | void addKeymap(); 55 | void deleteKeymap(); 56 | void deleteAllKeymap(); 57 | void itemFocusChanged(); 58 | bool keySequenceValid() const; 59 | void importKeymap(); 60 | void exportKeymap(); 61 | void importFileSelected(); 62 | void exportFileSelected(); 63 | 64 | private: 65 | CKeymapTable *table_; 66 | KeymapModel *model_; 67 | QStandardItemModel actionModel_; 68 | ActionFilterModel filteredActionModel_; 69 | }; 70 | } // namespace unikey 71 | } // namespace fcitx 72 | 73 | #endif // _MACRO_EDITOR_EDITOR_H_ 74 | -------------------------------------------------------------------------------- /keymap-editor/editor.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Editor 4 | 5 | 6 | 7 | 0 8 | 0 9 | 645 10 | 555 11 | 12 | 13 | 14 | Unikey Keymap Editor 15 | 16 | 17 | 18 | .. 19 | 20 | 21 | 22 | 23 | 24 | Built-in Input Methods 25 | 26 | 27 | 28 | 29 | 30 | Input Method: 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 0 39 | 0 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | &Load 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | Key definition 62 | 63 | 64 | 65 | 66 | 67 | Category: 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 0 76 | 0 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | Action: 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 0 93 | 0 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | Key 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | QAbstractItemView::SingleSelection 115 | 116 | 117 | QAbstractItemView::SelectRows 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | &Add / Update 129 | 130 | 131 | 132 | .. 133 | 134 | 135 | 136 | 137 | 138 | 139 | Move &Up 140 | 141 | 142 | 143 | .. 144 | 145 | 146 | 147 | 148 | 149 | 150 | Move &Down 151 | 152 | 153 | 154 | .. 155 | 156 | 157 | 158 | 159 | 160 | 161 | &Delete 162 | 163 | 164 | 165 | .. 166 | 167 | 168 | 169 | 170 | 171 | 172 | De&lete All 173 | 174 | 175 | 176 | .. 177 | 178 | 179 | 180 | 181 | 182 | 183 | Qt::Horizontal 184 | 185 | 186 | 187 | 188 | 189 | 190 | &Import 191 | 192 | 193 | 194 | .. 195 | 196 | 197 | 198 | 199 | 200 | 201 | &Export 202 | 203 | 204 | 205 | .. 206 | 207 | 208 | 209 | 210 | 211 | 212 | Qt::Vertical 213 | 214 | 215 | 216 | 20 217 | 40 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | fcitx::FcitxQtKeySequenceWidget 231 | QWidget 232 |
fcitxqtkeysequencewidget.h
233 |
234 |
235 | 236 | 237 |
238 | -------------------------------------------------------------------------------- /keymap-editor/keymap-editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "addon": "unikey", 3 | "files": ["keymap.txt"] 4 | } 5 | 6 | -------------------------------------------------------------------------------- /keymap-editor/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2022-2022 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #include "main.h" 8 | #include "editor.h" 9 | #include 10 | #include 11 | #include 12 | 13 | namespace fcitx { 14 | 15 | KeymapEditorPlugin::KeymapEditorPlugin(QObject *parent) 16 | : FcitxQtConfigUIPlugin(parent) { 17 | registerDomain("fcitx5-unikey", FCITX_INSTALL_LOCALEDIR); 18 | } 19 | 20 | FcitxQtConfigUIWidget *KeymapEditorPlugin::create(const QString &key) { 21 | Q_UNUSED(key); 22 | return new fcitx::unikey::KeymapEditor; 23 | } 24 | 25 | } // namespace fcitx 26 | -------------------------------------------------------------------------------- /keymap-editor/main.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2012-2018 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #ifndef _KEYMAP_EDITOR_MAIN_H_ 8 | #define _KEYMAP_EDITOR_MAIN_H_ 9 | 10 | #include 11 | 12 | namespace fcitx { 13 | 14 | class KeymapEditorPlugin : public FcitxQtConfigUIPlugin { 15 | Q_OBJECT 16 | public: 17 | Q_PLUGIN_METADATA(IID FcitxQtConfigUIFactoryInterface_iid FILE 18 | "keymap-editor.json") 19 | explicit KeymapEditorPlugin(QObject *parent = 0); 20 | FcitxQtConfigUIWidget *create(const QString &key) override; 21 | }; 22 | 23 | } // namespace fcitx 24 | 25 | #endif // _KEYMAP_EDITOR_MAIN_H_ 26 | -------------------------------------------------------------------------------- /keymap-editor/model.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2012-2018 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #include 8 | 9 | #include "actions.h" 10 | #include "editor.h" 11 | #include "inputproc.h" 12 | #include "keycons.h" 13 | #include "model.h" 14 | #include "usrkeymap.h" 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace fcitx::unikey { 31 | 32 | using ItemType = std::pair; 33 | 34 | KeymapModel::KeymapModel(QObject *parent) 35 | : QAbstractTableModel(parent), needSave_(false) {} 36 | 37 | KeymapModel::~KeymapModel() {} 38 | 39 | QVariant KeymapModel::headerData(int section, Qt::Orientation orientation, 40 | int role) const { 41 | if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { 42 | if (section == 0) { 43 | return _("Keymap"); 44 | } 45 | if (section == 1) { 46 | return _("Word"); 47 | } 48 | } 49 | return {}; 50 | } 51 | 52 | int KeymapModel::rowCount(const QModelIndex & /*parent*/) const { 53 | return list_.size(); 54 | } 55 | 56 | int KeymapModel::columnCount(const QModelIndex & /*parent*/) const { return 2; } 57 | 58 | QVariant KeymapModel::data(const QModelIndex &index, int role) const { 59 | if (index.row() >= static_cast(list_.size()) || index.row() < 0) { 60 | return {}; 61 | } 62 | 63 | if (role == Qt::DisplayRole) { 64 | if (index.column() == 0) { 65 | return QString(QChar(list_[index.row()].key)); 66 | } 67 | if (index.column() == 1) { 68 | return QString::fromStdString( 69 | _(actionName(list_[index.row()].action))); 70 | } 71 | } else if (role == Qt::UserRole) { 72 | if (index.column() == 0) { 73 | return QChar(list_[index.row()].key); 74 | } 75 | if (index.column() == 1) { 76 | return list_[index.row()].action; 77 | } 78 | } 79 | return QVariant(); 80 | } 81 | 82 | QModelIndex KeymapModel::addItem(unsigned char key, int action) { 83 | beginResetModel(); 84 | bool checkBoth = false; 85 | if (action < vneCount) { 86 | key = charutils::toupper(key); 87 | checkBoth = true; 88 | } 89 | const unsigned char lower = charutils::tolower(key); 90 | bool updated = false; 91 | auto match = [key, checkBoth, lower](const UkKeyMapping &item) { 92 | if (item.action < vneCount && 93 | charutils::toupper(item.key) == charutils::toupper(key)) { 94 | return true; 95 | } 96 | return item.key == key || (checkBoth && item.key == lower); 97 | }; 98 | 99 | auto iter = list_.begin(); 100 | for (; iter != list_.end(); iter++) { 101 | if (match(*iter)) { 102 | *iter = UkKeyMapping{.key = key, .action = action}; 103 | updated = true; 104 | break; 105 | } 106 | } 107 | 108 | int selectRow = 0; 109 | if (updated) { 110 | selectRow = std::distance(list_.begin(), iter); 111 | list_.erase(std::remove_if(std::next(iter), list_.end(), match), 112 | list_.end()); 113 | } else { 114 | selectRow = list_.size(); 115 | list_.push_back(UkKeyMapping{key, action}); 116 | } 117 | endResetModel(); 118 | setNeedSave(true); 119 | return index(selectRow, 0); 120 | } 121 | 122 | void KeymapModel::moveUp(int row) { 123 | if (row >= static_cast(list_.size()) || row <= 0) { 124 | return; 125 | } 126 | if (!beginMoveRows(QModelIndex(), row, row, QModelIndex(), row - 1)) { 127 | return; 128 | } 129 | std::swap(list_[row - 1], list_[row]); 130 | endMoveRows(); 131 | setNeedSave(true); 132 | } 133 | 134 | void KeymapModel::moveDown(int row) { 135 | if (row + 1 >= static_cast(list_.size()) || row < 0) { 136 | return; 137 | } 138 | if (!beginMoveRows(QModelIndex(), row, row, QModelIndex(), row + 2)) { 139 | return; 140 | } 141 | std::swap(list_[row], list_[row + 1]); 142 | endMoveRows(); 143 | setNeedSave(true); 144 | } 145 | 146 | void KeymapModel::deleteItem(int row) { 147 | if (row >= static_cast(list_.size())) { 148 | return; 149 | } 150 | beginRemoveRows(QModelIndex(), row, row); 151 | list_.erase(list_.begin() + row); 152 | endRemoveRows(); 153 | setNeedSave(true); 154 | } 155 | 156 | void KeymapModel::deleteAllItem() { 157 | if (!list_.empty()) { 158 | setNeedSave(true); 159 | } 160 | beginResetModel(); 161 | list_.clear(); 162 | endResetModel(); 163 | } 164 | 165 | void KeymapModel::setNeedSave(bool needSave) { 166 | if (needSave_ != needSave) { 167 | needSave_ = needSave; 168 | emit needSaveChanged(needSave_); 169 | } 170 | } 171 | 172 | bool KeymapModel::needSave() const { return needSave_; } 173 | 174 | void KeymapModel::load() { 175 | beginResetModel(); 176 | auto keymapFile = StandardPaths::global().open(StandardPathsType::PkgConfig, 177 | "unikey/keymap.txt"); 178 | if (keymapFile.isValid()) { 179 | list_ = UkLoadKeyOrderMap(keymapFile.fd()); 180 | } else { 181 | list_.clear(); 182 | } 183 | endResetModel(); 184 | } 185 | 186 | void KeymapModel::save() { 187 | StandardPaths::global().safeSave(StandardPathsType::PkgConfig, 188 | "unikey/keymap.txt", 189 | [this](int fd) { return saveToFd(fd); }); 190 | setNeedSave(false); 191 | } 192 | 193 | void KeymapModel::load(const QString &file) { 194 | UnixFD fd = UnixFD::own(open(file.toLocal8Bit().constData(), O_RDONLY)); 195 | 196 | if (!fd.isValid()) { 197 | return; 198 | } 199 | 200 | beginResetModel(); 201 | list_ = UkLoadKeyOrderMap(fd.fd()); 202 | endResetModel(); 203 | setNeedSave(true); 204 | } 205 | 206 | void KeymapModel::save(const QString &file) { 207 | if (!file.startsWith("/")) { 208 | return; 209 | } 210 | StandardPaths::global().safeSave(StandardPathsType::PkgConfig, 211 | file.toLocal8Bit().constData(), 212 | [this](int fd) { return saveToFd(fd); }); 213 | setNeedSave(false); 214 | } 215 | 216 | bool KeymapModel::saveToFd(int fd) { 217 | UnixFD unixFD(fd); 218 | auto fp = fs::openFD(unixFD, "wb"); 219 | if (!fp) { 220 | return false; 221 | } 222 | UkStoreKeyOrderMap(fp.get(), list_); 223 | return true; 224 | } 225 | 226 | void KeymapModel::load(int profile) { 227 | const UkKeyMapping *mapping = nullptr; 228 | switch (profile) { 229 | case UkTelex: 230 | mapping = TelexMethodMapping; 231 | break; 232 | case UkSimpleTelex: 233 | mapping = SimpleTelexMethodMapping; 234 | break; 235 | case UkSimpleTelex2: 236 | mapping = SimpleTelex2MethodMapping; 237 | break; 238 | case UkVni: 239 | mapping = VniMethodMapping; 240 | break; 241 | case UkViqr: 242 | mapping = VIQRMethodMapping; 243 | break; 244 | case UkMsVi: 245 | mapping = MsViMethodMapping; 246 | break; 247 | default: 248 | break; 249 | } 250 | if (!mapping) { 251 | return; 252 | } 253 | 254 | beginResetModel(); 255 | list_.clear(); 256 | for (size_t i = 0; mapping[i].key != 0; i++) { 257 | list_.push_back(mapping[i]); 258 | } 259 | endResetModel(); 260 | setNeedSave(true); 261 | } 262 | 263 | } // namespace fcitx::unikey 264 | -------------------------------------------------------------------------------- /keymap-editor/model.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2012-2018 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #ifndef _KEYMAP_EDITOR_MODEL_H_ 8 | #define _KEYMAP_EDITOR_MODEL_H_ 9 | 10 | #include "inputproc.h" 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | namespace fcitx::unikey { 20 | class KeymapModel : public QAbstractTableModel { 21 | Q_OBJECT 22 | public: 23 | explicit KeymapModel(QObject *parent = 0); 24 | virtual ~KeymapModel(); 25 | 26 | QVariant headerData(int section, Qt::Orientation orientation, 27 | int role = Qt::DisplayRole) const override; 28 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; 29 | int columnCount(const QModelIndex &parent = QModelIndex()) const override; 30 | QVariant data(const QModelIndex &index, 31 | int role = Qt::DisplayRole) const override; 32 | void load(); 33 | QModelIndex addItem(unsigned char key, int action); 34 | void moveUp(int row); 35 | void moveDown(int row); 36 | void deleteItem(int row); 37 | void deleteAllItem(); 38 | void save(); 39 | bool needSave() const; 40 | void load(const QString &fileName); 41 | void save(const QString &fileName); 42 | void load(int profile); 43 | 44 | signals: 45 | void needSaveChanged(bool); 46 | 47 | private: 48 | void setNeedSave(bool needSave); 49 | bool saveToFd(int fd); 50 | bool needSave_; 51 | std::vector list_; 52 | }; 53 | } // namespace fcitx::unikey 54 | 55 | #endif // _MACRO_EDITOR_MODEL_H_ 56 | -------------------------------------------------------------------------------- /macro-editor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | set(MACRO_EDITOR_SRCS 4 | model.cpp 5 | main.cpp 6 | editor.cpp 7 | dialog.cpp 8 | ) 9 | 10 | add_library(fcitx5-unikey-macro-editor 11 | MODULE ${MACRO_EDITOR_SRCS}) 12 | set_target_properties(fcitx5-unikey-macro-editor PROPERTIES 13 | AUTOMOC TRUE 14 | AUTOUIC TRUE 15 | AUTOUIC_OPTIONS "-tr=fcitx::tr2fcitx;--include=fcitxqti18nhelper.h" 16 | ) 17 | target_link_libraries(fcitx5-unikey-macro-editor 18 | Qt${QT_MAJOR_VERSION}::Core 19 | Qt${QT_MAJOR_VERSION}::Widgets 20 | Fcitx5Qt${QT_MAJOR_VERSION}::WidgetsAddons 21 | unikey-lib 22 | ) 23 | 24 | install(TARGETS fcitx5-unikey-macro-editor DESTINATION ${CMAKE_INSTALL_LIBDIR}/fcitx5/qt${QT_MAJOR_VERSION}) 25 | -------------------------------------------------------------------------------- /macro-editor/dialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2012-2018 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #include "dialog.h" 8 | #include "ui_dialog.h" 9 | 10 | namespace fcitx { 11 | namespace unikey { 12 | MacroDialog::MacroDialog(QWidget *parent) : QDialog(parent) { setupUi(this); } 13 | 14 | QString MacroDialog::macro() const { return macroLineEdit->text(); } 15 | 16 | QString MacroDialog::word() const { return wordLineEdit->text(); } 17 | 18 | } // namespace unikey 19 | } // namespace fcitx 20 | -------------------------------------------------------------------------------- /macro-editor/dialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2012-2018 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #ifndef _MACRO_EDITOR_DIALOG_H_ 8 | #define _MACRO_EDITOR_DIALOG_H_ 9 | 10 | #include "ui_dialog.h" 11 | #include 12 | 13 | class CMacroTable; 14 | 15 | namespace fcitx { 16 | namespace unikey { 17 | class MacroDialog : public QDialog, private Ui::Dialog { 18 | Q_OBJECT 19 | public: 20 | explicit MacroDialog(QWidget *parent = nullptr); 21 | QString macro() const; 22 | QString word() const; 23 | }; 24 | } // namespace unikey 25 | } // namespace fcitx 26 | 27 | #endif // _MACRO_EDITOR_DIALOG_H_ 28 | -------------------------------------------------------------------------------- /macro-editor/dialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Dialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 334 10 | 91 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Word: 26 | 27 | 28 | 29 | 30 | 31 | 32 | Macro: 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | Qt::Horizontal 45 | 46 | 47 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 48 | 49 | 50 | 51 | 52 | 53 | 54 | macroLineEdit 55 | wordLineEdit 56 | buttonBox 57 | 58 | 59 | 60 | 61 | buttonBox 62 | accepted() 63 | Dialog 64 | accept() 65 | 66 | 67 | 248 68 | 254 69 | 70 | 71 | 157 72 | 274 73 | 74 | 75 | 76 | 77 | buttonBox 78 | rejected() 79 | Dialog 80 | reject() 81 | 82 | 83 | 316 84 | 260 85 | 86 | 87 | 286 88 | 274 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /macro-editor/editor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2012-2018 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #include "editor.h" 8 | #include "charset.h" 9 | #include "dialog.h" 10 | #include "keycons.h" 11 | #include "mactab.h" 12 | #include "model.h" 13 | #include "vnconv.h" 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace fcitx::unikey { 31 | 32 | MacroEditor::MacroEditor(QWidget *parent) 33 | : FcitxQtConfigUIWidget(parent), table_(std::make_unique()), 34 | model_(new MacroModel(this)) { 35 | setupUi(this); 36 | 37 | connect(addButton, &QPushButton::clicked, this, &MacroEditor::addWord); 38 | connect(deleteButton, &QPushButton::clicked, this, 39 | &MacroEditor::deleteWord); 40 | connect(clearButton, &QPushButton::clicked, this, 41 | &MacroEditor::deleteAllWord); 42 | connect(importButton, &QPushButton::clicked, this, 43 | &MacroEditor::importMacro); 44 | connect(exportButton, &QPushButton::clicked, this, 45 | &MacroEditor::exportMacro); 46 | table_->init(); 47 | macroTableView->horizontalHeader()->setStretchLastSection(true); 48 | macroTableView->verticalHeader()->setVisible(false); 49 | macroTableView->setModel(model_); 50 | connect(macroTableView->selectionModel(), 51 | &QItemSelectionModel::selectionChanged, this, 52 | &MacroEditor::itemFocusChanged); 53 | connect(model_, &MacroModel::needSaveChanged, this, &MacroEditor::changed); 54 | load(); 55 | itemFocusChanged(); 56 | } 57 | 58 | MacroEditor::~MacroEditor() {} 59 | 60 | QString MacroEditor::icon() { return "fcitx-unikey"; } 61 | 62 | QString MacroEditor::title() { return _("Unikey Macro Editor"); } 63 | 64 | void MacroEditor::itemFocusChanged() { 65 | deleteButton->setEnabled(macroTableView->currentIndex().isValid()); 66 | } 67 | 68 | void MacroEditor::deleteWord() { 69 | if (!macroTableView->currentIndex().isValid()) { 70 | return; 71 | } 72 | int row = macroTableView->currentIndex().row(); 73 | model_->deleteItem(row); 74 | } 75 | 76 | void MacroEditor::deleteAllWord() { model_->deleteAllItem(); } 77 | 78 | void MacroEditor::addWord() { 79 | MacroDialog *dialog = new MacroDialog(this); 80 | dialog->setAttribute(Qt::WA_DeleteOnClose, true); 81 | dialog->open(); 82 | connect(dialog, &QDialog::accepted, this, &MacroEditor::addWordAccepted); 83 | } 84 | 85 | QString MacroEditor::getData(CMacroTable *table, int i, bool iskey) { 86 | 87 | char key[MAX_MACRO_KEY_LEN * 3]; 88 | char value[MAX_MACRO_TEXT_LEN * 3]; 89 | do { 90 | if (i < table->getCount()) { 91 | const StdVnChar *p = nullptr; 92 | int maxOutLen = 0; 93 | const char *result = nullptr; 94 | if (iskey) { 95 | p = table->getKey(i); 96 | maxOutLen = sizeof(key); 97 | result = key; 98 | } else { 99 | p = table->getText(i); 100 | maxOutLen = sizeof(value); 101 | result = value; 102 | } 103 | 104 | if (!p) { 105 | break; 106 | } 107 | int inLen = -1; 108 | int ret = 109 | VnConvert(CONV_CHARSET_VNSTANDARD, CONV_CHARSET_XUTF8, 110 | (UKBYTE *)p, (UKBYTE *)result, &inLen, &maxOutLen); 111 | if (ret != 0) { 112 | break; 113 | } 114 | return QString::fromUtf8(result); 115 | } 116 | } while (0); 117 | return QString(); 118 | } 119 | 120 | void MacroEditor::addWordAccepted() { 121 | const MacroDialog *dialog = 122 | qobject_cast(QObject::sender()); 123 | 124 | model_->addItem(dialog->macro(), dialog->word()); 125 | } 126 | 127 | void MacroEditor::load() { 128 | auto path = StandardPaths::global().locate(StandardPathsType::PkgConfig, 129 | "unikey/macro"); 130 | table_->loadFromFile(path.string().c_str()); 131 | model_->load(table_.get()); 132 | } 133 | 134 | void MacroEditor::save() { 135 | model_->save(table_.get()); 136 | StandardPaths::global().safeSave(StandardPathsType::PkgConfig, 137 | "unikey/macro", [this](int fd) -> bool { 138 | UnixFD unixFD(fd); 139 | auto f = fs::openFD(unixFD, "wb"); 140 | return table_->writeToFp(f.release()); 141 | }); 142 | } 143 | 144 | void MacroEditor::importMacro() { 145 | QFileDialog *dialog = new QFileDialog(this); 146 | dialog->setAttribute(Qt::WA_DeleteOnClose, true); 147 | dialog->setFileMode(QFileDialog::ExistingFile); 148 | dialog->setAcceptMode(QFileDialog::AcceptOpen); 149 | dialog->open(); 150 | connect(dialog, &QFileDialog::accepted, this, 151 | &MacroEditor::importFileSelected); 152 | } 153 | 154 | void MacroEditor::importFileSelected() { 155 | const QFileDialog *dialog = 156 | qobject_cast(QObject::sender()); 157 | if (dialog->selectedFiles().length() <= 0) { 158 | return; 159 | } 160 | QString file = dialog->selectedFiles()[0]; 161 | table_->loadFromFile(file.toUtf8().constData()); 162 | } 163 | 164 | void MacroEditor::exportMacro() { 165 | QFileDialog *dialog = new QFileDialog(this); 166 | dialog->setAttribute(Qt::WA_DeleteOnClose, true); 167 | dialog->setDirectory("macro"); 168 | dialog->setAcceptMode(QFileDialog::AcceptSave); 169 | dialog->open(); 170 | connect(dialog, &QFileDialog::accepted, this, 171 | &MacroEditor::exportFileSelected); 172 | } 173 | 174 | void MacroEditor::exportFileSelected() { 175 | const QFileDialog *dialog = 176 | qobject_cast(QObject::sender()); 177 | if (dialog->selectedFiles().length() <= 0) { 178 | return; 179 | } 180 | QString file = dialog->selectedFiles()[0]; 181 | table_->writeToFile(file.toUtf8().constData()); 182 | } 183 | 184 | } // namespace fcitx::unikey 185 | -------------------------------------------------------------------------------- /macro-editor/editor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2012-2018 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #ifndef _MACRO_EDITOR_EDITOR_H_ 8 | #define _MACRO_EDITOR_EDITOR_H_ 9 | 10 | #include "ui_editor.h" 11 | #include 12 | #include 13 | 14 | class CMacroTable; 15 | 16 | namespace fcitx { 17 | namespace unikey { 18 | 19 | class MacroModel; 20 | class MacroEditor : public FcitxQtConfigUIWidget, public Ui::Editor { 21 | Q_OBJECT 22 | public: 23 | explicit MacroEditor(QWidget *parent = 0); 24 | virtual ~MacroEditor(); 25 | void load() override; 26 | void save() override; 27 | QString title() override; 28 | QString icon() override; 29 | 30 | static QString getData(CMacroTable *table, int i, bool iskey); 31 | private slots: 32 | void addWord(); 33 | void deleteWord(); 34 | void deleteAllWord(); 35 | void itemFocusChanged(); 36 | void addWordAccepted(); 37 | void importMacro(); 38 | void exportMacro(); 39 | void importFileSelected(); 40 | void exportFileSelected(); 41 | 42 | private: 43 | std::unique_ptr table_; 44 | MacroModel *model_; 45 | }; 46 | } // namespace unikey 47 | } // namespace fcitx 48 | 49 | #endif // _MACRO_EDITOR_EDITOR_H_ 50 | -------------------------------------------------------------------------------- /macro-editor/editor.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Editor 4 | 5 | 6 | 7 | 0 8 | 0 9 | 375 10 | 366 11 | 12 | 13 | 14 | Unikey Macro Editor 15 | 16 | 17 | 18 | .. 19 | 20 | 21 | 22 | 23 | 24 | QAbstractItemView::SingleSelection 25 | 26 | 27 | QAbstractItemView::SelectRows 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | &Add 37 | 38 | 39 | 40 | .. 41 | 42 | 43 | 44 | 45 | 46 | 47 | &Delete 48 | 49 | 50 | 51 | .. 52 | 53 | 54 | 55 | 56 | 57 | 58 | De&lete All 59 | 60 | 61 | 62 | .. 63 | 64 | 65 | 66 | 67 | 68 | 69 | Qt::Horizontal 70 | 71 | 72 | 73 | 74 | 75 | 76 | &Import 77 | 78 | 79 | 80 | .. 81 | 82 | 83 | 84 | 85 | 86 | 87 | &Export 88 | 89 | 90 | 91 | .. 92 | 93 | 94 | 95 | 96 | 97 | 98 | Qt::Vertical 99 | 100 | 101 | 102 | 20 103 | 40 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /macro-editor/macro-editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "addon": "unikey", 3 | "files": ["macro"] 4 | } 5 | -------------------------------------------------------------------------------- /macro-editor/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2012-2018 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #include "main.h" 8 | #include "editor.h" 9 | #include "model.h" 10 | #include 11 | #include 12 | 13 | namespace fcitx { 14 | 15 | MacroEditorPlugin::MacroEditorPlugin(QObject *parent) 16 | : FcitxQtConfigUIPlugin(parent) { 17 | registerDomain("fcitx5-unikey", FCITX_INSTALL_LOCALEDIR); 18 | } 19 | 20 | FcitxQtConfigUIWidget *MacroEditorPlugin::create(const QString &key) { 21 | Q_UNUSED(key); 22 | return new fcitx::unikey::MacroEditor; 23 | } 24 | 25 | } // namespace fcitx 26 | -------------------------------------------------------------------------------- /macro-editor/main.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2012-2018 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #ifndef _MACRO_EDITOR_MAIN_H_ 8 | #define _MACRO_EDITOR_MAIN_H_ 9 | 10 | #include 11 | 12 | namespace fcitx { 13 | 14 | class MacroEditorPlugin : public FcitxQtConfigUIPlugin { 15 | Q_OBJECT 16 | public: 17 | Q_PLUGIN_METADATA(IID FcitxQtConfigUIFactoryInterface_iid FILE 18 | "macro-editor.json") 19 | explicit MacroEditorPlugin(QObject *parent = 0); 20 | FcitxQtConfigUIWidget *create(const QString &key) override; 21 | }; 22 | 23 | } // namespace fcitx 24 | 25 | #endif // _MACRO_EDITOR_MAIN_H_ 26 | -------------------------------------------------------------------------------- /macro-editor/model.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2012-2018 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #include 8 | 9 | #include "editor.h" 10 | #include "model.h" 11 | #include 12 | 13 | namespace fcitx { 14 | namespace unikey { 15 | 16 | typedef std::pair ItemType; 17 | 18 | MacroModel::MacroModel(QObject *parent) 19 | : QAbstractTableModel(parent), needSave_(false) {} 20 | 21 | MacroModel::~MacroModel() {} 22 | 23 | QVariant MacroModel::headerData(int section, Qt::Orientation orientation, 24 | int role) const { 25 | if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { 26 | if (section == 0) 27 | return _("Macro"); 28 | else if (section == 1) 29 | return _("Word"); 30 | } 31 | return QVariant(); 32 | } 33 | 34 | int MacroModel::rowCount(const QModelIndex &) const { return list_.count(); } 35 | 36 | int MacroModel::columnCount(const QModelIndex &) const { return 2; } 37 | 38 | QVariant MacroModel::data(const QModelIndex &index, int role) const { 39 | do { 40 | if (role == Qt::DisplayRole && index.row() < list_.count()) { 41 | if (index.column() == 0) { 42 | return list_[index.row()].first; 43 | } else if (index.column() == 1) { 44 | return list_[index.row()].second; 45 | } 46 | } 47 | } while (0); 48 | return QVariant(); 49 | } 50 | 51 | void MacroModel::addItem(const QString ¯o, const QString &word) { 52 | if (keyset_.contains(macro)) 53 | return; 54 | beginInsertRows(QModelIndex(), list_.size(), list_.size()); 55 | list_.append(std::pair(macro, word)); 56 | keyset_.insert(macro); 57 | endInsertRows(); 58 | setNeedSave(true); 59 | } 60 | 61 | void MacroModel::deleteItem(int row) { 62 | if (row >= list_.count()) 63 | return; 64 | std::pair item = list_.at(row); 65 | QString key = item.first; 66 | beginRemoveRows(QModelIndex(), row, row); 67 | list_.removeAt(row); 68 | keyset_.remove(key); 69 | endRemoveRows(); 70 | setNeedSave(true); 71 | } 72 | 73 | void MacroModel::deleteAllItem() { 74 | if (list_.count()) 75 | setNeedSave(true); 76 | beginResetModel(); 77 | list_.clear(); 78 | keyset_.clear(); 79 | endResetModel(); 80 | } 81 | 82 | void MacroModel::setNeedSave(bool needSave) { 83 | if (needSave_ != needSave) { 84 | needSave_ = needSave; 85 | emit needSaveChanged(needSave_); 86 | } 87 | } 88 | 89 | bool MacroModel::needSave() { return needSave_; } 90 | 91 | void MacroModel::load(CMacroTable *table) { 92 | beginResetModel(); 93 | list_.clear(); 94 | keyset_.clear(); 95 | for (int i = 0; i < table->getCount(); i++) { 96 | QString key = MacroEditor::getData(table, i, true); 97 | QString value = MacroEditor::getData(table, i, false); 98 | list_.append(std::pair(key, value)); 99 | keyset_.insert(key); 100 | } 101 | endResetModel(); 102 | } 103 | 104 | void MacroModel::save(CMacroTable *table) { 105 | table->resetContent(); 106 | foreach(const ItemType &item, list_) { 107 | table->addItem(item.first.toUtf8().data(), item.second.toUtf8().data(), 108 | CONV_CHARSET_XUTF8); 109 | } 110 | setNeedSave(false); 111 | } 112 | 113 | } // namespace unikey 114 | } // namespace fcitx 115 | -------------------------------------------------------------------------------- /macro-editor/model.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2012-2018 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #ifndef _MACRO_EDITOR_MODEL_H_ 8 | #define _MACRO_EDITOR_MODEL_H_ 9 | 10 | #include "mactab.h" 11 | #include 12 | #include 13 | 14 | namespace fcitx { 15 | namespace unikey { 16 | class MacroModel : public QAbstractTableModel { 17 | Q_OBJECT 18 | public: 19 | explicit MacroModel(QObject *parent = 0); 20 | virtual ~MacroModel(); 21 | 22 | virtual QVariant headerData(int section, Qt::Orientation orientation, 23 | int role = Qt::DisplayRole) const; 24 | virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; 25 | virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; 26 | virtual QVariant data(const QModelIndex &index, 27 | int role = Qt::DisplayRole) const; 28 | void load(CMacroTable *table); 29 | void addItem(const QString ¯o, const QString &word); 30 | void deleteItem(int row); 31 | void deleteAllItem(); 32 | void save(CMacroTable *table); 33 | bool needSave(); 34 | 35 | signals: 36 | void needSaveChanged(bool); 37 | 38 | private: 39 | void setNeedSave(bool needSave); 40 | bool needSave_; 41 | QSet keyset_; 42 | QList> list_; 43 | }; 44 | } // namespace unikey 45 | } // namespace fcitx 46 | 47 | #endif // _MACRO_EDITOR_MODEL_H_ 48 | -------------------------------------------------------------------------------- /org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.fcitx.Fcitx5.Addon.Unikey 4 | org.fcitx.Fcitx5 5 | CC0-1.0 6 | GPL-2.0+ and LGPL-2.0+ 7 | Unikey 8 | Vietnamese input method 9 | 10 | The Fcitx Team 11 | 12 | https://fcitx-im.org 13 | https://github.com/fcitx/fcitx5-unikey/issues 14 | https://github.com/fcitx/fcitx5-unikey 15 | Fcitx 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /po/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | fcitx5_install_translation(fcitx5-unikey) 2 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | 2 | ca 3 | da 4 | de 5 | fr 6 | he 7 | ja 8 | ko 9 | ru 10 | tr 11 | vi 12 | zh_CN 13 | zh_TW 14 | -------------------------------------------------------------------------------- /po/ca.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the fcitx5-unikey package. 4 | # 5 | # Translators: 6 | # csslayer , 2018 7 | # Robert Antoni Buj i Gelonch , 2018 8 | # 9 | msgid "" 10 | msgstr "" 11 | "Project-Id-Version: fcitx5-unikey\n" 12 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 13 | "POT-Creation-Date: 2023-01-04 20:25+0000\n" 14 | "PO-Revision-Date: 2018-06-12 22:55+0000\n" 15 | "Last-Translator: Robert Antoni Buj i Gelonch , 2018\n" 16 | "Language-Team: Catalan (https://www.transifex.com/fcitx/teams/12005/ca/)\n" 17 | "Language: ca\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 22 | 23 | #. i18n: file: macro-editor/editor.ui:36 24 | #. i18n: ectx: property (text), widget (QPushButton, addButton) 25 | #: rc.cpp:60 26 | #, kde-format 27 | msgid "&Add" 28 | msgstr "&Afegeix" 29 | 30 | #. i18n: file: keymap-editor/editor.ui:128 31 | #. i18n: ectx: property (text), widget (QPushButton, addButton) 32 | #: rc.cpp:27 33 | #, kde-format 34 | msgid "&Add / Update" 35 | msgstr "" 36 | 37 | #. i18n: file: keymap-editor/editor.ui:161 38 | #. i18n: ectx: property (text), widget (QPushButton, deleteButton) 39 | #. i18n: file: macro-editor/editor.ui:47 40 | #. i18n: ectx: property (text), widget (QPushButton, deleteButton) 41 | #: rc.cpp:36 rc.cpp:63 42 | #, kde-format 43 | msgid "&Delete" 44 | msgstr "Eli&mina" 45 | 46 | #. i18n: file: keymap-editor/editor.ui:201 47 | #. i18n: ectx: property (text), widget (QPushButton, exportButton) 48 | #. i18n: file: macro-editor/editor.ui:87 49 | #. i18n: ectx: property (text), widget (QPushButton, exportButton) 50 | #: rc.cpp:45 rc.cpp:72 51 | #, kde-format 52 | msgid "&Export" 53 | msgstr "&Exporta" 54 | 55 | #. i18n: file: keymap-editor/editor.ui:190 56 | #. i18n: ectx: property (text), widget (QPushButton, importButton) 57 | #. i18n: file: macro-editor/editor.ui:76 58 | #. i18n: ectx: property (text), widget (QPushButton, importButton) 59 | #: rc.cpp:42 rc.cpp:69 60 | #, kde-format 61 | msgid "&Import" 62 | msgstr "&Importa" 63 | 64 | #. i18n: file: keymap-editor/editor.ui:47 65 | #. i18n: ectx: property (text), widget (QPushButton, loadButton) 66 | #: rc.cpp:12 67 | #, kde-format 68 | msgid "&Load" 69 | msgstr "" 70 | 71 | #: keymap-editor/actions.cpp:38 72 | msgid "A with breve [A(]" 73 | msgstr "" 74 | 75 | #: keymap-editor/actions.cpp:36 76 | msgid "A with circumflex [A^]" 77 | msgstr "" 78 | 79 | #. i18n: file: keymap-editor/editor.ui:84 80 | #. i18n: ectx: property (text), widget (QLabel, label_4) 81 | #: rc.cpp:21 82 | #, kde-format 83 | msgid "Action:" 84 | msgstr "" 85 | 86 | #: src/unikey-config.h:60 87 | msgid "Allow to modify surrounding text (experimental)" 88 | msgstr "" 89 | 90 | #: src/unikey-config.h:54 91 | msgid "Allow type with more freedom" 92 | msgstr "" 93 | 94 | #: src/unikey-config.h:49 95 | msgid "Auto restore keys with invalid words" 96 | msgstr "" 97 | 98 | #: src/unikey-config.h:29 99 | msgid "BK HCM 2" 100 | msgstr "" 101 | 102 | #: keymap-editor/actions.cpp:30 103 | msgid "Breve: A becomes A(" 104 | msgstr "" 105 | 106 | #. i18n: file: keymap-editor/editor.ui:24 107 | #. i18n: ectx: property (title), widget (QGroupBox, groupBox) 108 | #: rc.cpp:6 109 | #, kde-format 110 | msgid "Built-in Input Methods" 111 | msgstr "" 112 | 113 | #: src/unikey-config.h:30 114 | msgid "CString" 115 | msgstr "" 116 | 117 | #. i18n: file: keymap-editor/editor.ui:67 118 | #. i18n: ectx: property (text), widget (QLabel, label_3) 119 | #: rc.cpp:18 120 | #, kde-format 121 | msgid "Category:" 122 | msgstr "" 123 | 124 | #: keymap-editor/editor.cpp:58 125 | msgid "Character complements" 126 | msgstr "" 127 | 128 | #: keymap-editor/actions.cpp:20 129 | msgid "Circumflex for all applicable characters" 130 | msgstr "" 131 | 132 | #: keymap-editor/actions.cpp:22 133 | msgid "Circumflex: A becomes A^" 134 | msgstr "" 135 | 136 | #: keymap-editor/actions.cpp:23 137 | msgid "Circumflex: E becomes E^" 138 | msgstr "" 139 | 140 | #: keymap-editor/actions.cpp:24 141 | msgid "Circumflex: O becomes O^" 142 | msgstr "" 143 | 144 | #: keymap-editor/actions.cpp:34 145 | msgid "D with stroke [-D]" 146 | msgstr "" 147 | 148 | #. i18n: file: keymap-editor/editor.ui:172 149 | #. i18n: ectx: property (text), widget (QPushButton, clearButton) 150 | #. i18n: file: macro-editor/editor.ui:58 151 | #. i18n: ectx: property (text), widget (QPushButton, clearButton) 152 | #: rc.cpp:39 rc.cpp:66 153 | #, kde-format 154 | msgid "De&lete All" 155 | msgstr "E&limina-ho tot" 156 | 157 | #. i18n: file: macro-editor/dialog.ui:14 158 | #. i18n: ectx: property (windowTitle), widget (QDialog, Dialog) 159 | #: rc.cpp:48 160 | #, kde-format 161 | msgid "Dialog" 162 | msgstr "Diàleg" 163 | 164 | #: keymap-editor/actions.cpp:40 165 | msgid "E with circumflex [E^]" 166 | msgstr "" 167 | 168 | #: src/unikey-config.h:45 169 | msgid "Enable Macro" 170 | msgstr "" 171 | 172 | #: src/unikey-config.h:44 173 | msgid "Enable spell check" 174 | msgstr "" 175 | 176 | #: keymap-editor/actions.cpp:19 177 | msgid "Escape key" 178 | msgstr "" 179 | 180 | #: keymap-editor/actions.cpp:25 181 | msgid "Horn-Breve: U, O, A, become U+, O+, A(" 182 | msgstr "" 183 | 184 | #: keymap-editor/actions.cpp:32 185 | msgid "Horn-Breve: U, O, A, become U+, O+, A(, or create U+" 186 | msgstr "" 187 | 188 | #: keymap-editor/actions.cpp:29 189 | msgid "Horn: O becomes O+" 190 | msgstr "" 191 | 192 | #: keymap-editor/actions.cpp:28 193 | msgid "Horn: U becomes U+" 194 | msgstr "" 195 | 196 | #: keymap-editor/actions.cpp:27 197 | msgid "Horn: U, O become U+, O+" 198 | msgstr "" 199 | 200 | #: src/unikey-config.h:41 src/unikey-im.cpp:331 201 | msgid "Input Method" 202 | msgstr "" 203 | 204 | #. i18n: file: keymap-editor/editor.ui:30 205 | #. i18n: ectx: property (text), widget (QLabel, label) 206 | #: rc.cpp:9 207 | #, kde-format 208 | msgid "Input Method:" 209 | msgstr "" 210 | 211 | #. i18n: file: keymap-editor/editor.ui:101 212 | #. i18n: ectx: property (text), widget (QLabel, label_2) 213 | #: rc.cpp:24 214 | #, kde-format 215 | msgid "Key" 216 | msgstr "" 217 | 218 | #. i18n: file: keymap-editor/editor.ui:61 219 | #. i18n: ectx: property (title), widget (QGroupBox, groupBox_2) 220 | #: rc.cpp:15 221 | #, kde-format 222 | msgid "Key definition" 223 | msgstr "" 224 | 225 | #: keymap-editor/model.cpp:32 226 | msgid "Keymap" 227 | msgstr "" 228 | 229 | #: src/unikey-config.h:66 230 | msgid "Keymap Editor" 231 | msgstr "" 232 | 233 | #: macro-editor/model.cpp:27 src/unikey-im.cpp:394 234 | msgid "Macro" 235 | msgstr "" 236 | 237 | #: src/unikey-im.cpp:645 238 | msgid "Macro Disabled" 239 | msgstr "" 240 | 241 | #: src/unikey-config.h:64 242 | msgid "Macro Editor" 243 | msgstr "" 244 | 245 | #: src/unikey-im.cpp:644 246 | msgid "Macro Enabled" 247 | msgstr "" 248 | 249 | #. i18n: file: macro-editor/dialog.ui:32 250 | #. i18n: ectx: property (text), widget (QLabel, label_2) 251 | #: rc.cpp:54 252 | #, kde-format 253 | msgid "Macro:" 254 | msgstr "Macro:" 255 | 256 | #: keymap-editor/editor.cpp:53 src/unikey-config.h:34 257 | msgid "Microsoft Vietnamese" 258 | msgstr "" 259 | 260 | #. i18n: file: keymap-editor/editor.ui:150 261 | #. i18n: ectx: property (text), widget (QPushButton, moveDownButton) 262 | #: rc.cpp:33 263 | #, kde-format 264 | msgid "Move &Down" 265 | msgstr "" 266 | 267 | #. i18n: file: keymap-editor/editor.ui:139 268 | #. i18n: ectx: property (text), widget (QPushButton, moveUpButton) 269 | #: rc.cpp:30 270 | #, kde-format 271 | msgid "Move &Up" 272 | msgstr "" 273 | 274 | #: src/unikey-config.h:30 275 | msgid "NCR Decimal" 276 | msgstr "" 277 | 278 | #: src/unikey-config.h:31 279 | msgid "NCR Hex" 280 | msgstr "" 281 | 282 | #: keymap-editor/actions.cpp:42 283 | msgid "O with circumflex [O^]" 284 | msgstr "" 285 | 286 | #: keymap-editor/actions.cpp:44 287 | msgid "O with horn [O+]" 288 | msgstr "" 289 | 290 | #: src/unikey-config.h:43 291 | msgid "Output Charset" 292 | msgstr "" 293 | 294 | #: src/unikey-im.cpp:357 295 | msgid "Output charset" 296 | msgstr "" 297 | 298 | #: src/unikey-config.h:47 299 | msgid "Process W at word begin" 300 | msgstr "" 301 | 302 | #: keymap-editor/actions.cpp:13 303 | msgid "Remove existing tone" 304 | msgstr "" 305 | 306 | #: src/unikey-config.h:57 307 | msgid "Restore typing state from surrounding text" 308 | msgstr "" 309 | 310 | #: keymap-editor/editor.cpp:54 src/unikey-config.h:35 311 | msgid "Simple Telex" 312 | msgstr "" 313 | 314 | #: keymap-editor/editor.cpp:55 src/unikey-config.h:36 315 | msgid "Simple Telex2" 316 | msgstr "" 317 | 318 | #: src/unikey-im.cpp:653 319 | msgid "Spell Check Disabled" 320 | msgstr "" 321 | 322 | #: src/unikey-im.cpp:652 323 | msgid "Spell Check Enabled" 324 | msgstr "" 325 | 326 | #: src/unikey-im.cpp:382 327 | msgid "Spell check" 328 | msgstr "" 329 | 330 | #: keymap-editor/actions.cpp:31 331 | msgid "Stroke: D becomes -D" 332 | msgstr "" 333 | 334 | #: src/unikey-config.h:28 335 | msgid "TCVN3" 336 | msgstr "" 337 | 338 | #: keymap-editor/editor.cpp:50 src/unikey-config.h:33 339 | msgid "Telex" 340 | msgstr "" 341 | 342 | #: keymap-editor/actions.cpp:14 343 | msgid "Tone ' (acute)" 344 | msgstr "" 345 | 346 | #: keymap-editor/actions.cpp:18 347 | msgid "Tone . (dot below)" 348 | msgstr "" 349 | 350 | #: keymap-editor/actions.cpp:15 351 | msgid "Tone ` (grave)" 352 | msgstr "" 353 | 354 | #: keymap-editor/editor.cpp:57 355 | msgid "Tone marks" 356 | msgstr "" 357 | 358 | #: keymap-editor/actions.cpp:17 359 | msgid "Tone ~ (tilde)" 360 | msgstr "" 361 | 362 | #: keymap-editor/actions.cpp:16 363 | msgid "Tone ◌̉ (hook above)" 364 | msgstr "" 365 | 366 | #: keymap-editor/actions.cpp:46 367 | msgid "U with horn [U+]" 368 | msgstr "" 369 | 370 | #: src/unikey-config.h:62 371 | msgid "Underline the preedit text" 372 | msgstr "" 373 | 374 | #: src/unikey-config.h:28 375 | msgid "Unicode" 376 | msgstr "" 377 | 378 | #: org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in:7 src/unikey.conf.in:3 379 | msgid "Unikey" 380 | msgstr "Unikey" 381 | 382 | #. i18n: file: keymap-editor/editor.ui:14 383 | #. i18n: ectx: property (windowTitle), widget (QWidget, Editor) 384 | #: keymap-editor/editor.cpp:103 rc.cpp:3 385 | #, kde-format 386 | msgid "Unikey Keymap Editor" 387 | msgstr "" 388 | 389 | #. i18n: file: macro-editor/editor.ui:14 390 | #. i18n: ectx: property (windowTitle), widget (QWidget, Editor) 391 | #: macro-editor/editor.cpp:52 rc.cpp:57 392 | #, kde-format 393 | msgid "Unikey Macro Editor" 394 | msgstr "Editor de macros unikey" 395 | 396 | #: src/unikey-addon.conf.in.in:3 397 | msgid "Unikey Wrapper For Fcitx" 398 | msgstr "Contenidor unikey per a fcitx" 399 | 400 | #: src/unikey-config.h:52 401 | msgid "Use oà, _uý (instead of òa, úy)" 402 | msgstr "" 403 | 404 | #: src/unikey-config.h:35 405 | msgid "UserIM" 406 | msgstr "" 407 | 408 | #: keymap-editor/editor.cpp:52 src/unikey-config.h:29 src/unikey-config.h:34 409 | msgid "VIQR" 410 | msgstr "" 411 | 412 | #: keymap-editor/editor.cpp:51 src/unikey-config.h:33 413 | msgid "VNI" 414 | msgstr "" 415 | 416 | #: src/unikey-config.h:29 417 | msgid "VNI Win" 418 | msgstr "" 419 | 420 | #: keymap-editor/editor.cpp:59 421 | msgid "Vietnamese characters" 422 | msgstr "" 423 | 424 | #: org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in:8 425 | msgid "Vietnamese input method" 426 | msgstr "" 427 | 428 | #: keymap-editor/model.cpp:34 macro-editor/model.cpp:29 429 | msgid "Word" 430 | msgstr "" 431 | 432 | #. i18n: file: macro-editor/dialog.ui:25 433 | #. i18n: ectx: property (text), widget (QLabel, label) 434 | #: rc.cpp:51 435 | #, kde-format 436 | msgid "Word:" 437 | msgstr "Paraula:" 438 | 439 | #: keymap-editor/actions.cpp:39 440 | msgid "a with breve [a(]" 441 | msgstr "" 442 | 443 | #: keymap-editor/actions.cpp:37 444 | msgid "a with circumflex [a^]" 445 | msgstr "" 446 | 447 | #: keymap-editor/actions.cpp:35 448 | msgid "d with stroke [-d]" 449 | msgstr "" 450 | 451 | #: keymap-editor/actions.cpp:41 452 | msgid "e with circumflex [e^]" 453 | msgstr "" 454 | 455 | #: keymap-editor/actions.cpp:43 456 | msgid "o with circumflex [o^]" 457 | msgstr "" 458 | 459 | #: keymap-editor/actions.cpp:45 460 | msgid "o with horn [o+]" 461 | msgstr "" 462 | 463 | #: keymap-editor/actions.cpp:47 464 | msgid "u with horn [u+]" 465 | msgstr "" 466 | -------------------------------------------------------------------------------- /po/da.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the fcitx5-unikey package. 4 | # 5 | # Translators: 6 | # csslayer , 2018 7 | # scootergrisen, 2020 8 | # 9 | msgid "" 10 | msgstr "" 11 | "Project-Id-Version: fcitx5-unikey\n" 12 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 13 | "POT-Creation-Date: 2023-01-04 20:25+0000\n" 14 | "PO-Revision-Date: 2018-06-12 22:55+0000\n" 15 | "Last-Translator: scootergrisen, 2020\n" 16 | "Language-Team: Danish (https://www.transifex.com/fcitx/teams/12005/da/)\n" 17 | "Language: da\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 22 | 23 | #. i18n: file: macro-editor/editor.ui:36 24 | #. i18n: ectx: property (text), widget (QPushButton, addButton) 25 | #: rc.cpp:60 26 | #, kde-format 27 | msgid "&Add" 28 | msgstr "&Tilføj" 29 | 30 | #. i18n: file: keymap-editor/editor.ui:128 31 | #. i18n: ectx: property (text), widget (QPushButton, addButton) 32 | #: rc.cpp:27 33 | #, kde-format 34 | msgid "&Add / Update" 35 | msgstr "" 36 | 37 | #. i18n: file: keymap-editor/editor.ui:161 38 | #. i18n: ectx: property (text), widget (QPushButton, deleteButton) 39 | #. i18n: file: macro-editor/editor.ui:47 40 | #. i18n: ectx: property (text), widget (QPushButton, deleteButton) 41 | #: rc.cpp:36 rc.cpp:63 42 | #, kde-format 43 | msgid "&Delete" 44 | msgstr "&Slet" 45 | 46 | #. i18n: file: keymap-editor/editor.ui:201 47 | #. i18n: ectx: property (text), widget (QPushButton, exportButton) 48 | #. i18n: file: macro-editor/editor.ui:87 49 | #. i18n: ectx: property (text), widget (QPushButton, exportButton) 50 | #: rc.cpp:45 rc.cpp:72 51 | #, kde-format 52 | msgid "&Export" 53 | msgstr "&Eksportér" 54 | 55 | #. i18n: file: keymap-editor/editor.ui:190 56 | #. i18n: ectx: property (text), widget (QPushButton, importButton) 57 | #. i18n: file: macro-editor/editor.ui:76 58 | #. i18n: ectx: property (text), widget (QPushButton, importButton) 59 | #: rc.cpp:42 rc.cpp:69 60 | #, kde-format 61 | msgid "&Import" 62 | msgstr "&Importér" 63 | 64 | #. i18n: file: keymap-editor/editor.ui:47 65 | #. i18n: ectx: property (text), widget (QPushButton, loadButton) 66 | #: rc.cpp:12 67 | #, kde-format 68 | msgid "&Load" 69 | msgstr "" 70 | 71 | #: keymap-editor/actions.cpp:38 72 | msgid "A with breve [A(]" 73 | msgstr "" 74 | 75 | #: keymap-editor/actions.cpp:36 76 | msgid "A with circumflex [A^]" 77 | msgstr "" 78 | 79 | #. i18n: file: keymap-editor/editor.ui:84 80 | #. i18n: ectx: property (text), widget (QLabel, label_4) 81 | #: rc.cpp:21 82 | #, kde-format 83 | msgid "Action:" 84 | msgstr "" 85 | 86 | #: src/unikey-config.h:60 87 | msgid "Allow to modify surrounding text (experimental)" 88 | msgstr "" 89 | 90 | #: src/unikey-config.h:54 91 | msgid "Allow type with more freedom" 92 | msgstr "" 93 | 94 | #: src/unikey-config.h:49 95 | msgid "Auto restore keys with invalid words" 96 | msgstr "" 97 | 98 | #: src/unikey-config.h:29 99 | msgid "BK HCM 2" 100 | msgstr "" 101 | 102 | #: keymap-editor/actions.cpp:30 103 | msgid "Breve: A becomes A(" 104 | msgstr "" 105 | 106 | #. i18n: file: keymap-editor/editor.ui:24 107 | #. i18n: ectx: property (title), widget (QGroupBox, groupBox) 108 | #: rc.cpp:6 109 | #, kde-format 110 | msgid "Built-in Input Methods" 111 | msgstr "" 112 | 113 | #: src/unikey-config.h:30 114 | msgid "CString" 115 | msgstr "" 116 | 117 | #. i18n: file: keymap-editor/editor.ui:67 118 | #. i18n: ectx: property (text), widget (QLabel, label_3) 119 | #: rc.cpp:18 120 | #, kde-format 121 | msgid "Category:" 122 | msgstr "" 123 | 124 | #: keymap-editor/editor.cpp:58 125 | msgid "Character complements" 126 | msgstr "" 127 | 128 | #: keymap-editor/actions.cpp:20 129 | msgid "Circumflex for all applicable characters" 130 | msgstr "" 131 | 132 | #: keymap-editor/actions.cpp:22 133 | msgid "Circumflex: A becomes A^" 134 | msgstr "" 135 | 136 | #: keymap-editor/actions.cpp:23 137 | msgid "Circumflex: E becomes E^" 138 | msgstr "" 139 | 140 | #: keymap-editor/actions.cpp:24 141 | msgid "Circumflex: O becomes O^" 142 | msgstr "" 143 | 144 | #: keymap-editor/actions.cpp:34 145 | msgid "D with stroke [-D]" 146 | msgstr "" 147 | 148 | #. i18n: file: keymap-editor/editor.ui:172 149 | #. i18n: ectx: property (text), widget (QPushButton, clearButton) 150 | #. i18n: file: macro-editor/editor.ui:58 151 | #. i18n: ectx: property (text), widget (QPushButton, clearButton) 152 | #: rc.cpp:39 rc.cpp:66 153 | #, kde-format 154 | msgid "De&lete All" 155 | msgstr "S&let alle" 156 | 157 | #. i18n: file: macro-editor/dialog.ui:14 158 | #. i18n: ectx: property (windowTitle), widget (QDialog, Dialog) 159 | #: rc.cpp:48 160 | #, kde-format 161 | msgid "Dialog" 162 | msgstr "Dialog" 163 | 164 | #: keymap-editor/actions.cpp:40 165 | msgid "E with circumflex [E^]" 166 | msgstr "" 167 | 168 | #: src/unikey-config.h:45 169 | msgid "Enable Macro" 170 | msgstr "" 171 | 172 | #: src/unikey-config.h:44 173 | msgid "Enable spell check" 174 | msgstr "" 175 | 176 | #: keymap-editor/actions.cpp:19 177 | msgid "Escape key" 178 | msgstr "" 179 | 180 | #: keymap-editor/actions.cpp:25 181 | msgid "Horn-Breve: U, O, A, become U+, O+, A(" 182 | msgstr "" 183 | 184 | #: keymap-editor/actions.cpp:32 185 | msgid "Horn-Breve: U, O, A, become U+, O+, A(, or create U+" 186 | msgstr "" 187 | 188 | #: keymap-editor/actions.cpp:29 189 | msgid "Horn: O becomes O+" 190 | msgstr "" 191 | 192 | #: keymap-editor/actions.cpp:28 193 | msgid "Horn: U becomes U+" 194 | msgstr "" 195 | 196 | #: keymap-editor/actions.cpp:27 197 | msgid "Horn: U, O become U+, O+" 198 | msgstr "" 199 | 200 | #: src/unikey-config.h:41 src/unikey-im.cpp:331 201 | msgid "Input Method" 202 | msgstr "" 203 | 204 | #. i18n: file: keymap-editor/editor.ui:30 205 | #. i18n: ectx: property (text), widget (QLabel, label) 206 | #: rc.cpp:9 207 | #, kde-format 208 | msgid "Input Method:" 209 | msgstr "" 210 | 211 | #. i18n: file: keymap-editor/editor.ui:101 212 | #. i18n: ectx: property (text), widget (QLabel, label_2) 213 | #: rc.cpp:24 214 | #, kde-format 215 | msgid "Key" 216 | msgstr "" 217 | 218 | #. i18n: file: keymap-editor/editor.ui:61 219 | #. i18n: ectx: property (title), widget (QGroupBox, groupBox_2) 220 | #: rc.cpp:15 221 | #, kde-format 222 | msgid "Key definition" 223 | msgstr "" 224 | 225 | #: keymap-editor/model.cpp:32 226 | msgid "Keymap" 227 | msgstr "" 228 | 229 | #: src/unikey-config.h:66 230 | msgid "Keymap Editor" 231 | msgstr "" 232 | 233 | #: macro-editor/model.cpp:27 src/unikey-im.cpp:394 234 | msgid "Macro" 235 | msgstr "" 236 | 237 | #: src/unikey-im.cpp:645 238 | msgid "Macro Disabled" 239 | msgstr "" 240 | 241 | #: src/unikey-config.h:64 242 | msgid "Macro Editor" 243 | msgstr "" 244 | 245 | #: src/unikey-im.cpp:644 246 | msgid "Macro Enabled" 247 | msgstr "" 248 | 249 | #. i18n: file: macro-editor/dialog.ui:32 250 | #. i18n: ectx: property (text), widget (QLabel, label_2) 251 | #: rc.cpp:54 252 | #, kde-format 253 | msgid "Macro:" 254 | msgstr "Makro:" 255 | 256 | #: keymap-editor/editor.cpp:53 src/unikey-config.h:34 257 | msgid "Microsoft Vietnamese" 258 | msgstr "" 259 | 260 | #. i18n: file: keymap-editor/editor.ui:150 261 | #. i18n: ectx: property (text), widget (QPushButton, moveDownButton) 262 | #: rc.cpp:33 263 | #, kde-format 264 | msgid "Move &Down" 265 | msgstr "" 266 | 267 | #. i18n: file: keymap-editor/editor.ui:139 268 | #. i18n: ectx: property (text), widget (QPushButton, moveUpButton) 269 | #: rc.cpp:30 270 | #, kde-format 271 | msgid "Move &Up" 272 | msgstr "" 273 | 274 | #: src/unikey-config.h:30 275 | msgid "NCR Decimal" 276 | msgstr "" 277 | 278 | #: src/unikey-config.h:31 279 | msgid "NCR Hex" 280 | msgstr "" 281 | 282 | #: keymap-editor/actions.cpp:42 283 | msgid "O with circumflex [O^]" 284 | msgstr "" 285 | 286 | #: keymap-editor/actions.cpp:44 287 | msgid "O with horn [O+]" 288 | msgstr "" 289 | 290 | #: src/unikey-config.h:43 291 | msgid "Output Charset" 292 | msgstr "" 293 | 294 | #: src/unikey-im.cpp:357 295 | msgid "Output charset" 296 | msgstr "" 297 | 298 | #: src/unikey-config.h:47 299 | msgid "Process W at word begin" 300 | msgstr "" 301 | 302 | #: keymap-editor/actions.cpp:13 303 | msgid "Remove existing tone" 304 | msgstr "" 305 | 306 | #: src/unikey-config.h:57 307 | msgid "Restore typing state from surrounding text" 308 | msgstr "" 309 | 310 | #: keymap-editor/editor.cpp:54 src/unikey-config.h:35 311 | msgid "Simple Telex" 312 | msgstr "" 313 | 314 | #: keymap-editor/editor.cpp:55 src/unikey-config.h:36 315 | msgid "Simple Telex2" 316 | msgstr "" 317 | 318 | #: src/unikey-im.cpp:653 319 | msgid "Spell Check Disabled" 320 | msgstr "" 321 | 322 | #: src/unikey-im.cpp:652 323 | msgid "Spell Check Enabled" 324 | msgstr "" 325 | 326 | #: src/unikey-im.cpp:382 327 | msgid "Spell check" 328 | msgstr "" 329 | 330 | #: keymap-editor/actions.cpp:31 331 | msgid "Stroke: D becomes -D" 332 | msgstr "" 333 | 334 | #: src/unikey-config.h:28 335 | msgid "TCVN3" 336 | msgstr "" 337 | 338 | #: keymap-editor/editor.cpp:50 src/unikey-config.h:33 339 | msgid "Telex" 340 | msgstr "" 341 | 342 | #: keymap-editor/actions.cpp:14 343 | msgid "Tone ' (acute)" 344 | msgstr "" 345 | 346 | #: keymap-editor/actions.cpp:18 347 | msgid "Tone . (dot below)" 348 | msgstr "" 349 | 350 | #: keymap-editor/actions.cpp:15 351 | msgid "Tone ` (grave)" 352 | msgstr "" 353 | 354 | #: keymap-editor/editor.cpp:57 355 | msgid "Tone marks" 356 | msgstr "" 357 | 358 | #: keymap-editor/actions.cpp:17 359 | msgid "Tone ~ (tilde)" 360 | msgstr "" 361 | 362 | #: keymap-editor/actions.cpp:16 363 | msgid "Tone ◌̉ (hook above)" 364 | msgstr "" 365 | 366 | #: keymap-editor/actions.cpp:46 367 | msgid "U with horn [U+]" 368 | msgstr "" 369 | 370 | #: src/unikey-config.h:62 371 | msgid "Underline the preedit text" 372 | msgstr "" 373 | 374 | #: src/unikey-config.h:28 375 | msgid "Unicode" 376 | msgstr "" 377 | 378 | #: org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in:7 src/unikey.conf.in:3 379 | msgid "Unikey" 380 | msgstr "Unikey" 381 | 382 | #. i18n: file: keymap-editor/editor.ui:14 383 | #. i18n: ectx: property (windowTitle), widget (QWidget, Editor) 384 | #: keymap-editor/editor.cpp:103 rc.cpp:3 385 | #, kde-format 386 | msgid "Unikey Keymap Editor" 387 | msgstr "" 388 | 389 | #. i18n: file: macro-editor/editor.ui:14 390 | #. i18n: ectx: property (windowTitle), widget (QWidget, Editor) 391 | #: macro-editor/editor.cpp:52 rc.cpp:57 392 | #, kde-format 393 | msgid "Unikey Macro Editor" 394 | msgstr "Unikey-makroredigering" 395 | 396 | #: src/unikey-addon.conf.in.in:3 397 | msgid "Unikey Wrapper For Fcitx" 398 | msgstr "Unikey-wrapper for Fcitx" 399 | 400 | #: src/unikey-config.h:52 401 | msgid "Use oà, _uý (instead of òa, úy)" 402 | msgstr "" 403 | 404 | #: src/unikey-config.h:35 405 | msgid "UserIM" 406 | msgstr "" 407 | 408 | #: keymap-editor/editor.cpp:52 src/unikey-config.h:29 src/unikey-config.h:34 409 | msgid "VIQR" 410 | msgstr "" 411 | 412 | #: keymap-editor/editor.cpp:51 src/unikey-config.h:33 413 | msgid "VNI" 414 | msgstr "" 415 | 416 | #: src/unikey-config.h:29 417 | msgid "VNI Win" 418 | msgstr "" 419 | 420 | #: keymap-editor/editor.cpp:59 421 | msgid "Vietnamese characters" 422 | msgstr "" 423 | 424 | #: org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in:8 425 | msgid "Vietnamese input method" 426 | msgstr "Vietnamesisk-inputmetode" 427 | 428 | #: keymap-editor/model.cpp:34 macro-editor/model.cpp:29 429 | msgid "Word" 430 | msgstr "" 431 | 432 | #. i18n: file: macro-editor/dialog.ui:25 433 | #. i18n: ectx: property (text), widget (QLabel, label) 434 | #: rc.cpp:51 435 | #, kde-format 436 | msgid "Word:" 437 | msgstr "Ord:" 438 | 439 | #: keymap-editor/actions.cpp:39 440 | msgid "a with breve [a(]" 441 | msgstr "" 442 | 443 | #: keymap-editor/actions.cpp:37 444 | msgid "a with circumflex [a^]" 445 | msgstr "" 446 | 447 | #: keymap-editor/actions.cpp:35 448 | msgid "d with stroke [-d]" 449 | msgstr "" 450 | 451 | #: keymap-editor/actions.cpp:41 452 | msgid "e with circumflex [e^]" 453 | msgstr "" 454 | 455 | #: keymap-editor/actions.cpp:43 456 | msgid "o with circumflex [o^]" 457 | msgstr "" 458 | 459 | #: keymap-editor/actions.cpp:45 460 | msgid "o with horn [o+]" 461 | msgstr "" 462 | 463 | #: keymap-editor/actions.cpp:47 464 | msgid "u with horn [u+]" 465 | msgstr "" 466 | -------------------------------------------------------------------------------- /po/fcitx5-unikey.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 fcitx5-unikey package. 4 | # 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: fcitx5-unikey\n" 8 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 9 | "POT-Creation-Date: 2023-01-04 20:25+0000\n" 10 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 11 | "Last-Translator: FULL NAME \n" 12 | "Language-Team: LANGUAGE \n" 13 | "Language: LANG\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | 18 | #. i18n: file: macro-editor/editor.ui:36 19 | #. i18n: ectx: property (text), widget (QPushButton, addButton) 20 | #: rc.cpp:60 21 | #, kde-format 22 | msgid "&Add" 23 | msgstr "" 24 | 25 | #. i18n: file: keymap-editor/editor.ui:128 26 | #. i18n: ectx: property (text), widget (QPushButton, addButton) 27 | #: rc.cpp:27 28 | #, kde-format 29 | msgid "&Add / Update" 30 | msgstr "" 31 | 32 | #. i18n: file: keymap-editor/editor.ui:161 33 | #. i18n: ectx: property (text), widget (QPushButton, deleteButton) 34 | #. i18n: file: macro-editor/editor.ui:47 35 | #. i18n: ectx: property (text), widget (QPushButton, deleteButton) 36 | #: rc.cpp:36 rc.cpp:63 37 | #, kde-format 38 | msgid "&Delete" 39 | msgstr "" 40 | 41 | #. i18n: file: keymap-editor/editor.ui:201 42 | #. i18n: ectx: property (text), widget (QPushButton, exportButton) 43 | #. i18n: file: macro-editor/editor.ui:87 44 | #. i18n: ectx: property (text), widget (QPushButton, exportButton) 45 | #: rc.cpp:45 rc.cpp:72 46 | #, kde-format 47 | msgid "&Export" 48 | msgstr "" 49 | 50 | #. i18n: file: keymap-editor/editor.ui:190 51 | #. i18n: ectx: property (text), widget (QPushButton, importButton) 52 | #. i18n: file: macro-editor/editor.ui:76 53 | #. i18n: ectx: property (text), widget (QPushButton, importButton) 54 | #: rc.cpp:42 rc.cpp:69 55 | #, kde-format 56 | msgid "&Import" 57 | msgstr "" 58 | 59 | #. i18n: file: keymap-editor/editor.ui:47 60 | #. i18n: ectx: property (text), widget (QPushButton, loadButton) 61 | #: rc.cpp:12 62 | #, kde-format 63 | msgid "&Load" 64 | msgstr "" 65 | 66 | #: keymap-editor/actions.cpp:38 67 | msgid "A with breve [A(]" 68 | msgstr "" 69 | 70 | #: keymap-editor/actions.cpp:36 71 | msgid "A with circumflex [A^]" 72 | msgstr "" 73 | 74 | #. i18n: file: keymap-editor/editor.ui:84 75 | #. i18n: ectx: property (text), widget (QLabel, label_4) 76 | #: rc.cpp:21 77 | #, kde-format 78 | msgid "Action:" 79 | msgstr "" 80 | 81 | #: src/unikey-config.h:60 82 | msgid "Allow to modify surrounding text (experimental)" 83 | msgstr "" 84 | 85 | #: src/unikey-config.h:54 86 | msgid "Allow type with more freedom" 87 | msgstr "" 88 | 89 | #: src/unikey-config.h:49 90 | msgid "Auto restore keys with invalid words" 91 | msgstr "" 92 | 93 | #: src/unikey-config.h:29 94 | msgid "BK HCM 2" 95 | msgstr "" 96 | 97 | #: keymap-editor/actions.cpp:30 98 | msgid "Breve: A becomes A(" 99 | msgstr "" 100 | 101 | #. i18n: file: keymap-editor/editor.ui:24 102 | #. i18n: ectx: property (title), widget (QGroupBox, groupBox) 103 | #: rc.cpp:6 104 | #, kde-format 105 | msgid "Built-in Input Methods" 106 | msgstr "" 107 | 108 | #: src/unikey-config.h:30 109 | msgid "CString" 110 | msgstr "" 111 | 112 | #. i18n: file: keymap-editor/editor.ui:67 113 | #. i18n: ectx: property (text), widget (QLabel, label_3) 114 | #: rc.cpp:18 115 | #, kde-format 116 | msgid "Category:" 117 | msgstr "" 118 | 119 | #: keymap-editor/editor.cpp:58 120 | msgid "Character complements" 121 | msgstr "" 122 | 123 | #: keymap-editor/actions.cpp:20 124 | msgid "Circumflex for all applicable characters" 125 | msgstr "" 126 | 127 | #: keymap-editor/actions.cpp:22 128 | msgid "Circumflex: A becomes A^" 129 | msgstr "" 130 | 131 | #: keymap-editor/actions.cpp:23 132 | msgid "Circumflex: E becomes E^" 133 | msgstr "" 134 | 135 | #: keymap-editor/actions.cpp:24 136 | msgid "Circumflex: O becomes O^" 137 | msgstr "" 138 | 139 | #: keymap-editor/actions.cpp:34 140 | msgid "D with stroke [-D]" 141 | msgstr "" 142 | 143 | #. i18n: file: keymap-editor/editor.ui:172 144 | #. i18n: ectx: property (text), widget (QPushButton, clearButton) 145 | #. i18n: file: macro-editor/editor.ui:58 146 | #. i18n: ectx: property (text), widget (QPushButton, clearButton) 147 | #: rc.cpp:39 rc.cpp:66 148 | #, kde-format 149 | msgid "De&lete All" 150 | msgstr "" 151 | 152 | #. i18n: file: macro-editor/dialog.ui:14 153 | #. i18n: ectx: property (windowTitle), widget (QDialog, Dialog) 154 | #: rc.cpp:48 155 | #, kde-format 156 | msgid "Dialog" 157 | msgstr "" 158 | 159 | #: keymap-editor/actions.cpp:40 160 | msgid "E with circumflex [E^]" 161 | msgstr "" 162 | 163 | #: src/unikey-config.h:45 164 | msgid "Enable Macro" 165 | msgstr "" 166 | 167 | #: src/unikey-config.h:44 168 | msgid "Enable spell check" 169 | msgstr "" 170 | 171 | #: keymap-editor/actions.cpp:19 172 | msgid "Escape key" 173 | msgstr "" 174 | 175 | #: keymap-editor/actions.cpp:25 176 | msgid "Horn-Breve: U, O, A, become U+, O+, A(" 177 | msgstr "" 178 | 179 | #: keymap-editor/actions.cpp:32 180 | msgid "Horn-Breve: U, O, A, become U+, O+, A(, or create U+" 181 | msgstr "" 182 | 183 | #: keymap-editor/actions.cpp:29 184 | msgid "Horn: O becomes O+" 185 | msgstr "" 186 | 187 | #: keymap-editor/actions.cpp:28 188 | msgid "Horn: U becomes U+" 189 | msgstr "" 190 | 191 | #: keymap-editor/actions.cpp:27 192 | msgid "Horn: U, O become U+, O+" 193 | msgstr "" 194 | 195 | #: src/unikey-config.h:41 src/unikey-im.cpp:331 196 | msgid "Input Method" 197 | msgstr "" 198 | 199 | #. i18n: file: keymap-editor/editor.ui:30 200 | #. i18n: ectx: property (text), widget (QLabel, label) 201 | #: rc.cpp:9 202 | #, kde-format 203 | msgid "Input Method:" 204 | msgstr "" 205 | 206 | #. i18n: file: keymap-editor/editor.ui:101 207 | #. i18n: ectx: property (text), widget (QLabel, label_2) 208 | #: rc.cpp:24 209 | #, kde-format 210 | msgid "Key" 211 | msgstr "" 212 | 213 | #. i18n: file: keymap-editor/editor.ui:61 214 | #. i18n: ectx: property (title), widget (QGroupBox, groupBox_2) 215 | #: rc.cpp:15 216 | #, kde-format 217 | msgid "Key definition" 218 | msgstr "" 219 | 220 | #: keymap-editor/model.cpp:32 221 | msgid "Keymap" 222 | msgstr "" 223 | 224 | #: src/unikey-config.h:66 225 | msgid "Keymap Editor" 226 | msgstr "" 227 | 228 | #: macro-editor/model.cpp:27 src/unikey-im.cpp:394 229 | msgid "Macro" 230 | msgstr "" 231 | 232 | #: src/unikey-im.cpp:645 233 | msgid "Macro Disabled" 234 | msgstr "" 235 | 236 | #: src/unikey-config.h:64 237 | msgid "Macro Editor" 238 | msgstr "" 239 | 240 | #: src/unikey-im.cpp:644 241 | msgid "Macro Enabled" 242 | msgstr "" 243 | 244 | #. i18n: file: macro-editor/dialog.ui:32 245 | #. i18n: ectx: property (text), widget (QLabel, label_2) 246 | #: rc.cpp:54 247 | #, kde-format 248 | msgid "Macro:" 249 | msgstr "" 250 | 251 | #: keymap-editor/editor.cpp:53 src/unikey-config.h:34 252 | msgid "Microsoft Vietnamese" 253 | msgstr "" 254 | 255 | #. i18n: file: keymap-editor/editor.ui:150 256 | #. i18n: ectx: property (text), widget (QPushButton, moveDownButton) 257 | #: rc.cpp:33 258 | #, kde-format 259 | msgid "Move &Down" 260 | msgstr "" 261 | 262 | #. i18n: file: keymap-editor/editor.ui:139 263 | #. i18n: ectx: property (text), widget (QPushButton, moveUpButton) 264 | #: rc.cpp:30 265 | #, kde-format 266 | msgid "Move &Up" 267 | msgstr "" 268 | 269 | #: src/unikey-config.h:30 270 | msgid "NCR Decimal" 271 | msgstr "" 272 | 273 | #: src/unikey-config.h:31 274 | msgid "NCR Hex" 275 | msgstr "" 276 | 277 | #: keymap-editor/actions.cpp:42 278 | msgid "O with circumflex [O^]" 279 | msgstr "" 280 | 281 | #: keymap-editor/actions.cpp:44 282 | msgid "O with horn [O+]" 283 | msgstr "" 284 | 285 | #: src/unikey-config.h:43 286 | msgid "Output Charset" 287 | msgstr "" 288 | 289 | #: src/unikey-im.cpp:357 290 | msgid "Output charset" 291 | msgstr "" 292 | 293 | #: src/unikey-config.h:47 294 | msgid "Process W at word begin" 295 | msgstr "" 296 | 297 | #: keymap-editor/actions.cpp:13 298 | msgid "Remove existing tone" 299 | msgstr "" 300 | 301 | #: src/unikey-config.h:57 302 | msgid "Restore typing state from surrounding text" 303 | msgstr "" 304 | 305 | #: keymap-editor/editor.cpp:54 src/unikey-config.h:35 306 | msgid "Simple Telex" 307 | msgstr "" 308 | 309 | #: keymap-editor/editor.cpp:55 src/unikey-config.h:36 310 | msgid "Simple Telex2" 311 | msgstr "" 312 | 313 | #: src/unikey-im.cpp:653 314 | msgid "Spell Check Disabled" 315 | msgstr "" 316 | 317 | #: src/unikey-im.cpp:652 318 | msgid "Spell Check Enabled" 319 | msgstr "" 320 | 321 | #: src/unikey-im.cpp:382 322 | msgid "Spell check" 323 | msgstr "" 324 | 325 | #: keymap-editor/actions.cpp:31 326 | msgid "Stroke: D becomes -D" 327 | msgstr "" 328 | 329 | #: src/unikey-config.h:28 330 | msgid "TCVN3" 331 | msgstr "" 332 | 333 | #: keymap-editor/editor.cpp:50 src/unikey-config.h:33 334 | msgid "Telex" 335 | msgstr "" 336 | 337 | #: keymap-editor/actions.cpp:14 338 | msgid "Tone ' (acute)" 339 | msgstr "" 340 | 341 | #: keymap-editor/actions.cpp:18 342 | msgid "Tone . (dot below)" 343 | msgstr "" 344 | 345 | #: keymap-editor/actions.cpp:15 346 | msgid "Tone ` (grave)" 347 | msgstr "" 348 | 349 | #: keymap-editor/editor.cpp:57 350 | msgid "Tone marks" 351 | msgstr "" 352 | 353 | #: keymap-editor/actions.cpp:17 354 | msgid "Tone ~ (tilde)" 355 | msgstr "" 356 | 357 | #: keymap-editor/actions.cpp:16 358 | msgid "Tone ◌̉ (hook above)" 359 | msgstr "" 360 | 361 | #: keymap-editor/actions.cpp:46 362 | msgid "U with horn [U+]" 363 | msgstr "" 364 | 365 | #: src/unikey-config.h:62 366 | msgid "Underline the preedit text" 367 | msgstr "" 368 | 369 | #: src/unikey-config.h:28 370 | msgid "Unicode" 371 | msgstr "" 372 | 373 | #: org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in:7 src/unikey.conf.in:3 374 | msgid "Unikey" 375 | msgstr "" 376 | 377 | #. i18n: file: keymap-editor/editor.ui:14 378 | #. i18n: ectx: property (windowTitle), widget (QWidget, Editor) 379 | #: keymap-editor/editor.cpp:103 rc.cpp:3 380 | #, kde-format 381 | msgid "Unikey Keymap Editor" 382 | msgstr "" 383 | 384 | #. i18n: file: macro-editor/editor.ui:14 385 | #. i18n: ectx: property (windowTitle), widget (QWidget, Editor) 386 | #: macro-editor/editor.cpp:52 rc.cpp:57 387 | #, kde-format 388 | msgid "Unikey Macro Editor" 389 | msgstr "" 390 | 391 | #: src/unikey-addon.conf.in.in:3 392 | msgid "Unikey Wrapper For Fcitx" 393 | msgstr "" 394 | 395 | #: src/unikey-config.h:52 396 | msgid "Use oà, _uý (instead of òa, úy)" 397 | msgstr "" 398 | 399 | #: src/unikey-config.h:35 400 | msgid "UserIM" 401 | msgstr "" 402 | 403 | #: keymap-editor/editor.cpp:52 src/unikey-config.h:29 src/unikey-config.h:34 404 | msgid "VIQR" 405 | msgstr "" 406 | 407 | #: keymap-editor/editor.cpp:51 src/unikey-config.h:33 408 | msgid "VNI" 409 | msgstr "" 410 | 411 | #: src/unikey-config.h:29 412 | msgid "VNI Win" 413 | msgstr "" 414 | 415 | #: keymap-editor/editor.cpp:59 416 | msgid "Vietnamese characters" 417 | msgstr "" 418 | 419 | #: org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in:8 420 | msgid "Vietnamese input method" 421 | msgstr "" 422 | 423 | #: keymap-editor/model.cpp:34 macro-editor/model.cpp:29 424 | msgid "Word" 425 | msgstr "" 426 | 427 | #. i18n: file: macro-editor/dialog.ui:25 428 | #. i18n: ectx: property (text), widget (QLabel, label) 429 | #: rc.cpp:51 430 | #, kde-format 431 | msgid "Word:" 432 | msgstr "" 433 | 434 | #: keymap-editor/actions.cpp:39 435 | msgid "a with breve [a(]" 436 | msgstr "" 437 | 438 | #: keymap-editor/actions.cpp:37 439 | msgid "a with circumflex [a^]" 440 | msgstr "" 441 | 442 | #: keymap-editor/actions.cpp:35 443 | msgid "d with stroke [-d]" 444 | msgstr "" 445 | 446 | #: keymap-editor/actions.cpp:41 447 | msgid "e with circumflex [e^]" 448 | msgstr "" 449 | 450 | #: keymap-editor/actions.cpp:43 451 | msgid "o with circumflex [o^]" 452 | msgstr "" 453 | 454 | #: keymap-editor/actions.cpp:45 455 | msgid "o with horn [o+]" 456 | msgstr "" 457 | 458 | #: keymap-editor/actions.cpp:47 459 | msgid "u with horn [u+]" 460 | msgstr "" 461 | -------------------------------------------------------------------------------- /po/he.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the fcitx5-unikey package. 4 | # 5 | # Translators: 6 | # 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e , 2020 7 | # 8 | msgid "" 9 | msgstr "" 10 | "Project-Id-Version: fcitx5-unikey\n" 11 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 12 | "POT-Creation-Date: 2024-03-07 20:24+0000\n" 13 | "PO-Revision-Date: 2018-06-12 22:55+0000\n" 14 | "Last-Translator: 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e " 15 | ", 2020\n" 16 | "Language-Team: Hebrew (https://app.transifex.com/fcitx/teams/12005/he/)\n" 17 | "Language: he\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Plural-Forms: nplurals=3; plural=(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % " 22 | "1 == 0) ? 1: 2;\n" 23 | 24 | #. i18n: file: macro-editor/editor.ui:36 25 | #. i18n: ectx: property (text), widget (QPushButton, addButton) 26 | #: rc.cpp:60 27 | #, kde-format 28 | msgid "&Add" 29 | msgstr "&הוספה" 30 | 31 | #. i18n: file: keymap-editor/editor.ui:128 32 | #. i18n: ectx: property (text), widget (QPushButton, addButton) 33 | #: rc.cpp:27 34 | #, kde-format 35 | msgid "&Add / Update" 36 | msgstr "" 37 | 38 | #. i18n: file: keymap-editor/editor.ui:161 39 | #. i18n: ectx: property (text), widget (QPushButton, deleteButton) 40 | #. i18n: file: macro-editor/editor.ui:47 41 | #. i18n: ectx: property (text), widget (QPushButton, deleteButton) 42 | #: rc.cpp:36 rc.cpp:63 43 | #, kde-format 44 | msgid "&Delete" 45 | msgstr "מ&חיקה" 46 | 47 | #. i18n: file: keymap-editor/editor.ui:201 48 | #. i18n: ectx: property (text), widget (QPushButton, exportButton) 49 | #. i18n: file: macro-editor/editor.ui:87 50 | #. i18n: ectx: property (text), widget (QPushButton, exportButton) 51 | #: rc.cpp:45 rc.cpp:72 52 | #, kde-format 53 | msgid "&Export" 54 | msgstr "יי&צוא" 55 | 56 | #. i18n: file: keymap-editor/editor.ui:190 57 | #. i18n: ectx: property (text), widget (QPushButton, importButton) 58 | #. i18n: file: macro-editor/editor.ui:76 59 | #. i18n: ectx: property (text), widget (QPushButton, importButton) 60 | #: rc.cpp:42 rc.cpp:69 61 | #, kde-format 62 | msgid "&Import" 63 | msgstr "יי&בוא" 64 | 65 | #. i18n: file: keymap-editor/editor.ui:47 66 | #. i18n: ectx: property (text), widget (QPushButton, loadButton) 67 | #: rc.cpp:12 68 | #, kde-format 69 | msgid "&Load" 70 | msgstr "" 71 | 72 | #: keymap-editor/actions.cpp:38 73 | msgid "A with breve [A(]" 74 | msgstr "" 75 | 76 | #: keymap-editor/actions.cpp:36 77 | msgid "A with circumflex [A^]" 78 | msgstr "" 79 | 80 | #. i18n: file: keymap-editor/editor.ui:84 81 | #. i18n: ectx: property (text), widget (QLabel, label_4) 82 | #: rc.cpp:21 83 | #, kde-format 84 | msgid "Action:" 85 | msgstr "" 86 | 87 | #: src/unikey-config.h:60 88 | msgid "Allow to modify surrounding text (experimental)" 89 | msgstr "" 90 | 91 | #: src/unikey-config.h:54 92 | msgid "Allow type with more freedom" 93 | msgstr "" 94 | 95 | #: src/unikey-config.h:49 96 | msgid "Auto restore keys with invalid words" 97 | msgstr "" 98 | 99 | #: src/unikey-config.h:29 100 | msgid "BK HCM 2" 101 | msgstr "" 102 | 103 | #: keymap-editor/actions.cpp:30 104 | msgid "Breve: A becomes A(" 105 | msgstr "" 106 | 107 | #. i18n: file: keymap-editor/editor.ui:24 108 | #. i18n: ectx: property (title), widget (QGroupBox, groupBox) 109 | #: rc.cpp:6 110 | #, kde-format 111 | msgid "Built-in Input Methods" 112 | msgstr "" 113 | 114 | #: src/unikey-config.h:30 115 | msgid "CString" 116 | msgstr "" 117 | 118 | #. i18n: file: keymap-editor/editor.ui:67 119 | #. i18n: ectx: property (text), widget (QLabel, label_3) 120 | #: rc.cpp:18 121 | #, kde-format 122 | msgid "Category:" 123 | msgstr "" 124 | 125 | #: keymap-editor/editor.cpp:58 126 | msgid "Character complements" 127 | msgstr "" 128 | 129 | #: keymap-editor/actions.cpp:20 130 | msgid "Circumflex for all applicable characters" 131 | msgstr "" 132 | 133 | #: keymap-editor/actions.cpp:22 134 | msgid "Circumflex: A becomes A^" 135 | msgstr "" 136 | 137 | #: keymap-editor/actions.cpp:23 138 | msgid "Circumflex: E becomes E^" 139 | msgstr "" 140 | 141 | #: keymap-editor/actions.cpp:24 142 | msgid "Circumflex: O becomes O^" 143 | msgstr "" 144 | 145 | #: keymap-editor/actions.cpp:34 146 | msgid "D with stroke [-D]" 147 | msgstr "" 148 | 149 | #. i18n: file: keymap-editor/editor.ui:172 150 | #. i18n: ectx: property (text), widget (QPushButton, clearButton) 151 | #. i18n: file: macro-editor/editor.ui:58 152 | #. i18n: ectx: property (text), widget (QPushButton, clearButton) 153 | #: rc.cpp:39 rc.cpp:66 154 | #, kde-format 155 | msgid "De&lete All" 156 | msgstr "למח&וק הכול" 157 | 158 | #. i18n: file: macro-editor/dialog.ui:14 159 | #. i18n: ectx: property (windowTitle), widget (QDialog, Dialog) 160 | #: rc.cpp:48 161 | #, kde-format 162 | msgid "Dialog" 163 | msgstr "דו־שיח" 164 | 165 | #: keymap-editor/actions.cpp:40 166 | msgid "E with circumflex [E^]" 167 | msgstr "" 168 | 169 | #: src/unikey-config.h:45 170 | msgid "Enable Macro" 171 | msgstr "" 172 | 173 | #: src/unikey-config.h:44 174 | msgid "Enable spell check" 175 | msgstr "" 176 | 177 | #: keymap-editor/actions.cpp:19 178 | msgid "Escape key" 179 | msgstr "" 180 | 181 | #: keymap-editor/actions.cpp:25 182 | msgid "Horn-Breve: U, O, A, become U+, O+, A(" 183 | msgstr "" 184 | 185 | #: keymap-editor/actions.cpp:32 186 | msgid "Horn-Breve: U, O, A, become U+, O+, A(, or create U+" 187 | msgstr "" 188 | 189 | #: keymap-editor/actions.cpp:29 190 | msgid "Horn: O becomes O+" 191 | msgstr "" 192 | 193 | #: keymap-editor/actions.cpp:28 194 | msgid "Horn: U becomes U+" 195 | msgstr "" 196 | 197 | #: keymap-editor/actions.cpp:27 198 | msgid "Horn: U, O become U+, O+" 199 | msgstr "" 200 | 201 | #: src/unikey-config.h:41 src/unikey-im.cpp:331 202 | msgid "Input Method" 203 | msgstr "" 204 | 205 | #. i18n: file: keymap-editor/editor.ui:30 206 | #. i18n: ectx: property (text), widget (QLabel, label) 207 | #: rc.cpp:9 208 | #, kde-format 209 | msgid "Input Method:" 210 | msgstr "" 211 | 212 | #. i18n: file: keymap-editor/editor.ui:101 213 | #. i18n: ectx: property (text), widget (QLabel, label_2) 214 | #: rc.cpp:24 215 | #, kde-format 216 | msgid "Key" 217 | msgstr "" 218 | 219 | #. i18n: file: keymap-editor/editor.ui:61 220 | #. i18n: ectx: property (title), widget (QGroupBox, groupBox_2) 221 | #: rc.cpp:15 222 | #, kde-format 223 | msgid "Key definition" 224 | msgstr "" 225 | 226 | #: keymap-editor/model.cpp:32 227 | msgid "Keymap" 228 | msgstr "" 229 | 230 | #: src/unikey-config.h:66 231 | msgid "Keymap Editor" 232 | msgstr "" 233 | 234 | #: macro-editor/model.cpp:27 src/unikey-im.cpp:394 235 | msgid "Macro" 236 | msgstr "" 237 | 238 | #: src/unikey-im.cpp:645 239 | msgid "Macro Disabled" 240 | msgstr "" 241 | 242 | #: src/unikey-config.h:64 243 | msgid "Macro Editor" 244 | msgstr "" 245 | 246 | #: src/unikey-im.cpp:644 247 | msgid "Macro Enabled" 248 | msgstr "" 249 | 250 | #. i18n: file: macro-editor/dialog.ui:32 251 | #. i18n: ectx: property (text), widget (QLabel, label_2) 252 | #: rc.cpp:54 253 | #, kde-format 254 | msgid "Macro:" 255 | msgstr "מאקרו:" 256 | 257 | #: keymap-editor/editor.cpp:53 src/unikey-config.h:34 258 | msgid "Microsoft Vietnamese" 259 | msgstr "" 260 | 261 | #. i18n: file: keymap-editor/editor.ui:150 262 | #. i18n: ectx: property (text), widget (QPushButton, moveDownButton) 263 | #: rc.cpp:33 264 | #, kde-format 265 | msgid "Move &Down" 266 | msgstr "" 267 | 268 | #. i18n: file: keymap-editor/editor.ui:139 269 | #. i18n: ectx: property (text), widget (QPushButton, moveUpButton) 270 | #: rc.cpp:30 271 | #, kde-format 272 | msgid "Move &Up" 273 | msgstr "" 274 | 275 | #: src/unikey-config.h:30 276 | msgid "NCR Decimal" 277 | msgstr "" 278 | 279 | #: src/unikey-config.h:31 280 | msgid "NCR Hex" 281 | msgstr "" 282 | 283 | #: keymap-editor/actions.cpp:42 284 | msgid "O with circumflex [O^]" 285 | msgstr "" 286 | 287 | #: keymap-editor/actions.cpp:44 288 | msgid "O with horn [O+]" 289 | msgstr "" 290 | 291 | #: src/unikey-config.h:43 292 | msgid "Output Charset" 293 | msgstr "" 294 | 295 | #: src/unikey-im.cpp:357 296 | msgid "Output charset" 297 | msgstr "" 298 | 299 | #: src/unikey-config.h:47 300 | msgid "Process W at word begin" 301 | msgstr "" 302 | 303 | #: keymap-editor/actions.cpp:13 304 | msgid "Remove existing tone" 305 | msgstr "" 306 | 307 | #: src/unikey-config.h:57 308 | msgid "Restore typing state from surrounding text" 309 | msgstr "" 310 | 311 | #: keymap-editor/editor.cpp:54 src/unikey-config.h:35 312 | msgid "Simple Telex" 313 | msgstr "" 314 | 315 | #: keymap-editor/editor.cpp:55 src/unikey-config.h:36 316 | msgid "Simple Telex2" 317 | msgstr "" 318 | 319 | #: src/unikey-im.cpp:653 320 | msgid "Spell Check Disabled" 321 | msgstr "" 322 | 323 | #: src/unikey-im.cpp:652 324 | msgid "Spell Check Enabled" 325 | msgstr "" 326 | 327 | #: src/unikey-im.cpp:382 328 | msgid "Spell check" 329 | msgstr "" 330 | 331 | #: keymap-editor/actions.cpp:31 332 | msgid "Stroke: D becomes -D" 333 | msgstr "" 334 | 335 | #: src/unikey-config.h:28 336 | msgid "TCVN3" 337 | msgstr "" 338 | 339 | #: keymap-editor/editor.cpp:50 src/unikey-config.h:33 340 | msgid "Telex" 341 | msgstr "" 342 | 343 | #: keymap-editor/actions.cpp:14 344 | msgid "Tone ' (acute)" 345 | msgstr "" 346 | 347 | #: keymap-editor/actions.cpp:18 348 | msgid "Tone . (dot below)" 349 | msgstr "" 350 | 351 | #: keymap-editor/actions.cpp:15 352 | msgid "Tone ` (grave)" 353 | msgstr "" 354 | 355 | #: keymap-editor/editor.cpp:57 356 | msgid "Tone marks" 357 | msgstr "" 358 | 359 | #: keymap-editor/actions.cpp:17 360 | msgid "Tone ~ (tilde)" 361 | msgstr "" 362 | 363 | #: keymap-editor/actions.cpp:16 364 | msgid "Tone ◌̉ (hook above)" 365 | msgstr "" 366 | 367 | #: keymap-editor/actions.cpp:46 368 | msgid "U with horn [U+]" 369 | msgstr "" 370 | 371 | #: src/unikey-config.h:62 372 | msgid "Underline the preedit text" 373 | msgstr "" 374 | 375 | #: src/unikey-config.h:28 376 | msgid "Unicode" 377 | msgstr "" 378 | 379 | #: org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in:7 src/unikey.conf.in:3 380 | msgid "Unikey" 381 | msgstr "" 382 | 383 | #. i18n: file: keymap-editor/editor.ui:14 384 | #. i18n: ectx: property (windowTitle), widget (QWidget, Editor) 385 | #: keymap-editor/editor.cpp:103 rc.cpp:3 386 | #, kde-format 387 | msgid "Unikey Keymap Editor" 388 | msgstr "" 389 | 390 | #. i18n: file: macro-editor/editor.ui:14 391 | #. i18n: ectx: property (windowTitle), widget (QWidget, Editor) 392 | #: macro-editor/editor.cpp:52 rc.cpp:57 393 | #, kde-format 394 | msgid "Unikey Macro Editor" 395 | msgstr "" 396 | 397 | #: src/unikey-addon.conf.in.in:3 398 | msgid "Unikey Wrapper For Fcitx" 399 | msgstr "" 400 | 401 | #: src/unikey-config.h:52 402 | msgid "Use oà, _uý (instead of òa, úy)" 403 | msgstr "" 404 | 405 | #: src/unikey-config.h:35 406 | msgid "UserIM" 407 | msgstr "" 408 | 409 | #: keymap-editor/editor.cpp:52 src/unikey-config.h:29 src/unikey-config.h:34 410 | msgid "VIQR" 411 | msgstr "" 412 | 413 | #: keymap-editor/editor.cpp:51 src/unikey-config.h:33 414 | msgid "VNI" 415 | msgstr "" 416 | 417 | #: src/unikey-config.h:29 418 | msgid "VNI Win" 419 | msgstr "" 420 | 421 | #: keymap-editor/editor.cpp:59 422 | msgid "Vietnamese characters" 423 | msgstr "" 424 | 425 | #: org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in:8 426 | msgid "Vietnamese input method" 427 | msgstr "" 428 | 429 | #: keymap-editor/model.cpp:34 macro-editor/model.cpp:29 430 | msgid "Word" 431 | msgstr "" 432 | 433 | #. i18n: file: macro-editor/dialog.ui:25 434 | #. i18n: ectx: property (text), widget (QLabel, label) 435 | #: rc.cpp:51 436 | #, kde-format 437 | msgid "Word:" 438 | msgstr "מילה:" 439 | 440 | #: keymap-editor/actions.cpp:39 441 | msgid "a with breve [a(]" 442 | msgstr "" 443 | 444 | #: keymap-editor/actions.cpp:37 445 | msgid "a with circumflex [a^]" 446 | msgstr "" 447 | 448 | #: keymap-editor/actions.cpp:35 449 | msgid "d with stroke [-d]" 450 | msgstr "" 451 | 452 | #: keymap-editor/actions.cpp:41 453 | msgid "e with circumflex [e^]" 454 | msgstr "" 455 | 456 | #: keymap-editor/actions.cpp:43 457 | msgid "o with circumflex [o^]" 458 | msgstr "" 459 | 460 | #: keymap-editor/actions.cpp:45 461 | msgid "o with horn [o+]" 462 | msgstr "" 463 | 464 | #: keymap-editor/actions.cpp:47 465 | msgid "u with horn [u+]" 466 | msgstr "" 467 | -------------------------------------------------------------------------------- /po/ja.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the fcitx5-unikey package. 4 | # 5 | # Translators: 6 | # csslayer , 2018 7 | # Takuro Onoue , 2020 8 | # 9 | msgid "" 10 | msgstr "" 11 | "Project-Id-Version: fcitx5-unikey\n" 12 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 13 | "POT-Creation-Date: 2023-01-04 20:25+0000\n" 14 | "PO-Revision-Date: 2018-06-12 22:55+0000\n" 15 | "Last-Translator: Takuro Onoue , 2020\n" 16 | "Language-Team: Japanese (https://www.transifex.com/fcitx/teams/12005/ja/)\n" 17 | "Language: ja\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Plural-Forms: nplurals=1; plural=0;\n" 22 | 23 | #. i18n: file: macro-editor/editor.ui:36 24 | #. i18n: ectx: property (text), widget (QPushButton, addButton) 25 | #: rc.cpp:60 26 | #, kde-format 27 | msgid "&Add" 28 | msgstr "追加 (&A)" 29 | 30 | #. i18n: file: keymap-editor/editor.ui:128 31 | #. i18n: ectx: property (text), widget (QPushButton, addButton) 32 | #: rc.cpp:27 33 | #, kde-format 34 | msgid "&Add / Update" 35 | msgstr "" 36 | 37 | #. i18n: file: keymap-editor/editor.ui:161 38 | #. i18n: ectx: property (text), widget (QPushButton, deleteButton) 39 | #. i18n: file: macro-editor/editor.ui:47 40 | #. i18n: ectx: property (text), widget (QPushButton, deleteButton) 41 | #: rc.cpp:36 rc.cpp:63 42 | #, kde-format 43 | msgid "&Delete" 44 | msgstr "削除 (&D)" 45 | 46 | #. i18n: file: keymap-editor/editor.ui:201 47 | #. i18n: ectx: property (text), widget (QPushButton, exportButton) 48 | #. i18n: file: macro-editor/editor.ui:87 49 | #. i18n: ectx: property (text), widget (QPushButton, exportButton) 50 | #: rc.cpp:45 rc.cpp:72 51 | #, kde-format 52 | msgid "&Export" 53 | msgstr "エクスポート (&E)" 54 | 55 | #. i18n: file: keymap-editor/editor.ui:190 56 | #. i18n: ectx: property (text), widget (QPushButton, importButton) 57 | #. i18n: file: macro-editor/editor.ui:76 58 | #. i18n: ectx: property (text), widget (QPushButton, importButton) 59 | #: rc.cpp:42 rc.cpp:69 60 | #, kde-format 61 | msgid "&Import" 62 | msgstr "インポート (&I)" 63 | 64 | #. i18n: file: keymap-editor/editor.ui:47 65 | #. i18n: ectx: property (text), widget (QPushButton, loadButton) 66 | #: rc.cpp:12 67 | #, kde-format 68 | msgid "&Load" 69 | msgstr "" 70 | 71 | #: keymap-editor/actions.cpp:38 72 | msgid "A with breve [A(]" 73 | msgstr "" 74 | 75 | #: keymap-editor/actions.cpp:36 76 | msgid "A with circumflex [A^]" 77 | msgstr "" 78 | 79 | #. i18n: file: keymap-editor/editor.ui:84 80 | #. i18n: ectx: property (text), widget (QLabel, label_4) 81 | #: rc.cpp:21 82 | #, kde-format 83 | msgid "Action:" 84 | msgstr "" 85 | 86 | #: src/unikey-config.h:60 87 | msgid "Allow to modify surrounding text (experimental)" 88 | msgstr "" 89 | 90 | #: src/unikey-config.h:54 91 | msgid "Allow type with more freedom" 92 | msgstr "" 93 | 94 | #: src/unikey-config.h:49 95 | msgid "Auto restore keys with invalid words" 96 | msgstr "" 97 | 98 | #: src/unikey-config.h:29 99 | msgid "BK HCM 2" 100 | msgstr "" 101 | 102 | #: keymap-editor/actions.cpp:30 103 | msgid "Breve: A becomes A(" 104 | msgstr "" 105 | 106 | #. i18n: file: keymap-editor/editor.ui:24 107 | #. i18n: ectx: property (title), widget (QGroupBox, groupBox) 108 | #: rc.cpp:6 109 | #, kde-format 110 | msgid "Built-in Input Methods" 111 | msgstr "" 112 | 113 | #: src/unikey-config.h:30 114 | msgid "CString" 115 | msgstr "" 116 | 117 | #. i18n: file: keymap-editor/editor.ui:67 118 | #. i18n: ectx: property (text), widget (QLabel, label_3) 119 | #: rc.cpp:18 120 | #, kde-format 121 | msgid "Category:" 122 | msgstr "" 123 | 124 | #: keymap-editor/editor.cpp:58 125 | msgid "Character complements" 126 | msgstr "" 127 | 128 | #: keymap-editor/actions.cpp:20 129 | msgid "Circumflex for all applicable characters" 130 | msgstr "" 131 | 132 | #: keymap-editor/actions.cpp:22 133 | msgid "Circumflex: A becomes A^" 134 | msgstr "" 135 | 136 | #: keymap-editor/actions.cpp:23 137 | msgid "Circumflex: E becomes E^" 138 | msgstr "" 139 | 140 | #: keymap-editor/actions.cpp:24 141 | msgid "Circumflex: O becomes O^" 142 | msgstr "" 143 | 144 | #: keymap-editor/actions.cpp:34 145 | msgid "D with stroke [-D]" 146 | msgstr "" 147 | 148 | #. i18n: file: keymap-editor/editor.ui:172 149 | #. i18n: ectx: property (text), widget (QPushButton, clearButton) 150 | #. i18n: file: macro-editor/editor.ui:58 151 | #. i18n: ectx: property (text), widget (QPushButton, clearButton) 152 | #: rc.cpp:39 rc.cpp:66 153 | #, kde-format 154 | msgid "De&lete All" 155 | msgstr "全削除 (&l)" 156 | 157 | #. i18n: file: macro-editor/dialog.ui:14 158 | #. i18n: ectx: property (windowTitle), widget (QDialog, Dialog) 159 | #: rc.cpp:48 160 | #, kde-format 161 | msgid "Dialog" 162 | msgstr "ダイアログ" 163 | 164 | #: keymap-editor/actions.cpp:40 165 | msgid "E with circumflex [E^]" 166 | msgstr "" 167 | 168 | #: src/unikey-config.h:45 169 | msgid "Enable Macro" 170 | msgstr "" 171 | 172 | #: src/unikey-config.h:44 173 | msgid "Enable spell check" 174 | msgstr "" 175 | 176 | #: keymap-editor/actions.cpp:19 177 | msgid "Escape key" 178 | msgstr "" 179 | 180 | #: keymap-editor/actions.cpp:25 181 | msgid "Horn-Breve: U, O, A, become U+, O+, A(" 182 | msgstr "" 183 | 184 | #: keymap-editor/actions.cpp:32 185 | msgid "Horn-Breve: U, O, A, become U+, O+, A(, or create U+" 186 | msgstr "" 187 | 188 | #: keymap-editor/actions.cpp:29 189 | msgid "Horn: O becomes O+" 190 | msgstr "" 191 | 192 | #: keymap-editor/actions.cpp:28 193 | msgid "Horn: U becomes U+" 194 | msgstr "" 195 | 196 | #: keymap-editor/actions.cpp:27 197 | msgid "Horn: U, O become U+, O+" 198 | msgstr "" 199 | 200 | #: src/unikey-config.h:41 src/unikey-im.cpp:331 201 | msgid "Input Method" 202 | msgstr "" 203 | 204 | #. i18n: file: keymap-editor/editor.ui:30 205 | #. i18n: ectx: property (text), widget (QLabel, label) 206 | #: rc.cpp:9 207 | #, kde-format 208 | msgid "Input Method:" 209 | msgstr "" 210 | 211 | #. i18n: file: keymap-editor/editor.ui:101 212 | #. i18n: ectx: property (text), widget (QLabel, label_2) 213 | #: rc.cpp:24 214 | #, kde-format 215 | msgid "Key" 216 | msgstr "" 217 | 218 | #. i18n: file: keymap-editor/editor.ui:61 219 | #. i18n: ectx: property (title), widget (QGroupBox, groupBox_2) 220 | #: rc.cpp:15 221 | #, kde-format 222 | msgid "Key definition" 223 | msgstr "" 224 | 225 | #: keymap-editor/model.cpp:32 226 | msgid "Keymap" 227 | msgstr "" 228 | 229 | #: src/unikey-config.h:66 230 | msgid "Keymap Editor" 231 | msgstr "" 232 | 233 | #: macro-editor/model.cpp:27 src/unikey-im.cpp:394 234 | msgid "Macro" 235 | msgstr "" 236 | 237 | #: src/unikey-im.cpp:645 238 | msgid "Macro Disabled" 239 | msgstr "" 240 | 241 | #: src/unikey-config.h:64 242 | msgid "Macro Editor" 243 | msgstr "" 244 | 245 | #: src/unikey-im.cpp:644 246 | msgid "Macro Enabled" 247 | msgstr "" 248 | 249 | #. i18n: file: macro-editor/dialog.ui:32 250 | #. i18n: ectx: property (text), widget (QLabel, label_2) 251 | #: rc.cpp:54 252 | #, kde-format 253 | msgid "Macro:" 254 | msgstr "マクロ:" 255 | 256 | #: keymap-editor/editor.cpp:53 src/unikey-config.h:34 257 | msgid "Microsoft Vietnamese" 258 | msgstr "" 259 | 260 | #. i18n: file: keymap-editor/editor.ui:150 261 | #. i18n: ectx: property (text), widget (QPushButton, moveDownButton) 262 | #: rc.cpp:33 263 | #, kde-format 264 | msgid "Move &Down" 265 | msgstr "" 266 | 267 | #. i18n: file: keymap-editor/editor.ui:139 268 | #. i18n: ectx: property (text), widget (QPushButton, moveUpButton) 269 | #: rc.cpp:30 270 | #, kde-format 271 | msgid "Move &Up" 272 | msgstr "" 273 | 274 | #: src/unikey-config.h:30 275 | msgid "NCR Decimal" 276 | msgstr "" 277 | 278 | #: src/unikey-config.h:31 279 | msgid "NCR Hex" 280 | msgstr "" 281 | 282 | #: keymap-editor/actions.cpp:42 283 | msgid "O with circumflex [O^]" 284 | msgstr "" 285 | 286 | #: keymap-editor/actions.cpp:44 287 | msgid "O with horn [O+]" 288 | msgstr "" 289 | 290 | #: src/unikey-config.h:43 291 | msgid "Output Charset" 292 | msgstr "" 293 | 294 | #: src/unikey-im.cpp:357 295 | msgid "Output charset" 296 | msgstr "" 297 | 298 | #: src/unikey-config.h:47 299 | msgid "Process W at word begin" 300 | msgstr "" 301 | 302 | #: keymap-editor/actions.cpp:13 303 | msgid "Remove existing tone" 304 | msgstr "" 305 | 306 | #: src/unikey-config.h:57 307 | msgid "Restore typing state from surrounding text" 308 | msgstr "" 309 | 310 | #: keymap-editor/editor.cpp:54 src/unikey-config.h:35 311 | msgid "Simple Telex" 312 | msgstr "" 313 | 314 | #: keymap-editor/editor.cpp:55 src/unikey-config.h:36 315 | msgid "Simple Telex2" 316 | msgstr "" 317 | 318 | #: src/unikey-im.cpp:653 319 | msgid "Spell Check Disabled" 320 | msgstr "" 321 | 322 | #: src/unikey-im.cpp:652 323 | msgid "Spell Check Enabled" 324 | msgstr "" 325 | 326 | #: src/unikey-im.cpp:382 327 | msgid "Spell check" 328 | msgstr "" 329 | 330 | #: keymap-editor/actions.cpp:31 331 | msgid "Stroke: D becomes -D" 332 | msgstr "" 333 | 334 | #: src/unikey-config.h:28 335 | msgid "TCVN3" 336 | msgstr "" 337 | 338 | #: keymap-editor/editor.cpp:50 src/unikey-config.h:33 339 | msgid "Telex" 340 | msgstr "" 341 | 342 | #: keymap-editor/actions.cpp:14 343 | msgid "Tone ' (acute)" 344 | msgstr "" 345 | 346 | #: keymap-editor/actions.cpp:18 347 | msgid "Tone . (dot below)" 348 | msgstr "" 349 | 350 | #: keymap-editor/actions.cpp:15 351 | msgid "Tone ` (grave)" 352 | msgstr "" 353 | 354 | #: keymap-editor/editor.cpp:57 355 | msgid "Tone marks" 356 | msgstr "" 357 | 358 | #: keymap-editor/actions.cpp:17 359 | msgid "Tone ~ (tilde)" 360 | msgstr "" 361 | 362 | #: keymap-editor/actions.cpp:16 363 | msgid "Tone ◌̉ (hook above)" 364 | msgstr "" 365 | 366 | #: keymap-editor/actions.cpp:46 367 | msgid "U with horn [U+]" 368 | msgstr "" 369 | 370 | #: src/unikey-config.h:62 371 | msgid "Underline the preedit text" 372 | msgstr "" 373 | 374 | #: src/unikey-config.h:28 375 | msgid "Unicode" 376 | msgstr "" 377 | 378 | #: org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in:7 src/unikey.conf.in:3 379 | msgid "Unikey" 380 | msgstr "Unikey" 381 | 382 | #. i18n: file: keymap-editor/editor.ui:14 383 | #. i18n: ectx: property (windowTitle), widget (QWidget, Editor) 384 | #: keymap-editor/editor.cpp:103 rc.cpp:3 385 | #, kde-format 386 | msgid "Unikey Keymap Editor" 387 | msgstr "" 388 | 389 | #. i18n: file: macro-editor/editor.ui:14 390 | #. i18n: ectx: property (windowTitle), widget (QWidget, Editor) 391 | #: macro-editor/editor.cpp:52 rc.cpp:57 392 | #, kde-format 393 | msgid "Unikey Macro Editor" 394 | msgstr "Unikey マクロエディター" 395 | 396 | #: src/unikey-addon.conf.in.in:3 397 | msgid "Unikey Wrapper For Fcitx" 398 | msgstr "Fcitx 用 Unikey ラッパー" 399 | 400 | #: src/unikey-config.h:52 401 | msgid "Use oà, _uý (instead of òa, úy)" 402 | msgstr "" 403 | 404 | #: src/unikey-config.h:35 405 | msgid "UserIM" 406 | msgstr "" 407 | 408 | #: keymap-editor/editor.cpp:52 src/unikey-config.h:29 src/unikey-config.h:34 409 | msgid "VIQR" 410 | msgstr "" 411 | 412 | #: keymap-editor/editor.cpp:51 src/unikey-config.h:33 413 | msgid "VNI" 414 | msgstr "" 415 | 416 | #: src/unikey-config.h:29 417 | msgid "VNI Win" 418 | msgstr "" 419 | 420 | #: keymap-editor/editor.cpp:59 421 | msgid "Vietnamese characters" 422 | msgstr "" 423 | 424 | #: org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in:8 425 | msgid "Vietnamese input method" 426 | msgstr "ベトナム語入力メソッド" 427 | 428 | #: keymap-editor/model.cpp:34 macro-editor/model.cpp:29 429 | msgid "Word" 430 | msgstr "" 431 | 432 | #. i18n: file: macro-editor/dialog.ui:25 433 | #. i18n: ectx: property (text), widget (QLabel, label) 434 | #: rc.cpp:51 435 | #, kde-format 436 | msgid "Word:" 437 | msgstr "単語:" 438 | 439 | #: keymap-editor/actions.cpp:39 440 | msgid "a with breve [a(]" 441 | msgstr "" 442 | 443 | #: keymap-editor/actions.cpp:37 444 | msgid "a with circumflex [a^]" 445 | msgstr "" 446 | 447 | #: keymap-editor/actions.cpp:35 448 | msgid "d with stroke [-d]" 449 | msgstr "" 450 | 451 | #: keymap-editor/actions.cpp:41 452 | msgid "e with circumflex [e^]" 453 | msgstr "" 454 | 455 | #: keymap-editor/actions.cpp:43 456 | msgid "o with circumflex [o^]" 457 | msgstr "" 458 | 459 | #: keymap-editor/actions.cpp:45 460 | msgid "o with horn [o+]" 461 | msgstr "" 462 | 463 | #: keymap-editor/actions.cpp:47 464 | msgid "u with horn [u+]" 465 | msgstr "" 466 | -------------------------------------------------------------------------------- /po/tr.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the fcitx5-unikey package. 4 | # 5 | # Translators: 6 | # csslayer , 2018 7 | # abc Def , 2021 8 | # 9 | msgid "" 10 | msgstr "" 11 | "Project-Id-Version: fcitx5-unikey\n" 12 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 13 | "POT-Creation-Date: 2023-01-04 20:25+0000\n" 14 | "PO-Revision-Date: 2018-06-12 22:55+0000\n" 15 | "Last-Translator: abc Def , 2021\n" 16 | "Language-Team: Turkish (https://www.transifex.com/fcitx/teams/12005/tr/)\n" 17 | "Language: tr\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 22 | 23 | #. i18n: file: macro-editor/editor.ui:36 24 | #. i18n: ectx: property (text), widget (QPushButton, addButton) 25 | #: rc.cpp:60 26 | #, kde-format 27 | msgid "&Add" 28 | msgstr "&Ekle" 29 | 30 | #. i18n: file: keymap-editor/editor.ui:128 31 | #. i18n: ectx: property (text), widget (QPushButton, addButton) 32 | #: rc.cpp:27 33 | #, kde-format 34 | msgid "&Add / Update" 35 | msgstr "" 36 | 37 | #. i18n: file: keymap-editor/editor.ui:161 38 | #. i18n: ectx: property (text), widget (QPushButton, deleteButton) 39 | #. i18n: file: macro-editor/editor.ui:47 40 | #. i18n: ectx: property (text), widget (QPushButton, deleteButton) 41 | #: rc.cpp:36 rc.cpp:63 42 | #, kde-format 43 | msgid "&Delete" 44 | msgstr "&Sil" 45 | 46 | #. i18n: file: keymap-editor/editor.ui:201 47 | #. i18n: ectx: property (text), widget (QPushButton, exportButton) 48 | #. i18n: file: macro-editor/editor.ui:87 49 | #. i18n: ectx: property (text), widget (QPushButton, exportButton) 50 | #: rc.cpp:45 rc.cpp:72 51 | #, kde-format 52 | msgid "&Export" 53 | msgstr "&Dışarı Aktar" 54 | 55 | #. i18n: file: keymap-editor/editor.ui:190 56 | #. i18n: ectx: property (text), widget (QPushButton, importButton) 57 | #. i18n: file: macro-editor/editor.ui:76 58 | #. i18n: ectx: property (text), widget (QPushButton, importButton) 59 | #: rc.cpp:42 rc.cpp:69 60 | #, kde-format 61 | msgid "&Import" 62 | msgstr "&İçeri Aktar" 63 | 64 | #. i18n: file: keymap-editor/editor.ui:47 65 | #. i18n: ectx: property (text), widget (QPushButton, loadButton) 66 | #: rc.cpp:12 67 | #, kde-format 68 | msgid "&Load" 69 | msgstr "" 70 | 71 | #: keymap-editor/actions.cpp:38 72 | msgid "A with breve [A(]" 73 | msgstr "" 74 | 75 | #: keymap-editor/actions.cpp:36 76 | msgid "A with circumflex [A^]" 77 | msgstr "" 78 | 79 | #. i18n: file: keymap-editor/editor.ui:84 80 | #. i18n: ectx: property (text), widget (QLabel, label_4) 81 | #: rc.cpp:21 82 | #, kde-format 83 | msgid "Action:" 84 | msgstr "" 85 | 86 | #: src/unikey-config.h:60 87 | msgid "Allow to modify surrounding text (experimental)" 88 | msgstr "" 89 | 90 | #: src/unikey-config.h:54 91 | msgid "Allow type with more freedom" 92 | msgstr "" 93 | 94 | #: src/unikey-config.h:49 95 | msgid "Auto restore keys with invalid words" 96 | msgstr "" 97 | 98 | #: src/unikey-config.h:29 99 | msgid "BK HCM 2" 100 | msgstr "" 101 | 102 | #: keymap-editor/actions.cpp:30 103 | msgid "Breve: A becomes A(" 104 | msgstr "" 105 | 106 | #. i18n: file: keymap-editor/editor.ui:24 107 | #. i18n: ectx: property (title), widget (QGroupBox, groupBox) 108 | #: rc.cpp:6 109 | #, kde-format 110 | msgid "Built-in Input Methods" 111 | msgstr "" 112 | 113 | #: src/unikey-config.h:30 114 | msgid "CString" 115 | msgstr "" 116 | 117 | #. i18n: file: keymap-editor/editor.ui:67 118 | #. i18n: ectx: property (text), widget (QLabel, label_3) 119 | #: rc.cpp:18 120 | #, kde-format 121 | msgid "Category:" 122 | msgstr "" 123 | 124 | #: keymap-editor/editor.cpp:58 125 | msgid "Character complements" 126 | msgstr "" 127 | 128 | #: keymap-editor/actions.cpp:20 129 | msgid "Circumflex for all applicable characters" 130 | msgstr "" 131 | 132 | #: keymap-editor/actions.cpp:22 133 | msgid "Circumflex: A becomes A^" 134 | msgstr "" 135 | 136 | #: keymap-editor/actions.cpp:23 137 | msgid "Circumflex: E becomes E^" 138 | msgstr "" 139 | 140 | #: keymap-editor/actions.cpp:24 141 | msgid "Circumflex: O becomes O^" 142 | msgstr "" 143 | 144 | #: keymap-editor/actions.cpp:34 145 | msgid "D with stroke [-D]" 146 | msgstr "" 147 | 148 | #. i18n: file: keymap-editor/editor.ui:172 149 | #. i18n: ectx: property (text), widget (QPushButton, clearButton) 150 | #. i18n: file: macro-editor/editor.ui:58 151 | #. i18n: ectx: property (text), widget (QPushButton, clearButton) 152 | #: rc.cpp:39 rc.cpp:66 153 | #, kde-format 154 | msgid "De&lete All" 155 | msgstr "&Tümünü Sil" 156 | 157 | #. i18n: file: macro-editor/dialog.ui:14 158 | #. i18n: ectx: property (windowTitle), widget (QDialog, Dialog) 159 | #: rc.cpp:48 160 | #, kde-format 161 | msgid "Dialog" 162 | msgstr "" 163 | 164 | #: keymap-editor/actions.cpp:40 165 | msgid "E with circumflex [E^]" 166 | msgstr "" 167 | 168 | #: src/unikey-config.h:45 169 | msgid "Enable Macro" 170 | msgstr "" 171 | 172 | #: src/unikey-config.h:44 173 | msgid "Enable spell check" 174 | msgstr "" 175 | 176 | #: keymap-editor/actions.cpp:19 177 | msgid "Escape key" 178 | msgstr "" 179 | 180 | #: keymap-editor/actions.cpp:25 181 | msgid "Horn-Breve: U, O, A, become U+, O+, A(" 182 | msgstr "" 183 | 184 | #: keymap-editor/actions.cpp:32 185 | msgid "Horn-Breve: U, O, A, become U+, O+, A(, or create U+" 186 | msgstr "" 187 | 188 | #: keymap-editor/actions.cpp:29 189 | msgid "Horn: O becomes O+" 190 | msgstr "" 191 | 192 | #: keymap-editor/actions.cpp:28 193 | msgid "Horn: U becomes U+" 194 | msgstr "" 195 | 196 | #: keymap-editor/actions.cpp:27 197 | msgid "Horn: U, O become U+, O+" 198 | msgstr "" 199 | 200 | #: src/unikey-config.h:41 src/unikey-im.cpp:331 201 | msgid "Input Method" 202 | msgstr "" 203 | 204 | #. i18n: file: keymap-editor/editor.ui:30 205 | #. i18n: ectx: property (text), widget (QLabel, label) 206 | #: rc.cpp:9 207 | #, kde-format 208 | msgid "Input Method:" 209 | msgstr "" 210 | 211 | #. i18n: file: keymap-editor/editor.ui:101 212 | #. i18n: ectx: property (text), widget (QLabel, label_2) 213 | #: rc.cpp:24 214 | #, kde-format 215 | msgid "Key" 216 | msgstr "" 217 | 218 | #. i18n: file: keymap-editor/editor.ui:61 219 | #. i18n: ectx: property (title), widget (QGroupBox, groupBox_2) 220 | #: rc.cpp:15 221 | #, kde-format 222 | msgid "Key definition" 223 | msgstr "" 224 | 225 | #: keymap-editor/model.cpp:32 226 | msgid "Keymap" 227 | msgstr "" 228 | 229 | #: src/unikey-config.h:66 230 | msgid "Keymap Editor" 231 | msgstr "" 232 | 233 | #: macro-editor/model.cpp:27 src/unikey-im.cpp:394 234 | msgid "Macro" 235 | msgstr "" 236 | 237 | #: src/unikey-im.cpp:645 238 | msgid "Macro Disabled" 239 | msgstr "" 240 | 241 | #: src/unikey-config.h:64 242 | msgid "Macro Editor" 243 | msgstr "" 244 | 245 | #: src/unikey-im.cpp:644 246 | msgid "Macro Enabled" 247 | msgstr "" 248 | 249 | #. i18n: file: macro-editor/dialog.ui:32 250 | #. i18n: ectx: property (text), widget (QLabel, label_2) 251 | #: rc.cpp:54 252 | #, kde-format 253 | msgid "Macro:" 254 | msgstr "Makro:" 255 | 256 | #: keymap-editor/editor.cpp:53 src/unikey-config.h:34 257 | msgid "Microsoft Vietnamese" 258 | msgstr "" 259 | 260 | #. i18n: file: keymap-editor/editor.ui:150 261 | #. i18n: ectx: property (text), widget (QPushButton, moveDownButton) 262 | #: rc.cpp:33 263 | #, kde-format 264 | msgid "Move &Down" 265 | msgstr "" 266 | 267 | #. i18n: file: keymap-editor/editor.ui:139 268 | #. i18n: ectx: property (text), widget (QPushButton, moveUpButton) 269 | #: rc.cpp:30 270 | #, kde-format 271 | msgid "Move &Up" 272 | msgstr "" 273 | 274 | #: src/unikey-config.h:30 275 | msgid "NCR Decimal" 276 | msgstr "" 277 | 278 | #: src/unikey-config.h:31 279 | msgid "NCR Hex" 280 | msgstr "" 281 | 282 | #: keymap-editor/actions.cpp:42 283 | msgid "O with circumflex [O^]" 284 | msgstr "" 285 | 286 | #: keymap-editor/actions.cpp:44 287 | msgid "O with horn [O+]" 288 | msgstr "" 289 | 290 | #: src/unikey-config.h:43 291 | msgid "Output Charset" 292 | msgstr "" 293 | 294 | #: src/unikey-im.cpp:357 295 | msgid "Output charset" 296 | msgstr "" 297 | 298 | #: src/unikey-config.h:47 299 | msgid "Process W at word begin" 300 | msgstr "" 301 | 302 | #: keymap-editor/actions.cpp:13 303 | msgid "Remove existing tone" 304 | msgstr "" 305 | 306 | #: src/unikey-config.h:57 307 | msgid "Restore typing state from surrounding text" 308 | msgstr "" 309 | 310 | #: keymap-editor/editor.cpp:54 src/unikey-config.h:35 311 | msgid "Simple Telex" 312 | msgstr "" 313 | 314 | #: keymap-editor/editor.cpp:55 src/unikey-config.h:36 315 | msgid "Simple Telex2" 316 | msgstr "" 317 | 318 | #: src/unikey-im.cpp:653 319 | msgid "Spell Check Disabled" 320 | msgstr "" 321 | 322 | #: src/unikey-im.cpp:652 323 | msgid "Spell Check Enabled" 324 | msgstr "" 325 | 326 | #: src/unikey-im.cpp:382 327 | msgid "Spell check" 328 | msgstr "" 329 | 330 | #: keymap-editor/actions.cpp:31 331 | msgid "Stroke: D becomes -D" 332 | msgstr "" 333 | 334 | #: src/unikey-config.h:28 335 | msgid "TCVN3" 336 | msgstr "" 337 | 338 | #: keymap-editor/editor.cpp:50 src/unikey-config.h:33 339 | msgid "Telex" 340 | msgstr "" 341 | 342 | #: keymap-editor/actions.cpp:14 343 | msgid "Tone ' (acute)" 344 | msgstr "" 345 | 346 | #: keymap-editor/actions.cpp:18 347 | msgid "Tone . (dot below)" 348 | msgstr "" 349 | 350 | #: keymap-editor/actions.cpp:15 351 | msgid "Tone ` (grave)" 352 | msgstr "" 353 | 354 | #: keymap-editor/editor.cpp:57 355 | msgid "Tone marks" 356 | msgstr "" 357 | 358 | #: keymap-editor/actions.cpp:17 359 | msgid "Tone ~ (tilde)" 360 | msgstr "" 361 | 362 | #: keymap-editor/actions.cpp:16 363 | msgid "Tone ◌̉ (hook above)" 364 | msgstr "" 365 | 366 | #: keymap-editor/actions.cpp:46 367 | msgid "U with horn [U+]" 368 | msgstr "" 369 | 370 | #: src/unikey-config.h:62 371 | msgid "Underline the preedit text" 372 | msgstr "" 373 | 374 | #: src/unikey-config.h:28 375 | msgid "Unicode" 376 | msgstr "" 377 | 378 | #: org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in:7 src/unikey.conf.in:3 379 | msgid "Unikey" 380 | msgstr "Unikey" 381 | 382 | #. i18n: file: keymap-editor/editor.ui:14 383 | #. i18n: ectx: property (windowTitle), widget (QWidget, Editor) 384 | #: keymap-editor/editor.cpp:103 rc.cpp:3 385 | #, kde-format 386 | msgid "Unikey Keymap Editor" 387 | msgstr "" 388 | 389 | #. i18n: file: macro-editor/editor.ui:14 390 | #. i18n: ectx: property (windowTitle), widget (QWidget, Editor) 391 | #: macro-editor/editor.cpp:52 rc.cpp:57 392 | #, kde-format 393 | msgid "Unikey Macro Editor" 394 | msgstr "Unikey Makro Editör" 395 | 396 | #: src/unikey-addon.conf.in.in:3 397 | msgid "Unikey Wrapper For Fcitx" 398 | msgstr "Fcitx için Unikey Wrapper" 399 | 400 | #: src/unikey-config.h:52 401 | msgid "Use oà, _uý (instead of òa, úy)" 402 | msgstr "" 403 | 404 | #: src/unikey-config.h:35 405 | msgid "UserIM" 406 | msgstr "" 407 | 408 | #: keymap-editor/editor.cpp:52 src/unikey-config.h:29 src/unikey-config.h:34 409 | msgid "VIQR" 410 | msgstr "" 411 | 412 | #: keymap-editor/editor.cpp:51 src/unikey-config.h:33 413 | msgid "VNI" 414 | msgstr "" 415 | 416 | #: src/unikey-config.h:29 417 | msgid "VNI Win" 418 | msgstr "" 419 | 420 | #: keymap-editor/editor.cpp:59 421 | msgid "Vietnamese characters" 422 | msgstr "" 423 | 424 | #: org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in:8 425 | msgid "Vietnamese input method" 426 | msgstr "Vietnamca giriş yöntemi" 427 | 428 | #: keymap-editor/model.cpp:34 macro-editor/model.cpp:29 429 | msgid "Word" 430 | msgstr "" 431 | 432 | #. i18n: file: macro-editor/dialog.ui:25 433 | #. i18n: ectx: property (text), widget (QLabel, label) 434 | #: rc.cpp:51 435 | #, kde-format 436 | msgid "Word:" 437 | msgstr "Sözcük:" 438 | 439 | #: keymap-editor/actions.cpp:39 440 | msgid "a with breve [a(]" 441 | msgstr "" 442 | 443 | #: keymap-editor/actions.cpp:37 444 | msgid "a with circumflex [a^]" 445 | msgstr "" 446 | 447 | #: keymap-editor/actions.cpp:35 448 | msgid "d with stroke [-d]" 449 | msgstr "" 450 | 451 | #: keymap-editor/actions.cpp:41 452 | msgid "e with circumflex [e^]" 453 | msgstr "" 454 | 455 | #: keymap-editor/actions.cpp:43 456 | msgid "o with circumflex [o^]" 457 | msgstr "" 458 | 459 | #: keymap-editor/actions.cpp:45 460 | msgid "o with horn [o+]" 461 | msgstr "" 462 | 463 | #: keymap-editor/actions.cpp:47 464 | msgid "u with horn [u+]" 465 | msgstr "" 466 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set( fcitx_unikey_sources 3 | unikey-im.cpp 4 | ) 5 | 6 | add_fcitx5_addon(unikey ${fcitx_unikey_sources}) 7 | target_link_libraries(unikey Fcitx5::Core Fcitx5::Config unikey-lib) 8 | target_include_directories(unikey PRIVATE ${PROJECT_BINARY_DIR}) 9 | if (ENABLE_QT) 10 | target_compile_definitions(unikey PRIVATE "-DENABLE_QT") 11 | endif() 12 | install(TARGETS unikey DESTINATION "${CMAKE_INSTALL_LIBDIR}/fcitx5") 13 | fcitx5_translate_desktop_file(unikey.conf.in unikey.conf) 14 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/unikey.conf" DESTINATION "${CMAKE_INSTALL_DATADIR}/fcitx5/inputmethod" COMPONENT config) 15 | configure_file(unikey-addon.conf.in.in unikey-addon.conf.in) 16 | fcitx5_translate_desktop_file("${CMAKE_CURRENT_BINARY_DIR}/unikey-addon.conf.in" unikey-addon.conf) 17 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/unikey-addon.conf" RENAME unikey.conf DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) 18 | -------------------------------------------------------------------------------- /src/unikey-addon.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=Unikey Wrapper For Fcitx 3 | Category=InputMethod 4 | Version=@PROJECT_VERSION@ 5 | Enabled=True 6 | Library=libunikey 7 | Type=SharedLibrary 8 | OnDemand=True 9 | Configurable=True 10 | 11 | [Addon/Dependencies] 12 | 0=core:@REQUIRED_FCITX_VERSION@ 13 | -------------------------------------------------------------------------------- /src/unikey-config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2018-2018 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #ifndef _FCITX5_UNIKEY_UNIKEY_CONFIG_H_ 8 | #define _FCITX5_UNIKEY_UNIKEY_CONFIG_H_ 9 | 10 | #include "keycons.h" 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | namespace fcitx { 17 | 18 | enum class UkConv { 19 | XUTF8, 20 | TCVN3, 21 | VNIWIN, 22 | VIQR, 23 | BKHCM2, 24 | UNI_CSTRING, 25 | UNIREF, 26 | UNIREF_HEX 27 | }; 28 | 29 | FCITX_CONFIG_ENUM_NAME_WITH_I18N(UkConv, N_("Unicode"), N_("TCVN3"), 30 | N_("VNI Win"), N_("VIQR"), N_("BK HCM 2"), 31 | N_("CString"), N_("NCR Decimal"), 32 | N_("NCR Hex")); 33 | 34 | FCITX_CONFIG_ENUM_NAME_WITH_I18N(UkInputMethod, N_("Telex"), N_("VNI"), 35 | N_("VIQR"), N_("Microsoft Vietnamese"), 36 | N_("UserIM"), N_("Simple Telex"), 37 | N_("Simple Telex2")); 38 | 39 | FCITX_CONFIGURATION( 40 | UnikeyConfig, 41 | OptionWithAnnotation im{ 42 | this, "InputMethod", _("Input Method"), UkTelex}; 43 | OptionWithAnnotation oc{ 44 | this, "OutputCharset", _("Output Charset"), UkConv::XUTF8}; 45 | Option spellCheck{this, "SpellCheck", _("Enable spell check"), true}; 46 | Option macro{this, "Macro", _("Enable Macro"), true}; 47 | Option process_w_at_begin{this, "ProcessWAtBegin", 48 | _("Process W at word begin"), true}; 49 | Option autoNonVnRestore{this, "AutoNonVnRestore", 50 | _("Auto restore keys with invalid words"), 51 | true}; 52 | Option modernStyle{this, "ModernStyle", 53 | _("Use oà, _uý (instead of òa, úy)"), false}; 54 | Option freeMarking{this, "FreeMarking", 55 | _("Allow type with more freedom"), true}; 56 | Option surroundingText{ 57 | this, "SurroundingText", 58 | _("Restore typing state from surrounding text"), true}; 59 | Option modifySurroundingText{ 60 | this, "ModifySurroundingText", 61 | _("Allow to modify surrounding text (experimental)"), false}; 62 | Option displayUnderline{this, "DisplayUnderline", 63 | _("Underline the preedit text"), true}; 64 | #ifdef ENABLE_QT 65 | ExternalOption macroEditor{this, "MacroEditor", _("Macro Editor"), 66 | "fcitx://config/addon/unikey/macro"}; 67 | ExternalOption keymapEditor{this, "KeymapEditor", _("Keymap Editor"), 68 | "fcitx://config/addon/unikey/keymap.txt"}; 69 | #endif 70 | ); 71 | } // namespace fcitx 72 | 73 | #endif // _FCITX5_UNIKEY_UNIKEY_CONFIG_H_ 74 | -------------------------------------------------------------------------------- /src/unikey-im.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2018-2018 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #ifndef _FCITX5_UNIKEY_UNIKEY_IM_H_ 8 | #define _FCITX5_UNIKEY_UNIKEY_IM_H_ 9 | 10 | #include "unikey-config.h" 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace fcitx { 31 | 32 | class UnikeyState; 33 | 34 | class UnikeyEngine final : public InputMethodEngine { 35 | public: 36 | UnikeyEngine(Instance *instance); 37 | ~UnikeyEngine(); 38 | Instance *instance() { return instance_; } 39 | 40 | const Configuration *getConfig() const override { return &config_; } 41 | void setConfig(const RawConfig &config) override { 42 | config_.load(config, true); 43 | safeSaveAsIni(config_, "conf/unikey.conf"); 44 | populateConfig(); 45 | } 46 | 47 | void setSubConfig(const std::string &path, 48 | const fcitx::RawConfig & /*unused*/) override { 49 | if (path == "macro") { 50 | reloadMacroTable(); 51 | } else if (path == "keymap.txt") { 52 | reloadKeymap(); 53 | // Need to populate again if old keymap is not valid. 54 | populateConfig(); 55 | } 56 | } 57 | 58 | void activate(const InputMethodEntry &entry, 59 | InputContextEvent &event) override; 60 | void keyEvent(const InputMethodEntry &entry, KeyEvent &keyEvent) override; 61 | void reloadConfig() override; 62 | void reset(const InputMethodEntry &entry, 63 | InputContextEvent &event) override; 64 | void deactivate(const fcitx::InputMethodEntry & /*entry*/, 65 | fcitx::InputContextEvent &event) override; 66 | void save() override; 67 | auto &factory() { return factory_; } 68 | auto &config() { return config_; } 69 | 70 | void updateUI(InputContext *ic); 71 | void updateMacroAction(InputContext *ic); 72 | void updateSpellAction(InputContext *ic); 73 | void updateCharsetAction(InputContext *ic); 74 | void updateInputMethodAction(InputContext *ic); 75 | 76 | std::string subMode(const InputMethodEntry & /*entry*/, 77 | InputContext & /*inputContext*/) override; 78 | 79 | UnikeyInputMethod *im() { return &im_; } 80 | 81 | private: 82 | void populateConfig(); 83 | void reloadMacroTable() { 84 | auto path = StandardPaths::global().locate(StandardPathsType::PkgConfig, 85 | "unikey/macro"); 86 | 87 | if (!path.empty()) { 88 | im_.loadMacroTable(path.string().c_str()); 89 | } 90 | } 91 | void reloadKeymap(); 92 | 93 | UnikeyConfig config_; 94 | UnikeyInputMethod im_; 95 | Instance *instance_; 96 | FactoryFor factory_; 97 | std::unique_ptr inputMethodAction_; 98 | std::vector> inputMethodSubAction_; 99 | std::unique_ptr inputMethodMenu_; 100 | std::unique_ptr charsetAction_; 101 | std::vector> charsetSubAction_; 102 | std::unique_ptr charsetMenu_; 103 | std::unique_ptr spellCheckAction_; 104 | std::unique_ptr macroAction_; 105 | std::vector connections_; 106 | std::vector>> 107 | eventWatchers_; 108 | }; 109 | 110 | class UnikeyFactory : public AddonFactory { 111 | public: 112 | AddonInstance *create(AddonManager *manager) override { 113 | registerDomain("fcitx5-unikey", FCITX_INSTALL_LOCALEDIR); 114 | return new UnikeyEngine(manager->instance()); 115 | } 116 | }; 117 | } // namespace fcitx 118 | 119 | #endif // _FCITX5_UNIKEY_UNIKEY_IM_H_ 120 | -------------------------------------------------------------------------------- /src/unikey.conf.in: -------------------------------------------------------------------------------- 1 | [InputMethod] 2 | Name=Unikey 3 | Icon=fcitx-unikey 4 | LangCode=vi 5 | Addon=unikey 6 | Configurable=True 7 | -------------------------------------------------------------------------------- /test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | configure_file(testdir.h.in ${CMAKE_CURRENT_BINARY_DIR}/testdir.h @ONLY) 3 | include_directories(${CMAKE_CURRENT_BINARY_DIR}) 4 | 5 | 6 | add_subdirectory(addon) 7 | add_subdirectory(inputmethod) 8 | add_executable(testunikey testunikey.cpp) 9 | target_link_libraries(testunikey Fcitx5::Core Fcitx5::Module::TestFrontend) 10 | add_dependencies(testunikey unikey copy-addon copy-im) 11 | add_test(NAME testunikey COMMAND testunikey) 12 | -------------------------------------------------------------------------------- /test/addon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_custom_target(copy-addon DEPENDS unikey-addon.conf.in-fmt) 2 | add_custom_command(TARGET copy-addon COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/src/unikey-addon.conf ${CMAKE_CURRENT_BINARY_DIR}/unikey.conf) 3 | -------------------------------------------------------------------------------- /test/inputmethod/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_custom_target(copy-im DEPENDS unikey.conf.in-fmt) 2 | add_custom_command(TARGET copy-im COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/src/unikey.conf ${CMAKE_CURRENT_BINARY_DIR}/unikey.conf) 3 | -------------------------------------------------------------------------------- /test/testdir.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2021~2021 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | #ifndef _TEST_TESTDIR_H_ 7 | #define _TEST_TESTDIR_H_ 8 | 9 | #define TESTING_SOURCE_DIR "@CMAKE_SOURCE_DIR@" 10 | #define TESTING_BINARY_DIR "@CMAKE_BINARY_DIR@" 11 | 12 | #endif // _TEST_TESTDIR_H_ 13 | -------------------------------------------------------------------------------- /unikey/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(UNIKEY_SRCS 3 | byteio.cpp 4 | charset.cpp 5 | convert.cpp 6 | data.cpp 7 | inputproc.cpp 8 | mactab.cpp 9 | pattern.cpp 10 | ukengine.cpp 11 | usrkeymap.cpp 12 | unikeyinputcontext.cpp 13 | ) 14 | 15 | 16 | add_library(unikey-lib STATIC ${UNIKEY_SRCS}) 17 | target_link_libraries(unikey-lib Fcitx5::Utils) 18 | set_target_properties(unikey-lib PROPERTIES POSITION_INDEPENDENT_CODE ON) 19 | target_include_directories(unikey-lib PUBLIC "$") 20 | -------------------------------------------------------------------------------- /unikey/README: -------------------------------------------------------------------------------- 1 | This folder contains ukengine (with changes 2 | for better use in my project) taking from project 3 | x-unikey (http://www.unikey.org). 4 | 5 | Read COPYING for License of ukengine. 6 | 7 | -------------------------------------------------------------------------------- /unikey/byteio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 1998-2002 Pham Kim Long 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | #ifndef BYTE_IO_STREAM_H 7 | #define BYTE_IO_STREAM_H 8 | 9 | // #include "vnconv.h" 10 | #include 11 | 12 | typedef unsigned char UKBYTE; 13 | typedef unsigned short UKWORD; 14 | typedef unsigned int UKDWORD; 15 | 16 | //---------------------------------------------------- 17 | class ByteStream { 18 | public: 19 | virtual ~ByteStream() {} 20 | }; 21 | 22 | //---------------------------------------------------- 23 | class ByteInStream : public ByteStream { 24 | public: 25 | virtual int getNext(UKBYTE &b) = 0; 26 | virtual int peekNext(UKBYTE &b) = 0; 27 | virtual int unget(UKBYTE b) = 0; 28 | 29 | virtual int getNextW(UKWORD &w) = 0; 30 | virtual int peekNextW(UKWORD &w) = 0; 31 | 32 | virtual int getNextDW(UKDWORD &dw) = 0; 33 | 34 | virtual int bookmark() // no support for bookmark by default 35 | { 36 | return 0; 37 | } 38 | 39 | virtual int gotoBookmark() { return 0; } 40 | 41 | virtual int eos() = 0; // end of stream 42 | virtual int close() = 0; 43 | }; 44 | 45 | //---------------------------------------------------- 46 | class ByteOutStream : public ByteStream { 47 | public: 48 | virtual int putB(UKBYTE b) = 0; 49 | virtual int putW(UKWORD w) = 0; 50 | virtual int puts(const char *s, int size = -1) = 0; // write an 8-bit string 51 | virtual int isOK() = 0; // get current stream state 52 | }; 53 | 54 | //---------------------------------------------------- 55 | class StringBIStream : public ByteInStream { 56 | protected: 57 | int m_eos; 58 | UKBYTE *m_data, *m_current; 59 | int m_len, m_left; 60 | 61 | struct { 62 | int eos; 63 | UKBYTE *data, *current; 64 | int len, left; 65 | } m_bookmark; 66 | 67 | int m_didBookmark; 68 | 69 | public: 70 | StringBIStream(UKBYTE *data, int len, int elementSize = 1); 71 | virtual int getNext(UKBYTE &b); 72 | virtual int peekNext(UKBYTE &b); 73 | virtual int unget(UKBYTE b); 74 | 75 | virtual int getNextW(UKWORD &w); 76 | virtual int peekNextW(UKWORD &w); 77 | 78 | virtual int getNextDW(UKDWORD &dw); 79 | 80 | virtual int eos(); // end of stream 81 | virtual int close(); 82 | 83 | virtual int bookmark(); 84 | virtual int gotoBookmark(); 85 | 86 | void reopen(); 87 | int left() { return m_left; } 88 | }; 89 | 90 | //---------------------------------------------------- 91 | class FileBIStream : public ByteInStream { 92 | protected: 93 | FILE *m_file; 94 | int m_bufSize; 95 | char *m_buf; 96 | int m_own; 97 | int m_didBookmark; 98 | 99 | struct { 100 | long pos; 101 | } m_bookmark; 102 | 103 | // some systems don't have wide char IO functions 104 | // we have to use this variables to implement that 105 | UKBYTE m_readByte; 106 | int m_readAhead; 107 | int m_lastIsAhead; 108 | 109 | public: 110 | FileBIStream(int bufsize = 8192, char *buf = NULL); 111 | // FileBIStream(char *fileName, int bufsize = 8192, void *buf = NULL); 112 | 113 | int open(const char *fileName); 114 | void attach(FILE *f); 115 | virtual int close(); 116 | 117 | virtual int getNext(UKBYTE &b); 118 | virtual int peekNext(UKBYTE &b); 119 | virtual int unget(UKBYTE b); 120 | 121 | virtual int getNextW(UKWORD &w); 122 | virtual int peekNextW(UKWORD &w); 123 | 124 | virtual int getNextDW(UKDWORD &dw); 125 | 126 | virtual int eos(); // end of stream 127 | 128 | virtual int bookmark(); 129 | virtual int gotoBookmark(); 130 | 131 | virtual ~FileBIStream(); 132 | }; 133 | 134 | //---------------------------------------------------- 135 | class StringBOStream : public ByteOutStream { 136 | protected: 137 | UKBYTE *m_buf, *m_current; 138 | int m_out; 139 | int m_len; 140 | int m_bad; 141 | 142 | public: 143 | StringBOStream(UKBYTE *buf, int len); 144 | virtual int putB(UKBYTE b); 145 | virtual int putW(UKWORD w); 146 | virtual int puts(const char *s, int size = -1); 147 | virtual int isOK(); // get current stream state 148 | 149 | virtual int close() { return 1; }; 150 | 151 | void reopen(); 152 | int getOutBytes() { return m_out; } 153 | }; 154 | 155 | //---------------------------------------------------- 156 | class FileBOStream : public ByteOutStream { 157 | protected: 158 | FILE *m_file; 159 | int m_bufSize; 160 | char *m_buf; 161 | int m_own; 162 | int m_bad; 163 | 164 | public: 165 | FileBOStream(int bufsize = 8192, char *buf = NULL); 166 | // FileBOStream(char *fileName, int bufsize = 8192, void *buf = NULL); 167 | 168 | int open(const char *fileName); 169 | void attach(FILE *); 170 | virtual int close(); 171 | 172 | virtual int putB(UKBYTE b); 173 | virtual int putW(UKWORD w); 174 | virtual int puts(const char *s, int size = -1); 175 | virtual int isOK(); // get current stream state 176 | virtual ~FileBOStream(); 177 | }; 178 | 179 | #endif 180 | -------------------------------------------------------------------------------- /unikey/charset.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 1998-2002 Pham Kim Long 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef __CHARSET_CONVERT_H 8 | #define __CHARSET_CONVERT_H 9 | 10 | #if !defined(_WIN32) 11 | #include 12 | #endif 13 | 14 | #if defined(_WIN32) 15 | #if defined(UNIKEYHOOK) 16 | #define DllInterface __declspec(dllexport) 17 | #else 18 | #define DllInterface __declspec(dllimport) 19 | #endif 20 | #else 21 | #define DllInterface // not used 22 | #define DllExport 23 | #define DllImport 24 | #endif 25 | 26 | #include "byteio.h" 27 | #include "pattern.h" 28 | #include "vnconv.h" 29 | 30 | #define TOTAL_VNCHARS 213 31 | #define TOTAL_ALPHA_VNCHARS 186 32 | 33 | #if defined(_WIN32) 34 | typedef unsigned __int32 StdVnChar; 35 | typedef unsigned __int16 UnicodeChar; 36 | typedef unsigned __int16 UKWORD; 37 | typedef unsigned __int32 UKDWORD; 38 | #else 39 | // typedef unsigned int StdVnChar; //the size should be more specific 40 | typedef uint32_t StdVnChar; 41 | typedef uint16_t UnicodeChar; 42 | typedef uint16_t UKWORD; 43 | typedef uint32_t UKDWORD; 44 | #endif 45 | 46 | // typedef unsigned short UnicodeChar; 47 | // typedef unsigned short UKWORD; 48 | 49 | // typedef unsigned int UKDWORD; //the size should be more specific 50 | 51 | #ifndef LOWORD 52 | #define LOWORD(l) ((UKWORD)(l)) 53 | #endif 54 | 55 | #ifndef HIWORD 56 | #define HIWORD(l) ((UKWORD)(((UKDWORD)(l) >> 16) & 0xFFFF)) 57 | #endif 58 | 59 | #ifndef MAKEWORD 60 | #define MAKEWORD(a, b) ((UKWORD)(((UKBYTE)(a)) | ((UKWORD)((UKBYTE)(b))) << 8)) 61 | #endif 62 | 63 | const StdVnChar VnStdCharOffset = 0x10000; 64 | const StdVnChar INVALID_STD_CHAR = 0xFFFFFFFF; 65 | // const unsigned char PadChar = '?'; //? is used for VIQR charset 66 | const unsigned char PadChar = '#'; 67 | const unsigned char PadStartQuote = '\"'; 68 | const unsigned char PadEndQuote = '\"'; 69 | const unsigned char PadEllipsis = '.'; 70 | 71 | class DllInterface VnCharset { 72 | public: 73 | virtual void startInput() {} 74 | virtual void startOutput() {} 75 | // virtual UKBYTE *nextInput(UKBYTE *input, int inLen, StdVnChar & stdChar, 76 | // int & bytesRead) = 0; 77 | virtual int nextInput(ByteInStream &is, StdVnChar &stdChar, 78 | int &bytesRead) = 0; 79 | 80 | //------------------------------------------------------------------------ 81 | // put a character to the output after converting it 82 | // Arguments: 83 | // output[in]: output buffer 84 | // stdChar[in]: character in standard charset 85 | // outLen[out]: length of converted sequence 86 | // maxAvail[in]: max length available. 87 | // Returns: next position in output 88 | //------------------------------------------------------------------------ 89 | virtual int putChar(ByteOutStream &os, StdVnChar stdChar, int &outLen) = 0; 90 | virtual int elementSize(); 91 | virtual ~VnCharset() {} 92 | }; 93 | 94 | //-------------------------------------------------- 95 | class SingleByteCharset : public VnCharset { 96 | protected: 97 | UKWORD m_stdMap[256]; 98 | unsigned char *m_vnChars; 99 | 100 | public: 101 | SingleByteCharset(unsigned char *vnChars); 102 | virtual int nextInput(ByteInStream &is, StdVnChar &stdChar, int &bytesRead); 103 | virtual int putChar(ByteOutStream &os, StdVnChar stdChar, int &outLen); 104 | }; 105 | 106 | //-------------------------------------------------- 107 | class VnInternalCharset : public VnCharset { 108 | public: 109 | VnInternalCharset() {} 110 | virtual int nextInput(ByteInStream &is, StdVnChar &stdChar, int &bytesRead); 111 | virtual int putChar(ByteOutStream &os, StdVnChar stdChar, int &outLen); 112 | virtual int elementSize(); 113 | }; 114 | 115 | //-------------------------------------------------- 116 | class UnicodeCharset : public VnCharset { 117 | protected: 118 | UKDWORD m_vnChars[TOTAL_VNCHARS]; 119 | UnicodeChar *m_toUnicode; 120 | 121 | public: 122 | UnicodeCharset(UnicodeChar *vnChars); 123 | virtual int nextInput(ByteInStream &is, StdVnChar &stdChar, int &bytesRead); 124 | virtual int putChar(ByteOutStream &os, StdVnChar stdChar, int &outLen); 125 | virtual int elementSize(); 126 | }; 127 | 128 | //-------------------------------------------------- 129 | class DoubleByteCharset : public VnCharset { 130 | protected: 131 | UKWORD m_stdMap[256]; 132 | UKDWORD m_vnChars[TOTAL_VNCHARS]; 133 | UKWORD *m_toDoubleChar; 134 | 135 | public: 136 | DoubleByteCharset(UKWORD *vnChars); 137 | virtual int nextInput(ByteInStream &is, StdVnChar &stdChar, int &bytesRead); 138 | virtual int putChar(ByteOutStream &os, StdVnChar stdChar, int &outLen); 139 | }; 140 | 141 | //-------------------------------------------------- 142 | class UnicodeUTF8Charset : public UnicodeCharset { 143 | public: 144 | UnicodeUTF8Charset(UnicodeChar *vnChars) : UnicodeCharset(vnChars) {} 145 | 146 | virtual int nextInput(ByteInStream &is, StdVnChar &stdChar, int &bytesRead); 147 | virtual int putChar(ByteOutStream &os, StdVnChar stdChar, int &outLen); 148 | }; 149 | 150 | //-------------------------------------------------- 151 | class UnicodeRefCharset : public UnicodeCharset { 152 | public: 153 | UnicodeRefCharset(UnicodeChar *vnChars) : UnicodeCharset(vnChars) {} 154 | 155 | virtual int nextInput(ByteInStream &is, StdVnChar &stdChar, int &bytesRead); 156 | virtual int putChar(ByteOutStream &os, StdVnChar stdChar, int &outLen); 157 | }; 158 | 159 | //-------------------------------------------------- 160 | class UnicodeHexCharset : public UnicodeRefCharset { 161 | public: 162 | UnicodeHexCharset(UnicodeChar *vnChars) : UnicodeRefCharset(vnChars) {} 163 | virtual int putChar(ByteOutStream &os, StdVnChar stdChar, int &outLen); 164 | }; 165 | 166 | //-------------------------------------------------- 167 | class UnicodeCStringCharset : public UnicodeCharset { 168 | protected: 169 | int m_prevIsHex; 170 | 171 | public: 172 | UnicodeCStringCharset(UnicodeChar *vnChars) : UnicodeCharset(vnChars) {} 173 | virtual int nextInput(ByteInStream &is, StdVnChar &stdChar, int &bytesRead); 174 | virtual int putChar(ByteOutStream &os, StdVnChar stdChar, int &outLen); 175 | virtual void startInput(); 176 | }; 177 | 178 | //-------------------------------------------------- 179 | class WinCP1258Charset : public VnCharset { 180 | protected: 181 | UKWORD m_stdMap[256]; 182 | UKDWORD m_vnChars[TOTAL_VNCHARS * 2]; 183 | UKWORD *m_toDoubleChar; 184 | int m_totalChars; 185 | 186 | public: 187 | WinCP1258Charset(UKWORD *compositeChars, UKWORD *precomposedChars); 188 | virtual int nextInput(ByteInStream &is, StdVnChar &stdChar, int &bytesRead); 189 | virtual int putChar(ByteOutStream &os, StdVnChar stdChar, int &outLen); 190 | }; 191 | 192 | //-------------------------------------------------- 193 | struct UniCompCharInfo { 194 | UKDWORD compChar; 195 | int stdIndex; 196 | }; 197 | 198 | class UnicodeCompCharset : public VnCharset { 199 | protected: 200 | UniCompCharInfo m_info[TOTAL_VNCHARS * 2]; 201 | UKDWORD *m_uniCompChars; 202 | int m_totalChars; 203 | 204 | public: 205 | UnicodeCompCharset(UnicodeChar *uniChars, UKDWORD *uniCompChars); 206 | virtual int nextInput(ByteInStream &is, StdVnChar &stdChar, int &bytesRead); 207 | virtual int putChar(ByteOutStream &os, StdVnChar stdChar, int &outLen); 208 | virtual int elementSize(); 209 | }; 210 | 211 | //-------------------------------------------------- 212 | class VIQRCharset : public VnCharset { 213 | protected: 214 | UKDWORD *m_vnChars; 215 | UKWORD m_stdMap[256]; 216 | int m_atWordBeginning; 217 | int m_escapeBowl; 218 | int m_escapeRoof; 219 | int m_escapeHook; 220 | int m_escapeTone; 221 | int m_gotTone; 222 | int m_escAll; 223 | int m_noOutEsc; 224 | 225 | public: 226 | int m_suspicious; 227 | VIQRCharset(UKDWORD *vnChars); 228 | virtual void startInput(); 229 | virtual void startOutput(); 230 | virtual int nextInput(ByteInStream &is, StdVnChar &stdChar, int &bytesRead); 231 | virtual int putChar(ByteOutStream &os, StdVnChar stdChar, int &outLen); 232 | }; 233 | 234 | //-------------------------------------------------- 235 | class UTF8VIQRCharset : public VnCharset { 236 | 237 | protected: 238 | VIQRCharset *m_pViqr; 239 | UnicodeUTF8Charset *m_pUtf; 240 | 241 | public: 242 | UTF8VIQRCharset(UnicodeUTF8Charset *pUtf, VIQRCharset *pViqr); 243 | virtual void startInput(); 244 | virtual void startOutput(); 245 | virtual int nextInput(ByteInStream &is, StdVnChar &stdChar, int &bytesRead); 246 | virtual int putChar(ByteOutStream &os, StdVnChar stdChar, int &outLen); 247 | }; 248 | 249 | //-------------------------------------------------- 250 | class DllInterface CVnCharsetLib { 251 | protected: 252 | SingleByteCharset *m_sgCharsets[CONV_TOTAL_SINGLE_CHARSETS]; 253 | DoubleByteCharset *m_dbCharsets[CONV_TOTAL_DOUBLE_CHARSETS]; 254 | UnicodeCharset *m_pUniCharset; 255 | UnicodeCompCharset *m_pUniCompCharset; 256 | UnicodeUTF8Charset *m_pUniUTF8; 257 | UnicodeRefCharset *m_pUniRef; 258 | UnicodeHexCharset *m_pUniHex; 259 | VIQRCharset *m_pVIQRCharObj; 260 | UTF8VIQRCharset *m_pUVIQRCharObj; 261 | WinCP1258Charset *m_pWinCP1258; 262 | UnicodeCStringCharset *m_pUniCString; 263 | VnInternalCharset *m_pVnIntCharset; 264 | 265 | public: 266 | PatternList m_VIQREscPatterns, m_VIQROutEscPatterns; 267 | VnConvOptions m_options; 268 | CVnCharsetLib(); 269 | ~CVnCharsetLib(); 270 | VnCharset *getVnCharset(int charsetIdx); 271 | }; 272 | 273 | extern unsigned char SingleByteTables[][TOTAL_VNCHARS]; 274 | extern UKWORD DoubleByteTables[][TOTAL_VNCHARS]; 275 | extern UnicodeChar UnicodeTable[TOTAL_VNCHARS]; 276 | extern UKDWORD VIQRTable[TOTAL_VNCHARS]; 277 | extern UKDWORD UnicodeComposite[TOTAL_VNCHARS]; 278 | extern UKWORD WinCP1258[TOTAL_VNCHARS]; 279 | extern UKWORD WinCP1258Pre[TOTAL_VNCHARS]; 280 | 281 | extern DllInterface CVnCharsetLib VnCharsetLibObj; 282 | extern VnConvOptions VnConvGlobalOptions; 283 | extern int StdVnNoTone[TOTAL_VNCHARS]; 284 | extern int StdVnRootChar[TOTAL_VNCHARS]; 285 | 286 | DllInterface int genConvert(VnCharset &incs, VnCharset &outcs, 287 | ByteInStream &input, ByteOutStream &output); 288 | 289 | StdVnChar StdVnToUpper(StdVnChar ch); 290 | StdVnChar StdVnToLower(StdVnChar ch); 291 | StdVnChar StdVnGetRoot(StdVnChar ch); 292 | 293 | #endif 294 | -------------------------------------------------------------------------------- /unikey/convert.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 1998-2002 Pham Kim Long 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #include "charset.h" 8 | #include 9 | #include 10 | #include 11 | 12 | #if defined(_WIN32) 13 | #include 14 | #include 15 | #endif 16 | 17 | #include "vnconv.h" 18 | 19 | int vnFileStreamConvert(int inCharset, int outCharset, FILE *inf, FILE *outf); 20 | 21 | DllExport int genConvert(VnCharset &incs, VnCharset &outcs, ByteInStream &input, 22 | ByteOutStream &output) { 23 | StdVnChar stdChar; 24 | int bytesRead, bytesWritten; 25 | 26 | incs.startInput(); 27 | outcs.startOutput(); 28 | 29 | int ret = 1; 30 | while (!input.eos()) { 31 | stdChar = 0; 32 | if (incs.nextInput(input, stdChar, bytesRead)) { 33 | if (stdChar != INVALID_STD_CHAR) { 34 | if (VnCharsetLibObj.m_options.toLower) 35 | stdChar = StdVnToLower(stdChar); 36 | else if (VnCharsetLibObj.m_options.toUpper) 37 | stdChar = StdVnToUpper(stdChar); 38 | if (VnCharsetLibObj.m_options.removeTone) 39 | stdChar = StdVnGetRoot(stdChar); 40 | ret = outcs.putChar(output, stdChar, bytesWritten); 41 | } 42 | } else 43 | break; 44 | } 45 | return (ret ? 0 : VNCONV_OUT_OF_MEMORY); 46 | } 47 | 48 | //---------------------------------------------- 49 | // Arguments: 50 | // inCharset: charset of input 51 | // outCharset: charset of output 52 | // input: input data 53 | // output: output data 54 | // inLen: [in] size of input. if inLen = -1, input data is 55 | // null-terminated. 56 | // [out] if input inLen != -1, output iLen is the numbers of byte 57 | // left in input. 58 | // maxOutLen: [in] size of output. 59 | // [out] number of bytes output, if enough memory 60 | // number of bytes needed for output, if not enough 61 | // memory 62 | // Returns: 0 if successful 63 | // error code: if failed 64 | //---------------------------------------------- 65 | // int VnConvert(int inCharset, int outCharset, UKBYTE *input, UKBYTE *output, 66 | // int & inLen, int & maxOutLen) 67 | 68 | DllExport int VnConvert(int inCharset, int outCharset, UKBYTE *input, 69 | UKBYTE *output, int *pInLen, int *pMaxOutLen) { 70 | int inLen, maxOutLen; 71 | int ret = -1; 72 | 73 | inLen = *pInLen; 74 | maxOutLen = *pMaxOutLen; 75 | 76 | if (inLen != -1 && inLen < 0) // invalid inLen 77 | return ret; 78 | 79 | VnCharset *pInCharset = VnCharsetLibObj.getVnCharset(inCharset); 80 | VnCharset *pOutCharset = VnCharsetLibObj.getVnCharset(outCharset); 81 | 82 | if (!pInCharset || !pOutCharset) 83 | return VNCONV_INVALID_CHARSET; 84 | 85 | StringBIStream is(input, inLen, pInCharset->elementSize()); 86 | StringBOStream os(output, maxOutLen); 87 | 88 | ret = genConvert(*pInCharset, *pOutCharset, is, os); 89 | *pMaxOutLen = os.getOutBytes(); 90 | *pInLen = is.left(); 91 | return ret; 92 | } 93 | 94 | //--------------------------------------- 95 | // Arguments: 96 | // inFile: input file name. NULL if STDIN is used 97 | // outFile: output file name, NULL if STDOUT is used 98 | // Returns: 99 | // 0: successful 100 | // errCode: if failed 101 | //--------------------------------------- 102 | DllExport int VnFileConvert(int inCharset, int outCharset, const char *inFile, 103 | const char *outFile) { 104 | FILE *inf = NULL; 105 | FILE *outf = NULL; 106 | int ret = 0; 107 | char tmpName[32]; 108 | 109 | if (inFile == NULL) { 110 | inf = stdin; 111 | #if defined(_WIN32) 112 | _setmode(_fileno(stdin), _O_BINARY); 113 | #endif 114 | } else { 115 | inf = fopen(inFile, "rb"); 116 | if (inf == NULL) { 117 | ret = VNCONV_ERR_INPUT_FILE; 118 | goto end; 119 | } 120 | } 121 | 122 | if (outFile == NULL) 123 | outf = stdout; 124 | else { 125 | // setup temporary output file (because real output file may be the same 126 | // as input file 127 | char outDir[256]; 128 | strcpy(outDir, outFile); 129 | 130 | #if defined(_WIN32) 131 | char *p = strrchr(outDir, '\\'); 132 | #else 133 | char *p = strrchr(outDir, '/'); 134 | #endif 135 | 136 | if (p == NULL) 137 | outDir[0] = 0; 138 | else 139 | *p = 0; 140 | 141 | strcpy(tmpName, outDir); 142 | strcat(tmpName, "XXXXXX"); 143 | 144 | if (mkstemp(tmpName) == -1) { 145 | fclose(inf); 146 | ret = VNCONV_ERR_OUTPUT_FILE; 147 | goto end; 148 | } 149 | outf = fopen(tmpName, "wb"); 150 | 151 | if (outf == NULL) { 152 | fclose(inf); 153 | ret = VNCONV_ERR_OUTPUT_FILE; 154 | goto end; 155 | } 156 | } 157 | 158 | ret = vnFileStreamConvert(inCharset, outCharset, inf, outf); 159 | if (inf != stdin) 160 | fclose(inf); 161 | if (outf != stdout) { 162 | fclose(outf); 163 | 164 | // delete output file if exisits 165 | if (ret == 0) { 166 | remove(outFile); 167 | #if !defined(_WIN32) 168 | char cmd[256]; 169 | sprintf(cmd, "mv %s %s", tmpName, outFile); 170 | cmd[0] = system(cmd); 171 | #else 172 | if (rename(tmpName, outFile) != 0) { 173 | remove(tmpName); 174 | ret = VNCONV_ERR_OUTPUT_FILE; 175 | goto end; 176 | } 177 | #endif 178 | } else 179 | remove(tmpName); 180 | } 181 | 182 | end: 183 | #if defined(_WIN32) 184 | if (inf == stdin) { 185 | _setmode(_fileno(stdin), _O_BINARY); 186 | } 187 | #endif 188 | return ret; 189 | } 190 | 191 | //------------------------------------------------ 192 | // Returns: 193 | // 0: successful 194 | // errCode: if failed 195 | //--------------------------------------- 196 | int vnFileStreamConvert(int inCharset, int outCharset, FILE *inf, FILE *outf) { 197 | VnCharset *pInCharset = VnCharsetLibObj.getVnCharset(inCharset); 198 | VnCharset *pOutCharset = VnCharsetLibObj.getVnCharset(outCharset); 199 | 200 | if (!pInCharset || !pOutCharset) 201 | return VNCONV_INVALID_CHARSET; 202 | 203 | if (outCharset == CONV_CHARSET_UNICODE) { 204 | UKWORD sign = 0xFEFF; 205 | fwrite(&sign, sizeof(UKWORD), 1, outf); 206 | } 207 | 208 | FileBIStream is; 209 | FileBOStream os; 210 | 211 | is.attach(inf); 212 | os.attach(outf); 213 | 214 | return genConvert(*pInCharset, *pOutCharset, is, os); 215 | } 216 | 217 | const char *ErrTable[VNCONV_LAST_ERROR] = { 218 | "No error", 219 | "Unknown error", 220 | "Invalid charset", 221 | "Error opening input file", 222 | "Error opening output file", 223 | "Error writing to output stream", 224 | "Not enough memory", 225 | }; 226 | 227 | DllExport const char *VnConvErrMsg(int errCode) { 228 | if (errCode < 0 || errCode >= VNCONV_LAST_ERROR) 229 | errCode = VNCONV_UNKNOWN_ERROR; 230 | return ErrTable[errCode]; 231 | } 232 | -------------------------------------------------------------------------------- /unikey/data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 1998-2002 Pham Kim Long 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | #ifndef VIETNAMESE_CHARSET_DATA_H 7 | #define VIETNAMESE_CHARSET_DATA_H 8 | 9 | // This header defines some special characters 10 | const StdVnChar StdStartQuote = 11 | (VnStdCharOffset + 201); // 0x93 in the Western charset 12 | // 201 is the offset of character 0x93 (start quote) in Vn charsets 13 | const StdVnChar StdEndQuote = 14 | (VnStdCharOffset + 202); // 0x94 in the Western charset 15 | const StdVnChar StdEllipsis = 16 | (VnStdCharOffset + 190); // 0x85 in Western charet. 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /unikey/inputproc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2000-2005 Pham Kim Long 3 | * 4 | * SPDX-License-Identifier: LGPL-2.0-or-later 5 | */ 6 | #ifndef __UK_INPUT_PROCESSOR_H 7 | #define __UK_INPUT_PROCESSOR_H 8 | 9 | #include "keycons.h" 10 | #include "vnlexi.h" 11 | #include 12 | 13 | #if defined(_WIN32) 14 | #define DllExport __declspec(dllexport) 15 | #define DllImport __declspec(dllimport) 16 | #if defined(UNIKEYHOOK) 17 | #define DllInterface __declspec(dllexport) 18 | #else 19 | #define DllInterface __declspec(dllimport) 20 | #endif 21 | #else 22 | #define DllInterface // not used 23 | #define DllExport 24 | #define DllImport 25 | #endif 26 | 27 | enum UkKeyEvName { 28 | vneRoofAll, 29 | vneRoof_a, 30 | vneRoof_e, 31 | vneRoof_o, 32 | vneHookAll, 33 | vneHook_uo, 34 | vneHook_u, 35 | vneHook_o, 36 | vneBowl, 37 | vneDd, 38 | vneTone0, 39 | vneTone1, 40 | vneTone2, 41 | vneTone3, 42 | vneTone4, 43 | vneTone5, 44 | vne_telex_w, // special for telex 45 | vneMapChar, // e.g. [ -> u+ , ] -> o+ 46 | vneEscChar, 47 | vneNormal, // does not belong to any of the above categories 48 | vneCount // just to count how many event types there are 49 | }; 50 | 51 | enum UkCharType { ukcVn, ukcWordBreak, ukcNonVn, ukcReset }; 52 | 53 | struct UkKeyEvent { 54 | int evType; 55 | UkCharType chType; 56 | VnLexiName vnSym; // meaningful only when chType==ukcVn 57 | unsigned int keyCode; 58 | int tone; // meaningful only when this is a vowel 59 | }; 60 | 61 | struct UkKeyMapping { 62 | unsigned char key; 63 | int action; 64 | }; 65 | 66 | /////////////////////////////////////////// 67 | class UkInputProcessor { 68 | 69 | public: 70 | // don't do anything with constructor, because 71 | // this object can be allocated in shared memory 72 | // Use init method instead 73 | // UkInputProcessor(); 74 | 75 | void init(); 76 | 77 | UkInputMethod getIM() const { return m_im; } 78 | 79 | void keyCodeToEvent(unsigned int keyCode, UkKeyEvent &ev); 80 | void keyCodeToSymbol(unsigned int keyCode, UkKeyEvent &ev); 81 | int setIM(UkInputMethod im); 82 | int setIM(int map[256]); 83 | void getKeyMap(int map[256]) const; 84 | 85 | UkCharType getCharType(unsigned int keyCode) const; 86 | 87 | protected: 88 | static bool m_classInit; 89 | 90 | UkInputMethod m_im; 91 | int m_keyMap[256]; 92 | 93 | void useBuiltIn(UkKeyMapping *map); 94 | }; 95 | 96 | void UkResetKeyMap(int keyMap[256]); 97 | void SetupInputClassifierTable(); 98 | 99 | DllInterface extern UkKeyMapping TelexMethodMapping[]; 100 | DllInterface extern UkKeyMapping SimpleTelexMethodMapping[]; 101 | DllInterface extern UkKeyMapping SimpleTelex2MethodMapping[]; 102 | DllInterface extern UkKeyMapping VniMethodMapping[]; 103 | DllInterface extern UkKeyMapping VIQRMethodMapping[]; 104 | DllInterface extern UkKeyMapping MsViMethodMapping[]; 105 | 106 | extern VnLexiName IsoVnLexiMap[]; 107 | inline VnLexiName IsoToVnLexi(unsigned int keyCode) { 108 | return (keyCode >= 256) ? vnl_nonVnChar : IsoVnLexiMap[keyCode]; 109 | } 110 | 111 | extern const std::unordered_set WordBreakSyms; 112 | 113 | #endif 114 | -------------------------------------------------------------------------------- /unikey/keycons.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 1998-2004 Pham Kim Long 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | #ifndef __KEY_CONS_H 7 | #define __KEY_CONS_H 8 | 9 | // macro table constants 10 | #define MAX_MACRO_KEY_LEN 16 11 | // #define MAX_MACRO_TEXT_LEN 256 12 | #define MAX_MACRO_TEXT_LEN 1024 13 | #define MAX_MACRO_ITEMS 1024 14 | #define MAX_MACRO_LINE (MAX_MACRO_TEXT_LEN + MAX_MACRO_KEY_LEN) 15 | 16 | #define MACRO_MEM_SIZE (1024 * 128) // 128 KB 17 | 18 | #define CP_US_ANSI 1252 19 | 20 | enum UkInputMethod { 21 | UkTelex, 22 | UkVni, 23 | UkViqr, 24 | UkMsVi, 25 | UkUsrIM, 26 | UkSimpleTelex, 27 | UkSimpleTelex2 28 | }; 29 | 30 | struct UnikeyOptions { 31 | int freeMarking; 32 | int modernStyle; 33 | int macroEnabled; 34 | int useUnicodeClipboard; 35 | int alwaysMacro; 36 | int strictSpellCheck; 37 | int useIME; // for Win32 only 38 | int spellCheckEnabled; 39 | int autoNonVnRestore; 40 | }; 41 | 42 | #define UKOPT_FLAG_ALL 0xFFFFFFFF 43 | #define UKOPT_FLAG_FREE_STYLE 0x00000001 44 | // #define UKOPT_FLAG_MANUAL_TONE 0x00000002 45 | #define UKOPT_FLAG_MODERN 0x00000004 46 | #define UKOPT_FLAG_MACRO_ENABLED 0x00000008 47 | #define UKOPT_FLAG_USE_CLIPBOARD 0x00000010 48 | #define UKOPT_FLAG_ALWAYS_MACRO 0x00000020 49 | #define UKOPT_FLAG_STRICT_SPELL 0x00000040 50 | #define UKOPT_FLAG_USE_IME 0x00000080 51 | #define UKOPT_FLAG_SPELLCHECK_ENABLED 0x00000100 52 | 53 | #if defined(WIN32) 54 | typedef struct _UnikeySysInfo UnikeySysInfo; 55 | struct _UnikeySysInfo { 56 | int switchKey; 57 | HHOOK keyHook; 58 | HHOOK mouseHook; 59 | HWND hMainDlg; 60 | UINT iconMsgId; 61 | HICON hVietIcon, hEnIcon; 62 | int unicodePlatform; 63 | DWORD winMajorVersion, winMinorVersion; 64 | }; 65 | #endif 66 | 67 | typedef enum { UkCharOutput, UkKeyOutput } UkOutputType; 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /unikey/mactab.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2000-2005 Pham Kim Long 3 | * 4 | * SPDX-License-Identifier: LGPL-2.0-or-later 5 | */ 6 | 7 | #include "mactab.h" 8 | #include "vnconv.h" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | using namespace std; 15 | #define UKMACRO_VERSION_UTF8 1 16 | 17 | //--------------------------------------------------------------- 18 | void CMacroTable::init() { 19 | m_memSize = MACRO_MEM_SIZE; 20 | m_count = 0; 21 | m_occupied = 0; 22 | } 23 | 24 | //--------------------------------------------------------------- 25 | char *MacCompareStartMem; 26 | 27 | #define STD_TO_LOWER(x) \ 28 | (((x) >= VnStdCharOffset && \ 29 | (x) < (VnStdCharOffset + TOTAL_ALPHA_VNCHARS) && !((x) & 1)) \ 30 | ? (x + 1) \ 31 | : (x)) 32 | 33 | int macCompare(const void *p1, const void *p2) { 34 | StdVnChar *s1 = 35 | (StdVnChar *)((char *)MacCompareStartMem + ((MacroDef *)p1)->keyOffset); 36 | StdVnChar *s2 = 37 | (StdVnChar *)((char *)MacCompareStartMem + ((MacroDef *)p2)->keyOffset); 38 | 39 | int i; 40 | StdVnChar ls1, ls2; 41 | 42 | for (i = 0; s1[i] != 0 && s2[i] != 0; i++) { 43 | ls1 = STD_TO_LOWER(s1[i]); 44 | ls2 = STD_TO_LOWER(s2[i]); 45 | if (ls1 > ls2) 46 | return 1; 47 | if (ls1 < ls2) 48 | return -1; 49 | /* 50 | if (s1[i] > s2[i]) 51 | return 1; 52 | if (s1[i] < s2[i]) 53 | return -1; 54 | */ 55 | } 56 | if (s1[i] == 0) 57 | return (s2[i] == 0) ? 0 : -1; 58 | return 1; 59 | } 60 | 61 | //--------------------------------------------------------------- 62 | int macKeyCompare(const void *key, const void *ele) { 63 | StdVnChar *s1 = (StdVnChar *)key; 64 | StdVnChar *s2 = (StdVnChar *)((char *)MacCompareStartMem + 65 | ((MacroDef *)ele)->keyOffset); 66 | 67 | StdVnChar ls1, ls2; 68 | int i; 69 | for (i = 0; s1[i] != 0 && s2[i] != 0; i++) { 70 | ls1 = STD_TO_LOWER(s1[i]); 71 | ls2 = STD_TO_LOWER(s2[i]); 72 | if (ls1 > ls2) 73 | return 1; 74 | if (ls1 < ls2) 75 | return -1; 76 | /* 77 | if (s1[i] > s2[i]) 78 | return 1; 79 | if (s1[i] < s2[i]) 80 | return -1; 81 | */ 82 | } 83 | if (s1[i] == 0) 84 | return (s2[i] == 0) ? 0 : -1; 85 | return 1; 86 | } 87 | 88 | //--------------------------------------------------------------- 89 | const StdVnChar *CMacroTable::lookup(StdVnChar *key) { 90 | MacCompareStartMem = m_macroMem; 91 | MacroDef *p = (MacroDef *)bsearch(key, m_table, m_count, sizeof(MacroDef), 92 | macKeyCompare); 93 | if (p) 94 | return (StdVnChar *)(m_macroMem + p->textOffset); 95 | return 0; 96 | } 97 | 98 | //---------------------------------------------------------------------------- 99 | // Read header, if it's present in the file. Get the version of the file 100 | // If header is absent, go back to the beginning of file and set version to 0 101 | // Return false if reading failed. 102 | // 103 | // Header format: ;[DO NOT DELETE THIS LINE]***version=n 104 | //---------------------------------------------------------------------------- 105 | bool CMacroTable::readHeader(FILE *f, int &version) { 106 | char line[MAX_MACRO_LINE]; 107 | if (!fgets(line, sizeof(line), f)) { 108 | if (feof(f)) { 109 | fseek(f, 0, SEEK_SET); 110 | version = 0; 111 | return true; 112 | } 113 | return false; 114 | } 115 | 116 | // if BOM is available, skip it 117 | char *p = line; 118 | size_t len = strlen(line); 119 | if (len >= 3 && (unsigned char)line[0] == 0xEF && 120 | (unsigned char)line[1] == 0xBB && (unsigned char)line[2] == 0xBF) { 121 | p += 3; 122 | } 123 | 124 | // read version number 125 | p = strstr(p, "***"); 126 | if (p) { 127 | p += 3; 128 | // skip possible spaces 129 | while (*p == ' ') 130 | p++; 131 | if (sscanf(p, "version=%d", &version) == 1) 132 | return true; 133 | } 134 | 135 | fseek(f, 0, SEEK_SET); 136 | version = 0; 137 | return true; 138 | } 139 | 140 | //---------------------------------------------------------------- 141 | void CMacroTable::writeHeader(FILE *f) { 142 | #if defined(WIN32) 143 | fprintf(f, "\xEF\xBB\xBF;DO NOT DELETE THIS LINE*** version=%d ***\n", 144 | UKMACRO_VERSION_UTF8); 145 | #else 146 | fprintf(f, "DO NOT DELETE THIS LINE*** version=%d ***\n", 147 | UKMACRO_VERSION_UTF8); 148 | #endif 149 | } 150 | //--------------------------------------------------------------- 151 | int CMacroTable::loadFromFile(const char *fname) { 152 | FILE *f; 153 | #if defined(WIN32) 154 | f = _tfopen(fname, _TEXT("rt")); 155 | #else 156 | f = fopen(fname, "r"); 157 | #endif 158 | 159 | if (f == NULL) 160 | return 0; 161 | char line[MAX_MACRO_LINE]; 162 | size_t len; 163 | 164 | resetContent(); 165 | 166 | // read possible header 167 | int version; 168 | if (!readHeader(f, version)) { 169 | version = 0; 170 | } 171 | 172 | while (fgets(line, sizeof(line), f)) { 173 | len = strlen(line); 174 | if (len > 0 && line[len - 1] == '\n') 175 | line[len - 1] = 0; 176 | if (len > 1 && line[len - 2] == '\r') 177 | line[len - 2] = 0; 178 | if (version == UKMACRO_VERSION_UTF8) 179 | addItem(line, CONV_CHARSET_UNIUTF8); 180 | else 181 | addItem(line, CONV_CHARSET_VIQR); 182 | } 183 | fclose(f); 184 | MacCompareStartMem = m_macroMem; 185 | qsort(m_table, m_count, sizeof(MacroDef), macCompare); 186 | // Convert old version 187 | if (version != UKMACRO_VERSION_UTF8) { 188 | writeToFile(fname); 189 | } 190 | return 1; 191 | } 192 | 193 | //--------------------------------------------------------------- 194 | int CMacroTable::writeToFile(const char *fname) { 195 | FILE *f; 196 | f = fopen(fname, "w"); 197 | return writeToFp(f); 198 | } 199 | 200 | int CMacroTable::writeToFp(FILE *f) { 201 | int ret; 202 | int inLen, maxOutLen; 203 | 204 | if (f == NULL) 205 | return 0; 206 | 207 | char line[MAX_MACRO_LINE * 3 + 1]; // 1 VnChar may need 3 chars in UTF8 208 | char key[MAX_MACRO_KEY_LEN * 3]; 209 | char text[MAX_MACRO_TEXT_LEN * 3]; 210 | 211 | writeHeader(f); 212 | 213 | UKBYTE *p; 214 | for (int i = 0; i < m_count; i++) { 215 | p = (UKBYTE *)m_macroMem + m_table[i].keyOffset; 216 | inLen = -1; 217 | maxOutLen = sizeof(key); 218 | ret = VnConvert(CONV_CHARSET_VNSTANDARD, CONV_CHARSET_UNIUTF8, 219 | (UKBYTE *)p, (UKBYTE *)key, &inLen, &maxOutLen); 220 | if (ret != 0) 221 | continue; 222 | 223 | p = (UKBYTE *)m_macroMem + m_table[i].textOffset; 224 | inLen = -1; 225 | maxOutLen = sizeof(text); 226 | ret = VnConvert(CONV_CHARSET_VNSTANDARD, CONV_CHARSET_UNIUTF8, p, 227 | (UKBYTE *)text, &inLen, &maxOutLen); 228 | if (ret != 0) 229 | continue; 230 | if (i < m_count - 1) 231 | sprintf(line, "%s:%s\n", key, text); 232 | else 233 | sprintf(line, "%s:%s", key, text); 234 | fputs(line, f); 235 | } 236 | 237 | fclose(f); 238 | return 1; 239 | } 240 | 241 | //--------------------------------------------------------------- 242 | int CMacroTable::addItem(const void *key, const void *text, int charset) { 243 | int ret; 244 | int inLen, maxOutLen; 245 | int offset = m_occupied; 246 | char *p = m_macroMem + offset; 247 | 248 | if (m_count >= MAX_MACRO_ITEMS) 249 | return -1; 250 | 251 | m_table[m_count].keyOffset = offset; 252 | 253 | // Convert macro key to VN standard 254 | inLen = -1; // input is null-terminated 255 | maxOutLen = MAX_MACRO_KEY_LEN * sizeof(StdVnChar); 256 | if (maxOutLen + offset > m_memSize) 257 | maxOutLen = m_memSize - offset; 258 | ret = VnConvert(charset, CONV_CHARSET_VNSTANDARD, (UKBYTE *)key, 259 | (UKBYTE *)p, &inLen, &maxOutLen); 260 | if (ret != 0) 261 | return -1; 262 | 263 | offset += maxOutLen; 264 | p += maxOutLen; 265 | 266 | // convert macro text to VN standard 267 | m_table[m_count].textOffset = offset; 268 | inLen = -1; // input is null-terminated 269 | maxOutLen = MAX_MACRO_TEXT_LEN * sizeof(StdVnChar); 270 | if (maxOutLen + offset > m_memSize) 271 | maxOutLen = m_memSize - offset; 272 | ret = VnConvert(charset, CONV_CHARSET_VNSTANDARD, (UKBYTE *)text, 273 | (UKBYTE *)p, &inLen, &maxOutLen); 274 | if (ret != 0) 275 | return -1; 276 | 277 | m_occupied = offset + maxOutLen; 278 | m_count++; 279 | return (m_count - 1); 280 | } 281 | 282 | //--------------------------------------------------------------- 283 | // add a new macro into the sorted macro table 284 | // item format: key:text (key and text are separated by a colon) 285 | //--------------------------------------------------------------- 286 | int CMacroTable::addItem(const char *item, int charset) { 287 | char key[MAX_MACRO_KEY_LEN]; 288 | 289 | // Parse the input item 290 | char *pos = (char *)strchr(item, ':'); 291 | if (pos == NULL) 292 | return -1; 293 | int keyLen = (int)(pos - item); 294 | if (keyLen > MAX_MACRO_KEY_LEN - 1) 295 | keyLen = MAX_MACRO_KEY_LEN - 1; 296 | strncpy(key, item, keyLen); 297 | key[keyLen] = '\0'; 298 | return addItem(key, ++pos, charset); 299 | } 300 | 301 | //--------------------------------------------------------------- 302 | void CMacroTable::resetContent() { 303 | m_occupied = 0; 304 | m_count = 0; 305 | } 306 | 307 | //--------------------------------------------------------------- 308 | const StdVnChar *CMacroTable::getKey(int idx) const { 309 | if (idx < 0 || idx >= m_count) 310 | return 0; 311 | return (StdVnChar *)(m_macroMem + m_table[idx].keyOffset); 312 | } 313 | 314 | //--------------------------------------------------------------- 315 | const StdVnChar *CMacroTable::getText(int idx) const { 316 | if (idx < 0 || idx >= m_count) 317 | return 0; 318 | return (StdVnChar *)(m_macroMem + m_table[idx].textOffset); 319 | } 320 | -------------------------------------------------------------------------------- /unikey/mactab.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2000-2005 Pham Kim Long 3 | * 4 | * SPDX-License-Identifier: LGPL-2.0-or-later 5 | */ 6 | 7 | #ifndef __MACRO_TABLE_H 8 | #define __MACRO_TABLE_H 9 | 10 | #include "charset.h" 11 | #include "keycons.h" 12 | 13 | #if defined(_WIN32) 14 | #if defined(UNIKEYHOOK) 15 | #define DllInterface __declspec(dllexport) 16 | #else 17 | #define DllInterface __declspec(dllimport) 18 | #endif 19 | #else 20 | #define DllInterface // not used 21 | #define DllExport 22 | #define DllImport 23 | #endif 24 | 25 | struct MacroDef { 26 | int keyOffset; 27 | int textOffset; 28 | }; 29 | 30 | #if !defined(WIN32) 31 | typedef char TCHAR; 32 | #endif 33 | 34 | class DllInterface CMacroTable { 35 | public: 36 | void init(); 37 | int loadFromFile(const char *fname); 38 | int writeToFile(const char *fname); 39 | int writeToFp(FILE *f); 40 | 41 | const StdVnChar *lookup(StdVnChar *key); 42 | const StdVnChar *getKey(int idx) const; 43 | const StdVnChar *getText(int idx) const; 44 | int getCount() const { return m_count; } 45 | void resetContent(); 46 | int addItem(const char *item, int charset); 47 | int addItem(const void *key, const void *text, int charset); 48 | 49 | protected: 50 | bool readHeader(FILE *f, int &version); 51 | void writeHeader(FILE *f); 52 | 53 | MacroDef m_table[MAX_MACRO_ITEMS]; 54 | char m_macroMem[MACRO_MEM_SIZE]; 55 | 56 | int m_count; 57 | int m_memSize, m_occupied; 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /unikey/pattern.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 1998-2002 Pham Kim Long 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #include "pattern.h" 8 | 9 | ////////////////////////////////////////////////// 10 | // Pattern matching (based on KPM algorithm) 11 | ////////////////////////////////////////////////// 12 | 13 | //---------------------------- 14 | void PatternState::reset() { 15 | m_pos = 0; 16 | m_found = 0; 17 | } 18 | 19 | //---------------------------- 20 | void PatternState::init(char *pattern) { 21 | m_pos = 0; 22 | m_found = 0; 23 | m_pattern = pattern; 24 | 25 | int i = 0, j = -1; 26 | m_border[i] = j; 27 | while (m_pattern[i]) { 28 | while (j >= 0 && m_pattern[i] != m_pattern[j]) 29 | j = m_border[j]; 30 | i++; 31 | j++; 32 | m_border[i] = j; 33 | } 34 | } 35 | 36 | //----------------------------------------------------- 37 | // get next input char, returns 1 if pattern is found. 38 | //----------------------------------------------------- 39 | int PatternState::foundAtNextChar(char ch) { 40 | int ret = 0; 41 | // int j = m_pos; 42 | while (m_pos >= 0 && ch != m_pattern[m_pos]) 43 | m_pos = m_border[m_pos]; 44 | m_pos++; 45 | if (m_pattern[m_pos] == 0) { 46 | m_found++; 47 | m_pos = m_border[m_pos]; 48 | ret = 1; 49 | } 50 | return ret; 51 | } 52 | 53 | //----------------------------------------------------- 54 | void PatternList::init(char **patterns, int count) { 55 | m_count = count; 56 | delete[] m_patterns; 57 | m_patterns = new PatternState[count]; 58 | for (int i = 0; i < count; i++) 59 | m_patterns[i].init(patterns[i]); 60 | } 61 | 62 | //----------------------------------------------------- 63 | // return the order number of the pattern that is found. 64 | // If more than 1 pattern is found, returns any pattern 65 | // Returns -1 if no pattern is found 66 | //----------------------------------------------------- 67 | int PatternList::foundAtNextChar(char ch) { 68 | int patternFound = -1; 69 | for (int i = 0; i < m_count; i++) { 70 | if (m_patterns[i].foundAtNextChar(ch)) 71 | patternFound = i; 72 | } 73 | return patternFound; 74 | } 75 | 76 | //----------------------------------------------------- 77 | void PatternList::reset() { 78 | for (int i = 0; i < m_count; i++) 79 | m_patterns[i].reset(); 80 | } 81 | -------------------------------------------------------------------------------- /unikey/pattern.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 1998-2002 Pham Kim Long 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | #ifndef __PATTERN_H 7 | #define __PATTERN_H 8 | 9 | #if defined(_WIN32) 10 | #if defined(UNIKEYHOOK) 11 | #define DllInterface __declspec(dllexport) 12 | #else 13 | #define DllInterface __declspec(dllimport) 14 | #endif 15 | #else 16 | #define DllInterface // not used 17 | #endif 18 | 19 | #define MAX_PATTERN_LEN 40 20 | 21 | class DllInterface PatternState { 22 | public: 23 | char *m_pattern; 24 | int m_border[MAX_PATTERN_LEN + 1]; 25 | int m_pos; 26 | int m_found; 27 | void init(char *pattern); 28 | void reset(); 29 | int foundAtNextChar( 30 | char ch); // get next input char, returns 1 if pattern is found. 31 | }; 32 | 33 | class DllInterface PatternList { 34 | public: 35 | PatternState *m_patterns; 36 | int m_count; 37 | void init(char **patterns, int count); 38 | int foundAtNextChar(char ch); 39 | void reset(); 40 | 41 | PatternList() { 42 | m_count = 0; 43 | m_patterns = 0; 44 | } 45 | 46 | ~PatternList() { 47 | if (m_patterns) 48 | delete[] m_patterns; 49 | } 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /unikey/ukengine.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2000-2005 Pham Kim Long 3 | * 4 | * SPDX-License-Identifier: LGPL-2.0-or-later 5 | */ 6 | 7 | #ifndef __UKENGINE_H 8 | #define __UKENGINE_H 9 | 10 | #include "charset.h" 11 | #include "inputproc.h" 12 | #include "mactab.h" 13 | #include "vnlexi.h" 14 | #include 15 | 16 | // This is a shared object among processes, do not put any pointer in it 17 | struct UkSharedMem { 18 | // states 19 | bool vietKey; 20 | 21 | UnikeyOptions options; 22 | UkInputProcessor input; 23 | bool usrKeyMapLoaded; 24 | int usrKeyMap[256]; 25 | int charsetId; 26 | 27 | CMacroTable macStore; 28 | }; 29 | 30 | #define MAX_UK_ENGINE 128 31 | 32 | enum VnWordForm { vnw_nonVn, vnw_empty, vnw_c, vnw_v, vnw_cv, vnw_vc, vnw_cvc }; 33 | 34 | typedef std::function 35 | CheckKeyboardCaseCb; 36 | 37 | struct KeyBufEntry { 38 | UkKeyEvent ev; 39 | bool converted; 40 | }; 41 | 42 | class UkEngine { 43 | public: 44 | UkEngine(); 45 | void setCtrlInfo(UkSharedMem *p) { m_pCtrl = p; } 46 | 47 | void setCheckKbCaseFunc(CheckKeyboardCaseCb pFunc) { 48 | m_keyCheckFunc = pFunc; 49 | } 50 | 51 | bool atWordBeginning() const; 52 | 53 | int process(unsigned int keyCode, int &backs, unsigned char *outBuf, 54 | int &outSize, UkOutputType &outType); 55 | // just pass through without filtering 56 | void pass(int keyCode); 57 | // rebuild preedit from surrounding char 58 | void rebuildChar(VnLexiName ch, int &backs, unsigned char *outBuf, 59 | int &outSize); 60 | 61 | void setSingleMode(); 62 | 63 | int processBackspace(int &backs, unsigned char *outBuf, int &outSize, 64 | UkOutputType &outType); 65 | void reset(); 66 | int restoreKeyStrokes(int &backs, unsigned char *outBuf, int &outSize, 67 | UkOutputType &outType); 68 | 69 | // following methods must be public just to enable the use of pointers to 70 | // them they should not be called from outside. 71 | int processTone(UkKeyEvent &ev); 72 | int processRoof(UkKeyEvent &ev); 73 | int processHook(UkKeyEvent &ev); 74 | int processAppend(UkKeyEvent &ev); 75 | int appendVowel(UkKeyEvent &ev); 76 | int appendConsonnant(UkKeyEvent &ev); 77 | int processDd(UkKeyEvent &ev); 78 | int processMapChar(UkKeyEvent &ev); 79 | int processTelexW(UkKeyEvent &ev); 80 | int processEscChar(UkKeyEvent &ev); 81 | 82 | protected: 83 | static bool m_classInit; 84 | CheckKeyboardCaseCb m_keyCheckFunc; 85 | UkSharedMem *m_pCtrl; 86 | 87 | int m_changePos; 88 | int m_backs; 89 | int m_bufSize; 90 | int m_current; 91 | int m_singleMode; 92 | 93 | int m_keyBufSize; 94 | // unsigned int m_keyStrokes[MAX_UK_ENGINE]; 95 | KeyBufEntry m_keyStrokes[MAX_UK_ENGINE]; 96 | int m_keyCurrent; 97 | bool m_toEscape; 98 | 99 | // variables valid in one session 100 | unsigned char *m_pOutBuf; 101 | int *m_pOutSize; 102 | bool m_outputWritten; 103 | bool m_reverted; 104 | bool m_keyRestored; 105 | bool m_keyRestoring; 106 | UkOutputType m_outType; 107 | 108 | struct WordInfo { 109 | // info for word ending at this position 110 | VnWordForm form; 111 | int c1Offset, vOffset, c2Offset; 112 | 113 | union { 114 | VowelSeq vseq; 115 | ConSeq cseq; 116 | }; 117 | 118 | // info for current symbol 119 | int caps, tone; 120 | // canonical symbol, after caps, tone are removed 121 | // for non-Vn, vnSym == -1 122 | VnLexiName vnSym; 123 | int keyCode; 124 | }; 125 | 126 | WordInfo m_buffer[MAX_UK_ENGINE]; 127 | 128 | int processHookWithUO(UkKeyEvent &ev); 129 | int macroMatch(UkKeyEvent &ev); 130 | void markChange(int pos); 131 | void prepareBuffer(); // make sure we have a least 10 entries available 132 | int writeOutput(unsigned char *outBuf, int &outSize); 133 | // int getSeqLength(int first, int last); 134 | int getSeqSteps(int first, int last) const; 135 | int getTonePosition(VowelSeq vs, bool terminated) const; 136 | void resetKeyBuf(); 137 | int checkEscapeVIQR(UkKeyEvent &ev); 138 | int processNoSpellCheck(UkKeyEvent &ev); 139 | int processWordEnd(UkKeyEvent &ev); 140 | void synchKeyStrokeBuffer(); 141 | bool lastWordHasVnMark() const; 142 | bool lastWordIsNonVn() const; 143 | }; 144 | 145 | void SetupUnikeyEngine(); 146 | 147 | #endif 148 | -------------------------------------------------------------------------------- /unikey/unikeyinputcontext.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2018-2018 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #include "unikeyinputcontext.h" 8 | #include "ukengine.h" 9 | #include "usrkeymap.h" 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | using namespace std; 16 | 17 | //-------------------------------------------- 18 | void CreateDefaultUnikeyOptions(UnikeyOptions *pOpt) { 19 | pOpt->freeMarking = 1; 20 | pOpt->modernStyle = 0; 21 | pOpt->macroEnabled = 0; 22 | pOpt->useUnicodeClipboard = 0; 23 | pOpt->alwaysMacro = 0; 24 | pOpt->spellCheckEnabled = 1; 25 | pOpt->autoNonVnRestore = 0; 26 | } 27 | 28 | UnikeyInputMethod::UnikeyInputMethod() 29 | : sharedMem_(std::make_unique()) { 30 | SetupUnikeyEngine(); 31 | sharedMem_->input.init(); 32 | sharedMem_->macStore.init(); 33 | sharedMem_->vietKey = true; 34 | sharedMem_->usrKeyMapLoaded = false; 35 | setInputMethod(UkTelex); 36 | setOutputCharset(CONV_CHARSET_XUTF8); 37 | CreateDefaultUnikeyOptions(&sharedMem_->options); 38 | } 39 | 40 | //-------------------------------------------- 41 | void UnikeyInputMethod::setInputMethod(UkInputMethod im) { 42 | if (im == UkTelex || im == UkVni || im == UkSimpleTelex || 43 | im == UkSimpleTelex2 || im == UkViqr || im == UkMsVi) { 44 | sharedMem_->input.setIM(im); 45 | } else if (im == UkUsrIM && sharedMem_->usrKeyMapLoaded) { 46 | // cout << "Switched to user mode\n"; //DEBUG 47 | sharedMem_->input.setIM(sharedMem_->usrKeyMap); 48 | } 49 | emit(); 50 | // cout << "IM changed to: " << im << endl; //DEBUG 51 | } 52 | 53 | void UnikeyInputMethod::setOutputCharset(int charset) { 54 | sharedMem_->charsetId = charset; 55 | emit(); 56 | } 57 | 58 | //-------------------------------------------- 59 | void UnikeyInputMethod::setOptions(UnikeyOptions *pOpt) { 60 | sharedMem_->options.freeMarking = pOpt->freeMarking; 61 | sharedMem_->options.modernStyle = pOpt->modernStyle; 62 | sharedMem_->options.macroEnabled = pOpt->macroEnabled; 63 | sharedMem_->options.useUnicodeClipboard = pOpt->useUnicodeClipboard; 64 | sharedMem_->options.alwaysMacro = pOpt->alwaysMacro; 65 | sharedMem_->options.spellCheckEnabled = pOpt->spellCheckEnabled; 66 | sharedMem_->options.autoNonVnRestore = pOpt->autoNonVnRestore; 67 | } 68 | 69 | //-------------------------------------------- 70 | void UnikeyInputContext::setCapsState(int shiftPressed, int CapsLockOn) { 71 | // UnikeyCapsAll = (shiftPressed && !CapsLockOn) || (!shiftPressed && 72 | // CapsLockOn); 73 | capsLockOn_ = CapsLockOn; 74 | shiftPressed_ = shiftPressed; 75 | } 76 | 77 | //-------------------------------------------- 78 | UnikeyInputContext::UnikeyInputContext(UnikeyInputMethod *im) { 79 | conn_ = 80 | im->connect([this]() { engine_.reset(); }); 81 | engine_.setCtrlInfo(im->sharedMem()); 82 | engine_.setCheckKbCaseFunc([this](int *pShiftPressed, int *pCapsLockOn) { 83 | *pShiftPressed = shiftPressed_; 84 | *pCapsLockOn = capsLockOn_; 85 | }); 86 | } 87 | 88 | //-------------------------------------------- 89 | UnikeyInputContext::~UnikeyInputContext() {} 90 | 91 | //-------------------------------------------- 92 | void UnikeyInputContext::filter(unsigned int ch) { 93 | bufChars_ = sizeof(buf_); 94 | engine_.process(ch, backspaces_, buf_, bufChars_, output_); 95 | } 96 | 97 | //-------------------------------------------- 98 | void UnikeyInputContext::putChar(unsigned int ch) { 99 | engine_.pass(ch); 100 | bufChars_ = 0; 101 | backspaces_ = 0; 102 | } 103 | 104 | //-------------------------------------------- 105 | void UnikeyInputContext::rebuildChar(VnLexiName ch) { 106 | bufChars_ = sizeof(buf_); 107 | engine_.rebuildChar(ch, backspaces_, buf_, bufChars_); 108 | } 109 | 110 | //-------------------------------------------- 111 | void UnikeyInputContext::resetBuf() { engine_.reset(); } 112 | 113 | //-------------------------------------------- 114 | void UnikeyInputContext::backspacePress() { 115 | bufChars_ = sizeof(buf_); 116 | engine_.processBackspace(backspaces_, buf_, bufChars_, output_); 117 | // printf("Backspaces: %d\n",UnikeyBackspaces); 118 | } 119 | 120 | //-------------------------------------------- 121 | void UnikeyInputContext::restoreKeyStrokes() { 122 | bufChars_ = sizeof(buf_); 123 | engine_.restoreKeyStrokes(backspaces_, buf_, bufChars_, output_); 124 | } 125 | 126 | bool UnikeyInputContext::isAtWordBeginning() const { 127 | return engine_.atWordBeginning(); 128 | } 129 | -------------------------------------------------------------------------------- /unikey/unikeyinputcontext.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2018-2018 CSSlayer 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | */ 7 | #ifndef _UNIKEY_UNIKEYINPUTCONTEXT_H_ 8 | #define _UNIKEY_UNIKEYINPUTCONTEXT_H_ 9 | 10 | #include "keycons.h" 11 | #include "ukengine.h" 12 | #include 13 | #include 14 | 15 | class UnikeyInputMethod : public fcitx::ConnectableObject { 16 | public: 17 | UnikeyInputMethod(); 18 | 19 | // set input method 20 | // im: TELEX_INPUT, VNI_INPUT, VIQR_INPUT, VIQR_STAR_INPUT 21 | void setInputMethod(UkInputMethod im); 22 | // set output format 23 | void setOutputCharset(int charset); 24 | 25 | // set extra options 26 | void setOptions(UnikeyOptions *pOpt); 27 | 28 | //-------------------------------------------- 29 | int loadMacroTable(const char *fileName) { 30 | return sharedMem_->macStore.loadFromFile(fileName); 31 | } 32 | 33 | UkSharedMem *sharedMem() { return sharedMem_.get(); } 34 | 35 | FCITX_DECLARE_SIGNAL(UnikeyInputMethod, Reset, void()); 36 | 37 | private: 38 | FCITX_DEFINE_SIGNAL(UnikeyInputMethod, Reset); 39 | std::unique_ptr sharedMem_; 40 | }; 41 | 42 | class UnikeyInputContext { 43 | public: 44 | UnikeyInputContext(UnikeyInputMethod *im); 45 | ~UnikeyInputContext(); 46 | 47 | // call this to reset Unikey's state when focus, context is changed or 48 | // some control key is pressed 49 | void resetBuf(); 50 | 51 | // main handler, call every time a character input is received 52 | void filter(unsigned int ch); 53 | void putChar(unsigned int ch); // put new char without filtering 54 | 55 | // call to rebuild preedit from surrounding char 56 | void rebuildChar(VnLexiName ch); 57 | 58 | // call this before UnikeyFilter for correctly processing some TELEX 59 | // shortcuts 60 | void setCapsState(int shiftPressed, int CapsLockOn); 61 | 62 | // call this when backspace is pressed 63 | void backspacePress(); 64 | 65 | // call this to restore to original key strokes 66 | void restoreKeyStrokes(); 67 | 68 | bool isAtWordBeginning() const; 69 | 70 | int backspaces() const { return backspaces_; } 71 | int bufChars() const { return bufChars_; } 72 | const unsigned char *buf() const { return buf_; } 73 | 74 | private: 75 | fcitx::ScopedConnection conn_; 76 | 77 | unsigned char buf_[1024]; 78 | int backspaces_ = 0; 79 | int bufChars_; 80 | UkOutputType output_; 81 | UkEngine engine_; 82 | 83 | int capsLockOn_ = 0; 84 | int shiftPressed_ = 0; 85 | }; 86 | 87 | #endif // _UNIKEY_UNIKEYINPUTCONTEXT_H_ 88 | -------------------------------------------------------------------------------- /unikey/usrkeymap.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2000-2005 Pham Kim Long 3 | * 4 | * SPDX-License-Identifier: LGPL-2.0-or-later 5 | */ 6 | 7 | #include "usrkeymap.h" 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | namespace { 20 | 21 | constexpr char OPT_COMMENT_CHAR = ';'; 22 | 23 | struct UkEventLabelPair { 24 | char label[32]; 25 | int ev; 26 | }; 27 | 28 | const char *UkKeyMapHeader = "; This is UniKey user-defined key mapping file, " 29 | "generated from UniKey (Fcitx 5)\n\n"; 30 | 31 | constexpr UkEventLabelPair UkEvLabelList[] = { 32 | {"Tone0", vneTone0}, {"Tone1", vneTone1}, 33 | {"Tone2", vneTone2}, {"Tone3", vneTone3}, 34 | {"Tone4", vneTone4}, {"Tone5", vneTone5}, 35 | {"Roof-All", vneRoofAll}, {"Roof-A", vneRoof_a}, 36 | {"Roof-E", vneRoof_e}, {"Roof-O", vneRoof_o}, 37 | {"Hook-Bowl", vneHookAll}, {"Hook-UO", vneHook_uo}, 38 | {"Hook-U", vneHook_u}, {"Hook-O", vneHook_o}, 39 | {"Bowl", vneBowl}, {"D-Mark", vneDd}, 40 | {"Telex-W", vne_telex_w}, {"Escape", vneEscChar}, 41 | {"DD", vneCount + vnl_DD}, {"dd", vneCount + vnl_dd}, 42 | {"A^", vneCount + vnl_Ar}, {"a^", vneCount + vnl_ar}, 43 | {"A(", vneCount + vnl_Ab}, {"a(", vneCount + vnl_ab}, 44 | {"E^", vneCount + vnl_Er}, {"e^", vneCount + vnl_er}, 45 | {"O^", vneCount + vnl_Or}, {"o^", vneCount + vnl_or}, 46 | {"O+", vneCount + vnl_Oh}, {"o+", vneCount + vnl_oh}, 47 | {"U+", vneCount + vnl_Uh}, {"u+", vneCount + vnl_uh}}; 48 | 49 | constexpr auto UkEvLabelCount = FCITX_ARRAY_SIZE(UkEvLabelList); 50 | 51 | //------------------------------------------- 52 | void initKeyMap(int keyMap[256]) { 53 | unsigned int c; 54 | for (c = 0; c < 256; c++) 55 | keyMap[c] = vneNormal; 56 | } 57 | 58 | int getLabelIndex(int event) { 59 | for (size_t i = 0; i < UkEvLabelCount; i++) { 60 | if (UkEvLabelList[i].ev == event) 61 | return i; 62 | } 63 | return -1; 64 | } 65 | 66 | } // namespace 67 | 68 | //-------------------------------------------------- 69 | static bool parseNameValue(std::string_view line, std::string_view *name, 70 | std::string_view *value) { 71 | if (line.empty()) { 72 | return false; 73 | } 74 | 75 | // get rid of comment 76 | auto pos = line.find(OPT_COMMENT_CHAR); 77 | if (pos != std::string::npos) { 78 | line = line.substr(0, pos); 79 | } 80 | if (line.empty()) { 81 | return false; 82 | } 83 | 84 | pos = line.find('='); 85 | if (pos == std::string::npos) { 86 | return false; 87 | } 88 | auto k = fcitx::stringutils::trimView(line.substr(0, pos)); 89 | auto v = fcitx::stringutils::trimView(line.substr(pos + 1)); 90 | if (k.empty() || v.empty()) { 91 | return false; 92 | } 93 | 94 | *name = k; 95 | *value = v; 96 | return true; 97 | } 98 | 99 | //----------------------------------------------------- 100 | DllExport void UkLoadKeyMap(int fd, int keyMap[256]) { 101 | std::vector orderMap = UkLoadKeyOrderMap(fd); 102 | initKeyMap(keyMap); 103 | for (const auto &item : orderMap) { 104 | keyMap[item.key] = item.action; 105 | if (item.action < vneCount) { 106 | keyMap[tolower(item.key)] = item.action; 107 | } 108 | } 109 | } 110 | 111 | //------------------------------------------------------------------ 112 | DllExport std::vector UkLoadKeyOrderMap(int fd) { 113 | size_t lineCount = 0; 114 | int keyMap[256]; 115 | 116 | initKeyMap(keyMap); 117 | 118 | std::vector pMap; 119 | fcitx::IFDStreamBuf buf(fd); 120 | std::istream in(&buf); 121 | std::string line; 122 | while (std::getline(in, line)) { 123 | lineCount++; 124 | auto text = fcitx::stringutils::trimView(line); 125 | if (text.empty()) { 126 | continue; 127 | } 128 | std::string_view name, value; 129 | if (parseNameValue(text, &name, &value)) { 130 | if (name.size() != 1) { 131 | FCITX_ERROR() << "Error in user key layout, line " << lineCount 132 | << ": key name is not a single character"; 133 | continue; 134 | } 135 | size_t i = 0; 136 | for (; i < UkEvLabelCount; i++) { 137 | if (UkEvLabelList[i].label == value) { 138 | break; 139 | } 140 | } 141 | if (i == UkEvLabelCount) { 142 | FCITX_ERROR() << "Error in user key layout, line " << lineCount 143 | << ": command not found"; 144 | continue; 145 | } 146 | 147 | auto c = static_cast(name[0]); 148 | if (keyMap[c] != vneNormal) { 149 | // already assigned, don't accept this map 150 | break; 151 | } 152 | // cout << "key: " << c << " value: " << 153 | // UkEvLabelList[i].ev << endl; //DEBUG 154 | keyMap[c] = UkEvLabelList[i].ev; 155 | UkKeyMapping newPair; 156 | newPair.action = UkEvLabelList[i].ev; 157 | if (keyMap[c] < vneCount) { 158 | newPair.key = toupper(c); 159 | keyMap[toupper(c)] = UkEvLabelList[i].ev; 160 | } else { 161 | newPair.key = c; 162 | } 163 | pMap.push_back(newPair); 164 | } 165 | } 166 | return pMap; 167 | } 168 | 169 | DllExport void UkStoreKeyOrderMap(FILE *f, 170 | const std::vector &pMap) { 171 | int labelIndex; 172 | 173 | fputs(UkKeyMapHeader, f); 174 | for (const auto &item : pMap) { 175 | labelIndex = getLabelIndex(item.action); 176 | if (labelIndex != -1) { 177 | fprintf(f, "%c = %s\n", item.key, UkEvLabelList[labelIndex].label); 178 | } 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /unikey/usrkeymap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2000-2005 Pham Kim Long 3 | * 4 | * SPDX-License-Identifier: LGPL-2.0-or-later 5 | */ 6 | 7 | #ifndef __UNIKEY_USER_KEY_MAP_H 8 | #define __UNIKEY_USER_KEY_MAP_H 9 | 10 | #include "inputproc.h" 11 | #include 12 | #include 13 | 14 | DllInterface void UkLoadKeyMap(int fd, int keyMap[256]); 15 | DllInterface std::vector UkLoadKeyOrderMap(int fd); 16 | DllInterface void UkStoreKeyOrderMap(FILE *f, 17 | const std::vector &pMap); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /unikey/vnconv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 1998-2002 Pham Kim Long 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef __VN_CONVERT_H 8 | #define __VN_CONVERT_H 9 | 10 | #if defined(_WIN32) 11 | #if defined(UNIKEYHOOK) 12 | #define DllInterface __declspec(dllexport) 13 | #else 14 | #define DllInterface __declspec(dllimport) 15 | #endif 16 | #define DllExport __declspec(dllexport) 17 | #define DllImport __declspec(dllimport) 18 | #else 19 | #define DllInterface // not used 20 | #define DllExport 21 | #define DllImport 22 | #endif 23 | 24 | #define CONV_CHARSET_UNICODE 0 25 | #define CONV_CHARSET_UNIUTF8 1 26 | #define CONV_CHARSET_UNIREF 2 //&#D; 27 | #define CONV_CHARSET_UNIREF_HEX 3 28 | #define CONV_CHARSET_UNIDECOMPOSED 4 29 | #define CONV_CHARSET_WINCP1258 5 30 | #define CONV_CHARSET_UNI_CSTRING 6 31 | #define CONV_CHARSET_VNSTANDARD 7 32 | 33 | #define CONV_CHARSET_VIQR 10 34 | #define CONV_CHARSET_UTF8VIQR 11 35 | #define CONV_CHARSET_XUTF8 12 36 | 37 | #define CONV_CHARSET_TCVN3 20 38 | #define CONV_CHARSET_VPS 21 39 | #define CONV_CHARSET_VISCII 22 40 | #define CONV_CHARSET_BKHCM1 23 41 | #define CONV_CHARSET_VIETWAREF 24 42 | #define CONV_CHARSET_ISC 25 43 | 44 | #define CONV_CHARSET_VNIWIN 40 45 | #define CONV_CHARSET_BKHCM2 41 46 | #define CONV_CHARSET_VIETWAREX 42 47 | #define CONV_CHARSET_VNIMAC 43 48 | 49 | #define CONV_TOTAL_SINGLE_CHARSETS 6 50 | #define CONV_TOTAL_DOUBLE_CHARSETS 4 51 | 52 | #define IS_SINGLE_BYTE_CHARSET(x) \ 53 | (x >= CONV_CHARSET_TCVN3 && \ 54 | x < CONV_CHARSET_TCVN3 + CONV_TOTAL_SINGLE_CHARSETS) 55 | #define IS_DOUBLE_BYTE_CHARSET(x) \ 56 | (x >= CONV_CHARSET_VNIWIN && \ 57 | x < CONV_CHARSET_VNIWIN + CONV_TOTAL_DOUBLE_CHARSETS) 58 | 59 | typedef unsigned char UKBYTE; 60 | 61 | #if defined(__cplusplus) 62 | extern "C" { 63 | #endif 64 | DllInterface int VnConvert(int inCharset, int outCharset, UKBYTE *input, 65 | UKBYTE *output, int *pInLen, int *pMaxOutLen); 66 | 67 | DllInterface int VnFileConvert(int inCharset, int outCharset, 68 | const char *inFile, const char *outFile); 69 | 70 | #if defined(__cplusplus) 71 | } 72 | #endif 73 | 74 | DllInterface const char *VnConvErrMsg(int errCode); 75 | 76 | enum VnConvError { 77 | VNCONV_NO_ERROR, 78 | VNCONV_UNKNOWN_ERROR, 79 | VNCONV_INVALID_CHARSET, 80 | VNCONV_ERR_INPUT_FILE, 81 | VNCONV_ERR_OUTPUT_FILE, 82 | VNCONV_OUT_OF_MEMORY, 83 | VNCONV_ERR_WRITING, 84 | VNCONV_LAST_ERROR 85 | }; 86 | 87 | typedef struct _CharsetNameId CharsetNameId; 88 | 89 | struct _CharsetNameId { 90 | const char *name; 91 | int id; 92 | }; 93 | 94 | typedef struct _VnConvOptions VnConvOptions; 95 | 96 | struct _VnConvOptions { 97 | int viqrMixed; 98 | int viqrEsc; 99 | int toUpper; 100 | int toLower; 101 | int removeTone; 102 | int smartViqr; 103 | }; 104 | 105 | DllInterface void VnConvSetOptions(VnConvOptions *pOptions); 106 | DllInterface void VnConvGetOptions(VnConvOptions *pOptions); 107 | DllInterface void VnConvResetOptions(VnConvOptions *pOptions); 108 | 109 | #endif 110 | -------------------------------------------------------------------------------- /unikey/vnlexi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2000-2005 Pham Kim Long 3 | * 4 | * SPDX-License-Identifier: LGPL-2.0-or-later 5 | */ 6 | 7 | #ifndef __VN_LEXI_H 8 | #define __VN_LEXI_H 9 | 10 | enum VnLexiName { 11 | vnl_nonVnChar = -1, 12 | vnl_A, 13 | vnl_a, 14 | vnl_A1, 15 | vnl_a1, 16 | vnl_A2, 17 | vnl_a2, 18 | vnl_A3, 19 | vnl_a3, 20 | vnl_A4, 21 | vnl_a4, 22 | vnl_A5, 23 | vnl_a5, 24 | vnl_Ar, 25 | vnl_ar, 26 | vnl_Ar1, 27 | vnl_ar1, 28 | vnl_Ar2, 29 | vnl_ar2, 30 | vnl_Ar3, 31 | vnl_ar3, 32 | vnl_Ar4, 33 | vnl_ar4, 34 | vnl_Ar5, 35 | vnl_ar5, 36 | vnl_Ab, 37 | vnl_ab, 38 | vnl_Ab1, 39 | vnl_ab1, 40 | vnl_Ab2, 41 | vnl_ab2, 42 | vnl_Ab3, 43 | vnl_ab3, 44 | vnl_Ab4, 45 | vnl_ab4, 46 | vnl_Ab5, 47 | vnl_ab5, 48 | vnl_B, 49 | vnl_b, 50 | vnl_C, 51 | vnl_c, 52 | vnl_D, 53 | vnl_d, 54 | vnl_DD, 55 | vnl_dd, 56 | vnl_E, 57 | vnl_e, 58 | vnl_E1, 59 | vnl_e1, 60 | vnl_E2, 61 | vnl_e2, 62 | vnl_E3, 63 | vnl_e3, 64 | vnl_E4, 65 | vnl_e4, 66 | vnl_E5, 67 | vnl_e5, 68 | vnl_Er, 69 | vnl_er, 70 | vnl_Er1, 71 | vnl_er1, 72 | vnl_Er2, 73 | vnl_er2, 74 | vnl_Er3, 75 | vnl_er3, 76 | vnl_Er4, 77 | vnl_er4, 78 | vnl_Er5, 79 | vnl_er5, 80 | vnl_F, 81 | vnl_f, 82 | vnl_G, 83 | vnl_g, 84 | vnl_H, 85 | vnl_h, 86 | vnl_I, 87 | vnl_i, 88 | vnl_I1, 89 | vnl_i1, 90 | vnl_I2, 91 | vnl_i2, 92 | vnl_I3, 93 | vnl_i3, 94 | vnl_I4, 95 | vnl_i4, 96 | vnl_I5, 97 | vnl_i5, 98 | vnl_J, 99 | vnl_j, 100 | vnl_K, 101 | vnl_k, 102 | vnl_L, 103 | vnl_l, 104 | vnl_M, 105 | vnl_m, 106 | vnl_N, 107 | vnl_n, 108 | vnl_O, 109 | vnl_o, 110 | vnl_O1, 111 | vnl_o1, 112 | vnl_O2, 113 | vnl_o2, 114 | vnl_O3, 115 | vnl_o3, 116 | vnl_O4, 117 | vnl_o4, 118 | vnl_O5, 119 | vnl_o5, 120 | vnl_Or, 121 | vnl_or, 122 | vnl_Or1, 123 | vnl_or1, 124 | vnl_Or2, 125 | vnl_or2, 126 | vnl_Or3, 127 | vnl_or3, 128 | vnl_Or4, 129 | vnl_or4, 130 | vnl_Or5, 131 | vnl_or5, 132 | vnl_Oh, 133 | vnl_oh, 134 | vnl_Oh1, 135 | vnl_oh1, 136 | vnl_Oh2, 137 | vnl_oh2, 138 | vnl_Oh3, 139 | vnl_oh3, 140 | vnl_Oh4, 141 | vnl_oh4, 142 | vnl_Oh5, 143 | vnl_oh5, 144 | vnl_P, 145 | vnl_p, 146 | vnl_Q, 147 | vnl_q, 148 | vnl_R, 149 | vnl_r, 150 | vnl_S, 151 | vnl_s, 152 | vnl_T, 153 | vnl_t, 154 | vnl_U, 155 | vnl_u, 156 | vnl_U1, 157 | vnl_u1, 158 | vnl_U2, 159 | vnl_u2, 160 | vnl_U3, 161 | vnl_u3, 162 | vnl_U4, 163 | vnl_u4, 164 | vnl_U5, 165 | vnl_u5, 166 | vnl_Uh, 167 | vnl_uh, 168 | vnl_Uh1, 169 | vnl_uh1, 170 | vnl_Uh2, 171 | vnl_uh2, 172 | vnl_Uh3, 173 | vnl_uh3, 174 | vnl_Uh4, 175 | vnl_uh4, 176 | vnl_Uh5, 177 | vnl_uh5, 178 | vnl_V, 179 | vnl_v, 180 | vnl_W, 181 | vnl_w, 182 | vnl_X, 183 | vnl_x, 184 | vnl_Y, 185 | vnl_y, 186 | vnl_Y1, 187 | vnl_y1, 188 | vnl_Y2, 189 | vnl_y2, 190 | vnl_Y3, 191 | vnl_y3, 192 | vnl_Y4, 193 | vnl_y4, 194 | vnl_Y5, 195 | vnl_y5, 196 | vnl_Z, 197 | vnl_z, 198 | 199 | vnl_lastChar, 200 | }; 201 | 202 | enum VowelSeq { 203 | vs_nil = -1, 204 | vs_a, 205 | vs_ar, 206 | vs_ab, 207 | vs_e, 208 | vs_er, 209 | vs_i, 210 | vs_o, 211 | vs_or, 212 | vs_oh, 213 | vs_u, 214 | vs_uh, 215 | vs_y, 216 | vs_ai, 217 | vs_ao, 218 | vs_au, 219 | vs_ay, 220 | vs_aru, 221 | vs_ary, 222 | vs_eo, 223 | vs_eu, 224 | vs_eru, 225 | vs_ia, 226 | vs_ie, 227 | vs_ier, 228 | vs_iu, 229 | vs_oa, 230 | vs_oab, 231 | vs_oe, 232 | vs_oi, 233 | vs_ori, 234 | vs_ohi, 235 | vs_ua, 236 | vs_uar, 237 | vs_ue, 238 | vs_uer, 239 | vs_ui, 240 | vs_uo, 241 | vs_uor, 242 | vs_uoh, 243 | vs_uu, 244 | vs_uy, 245 | vs_uha, 246 | vs_uhi, 247 | vs_uho, 248 | vs_uhoh, 249 | vs_uhu, 250 | vs_ye, 251 | vs_yer, 252 | vs_ieu, 253 | vs_ieru, 254 | vs_oai, 255 | vs_oay, 256 | vs_oeo, 257 | vs_uay, 258 | vs_uary, 259 | vs_uoi, 260 | vs_uou, 261 | vs_uori, 262 | vs_uohi, 263 | vs_uohu, 264 | vs_uya, 265 | vs_uye, 266 | vs_uyer, 267 | vs_uyu, 268 | vs_uhoi, 269 | vs_uhou, 270 | vs_uhohi, 271 | vs_uhohu, 272 | vs_yeu, 273 | vs_yeru 274 | }; 275 | 276 | enum ConSeq { 277 | cs_nil = -1, 278 | cs_b, 279 | cs_c, 280 | cs_ch, 281 | cs_d, 282 | cs_dd, 283 | cs_dz, 284 | cs_g, 285 | cs_gh, 286 | cs_gi, 287 | cs_gin, 288 | cs_h, 289 | cs_k, 290 | cs_kh, 291 | cs_l, 292 | cs_m, 293 | cs_n, 294 | cs_ng, 295 | cs_ngh, 296 | cs_nh, 297 | cs_p, 298 | cs_ph, 299 | cs_q, 300 | cs_qu, 301 | cs_r, 302 | cs_s, 303 | cs_t, 304 | cs_th, 305 | cs_tr, 306 | cs_v, 307 | cs_x 308 | }; 309 | 310 | #endif 311 | --------------------------------------------------------------------------------