├── .clang-format ├── .formatignore ├── .gitignore ├── CMakeLists.txt ├── COPYING ├── COPYING.BSD ├── README ├── clang-format.sh ├── cmake ├── FindLibIntl.cmake └── FindXKBCommon.cmake ├── po ├── CMakeLists.txt ├── ca.po ├── da.po ├── de.po ├── es.po ├── fcitx-qt5.pot ├── fr.po ├── ja.po ├── ko.po ├── ru.po ├── zh_CN.po └── zh_TW.po ├── qt5 ├── CMakeLists.txt ├── dbusaddons │ ├── CMakeLists.txt │ ├── FcitxQt5DBusAddonsConfig.cmake.in │ ├── fcitxqtconnection.cpp │ ├── fcitxqtconnection.h │ ├── fcitxqtconnection_p.h │ ├── fcitxqtformattedpreedit.cpp │ ├── fcitxqtformattedpreedit.h │ ├── fcitxqtinputcontextproxy.cpp │ ├── fcitxqtinputcontextproxy.h │ ├── fcitxqtinputmethoditem.cpp │ ├── fcitxqtinputmethoditem.h │ ├── fcitxqtinputmethodproxy.cpp │ ├── fcitxqtinputmethodproxy.h │ ├── fcitxqtkeyboardlayout.cpp │ ├── fcitxqtkeyboardlayout.h │ ├── fcitxqtkeyboardproxy.cpp │ ├── fcitxqtkeyboardproxy.h │ ├── gen_dbus.sh │ └── interfaces │ │ ├── org.fcitx.Fcitx.InputContext.xml │ │ ├── org.fcitx.Fcitx.InputMethod.xml │ │ └── org.fcitx.Fcitx.Keyboard.xml ├── guiwrapper │ ├── CMakeLists.txt │ ├── common.h │ ├── main.cpp │ ├── mainwindow.cpp │ ├── mainwindow.h │ ├── mainwindow.ui │ ├── wrapperapp.cpp │ └── wrapperapp.h ├── platforminputcontext │ ├── CMakeLists.txt │ ├── fcitx.json │ ├── fcitxinputcontextproxy.cpp │ ├── fcitxinputcontextproxy.h │ ├── fcitxqtdbustypes.cpp │ ├── fcitxqtdbustypes.h │ ├── fcitxwatcher.cpp │ ├── fcitxwatcher.h │ ├── main.cpp │ ├── main.h │ ├── org.fcitx.Fcitx.InputContext.xml │ ├── org.fcitx.Fcitx.InputContext1.xml │ ├── org.fcitx.Fcitx.InputMethod.xml │ ├── org.fcitx.Fcitx.InputMethod1.xml │ ├── qfcitxplatforminputcontext.cpp │ ├── qfcitxplatforminputcontext.h │ ├── qtkey.cpp │ └── qtkey.h ├── quickphrase-editor │ ├── CMakeLists.txt │ ├── batchdialog.cpp │ ├── batchdialog.h │ ├── batchdialog.ui │ ├── common.h │ ├── editor.cpp │ ├── editor.h │ ├── editor.ui │ ├── editordialog.cpp │ ├── editordialog.h │ ├── editordialog.ui │ ├── filelistmodel.cpp │ ├── filelistmodel.h │ ├── main.cpp │ ├── main.h │ ├── model.cpp │ ├── model.h │ └── quickphrase-editor.json └── widgetsaddons │ ├── CMakeLists.txt │ ├── FcitxQt5WidgetsAddonsConfig.cmake.in │ ├── fcitxqtconfiguifactory.cpp │ ├── fcitxqtconfiguifactory.h │ ├── fcitxqtconfiguifactory_p.h │ ├── fcitxqtconfiguiplugin.cpp │ ├── fcitxqtconfiguiplugin.h │ ├── fcitxqtconfiguiwidget.cpp │ ├── fcitxqtconfiguiwidget.h │ ├── fcitxqtkeysequencewidget.cpp │ ├── fcitxqtkeysequencewidget.h │ ├── fcitxqtkeysequencewidget_p.h │ ├── qtkeytrans.cpp │ ├── qtkeytrans.h │ └── qtkeytransdata.h └── qt6 ├── CMakeLists.txt └── platforminputcontext ├── CMakeLists.txt ├── fcitx.json ├── fcitxinputcontextproxy.cpp ├── fcitxinputcontextproxy.h ├── fcitxqtdbustypes.cpp ├── fcitxqtdbustypes.h ├── fcitxwatcher.cpp ├── fcitxwatcher.h ├── main.cpp ├── main.h ├── org.fcitx.Fcitx.InputContext.xml ├── org.fcitx.Fcitx.InputContext1.xml ├── org.fcitx.Fcitx.InputMethod.xml ├── org.fcitx.Fcitx.InputMethod1.xml ├── qfcitxplatforminputcontext.cpp ├── qfcitxplatforminputcontext.h ├── qtkey.cpp └── qtkey.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: [ foreach, Q_FOREACH, BOOST_FOREACH ] 54 | SpaceBeforeParens: ControlStatements 55 | DisableFormat: false 56 | SortIncludes: true 57 | ... 58 | 59 | -------------------------------------------------------------------------------- /.formatignore: -------------------------------------------------------------------------------- 1 | fcitxqtkeyboardproxy.cpp 2 | fcitxqtinputcontextproxy.h 3 | fcitxqtinputmethodproxy.cpp 4 | fcitxqtinputmethodproxy.h 5 | fcitxqtinputcontextproxy.cpp 6 | fcitxqtkeyboardproxy.h 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | build/* 3 | *.kdev4 4 | .kdev_include_paths 5 | .directory 6 | *.kate-swp 7 | *.orig 8 | tags 9 | run.sh 10 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.1) 2 | 3 | project(fcitx-qt5) 4 | 5 | set(FcitxQt5_VERSION 1.1.0) 6 | set(REQUIRED_QT_VERSION 5.1.0) 7 | set(REQUIRED_QT6_VERSION 6.0.0) 8 | 9 | find_package(ECM 1.4.0 REQUIRED NO_MODULE) 10 | 11 | set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) 12 | 13 | option(ENABLE_QT5 "Enable Qt5" On) 14 | option(ENABLE_QT6 "Enable Qt6 im module" Off) 15 | option(ENABLE_LIBRARY "Qt library" On) 16 | 17 | include(GNUInstallDirs) 18 | include(FeatureSummary) 19 | include(GenerateExportHeader) 20 | include(CMakePackageConfigHelpers) 21 | include(ECMSetupVersion) 22 | include(ECMGenerateHeaders) 23 | 24 | set(CMAKE_CXX_EXTENSIONS OFF) 25 | set(CMAKE_CXX_STANDARD_REQUIRED TRUE) 26 | set(CMAKE_CXX_STANDARD 11) 27 | 28 | set(CMAKE_C_FLAGS "-Wall -Wextra ${CMAKE_C_FLAGS}") 29 | set(CMAKE_CXX_FLAGS "-Wall -Wextra ${CMAKE_CXX_FLAGS}") 30 | set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined -Wl,--as-needed ${CMAKE_SHARED_LINKER_FLAGS}") 31 | set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined -Wl,--as-needed ${CMAKE_MODULE_LINKER_FLAGS}") 32 | 33 | set(CMAKE_C_VISIBILITY_PRESET hidden) 34 | set(CMAKE_CXX_VISIBILITY_PRESET hidden) 35 | set(CMAKE_VISIBILITY_INLINES_HIDDEN On) 36 | 37 | if (POLICY CMP0063) 38 | # No sane project should be affected by CMP0063, so suppress the warnings 39 | # generated by the above visibility settings in CMake >= 3.3 40 | cmake_policy(SET CMP0063 NEW) 41 | endif() 42 | 43 | find_package(XKBCommon 0.5.0 REQUIRED COMPONENTS XKBCommon) 44 | 45 | if (ENABLE_LIBRARY) 46 | find_package(Fcitx 4.2.8 REQUIRED) 47 | find_package(LibIntl REQUIRED) 48 | add_subdirectory(po) 49 | endif () 50 | 51 | if(ENABLE_QT5) 52 | add_subdirectory(qt5) 53 | endif() 54 | 55 | if(ENABLE_QT6) 56 | add_subdirectory(qt6) 57 | endif() 58 | 59 | feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) 60 | -------------------------------------------------------------------------------- /COPYING.BSD: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017, CSSlayer 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the authors nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Fcitx Qt5 Input Context 2 | 3 | The platform input context plugin is released under 3-Clause BSD License. 4 | Other libraries are released under GPL2+. 5 | -------------------------------------------------------------------------------- /clang-format.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | find . \( -not \( -name 'fcitxqt*proxy.h' -o -name 'fcitxqt*proxy.cpp' \) \) -a \( -name '*.h' -o -name '*.cpp' \) | xargs clang-format -i 3 | -------------------------------------------------------------------------------- /cmake/FindLibIntl.cmake: -------------------------------------------------------------------------------- 1 | # - find where dlopen and friends are located. 2 | # LibIntl_FOUND - system has dynamic linking interface available 3 | # LibIntl_INCLUDE_DIR - where dlfcn.h is located. 4 | # LibIntl_LIBRARY - libraries needed to use dlopen 5 | 6 | include(CheckFunctionExists) 7 | 8 | find_path(LibIntl_INCLUDE_DIR NAMES libintl.h) 9 | find_library(LibIntl_LIBRARY NAMES intl) 10 | if(LibIntl_LIBRARY) 11 | set(LibIntl_FOUND TRUE) 12 | else(LibIntl_LIBRARY) 13 | check_function_exists(dgettext LibIntl_FOUND) 14 | # If dlopen can be found without linking in dl then dlopen is part 15 | # of libc, so don't need to link extra libs. 16 | set(LibIntl_LIBRARY "") 17 | endif(LibIntl_LIBRARY) 18 | 19 | include(FindPackageHandleStandardArgs) 20 | find_package_handle_standard_args(LibIntl 21 | FOUND_VAR 22 | LibIntl_FOUND 23 | REQUIRED_VARS 24 | LibIntl_INCLUDE_DIR 25 | ) 26 | 27 | mark_as_advanced(LibIntl_INCLUDE_DIR LibIntl_LIBRARY) 28 | 29 | if(LibIntl_FOUND AND NOT TARGET LibIntl::LibIntl) 30 | if (LibIntl_LIBRARY) 31 | add_library(LibIntl::LibIntl UNKNOWN IMPORTED) 32 | set_target_properties(LibIntl::LibIntl PROPERTIES 33 | IMPORTED_LOCATION "${LibIntl_LIBRARY}") 34 | else() 35 | add_library(LibIntl::LibIntl INTERFACE IMPORTED ) 36 | endif() 37 | set_target_properties(LibIntl::LibIntl PROPERTIES 38 | INTERFACE_INCLUDE_DIRECTORIES "${LibIntl_INCLUDE_DIR}" 39 | ) 40 | endif() 41 | 42 | -------------------------------------------------------------------------------- /cmake/FindXKBCommon.cmake: -------------------------------------------------------------------------------- 1 | 2 | include(ECMFindModuleHelpersStub) 3 | 4 | ecm_find_package_version_check(XKBCommon) 5 | 6 | # Note that this list needs to be ordered such that any component 7 | # appears after its dependencies 8 | set(XKBCommon_known_components 9 | XKBCommon 10 | X11) 11 | 12 | set(XKBCommon_XKBCommon_component_deps) 13 | set(XKBCommon_XKBCommon_pkg_config "xkbcommon") 14 | set(XKBCommon_XKBCommon_lib "xkbcommon") 15 | set(XKBCommon_XKBCommon_header "xkbcommon/xkbcommon.h") 16 | 17 | set(XKBCommon_X11_component_deps XKBCommon) 18 | set(XKBCommon_X11_pkg_config "xkbcommon-x11") 19 | set(XKBCommon_X11_lib "xkbcommon-x11") 20 | set(XKBCommon_X11_header "xkbcommon/xkbcommon-x11.h") 21 | 22 | ecm_find_package_parse_components(XKBCommon 23 | RESULT_VAR XKBCommon_components 24 | KNOWN_COMPONENTS ${XKBCommon_known_components} 25 | ) 26 | ecm_find_package_handle_library_components(XKBCommon 27 | COMPONENTS ${XKBCommon_components} 28 | ) 29 | 30 | find_package_handle_standard_args(XKBCommon 31 | FOUND_VAR 32 | XKBCommon_FOUND 33 | REQUIRED_VARS 34 | XKBCommon_LIBRARIES 35 | VERSION_VAR 36 | XKBCommon_VERSION 37 | HANDLE_COMPONENTS 38 | ) 39 | 40 | include(FeatureSummary) 41 | set_package_properties(XKBCommon PROPERTIES 42 | URL "http://xkbcommon.org" 43 | DESCRIPTION "Keyboard handling library using XKB data" 44 | ) 45 | -------------------------------------------------------------------------------- /po/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB PO_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" *.po) 2 | 3 | foreach(po_file ${PO_FILES}) 4 | string(REPLACE ".po" "" po_lang "${po_file}") 5 | fcitx_translate_add_po_file("${po_lang}" "${po_file}") 6 | endforeach() 7 | fcitx_translate_set_pot_target(pot fcitx-qt5 fcitx-qt5.pot) 8 | -------------------------------------------------------------------------------- /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 PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # csslayer , 2017 8 | # Robert Antoni Buj Gelonch , 2017 9 | # 10 | #, fuzzy 11 | msgid "" 12 | msgstr "" 13 | "Project-Id-Version: PACKAGE VERSION\n" 14 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 15 | "POT-Creation-Date: 2019-11-03 12:28-0800\n" 16 | "PO-Revision-Date: 2017-09-30 02:01+0000\n" 17 | "Last-Translator: Robert Antoni Buj Gelonch , 2017\n" 18 | "Language-Team: Catalan (https://www.transifex.com/fcitx/teams/12005/ca/)\n" 19 | "Language: ca\n" 20 | "MIME-Version: 1.0\n" 21 | "Content-Type: text/plain; charset=UTF-8\n" 22 | "Content-Transfer-Encoding: 8bit\n" 23 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 24 | 25 | #: quickphrase-editor/editor.cpp:300 26 | #, kde-format 27 | msgid "%1 is a system file, do you want to delete all phrases instead?" 28 | msgstr "%1 és un fitxer de sistema, voleu eliminar en canvi totes les frases?" 29 | 30 | #: quickphrase-editor/editor.cpp:48 31 | msgid "&Add" 32 | msgstr "&Afegeix" 33 | 34 | #: quickphrase-editor/editor.cpp:49 35 | msgid "&Batch Edit" 36 | msgstr "Edició per &lots" 37 | 38 | #: guiwrapper/mainwindow.cpp:42 39 | msgid "&Close" 40 | msgstr "Tan&ca" 41 | 42 | #: quickphrase-editor/editor.cpp:50 43 | msgid "&Delete" 44 | msgstr "&Elimina" 45 | 46 | #: quickphrase-editor/editor.cpp:52 47 | msgid "&Import" 48 | msgstr "&Importa" 49 | 50 | #: quickphrase-editor/editor.cpp:54 51 | msgid "&Operation" 52 | msgstr "&Operació" 53 | 54 | #: guiwrapper/mainwindow.cpp:41 55 | msgid "&Reset" 56 | msgstr "&Restableix" 57 | 58 | #: guiwrapper/mainwindow.cpp:40 59 | msgid "&Save" 60 | msgstr "De&sa" 61 | 62 | #: quickphrase-editor/editor.cpp:65 63 | msgid "Add File" 64 | msgstr "Afegeix un fitxer" 65 | 66 | #: quickphrase-editor/editor.cpp:311 67 | #, kde-format 68 | msgid "Are you sure to delete %1?" 69 | msgstr "Segur que voleu eliminar %1?" 70 | 71 | #: quickphrase-editor/editor.cpp:277 72 | #, kde-format 73 | msgid "Cannot create file %1." 74 | msgstr "No es pot crear el fitxer %1." 75 | 76 | #: quickphrase-editor/editor.cpp:299 77 | msgid "Cannot remove system file" 78 | msgstr "No es pot eliminar el fitxer de sistema" 79 | 80 | #: quickphrase-editor/editor.cpp:310 81 | msgid "Confirm deletion" 82 | msgstr "Confirma l'eliminació" 83 | 84 | #: quickphrase-editor/editor.cpp:260 85 | msgid "Create new file" 86 | msgstr "Crea un fitxer nou" 87 | 88 | #: quickphrase-editor/editor.cpp:51 89 | msgid "De&lete All" 90 | msgstr "E&limina tot" 91 | 92 | #: quickphrase-editor/filelistmodel.cpp:42 93 | msgid "Default" 94 | msgstr "Per defecte" 95 | 96 | #: quickphrase-editor/editor.cpp:53 97 | msgid "E&xport" 98 | msgstr "E&xporta" 99 | 100 | #: quickphrase-editor/editor.cpp:318 101 | #, kde-format 102 | msgid "Error while deleting %1." 103 | msgstr "S'ha produït un error quan s'estava eliminant %1." 104 | 105 | #: quickphrase-editor/editor.cpp:276 quickphrase-editor/editor.cpp:317 106 | msgid "File Operation Failed" 107 | msgstr "Ha fallat l'operació de fitxer" 108 | 109 | #: quickphrase-editor/editor.cpp:265 110 | msgid "File name should not contain '/'." 111 | msgstr "El nom de fitxer no hauria de contenir «'»." 112 | 113 | #: quickphrase-editor/editor.cpp:264 114 | msgid "Invalid filename" 115 | msgstr "Nom de fitxer no vàlid" 116 | 117 | #: quickphrase-editor/model.cpp:47 118 | msgid "Keyword" 119 | msgstr "Paraula clau" 120 | 121 | #: quickphrase-editor/editordialog.cpp:28 122 | msgid "Keyword:" 123 | msgstr "Paraula clau:" 124 | 125 | #: quickphrase-editor/model.cpp:49 126 | msgid "Phrase" 127 | msgstr "Frase" 128 | 129 | #: quickphrase-editor/editordialog.cpp:29 130 | msgid "Phrase:" 131 | msgstr "Frase:" 132 | 133 | #: quickphrase-editor/editor.cpp:260 134 | msgid "Please input a filename for newfile" 135 | msgstr "Si us plau entre un nom de fitxer per al fitxer nou" 136 | 137 | #: quickphrase-editor/editor.cpp:138 138 | msgid "Quick Phrase Editor" 139 | msgstr "Editor ràpid de frases" 140 | 141 | #: quickphrase-editor/editor.cpp:68 142 | msgid "Refresh List" 143 | msgstr "Actualitza la llista" 144 | 145 | #: quickphrase-editor/editor.cpp:66 146 | msgid "Remove File" 147 | msgstr "Elimina un fitxer" 148 | 149 | #: quickphrase-editor/editor.cpp:122 150 | msgid "Save Changes" 151 | msgstr "Desa els canvis" 152 | 153 | #: quickphrase-editor/editor.cpp:123 154 | msgid "" 155 | "The content has changed.\n" 156 | "Do you want to save the changes or discard them?" 157 | msgstr "" 158 | "El contingut ha canviat.\n" 159 | "Voleu desar els canvis o descartar-los?" 160 | 161 | #: quickphrase-editor/batchdialog.cpp:31 162 | msgid "Use format on every line." 163 | msgstr "Utilitza el format en cada línia." 164 | -------------------------------------------------------------------------------- /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 PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # csslayer , 2017 8 | # scootergrisen, 2020 9 | # 10 | #, fuzzy 11 | msgid "" 12 | msgstr "" 13 | "Project-Id-Version: PACKAGE VERSION\n" 14 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 15 | "POT-Creation-Date: 2020-10-15 00:02-0700\n" 16 | "PO-Revision-Date: 2017-09-30 02:01+0000\n" 17 | "Last-Translator: scootergrisen, 2020\n" 18 | "Language-Team: Danish (https://www.transifex.com/fcitx/teams/12005/da/)\n" 19 | "Language: da\n" 20 | "MIME-Version: 1.0\n" 21 | "Content-Type: text/plain; charset=UTF-8\n" 22 | "Content-Transfer-Encoding: 8bit\n" 23 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 24 | 25 | #: quickphrase-editor/editor.cpp:300 26 | #, kde-format 27 | msgid "%1 is a system file, do you want to delete all phrases instead?" 28 | msgstr "%1 er en systemfil - vil du slette alle fraser i stedet?" 29 | 30 | #: quickphrase-editor/editor.cpp:48 31 | msgid "&Add" 32 | msgstr "&Tilføj" 33 | 34 | #: quickphrase-editor/editor.cpp:49 35 | msgid "&Batch Edit" 36 | msgstr "&Batchredigering" 37 | 38 | #: guiwrapper/mainwindow.cpp:42 39 | msgid "&Close" 40 | msgstr "&Luk" 41 | 42 | #: quickphrase-editor/editor.cpp:50 43 | msgid "&Delete" 44 | msgstr "&Slet" 45 | 46 | #: quickphrase-editor/editor.cpp:52 47 | msgid "&Import" 48 | msgstr "&Importér" 49 | 50 | #: quickphrase-editor/editor.cpp:54 51 | msgid "&Operation" 52 | msgstr "&Handling" 53 | 54 | #: guiwrapper/mainwindow.cpp:41 55 | msgid "&Reset" 56 | msgstr "&Nulstil" 57 | 58 | #: guiwrapper/mainwindow.cpp:40 59 | msgid "&Save" 60 | msgstr "&Gem" 61 | 62 | #: quickphrase-editor/editor.cpp:65 63 | msgid "Add File" 64 | msgstr "Tilføj fil" 65 | 66 | #: quickphrase-editor/editor.cpp:311 67 | #, kde-format 68 | msgid "Are you sure to delete %1?" 69 | msgstr "Er du sikker på, at du vil slette %1?" 70 | 71 | #: quickphrase-editor/editor.cpp:277 72 | #, kde-format 73 | msgid "Cannot create file %1." 74 | msgstr "Kan ikke oprette filen %1." 75 | 76 | #: quickphrase-editor/editor.cpp:299 77 | msgid "Cannot remove system file" 78 | msgstr "Kan ikke fjerne systemfilen" 79 | 80 | #: quickphrase-editor/editor.cpp:310 81 | msgid "Confirm deletion" 82 | msgstr "Bekræft sletning" 83 | 84 | #: quickphrase-editor/editor.cpp:260 85 | msgid "Create new file" 86 | msgstr "Opret ny fil" 87 | 88 | #: quickphrase-editor/editor.cpp:51 89 | msgid "De&lete All" 90 | msgstr "Slet &alle" 91 | 92 | #: quickphrase-editor/filelistmodel.cpp:42 93 | msgid "Default" 94 | msgstr "Standard" 95 | 96 | #: quickphrase-editor/editor.cpp:53 97 | msgid "E&xport" 98 | msgstr "&Eksportér" 99 | 100 | #: quickphrase-editor/editor.cpp:318 101 | #, kde-format 102 | msgid "Error while deleting %1." 103 | msgstr "Fejl under sletning af %1." 104 | 105 | #: quickphrase-editor/editor.cpp:276 quickphrase-editor/editor.cpp:317 106 | msgid "File Operation Failed" 107 | msgstr "Filhandlingen mislykkedes" 108 | 109 | #: quickphrase-editor/editor.cpp:265 110 | msgid "File name should not contain '/'." 111 | msgstr "Filnavnet må ikke indeholde '/'." 112 | 113 | #: quickphrase-editor/editor.cpp:264 114 | msgid "Invalid filename" 115 | msgstr "Ugyldigt filnavn" 116 | 117 | #: quickphrase-editor/model.cpp:47 118 | msgid "Keyword" 119 | msgstr "Nøgleord" 120 | 121 | #: quickphrase-editor/editordialog.cpp:28 122 | msgid "Keyword:" 123 | msgstr "Nøgleord:" 124 | 125 | #: quickphrase-editor/model.cpp:49 126 | msgid "Phrase" 127 | msgstr "Frase" 128 | 129 | #: quickphrase-editor/editordialog.cpp:29 130 | msgid "Phrase:" 131 | msgstr "Frase:" 132 | 133 | #: quickphrase-editor/editor.cpp:260 134 | msgid "Please input a filename for newfile" 135 | msgstr "Skriv venligst et filnavn til den nye fil" 136 | 137 | #: quickphrase-editor/editor.cpp:138 138 | msgid "Quick Phrase Editor" 139 | msgstr "Hurtig fraseredigering" 140 | 141 | #: quickphrase-editor/editor.cpp:68 142 | msgid "Refresh List" 143 | msgstr "Genopfrisk liste" 144 | 145 | #: quickphrase-editor/editor.cpp:66 146 | msgid "Remove File" 147 | msgstr "Fjern fil" 148 | 149 | #: quickphrase-editor/editor.cpp:122 150 | msgid "Save Changes" 151 | msgstr "Gem ændringer" 152 | 153 | #: quickphrase-editor/editor.cpp:123 154 | msgid "" 155 | "The content has changed.\n" 156 | "Do you want to save the changes or discard them?" 157 | msgstr "" 158 | "Indholdet er blevet ændret.\n" 159 | "Vil du gemme ændringerne eller forkaste dem?" 160 | 161 | #: quickphrase-editor/batchdialog.cpp:31 162 | msgid "Use format on every line." 163 | msgstr "Brug formatet på hver linje." 164 | -------------------------------------------------------------------------------- /po/es.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 PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 11 | "POT-Creation-Date: 2022-05-23 20:28+0000\n" 12 | "PO-Revision-Date: 2017-09-30 02:01+0000\n" 13 | "Language-Team: Spanish (https://www.transifex.com/fcitx/teams/12005/es/)\n" 14 | "Language: es\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? " 19 | "1 : 2;\n" 20 | 21 | #: qt5/quickphrase-editor/editor.cpp:300 22 | #, kde-format 23 | msgid "%1 is a system file, do you want to delete all phrases instead?" 24 | msgstr "" 25 | 26 | #: qt5/quickphrase-editor/editor.cpp:48 27 | msgid "&Add" 28 | msgstr "" 29 | 30 | #: qt5/quickphrase-editor/editor.cpp:49 31 | msgid "&Batch Edit" 32 | msgstr "" 33 | 34 | #: qt5/guiwrapper/mainwindow.cpp:42 35 | msgid "&Close" 36 | msgstr "" 37 | 38 | #: qt5/quickphrase-editor/editor.cpp:50 39 | msgid "&Delete" 40 | msgstr "" 41 | 42 | #: qt5/quickphrase-editor/editor.cpp:52 43 | msgid "&Import" 44 | msgstr "" 45 | 46 | #: qt5/quickphrase-editor/editor.cpp:54 47 | msgid "&Operation" 48 | msgstr "" 49 | 50 | #: qt5/guiwrapper/mainwindow.cpp:41 51 | msgid "&Reset" 52 | msgstr "" 53 | 54 | #: qt5/guiwrapper/mainwindow.cpp:40 55 | msgid "&Save" 56 | msgstr "" 57 | 58 | #: qt5/quickphrase-editor/editor.cpp:65 59 | msgid "Add File" 60 | msgstr "" 61 | 62 | #: qt5/quickphrase-editor/editor.cpp:311 63 | #, kde-format 64 | msgid "Are you sure to delete %1?" 65 | msgstr "" 66 | 67 | #: qt5/quickphrase-editor/editor.cpp:277 68 | #, kde-format 69 | msgid "Cannot create file %1." 70 | msgstr "" 71 | 72 | #: qt5/quickphrase-editor/editor.cpp:299 73 | msgid "Cannot remove system file" 74 | msgstr "" 75 | 76 | #: qt5/quickphrase-editor/editor.cpp:310 77 | msgid "Confirm deletion" 78 | msgstr "" 79 | 80 | #: qt5/quickphrase-editor/editor.cpp:260 81 | msgid "Create new file" 82 | msgstr "" 83 | 84 | #: qt5/quickphrase-editor/editor.cpp:51 85 | msgid "De&lete All" 86 | msgstr "" 87 | 88 | #: qt5/quickphrase-editor/filelistmodel.cpp:42 89 | msgid "Default" 90 | msgstr "" 91 | 92 | #: qt5/quickphrase-editor/editor.cpp:53 93 | msgid "E&xport" 94 | msgstr "" 95 | 96 | #: qt5/quickphrase-editor/editor.cpp:318 97 | #, kde-format 98 | msgid "Error while deleting %1." 99 | msgstr "" 100 | 101 | #: qt5/quickphrase-editor/editor.cpp:276 qt5/quickphrase-editor/editor.cpp:317 102 | msgid "File Operation Failed" 103 | msgstr "" 104 | 105 | #: qt5/quickphrase-editor/editor.cpp:265 106 | msgid "File name should not contain '/'." 107 | msgstr "" 108 | 109 | #: qt5/quickphrase-editor/editor.cpp:264 110 | msgid "Invalid filename" 111 | msgstr "" 112 | 113 | #: qt5/quickphrase-editor/model.cpp:47 114 | msgid "Keyword" 115 | msgstr "" 116 | 117 | #: qt5/quickphrase-editor/editordialog.cpp:28 118 | msgid "Keyword:" 119 | msgstr "" 120 | 121 | #: qt5/quickphrase-editor/model.cpp:49 122 | msgid "Phrase" 123 | msgstr "" 124 | 125 | #: qt5/quickphrase-editor/editordialog.cpp:29 126 | msgid "Phrase:" 127 | msgstr "" 128 | 129 | #: qt5/quickphrase-editor/editor.cpp:260 130 | msgid "Please input a filename for newfile" 131 | msgstr "" 132 | 133 | #: qt5/quickphrase-editor/editor.cpp:138 134 | msgid "Quick Phrase Editor" 135 | msgstr "" 136 | 137 | #: qt5/quickphrase-editor/editor.cpp:68 138 | msgid "Refresh List" 139 | msgstr "" 140 | 141 | #: qt5/quickphrase-editor/editor.cpp:66 142 | msgid "Remove File" 143 | msgstr "" 144 | 145 | #: qt5/quickphrase-editor/editor.cpp:122 146 | msgid "Save Changes" 147 | msgstr "" 148 | 149 | #: qt5/quickphrase-editor/editor.cpp:123 150 | msgid "" 151 | "The content has changed.\n" 152 | "Do you want to save the changes or discard them?" 153 | msgstr "" 154 | 155 | #: qt5/quickphrase-editor/batchdialog.cpp:31 156 | msgid "Use format on every line." 157 | msgstr "" 158 | -------------------------------------------------------------------------------- /po/fcitx-qt5.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 11 | "POT-Creation-Date: 2017-09-28 18:15-0700\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: LANG\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=utf-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: guiwrapper/mainwindow.cpp:42 21 | msgid "&Save" 22 | msgstr "" 23 | 24 | #: guiwrapper/mainwindow.cpp:43 25 | msgid "&Reset" 26 | msgstr "" 27 | 28 | #: guiwrapper/mainwindow.cpp:44 29 | msgid "&Close" 30 | msgstr "" 31 | 32 | #: quickphrase-editor/batchdialog.cpp:31 33 | msgid "Use format on every line." 34 | msgstr "" 35 | 36 | #: quickphrase-editor/editor.cpp:51 37 | msgid "&Add" 38 | msgstr "" 39 | 40 | #: quickphrase-editor/editor.cpp:52 41 | msgid "&Batch Edit" 42 | msgstr "" 43 | 44 | #: quickphrase-editor/editor.cpp:53 45 | msgid "&Delete" 46 | msgstr "" 47 | 48 | #: quickphrase-editor/editor.cpp:54 49 | msgid "De&lete All" 50 | msgstr "" 51 | 52 | #: quickphrase-editor/editor.cpp:55 53 | msgid "&Import" 54 | msgstr "" 55 | 56 | #: quickphrase-editor/editor.cpp:56 57 | msgid "E&xport" 58 | msgstr "" 59 | 60 | #: quickphrase-editor/editor.cpp:57 61 | msgid "&Operation" 62 | msgstr "" 63 | 64 | #: quickphrase-editor/editor.cpp:68 65 | msgid "Add File" 66 | msgstr "" 67 | 68 | #: quickphrase-editor/editor.cpp:69 69 | msgid "Remove File" 70 | msgstr "" 71 | 72 | #: quickphrase-editor/editor.cpp:70 73 | msgid "Refresh List" 74 | msgstr "" 75 | 76 | #: quickphrase-editor/editor.cpp:131 77 | msgid "Save Changes" 78 | msgstr "" 79 | 80 | #: quickphrase-editor/editor.cpp:132 81 | msgid "" 82 | "The content has changed.\n" 83 | "Do you want to save the changes or discard them?" 84 | msgstr "" 85 | 86 | #: quickphrase-editor/editor.cpp:148 87 | msgid "Quick Phrase Editor" 88 | msgstr "" 89 | 90 | #: quickphrase-editor/editor.cpp:279 91 | msgid "Create new file" 92 | msgstr "" 93 | 94 | #: quickphrase-editor/editor.cpp:280 95 | msgid "Please input a filename for newfile" 96 | msgstr "" 97 | 98 | #: quickphrase-editor/editor.cpp:285 99 | msgid "Invalid filename" 100 | msgstr "" 101 | 102 | #: quickphrase-editor/editor.cpp:285 103 | msgid "File name should not contain '/'." 104 | msgstr "" 105 | 106 | #: quickphrase-editor/editor.cpp:295 quickphrase-editor/editor.cpp:342 107 | msgid "File Operation Failed" 108 | msgstr "" 109 | 110 | #: quickphrase-editor/editor.cpp:296 111 | #, kde-format 112 | msgid "Cannot create file %1." 113 | msgstr "" 114 | 115 | #: quickphrase-editor/editor.cpp:322 116 | msgid "Cannot remove system file" 117 | msgstr "" 118 | 119 | #: quickphrase-editor/editor.cpp:323 120 | #, kde-format 121 | msgid "%1 is a system file, do you want to delete all phrases instead?" 122 | msgstr "" 123 | 124 | #: quickphrase-editor/editor.cpp:334 125 | msgid "Confirm deletion" 126 | msgstr "" 127 | 128 | #: quickphrase-editor/editor.cpp:335 129 | #, kde-format 130 | msgid "Are you sure to delete %1?" 131 | msgstr "" 132 | 133 | #: quickphrase-editor/editor.cpp:343 134 | #, kde-format 135 | msgid "Error while deleting %1." 136 | msgstr "" 137 | 138 | #: quickphrase-editor/editordialog.cpp:30 139 | msgid "Keyword:" 140 | msgstr "" 141 | 142 | #: quickphrase-editor/editordialog.cpp:31 143 | msgid "Phrase:" 144 | msgstr "" 145 | 146 | #: quickphrase-editor/filelistmodel.cpp:47 147 | msgid "Default" 148 | msgstr "" 149 | 150 | #: quickphrase-editor/model.cpp:56 151 | msgid "Keyword" 152 | msgstr "" 153 | 154 | #: quickphrase-editor/model.cpp:58 155 | msgid "Phrase" 156 | msgstr "" 157 | -------------------------------------------------------------------------------- /po/fr.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 PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # roxfr , 2022 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: PACKAGE VERSION\n" 13 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 14 | "POT-Creation-Date: 2022-05-28 20:27+0000\n" 15 | "PO-Revision-Date: 2017-09-30 02:01+0000\n" 16 | "Last-Translator: roxfr , 2022\n" 17 | "Language-Team: French (https://www.transifex.com/fcitx/teams/12005/fr/)\n" 18 | "Language: fr\n" 19 | "MIME-Version: 1.0\n" 20 | "Content-Type: text/plain; charset=UTF-8\n" 21 | "Content-Transfer-Encoding: 8bit\n" 22 | "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " 23 | "1000000 == 0 ? 1 : 2;\n" 24 | 25 | #: qt5/quickphrase-editor/editor.cpp:300 26 | #, kde-format 27 | msgid "%1 is a system file, do you want to delete all phrases instead?" 28 | msgstr "" 29 | "%1 est un fichier système, voulez-vous plutôt supprimer toutes les phrases ?" 30 | 31 | #: qt5/quickphrase-editor/editor.cpp:48 32 | msgid "&Add" 33 | msgstr "&Ajouter" 34 | 35 | #: qt5/quickphrase-editor/editor.cpp:49 36 | msgid "&Batch Edit" 37 | msgstr "&Éditer par lots" 38 | 39 | #: qt5/guiwrapper/mainwindow.cpp:42 40 | msgid "&Close" 41 | msgstr "&Fermer" 42 | 43 | #: qt5/quickphrase-editor/editor.cpp:50 44 | msgid "&Delete" 45 | msgstr "&Effacer" 46 | 47 | #: qt5/quickphrase-editor/editor.cpp:52 48 | msgid "&Import" 49 | msgstr "&Importer" 50 | 51 | #: qt5/quickphrase-editor/editor.cpp:54 52 | msgid "&Operation" 53 | msgstr "&Opération" 54 | 55 | #: qt5/guiwrapper/mainwindow.cpp:41 56 | msgid "&Reset" 57 | msgstr "&Réinitialiser" 58 | 59 | #: qt5/guiwrapper/mainwindow.cpp:40 60 | msgid "&Save" 61 | msgstr "&Sauvegarder" 62 | 63 | #: qt5/quickphrase-editor/editor.cpp:65 64 | msgid "Add File" 65 | msgstr "Ajouter un fichier" 66 | 67 | #: qt5/quickphrase-editor/editor.cpp:311 68 | #, kde-format 69 | msgid "Are you sure to delete %1?" 70 | msgstr "Êtes-vous sûr de vouloir supprimer %1 ?" 71 | 72 | #: qt5/quickphrase-editor/editor.cpp:277 73 | #, kde-format 74 | msgid "Cannot create file %1." 75 | msgstr "Impossible de créer le fichier %1." 76 | 77 | #: qt5/quickphrase-editor/editor.cpp:299 78 | msgid "Cannot remove system file" 79 | msgstr "Impossible de supprimer le fichier système" 80 | 81 | #: qt5/quickphrase-editor/editor.cpp:310 82 | msgid "Confirm deletion" 83 | msgstr "Confirmer la suppression" 84 | 85 | #: qt5/quickphrase-editor/editor.cpp:260 86 | msgid "Create new file" 87 | msgstr "Créer un nouveau fichier" 88 | 89 | #: qt5/quickphrase-editor/editor.cpp:51 90 | msgid "De&lete All" 91 | msgstr "&Tout supprimer" 92 | 93 | #: qt5/quickphrase-editor/filelistmodel.cpp:42 94 | msgid "Default" 95 | msgstr "Par défaut" 96 | 97 | #: qt5/quickphrase-editor/editor.cpp:53 98 | msgid "E&xport" 99 | msgstr "&Exporter" 100 | 101 | #: qt5/quickphrase-editor/editor.cpp:318 102 | #, kde-format 103 | msgid "Error while deleting %1." 104 | msgstr "Erreur lors de la suppression %1." 105 | 106 | #: qt5/quickphrase-editor/editor.cpp:276 qt5/quickphrase-editor/editor.cpp:317 107 | msgid "File Operation Failed" 108 | msgstr "Échec de l'opération du fichier" 109 | 110 | #: qt5/quickphrase-editor/editor.cpp:265 111 | msgid "File name should not contain '/'." 112 | msgstr "Le nom du fichier ne doit pas contenir '/'." 113 | 114 | #: qt5/quickphrase-editor/editor.cpp:264 115 | msgid "Invalid filename" 116 | msgstr "Nom de fichier invalide" 117 | 118 | #: qt5/quickphrase-editor/model.cpp:47 119 | msgid "Keyword" 120 | msgstr "Mot-clé" 121 | 122 | #: qt5/quickphrase-editor/editordialog.cpp:28 123 | msgid "Keyword:" 124 | msgstr "Mot-clé :" 125 | 126 | #: qt5/quickphrase-editor/model.cpp:49 127 | msgid "Phrase" 128 | msgstr "Phrase" 129 | 130 | #: qt5/quickphrase-editor/editordialog.cpp:29 131 | msgid "Phrase:" 132 | msgstr "Phrase :" 133 | 134 | #: qt5/quickphrase-editor/editor.cpp:260 135 | msgid "Please input a filename for newfile" 136 | msgstr "Veuillez saisir un nom de fichier pour le nouveau fichier" 137 | 138 | #: qt5/quickphrase-editor/editor.cpp:138 139 | msgid "Quick Phrase Editor" 140 | msgstr "Éditeur de phrases rapide" 141 | 142 | #: qt5/quickphrase-editor/editor.cpp:68 143 | msgid "Refresh List" 144 | msgstr "Rafraîchir la liste" 145 | 146 | #: qt5/quickphrase-editor/editor.cpp:66 147 | msgid "Remove File" 148 | msgstr "Effacer un fichier" 149 | 150 | #: qt5/quickphrase-editor/editor.cpp:122 151 | msgid "Save Changes" 152 | msgstr "Sauvegarder les modifications" 153 | 154 | #: qt5/quickphrase-editor/editor.cpp:123 155 | msgid "" 156 | "The content has changed.\n" 157 | "Do you want to save the changes or discard them?" 158 | msgstr "" 159 | "Le contenu a changé.\n" 160 | "Voulez-vous enregistrer les modifications ou les annuler ?" 161 | 162 | #: qt5/quickphrase-editor/batchdialog.cpp:31 163 | msgid "Use format on every line." 164 | msgstr "Utiliser format sur chaque ligne." 165 | -------------------------------------------------------------------------------- /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 PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # csslayer , 2017 8 | # UTUMI Hirosi , 2020 9 | # 10 | #, fuzzy 11 | msgid "" 12 | msgstr "" 13 | "Project-Id-Version: PACKAGE VERSION\n" 14 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 15 | "POT-Creation-Date: 2020-12-19 20:26+0000\n" 16 | "PO-Revision-Date: 2017-09-30 02:01+0000\n" 17 | "Last-Translator: UTUMI Hirosi , 2020\n" 18 | "Language-Team: Japanese (https://www.transifex.com/fcitx/teams/12005/ja/)\n" 19 | "Language: ja\n" 20 | "MIME-Version: 1.0\n" 21 | "Content-Type: text/plain; charset=UTF-8\n" 22 | "Content-Transfer-Encoding: 8bit\n" 23 | "Plural-Forms: nplurals=1; plural=0;\n" 24 | 25 | #: quickphrase-editor/editor.cpp:300 26 | #, kde-format 27 | msgid "%1 is a system file, do you want to delete all phrases instead?" 28 | msgstr "%1 はシステムファイルです。代わりにすべてのフレーズを削除しますか?" 29 | 30 | #: quickphrase-editor/editor.cpp:48 31 | msgid "&Add" 32 | msgstr "追加 (&A)" 33 | 34 | #: quickphrase-editor/editor.cpp:49 35 | msgid "&Batch Edit" 36 | msgstr "バッチ編集 (&B)" 37 | 38 | #: guiwrapper/mainwindow.cpp:42 39 | msgid "&Close" 40 | msgstr "閉じる (&C)" 41 | 42 | #: quickphrase-editor/editor.cpp:50 43 | msgid "&Delete" 44 | msgstr "削除 (&D)" 45 | 46 | #: quickphrase-editor/editor.cpp:52 47 | msgid "&Import" 48 | msgstr "インポート (&I)" 49 | 50 | #: quickphrase-editor/editor.cpp:54 51 | msgid "&Operation" 52 | msgstr "操作(&O)" 53 | 54 | #: guiwrapper/mainwindow.cpp:41 55 | msgid "&Reset" 56 | msgstr "リセット (&R)" 57 | 58 | #: guiwrapper/mainwindow.cpp:40 59 | msgid "&Save" 60 | msgstr "保存 (&S)" 61 | 62 | #: quickphrase-editor/editor.cpp:65 63 | msgid "Add File" 64 | msgstr "ファイル追加" 65 | 66 | #: quickphrase-editor/editor.cpp:311 67 | #, kde-format 68 | msgid "Are you sure to delete %1?" 69 | msgstr "本当に %1 を削除しますか?" 70 | 71 | #: quickphrase-editor/editor.cpp:277 72 | #, kde-format 73 | msgid "Cannot create file %1." 74 | msgstr "%1 ファイルを作成できません。" 75 | 76 | #: quickphrase-editor/editor.cpp:299 77 | msgid "Cannot remove system file" 78 | msgstr "システムファイルは削除出来ません。" 79 | 80 | #: quickphrase-editor/editor.cpp:310 81 | msgid "Confirm deletion" 82 | msgstr "削除の確認" 83 | 84 | #: quickphrase-editor/editor.cpp:260 85 | msgid "Create new file" 86 | msgstr "ファイルの新規作成" 87 | 88 | #: quickphrase-editor/editor.cpp:51 89 | msgid "De&lete All" 90 | msgstr "全削除 (&l)" 91 | 92 | #: quickphrase-editor/filelistmodel.cpp:42 93 | msgid "Default" 94 | msgstr "デフォルト" 95 | 96 | #: quickphrase-editor/editor.cpp:53 97 | msgid "E&xport" 98 | msgstr "エクスポート (&x)" 99 | 100 | #: quickphrase-editor/editor.cpp:318 101 | #, kde-format 102 | msgid "Error while deleting %1." 103 | msgstr "%1 の削除中にエラーが起きました。" 104 | 105 | #: quickphrase-editor/editor.cpp:276 quickphrase-editor/editor.cpp:317 106 | msgid "File Operation Failed" 107 | msgstr "ファイル処理に失敗しました" 108 | 109 | #: quickphrase-editor/editor.cpp:265 110 | msgid "File name should not contain '/'." 111 | msgstr "ファイル名に '/' は含められません。" 112 | 113 | #: quickphrase-editor/editor.cpp:264 114 | msgid "Invalid filename" 115 | msgstr "無効なファイル名" 116 | 117 | #: quickphrase-editor/model.cpp:47 118 | msgid "Keyword" 119 | msgstr "キーワード" 120 | 121 | #: quickphrase-editor/editordialog.cpp:28 122 | msgid "Keyword:" 123 | msgstr "キーワード:" 124 | 125 | #: quickphrase-editor/model.cpp:49 126 | msgid "Phrase" 127 | msgstr "フレーズ" 128 | 129 | #: quickphrase-editor/editordialog.cpp:29 130 | msgid "Phrase:" 131 | msgstr "フレーズ:" 132 | 133 | #: quickphrase-editor/editor.cpp:260 134 | msgid "Please input a filename for newfile" 135 | msgstr "新しいファイルのファイル名を入力してください" 136 | 137 | #: quickphrase-editor/editor.cpp:138 138 | msgid "Quick Phrase Editor" 139 | msgstr "クイックフレーズ エディター" 140 | 141 | #: quickphrase-editor/editor.cpp:68 142 | msgid "Refresh List" 143 | msgstr "リストの更新" 144 | 145 | #: quickphrase-editor/editor.cpp:66 146 | msgid "Remove File" 147 | msgstr "ファイル削除" 148 | 149 | #: quickphrase-editor/editor.cpp:122 150 | msgid "Save Changes" 151 | msgstr "変更の保存" 152 | 153 | #: quickphrase-editor/editor.cpp:123 154 | msgid "" 155 | "The content has changed.\n" 156 | "Do you want to save the changes or discard them?" 157 | msgstr "" 158 | "内容が変更されています。\n" 159 | "変更を保存しますか?それとも変更を破棄しますか?" 160 | 161 | #: quickphrase-editor/batchdialog.cpp:31 162 | msgid "Use format on every line." 163 | msgstr "各行では の形式を使用してください。" 164 | -------------------------------------------------------------------------------- /po/ko.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 PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # csslayer , 2017 8 | # Junghee Lee , 2022 9 | # 10 | #, fuzzy 11 | msgid "" 12 | msgstr "" 13 | "Project-Id-Version: PACKAGE VERSION\n" 14 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 15 | "POT-Creation-Date: 2022-04-13 20:27+0000\n" 16 | "PO-Revision-Date: 2017-09-30 02:01+0000\n" 17 | "Last-Translator: Junghee Lee , 2022\n" 18 | "Language-Team: Korean (https://www.transifex.com/fcitx/teams/12005/ko/)\n" 19 | "Language: ko\n" 20 | "MIME-Version: 1.0\n" 21 | "Content-Type: text/plain; charset=UTF-8\n" 22 | "Content-Transfer-Encoding: 8bit\n" 23 | "Plural-Forms: nplurals=1; plural=0;\n" 24 | 25 | #: qt5/quickphrase-editor/editor.cpp:300 26 | #, kde-format 27 | msgid "%1 is a system file, do you want to delete all phrases instead?" 28 | msgstr "%1은(는) 시스템 파일입니다. 대신 모든 구문을 삭제하시겠습니까?" 29 | 30 | #: qt5/quickphrase-editor/editor.cpp:48 31 | msgid "&Add" 32 | msgstr "추가(&A)" 33 | 34 | #: qt5/quickphrase-editor/editor.cpp:49 35 | msgid "&Batch Edit" 36 | msgstr "일괄 편집(&B)" 37 | 38 | #: qt5/guiwrapper/mainwindow.cpp:42 39 | msgid "&Close" 40 | msgstr "닫기(&C)" 41 | 42 | #: qt5/quickphrase-editor/editor.cpp:50 43 | msgid "&Delete" 44 | msgstr "삭제(&D)" 45 | 46 | #: qt5/quickphrase-editor/editor.cpp:52 47 | msgid "&Import" 48 | msgstr "가져오기(&I)" 49 | 50 | #: qt5/quickphrase-editor/editor.cpp:54 51 | msgid "&Operation" 52 | msgstr "작동(&O)" 53 | 54 | #: qt5/guiwrapper/mainwindow.cpp:41 55 | msgid "&Reset" 56 | msgstr "재설정(&R)" 57 | 58 | #: qt5/guiwrapper/mainwindow.cpp:40 59 | msgid "&Save" 60 | msgstr "저장(&S)" 61 | 62 | #: qt5/quickphrase-editor/editor.cpp:65 63 | msgid "Add File" 64 | msgstr "파일 추가" 65 | 66 | #: qt5/quickphrase-editor/editor.cpp:311 67 | #, kde-format 68 | msgid "Are you sure to delete %1?" 69 | msgstr "%1을(를) 삭제하시겠습니까?" 70 | 71 | #: qt5/quickphrase-editor/editor.cpp:277 72 | #, kde-format 73 | msgid "Cannot create file %1." 74 | msgstr "파일 %1을 만들수 없습니다." 75 | 76 | #: qt5/quickphrase-editor/editor.cpp:299 77 | msgid "Cannot remove system file" 78 | msgstr "시스템 파일을 제거할 수 없음" 79 | 80 | #: qt5/quickphrase-editor/editor.cpp:310 81 | msgid "Confirm deletion" 82 | msgstr "지우기 확인" 83 | 84 | #: qt5/quickphrase-editor/editor.cpp:260 85 | msgid "Create new file" 86 | msgstr "새로운 파일 생성" 87 | 88 | #: qt5/quickphrase-editor/editor.cpp:51 89 | msgid "De&lete All" 90 | msgstr "모두 삭제(&L)" 91 | 92 | #: qt5/quickphrase-editor/filelistmodel.cpp:42 93 | msgid "Default" 94 | msgstr "기본값" 95 | 96 | #: qt5/quickphrase-editor/editor.cpp:53 97 | msgid "E&xport" 98 | msgstr "내보내기(&X)" 99 | 100 | #: qt5/quickphrase-editor/editor.cpp:318 101 | #, kde-format 102 | msgid "Error while deleting %1." 103 | msgstr "%1을 지우는 중 오류 발생" 104 | 105 | #: qt5/quickphrase-editor/editor.cpp:276 qt5/quickphrase-editor/editor.cpp:317 106 | msgid "File Operation Failed" 107 | msgstr "파일 작업 실패" 108 | 109 | #: qt5/quickphrase-editor/editor.cpp:265 110 | msgid "File name should not contain '/'." 111 | msgstr "파일명에 '/'가 포함되지 않아야 합니다." 112 | 113 | #: qt5/quickphrase-editor/editor.cpp:264 114 | msgid "Invalid filename" 115 | msgstr "잘못된 파일명" 116 | 117 | #: qt5/quickphrase-editor/model.cpp:47 118 | msgid "Keyword" 119 | msgstr "키워드" 120 | 121 | #: qt5/quickphrase-editor/editordialog.cpp:28 122 | msgid "Keyword:" 123 | msgstr "키워드:" 124 | 125 | #: qt5/quickphrase-editor/model.cpp:49 126 | msgid "Phrase" 127 | msgstr "구문" 128 | 129 | #: qt5/quickphrase-editor/editordialog.cpp:29 130 | msgid "Phrase:" 131 | msgstr "구문:" 132 | 133 | #: qt5/quickphrase-editor/editor.cpp:260 134 | msgid "Please input a filename for newfile" 135 | msgstr "새 파일의 이름을 입력" 136 | 137 | #: qt5/quickphrase-editor/editor.cpp:138 138 | msgid "Quick Phrase Editor" 139 | msgstr "상용구 편집기" 140 | 141 | #: qt5/quickphrase-editor/editor.cpp:68 142 | msgid "Refresh List" 143 | msgstr "목록 갱신" 144 | 145 | #: qt5/quickphrase-editor/editor.cpp:66 146 | msgid "Remove File" 147 | msgstr "파일 제거" 148 | 149 | #: qt5/quickphrase-editor/editor.cpp:122 150 | msgid "Save Changes" 151 | msgstr "변경 저장" 152 | 153 | #: qt5/quickphrase-editor/editor.cpp:123 154 | msgid "" 155 | "The content has changed.\n" 156 | "Do you want to save the changes or discard them?" 157 | msgstr "" 158 | "내용이 변했습니다.\n" 159 | "변경사항을 저장할까요?" 160 | 161 | #: qt5/quickphrase-editor/batchdialog.cpp:31 162 | msgid "Use format on every line." 163 | msgstr "모든 줄에 형식을 사용합니다." 164 | -------------------------------------------------------------------------------- /po/ru.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 PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # csslayer , 2017 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: PACKAGE VERSION\n" 13 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 14 | "POT-Creation-Date: 2022-06-02 20:30+0000\n" 15 | "PO-Revision-Date: 2017-09-30 02:01+0000\n" 16 | "Last-Translator: csslayer , 2017\n" 17 | "Language-Team: Russian (https://www.transifex.com/fcitx/teams/12005/ru/)\n" 18 | "Language: ru\n" 19 | "MIME-Version: 1.0\n" 20 | "Content-Type: text/plain; charset=UTF-8\n" 21 | "Content-Transfer-Encoding: 8bit\n" 22 | "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " 23 | "n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || " 24 | "(n%100>=11 && n%100<=14)? 2 : 3);\n" 25 | 26 | #: qt5/quickphrase-editor/editor.cpp:300 27 | #, kde-format 28 | msgid "%1 is a system file, do you want to delete all phrases instead?" 29 | msgstr "%1 — системный файл. Хотите вместо этого удалить все фразы?" 30 | 31 | #: qt5/quickphrase-editor/editor.cpp:48 32 | msgid "&Add" 33 | msgstr "&Добавить" 34 | 35 | #: qt5/quickphrase-editor/editor.cpp:49 36 | msgid "&Batch Edit" 37 | msgstr "&Групповое редактирование" 38 | 39 | #: qt5/guiwrapper/mainwindow.cpp:42 40 | msgid "&Close" 41 | msgstr "&Закрыть" 42 | 43 | #: qt5/quickphrase-editor/editor.cpp:50 44 | msgid "&Delete" 45 | msgstr "&Удалить" 46 | 47 | #: qt5/quickphrase-editor/editor.cpp:52 48 | msgid "&Import" 49 | msgstr "&Импорт" 50 | 51 | #: qt5/quickphrase-editor/editor.cpp:54 52 | msgid "&Operation" 53 | msgstr "&Операция" 54 | 55 | #: qt5/guiwrapper/mainwindow.cpp:41 56 | msgid "&Reset" 57 | msgstr "&Переустановить" 58 | 59 | #: qt5/guiwrapper/mainwindow.cpp:40 60 | msgid "&Save" 61 | msgstr "&Сохранить" 62 | 63 | #: qt5/quickphrase-editor/editor.cpp:65 64 | msgid "Add File" 65 | msgstr "Добавить файл" 66 | 67 | #: qt5/quickphrase-editor/editor.cpp:311 68 | #, kde-format 69 | msgid "Are you sure to delete %1?" 70 | msgstr "Действительно удалить %1?" 71 | 72 | #: qt5/quickphrase-editor/editor.cpp:277 73 | #, kde-format 74 | msgid "Cannot create file %1." 75 | msgstr "Не удалось создать файл %1." 76 | 77 | #: qt5/quickphrase-editor/editor.cpp:299 78 | msgid "Cannot remove system file" 79 | msgstr "Не удалось удалить системный файл" 80 | 81 | #: qt5/quickphrase-editor/editor.cpp:310 82 | msgid "Confirm deletion" 83 | msgstr "Подтвердите удаление" 84 | 85 | #: qt5/quickphrase-editor/editor.cpp:260 86 | msgid "Create new file" 87 | msgstr "Создать новый файл" 88 | 89 | #: qt5/quickphrase-editor/editor.cpp:51 90 | msgid "De&lete All" 91 | msgstr "Уд&алить все" 92 | 93 | #: qt5/quickphrase-editor/filelistmodel.cpp:42 94 | msgid "Default" 95 | msgstr "По умолчанию" 96 | 97 | #: qt5/quickphrase-editor/editor.cpp:53 98 | msgid "E&xport" 99 | msgstr "&Экспорт" 100 | 101 | #: qt5/quickphrase-editor/editor.cpp:318 102 | #, kde-format 103 | msgid "Error while deleting %1." 104 | msgstr "Ошибка при удалении %1." 105 | 106 | #: qt5/quickphrase-editor/editor.cpp:276 qt5/quickphrase-editor/editor.cpp:317 107 | msgid "File Operation Failed" 108 | msgstr "Сбой операции с файлом" 109 | 110 | #: qt5/quickphrase-editor/editor.cpp:265 111 | msgid "File name should not contain '/'." 112 | msgstr "Имя файла не должно содержать '/'." 113 | 114 | #: qt5/quickphrase-editor/editor.cpp:264 115 | msgid "Invalid filename" 116 | msgstr "Недопустимое имя файла" 117 | 118 | #: qt5/quickphrase-editor/model.cpp:47 119 | msgid "Keyword" 120 | msgstr "Ключевое слово" 121 | 122 | #: qt5/quickphrase-editor/editordialog.cpp:28 123 | msgid "Keyword:" 124 | msgstr "Ключевое слово:" 125 | 126 | #: qt5/quickphrase-editor/model.cpp:49 127 | msgid "Phrase" 128 | msgstr "Фраза" 129 | 130 | #: qt5/quickphrase-editor/editordialog.cpp:29 131 | msgid "Phrase:" 132 | msgstr "Фраза:" 133 | 134 | #: qt5/quickphrase-editor/editor.cpp:260 135 | msgid "Please input a filename for newfile" 136 | msgstr "Введите имя для нового файла" 137 | 138 | #: qt5/quickphrase-editor/editor.cpp:138 139 | msgid "Quick Phrase Editor" 140 | msgstr "Быстрый редактор фраз" 141 | 142 | #: qt5/quickphrase-editor/editor.cpp:68 143 | msgid "Refresh List" 144 | msgstr "Обновить список" 145 | 146 | #: qt5/quickphrase-editor/editor.cpp:66 147 | msgid "Remove File" 148 | msgstr "Удалить файл" 149 | 150 | #: qt5/quickphrase-editor/editor.cpp:122 151 | msgid "Save Changes" 152 | msgstr "Сохранить изменения" 153 | 154 | #: qt5/quickphrase-editor/editor.cpp:123 155 | msgid "" 156 | "The content has changed.\n" 157 | "Do you want to save the changes or discard them?" 158 | msgstr "" 159 | "Содержимое изменилось.\n" 160 | "Сохранить изменения или отменить их?" 161 | 162 | #: qt5/quickphrase-editor/batchdialog.cpp:31 163 | msgid "Use format on every line." 164 | msgstr "Использовать для каждой строки формат <Ключевое слово> <Фраза>." 165 | -------------------------------------------------------------------------------- /po/zh_CN.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 PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # csslayer , 2017 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: PACKAGE VERSION\n" 13 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 14 | "POT-Creation-Date: 2019-11-03 12:28-0800\n" 15 | "PO-Revision-Date: 2017-09-30 02:01+0000\n" 16 | "Last-Translator: csslayer , 2017\n" 17 | "Language-Team: Chinese (China) (https://www.transifex.com/fcitx/teams/12005/" 18 | "zh_CN/)\n" 19 | "Language: zh_CN\n" 20 | "MIME-Version: 1.0\n" 21 | "Content-Type: text/plain; charset=UTF-8\n" 22 | "Content-Transfer-Encoding: 8bit\n" 23 | "Plural-Forms: nplurals=1; plural=0;\n" 24 | 25 | #: quickphrase-editor/editor.cpp:300 26 | #, kde-format 27 | msgid "%1 is a system file, do you want to delete all phrases instead?" 28 | msgstr "%1 是系统文件,您是否想要改为清空所有词组?" 29 | 30 | #: quickphrase-editor/editor.cpp:48 31 | msgid "&Add" 32 | msgstr "添加(&A)" 33 | 34 | #: quickphrase-editor/editor.cpp:49 35 | msgid "&Batch Edit" 36 | msgstr "批量编辑(&B)" 37 | 38 | #: guiwrapper/mainwindow.cpp:42 39 | msgid "&Close" 40 | msgstr "关闭(&C)" 41 | 42 | #: quickphrase-editor/editor.cpp:50 43 | msgid "&Delete" 44 | msgstr "删除(&D)" 45 | 46 | #: quickphrase-editor/editor.cpp:52 47 | msgid "&Import" 48 | msgstr "导入(&I)" 49 | 50 | #: quickphrase-editor/editor.cpp:54 51 | msgid "&Operation" 52 | msgstr "操作(&O)" 53 | 54 | #: guiwrapper/mainwindow.cpp:41 55 | msgid "&Reset" 56 | msgstr "重置(&R)" 57 | 58 | #: guiwrapper/mainwindow.cpp:40 59 | msgid "&Save" 60 | msgstr "保存(&S)" 61 | 62 | #: quickphrase-editor/editor.cpp:65 63 | msgid "Add File" 64 | msgstr "添加文件" 65 | 66 | #: quickphrase-editor/editor.cpp:311 67 | #, kde-format 68 | msgid "Are you sure to delete %1?" 69 | msgstr "您确定要删除 %1?" 70 | 71 | #: quickphrase-editor/editor.cpp:277 72 | #, kde-format 73 | msgid "Cannot create file %1." 74 | msgstr "无法创建文件 %1。" 75 | 76 | #: quickphrase-editor/editor.cpp:299 77 | msgid "Cannot remove system file" 78 | msgstr "无法移除系统文件" 79 | 80 | #: quickphrase-editor/editor.cpp:310 81 | msgid "Confirm deletion" 82 | msgstr "确认删除" 83 | 84 | #: quickphrase-editor/editor.cpp:260 85 | msgid "Create new file" 86 | msgstr "创建新文件" 87 | 88 | #: quickphrase-editor/editor.cpp:51 89 | msgid "De&lete All" 90 | msgstr "全部删除(&L)" 91 | 92 | #: quickphrase-editor/filelistmodel.cpp:42 93 | msgid "Default" 94 | msgstr "默认" 95 | 96 | #: quickphrase-editor/editor.cpp:53 97 | msgid "E&xport" 98 | msgstr "导出(&X)" 99 | 100 | #: quickphrase-editor/editor.cpp:318 101 | #, kde-format 102 | msgid "Error while deleting %1." 103 | msgstr "删除 %1 时出错。" 104 | 105 | #: quickphrase-editor/editor.cpp:276 quickphrase-editor/editor.cpp:317 106 | msgid "File Operation Failed" 107 | msgstr "文件操作失败" 108 | 109 | #: quickphrase-editor/editor.cpp:265 110 | msgid "File name should not contain '/'." 111 | msgstr "文件名不应该包括 “/”。" 112 | 113 | #: quickphrase-editor/editor.cpp:264 114 | msgid "Invalid filename" 115 | msgstr "文件名无效" 116 | 117 | #: quickphrase-editor/model.cpp:47 118 | msgid "Keyword" 119 | msgstr "关键字" 120 | 121 | #: quickphrase-editor/editordialog.cpp:28 122 | msgid "Keyword:" 123 | msgstr "关键字:" 124 | 125 | #: quickphrase-editor/model.cpp:49 126 | msgid "Phrase" 127 | msgstr "词组" 128 | 129 | #: quickphrase-editor/editordialog.cpp:29 130 | msgid "Phrase:" 131 | msgstr "词组:" 132 | 133 | #: quickphrase-editor/editor.cpp:260 134 | msgid "Please input a filename for newfile" 135 | msgstr "请输入新文件的文件名" 136 | 137 | #: quickphrase-editor/editor.cpp:138 138 | msgid "Quick Phrase Editor" 139 | msgstr "快速输入编辑器" 140 | 141 | #: quickphrase-editor/editor.cpp:68 142 | msgid "Refresh List" 143 | msgstr "刷新列表" 144 | 145 | #: quickphrase-editor/editor.cpp:66 146 | msgid "Remove File" 147 | msgstr "移除文件" 148 | 149 | #: quickphrase-editor/editor.cpp:122 150 | msgid "Save Changes" 151 | msgstr "保存更改" 152 | 153 | #: quickphrase-editor/editor.cpp:123 154 | msgid "" 155 | "The content has changed.\n" 156 | "Do you want to save the changes or discard them?" 157 | msgstr "" 158 | "内容已更改。\n" 159 | "您想要保存还是撤销这些修改?" 160 | 161 | #: quickphrase-editor/batchdialog.cpp:31 162 | msgid "Use format on every line." 163 | msgstr "每行使用 <关键词> <词组> 的格式。" 164 | -------------------------------------------------------------------------------- /po/zh_TW.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 PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # csslayer , 2017 8 | # Lau YeeYu, 2023 9 | # 10 | #, fuzzy 11 | msgid "" 12 | msgstr "" 13 | "Project-Id-Version: PACKAGE VERSION\n" 14 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 15 | "POT-Creation-Date: 2023-04-25 20:27+0000\n" 16 | "PO-Revision-Date: 2017-09-30 02:01+0000\n" 17 | "Last-Translator: Lau YeeYu, 2023\n" 18 | "Language-Team: Chinese (Taiwan) (https://app.transifex.com/fcitx/teams/12005/" 19 | "zh_TW/)\n" 20 | "Language: zh_TW\n" 21 | "MIME-Version: 1.0\n" 22 | "Content-Type: text/plain; charset=UTF-8\n" 23 | "Content-Transfer-Encoding: 8bit\n" 24 | "Plural-Forms: nplurals=1; plural=0;\n" 25 | 26 | #: qt5/quickphrase-editor/editor.cpp:300 27 | #, kde-format 28 | msgid "%1 is a system file, do you want to delete all phrases instead?" 29 | msgstr "%1 是系統檔,您是否想要改為清空所有字詞?" 30 | 31 | #: qt5/quickphrase-editor/editor.cpp:48 32 | msgid "&Add" 33 | msgstr "新增(&A)" 34 | 35 | #: qt5/quickphrase-editor/editor.cpp:49 36 | msgid "&Batch Edit" 37 | msgstr "批次編輯(&B)" 38 | 39 | #: qt5/guiwrapper/mainwindow.cpp:42 40 | msgid "&Close" 41 | msgstr "關閉(&C)" 42 | 43 | #: qt5/quickphrase-editor/editor.cpp:50 44 | msgid "&Delete" 45 | msgstr "刪除(&D)" 46 | 47 | #: qt5/quickphrase-editor/editor.cpp:52 48 | msgid "&Import" 49 | msgstr "匯入(&I)" 50 | 51 | #: qt5/quickphrase-editor/editor.cpp:54 52 | msgid "&Operation" 53 | msgstr "操作(&O)" 54 | 55 | #: qt5/guiwrapper/mainwindow.cpp:41 56 | msgid "&Reset" 57 | msgstr "重新設定(&R)" 58 | 59 | #: qt5/guiwrapper/mainwindow.cpp:40 60 | msgid "&Save" 61 | msgstr "儲存(&S)" 62 | 63 | #: qt5/quickphrase-editor/editor.cpp:65 64 | msgid "Add File" 65 | msgstr "加入檔案" 66 | 67 | #: qt5/quickphrase-editor/editor.cpp:311 68 | #, kde-format 69 | msgid "Are you sure to delete %1?" 70 | msgstr "您確定要刪除 %1?" 71 | 72 | #: qt5/quickphrase-editor/editor.cpp:277 73 | #, kde-format 74 | msgid "Cannot create file %1." 75 | msgstr "無法建立檔案 %1。" 76 | 77 | #: qt5/quickphrase-editor/editor.cpp:299 78 | msgid "Cannot remove system file" 79 | msgstr "無法移除系統檔案" 80 | 81 | #: qt5/quickphrase-editor/editor.cpp:310 82 | msgid "Confirm deletion" 83 | msgstr "確定刪除" 84 | 85 | #: qt5/quickphrase-editor/editor.cpp:260 86 | msgid "Create new file" 87 | msgstr "建立新檔" 88 | 89 | #: qt5/quickphrase-editor/editor.cpp:51 90 | msgid "De&lete All" 91 | msgstr "全部刪除(&L)" 92 | 93 | #: qt5/quickphrase-editor/filelistmodel.cpp:42 94 | msgid "Default" 95 | msgstr "預設" 96 | 97 | #: qt5/quickphrase-editor/editor.cpp:53 98 | msgid "E&xport" 99 | msgstr "匯出(&X)" 100 | 101 | #: qt5/quickphrase-editor/editor.cpp:318 102 | #, kde-format 103 | msgid "Error while deleting %1." 104 | msgstr "刪除 %1 時出錯。" 105 | 106 | #: qt5/quickphrase-editor/editor.cpp:276 qt5/quickphrase-editor/editor.cpp:317 107 | msgid "File Operation Failed" 108 | msgstr "檔案操作失敗" 109 | 110 | #: qt5/quickphrase-editor/editor.cpp:265 111 | msgid "File name should not contain '/'." 112 | msgstr "檔案名稱不能有「/」。" 113 | 114 | #: qt5/quickphrase-editor/editor.cpp:264 115 | msgid "Invalid filename" 116 | msgstr "無效的檔案名稱" 117 | 118 | #: qt5/quickphrase-editor/model.cpp:47 119 | msgid "Keyword" 120 | msgstr "關鍵字" 121 | 122 | #: qt5/quickphrase-editor/editordialog.cpp:28 123 | msgid "Keyword:" 124 | msgstr "關鍵字:" 125 | 126 | #: qt5/quickphrase-editor/model.cpp:49 127 | msgid "Phrase" 128 | msgstr "字詞" 129 | 130 | #: qt5/quickphrase-editor/editordialog.cpp:29 131 | msgid "Phrase:" 132 | msgstr "字詞:" 133 | 134 | #: qt5/quickphrase-editor/editor.cpp:260 135 | msgid "Please input a filename for newfile" 136 | msgstr "請輸入新檔案的名稱" 137 | 138 | #: qt5/quickphrase-editor/editor.cpp:138 139 | msgid "Quick Phrase Editor" 140 | msgstr "快速輸入編輯器" 141 | 142 | #: qt5/quickphrase-editor/editor.cpp:68 143 | msgid "Refresh List" 144 | msgstr "更新列表" 145 | 146 | #: qt5/quickphrase-editor/editor.cpp:66 147 | msgid "Remove File" 148 | msgstr "移除檔案" 149 | 150 | #: qt5/quickphrase-editor/editor.cpp:122 151 | msgid "Save Changes" 152 | msgstr "儲存修改" 153 | 154 | #: qt5/quickphrase-editor/editor.cpp:123 155 | msgid "" 156 | "The content has changed.\n" 157 | "Do you want to save the changes or discard them?" 158 | msgstr "" 159 | "內容已修改。\n" 160 | "您想要儲存還是放棄這些修改?" 161 | 162 | #: qt5/quickphrase-editor/batchdialog.cpp:31 163 | msgid "Use format on every line." 164 | msgstr "每一行請使用 格式。" 165 | -------------------------------------------------------------------------------- /qt5/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core DBus Widgets Concurrent) 2 | find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED Private) 3 | 4 | set(FcitxQt5_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/FcitxQt5) 5 | add_definitions(-DQT_NO_KEYWORDS) 6 | 7 | if (ENABLE_LIBRARY) 8 | add_subdirectory(dbusaddons) 9 | add_subdirectory(widgetsaddons) 10 | add_subdirectory(guiwrapper) 11 | add_subdirectory(quickphrase-editor) 12 | endif() 13 | 14 | add_subdirectory(platforminputcontext) 15 | -------------------------------------------------------------------------------- /qt5/dbusaddons/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ecm_setup_version(${FcitxQt5_VERSION} VARIABLE_PREFIX FCITXQT5DBUSADDONS 2 | VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/fcitxqtdbusaddons_version.h" 3 | PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/FcitxQt5DBusAddonsConfigVersion.cmake" 4 | SOVERSION 1) 5 | 6 | # create a Config.cmake and a ConfigVersion.cmake file and install them 7 | set(CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/FcitxQt5DBusAddons") 8 | 9 | configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/FcitxQt5DBusAddonsConfig.cmake.in" 10 | "${CMAKE_CURRENT_BINARY_DIR}/FcitxQt5DBusAddonsConfig.cmake" 11 | INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} 12 | ) 13 | 14 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/FcitxQt5DBusAddonsConfig.cmake" 15 | "${CMAKE_CURRENT_BINARY_DIR}/FcitxQt5DBusAddonsConfigVersion.cmake" 16 | DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 17 | COMPONENT Devel ) 18 | 19 | install(EXPORT FcitxQt5DBusAddonsTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE FcitxQt5DBusAddonsTargets.cmake NAMESPACE FcitxQt5:: ) 20 | 21 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/fcitxqtdbusaddons_version.h 22 | DESTINATION ${FcitxQt5_INCLUDE_INSTALL_DIR} COMPONENT Devel ) 23 | 24 | set(dbusaddons_SOURCES 25 | fcitxqtconnection.cpp 26 | fcitxqtformattedpreedit.cpp 27 | fcitxqtinputcontextproxy.cpp 28 | fcitxqtinputmethodproxy.cpp 29 | fcitxqtkeyboardlayout.cpp 30 | fcitxqtkeyboardproxy.cpp 31 | fcitxqtinputmethoditem.cpp 32 | ) 33 | 34 | set(dbusaddons_HEADERS 35 | fcitxqtconnection.h 36 | fcitxqtformattedpreedit.h 37 | fcitxqtinputcontextproxy.h 38 | fcitxqtinputmethodproxy.h 39 | fcitxqtkeyboardlayout.h 40 | fcitxqtkeyboardproxy.h 41 | fcitxqtinputmethoditem.h 42 | ) 43 | 44 | set(fcitxqtdbusaddons_INCLUDE_DIRS 45 | ${CMAKE_CURRENT_BINARY_DIR} 46 | ${CMAKE_CURRENT_SOURCE_DIR} 47 | ) 48 | 49 | add_library(FcitxQt5DBusAddons SHARED ${dbusaddons_SOURCES}) 50 | generate_export_header(FcitxQt5DBusAddons BASE_NAME FcitxQtDBusAddons) 51 | add_library(FcitxQt5::DBusAddons ALIAS FcitxQt5DBusAddons) 52 | 53 | target_include_directories(FcitxQt5DBusAddons PUBLIC "$") 54 | target_include_directories(FcitxQt5DBusAddons INTERFACE "$") 55 | 56 | set_target_properties(FcitxQt5DBusAddons 57 | PROPERTIES VERSION 1.0 58 | AUTOMOC TRUE 59 | SOVERSION 1 60 | COMPILE_FLAGS "-fvisibility=hidden" 61 | LINK_FLAGS "-Wl,--no-undefined" 62 | EXPORT_NAME DBusAddons 63 | ) 64 | 65 | target_link_libraries( 66 | FcitxQt5DBusAddons 67 | PUBLIC 68 | Qt5::Core 69 | Qt5::DBus 70 | ) 71 | 72 | install(TARGETS FcitxQt5DBusAddons EXPORT FcitxQt5DBusAddonsTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") 73 | 74 | install(FILES ${dbusaddons_HEADERS} 75 | ${CMAKE_CURRENT_BINARY_DIR}/fcitxqtdbusaddons_export.h 76 | DESTINATION "${FcitxQt5_INCLUDE_INSTALL_DIR}/FcitxQtDBusAddons") 77 | 78 | 79 | -------------------------------------------------------------------------------- /qt5/dbusaddons/FcitxQt5DBusAddonsConfig.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include(CMakeFindDependencyMacro) 4 | 5 | find_dependency(Qt5Core @REQUIRED_QT_VERSION@) 6 | find_dependency(Qt5DBus @REQUIRED_QT_VERSION@) 7 | 8 | 9 | include("${CMAKE_CURRENT_LIST_DIR}/FcitxQt5DBusAddonsTargets.cmake") 10 | -------------------------------------------------------------------------------- /qt5/dbusaddons/fcitxqtconnection.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef FCITXQTCONNECTION_H 21 | #define FCITXQTCONNECTION_H 22 | 23 | #include "fcitxqtdbusaddons_export.h" 24 | 25 | #include 26 | 27 | class QDBusConnection; 28 | 29 | class FcitxQtConnectionPrivate; 30 | 31 | /** 32 | * dbus connection to fcitx 33 | **/ 34 | class FCITXQTDBUSADDONS_EXPORT FcitxQtConnection : public QObject { 35 | Q_OBJECT 36 | Q_PROPERTY(bool autoReconnect READ autoReconnect WRITE setAutoReconnect) 37 | Q_PROPERTY(bool connected READ isConnected) 38 | Q_PROPERTY(QDBusConnection *connection READ connection) 39 | Q_PROPERTY(QString serviceName READ serviceName) 40 | public: 41 | /** 42 | * create a new connection 43 | * 44 | * @param parent 45 | **/ 46 | explicit FcitxQtConnection(QObject *parent = 0); 47 | 48 | /** 49 | * destroy the connection 50 | **/ 51 | virtual ~FcitxQtConnection(); 52 | 53 | /** 54 | * the connection will not start to work until you call this function 55 | * you may want to connect to the signal before you call this function 56 | **/ 57 | void startConnection(); 58 | void endConnection(); 59 | /** 60 | * automatically reconnect if fcitx disappeared 61 | * 62 | * @param a ... 63 | * @return void 64 | **/ 65 | void setAutoReconnect(bool a); 66 | 67 | /** 68 | * check this connection is doing automatical reconnect or not 69 | * 70 | * default value is true 71 | **/ 72 | bool autoReconnect(); 73 | 74 | /** 75 | * return the current dbus connection to fcitx, notice, the object return 76 | * by this function might be deteled if fcitx disappear, or might return 0 77 | * if fcitx is not running 78 | * 79 | * @return QDBusConnection* 80 | **/ 81 | QDBusConnection *connection(); 82 | /** 83 | * current fcitx dbus service name, can be used for create DBus proxy 84 | * 85 | * @return service name 86 | **/ 87 | const QString &serviceName(); 88 | /** 89 | * check its connected or not 90 | **/ 91 | bool isConnected(); 92 | 93 | Q_SIGNALS: 94 | /** 95 | * this signal will be emitted upon fcitx appears 96 | **/ 97 | void connected(); 98 | /** 99 | * this signal will be emitted upon fcitx disappears 100 | * 101 | * it will come with connected in pair 102 | **/ 103 | void disconnected(); 104 | 105 | private: 106 | FcitxQtConnectionPrivate *const d_ptr; 107 | Q_DECLARE_PRIVATE(FcitxQtConnection); 108 | }; 109 | 110 | #endif // FCITXCONNECTION_H 111 | -------------------------------------------------------------------------------- /qt5/dbusaddons/fcitxqtconnection_p.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef FCITXQTCONNECTION_P_H 21 | #define FCITXQTCONNECTION_P_H 22 | 23 | #include "fcitxqtconnection.h" 24 | #include 25 | #include 26 | 27 | class QDBusConnection; 28 | class QDBusServiceWatcher; 29 | 30 | class FcitxQtConnectionPrivate : public QObject { 31 | Q_OBJECT 32 | public: 33 | FcitxQtConnectionPrivate(FcitxQtConnection *conn); 34 | virtual ~FcitxQtConnectionPrivate(); 35 | FcitxQtConnection *const q_ptr; 36 | Q_DECLARE_PUBLIC(FcitxQtConnection); 37 | 38 | private Q_SLOTS: 39 | void imChanged(const QString &service, const QString &oldowner, 40 | const QString &newowner); 41 | void dbusDisconnected(); 42 | void cleanUp(); 43 | void newServiceAppear(); 44 | void socketFileChanged(); 45 | 46 | private: 47 | bool isConnected(); 48 | 49 | static QByteArray localMachineId(); 50 | const QString &socketFile(); 51 | void createConnection(); 52 | QString address(); 53 | int displayNumber(); 54 | void initialize(); 55 | void finalize(); 56 | 57 | int m_displayNumber; 58 | QString m_serviceName; 59 | QDBusConnection *m_connection; 60 | QDBusServiceWatcher *m_serviceWatcher; 61 | QFileSystemWatcher *m_watcher; 62 | QString m_socketFile; 63 | bool m_autoReconnect; 64 | bool m_connectedOnce; 65 | bool m_initialized; 66 | }; 67 | 68 | #endif // FCITXCONNECTION_P_H 69 | -------------------------------------------------------------------------------- /qt5/dbusaddons/fcitxqtformattedpreedit.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | ***************************************************************************/ 19 | 20 | #include 21 | 22 | #include "fcitxqtformattedpreedit.h" 23 | 24 | void FcitxQtFormattedPreedit::registerMetaType() { 25 | qRegisterMetaType("FcitxQtFormattedPreedit"); 26 | qDBusRegisterMetaType(); 27 | qRegisterMetaType( 28 | "FcitxQtFormattedPreeditList"); 29 | qDBusRegisterMetaType(); 30 | } 31 | 32 | qint32 FcitxQtFormattedPreedit::format() const { return m_format; } 33 | 34 | const QString &FcitxQtFormattedPreedit::string() const { return m_string; } 35 | 36 | void FcitxQtFormattedPreedit::setFormat(qint32 format) { m_format = format; } 37 | 38 | void FcitxQtFormattedPreedit::setString(const QString &str) { m_string = str; } 39 | 40 | bool FcitxQtFormattedPreedit::operator==( 41 | const FcitxQtFormattedPreedit &preedit) const { 42 | return (preedit.m_format == m_format) && (preedit.m_string == m_string); 43 | } 44 | 45 | FCITXQTDBUSADDONS_EXPORT 46 | QDBusArgument &operator<<(QDBusArgument &argument, 47 | const FcitxQtFormattedPreedit &preedit) { 48 | argument.beginStructure(); 49 | argument << preedit.string(); 50 | argument << preedit.format(); 51 | argument.endStructure(); 52 | return argument; 53 | } 54 | 55 | FCITXQTDBUSADDONS_EXPORT 56 | const QDBusArgument &operator>>(const QDBusArgument &argument, 57 | FcitxQtFormattedPreedit &preedit) { 58 | QString str; 59 | qint32 format; 60 | argument.beginStructure(); 61 | argument >> str >> format; 62 | argument.endStructure(); 63 | preedit.setString(str); 64 | preedit.setFormat(format); 65 | return argument; 66 | } 67 | -------------------------------------------------------------------------------- /qt5/dbusaddons/fcitxqtformattedpreedit.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef FCITX_QT_FORMATTED_PREEDIT_H 21 | #define FCITX_QT_FORMATTED_PREEDIT_H 22 | 23 | #include "fcitxqtdbusaddons_export.h" 24 | 25 | #include 26 | #include 27 | 28 | class FCITXQTDBUSADDONS_EXPORT FcitxQtFormattedPreedit { 29 | public: 30 | const QString &string() const; 31 | qint32 format() const; 32 | void setString(const QString &str); 33 | void setFormat(qint32 format); 34 | 35 | static void registerMetaType(); 36 | 37 | bool operator==(const FcitxQtFormattedPreedit &preedit) const; 38 | 39 | private: 40 | QString m_string; 41 | qint32 m_format; 42 | }; 43 | 44 | typedef QList FcitxQtFormattedPreeditList; 45 | 46 | QDBusArgument &operator<<(QDBusArgument &argument, 47 | const FcitxQtFormattedPreedit &im); 48 | const QDBusArgument &operator>>(const QDBusArgument &argument, 49 | FcitxQtFormattedPreedit &im); 50 | 51 | Q_DECLARE_METATYPE(FcitxQtFormattedPreedit) 52 | Q_DECLARE_METATYPE(FcitxQtFormattedPreeditList) 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /qt5/dbusaddons/fcitxqtinputcontextproxy.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by qdbusxml2cpp version 0.8 3 | * Command line was: qdbusxml2cpp -N -p fcitxqtinputcontextproxy -c FcitxQtInputContextProxy interfaces/org.fcitx.Fcitx.InputContext.xml -i fcitxqtformattedpreedit.h -i fcitxqtdbusaddons_export.h 4 | * 5 | * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd. 6 | * 7 | * This is an auto-generated file. 8 | * This file may have been hand-edited. Look for HAND-EDIT comments 9 | * before re-generating it. 10 | */ 11 | 12 | #include "fcitxqtinputcontextproxy.h" 13 | 14 | /* 15 | * Implementation of interface class FcitxQtInputContextProxy 16 | */ 17 | 18 | FcitxQtInputContextProxy::FcitxQtInputContextProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) 19 | : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) 20 | { 21 | } 22 | 23 | FcitxQtInputContextProxy::~FcitxQtInputContextProxy() 24 | { 25 | } 26 | 27 | -------------------------------------------------------------------------------- /qt5/dbusaddons/fcitxqtinputmethoditem.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2011~2012 by CSSlayer * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | ***************************************************************************/ 19 | 20 | // Qt 21 | #include 22 | #include 23 | 24 | // self 25 | #include "fcitxqtinputmethoditem.h" 26 | 27 | bool FcitxQtInputMethodItem::enabled() const { return m_enabled; } 28 | const QString &FcitxQtInputMethodItem::langCode() const { return m_langCode; } 29 | const QString &FcitxQtInputMethodItem::name() const { return m_name; } 30 | const QString &FcitxQtInputMethodItem::uniqueName() const { 31 | return m_uniqueName; 32 | } 33 | void FcitxQtInputMethodItem::setEnabled(bool enable) { m_enabled = enable; } 34 | void FcitxQtInputMethodItem::setLangCode(const QString &lang) { 35 | m_langCode = lang; 36 | } 37 | void FcitxQtInputMethodItem::setName(const QString &name) { m_name = name; } 38 | void FcitxQtInputMethodItem::setUniqueName(const QString &name) { 39 | m_uniqueName = name; 40 | } 41 | 42 | void FcitxQtInputMethodItem::registerMetaType() { 43 | qRegisterMetaType("FcitxQtInputMethodItem"); 44 | qDBusRegisterMetaType(); 45 | qRegisterMetaType("FcitxQtInputMethodItemList"); 46 | qDBusRegisterMetaType(); 47 | } 48 | 49 | FCITXQTDBUSADDONS_EXPORT 50 | QDBusArgument &operator<<(QDBusArgument &argument, 51 | const FcitxQtInputMethodItem &im) { 52 | argument.beginStructure(); 53 | argument << im.name(); 54 | argument << im.uniqueName(); 55 | argument << im.langCode(); 56 | argument << im.enabled(); 57 | argument.endStructure(); 58 | return argument; 59 | } 60 | 61 | FCITXQTDBUSADDONS_EXPORT 62 | const QDBusArgument &operator>>(const QDBusArgument &argument, 63 | FcitxQtInputMethodItem &im) { 64 | QString name; 65 | QString uniqueName; 66 | QString langCode; 67 | bool enabled; 68 | argument.beginStructure(); 69 | argument >> name >> uniqueName >> langCode >> enabled; 70 | argument.endStructure(); 71 | im.setName(name); 72 | im.setUniqueName(uniqueName); 73 | im.setLangCode(langCode); 74 | im.setEnabled(enabled); 75 | return argument; 76 | } 77 | -------------------------------------------------------------------------------- /qt5/dbusaddons/fcitxqtinputmethoditem.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2011~2012 by CSSlayer * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef FCITX_QT_INPUT_METHOD_ITEM_H 21 | #define FCITX_QT_INPUT_METHOD_ITEM_H 22 | 23 | #include "fcitxqtdbusaddons_export.h" 24 | 25 | // Qt 26 | #include 27 | #include 28 | #include 29 | 30 | class FCITXQTDBUSADDONS_EXPORT FcitxQtInputMethodItem { 31 | public: 32 | const QString &name() const; 33 | const QString &uniqueName() const; 34 | const QString &langCode() const; 35 | bool enabled() const; 36 | 37 | void setName(const QString &name); 38 | void setUniqueName(const QString &name); 39 | void setLangCode(const QString &name); 40 | void setEnabled(bool name); 41 | static void registerMetaType(); 42 | 43 | inline bool operator<(const FcitxQtInputMethodItem &im) const { 44 | if (m_enabled == true && im.m_enabled == false) 45 | return true; 46 | return false; 47 | } 48 | 49 | private: 50 | QString m_name; 51 | QString m_uniqueName; 52 | QString m_langCode; 53 | bool m_enabled; 54 | }; 55 | 56 | typedef QList FcitxQtInputMethodItemList; 57 | 58 | QDBusArgument &operator<<(QDBusArgument &argument, 59 | const FcitxQtInputMethodItem &im); 60 | const QDBusArgument &operator>>(const QDBusArgument &argument, 61 | FcitxQtInputMethodItem &im); 62 | 63 | Q_DECLARE_METATYPE(FcitxQtInputMethodItem) 64 | Q_DECLARE_METATYPE(FcitxQtInputMethodItemList) 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /qt5/dbusaddons/fcitxqtinputmethodproxy.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by qdbusxml2cpp version 0.8 3 | * Command line was: qdbusxml2cpp -N -p fcitxqtinputmethodproxy -c FcitxQtInputMethodProxy interfaces/org.fcitx.Fcitx.InputMethod.xml -i fcitxqtinputmethoditem.h -i fcitxqtdbusaddons_export.h 4 | * 5 | * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd. 6 | * 7 | * This is an auto-generated file. 8 | * This file may have been hand-edited. Look for HAND-EDIT comments 9 | * before re-generating it. 10 | */ 11 | 12 | #include "fcitxqtinputmethodproxy.h" 13 | 14 | /* 15 | * Implementation of interface class FcitxQtInputMethodProxy 16 | */ 17 | 18 | FcitxQtInputMethodProxy::FcitxQtInputMethodProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) 19 | : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) 20 | { 21 | } 22 | 23 | FcitxQtInputMethodProxy::~FcitxQtInputMethodProxy() 24 | { 25 | } 26 | 27 | -------------------------------------------------------------------------------- /qt5/dbusaddons/fcitxqtkeyboardlayout.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2011~2012 by CSSlayer * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | ***************************************************************************/ 19 | 20 | // Qt 21 | #include 22 | #include 23 | 24 | // self 25 | #include "fcitxqtkeyboardlayout.h" 26 | 27 | const QString &FcitxQtKeyboardLayout::layout() const { return m_layout; } 28 | const QString &FcitxQtKeyboardLayout::langCode() const { return m_langCode; } 29 | const QString &FcitxQtKeyboardLayout::name() const { return m_name; } 30 | 31 | const QString &FcitxQtKeyboardLayout::variant() const { return m_variant; } 32 | 33 | void FcitxQtKeyboardLayout::setLayout(const QString &layout) { 34 | m_layout = layout; 35 | } 36 | 37 | void FcitxQtKeyboardLayout::setLangCode(const QString &lang) { 38 | m_langCode = lang; 39 | } 40 | 41 | void FcitxQtKeyboardLayout::setName(const QString &name) { m_name = name; } 42 | 43 | void FcitxQtKeyboardLayout::setVariant(const QString &variant) { 44 | m_variant = variant; 45 | } 46 | 47 | void FcitxQtKeyboardLayout::registerMetaType() { 48 | qRegisterMetaType("FcitxQtKeyboardLayout"); 49 | qDBusRegisterMetaType(); 50 | qRegisterMetaType("FcitxQtKeyboardLayoutList"); 51 | qDBusRegisterMetaType(); 52 | } 53 | 54 | FCITXQTDBUSADDONS_EXPORT 55 | QDBusArgument &operator<<(QDBusArgument &argument, 56 | const FcitxQtKeyboardLayout &layout) { 57 | argument.beginStructure(); 58 | argument << layout.layout(); 59 | argument << layout.variant(); 60 | argument << layout.name(); 61 | argument << layout.langCode(); 62 | argument.endStructure(); 63 | return argument; 64 | } 65 | 66 | FCITXQTDBUSADDONS_EXPORT 67 | const QDBusArgument &operator>>(const QDBusArgument &argument, 68 | FcitxQtKeyboardLayout &layout) { 69 | QString l; 70 | QString variant; 71 | QString name; 72 | QString langCode; 73 | argument.beginStructure(); 74 | argument >> l >> variant >> name >> langCode; 75 | argument.endStructure(); 76 | layout.setLayout(l); 77 | layout.setVariant(variant); 78 | layout.setName(name); 79 | layout.setLangCode(langCode); 80 | return argument; 81 | } 82 | -------------------------------------------------------------------------------- /qt5/dbusaddons/fcitxqtkeyboardlayout.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2011~2012 by CSSlayer * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef FCITX_QT_KEYBOARD_LAYOUT_H 21 | #define FCITX_QT_KEYBOARD_LAYOUT_H 22 | 23 | #include "fcitxqtdbusaddons_export.h" 24 | 25 | // Qt 26 | #include 27 | #include 28 | #include 29 | 30 | class FCITXQTDBUSADDONS_EXPORT FcitxQtKeyboardLayout { 31 | public: 32 | const QString &layout() const; 33 | const QString &variant() const; 34 | const QString &name() const; 35 | const QString &langCode() const; 36 | void setLayout(const QString &layout); 37 | void setLangCode(const QString &lang); 38 | void setName(const QString &name); 39 | void setVariant(const QString &variant); 40 | 41 | static void registerMetaType(); 42 | 43 | private: 44 | QString m_layout; 45 | QString m_variant; 46 | QString m_name; 47 | QString m_langCode; 48 | }; 49 | 50 | typedef QList FcitxQtKeyboardLayoutList; 51 | 52 | QDBusArgument &operator<<(QDBusArgument &argument, 53 | const FcitxQtKeyboardLayout &l); 54 | const QDBusArgument &operator>>(const QDBusArgument &argument, 55 | FcitxQtKeyboardLayout &l); 56 | 57 | Q_DECLARE_METATYPE(FcitxQtKeyboardLayout) 58 | Q_DECLARE_METATYPE(FcitxQtKeyboardLayoutList) 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /qt5/dbusaddons/fcitxqtkeyboardproxy.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by qdbusxml2cpp version 0.8 3 | * Command line was: qdbusxml2cpp -N -p fcitxqtkeyboardproxy -c FcitxQtKeyboardProxy interfaces/org.fcitx.Fcitx.Keyboard.xml -i fcitxqtkeyboardlayout.h -i fcitxqtdbusaddons_export.h 4 | * 5 | * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd. 6 | * 7 | * This is an auto-generated file. 8 | * This file may have been hand-edited. Look for HAND-EDIT comments 9 | * before re-generating it. 10 | */ 11 | 12 | #include "fcitxqtkeyboardproxy.h" 13 | 14 | /* 15 | * Implementation of interface class FcitxQtKeyboardProxy 16 | */ 17 | 18 | FcitxQtKeyboardProxy::FcitxQtKeyboardProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) 19 | : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) 20 | { 21 | } 22 | 23 | FcitxQtKeyboardProxy::~FcitxQtKeyboardProxy() 24 | { 25 | } 26 | 27 | -------------------------------------------------------------------------------- /qt5/dbusaddons/fcitxqtkeyboardproxy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by qdbusxml2cpp version 0.8 3 | * Command line was: qdbusxml2cpp -N -p fcitxqtkeyboardproxy -c FcitxQtKeyboardProxy interfaces/org.fcitx.Fcitx.Keyboard.xml -i fcitxqtkeyboardlayout.h -i fcitxqtdbusaddons_export.h 4 | * 5 | * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd. 6 | * 7 | * This is an auto-generated file. 8 | * Do not edit! All changes made to it will be lost. 9 | */ 10 | 11 | #ifndef FCITXQTKEYBOARDPROXY_H 12 | #define FCITXQTKEYBOARDPROXY_H 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include "fcitxqtkeyboardlayout.h" 23 | #include "fcitxqtdbusaddons_export.h" 24 | 25 | /* 26 | * Proxy class for interface org.fcitx.Fcitx.Keyboard 27 | */ 28 | class FCITXQTDBUSADDONS_EXPORT FcitxQtKeyboardProxy: public QDBusAbstractInterface 29 | { 30 | Q_OBJECT 31 | public: 32 | static inline const char *staticInterfaceName() 33 | { return "org.fcitx.Fcitx.Keyboard"; } 34 | 35 | public: 36 | FcitxQtKeyboardProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); 37 | 38 | ~FcitxQtKeyboardProxy(); 39 | 40 | public Q_SLOTS: // METHODS 41 | inline QDBusPendingReply GetLayoutForIM(const QString &im) 42 | { 43 | QList argumentList; 44 | argumentList << QVariant::fromValue(im); 45 | return asyncCallWithArgumentList(QStringLiteral("GetLayoutForIM"), argumentList); 46 | } 47 | inline QDBusReply GetLayoutForIM(const QString &im, QString &variant) 48 | { 49 | QList argumentList; 50 | argumentList << QVariant::fromValue(im); 51 | QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("GetLayoutForIM"), argumentList); 52 | if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 2) { 53 | variant = qdbus_cast(reply.arguments().at(1)); 54 | } 55 | return reply; 56 | } 57 | 58 | inline QDBusPendingReply GetLayouts() 59 | { 60 | QList argumentList; 61 | return asyncCallWithArgumentList(QStringLiteral("GetLayouts"), argumentList); 62 | } 63 | 64 | inline QDBusPendingReply<> SetLayoutForIM(const QString &im, const QString &layout, const QString &variant) 65 | { 66 | QList argumentList; 67 | argumentList << QVariant::fromValue(im) << QVariant::fromValue(layout) << QVariant::fromValue(variant); 68 | return asyncCallWithArgumentList(QStringLiteral("SetLayoutForIM"), argumentList); 69 | } 70 | 71 | Q_SIGNALS: // SIGNALS 72 | }; 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /qt5/dbusaddons/gen_dbus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | qdbusxml2cpp-qt5 -N -p fcitxqtinputcontextproxy -c FcitxQtInputContextProxy interfaces/org.fcitx.Fcitx.InputContext.xml -i fcitxqtformattedpreedit.h -i fcitxqtdbusaddons_export.h 4 | qdbusxml2cpp-qt5 -N -p fcitxqtinputmethodproxy -c FcitxQtInputMethodProxy interfaces/org.fcitx.Fcitx.InputMethod.xml -i fcitxqtinputmethoditem.h -i fcitxqtdbusaddons_export.h 5 | qdbusxml2cpp-qt5 -N -p fcitxqtkeyboardproxy -c FcitxQtKeyboardProxy interfaces/org.fcitx.Fcitx.Keyboard.xml -i fcitxqtkeyboardlayout.h -i fcitxqtdbusaddons_export.h 6 | -------------------------------------------------------------------------------- /qt5/dbusaddons/interfaces/org.fcitx.Fcitx.InputContext.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 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 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /qt5/dbusaddons/interfaces/org.fcitx.Fcitx.InputMethod.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 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 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /qt5/dbusaddons/interfaces/org.fcitx.Fcitx.Keyboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /qt5/guiwrapper/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(QT_WRAPPER_SRCS 2 | main.cpp 3 | wrapperapp.cpp 4 | mainwindow.cpp 5 | ) 6 | 7 | fcitx_translate_add_sources( 8 | ${QT_WRAPPER_SRCS} 9 | ) 10 | 11 | include_directories( 12 | ${CMAKE_CURRENT_BINARY_DIR} 13 | ) 14 | 15 | link_directories(${FCITX4_FCITX_UTILS_LIBRARY_DIRS}) 16 | 17 | qt5_wrap_ui(QT_WRAPPER_SRCS mainwindow.ui) 18 | 19 | add_executable(fcitx-qt5-gui-wrapper ${QT_WRAPPER_SRCS}) 20 | 21 | set_target_properties(fcitx-qt5-gui-wrapper 22 | PROPERTIES AUTOMOC TRUE) 23 | 24 | target_link_libraries(fcitx-qt5-gui-wrapper 25 | Qt5::Core 26 | Qt5::Gui 27 | Qt5::Widgets 28 | FcitxQt5::DBusAddons 29 | FcitxQt5::WidgetsAddons 30 | LibIntl::LibIntl 31 | ${FCITX4_FCITX_UTILS_LIBRARIES} 32 | ) 33 | 34 | install(TARGETS fcitx-qt5-gui-wrapper DESTINATION "${CMAKE_INSTALL_LIBDIR}/fcitx/libexec") 35 | -------------------------------------------------------------------------------- /qt5/guiwrapper/common.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * Copyright (C) 2017~2017 by xzhao * 5 | * i@xuzhao.net * 6 | * * 7 | * This program is free software: you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation, either version 3 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program. If not, see . * 19 | * * 20 | ***************************************************************************/ 21 | 22 | #ifndef FCITX_QT5_GUIWRAPPER_COMMON_H 23 | #define FCITX_QT5_GUIWRAPPER_COMMON_H 24 | 25 | #include 26 | 27 | #define _(x) QString::fromUtf8(dgettext("fcitx-qt5", x)) 28 | 29 | #endif // FCITX_QT5_GUIWRAPPER_COMMON_H 30 | -------------------------------------------------------------------------------- /qt5/guiwrapper/main.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * Copyright (C) 2017~2017 by xzhao * 5 | * i@xuzhao.net * 6 | * * 7 | * This program is free software: you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation, either version 3 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program. If not, see . * 19 | * * 20 | ***************************************************************************/ 21 | 22 | #include "fcitx-utils/utils.h" 23 | #include "wrapperapp.h" 24 | #include 25 | 26 | int main(int argc, char *argv[]) { 27 | QGuiApplication::setAttribute(Qt::AA_ShareOpenGLContexts); 28 | WrapperApp app(argc, argv); 29 | return app.exec(); 30 | } 31 | -------------------------------------------------------------------------------- /qt5/guiwrapper/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2013 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * Copyright (C) 2017~2017 by xzhao * 5 | * i@xuzhao.net * 6 | * * 7 | * This program is free software: you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation, either version 3 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program. If not, see . * 19 | * * 20 | ***************************************************************************/ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include "common.h" 28 | #include "fcitx-utils/utils.h" 29 | #include "fcitxqtconfiguifactory.h" 30 | #include "fcitxqtconnection.h" 31 | #include "fcitxqtinputmethodproxy.h" 32 | #include "mainwindow.h" 33 | 34 | MainWindow::MainWindow(FcitxQtConfigUIWidget *pluginWidget, QWidget *parent) 35 | : QMainWindow(parent), m_ui(new Ui::MainWindow), 36 | m_connection(new FcitxQtConnection(this)), m_pluginWidget(pluginWidget), 37 | m_proxy(0) { 38 | m_ui->setupUi(this); 39 | m_ui->verticalLayout->insertWidget(0, m_pluginWidget); 40 | m_ui->buttonBox->button(QDialogButtonBox::Save)->setText(_("&Save")); 41 | m_ui->buttonBox->button(QDialogButtonBox::Reset)->setText(_("&Reset")); 42 | m_ui->buttonBox->button(QDialogButtonBox::Close)->setText(_("&Close")); 43 | m_ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(false); 44 | m_ui->buttonBox->button(QDialogButtonBox::Reset)->setEnabled(false); 45 | setWindowIcon(QIcon::fromTheme(m_pluginWidget->icon())); 46 | setWindowTitle(m_pluginWidget->title()); 47 | 48 | connect(m_pluginWidget, SIGNAL(changed(bool)), this, SLOT(changed(bool))); 49 | if (m_pluginWidget->asyncSave()) 50 | connect(m_pluginWidget, SIGNAL(saveFinished()), this, 51 | SLOT(saveFinished())); 52 | connect(m_ui->buttonBox, SIGNAL(clicked(QAbstractButton *)), this, 53 | SLOT(clicked(QAbstractButton *))); 54 | connect(m_connection, SIGNAL(connected()), this, SLOT(connected())); 55 | 56 | m_connection->startConnection(); 57 | } 58 | 59 | void MainWindow::connected() { 60 | if (m_proxy) { 61 | delete m_proxy; 62 | } 63 | m_proxy = new FcitxQtInputMethodProxy(m_connection->serviceName(), 64 | QLatin1String("/inputmethod"), 65 | *m_connection->connection(), this); 66 | } 67 | 68 | void MainWindow::clicked(QAbstractButton *button) { 69 | QDialogButtonBox::StandardButton standardButton = 70 | m_ui->buttonBox->standardButton(button); 71 | if (standardButton == QDialogButtonBox::Save) { 72 | if (m_pluginWidget->asyncSave()) 73 | m_pluginWidget->setEnabled(false); 74 | m_pluginWidget->save(); 75 | if (!m_pluginWidget->asyncSave()) 76 | saveFinished(); 77 | } else if (standardButton == QDialogButtonBox::Close) { 78 | qApp->quit(); 79 | } else if (standardButton == QDialogButtonBox::Reset) { 80 | m_pluginWidget->load(); 81 | } 82 | } 83 | 84 | void MainWindow::saveFinished() { 85 | if (m_pluginWidget->asyncSave()) 86 | m_pluginWidget->setEnabled(true); 87 | if (m_proxy) { 88 | m_proxy->ReloadAddonConfig(m_pluginWidget->addon()); 89 | } 90 | } 91 | 92 | void MainWindow::changed(bool changed) { 93 | m_ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(changed); 94 | m_ui->buttonBox->button(QDialogButtonBox::Reset)->setEnabled(changed); 95 | } 96 | 97 | MainWindow::~MainWindow() { delete m_ui; } 98 | -------------------------------------------------------------------------------- /qt5/guiwrapper/mainwindow.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * Copyright (C) 2017~2017 by xzhao * 5 | * i@xuzhao.net * 6 | * * 7 | * This program is free software: you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation, either version 3 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program. If not, see . * 19 | * * 20 | ***************************************************************************/ 21 | 22 | #ifndef FCITXQT5_GUIWRAPPER_MAINWINDOW_H 23 | #define FCITXQT5_GUIWRAPPER_MAINWINDOW_H 24 | 25 | #include 26 | 27 | #include "fcitxqtconfiguiwidget.h" 28 | #include "ui_mainwindow.h" 29 | 30 | class FcitxQtInputMethodProxy; 31 | class FcitxQtConnection; 32 | class MainWindow : public QMainWindow { 33 | Q_OBJECT 34 | public: 35 | explicit MainWindow(FcitxQtConfigUIWidget *pluginWidget, 36 | QWidget *parent = 0); 37 | virtual ~MainWindow(); 38 | public Q_SLOTS: 39 | void changed(bool changed); 40 | void clicked(QAbstractButton *button); 41 | void connected(); 42 | void saveFinished(); 43 | 44 | private: 45 | Ui::MainWindow *m_ui; 46 | FcitxQtConnection *m_connection; 47 | FcitxQtConfigUIWidget *m_pluginWidget; 48 | FcitxQtInputMethodProxy *m_proxy; 49 | }; 50 | 51 | #endif // FCITXQT5_GUIWRAPPER_MAINWINDOW_H 52 | -------------------------------------------------------------------------------- /qt5/guiwrapper/mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 8 | 9 | 10 | QDialogButtonBox::Close|QDialogButtonBox::Reset|QDialogButtonBox::Save 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /qt5/guiwrapper/wrapperapp.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * Copyright (C) 2017~2017 by xzhao * 5 | * i@xuzhao.net * 6 | * * 7 | * This program is free software: you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation, either version 3 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program. If not, see . * 19 | * * 20 | ***************************************************************************/ 21 | 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | #include "fcitx-utils/utils.h" 28 | #include "fcitxqtconfiguifactory.h" 29 | #include "fcitxqtconnection.h" 30 | #include "mainwindow.h" 31 | #include "wrapperapp.h" 32 | 33 | WrapperApp::WrapperApp(int &argc, char **argv) 34 | : QApplication(argc, argv), m_factory(new FcitxQtConfigUIFactory(this)), 35 | m_mainWindow(0) { 36 | char *localedir = fcitx_utils_get_fcitx_path("localedir"); 37 | setlocale(LC_ALL, ""); 38 | bindtextdomain("fcitx", localedir); 39 | bindtextdomain("fcitx-qt5", localedir); 40 | free(localedir); 41 | bind_textdomain_codeset("fcitx", "UTF-8"); 42 | bind_textdomain_codeset("fcitx-qt5", "UTF-8"); 43 | textdomain("fcitx"); 44 | 45 | FcitxQtConfigUIWidget *widget = 0; 46 | 47 | if (argc == 3 && strcmp(argv[1], "--test") == 0) { 48 | if (m_factory->test(QString::fromLocal8Bit(argv[2]))) { 49 | QMetaObject::invokeMethod(this, "quit", Qt::QueuedConnection); 50 | } else { 51 | QMetaObject::invokeMethod(this, "errorExit", Qt::QueuedConnection); 52 | } 53 | } else { 54 | if (argc == 2) { 55 | widget = m_factory->create(QString::fromLocal8Bit(argv[1])); 56 | } 57 | if (!widget) { 58 | qWarning("Could not find plugin for file."); 59 | QMetaObject::invokeMethod(this, "errorExit", Qt::QueuedConnection); 60 | } else { 61 | m_mainWindow = new MainWindow(widget); 62 | m_mainWindow->show(); 63 | } 64 | } 65 | } 66 | 67 | WrapperApp::~WrapperApp() { 68 | if (m_mainWindow) { 69 | delete m_mainWindow; 70 | } 71 | } 72 | 73 | void WrapperApp::errorExit() { exit(1); } 74 | -------------------------------------------------------------------------------- /qt5/guiwrapper/wrapperapp.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * Copyright (C) 2017~2017 by xzhao * 5 | * i@xuzhao.net * 6 | * * 7 | * This program is free software: you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation, either version 3 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program. If not, see . * 19 | * * 20 | ***************************************************************************/ 21 | 22 | #ifndef FCITXQT5_GUIWRAPPER_WRAPPERAPP_H 23 | #define FCITXQT5_GUIWRAPPER_WRAPPERAPP_H 24 | 25 | #include "mainwindow.h" 26 | #include 27 | 28 | class FcitxQtConfigUIFactory; 29 | class WrapperApp : public QApplication { 30 | Q_OBJECT 31 | public: 32 | WrapperApp(int &argc, char **argv); 33 | virtual ~WrapperApp(); 34 | 35 | private Q_SLOTS: 36 | void errorExit(); 37 | 38 | private: 39 | FcitxQtConfigUIFactory *m_factory; 40 | MainWindow *m_mainWindow; 41 | }; 42 | 43 | #endif // FCITXQT5_GUIWRAPPER_WRAPPERAPP_H 44 | -------------------------------------------------------------------------------- /qt5/platforminputcontext/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS}) 2 | 3 | 4 | set(plugin_SRCS 5 | fcitxinputcontextproxy.cpp 6 | fcitxqtdbustypes.cpp 7 | fcitxwatcher.cpp 8 | qfcitxplatforminputcontext.cpp 9 | main.cpp 10 | qtkey.cpp 11 | ) 12 | 13 | set_source_files_properties(org.fcitx.Fcitx.InputContext.xml PROPERTIES 14 | INCLUDE fcitxqtdbustypes.h) 15 | set_source_files_properties(org.fcitx.Fcitx.InputContext1.xml PROPERTIES 16 | INCLUDE fcitxqtdbustypes.h) 17 | set_source_files_properties(org.fcitx.Fcitx.InputMethod.xml PROPERTIES 18 | INCLUDE fcitxqtdbustypes.h) 19 | set_source_files_properties(org.fcitx.Fcitx.InputMethod1.xml PROPERTIES 20 | INCLUDE fcitxqtdbustypes.h) 21 | 22 | qt5_add_dbus_interface(plugin_SRCS org.fcitx.Fcitx.InputContext.xml inputcontextproxy) 23 | qt5_add_dbus_interface(plugin_SRCS org.fcitx.Fcitx.InputContext1.xml inputcontext1proxy) 24 | qt5_add_dbus_interface(plugin_SRCS org.fcitx.Fcitx.InputMethod.xml inputmethodproxy) 25 | qt5_add_dbus_interface(plugin_SRCS org.fcitx.Fcitx.InputMethod1.xml inputmethod1proxy) 26 | 27 | add_library(fcitxplatforminputcontextplugin MODULE ${plugin_SRCS}) 28 | set_target_properties(fcitxplatforminputcontextplugin PROPERTIES 29 | AUTOMOC TRUE 30 | COMPILE_FLAGS "-fvisibility=hidden" 31 | LINK_FLAGS "-Wl,--no-undefined" 32 | ) 33 | target_include_directories(fcitxplatforminputcontextplugin 34 | PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} 35 | ) 36 | target_link_libraries(fcitxplatforminputcontextplugin 37 | Qt5::Core 38 | Qt5::Gui 39 | Qt5::DBus 40 | XKBCommon::XKBCommon 41 | ) 42 | 43 | include(ECMQueryQmake) 44 | query_qmake(_QT5PLUGINDIR QT_INSTALL_PLUGINS) 45 | set(CMAKE_INSTALL_QTPLUGINDIR ${_QT5PLUGINDIR} CACHE PATH "Qt5 plugin dir") 46 | install(TARGETS fcitxplatforminputcontextplugin DESTINATION ${CMAKE_INSTALL_QTPLUGINDIR}/platforminputcontexts) 47 | -------------------------------------------------------------------------------- /qt5/platforminputcontext/fcitx.json: -------------------------------------------------------------------------------- 1 | { 2 | "Keys": [ "fcitx" ] 3 | } -------------------------------------------------------------------------------- /qt5/platforminputcontext/fcitxinputcontextproxy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011~2017 by CSSlayer 3 | * wengxt@gmail.com 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above Copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above Copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * 3. Neither the name of the authors nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | */ 20 | 21 | #ifndef FCITXINPUTCONTEXTPROXY_H_ 22 | #define FCITXINPUTCONTEXTPROXY_H_ 23 | 24 | #include "inputcontext1proxy.h" 25 | #include "inputcontextproxy.h" 26 | #include "inputmethod1proxy.h" 27 | #include "inputmethodproxy.h" 28 | #include 29 | #include 30 | #include 31 | 32 | class QDBusPendingCallWatcher; 33 | class FcitxWatcher; 34 | 35 | class FcitxInputContextProxy : public QObject { 36 | Q_OBJECT 37 | public: 38 | FcitxInputContextProxy(FcitxWatcher *watcher, QObject *parent); 39 | ~FcitxInputContextProxy(); 40 | 41 | bool isValid() const; 42 | 43 | QDBusPendingReply<> focusIn(); 44 | QDBusPendingReply<> focusOut(); 45 | QDBusPendingCall processKeyEvent(uint keyval, uint keycode, uint state, 46 | bool type, uint time); 47 | bool processKeyEventResult(const QDBusPendingCall &call); 48 | QDBusPendingReply<> reset(); 49 | QDBusPendingReply<> setCapability(qulonglong caps); 50 | QDBusPendingReply<> setCursorRect(int x, int y, int w, int h); 51 | QDBusPendingReply<> setSurroundingText(const QString &text, uint cursor, 52 | uint anchor); 53 | QDBusPendingReply<> setSurroundingTextPosition(uint cursor, uint anchor); 54 | void setDisplay(const QString &display); 55 | 56 | Q_SIGNALS: 57 | void commitString(const QString &str); 58 | void currentIM(const QString &name, const QString &uniqueName, 59 | const QString &langCode); 60 | void deleteSurroundingText(int offset, uint nchar); 61 | void forwardKey(uint keyval, uint state, bool isRelease); 62 | void updateFormattedPreedit(const FcitxFormattedPreeditList &str, 63 | int cursorpos); 64 | void inputContextCreated(); 65 | 66 | private Q_SLOTS: 67 | void availabilityChanged(); 68 | void createInputContext(); 69 | void createInputContextFinished(); 70 | void serviceUnregistered(); 71 | void recheck(); 72 | void forwardKeyWrapper(uint keyval, uint state, int type); 73 | void updateFormattedPreeditWrapper(const FcitxFormattedPreeditList &str, 74 | int cursorpos); 75 | 76 | private: 77 | void cleanUp(); 78 | 79 | QDBusServiceWatcher m_watcher; 80 | FcitxWatcher *m_fcitxWatcher; 81 | org::fcitx::Fcitx::InputMethod *m_improxy = nullptr; 82 | org::fcitx::Fcitx::InputMethod1 *m_im1proxy = nullptr; 83 | org::fcitx::Fcitx::InputContext *m_icproxy = nullptr; 84 | org::fcitx::Fcitx::InputContext1 *m_ic1proxy = nullptr; 85 | QDBusPendingCallWatcher *m_createInputContextWatcher = nullptr; 86 | QString m_display; 87 | bool m_portal; 88 | }; 89 | 90 | #endif // FCITXINPUTCONTEXTPROXY_H_ 91 | -------------------------------------------------------------------------------- /qt5/platforminputcontext/fcitxqtdbustypes.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017~2017 by CSSlayer 3 | * wengxt@gmail.com 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above Copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above Copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * 3. Neither the name of the authors nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | */ 20 | 21 | #include 22 | 23 | #include "fcitxqtdbustypes.h" 24 | 25 | void FcitxFormattedPreedit::registerMetaType() { 26 | qRegisterMetaType("FcitxFormattedPreedit"); 27 | qDBusRegisterMetaType(); 28 | qRegisterMetaType("FcitxFormattedPreeditList"); 29 | qDBusRegisterMetaType(); 30 | } 31 | 32 | qint32 FcitxFormattedPreedit::format() const { return m_format; } 33 | 34 | const QString &FcitxFormattedPreedit::string() const { return m_string; } 35 | 36 | void FcitxFormattedPreedit::setFormat(qint32 format) { m_format = format; } 37 | 38 | void FcitxFormattedPreedit::setString(const QString &str) { m_string = str; } 39 | 40 | bool FcitxFormattedPreedit::operator==( 41 | const FcitxFormattedPreedit &preedit) const { 42 | return (preedit.m_format == m_format) && (preedit.m_string == m_string); 43 | } 44 | 45 | QDBusArgument &operator<<(QDBusArgument &argument, 46 | const FcitxFormattedPreedit &preedit) { 47 | argument.beginStructure(); 48 | argument << preedit.string(); 49 | argument << preedit.format(); 50 | argument.endStructure(); 51 | return argument; 52 | } 53 | 54 | const QDBusArgument &operator>>(const QDBusArgument &argument, 55 | FcitxFormattedPreedit &preedit) { 56 | QString str; 57 | qint32 format; 58 | argument.beginStructure(); 59 | argument >> str >> format; 60 | argument.endStructure(); 61 | preedit.setString(str); 62 | preedit.setFormat(format); 63 | return argument; 64 | } 65 | 66 | void FcitxInputContextArgument::registerMetaType() { 67 | qRegisterMetaType("FcitxInputContextArgument"); 68 | qDBusRegisterMetaType(); 69 | qRegisterMetaType( 70 | "FcitxInputContextArgumentList"); 71 | qDBusRegisterMetaType(); 72 | } 73 | 74 | const QString &FcitxInputContextArgument::name() const { return m_name; } 75 | 76 | void FcitxInputContextArgument::setName(const QString &name) { m_name = name; } 77 | 78 | const QString &FcitxInputContextArgument::value() const { return m_value; } 79 | 80 | void FcitxInputContextArgument::setValue(const QString &value) { 81 | m_value = value; 82 | } 83 | 84 | QDBusArgument &operator<<(QDBusArgument &argument, 85 | const FcitxInputContextArgument &arg) { 86 | argument.beginStructure(); 87 | argument << arg.name(); 88 | argument << arg.value(); 89 | argument.endStructure(); 90 | return argument; 91 | } 92 | 93 | const QDBusArgument &operator>>(const QDBusArgument &argument, 94 | FcitxInputContextArgument &arg) { 95 | QString name, value; 96 | argument.beginStructure(); 97 | argument >> name >> value; 98 | argument.endStructure(); 99 | arg.setName(name); 100 | arg.setValue(value); 101 | return argument; 102 | } 103 | -------------------------------------------------------------------------------- /qt5/platforminputcontext/fcitxqtdbustypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012~2017 by CSSlayer 3 | * wengxt@gmail.com 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above Copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above Copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * 3. Neither the name of the authors nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | */ 20 | 21 | #ifndef _DBUSADDONS_FCITXQTDBUSTYPES_H_ 22 | #define _DBUSADDONS_FCITXQTDBUSTYPES_H_ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | class FcitxFormattedPreedit { 29 | public: 30 | const QString &string() const; 31 | qint32 format() const; 32 | void setString(const QString &str); 33 | void setFormat(qint32 format); 34 | 35 | static void registerMetaType(); 36 | 37 | bool operator==(const FcitxFormattedPreedit &preedit) const; 38 | 39 | private: 40 | QString m_string; 41 | qint32 m_format = 0; 42 | }; 43 | 44 | typedef QList FcitxFormattedPreeditList; 45 | 46 | QDBusArgument &operator<<(QDBusArgument &argument, 47 | const FcitxFormattedPreedit &im); 48 | const QDBusArgument &operator>>(const QDBusArgument &argument, 49 | FcitxFormattedPreedit &im); 50 | 51 | class FcitxInputContextArgument { 52 | public: 53 | FcitxInputContextArgument() {} 54 | FcitxInputContextArgument(const QString &name, const QString &value) 55 | : m_name(name), m_value(value) {} 56 | 57 | static void registerMetaType(); 58 | 59 | const QString &name() const; 60 | const QString &value() const; 61 | void setName(const QString &); 62 | void setValue(const QString &); 63 | 64 | private: 65 | QString m_name; 66 | QString m_value; 67 | }; 68 | 69 | typedef QList FcitxInputContextArgumentList; 70 | 71 | QDBusArgument &operator<<(QDBusArgument &argument, 72 | const FcitxInputContextArgument &im); 73 | const QDBusArgument &operator>>(const QDBusArgument &argument, 74 | FcitxInputContextArgument &im); 75 | 76 | Q_DECLARE_METATYPE(FcitxFormattedPreedit) 77 | Q_DECLARE_METATYPE(FcitxFormattedPreeditList) 78 | 79 | Q_DECLARE_METATYPE(FcitxInputContextArgument) 80 | Q_DECLARE_METATYPE(FcitxInputContextArgumentList) 81 | 82 | #endif // _DBUSADDONS_FCITXQTDBUSTYPES_H_ 83 | -------------------------------------------------------------------------------- /qt5/platforminputcontext/fcitxwatcher.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017~2017 by CSSlayer 3 | * wengxt@gmail.com 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above Copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above Copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * 3. Neither the name of the authors nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | */ 20 | 21 | #ifndef FCITXWATCHER_H_ 22 | #define FCITXWATCHER_H_ 23 | 24 | #include 25 | #include 26 | 27 | class QDBusConnection; 28 | class QFileSystemWatcher; 29 | class QDBusServiceWatcher; 30 | 31 | // A FcitxQtConnection replacement, to implement compatibility with fcitx 5. 32 | // Since we have three thing to monitor, the situation becomes much more 33 | // complexer. 34 | class FcitxWatcher : public QObject { 35 | Q_OBJECT 36 | public: 37 | explicit FcitxWatcher(QDBusConnection sessionBus, 38 | QObject *parent = nullptr); 39 | ~FcitxWatcher(); 40 | void watch(); 41 | void unwatch(); 42 | 43 | bool availability() const; 44 | 45 | QDBusConnection connection() const; 46 | QString service() const; 47 | 48 | Q_SIGNALS: 49 | void availabilityChanged(bool); 50 | 51 | private Q_SLOTS: 52 | void dbusDisconnected(); 53 | void socketFileChanged(); 54 | void imChanged(const QString &service, const QString &oldOwner, 55 | const QString &newOwner); 56 | 57 | private: 58 | QString address(); 59 | void watchSocketFile(); 60 | void unwatchSocketFile(); 61 | void createConnection(); 62 | void cleanUpConnection(); 63 | void setAvailability(bool availability); 64 | void updateAvailability(); 65 | 66 | QFileSystemWatcher *m_fsWatcher; 67 | QDBusServiceWatcher *m_serviceWatcher; 68 | QDBusConnection *m_connection; 69 | QDBusConnection m_sessionBus; 70 | QString m_socketFile; 71 | QString m_serviceName; 72 | bool m_availability = false; 73 | bool m_mainPresent = false; 74 | bool m_portalPresent = false; 75 | bool m_watched = false; 76 | }; 77 | 78 | #endif // FCITXWATCHER_H_ 79 | -------------------------------------------------------------------------------- /qt5/platforminputcontext/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012~2017 by CSSlayer 3 | * wengxt@gmail.com 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above Copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above Copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * 3. Neither the name of the authors nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | */ 20 | 21 | #include "main.h" 22 | 23 | QStringList QFcitxPlatformInputContextPlugin::keys() const { 24 | return QStringList(QStringLiteral("fcitx")); 25 | } 26 | 27 | QFcitxPlatformInputContext * 28 | QFcitxPlatformInputContextPlugin::create(const QString &system, 29 | const QStringList ¶mList) { 30 | Q_UNUSED(paramList); 31 | if (system.compare(system, QStringLiteral("fcitx"), Qt::CaseInsensitive) == 32 | 0) 33 | return new QFcitxPlatformInputContext; 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /qt5/platforminputcontext/main.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012~2017 by CSSlayer 3 | * wengxt@gmail.com 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above Copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above Copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * 3. Neither the name of the authors nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | */ 20 | 21 | #ifndef MAIN_H 22 | #define MAIN_H 23 | 24 | #include 25 | #include 26 | 27 | #include "qfcitxplatforminputcontext.h" 28 | 29 | class QFcitxPlatformInputContextPlugin : public QPlatformInputContextPlugin { 30 | Q_OBJECT 31 | public: 32 | Q_PLUGIN_METADATA(IID QPlatformInputContextFactoryInterface_iid FILE 33 | "fcitx.json") 34 | QStringList keys() const; 35 | QFcitxPlatformInputContext *create(const QString &system, 36 | const QStringList ¶mList); 37 | }; 38 | 39 | #endif // MAIN_H 40 | -------------------------------------------------------------------------------- /qt5/platforminputcontext/org.fcitx.Fcitx.InputContext.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 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 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /qt5/platforminputcontext/org.fcitx.Fcitx.InputContext1.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 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 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /qt5/platforminputcontext/org.fcitx.Fcitx.InputMethod.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /qt5/platforminputcontext/org.fcitx.Fcitx.InputMethod1.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /qt5/platforminputcontext/qtkey.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017~2017 by CSSlayer 3 | * wengxt@gmail.com 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above Copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above Copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * 3. Neither the name of the authors nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | */ 20 | 21 | #ifndef _PLATFORMINPUTCONTEXT_QTKEY_H_ 22 | #define _PLATFORMINPUTCONTEXT_QTKEY_H_ 23 | 24 | #include 25 | 26 | int keysymToQtKey(uint32_t keysym, const QString &text); 27 | 28 | #endif // _PLATFORMINPUTCONTEXT_QTKEY_H_ 29 | -------------------------------------------------------------------------------- /qt5/quickphrase-editor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | link_directories( 2 | ${FCITX4_FCITX_UTILS_LIBRARY_DIRS} 3 | ${FCITX4_FCITX_CONFIG_LIBRARY_DIRS} 4 | ) 5 | 6 | set(QUICKPHRASE_EDITOR_SRCS 7 | main.cpp 8 | model.cpp 9 | editor.cpp 10 | editordialog.cpp 11 | batchdialog.cpp 12 | filelistmodel.cpp 13 | ) 14 | fcitx_translate_add_sources( 15 | ${QUICKPHRASE_EDITOR_SRCS}) 16 | 17 | include_directories( 18 | ${LIBINTL_INCLUDE_DIR} 19 | ${CMAKE_CURRENT_BINARY_DIR} 20 | ${FCITX4_FCITX_UTILS_INCLUDE_DIRS} 21 | ) 22 | qt5_wrap_ui(QUICKPHRASE_EDITOR_SRCS editordialog.ui batchdialog.ui editor.ui) 23 | add_library(fcitx-quickphrase-editor5 24 | MODULE ${QUICKPHRASE_EDITOR_SRCS}) 25 | 26 | set_target_properties(fcitx-quickphrase-editor5 PROPERTIES 27 | LINK_FLAGS "-Wl,--no-undefined" 28 | AUTOMOC TRUE 29 | ) 30 | target_link_libraries(fcitx-quickphrase-editor5 31 | Qt5::Core 32 | Qt5::Gui 33 | Qt5::Concurrent 34 | FcitxQt5::WidgetsAddons 35 | LibIntl::LibIntl 36 | ${FCITX4_FCITX_UTILS_LIBRARIES} 37 | ${FCITX4_FCITX_CONFIG_LIBRARIES} 38 | ) 39 | 40 | install(TARGETS fcitx-quickphrase-editor5 DESTINATION ${FCITX4_ADDON_INSTALL_DIR}/qt) 41 | -------------------------------------------------------------------------------- /qt5/quickphrase-editor/batchdialog.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013~2013 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #include "batchdialog.h" 21 | #include "common.h" 22 | #include "ui_batchdialog.h" 23 | #include 24 | 25 | namespace fcitx { 26 | BatchDialog::BatchDialog(QWidget *parent) 27 | : QDialog(parent), m_ui(new Ui::BatchDialog) { 28 | m_ui->setupUi(this); 29 | m_ui->iconLabel->setPixmap( 30 | QIcon::fromTheme("dialog-information").pixmap(22, 22)); 31 | m_ui->infoLabel->setText(_("Use format on every line.")); 32 | } 33 | 34 | BatchDialog::~BatchDialog() { delete m_ui; } 35 | 36 | void BatchDialog::setText(const QString &s) { 37 | m_ui->plainTextEdit->setPlainText(s); 38 | } 39 | 40 | QString BatchDialog::text() const { return m_ui->plainTextEdit->toPlainText(); } 41 | } // namespace fcitx 42 | -------------------------------------------------------------------------------- /qt5/quickphrase-editor/batchdialog.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013~2013 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #ifndef FCITX_TOOLS_GUI_BATCHDIALOG_H 21 | #define FCITX_TOOLS_GUI_BATCHDIALOG_H 22 | 23 | #include 24 | 25 | class CMacroTable; 26 | namespace Ui { 27 | class BatchDialog; 28 | } 29 | 30 | namespace fcitx { 31 | class BatchDialog : public QDialog { 32 | Q_OBJECT 33 | public: 34 | explicit BatchDialog(QWidget *parent = 0); 35 | virtual ~BatchDialog(); 36 | 37 | QString text() const; 38 | void setText(const QString &s); 39 | 40 | private: 41 | Ui::BatchDialog *m_ui; 42 | }; 43 | } // namespace fcitx 44 | 45 | #endif // FCITX_TOOLS_GUI_ 46 | -------------------------------------------------------------------------------- /qt5/quickphrase-editor/batchdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | BatchDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 395 10 | 344 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 0 24 | 0 25 | 26 | 27 | 28 | 29 | 22 30 | 22 31 | 32 | 33 | 34 | 35 | 22 36 | 22 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | Qt::Horizontal 57 | 58 | 59 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 60 | 61 | 62 | 63 | 64 | 65 | 66 | buttonBox 67 | 68 | 69 | 70 | 71 | buttonBox 72 | accepted() 73 | BatchDialog 74 | accept() 75 | 76 | 77 | 248 78 | 254 79 | 80 | 81 | 157 82 | 274 83 | 84 | 85 | 86 | 87 | buttonBox 88 | rejected() 89 | BatchDialog 90 | reject() 91 | 92 | 93 | 316 94 | 260 95 | 96 | 97 | 286 98 | 274 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /qt5/quickphrase-editor/common.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #ifndef _FCITX_TOOL_GUI_COMMON_H 21 | #define _FCITX_TOOL_GUI_COMMON_H 22 | 23 | #include 24 | 25 | #define _(x) QString::fromUtf8(dgettext("fcitx-qt5", x)) 26 | 27 | #endif // _FCITX_TOOL_GUI_COMMON_H 28 | -------------------------------------------------------------------------------- /qt5/quickphrase-editor/editor.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #ifndef FCITX_TOOLS_GUI_EDITOR_H 21 | #define FCITX_TOOLS_GUI_EDITOR_H 22 | 23 | #include "fcitxqtconfiguiwidget.h" 24 | #include "model.h" 25 | #include 26 | #include 27 | #include 28 | 29 | class QAbstractItemModel; 30 | class CMacroTable; 31 | namespace Ui { 32 | class Editor; 33 | } 34 | 35 | namespace fcitx { 36 | 37 | class FileListModel; 38 | 39 | class ListEditor : public FcitxQtConfigUIWidget { 40 | Q_OBJECT 41 | public: 42 | explicit ListEditor(QWidget *parent = 0); 43 | virtual ~ListEditor(); 44 | 45 | virtual void load(); 46 | virtual void save(); 47 | virtual QString title(); 48 | virtual QString addon(); 49 | virtual bool asyncSave(); 50 | 51 | void loadFileList(); 52 | 53 | public Q_SLOTS: 54 | void batchEditAccepted(); 55 | void removeFileTriggered(); 56 | void addFileTriggered(); 57 | void refreshListTriggered(); 58 | void changeFile(int); 59 | 60 | private Q_SLOTS: 61 | void addWord(); 62 | void batchEditWord(); 63 | void deleteWord(); 64 | void deleteAllWord(); 65 | void itemFocusChanged(); 66 | void addWordAccepted(); 67 | void importData(); 68 | void exportData(); 69 | void importFileSelected(); 70 | void exportFileSelected(); 71 | 72 | private: 73 | void load(const QString &file); 74 | void save(const QString &file); 75 | QString currentFile(); 76 | QString currentName(); 77 | Ui::Editor *m_ui; 78 | QuickPhraseModel *m_model; 79 | FileListModel *m_fileListModel; 80 | QMenu *m_operationMenu; 81 | QString m_lastFile; 82 | }; 83 | } // namespace fcitx 84 | 85 | #endif // FCITX_TOOLS_GUI_EDITOR_H 86 | -------------------------------------------------------------------------------- /qt5/quickphrase-editor/editor.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Editor 4 | 5 | 6 | 7 | 0 8 | 0 9 | 358 10 | 389 11 | 12 | 13 | 14 | 15 | 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 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | Qt::Horizontal 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | Qt::Vertical 116 | 117 | 118 | 119 | 20 120 | 40 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /qt5/quickphrase-editor/editordialog.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #include "editordialog.h" 21 | #include "common.h" 22 | #include "ui_editordialog.h" 23 | 24 | namespace fcitx { 25 | EditorDialog::EditorDialog(QWidget *parent) 26 | : QDialog(parent), m_ui(new Ui::EditorDialog) { 27 | m_ui->setupUi(this); 28 | m_ui->keyLabel->setText(_("Keyword:")); 29 | m_ui->valueLabel->setText(_("Phrase:")); 30 | } 31 | 32 | EditorDialog::~EditorDialog() { delete m_ui; } 33 | 34 | void EditorDialog::setKey(const QString &s) { m_ui->keyLineEdit->setText(s); } 35 | 36 | void EditorDialog::setValue(const QString &s) { 37 | m_ui->valueLineEdit->setText(s); 38 | } 39 | 40 | QString EditorDialog::key() const { return m_ui->keyLineEdit->text(); } 41 | 42 | QString EditorDialog::value() const { return m_ui->valueLineEdit->text(); } 43 | } // namespace fcitx 44 | -------------------------------------------------------------------------------- /qt5/quickphrase-editor/editordialog.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #ifndef FCITX_TOOLS_GUI_DIALOG_H 21 | #define FCITX_TOOLS_GUI_DIALOG_H 22 | 23 | #include 24 | 25 | class CMacroTable; 26 | namespace Ui { 27 | class EditorDialog; 28 | } 29 | 30 | namespace fcitx { 31 | class EditorDialog : public QDialog { 32 | Q_OBJECT 33 | public: 34 | explicit EditorDialog(QWidget *parent = 0); 35 | virtual ~EditorDialog(); 36 | 37 | QString key() const; 38 | QString value() const; 39 | void setValue(const QString &s); 40 | void setKey(const QString &s); 41 | 42 | private: 43 | Ui::EditorDialog *m_ui; 44 | }; 45 | } // namespace fcitx 46 | 47 | #endif // FCITX_TOOLS_GUI_ 48 | -------------------------------------------------------------------------------- /qt5/quickphrase-editor/editordialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | EditorDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 334 10 | 91 11 | 12 | 13 | 14 | 15 | 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 | Qt::Horizontal 42 | 43 | 44 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 45 | 46 | 47 | 48 | 49 | 50 | 51 | keyLineEdit 52 | 53 | 54 | 55 | 56 | buttonBox 57 | accepted() 58 | EditorDialog 59 | accept() 60 | 61 | 62 | 248 63 | 254 64 | 65 | 66 | 157 67 | 274 68 | 69 | 70 | 71 | 72 | buttonBox 73 | rejected() 74 | EditorDialog 75 | reject() 76 | 77 | 78 | 316 79 | 260 80 | 81 | 82 | 286 83 | 274 84 | 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /qt5/quickphrase-editor/filelistmodel.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013~2013 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #include "filelistmodel.h" 21 | #include "common.h" 22 | #include "fcitx-config/xdg.h" 23 | 24 | fcitx::FileListModel::FileListModel(QObject *parent) 25 | : QAbstractListModel(parent) { 26 | loadFileList(); 27 | } 28 | 29 | fcitx::FileListModel::~FileListModel() {} 30 | 31 | int fcitx::FileListModel::rowCount(const QModelIndex &) const { 32 | return m_fileList.size(); 33 | } 34 | 35 | QVariant fcitx::FileListModel::data(const QModelIndex &index, int role) const { 36 | if (!index.isValid() || index.row() >= m_fileList.size()) 37 | return QVariant(); 38 | 39 | switch (role) { 40 | case Qt::DisplayRole: 41 | if (m_fileList[index.row()] == QUICK_PHRASE_CONFIG_FILE) { 42 | return _("Default"); 43 | } else { 44 | // remove "data/quickphrase.d/" 45 | const size_t length = strlen(QUICK_PHRASE_CONFIG_DIR); 46 | return m_fileList[index.row()].mid(length + 1, 47 | m_fileList[index.row()].size() - 48 | length - strlen(".mb") - 1); 49 | } 50 | case Qt::UserRole: 51 | return m_fileList[index.row()]; 52 | default: 53 | break; 54 | } 55 | return QVariant(); 56 | } 57 | 58 | void fcitx::FileListModel::loadFileList() { 59 | beginResetModel(); 60 | m_fileList.clear(); 61 | m_fileList.append(QUICK_PHRASE_CONFIG_FILE); 62 | FcitxStringHashSet *files = 63 | FcitxXDGGetFiles(QUICK_PHRASE_CONFIG_DIR, NULL, ".mb"); 64 | 65 | HASH_SORT(files, fcitx_utils_string_hash_set_compare); 66 | HASH_FOREACH(f, files, FcitxStringHashSet) { 67 | m_fileList.append(QString::fromLocal8Bit(f->name).prepend( 68 | QUICK_PHRASE_CONFIG_DIR "/")); 69 | } 70 | fcitx_utils_free_string_hash_set(files); 71 | 72 | endResetModel(); 73 | } 74 | 75 | int fcitx::FileListModel::findFile(const QString &lastFileName) { 76 | int idx = m_fileList.indexOf(lastFileName); 77 | if (idx < 0) { 78 | return 0; 79 | } 80 | return idx; 81 | } 82 | -------------------------------------------------------------------------------- /qt5/quickphrase-editor/filelistmodel.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013~2013 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #ifndef FCITX_TOOLS_GUI_FILE_LIST_MODEL_H_ 21 | #define FCITX_TOOLS_GUI_FILE_LIST_MODEL_H_ 22 | 23 | #include 24 | #include 25 | 26 | #define QUICK_PHRASE_CONFIG_DIR "data/quickphrase.d" 27 | #define QUICK_PHRASE_CONFIG_FILE "data/QuickPhrase.mb" 28 | 29 | namespace fcitx { 30 | 31 | class FileListModel : public QAbstractListModel { 32 | Q_OBJECT 33 | public: 34 | explicit FileListModel(QObject *parent = 0); 35 | virtual ~FileListModel(); 36 | 37 | virtual QVariant data(const QModelIndex &index, 38 | int role = Qt::DisplayRole) const; 39 | virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; 40 | 41 | void loadFileList(); 42 | int findFile(const QString &lastFileName); 43 | 44 | private: 45 | QStringList m_fileList; 46 | }; 47 | } // namespace fcitx 48 | 49 | #endif // FCITX_TOOLS_GUI_FILE_LIST_MODEL_H_ 50 | -------------------------------------------------------------------------------- /qt5/quickphrase-editor/main.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #include "main.h" 21 | #include "editor.h" 22 | #include "model.h" 23 | #include 24 | #include 25 | 26 | QuickPhraseEditorPlugin::QuickPhraseEditorPlugin(QObject *parent) 27 | : FcitxQtConfigUIPlugin(parent) {} 28 | 29 | FcitxQtConfigUIWidget *QuickPhraseEditorPlugin::create(const QString &key) { 30 | Q_UNUSED(key); 31 | return new fcitx::ListEditor; 32 | } 33 | 34 | QStringList QuickPhraseEditorPlugin::files() { 35 | return QStringList("data/QuickPhrase.mb"); 36 | } 37 | 38 | QString QuickPhraseEditorPlugin::name() { return "quickphrase-editor"; } 39 | 40 | QString QuickPhraseEditorPlugin::domain() { return "fcitx"; } 41 | -------------------------------------------------------------------------------- /qt5/quickphrase-editor/main.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #ifndef FCITX_TOOLS_GUI_MAIN_H_ 21 | #define FCITX_TOOLS_GUI_MAIN_H_ 22 | 23 | #include "fcitxqtconfiguiplugin.h" 24 | 25 | class QuickPhraseEditorPlugin : public FcitxQtConfigUIPlugin { 26 | Q_OBJECT 27 | public: 28 | Q_PLUGIN_METADATA(IID FcitxQtConfigUIFactoryInterface_iid FILE 29 | "quickphrase-editor.json") 30 | explicit QuickPhraseEditorPlugin(QObject *parent = 0); 31 | virtual QString name(); 32 | virtual QStringList files(); 33 | virtual QString domain(); 34 | virtual FcitxQtConfigUIWidget *create(const QString &key); 35 | }; 36 | 37 | #endif // FCITX_TOOLS_GUI_MAIN_H_ 38 | -------------------------------------------------------------------------------- /qt5/quickphrase-editor/model.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #ifndef FCITX_TOOLS_GUI_MODEL_H_ 21 | #define FCITX_TOOLS_GUI_MODEL_H_ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | class QFile; 29 | namespace fcitx { 30 | 31 | typedef QList> QStringPairList; 32 | 33 | class QuickPhraseModel : public QAbstractTableModel { 34 | Q_OBJECT 35 | public: 36 | explicit QuickPhraseModel(QObject *parent = 0); 37 | virtual ~QuickPhraseModel(); 38 | 39 | virtual Qt::ItemFlags flags(const QModelIndex &index) const; 40 | virtual bool setData(const QModelIndex &index, const QVariant &value, 41 | int role = Qt::EditRole); 42 | virtual QVariant headerData(int section, Qt::Orientation orientation, 43 | int role = Qt::DisplayRole) const; 44 | virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; 45 | virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; 46 | virtual QVariant data(const QModelIndex &index, 47 | int role = Qt::DisplayRole) const; 48 | void load(const QString &file, bool append); 49 | void loadData(QTextStream &stream); 50 | void addItem(const QString ¯o, const QString &word); 51 | void deleteItem(int row); 52 | void deleteAllItem(); 53 | QFutureWatcher *save(const QString &file); 54 | void saveData(QTextStream &dev); 55 | bool needSave(); 56 | 57 | Q_SIGNALS: 58 | void needSaveChanged(bool m_needSave); 59 | 60 | private Q_SLOTS: 61 | void loadFinished(); 62 | void saveFinished(); 63 | 64 | private: 65 | QStringPairList parse(const QString &file); 66 | bool saveData(const QString &file, const fcitx::QStringPairList &list); 67 | void setNeedSave(bool needSave); 68 | bool m_needSave; 69 | QStringPairList m_list; 70 | QFutureWatcher *m_futureWatcher; 71 | }; 72 | } // namespace fcitx 73 | 74 | #endif // FCITX_TOOLS_GUI_MODEL_H_ 75 | -------------------------------------------------------------------------------- /qt5/quickphrase-editor/quickphrase-editor.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /qt5/widgetsaddons/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | link_directories( 2 | ${FCITX4_FCITX_UTILS_LIBRARY_DIRS} 3 | ${FCITX4_FCITX_CONFIG_LIBRARY_DIRS} 4 | ) 5 | 6 | ecm_setup_version(${FcitxQt5_VERSION} VARIABLE_PREFIX FCITXQT5WIDGETSADDONS 7 | VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/fcitxqtwidgetsaddons_version.h" 8 | PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/FcitxQt5WidgetsAddonsConfigVersion.cmake" 9 | SOVERSION 1) 10 | 11 | # create a Config.cmake and a ConfigVersion.cmake file and install them 12 | set(CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/FcitxQt5WidgetsAddons") 13 | 14 | configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/FcitxQt5WidgetsAddonsConfig.cmake.in" 15 | "${CMAKE_CURRENT_BINARY_DIR}/FcitxQt5WidgetsAddonsConfig.cmake" 16 | INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} 17 | ) 18 | 19 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/FcitxQt5WidgetsAddonsConfig.cmake" 20 | "${CMAKE_CURRENT_BINARY_DIR}/FcitxQt5WidgetsAddonsConfigVersion.cmake" 21 | DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 22 | COMPONENT Devel ) 23 | 24 | install(EXPORT FcitxQt5WidgetsAddonsTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE FcitxQt5WidgetsAddonsTargets.cmake NAMESPACE FcitxQt5:: ) 25 | 26 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/fcitxqtwidgetsaddons_version.h 27 | DESTINATION ${FcitxQt5_INCLUDE_INSTALL_DIR} COMPONENT Devel ) 28 | 29 | set(widgetsaddons_SOURCES 30 | fcitxqtconfiguifactory.cpp 31 | fcitxqtconfiguiplugin.cpp 32 | fcitxqtconfiguiwidget.cpp 33 | fcitxqtkeysequencewidget.cpp 34 | qtkeytrans.cpp 35 | ) 36 | 37 | set(widgetsaddons_HEADERS 38 | fcitxqtconfiguifactory.h 39 | fcitxqtconfiguiplugin.h 40 | fcitxqtconfiguiwidget.h 41 | fcitxqtkeysequencewidget.h 42 | ) 43 | 44 | set(fcitxqtwidgetsaddons_INCLUDE_DIRS 45 | ${CMAKE_CURRENT_BINARY_DIR} 46 | ${CMAKE_CURRENT_SOURCE_DIR} 47 | ${FCITX4_FCITX_UTILS_INCLUDE_DIRS} 48 | ) 49 | 50 | add_library(FcitxQt5WidgetsAddons SHARED ${widgetsaddons_SOURCES}) 51 | generate_export_header(FcitxQt5WidgetsAddons BASE_NAME FcitxQtWidgetsAddons) 52 | add_library(FcitxQt5::WidgetsAddons ALIAS FcitxQt5WidgetsAddons) 53 | 54 | target_include_directories(FcitxQt5WidgetsAddons PUBLIC "$") 55 | target_include_directories(FcitxQt5WidgetsAddons INTERFACE "$") 56 | 57 | set_target_properties(FcitxQt5WidgetsAddons 58 | PROPERTIES VERSION 1.0 59 | AUTOMOC TRUE 60 | SOVERSION 1 61 | COMPILE_FLAGS "-fvisibility=hidden" 62 | LINK_FLAGS "-Wl,--no-undefined" 63 | EXPORT_NAME WidgetsAddons 64 | ) 65 | 66 | target_link_libraries(FcitxQt5WidgetsAddons 67 | PUBLIC 68 | Qt5::Core 69 | Qt5::Widgets 70 | PRIVATE 71 | ${FCITX4_FCITX_UTILS_LIBRARIES} 72 | ${FCITX4_FCITX_CONFIG_LIBRARIES} 73 | ) 74 | 75 | install(TARGETS FcitxQt5WidgetsAddons EXPORT FcitxQt5WidgetsAddonsTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") 76 | 77 | install(FILES ${widgetsaddons_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/fcitxqtwidgetsaddons_export.h 79 | DESTINATION "${FcitxQt5_INCLUDE_INSTALL_DIR}/FcitxQtWidgetsAddons") 80 | -------------------------------------------------------------------------------- /qt5/widgetsaddons/FcitxQt5WidgetsAddonsConfig.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include(CMakeFindDependencyMacro) 4 | 5 | find_dependency(Qt5Core @REQUIRED_QT_VERSION@) 6 | find_dependency(Qt5Gui @REQUIRED_QT_VERSION@) 7 | find_dependency(Qt5Widgets @REQUIRED_QT_VERSION@) 8 | 9 | 10 | include("${CMAKE_CURRENT_LIST_DIR}/FcitxQt5WidgetsAddonsTargets.cmake") 11 | -------------------------------------------------------------------------------- /qt5/widgetsaddons/fcitxqtconfiguifactory.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | ***************************************************************************/ 19 | 20 | #include "fcitxqtconfiguifactory.h" 21 | #include "fcitxqtconfiguifactory_p.h" 22 | #include "fcitxqtconfiguiplugin.h" 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | FcitxQtConfigUIFactoryPrivate::FcitxQtConfigUIFactoryPrivate( 32 | FcitxQtConfigUIFactory *factory) 33 | : QObject(factory), q_ptr(factory) {} 34 | 35 | FcitxQtConfigUIFactoryPrivate::~FcitxQtConfigUIFactoryPrivate() {} 36 | 37 | FcitxQtConfigUIFactory::FcitxQtConfigUIFactory(QObject *parent) 38 | : QObject(parent), d_ptr(new FcitxQtConfigUIFactoryPrivate(this)) { 39 | Q_D(FcitxQtConfigUIFactory); 40 | d->scan(); 41 | } 42 | 43 | FcitxQtConfigUIFactory::~FcitxQtConfigUIFactory() {} 44 | 45 | FcitxQtConfigUIWidget *FcitxQtConfigUIFactory::create(const QString &file) { 46 | Q_D(FcitxQtConfigUIFactory); 47 | 48 | if (!d->plugins.contains(file)) 49 | return 0; 50 | 51 | char *localepath = fcitx_utils_get_fcitx_path("localedir"); 52 | bindtextdomain(d->plugins[file]->domain().toUtf8().data(), localepath); 53 | bind_textdomain_codeset(d->plugins[file]->domain().toUtf8().data(), 54 | "UTF-8"); 55 | free(localepath); 56 | return d->plugins[file]->create(file); 57 | } 58 | 59 | bool FcitxQtConfigUIFactory::test(const QString &file) { 60 | Q_D(FcitxQtConfigUIFactory); 61 | 62 | return d->plugins.contains(file); 63 | } 64 | 65 | void FcitxQtConfigUIFactoryPrivate::scan() { 66 | QStringList dirs; 67 | // check plugin files 68 | size_t len; 69 | char **path = FcitxXDGGetLibPath(&len); 70 | for (size_t i = 0; i < len; i++) { 71 | dirs << path[i]; 72 | } 73 | 74 | if (dirs.isEmpty()) 75 | return; 76 | for (QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it) { 77 | // qDebug() << QString ("Checking Qt Library Path: %1").arg (*it); 78 | QDir libpath(*it); 79 | QDir dir(libpath.filePath(QString("qt"))); 80 | if (!dir.exists()) { 81 | continue; 82 | } 83 | 84 | QStringList entryList = dir.entryList(); 85 | // filter out "." and ".." to keep debug output cleaner 86 | entryList.removeAll("."); 87 | entryList.removeAll(".."); 88 | if (entryList.isEmpty()) { 89 | continue; 90 | } 91 | 92 | Q_FOREACH (const QString &maybeFile, entryList) { 93 | QFileInfo fi(dir.filePath(maybeFile)); 94 | 95 | QString filePath = fi.filePath(); // file name with path 96 | QString fileName = fi.fileName(); // just file name 97 | 98 | // qDebug() << filePath; 99 | 100 | if (!QLibrary::isLibrary(filePath)) { 101 | continue; 102 | } 103 | 104 | QPluginLoader *loader = new QPluginLoader(filePath, this); 105 | // qDebug() << loader->load(); 106 | // qDebug() << loader->errorString(); 107 | FcitxQtConfigUIFactoryInterface *plugin = 108 | qobject_cast( 109 | loader->instance()); 110 | if (plugin) { 111 | QStringList list = plugin->files(); 112 | Q_FOREACH (const QString &s, list) { plugins[s] = plugin; } 113 | } 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /qt5/widgetsaddons/fcitxqtconfiguifactory.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef FCITX_QT_CONFIG_UI_FACTORY_H 21 | #define FCITX_QT_CONFIG_UI_FACTORY_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include "fcitxqtconfiguiplugin.h" 28 | #include "fcitxqtconfiguiwidget.h" 29 | #include "fcitxqtwidgetsaddons_export.h" 30 | 31 | class FcitxQtConfigUIFactoryPrivate; 32 | /** 33 | * ui plugin factory. 34 | **/ 35 | class FCITXQTWIDGETSADDONS_EXPORT FcitxQtConfigUIFactory : public QObject { 36 | Q_OBJECT 37 | public: 38 | /** 39 | * create a plugin factory 40 | * 41 | * @param parent object parent 42 | **/ 43 | explicit FcitxQtConfigUIFactory(QObject *parent = 0); 44 | virtual ~FcitxQtConfigUIFactory(); 45 | /** 46 | * create widget based on file name, it might return 0 if there is no match 47 | * 48 | * @param file file name need to be configured 49 | * @return FcitxQtConfigUIWidget* 50 | **/ 51 | FcitxQtConfigUIWidget *create(const QString &file); 52 | /** 53 | * a simplified version of create, but it just test if there is a valid 54 | *entry or not 55 | * 56 | * @param file file name 57 | * @return bool 58 | **/ 59 | bool test(const QString &file); 60 | 61 | private: 62 | FcitxQtConfigUIFactoryPrivate *d_ptr; 63 | Q_DECLARE_PRIVATE(FcitxQtConfigUIFactory); 64 | }; 65 | 66 | #endif // FCITX_CONFIG_UI_FACTORY_H 67 | -------------------------------------------------------------------------------- /qt5/widgetsaddons/fcitxqtconfiguifactory_p.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef FCITXQTCONFIGUIFACTORY_P_H 21 | #define FCITXQTCONFIGUIFACTORY_P_H 22 | 23 | #include "fcitxqtconfiguifactory.h" 24 | #include 25 | 26 | class FcitxQtConfigUIFactoryPrivate : public QObject { 27 | Q_OBJECT 28 | public: 29 | FcitxQtConfigUIFactoryPrivate(FcitxQtConfigUIFactory *conn); 30 | virtual ~FcitxQtConfigUIFactoryPrivate(); 31 | FcitxQtConfigUIFactory *const q_ptr; 32 | Q_DECLARE_PUBLIC(FcitxQtConfigUIFactory); 33 | 34 | private: 35 | void scan(); 36 | QMap plugins; 37 | }; 38 | 39 | #endif // FCITXQTCONFIGUIFACTORY_P_H -------------------------------------------------------------------------------- /qt5/widgetsaddons/fcitxqtconfiguiplugin.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | ***************************************************************************/ 19 | 20 | #include "fcitxqtconfiguiplugin.h" 21 | 22 | FcitxQtConfigUIPlugin::FcitxQtConfigUIPlugin(QObject *parent) 23 | : QObject(parent) {} 24 | 25 | FcitxQtConfigUIPlugin::~FcitxQtConfigUIPlugin() {} 26 | -------------------------------------------------------------------------------- /qt5/widgetsaddons/fcitxqtconfiguiplugin.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef FCITXQTCONFIGPLUGIN_H 21 | #define FCITXQTCONFIGPLUGIN_H 22 | 23 | #include "fcitxqtwidgetsaddons_export.h" 24 | #include 25 | #include 26 | #include 27 | 28 | class FcitxQtConfigUIWidget; 29 | 30 | /** 31 | * interface for qt config ui 32 | */ 33 | struct FCITXQTWIDGETSADDONS_EXPORT FcitxQtConfigUIFactoryInterface { 34 | /** 35 | * return the name for plugin 36 | */ 37 | virtual QString name() = 0; 38 | 39 | /** 40 | * create new widget based on key 41 | * 42 | * @see FcitxQtConfigUIPlugin::files 43 | * 44 | * @return plugin name 45 | */ 46 | virtual FcitxQtConfigUIWidget *create(const QString &key) = 0; 47 | 48 | /** 49 | * return a list that this plugin will handle, need to be consist with 50 | * the file path in config file 51 | * 52 | * @return support file list 53 | */ 54 | virtual QStringList files() = 0; 55 | 56 | /** 57 | * return gettext domain, due to some reason, fcitx doesn't use qt's i18n 58 | * feature 59 | * but gettext 60 | * 61 | * @return domain of gettext 62 | */ 63 | virtual QString domain() = 0; 64 | }; 65 | 66 | #define FcitxQtConfigUIFactoryInterface_iid \ 67 | "org.fcitx.Fcitx.FcitxQtConfigUIFactoryInterface" 68 | Q_DECLARE_INTERFACE(FcitxQtConfigUIFactoryInterface, 69 | FcitxQtConfigUIFactoryInterface_iid) 70 | 71 | /** 72 | * base class for qt config ui 73 | */ 74 | class FCITXQTWIDGETSADDONS_EXPORT FcitxQtConfigUIPlugin 75 | : public QObject, 76 | public FcitxQtConfigUIFactoryInterface { 77 | Q_OBJECT 78 | Q_INTERFACES(FcitxQtConfigUIFactoryInterface) 79 | public: 80 | explicit FcitxQtConfigUIPlugin(QObject *parent = 0); 81 | virtual ~FcitxQtConfigUIPlugin(); 82 | }; 83 | 84 | #endif // FCITXCONFIGPLUGIN_H 85 | -------------------------------------------------------------------------------- /qt5/widgetsaddons/fcitxqtconfiguiwidget.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | ***************************************************************************/ 19 | 20 | #include "fcitxqtconfiguiwidget.h" 21 | 22 | FcitxQtConfigUIWidget::FcitxQtConfigUIWidget(QWidget *parent) 23 | : QWidget(parent) {} 24 | 25 | QString FcitxQtConfigUIWidget::icon() { return QLatin1String("fcitx"); } 26 | 27 | bool FcitxQtConfigUIWidget::asyncSave() { return false; } 28 | -------------------------------------------------------------------------------- /qt5/widgetsaddons/fcitxqtconfiguiwidget.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef FCITXQTCONFIGUIWIDGET_H 21 | #define FCITXQTCONFIGUIWIDGET_H 22 | #include "fcitxqtwidgetsaddons_export.h" 23 | #include 24 | 25 | /** 26 | * embedded gui for custom configuration 27 | **/ 28 | class FCITXQTWIDGETSADDONS_EXPORT FcitxQtConfigUIWidget : public QWidget { 29 | Q_OBJECT 30 | public: 31 | explicit FcitxQtConfigUIWidget(QWidget *parent = 0); 32 | 33 | /** 34 | * load the configuration, usually, this is being called upon a "reset" 35 | *button clicked 36 | * the outer gui will not call it for you for the first time, your 37 | *initialization might 38 | * want to call it by yourself. 39 | * 40 | * @return void 41 | **/ 42 | virtual void load() = 0; 43 | 44 | /** 45 | * save the configuration 46 | * 47 | * @see asyncSave saveFinished 48 | **/ 49 | virtual void save() = 0; 50 | 51 | /** 52 | * window title 53 | * 54 | * @return window title 55 | **/ 56 | virtual QString title() = 0; 57 | 58 | /** 59 | * return the addon name it belongs to 60 | * 61 | * @return addon name 62 | **/ 63 | virtual QString addon() = 0; 64 | 65 | /** 66 | * return the icon name of the window, see QIcon::fromTheme 67 | * 68 | * @return icon name 69 | **/ 70 | virtual QString icon(); 71 | 72 | /** 73 | * return the save function is async or not, default implementation is false 74 | * 75 | * @return bool 76 | **/ 77 | virtual bool asyncSave(); 78 | 79 | Q_SIGNALS: 80 | /** 81 | * the configuration is changed or not, used to indicate parent gui 82 | * 83 | * @param changed is config changed 84 | **/ 85 | void changed(bool changed); 86 | 87 | /** 88 | * if asyncSave return true, be sure to emit this signal on all case 89 | * 90 | * @see asyncSave 91 | **/ 92 | void saveFinished(); 93 | }; 94 | 95 | #endif // FCITXCONFIGUIWIDGET_H 96 | -------------------------------------------------------------------------------- /qt5/widgetsaddons/fcitxqtkeysequencewidget.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013~2013 by CSSlayer * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | ***************************************************************************/ 19 | 20 | /* this is forked from kdelibs/kdeui/kkeysequencewidget.h */ 21 | 22 | /* 23 | Original Copyright header 24 | This file is part of the KDE libraries 25 | Copyright (C) 2001, 2002 Ellis Whitehead 26 | Copyright (C) 2007 Andreas Hartmetz 27 | 28 | This library is free software; you can redistribute it and/or 29 | modify it under the terms of the GNU Library General Public 30 | License as published by the Free Software Foundation; either 31 | version 2 of the License, or (at your option) any later version. 32 | 33 | This library is distributed in the hope that it will be useful, 34 | but WITHOUT ANY WARRANTY; without even the implied warranty of 35 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 36 | Library General Public License for more details. 37 | 38 | You should have received a copy of the GNU Library General Public License 39 | along with this library; see the file COPYING.LIB. If not, write to 40 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 41 | Boston, MA 02110-1301, USA. 42 | */ 43 | 44 | #ifndef KKEYSEQUENCEWIDGET_H 45 | #define KKEYSEQUENCEWIDGET_H 46 | 47 | #include 48 | #include 49 | 50 | #include "fcitxqtwidgetsaddons_export.h" 51 | 52 | enum FcitxQtModifierSide { MS_Unknown = 0, MS_Left = 1, MS_Right = 2 }; 53 | 54 | class FcitxQtKeySequenceWidgetPrivate; 55 | 56 | class FCITXQTWIDGETSADDONS_EXPORT FcitxQtKeySequenceWidget : public QWidget { 57 | Q_OBJECT 58 | 59 | Q_PROPERTY(bool multiKeyShortcutsAllowed READ multiKeyShortcutsAllowed WRITE 60 | setMultiKeyShortcutsAllowed) 61 | 62 | Q_PROPERTY(bool modifierlessAllowed READ isModifierlessAllowed WRITE 63 | setModifierlessAllowed) 64 | 65 | Q_PROPERTY(bool modifierOnlyAllowed READ isModifierOnlyAllowed WRITE 66 | setModifierOnlyAllowed) 67 | 68 | public: 69 | enum Validation { Validate = 0, NoValidate = 1 }; 70 | 71 | /** 72 | * Constructor. 73 | */ 74 | explicit FcitxQtKeySequenceWidget(QWidget *parent = 0); 75 | 76 | /** 77 | * Destructs the widget. 78 | */ 79 | virtual ~FcitxQtKeySequenceWidget(); 80 | 81 | void setMultiKeyShortcutsAllowed(bool); 82 | bool multiKeyShortcutsAllowed() const; 83 | 84 | void setModifierlessAllowed(bool allow); 85 | bool isModifierlessAllowed(); 86 | 87 | void setModifierOnlyAllowed(bool allow); 88 | bool isModifierOnlyAllowed(); 89 | 90 | /* 91 | * only useful when modifierOnlyAllowed is true 92 | * and the key is modifierOnly. 93 | */ 94 | FcitxQtModifierSide modifierSide(); 95 | 96 | void setClearButtonShown(bool show); 97 | 98 | QKeySequence keySequence() const; 99 | 100 | static void keyQtToFcitx(int keyQt, FcitxQtModifierSide side, int &outsym, 101 | uint &outstate); 102 | static int keyFcitxToQt(int sym, uint state); 103 | 104 | Q_SIGNALS: 105 | void keySequenceChanged(const QKeySequence &seq, FcitxQtModifierSide side); 106 | 107 | public Q_SLOTS: 108 | void captureKeySequence(); 109 | void setKeySequence(const QKeySequence &seq, 110 | FcitxQtModifierSide side = MS_Unknown, 111 | Validation val = NoValidate); 112 | void clearKeySequence(); 113 | 114 | private: 115 | friend class FcitxQtKeySequenceWidgetPrivate; 116 | FcitxQtKeySequenceWidgetPrivate *const d; 117 | 118 | Q_DISABLE_COPY(FcitxQtKeySequenceWidget) 119 | }; 120 | 121 | #endif // KKEYSEQUENCEWIDGET_H 122 | -------------------------------------------------------------------------------- /qt5/widgetsaddons/fcitxqtkeysequencewidget_p.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013~2013 by CSSlayer * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | ***************************************************************************/ 19 | 20 | /* this is forked from kdelibs/kdeui/kkeysequencewidget_p.h */ 21 | 22 | /* 23 | Original Copyright header 24 | Copyright (C) 2001, 2002 Ellis Whitehead 25 | Copyright (C) 2007 Andreas Hartmetz 26 | 27 | This library is free software; you can redistribute it and/or 28 | modify it under the terms of the GNU Library General Public 29 | License as published by the Free Software Foundation; either 30 | version 2 of the License, or (at your option) any later version. 31 | 32 | This library is distributed in the hope that it will be useful, 33 | but WITHOUT ANY WARRANTY; without even the implied warranty of 34 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 35 | Library General Public License for more details. 36 | 37 | You should have received a copy of the GNU Library General Public License 38 | along with this library; see the file COPYING.LIB. If not, write to 39 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 40 | Boston, MA 02110-1301, USA. 41 | */ 42 | #ifndef FCITXQT_KEYSEQUENCEWIDGET_P_H 43 | #define FCITXQT_KEYSEQUENCEWIDGET_P_H 44 | 45 | #include 46 | #include 47 | #include 48 | 49 | class FcitxQtKeySequenceWidgetPrivate; 50 | class FcitxQtKeySequenceButton : public QPushButton { 51 | Q_OBJECT 52 | 53 | public: 54 | explicit FcitxQtKeySequenceButton(FcitxQtKeySequenceWidgetPrivate *d, 55 | QWidget *parent) 56 | : QPushButton(parent), d(d) {} 57 | 58 | virtual ~FcitxQtKeySequenceButton(); 59 | 60 | protected: 61 | /** 62 | * Reimplemented for internal reasons. 63 | */ 64 | virtual bool event(QEvent *event); 65 | virtual void keyPressEvent(QKeyEvent *event); 66 | virtual void keyReleaseEvent(QKeyEvent *event); 67 | 68 | private: 69 | FcitxQtKeySequenceWidgetPrivate *const d; 70 | }; 71 | 72 | #endif // FCITXQT_KEYSEQUENCEWIDGET_P_H 73 | -------------------------------------------------------------------------------- /qt5/widgetsaddons/qtkeytrans.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by CSSlayer * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef QTKEYTRANS_H 21 | #define QTKEYTRANS_H 22 | #include 23 | 24 | bool keyQtToSym(int qtcode, Qt::KeyboardModifiers mod, int &sym, 25 | unsigned int &state); 26 | 27 | bool symToKeyQt(int sym, unsigned int state, int &qtcode, 28 | Qt::KeyboardModifiers &mod); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /qt6/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(Qt6 ${REQUIRED_QT6_VERSION} CONFIG REQUIRED Core DBus) 2 | find_package(Qt6Gui ${REQUIRED_QT6_VERSION} REQUIRED Private) 3 | 4 | add_definitions(-DQT_NO_KEYWORDS) 5 | 6 | add_subdirectory(platforminputcontext) 7 | -------------------------------------------------------------------------------- /qt6/platforminputcontext/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${Qt6Gui_PRIVATE_INCLUDE_DIRS}) 2 | 3 | 4 | set(plugin_SRCS 5 | fcitxinputcontextproxy.cpp 6 | fcitxqtdbustypes.cpp 7 | fcitxwatcher.cpp 8 | qfcitxplatforminputcontext.cpp 9 | main.cpp 10 | qtkey.cpp 11 | ) 12 | 13 | set_source_files_properties(org.fcitx.Fcitx.InputContext.xml PROPERTIES 14 | INCLUDE fcitxqtdbustypes.h) 15 | set_source_files_properties(org.fcitx.Fcitx.InputContext1.xml PROPERTIES 16 | INCLUDE fcitxqtdbustypes.h) 17 | set_source_files_properties(org.fcitx.Fcitx.InputMethod.xml PROPERTIES 18 | INCLUDE fcitxqtdbustypes.h) 19 | set_source_files_properties(org.fcitx.Fcitx.InputMethod1.xml PROPERTIES 20 | INCLUDE fcitxqtdbustypes.h) 21 | 22 | qt6_add_dbus_interface(plugin_SRCS org.fcitx.Fcitx.InputContext.xml inputcontextproxy) 23 | qt6_add_dbus_interface(plugin_SRCS org.fcitx.Fcitx.InputContext1.xml inputcontext1proxy) 24 | qt6_add_dbus_interface(plugin_SRCS org.fcitx.Fcitx.InputMethod.xml inputmethodproxy) 25 | qt6_add_dbus_interface(plugin_SRCS org.fcitx.Fcitx.InputMethod1.xml inputmethod1proxy) 26 | 27 | add_library(fcitxplatforminputcontextplugin-qt6 MODULE ${plugin_SRCS}) 28 | set_target_properties(fcitxplatforminputcontextplugin-qt6 PROPERTIES 29 | AUTOMOC TRUE 30 | COMPILE_FLAGS "-fvisibility=hidden" 31 | LINK_FLAGS "-Wl,--no-undefined" 32 | ) 33 | target_include_directories(fcitxplatforminputcontextplugin-qt6 34 | PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} 35 | ) 36 | target_link_libraries(fcitxplatforminputcontextplugin-qt6 37 | Qt6::Core 38 | Qt6::Gui 39 | Qt6::DBus 40 | XKBCommon::XKBCommon 41 | ) 42 | 43 | get_target_property(_QT6_QMAKE_EXECUTABLE Qt6::qmake LOCATION) 44 | execute_process( 45 | COMMAND ${_QT6_QMAKE_EXECUTABLE} -query "QT_INSTALL_PLUGINS" 46 | RESULT_VARIABLE return_code 47 | OUTPUT_VARIABLE _QT6PLUGINDIR 48 | ) 49 | if(return_code EQUAL 0) 50 | string(STRIP "${_QT6PLUGINDIR}" _QT6PLUGINDIR) 51 | else() 52 | message(FATAL_ERROR "QMake Qt6 call failed: ${return_code}") 53 | endif() 54 | set(CMAKE_INSTALL_QT6PLUGINDIR ${_QT6PLUGINDIR} CACHE PATH "Qt6 plugin dir") 55 | install(TARGETS fcitxplatforminputcontextplugin-qt6 DESTINATION ${CMAKE_INSTALL_QT6PLUGINDIR}/platforminputcontexts) 56 | -------------------------------------------------------------------------------- /qt6/platforminputcontext/fcitx.json: -------------------------------------------------------------------------------- 1 | ../../qt5/platforminputcontext/fcitx.json -------------------------------------------------------------------------------- /qt6/platforminputcontext/fcitxinputcontextproxy.cpp: -------------------------------------------------------------------------------- 1 | ../../qt5/platforminputcontext/fcitxinputcontextproxy.cpp -------------------------------------------------------------------------------- /qt6/platforminputcontext/fcitxinputcontextproxy.h: -------------------------------------------------------------------------------- 1 | ../../qt5/platforminputcontext/fcitxinputcontextproxy.h -------------------------------------------------------------------------------- /qt6/platforminputcontext/fcitxqtdbustypes.cpp: -------------------------------------------------------------------------------- 1 | ../../qt5/platforminputcontext/fcitxqtdbustypes.cpp -------------------------------------------------------------------------------- /qt6/platforminputcontext/fcitxqtdbustypes.h: -------------------------------------------------------------------------------- 1 | ../../qt5/platforminputcontext/fcitxqtdbustypes.h -------------------------------------------------------------------------------- /qt6/platforminputcontext/fcitxwatcher.cpp: -------------------------------------------------------------------------------- 1 | ../../qt5/platforminputcontext/fcitxwatcher.cpp -------------------------------------------------------------------------------- /qt6/platforminputcontext/fcitxwatcher.h: -------------------------------------------------------------------------------- 1 | ../../qt5/platforminputcontext/fcitxwatcher.h -------------------------------------------------------------------------------- /qt6/platforminputcontext/main.cpp: -------------------------------------------------------------------------------- 1 | ../../qt5/platforminputcontext/main.cpp -------------------------------------------------------------------------------- /qt6/platforminputcontext/main.h: -------------------------------------------------------------------------------- 1 | ../../qt5/platforminputcontext/main.h -------------------------------------------------------------------------------- /qt6/platforminputcontext/org.fcitx.Fcitx.InputContext.xml: -------------------------------------------------------------------------------- 1 | ../../qt5/platforminputcontext/org.fcitx.Fcitx.InputContext.xml -------------------------------------------------------------------------------- /qt6/platforminputcontext/org.fcitx.Fcitx.InputContext1.xml: -------------------------------------------------------------------------------- 1 | ../../qt5/platforminputcontext/org.fcitx.Fcitx.InputContext1.xml -------------------------------------------------------------------------------- /qt6/platforminputcontext/org.fcitx.Fcitx.InputMethod.xml: -------------------------------------------------------------------------------- 1 | ../../qt5/platforminputcontext/org.fcitx.Fcitx.InputMethod.xml -------------------------------------------------------------------------------- /qt6/platforminputcontext/org.fcitx.Fcitx.InputMethod1.xml: -------------------------------------------------------------------------------- 1 | ../../qt5/platforminputcontext/org.fcitx.Fcitx.InputMethod1.xml -------------------------------------------------------------------------------- /qt6/platforminputcontext/qfcitxplatforminputcontext.cpp: -------------------------------------------------------------------------------- 1 | ../../qt5/platforminputcontext/qfcitxplatforminputcontext.cpp -------------------------------------------------------------------------------- /qt6/platforminputcontext/qfcitxplatforminputcontext.h: -------------------------------------------------------------------------------- 1 | ../../qt5/platforminputcontext/qfcitxplatforminputcontext.h -------------------------------------------------------------------------------- /qt6/platforminputcontext/qtkey.cpp: -------------------------------------------------------------------------------- 1 | ../../qt5/platforminputcontext/qtkey.cpp -------------------------------------------------------------------------------- /qt6/platforminputcontext/qtkey.h: -------------------------------------------------------------------------------- 1 | ../../qt5/platforminputcontext/qtkey.h --------------------------------------------------------------------------------