pax_global_header00006660000000000000000000000064124435653430014523gustar00rootroot0000000000000052 comment=97832fff4cef0050a893afc9bbe55bbb86c51595 ibus-chewing-1.4.14/000077500000000000000000000000001244356534300141765ustar00rootroot00000000000000ibus-chewing-1.4.14/.gitignore000066400000000000000000000011211244356534300161610ustar00rootroot00000000000000.* *~ *.sw[op] **/CMakeFiles/ **/_CPack_Packages/ **/Testing/ **/BUILD/ **/BUILDROOT/ **/RPMS/ **/SPECS/ **/SOURCES/ **/SRPMS/ **/FedPkg/ *NO_PACK* bin/ *.la *.lo *.loT bodhi.template CMakeCache.txt cmake-fedora/ cmake_*install.cmake CPack*Config.cmake CTestTestfile.cmake CVS/ data/*.schemas debug*s.list *.gmo gtk-doc.make ibus-chewing.spec ibus-chewing*.tar.* install_manifest.txt ltmain.sh Makefile missing Modules *.o *.old *.orig *.pot py-compile *.so RPM-ChangeLog src/ibus-chewing-engine*.[ch] src/maker-dialog*.[ch] stamp-h1 *.rej *.rpm *.bak tags data/*.xml arch/PKGBUILD test-bin/ ibus-chewing-1.4.14/.gitmodules000066400000000000000000000001511244356534300163500ustar00rootroot00000000000000[submodule "cmake-fedora"] path = cmake-fedora url = https://git.fedorahosted.org/git/cmake-fedora.git ibus-chewing-1.4.14/AUTHORS000066400000000000000000000010301244356534300152400ustar00rootroot00000000000000Original Author: Peng Huang Current Maintainer: Ding-Yi Chen Translators: ----------- zh_CN.po: Peng Huang zh_TW.po: swyear Acknowledge: ----------- From Tango project: key_bindings.png settings.png (gnome-settings.png) From WM Chang: ibus-chewing.png Patch Accepted from: Fred Chien Peng Huang yusake zork@chromium.org hychen Four Dollar Scott Tsai buganini@gmail.com Huei-Horng Yo hiroshiyui ibus-chewing-1.4.14/CMakeLists.txt000066400000000000000000000240021244356534300167340ustar00rootroot00000000000000cmake_minimum_required(VERSION 2.6.2) # Included scripts do automatic cmake_policy PUSH and POP. # OLD: CMake policy in included script will affect the invoker. # CMAKE_POLICY(SET CMP0011 OLD) #################################################################### # Find cmake-fedora # LIST(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/Modules") INCLUDE(ManageEnvironmentCommon OPTIONAL RESULT_VARIABLE MANAGE_ENVIRONMENT_PATH) IF(MANAGE_ENVIRONMENT_PATH STREQUAL "NOTFOUND") # Is cmake-fedora a git submodule? IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/Modules) ## Create a link if Modules/ does not exists IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/cmake-fedora) IF(EXISTS ${CMAKE_SOURCE_DIR}/.gitmodules) ## cmake-fedora may be a git submodules EXECUTE_PROCESS(COMMAND git submodule init COMMAND git submodule update RESULT_VARIABLE gitSubmoduleFailed WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/.gitmodules) ENDIF(NOT EXISTS ${CMAKE_SOURCE_DIR}/cmake-fedora) IF(EXISTS ${CMAKE_SOURCE_DIR}/cmake-fedora/Modules) ## cmake-fedora is now available as subdirectory, try again EXECUTE_PROCESS(COMMAND ln -s ${CMAKE_SOURCE_DIR}/cmake-fedora/Modules .) INCLUDE(ManageEnvironmentCommon RESULT_VARIABLE MANAGE_ENVIRONMENT_PATH) ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/cmake-fedora/Modules) ENDIF(NOT EXISTS ${CMAKE_SOURCE_DIR}/Modules) ENDIF(MANAGE_ENVIRONMENT_PATH STREQUAL "NOTFOUND") IF(MANAGE_ENVIRONMENT_PATH STREQUAL "NOTFOUND") MESSAGE(FATAL_ERROR "ManageEnvironmentCommon.cmake is not found in CMAKE_MODULE_PATH. Please either: 1) Use cmake-fedora as a git submodule: git submodule add https://git.fedorahosted.org/git/cmake-fedora.git 2) Install cmake-fedora from repository: yum -y install cmake-fedora 3) Download the source: wget https://fedorahosted.org/releases/c/m/cmake-fedora/cmake-fedora-modules-only-latest.tar.gz tar zxvf SOURCES/cmake-fedora-modules-only-latest.tar.gz") ENDIF(MANAGE_ENVIRONMENT_PATH STREQUAL "NOTFOUND") GET_FILENAME_COMPONENT(CMAKE_FEDORA_MODULE_DIR "${MANAGE_ENVIRONMENT_PATH}" PATH CACHE ) # Whether to build on fedora SET(CMAKE_FEDORA_ENABLE_FEDORA_BUILD "0" CACHE STRING "Enable fedora build") # Default Message level M_OFF (4) SET(MANAGE_MESSAGE_LEVEL 7 CACHE STRING "Message (Verbose) Level") #################################################################### # Project specific information # PROJECT(ibus-chewing) SET(PRJ_SUMMARY "The Chewing engine for IBus input platform") SET(SUMMARY_TRANSLATIONS "zh_TW" "IBus新酷音輸入法") SET(PRJ_DESCRIPTION "IBus-chewing is an IBus front-end of Chewing, an intelligent Chinese input method for Zhuyin (BoPoMoFo) users. It supports various Zhuyin keyboard layout, such as standard (DaChen), IBM, Gin-Yeah, Eten, Eten 26, Hsu, Dvorak, Dvorak-Hsu, and DaChen26. Chewing also support toned Hanyu pinyin input.") SET(DESCRIPTION_TRANSLATIONS "zh_TW" "IBus-chewing 是新酷音輸入法的IBus前端。 新酷音輸入法是個智慧型注音輸入法,支援多種鍵盤布局,諸如: 標準注音鍵盤、IBM、精業、倚天、倚天26鍵、許氏、Dvorak、Dvorak許氏 及大千26鍵。 本輸入法也同時支援帶調漢語拼音輸入。") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") SET(AUTHORS "Peng Huang, Ding-Yi Chen") SET(MAINTAINER "Ding-Yi Chen ") SET(VENDOR "Red Hat, APAC, Inc.") SET(LICENSE "GPLv2+") SET(PRJ_GROUP "System Environment/Libraries") SET(RPM_SPEC_URL "https://github.com/definite/${PROJECT_NAME}") SET(RPM_SPEC_SOURCES "https://github.com/definite/%{name}/releases/download/%{version}/%{name}-%{version}-Source.tar.gz") #################################################################### # Includes # # Use standard FHS if Fedora build is not enabled IF(NOT CMAKE_FEDORA_ENABLE_FEDORA_BUILD) SET(LIBEXEC_DIR "${LIB_DIR}" CACHE PATH "LIBEXEC dir") ENDIF(NOT CMAKE_FEDORA_ENABLE_FEDORA_BUILD) INCLUDE(ManageEnvironment) MANAGE_CMAKE_POLICY(CMP0017 NEW) INCLUDE(ManageMessage) INCLUDE(ManageVersion) RELEASE_NOTES_READ_FILE() INCLUDE(ManageArchive) INCLUDE(ManageDependency) INCLUDE(ManageFile) INCLUDE(ManageSourceVersionControl) INCLUDE(ManageTarget) INCLUDE(ManageTranslation) INCLUDE(ManageUninstall) ENABLE_TESTING() #################################################################### # Dependencies # # Enable GNOME_SHELL support by set the value to 1 SET_COMPILE_ENV(GNOME_SHELL 1 CACHE BOOL "Enable GNOME Shell support") # Enable GCONF2 support by set the value to 1 SET_COMPILE_ENV(GCONF2_SUPPORT 0 CACHE BOOL "Enable GConf2 support") # Enable GSETTINGS support by set the value to 1 SET_COMPILE_ENV(GSETTINGS_SUPPORT 1 CACHE BOOL "Enable GSettings support") SET(IBUS_MIN_VER "1.3") SET(CHEWING_MIN_VER "0.3.3") ########## Package Dependencies ########## MANAGE_DEPENDENCY(BUILD_REQUIRES CMAKE VER "2.6.2" REQUIRED) ### ibus MANAGE_DEPENDENCY(REQUIRES IBUS VER "${IBUS_MIN_VER}" REQUIRED PKG_CONFIG ${IBUS_PKG_CONFIG}) SET(IBUS_PKG_CONFIG "ibus-1.0" CACHE STRING "ibus pkg-config name") MANAGE_DEPENDENCY(BUILD_REQUIRES IBUS VER "${IBUS_MIN_VER}" REQUIRED PKG_CONFIG ${IBUS_PKG_CONFIG} DEVEL ) ### libchewing SET(CHEWING_PACKAGE_NAME "libchewing" CACHE STRING "chewing package name") MANAGE_DEPENDENCY(REQUIRES CHEWING VER "${CHEWING_MIN_VER}" REQUIRED PACKAGE_NAME "${CHEWING_PACKAGE_NAME}" ) SET(CHEWING_DEVEL_PACKAGE_NAME "${CHEWING_PACKAGE_NAME}-devel" CACHE STRING "chewing devel package name") SET(CHEWING_PKG_CONFIG "chewing" CACHE STRING "chewing pkg-config name") MANAGE_DEPENDENCY(BUILD_REQUIRES CHEWING VER "${CHEWING_MIN_VER}" REQUIRED PKG_CONFIG ${CHEWING_PKG_CONFIG} PACKAGE_NAME "${CHEWING_DEVEL_PACKAGE_NAME}" ) M_MSG(${M_INFO1} "CHEWING_VERSION=${CHEWING_VERSION}") STRING_SPLIT(chewingVerList "." "${CHEWING_VERSION}") LIST(GET chewingVerList 0 CHEWING_VERSION_MAJOR) LIST(GET chewingVerList 1 CHEWING_VERSION_MINOR) LIST(GET chewingVerList 2 CHEWING_VERSION_PATCH) M_MSG(${M_INFO1} "CHEWING_VERSION_MAJOR=${CHEWING_VERSION_MAJOR}") M_MSG(${M_INFO1} "CHEWING_VERSION_MINOR=${CHEWING_VERSION_MINOR}") M_MSG(${M_INFO1} "CHEWING_VERSION_PATCH=${CHEWING_VERSION_PATCH}") ADD_DEFINITIONS("-DCHEWING_VERSION_MAJOR=${CHEWING_VERSION_MAJOR}" "-DCHEWING_VERSION_MINOR=${CHEWING_VERSION_MINOR}" "-DCHEWING_VERSION_PATCH=${CHEWING_VERSION_PATCH}" ) ## In case CHEWING_DATADIR is incorrect FOREACH(d ${CHEWING_DATADIR} /usr/share/chewing ${CHEWING_LIBDIR}/libchewing) IF(EXISTS "${d}/symbols.dat") SET(CHEWING_DATADIR_REAL "${d}" CACHE STRING "CHEWING_DATADIR_REAL") BREAK() ENDIF() ENDFOREACH() IF("${CHEWING_DATADIR_REAL}" STREQUAL "") M_MSG(${M_ERROR} "Chewing: symbols.dat cannot be found, please reinstall chewing package") ENDIF() M_MSG(${M_INFO1} "CHEWING_DATADIR_REAL=${CHEWING_DATADIR_REAL}") SET_COMPILE_ENV(CHEWING_DATADIR_REAL) ### Glib, Gtk and GOB ## Glib2 is not explicit list as Requires, as it should be pick up by rpm SET(GLIB2_PKG_CONFIG "gio-2.0;glib-2.0;gmodule-2.0;gobject-2.0;gthread-2.0" CACHE STRING "glib2 pkg-config name") MANAGE_DEPENDENCY(BUILD_REQUIRES GLIB2 REQUIRED PKG_CONFIG ${GLIB2_PKG_CONFIG} glib-2.0 DEVEL ) MANAGE_DEPENDENCY(REQUIRES GTK2 REQUIRED) SET(GTK2_PKG_CONFIG "gtk+-2.0" CACHE STRING "gtk pkg-config name") MANAGE_DEPENDENCY(BUILD_REQUIRES GTK2 REQUIRED PKG_CONFIG ${GTK2_PKG_CONFIG} DEVEL ) MANAGE_DEPENDENCY(BUILD_REQUIRES GOB2 VER "2.0.16" REQUIRED PROGRAM_NAMES "gob2" ) ### X11 SET(X11_PKG_CONFIG "x11" CACHE STRING "x11 pkg-config name") MANAGE_DEPENDENCY(BUILD_REQUIRES X11 REQUIRED PKG_CONFIG ${X11_PKG_CONFIG} PACKAGE_NAME "libX11-devel" ) #################################################################### # Building # SET_COMPILE_ENV(PROJECT_SCHEMA_ID "org.freedesktop.IBus.Chewing" CACHE STRING "PROJECT_SCHEMA_ID") SET_COMPILE_ENV(PROJECT_SCHEMA_DIR "/desktop/ibus/engine/chewing" CACHE STRING "PROJECT_SCHEMA_DIR") SET_COMPILE_ENV(PROJECT_SCHEMA_PATH "${PROJECT_SCHEMA_DIR}/" CACHE STRING "PROJECT_SCHEMA_PATH") # Generate chewing.xml SET(SYMBOL_XML "") IF(NOT GNOME_SHELL) SET(SYMBOL_XML "") ENDIF(NOT GNOME_SHELL) SET_COMPILE_ENV(CHEWING_HOTKEYS "Super+space") SET(HOTKEYS_XML "${CHEWING_HOTKEYS}") IF(NOT GNOME_SHELL) SET(HOTKEYS_XML "") ENDIF(NOT GNOME_SHELL) CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/data/chewing.xml.in ${CMAKE_BINARY_DIR}/data/chewing.xml) # Sub directories ADD_SUBDIRECTORY(src bin) ADD_SUBDIRECTORY(po) ADD_SUBDIRECTORY(test test-bin) #################################################################### # Installing # INSTALL(FILES AUTHORS README ChangeLog COPYING USER-GUIDE DESTINATION "${PRJ_DOC_DIR}" ) INSTALL(FILES ${CMAKE_BINARY_DIR}/data/chewing.xml DESTINATION "${DATA_DIR}/ibus/component") INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/ibus-setup-chewing.desktop DESTINATION "${DATA_DIR}/applications") INSTALL(DIRECTORY icons DESTINATION "${PRJ_DATA_DIR}" ) MANAGE_SOURCE_VERSION_CONTROL_GIT() #################################################################### # Packing # SET(SOURCE_ARCHIVE_DIR ${CMAKE_BINARY_DIR} CACHE PATH "Source Archive Dir") PACK_SOURCE_ARCHIVE("${SOURCE_ARCHIVE_DIR}" GITIGNORE ${CMAKE_SOURCE_DIR}/.gitignore INCLUDE ${PROJECT_NAME}.pot ) INCLUDE(ManageRelease) IF(CMAKE_FEDORA_ENABLE_FEDORA_BUILD) SET(RPM_BUILD_SOURCES ${SOURCE_ARCHIVE_DIR}) ADD_SUBDIRECTORY(rpm) LIST(APPEND _releaset_targets "release_fedora") ENDIF(CMAKE_FEDORA_ENABLE_FEDORA_BUILD) ##################################################################### # Hosting # #INCLUDE(ManageUpload) #ADD_CUSTOM_TARGET(upload # COMMENT "Uploading all files" # ) #################################################################### # Custom # #################################################################### # Release # INCLUDE(ManageRelease) SET(releaseTarget "tag_push") IF(CMAKE_FEDORA_ENABLE_FEDORA_BUILD) LIST(APPEND releaseTargets release_fedora) ENDIF(CMAKE_FEDORA_ENABLE_FEDORA_BUILD) MANAGE_RELEASE(${releaseTargets}) ibus-chewing-1.4.14/COPYING000066400000000000000000000431031244356534300152320ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. ibus-chewing-1.4.14/ChangeLog000066400000000000000000000356001244356534300157540ustar00rootroot00000000000000* Mon Dec 15 2014 Ding-Yi Chen - 1.4.14 - Fixed the issues found in static checks * Thu Dec 11 2014 Ding-Yi Chen - 1.4.12 - Fix the GitHub download link * Thu Dec 11 2014 Ding-Yi Chen - 1.4.11.1 - Resolves Bug 1013977 - Slow focus change with ibus-chewing - Resolves Bug 1062133 - ibus-chewing may not handle key event after focus change - Resolves Bug 1073797 - Cannot identify input mode for Chinese IME (ibus-chewing) - Fixed Bug 902866 - ibus-chewing uses dconf but still installs gconf schemas (Also listed as GitHub ibus-chewing #36) - MakerDialog GUI is only loaded when setting dialog is invoked. - Setting is removed from ibus-properties because it can be launched from either: + Executable ibus-setup-chewing: Usually under /usr/libexec + Input method preference in IBus preference. - Fixed github issue #43: First space not able to input Thanks FreedomKnight. - Fixed github issue #44: Update input-events (for libchewing-0.4.0) Thanks hiunnhue. - Fixed github issue #45: Optimize properties handling. Thanks Ueno. - github is now hosting the ibus-chewing tarballs. * Sat Feb 01 2014 Ding-Yi Chen - 1.4.10.1 - Resolves Bug 1054937 - Broken defattr in ibus-chewing * Sat Feb 01 2014 Ding-Yi Chen - 1.4.10 - Resolves Bug 1054937 - Broken defattr in ibus-chewing * Sat Feb 01 2014 Ding-Yi Chen - 1.4.9 - Resolves Bug 1054937 - Broken defattr in ibus-chewing * Thu Jan 16 2014 Ding-Yi Chen - 1.4.7 - Target "translation" is built separately with all, in order to tame multiple job make. * Thu Jan 16 2014 Ding-Yi Chen - 1.4.6 - Fixed Build for RHEL7 * Wed Jan 15 2014 Ding-Yi Chen - 1.4.5 - Resolves Bug 1013977 - ibus-chewing needs to have ibus write-cache --system in post and postun - Resolves Bug 1027031 - CVE-2013-4509 ibus-chewing: ibus: visible password entry flaw [rhel-7.0] - Resolves Bug 1028911 - [zh_TW]'Chinese<->English' switch does not work when clicking on the Chewing menu list. - Resolves Bug 1045868 - ibus-chewing *again* not built with $RPM_OPT_FLAGS - Option "Sync between caps lock and IM": + Default of is changed to "disable", because the previous default "keyboard" cause bug 1028911 for GNOME Shell. + Now Sync from "input method" can control Caps LED in GNOME shell. - Translation added: de_DE, es_ES, it_IT, pt_BR, uk_UA - Set environment IBUS_CHEWING_LOGFILE for ibus-chewing log. * Mon Dec 23 2013 Ding-Yi Chen - 1.4.4 - Resolves Bug 842856 - ibus-chewing 1.4.3-1 not built with $RPM_OPT_FLAGS - Resolves Bug 1027030 - CVE-2013-4509 ibus-chewing: ibus: visible password entry flaw [fedora-all] Thanks czchen for the GitHub pull request 39. - Added translations: fr_FR, ja_JP, ko_KR - Adopt cmake-fedora-1.2.0 * Mon Nov 26 2012 Ding-Yi Chen - 1.4.3 - Fixed GitHub issue #30: Rework decorate_preedit by merging pull request #30 from buganini - Fixed GitHub issue #31: Properly refresh property by merging pull request #31 from buganini * Thu Aug 23 2012 Ding-Yi Chen - 1.4.2 - Fixed GitHub issue #7: highlighted text be cut after switch back to pure ibus by merging pull request #24 from buganini - Fixed GitHub issue #20: Shift key will send duplicated strings by merging pull request #22 from buganini - Fixed GitHub issue #21: somethings wrong with cmake - Fixed GitHub issue #25: Weird symbol when input with somethings highlighted by merging pull request #26 from buganini - Fixed GitHub issue #27: Local path committed into tree - Fixed: Bug 713033 - [zh_TW] ibus-chewing problem - Fixed: Bug 745371 - ibus-chewing: mode confusion In Temporary English mode and Chinese mode later on - Fixed: Google Issue 1172: [ibus-chewing] move elf file to standard directory. - Fixed: Google Issue 1426: ibus-chewing-1.3.10 installs directory /gconf to root filesystem - Fixed: Google Issue 1428: ibus-chewing-1.3.10 fails to save it's settings - Fixed: Google Issue 1481: Some characters are missing when a long string in preedit buffer. - Fixed: Google Issue 1490: Cannot change INSTAL prefix for ibus-chewing-1.4.0 * Mon Jul 23 2012 Ding-Yi Chen - 1.4.0 - Merge pull request #13 from hiroshiyui to Fix wrong data type conversion - Fixed: Google Issue 1079: Use shift key to switch to English mode in ibus-chewing Also list as GitHub pull request #17 - Fixed: Google Issue 1089: Ibus-chewing cause window flicker when compiz enabled - Fixed: Google Issue 1329, Github Issue 3: Merge with buganini at gmail.com - Fixed: Google Issue 1351: ibus-chewing 1.3.10 mistakenly send uncommitted charactor. - Fixed: Google Issue 1374: ibus-chewing: cannot save the preference with gnomeshell - Fixed: Google Issue 1427: ibus-chewing-1.3.10 is not compatible with ibus-1.4.0 and higher Also list as GitHub pull request #16 - Fixed: GitHub Issue 5: Word missing when with libchewing-0.3.3 and ibus-chewing 1.3.10 Also list as GitHub pull request #15 - Fixed: Launchpad bug: 1014456 bus-chewing deletes characters if too many of them are entered Also list as GitHub pull request #19 * Thu Dec 15 2011 - Ding-Yi Chen - 1.3.10 - Fixed Bug 726335 (Google issue 1281)- [abrt] ibus-chewing-1.3.9.2-3.fc15: g_atomic_int_get: Process /usr/libexec/ibus-engine-chewing was killed by signal 11 (SIGSEGV) using patch from Scott Tsai - Fixed Bug 727018 - ibus compose file needs a symbol tag for gnome-shell - Fixed characters duplication problem (Google issue 1245, GitHub ibus-chewing issue 2) - Fixed KP-Enter not been able to commit preedit buffer. (Google issue 1303, GitHub ibus-chewing issue 4) - Depends on cmake-fedora now. - Fixed issue 1274, which is addressed by yusake's comments on d9009bf. - Add compile flag for GNOME3. - Add command line option: showFlags - ibus-gnome special symbol - Thanks Fred Chien's patch against that candidate window cannot be closed with escape key since selected tone. - Thanks Fourdollar's patch for Fix plain zhuyin with space as selection problem. - Remove support for ibus-1.2 and prior. * Fri Nov 19 2010 Ding-Yi Chen - 1.3.9.2 - Fixed Bug 652909 - Added back a Changlog item that mention Nils Philippsen's change. - Apply Jim Huang's patch for zh_TW.po * Fri Nov 12 2010 Ding-Yi Chen - 1.3.8 - Quick fix for f15 and ibus-1.4 build - Version scheme change. * Fri Sep 10 2010 Ding-Yi Chen - 1.3.7.20100910 - Input style of ibus-chewing is decommissioned under ibus >=1.3. Now the input style is determined solely on the setting of "Embed preedit in application window" in IBus. - Resolves: #608991, #632043 - Fixed Issue 1022: chewing commit some text in reset method (patched by Peng Huang). - Fixed Issue 1032: [ibus-chewing] Chewing not commit some single Chinese char into application when press enter. - Rewrite CMake modules to make them cleaner, and documents in cmake module help format. - [For developer and distro maintainer] Various targets changed. Use 'make help' to obtain a list of available targets. * Fri Jul 30 2010 - Ding-Yi Chen - 1.3.6.20100730 - Resolves: #608991 - Sort of fix upstream issue 993. - Include USER-GUIDE - Remove NEWS, as this project does not use it. - Fix upstream Issue 1016: [ibus-chewing] Chewing should commit the complete string before disable chewing. But only for ibus-1.3.0 and later. - Mouse candidate selection now work in plain Zhuyin mode. - Default setting changes: (Won't affect current user though). + Auto move cursor: TRUE + Add phrases in front: TRUE + spaceAsSelection: FALSE * Wed Jul 14 2010 Ding-Yi Chen - 1.3.5.20100714 - Resolves: #608991 - Removes Ctrl-v/V Hotkey * Wed Jul 07 2010 - Ding-Yi Chen - 1.3.5.20100706 - Fixed google issue 965: Candidate missing if both "Plain Zhuyin" and "Space As selection" are enabled. - Revised Basic.macro - Resolved: #608991 * Tue Jun 08 2010 - Ding-Yi Chen - 1.3.4.20100608 - ibus-chewing can now use mouse to click on mouse. Thus Fix Issue 951: Chewing does not support selection of candidates via mouseclick Thanks zork@chromium.org for the patch. * Fri Jun 04 2010 - Ding-Yi Chen - 1.3.4.20100605 - Fix Issue 942: Fix unsunk references in ibus-chewing Applied the patch provided by zork@chromium.org. - Rename CVS_DIST_TAGS to FEDORA_DIST_TAGS, and move its definition to cmake_modules/ - Gob2 generated file is now removed, because Bug 519108 is fixed from Fedora 11. * Wed Mar 17 2010 - Ding-Yi Chen - 1.2.99.20100317 - Fix google 796: English input for dvorak - Fix google 797: Zhuyin input for dvorak - Fix google 807: ibus-chewing shows the over-the-spot panel even when not necessary * Fri Feb 19 2010 - Ding-Yi Chen - 1.2.99.20100217 - Fixed the CMake description that leads summary incorrect. * Tue Feb 16 2010 - Ding-Yi Chen - 1.2.99.20100216 - Fixed when typing English immediately after incomplete Chinese character. - Add zh_TW summary. - Revised description and write its zh_TW translation. * Tue Feb 16 2010 - Ding-Yi Chen - 1.2.99.20100215 - "Macroize" rpm spec. - Resolves: #565388 * Fri Feb 12 2010 - Ding-Yi Chen - 1.2.99.20100212 - Fixed Google issue 505. - Google issue 755 is fixed in libchewing-0.3.2-22, See Chewing Google issue 10 - Fixed behavior of Del, Backspace, Home, End - Revert the change that fix Google issue 758. - Change the default input style to "in candidate window", because not all application handle the on-the-spot mode well. - Fixed Google issue 776 * Tue Feb 09 2010 - Ding-Yi Chen - 1.2.0.20100210 - Revert the change that fix Google issue 758. - Remove "tag" target, add "commit" which do commit and tag. * Tue Feb 09 2010 - Ding-Yi Chen - 1.2.0.20100209 - Fixed Google issue 754: commit string is missing when inputting long English text in the end. - Fixed Google issue 758: Space is irresponsive in Temporary English mode if no Chinese in preedit buffer. - Fixed Google Issue 763: [ibus-chewing] [qt] Shift-Up/Down does not mark text area properly. - Change the String "on the spot" to "in application window", Chinese translation change to "在輸入處組詞" - Change the "over the spot" to "in candidate window", Chinese translation remain the same - Fixed bodhi submission. * Mon Jan 25 2010 - Ding-Yi Chen - 1.2.0.20100125 - Add over-the-spot editing mode. - Possible fixed of Google issue 505: ibus acts strange in Qt programs. - Implemented Google issue 738: Add a mode that allow editing in candidate window (thus over-the-spot mode). * Fri Dec 11 2009 - Ding-Yi Chen - 1.2.0.20091211 - Fix Google issue 608: ibus-chewing does not show cursor in xim mode. - Fix Google issue 611: ibus-chewing keyboard setting reverts to default unexpectlly. - Fix Google issue 660: failed to build with binutils-gold. - Remove make target commit. - Add make target tag * Fri Oct 02 2009 - Ding-Yi Chen - 1.2.0.20091002 - Bug 518901 - ibus-chewing would not work with locale zh_TW.Big - Fix Google issue 501: ibus-chewing buffer doesn't get cleared when toggling ibus on/off - Fix Google issue 502: ibus-chewing: character selection window stays behind when toggling ibus off- Use WM's revised ibus-chewing icon. - Debug output now marked with levels. * Thu Sep 17 2009 - Ding-Yi Chen - 1.2.0.20090917 - Addressed Upstream (IBUS Google code) issue 484: + Find the source that why the / and . are not working. - Pack the gob2 generation source to avoid the [Bug 519108]: [gob2] class and enum names convert incorrectly in mock / koji. * Wed Sep 09 2009 - Ding-Yi Chen - 1.2.0.20090831 - IBusProperty and IBusPropList are free upon destruction. - Fixed Red Hat Bugzilla [Bug 519328] [ibus-chewing] inconsistent between normal mode and plain Zhuyin mode. - Addressed Upstream (IBUS Google code) issue 484: Arithmetic symbols (+-*/) on number pad does not input properly. * Wed Aug 26 2009 - Ding-Yi Chen - 1.2.0.20090818 - Merged 1.2 and 1.1 source code. - Addressed Upstream (IBUS Google code) issue 471. - Remove libX11 dependency. * Mon Aug 17 2009 - Ding-Yi Chen - 1.2.0.20090624 - Lookup table now shows the selection key. * Mon Jun 22 2009 - Ding-Yi Chen - 1.2.0.20090622 - For IBus 1.2 - Revised dialog look. * Fri May 22 2009 - Ding-Yi Chen - 1.0.10.20090523 - Applied Lubomir Rintel's patch * Fri May 22 2009 - Ding-Yi Chen - 1.0.10.20090522 - Now the 1st down key brings the longest possible phrases. The 2nd down key brings the 2nd longest possible phrases from the back, unlike the previous versions where the cursor stays in the head of longest phrase. - Add force lowercase in English mode option. - Fix double free issue when destroy ibus-chewing. - Hide ibus-chewing-panel when ibus-chewing is focus-out * Mon May 11 2009 - Ding-Yi Chen - 1.0.9.20090508 Now commit is forced when switch of ibus-chewing or current application loses focus. - New ibus-chewing.png is contribute by WM. - input-keyboard.png is no longer needed and removed. - ibus-engine-chewing -v option now need an integer as verbose level. - ibus-chewing.schemas is now generated. - Fix some CMake modules bugs. * Tue Apr 28 2009 - Ding-Yi Chen - 1.0.8.20090428 Fix the errors which Funda Wang as pointing out: - Move src/chewing.xml.in to data/ - Fixed some typo in next_version targets. - Remove GConf2 package requirement, while add gconftool-2 requirement. * Mon Mar 30 2009 - Ding-Yi Chen - 1.0.5.20090330 - Added tooltips. - Revealed the sync caps lock setting. - Fixed Right key bug. - Added CMake policy 0011 as OLD. * Mon Mar 23 2009 Ding-Yi Chen - 1.0.4.20090323 - Various Settings are now in dialog. - Integer settings are now revealed. - MakerDialog.gob is now available. - Work around of easy symbol input. - Fix iBus Google issue 310. * Wed Mar 11 2009 Ding-Yi Chen - 1.0.3.20090311 - IBus Google issue 305: ibus-chewing.schema -> ibus-chewing.schemas - IBus Google issue 307: hardcoded chewing datadir - Sync chewing candPerPage and IBusTable->page_size - Sync between IM and keyboard (Experimental) * Tue Mar 03 2009 Ding-Yi Chen - 1.0.2.20090303 - Required gconf2 -> GConf2. - Fix RPM scriptlet. * Fri Feb 27 2009 Ding-Yi Chen - 1.0.1.20090227 - Add gconf schema. - Fix some memory leaking checked. - Move some function to cmake_modules. - Fix Google code issue 281 * Fri Feb 20 2009 - Ding-Yi Chen - 1.0.0.20090220 - This is a barely working version for with IBus C. - The build system is converted from autotool to CMake.ibus-chewing-1.4.14/INSTALL000066400000000000000000000015601244356534300152310ustar00rootroot00000000000000Installation Instructions ************************* 0. Required: libchewing>=0.3.2-16 (with chewing_zuin path, or upstream r1048), cmake >=2.4 gob >=2 gettext gtk2 GConf2 libXtst 1. Remove the old build cache: If you have previous ibus-chewing, or change between ibus 1.1 and ibus 1.2, You may need to remove CMakeCache.txt 2. Extract source and enter the extracted directory, then: cmake . -DCMAKE_INSTALL_PREFIX='/usr' -DLIBEXEC_DIR='/usr/libexec' make Change CMAKE_INSTALL_PREFIX and LIBEXEC_DIR if you want to install in different directories. 3. If you have previous version installed, then need to: make uninstall_schemas 4. Install and register schemas: sudo make install make install_schemas 5. Use iBus UI or run ibus-setup to add ibus-chewing. 6. Restart iBus and Enjoy! To see other available build targets, use make help ibus-chewing-1.4.14/README000066400000000000000000000014561244356534300150640ustar00rootroot00000000000000IBus-Chewing is an IBus front-end of Chewing, an intelligent Chinese input method for Zhuyin (BoPoMoFo) users. Following documents provides further instruction: COPYING : GPLv2 Licence USER-GUIDE: How to use ibus-chewing INSTALL : Installation instruction. Bugs and enhancement can be filed to: Red Hat Bugzilla: https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=ibus-chewing GitHub ibus-chewing issues: https://github.com/definite/ibus-chewing/issues Google Code IBus: http://code.google.com/p/ibus/issues/list For debugging ibus-chewing: 1. Quit existing ibus-daemon By right click on IBus systray icon, then quit, or kill the process. 2. Run ibus-daemon in command line with following command export G_MESSAGES_DEBUG=all export G_DEBUG=MKDG,ibus-chewing ibus-daemon -rvx ibus-chewing-1.4.14/RELEASE-NOTES.txt000066400000000000000000000002051244356534300167020ustar00rootroot00000000000000PRJ_VER=1.4.14 SUMMARY=Fixed the issues found in static checks REDHAT_BUGZILLA= [Changes] - Fixed the issues found in static checks ibus-chewing-1.4.14/USER-GUIDE000066400000000000000000000107721244356534300155410ustar00rootroot00000000000000#summary User Guide for Chewing For the latest version of this document, please see http://code.google.com/p/ibus/wiki/ChewingUserGuide = Introduction = Chewing helps you inputting Chinese by its pronunciation, in the form of either [http://en.wikipedia.org/wiki/Bopomofo Bopomofo/Zhuyin] or [http://en.wikipedia.org/wiki/Pinyin Hanyu pinyin], as well as Chinese punctuation marks and normal and full shape number and English alphabets. For the ease of documentation and readability, following sections assume you are using the default configuration, that is, with default/DaChen Bopomofo keyboard layout, on an en_US keyboard, and default key-binding. = Glossary = Preedit buffer: The places for storing your typing before sending to the applications (such as firefox) you are using. = Mode = Mode determines how Chewing reacts on keyboard input. == Editing mode == This mode is for normal Chinese character and punctuation typing. You are more likely working on this mode. In this mode, alpha-numberic and punctuation marks are interpreted as either Bopomofo symbols or punctuation marks. If the symbols can form Chinese characters, it will choose the most suitable character according to the context in preedit buffer. It's recommend that you enter the whole Chinese sentences, so Chewing can do auto-correction for you. If you like what you see, you can press [Enter] to commit the characters in preedit buffer. If something go wrong, you can select the character by move your cursor using {Left} or {Right}, then press {Down} to enter Candidate Selection mode to choose words. To prevent the auto-correction on certain phrase, you may press {Tab} to break the auto-correction on the end of the sentence. You can also remember the 2,3,4 words phrases by pressing {Ctrl-2}, {Ctrl-3}, and {Ctrl-4} on the end of the phrase. Also note that Shift's behavior changes in this mode. Shift-(alpha number) outputs corresponding Full shape Chinese symbols if "Easy symbol input" is enabled; Or outputs corresponding number half shape lowercase English alphabets if "Easy symbol input" is disabled. Talking about inputing Chinese symbols, other then enable "Easy symbol input" mode, you can also press {Ctrl-1} to open up a symbol selection dialog, select the category, then use {Down} key to choose the symbols as you would do for characters. Hot-keys: ||Caps Lock || Toggle Temporary English sub-mode || ||Down || Enter Candidate Selection mode || ||Shift-Space|| Toggle Half/Full Shape sub-mode || ||Enter || Commit the content in preedit buffer to application || ||Tab || Break the auto-correction. || ||Ctrl-1 || Open symbol selection dialog || ||Ctrl-2 || Remember 2-word phrase. || ||Ctrl-3 || Remember 3-word phrase. || ||Ctrl-4 || Remember 4-word phrase. || === Half/Full Shape sub-mode ==== This sub-mode is for inputing half shape and full shape characters. Half shape characters are essentially normal English characters; while the full shape characters are full-width pretty symbols that resemble English characters. Hot-keys: ||Shift-Space|| Toggle Half/Full Shape sub-mode || === Temporary English sub-mode === This sub-mode is for temporary English inputting. Hot-keys: ||Caps Lock || Toggle Temporary English sub-mode || == Candidate Selection mode == This mode if for Choosing the candidate. Firstly, the longest phrases that fit the pronunciation are shown, then the second shortest, till the single characters. Pressing {Down} again to return to the longest phrases. For example, after entering "w91o3g4". Pressing {Down} makes Chewing displays 3-word candidate "台北市"; pressing {Down} again makes Chewing displays 2-word candidate "北市"; pressing {Down} again makes Chewing displays 1-word candidates "市","是"; pressing {Down} again makes Chewing displays back the 3-word candidates "台北市"; Hot-keys: ||Down || Next bunch of candidates in different length || ||Left || Previous page of candidates || ||Right || Next page of candidates || ||1, 2, ...0 || Select 1st, 2nd, ... 10th candidate || == Bypass mode == This mode is on whenever the preedit buffer is empty. This allows you to use movement keys (such as cursor keys and page up/page down) and popular key binding (Ctrl-A, Ctrl-S). ibus-chewing-1.4.14/cmake-fedora/000077500000000000000000000000001244356534300165145ustar00rootroot00000000000000ibus-chewing-1.4.14/data/000077500000000000000000000000001244356534300151075ustar00rootroot00000000000000ibus-chewing-1.4.14/data/chewing.xml.in000066400000000000000000000020001244356534300176520ustar00rootroot00000000000000 @PROJECT_SCHEMA_ID@ Chewing Component @PRJ_VER@ @LICENSE@ Peng Huang, Ding-Yi Chen http://code.google.com/p/ibus @LIBEXEC_DIR@/ibus-engine-chewing --ibus ibus-chewing chewing Chewing Chinese chewing input method zh_TW GPLv2+ Peng Huang, Ding-Yi Chen @PRJ_DATA_DIR@/icons/@PROJECT_NAME@.png us @LIBEXEC_DIR@/ibus-setup-chewing @PRJ_VER@ @PROJECT_NAME@ 80 @HOTKEYS_XML@ @SYMBOL_XML@ ibus-chewing-1.4.14/data/ibus-setup-chewing.desktop000066400000000000000000000004631244356534300222270ustar00rootroot00000000000000[Desktop Entry] Name=IBus Chewing Preferences Name[zh_TW]=IBus 酷音偏好設定 Comment=Set IBus Chewing Preferences Comment[zh_TW]=設定 IBus 酷音偏好 Exec=/usr/libexec/ibus-setup-chewing Icon=ibus-setup-chewing NoDisplay=true Terminal=false Type=Application StartupNotify=true Categories=Settings; ibus-chewing-1.4.14/icons/000077500000000000000000000000001244356534300153115ustar00rootroot00000000000000ibus-chewing-1.4.14/icons/ibus-chewing-orig.png000066400000000000000000000110641244356534300213430ustar00rootroot00000000000000PNG  IHDR00WbKGDC pHYs  IDATh޵it\ՑoEnvɒ,Xf`H 'xXC !Á I0bLH&dB 8!`fclYdI[RK·e5wnoխ1I-`>1k^}{J-}bҳElτNM&ąelL.h&_,['s'=Spx;a  L`${DHt.'s3 ڬ][̚5)-b1y/2dpb*Ko8MQT/Lx!s.Xh Xt0wYtapXax+ؾ=dn:Jl&[ߤF{;̐xc jQK?$I۷`Y'p|{LV)^gSSfMK/ 1w`PF/*RhlkW5kPce *y'0;a|AGx&wٽ!fG}ŎF)>j]̎xNd \WbM+/7$]W]G3Io⫯얯#M)XϏx#[ICeW|F^< `pz%!ű' Swc,W\&T:!-d )M8##Dt#_>kSgR8鱾c6fvC;,@<_ 6n`/?z3v}D0穼gF{;]@߭wbXer#8D"&˾}Y*mZ$BThՕ~K>J(DD -1q惄$(7ĭavm0Mf0W]֜=8(`v~Z02q!bċZLƹ =P$]NJ`<؅J(DP|u5m6o-]<|,F_HDrў=Y6BMuוre!&9*>gծÌD㧠(EaUȅ$xT&V=@J0Hͦ x(5\<5Md[$y챚)D&Z[h ϼ-]aZe9X&gr0ebJC--F;ԟ3V%l[M^uJD"&۶ٷ/,CS G Ԃ?t$)O-!gG= {8 Hlۖb۶$,+̞g9c9G}6zmy"᫯@--lߏNwcۂ8 ^.4Ē%>=^u'8c (\_xpbC>"Vw/ͯ<0PJA݌)'Oزmc48UfiQVR[#l<ڵanB=2p姑}\c@!Im{5ȾV_o) 4IG^ڌp]zؼ93όPW8眩^KEA. :ɭΕJY 8. :+zM5}GfGT3&=zk+&޽nn!RشfZYH$cм XPaZT޷.F-+!'{,BȾC7|j0{;.lD##6އHbQd.SQR_䣡CCJ PH@FӤ'2g"<U`x'yJ<;C&pc4ǻpD)wIcUgj,YRȲe~.ࡴT㑎u5 |!\$g;3C"w?E]B𒋦@Rռ[!Ѫ*3z]g*!46!pqI z~fN}Nmgw#( -_KVf"=ȁJI1+"xg'@'MH bGSnzjy[6De688h1Zi5ڈX݌:cȄ"DnFQڍV컇3MIp]lIא ^n!=֏&>X/m I5.K7u`eثHBH RSqN`9 8IC>R'V6'"%hm{Xxh"IȊ>y7OiOqah; ߯ ϣL-#(PS;(RBh,@t.g^xHj~r4Owi/Hgxj#{X_eoMZvA4n*x7ÉQ y)bB*GZZ\\ ,kZlz|Ͳe/]~Ҋ"L 1`@FAntSwN*mbuFuJ 4gvsh;*aH2/Vϯ|hT 1v`džs)62ȤB"!#:H2_ N| N1$?){}K܉oivjb#. ؖN yt@I= @[ISѪP \$݃6IHm}  'G+ '{AL͚!v6H j9sdk=ÏSyߝx9 "y=t4pΙ8#qbO<;t#oe^ٽ2S}M3g j%RCBLDa!͊_'pm%'ZZ)vN>]484#K a'>o^wIg͞%Ql1c8n}q2ayzl'mRg_tEXtCommentCreated with The GIMPd%nIENDB`ibus-chewing-1.4.14/icons/ibus-chewing.png000066400000000000000000000036101244356534300204030ustar00rootroot00000000000000PNG  IHDR00` sRGBgAMA a cHRMz&u0`:pQ<PLTE?R?R?R?R?R?R?R?R?S?S?S?S?S?S?T?T?T?T?T?T?T?U?U?U?U?U?U?U?V?V?V?V?V?V?V?W?W?W?W?W?W?W?X?X?X?X[k[lQfQfQgQg[oeto}euevevevevevewewewo}o}o~o~ewewewewexexyyooyy鄐׏ُ߄ㄒ脒ꄓ쏛嚤ݚޚߚᚥ⚥㚥䚥嚥皦蚦隦ꚦ뚦욦횦藺᧰⧰䧰姰槱秱觱駱맱ﴻ紼봼 tRNSS% pHYsodtEXtSoftwarePaint.NET v3.5EIDATHKSRQ!MMeqPD,l56}/RԲ2KCIK_?'雹p9 3sĔ ,{+d98bpTq@e6  *f `#!|;6s?txJ)!x1l^76 (1 mt cwzކB~tC`|'=#v_Ċ;ZN8i') *Ju_3# 0WUib 'ܵy# Oa[BYI\r:N-nw8l|:~C<܂KV͖ĐCHp|w@GC,D!K !kVd B(!p4`)aXۀ6+1Hx c$?2}-B"H [KH#\@%{AyDos~(PpDsa"Ha"$sqUPەO矶 QD8uA [ATЙ+!5rJm?ֹcn;5LJniݘ~ଙ>VK _#}+!2ƑŇ\fC`cٗ 7տAIENDB`ibus-chewing-1.4.14/icons/ibus-setup-chewing.png000066400000000000000000000027121244356534300215430ustar00rootroot00000000000000PNG  IHDR00WbKGDtIME "(B0lIDAThOhgnL՚J,+4m id)69 5I(R""Z$x/, %B̟w&3j wy}?C="~3;;y"ԛx~ܹ~\⺮0MS9,//3??si!tqvYh4&RJ͛ɩk!{B_FFF>=Z[caaaqO{ ?tqJv֨RKLRJ\V?}{={Ƕ_ӶVBjϕRgϞ+… /Ҷˮ~X,KeUI)jZ}CKRʫ\,Jy(Y]1 !'<ј0uO-mff柮>t1>(c>RPV~FFF8tP4ƃx\.]mve566?fee%ʶR !GŲ,]ETU*Jb\JɁ8x CCCܽ{w}}}}ڲ0 #G r8VC۷cǎ%ZR)eYVh+ |i2E MBē:'yMyHmV@4t]U Q+$'M@XLNฐ,H@>/  BDZ)]qdF??m۸e4mJf'&&&k RyJB`X~jnܯ.GR'?>#e MFU[ܿ=Ʌe5O K {ʞ+*ڿAVAP++~R8}t0|̙^>u癀#A>>ZMh@ظ^...tʕI6J)2 bd2P$}MP>A^0/D~ܩ] m@A` Nq잀Az/a50kIENDB`ibus-chewing-1.4.14/po/000077500000000000000000000000001244356534300146145ustar00rootroot00000000000000ibus-chewing-1.4.14/po/CMakeLists.txt000066400000000000000000000004021244356534300173500ustar00rootroot00000000000000# Translated languages. INCLUDE(ManageZanata) MANAGE_GETTEXT(ALL SRCS ${IBUS_CHEWING_SOURCE_TO_TRANSLATE}) MANAGE_ZANATA("https://fedora.zanata.org/" YES VERSION "master" GENERATE_ZANATA_XML ) ADD_DEPENDENCIES(pack_src_pre translations) ibus-chewing-1.4.14/po/de.po000066400000000000000000000365361244356534300155610ustar00rootroot00000000000000# da ma , 2014. #zanata msgid "" msgstr "" "Project-Id-Version: ibus-chewing 1.4.11\n" "Report-Msgid-Bugs-To: Ding-Yi Chen \n" "POT-Creation-Date: 2014-11-04 16:04+1000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "PO-Revision-Date: 2014-11-20 03:41-0500\n" "Last-Translator: da ma \n" "Language-Team: German (Germany)\n" "Language: de\n" "X-Generator: Zanata 3.5.1\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine-input-events.c:386 #: /home/dchen/devel/ibus-chewing/src/ibus-setup-chewing.c:72 msgid "Setting" msgstr "Einstellung" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:251 msgid "Chi" msgstr "Chi" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:254 msgid "Eng" msgstr "Eng" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:258 msgid "Click to switch to English" msgstr "Klicken um in die englische Sprache zu wechseln" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:262 msgid "Click to switch to Chinese" msgstr "Klicken um in die chinesische Sprache zu wechseln" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:265 msgid "Full" msgstr "Voll" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:268 msgid "Half" msgstr "Halb" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:271 msgid "Settings" msgstr "Einstellungen" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:13 msgid "Editing" msgstr "Bearbeiten" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:14 msgid "Selecting" msgstr "Wählen" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:15 msgid "Keyboard" msgstr "Tastatur" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:18 msgid "default" msgstr "Standard" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:19 msgid "hsu" msgstr "hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:20 msgid "ibm" msgstr "ibm" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:21 msgid "gin_yieh" msgstr "gin_yieh" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:22 msgid "eten" msgstr "eten" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:23 msgid "eten26" msgstr "eten26" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:24 msgid "dvorak" msgstr "dvorak" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:25 msgid "dvorak_hsu" msgstr "dvorak_hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:26 msgid "dachen_26" msgstr "dachen_26" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:27 msgid "hanyu" msgstr "hanyu" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:45 msgctxt "Sync" msgid "disable" msgstr "Deaktivieren" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:46 msgctxt "Sync" msgid "keyboard" msgstr "Tastatur" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:47 msgctxt "Sync" msgid "input method" msgstr "Eingabemethode" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:52 msgid "Auto" msgstr "Auto" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:53 msgid "Big5" msgstr "Big5" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:54 msgid "UTF8" msgstr "UTF8" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:59 msgid "Keyboard Type" msgstr "Tastaturtyp" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:63 msgid "Select Zhuyin keyboard layout." msgstr "Zhuyin-Tastaturbelegung wählen." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:66 msgid "Selection keys" msgstr "Auswahltasten" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:71 msgid "" "Keys used to select candidate. For example \"asdfghjkl;\", press 'a' to " "select the 1st candidate, 's' for 2nd, and so on." msgstr "" "Tasten zur Kandidatenauswahl. Zum Beispiel \"asdfghjkl;\", drücken Sie 'a', " "um den 1. Kandidaten zu wählen, 's' für den 2., etc." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:75 msgid "Hsu's selection key" msgstr "Hsu's Auswahltaste" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:78 msgid "Hsu's keyboard selection keys, 1 for asdfjkl789, 2 for asdfzxcv89 ." msgstr "Hsu's Tastaturauswahl-Tasten, 1 für asdfjkl789, 2 für asdfzxcv89 ." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:82 msgid "Auto move cursor" msgstr "Auto-Cursor" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:85 msgid "Automatically move cursor to next character." msgstr "Cursor automatisch zum nächsten Zeichen bewegen." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:89 msgid "Add phrases in front" msgstr "Ausdrücke am Anfang einfügen" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:92 msgid "Add phrases in the front." msgstr "Ausdrücke am Anfang einfügen." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:96 msgid "Easy symbol input" msgstr "Einfache Symboleingabe" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:99 msgid "Easy symbol input." msgstr "Einfache Symboleingabe." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:103 msgid "Esc clean all buffer" msgstr "Esc löscht Puffer" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:106 msgid "Escape key cleans the text in pre-edit-buffer." msgstr "Escape-Taste löscht Text im Puffer." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:110 msgid "Maximum Chinese characters" msgstr "Maximale Chinesische Zeichen" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:113 msgid "" "Maximum Chinese characters in pre-edit buffer, including inputing Zhuyin " "symbols" msgstr "Maximale Chinesische Zeichen im Puffer, einschließlich Zhuyin-Symbole" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:117 msgid "Force lowercase in En mode" msgstr "Kleinschreibung in En-Modus erzwingen" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:120 msgid "" "Ignore CapsLock status and input lowercase by default.\n" "It is handy if you wish to enter lowercase by default.\n" "Uppercase can still be inputted with Shift." msgstr "" "CapsLock-Status ignorieren und standardmäßig Kleinschreibung verwenden.\n" "Praktisch für die standardmäßige Eingabe in Kleinschreibung.\n" "Großschreibung kann per Umschalttaste aktiviert werden." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:128 msgid "Sync between CapsLock and IM" msgstr "Sync zwischen CapsLock und IM" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:134 msgid "" "Occasionally, the CapsLock status does not match the IM, this option " "determines how these status be synchronized. Valid values:\n" "\"disable\": Do nothing.\n" "\"keyboard\": IM status follows keyboard status.\n" "\"IM\": Keyboard status follows IM status." msgstr "" "Gelegentlich stimmt der CapsLock-Status nicht mit der IM überein, diese " "Option legt fest, wie diese Status synchronisiert werden. Gültige Werte:\n" "\"Deaktivieren\": Nichts tun.\n" "\"Tastatur\": IM-Status folgt dem Tastaturstatus.\n" "\"IM\": Tastaturstatus folgt dem IM-Status." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:141 msgid "Number pad always input number" msgstr "Nummernblock gibt immer Zahlen ein" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:144 msgid "Always input numbers when number keys from key pad is inputted." msgstr "" "Immer Zahlen eingeben, wenn Zahlentasten vom Nummernblock verwendet werden." #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:148 msgid "Shift toggle Chinese Mode" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:151 msgid "Shift key to toggle Chinese Mode" msgstr "" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:155 msgid "Plain Zhuyin mode" msgstr "Einfacher Zhuyin-Modus" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:158 msgid "" "In plain Zhuyin mode, automatic candidate selection and related options are " "disabled or ignored." msgstr "" "In einfachem Zhuyin-Modus werden automatische Kandidatenauswahl und " "zugehörige Optionen deaktiviert oder ignoriert." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:161 msgid "Candidate per page" msgstr "Kandidaten pro Seite" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:164 msgid "Number of candidate per page." msgstr "Anzahl der Kandidaten pro Seite." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:168 msgid "Choose phrases from backward" msgstr "Ausdrücke von hinten wählen" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:171 msgid "Choose phrases from the back, without moving cursor." msgstr "Ausdrücke von hinten wählen, ohne den Cursor zu bewegen." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:175 msgid "Space to select" msgstr "Leertaste zum Auswählen" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:7 msgctxt "Configure" msgid "Cancel" msgstr "Abbruch" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:8 msgctxt "Configure" msgid "Save" msgstr "Speichern" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:9 msgctxt "Configure" msgid "Apply" msgstr "Anwenden" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:10 msgctxt "Configure" msgid "Close" msgstr "Schließen" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:11 msgctxt "Configure" msgid "Ok" msgstr "Ok" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/main.c:84 msgid "Chewing component" msgstr "Chewing-Komponente" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/main.c:86 #: /home/dchen/devel/ibus-chewing/src/main.c:99 msgid "Peng Huang, Ding-Yi Chen" msgstr "Peng Huang, Ding-Yi Chen" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author hedda #: /home/dchen/devel/ibus-chewing/src/main.c:95 msgid "Chewing" msgstr "Chewing" #: /home/dchen/devel/ibus-chewing/src/main.c:96 msgid "Chinese chewing input method" msgstr "" ibus-chewing-1.4.14/po/es.po000066400000000000000000000374051244356534300155740ustar00rootroot00000000000000# Domingo Becker , 2014. #zanata msgid "" msgstr "" "Project-Id-Version: ibus-chewing 1.4.11\n" "Report-Msgid-Bugs-To: Ding-Yi Chen \n" "POT-Creation-Date: 2014-11-04 16:04+1000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "PO-Revision-Date: 2014-12-06 06:11-0500\n" "Last-Translator: Domingo Becker \n" "Language-Team: Spanish (Spain)\n" "Language: es\n" "X-Generator: Zanata 3.5.1\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine-input-events.c:386 #: /home/dchen/devel/ibus-chewing/src/ibus-setup-chewing.c:72 msgid "Setting" msgstr "Configuración" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:251 msgid "Chi" msgstr "Chi (Chino)" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:254 msgid "Eng" msgstr "Eng (Inglés)" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:258 msgid "Click to switch to English" msgstr "Clic para cambiar a inglés" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:262 msgid "Click to switch to Chinese" msgstr "Clic para cambiar a Chino" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:265 msgid "Full" msgstr "Total" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:268 msgid "Half" msgstr "Medio" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:271 msgid "Settings" msgstr "Configuración" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:13 msgid "Editing" msgstr "Modificar rol:" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:14 msgid "Selecting" msgstr "Selección" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:15 msgid "Keyboard" msgstr "Teclado" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:18 msgid "default" msgstr "Predeterminado" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:19 msgid "hsu" msgstr "hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:20 msgid "ibm" msgstr "ibm" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:21 msgid "gin_yieh" msgstr "gin_yieh" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:22 msgid "eten" msgstr "eten" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:23 msgid "eten26" msgstr "eten26" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:24 msgid "dvorak" msgstr "dvorak" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:25 msgid "dvorak_hsu" msgstr "dvorak_hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:26 msgid "dachen_26" msgstr "dachen_26" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:27 msgid "hanyu" msgstr "hanyu" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:45 msgctxt "Sync" msgid "disable" msgstr "deshabilitar" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:46 msgctxt "Sync" msgid "keyboard" msgstr "teclado" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:47 msgctxt "Sync" msgid "input method" msgstr "método de entrada" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:52 msgid "Auto" msgstr "Auto" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:53 msgid "Big5" msgstr "Big5" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:54 msgid "UTF8" msgstr "UTF8" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:59 msgid "Keyboard Type" msgstr "Tipo de teclado" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:63 msgid "Select Zhuyin keyboard layout." msgstr "Seleccione la presentación de teclado Zhuyin." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:66 msgid "Selection keys" msgstr "Teclas de selección" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:71 msgid "" "Keys used to select candidate. For example \"asdfghjkl;\", press 'a' to " "select the 1st candidate, 's' for 2nd, and so on." msgstr "" "Las teclas utilizadas para seleccionar candidatos. Por ejemplo " "\"asdfghjkl;\", presione 'a' para seleccionar el 1er candidato, 's' para " "segundo y así sucesivamente. " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:75 msgid "Hsu's selection key" msgstr "Teclas de Selección de Hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:78 msgid "Hsu's keyboard selection keys, 1 for asdfjkl789, 2 for asdfzxcv89 ." msgstr "" "Selección de teclas del teclado de Hsu, 1 para asdfjkl789, 2 para asdfzxcv89 " "." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:82 msgid "Auto move cursor" msgstr "Desplace el cursor de forma automática" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:85 msgid "Automatically move cursor to next character." msgstr "Desplace el cursor de forma automática al siguiente caracter." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:89 msgid "Add phrases in front" msgstr "Añadir frases al frente" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:92 msgid "Add phrases in the front." msgstr "Añadir frases al frente." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:96 msgid "Easy symbol input" msgstr "Fácil entrada de símbolo" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:99 msgid "Easy symbol input." msgstr "Fácil entrada de símbolo" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:103 msgid "Esc clean all buffer" msgstr "ESC limpieza de todo el buffer" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:106 msgid "Escape key cleans the text in pre-edit-buffer." msgstr "La tecla de escape limpia el texto en el buffer de pre-edición" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:110 msgid "Maximum Chinese characters" msgstr "Número máximo de caracteres chinos" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:113 msgid "" "Maximum Chinese characters in pre-edit buffer, including inputing Zhuyin " "symbols" msgstr "" "Máximos caracteres chinos en buffer de pre-edición, incluyendo ingreso de " "símbolos de entrada" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:117 msgid "Force lowercase in En mode" msgstr "Fuerza el modo En minúsculas" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:120 msgid "" "Ignore CapsLock status and input lowercase by default.\n" "It is handy if you wish to enter lowercase by default.\n" "Uppercase can still be inputted with Shift." msgstr "" "Ignorar el estado de MAYÚS e ingrese en minúsculas por defecto.\n" "Es útil si desea ingresar en minúsculas por defecto.\n" "Las mayúsculas se pueden ingresar con Shift." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:128 msgid "Sync between CapsLock and IM" msgstr "Sincronización entre MAYÚS e IM" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:134 msgid "" "Occasionally, the CapsLock status does not match the IM, this option " "determines how these status be synchronized. Valid values:\n" "\"disable\": Do nothing.\n" "\"keyboard\": IM status follows keyboard status.\n" "\"IM\": Keyboard status follows IM status." msgstr "" "En ocasiones, el estatus de MAYÚS no coincide con IM, esta opción determina " "cómo estos estatus se sincronizan. Valores válidos:\n" "\"disable\": No hace nada.\n" "\"keyboard\": estatus IM sigue el estatus de teclado\n" "\"IM\": Estatus de teclado sigue el estatus IM." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:141 msgid "Number pad always input number" msgstr "Almohadilla numérica siempre ingrese número" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:144 msgid "Always input numbers when number keys from key pad is inputted." msgstr "" "Siempre introduzca números al ingresar teclas numéricas desde el teclado." #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:148 msgid "Shift toggle Chinese Mode" msgstr "Shift intercambia el modo de Chino" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:151 msgid "Shift key to toggle Chinese Mode" msgstr "Tecla Shift para cambiar modo de Chino" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:155 msgid "Plain Zhuyin mode" msgstr "Modo plano Zhuyin" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:158 msgid "" "In plain Zhuyin mode, automatic candidate selection and related options are " "disabled or ignored." msgstr "" "En modo plano Zhuyin, la selección automática de candidatos y las opciones " "relacionadas se inhabilitan o ignoran. " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:161 msgid "Candidate per page" msgstr "Candidato por página" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:164 msgid "Number of candidate per page." msgstr "Número de candidato por página." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:168 msgid "Choose phrases from backward" msgstr "Elija frases desde atrás" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:171 msgid "Choose phrases from the back, without moving cursor." msgstr "Elija frases desde atrás, sin desplazar el cursor." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:175 msgid "Space to select" msgstr "Espacio para seleccionar" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:7 msgctxt "Configure" msgid "Cancel" msgstr "Cancelar" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:8 msgctxt "Configure" msgid "Save" msgstr "Guardar" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:9 msgctxt "Configure" msgid "Apply" msgstr "Aplicar" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:10 msgctxt "Configure" msgid "Close" msgstr "Cerrar" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:11 msgctxt "Configure" msgid "Ok" msgstr "Aceptar" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/main.c:84 msgid "Chewing component" msgstr "Componente de Chewing" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/main.c:86 #: /home/dchen/devel/ibus-chewing/src/main.c:99 msgid "Peng Huang, Ding-Yi Chen" msgstr "Peng Huang, Ding-Yi Chen" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gguerrer #: /home/dchen/devel/ibus-chewing/src/main.c:95 msgid "Chewing" msgstr "Chewing" #: /home/dchen/devel/ibus-chewing/src/main.c:96 msgid "Chinese chewing input method" msgstr "Método de entrada de Chino" ibus-chewing-1.4.14/po/fr.po000066400000000000000000000375521244356534300155770ustar00rootroot00000000000000# msgid "" msgstr "" "Project-Id-Version: ibus-chewing 1.4.11\n" "Report-Msgid-Bugs-To: Ding-Yi Chen \n" "POT-Creation-Date: 2014-11-04 16:04+1000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "PO-Revision-Date: 2014-10-02 12:54-0400\n" "Last-Translator: dchen \n" "Language-Team: French\n" "Language: fr\n" "X-Generator: Zanata 3.5.1\n" "Plural-Forms: nplurals=2; plural=(n > 1)\n" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine-input-events.c:386 #: /home/dchen/devel/ibus-chewing/src/ibus-setup-chewing.c:72 msgid "Setting" msgstr "Paramétrer" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:251 msgid "Chi" msgstr "Chi" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:254 msgid "Eng" msgstr "Eng" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:258 msgid "Click to switch to English" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:262 msgid "Click to switch to Chinese" msgstr "" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:265 msgid "Full" msgstr "Plein" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:268 msgid "Half" msgstr "Moitié" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:271 msgid "Settings" msgstr "Paramètres" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:13 msgid "Editing" msgstr "Modifier" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:14 msgid "Selecting" msgstr "Sélection" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:15 msgid "Keyboard" msgstr "Clavier" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:18 msgid "default" msgstr "par défaut" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:19 msgid "hsu" msgstr "hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:20 msgid "ibm" msgstr "ibm" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:21 msgid "gin_yieh" msgstr "gin_yieh" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:22 msgid "eten" msgstr "eten" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:23 msgid "eten26" msgstr "eten26" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:24 msgid "dvorak" msgstr "dvorak" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:25 msgid "dvorak_hsu" msgstr "dvorak_hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:26 msgid "dachen_26" msgstr "dachen_26" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:27 msgid "hanyu" msgstr "hanyu" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:45 msgctxt "Sync" msgid "disable" msgstr "Désactiver" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:46 msgctxt "Sync" msgid "keyboard" msgstr "Clavier" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:47 msgctxt "Sync" msgid "input method" msgstr "Méthode de saisie" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:52 msgid "Auto" msgstr "Auto" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:53 msgid "Big5" msgstr "Big5" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:54 msgid "UTF8" msgstr "UTF8" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:59 msgid "Keyboard Type" msgstr "Type de clavier" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:63 msgid "Select Zhuyin keyboard layout." msgstr "Sélectionner la disposition Zhuyin du clavier." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:66 msgid "Selection keys" msgstr "Touches de sélection" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:71 msgid "" "Keys used to select candidate. For example \"asdfghjkl;\", press 'a' to " "select the 1st candidate, 's' for 2nd, and so on." msgstr "" "Touches utilisées pour sélectionner le candidat. Par exemple : " "\"asdfghjkl;\", appuyez sur 'a' pour sélectionner le 1er candidat, sur 's' " "pour le 2ème, et ainsi de suite." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:75 msgid "Hsu's selection key" msgstr "Touche de sélection de Hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:78 msgid "Hsu's keyboard selection keys, 1 for asdfjkl789, 2 for asdfzxcv89 ." msgstr "" "Touches de sélection du clavier Hsu, 1 pour asdfjkl789, 2 pour asdfzxcv89 ." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:82 msgid "Auto move cursor" msgstr "Déplacement automatique du curseur" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:85 msgid "Automatically move cursor to next character." msgstr "Automatiquement déplacer le curseur sur le caractère suivant." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:89 msgid "Add phrases in front" msgstr "Ajouter des phrases devant" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:92 msgid "Add phrases in the front." msgstr "Ajouter des phrases à l'avant." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:96 msgid "Easy symbol input" msgstr "Entrée Easy Symbol" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:99 msgid "Easy symbol input." msgstr "Entrée Easy symbol." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:103 msgid "Esc clean all buffer" msgstr "Esc supprime toute la mémoire-tampon" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:106 msgid "Escape key cleans the text in pre-edit-buffer." msgstr "" "La touche d'échappement (« Esc ») supprimer le texte dans la mémoire-tampon " "pré-modifications." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:110 msgid "Maximum Chinese characters" msgstr "Caractères chinois maximum" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:113 msgid "" "Maximum Chinese characters in pre-edit buffer, including inputing Zhuyin " "symbols" msgstr "" "Caractères chinois maximum dans la mémoire-tampon pré-modifications, y " "compris les entrées de symboles Zhuyin" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:117 msgid "Force lowercase in En mode" msgstr "Force les minuscules en mode En" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:120 msgid "" "Ignore CapsLock status and input lowercase by default.\n" "It is handy if you wish to enter lowercase by default.\n" "Uppercase can still be inputted with Shift." msgstr "" "Ignorer le statut CapsLock et entrer des lettres minuscules par défaut.\n" "Ceci est pratique si vous souhaitez saisir des lettres minuscules par défaut." "\n" "Les majuscules peuvent toujours être saisies avec la touche « Shift »." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:128 msgid "Sync between CapsLock and IM" msgstr "Synchronisation de CapsLock et IM" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:134 msgid "" "Occasionally, the CapsLock status does not match the IM, this option " "determines how these status be synchronized. Valid values:\n" "\"disable\": Do nothing.\n" "\"keyboard\": IM status follows keyboard status.\n" "\"IM\": Keyboard status follows IM status." msgstr "" "Occasionnellement, le statut CapsLock ne correspond pas à l'IM, cette option " "détermine la manière par laquelle ces statuts sont synchronisés. Valeurs " "valides :\n" "\"disable\": ne rien faire.\n" "\"keyboard\": le statut IM suit le statut du clavier.\n" "\"IM\": le statut du clavier suit le statut IM." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:141 msgid "Number pad always input number" msgstr "Le pavé numérique produit toujours des chiffres" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:144 msgid "Always input numbers when number keys from key pad is inputted." msgstr "" "Toujours entrer des chiffres lorsque des touches de chiffres du clavier sont " "saisies." #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:148 msgid "Shift toggle Chinese Mode" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:151 msgid "Shift key to toggle Chinese Mode" msgstr "" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:155 msgid "Plain Zhuyin mode" msgstr "Mode Zhuyin simple" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:158 msgid "" "In plain Zhuyin mode, automatic candidate selection and related options are " "disabled or ignored." msgstr "" "En mode Zhuyin simple, la sélection de candidat automatique et les options " "qui y sont liées sont désactivées ou ignorées." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:161 msgid "Candidate per page" msgstr "Candidat par page" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:164 msgid "Number of candidate per page." msgstr "Nombre de candidats par page." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:168 msgid "Choose phrases from backward" msgstr "Choisir des phrases depuis l'arrière" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:171 msgid "Choose phrases from the back, without moving cursor." msgstr "Choisir des phrases depuis l'arrière, sans déplacer le curseur." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:175 msgid "Space to select" msgstr "Espace à sélectionner" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:7 msgctxt "Configure" msgid "Cancel" msgstr "Annuler" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:8 msgctxt "Configure" msgid "Save" msgstr "Sauvegarder" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:9 msgctxt "Configure" msgid "Apply" msgstr "Appliquer" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:10 msgctxt "Configure" msgid "Close" msgstr "Fermer" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:11 msgctxt "Configure" msgid "Ok" msgstr "OK" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/main.c:84 msgid "Chewing component" msgstr "Composant Chewing" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/main.c:86 #: /home/dchen/devel/ibus-chewing/src/main.c:99 msgid "Peng Huang, Ding-Yi Chen" msgstr "Peng Huang, Ding-Yi Chen" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author samfreemanz #: /home/dchen/devel/ibus-chewing/src/main.c:95 msgid "Chewing" msgstr "Chewing" #: /home/dchen/devel/ibus-chewing/src/main.c:96 msgid "Chinese chewing input method" msgstr "" ibus-chewing-1.4.14/po/it.po000066400000000000000000000366451244356534300156060ustar00rootroot00000000000000# msgid "" msgstr "" "Project-Id-Version: ibus-chewing 1.4.11\n" "Report-Msgid-Bugs-To: Ding-Yi Chen \n" "POT-Creation-Date: 2014-11-04 16:04+1000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "PO-Revision-Date: 2014-10-02 12:59-0400\n" "Last-Translator: dchen \n" "Language-Team: Italian\n" "Language: it\n" "X-Generator: Zanata 3.5.1\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine-input-events.c:386 #: /home/dchen/devel/ibus-chewing/src/ibus-setup-chewing.c:72 msgid "Setting" msgstr "Impostazione" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:251 msgid "Chi" msgstr "Chi" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:254 msgid "Eng" msgstr "Eng" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:258 msgid "Click to switch to English" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:262 msgid "Click to switch to Chinese" msgstr "" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:265 msgid "Full" msgstr "Completo" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:268 msgid "Half" msgstr "Metà" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:271 msgid "Settings" msgstr "Impostazioni" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:13 msgid "Editing" msgstr "Modifica" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:14 msgid "Selecting" msgstr "Selezione" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:15 msgid "Keyboard" msgstr "Tastiera" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:18 msgid "default" msgstr "default" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:19 msgid "hsu" msgstr "hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:20 msgid "ibm" msgstr "ibm" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:21 msgid "gin_yieh" msgstr "gin_yieh" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:22 msgid "eten" msgstr "eten" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:23 msgid "eten26" msgstr "eten26" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:24 msgid "dvorak" msgstr "dvorak" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:25 msgid "dvorak_hsu" msgstr "dvorak_hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:26 msgid "dachen_26" msgstr "dachen_26" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:27 msgid "hanyu" msgstr "hanyu" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:45 msgctxt "Sync" msgid "disable" msgstr "Disabilita" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:46 msgctxt "Sync" msgid "keyboard" msgstr "Tastiera" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:47 msgctxt "Sync" msgid "input method" msgstr "" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:52 msgid "Auto" msgstr "Auto" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:53 msgid "Big5" msgstr "Big5" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:54 msgid "UTF8" msgstr "UTF8" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:59 msgid "Keyboard Type" msgstr "Tipo di tastiera" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:63 msgid "Select Zhuyin keyboard layout." msgstr "Seleziona il layout della tastiera Zhuyin" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:66 msgid "Selection keys" msgstr "Tasti di selezione" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:71 msgid "" "Keys used to select candidate. For example \"asdfghjkl;\", press 'a' to " "select the 1st candidate, 's' for 2nd, and so on." msgstr "" "Tasti usati per selezionare il candidato. Per esempio \"asdfghjkl;\", " "premere 'a' per selezionare il primo candidato, 's' per selezionare il " "secondo e così via." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:75 msgid "Hsu's selection key" msgstr "Tasto di selezione di Hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:78 msgid "Hsu's keyboard selection keys, 1 for asdfjkl789, 2 for asdfzxcv89 ." msgstr "" "Tasti di selezione della tastiera di Hsu, 1 per asdfjkl789, 2 per asdfzxcv89 " "." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:82 msgid "Auto move cursor" msgstr "Sposta automaticamente il cursore" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:85 msgid "Automatically move cursor to next character." msgstr "Sposta automaticamente il cursore al carattere successivo." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:89 msgid "Add phrases in front" msgstr "Aggiungi espressioni davanti" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:92 msgid "Add phrases in the front." msgstr "Aggiungi espressioni davanti." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:96 msgid "Easy symbol input" msgstr "Input simbolo semplice" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:99 msgid "Easy symbol input." msgstr "Input simbolo semplice." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:103 msgid "Esc clean all buffer" msgstr "Pulisci con Esc tutto il buffer" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:106 msgid "Escape key cleans the text in pre-edit-buffer." msgstr "Il tasto Escape rimuove il testo in pre-edit-buffer." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:110 msgid "Maximum Chinese characters" msgstr "Numero massimo di caratteri cinesi" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:113 msgid "" "Maximum Chinese characters in pre-edit buffer, including inputing Zhuyin " "symbols" msgstr "" "Numero massimo di caratteri cinesi in pre-edit buffer, incluso l'input dei " "simboli Zhuyin" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:117 msgid "Force lowercase in En mode" msgstr "Forza minuscolo in modalità En" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:120 msgid "" "Ignore CapsLock status and input lowercase by default.\n" "It is handy if you wish to enter lowercase by default.\n" "Uppercase can still be inputted with Shift." msgstr "" "Ignora CapsLock ed input minuscolo per impostazione predefinita. \n" "È utile se inserisci il minuscolo per impostazione predefinita.\n" "Il maiuscolo può ancora essere inserito con il tasto Maiusc \"Shift\"." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:128 msgid "Sync between CapsLock and IM" msgstr "Sincronizza tra CapsLock e IM" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:134 msgid "" "Occasionally, the CapsLock status does not match the IM, this option " "determines how these status be synchronized. Valid values:\n" "\"disable\": Do nothing.\n" "\"keyboard\": IM status follows keyboard status.\n" "\"IM\": Keyboard status follows IM status." msgstr "" "Talvolta lo stato di Capslock non corrisponde all'IM, questa opzione " "determina come sincronizzare lo stato. I valori validi sono:¶\n" "\"disable\": Non fare niente.¶\n" "\"keyboard\": lo stato IM segue lo stato della tastiera.¶\n" "\"IM\": lo stato della tastiera segue lo stato IM." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:141 msgid "Number pad always input number" msgstr "Il tastierino numerico inserisce sempre il numero" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:144 msgid "Always input numbers when number keys from key pad is inputted." msgstr "" "Inserisci sempre i numeri quando i tasti numerici della tastiera sono " "inseriti." #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:148 msgid "Shift toggle Chinese Mode" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:151 msgid "Shift key to toggle Chinese Mode" msgstr "" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:155 msgid "Plain Zhuyin mode" msgstr "Modalità Zhuyin semplice" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:158 msgid "" "In plain Zhuyin mode, automatic candidate selection and related options are " "disabled or ignored." msgstr "" "In modalità semplice Zhuyin, la selezione del candidato automatica e le " "opzioni relative sono disabilitate o ignorate." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:161 msgid "Candidate per page" msgstr "Candidato per pagina" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:164 msgid "Number of candidate per page." msgstr "Numero di candicati per pagina." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:168 msgid "Choose phrases from backward" msgstr "Seleziona espressioni all'indietro" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:171 msgid "Choose phrases from the back, without moving cursor." msgstr "Seleziona espressioni all'indietro senza spostare il cursore." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:175 msgid "Space to select" msgstr "Spazio da selezionare" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:7 msgctxt "Configure" msgid "Cancel" msgstr "Annulla" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:8 msgctxt "Configure" msgid "Save" msgstr "Salva" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:9 msgctxt "Configure" msgid "Apply" msgstr "Applica" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:10 msgctxt "Configure" msgid "Close" msgstr "Chiudi" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:11 msgctxt "Configure" msgid "Ok" msgstr "OK" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/main.c:84 msgid "Chewing component" msgstr "Componente Chewing" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/main.c:86 #: /home/dchen/devel/ibus-chewing/src/main.c:99 msgid "Peng Huang, Ding-Yi Chen" msgstr "Peng Huang, Ding-Yi Chen" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author fvalen #: /home/dchen/devel/ibus-chewing/src/main.c:95 msgid "Chewing" msgstr "Chewing" #: /home/dchen/devel/ibus-chewing/src/main.c:96 msgid "Chinese chewing input method" msgstr "" ibus-chewing-1.4.14/po/ja.po000066400000000000000000000374401244356534300155560ustar00rootroot00000000000000# msgid "" msgstr "" "Project-Id-Version: ibus-chewing 1.4.11\n" "Report-Msgid-Bugs-To: Ding-Yi Chen \n" "POT-Creation-Date: 2014-11-04 16:04+1000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "PO-Revision-Date: 2014-10-02 01:07-0400\n" "Last-Translator: dchen \n" "Language-Team: Japanese\n" "Language: ja\n" "X-Generator: Zanata 3.5.1\n" "Plural-Forms: nplurals=1; plural=0\n" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine-input-events.c:386 #: /home/dchen/devel/ibus-chewing/src/ibus-setup-chewing.c:72 msgid "Setting" msgstr "設定" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:251 msgid "Chi" msgstr "Chi" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:254 msgid "Eng" msgstr "Eng" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:258 msgid "Click to switch to English" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:262 msgid "Click to switch to Chinese" msgstr "" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:265 msgid "Full" msgstr "全" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:268 msgid "Half" msgstr "半" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:271 msgid "Settings" msgstr "設定" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:13 msgid "Editing" msgstr "編集" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:14 msgid "Selecting" msgstr "選択" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:15 msgid "Keyboard" msgstr "キーボード" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:18 msgid "default" msgstr "デフォルト" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:19 msgid "hsu" msgstr "hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:20 msgid "ibm" msgstr "ibm" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:21 msgid "gin_yieh" msgstr "gin_yieh" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:22 msgid "eten" msgstr "eten" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:23 msgid "eten26" msgstr "eten26" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:24 msgid "dvorak" msgstr "ドボラック" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:25 msgid "dvorak_hsu" msgstr "dvorak_hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:26 msgid "dachen_26" msgstr "dachen_26" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:27 msgid "hanyu" msgstr "hanyu" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:45 msgctxt "Sync" msgid "disable" msgstr "無効" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:46 msgctxt "Sync" msgid "keyboard" msgstr "キーボード" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:47 msgctxt "Sync" msgid "input method" msgstr "入力メソッド" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:52 msgid "Auto" msgstr "自動" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:53 msgid "Big5" msgstr "Big5" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:54 msgid "UTF8" msgstr "UTF8" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:59 msgid "Keyboard Type" msgstr "キーボードのタイプ" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:63 msgid "Select Zhuyin keyboard layout." msgstr "ズウインのキーボードレイアウトを選択します。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:66 msgid "Selection keys" msgstr "選択キー" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:71 msgid "" "Keys used to select candidate. For example \"asdfghjkl;\", press 'a' to " "select the 1st candidate, 's' for 2nd, and so on." msgstr "" "候補の選択に使用するキーです。 たとえば、 「asdfghjkl;」なら「a」を押して 1 番目の候補を選択します。 2 " "番目の候補を選択する場合は「s」を押します。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:75 msgid "Hsu's selection key" msgstr "Hsu の選択キー" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:78 msgid "Hsu's keyboard selection keys, 1 for asdfjkl789, 2 for asdfzxcv89 ." msgstr "Hsu のキーボード選択キーです。 1 は asdfjkl789、 2 は asdfzxcv89 です。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:82 msgid "Auto move cursor" msgstr "自動カーソル移動" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:85 msgid "Automatically move cursor to next character." msgstr "カーソルを自動的に次の文字に移動させます。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:89 msgid "Add phrases in front" msgstr "先頭に語句を追加" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:92 msgid "Add phrases in the front." msgstr "先頭に語句を追加します。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:96 msgid "Easy symbol input" msgstr "簡単な記号入力" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:99 msgid "Easy symbol input." msgstr "簡単な記号入力です。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:103 msgid "Esc clean all buffer" msgstr "全バッファの Esc キー消去" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:106 msgid "Escape key cleans the text in pre-edit-buffer." msgstr "Esc (エスケープ) キーでプレ編集バッファにあるテキストを消去します。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:110 msgid "Maximum Chinese characters" msgstr "中国語文字の最大数" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:113 msgid "" "Maximum Chinese characters in pre-edit buffer, including inputing Zhuyin " "symbols" msgstr "ズウイン記号の入力など、 プレ編集バッファ内の中国語文字の最大数" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:117 msgid "Force lowercase in En mode" msgstr "英語モードでは小文字を強制" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:120 msgid "" "Ignore CapsLock status and input lowercase by default.\n" "It is handy if you wish to enter lowercase by default.\n" "Uppercase can still be inputted with Shift." msgstr "" "CapsLock 状態を無視してデフォルトでは小文字を入力します。\n" "デフォルトでは小文字入力にしたい場合に便利です。 \n" "Shift を使用すれば大文字入力も可能です。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:128 msgid "Sync between CapsLock and IM" msgstr "CapsLock と入力メソッド間の同期" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:134 msgid "" "Occasionally, the CapsLock status does not match the IM, this option " "determines how these status be synchronized. Valid values:\n" "\"disable\": Do nothing.\n" "\"keyboard\": IM status follows keyboard status.\n" "\"IM\": Keyboard status follows IM status." msgstr "" "CapsLock 状態が入力メソッドと一致しない場合があります。 このオプションを使ってこうした状態をどのように同期するかを指定します。 " "有効な値は次の通りです。\n" "「disable」何もしません。\n" "「keyboard」入力メソッド状態をキーボードの状態に従わせます。\n" "「IM」キーボード状態を入力メソッド状態に従わせます。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:141 msgid "Number pad always input number" msgstr "番号パッドは常に入力番号" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:144 msgid "Always input numbers when number keys from key pad is inputted." msgstr "キーパッドの番号キーが入力された場合は常に番号を入力します。" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:148 msgid "Shift toggle Chinese Mode" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:151 msgid "Shift key to toggle Chinese Mode" msgstr "" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:155 msgid "Plain Zhuyin mode" msgstr "プレーンのズウインモード" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:158 msgid "" "In plain Zhuyin mode, automatic candidate selection and related options are " "disabled or ignored." msgstr "プレーンのズウイン (Zhuyin) モードでは、 候補自動選択および関連オプションは無効になっているか無視されます。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:161 msgid "Candidate per page" msgstr "ページごとの候補" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:164 msgid "Number of candidate per page." msgstr "1 ページの候補数" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:168 msgid "Choose phrases from backward" msgstr "後方から語句を選択" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:171 msgid "Choose phrases from the back, without moving cursor." msgstr "カーソル移動せずに後ろから語句を選択します。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:175 msgid "Space to select" msgstr "選択にスペースキー" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:7 msgctxt "Configure" msgid "Cancel" msgstr "キャンセル" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:8 msgctxt "Configure" msgid "Save" msgstr "保存する" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:9 msgctxt "Configure" msgid "Apply" msgstr "適用" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:10 msgctxt "Configure" msgid "Close" msgstr "閉じる" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:11 msgctxt "Configure" msgid "Ok" msgstr "OK" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/main.c:84 msgid "Chewing component" msgstr "Chewing コンポーネント" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/main.c:86 #: /home/dchen/devel/ibus-chewing/src/main.c:99 msgid "Peng Huang, Ding-Yi Chen" msgstr "Peng Huang, Ding-Yi Chen" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author noriko #: /home/dchen/devel/ibus-chewing/src/main.c:95 msgid "Chewing" msgstr "Chewing" #: /home/dchen/devel/ibus-chewing/src/main.c:96 msgid "Chinese chewing input method" msgstr "" ibus-chewing-1.4.14/po/ko.po000066400000000000000000000372631244356534300156000ustar00rootroot00000000000000# Michelle Kim , 2014. #zanata msgid "" msgstr "" "Project-Id-Version: ibus-chewing 1.4.11\n" "Report-Msgid-Bugs-To: Ding-Yi Chen \n" "POT-Creation-Date: 2014-11-04 16:04+1000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "PO-Revision-Date: 2014-11-04 11:55-0500\n" "Last-Translator: Michelle Kim \n" "Language-Team: Korean\n" "Language: ko\n" "X-Generator: Zanata 3.5.1\n" "Plural-Forms: nplurals=1; plural=0\n" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine-input-events.c:386 #: /home/dchen/devel/ibus-chewing/src/ibus-setup-chewing.c:72 msgid "Setting" msgstr "설정 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:251 msgid "Chi" msgstr "Chi" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:254 msgid "Eng" msgstr "Eng" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:258 msgid "Click to switch to English" msgstr "영어로 변환" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:262 msgid "Click to switch to Chinese" msgstr "중국어로 변환" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:265 msgid "Full" msgstr "전체 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:268 msgid "Half" msgstr "반 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:271 msgid "Settings" msgstr "설정 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:13 msgid "Editing" msgstr "편집 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:14 msgid "Selecting" msgstr "선택 중 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:15 msgid "Keyboard" msgstr "키보드 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:18 msgid "default" msgstr "디폴트 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:19 msgid "hsu" msgstr "hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:20 msgid "ibm" msgstr "ibm" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:21 msgid "gin_yieh" msgstr "gin_yieh" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:22 msgid "eten" msgstr "eten" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:23 msgid "eten26" msgstr "eten26" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:24 msgid "dvorak" msgstr "드보락 (dvorak)" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:25 msgid "dvorak_hsu" msgstr "dvorak_hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:26 msgid "dachen_26" msgstr "dachen_26" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:27 msgid "hanyu" msgstr "hanyu" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:45 msgctxt "Sync" msgid "disable" msgstr "비활성화 " #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:46 msgctxt "Sync" msgid "keyboard" msgstr "키보드 " #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:47 msgctxt "Sync" msgid "input method" msgstr "입력 방식 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:52 msgid "Auto" msgstr "자동 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:53 msgid "Big5" msgstr "Big5" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:54 msgid "UTF8" msgstr "UTF8" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:59 msgid "Keyboard Type" msgstr "키보드 유형 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:63 msgid "Select Zhuyin keyboard layout." msgstr "Zhuyin 키보드 레이아웃을 선택합니다. " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:66 msgid "Selection keys" msgstr "선택 키 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:71 msgid "" "Keys used to select candidate. For example \"asdfghjkl;\", press 'a' to " "select the 1st candidate, 's' for 2nd, and so on." msgstr "" "후보 선택에 사용하는 키입니다. 예를 들어, \"asdfghjkl;\"의 경우 'a'를 눌러 첫 번째 후보로 선택하고 두번째 후보를 " "선택하려면 's'를 누릅니다. " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:75 msgid "Hsu's selection key" msgstr "Hsu 선택 키 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:78 msgid "Hsu's keyboard selection keys, 1 for asdfjkl789, 2 for asdfzxcv89 ." msgstr "Hsu 키보드 선택 키입니다. 1은 asdfjkl789이고 2는 asdfzxcv89입니다. " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:82 msgid "Auto move cursor" msgstr "자동 커서 이동 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:85 msgid "Automatically move cursor to next character." msgstr "자동으로 커서를 다음 문자로 이동시킵니다. " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:89 msgid "Add phrases in front" msgstr "처음에 단어 추가 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:92 msgid "Add phrases in the front." msgstr "처음에 단어 추가 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:96 msgid "Easy symbol input" msgstr "쉬운 기호 입력 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:99 msgid "Easy symbol input." msgstr "쉬운 기호를 입력합니다. " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:103 msgid "Esc clean all buffer" msgstr "Esc 키는 모든 버퍼를 지웁니다 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:106 msgid "Escape key cleans the text in pre-edit-buffer." msgstr "Esc 키는 사전 편집 버퍼의 텍스트를 지웁니다. " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:110 msgid "Maximum Chinese characters" msgstr "최대 중국어 문자 수 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:113 msgid "" "Maximum Chinese characters in pre-edit buffer, including inputing Zhuyin " "symbols" msgstr "Zhuyin 기호 입력을 포함하여 사전 편집 버퍼에서 최대 중국어 문자 수 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:117 msgid "Force lowercase in En mode" msgstr "En 모드에서 소문자를 강제 " #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:120 msgid "" "Ignore CapsLock status and input lowercase by default.\n" "It is handy if you wish to enter lowercase by default.\n" "Uppercase can still be inputted with Shift." msgstr "" "CapsLock 상태를 무시하고 디폴트로 소문자를 입력합니다.\n" "디폴트로 소문자를 입력하고자 하는 경우 유용합니다.\n" "Shift를 사용하여 대문자 입력도 가능합니다." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:128 msgid "Sync between CapsLock and IM" msgstr "CapsLock과 입력 방식 간의 동기화 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:134 msgid "" "Occasionally, the CapsLock status does not match the IM, this option " "determines how these status be synchronized. Valid values:\n" "\"disable\": Do nothing.\n" "\"keyboard\": IM status follows keyboard status.\n" "\"IM\": Keyboard status follows IM status." msgstr "" "CapsLock 상태가 입력 방식과 일치하지 않을 수 있습니다. 이 옵션을 사용하여 이러한 상태를 동기화할 방법을 지정합니다. 유효한 " "값은 다음과 같습니다:\n" "\"disable\": 아무것도 실행하지 않습니다. \n" "\"keyboard\": 입력 방식 상태는 키보다 상태를 따릅니다.\n" "\"IM\": 키보드 상태는 입력 방식 상태를 따릅니다. " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:141 msgid "Number pad always input number" msgstr "번호 패드는 항상 번호 입력 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:144 msgid "Always input numbers when number keys from key pad is inputted." msgstr "키 패드에서 숫자 키를 입력하면 항상 번호가 입력됩니다. " #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:148 msgid "Shift toggle Chinese Mode" msgstr "중국어 모드 토클 Shift" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:151 msgid "Shift key to toggle Chinese Mode" msgstr "중국어 모드 토클을 위한 Shift 키" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:155 msgid "Plain Zhuyin mode" msgstr "Plain Zhuyin 모드 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:158 msgid "" "In plain Zhuyin mode, automatic candidate selection and related options are " "disabled or ignored." msgstr "Plain Zhuyin 모드에서 자동 후보 선택 및 관련 옵션이 비활성화되어 있거나 무시됩니다. " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:161 msgid "Candidate per page" msgstr "페이지 당 후보 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:164 msgid "Number of candidate per page." msgstr "페이지 당 후보 수 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:168 msgid "Choose phrases from backward" msgstr "뒤에서 단어 선택 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:171 msgid "Choose phrases from the back, without moving cursor." msgstr "커서를 이동하지 않고 뒤에서 단어를 선택합니다. " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:175 msgid "Space to select" msgstr "선택 공간 " #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:7 msgctxt "Configure" msgid "Cancel" msgstr "취소" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:8 msgctxt "Configure" msgid "Save" msgstr "저장" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:9 msgctxt "Configure" msgid "Apply" msgstr "적용 " #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:10 msgctxt "Configure" msgid "Close" msgstr "종료 " #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:11 msgctxt "Configure" msgid "Ok" msgstr "Ok" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/main.c:84 msgid "Chewing component" msgstr "Chewing 구성 요소 " # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/main.c:86 #: /home/dchen/devel/ibus-chewing/src/main.c:99 msgid "Peng Huang, Ding-Yi Chen" msgstr "Peng Huang, Ding-Yi Chen" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author eukim #: /home/dchen/devel/ibus-chewing/src/main.c:95 msgid "Chewing" msgstr "Chewing" #: /home/dchen/devel/ibus-chewing/src/main.c:96 msgid "Chinese chewing input method" msgstr "중국어 chewing 입력 방식" ibus-chewing-1.4.14/po/pa.po000066400000000000000000000204401244356534300155540ustar00rootroot00000000000000# A S Alam , 2014. #zanata msgid "" msgstr "" "Project-Id-Version: ibus-chewing 1.4.11\n" "Report-Msgid-Bugs-To: Ding-Yi Chen \n" "POT-Creation-Date: 2014-11-04 16:04+1000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "PO-Revision-Date: 2014-11-13 09:28-0500\n" "Last-Translator: A S Alam \n" "Language-Team: Punjabi\n" "Language: pa\n" "X-Generator: Zanata 3.5.1\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine-input-events.c:386 #: /home/dchen/devel/ibus-chewing/src/ibus-setup-chewing.c:72 msgid "Setting" msgstr "ਸੈਟਿੰਗ" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:251 msgid "Chi" msgstr "ਚਾਈ" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:254 msgid "Eng" msgstr "ਅੰਗ" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:258 msgid "Click to switch to English" msgstr "ਅੰਗਰੇਜ਼ੀ ਵਿੱਚ ਬਦਲਣ ਲਈ ਕਲਿੱਕ ਕਰੋ" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:262 msgid "Click to switch to Chinese" msgstr "ਚੀਨੀ ਵਿੱਚ ਬਦਲਣ ਲਈ ਕਲਿੱਕ ਕਰੋ" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:265 msgid "Full" msgstr "ਪੂਰਾ" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:268 msgid "Half" msgstr "ਅੱਧਾ" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:271 msgid "Settings" msgstr "ਸੈਟਿੰਗ" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:13 msgid "Editing" msgstr "ਸੋਧ" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:14 msgid "Selecting" msgstr "ਚੋਣ" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:15 msgid "Keyboard" msgstr "ਕੀਬੋਰਡ" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:18 msgid "default" msgstr "ਮੂਲ" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:19 msgid "hsu" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:20 msgid "ibm" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:21 msgid "gin_yieh" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:22 msgid "eten" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:23 msgid "eten26" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:24 msgid "dvorak" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:25 msgid "dvorak_hsu" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:26 msgid "dachen_26" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:27 msgid "hanyu" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:45 msgctxt "Sync" msgid "disable" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:46 msgctxt "Sync" msgid "keyboard" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:47 msgctxt "Sync" msgid "input method" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:52 msgid "Auto" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:53 msgid "Big5" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:54 msgid "UTF8" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:59 msgid "Keyboard Type" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:63 msgid "Select Zhuyin keyboard layout." msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:66 msgid "Selection keys" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:71 msgid "" "Keys used to select candidate. For example \"asdfghjkl;\", press 'a' to " "select the 1st candidate, 's' for 2nd, and so on." msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:75 msgid "Hsu's selection key" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:78 msgid "Hsu's keyboard selection keys, 1 for asdfjkl789, 2 for asdfzxcv89 ." msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:82 msgid "Auto move cursor" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:85 msgid "Automatically move cursor to next character." msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:89 msgid "Add phrases in front" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:92 msgid "Add phrases in the front." msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:96 msgid "Easy symbol input" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:99 msgid "Easy symbol input." msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:103 msgid "Esc clean all buffer" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:106 msgid "Escape key cleans the text in pre-edit-buffer." msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:110 msgid "Maximum Chinese characters" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:113 msgid "" "Maximum Chinese characters in pre-edit buffer, including inputing Zhuyin " "symbols" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:117 msgid "Force lowercase in En mode" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:120 msgid "" "Ignore CapsLock status and input lowercase by default.\n" "It is handy if you wish to enter lowercase by default.\n" "Uppercase can still be inputted with Shift." msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:128 msgid "Sync between CapsLock and IM" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:134 msgid "" "Occasionally, the CapsLock status does not match the IM, this option " "determines how these status be synchronized. Valid values:\n" "\"disable\": Do nothing.\n" "\"keyboard\": IM status follows keyboard status.\n" "\"IM\": Keyboard status follows IM status." msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:141 msgid "Number pad always input number" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:144 msgid "Always input numbers when number keys from key pad is inputted." msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:148 msgid "Shift toggle Chinese Mode" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:151 msgid "Shift key to toggle Chinese Mode" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:155 msgid "Plain Zhuyin mode" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:158 msgid "" "In plain Zhuyin mode, automatic candidate selection and related options are " "disabled or ignored." msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:161 msgid "Candidate per page" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:164 msgid "Number of candidate per page." msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:168 msgid "Choose phrases from backward" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:171 msgid "Choose phrases from the back, without moving cursor." msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:175 msgid "Space to select" msgstr "" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:7 msgctxt "Configure" msgid "Cancel" msgstr "" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:8 msgctxt "Configure" msgid "Save" msgstr "" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:9 msgctxt "Configure" msgid "Apply" msgstr "" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:10 msgctxt "Configure" msgid "Close" msgstr "" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:11 msgctxt "Configure" msgid "Ok" msgstr "" #: /home/dchen/devel/ibus-chewing/src/main.c:84 msgid "Chewing component" msgstr "" #: /home/dchen/devel/ibus-chewing/src/main.c:86 #: /home/dchen/devel/ibus-chewing/src/main.c:99 msgid "Peng Huang, Ding-Yi Chen" msgstr "" #: /home/dchen/devel/ibus-chewing/src/main.c:95 msgid "Chewing" msgstr "" #: /home/dchen/devel/ibus-chewing/src/main.c:96 msgid "Chinese chewing input method" msgstr "" ibus-chewing-1.4.14/po/pt_BR.po000066400000000000000000000366521244356534300161760ustar00rootroot00000000000000# msgid "" msgstr "" "Project-Id-Version: ibus-chewing 1.4.11\n" "Report-Msgid-Bugs-To: Ding-Yi Chen \n" "POT-Creation-Date: 2014-11-04 16:04+1000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "PO-Revision-Date: 2014-10-02 01:09-0400\n" "Last-Translator: dchen \n" "Language-Team: Portuguese (Brazil)\n" "Language: pt-BR\n" "X-Generator: Zanata 3.5.1\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine-input-events.c:386 #: /home/dchen/devel/ibus-chewing/src/ibus-setup-chewing.c:72 msgid "Setting" msgstr "Configuração" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:251 msgid "Chi" msgstr "Chi" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:254 msgid "Eng" msgstr "Eng" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:258 msgid "Click to switch to English" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:262 msgid "Click to switch to Chinese" msgstr "" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:265 msgid "Full" msgstr "Cheio" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:268 msgid "Half" msgstr "Meio" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:271 msgid "Settings" msgstr "Configurações" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:13 msgid "Editing" msgstr "Editando" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:14 msgid "Selecting" msgstr "Selecionando" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:15 msgid "Keyboard" msgstr "Teclado" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:18 msgid "default" msgstr "padrão" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:19 msgid "hsu" msgstr "hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:20 msgid "ibm" msgstr "ibm" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:21 msgid "gin_yieh" msgstr "gin_yieh" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:22 msgid "eten" msgstr "eten" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:23 msgid "eten26" msgstr "eten26" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:24 msgid "dvorak" msgstr "dvorak" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:25 msgid "dvorak_hsu" msgstr "dvorak_hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:26 msgid "dachen_26" msgstr "dachen_26" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:27 msgid "hanyu" msgstr "hanyu" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:45 msgctxt "Sync" msgid "disable" msgstr "Desabilitar" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:46 msgctxt "Sync" msgid "keyboard" msgstr "Teclado" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:47 msgctxt "Sync" msgid "input method" msgstr "" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:52 msgid "Auto" msgstr "Auto" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:53 msgid "Big5" msgstr "Big5" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:54 msgid "UTF8" msgstr "UTF8" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:59 msgid "Keyboard Type" msgstr "Tipo de Teclado" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:63 msgid "Select Zhuyin keyboard layout." msgstr "Selecionar layout do teclado Zhuyin." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:66 msgid "Selection keys" msgstr "Teclas de seleção" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:71 msgid "" "Keys used to select candidate. For example \"asdfghjkl;\", press 'a' to " "select the 1st candidate, 's' for 2nd, and so on." msgstr "" "Teclas usadas para selecionar candidato. Por exemplo \"asdfghjkl;\", " "pressione 'a' para selecionar o 1o. candidato, 's' para o 2o. e assim por " "diante." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:75 msgid "Hsu's selection key" msgstr "tela de seleção do Hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:78 msgid "Hsu's keyboard selection keys, 1 for asdfjkl789, 2 for asdfzxcv89 ." msgstr "" "teclas de seleção do teclado de Hsu , 1 para asdfjkl789, 2 para asdfzxcv89 ." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:82 msgid "Auto move cursor" msgstr "Auto mover o cursor" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:85 msgid "Automatically move cursor to next character." msgstr "Mover automaticamente o cursor para o próximo carácter" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:89 msgid "Add phrases in front" msgstr "Adicionar frases na frente" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:92 msgid "Add phrases in the front." msgstr "Adicionar frases na frente" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:96 msgid "Easy symbol input" msgstr "Entrada de símbolo fácil" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:99 msgid "Easy symbol input." msgstr "Entrada de símbolo fácil." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:103 msgid "Esc clean all buffer" msgstr "Esc limpar todo o buffer" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:106 msgid "Escape key cleans the text in pre-edit-buffer." msgstr "Tecla Escape limpa o texto no buffer de pré-edição" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:110 msgid "Maximum Chinese characters" msgstr "Máximo de Caracteres chineses" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:113 msgid "" "Maximum Chinese characters in pre-edit buffer, including inputing Zhuyin " "symbols" msgstr "" "Máximo de caracteres chineses no buffer de pré-edição, incluindo os simbolos " "Zhuyin de inserção." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:117 msgid "Force lowercase in En mode" msgstr "Forçar letra minúscula no modo En" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:120 msgid "" "Ignore CapsLock status and input lowercase by default.\n" "It is handy if you wish to enter lowercase by default.\n" "Uppercase can still be inputted with Shift." msgstr "" "Ignorar o estado CapsLock e inserir letra minúscula por padrão.\n" "É fácil se você deseja inserir letras minúsculas por padrão.\n" "A letra maiúscula pode ainda ser inserida com o Shift." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:128 msgid "Sync between CapsLock and IM" msgstr "Sinc entre o CapsLock e IM" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:134 msgid "" "Occasionally, the CapsLock status does not match the IM, this option " "determines how these status be synchronized. Valid values:\n" "\"disable\": Do nothing.\n" "\"keyboard\": IM status follows keyboard status.\n" "\"IM\": Keyboard status follows IM status." msgstr "" "Geralmente o status do CapsLock não coincide com o IM, esta opção determina " "como estes status são sincronizados. Valores válidos:\n" "\"disable\": Não faz nada.¶\n" "\"keyboard\": status do IM segue o status do teclado.¶\n" "\"IM\": Status do Teclado segue o status do IM." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:141 msgid "Number pad always input number" msgstr "Pad de números sempre insere números" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:144 msgid "Always input numbers when number keys from key pad is inputted." msgstr "" "Sempre inserir números quando as chaves de números a partir do pad é " "inserida" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:148 msgid "Shift toggle Chinese Mode" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:151 msgid "Shift key to toggle Chinese Mode" msgstr "" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:155 msgid "Plain Zhuyin mode" msgstr "Modo Simples Zhuyin" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:158 msgid "" "In plain Zhuyin mode, automatic candidate selection and related options are " "disabled or ignored." msgstr "" "Em modo simples de Zhuyin, a seleção de candidato automática e opções " "relacionadas são desabilitadas ou ignoradas." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:161 msgid "Candidate per page" msgstr "Candidato por página" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:164 msgid "Number of candidate per page." msgstr "Número de candidato por página" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:168 msgid "Choose phrases from backward" msgstr "Escolher frases de tras para frente" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:171 msgid "Choose phrases from the back, without moving cursor." msgstr "Escolehr frases a partir do final, sem mover o cursor" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:175 msgid "Space to select" msgstr "Espaço para selecionar" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:7 msgctxt "Configure" msgid "Cancel" msgstr "Cancelar" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:8 msgctxt "Configure" msgid "Save" msgstr "Salvar" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:9 msgctxt "Configure" msgid "Apply" msgstr "Aplicar" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:10 msgctxt "Configure" msgid "Close" msgstr "Fechar" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:11 msgctxt "Configure" msgid "Ok" msgstr "" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/main.c:84 msgid "Chewing component" msgstr "Componente Chewing" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/main.c:86 #: /home/dchen/devel/ibus-chewing/src/main.c:99 msgid "Peng Huang, Ding-Yi Chen" msgstr "Peng Huang, Ding-Yi Chen" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author gcintra #: /home/dchen/devel/ibus-chewing/src/main.c:95 msgid "Chewing" msgstr "Chewing" #: /home/dchen/devel/ibus-chewing/src/main.c:96 msgid "Chinese chewing input method" msgstr "" ibus-chewing-1.4.14/po/uk.po000066400000000000000000000325251244356534300156020ustar00rootroot00000000000000# msgid "" msgstr "" "Project-Id-Version: ibus-chewing 1.4.11\n" "Report-Msgid-Bugs-To: Ding-Yi Chen \n" "POT-Creation-Date: 2014-11-04 16:04+1000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "PO-Revision-Date: 2014-10-02 03:13-0400\n" "Last-Translator: dchen \n" "Language-Team: Ukrainian \n" "Language: uk\n" "X-Generator: Zanata 3.5.1\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author yurchor #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine-input-events.c:386 #: /home/dchen/devel/ibus-chewing/src/ibus-setup-chewing.c:72 msgid "Setting" msgstr "Параметри" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:251 msgid "Chi" msgstr "Чі" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author yurchor #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:254 msgid "Eng" msgstr "Eng" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:258 msgid "Click to switch to English" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:262 msgid "Click to switch to Chinese" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:265 msgid "Full" msgstr "Повні" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:268 msgid "Half" msgstr "Половинні" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author yurchor #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:271 msgid "Settings" msgstr "Параметри" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author yurchor #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:13 msgid "Editing" msgstr "Редагування" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author yurchor #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:14 msgid "Selecting" msgstr "Позначення" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author yurchor #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:15 msgid "Keyboard" msgstr "Клавіатура" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author yurchor #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:18 msgid "default" msgstr "типове" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:19 msgid "hsu" msgstr "сюй" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:20 msgid "ibm" msgstr "ibm" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:21 msgid "gin_yieh" msgstr "жін_є" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:22 msgid "eten" msgstr "етен" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:23 msgid "eten26" msgstr "етен26" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:24 msgid "dvorak" msgstr "дворак" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:25 msgid "dvorak_hsu" msgstr "дворак_сюй" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author yurchor #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:26 msgid "dachen_26" msgstr "dachen_26" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:27 msgid "hanyu" msgstr "ханю" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:45 msgctxt "Sync" msgid "disable" msgstr "вимкнути" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:46 msgctxt "Sync" msgid "keyboard" msgstr "клавіатура" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:47 msgctxt "Sync" msgid "input method" msgstr "спосіб введення" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:52 msgid "Auto" msgstr "Автоматично" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author yurchor #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:53 msgid "Big5" msgstr "Big5" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author yurchor #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:54 msgid "UTF8" msgstr "UTF8" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author yurchor #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:59 msgid "Keyboard Type" msgstr "Тип клавіатури" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:63 msgid "Select Zhuyin keyboard layout." msgstr "Виберіть розкладку клавіатури чжуїн." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author yurchor #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:66 msgid "Selection keys" msgstr "Клавіші для позначення" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:71 msgid "" "Keys used to select candidate. For example \"asdfghjkl;\", press 'a' to " "select the 1st candidate, 's' for 2nd, and so on." msgstr "" "Клавіші, які використовуватимуться для вибору варіантів. Наприклад, якщо це " "«asdfghjkl;», натискання «a» вибиратиме перший кандидат, «s» — другий тощо." #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:75 msgid "Hsu's selection key" msgstr "Клавіша вибору Сюя" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:78 msgid "Hsu's keyboard selection keys, 1 for asdfjkl789, 2 for asdfzxcv89 ." msgstr "Клавіші вибору клавіатури Сюя, 1 для asdfjkl789, 2 для asdfzxcv89 ." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author yurchor #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:82 msgid "Auto move cursor" msgstr "Автоматичне пересування курсора" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:85 msgid "Automatically move cursor to next character." msgstr "Автоматично пересувати курсор до наступного символу." #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:89 msgid "Add phrases in front" msgstr "Додавати фрази на початку" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:92 msgid "Add phrases in the front." msgstr "Додавати фрази на початку." #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:96 msgid "Easy symbol input" msgstr "Просте введення символів" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:99 msgid "Easy symbol input." msgstr "Просте введення символів." #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:103 msgid "Esc clean all buffer" msgstr "Esc спрожнює весь буфер" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:106 msgid "Escape key cleans the text in pre-edit-buffer." msgstr "Клавіша Escape спорожнює вміст буфера попереднього редагування." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author yurchor #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:110 msgid "Maximum Chinese characters" msgstr "Максимальна кількість символів китайською" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:113 msgid "" "Maximum Chinese characters in pre-edit buffer, including inputing Zhuyin " "symbols" msgstr "" "Максимальна кількість символів китайської у буфері попереднього редагування, " "зокрема під час введення символів чжуїн" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:117 msgid "Force lowercase in En mode" msgstr "Примусовий нижній регістр у режимі англійської" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:120 msgid "" "Ignore CapsLock status and input lowercase by default.\n" "It is handy if you wish to enter lowercase by default.\n" "Uppercase can still be inputted with Shift." msgstr "" "Ігнорувати стан CapsLock і типово вводити символи нижнього регістру.\n" "Зручно, якщо ви маєте намір типово вводити символи у нижньому регістрі. \n" "Символи верхнього регістру можна вводити за допомогою клавіші Shift." #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:128 msgid "Sync between CapsLock and IM" msgstr "Синхронізація CapsLock зі способом введення" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:134 msgid "" "Occasionally, the CapsLock status does not match the IM, this option " "determines how these status be synchronized. Valid values:\n" "\"disable\": Do nothing.\n" "\"keyboard\": IM status follows keyboard status.\n" "\"IM\": Keyboard status follows IM status." msgstr "" "Якщо раптом стан CapsLock не відповідає стану способу введення, за допомогою " "цього пункту можна визначити спосіб синхронізації станів. Можливі значення:\n" "«вимкнути»: не виконувати синхронізації.\n" "«клавіатура»: змінювати стан способу введення за станом на клавіатурі.\n" "«спосіб введення»: змінювати стан на клавіатурі за станом у способі введення." "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:141 msgid "Number pad always input number" msgstr "Завжди вводити цифри з цифрової панелі" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:144 msgid "Always input numbers when number keys from key pad is inputted." msgstr "" "Завжди вводити цифри, якщо натискаються клавіші цифр на цифровій панелі." #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:148 msgid "Shift toggle Chinese Mode" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:151 msgid "Shift key to toggle Chinese Mode" msgstr "" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:155 msgid "Plain Zhuyin mode" msgstr "Звичайний режим чжуїн" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:158 msgid "" "In plain Zhuyin mode, automatic candidate selection and related options are " "disabled or ignored." msgstr "" "У режимі звичайного введення чжуїн автоматичний вибір варіантів та пов’язані " "з ним параметри буде вимкнено або проігноровано." #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:161 msgid "Candidate per page" msgstr "Варіант на сторінку" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:164 msgid "Number of candidate per page." msgstr "Кількість варіантів на сторінку." #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:168 msgid "Choose phrases from backward" msgstr "Вибирати фрази з кінця" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:171 msgid "Choose phrases from the back, without moving cursor." msgstr "Вибирати фрази з кінця без пересування курсора." # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author yurchor #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:175 msgid "Space to select" msgstr "Пробіл для позначення" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:7 msgctxt "Configure" msgid "Cancel" msgstr "Скасувати" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:8 msgctxt "Configure" msgid "Save" msgstr "Зберегти" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:9 msgctxt "Configure" msgid "Apply" msgstr "" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:10 msgctxt "Configure" msgid "Close" msgstr "Закрити" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:11 msgctxt "Configure" msgid "Ok" msgstr "Гаразд" #: /home/dchen/devel/ibus-chewing/src/main.c:84 msgid "Chewing component" msgstr "Компонент чжуінь" #: /home/dchen/devel/ibus-chewing/src/main.c:86 #: /home/dchen/devel/ibus-chewing/src/main.c:99 msgid "Peng Huang, Ding-Yi Chen" msgstr "Пень Юань, Дінь-Ї Чен" #: /home/dchen/devel/ibus-chewing/src/main.c:95 msgid "Chewing" msgstr "Чжуінь" #: /home/dchen/devel/ibus-chewing/src/main.c:96 msgid "Chinese chewing input method" msgstr "Чжуінь спосіб введення" ibus-chewing-1.4.14/po/zanata.xml000066400000000000000000000052671244356534300166260ustar00rootroot00000000000000 https://fedora.zanata.org/ ibus-chewing master gettext af am ar as ast bal be bg bn bn-IN bo br brx bs ca cs cy da de de-CH el en-GB eo es et eu fa fi fr gl gu he hi hr hu ia id ilo is it ja ka kk km kn ko kw kw-GB kw@kkcor kw@uccor ky lt lv mai mk ml mn mr ms nb nds ne nl nn nso or pa pl pt pt-BR ro ru si sk sl sq sr sr@latin sv ta te tg th tr tw uk ur vi wba yo zh-CN zh-HK zh-TW zu ibus-chewing-1.4.14/po/zh_CN.po000066400000000000000000000354311244356534300161630ustar00rootroot00000000000000# Translation to Simplfied Chinese of ibus-chewing # Copyright (C) YEAR Huang Peng # This file is distributed under the same license as the PACKAGE package. # Peng Huang , 2008. # Pany , 2014. #zanata msgid "" msgstr "" "Project-Id-Version: ibus-chewing 1.4.11\n" "Report-Msgid-Bugs-To: Ding-Yi Chen \n" "POT-Creation-Date: 2014-11-04 16:04+1000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "PO-Revision-Date: 2014-12-09 03:30-0500\n" "Last-Translator: Pany \n" "Language-Team: LANGUAGE \n" "Language: zh-CN\n" "X-Generator: Zanata 3.5.1\n" "Plural-Forms: nplurals=1; plural=0\n" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine-input-events.c:386 #: /home/dchen/devel/ibus-chewing/src/ibus-setup-chewing.c:72 msgid "Setting" msgstr "设置" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:251 msgid "Chi" msgstr "中" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:254 msgid "Eng" msgstr "英" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:258 msgid "Click to switch to English" msgstr "切换到英文模式" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:262 msgid "Click to switch to Chinese" msgstr "切换到中文模式" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:265 msgid "Full" msgstr "全" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:268 msgid "Half" msgstr "半" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:271 msgid "Settings" msgstr "设置" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:13 msgid "Editing" msgstr "编辑中" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:14 msgid "Selecting" msgstr "选择中" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:15 msgid "Keyboard" msgstr "键盘" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:18 msgid "default" msgstr "默认" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:19 msgid "hsu" msgstr "许氏" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:20 msgid "ibm" msgstr "ibm" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:21 msgid "gin_yieh" msgstr "gin_yieh" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:22 msgid "eten" msgstr "eten" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:23 msgid "eten26" msgstr "eten26" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:24 msgid "dvorak" msgstr "dvorak" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:25 msgid "dvorak_hsu" msgstr "dvorak_hsu" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:26 msgid "dachen_26" msgstr "dachen_26" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:27 msgid "hanyu" msgstr "中文" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:45 msgctxt "Sync" msgid "disable" msgstr "禁用" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:46 msgctxt "Sync" msgid "keyboard" msgstr "键盘" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:47 msgctxt "Sync" msgid "input method" msgstr "输入法" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:52 msgid "Auto" msgstr "自动" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:53 msgid "Big5" msgstr "Big5" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:54 msgid "UTF8" msgstr "UTF8" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:59 msgid "Keyboard Type" msgstr "键盘类型" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:63 msgid "Select Zhuyin keyboard layout." msgstr "选择注音键盘布局。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:66 msgid "Selection keys" msgstr "选择键" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:71 msgid "" "Keys used to select candidate. For example \"asdfghjkl;\", press 'a' to " "select the 1st candidate, 's' for 2nd, and so on." msgstr "用来选择候选词的键。例如:\"asdfghjkl;\",按 'a' 选择第一个词,'s' 代表第二个,依次类推。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:75 msgid "Hsu's selection key" msgstr "Hsu 的选择键" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:78 msgid "Hsu's keyboard selection keys, 1 for asdfjkl789, 2 for asdfzxcv89 ." msgstr "Hsu 的键盘选择键,1 代表 asdfjkl789,2 代表 asdfzxcv89。" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:82 msgid "Auto move cursor" msgstr "自动移游标下一个字" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:85 msgid "Automatically move cursor to next character." msgstr "自动将光标移动到下一个字符。" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:89 msgid "Add phrases in front" msgstr "前方加词" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:92 msgid "Add phrases in the front." msgstr "前方加词" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:96 msgid "Easy symbol input" msgstr "轻松输入符号" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:99 msgid "Easy symbol input." msgstr "轻松输入符号" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:103 msgid "Esc clean all buffer" msgstr "Esc 清除所有缓存" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:106 msgid "Escape key cleans the text in pre-edit-buffer." msgstr "按 Esc 键可清除所有预编辑缓冲中的文本。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:110 msgid "Maximum Chinese characters" msgstr "最多中文字符" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:113 msgid "" "Maximum Chinese characters in pre-edit buffer, including inputing Zhuyin " "symbols" msgstr "在预编辑缓冲中最多的中文字符数,其中包括输入的注音符号。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:117 msgid "Force lowercase in En mode" msgstr "在 En 模式中强制使用小写" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:120 msgid "" "Ignore CapsLock status and input lowercase by default.\n" "It is handy if you wish to enter lowercase by default.\n" "Uppercase can still be inputted with Shift." msgstr "忽略 CapsLock 状态,默认输入小写。\n" "如果您希望默认输入小写就很方便。\n" "您仍可使用 Shift 键输入大写。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:128 msgid "Sync between CapsLock and IM" msgstr "同步 CapsLock 和输入法" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:134 msgid "" "Occasionally, the CapsLock status does not match the IM, this option " "determines how these status be synchronized. Valid values:\n" "\"disable\": Do nothing.\n" "\"keyboard\": IM status follows keyboard status.\n" "\"IM\": Keyboard status follows IM status." msgstr "" "偶尔也有 CapsLock 状态与输入法不符的情况,这个选项可决定如何同步这些状态。有效值为:\n" "\"disable\":什么都不做。\n" "\"keyboard\":输入法状态遵循键盘状态。\n" "\"IM\":键盘状态遵循输入法状态。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:141 msgid "Number pad always input number" msgstr "数字键盘总是输入数字" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:144 msgid "Always input numbers when number keys from key pad is inputted." msgstr "在使用数字键盘的按键输入时总是输入数字。" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:148 msgid "Shift toggle Chinese Mode" msgstr "Shift 切换中文" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:151 msgid "Shift key to toggle Chinese Mode" msgstr "Shift 键切换中文模式" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:155 msgid "Plain Zhuyin mode" msgstr "简单注音模式" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:158 msgid "" "In plain Zhuyin mode, automatic candidate selection and related options are " "disabled or ignored." msgstr "在简单注音模式中,禁用或忽略自动候选词选择及相关选项。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:161 msgid "Candidate per page" msgstr "每页中的候选词" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:164 msgid "Number of candidate per page." msgstr "每页中的候选词数。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:168 msgid "Choose phrases from backward" msgstr "反向取词" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:171 msgid "Choose phrases from the back, without moving cursor." msgstr "在不移动光标的情况下反向取词。" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:175 msgid "Space to select" msgstr "按空格选择" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:7 msgctxt "Configure" msgid "Cancel" msgstr "取消" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:8 msgctxt "Configure" msgid "Save" msgstr "保存" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:9 msgctxt "Configure" msgid "Apply" msgstr "应用" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:10 msgctxt "Configure" msgid "Close" msgstr "关闭" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:11 msgctxt "Configure" msgid "Ok" msgstr "确认" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/main.c:84 msgid "Chewing component" msgstr "酷音组件" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/main.c:86 #: /home/dchen/devel/ibus-chewing/src/main.c:99 msgid "Peng Huang, Ding-Yi Chen" msgstr "黄鹏,陳定彞" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author leahliu #: /home/dchen/devel/ibus-chewing/src/main.c:95 msgid "Chewing" msgstr "酷音(Chewing)" #: /home/dchen/devel/ibus-chewing/src/main.c:96 msgid "Chinese chewing input method" msgstr "酷音输入法" ibus-chewing-1.4.14/po/zh_TW.po000066400000000000000000000245241244356534300162160ustar00rootroot00000000000000# Translation of Traditional Chinese of ibus-chewing # Copyright (C) 2008, 2009, 2010 # Huang Peng . Ding-Yi Chen # swyear # This file is distributed under the same license as the ibus-chewing package. # Ding-Yi Chen , 2014. #zanata msgid "" msgstr "" "Project-Id-Version: ibus-chewing 1.4.11\n" "Report-Msgid-Bugs-To: Ding-Yi Chen \n" "POT-Creation-Date: 2014-11-04 16:04+1000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "PO-Revision-Date: 2014-11-04 03:07-0500\n" "Last-Translator: Ding-Yi Chen \n" "Language-Team: Chinese (Traditional Han, Taiwan)\n" "Language: zh-TW\n" "X-Generator: Zanata 3.5.1\n" "Plural-Forms: nplurals=1; plural=0\n" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine-input-events.c:386 #: /home/dchen/devel/ibus-chewing/src/ibus-setup-chewing.c:72 msgid "Setting" msgstr "設定" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:251 msgid "Chi" msgstr "中" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:254 msgid "Eng" msgstr "英" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:258 msgid "Click to switch to English" msgstr "點擊以切換至英文" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:262 msgid "Click to switch to Chinese" msgstr "點擊以切換至中文" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:265 msgid "Full" msgstr "全" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:268 msgid "Half" msgstr "半" #: /home/dchen/devel/ibus-chewing/src/IBusChewingEngine.gob:271 msgid "Settings" msgstr "設定" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:13 msgid "Editing" msgstr "編輯" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:14 msgid "Selecting" msgstr "選字" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:15 msgid "Keyboard" msgstr "鍵盤" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:18 msgid "default" msgstr "預設" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:19 msgid "hsu" msgstr "許氏" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:20 msgid "ibm" msgstr "IBM" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:21 msgid "gin_yieh" msgstr "精業" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:22 msgid "eten" msgstr "倚天" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:23 msgid "eten26" msgstr "倚天26鍵" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:24 msgid "dvorak" msgstr "Dvorak" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:25 msgid "dvorak_hsu" msgstr "Dvorak+許氏" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:26 msgid "dachen_26" msgstr "大千26鍵" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:27 msgid "hanyu" msgstr "漢語" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:45 msgctxt "Sync" msgid "disable" msgstr "停用" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:46 msgctxt "Sync" msgid "keyboard" msgstr "由鍵盤" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:47 msgctxt "Sync" msgid "input method" msgstr "由輸入法" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:52 msgid "Auto" msgstr "自動" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:53 msgid "Big5" msgstr "Big5" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author dchen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:54 msgid "UTF8" msgstr "UTF8" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:59 msgid "Keyboard Type" msgstr "鍵盤排列" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:63 msgid "Select Zhuyin keyboard layout." msgstr "選擇注音符號的鍵盤排列。" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:66 msgid "Selection keys" msgstr "選字按鍵" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:71 msgid "" "Keys used to select candidate. For example \"asdfghjkl;\", press 'a' to " "select the 1st candidate, 's' for 2nd, and so on." msgstr "設定選字按鍵。以 \"asdfghjkl;\" 為例,按 'a' 選第一個候選字詞,按 's' 選第二個,依此類推。" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:75 msgid "Hsu's selection key" msgstr "許式鍵盤選擇鍵" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:78 msgid "Hsu's keyboard selection keys, 1 for asdfjkl789, 2 for asdfzxcv89 ." msgstr "許氏鍵盤選擇鍵設定。1 為使用 asdfjkl789,2 為使用asdfzxcv89。" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:82 msgid "Auto move cursor" msgstr "自動移動游標" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:85 msgid "Automatically move cursor to next character." msgstr "自動移游標至下一個字。" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:89 msgid "Add phrases in front" msgstr "前方加詞" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author dchen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:92 msgid "Add phrases in the front." msgstr "前方加詞。" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:96 msgid "Easy symbol input" msgstr "簡易符號輸入" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:99 msgid "Easy symbol input." msgstr "簡易符號輸入。" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:103 msgid "Esc clean all buffer" msgstr "Esc 鍵清預編區" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:106 msgid "Escape key cleans the text in pre-edit-buffer." msgstr "Esc 鍵清預編區。" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:110 msgid "Maximum Chinese characters" msgstr "容納中文字數" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:113 msgid "" "Maximum Chinese characters in pre-edit buffer, including inputing Zhuyin " "symbols" msgstr "預編區可容納中文字數(包含輸入中的注音符號)" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:117 msgid "Force lowercase in En mode" msgstr "CapsLock時英數仍用小寫" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:120 msgid "" "Ignore CapsLock status and input lowercase by default.\n" "It is handy if you wish to enter lowercase by default.\n" "Uppercase can still be inputted with Shift." msgstr "即使在CapsLcok On 的狀態時,仍然輸出小寫英文字母。 \n" "這對習慣打小寫的用戶來說比較方便。\n" "大寫字母仍然可用Shift 鍵輸入。" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:128 msgid "Sync between CapsLock and IM" msgstr "CapsLock與輸入法狀態同步" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:134 msgid "" "Occasionally, the CapsLock status does not match the IM, this option " "determines how these status be synchronized. Valid values:\n" "\"disable\": Do nothing.\n" "\"keyboard\": IM status follows keyboard status.\n" "\"IM\": Keyboard status follows IM status." msgstr "" "CapsLock 狀態有時會跟輸入法不同步,這個選項決定如何同步這些狀態。可用的值:\n" "\"disable\": 停用本功能。\n" "\"keyboard\": 輸入法向 Caps Lock 狀態同步。\n" "\"im\": Caps Lock 向輸入法狀態同步。" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:141 msgid "Number pad always input number" msgstr "數字版總是輸入數字" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:144 msgid "Always input numbers when number keys from key pad is inputted." msgstr "用數字版輸入時總是輸入數字,並不負責選字。" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:148 msgid "Shift toggle Chinese Mode" msgstr "Shift 切換中文" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:151 msgid "Shift key to toggle Chinese Mode" msgstr "Shift 鍵切換中文模式" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:155 msgid "Plain Zhuyin mode" msgstr "單純注音模式" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:158 msgid "" "In plain Zhuyin mode, automatic candidate selection and related options are " "disabled or ignored." msgstr "在單純注音模式,自動選詞功能及選項將被關閉或忽略。" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:161 msgid "Candidate per page" msgstr "每頁候選字數" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:164 msgid "Number of candidate per page." msgstr "每頁可顯示候選字詞數。" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:168 msgid "Choose phrases from backward" msgstr "後方選詞" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author dchen #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:171 msgid "Choose phrases from the back, without moving cursor." msgstr "直接由後方選詞,不必把游標移到候選詞前。" #: /home/dchen/devel/ibus-chewing/src/IBusChewingProperties.c:175 msgid "Space to select" msgstr "空白鍵選字" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:7 msgctxt "Configure" msgid "Cancel" msgstr "取消" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:8 msgctxt "Configure" msgid "Save" msgstr "儲存" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:9 msgctxt "Configure" msgid "Apply" msgstr "套用" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:10 msgctxt "Configure" msgid "Close" msgstr "關閉" #: /home/dchen/devel/ibus-chewing/src/MakerDialogWidget.c:11 msgctxt "Configure" msgid "Ok" msgstr "確定" #: /home/dchen/devel/ibus-chewing/src/main.c:84 msgid "Chewing component" msgstr "酷音元件" #: /home/dchen/devel/ibus-chewing/src/main.c:86 #: /home/dchen/devel/ibus-chewing/src/main.c:99 msgid "Peng Huang, Ding-Yi Chen" msgstr "黃鵬,陳定彞" # translation auto-copied from project ibus-chewing, version 1.3.10, document ibus-chewing, author dchen #: /home/dchen/devel/ibus-chewing/src/main.c:95 msgid "Chewing" msgstr "新酷音" #: /home/dchen/devel/ibus-chewing/src/main.c:96 msgid "Chinese chewing input method" msgstr "中文新酷音輸入法" ibus-chewing-1.4.14/rpm/000077500000000000000000000000001244356534300147745ustar00rootroot00000000000000ibus-chewing-1.4.14/rpm/CMakeLists.txt000066400000000000000000000051201244356534300175320ustar00rootroot00000000000000SET(RPM_BUILD_TOPDIR "${CMAKE_BINARY_DIR}/rpm" CACHE FILEPATH "RPM top dir") SET(RPM_BUILD_SOURCES "${SOURCE_ARCHIVE_DIR}" CACHE FILEPATH "RPM Source dir") INCLUDE(ManageRPM) INCLUDE(ManageReleaseFedora) #RPM_SPEC_STRING_ADD(RPM_SPEC_BUILD_OUTPUT "make VERBOSE=1 translations") IF(NOT "${IBUS_VERSION}" VERSION_LESS "1.5.3") # IBus supports write cache since 1.5.3 SET(RPM_SPEC_IBUS_WRITE_CACHE "[ -x %{_bindir}/ibus ] && %{_bindir}/ibus write-cache --system &>/dev/null || :") SET(RPM_SPEC_POST_COMMON "${RPM_SPEC_IBUS_WRITE_CACHE}") SET(RPM_SPEC_POSTUN_COMMON "${RPM_SPEC_IBUS_WRITE_CACHE}") ELSE() SET(RPM_SPEC_POST_COMMON "") SET(RPM_SPEC_POSTUN_COMMON "") ENDIF() IF(GSETTINGS_SUPPORT) RPM_SPEC_STRING_ADD_DIRECTIVE(RPM_SPEC_SCRIPT_OUTPUT post "" "if [ $1 -eq 0 ] ; then /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : fi ${RPM_SPEC_POST_COMMON} " ) RPM_SPEC_STRING_ADD_DIRECTIVE(RPM_SPEC_SCRIPT_OUTPUT postun "" "/usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : ${RPM_SPEC_POSTUN_COMMON} " ) ENDIF() IF(GCONF2_SUPPORT) RPM_SPEC_STRING_ADD_DIRECTIVE(RPM_SPEC_SCRIPT_OUTPUT pre "" "if [ \"$1\" -gt 1 ] ; then export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` [ -r %{_sysconfdir}/gconf/schemas/%{name}.schemas ] && gconftool-2 --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/%{name}.schemas >/dev/null || : # Upgrading 1.0.2.20090302-1.fc11 or older? [ -r %{_sysconfdir}/gconf/schemas/%{name}.schema ] && gconftool-2 --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/%{name}.schema >/dev/null || : fi " ) RPM_SPEC_STRING_ADD_DIRECTIVE(RPM_SPEC_SCRIPT_OUTPUT preun "" "if [ \"$1\" -eq 0 ] ; then export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` gconftool-2 --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/%{name}.schemas > /dev/null || : fi " ) RPM_SPEC_STRING_ADD_DIRECTIVE(RPM_SPEC_SCRIPT_OUTPUT post "" "export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/%{name}.schemas > /dev/null || : ${RPM_SPEC_POST_COMMON} " ) RPM_SPEC_STRING_ADD_DIRECTIVE(RPM_SPEC_SCRIPT_OUTPUT postun "" "[ -x %{_bindir}/ibus ] && %{_bindir}/ibus write-cache --system &>/dev/null || : ${RPM_SPEC_POSTUN_COMMON} " ) ENDIF() ADD_CUSTOM_COMMAND(OUTPUT ${SOURCE_ARCHIVE_FILE} COMMAND make pack_src WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) PACK_RPM() RELEASE_FEDORA(fedora) # "Off" Warning is displayed if mock is not installed. RPM_MOCK_BUILD() ibus-chewing-1.4.14/rpm/project.spec.in000066400000000000000000000013201244356534300177170ustar00rootroot00000000000000Name: @PROJECT_NAME@ Version: @PRJ_VER@ Release: @RPM_RELEASE_NO@%{?dist} @RPM_SPEC_SUMMARY_OUTPUT@ License: @LICENSE@ Group: @PRJ_GROUP@ URL: @RPM_SPEC_URL_OUTPUT@ @RPM_SPEC_SOURCE_OUTPUT@ @RPM_SPEC_REQUIRES_OUTPUT@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @RPM_SPEC_HEADER_OUTPUT@ @RPM_SPEC_DESCRIPTION_OUTPUT@ @RPM_SPEC_SUB_PACKAGE_OUTPUT@ %prep %setup -q -n %{name}-%{version}-Source %build # $RPM_OPT_FLAGS should be loaded from cmake macro. @RPM_SPEC_BUILD_OUTPUT@ %clean rm -rf %{buildroot} @RPM_SPEC_INSTALL_SECTION_OUTPUT@ @RPM_SPEC_SCRIPT_OUTPUT@ @RPM_SPEC_FILES_SECTION_OUTPUT@ @RPM_SPEC_CHANGELOG_SECTION_OUTPUT@ ibus-chewing-1.4.14/src/000077500000000000000000000000001244356534300147655ustar00rootroot00000000000000ibus-chewing-1.4.14/src/CMakeLists.txt000066400000000000000000000216341244356534300175330ustar00rootroot00000000000000IF(GSETTINGS_SUPPORT) SET(PROJECT_GSCHEMA_XML ${PROJECT_SCHEMA_ID}.gschema.xml CACHE INTERNAL "PROJECT_GSCHEMA_XML") SET(GSETTINGS_SCHEMAS_DIR "${DATA_DIR}/glib-2.0/schemas") ENDIF() SET(IBUS_CHEWING_DEPENDENCIES "") IF(GCONF2_SUPPORT) # Schemas INCLUDE(ManageGConf) SET(PROJECT_SCHEMAS ${PROJECT_NAME}.schemas CACHE INTERNAL "PROJECT_SCHEMAS") SET(IBUS_CHEWING_DEPENDENCIES "GCONF2") MANAGE_GCONF_SCHEMAS() ELSE() SET(IBUS_CHEWING_DEPENDENCIES "") ENDIF() SET(IBUS_ENGINE_CHEWING ibus-engine-chewing) SET(IBUS_SETUP_CHEWING ibus-setup-chewing) # Location of library include files INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ) LIST(APPEND IBUS_CHEWING_DEPENDENCIES CHEWING GLIB2 GTK2 IBUS X11 XTST) SET(IBUS_CHEWING_DEPENDENCIES "${IBUS_CHEWING_DEPENDENCIES}" CACHE INTERAL "IBUS_CHEWING_DEPENDENCIES" ) FOREACH(_d ${IBUS_CHEWING_DEPENDENCIES}) INCLUDE_DIRECTORIES(${${_d}_INCLUDE_DIRS}) # STRING_APPEND(CMAKE_C_FLAGS "${${_d}_CFLAGS}" " ") ENDFOREACH(_d ${IBUS_CHEWING_DEPENDENCIES}) #================================================================== # Sources # SET(GOB2_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}") MACRO(GOB_GENERATE name gobFile) SET(GOB_GENERATED_C_${name} ${GOB2_OUTPUT_DIR}/${name}.c) SET(GOB_GENERATED_${name} ${GOB_GENERATED_C_${name}} "${GOB2_OUTPUT_DIR}/${name}.h" "${GOB2_OUTPUT_DIR}/${name}-private.h" CACHE INTERNAL "GOB_GENERATED_${name}" ) ADD_CUSTOM_COMMAND(OUTPUT ${GOB_GENERATED_${name}} COMMAND ${GOB2_EXECUTABLE} "${gobFile}" -o "${GOB2_OUTPUT_DIR}/" DEPENDS ${gobFile} ${ARGN} ) ENDMACRO(GOB_GENERATE name gobFile) SET(IBUS_CHEWING_ENGINE_SOURCE_INCLUDED_C_FILES ${CMAKE_CURRENT_SOURCE_DIR}/IBusChewingEngine-signal.c ${CMAKE_CURRENT_SOURCE_DIR}/IBusChewingEngine-input-events.c ) GOB_GENERATE(ibus-chewing-engine ${CMAKE_CURRENT_SOURCE_DIR}/IBusChewingEngine.gob ${IBUS_CHEWING_ENGINE_SOURCE_INCLUDED_C_FILES} ) GOB_GENERATE(maker-dialog ${CMAKE_CURRENT_SOURCE_DIR}/MakerDialog.gob ) SET_SOURCE_FILES_PROPERTIES(${GOB_GENERATED_ibus-chewing-engine} ${GOB_GENERATED_maker-dialog} PROPERTIES GENERATED true ) SET(COMMON_SOURCE_C_FILES ${CMAKE_CURRENT_SOURCE_DIR}/IBusChewingApplier.c ${CMAKE_CURRENT_SOURCE_DIR}/IBusChewingLookupTable.c ${CMAKE_CURRENT_SOURCE_DIR}/IBusChewingProperties.c ${CMAKE_CURRENT_SOURCE_DIR}/IBusConfigBackend.c ${CMAKE_CURRENT_SOURCE_DIR}/MakerDialogBackend.c ${CMAKE_CURRENT_SOURCE_DIR}/MakerDialogProperty.c ${CMAKE_CURRENT_SOURCE_DIR}/MakerDialogUtil.c ) IF(GSETTINGS_SUPPORT) LIST(APPEND COMMON_SOURCE_C_FILES ${CMAKE_CURRENT_SOURCE_DIR}/GSettingsBackend.c ) ENDIF() IF(GCONF2_SUPPORT) LIST(APPEND COMMON_SOURCE_C_FILES ${CMAKE_CURRENT_SOURCE_DIR}/GConf2Backend.c ) ENDIF() SET(COMMON_SOURCE_FILES ${COMMON_SOURCE_C_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/IBusChewingLookupTable.h ${CMAKE_CURRENT_SOURCE_DIR}/IBusChewingProperties.h ${CMAKE_CURRENT_SOURCE_DIR}/IBusConfigBackend.h ${CMAKE_CURRENT_SOURCE_DIR}/MakerDialogBackend.h ${CMAKE_CURRENT_SOURCE_DIR}/MakerDialogProperty.h ${CMAKE_CURRENT_SOURCE_DIR}/MakerDialogPropertySpec.h ${CMAKE_CURRENT_SOURCE_DIR}/MakerDialogUtil.h ${GOB2_OUTPUT_DIR}/ibus-chewing-engine.h CACHE INTERNAL "COMMON_SOURCE_FILES" ) IF(GSETTINGS_SUPPORT) LIST(APPEND COMMON_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/GSettingsBackend.h) ENDIF() IF(GCONF2_SUPPORT) LIST(APPEND COMMON_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/GConf2Backend.h) ENDIF() SET(MAKER_DIALOG_SOURCE_C_FILES ${CMAKE_CURRENT_SOURCE_DIR}/MakerDialogWidget.c ) SET(MAKER_DIALOG_SOURCE_FILES ${MAKER_DIALOG_SOURCE_C_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/MakerDialogWidget.h ) SET(IBUS_SETUP_CHEWING_SOURCE_C_FILES ${COMMON_SOURCE_C_FILES} ${MAKER_DIALOG_SOURCE_C_FILES} ) SET(IBUS_SETUP_CHEWING_SOURCE_FILES ${COMMON_SOURCE_FILES} ${MAKER_DIALOG_SOURCE_FILES} ) SET(IBUS_ENGINE_CHEWING_SOURCE_C_FILES ${IBUS_SETUP_CHEWING_SOURCE_C_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/IBusChewingPreEdit.c ${CMAKE_CURRENT_SOURCE_DIR}/IBusChewingUtil.c ) SET(IBUS_ENGINE_CHEWING_SOURCE_FILES ${IBUS_SETUP_CHEWING_SOURCE_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/IBusChewingPreEdit.c ${CMAKE_CURRENT_SOURCE_DIR}/IBusChewingPreEdit.h ${CMAKE_CURRENT_SOURCE_DIR}/IBusChewingUtil.c ${CMAKE_CURRENT_SOURCE_DIR}/IBusChewingUtil.h CACHE INTERNAL "IBUS_ENGINE_CHEWING_SOURCE_FILES" ) SET(IBUS_CHEWING_SOURCE_TO_TRANSLATE ${IBUS_ENGINE_CHEWING_SOURCE_C_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/MakerDialog.gob ${CMAKE_CURRENT_SOURCE_DIR}/IBusChewingEngine.gob ${IBUS_CHEWING_ENGINE_SOURCE_INCLUDED_C_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/ibus-setup-chewing.c ${CMAKE_CURRENT_SOURCE_DIR}/generate-gconf-schemas.c ${CMAKE_CURRENT_SOURCE_DIR}/main.c ) IF(GSETTINGS_SUPPORT) LIST(APPEND IBUS_CHEWING_SOURCE_TO_TRANSLATE ${CMAKE_CURRENT_SOURCE_DIR}/generate-gsettings-schemas.c) ENDIF() IF(GCONF2_SUPPORT) LIST(APPEND IBUS_CHEWING_SOURCE_TO_TRANSLATE ${CMAKE_CURRENT_SOURCE_DIR}/generate-gconf-schemas.c) ENDIF() SET(IBUS_CHEWING_SOURCE_TO_TRANSLATE "${IBUS_CHEWING_SOURCE_TO_TRANSLATE}" CACHE INTERNAL "IBUS_CHEWING_SOURCE_TO_TRANSLATE" ) ADD_CUSTOM_TARGET(gob2 DEPENDS ${GOB_GENERATED_ibus-chewing-engine} ${GOB_GENERATED_maker-dialog} COMMENT "Preprocess with gob2." ) #================================================================== # Building executables # IF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") ADD_DEFINITIONS("-DVERBOSE_LEVEL=DEBUG") ELSE() ADD_DEFINITIONS("-DVERBOSE_LEVEL=MSG") ENDIF() SET(GENERATE_SCHEMAS_LIBARARIES ${CHEWING_LIBRARIES} ${IBUS_LIBRARIES} ${GLIB2_LIBRARIES} ) IF(GSETTINGS_SUPPORT) ADD_EXECUTABLE(generate-gsettings-schemas ${CMAKE_CURRENT_SOURCE_DIR}/generate-gsettings-schemas.c ${COMMON_SOURCE_FILES} ) TARGET_LINK_LIBRARIES(generate-gsettings-schemas ${GENERATE_SCHEMAS_LIBARARIES} ) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_GSCHEMA_XML} DESTINATION "${GSETTINGS_SCHEMAS_DIR}" ) ADD_CUSTOM_TARGET(schemas_gsettings ALL COMMAND G_MESSAGES_DEBUG=all "${CMAKE_CURRENT_BINARY_DIR}/generate-gsettings-schemas" -v 5 "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_GSCHEMA_XML}" COMMAND G_MESSAGES_DEBUG=all glib-compile-schemas "${CMAKE_CURRENT_BINARY_DIR}" COMMENT "Generating gsettings schemas ${PROJECT_GSCHEMA_XML}" VERBATIM ) ADD_DEPENDENCIES(schemas_gsettings generate-gsettings-schemas ) ADD_CUSTOM_TARGET(install_schemas_gsettings COMMAND install "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_GSCHEMA_XML}" "${GSETTINGS_SCHEMAS_DIR}/${PROJECT_GSCHEMA_XML}" COMMAND glib-compile-schemas "${GSETTINGS_SCHEMAS_DIR}" COMMENT "install_schemas_gsettings" ) ADD_CUSTOM_TARGET(uninstall_schemas_gsettings COMMAND rm -f "${GSETTINGS_SCHEMAS_DIR}/${PROJECT_GSCHEMA_XML}" COMMAND glib-compile-schemas "${GSETTINGS_SCHEMAS_DIR}" COMMENT "install_schemas_gsettings" ) ENDIF() IF(GCONF2_SUPPORT) ADD_EXECUTABLE(generate-gconf-schemas ${CMAKE_CURRENT_SOURCE_DIR}/generate-gconf-schemas.c ${COMMON_SOURCE_FILES} ) LIST(APPEND GENERATE_SCHEMAS_LIBARARIES ${GCONF2_LIBRARIES}) TARGET_LINK_LIBRARIES(generate-gconf-schemas ${GENERATE_SCHEMAS_LIBARARIES} ) ADD_CUSTOM_COMMAND(TARGET generate-gconf-schemas POST_BUILD COMMAND G_MESSAGES_DEBUG=all ${CMAKE_CURRENT_BINARY_DIR}/generate-gconf-schemas -v 5 -l "C;${TRANSLATED}" "${CMAKE_CURRENT_BIN_DIR}/${PROJECT_SCHEMAS}" COMMENT "Generating gconf-schemas" VERBATIM ) ENDIF() ADD_EXECUTABLE(${IBUS_SETUP_CHEWING} ${CMAKE_CURRENT_SOURCE_DIR}/ibus-setup-chewing.c ${IBUS_SETUP_CHEWING_SOURCE_FILES} ${GOB_GENERATED_maker-dialog} ) TARGET_LINK_LIBRARIES(${IBUS_SETUP_CHEWING} ${GENERATE_SCHEMAS_LIBARARIES} ${GTK2_LIBRARIES} ) SET(IBUS_ENGINE_CHEWING_LIBRARIES ${GENERATE_SCHEMAS_LIBARARIES} ${GTK2_LIBRARIES} ${X11_LIBRARIES} ${XTST_LIBRARIES} CACHE INTERNAL "IBUS_ENGINE_CHEWING_LIBRARIES" ) ADD_EXECUTABLE(${IBUS_ENGINE_CHEWING} ${CMAKE_CURRENT_SOURCE_DIR}/main.c ${IBUS_ENGINE_CHEWING_SOURCE_FILES} ${GOB_GENERATED_ibus-chewing-engine} ${GOB_GENERATED_maker-dialog} ) TARGET_LINK_LIBRARIES(${IBUS_ENGINE_CHEWING} ${IBUS_ENGINE_CHEWING_LIBRARIES} ) IF(NOT DEFINED LIB_INSTALL_DIR) SET(LIB_INSTALL_DIR "lib${IS_64}") ENDIF() SET_COMPILE_ENV(LIB_INSTALL_DIR "${LIB_INSTALL_DIR}" DISPLAY STRING "Chewing library directory") FILE(GLOB poFiles RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/../po" "../po/*.po") STRING(REPLACE ".po" "" TRANSLATED "${poFiles}") M_MSG(${M_INFO2} "TRANSLATED=${TRANSLATED}") MANAGE_FILE_INSTALL(TARGETS ${IBUS_ENGINE_CHEWING} ARGS LIBEXEC DESTINATION ${LIBEXEC_DIR} LIBRARY DESTINATION ${LIB_INSTALL_DIR} ) MANAGE_FILE_INSTALL(TARGETS ${IBUS_SETUP_CHEWING} ARGS LIBEXEC DESTINATION ${LIBEXEC_DIR} LIBRARY DESTINATION ${LIB_INSTALL_DIR} ) ibus-chewing-1.4.14/src/GConf2Backend.c000066400000000000000000000112461244356534300174630ustar00rootroot00000000000000/* * Copyright © 2014 Red Hat, Inc. All rights reserved. * Copyright © 2014 Ding-Yi Chen * * This file is part of the ibus-chewing Project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include "MakerDialogUtil.h" #include "GConf2Backend.h" static GValue *gconf_value_to_g_value(GConfValue * confValue, GValue * value) { GType gType = G_VALUE_TYPE(value); switch (confValue->type) { case GCONF_VALUE_BOOL: if (gType != G_TYPE_BOOLEAN) { return NULL; } g_value_set_boolean(value, gconf_value_get_bool(confValue)); break; case GCONF_VALUE_INT: if (gType != G_TYPE_INT && gType != G_TYPE_UINT) { return NULL; } else if (gType == G_TYPE_INT) { g_value_set_int(value, gconf_value_get_int(confValue)); } else { g_value_set_uint(value, gconf_value_get_int(confValue)); } break; case GCONF_VALUE_STRING: if (gType != G_TYPE_STRING) { return NULL; } g_value_set_string(value, gconf_value_get_string(confValue)); break; default: return NULL; } return value; } static GConfValue *gconf_value_new_g_value(GValue * value) { GConfValue *confValue; GType gType = G_VALUE_TYPE(value); switch (gType) { case G_TYPE_BOOLEAN: confValue = gconf_value_new(GCONF_VALUE_BOOL); gconf_value_set_bool(confValue, g_value_get_boolean(value)); break; case G_TYPE_INT: confValue = gconf_value_new(GCONF_VALUE_INT); gconf_value_set_int(confValue, g_value_get_int(value)); break; case G_TYPE_UINT: confValue = gconf_value_new(GCONF_VALUE_INT); gconf_value_set_int(confValue, g_value_get_uint(value)); break; case G_TYPE_STRING: confValue = gconf_value_new(GCONF_VALUE_STRING); gconf_value_set_string(confValue, g_value_get_string(value)); break; default: return NULL; } return confValue; } #define KEY_BUFFER_SIZE 100 static gchar *to_real_key(gchar * confKey, MkdgBackend * backend, const gchar * section, const gchar * key) { if (!STRING_IS_EMPTY(backend->basePath)) { g_strlcpy(confKey, backend->basePath, KEY_BUFFER_SIZE); } else { g_strlcpy(confKey, "/", KEY_BUFFER_SIZE); } if (!STRING_IS_EMPTY(section)) { g_strlcat(confKey, section, KEY_BUFFER_SIZE); g_strlcat(confKey, "/", KEY_BUFFER_SIZE); } g_strlcat(confKey, key, KEY_BUFFER_SIZE); return confKey; } /*============================================ * Interface routines */ GValue *gconf2_backend_read_value(MkdgBackend * backend, GValue * value, const gchar * section, const gchar * key, gpointer userData) { GConfClient *config = (GConfClient *) backend->config; GError *err = NULL; gchar confKey[KEY_BUFFER_SIZE]; to_real_key(confKey, backend, section, key); GConfValue *confValue = gconf_client_get(config, confKey, &err); if (err != NULL) { mkdg_log(ERROR, "gconf2_backend_read_value(-,-,%s,%s,-): %s", section, key, err->message); return NULL; } return gconf_value_to_g_value(confValue, value); } gboolean gconf2_backend_write_value(MkdgBackend * backend, GValue * value, const gchar * section, const gchar * key, gpointer userData) { GConfClient *config = (GConfClient *) backend->config; GError *err = NULL; gchar confKey[KEY_BUFFER_SIZE]; to_real_key(confKey, backend, section, key); GConfValue *confValue = gconf_value_new_g_value(value); gconf_client_set(config, confKey, confValue, &err); gconf_value_free(confValue); if (err != NULL) { mkdg_log(ERROR, "gconf2_backend_write_value(-,-,%s,%s,-): %s", section, key, err->message); return FALSE; } return TRUE; } MkdgBackend *gconf2_backend_new(const gchar * basePath, gpointer auxData) { GConfClient *client = gconf_client_get_default(); MkdgBackend *result = mkdg_backend_new(GCONF2_BACKEND_ID, (gpointer) client, basePath, auxData); result->readFunc = gconf2_backend_read_value; result->writeFunc = gconf2_backend_write_value; return result; } ibus-chewing-1.4.14/src/GConf2Backend.h000066400000000000000000000027751244356534300174770ustar00rootroot00000000000000/* * Copyright © 2014 Red Hat, Inc. All rights reserved. * Copyright © 2014 Ding-Yi Chen * * This file is part of the ibus-chewing Project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** * SECTION:GConf2Backend * @short_description: A GConf2 Backend * @title: GConf2 Backend * @stability: Stable * @include: GConf2Backend.h * * GConf2 as MakerDialog backend. */ #ifndef _G_CONF2_BACKEND_H_ #define _G_CONF2_BACKEND_H_ #include "MakerDialogBackend.h" #define GCONF2_BACKEND_ID "gconf2" /** * gconf2_backend_new: * @basePath: All keys and sub-sections of this project should be put under here (with trailing '/'). * @auxData: Auxiliary data. * * @returns: And GConf2 backend for this project. */ MkdgBackend *gconf2_backend_new(const gchar * basePath, gpointer auxData); #endif /* _G_CONF2_BACKEND_H_ */ ibus-chewing-1.4.14/src/GSettingsBackend.c000066400000000000000000000240511244356534300203120ustar00rootroot00000000000000/* * Copyright © 2014 Red Hat, Inc. All rights reserved. * Copyright © 2014 Ding-Yi Chen * * This file is part of the ibus-chewing Project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "MakerDialogUtil.h" #include "GSettingsBackend.h" void mkdg_g_variant_to_g_value(GVariant * gVar, GValue * value) { const GVariantType *gVType = g_variant_get_type(gVar); if (g_variant_type_is_subtype_of(gVType, G_VARIANT_TYPE_BOOLEAN)) { g_value_set_boolean(value, g_variant_get_boolean(gVar)); } else if (g_variant_type_is_subtype_of(gVType, G_VARIANT_TYPE_UINT16)) { g_value_set_uint(value, g_variant_get_uint16(gVar)); } else if (g_variant_type_is_subtype_of(gVType, G_VARIANT_TYPE_UINT32)) { g_value_set_uint(value, g_variant_get_uint32(gVar)); } else if (g_variant_type_is_subtype_of(gVType, G_VARIANT_TYPE_UINT64)) { g_value_set_uint64(value, g_variant_get_uint64(gVar)); } else if (g_variant_type_is_subtype_of(gVType, G_VARIANT_TYPE_INT16)) { g_value_set_int(value, g_variant_get_int16(gVar)); } else if (g_variant_type_is_subtype_of(gVType, G_VARIANT_TYPE_INT32)) { g_value_set_int(value, g_variant_get_int32(gVar)); } else if (g_variant_type_is_subtype_of(gVType, G_VARIANT_TYPE_INT64)) { g_value_set_int64(value, g_variant_get_int64(gVar)); } else if (g_variant_type_is_subtype_of(gVType, G_VARIANT_TYPE_STRING)) { g_value_set_string(value, g_variant_get_string(gVar, NULL)); } } GVariant *mkdg_g_value_to_g_variant(GValue * value) { GType gType = G_VALUE_TYPE(value); GVariant *gVar = NULL; switch (gType) { case G_TYPE_BOOLEAN: gVar = g_variant_new_boolean(g_value_get_boolean(value)); break; case G_TYPE_UINT: gVar = g_variant_new_uint32(g_value_get_uint(value)); break; case G_TYPE_UINT64: gVar = g_variant_new_uint64(g_value_get_uint(value)); break; case G_TYPE_INT: gVar = g_variant_new_int32(g_value_get_int(value)); break; case G_TYPE_INT64: gVar = g_variant_new_int64(g_value_get_int(value)); break; case G_TYPE_STRING: gVar = g_variant_new_string(g_value_get_string(value)); break; default: break; } return gVar; } const gchar *mkdg_g_variant_type_string(GType gType) { switch (gType) { case G_TYPE_BOOLEAN: return (const gchar *) G_VARIANT_TYPE_BOOLEAN; case G_TYPE_UINT: return (const gchar *) G_VARIANT_TYPE_UINT32; case G_TYPE_UINT64: return (const gchar *) G_VARIANT_TYPE_UINT64; case G_TYPE_INT: return (const gchar *) G_VARIANT_TYPE_INT32; case G_TYPE_INT64: return (const gchar *) G_VARIANT_TYPE_INT64; case G_TYPE_STRING: return (const gchar *) G_VARIANT_TYPE_STRING; default: break; } return NULL; } gchar *mkdg_g_settings_attr_append(gchar * buf, gint bufferSize, const gchar * attr, const gchar * value) { if (STRING_IS_EMPTY(attr)) return buf; if (!STRING_IS_EMPTY(buf)) g_strlcat(buf, " ", bufferSize); return buf; } gchar *mkdg_g_variant_to_string(GVariant * gVar) { static gchar result[MAKER_DIALOG_VALUE_LENGTH]; result[0] = '\0'; const GVariantType *gVType = g_variant_get_type(gVar); if (g_variant_type_is_subtype_of(gVType, G_VARIANT_TYPE_BOOLEAN)) { g_snprintf(result, MAKER_DIALOG_VALUE_LENGTH, g_variant_get_boolean(gVar) ? "1" : "0"); } else if (g_variant_type_is_subtype_of(gVType, G_VARIANT_TYPE_UINT16)) { g_snprintf(result, MAKER_DIALOG_VALUE_LENGTH, "%u", g_variant_get_uint16(gVar)); } else if (g_variant_type_is_subtype_of(gVType, G_VARIANT_TYPE_UINT32)) { g_snprintf(result, MAKER_DIALOG_VALUE_LENGTH, "%u", g_variant_get_uint32(gVar)); } else if (g_variant_type_is_subtype_of(gVType, G_VARIANT_TYPE_UINT64)) { g_snprintf(result, MAKER_DIALOG_VALUE_LENGTH, "%lu", g_variant_get_uint64(gVar)); } else if (g_variant_type_is_subtype_of(gVType, G_VARIANT_TYPE_INT16)) { g_snprintf(result, MAKER_DIALOG_VALUE_LENGTH, "%d", g_variant_get_int16(gVar)); } else if (g_variant_type_is_subtype_of(gVType, G_VARIANT_TYPE_INT32)) { g_snprintf(result, MAKER_DIALOG_VALUE_LENGTH, "%d", g_variant_get_int32(gVar)); } else if (g_variant_type_is_subtype_of(gVType, G_VARIANT_TYPE_INT64)) { g_snprintf(result, MAKER_DIALOG_VALUE_LENGTH, "%ld", g_variant_get_int64(gVar)); } else if (g_variant_type_is_subtype_of(gVType, G_VARIANT_TYPE_STRING)) { g_snprintf(result, MAKER_DIALOG_VALUE_LENGTH, g_variant_get_string(gVar, NULL)); } return result; } /*============================================ * Class routines */ #define KEY_BUFFER_SIZE 300 /*=== Start Schema Writing ===*/ gboolean mkdg_g_settings_write_schema_spec(FILE * file, MkdgPropertySpec * spec) { gchar attrBuf[KEY_BUFFER_SIZE]; const gchar *typeString = mkdg_g_variant_type_string(spec->valueType); g_strlcpy(attrBuf, "", KEY_BUFFER_SIZE); mkdg_xml_attr_append(attrBuf, KEY_BUFFER_SIZE, "name", spec->key); mkdg_xml_attr_append(attrBuf, KEY_BUFFER_SIZE, "type", typeString); mkdg_xml_tags_write(file, "key", MKDG_XML_TAG_TYPE_BEGIN_ONLY, attrBuf, NULL); /* tag default */ g_strlcpy(attrBuf, "", KEY_BUFFER_SIZE); if (spec->propertyFlags & MKDG_PROPERTY_FLAG_HAS_TRANSLATION) { mkdg_xml_attr_append(attrBuf, KEY_BUFFER_SIZE, "l10n", "messages"); if (!STRING_IS_EMPTY(spec->translationContext)) { mkdg_xml_attr_append(attrBuf, KEY_BUFFER_SIZE, "context", spec->translationContext); } } gchar *valueStr = NULL; switch (spec->valueType) { case G_TYPE_BOOLEAN: valueStr = g_strdup_printf("%s", (STRING_EQUALS(spec->defaultValue, "0")) ? "false" : "true"); break; case G_TYPE_STRING: valueStr = g_strdup_printf("\"%s\"", spec->defaultValue); break; default: valueStr = g_strdup_printf("%s", spec->defaultValue); break; } mkdg_xml_tags_write(file, "default", MKDG_XML_TAG_TYPE_SHORT, attrBuf, valueStr); g_free(valueStr); mkdg_xml_tags_write(file, "summary", MKDG_XML_TAG_TYPE_SHORT, NULL, spec->label); mkdg_xml_tags_write(file, "description", MKDG_XML_TAG_TYPE_LONG, NULL, spec->tooltip); mkdg_xml_tags_write(file, "key", MKDG_XML_TAG_TYPE_END_ONLY, NULL, NULL); return TRUE; } gboolean mkdg_g_settings_write_schema_from_spec_array(const gchar * schemaId, const gchar * basePath, FILE * file, MkdgPropertySpec specs[], const gchar * gettextDomain) { mkdg_log(DEBUG, "mkdg_g_settings_write_schema_from_spec_array(%s,%s,-,-,-,%s)", schemaId, basePath, gettextDomain); gchar attrBuf[KEY_BUFFER_SIZE]; gchar path[KEY_BUFFER_SIZE]; g_snprintf(path, KEY_BUFFER_SIZE, "%s", basePath); /* Header */ mkdg_xml_tags_write(file, "schemalist", MKDG_XML_TAG_TYPE_BEGIN_ONLY, NULL, NULL); g_strlcpy(attrBuf, "", KEY_BUFFER_SIZE); mkdg_xml_attr_append(attrBuf, KEY_BUFFER_SIZE, "id", schemaId); mkdg_xml_attr_append(attrBuf, KEY_BUFFER_SIZE, "path", path); mkdg_xml_attr_append(attrBuf, KEY_BUFFER_SIZE, "gettext-domain", gettextDomain); mkdg_xml_tags_write(file, "schema", MKDG_XML_TAG_TYPE_BEGIN_ONLY, attrBuf, NULL); /* Body */ gint i; for (i = 0; (&specs[i])->valueType != G_TYPE_INVALID; i++) { mkdg_g_settings_write_schema_spec(file, &specs[i]); } /* Footer */ mkdg_xml_tags_write(file, "schema", MKDG_XML_TAG_TYPE_END_ONLY, NULL, NULL); mkdg_xml_tags_write(file, "schemalist", MKDG_XML_TAG_TYPE_END_ONLY, NULL, NULL); return TRUE; } /*=== End Schema Writing ===*/ GValue *mkdg_g_settings_read_value(GSettings * settings, GValue * value, const gchar * key) { GVariant *confValue = g_settings_get_value(settings, key); mkdg_log(DEBUG, "mkdg_g_settings_read_value(-,-,%s)", key); if (confValue == NULL) { mkdg_log(ERROR, "mkdg_g_settings_read_value(-,-,%s)", key); return NULL; } mkdg_g_variant_to_g_value(confValue, value); return value; } GValue *mkdg_g_settings_backend_read_value(MkdgBackend * backend, GValue * value, const gchar * section, const gchar * key, gpointer userData) { GSettings *config = (GSettings *) backend->config; return mkdg_g_settings_read_value(config, value, key); } gboolean mkdg_g_settings_backend_write_value(MkdgBackend * backend, GValue * value, const gchar * section, const gchar * key, gpointer userData) { GSettings *config = (GSettings *) backend->config; GVariant *confValue = g_variant_ref_sink(mkdg_g_value_to_g_variant(value)); mkdg_log(DEBUG, "mkdg_g_settings_write_value(-,%s,%s) %s", mkdg_g_value_to_string(value), key, mkdg_g_variant_to_string(confValue)); gboolean result = g_settings_set_value(config, key, confValue); g_settings_sync(); if (!result) { mkdg_log(ERROR, "mkdg_g_settings_backend_write_value(-,%s,%s,%s,-): Fail g_settings_set_value", mkdg_g_value_to_string(value), section, key); } g_variant_unref(confValue); return result; } MkdgBackend *mkdg_g_settings_backend_new(const gchar * schemaId, const gchar * basePath, gpointer auxData) { GSettings *client = g_settings_new(schemaId); MkdgBackend *result = mkdg_backend_new(GSETTINGS_BACKEND_ID, (gpointer) client, basePath, auxData); result->readFunc = mkdg_g_settings_backend_read_value; result->writeFunc = mkdg_g_settings_backend_write_value; return result; } ibus-chewing-1.4.14/src/GSettingsBackend.h000066400000000000000000000042261244356534300203210ustar00rootroot00000000000000/* * Copyright © 2014 Red Hat, Inc. All rights reserved. * Copyright © 2014 Ding-Yi Chen * * This file is part of the ibus-chewing Project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** * SECTION:GSettingsBackend * @short_description: GSettings backend * @title: GSettings Backend * @stability: Stable * @include: GSettingsBackend.h * * GSettings as MakerDialog backend. */ #ifndef _MKDG_GSETTINGS_BACKEND_H_ #define _MKDG_GSETTINGS_BACKEND_H_ #include #include #include #include "MakerDialogPropertySpec.h" #include "MakerDialogBackend.h" #define GSETTINGS_BACKEND_ID "gsettings" GValue *mkdg_g_settings_read_value(GSettings * settings, GValue * value, const gchar * key); void mkdg_g_variant_to_g_value(GVariant * gVar, GValue * value); GVariant *mkdg_g_value_to_g_variant(GValue * value); /** * mkdg_g_settings_backend_new: * @schemaId: GSettings Schema ID. * @basePath: GSettings path with trailing '/' * @auxData: Auxiliary data. * * @returns: An GSettings backend for this project. * */ MkdgBackend *mkdg_g_settings_backend_new(const gchar * schemaId, const gchar * basePath, gpointer auxData); gboolean mkdg_g_settings_write_schema_from_spec_array(const gchar * schemaId, const gchar * basePath, FILE * file, MkdgPropertySpec specs[], const gchar * gettextDomain); #endif /* _MKDG_GSETTINGS_BACKEND_H_ */ ibus-chewing-1.4.14/src/IBusChewingApplier.c000066400000000000000000000125711244356534300206230ustar00rootroot00000000000000#include #include "IBusChewingPreEdit.h" #include "IBusChewingLookupTable.h" #include "ibus-chewing-engine.h" static ChewingKbType kbType_id_get_index(const gchar * kbType_id) { ChewingKbType i = 0; for (i = 0; kbType_ids[i] != NULL; i++) { if (strcmp(kbType_id, kbType_ids[i]) == 0) { return i; } } return CHEWING_KBTYPE_INVALID; } /*============================================ * Callback routines */ gboolean KBType_apply_callback(PropertyContext * ctx, gpointer userData) { GValue *value = &(ctx->value); IBUS_CHEWING_LOG(DEBUG, "KBType_apply_callback(%s,%s)", ctx->spec->key, mkdg_g_value_to_string(value)); ChewingKbType kbType = kbType_id_get_index(g_value_get_string(value)); IBusChewingPreEdit *icPreEdit = (IBusChewingPreEdit *) ctx->parent; chewing_set_KBType(icPreEdit->context, kbType); return TRUE; } gboolean selKeys_apply_callback(PropertyContext * ctx, gpointer userData) { GValue *value = &(ctx->value); IBUS_CHEWING_LOG(DEBUG, "selKeys_apply_callback(%s,%s)", ctx->spec->key, mkdg_g_value_to_string(value)); IBusChewingPreEdit *icPreEdit = (IBusChewingPreEdit *) ctx->parent; ibus_chewing_lookup_table_resize(icPreEdit->iTable, icPreEdit->iProperties, icPreEdit->context); return TRUE; } gboolean hsuSelKeyType_apply_callback(PropertyContext * ctx, gpointer userData) { GValue *value = &(ctx->value); IBusChewingPreEdit *icPreEdit = (IBusChewingPreEdit *) ctx->parent; chewing_set_hsuSelKeyType(icPreEdit->context, g_value_get_int(value)); return TRUE; } gboolean autoShiftCur_apply_callback(PropertyContext * ctx, gpointer userData) { GValue *value = &(ctx->value); IBusChewingPreEdit *icPreEdit = (IBusChewingPreEdit *) ctx->parent; chewing_set_autoShiftCur(icPreEdit->context, (g_value_get_boolean(value)) ? 1 : 0); return TRUE; } gboolean addPhraseDirection_apply_callback(PropertyContext * ctx, gpointer userData) { GValue *value = &(ctx->value); IBusChewingPreEdit *icPreEdit = (IBusChewingPreEdit *) ctx->parent; chewing_set_addPhraseDirection(icPreEdit->context, (g_value_get_boolean(value)) ? 1 : 0); return TRUE; } gboolean easySymbolInput_apply_callback(PropertyContext * ctx, gpointer userData) { GValue *value = &(ctx->value); IBusChewingPreEdit *icPreEdit = (IBusChewingPreEdit *) ctx->parent; chewing_set_easySymbolInput(icPreEdit->context, (g_value_get_boolean(value)) ? 1 : 0); /* Use MkdgProperty directly, no need to keep flag */ return TRUE; } gboolean escCleanAllBuf_apply_callback(PropertyContext * ctx, gpointer userData) { GValue *value = &(ctx->value); IBusChewingPreEdit *icPreEdit = (IBusChewingPreEdit *) ctx->parent; chewing_set_escCleanAllBuf(icPreEdit->context, (g_value_get_boolean(value)) ? 1 : 0); return TRUE; } /* Additional symbol buffer length */ gboolean maxChiSymbolLen_apply_callback(PropertyContext * ctx, gpointer userData) { GValue *value = &(ctx->value); IBusChewingPreEdit *icPreEdit = (IBusChewingPreEdit *) ctx->parent; chewing_set_maxChiSymbolLen(icPreEdit->context, g_value_get_int(value)); return TRUE; } gboolean forceLowercaseEnglish_apply_callback(PropertyContext * ctx, gpointer userData) { /* Use MkdgProperty directly, no need to keep flag */ return TRUE; } gboolean syncCapsLock_apply_callback(PropertyContext * ctx, gpointer userData) { GValue *value = &(ctx->value); IBusChewingPreEdit *icPreEdit = (IBusChewingPreEdit *) ctx->parent; const gchar *str = g_value_get_string(value); if (strcmp(str, "keyboard") == 0) { ibus_chewing_pre_edit_set_flag(icPreEdit, FLAG_SYNC_FROM_KEYBOARD); ibus_chewing_pre_edit_clear_flag(icPreEdit, FLAG_SYNC_FROM_IM); } else if (strcmp(str, "input method") == 0) { ibus_chewing_pre_edit_set_flag(icPreEdit, FLAG_SYNC_FROM_IM); ibus_chewing_pre_edit_clear_flag(icPreEdit, FLAG_SYNC_FROM_KEYBOARD); } else { ibus_chewing_pre_edit_clear_flag(icPreEdit, FLAG_SYNC_FROM_IM | FLAG_SYNC_FROM_KEYBOARD); } return TRUE; } gboolean numpadAlwaysNumber_apply_callback(PropertyContext * ctx, gpointer userData) { /* Use MkdgProperty directly, no need to keep flag */ return TRUE; } gboolean candPerPage_apply_callback(PropertyContext * ctx, gpointer userData) { IBusChewingPreEdit *icPreEdit = (IBusChewingPreEdit *) ctx->parent; ibus_chewing_lookup_table_resize(icPreEdit->iTable, icPreEdit->iProperties, icPreEdit->context); return TRUE; } gboolean phraseChoiceRearward_apply_callback(PropertyContext * ctx, gpointer userData) { GValue *value = &(ctx->value); IBusChewingPreEdit *icPreEdit = (IBusChewingPreEdit *) ctx->parent; chewing_set_phraseChoiceRearward(icPreEdit->context, (g_value_get_boolean(value)) ? 1 : 0); return TRUE; } gboolean spaceAsSelection_apply_callback(PropertyContext * ctx, gpointer userData) { GValue *value = &(ctx->value); IBusChewingPreEdit *icPreEdit = (IBusChewingPreEdit *) ctx->parent; chewing_set_spaceAsSelection(icPreEdit->context, (g_value_get_boolean(value)) ? 1 : 0); return TRUE; } gboolean plainZhuyin_apply_callback(PropertyContext * ctx, gpointer userData) { /* Use MkdgProperty directly, no need to keep flag */ return TRUE; } ibus-chewing-1.4.14/src/IBusChewingEngine-input-events.c000066400000000000000000000056501244356534300230730ustar00rootroot00000000000000#include "IBusChewingProperties.h" gboolean ibus_chewing_engine_process_key_event(IBusEngine * engine, KSym keySym, guint keycode, KeyModifiers unmaskedMod) { IBUS_CHEWING_LOG(INFO, "******** process_key_event(-,%x(%s),%x,%x) %s", keySym, key_sym_get_name(keySym), keycode, unmaskedMod, modifiers_to_string(unmaskedMod)); IBusChewingEngine *self = IBUS_CHEWING_ENGINE(engine); if (is_password(self)) return FALSE; KSym kSym = ibus_chewing_pre_edit_key_code_to_key_sym(self->icPreEdit, keySym, keycode, unmaskedMod); gboolean result = ibus_chewing_pre_edit_process_key(self->icPreEdit, kSym, unmaskedMod); IBUS_CHEWING_LOG(MSG, "process_key_event() result=%d", result); self_update(self); return result; } /*=================================================== * Mouse events */ void ibus_chewing_engine_candidate_clicked(IBusEngine * engine, guint index, guint button, guint state) { IBUS_CHEWING_LOG(INFO, "*** candidate_clicked(-, %x, %x, %x) ... proceed.", index, button, state); IBusChewingEngine *self = IBUS_CHEWING_ENGINE(engine); if (is_password(self)) return; if (index >= chewing_get_candPerPage(self->icPreEdit->context) || index < 0) { IBUS_CHEWING_LOG(DEBUG, "candidate_clicked() index out of ranged"); return; } if (ibus_chewing_pre_edit_has_flag(self->icPreEdit, FLAG_TABLE_SHOW)) { gint *selKeys = chewing_get_selKey(self->icPreEdit->context); KSym k = (KSym) selKeys[index]; ibus_chewing_pre_edit_process_key(self->icPreEdit, k, 0); g_free(selKeys); self_update(self); } else { IBUS_CHEWING_LOG(DEBUG, "candidate_clicked() ... candidates are not showing"); } } void ibus_chewing_engine_property_activate(IBusEngine * engine, const gchar * prop_name, guint prop_state) { IBUS_CHEWING_LOG(INFO, "property_activate(-, %s, %u)", prop_name, prop_state); Self *self = SELF(engine); if (STRING_EQUALS(prop_name, "InputMode")) { /* Toggle Chinese <-> English */ ibus_chewing_pre_edit_toggle_chi_eng_mode(self->icPreEdit); IBUS_CHEWING_LOG(INFO, "property_activate chinese=%d caps_lock=%d", is_chinese(self), is_caps_lock(self)); if (ibus_chewing_pre_edit_has_flag (self->icPreEdit, FLAG_SYNC_FROM_IM) || ibus_chewing_pre_edit_has_flag(self->icPreEdit, FLAG_SYNC_FROM_KEYBOARD)) { if (is_chinese(self) == is_caps_lock(self)) { set_caps_led(!is_chinese(self), self->_priv->pDisplay); } } self_refresh_property(self, prop_name); } else if (STRING_EQUALS(prop_name, "chewing_alnumSize_prop")) { /* Toggle Full <-> Half */ chewing_set_ShapeMode(self->icPreEdit->context, !chewing_get_ShapeMode(self-> icPreEdit->context)); self_refresh_property(self, prop_name); } else { IBUS_CHEWING_LOG(DEBUG, "property_activate(-, %s, %u) not recognized", prop_name, prop_state); } } ibus-chewing-1.4.14/src/IBusChewingEngine-signal.c000066400000000000000000000225231244356534300217050ustar00rootroot00000000000000/*================================================= * Signal process routines * */ /** * ibus_chewing_engine_reset: * @self: IBusChewingEngine instance. * * Reset the outgoing and pre_edit buffer and cursor * chewing_reset will NOT called here, as it will chnage the KBType and input mode. */ void ibus_chewing_engine_reset(IBusChewingEngine * self) { IBUS_CHEWING_LOG(MSG, "* reset"); /* Always clean buffer */ ibus_chewing_pre_edit_clear(self->icPreEdit); #ifndef UNIT_TEST IBusEngine *engine=IBUS_ENGINE(self); ibus_engine_hide_auxiliary_text(engine); ibus_engine_hide_lookup_table(engine); ibus_engine_update_preedit_text(engine, SELF_GET_CLASS(self)->emptyText, 0, FALSE); #endif } void ibus_chewing_engine_enable(IBusChewingEngine * self) { IBUS_CHEWING_LOG(MSG, "* enable(): statusFlags=%x", self->_priv->statusFlags); ibus_chewing_engine_use_setting(self); ibus_chewing_engine_set_status_flag(self, ENGINE_FLAG_ENABLED); } void ibus_chewing_engine_disable(IBusChewingEngine * self) { IBUS_CHEWING_LOG(MSG, "* disable(): statusFlags=%x", self->_priv->statusFlags); ibus_chewing_engine_clear_status_flag(self, ENGINE_FLAG_ENABLED); } void ibus_chewing_engine_focus_in(IBusChewingEngine * self) { IBUS_CHEWING_LOG(MSG, "* focus_in(): statusFlags=%x", self->_priv->statusFlags); ibus_chewing_engine_use_setting(self); ibus_chewing_engine_restore_mode(self); ibus_chewing_engine_refresh_property_list(self); /* Shouldn't have anything to commit when Focus-in */ ibus_chewing_pre_edit_clear(self->icPreEdit); refresh_pre_edit_text(self); refresh_aux_text(self); #ifdef UNIT_TEST refresh_outgoing_text(self); #else commit_text(self); #endif ibus_chewing_engine_set_status_flag(self, ENGINE_FLAG_FOCUS_IN); IBUS_CHEWING_LOG(INFO, "focus_in() statusFlags=%x: return", self->_priv->statusFlags); } void ibus_chewing_engine_focus_out(IBusChewingEngine * self) { IBUS_CHEWING_LOG(MSG, "* focus_out(): statusFlags=%x", self->_priv->statusFlags); ibus_chewing_engine_clear_status_flag(self, ENGINE_FLAG_FOCUS_IN | ENGINE_FLAG_PROPERTIES_REGISTERED); ibus_chewing_engine_hide_property_list(self); IBUS_CHEWING_LOG(DEBUG, "focus_out(): return"); } #if IBUS_CHECK_VERSION(1, 5, 4) void ibus_chewing_engine_set_content_type(IBusEngine * engine, guint purpose, guint hints) { IBUS_CHEWING_LOG(DEBUG, "ibus_chewing_set_content_type(%d, %d)", purpose, hints); Self *self = SELF(engine); if (purpose == IBUS_INPUT_PURPOSE_PASSWORD || purpose == IBUS_INPUT_PURPOSE_PIN) { ibus_chewing_engine_set_status_flag(self, ENGINE_FLAG_IS_PASSWORD); } else { ibus_chewing_engine_clear_status_flag(self, ENGINE_FLAG_IS_PASSWORD); } } #endif /*================================================= * Display text update routines * */ void parent_commit_text(IBusEngine * iEngine) { IBusChewingEngine *self = IBUS_CHEWING_ENGINE(iEngine); IBUS_CHEWING_LOG(MSG, "* parent_commit_text(-): outgoingText=%s", self->outgoingText->text); #ifdef UNIT_TEST printf("* parent_commit_text(-, %s)\n", self->outgoingText->text); #else ibus_engine_commit_text(iEngine, self->outgoingText); #endif } void parent_update_pre_edit_text(IBusEngine * iEngine, IBusText * iText, guint cursor_pos, gboolean visible) { #ifdef UNIT_TEST printf("* parent_update_pre_edit_text(-, %s, %u, %x)\n", iText->text, cursor_pos, visible); #else ibus_engine_update_preedit_text(iEngine, iText, cursor_pos, visible); #endif } void parent_update_pre_edit_text_with_mode(IBusEngine * iEngine, IBusText * iText, guint cursor_pos, gboolean visible, IBusPreeditFocusMode mode) { #ifdef UNIT_TEST printf ("* parent_update_pre_edit_text_with_mode(-, %s, %u, %x, %x)\n", iText->text, cursor_pos, visible, mode); #else ibus_engine_update_preedit_text_with_mode (iEngine, iText, cursor_pos, visible, mode); #endif } void parent_update_auxiliary_text(IBusEngine * iEngine, IBusText * iText, gboolean visible) { #ifdef UNIT_TEST printf ("* parent_update_auxiliary_text(-, %s, %x)\n", (iText) ? iText->text : "NULL", visible); #else if (!visible) { ibus_engine_hide_auxiliary_text(iEngine); return; } if (ibus_text_is_empty(iText)) { ibus_engine_hide_auxiliary_text(iEngine); return; } ibus_engine_show_auxiliary_text(iEngine); #endif } IBusText *decorate_pre_edit(IBusChewingPreEdit * icPreEdit, EngineFlag statusFlags) { gchar *preEdit = ibus_chewing_pre_edit_get_pre_edit(icPreEdit); IBusText *iText = g_object_ref_sink(ibus_text_new_from_string(preEdit)); gint chiSymbolCursor = chewing_cursor_Current(icPreEdit->context); IBUS_CHEWING_LOG(DEBUG, "decorate_pre_edit() cursor=%d preEdit=%s", chiSymbolCursor, preEdit); gint charLen = (gint) g_utf8_strlen(preEdit, -1); gint cursorRight = chiSymbolCursor + icPreEdit->bpmfLen; IBUS_CHEWING_LOG(DEBUG, "decorate_pre_edit() charLen=%d cursorRight=%d", charLen, cursorRight); IntervalType it; chewing_interval_Enumerate(icPreEdit->context); /* Add double lines on chewing interval that contains cursor */ /* Add single line on other chewing interval */ while (chewing_interval_hasNext(icPreEdit->context)) { chewing_interval_Get(icPreEdit->context, &it); if (it.from <= chiSymbolCursor && chiSymbolCursor <= it.to) { ibus_text_append_attribute(iText, IBUS_ATTR_TYPE_UNDERLINE, IBUS_ATTR_UNDERLINE_DOUBLE, it.from, it.to + 1); } else { ibus_text_append_attribute(iText, IBUS_ATTR_TYPE_UNDERLINE, IBUS_ATTR_UNDERLINE_SINGLE, it.from, it.to + 1); } } if (!mkdg_has_flag(statusFlags, ENGINE_FLAG_CAP_SURROUNDING_TEXT)) { /* Cannot change color when if the client is not capable * of showing surrounding text */ return iText; } /* Show current cursor in red */ ibus_text_append_attribute(iText, IBUS_ATTR_TYPE_BACKGROUND, 0x00ff0000, chiSymbolCursor, chiSymbolCursor + 1); return iText; } void refresh_pre_edit_text(IBusChewingEngine * self) { IBusText *iText = decorate_pre_edit(self->icPreEdit, self->_priv->statusFlags); if (self->preEditText) { g_object_unref(self->preEditText); } self->preEditText = g_object_ref_sink(iText); } void update_pre_edit_text(IBusChewingEngine * self) { refresh_pre_edit_text(self); gboolean visible = TRUE; IBusPreeditFocusMode mode; if (STRING_IS_EMPTY(self->preEditText->text)) { mode = IBUS_ENGINE_PREEDIT_CLEAR; visible = FALSE; } else { mode = IBUS_ENGINE_PREEDIT_COMMIT; } parent_update_pre_edit_text_with_mode(IBUS_ENGINE(self), self->preEditText, cursor_current, visible, mode); } void refresh_aux_text(IBusChewingEngine * self) { if (!ibus_chewing_engine_has_status_flag (self, ENGINE_FLAG_CAP_AUXILIARY_TEXT)) { return; } IBUS_CHEWING_LOG(INFO, "refresh_aux_text()"); gint bpmfLen; gchar *auxStr; if (self->auxText != NULL) { g_object_unref(self->auxText); } if (chewing_aux_Length(self->icPreEdit->context) > 0) { auxStr = chewing_aux_String(self->icPreEdit->context); IBUS_CHEWING_LOG(INFO, "update_aux_text() auxStr=%s", auxStr); } else { IBUS_CHEWING_LOG(INFO, "update_aux_text() bpmf_check=%x", ibus_chewing_bopomofo_check(self-> icPreEdit->context)); gchar *bpmfStr = ibus_chewing_bopomofo_string(self->icPreEdit->context, &bpmfLen); IBUS_CHEWING_LOG(INFO, "update_aux_text() bpmfStr=%s", bpmfStr); self->auxText = g_object_ref_sink(ibus_text_new_from_string(bpmfStr)); g_free(bpmfStr); } } void update_aux_text(IBusChewingEngine * self) { IBUS_CHEWING_LOG(DEBUG, "update_aux_text()"); if (!ibus_chewing_engine_has_status_flag (self, ENGINE_FLAG_CAP_AUXILIARY_TEXT)) { return; } refresh_aux_text(self); parent_update_auxiliary_text(IBUS_ENGINE(self), self->auxText, TRUE); } void update_lookup_table(IBusChewingEngine * self) { IBUS_CHEWING_LOG(DEBUG, "update_lookup_table() CurrentPage=%d", chewing_cand_CurrentPage(self->icPreEdit->context)); gboolean isShow = ibus_chewing_pre_edit_has_flag(self->icPreEdit, FLAG_TABLE_SHOW); if (isShow) { #ifndef UNIT_TEST ibus_engine_update_lookup_table(IBUS_ENGINE(self), self->icPreEdit->iTable, isShow); ibus_engine_show_lookup_table(IBUS_ENGINE(self)); #endif } else { #ifndef UNIT_TEST ibus_engine_update_lookup_table(IBUS_ENGINE(self), self->icPreEdit->iTable, isShow); ibus_engine_hide_lookup_table(IBUS_ENGINE(self)); #endif } } void refresh_outgoing_text(IBusChewingEngine * self) { gchar *outgoingStr = ibus_chewing_pre_edit_get_outgoing(self->icPreEdit); IBUS_CHEWING_LOG(INFO, "refresh_outgoing_text() outgoingStr=|%s|", outgoingStr); if (self->outgoingText) { g_object_unref(self->outgoingText); } self->outgoingText = g_object_ref_sink(ibus_text_new_from_string(outgoingStr)); IBUS_CHEWING_LOG(DEBUG, "refresh_outgoing_text() outgoingText=|%s|", self->outgoingText->text); } void commit_text(IBusChewingEngine * self) { refresh_outgoing_text(self); if (!ibus_text_is_empty(self->outgoingText) || !ibus_chewing_engine_has_status_flag(self, ENGINE_FLAG_FOCUS_IN)) { parent_commit_text(IBUS_ENGINE(self)); } ibus_chewing_pre_edit_clear_outgoing(self->icPreEdit); } ibus-chewing-1.4.14/src/IBusChewingEngine.gob000066400000000000000000000433611244356534300207620ustar00rootroot00000000000000requires 2.0.0 %alltop{ /* * Copyright © 2009,2010 Red Hat, Inc. All rights reserved. * Copyright © 2009,2010 Ding-Yi Chen * * This file is part of the ibus-chewing Project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that ill be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #define GETTEXT_PACKAGE "gtk20" #include #include #include #include #include "IBusChewingUtil.h" #include "GSettingsBackend.h" #include "IBusChewingProperties.h" #include "IBusChewingPreEdit.h" %} enum CHEWING_INPUT_STYLE { IN_APPLICATION, IN_CANDIDATE, } Chewing:Input:Style; /** * EngineFlag: * @UNIT_TEST: Engine is in unit test mode (i.e. not connect to Bus) * @INITIALIZED: Engine is initialized. * @ENABLED: Engine is enabled. * @FOCUS_IN: Engine gets focus. * @SHOW_CANDIDATE: Whether the candidate selection should be shown. Important for Plain Zhuyin. * @IS_PASSWORD: Current input is password. * @PROPERTIES_REGISTERED: Engine registered the properties. * * * Engine flags show the current states of engine, * Thus those might change quite often. * * If SYSTEM_KEYBOARD_LAYOUT is enabled, IBus-Chewing uses whatever * key_syms received. Otherwise it converts according to en-US * keyboard layout. * * It does not make any difference for en-US keyboards (which are * the default keyboards in Taiwan). However, for French AZERTY * keyboard. Pressing the key below 1 returns * * SYSTEM_KEYBOARD_LAYOUT enabled (key a): ㄇ * SYSTEM_KEYBOARD_LAYOUT disabled (key q): ㄆ * * libChewing does not have direct method to clean commit buffer. * Thus NEED_COMMIT is needed to prevent unnecessary commit. */ enum ENGINE_FLAG { INITIALIZED = 0x1, ENABLED = 0x2, FOCUS_IN = 0x4, IS_PASSWORD = 0x8, PROPERTIES_REGISTERED = 0x10, CAP_PREEDIT_TEXT = 0x20, CAP_AUXILIARY_TEXT = 0x40, CAP_LOOKUP_TABLE = 0x80, CAP_FOCUS = 0x100, CAP_PROPERTY = 0x200, CAP_SURROUNDING_TEXT = 0x400 } Engine:Flag; %h{ extern MkdgPropertySpec propSpecs[]; extern const gchar *page_labels[]; extern const gchar *button_labels[]; extern GtkResponseType button_responses[]; #define ibus_chewing_engine_has_status_flag(self,f) mkdg_has_flag(self->_priv->statusFlags,f) #define ibus_chewing_engine_set_status_flag(self,f) mkdg_set_flag(self->_priv->statusFlags,f) #define ibus_chewing_engine_clear_status_flag(self,f) mkdg_clear_flag(self->_priv->statusFlags,f) #define is_password(self) ibus_chewing_engine_has_status_flag(self, ENGINE_FLAG_IS_PASSWORD) #define is_chinese(self) (chewing_get_ChiEngMode(self->icPreEdit->context)!=0) #define is_caps_lock(self) (is_caps_led_on(self->_priv->pDisplay)) #define ibus_text_is_empty(iText) ((iText==NULL) || STRING_IS_EMPTY(iText->text)) #define is_plain_chewing ibus_chewing_pre_edit_get_property_boolean(self->icPreEdit, "plain-zhuyin") #define cursor_current chewing_cursor_Current(self->icPreEdit->context) %} %privateheader{ #include "maker-dialog.h" void ibus_chewing_engine_handle_Default(IBusChewingEngine * self, guint keyval, gboolean shiftPressed); #define self_handle_Default ibus_chewing_engine_handle_Default void ibus_chewing_engine_candidate_clicked(IBusEngine * engine, guint index, guint button, guint state); void ibus_chewing_engine_property_activate(IBusEngine * engine, const gchar * prop_name, guint prop_state); void ibus_chewing_engine_set_content_type(IBusEngine * engine, guint purpose, guint hints); void refresh_pre_edit_text(IBusChewingEngine * self); void update_pre_edit_text(IBusChewingEngine * self); void refresh_aux_text(IBusChewingEngine * self); void update_aux_text(IBusChewingEngine * self); void update_lookup_table(IBusChewingEngine * self); void refresh_outgoing_text(IBusChewingEngine * self); void commit_text(IBusChewingEngine * self); %} %{ extern gint ibus_chewing_verbose; #define IBUS_CHEWING_MAIN #include "IBusConfigBackend.h" %} class IBus:Chewing:Engine from IBus:Engine { public IBusChewingPreEdit *icPreEdit= NULL destroywith ibus_chewing_pre_edit_free; public GtkWidget *sDialog=NULL; /** * preEditText: text in pre-edit buffer. * * When IN_APPLICATION: Shows pre-edit string. * When IN_CANDIDATE: content of pre-edit is hidden, * the content is visiable in auxiliary field. * * This variable is not update until next "update" event, * so it can be used in integration test. */ public IBusText *preEditText=NULL; /** * auxText: text to be displayed in auxiliary candidate window. * If PLAIN CHEWING * When IN_APPLICATION: show chewing_aux_string * When IN_CANDIDATE: show the preedit * * This variable is not update until next "update" event, * so it can be used in integration test. */ public IBusText *auxText=NULL; /** * outgoingText: text to be committed to engine. * * This variable is not update until next "update" event, * so it can be used in integration test. */ public IBusText *outgoingText=NULL; /* Controlling flags */ /* Log file */ protected FILE *logFile = NULL; /* Indicate the string is outgoing to avoid update() set * NEED_COMMIT status * again when focus in event is trigger, * because the last key is Return key * and libchewing is still Commit state. */ private EngineFlag statusFlags = 0; private ChewingInputStyle inputStyle; public IBusProperty *chieng_prop = { g_object_ref_sink(ibus_property_new ("InputMode", PROP_TYPE_NORMAL, SELF_GET_CLASS(self)->chieng_prop_label_chi, NULL, SELF_GET_CLASS(self)->chieng_prop_tooltip_chi, TRUE, TRUE, PROP_STATE_UNCHECKED, NULL)) } destroywith g_object_unref; public IBusProperty *alnumSize_prop = { g_object_ref_sink(ibus_property_new ("chewing_alnumSize_prop", PROP_TYPE_NORMAL, SELF_GET_CLASS(self)->alnumSize_prop_label_half, NULL, NULL, TRUE, TRUE, PROP_STATE_UNCHECKED, NULL)) } destroywith g_object_unref; public IBusPropList *prop_list = { g_object_ref_sink(ibus_prop_list_new()) } destroywith g_object_unref; protected IBusKeymap *keymap_us = { ibus_keymap_get("us") }; private Display *pDisplay = { XOpenDisplay(NULL) } destroywith XCloseDisplay; classwide IBusText *chieng_prop_label_chi = { g_object_ref_sink(ibus_text_new_from_static_string(_("Chi"))) }; classwide IBusText *chieng_prop_label_eng = { g_object_ref_sink(ibus_text_new_from_static_string(_("Eng"))) }; classwide IBusText *chieng_prop_tooltip_chi = { g_object_ref_sink(ibus_text_new_from_static_string (_("Click to switch to English"))) }; classwide IBusText *chieng_prop_tooltip_eng = { g_object_ref_sink(ibus_text_new_from_static_string (_("Click to switch to Chinese"))) }; classwide IBusText *chieng_prop_symbol_chi = { g_object_ref_sink(ibus_text_new_from_static_string(_("中"))) }; classwide IBusText *chieng_prop_symbol_eng = { g_object_ref_sink(ibus_text_new_from_static_string(_("英"))) }; classwide IBusText *alnumSize_prop_label_full = { g_object_ref_sink(ibus_text_new_from_static_string(_("Full"))) }; classwide IBusText *alnumSize_prop_label_half = { g_object_ref_sink(ibus_text_new_from_static_string(_("Half"))) }; classwide IBusText *emptyText = { g_object_ref_sink(ibus_text_new_from_static_string("")) }; init(self) { /* initialize the object here */ IBUS_CHEWING_LOG(INFO, "init() %sinitialized", (self->_priv-> statusFlags & ENGINE_FLAG_INITIALIZED) ? "" : "un"); if (self->_priv->statusFlags & ENGINE_FLAG_INITIALIZED) { return; } IBUS_CHEWING_LOG(INFO, "init() CHEWING_DATADIR_REAL=%s", QUOTE_ME(CHEWING_DATADIR_REAL)); gchar *logFilename = getenv("IBUS_CHEWING_LOGFILE"); if (logFilename != NULL) { self->logFile = fopen(logFilename, "w+"); if (self->logFile == NULL) { IBUS_CHEWING_LOG(WARN, "init() Cannot write to logfile %s, ignored", logFilename); }else{ mkdg_log_set_file(self->logFile); } } /* init properties */ ibus_prop_list_append(self->prop_list, self->chieng_prop); ibus_prop_list_append(self->prop_list, self->alnumSize_prop); ibus_chewing_engine_set_status_flag(self, ENGINE_FLAG_INITIALIZED); self_use_setting(self); IBUS_CHEWING_LOG(DEBUG, "init() Done"); } class_init(klass) { ibus_engine_class->property_activate = ibus_chewing_engine_property_activate; ibus_engine_class->process_key_event = ibus_chewing_engine_process_key_event; ibus_engine_class->candidate_clicked = ibus_chewing_engine_candidate_clicked; #if IBUS_CHECK_VERSION(1, 5, 4) ibus_engine_class->set_content_type = ibus_chewing_engine_set_content_type; #endif } protected void use_setting(self) { IBUS_CHEWING_LOG(INFO, "use_setting()"); if (self->icPreEdit == NULL){ #ifdef GSETTINGS_SUPPORT MkdgBackend *backend = mkdg_g_settings_backend_new(QUOTE_ME(PROJECT_SCHEMA_ID), QUOTE_ME(PROJECT_SCHEMA_DIR), NULL); #elif GCONF2_SUPPORT MkdgBackend *backend = gconf2_backend_new("/desktop/ibus/engine", NULL); #else MkdgBackend *backend = NULL; g_error("Flag GSETTINGS_SUPPORT or GCONF2_SUPPORT are required!"); return 1; #endif /* GSETTINGS_SUPPORT */ self->icPreEdit = ibus_chewing_pre_edit_new(backend); } ibus_chewing_pre_edit_use_all_configure(self->icPreEdit); /* Input style */ if(ibus_chewing_properties_read_boolean_general(self->icPreEdit->iProperties, "ibus/general", "embed-preedit-text", NULL)){ self->_priv->inputStyle=CHEWING_INPUT_STYLE_IN_APPLICATION; }else{ self->_priv->inputStyle=CHEWING_INPUT_STYLE_IN_CANDIDATE; } } protected void restore_mode(self) { if (ibus_chewing_pre_edit_has_flag(self->icPreEdit, FLAG_SYNC_FROM_IM)){ if (is_chinese(self) == is_caps_lock(self)) { /* ChiEng mode does not agree each other */ set_caps_led(!is_chinese(self), self->_priv->pDisplay); } }else if (ibus_chewing_pre_edit_has_flag(self->icPreEdit, FLAG_SYNC_FROM_KEYBOARD)){ chewing_set_ChiEngMode(self->icPreEdit->context, (is_caps_lock(self))? 0: CHINESE_MODE ); } self_refresh_property(self, "InputMode"); } protected void update(self) { IBUS_CHEWING_LOG(DEBUG, "update() statusFlags=%x", self->_priv->statusFlags); update_pre_edit_text(self); update_aux_text(self); commit_text(self); IBUS_CHEWING_LOG(DEBUG, "update() nPhoneSeq=%d statusFlags=%x", chewing_get_phoneSeqLen(self->icPreEdit->context), self->_priv->statusFlags); update_lookup_table(self); self_refresh_property_list(self); } protected void refresh_property(self, const gchar * prop_name) { #ifndef UNIT_TEST IBUS_CHEWING_LOG(DEBUG, "refresh_property(%s) status=%x", prop_name, self->_priv->statusFlags); if (STRING_EQUALS(prop_name, "InputMode")) { if (ibus_chewing_pre_edit_get_chi_eng_mode(self->icPreEdit)) { /* Chinese */ ibus_property_set_label(self->chieng_prop, SELF_GET_CLASS(self)-> chieng_prop_label_chi); ibus_property_set_tooltip(self->chieng_prop, SELF_GET_CLASS(self)-> chieng_prop_tooltip_chi); #if IBUS_CHECK_VERSION(1, 5, 0) ibus_property_set_symbol(self->chieng_prop, SELF_GET_CLASS(self)-> chieng_prop_symbol_chi); #endif } else { ibus_property_set_label(self->chieng_prop, SELF_GET_CLASS(self)-> chieng_prop_label_eng); ibus_property_set_tooltip(self->chieng_prop, SELF_GET_CLASS(self)-> chieng_prop_tooltip_eng); #if IBUS_CHECK_VERSION(1, 5, 0) ibus_property_set_symbol(self->chieng_prop, SELF_GET_CLASS(self)-> chieng_prop_symbol_eng); #endif } if (self->_priv-> statusFlags & ENGINE_FLAG_PROPERTIES_REGISTERED) ibus_engine_update_property(IBUS_ENGINE(self), self->chieng_prop); } else if (STRING_EQUALS(prop_name, "chewing_alnumSize_prop")) { if (chewing_get_ShapeMode(self->icPreEdit->context)) { /* Full-Sized Shape */ ibus_property_set_label(self->alnumSize_prop, SELF_GET_CLASS(self)-> alnumSize_prop_label_full); } else { /* Half-Sized Shape */ ibus_property_set_label(self->alnumSize_prop, SELF_GET_CLASS(self)-> alnumSize_prop_label_half); } if (self->_priv-> statusFlags & ENGINE_FLAG_PROPERTIES_REGISTERED) ibus_engine_update_property(IBUS_ENGINE(self), self->alnumSize_prop); } #endif } /** * refresh_property_list: * @self: this instances. * * Refresh the property list (language bar). */ public void refresh_property_list(self) { #ifndef UNIT_TEST self_refresh_property(self, "InputMode"); self_refresh_property(self, "chewing_alnumSize_prop"); if (! (self->_priv-> statusFlags & ENGINE_FLAG_PROPERTIES_REGISTERED)) { IBUS_ENGINE_GET_CLASS(self)->property_show(IBUS_ENGINE(self), "InputMode"); IBUS_ENGINE_GET_CLASS(self)->property_show(IBUS_ENGINE(self), "chewing_alnumSize_prop"); ibus_engine_register_properties(IBUS_ENGINE(self), self->prop_list); ibus_chewing_engine_set_status_flag(self, ENGINE_FLAG_PROPERTIES_REGISTERED); } #endif } /** * hide_property_list: * @self: this instances. * * Hide the property list (language bar). */ public void hide_property_list(self) { #ifndef UNIT_TEST // IBUS_ENGINE_GET_CLASS(self)->property_hide(IBUS_ENGINE(self), // "InputMode"); IBUS_ENGINE_GET_CLASS(self)->property_hide(IBUS_ENGINE(self), "chewing_alnumSize_prop"); #endif } private IBusProperty *get_ibus_property_by_name(self, const gchar * prop_name) { if (STRING_EQUALS(prop_name, "InputMode")) { return self->chieng_prop; } else if (STRING_EQUALS(prop_name, "chewing_alnumSize_prop")) { return self->alnumSize_prop; } IBUS_CHEWING_LOG(MSG, "get_ibus_property_by_name(%s): NULL is returned", prop_name); return NULL; } /*============================================ * Overridden Parent (IBusEngine) methods */ override(IBus:Engine) void reset(IBus:Engine * engine) { Self *self = SELF(engine); ibus_chewing_engine_reset(self); } override(IBus:Engine) void page_up(IBus:Engine * engine) { Self *self = SELF(engine); if (is_password(self)) return; ibus_chewing_pre_edit_process_key(self->icPreEdit, IBUS_KEY_Page_Up, 0); self_update(self); } override(IBus:Engine) void page_down(IBus:Engine * engine) { Self *self = SELF(engine); if (is_password(self)) return; ibus_chewing_pre_edit_process_key(self->icPreEdit, IBUS_KEY_Page_Down, 0); self_update(self); } override(IBus:Engine) void cursor_up(IBus:Engine * engine) { Self *self = SELF(engine); if (is_password(self)) return; ibus_chewing_pre_edit_process_key(self->icPreEdit, IBUS_KEY_Up, 0); self_update(self); } override(IBus:Engine) void cursor_down(IBus:Engine * engine) { Self *self = SELF(engine); if (is_password(self)) return; ibus_chewing_pre_edit_process_key(self->icPreEdit, IBUS_KEY_Down, 0); self_update(self); } override(IBus:Engine) void enable(IBus:Engine * engine) { Self *self = SELF(engine); ibus_chewing_engine_enable(self); } override(IBus:Engine) void disable(IBus:Engine * engine) { Self *self = SELF(engine); ibus_chewing_engine_disable(self); } override(IBus:Engine) void focus_in(IBus:Engine * engine) { Self *self = SELF(engine); ibus_chewing_engine_focus_in(self); } override(IBus:Engine) void focus_out(IBus:Engine * engine) { Self *self = SELF(engine); ibus_chewing_engine_focus_out(self); } override(IBus:Engine) void set_capabilities(IBus:Engine * engine, guint caps) { Self *self = SELF(engine); self->_priv->statusFlags %= ENGINE_FLAG_CAP_PREEDIT_TEXT; self->_priv->statusFlags |= caps * ENGINE_FLAG_CAP_PREEDIT_TEXT; IBUS_CHEWING_LOG(MSG, "***** set_capabilities(%x): statusFlags=%x", caps, self->_priv->statusFlags); } override(IBus:Engine) void property_show(IBus:Engine * engine, const gchar * prop_name) { IBUS_CHEWING_LOG(INFO, "property_show(-, %s)", prop_name); Self *self = SELF(engine); IBusProperty *prop = self_get_ibus_property_by_name(self, prop_name); ibus_property_set_visible(prop, TRUE); } override(IBus:Engine) void property_hide(IBus:Engine * engine, const gchar * prop_name) { IBUS_CHEWING_LOG(INFO, "property_hide(-, %s)", prop_name); Self *self = SELF(engine); IBusProperty *prop = self_get_ibus_property_by_name(self, prop_name); ibus_property_set_visible(prop, FALSE); } } %h{ void ibus_chewing_engine_reset(IBusChewingEngine *self); void ibus_chewing_engine_enable(IBusChewingEngine *self); void ibus_chewing_engine_disable(IBusChewingEngine *self); void ibus_chewing_engine_focus_in(IBusChewingEngine *self); void ibus_chewing_engine_focus_out(IBusChewingEngine *self); gboolean ibus_chewing_engine_process_key_event(IBusEngine *self, guint key_sym, guint keycode, guint modifiers); %} %{ #include "IBusChewingEngine-signal.c" #include "IBusChewingEngine-input-events.c" %} ibus-chewing-1.4.14/src/IBusChewingLookupTable.c000066400000000000000000000046351244356534300214520ustar00rootroot00000000000000#include "IBusChewingUtil.h" #include "IBusChewingLookupTable.h" IBusLookupTable *ibus_chewing_lookup_table_new(IBusChewingProperties * iProperties, ChewingContext * context) { guint size = mkdg_properties_get_uint_by_key (iProperties->properties, "cand-per-page"); gboolean cursorShow = FALSE; gboolean wrapAround = TRUE; IBusLookupTable *iTable = ibus_lookup_table_new (size, 0, cursorShow, wrapAround); ibus_chewing_lookup_table_resize(iTable, iProperties, context); return g_object_ref_sink(iTable); } void ibus_chewing_lookup_table_resize(IBusLookupTable * iTable, IBusChewingProperties * iProperties, ChewingContext * context) { gint selKSym[MAX_SELKEY]; const gchar *selKeyStr = mkdg_properties_get_string_by_key(iProperties->properties, "sel-keys"); guint candPerPage = mkdg_properties_get_uint_by_key(iProperties->properties, "cand-per-page"); int len = MIN(strlen(selKeyStr), MAX_SELKEY); len = MIN(len, candPerPage); IBusText *iText; int i; if (iTable != NULL) { ibus_lookup_table_clear(iTable); for (i = 0; i < len; i++) { selKSym[i] = (gint) selKeyStr[i]; iText = g_object_ref_sink(ibus_text_new_from_unichar ((gunichar) selKeyStr[i])); ibus_lookup_table_set_label(iTable, i, iText); } } chewing_set_candPerPage(context, len); chewing_set_selKey(context, selKSym, len); } guint ibus_chewing_lookup_table_update(IBusLookupTable * iTable, IBusChewingProperties * iProperties, ChewingContext * context) { ibus_chewing_lookup_table_resize(iTable, iProperties, context); IBusText *iText = NULL; guint i; gint choicePerPage = chewing_cand_ChoicePerPage(context); gint totalChoice = chewing_cand_TotalChoice(context); gint currentPage = chewing_cand_CurrentPage(context); IBUS_CHEWING_LOG(INFO, "***** ibus_chewing_lookup_table_update(): choicePerPage=%d, totalChoice=%d, currentPage=%d", choicePerPage, totalChoice, currentPage); chewing_cand_Enumerate(context); for (i = 0; i < choicePerPage; i++) { if (chewing_cand_hasNext(context)) { gchar *candidate = chewing_cand_String(context); iText = g_object_ref_sink(ibus_text_new_from_string(candidate)); ibus_lookup_table_append_candidate(iTable, iText); g_free(candidate); g_object_unref(iText); } else { break; } } return i; } ibus-chewing-1.4.14/src/IBusChewingLookupTable.h000066400000000000000000000033621244356534300214530ustar00rootroot00000000000000/* * Copyright © 2014 Red Hat, Inc. All rights reserved. * Copyright © 2014 Ding-Yi Chen * * This file is part of the ibus-chewing Project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** * SECTION:IBusChewingLookupTable * @short_description: Lookup table for ibus-chewing * @title: IBusChewingLookupTable * @stability: Stable * @include: IbusChewingLookupTable.h * * IBusChewingLookup provides subroutines for manipulate * IBusLookupTable. */ #ifndef _IBUS_CHEWING_LOOKUP_TABLE_H_ #define _IBUS_CHEWING_LOOKUP_TABLE_H_ #include #include #include "IBusChewingProperties.h" IBusLookupTable *ibus_chewing_lookup_table_new(IBusChewingProperties * iProperties, ChewingContext * context); void ibus_chewing_lookup_table_resize(IBusLookupTable * iTable, IBusChewingProperties * iProperties, ChewingContext * context); guint ibus_chewing_lookup_table_update(IBusLookupTable * iTable, IBusChewingProperties * iProperties, ChewingContext * context); #endif /* _IBUS_CHEWING_LOOKUP_TABLE_H_ */ ibus-chewing-1.4.14/src/IBusChewingPreEdit.c000066400000000000000000000561501244356534300205640ustar00rootroot00000000000000#include #include #include "IBusChewingUtil.h" #include "IBusChewingProperties.h" #include "IBusChewingPreEdit.h" #define is_plain_zhuyin ibus_chewing_pre_edit_get_property_boolean(self, "plain-zhuyin") #define bpmf_check ibus_chewing_bopomofo_check(self->context) #define table_is_showing ibus_chewing_pre_edit_has_flag(self,FLAG_TABLE_SHOW) #define cursor_current chewing_cursor_Current(self->context) #define total_choice chewing_cand_TotalChoice(self->context) /************************************** * Methods */ IBusChewingPreEdit *ibus_chewing_pre_edit_new(MkdgBackend * backend) { IBusChewingPreEdit *self = g_new0(IBusChewingPreEdit, 1); self->iProperties = ibus_chewing_properties_new(backend, self, NULL); self->preEdit = g_string_sized_new(IBUS_CHEWING_MAX_BYTES); self->outgoing = g_string_sized_new(IBUS_CHEWING_MAX_BYTES); self->keyLast = 0; self->bpmfLen = 0; self->wordLen = 0; /* Create chewing context */ gchar buf[100]; g_snprintf(buf, 100, "%s/.chewing", getenv("HOME")); #if !CHEWING_CHECK_VERSION(0,4,0) gint ret = chewing_Init(QUOTE_ME(CHEWING_DATADIR_REAL), buf); if (ret) { IBUS_CHEWING_LOG(ERROR, "ibus_chewing_pre_edit_new() chewing_Init(%s,%s)", QUOTE_ME(CHEWING_DATADIR_REAL), buf); } #endif self->context = chewing_new(); chewing_set_ChiEngMode(self->context, CHINESE_MODE); ibus_chewing_pre_edit_use_all_configure(self); self->iTable = g_object_ref_sink(ibus_chewing_lookup_table_new (self->iProperties, self->context)); return self; } void ibus_chewing_pre_edit_free(IBusChewingPreEdit * self) { /* properties need not be freed here */ chewing_delete(self->context); g_string_free(self->preEdit, TRUE); g_string_free(self->outgoing, TRUE); ibus_lookup_table_clear(self->iTable); g_object_unref(self->iTable); g_free(self); } void ibus_chewing_pre_edit_use_all_configure(IBusChewingPreEdit * self) { mkdg_properties_use_all(self->iProperties->properties, NULL); } void ibus_chewing_pre_edit_update_outgoing(IBusChewingPreEdit * self) { if (ibus_chewing_pre_edit_has_flag(self, FLAG_UPDATED_OUTGOING)) { /* Commit already sent to outgoing, no need to update again */ return; } if (chewing_commit_Check(self->context)) { /* commit_Check=1 means new commit available */ gchar *commitStr = chewing_commit_String(self->context); printf("### commitStr=|%s|\n", commitStr); g_string_append(self->outgoing, commitStr); g_free(commitStr); ibus_chewing_pre_edit_set_flag(self, FLAG_UPDATED_OUTGOING); } printf("### outgoing=|%s|\n", self->outgoing->str); IBUS_CHEWING_LOG(DEBUG, "ibus_chewing_pre_edit_update_outgoing(-): return: outgoing=|%s|", self->outgoing->str); } void ibus_chewing_pre_edit_update(IBusChewingPreEdit * self) { IBUS_CHEWING_LOG(MSG, "* ibus_chewing_pre_edit_update(-)"); /* Make preEdit */ gchar *bufferStr = chewing_buffer_String(self->context); gint count; gchar *bpmfStr = ibus_chewing_bopomofo_string(self->context, &count); self->bpmfLen = count; g_string_assign(self->preEdit, ""); gint i; gchar *cP = bufferStr; gunichar uniCh; IBUS_CHEWING_LOG(INFO, "* ibus_chewing_pre_edit_update(-) bufferStr=|%s|, bpmfStr=|%s| count=%d cursor=%d", bufferStr, bpmfStr, count, cursor_current); for (i = 0; i < chewing_buffer_Len(self->context) && cP != NULL; i++) { if (i == cursor_current) { /* Insert bopomofo string */ g_string_append(self->preEdit, bpmfStr); } uniCh = g_utf8_get_char(cP); g_string_append_unichar(self->preEdit, uniCh); cP = g_utf8_next_char(cP); } if (chewing_buffer_Len(self->context) <= cursor_current) { g_string_append(self->preEdit, bpmfStr); } self->wordLen = i + count; g_free(bufferStr); g_free(bpmfStr); ibus_chewing_pre_edit_update_outgoing(self); } guint ibus_chewing_pre_edit_length(IBusChewingPreEdit * self) { return self->preEdit->len; } guint ibus_chewing_pre_edit_word_length(IBusChewingPreEdit * self) { return self->wordLen; } guint ibus_chewing_pre_edit_word_limit(IBusChewingPreEdit * self) { return chewing_get_maxChiSymbolLen(self->context); } gchar *ibus_chewing_pre_edit_get_pre_edit(IBusChewingPreEdit * self) { return self->preEdit->str; } gchar *ibus_chewing_pre_edit_get_outgoing(IBusChewingPreEdit * self) { return self->outgoing->str; } /* force_commit is run when receiving IGNORE event */ void ibus_chewing_pre_edit_force_commit(IBusChewingPreEdit * self) { IBUS_CHEWING_LOG(INFO, "ibus_chewing_pre_edit_force_commit(-) bpmf_check=%d buffer_check=%d", bpmf_check, chewing_buffer_Check(self->context)); /* Ignore the context and * Commit whatever in preedit buffer * TODO: an option to control this behavior */ g_string_append(self->outgoing, self->preEdit->str); ibus_chewing_pre_edit_clear_pre_edit(self); ibus_chewing_pre_edit_update(self); } void ibus_chewing_pre_edit_clear(IBusChewingPreEdit * self) { IBUS_CHEWING_LOG(INFO, "ibus_chewing_pre_edit_clear(-)"); ibus_chewing_pre_edit_clear_pre_edit(self); ibus_chewing_pre_edit_clear_outgoing(self); ibus_chewing_pre_edit_update(self); } void ibus_chewing_pre_edit_clear_pre_edit(IBusChewingPreEdit * self) { IBUS_CHEWING_LOG(DEBUG, "ibus_chewing_pre_edit_clear_pre_edit(-)"); /* Clear chewing buffer */ /* Save the orig Esc clean buffer state */ gint origState = chewing_get_escCleanAllBuf(self->context); /* Send a false event, then clean it to wipe the commit */ chewing_handle_Default(self->context, '1'); chewing_set_escCleanAllBuf(self->context, TRUE); chewing_handle_Esc(self->context); chewing_set_escCleanAllBuf(self->context, origState); ibus_chewing_pre_edit_clear_flag(self, FLAG_UPDATED_OUTGOING); } void ibus_chewing_pre_edit_clear_outgoing(IBusChewingPreEdit * self) { IBUS_CHEWING_LOG(DEBUG, "ibus_chewing_pre_edit_clear_outgoing(-)"); g_string_assign(self->outgoing, ""); } #define is_chinese (chewing_get_ChiEngMode(self->context)!=0) #define is_full_shape (chewing_get_ShapeMode(self->context)!=0) gboolean ibus_chewing_pre_edit_get_chi_eng_mode(IBusChewingPreEdit * self) { return is_chinese; } void ibus_chewing_pre_edit_toggle_chi_eng_mode(IBusChewingPreEdit * self) { /* When Chi->Eng with incomplete character */ if (is_chinese && bpmf_check) { ibus_chewing_pre_edit_force_commit(self); } chewing_set_ChiEngMode(self->context, !is_chinese); } void ibus_chewing_pre_edit_toggle_full_half(IBusChewingPreEdit * self) { /* When Chi->Eng with incomplete character */ if (is_chinese && bpmf_check) { ibus_chewing_pre_edit_force_commit(self); } chewing_set_ShapeMode(self->context, !is_full_shape); } /************************************** * ibus_chewing_pre_edit key processing */ #define modifiers_mask(unmaskedMod) unmaskedMod & (IBUS_SHIFT_MASK | IBUS_CONTROL_MASK | IBUS_MOD1_MASK) #define event_is_released(unmaskedMod) ((unmaskedMod & IBUS_RELEASE_MASK) !=0 ) #define is_shift_only (maskedMod == IBUS_SHIFT_MASK) #define is_shift (unmaskedMod & IBUS_SHIFT_MASK) #define is_ctrl_only (maskedMod == IBUS_CONTROL_MASK) #define buffer_is_empty (ibus_chewing_pre_edit_is_empty(self)) #define filter_modifiers(mask) KeyModifiers maskedMod = modifiers_mask(unmaskedMod); \ if (maskedMod & (~mask)){ return EVENT_RESPONSE_IGNORE; } \ if (maskedMod == (IBUS_SHIFT_MASK | IBUS_CONTROL_MASK)){ return EVENT_RESPONSE_IGNORE; } #define absorb_when_release if (event_is_released(unmaskedMod)){ return EVENT_RESPONSE_ABSORB; } #define ignore_when_buffer_is_empty if (buffer_is_empty) { return EVENT_RESPONSE_IGNORE;} #define event_process_or_ignore(cond) (cond) ? EVENT_RESPONSE_PROCESS: EVENT_RESPONSE_IGNORE #define handle_log(funcName) IBUS_CHEWING_LOG(INFO, "* self_handle_%s(-,%x(%s),%x(%s))", funcName, kSym, key_sym_get_name(kSym), unmaskedMod, modifiers_to_string(unmaskedMod)); EventResponse self_handle_key_sym_default(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(IBUS_SHIFT_MASK); handle_log("key_sym_default"); /* Seem like we need to disable easy symbol temporarily * otherwise the key won't process */ gint easySymbolInput = chewing_get_easySymbolInput(self->context); if (maskedMod != IBUS_SHIFT_MASK) { chewing_set_easySymbolInput(self->context, 0); } EventResponse response = EVENT_RESPONSE_UNDECIDED; if (!is_chinese && !is_full_shape && ibus_chewing_pre_edit_get_property_boolean(self, "force-lowercase-english")) { /* English mode and force-lower-case-engligh=TRUE */ if (isupper(kSym) && !is_shift_only) { kSym = tolower(kSym); } else if (islower(kSym) && is_shift_only) { kSym = toupper(kSym); } } gint ret = chewing_handle_Default(self->context, kSym); /* Handle quick commit */ ibus_chewing_pre_edit_clear_flag(self, FLAG_UPDATED_OUTGOING); ibus_chewing_pre_edit_update_outgoing(self); switch (ret) { case 0: case KEYSTROKE_COMMIT: response = EVENT_RESPONSE_PROCESS; break; case KEYSTROKE_ABSORB: response = EVENT_RESPONSE_ABSORB; break; case KEYSTROKE_IGNORE: response = EVENT_RESPONSE_IGNORE; break; default: break; } IBUS_CHEWING_LOG(DEBUG, "self_handle_key_sym_default() ret=%d response=%d", ret, response); /* Restore easySymbolInput */ chewing_set_easySymbolInput(self->context, easySymbolInput); return response; } /* Return FALSE if the key should not be processed with input method */ EventResponse self_handle_num(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(IBUS_SHIFT_MASK | IBUS_CONTROL_MASK); absorb_when_release; handle_log("num"); if (is_ctrl_only) { return event_process_or_ignore(!chewing_handle_CtrlNum (self->context, kSym)); } /* maskedMod= 0 */ return self_handle_key_sym_default(self, kSym, unmaskedMod); } EventResponse self_handle_num_keypad(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(IBUS_SHIFT_MASK | IBUS_CONTROL_MASK); absorb_when_release; handle_log("num_keypad"); if ((maskedMod != 0) && (!is_shift_only) && (!is_ctrl_only)) { return EVENT_RESPONSE_IGNORE; } KSym kSymFinal = kSym; KSym kSymEquiv = key_sym_KP_to_normal(kSym); gboolean numpadIsAlwaysNum = ibus_chewing_pre_edit_get_property_boolean(self, "numpad-always-number"); if (numpadIsAlwaysNum) { kSymFinal = kSymEquiv; } if (is_ctrl_only) { return event_process_or_ignore(!chewing_handle_CtrlNum (self->context, kSymFinal)); } /* maskedMod= 0 */ return self_handle_key_sym_default(self, kSym, unmaskedMod); } EventResponse self_handle_caps_lock(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(0); absorb_when_release; handle_log("caps_lock"); /* When Chi->Eng with incomplete character */ if (is_chinese && bpmf_check) { ibus_chewing_pre_edit_force_commit(self); } return event_process_or_ignore(!chewing_handle_Capslock(self->context)); } EventResponse self_handle_shift(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(IBUS_SHIFT_MASK); handle_log("shift"); gboolean shiftIsToggleChinese = ibus_chewing_pre_edit_get_property_boolean(self, "shift-toggle-chinese"); if (!shiftIsToggleChinese) { return EVENT_RESPONSE_IGNORE; } if (!event_is_released(unmaskedMod)) { return EVENT_RESPONSE_ABSORB; } /* keyLast != Shift means Shift is just part of combination, * thus should not be recognized as single Shift key */ if (self->keyLast != IBUS_KEY_Shift_L && self->keyLast != IBUS_KEY_Shift_R) { return EVENT_RESPONSE_ABSORB; } ibus_chewing_pre_edit_toggle_chi_eng_mode(self); return EVENT_RESPONSE_ABSORB; } EventResponse self_handle_space(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(IBUS_SHIFT_MASK | IBUS_CONTROL_MASK); absorb_when_release; handle_log("space"); if (is_shift_only) { ibus_chewing_pre_edit_toggle_full_half(self); return EVENT_RESPONSE_PROCESS; } gint easySymbolInput = chewing_get_easySymbolInput(self->context); /** * Fix for space in Temporary English mode. */ if (!is_shift_only) { /* fixed #33 first space wouldn't be outgoing */ chewing_set_easySymbolInput(self->context, 0); } EventResponse response = event_process_or_ignore(!chewing_handle_Space(self->context)); /* Handle quick commit */ ibus_chewing_pre_edit_clear_flag(self, FLAG_UPDATED_OUTGOING); ibus_chewing_pre_edit_update_outgoing(self); chewing_set_easySymbolInput(self->context, easySymbolInput); return response; } EventResponse self_handle_return(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(0); absorb_when_release; ignore_when_buffer_is_empty; handle_log("return"); EventResponse response = event_process_or_ignore(!chewing_handle_Enter(self->context)); /* Handle quick commit */ ibus_chewing_pre_edit_clear_flag(self, FLAG_UPDATED_OUTGOING); ibus_chewing_pre_edit_update_outgoing(self); return response; } EventResponse self_handle_backspace(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(0); absorb_when_release; ignore_when_buffer_is_empty; handle_log("backspace"); return event_process_or_ignore(!chewing_handle_Backspace(self->context)); } EventResponse self_handle_delete(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(0); absorb_when_release; ignore_when_buffer_is_empty; handle_log("delete"); return event_process_or_ignore(!chewing_handle_Del(self->context)); } EventResponse self_handle_escape(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(0); absorb_when_release; ignore_when_buffer_is_empty; handle_log("escape"); return event_process_or_ignore(!chewing_handle_Esc(self->context)); } EventResponse self_handle_left(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(IBUS_SHIFT_MASK); absorb_when_release; ignore_when_buffer_is_empty; handle_log("left"); if (is_shift_only) { return event_process_or_ignore(!chewing_handle_ShiftLeft (self->context)); } return event_process_or_ignore(!chewing_handle_Left(self->context)); } EventResponse self_handle_up(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(0); absorb_when_release; ignore_when_buffer_is_empty; handle_log("up"); return event_process_or_ignore(!chewing_handle_Up(self->context)); } EventResponse self_handle_right(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(IBUS_SHIFT_MASK); absorb_when_release; ignore_when_buffer_is_empty; handle_log("right"); if (is_shift_only) { return event_process_or_ignore(!chewing_handle_ShiftRight (self->context)); } return event_process_or_ignore(!chewing_handle_Right(self->context)); } EventResponse self_handle_down(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(0); absorb_when_release; ignore_when_buffer_is_empty; handle_log("down"); return event_process_or_ignore(!chewing_handle_Down(self->context)); } EventResponse self_handle_page_up(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(0); absorb_when_release; ignore_when_buffer_is_empty; handle_log("page_up"); return event_process_or_ignore(!chewing_handle_PageUp(self->context)); } EventResponse self_handle_page_down(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(0); absorb_when_release; ignore_when_buffer_is_empty; handle_log("page_down"); return event_process_or_ignore(!chewing_handle_PageDown(self->context)); } EventResponse self_handle_tab(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(0); absorb_when_release; ignore_when_buffer_is_empty; handle_log("tab"); return event_process_or_ignore(!chewing_handle_Tab(self->context)); } EventResponse self_handle_home(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(0); absorb_when_release; ignore_when_buffer_is_empty; handle_log("home"); return event_process_or_ignore(!chewing_handle_Home(self->context)); } EventResponse self_handle_end(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(0); absorb_when_release; ignore_when_buffer_is_empty; handle_log("end"); return event_process_or_ignore(!chewing_handle_End(self->context)); } EventResponse self_handle_special(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { /* KSym >=128 is special key, which IM ignore. */ return EVENT_RESPONSE_IGNORE; } EventResponse self_handle_default(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { filter_modifiers(IBUS_SHIFT_MASK); absorb_when_release; handle_log("default"); return self_handle_key_sym_default(self, kSym, unmaskedMod); } KeyHandlingRule keyHandlingRules[] = { {IBUS_KEY_0, IBUS_KEY_9, self_handle_num} , {IBUS_KEY_KP_0, IBUS_KEY_KP_9, self_handle_num_keypad} , {IBUS_KEY_Caps_Lock, IBUS_KEY_Caps_Lock, self_handle_caps_lock} , {IBUS_KEY_Shift_L, IBUS_KEY_Shift_R, self_handle_shift} , {IBUS_KEY_space, IBUS_KEY_space, self_handle_space} , {IBUS_KEY_Return, IBUS_KEY_Return, self_handle_return} , {IBUS_KEY_KP_Enter, IBUS_KEY_KP_Enter, self_handle_return} , {IBUS_KEY_BackSpace, IBUS_KEY_BackSpace, self_handle_backspace} , {IBUS_KEY_Delete, IBUS_KEY_Delete, self_handle_delete} , {IBUS_KEY_Escape, IBUS_KEY_Escape, self_handle_escape} , {IBUS_KEY_Left, IBUS_KEY_Left, self_handle_left} , {IBUS_KEY_KP_Left, IBUS_KEY_KP_Left, self_handle_left} , {IBUS_KEY_Up, IBUS_KEY_Up, self_handle_up} , {IBUS_KEY_KP_Up, IBUS_KEY_KP_Up, self_handle_up} , {IBUS_KEY_Right, IBUS_KEY_Right, self_handle_right} , {IBUS_KEY_KP_Right, IBUS_KEY_KP_Right, self_handle_right} , {IBUS_KEY_Down, IBUS_KEY_Down, self_handle_down} , {IBUS_KEY_KP_Down, IBUS_KEY_KP_Down, self_handle_down} , {IBUS_KEY_Page_Up, IBUS_KEY_Page_Up, self_handle_page_up} , {IBUS_KEY_KP_Page_Up, IBUS_KEY_KP_Page_Up, self_handle_page_up} , {IBUS_KEY_Page_Down, IBUS_KEY_Page_Down, self_handle_page_down} , {IBUS_KEY_KP_Page_Down, IBUS_KEY_KP_Page_Down, self_handle_page_down} , {IBUS_KEY_Tab, IBUS_KEY_Tab, self_handle_tab} , {IBUS_KEY_Home, IBUS_KEY_Home, self_handle_home} , {IBUS_KEY_KP_Home, IBUS_KEY_KP_Home, self_handle_home} , {IBUS_KEY_End, IBUS_KEY_Home, self_handle_end} , {IBUS_KEY_KP_End, IBUS_KEY_KP_End, self_handle_end} , {128, G_MAXUINT, self_handle_special} , {0, 0, self_handle_default} , }; static KeyHandlingRule *self_key_sym_find_key_handling_rule(KSym kSym) { gint i; for (i = 0; keyHandlingRules[i].kSymLower != 0; i++) { if ((keyHandlingRules[i].kSymLower <= kSym) && (kSym <= keyHandlingRules[i].kSymUpper)) { return &(keyHandlingRules[i]); } } return &(keyHandlingRules[i]); } #define handle_key(kSym, unmaskedMod) (self_key_sym_find_key_handling_rule(kSym))->keyFunc(self, kSym, unmaskedMod) #define process_key_debug(prompt) IBUS_CHEWING_LOG(DEBUG, "ibus_chewing_pre_edit_process_key(): %s flags=%x buff_check=%d bpmf_check=%d cursor=%d total_choice=%d is_chinese=%d is_full_shape=%d is_plain_zhuyin=%d" ,\ prompt, self->flags, chewing_buffer_Check(self->context),\ bpmf_check, cursor_current, total_choice, is_chinese, is_full_shape, is_plain_zhuyin) /* keyCode should be converted to kSym already */ gboolean ibus_chewing_pre_edit_process_key (IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod) { IBUS_CHEWING_LOG(INFO, "***** ibus_chewing_pre_edit_process_key(-,%x(%s),%x(%s))", kSym, key_sym_get_name(kSym), unmaskedMod, modifiers_to_string(unmaskedMod)); process_key_debug("Before response"); gboolean bufferEmpty = (ibus_chewing_pre_edit_length(self) == 0) ? TRUE : FALSE; /* Find corresponding rule */ EventResponse response; response = handle_key(kSym, unmaskedMod); IBUS_CHEWING_LOG(DEBUG, "ibus_chewing_pre_edit_process_key() response=%x", response); process_key_debug("After response"); self->keyLast = kSym; switch (response) { case EVENT_RESPONSE_ABSORB: return TRUE; case EVENT_RESPONSE_IGNORE: /* Play conservatively, commit everything when unhandled key is received. * Use case: In gedit, press Ctrl-F to open search UI * Better to commit every thing before the search field active. */ if (!bufferEmpty) { ibus_chewing_pre_edit_force_commit(self); } return FALSE; default: break; } /** *Plain zhuyin mode */ if (is_plain_zhuyin && !bpmf_check) { /* libchewing functions are used here to skip the check * that handle_key functions perform. */ if (kSym == IBUS_KEY_Escape) { ibus_chewing_pre_edit_clear_pre_edit(self); } else if (kSym == IBUS_KEY_Return && table_is_showing) { /* Use Enter to select the last chosen */ chewing_handle_Up(self->context); chewing_handle_Enter(self->context); } else if (is_chinese && !table_is_showing) { /* Character completed, and lookup table is not show */ /* Then open lookup table */ if (is_shift) { /* For Chinese symbols */ chewing_handle_Left(self->context); } chewing_handle_Down(self->context); } else if (total_choice == 0) { /* lookup table is shown */ /* but selection is done */ chewing_handle_Enter(self->context); } } process_key_debug("After plain-zhuyin handling"); ibus_chewing_pre_edit_update(self); guint candidateCount = ibus_chewing_lookup_table_update(self->iTable, self->iProperties, self->context); IBUS_CHEWING_LOG(INFO, "ibus_chewing_pre_edit_process_key() candidateCount=%d", candidateCount); if (candidateCount) { ibus_chewing_pre_edit_set_flag(self, FLAG_TABLE_SHOW); } else { ibus_chewing_pre_edit_clear_flag(self, FLAG_TABLE_SHOW); } return TRUE; } KSym ibus_chewing_pre_edit_key_code_to_key_sym (IBusChewingPreEdit * self, KSym keySym, guint keyCode, KeyModifiers unmaskedMod) { KSym kSym = keySym; if (!chewing_get_ChiEngMode(self->context)) { /* English mode, pass as-is */ return kSym; } if (!ibus_chewing_pre_edit_is_system_keyboard_layout(self)) { /* Use en_US keyboard layout */ /* ibus_keymap_lookup_key_sym treats keycode >= 256 */ /* as IBUS_VoidSymbol */ kSym = ibus_keymap_lookup_keysym(ibus_keymap_get ("us"), keyCode, unmaskedMod); if (kSym == IBUS_VoidSymbol) { /* Restore key_sym */ kSym = keySym; } } return kSym; } ibus-chewing-1.4.14/src/IBusChewingPreEdit.h000066400000000000000000000202261244356534300205640ustar00rootroot00000000000000/* * Copyright © 2014 Red Hat, Inc. All rights reserved. * Copyright © 2014 Ding-Yi Chen * * This file is part of the ibus-chewing Project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** * SECTION:IBusChewingPreEdit * @short_description: Pre-edit string buffer. * @title: IBusChewingPreEdit * @stability: Stable * @include: IbusChewingPreedit * * IBusChewingPreEdit is core of ibus-chewing. * It processes incoming key events and manage pre-edit and outgoing buffer. * * IBusChewingEngine uses the pre-edit and outgoing buffer to show to the end user. */ #ifndef _IBUS_CHEWING_PRE_EDIT_H_ #define _IBUS_CHEWING_PRE_EDIT_H_ #include #include #include #include "MakerDialogBackend.h" #include "IBusChewingUtil.h" #include "IBusChewingLookupTable.h" #include "IBusChewingProperties.h" #define UTF8_MAX_BYTES 6 #ifndef IBUS_CHEWING_MAX_WORD #define IBUS_CHEWING_MAX_WORD 100 #endif #define IBUS_CHEWING_MAX_BYTES UTF8_MAX_BYTES * IBUS_CHEWING_MAX_WORD /** * IBusChewingPreEditFlag: * @FLAG_SYNC_FROM_IM: Sync the Chinese mode with input method * @FLAG_SYNC_FROM_KEYBOARD: Sync the Chinese mode with Caps Lock status * @FLAG_TABLE_SHOW: Lookup table is shown. * @FLAG_UPDATED_OUTGOING: The commit string is already send to outgoing, to avoid double committing. * */ typedef enum { FLAG_SYNC_FROM_IM = 1, FLAG_SYNC_FROM_KEYBOARD = 1 << 1, FLAG_TABLE_SHOW = 1 << 2, FLAG_UPDATED_OUTGOING = 1 << 3, } IBusChewingPreEditFlag; /** * IBusChewingPreEdit: * @context: chewing input context. * @preEdit: String that are not ready to be committed to engine. * @outgoing: String to be committed to engine. (Usually means completed string). * @flags: Misc flags. * @keyLast: Last effective key. * @bpmfLen: Length of bopomofo chars in unicode characters. * @wordLen: Length of preEdit in unicode characters. * * An IBusChewingPreEdit. */ typedef struct { IBusChewingProperties *iProperties; /*< public > */ ChewingContext *context; GString *preEdit; GString *outgoing; IBusKeymap *keymap; IBusLookupTable *iTable; IBusChewingPreEditFlag flags; KSym keyLast; gint bpmfLen; gint wordLen; } IBusChewingPreEdit; IBusChewingPreEdit *ibus_chewing_pre_edit_new(MkdgBackend * backend); void ibus_chewing_pre_edit_free(IBusChewingPreEdit * self); #define ibus_chewing_pre_edit_get_property(self,propertyKey) mkdg_properties_find_by_key(self->iProperties->properties, propertyKey) #define ibus_chewing_pre_edit_get_property_boolean(self,propertyKey) mkdg_properties_get_boolean_by_key(self->iProperties->properties, propertyKey) #define ibus_chewing_pre_edit_get_property_int(self,propertyKey) mkdg_properties_get_int_by_key(self->iProperties->properties, propertyKey) #define ibus_chewing_pre_edit_get_property_string(self,propertyKey) mkdg_properties_get_string_by_key(self->iProperties->properties, propertyKey) #define ibus_chewing_pre_edit_set_property_boolean(self,propertyKey,boolValue) mkdg_properties_set_boolean_by_key(self->iProperties->properties, propertyKey, boolValue) #define ibus_chewing_pre_edit_set_property_int(self,propertyKey,intValue) mkdg_properties_set_int_by_key(self->iProperties->properties, propertyKey, intValue) #define ibus_chewing_pre_edit_set_property_string(self,propertyKey,strValue) mkdg_properties_set_string_by_key(self->iProperties->properties,propertyKey,strValue) #define ibus_chewing_pre_edit_is_system_keyboard_layout(self) ibus_chewing_properties_read_boolean_general(self->iProperties, "ibus/general", "use-system-keyboard-layout", NULL) #define ibus_chewing_pre_edit_is_embed_preedit_text(self) ibus_chewing_properties_read_boolean_general(self->iProperties, "ibus/general", "embed-preedit-text", NULL) #define ibus_chewing_pre_edit_apply_property(self,propertyKey) mkdg_properties_apply_by_key(self->iProperties->properties, propertyKey, NULL) #define ibus_chewing_pre_edit_set_apply_property_boolean(self, propertyKey,boolValue) ibus_chewing_pre_edit_set_property_boolean(self,propertyKey,boolValue); ibus_chewing_pre_edit_apply_property(self,propertyKey) #define ibus_chewing_pre_edit_set_apply_property_int(self, propertyKey,intValue) ibus_chewing_pre_edit_set_property_int(self,propertyKey,intValue); ibus_chewing_pre_edit_apply_property(self,propertyKey) #define ibus_chewing_pre_edit_set_apply_property_string(self, propertyKey,stringValue) ibus_chewing_pre_edit_set_property_string(self,propertyKey,stringValue); ibus_chewing_pre_edit_apply_property(self,propertyKey) void ibus_chewing_pre_edit_use_all_configure(IBusChewingPreEdit * self); guint ibus_chewing_pre_edit_length(IBusChewingPreEdit * self); guint ibus_chewing_pre_edit_word_length(IBusChewingPreEdit * self); guint ibus_chewing_pre_edit_word_limit(IBusChewingPreEdit * self); #define ibus_chewing_pre_edit_is_empty(self) (ibus_chewing_pre_edit_length(self) ==0) #define ibus_chewing_pre_edit_is_full(self) (self->wordLen >= ibus_chewing_pre_edit_word_limit(self)) #define ibus_chewing_pre_edit_is_outgoing_empty(self) (self->outgoing->len==0) /** * ibus_chewing_pre_edit_get_pre_edit: * @self: An IBusChewingPreEdit. * @returns: Content of pre-edit buffer. * * Return the content of pre-edit buffer in UTF-8 encoded string format. * No need to free it. */ gchar *ibus_chewing_pre_edit_get_pre_edit(IBusChewingPreEdit * self); /** * ibus_chewing_pre_edit_get_outgoing: * @self: An IBusChewingPreEdit. * @returns: Content of outgoing buffer. * * Return the content of outgoing buffer in UTF-8 encoded string format. * No need to free it. */ gchar *ibus_chewing_pre_edit_get_outgoing(IBusChewingPreEdit * self); #define ibus_chewing_pre_edit_has_flag(self,f) mkdg_has_flag(self->flags,f) #define ibus_chewing_pre_edit_set_flag(self,f) mkdg_set_flag(self->flags,f) #define ibus_chewing_pre_edit_clear_flag(self,f) mkdg_clear_flag(self->flags,f) void ibus_chewing_pre_edit_force_commit(IBusChewingPreEdit * self); void ibus_chewing_pre_edit_clear(IBusChewingPreEdit * self); void ibus_chewing_pre_edit_clear_pre_edit(IBusChewingPreEdit * self); void ibus_chewing_pre_edit_clear_outgoing(IBusChewingPreEdit * self); gboolean ibus_chewing_pre_edit_get_chi_eng_mode(IBusChewingPreEdit * self); void ibus_chewing_pre_edit_toggle_chi_eng_mode(IBusChewingPreEdit * self); gboolean ibus_chewing_pre_edit_process_key(IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod); /** * ibus_chewing_pre_edit_key_code_to_key_sym: * * Convert keycode to key_sym. */ KSym ibus_chewing_pre_edit_key_code_to_key_sym(IBusChewingPreEdit * self, KSym keySym, guint keyCode, KeyModifiers unmaskedMod); /** * ibus_chewing_bopomofo_check(ChewingContext *context) * @returns: 1 if bopomofo buffer is non-empty; 0 if bopomofo buffer is empty. * */ #if CHEWING_CHECK_VERSION(0,4,0) #define ibus_chewing_bopomofo_check chewing_bopomofo_Check #else #define ibus_chewing_bopomofo_check !chewing_zuin_Check #endif #define ibus_chewing_bopomofo_string chewing_zuin_String typedef enum { EVENT_RESPONSE_PROCESS = 0, /* Event process by IM */ EVENT_RESPONSE_ABSORB, /* Event throw away by IM (e.g. Release event) */ EVENT_RESPONSE_IGNORE, /* Event that should be passed to application, but not process by IM */ EVENT_RESPONSE_UNDECIDED, } EventResponse; typedef EventResponse(*KeyHandlingFunc) (IBusChewingPreEdit * self, KSym kSym, KeyModifiers unmaskedMod); typedef struct { KSym kSymLower; KSym kSymUpper; KeyHandlingFunc keyFunc; } KeyHandlingRule; #endif /* _IBUS_CHEWING_PRE_EDIT_H_ */ ibus-chewing-1.4.14/src/IBusChewingProperties.c000066400000000000000000000207631244356534300213650ustar00rootroot00000000000000#define GETTEXT_PACKAGE "gtk20" #include #include #include "MakerDialogUtil.h" #include "MakerDialogProperty.h" #include "IBusChewingUtil.h" #include "IBusChewingProperties.h" #include "IBusConfigBackend.h" #ifdef GSETTINGS_SUPPORT #include "GSettingsBackend.h" #endif #define PAGE_EDITING N_("Editing") #define PAGE_SELECTING N_("Selecting") #define PAGE_KEYBOARD N_("Keyboard") const gchar *kbType_ids[] = { N_("default"), N_("hsu"), N_("ibm"), N_("gin_yieh"), N_("eten"), N_("eten26"), N_("dvorak"), N_("dvorak_hsu"), N_("dachen_26"), N_("hanyu"), NULL }; #define SELKEYS_ARRAY_SIZE 8 const gchar *selKeys_array[SELKEYS_ARRAY_SIZE + 1] = { "1234567890", "asdfghjkl;", "asdfzxcv89", "asdfjkl789", "aoeu;qjkix", /* Dvorak */ "aoeuhtnsid", /* Dvorak */ "aoeuidhtns", /* Dvorak */ "1234qweras", NULL }; const gchar *syncCapsLock_strs[] = { NC_("Sync", "disable"), NC_("Sync", "keyboard"), NC_("Sync", "input method"), NULL }; const gchar *outputCharsets[] = { N_("Auto"), N_("Big5"), N_("UTF8"), NULL }; MkdgPropertySpec propSpecs[] = { {G_TYPE_STRING, "kb-type", PAGE_KEYBOARD, N_("Keyboard Type"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "default", kbType_ids, NULL, 0, 0, KBType_apply_callback, MKDG_PROPERTY_FLAG_NO_NEW | MKDG_PROPERTY_FLAG_HAS_TRANSLATION, N_("Select Zhuyin keyboard layout."), } , {G_TYPE_STRING, "sel-keys", PAGE_KEYBOARD, N_("Selection keys"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "1234567890", selKeys_array, NULL, 0, 0, selKeys_apply_callback, 0, N_("Keys used to select candidate. For example \"asdfghjkl;\", press 'a' to select the 1st candidate, 's' for 2nd, and so on."), } , {G_TYPE_INT, "hsu-sel-key-type", PAGE_KEYBOARD, N_("Hsu's selection key"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "1", NULL, NULL, 1, 2, hsuSelKeyType_apply_callback, 0, N_("Hsu's keyboard selection keys, 1 for asdfjkl789, 2 for asdfzxcv89 ."), } , {G_TYPE_BOOLEAN, "auto-shift-cur", PAGE_EDITING, N_("Auto move cursor"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "1", NULL, NULL, 0, 1, autoShiftCur_apply_callback, 0, N_("Automatically move cursor to next character."), } , {G_TYPE_BOOLEAN, "add-phrase-direction", PAGE_EDITING, N_("Add phrases in front"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "1", NULL, NULL, 0, 1, addPhraseDirection_apply_callback, 0, N_("Add phrases in the front."), } , {G_TYPE_BOOLEAN, "easy-symbol-input", PAGE_EDITING, N_("Easy symbol input"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "1", NULL, NULL, 0, 1, easySymbolInput_apply_callback, 0, N_("Easy symbol input."), } , {G_TYPE_BOOLEAN, "esc-clean-all-buf", PAGE_EDITING, N_("Esc clean all buffer"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "0", NULL, NULL, 0, 1, escCleanAllBuf_apply_callback, 0, N_("Escape key cleans the text in pre-edit-buffer."), } , {G_TYPE_INT, "max-chi-symbol-len", PAGE_EDITING, N_("Maximum Chinese characters"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "20", NULL, NULL, 8, 39, maxChiSymbolLen_apply_callback, 0, N_("Maximum Chinese characters in pre-edit buffer, including inputing Zhuyin symbols"), } , {G_TYPE_BOOLEAN, "force-lowercase-english", PAGE_EDITING, N_("Force lowercase in En mode"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "0", NULL, NULL, 0, 1, forceLowercaseEnglish_apply_callback, 0, N_("Ignore CapsLock status and input lowercase by default.\n\ It is handy if you wish to enter lowercase by default.\n\ Uppercase can still be inputted with Shift."), } , /* Sync between CapsLock and IM */ {G_TYPE_STRING, "sync-caps-lock", PAGE_EDITING, N_("Sync between CapsLock and IM"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "disable", syncCapsLock_strs, "Sync", 0, 1, syncCapsLock_apply_callback, MKDG_PROPERTY_FLAG_NO_NEW | MKDG_PROPERTY_FLAG_HAS_TRANSLATION, N_("Occasionally, the CapsLock status does not match the IM, this option determines how these status be synchronized. Valid values:\n\ \"disable\": Do nothing.\n\ \"keyboard\": IM status follows keyboard status.\n\ \"IM\": Keyboard status follows IM status."), } , {G_TYPE_BOOLEAN, "numpad-always-number", PAGE_EDITING, N_("Number pad always input number"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "1", NULL, NULL, 0, 1, numpadAlwaysNumber_apply_callback, 0, N_("Always input numbers when number keys from key pad is inputted."), } , {G_TYPE_BOOLEAN, "shift-toggle-chinese", PAGE_EDITING, N_("Shift toggle Chinese Mode"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "1", NULL, NULL, 0, 1, easySymbolInput_apply_callback, 0, N_("Shift key to toggle Chinese Mode"), } , {G_TYPE_BOOLEAN, "plain-zhuyin", PAGE_SELECTING, N_("Plain Zhuyin mode"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "0", NULL, NULL, 0, 1, plainZhuyin_apply_callback, 0, N_("In plain Zhuyin mode, automatic candidate selection and related options are disabled or ignored."), } , {G_TYPE_UINT, "cand-per-page", PAGE_SELECTING, N_("Candidate per page"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "10", NULL, NULL, 8, 10, candPerPage_apply_callback, 0, N_("Number of candidate per page."), } , {G_TYPE_BOOLEAN, "phrase-choice-from-last", PAGE_SELECTING, N_("Choose phrases from backward"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "1", NULL, NULL, 0, 1, phraseChoiceRearward_apply_callback, 0, N_("Choose phrases from the back, without moving cursor."), } , {G_TYPE_BOOLEAN, "space-as-selection", PAGE_SELECTING, N_("Space to select"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "0", NULL, NULL, 0, 1, spaceAsSelection_apply_callback, 0, "Press Space to select the candidate.", } , {G_TYPE_INVALID, "", "", "", IBUS_CHEWING_PROPERTIES_SUBSECTION, "", NULL, NULL, 0, 0, NULL, 0, NULL, } , }; /*============================================ * Class methods */ IBusChewingProperties *ibus_chewing_properties_new(MkdgBackend * backend, gpointer parent, gpointer auxData) { IBusChewingProperties *self = g_new0(IBusChewingProperties, 1); self->properties = mkdg_properties_from_spec_array(propSpecs, backend, parent, auxData); if (STRING_EQUALS(backend->id, GSETTINGS_BACKEND_ID)) { self->confObjTable = g_hash_table_new(g_str_hash, g_str_equal); } else { self->confObjTable = NULL; } return self; } static GString *ibus_section_to_schema(const gchar * section) { GString *result = g_string_new("org.freedesktop"); gchar **strArr = g_strsplit(section, "/", -1); gint i; for (i = 0; strArr[i] != NULL; i++) { g_string_append_printf(result, ".%s", strArr[i]); } g_strfreev(strArr); return result; } GValue *ibus_chewing_properties_read_general(IBusChewingProperties * self, GValue * value, const gchar * section, const gchar * key, gpointer userData) { g_assert(self); g_assert(value); if (STRING_EQUALS(self->properties->backend->id, GSETTINGS_BACKEND_ID)) { GSettings *confObj; if (!g_hash_table_contains(self->confObjTable, (gpointer) section)) { GString *schemaIdStr = ibus_section_to_schema(section); confObj = g_settings_new(schemaIdStr->str); g_hash_table_insert(self->confObjTable, (gpointer) section, (gpointer) confObj); g_string_free(schemaIdStr, TRUE); } else { confObj = (GSettings *) g_hash_table_lookup(self->confObjTable, (gconstpointer) section); } g_assert(confObj); return mkdg_g_settings_read_value(confObj, value, key); } return mkdg_backend_read(self->properties->backend, value, section, key, userData); } gboolean ibus_chewing_properties_read_boolean_general(IBusChewingProperties * self, const gchar * section, const gchar * key, gpointer userData) { GValue gValue = { 0 }; g_value_init(&gValue, G_TYPE_BOOLEAN); ibus_chewing_properties_read_general(self, &gValue, section, key, userData); gboolean result=g_value_get_boolean(&gValue); g_value_unset(&gValue); return result; } gint ibus_chewing_properties_read_int_general(IBusChewingProperties * self, const gchar * section, const gchar * key, gpointer userData) { GValue gValue = { 0 }; g_value_init(&gValue, G_TYPE_INT); ibus_chewing_properties_read_general(self, &gValue, section, key, userData); gint result=g_value_get_int(&gValue); g_value_unset(&gValue); return result; } ibus-chewing-1.4.14/src/IBusChewingProperties.h000066400000000000000000000052511244356534300213650ustar00rootroot00000000000000#ifndef _IBUS_CHEWING_PROPERTIES_H_ #define _IBUS_CHEWING_PROPERTIES_H_ #include #include #include #include "MakerDialogProperty.h" #include "MakerDialogBackend.h" typedef struct { MkdgProperties *properties; GHashTable *confObjTable; } IBusChewingProperties; /* GConf/dconf section under PROJECT_SCHEMA_PATH */ #define IBUS_CHEWING_PROPERTIES_SUBSECTION "" IBusChewingProperties *ibus_chewing_properties_new(MkdgBackend * backend, gpointer parent, gpointer auxData); GValue *ibus_chewing_properties_read_general(IBusChewingProperties * self, GValue * value, const gchar * section, const gchar * key, gpointer userData); gboolean ibus_chewing_properties_read_boolean_general(IBusChewingProperties * self, const gchar * section, const gchar * key, gpointer userData); gint ibus_chewing_properties_read_int_general(IBusChewingProperties * self, const gchar * section, const gchar * key, gpointer userData); /*============================================ * Callback functions */ gboolean KBType_apply_callback(PropertyContext * ctx, gpointer userData); gboolean selKeys_apply_callback(PropertyContext * ctx, gpointer userData); gboolean hsuSelKeyType_apply_callback(PropertyContext * ctx, gpointer userData); gboolean autoShiftCur_apply_callback(PropertyContext * ctx, gpointer userData); gboolean addPhraseDirection_apply_callback(PropertyContext * ctx, gpointer userData); gboolean easySymbolInput_apply_callback(PropertyContext * ctx, gpointer userData); gboolean escCleanAllBuf_apply_callback(PropertyContext * ctx, gpointer userData); gboolean maxChiSymbolLen_apply_callback(PropertyContext * ctx, gpointer userData); gboolean forceLowercaseEnglish_apply_callback(PropertyContext * ctx, gpointer userData); gboolean syncCapsLock_apply_callback(PropertyContext * ctx, gpointer userData); gboolean numpadAlwaysNumber_apply_callback(PropertyContext * ctx, gpointer userData); gboolean candPerPage_apply_callback(PropertyContext * ctx, gpointer userData); gboolean phraseChoiceRearward_apply_callback(PropertyContext * ctx, gpointer userData); gboolean spaceAsSelection_apply_callback(PropertyContext * ctx, gpointer userData); gboolean plainZhuyin_apply_callback(PropertyContext * ctx, gpointer userData); extern MkdgPropertySpec propSpecs[]; extern const gchar *kbType_ids[]; extern const gchar *selKeys_array[]; extern const gchar *syncCapsLock_strs[]; extern const gchar *outputCharsets[]; #endif /* _IBUS_CHEWING_PROPERTIES_H_ */ ibus-chewing-1.4.14/src/IBusChewingUtil.c000066400000000000000000000142551244356534300201450ustar00rootroot00000000000000#include #include #include #include /** * Utility routines that do not depend on * IBusChewingEngine */ /*===================================== * Tone */ const gchar *toneKeys[] = { "6347", //Default "jfds", //hsu "uiop", //ibm "zaq1", //gin-yieh "4321", //eten "kjfd", //eten26 "6347", //dvorak "thdn", //dvorak_hsu "yert", //dachen_26 "1234", //hanyu NULL }; gint get_tone(ChewingKbType kbType, KSym kSym) { int i = 0; if (kSym == ' ') return 1; for (i = 0; i < 4; i++) { if (toneKeys[kbType][i] == kSym) { return i + 2; } } return -1; } void add_tone(char *str, gint tone) { switch (tone) { case 2: g_strlcat(str, "ˊ", ZHUYIN_BUFFER_SIZE); break; case 3: g_strlcat(str, "ˇ", ZHUYIN_BUFFER_SIZE); break; case 4: g_strlcat(str, "ˋ", ZHUYIN_BUFFER_SIZE); break; case 5: g_strlcat(str, "˙", ZHUYIN_BUFFER_SIZE); break; default: break; } } /*===================================== * Key */ KSym key_sym_KP_to_normal(KSym k) { if (k < IBUS_KP_0 || k > IBUS_KP_9) { switch (k) { case IBUS_KP_Decimal: return IBUS_period; case IBUS_KP_Add: return IBUS_plus; case IBUS_KP_Subtract: return IBUS_minus; case IBUS_KP_Multiply: return IBUS_asterisk; case IBUS_KP_Divide: return IBUS_slash; default: return 0; } } return k - IBUS_KP_0 + IBUS_0; } const char asciiConst[] = " \0" "!\0" "\"\0" "#\0" "$\0" "%\0" "&\0" "'\0" "(\0" ")\0" "*\0" "+\0" ",\0" "-\0" ".\0" "/\0" "0\0" "1\0" "2\0" "3\0" "4\0" "5\0" "6\0" "7\0" "8\0" "9\0" ":\0" ";\0" "<\0" "=\0" ">\0" "?\0" "@\0" "A\0" "B\0" "C\0" "D\0" "E\0" "F\0" "G\0" "H\0" "I\0" "J\0" "K\0" "L\0" "M\0" "N\0" "O\0" "P\0" "Q\0" "R\0" "S\0" "T\0" "U\0" "V\0" "W\0" "X\0" "Y\0" "Z\0" "[\0" "\\\0" "]\0" "^\0" "_\0" "`\0" "a\0" "b\0" "c\0" "d\0" "e\0" "f\0" "g\0" "h\0" "i\0" "j\0" "k\0" "l\0" "m\0" "n\0" "o\0" "p\0" "q\0" "r\0" "s\0" "t\0" "u\0" "v\0" "w\0" "x\0" "y\0" "z\0" "{\0" "|\0" "}\0" "~\0"; const char *key_sym_get_name(KSym k) { switch (k) { case IBUS_Return: return "Return"; case IBUS_KP_Enter: return "KP_Enter"; case IBUS_Escape: return "Escape"; case IBUS_BackSpace: return "BackSpace"; case IBUS_Delete: return "Delete"; case IBUS_KP_Delete: return "KP_Delete"; case IBUS_space: return "space"; case IBUS_KP_Space: return "KP_space"; case IBUS_Page_Up: return "Page_Up"; case IBUS_KP_Page_Up: return "KP_Page_Up"; case IBUS_Page_Down: return "Page_Down"; case IBUS_KP_Page_Down: return "KP_Page_Down"; case IBUS_Up: return "Up"; case IBUS_KP_Up: return "KP_Up"; case IBUS_Down: return "Down"; case IBUS_KP_Down: return "KP_Down"; case IBUS_Left: return "Left"; case IBUS_KP_Left: return "KP_Left"; case IBUS_Right: return "Right"; case IBUS_KP_Right: return "KP_Right"; case IBUS_Home: return "Home"; case IBUS_KP_Home: return "KP_Home"; case IBUS_End: return "End"; case IBUS_KP_End: return "KP_End"; case IBUS_Tab: return "Tab"; case IBUS_Caps_Lock: return "Caps"; case IBUS_Shift_L: return "Shift_L"; case IBUS_Shift_R: return "Shift_R"; case IBUS_Alt_L: return "Alt_L"; case IBUS_Alt_R: return "Alt_R"; case IBUS_Control_L: return "Control_L"; case IBUS_Control_R: return "Control_R"; case IBUS_Super_L: return "Super_L"; case IBUS_Super_R: return "Super_R"; case IBUS_ISO_Lock: return "ISO_Lock"; case IBUS_ISO_Level3_Lock: return "ISO_Level3_Lock"; case IBUS_ISO_Level3_Shift: return "ISO_Level3_Shift"; default: if (isprint(k)) { return &asciiConst[(k - ' ') * 2]; } #if 0 if (k >= '0' && k <= '9') { return &numConst[(k - '0') * 2]; } else if (k >= 'a' && k <= 'z') { return &alphaConstL[(k - 'a') * 2]; } else if (k >= 'A' && k <= 'Z') { return &alphaConstU[(k - 'A') * 2]; } #endif break; } return "Others"; } /*===================================== * Modifiers */ #define CAPS_LOCK_MASK 2 gboolean is_caps_led_on(Display * pDisplay) { XKeyboardState retState; XGetKeyboardControl(pDisplay, &retState); return (retState.led_mask & 1) ? TRUE : FALSE; } void set_caps_led(gboolean on, Display * pDisplay) { XKeyboardControl control; control.led_mode = (on) ? LedModeOn : LedModeOff; control.led = CAPS_LOCK_MASK; guint flags = (on) ? CAPS_LOCK_MASK : 0; XChangeKeyboardControl(pDisplay, KBLedMode, &control); XkbLockModifiers(pDisplay, XkbUseCoreKbd, control.led, flags); XFlush(pDisplay); } const gchar *modifier_get_string(guint modifier) { switch (modifier) { case 0: return ""; case IBUS_SHIFT_MASK: return "SHIFT"; case IBUS_LOCK_MASK: return "LOCK"; case IBUS_CONTROL_MASK: return "CONTROL"; case IBUS_MOD1_MASK: return "MOD1"; case IBUS_MOD2_MASK: return "MOD2"; case IBUS_MOD3_MASK: return "MOD3"; case IBUS_MOD4_MASK: return "MOD4"; case IBUS_MOD5_MASK: return "MOD5"; case IBUS_HANDLED_MASK: return "HANDLED"; case IBUS_FORWARD_MASK: return "FORWARD"; case IBUS_SUPER_MASK: return "SUPER"; case IBUS_HYPER_MASK: return "HYPER"; case IBUS_META_MASK: return "META"; case IBUS_RELEASE_MASK: return "RELEASE"; default: break; } return "UNRECOGNIZED_MASK"; } #define MODIFIER_BUFFER_SIZE 100 const gchar *modifiers_to_string(guint modifier) { static gchar modifierBuf[MODIFIER_BUFFER_SIZE]; g_strlcpy(modifierBuf, "", MODIFIER_BUFFER_SIZE); gboolean first = TRUE; gint i, mask; for (i = 0; i < 32; i++) { mask = 1 << i; if (modifier & mask) { if (first) { g_strlcpy(modifierBuf, modifier_get_string(mask), MODIFIER_BUFFER_SIZE); first = FALSE; } else { g_strlcat(modifierBuf, "| ", MODIFIER_BUFFER_SIZE); g_strlcat(modifierBuf, modifier_get_string(mask), MODIFIER_BUFFER_SIZE); } } } return modifierBuf; } /*===================================== * Misc */ gboolean ibus_chewing_property_get_state(IBusProperty * prop) { #if IBUS_CHECK_VERSION(1, 4, 0) return ibus_property_get_state(prop); #else return prop->state; #endif } ibus-chewing-1.4.14/src/IBusChewingUtil.h000066400000000000000000000046051244356534300201500ustar00rootroot00000000000000/* * Copyright © 2011 Red Hat, Inc. All rights reserved. * Copyright © 2011 Ding-Yi Chen * * This file is part of the ibus-chewing Project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _IBUS_CHEWING_UTIL_H_ #define _IBUS_CHEWING_UTIL_H_ #include #include #include #include #include #include #define ZHUYIN_BUFFER_SIZE 12 #define CHEWING_CHECK_VERSION(major,minor,patch) \ (CHEWING_VERSION_MAJOR > (major) || \ (CHEWING_VERSION_MAJOR == (major) && CHEWING_VERSION_MINOR > (minor)) || \ (CHEWING_VERSION_MAJOR == (major) && CHEWING_VERSION_MINOR == (minor) && \ CHEWING_VERSION_PATCH >= (patch) \ )\ ) #define IBUS_CHEWING_LOG_DOMAIN "ibus-chewing" #define IBUS_CHEWING_LOG(level, msg, args...) \ mkdg_log_domain(IBUS_CHEWING_LOG_DOMAIN, level, msg, ##args) typedef guint KSym; typedef guint KeyModifiers; typedef enum { CHEWING_KBTYPE_INVALID = -1, CHEWING_KBTYPE_DEFAULT, CHEWING_KBTYPE_HSU, CHEWING_KBTYPE_IBM, CHEWING_KBTYPE_GIN_YIEH, CHEWING_KBTYPE_ETEN, CHEWING_KBTYPE_ETEN26, CHEWING_KBTYPE_DVORAK, CHEWING_KBTYPE_DVORAK_HSU, CHEWING_KBTYPE_DACHEN_CP26, CHEWING_KBTYPE_HAN_YU } ChewingKbType; gint get_tone(ChewingKbType kbType, KSym k); void add_tone(char *str, gint tone); KSym key_sym_KP_to_normal(KSym k); const char *key_sym_get_name(KSym k); gboolean is_caps_led_on(Display * pDisplay); void set_caps_led(gboolean on, Display * pDisplay); const gchar *modifier_get_string(guint modifier); const gchar *modifiers_to_string(guint modifier); gboolean ibus_chewing_property_get_state(IBusProperty * prop); #endif /* _IBUS_CHEWING_UTIL_H_ */ ibus-chewing-1.4.14/src/IBusConfigBackend.c000066400000000000000000000103541244356534300203740ustar00rootroot00000000000000/* * Copyright © 2014 Red Hat, Inc. All rights reserved. * Copyright © 2014 Ding-Yi Chen * * This file is part of the ibus-chewing Project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "MakerDialogUtil.h" #include "GSettingsBackend.h" #include "IBusChewingUtil.h" #include "IBusConfigBackend.h" #include "IBusChewingProperties.h" /*============================================ * Class methods */ #define KEY_BUFFER_SIZE 100 static gchar *to_real_section(gchar * confSection, MkdgBackend * backend, const gchar * section) { if (!STRING_IS_EMPTY(backend->basePath)) { g_strlcpy(confSection, backend->basePath, KEY_BUFFER_SIZE); } else { g_strlcpy(confSection, "", KEY_BUFFER_SIZE); } if (!STRING_IS_EMPTY(section)) { g_strlcat(confSection, section, KEY_BUFFER_SIZE); g_strlcat(confSection, "/", KEY_BUFFER_SIZE); } return confSection; } GValue *ibus_config_backend_read_value(MkdgBackend * backend, GValue * value, const gchar * section, const gchar * key, gpointer userData) { IBusConfig *config = (IBusConfig *) backend->config; gchar confSection[KEY_BUFFER_SIZE]; to_real_section(confSection, backend, section); printf("confSection=%s\n", confSection); #if IBUS_CHECK_VERSION(1, 4, 0) GVariant *gVar = ibus_config_get_value(config, confSection, key); if (gVar == NULL) { return NULL; } g_variant_ref_sink(gVar); mkdg_g_variant_to_g_value(gVar, value); g_variant_unref(gVar); return value; #else return ibus_config_get_value(config, confSection, key, value); #endif } gboolean ibus_config_backend_write_value(MkdgBackend * backend, GValue * value, const gchar * section, const gchar * key, gpointer userData) { gboolean result = FALSE; IBusConfig *config = (IBusConfig *) backend->config; gchar confSection[KEY_BUFFER_SIZE]; to_real_section(confSection, backend, section); #if IBUS_CHECK_VERSION(1, 4, 0) GVariant *gVar = g_variant_ref_sink(mkdg_g_value_to_g_variant(value)); if (gVar != NULL) { result = ibus_config_set_value(config, confSection, key, gVar); } #else result = ibus_config_set_value(config, confSection, key, value); #endif if (result == FALSE) { mkdg_log(WARN, "ibus_config_backend_write_value(-, %s, -) %s %s", key, "Failed to set variable", key); return FALSE; } if (!config) { mkdg_log(WARN, "ibus_config_backend_write_value(-, %s, -) %s", key, "Failed to connect to IBusService"); return FALSE; } return TRUE; } /* * basePath is shorter that other backend, as ibus-config should provide ibus level base */ MkdgBackend *ibus_config_backend_new(IBusService * service, const gchar * basePath, gpointer auxData) { IBusConfig *config = NULL; #if IBUS_CHECK_VERSION(1, 4, 0) GError *error = NULL; GDBusConnection *connection = ibus_service_get_connection(service); config = g_object_ref_sink(ibus_config_new(connection, NULL, &error)); g_assert(error == NULL); #else GList *connections_list = ibus_service_get_connections(service); g_assert(connections_list); g_assert(connections_list->data); IBusConnection *iConnection = (IBusConnection *) connections_list->data; config = g_object_ref_sink(ibus_config_new(iConnection)); #endif MkdgBackend *result = mkdg_backend_new(IBUS_CONFIG_BACKEND_ID, (gpointer) config, basePath, auxData); result->readFunc = ibus_config_backend_read_value; result->writeFunc = ibus_config_backend_write_value; return result; } ibus-chewing-1.4.14/src/IBusConfigBackend.h000066400000000000000000000027131244356534300204010ustar00rootroot00000000000000/* * Copyright © 2014 Red Hat, Inc. All rights reserved. * Copyright © 2014 Ding-Yi Chen * * This file is part of the ibus-chewing Project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** * SECTION:IBusConfigBackend * @short_description: An IBus-Config Backend * @title: IBusConfig Backend * @stability: Stable * @include: IBusConfigBackend.h * * A MakerDialog backend provides an interface to configuration service * like GConf2 or dconf */ #ifndef _IBUS_CONFIG_BACKEND_H_ #define _IBUS_CONFIG_BACKEND_H_ #include "ibus.h" #include "MakerDialogBackend.h" #define IBUS_CONFIG_BACKEND_ID "ibus_config" MkdgBackend *ibus_config_backend_new(IBusService * service, const gchar * baseDir, gpointer auxData); #endif /* _IBUS_CONFIG_BACKEND_H_ */ ibus-chewing-1.4.14/src/MakerDialog-def.c000066400000000000000000000032431244356534300200460ustar00rootroot00000000000000 static gchar *widget_get_id(gchar * buffer, gint buffer_size, const gchar * widget_label, const gchar * widget_type) { g_snprintf(buffer, buffer_size, "%s%s%s%s", WIDGET_ID_PREFIX, widget_label, (widget_type) ? "_" : "", (widget_type) ? widget_type : ""); return buffer; } typedef struct { MakerDialog *self; gint currentMaxWidth; const gchar *pageName; gfloat xalign; gfloat yalign; } WidgetAlignment; static void calculate_max_label_width_callback(gpointer key, gpointer value, gpointer widgetAlignment) { gchar *wKey = (gchar *) key; gchar *pageName = (gchar *) value; WidgetAlignment *wAlignment = (WidgetAlignment *) widgetAlignment; if (!STRING_EQUALS(wAlignment->pageName, pageName)) { /* Different Page */ return; } GtkWidget *widget = maker_dialog_get_widget(wAlignment->self, wKey, "label"); GtkRequisition requisition; gtk_widget_size_request(widget, &requisition); wAlignment->currentMaxWidth = MAX(wAlignment->currentMaxWidth, requisition.width); } static void set_label_width_callback(gpointer key, gpointer value, gpointer userData) { WidgetAlignment *wAlignment = (WidgetAlignment *) userData; gchar *wKey = (gchar *) key; gchar *pageName = (gchar *) value; if (!STRING_EQUALS(wAlignment->pageName, pageName)) { /* Different Page */ return; } GtkWidget *widget = maker_dialog_get_widget(wAlignment->self, wKey, "label"); gtk_widget_set_size_request(widget, wAlignment->currentMaxWidth, -1); gtk_misc_set_alignment(GTK_MISC(widget), wAlignment->xalign, wAlignment->yalign); gtk_widget_show(widget); } ibus-chewing-1.4.14/src/MakerDialog.gob000066400000000000000000000240031244356534300176340ustar00rootroot00000000000000requires 2.0.0 %alltop{ /* * Copyright © 2009 Red Hat, Inc. All rights reserved. * Copyright © 2009 Ding-Yi Chen * * This file is part of the ibus-chewing Project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ %} %headertop{ #ifndef MAKER_DIALOG_H_ #define MAKER_DIALOG_H_ #include #include #include #include #include #include #include "MakerDialogProperty.h" #include "MakerDialogWidget.h" %} %headertop{ #define MKDG_PAGE_NAME_DEFAULT "..." #ifndef WIDGET_ID_PREFIX #define WIDGET_ID_PREFIX "+" #endif #ifndef MAKER_DIALOG_ID_LENGTH #define MAKER_DIALOG_ID_LENGTH 200 #endif #define MKDG_CONTAINER_TABLE_LOOKUP(table,key) (MkdgWidgetContainer *) g_hash_table_lookup(table, (gconstpointer) key) %} %{ #define GETTEXT_PACKAGE "gtk20" #include %} class Maker:Dialog from Gtk:Dialog { protected MkdgWgt *notebookWgt = NULL destroywith mkdg_wgt_destroy; protected MkdgWidgetFlag wFlags; private GHashTable *containerTable = { g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL) } destroywith g_hash_table_destroy; private GHashTable *widgetTable = { g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL) } destroywith g_hash_table_destroy; private GHashTable *notebookContentTable = { g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL) } destroywith g_hash_table_destroy; private GStringChunk *widgetIds = { g_string_chunk_new(MAKER_DIALOG_ID_LENGTH) } destroywith g_string_chunk_free; private GPtrArray *pageLabels = NULL destroy { if (VAR) { g_ptr_array_free(VAR, TRUE); } }; private MkdgProperties *properties = NULL destroy { if (VAR) { mkdg_properties_free(VAR); } }; init(self) { /* initialize the object here */ } public MakerDialog * new(void) { Self * self = GET_NEW; return self; } public MakerDialog * new_full(MkdgProperties * properties, const gchar * title, MkdgWidgetFlag wFlags, MkdgButtonFlag bFlags) { Self * self = GET_NEW; GtkDialog * dialog = GTK_DIALOG(self); gtk_window_set_title(GTK_WINDOW(dialog), title); gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE); gtk_window_set_type_hint(GTK_WINDOW(dialog), GDK_WINDOW_TYPE_HINT_DIALOG); self->wFlags=wFlags; self->_priv->properties=properties; gint i; /* Create Buttons */ for (i = MKDG_BUTTON_INDEX_INVALID -1; i >=0; i--) { if ( bFlags & (1 << i)){ const gchar *buttonText=mkdg_button_get_text(i); mkdg_log(DEBUG, "new_full(-,%s,%X,%X) i=%d, buttonText=%s", title, wFlags, bFlags, i, buttonText); MkdgButtonResponse response = mkdg_button_get_response(i); gtk_dialog_add_button(dialog, buttonText, response); } } /* Create Notebook */ self->notebookWgt = gtk_notebook_new(); mkdg_wgt_show(self->notebookWgt); GtkWidget *dialogVboxWgt=GTK_DIALOG(self)->vbox; mkdg_wgt_show(dialogVboxWgt); gtk_box_pack_start(GTK_BOX(dialogVboxWgt), self->notebookWgt, TRUE, TRUE, 0); self_prepare(self); return self; } /** * add_property: * @self: A MakerDialog * @ctx: A PropertyContext which contain the value to be set. * @returns: TRUE if the property adding succeed; FALSE otherwise. * * Add a property to the dialog and corresponding Gtk widget will also be * set. */ public gboolean add_property(self, PropertyContext * ctx){ if (ctx==NULL) { return FALSE; } mkdg_log(INFO, "add_property(%s) %s", ctx->spec->key, property_context_to_string(ctx)); /* Create the widget */ MkdgWidget * mWidget = mkdg_widget_new(ctx, self->wFlags); if (mWidget == NULL) return FALSE; /* Find the container */ const gchar *pageName = (STRING_IS_EMPTY(ctx->spec->pageName)) ? MKDG_PAGE_NAME_DEFAULT : ctx->spec->pageName; MkdgWidgetContainer *container = MKDG_CONTAINER_TABLE_LOOKUP(self->_priv->containerTable, pageName); /* Do we need a new container/page? */ if (container == NULL){ MkdgWgt * vboxWgt = gtk_vbox_new(FALSE, MKDG_VBOX_SPACING_DEFAULT); mkdg_wgt_show(vboxWgt); container = mkdg_widget_container_new(vboxWgt); g_hash_table_insert(self->_priv->containerTable, (gpointer) pageName, (gpointer) container); /* new notebook page */ MkdgWgt * pageLabelWgt = gtk_label_new(_(pageName)); mkdg_wgt_show(pageLabelWgt); gtk_notebook_append_page(GTK_NOTEBOOK(self->notebookWgt), vboxWgt, pageLabelWgt); } /* Add the widget to container */ mkdg_widget_container_add_widget(container,mWidget); g_hash_table_insert(self->_priv->widgetTable, (gpointer) ctx->spec->key, (gpointer) mWidget); return TRUE; } /** * add_all_properties: * @self: A MakerDialog * @returns: TRUE if all properties added successfully; FALSE otherwise. * * Add all properties to the dialog and corresponding Gtk widget will also be * set. * */ public gboolean add_all_properties(self){ gint i; gboolean result=TRUE; for(i=0;i_priv->properties);i++){ PropertyContext * ctx=mkdg_properties_index(self->_priv->properties, i); GValue * ret=property_context_load(ctx,NULL); if (ret==NULL) result=FALSE; self_add_property(self, ctx); } return result; } /** * prepare: * @returns: TRUE if success; FALSE otherwise. * * Prepare the MakerDialog after new. This includes add_all_properties. */ protected gboolean prepare(self){ gboolean success; success = self_add_all_properties(self); if (!success){ return FALSE; } GList * containerList = g_hash_table_get_values(self->_priv->containerTable); GList * node; for(node = g_list_first(containerList); node != NULL; node = g_list_next(node)){ MkdgWidgetContainer *container= (MkdgWidgetContainer *) node->data; mkdg_widget_container_align_all_children(container, 1.0f, 0.5f, 0.0f, 0.5f); } g_list_free(containerList); return TRUE; } /** * assign_widget_value: * @self: A MakerDialog. * @ctx: The PropertyContext * @userData: userData that pass through applyFunc. * * Assign the value shown in widget to the property. * That is firstly save the value, then apply the value. * * @see_also: set_widget_value() */ public void assign_widget_value(self, PropertyContext *ctx, gpointer userData) { mkdg_log(INFO, "assign_widget_value(%s)", ctx->spec->key); GValue gValue = {0}; mkdg_g_value_reset(&gValue, ctx->spec->valueType, TRUE); self_get_widget_value(self, ctx->spec->key, &gValue); property_context_save(ctx, &gValue, userData); property_context_apply(ctx, userData); g_value_unset(&gValue); } /** * assign_all_widgets_values: * @self: A MakerDialog. * @userData: userData that pass through applyFunc. * * Invoke assign_widget_value for all widgets. * * @see_also: assign_widget_value(), set_widget_value() */ public void assign_all_widgets_values(self, gpointer userData){ gint i; for (i = 0; i < mkdg_properties_size(self->_priv->properties); i++) { PropertyContext *ctx = mkdg_properties_index(self->_priv->properties,i); self_assign_widget_value(self,ctx, userData); } } /** * save_all_widgets_values: * @self: A MakerDialog. * @userData: userData that pass through property_context_save. * * Save all widget values to configuration backend. * */ public void save_all_widgets_values(self, gpointer userData){ gint i; for (i = 0; i < mkdg_properties_size(self->_priv->properties); i++) { PropertyContext *ctx = mkdg_properties_index(self->_priv->properties,i); GValue gValue={0}; mkdg_g_value_reset(&gValue, ctx->spec->valueType, TRUE); self_get_widget_value(self, ctx->spec->key, &gValue); property_context_save(ctx, &gValue, userData); g_value_reset(&gValue); } } /** * get_widget_value: * @self: A MakerDialog. * @key: The key of a property. * @value: GValue that store output. * @returns: The address of value if success, NULL if failed. * * Get value as display in widget. */ public GValue * get_widget_value(self, const gchar * key, GValue * value) { mkdg_log(INFO, "get_widget_value(%s)", key); MkdgWidget * mWidget = self_get_widget_by_key(self, key); if (mWidget == NULL){ /* Not fount */ return NULL; } return mkdg_widget_get_widget_value(mWidget, value); } /** * set_widget_value: * @self: A MakerDialog. * @key: The key of a property. * @value: Value to be shown in widget. * * Set value for widget display. * However, value in PropertyContext is not changed. * Use assign_widget_value() to do it. * @see_also: assign_widget_value() */ public void set_widget_value(self, const gchar * key, GValue * value) { mkdg_log(INFO, "set_widget_value(%s, %s)", key, mkdg_g_value_to_string(value)); MkdgWidget * mWidget = self_get_widget_by_key(self, key); mkdg_widget_set_widget_value(mWidget, value); } /** * show: * @self: A MakerDialog. * */ public void show(self){ mkdg_wgt_show_all(GTK_WIDGET(self)); } public MkdgWidget * get_widget_by_key(self, const gchar *key){ return (MkdgWidget *) g_hash_table_lookup(self->_priv->widgetTable, key); } } %headertop{ #endif /* MAKER_DIALOG_H_ */ %} ibus-chewing-1.4.14/src/MakerDialogBackend.c000066400000000000000000000015511244356534300205620ustar00rootroot00000000000000#include "MakerDialogUtil.h" #include "MakerDialogBackend.h" MkdgBackend *mkdg_backend_new(const gchar * id, gpointer config, const gchar * basePath, gpointer auxData) { g_assert(config); g_assert(!STRING_IS_EMPTY(id)); MkdgBackend *result = g_new0(MkdgBackend, 1); result->id = id; result->config = config; result->basePath = basePath; result->auxData = auxData; result->flags=0; return result; } GValue *mkdg_backend_read(MkdgBackend * backend, GValue * value, const gchar * section, const gchar * key, gpointer userData) { return backend->readFunc(backend, value, section, key, userData); } gboolean mkdg_backend_write(MkdgBackend * backend, GValue * value, const gchar * section, const gchar * key, gpointer userData) { return backend->writeFunc(backend, value, section, key, userData); } ibus-chewing-1.4.14/src/MakerDialogBackend.h000066400000000000000000000055421244356534300205730ustar00rootroot00000000000000/* * Copyright © 2014 Red Hat, Inc. All rights reserved. * Copyright © 2014 Ding-Yi Chen * * This file is part of the ibus-chewing Project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** * SECTION:MakerDialogBackend * @short_description: An interface to configuration service * @title: MakerDialog Backend * @stability: Stable * @include: MakerDailogBackend.h * * A MakerDialog backend provides an interface to configuration service like GConf2 or dconf */ #ifndef _MAKER_DIALOG_BACKEND_H_ #define _MAKER_DIALOG_BACKEND_H_ #include #include typedef struct MkdgBackend_ MkdgBackend; /** * MkdgBackendFlag: * @MKDG_BACKEND_FLAG_DISCONNECTED: Disconnect from backend, so the backend works without connect to real service. * * MakerDialog backend flags. * */ typedef enum { MKDG_BACKEND_FLAG_DISCONNECTED =1 } MkdgBackendFlag; typedef GValue *(*BackendReadFunc) (MkdgBackend * backend, GValue * value, const gchar * section, const gchar * key, gpointer userData); typedef gboolean(*BackendWriteFunc) (MkdgBackend * backend, GValue * value, const gchar * section, const gchar * key, gpointer userData); /** * MkdgBackend: * @id: A string that identify the backend. * @config: A configuration service * @basePath: All keys and sub-sections of this project should be put under this path (with trailing '/') * @readFunc: Callback function for load * @writeFunc: Callback function for save * @auxData: Auxiliary data that might be useful. * * A MkdgBackend object. */ struct MkdgBackend_ { const gchar *id; gpointer config; const gchar *basePath; BackendReadFunc readFunc; BackendWriteFunc writeFunc; MkdgBackendFlag flags; gpointer auxData; }; MkdgBackend *mkdg_backend_new(const gchar * id, gpointer config, const gchar * basePath, gpointer auxData); GValue *mkdg_backend_read(MkdgBackend * backend, GValue * value, const gchar * section, const gchar * key, gpointer userData); gboolean mkdg_backend_write(MkdgBackend * backend, GValue * value, const gchar * section, const gchar * key, gpointer userData); #endif /* _MAKER_DIALOG_BACKEND_H_ */ ibus-chewing-1.4.14/src/MakerDialogProperty.c000066400000000000000000000245111244356534300210600ustar00rootroot00000000000000#include #include #include "MakerDialogUtil.h" #include "MakerDialogProperty.h" /*============================================ * PropertyContext Methods */ void property_context_default(PropertyContext * ctx) { if (ctx->spec->defaultValue == NULL) return; mkdg_log(DEBUG, "property_context_default(%s)", ctx->spec->key); gboolean ret=property_context_from_string(ctx, ctx->spec->defaultValue); if (!ret) { mkdg_log(WARN, "property_context_default(%s): failed to convert string %s, return NULL", ctx->spec->key, ctx->spec->defaultValue); } } PropertyContext *property_context_new(MkdgPropertySpec * spec, MkdgBackend * backend, gpointer parent, gpointer auxData) { if (spec == NULL) { return NULL; } mkdg_log(INFO, "property_context_new(%s,-,-,-)", spec->key); PropertyContext *result = g_new0(PropertyContext, 1); result->spec = spec; result->backend = backend; result->parent = parent; result->auxData = auxData; g_value_init(&(result->value), result->spec->valueType); property_context_default(result); mkdg_log(DEBUG, "property_context_new(%s):Done", result->spec->key); return result; } gchar *property_context_to_string(PropertyContext * ctx) { if (ctx == NULL) { return NULL; } return mkdg_g_value_to_string(&(ctx->value)); } gboolean property_context_from_string(PropertyContext * ctx, const gchar * str) { if (ctx == NULL) { return FALSE; } return mkdg_g_value_from_string(&(ctx->value), str); } gboolean property_context_from_gvalue(PropertyContext * ctx, GValue * value) { if (ctx == NULL) { return FALSE; } if (!G_IS_VALUE(value)) { return FALSE; } g_value_copy(value, &(ctx->value)); return TRUE; } /* read: backend -> Context or Default */ /* write: Context -> backend */ /* get: Context -> GValue */ /* set: GValue -> Context */ /* load: read then get, errors in read are ignored */ /* save: set then write */ /* apply: Context -> apply callback */ /* use: load then apply */ /* assigne: save then apply */ GValue *property_context_read(PropertyContext * ctx, gpointer userData) { if (ctx == NULL || ctx->backend == NULL) { return NULL; } mkdg_log(DEBUG, "property_context_read(%s, - )", ctx->spec->key); GValue *result = ctx->backend->readFunc(ctx->backend, &(ctx->value), ctx->spec->subSection, ctx->spec->key, userData); if (result == NULL) { mkdg_log(WARN, "property_context_read(%s): failed to read key", ctx->spec->key); } return result; } gboolean property_context_write(PropertyContext * ctx, gpointer userData) { if (ctx == NULL || ctx->backend == NULL) { return FALSE; } mkdg_log(DEBUG, "property_context_write(%s, - )", ctx->spec->key); return ctx->backend->writeFunc(ctx->backend, &(ctx->value), ctx->spec->subSection, ctx->spec->key, userData); } GValue *property_context_get(PropertyContext * ctx) { if (ctx == NULL) { mkdg_log(WARN, "property_context_get(-): ctx is NULL"); return NULL; } mkdg_log(DEBUG, "property_context_get(%s): value=%s", ctx->spec->key, mkdg_g_value_to_string(&(ctx->value))); return &(ctx->value); } gboolean property_context_set(PropertyContext * ctx, GValue * value) { if (ctx == NULL) { mkdg_log(WARN, "property_context_set(-): ctx is NULL"); return FALSE; } mkdg_log(DEBUG, "property_context_set(%s,-)", ctx->spec->key); if (!G_IS_VALUE(value)) { mkdg_log(WARN, "property_context_set(%s): value is not GValue", ctx->spec->key); return FALSE; } g_value_copy(value, &(ctx->value)); return TRUE; } GValue *property_context_load(PropertyContext * ctx, gpointer userData) { mkdg_log(DEBUG, "property_context_load(%s,-)", ctx->spec->key); property_context_read(ctx, userData); return property_context_get(ctx); } gboolean property_context_save(PropertyContext * ctx, GValue * value, gpointer userData) { mkdg_log(DEBUG, "property_context_save(%s,-)", ctx->spec->key); if (!property_context_set(ctx, value)) { return FALSE; } return property_context_write(ctx, userData); } gboolean property_context_apply(PropertyContext * ctx, gpointer userData) { if (ctx == NULL || ctx->parent == NULL) { mkdg_log(WARN, "property_context_apply(%s): either ctx or ctx->parent is NULL", ctx->spec->key); return FALSE; } mkdg_log(DEBUG, "property_context_apply(%s,-)", ctx->spec->key); return ctx->spec->applyFunc(ctx, userData); } gboolean property_context_use(PropertyContext * ctx, gpointer userData) { mkdg_log(DEBUG, "property_context_use(%s,-)", ctx->spec->key); GValue *ret = property_context_load(ctx, userData); if (ret == NULL) { mkdg_log(WARN, "property_context_use(%s): property_context_load return NULL", ctx->spec->key); return FALSE; } return property_context_apply(ctx, userData); } void property_context_free(PropertyContext * ctx) { mkdg_log(INFO, "property_context_free(%s,-)", ctx->spec->key); g_value_unset(&(ctx->value)); g_free(ctx); } /*============================================ * MkdgProperties Methods */ /* This alone is sufficient to generate schemas */ MkdgProperties *mkdg_properties_from_spec_array(MkdgPropertySpec specs[], MkdgBackend * backend, gpointer parent, gpointer auxData) { gsize arraySize = 0; gsize i; for (i = 0; specs[i].valueType != G_TYPE_INVALID; i++) { arraySize++; } MkdgProperties *result = g_new0(MkdgProperties, 1); result->backend = backend; result->contexts = g_ptr_array_sized_new(arraySize); result->auxData = auxData; for (i = 0; i < arraySize; i++) { PropertyContext *ctx = property_context_new(&specs[i], backend, parent, auxData); g_ptr_array_add(result->contexts, (gpointer) ctx); } return result; } PropertyContext *mkdg_properties_find_by_key(MkdgProperties * properties, const gchar * key) { gsize i; for (i = 0; i < mkdg_properties_size(properties); i++) { PropertyContext *ctx = mkdg_properties_index(properties, i); if (STRING_EQUALS(ctx->spec->key, key)) { return ctx; } } return NULL; } PropertyContext *mkdg_properties_index(MkdgProperties * properties, guint index) { return (PropertyContext *) g_ptr_array_index(properties->contexts, index); } GValue *mkdg_properties_get_by_key(MkdgProperties * properties, const gchar * key) { if (properties == NULL) { return NULL; } PropertyContext *ctx = mkdg_properties_find_by_key(properties, key); return property_context_get(ctx); } gboolean mkdg_properties_set_by_key(MkdgProperties * properties, const gchar * key, GValue *value) { if (properties == NULL) { return FALSE; } PropertyContext *ctx = mkdg_properties_find_by_key(properties, key); return property_context_set(ctx, value); } gboolean mkdg_properties_set_boolean_by_key(MkdgProperties * properties, const gchar * key, gboolean boolValue) { GValue gValue={0}; g_value_init(&gValue, G_TYPE_BOOLEAN); g_value_set_boolean(&gValue, boolValue); gboolean result=mkdg_properties_set_by_key(properties,key,&gValue); g_value_unset(&gValue); return result; } gboolean mkdg_properties_set_int_by_key(MkdgProperties * properties, const gchar * key, gint intValue) { GValue gValue={0}; g_value_init(&gValue, G_TYPE_INT); g_value_set_int(&gValue, intValue); gboolean result=mkdg_properties_set_by_key(properties,key,&gValue); g_value_unset(&gValue); return result; } gboolean mkdg_properties_set_string_by_key(MkdgProperties * properties, const gchar * key, const gchar *stringValue) { GValue gValue={0}; g_value_init(&gValue, G_TYPE_STRING); g_value_set_string(&gValue, stringValue); gboolean result=mkdg_properties_set_by_key(properties,key,&gValue); g_value_unset(&gValue); return result; } GValue *mkdg_properties_load_by_key(MkdgProperties * properties, const gchar * key, gpointer userData) { if (properties == NULL) { return NULL; } PropertyContext *ctx = mkdg_properties_find_by_key(properties, key); return property_context_load(ctx, userData); } gboolean mkdg_properties_apply_by_key(MkdgProperties * properties, const gchar * key, gpointer userData) { if (properties == NULL) { return FALSE; } PropertyContext *ctx = mkdg_properties_find_by_key(properties, key); return property_context_apply(ctx, userData); } gsize mkdg_properties_size(MkdgProperties * properties) { return properties->contexts->len; } /* For setup interface */ gboolean mkdg_properties_load_all(MkdgProperties * properties, gpointer userData) { gsize i; gboolean result = TRUE; for (i = 0; i < mkdg_properties_size(properties); i++) { PropertyContext *ctx = mkdg_properties_index(properties, i); GValue *value = property_context_load(ctx, userData); if (value == NULL) { result = FALSE; } } return result; } gboolean mkdg_properties_write_all(MkdgProperties * properties, gpointer userData) { gsize i; gboolean result = TRUE; for (i = 0; i < mkdg_properties_size(properties); i++) { PropertyContext *ctx = mkdg_properties_index(properties, i); gboolean ret = property_context_write(ctx, userData); if (!ret) { result = FALSE; } } return result; } /* For actual runtime */ gboolean mkdg_properties_apply_all(MkdgProperties * properties, gpointer userData) { gsize i; gboolean result = TRUE; for (i = 0; i < mkdg_properties_size(properties); i++) { PropertyContext *ctx = mkdg_properties_index(properties, i); gboolean ret = property_context_apply(ctx, userData); if (!ret) { result = FALSE; } } return result; } gboolean mkdg_properties_use_all(MkdgProperties * properties, gpointer userData) { gsize i; gboolean result = TRUE; for (i = 0; i < mkdg_properties_size(properties); i++) { PropertyContext *ctx = mkdg_properties_index(properties, i); gboolean ret = property_context_use(ctx, userData); if (!ret) { result = FALSE; } } return result; } void mkdg_properties_free(MkdgProperties * properties) { gsize i; for (i = 0; i < mkdg_properties_size(properties); i++) { PropertyContext *ctx = mkdg_properties_index(properties, i); property_context_free(ctx); } g_ptr_array_free(properties->contexts, TRUE); g_free(properties); } ibus-chewing-1.4.14/src/MakerDialogProperty.h000066400000000000000000000111721244356534300210640ustar00rootroot00000000000000/* * Copyright © 2014 Red Hat, Inc. All rights reserved. * Copyright © 2014 Ding-Yi Chen * * This file is part of the ibus-chewing Project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** * SECTION:MakerDialogProperty * @short_description: A property stores a value for a configuration * @title: MakerDialog Property * @stability: Stable * @include: MakerDailogProperty.h * * A MakerDialog property stores a value for a configuration options. */ #ifndef _MAKER_DIALOG_PROPERTY_H_ #define _MAKER_DIALOG_PROPERTY_H_ #include #include #include "MakerDialogUtil.h" #include "MakerDialogPropertySpec.h" #include "MakerDialogBackend.h" struct _PropertyContext { MkdgPropertySpec *spec; GValue value; // * * This file is part of the ibus-chewing Project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** * SECTION:MakerDialogPropertySpec * @short_description: A MakerDialog property spec defines the characteristics of a property. * @title: MakerDialog Property * @stability: Stable * @include: MakerDailogPropertySpec.h * * A MakerDialog property spec defines the characteristics of a property, * including value type, display names, default value, and valid values. */ #ifndef _MAKER_DIALOG_PROPERTY_SPEC_H_ #define _MAKER_DIALOG_PROPERTY_SPEC_H_ #include #include /** * MkdgPropertyFlags: * @MKDG_PROPERTY_FLAG_INVISIBLE: The property is not visible in UI. * @MKDG_PROPERTY_FLAG_INSENSITIVE: The property is gray-out and not editable. * @MKDG_PROPERTY_FLAG_NO_NEW: The property does not accept new values. * @MKDG_PROPERTY_FLAG_HAS_TRANSLATION: The property should show translated value. * * MakerDialog flag controls how the property displayed in UI. */ typedef enum { MKDG_PROPERTY_FLAG_INVISIBLE = 1, MKDG_PROPERTY_FLAG_INSENSITIVE = 1 << 1, MKDG_PROPERTY_FLAG_NO_NEW = 1 << 2, MKDG_PROPERTY_FLAG_HAS_TRANSLATION = 1 << 3, } MkdgPropertyFlags; typedef struct _PropertyContext PropertyContext; typedef gboolean(*MkdgApplyFunc) (PropertyContext * ctx, gpointer userData); /** * MkdgPropertySpec: * @valueType: Type of the value. * @key: A unique Property ID. * @pageName: The name of the tab that contain this property (Translatable). * @label: Label in UI (Translatable). * @subSection: Sub-section in backend. * @defaultValue: String represented string value. * @validValues: NULL terminated valid values. * @min: Minimum valid value for numeric types. * @max: Maximum valid value for numeric types. * @applyFunc: Callback function for apply the value. * @propertyFlags: Property Flags. * @tooltip: Tooltip of this property (Translatable). * @auxData: Auxiliary data that might be needed somewhere. * * A Property Spec describe the characteristic of a property. */ typedef struct { GType valueType; gchar key[30]; gchar pageName[50]; gchar label[200]; gchar subSection[200]; gchar defaultValue[100]; const gchar **validValues; gchar *translationContext; gint min; gint max; MkdgApplyFunc applyFunc; MkdgPropertyFlags propertyFlags; const gchar *tooltip; gpointer auxData; } MkdgPropertySpec; #endif /* _MAKER_DIALOG_PROPERTY_SPEC_H_ */ ibus-chewing-1.4.14/src/MakerDialogUtil.c000066400000000000000000000165201244356534300201520ustar00rootroot00000000000000#include #include #include "MakerDialogUtil.h" static MkdgLogLevel debugLevel = WARN; #define MKDG_LOG_DOMAIN_LEN 20 static gchar mkdgLogDomain[MKDG_LOG_DOMAIN_LEN] = "MKDG"; static FILE *logFile = NULL; void mkdg_log_set_level(MkdgLogLevel level) { debugLevel = level; } void mkdg_log_set_domain(const gchar * domain) { g_strlcpy(mkdgLogDomain, domain, MKDG_LOG_DOMAIN_LEN); } void mkdg_log_set_file(FILE * file) { logFile = file; } void mkdg_logv_domain(const gchar * domain, MkdgLogLevel level, const gchar * format, va_list argList) { if (level > debugLevel) return; GLogLevelFlags flagSet; gchar *levelStr = NULL; switch (level) { case ERROR: flagSet = G_LOG_FLAG_FATAL | G_LOG_LEVEL_ERROR; levelStr = "ERROR"; break; case WARN: flagSet = G_LOG_LEVEL_WARNING; levelStr = "WARN"; break; case MSG: flagSet = G_LOG_LEVEL_MESSAGE; levelStr = "MSG"; break; case INFO: flagSet = G_LOG_LEVEL_INFO; levelStr = "INFO"; break; default: flagSet = G_LOG_LEVEL_DEBUG; levelStr = "DEBUG"; break; } g_logv(domain, flagSet, format, argList); if (logFile != NULL) { fprintf(logFile, "%s-%s: ", domain, levelStr); vfprintf(logFile, format, argList); fprintf(logFile, "\n"); } } void mkdg_log(MkdgLogLevel level, const gchar * format, ...) { if (level > debugLevel) return; va_list argList; va_start(argList, format); mkdg_logv_domain(mkdgLogDomain, level, format, argList); va_end(argList); } void mkdg_log_domain(const gchar * domain, MkdgLogLevel level, const gchar * format, ...) { if (level > debugLevel) return; va_list argList; va_start(argList, format); mkdg_logv_domain(domain, level, format, argList); va_end(argList); } gboolean mkdg_g_value_reset(GValue * value, GType type, gboolean overwrite) { if (!G_IS_VALUE(value)) { g_value_init(value, type); } if (G_VALUE_TYPE(value) != type) { if (!overwrite) { mkdg_log(ERROR, "mkdg_g_value_reset(): type incompatable"); return FALSE; } } g_value_reset(value); return TRUE; } gchar *mkdg_g_value_to_string(GValue * value) { static gchar result[MAKER_DIALOG_VALUE_LENGTH]; result[0] = '\0'; GType gType = G_VALUE_TYPE(value); guint uintValue; gint intValue; switch (gType) { case G_TYPE_BOOLEAN: if (g_value_get_boolean(value)) { g_snprintf(result, MAKER_DIALOG_VALUE_LENGTH, "1"); } else { g_snprintf(result, MAKER_DIALOG_VALUE_LENGTH, "0"); } break; case G_TYPE_UINT: uintValue = g_value_get_uint(value); g_snprintf(result, MAKER_DIALOG_VALUE_LENGTH, "%u", uintValue); break; case G_TYPE_INT: intValue = g_value_get_int(value); g_snprintf(result, MAKER_DIALOG_VALUE_LENGTH, "%d", intValue); break; case G_TYPE_STRING: g_snprintf(result, MAKER_DIALOG_VALUE_LENGTH, g_value_get_string(value)); break; default: break; } return result; } gboolean mkdg_g_value_from_string(GValue * value, const gchar * str) { mkdg_log(DEBUG, "mkdg_g_value_from_string(-,%s)", str); if (!G_IS_VALUE(value)) { mkdg_log(ERROR, "mkdg_g_value_from_string(): Failed to get GType"); return FALSE; } GType gType = G_VALUE_TYPE(value); mkdg_log(DEBUG, "mkdg_g_value_from_string() gType=%s", g_type_name(gType)); if (!mkdg_g_value_reset(value, gType, FALSE)) { return FALSE; } guint uintValue; gint intValue; gchar *endPtr = NULL; switch (gType) { case G_TYPE_BOOLEAN: if (STRING_IS_EMPTY(str)) { g_value_set_boolean(value, FALSE); } else if (STRING_EQUALS(str, "0")) { g_value_set_boolean(value, FALSE); } else if (STRING_EQUALS(str, "F")) { g_value_set_boolean(value, FALSE); } else if (STRING_EQUALS(str, "f")) { g_value_set_boolean(value, FALSE); } else if (STRING_EQUALS(str, "FALSE")) { g_value_set_boolean(value, FALSE); } else if (STRING_EQUALS(str, "false")) { g_value_set_boolean(value, FALSE); } else { g_value_set_boolean(value, TRUE); } return TRUE; case G_TYPE_UINT: uintValue = g_ascii_strtoull(str, &endPtr, 10); if (uintValue == 0 && endPtr == str) { return FALSE; } g_value_set_uint(value, uintValue); return TRUE; case G_TYPE_INT: intValue = g_ascii_strtoll(str, &endPtr, 10); if (intValue == 0 && endPtr == str) { return FALSE; } g_value_set_int(value, intValue); return TRUE; case G_TYPE_STRING: g_value_set_string(value, str); return TRUE; default: break; } return FALSE; } /*============================================ * MKDG XML functions */ #define INDENT_SPACES 4 static void mkdg_xml_append_indent_space(GString * strBuf, gint indentLevel) { int i, indentLen = indentLevel * INDENT_SPACES; for (i = 0; i < indentLen; i++) { g_string_append_c(strBuf, ' '); } } static GString *mkdg_xml_tags_to_string(const gchar * tagName, MkdgXmlTagType type, const gchar * attribute, const gchar * value, gint indentLevel) { GString *strBuf = g_string_new(NULL); mkdg_xml_append_indent_space(strBuf, indentLevel); if (type != MKDG_XML_TAG_TYPE_NO_TAG) { g_string_append_printf(strBuf, "<%s%s%s%s%s>", (type == MKDG_XML_TAG_TYPE_END_ONLY) ? "/" : "", (!STRING_IS_EMPTY(tagName)) ? tagName : "", (!STRING_IS_EMPTY(attribute)) ? " " : "", (!STRING_IS_EMPTY(attribute)) ? attribute : "", (type == MKDG_XML_TAG_TYPE_EMPTY) ? "/" : ""); } if (type == MKDG_XML_TAG_TYPE_EMPTY) return strBuf; if (type == MKDG_XML_TAG_TYPE_BEGIN_ONLY) return strBuf; if (type == MKDG_XML_TAG_TYPE_END_ONLY) return strBuf; if (type == MKDG_XML_TAG_TYPE_LONG) { g_string_append_c(strBuf, '\n'); } if (value) { if (type == MKDG_XML_TAG_TYPE_LONG || type == MKDG_XML_TAG_TYPE_NO_TAG) { mkdg_xml_append_indent_space(strBuf, indentLevel + 1); int i, valueLen = strlen(value); for (i = 0; i < valueLen; i++) { g_string_append_c(strBuf, value[i]); if (value[i] == '\n') { mkdg_xml_append_indent_space(strBuf, indentLevel + 1); } } g_string_append_c(strBuf, '\n'); if (type == MKDG_XML_TAG_TYPE_LONG) { mkdg_xml_append_indent_space(strBuf, indentLevel); } } else { g_string_append(strBuf, value); } } if (type == MKDG_XML_TAG_TYPE_LONG || type == MKDG_XML_TAG_TYPE_SHORT) { g_string_append_printf(strBuf, "", tagName); } return strBuf; } gchar *mkdg_xml_attr_append(gchar * buf, gint bufferSize, const gchar * attr, const gchar * value) { if (STRING_IS_EMPTY(attr)) return buf; if (!STRING_IS_EMPTY(buf)) g_strlcat(buf, " ", bufferSize); g_strlcat(buf, attr, bufferSize); if (STRING_IS_EMPTY(value)) return buf; g_strlcat(buf, "=\"", bufferSize); g_strlcat(buf, value, bufferSize); g_strlcat(buf, "\"", bufferSize); return buf; } gboolean mkdg_xml_tags_write(FILE * outF, const gchar * tagName, MkdgXmlTagType type, const gchar * attribute, const gchar * value) { static int indentLevel = 0; if (type == MKDG_XML_TAG_TYPE_END_ONLY) indentLevel--; GString *strBuf = mkdg_xml_tags_to_string(tagName, type, attribute, value, indentLevel); mkdg_log(INFO, "xml_tags_write:%s", strBuf->str); fprintf(outF, "%s\n", strBuf->str); if (type == MKDG_XML_TAG_TYPE_BEGIN_ONLY) indentLevel++; g_string_free(strBuf, TRUE); return TRUE; } ibus-chewing-1.4.14/src/MakerDialogUtil.h000066400000000000000000000061751244356534300201640ustar00rootroot00000000000000/* * Copyright © 2014 Red Hat, Inc. All rights reserved. * Copyright © 2014 Ding-Yi Chen * * This file is part of the ibus-chewing Project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _MAKER_DIALOG_UTIL_H_ #define _MAKER_DIALOG_UTIL_H_ #include #include #include typedef enum { ERROR, WARN, MSG, INFO, DEBUG } MkdgLogLevel; void mkdg_log_set_level(MkdgLogLevel level); void mkdg_log_set_domain(const gchar * domain); void mkdg_log_set_file(FILE * file); void mkdg_log(MkdgLogLevel level, const gchar * format, ...); void mkdg_log_domain(const gchar * domain, MkdgLogLevel level, const gchar * format, ...); gchar *mkdg_g_value_to_string(GValue * value); gboolean mkdg_g_value_reset(GValue * value, GType type, gboolean overwrite); gboolean mkdg_g_value_from_string(GValue * value, const gchar * str); gint mkdg_g_ptr_array_find_string(GPtrArray * array, const gchar * str); #define mkdg_g_value_is_boolean(value) (G_VALUE_TYPE(value)==G_TYPE_BOOLEAN) #define mkdg_g_value_is_int(value) (G_VALUE_TYPE(value)==G_TYPE_INT) #define mkdg_g_value_is_uint(value) (G_VALUE_TYPE(value)==G_TYPE_UINT) #define mkdg_g_value_is_string(value) (G_VALUE_TYPE(value)==G_TYPE_STRING) /************************************** * String Utility Macros */ #define QUOTE_ME_INNER(s) #s #define QUOTE_ME(s) QUOTE_ME_INNER(s) #define STRING_IS_EMPTY(str) \ (!str || \ (str[0] == '\0')\ ) #define STRING_EQUALS(str1, str2) \ ((str1==NULL && str2==NULL) ||\ ((str1!=NULL && str2!=NULL) && strcmp(str1, str2)==0) \ ) /************************************** * Flag Utility Macros */ #define mkdg_has_flag(flagSet, flag) (flagSet & flag) #define mkdg_set_flag(flagSet, flag) (flagSet |= flag) #define mkdg_clear_flag(flagSet, flag) (flagSet &= ~(flag)) /************************************** * XML data structure and functions */ typedef enum { MKDG_XML_TAG_TYPE_NO_TAG, MKDG_XML_TAG_TYPE_EMPTY, MKDG_XML_TAG_TYPE_SHORT, MKDG_XML_TAG_TYPE_LONG, MKDG_XML_TAG_TYPE_BEGIN_ONLY, MKDG_XML_TAG_TYPE_END_ONLY, } MkdgXmlTagType; gchar *mkdg_xml_attr_append(gchar * buf, gint bufferSize, const gchar * attr, const gchar * value); gboolean mkdg_xml_tags_write(FILE * outF, const gchar * tagName, MkdgXmlTagType type, const gchar * attribute, const gchar * value); #define MAKER_DIALOG_VALUE_LENGTH 200 #endif /* _MAKER_DIALOG_UTIL_H_ */ ibus-chewing-1.4.14/src/MakerDialogWidget.c000066400000000000000000000405751244356534300204670ustar00rootroot00000000000000#define GETTEXT_PACKAGE "gtk20" #include #include "MakerDialogUtil.h" #include "MakerDialogWidget.h" const gchar *mkdgButtonTextArray[MKDG_BUTTON_INDEX_INVALID + 1] = { NC_("Configure", "Cancel"), NC_("Configure", "Save"), NC_("Configure", "Apply"), NC_("Configure", "Close"), NC_("Configure", "Ok"), NULL }; MkdgButtonResponse mkdg_button_get_response(MkdgButtonIndex index) { switch (index) { case MKDG_BUTTON_INDEX_CANCEL: return MKDG_BUTTON_RESPONSE_CANCEL; case MKDG_BUTTON_INDEX_SAVE: return MKDG_BUTTON_RESPONSE_SAVE; case MKDG_BUTTON_INDEX_APPLY: return MKDG_BUTTON_RESPONSE_APPLY; case MKDG_BUTTON_INDEX_CLOSE: return MKDG_BUTTON_RESPONSE_CLOSE; case MKDG_BUTTON_INDEX_OK: return MKDG_BUTTON_RESPONSE_OK; default: break; } return MKDG_BUTTON_RESPONSE_INVALID; } const gchar *mkdg_button_get_text(MkdgButtonIndex index) { if (index < 0) { return NULL; } if (index > MKDG_BUTTON_INDEX_INVALID) { return NULL; } return g_dpgettext2(NULL,"Configure",mkdgButtonTextArray[index]); } /*===================================== * MkdgWidget * */ static void mkdg_list_store_append(GtkListStore * listStore, const gchar * str, const gchar * translationContext, MkdgPropertyFlags propertyFlags) { GtkTreeIter iter; gtk_list_store_append(listStore, &iter); if (propertyFlags & MKDG_PROPERTY_FLAG_HAS_TRANSLATION) { if (STRING_IS_EMPTY(translationContext)) { mkdg_log(DEBUG, "mkdg_list_store_append() str=%s, _(str)=%s", str, _(str)); gtk_list_store_set(listStore, &iter, 0, str, 1, _(str), -1); } else { mkdg_log(DEBUG, "mkdg_list_store_append() str=%s, _(str)=%s", str, g_dpgettext2(NULL, translationContext, str)); gtk_list_store_set(listStore, &iter, 0, str, 1, g_dpgettext2(NULL, translationContext, str), -1); } } else { mkdg_log(DEBUG, "mkdg_list_store_append() str=%s", str); gtk_list_store_set(listStore, &iter, 0, str, -1); } } gint mkdg_list_store_find_string(GtkListStore * listStore, const gchar * str, const gchar * translationContext, MkdgPropertyFlags propertyFlags) { g_assert(str); mkdg_log(INFO, "mkdg_list_store_find_string(%s,%u)", str, propertyFlags); gint i = 0, index = -1; GtkTreeIter iter; GValue gValue = { 0 }; if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(listStore), &iter)) { do { gtk_tree_model_get_value(GTK_TREE_MODEL(listStore), &iter, 0, &gValue); if (STRING_EQUALS(str, g_value_get_string(&gValue))) { index = i; break; } i++; g_value_unset(&gValue); } while (gtk_tree_model_iter_next (GTK_TREE_MODEL(listStore), &iter)); } if (index < 0 && !(propertyFlags & MKDG_PROPERTY_FLAG_NO_NEW)) { /* Add new item */ mkdg_list_store_append(listStore, str, translationContext, propertyFlags); index = i; } mkdg_log(DEBUG, "mkdg_list_store_find_string(%s,%u) index=%d", str, propertyFlags, index); return index; } gint mkdg_combo_find_string_index(GtkComboBox * combo, const gchar * str, const gchar * translationContext, MkdgPropertyFlags propertyFlags) { GtkListStore *listStore = GTK_LIST_STORE(gtk_combo_box_get_model(combo)); return mkdg_list_store_find_string(listStore, str, translationContext, propertyFlags); } static GValue * mkdg_combo_get_active_text(GtkComboBox * combo) { GtkTreeIter iter; if (!gtk_combo_box_get_active_iter(combo, &iter)) { return NULL; } GValue *value = g_new0(GValue, 1); GtkListStore *listStore = GTK_LIST_STORE(gtk_combo_box_get_model(combo)); gtk_tree_model_get_value(GTK_TREE_MODEL(listStore), &iter, 0, value); return value; } /*===================================== * Widget Callback function wraps */ static void on_value_change(MkdgWidget * mWidget, GValue * value) { if (!(mWidget->flags & MKDG_WIDGET_FLAG_SET_IMMEDIATELY)) { if (mWidget->flags & MKDG_WIDGET_FLAG_WRITE_IMMEDIATELY) { mkdg_log(ERROR, "MKDG_WIDGET_FLAG_SET_IMMEDIATELY is needed for MKDG_WIDGET_FLAG_WRITE_IMMEDIATELY"); return; } else if (mWidget->flags & MKDG_WIDGET_FLAG_APPLY_IMMEDIATELY) { mkdg_log(ERROR, "MKDG_WIDGET_FLAG_SET_IMMEDIATELY is needed for MKDG_WIDGET_FLAG_APPLY_IMMEDIATELY"); return; } } if (mWidget->flags & MKDG_WIDGET_FLAG_SET_IMMEDIATELY) { property_context_set(mWidget->ctx, value); } if (mWidget->flags & MKDG_WIDGET_FLAG_WRITE_IMMEDIATELY) { property_context_save(mWidget->ctx, value, NULL); } if (mWidget->flags & MKDG_WIDGET_FLAG_APPLY_IMMEDIATELY) { property_context_apply(mWidget->ctx, NULL); } } static void on_comboBox_changed_wrap(GtkComboBox * comboBox, gpointer userData) { MkdgWidget *mWidget = (MkdgWidget *) userData; //GValue gValue = { 0 }; GValue *value = mkdg_combo_get_active_text(comboBox); mkdg_log(INFO, "on_comboBox_changed_wrap(), key=%s value=%s", mWidget->ctx->spec->key, mkdg_g_value_to_string(value)); on_value_change(mWidget, value); g_value_unset(value); } static void on_entry_activate_wrap(GtkEntry * entry, gpointer userData) { MkdgWidget *mWidget = (MkdgWidget *) userData; GValue gValue = { 0 }; g_value_init(&gValue, mWidget->ctx->spec->valueType); g_value_set_string(&gValue, gtk_entry_get_text(entry)); mkdg_log(INFO, "on_entry_activate_wrap(), key=%s value=%s", mWidget->ctx->spec->key, g_value_get_string(&gValue)); on_value_change(mWidget, &gValue); } static void on_spinButton_value_changed_wrap(GtkSpinButton * button, gpointer userData) { MkdgWidget *mWidget = (MkdgWidget *) userData; GValue gValue = { 0 }; g_value_init(&gValue, mWidget->ctx->spec->valueType); switch (mWidget->ctx->spec->valueType) { case G_TYPE_INT: g_value_set_int(&gValue, (gint) gtk_spin_button_get_value(button)); mkdg_log(INFO, "on_spinButton_value_changed_wrap(), key=%s value=%d", mWidget->ctx->spec->key, g_value_get_int(&gValue)); break; case G_TYPE_UINT: g_value_set_uint(&gValue, (guint) gtk_spin_button_get_value(button)); mkdg_log(INFO, "on_spinButton_value_changed_wrap(), key=%s value=%u", mWidget->ctx->spec->key, g_value_get_uint(&gValue)); break; case G_TYPE_DOUBLE: g_value_set_double(&gValue, gtk_spin_button_get_value(button)); mkdg_log(INFO, "on_spinButton_value_changed_wrap(), key=%s value=%g", mWidget->ctx->spec->key, g_value_get_double(&gValue)); break; default: break; } on_value_change(mWidget, &gValue); } static void on_toggleButton_toggled_wrap(GtkToggleButton * button, gpointer userData) { MkdgWidget *mWidget = (MkdgWidget *) userData; GValue gValue = { 0 }; g_value_init(&gValue, mWidget->ctx->spec->valueType); g_value_set_boolean(&gValue, gtk_toggle_button_get_active(button)); mkdg_log(INFO, "on_entry_activate_wrap(), key=%s value=%s", mWidget->ctx->spec->key, mkdg_g_value_to_string(&gValue)); on_value_change(mWidget, &gValue); } /*===================================== * MkdgWgt subroutines */ gint mkdg_wgt_get_width(MkdgWgt * wgt) { GtkRequisition requisition; gtk_widget_size_request(wgt, &requisition); return requisition.width; } void mkdg_wgt_set_width(MkdgWgt * wgt, gint width) { gtk_widget_set_size_request(wgt, width, -1); } void mkdg_wgt_set_alignment(MkdgWgt * wgt, gfloat xAlign, gfloat yAlign) { gtk_misc_set_alignment(GTK_MISC(wgt), xAlign, yAlign); } void mkdg_wgt_show(MkdgWgt * wgt) { gtk_widget_show(wgt); } void mkdg_wgt_show_all(MkdgWgt * wgt) { gtk_widget_show_all(wgt); } void mkdg_wgt_destroy(MkdgWgt * wgt) { gtk_widget_destroy(wgt); } /*===================================== * MkdgWidgetContainer subroutines */ MkdgWidgetContainer *mkdg_widget_container_new(MkdgWgt * wgt) { if (wgt == NULL) { return NULL; } MkdgWidgetContainer *container = g_new0(MkdgWidgetContainer, 1); container->wgt = wgt; container->children = g_ptr_array_new(); container->childrenLabelWidth = 0; return container; } void mkdg_widget_container_add_widget(MkdgWidgetContainer * container, MkdgWidget * mWidget) { if ((container == NULL) || (mWidget == NULL)) { return; } MkdgWgt *vbox = container->wgt; /* Add widget to the vbox */ MkdgWgt *hbox = gtk_hbox_new(FALSE, MKDG_HBOX_SPACING_DEFAULT); MkdgWgt *labelWgt = MKDG_WGT(mWidget->label); MkdgWgt *wgt = mWidget->wgt; gtk_box_pack_start(GTK_BOX(hbox), labelWgt, FALSE, FALSE, 0); mkdg_wgt_show(labelWgt); gtk_box_pack_start(GTK_BOX(hbox), wgt, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); g_ptr_array_add(container->children, mWidget); container->childrenLabelWidth = MAX(container->childrenLabelWidth, mkdg_wgt_get_width(labelWgt)); } void mkdg_widget_container_align_all_children(MkdgWidgetContainer * container, gfloat labelXAlign, gfloat labelYAlign, gfloat wgtXAlign, gfloat wgtYAlign) { if ((container == NULL) || (container->children == NULL)) { return; } gint i; for (i = 0; i < mkdg_widget_container_count_children(container); i++) { MkdgWidget *mWidget = g_ptr_array_index(container->children, i); /* Set Width and Aligning labels */ MkdgWgt *labelWgt = MKDG_WGT(mWidget->label); mkdg_wgt_set_width(labelWgt, container->childrenLabelWidth); mkdg_wgt_set_alignment(labelWgt, labelXAlign, labelYAlign); mkdg_wgt_set_alignment(mWidget->wgt, wgtXAlign, wgtYAlign); } } gint mkdg_widget_container_count_children(MkdgWidgetContainer * container) { if ((container == NULL) || (container->children == NULL)) { return -1; } return container->children->len; } void mkdg_widget_cointainer_free(MkdgWidgetContainer * container) { g_ptr_array_free(container->children, TRUE); g_free(container); } /*===================================== * MkdgWidget subroutines */ MkdgWidget *mkdg_widget_new(PropertyContext * ctx, MkdgWidgetFlag widgetFlags) { if (ctx == NULL) { return NULL; } mkdg_log(INFO, "mkdg_widget_new(%s,%x)", ctx->spec->key, widgetFlags); MkdgWidget *mWidget = g_new0(MkdgWidget, 1); MkdgWgt *wgt = NULL; GtkAdjustment *gAdjust = NULL; gboolean bValue; const gchar *strValue; gdouble numberValue; gdouble stepInc = 1.0; gdouble pageInc = 10.0; gdouble pageSize = 0.0; switch (ctx->spec->valueType) { case G_TYPE_BOOLEAN: bValue = g_value_get_boolean(property_context_get(ctx)); wgt = gtk_check_button_new(); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wgt), bValue); g_signal_connect(wgt, "toggled", G_CALLBACK(on_toggleButton_toggled_wrap), mWidget); break; case G_TYPE_UINT: case G_TYPE_INT: if (ctx->spec->valueType == G_TYPE_UINT) { numberValue = (gdouble) g_value_get_uint(property_context_get(ctx)); } else { numberValue = (gdouble) g_value_get_int(property_context_get(ctx)); } gAdjust = (GtkAdjustment *) gtk_adjustment_new(numberValue, ctx->spec->min, ctx->spec->max, stepInc, pageInc, pageSize); wgt = gtk_spin_button_new(gAdjust, 1.0, 0); g_signal_connect(wgt, "value-changed", G_CALLBACK(on_spinButton_value_changed_wrap), mWidget); break; case G_TYPE_STRING: strValue = g_value_get_string(property_context_get(ctx)); if (ctx->spec->validValues) { GtkListStore *listStore = NULL; if (ctx->spec-> propertyFlags & MKDG_PROPERTY_FLAG_HAS_TRANSLATION) { listStore = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING); } else { listStore = gtk_list_store_new(1, G_TYPE_STRING); } int i; for (i = 0; ctx->spec->validValues[i] != NULL; i++) { /* Add new item */ mkdg_list_store_append(listStore, ctx->spec->validValues[i], ctx->spec->translationContext, ctx->spec->propertyFlags); } int index = mkdg_list_store_find_string(listStore, strValue, ctx->spec-> translationContext, ctx->spec-> propertyFlags); if (ctx->spec->propertyFlags & MKDG_PROPERTY_FLAG_NO_NEW) { wgt = gtk_combo_box_new_with_model(GTK_TREE_MODEL (listStore)); GtkCellRenderer *renderer = gtk_cell_renderer_text_new(); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(wgt), renderer, FALSE); if (ctx->spec->propertyFlags & MKDG_PROPERTY_FLAG_HAS_TRANSLATION) { gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(wgt), renderer, "text", 1, NULL); } else { gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(wgt), renderer, "text", 0, NULL); } } else { wgt = gtk_combo_box_entry_new_with_model(GTK_TREE_MODEL (listStore), (ctx->spec-> propertyFlags & MKDG_PROPERTY_FLAG_HAS_TRANSLATION) ? 1 : 0); } gtk_combo_box_set_active(GTK_COMBO_BOX(wgt), index); g_signal_connect(wgt, "changed", G_CALLBACK(on_comboBox_changed_wrap), mWidget); } else { wgt = gtk_entry_new(); if (ctx->spec->max >= 0) { gtk_entry_set_max_length(GTK_ENTRY(wgt), ctx->spec->max); } gtk_entry_set_text(GTK_ENTRY(wgt), strValue); gtk_editable_set_editable(GTK_EDITABLE(wgt), !(ctx->spec->propertyFlags & MKDG_PROPERTY_FLAG_NO_NEW)); g_signal_connect(wgt, "activate", G_CALLBACK(on_entry_activate_wrap), mWidget); } break; default: break; } if (wgt == NULL) { g_free(mWidget); return NULL; } mWidget->ctx = ctx; mWidget->wgt = wgt; MkdgWgtLabel *label = GTK_LABEL(gtk_label_new(_(ctx->spec->label))); mWidget->label = label; gtk_widget_set_tooltip_text(GTK_WIDGET(label), _(ctx->spec->tooltip)); mWidget->flags = widgetFlags; mWidget->container = NULL; return mWidget; } MkdgWidget *mkdg_widget_new_in_container(PropertyContext * ctx, MkdgWidgetFlag widgetFlags, MkdgWidgetContainer * container) { MkdgWidget *mWidget = mkdg_widget_new(ctx, widgetFlags); if (mWidget == NULL) { return NULL; } mkdg_widget_container_add_widget(container, mWidget); return mWidget; } GValue *mkdg_widget_get_widget_value(MkdgWidget * mWidget, GValue * value) { if (mWidget == NULL) { return NULL; } if (mWidget->wgt == NULL) { return NULL; } switch (mWidget->ctx->spec->valueType) { case G_TYPE_BOOLEAN: g_value_set_boolean(value, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (mWidget->wgt))); break; case G_TYPE_INT: g_value_set_int(value, (gint) gtk_spin_button_get_value(GTK_SPIN_BUTTON (mWidget->wgt))); break; case G_TYPE_UINT: g_value_set_uint(value, (guint) gtk_spin_button_get_value(GTK_SPIN_BUTTON (mWidget->wgt))); break; case G_TYPE_STRING: if (mWidget->ctx->spec->validValues) { GValue * strValue = mkdg_combo_get_active_text(GTK_COMBO_BOX(mWidget->wgt)); mkdg_log(INFO, "mkdg_widget_get_widget_value(%s) %s", mWidget->ctx->spec->key, mkdg_g_value_to_string(strValue)); g_value_copy(strValue,value); g_value_unset(strValue); } else { g_value_set_string(value, gtk_entry_get_text(GTK_ENTRY (mWidget->wgt))); } break; default: return NULL; } return value; } gboolean mkdg_widget_set_widget_value(MkdgWidget * mWidget, GValue * value) { if (mWidget == NULL) { return FALSE; } if (mWidget->ctx == NULL) { return FALSE; } if (mWidget->wgt == NULL) { return FALSE; } switch (mWidget->ctx->spec->valueType) { case G_TYPE_BOOLEAN: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mWidget->wgt), g_value_get_boolean(value)); break; case G_TYPE_INT: gtk_spin_button_set_value(GTK_SPIN_BUTTON(mWidget->wgt), (gdouble) g_value_get_int(value)); break; case G_TYPE_UINT: gtk_spin_button_set_value(GTK_SPIN_BUTTON(mWidget->wgt), (gdouble) g_value_get_uint(value)); break; case G_TYPE_STRING: if (mWidget->ctx->spec->validValues) { const gchar *str = g_value_get_string(value); gint index = mkdg_combo_find_string_index(GTK_COMBO_BOX (mWidget->wgt), str, mWidget->ctx->spec-> translationContext, mWidget->ctx->spec-> propertyFlags); gtk_combo_box_set_active(GTK_COMBO_BOX(mWidget->wgt), index); } else { g_value_set_string(value, gtk_entry_get_text(GTK_ENTRY (mWidget->wgt))); } break; default: /* Not supported */ return FALSE; } return TRUE; } ibus-chewing-1.4.14/src/MakerDialogWidget.h000066400000000000000000000104411244356534300204610ustar00rootroot00000000000000#ifndef _MAKER_DIALOG_WIDGET_H_ #define _MAKER_DIALOG_WIDGET_H_ #include #include "MakerDialogProperty.h" #ifndef MKDG_HBOX_SPACING_DEFAULT #define MKDG_HBOX_SPACING_DEFAULT 2 #endif #ifndef MKDG_VBOX_SPACING_DEFAULT #define MKDG_VBOX_SPACING_DEFAULT 2 #endif typedef enum { MKDG_WIDGET_FLAG_SET_IMMEDIATELY = 1, MKDG_WIDGET_FLAG_WRITE_IMMEDIATELY = 1 << 1, MKDG_WIDGET_FLAG_APPLY_IMMEDIATELY = 1 << 2 } MkdgWidgetFlag; typedef enum { MKDG_BUTTON_INDEX_CANCEL, MKDG_BUTTON_INDEX_SAVE, MKDG_BUTTON_INDEX_APPLY, MKDG_BUTTON_INDEX_CLOSE, MKDG_BUTTON_INDEX_OK, MKDG_BUTTON_INDEX_INVALID, } MkdgButtonIndex; /** * MkdgButtonFlag: * @MKDG_BUTTON_FLAG_CANCEL: Close dialog. * @MKDG_BUTTON_FLAG_SAVE: Save. * @MKDG_BUTTON_FLAG_APPLY: Apply. * @MKDG_BUTTON_FLAG_OK: Save, Apply and Close dialog. * * Buttons of this dialog. */ typedef enum { MKDG_BUTTON_FLAG_CANCEL = 1 << MKDG_BUTTON_INDEX_CANCEL, MKDG_BUTTON_FLAG_SAVE = 1 << MKDG_BUTTON_INDEX_SAVE, MKDG_BUTTON_FLAG_APPLY = 1 << MKDG_BUTTON_INDEX_APPLY, MKDG_BUTTON_FLAG_CLOSE = 1 << MKDG_BUTTON_INDEX_CLOSE, MKDG_BUTTON_FLAG_OK = 1 << MKDG_BUTTON_INDEX_OK, MKDG_BUTTON_FLAG_INVALID = 1 << MKDG_BUTTON_INDEX_INVALID, } MkdgButtonFlag; typedef enum { MKDG_BUTTON_RESPONSE_CANCEL = GTK_RESPONSE_CANCEL, MKDG_BUTTON_RESPONSE_SAVE = MKDG_BUTTON_INDEX_SAVE, MKDG_BUTTON_RESPONSE_APPLY = GTK_RESPONSE_APPLY, MKDG_BUTTON_RESPONSE_CLOSE = GTK_RESPONSE_CLOSE, MKDG_BUTTON_RESPONSE_OK = GTK_RESPONSE_OK, MKDG_BUTTON_RESPONSE_INVALID = MKDG_BUTTON_INDEX_INVALID } MkdgButtonResponse; MkdgButtonResponse mkdg_button_get_response(MkdgButtonIndex index); const gchar *mkdg_button_get_text(MkdgButtonIndex index); /** * MkdgWdt: * * The actual widget from the ToolKit. */ typedef GtkWidget MkdgWgt; /** * MkdgWdtLabel: * * The actual label widget from the ToolKit. */ typedef GtkLabel MkdgWgtLabel; /** * MKDG_WGT: * @obj: Object to be casted. * * Cast the object as MkdgWgt. */ #define MKDG_WGT(obj) GTK_WIDGET(obj) gint mkdg_wgt_get_width(MkdgWgt * wgt); void mkdg_wgt_set_width(MkdgWgt * wgt, gint width); void mkdg_wgt_set_alignment(MkdgWgt * wgt, gfloat xAlign, gfloat yAlign); void mkdg_wgt_show(MkdgWgt * wgt); void mkdg_wgt_show_all(MkdgWgt * wgt); void mkdg_wgt_destroy(MkdgWgt * wgt); /*===================================== * MkdgWidgetContainer subroutines */ typedef struct { MkdgWgt *wgt; GPtrArray *children; gint childrenLabelWidth; } MkdgWidgetContainer; typedef struct { MkdgWgtLabel *label; MkdgWgt *wgt; PropertyContext *ctx; MkdgWidgetFlag flags; MkdgWidgetContainer *container; } MkdgWidget; MkdgWidgetContainer *mkdg_widget_container_new(MkdgWgt * wgt); void mkdg_widget_container_add_widget(MkdgWidgetContainer * container, MkdgWidget * mWidget); void mkdg_widget_container_align_all_children(MkdgWidgetContainer * container, gfloat labelXAlign, gfloat labelYAlign, gfloat wgtXAlign, gfloat wgtYAlign); gint mkdg_widget_container_count_children(MkdgWidgetContainer * container); void mkdg_widget_cointainer_free(MkdgWidgetContainer * container); MkdgWidget *mkdg_widget_new(PropertyContext * ctx, MkdgWidgetFlag widgetFlags); /** * mkdg_widget_get_widget_value: * @mWidget: Widget to be get. * @value: Result value stores here. * @returns: NULL if failed, otherwise return the address of value. * * Get value from display widget. * This subroutine will not touch the property context. Use property_context_get() for that. * @see_also: property_context_get(), mkdg_widget_set_widget_value() * @returns: TRUE if success, FALSE if either mWidget or it's members are NULL */ GValue *mkdg_widget_get_widget_value(MkdgWidget * mWidget, GValue * value); /** * mkdg_widget_set_widget_value: * @mWidget: Widget to be set. * @value: Set Widget with this value. * * Set widget value for display. * This subroutine will not touch the property context. Use property_context_set() for that. * @see_also: property_context_set(), mkdg_widget_get_widget_value() * @returns: TRUE if success, FALSE if either mWidget or it's members are NULL */ gboolean mkdg_widget_set_widget_value(MkdgWidget * mWidget, GValue * value); #endif /* _MAKER_DIALOG_WIDGET_H_ */ ibus-chewing-1.4.14/src/generate-gconf-schemas.c000066400000000000000000000140731244356534300214430ustar00rootroot00000000000000#include #include #include #include #include /* * Callback should be skipped */ #ifndef MKDG_SPEC_ONLY #define MKDG_SPEC_ONLY #endif #include "IBusChewingEngine-def.c" #include "MakerDialogUtil.h" #include "MakerDialogProperty.h" #include "IBusConfigBackend.h" #include "IBusChewingProperties.h" #define XML_BUFFER_SIZE 1000 #define DEFAULT_LOCALES "C;zh_TW" static gint verbose = WARN; static gchar *schemasFilename = NULL; static gchar *localeStr = NULL; static gboolean isLocaleStrAllocated = FALSE; static gchar **localeArray = NULL; static const GOptionEntry entries[] = { {"verbose", 'v', 0, G_OPTION_ARG_INT, &verbose, "Verbose level. The higher the level, the more the debug messages.", "[integer]"}, {"locale", 'l', 0, G_OPTION_ARG_STRING, &localeStr, "Supported locales. Use ';' to separate locales.", "[str]"}, {NULL}, }; /*============================================ * GConf Schemas routines */ static void ctx_write_locale(PropertyContext * ctx, FILE * outF, const gchar * locale) { gchar buf[XML_BUFFER_SIZE]; mkdg_log(DEBUG, "ctx_write_locale(%s,-,%s)", ctx->spec->key, locale); setlocale(LC_ALL, "locale"); g_snprintf(buf, 50, "name=\"%s\"", locale); setlocale(LC_MESSAGES, locale); mkdg_xml_tags_write(outF, "locale", MKDG_XML_TAG_TYPE_BEGIN_ONLY, buf, NULL); mkdg_xml_tags_write(outF, "short", MKDG_XML_TAG_TYPE_SHORT, NULL, gettext(ctx->spec->label)); mkdg_xml_tags_write(outF, "long", MKDG_XML_TAG_TYPE_LONG, NULL, gettext(ctx->spec->tooltip)); mkdg_xml_tags_write(outF, "locale", MKDG_XML_TAG_TYPE_END_ONLY, NULL, NULL); } gboolean ctx_write(PropertyContext * ctx, const gchar * schemasHome, const gchar * owner, FILE * outF) { mkdg_xml_tags_write(outF, "schema", MKDG_XML_TAG_TYPE_BEGIN_ONLY, NULL, NULL); gchar buf[XML_BUFFER_SIZE]; if (STRING_IS_EMPTY(ctx->spec->subSection)) { g_snprintf(buf, XML_BUFFER_SIZE, "/schemas%s/%s", schemasHome, ctx->spec->key); } else { g_snprintf(buf, XML_BUFFER_SIZE, "/schemas%s/%s/%s", schemasHome, ctx->spec->subSection, ctx->spec->key); } mkdg_xml_tags_write(outF, "key", MKDG_XML_TAG_TYPE_SHORT, NULL, buf); mkdg_xml_tags_write(outF, "applyto", MKDG_XML_TAG_TYPE_SHORT, NULL, buf + strlen("/schemas")); mkdg_xml_tags_write(outF, "owner", MKDG_XML_TAG_TYPE_SHORT, NULL, owner); switch (ctx->spec->valueType) { case G_TYPE_BOOLEAN: mkdg_xml_tags_write(outF, "type", MKDG_XML_TAG_TYPE_SHORT, NULL, "bool"); break; case G_TYPE_INT: case G_TYPE_UINT: mkdg_xml_tags_write(outF, "type", MKDG_XML_TAG_TYPE_SHORT, NULL, "int"); break; case G_TYPE_STRING: mkdg_xml_tags_write(outF, "type", MKDG_XML_TAG_TYPE_SHORT, NULL, "string"); break; default: break; } if (ctx->spec->defaultValue) { mkdg_xml_tags_write(outF, "default", MKDG_XML_TAG_TYPE_SHORT, NULL, ctx->spec->defaultValue); } int i; for (i = 0; localeArray[i] != NULL; i++) { ctx_write_locale(ctx, outF, localeArray[i]); } setlocale(LC_ALL, NULL); mkdg_xml_tags_write(outF, "schema", MKDG_XML_TAG_TYPE_END_ONLY, NULL, NULL); return TRUE; } /** * write_gconf_schemas_file: * @filename: Filename for output. * @owner: Owner of the schemas. * @schemasHome: The "home direcory" of schemas. * @localeStr: Supported localeStr, use ';' as delimiter. * @returns: TRUE if succeed; FALSE otherwise. * * Output the parameters as GConf schemes file. */ gboolean write_gconf_schemas_file(const gchar * filename, const gchar * owner, const gchar * schemasHome, const gchar * localeStr) { mkdg_log(INFO, "write_gconf_schemes_file(%s,%s,%s,%s)", filename, owner, schemasHome, localeStr); FILE *outF = fopen(filename, "w"); if (outF == NULL) { mkdg_log(DEBUG, "write_gconf_schemas_file(%s) file %s cannot be written!", filename, filename); return FALSE; } localeArray = g_strsplit_set(localeStr, ":;", -1); gchar **loc; for (loc = localeArray; *loc != NULL; loc++) { mkdg_log(DEBUG, "write_gconf_schemas_file() locale=%s", *loc); } /* Header */ mkdg_xml_tags_write(outF, "gconfschemafile", MKDG_XML_TAG_TYPE_BEGIN_ONLY, NULL, NULL); mkdg_xml_tags_write(outF, "schemalist", MKDG_XML_TAG_TYPE_BEGIN_ONLY, NULL, NULL); /* Body */ /* Backend is not needed for schema generation */ IBusChewingConfig *iConfig = ibus_chewing_properties_new(NULL, NULL, NULL, NULL); gsize i; for (i = 0; i < mkdg_properties_size(iConfig->properties); i++) { PropertyContext *ctx = mkdg_properties_index(iConfig->properties, i); ctx_write(ctx, schemasHome, owner, outF); } /* Footer */ mkdg_xml_tags_write(outF, "schemalist", MKDG_XML_TAG_TYPE_END_ONLY, NULL, NULL); mkdg_xml_tags_write(outF, "gconfschemafile", MKDG_XML_TAG_TYPE_END_ONLY, NULL, NULL); if (fclose(outF)) return FALSE; mkdg_log(DEBUG, "write_gconf_schemas_file(%s) ... done.", filename); return TRUE; } int main(gint argc, gchar * argv[]) { GError *error = NULL; GOptionContext *context; /* Init i18n messages */ setlocale(LC_ALL, ""); bindtextdomain(QUOTE_ME(PROJECT_NAME), QUOTE_ME(DATA_DIR) "/locale"); textdomain(QUOTE_ME(PROJECT_NAME)); context = g_option_context_new("schemasFile"); g_option_context_add_main_entries(context, entries, "ibus-chewing"); if (!g_option_context_parse(context, &argc, &argv, &error)) { g_print("Option parsing failed: %s\n", error->message); return 2; } g_option_context_free(context); if (argc < 2) { fprintf(stderr, "Specify output schemas file!\n"); return 2; } if (localeStr == NULL) { localeStr = DEFAULT_LOCALES; } else { isLocaleStrAllocated = TRUE; } mkdg_log_set_level(verbose); schemasFilename = argv[1]; g_type_init(); gboolean result = write_gconf_schemas_file(schemasFilename, "ibus-chewing", QUOTE_ME(PROJECT_SCHEMA_PATH), localeStr); if (isLocaleStrAllocated) { g_free(localeStr); } if (!result) { return 1; } return 0; } ibus-chewing-1.4.14/src/generate-gsettings-schemas.c000066400000000000000000000043761244356534300223630ustar00rootroot00000000000000#include #include #include #include #include /* * Callback should be skipped */ #ifndef MKDG_SPEC_ONLY #define MKDG_SPEC_ONLY #endif #include "MakerDialogUtil.h" #include "MakerDialogProperty.h" #include "GSettingsBackend.h" #include "IBusChewingProperties.h" #define XML_BUFFER_SIZE 1000 #define DEFAULT_LOCALES "C;zh_TW" static gint verbose = WARN; static gchar *schemasFilename = NULL; static const GOptionEntry entries[] = { {"verbose", 'v', 0, G_OPTION_ARG_INT, &verbose, "Verbose level. The higher the level, the more the debug messages.", "[integer]"}, {NULL}, }; /** * write_gconf_schemas_file: * @filename: Filename for output. * * Output the parameters as GSettings schemes file. */ gboolean write_schemas_file(const gchar * filename) { mkdg_log(INFO, "write_schemes_file(%s,)", filename); FILE *outF = fopen(filename, "w"); if (outF == NULL) { mkdg_log(DEBUG, "write_gconf_schemas_file(%s) file %s cannot be written!", filename, filename); return FALSE; } gboolean result = mkdg_g_settings_write_schema_from_spec_array(QUOTE_ME (PROJECT_SCHEMA_ID), QUOTE_ME (PROJECT_SCHEMA_PATH), outF, propSpecs, QUOTE_ME (PROJECT_NAME)); if (fclose(outF)) return FALSE; mkdg_log(DEBUG, "write_gconf_schemas_file(%s) ... done.", filename); return result; } int main(gint argc, gchar * argv[]) { GError *error = NULL; GOptionContext *context; /* Init i18n messages */ setlocale(LC_ALL, ""); bindtextdomain(QUOTE_ME(PROJECT_NAME), QUOTE_ME(DATA_DIR) "/locale"); textdomain(QUOTE_ME(PROJECT_NAME)); context = g_option_context_new("schemasFile"); g_option_context_add_main_entries(context, entries, "ibus-chewing"); if (!g_option_context_parse(context, &argc, &argv, &error)) { g_print("Option parsing failed: %s\n", error->message); return 1; } g_option_context_free(context); if (argc < 2) { fprintf(stderr, "Specify filename of outputing schemas file!\n"); return 1; } mkdg_log_set_level(verbose); schemasFilename = argv[1]; gboolean result = write_schemas_file(schemasFilename); if (!result) { return 2; } return 0; } ibus-chewing-1.4.14/src/ibus-setup-chewing.c000066400000000000000000000071141244356534300206560ustar00rootroot00000000000000/* vim:set et sts=4: */ /* * Copyright © 2014 Red Hat, Inc. All rights reserved. * Copyright © 2014 Ding-Yi Chen * * This file is part of the ibus-chewing Project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include "MakerDialogUtil.h" #include "MakerDialogBackend.h" #ifdef GSETTINGS_SUPPORT #include "GSettingsBackend.h" #endif #ifdef GCONF2_SUPPORT #include "GConf2Backend.h" #endif #include "GConf2Backend.h" #include "IBusChewingProperties.h" #include "IBusChewingUtil.h" #include "maker-dialog.h" /* options */ static gboolean showFlags = FALSE; gint verbose = 0; static const GOptionEntry entries[] = { {"show_flags", 's', 0, G_OPTION_ARG_NONE, &showFlags, "Show compile flag only", NULL}, {"verbose", 'v', 0, G_OPTION_ARG_INT, &verbose, "Verbose level. The higher the level, the more the debug messages.", "[integer]"}, {NULL}, }; gint start_dialog() { #ifdef GSETTINGS_SUPPORT MkdgBackend *backend = mkdg_g_settings_backend_new(QUOTE_ME(PROJECT_SCHEMA_ID), QUOTE_ME(PROJECT_SCHEMA_DIR), NULL); #elif GCONF2_SUPPORT MkdgBackend *backend = gconf2_backend_new("/desktop/ibus/engine", NULL); #else MkdgBackend *backend = NULL; g_error("Flag GSETTINGS_SUPPORT or GCONF2_SUPPORT are required!"); return 1; #endif /* GSETTINGS_SUPPORT */ IBusChewingProperties *iProperties = ibus_chewing_properties_new(backend, NULL, NULL); MakerDialog *mDialog = maker_dialog_new_full(iProperties->properties, _("Setting"), MKDG_WIDGET_FLAG_SET_IMMEDIATELY, MKDG_BUTTON_FLAG_OK | MKDG_BUTTON_FLAG_CANCEL); GtkWidget *sDialog = GTK_WIDGET(mDialog); gtk_widget_show_all(sDialog); gint result = gtk_dialog_run(GTK_DIALOG(sDialog)); gtk_widget_hide(sDialog); if (result != GTK_RESPONSE_OK) { return 3; } maker_dialog_save_all_widgets_values(mDialog,NULL); return 0; } gint main(gint argc, gchar * argv[]) { GError *error = NULL; GOptionContext *context; gtk_init(&argc, &argv); /* Init i18n messages */ setlocale(LC_ALL, ""); bindtextdomain(QUOTE_ME(PROJECT_NAME), QUOTE_ME(DATA_DIR) "/locale"); textdomain(QUOTE_ME(PROJECT_NAME)); context = g_option_context_new("- ibus chewing engine setup"); g_option_context_add_main_entries(context, entries, QUOTE_ME(PROJECT_NAME)); if (!g_option_context_parse(context, &argc, &argv, &error)) { g_print("Option parsing failed: %s\n", error->message); exit(1); } g_option_context_free(context); if (showFlags) { printf("PROJECT_NAME=" QUOTE_ME(PROJECT_NAME) "\n"); printf("DATA_DIR=" QUOTE_ME(DATA_DIR) "\n"); printf("CHEWING_DATADIR_REAL=" QUOTE_ME(CHEWING_DATADIR_REAL) "\n"); return 0; } mkdg_log_set_level(verbose); return start_dialog(); } /* vim:set et sts=4: */ ibus-chewing-1.4.14/src/main.c000066400000000000000000000124721244356534300160630ustar00rootroot00000000000000/* vim:set et sts=4: */ /* * Copyright © 2009 Red Hat, Inc. All rights reserved. * Copyright © 2009 Ding-Yi Chen * * This file is part of the ibus-chewing Project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include "ibus-chewing-engine.h" #include "IBusChewingUtil.h" #include "maker-dialog.h" MakerDialog *makerDialog = NULL; static IBusBus *bus = NULL; static IBusFactory *factory = NULL; /* options */ static gboolean showFlags = FALSE; static gboolean ibus = FALSE; static gboolean xml = FALSE; gint ibus_chewing_verbose = VERBOSE_LEVEL; static const GOptionEntry entries[] = { {"show_flags", 's', 0, G_OPTION_ARG_NONE, &showFlags, "Show compile flag only", NULL}, {"ibus", 'i', 0, G_OPTION_ARG_NONE, &ibus, "component is executed by ibus", NULL}, {"verbose", 'v', 0, G_OPTION_ARG_INT, &ibus_chewing_verbose, "Verbose level. The higher the level, the more the debug messages.", "[integer]"}, {"xml", 'x', 0, G_OPTION_ARG_NONE, &xml, "read chewing engine desc from xml file", NULL}, {NULL}, }; static void ibus_disconnected_cb(IBusBus * bus, gpointer user_data) { g_debug("bus disconnected"); ibus_quit(); } static void start_component(void) { IBUS_CHEWING_LOG(INFO, "start_component"); ibus_init(); bus = ibus_bus_new(); g_signal_connect(bus, "disconnected", G_CALLBACK(ibus_disconnected_cb), NULL); factory = ibus_factory_new(ibus_bus_get_connection(bus)); ibus_factory_add_engine(factory, "chewing", IBUS_TYPE_CHEWING_ENGINE); if (ibus) { ibus_bus_request_name(bus, QUOTE_ME(PROJECT_SCHEMA_ID), 0); } else { IBusComponent *component = NULL; if (xml) { component = ibus_component_new_from_file(QUOTE_ME(DATA_DIR) "/ibus/component/chewing.xml"); } else { component = ibus_component_new(QUOTE_ME(PROJECT_SCHEMA_ID), _("Chewing component"), QUOTE_ME(PRJ_VER), "GPLv2+", _("Peng Huang, Ding-Yi Chen"), "http://code.google.com/p/ibus", QUOTE_ME(LIBEXEC_DIR) "/ibus-engine-chewing --ibus", QUOTE_ME(PROJECT_NAME)); } IBusEngineDesc *engineDesc = ibus_engine_desc_new_varargs("name", "chewing", "longname", _("Chewing"), "description", _("Chinese chewing input method"), "language", "zh_TW", "license", "GPLv2+", "author", _("Peng Huang, Ding-Yi Chen"), "icon", QUOTE_ME(PRJ_DATA_DIR) "/icons/" QUOTE_ME(PROJECT_NAME) ".png", "layout", "us", "setup", QUOTE_ME(LIBEXEC_DIR) "/ibus-setup-chewing", "version", QUOTE_ME(PRJ_VER), "textdomain", QUOTE_ME(PROJECT_NAME), NULL); ibus_component_add_engine(component, engineDesc); ibus_bus_register_component(bus, component); } ibus_main(); } const char *locale_env_strings[] = { "LC_ALL", "LANG", "LANGUAGE", "GDM_LANG", NULL }; void determine_locale() { #ifndef STRING_BUFFER_SIZE #define STRING_BUFFER_SIZE 100 #endif gchar *localePtr = NULL; gchar localeStr[STRING_BUFFER_SIZE]; int i; for (i = 0; locale_env_strings[i] != NULL; i++) { if (getenv(locale_env_strings[i])) { localePtr = getenv(locale_env_strings[i]); break; } } if (!localePtr) { localePtr = "en_US.utf8"; } /* Use UTF8 as charset unconditionally */ for (i = 0; localePtr[i] != '\0'; i++) { if (localePtr[i] == '.') break; localeStr[i] = localePtr[i]; } localeStr[i] = '\0'; g_strlcat(localeStr, ".utf8", STRING_BUFFER_SIZE); #undef STRING_BUFFER_SIZE setlocale(LC_ALL, localeStr); IBUS_CHEWING_LOG(INFO, "determine_locale %s", localeStr); } int main(gint argc, gchar * argv[]) { GError *error = NULL; GOptionContext *context; gtk_init(&argc, &argv); /* Init i18n messages */ setlocale(LC_ALL, ""); bindtextdomain(QUOTE_ME(PROJECT_NAME), QUOTE_ME(DATA_DIR) "/locale"); textdomain(QUOTE_ME(PROJECT_NAME)); determine_locale(); context = g_option_context_new("- ibus chewing engine component"); g_option_context_add_main_entries(context, entries, QUOTE_ME(PROJECT_NAME)); if (!g_option_context_parse(context, &argc, &argv, &error)) { g_print("Option parsing failed: %s\n", error->message); exit(-1); } g_option_context_free(context); mkdg_log_set_level(ibus_chewing_verbose); if (showFlags) { printf("PROJECT_NAME=" QUOTE_ME(PROJECT_NAME) "\n"); printf("DATA_DIR=" QUOTE_ME(DATA_DIR) "\n"); printf("CHEWING_DATADIR_REAL=" QUOTE_ME(CHEWING_DATADIR_REAL) "\n"); } else { start_component(); } return 0; } ibus-chewing-1.4.14/test/000077500000000000000000000000001244356534300151555ustar00rootroot00000000000000ibus-chewing-1.4.14/test/CMakeLists.txt000066400000000000000000000054151244356534300177220ustar00rootroot00000000000000# Location of library include files INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}/bin ) ADD_DEFINITIONS("-DUNIT_TEST=1") FOREACH(_d ${IBUS_CHEWING_DEPENDENCIES}) INCLUDE_DIRECTORIES(${${_d}_INCLUDE_DIRS}) LINK_DIRECTORIES(${${_d}_LIBRARY_DIRS}) ENDFOREACH(_d ${IBUS_CHEWING_DEPENDENCIES}) SET_SOURCE_FILES_PROPERTIES(${GOB_GENERATED_ibus-chewing-engine} ${GOB_GENERATED_maker-dialog} PROPERTIES GENERATED true ) #=========================================== # MakerDialogUtil # SET(MAKER_DIALOG_UTIL MakerDialogUtil) ADD_EXECUTABLE(${MAKER_DIALOG_UTIL}-test ${CMAKE_CURRENT_SOURCE_DIR}/${MAKER_DIALOG_UTIL}-test.c ${CMAKE_SOURCE_DIR}/src/${MAKER_DIALOG_UTIL}.c ) MESSAGE("test GLIB2_LIBRARIES=${GLIB2_LIBRARIES}") TARGET_LINK_LIBRARIES(${MAKER_DIALOG_UTIL}-test ${GLIB2_LIBRARIES} ) ADD_TEST("${MAKER_DIALOG_UTIL}" gtester ${CMAKE_CURRENT_BINARY_DIR}/${MAKER_DIALOG_UTIL}-test ) #=========================================== # MakerDialogBackend # SET(MAKER_DIALOG_BACKEND MakerDialogBackend) ADD_EXECUTABLE(${MAKER_DIALOG_BACKEND}-test ${CMAKE_CURRENT_SOURCE_DIR}/${MAKER_DIALOG_BACKEND}-test.c ${CMAKE_SOURCE_DIR}/src/GSettingsBackend.c ${CMAKE_SOURCE_DIR}/src/MakerDialogBackend.c ${CMAKE_SOURCE_DIR}/src/MakerDialogProperty.c ${CMAKE_SOURCE_DIR}/src/MakerDialogUtil.c ) MESSAGE("test GLIB2_LIBRARIES=${GLIB2_LIBRARIES}") TARGET_LINK_LIBRARIES(${MAKER_DIALOG_BACKEND}-test ${GLIB2_LIBRARIES} ) ADD_TEST("${MAKER_DIALOG_BACKEND}" gtester ${CMAKE_CURRENT_BINARY_DIR}/${MAKER_DIALOG_BACKEND}-test ) #=========================================== # IBusChewingPreEdit # SET(IBUS_CHEWING_PRE_EDIT IBusChewingPreEdit) ADD_EXECUTABLE(${IBUS_CHEWING_PRE_EDIT}-test ${CMAKE_CURRENT_SOURCE_DIR}/${IBUS_CHEWING_PRE_EDIT}-test.c ${CMAKE_SOURCE_DIR}/src/IBusChewingUtil.c ${COMMON_SOURCE_FILES} ${CMAKE_SOURCE_DIR}/src/${IBUS_CHEWING_PRE_EDIT}.c ) TARGET_LINK_LIBRARIES(${IBUS_CHEWING_PRE_EDIT}-test ${GLIB2_LIBRARIES} ${CHEWING_LIBRARIES} ${IBUS_LIBRARIES} ${X11_LIBRARIES} ) ADD_TEST("${IBUS_CHEWING_PRE_EDIT}" gtester ${CMAKE_CURRENT_BINARY_DIR}/${IBUS_CHEWING_PRE_EDIT}-test ) #=========================================== # IBusChewingEngine # SET(IBUS_ENGINE_CHEWING ibus-chewing-engine) ADD_EXECUTABLE(${IBUS_ENGINE_CHEWING}-test ${CMAKE_CURRENT_SOURCE_DIR}/${IBUS_ENGINE_CHEWING}-test.c ${IBUS_ENGINE_CHEWING_SOURCE_FILES} ${GOB_GENERATED_ibus-chewing-engine} ${GOB_GENERATED_maker-dialog} ) TARGET_LINK_LIBRARIES(${IBUS_ENGINE_CHEWING}-test ${IBUS_ENGINE_CHEWING_LIBRARIES} ) ADD_TEST("${IBUS_ENGINE_CHEWING}" gtester ${CMAKE_CURRENT_BINARY_DIR}/${IBUS_ENGINE_CHEWING}-test ) ibus-chewing-1.4.14/test/IBusChewingPreEdit-test.c000066400000000000000000000242701244356534300217270ustar00rootroot00000000000000#include #include #include "IBusChewingPreEdit.h" #include "IBusChewingUtil.h" #ifdef GSETTINGS_SUPPORT #include "GSettingsBackend.h" #elif GCONF2_SUPPORT #include "GConf2Backend.h" #endif #include "MakerDialogUtil.h" #include "test-util.h" #define TEST_RUN_THIS(f) add_test_case("IBusChewingPreEdit", f) static IBusChewingPreEdit *self = NULL; void free_test() { ibus_chewing_pre_edit_free(self); } void key_press_from_key_sym(KSym keySym, KeyModifiers modifiers) { switch (keySym) { case IBUS_KEY_Shift_L: case IBUS_KEY_Shift_R: ibus_chewing_pre_edit_process_key(self, keySym, modifiers); ibus_chewing_pre_edit_process_key(self, keySym, modifiers | IBUS_RELEASE_MASK | IBUS_SHIFT_MASK); break; default: if (modifiers & IBUS_SHIFT_MASK) { ibus_chewing_pre_edit_process_key(self, IBUS_KEY_Shift_L, 0); } ibus_chewing_pre_edit_process_key(self, keySym, modifiers); ibus_chewing_pre_edit_process_key(self, keySym, modifiers | IBUS_RELEASE_MASK); if (modifiers & IBUS_SHIFT_MASK) { ibus_chewing_pre_edit_process_key(self, IBUS_KEY_Shift_L, IBUS_SHIFT_MASK | IBUS_RELEASE_MASK); } break; } printf ("key_press_from_key_sym(%x(%s),%x), buffer=|%s| outgoing=|%s|\n", keySym, key_sym_get_name(keySym), modifiers, ibus_chewing_pre_edit_get_pre_edit(self), ibus_chewing_pre_edit_get_outgoing(self)); } void key_press_from_string(const gchar * keySeq) { gint i; for (i = 0; i < strlen(keySeq); i++) { key_press_from_key_sym((guint) keySeq[i], 0); } } void assert_substring(const gchar * haystack, const gchar * needle, gint begin, gint length) { gchar *subStr = g_utf8_substring(haystack, begin, begin + length); g_assert_cmpstr(subStr, ==, needle); g_free(subStr); } #define assert_pre_edit_substring(needle, begin, length) assert_substring(ibus_chewing_pre_edit_get_pre_edit(self), needle, begin, length) void assert_outgoing_pre_edit(const gchar * outgoing, const gchar * pre_edit) { g_assert_cmpstr(outgoing, ==, ibus_chewing_pre_edit_get_outgoing(self)); g_assert_cmpstr(pre_edit, ==, ibus_chewing_pre_edit_get_pre_edit(self)); } /* Chinese mode: "中文" (5j/ jp6) and Enter*/ void process_key_normal_test() { key_press_from_string("5j/ jp6"); assert_outgoing_pre_edit("", "中文"); g_assert_cmpint(2, ==, self->wordLen); key_press_from_key_sym(IBUS_KEY_Return, 0); assert_outgoing_pre_edit("中文", ""); g_assert_cmpint(0, ==, self->wordLen); ibus_chewing_pre_edit_clear(self); assert_outgoing_pre_edit("", ""); } /* 他不重,他是我兄弟。 */ void process_key_text_with_symbol_test() { key_press_from_string("w8 "); key_press_from_key_sym(IBUS_KEY_Down, 0); key_press_from_string("2"); key_press_from_string("1j65j/4"); key_press_from_key_sym(IBUS_KEY_Down, 0); key_press_from_string("3"); key_press_from_key_sym(IBUS_KEY_less, IBUS_SHIFT_MASK); key_press_from_string("w8 g4ji3vm/ 2u4"); key_press_from_key_sym(IBUS_KEY_greater, IBUS_SHIFT_MASK); key_press_from_key_sym(IBUS_KEY_Return, 0); assert_outgoing_pre_edit("他不重,他是我兄弟。", ""); ibus_chewing_pre_edit_clear(self); assert_outgoing_pre_edit("", ""); } /* Mix english and chinese */ /* " 這是ibus-chewing 輸入法"*/ void process_key_mix_test() { key_press_from_string("5k4g4"); key_press_from_key_sym(IBUS_KEY_Shift_L, 0); key_press_from_string("ibus-chewing "); key_press_from_key_sym(IBUS_KEY_Shift_L, 0); key_press_from_string("gj bj4z83"); key_press_from_key_sym(IBUS_KEY_Return, 0); assert_outgoing_pre_edit("這是ibus-chewing 輸入法", ""); ibus_chewing_pre_edit_clear(self); assert_outgoing_pre_edit("", ""); } void process_key_incomplete_char_test() { key_press_from_string("u"); ibus_chewing_pre_edit_force_commit(self); assert_outgoing_pre_edit("ㄧ", ""); ibus_chewing_pre_edit_clear(self); assert_outgoing_pre_edit("", ""); } void process_key_buffer_full_handling_test() { key_press_from_string("ji3ru8 ap6fu06u.3vul3ck6"); key_press_from_key_sym(',', IBUS_SHIFT_MASK); key_press_from_string("c.4au04u.3g0 qi "); key_press_from_key_sym(IBUS_KEY_Return, 0); assert_outgoing_pre_edit("我家門前有小河,後面有山坡", ""); ibus_chewing_pre_edit_clear(self); assert_outgoing_pre_edit("", ""); } /* 程式 */ void process_key_down_arrow_test() { ibus_chewing_pre_edit_set_apply_property_boolean(self, "plain-zhuyin", FALSE); key_press_from_string("t/6g4"); key_press_from_key_sym(IBUS_KEY_Down, 0); key_press_from_string("1"); assert_outgoing_pre_edit("", "城市"); key_press_from_key_sym(IBUS_KEY_Down, 0); key_press_from_string("2"); assert_outgoing_pre_edit("", "程式"); key_press_from_key_sym(IBUS_KEY_Down, 0); key_press_from_key_sym(IBUS_KEY_Down, 0); key_press_from_string("4"); assert_pre_edit_substring("世", 1, 1); ibus_chewing_pre_edit_clear(self); assert_outgoing_pre_edit("", ""); } void full_half_shape_test() { ibus_chewing_pre_edit_set_apply_property_boolean(self, "plain-zhuyin", FALSE); g_assert(ibus_chewing_pre_edit_get_chi_eng_mode(self)); ibus_chewing_pre_edit_toggle_chi_eng_mode(self); g_assert(!ibus_chewing_pre_edit_get_chi_eng_mode(self)); key_press_from_key_sym(IBUS_KEY_space, IBUS_SHIFT_MASK); g_assert(chewing_get_ShapeMode(self->context)); key_press_from_string("ab "); assert_outgoing_pre_edit("ab ", ""); key_press_from_key_sym(IBUS_KEY_space, IBUS_SHIFT_MASK); g_assert(!chewing_get_ShapeMode(self->context)); ibus_chewing_pre_edit_clear(self); assert_outgoing_pre_edit("", ""); ibus_chewing_pre_edit_toggle_chi_eng_mode(self); } void plain_zhuyin_test() { ibus_chewing_pre_edit_set_apply_property_boolean(self, "plain-zhuyin", TRUE); g_assert(ibus_chewing_pre_edit_get_property_boolean (self, "plain-zhuyin")); key_press_from_string("y "); /* Candidate window should be shown */ g_assert(ibus_chewing_pre_edit_has_flag(self, FLAG_TABLE_SHOW)); /* The default is the most frequently used character, not * necessary "資" */ /* assert_outgoing_pre_edit("","資"); */ key_press_from_string("4"); assert_outgoing_pre_edit("吱", ""); /* Candidate window should be hidden */ g_assert(!ibus_chewing_pre_edit_has_flag(self, FLAG_TABLE_SHOW)); ibus_chewing_pre_edit_clear(self); assert_outgoing_pre_edit("", ""); } /* 你好,*/ void plain_zhuyin_shift_symbol_test() { ibus_chewing_pre_edit_set_apply_property_boolean(self, "plain-zhuyin", TRUE); g_assert(ibus_chewing_pre_edit_get_property_boolean (self, "plain-zhuyin")); ibus_chewing_pre_edit_set_apply_property_boolean(self, "shift-toggle-chinese", TRUE); key_press_from_string("su31cl31"); /* , */ key_press_from_key_sym(IBUS_KEY_less, IBUS_SHIFT_MASK); /* Candidate window should be shown */ g_assert(ibus_chewing_pre_edit_has_flag(self, FLAG_TABLE_SHOW)); key_press_from_string("1"); /* Candidate window should be hidden */ g_assert(!ibus_chewing_pre_edit_has_flag(self, FLAG_TABLE_SHOW)); assert_outgoing_pre_edit("你好,", ""); /* 打電話 */ key_press_from_string("28312u041cj841"); assert_outgoing_pre_edit("你好,打電話", ""); /* ; */ key_press_from_key_sym(IBUS_KEY_quotedbl, IBUS_SHIFT_MASK); key_press_from_string("1"); assert_outgoing_pre_edit("你好,打電話;", ""); /* Mix with shift */ key_press_from_key_sym(IBUS_KEY_Shift_L, IBUS_SHIFT_MASK); /* String is bypass in English mode */ key_press_from_string("4321-9876 "); assert_outgoing_pre_edit("你好,打電話;4321-9876 ", ""); key_press_from_key_sym(IBUS_KEY_Shift_L, IBUS_SHIFT_MASK); /* "來訂餐" */ key_press_from_string("x9612u/42h0 2"); assert_outgoing_pre_edit("你好,打電話;4321-9876 來訂餐", ""); ibus_chewing_pre_edit_clear(self); assert_outgoing_pre_edit("", ""); } void plain_zhuyin_full_half_shape_test() { ibus_chewing_pre_edit_set_apply_property_boolean(self, "plain-zhuyin", TRUE); g_assert(ibus_chewing_pre_edit_get_chi_eng_mode(self)); ibus_chewing_pre_edit_toggle_chi_eng_mode(self); g_assert(!ibus_chewing_pre_edit_get_chi_eng_mode(self)); key_press_from_key_sym(IBUS_KEY_space, IBUS_SHIFT_MASK); g_assert(chewing_get_ShapeMode(self->context)); key_press_from_string("ab "); assert_outgoing_pre_edit("ab ", ""); key_press_from_key_sym(IBUS_KEY_space, IBUS_SHIFT_MASK); g_assert(!chewing_get_ShapeMode(self->context)); ibus_chewing_pre_edit_clear(self); assert_outgoing_pre_edit("", ""); } gint main(gint argc, gchar ** argv) { g_test_init(&argc, &argv, NULL); #ifdef GSETTINGS_SUPPORT MkdgBackend *backend = mkdg_g_settings_backend_new(QUOTE_ME(PROJECT_SCHEMA_ID), QUOTE_ME(PROJECT_SCHEMA_DIR), NULL); #elif GCONF2_SUPPORT MkdgBackend *backend = gconf2_backend_new("/desktop/ibus/engine", NULL); #else MkdgBackend *backend = NULL; g_error("Flag GSETTINGS_SUPPORT or GCONF2_SUPPORT are required!"); return 1; #endif /* GSETTINGS_SUPPORT */ mkdg_log_set_level(DEBUG); self = ibus_chewing_pre_edit_new(backend); ibus_chewing_pre_edit_set_apply_property_int(self, "max-chi-symbol-len", 8); ibus_chewing_pre_edit_set_apply_property_string(self, "sel-keys", "1234567890"); ibus_chewing_pre_edit_set_apply_property_boolean(self, "plain-zhuyin", FALSE); g_assert(self != NULL); TEST_RUN_THIS(process_key_normal_test); TEST_RUN_THIS(process_key_text_with_symbol_test); TEST_RUN_THIS(process_key_mix_test); TEST_RUN_THIS(process_key_incomplete_char_test); TEST_RUN_THIS(process_key_buffer_full_handling_test); TEST_RUN_THIS(process_key_down_arrow_test); TEST_RUN_THIS(full_half_shape_test); TEST_RUN_THIS(plain_zhuyin_test); TEST_RUN_THIS(plain_zhuyin_shift_symbol_test); TEST_RUN_THIS(plain_zhuyin_full_half_shape_test); TEST_RUN_THIS(free_test); return g_test_run(); } ibus-chewing-1.4.14/test/MakerDialogBackend-test.c000066400000000000000000000133661244356534300217360ustar00rootroot00000000000000#include #include #include #include #include "test-util.h" #include "MakerDialogUtil.h" #include "MakerDialogBackend.h" #ifdef GSETTINGS_SUPPORT #include "GSettingsBackend.h" #elif GCONF2_SUPPORT #include "GConf2Backend.h" #endif #define TEST_RUN_THIS(f) add_test_case("MakerDialogBackend", f) MkdgBackend *backend = NULL; #define COMMAND_BUFFER_SIZE 200 #define FILE_BUFFER_SIZE 1024 gchar *command_run_obtain_output(const gchar *cmd) { static gchar readBuffer[FILE_BUFFER_SIZE]; FILE *stream = popen(cmd, "r"); if (stream == NULL) { g_error("Cannot pipe from command %s",cmd); exit(3); } gchar *line = fgets(readBuffer, FILE_BUFFER_SIZE, stream); pclose(stream); if (line==NULL){ printf("### line=NULL\n"); }else{ line[strlen(line) - 1] = '\0'; printf("### line=%s\n", line); } return line; } GValue *gsettings_command_get_key_value(const gchar * key, GValue * value) { gchar cmdBuf[COMMAND_BUFFER_SIZE]; g_snprintf(cmdBuf, COMMAND_BUFFER_SIZE, "gsettings get %s %s", QUOTE_ME(PROJECT_SCHEMA_ID), key); gchar *ret=command_run_obtain_output(cmdBuf); if (G_VALUE_TYPE(value)==G_TYPE_UINT){ gint offset=strlen("uint32 "); ret+=offset; } mkdg_g_value_from_string(value, ret); return value; } void gsettings_command_set_key_value(const gchar * key, GValue * value) { gchar *valueStr=mkdg_g_value_to_string(value); if (mkdg_g_value_is_boolean(value)){ valueStr=(g_value_get_boolean(value))? "true" : "false"; } gchar cmdBuf[COMMAND_BUFFER_SIZE]; g_snprintf(cmdBuf, COMMAND_BUFFER_SIZE, "gsettings set %s %s %s", QUOTE_ME(PROJECT_SCHEMA_ID), key, valueStr); command_run_obtain_output(cmdBuf); } gboolean mkdg_g_value_is_equal(GValue * value1, GValue * value2) { switch (G_VALUE_TYPE(value1)) { case G_TYPE_BOOLEAN: return (g_value_get_boolean(value1) == g_value_get_boolean(value2)); case G_TYPE_INT: return (g_value_get_int(value1) == g_value_get_int(value2)); case G_TYPE_UINT: return (g_value_get_uint(value1) == g_value_get_uint(value2)); case G_TYPE_STRING: return (STRING_EQUALS (g_value_get_string(value1), g_value_get_string(value2))); default: break; } return FALSE; } void backup_key_to_g_value(const gchar *key, GType gType, GValue *value) { g_value_init(value, gType); gsettings_command_get_key_value(key, value); } void change_new_value_from_orig_value(GValue *newValue, GValue *origValue) { g_value_init(newValue, G_VALUE_TYPE(origValue)); gchar *tempStr=NULL; switch (G_VALUE_TYPE(origValue)) { case G_TYPE_BOOLEAN: g_value_set_boolean(newValue, !g_value_get_boolean(origValue)); break; case G_TYPE_INT: g_value_set_int(newValue, (g_value_get_int(origValue)>0) ? g_value_get_int(origValue)-1 : g_value_get_int(origValue)+1); break; case G_TYPE_UINT: g_value_set_uint(newValue, (g_value_get_uint(origValue)>0) ? g_value_get_uint(origValue)-1 : g_value_get_uint(origValue)+1); break; case G_TYPE_STRING: tempStr=g_strdup_printf("%sx", g_value_get_string(origValue)); g_value_set_string(newValue, tempStr); break; default: break; } } void write_key_with_g_value(const gchar *key, GValue *value) { mkdg_backend_write(backend, value, QUOTE_ME(PROJECT_SCHEMA_DIR), key, NULL); } void assert_new_value_is_written(const gchar *key, GValue *newValue) { GValue storedGValue = { 0 }; g_value_init(&storedGValue, G_VALUE_TYPE(newValue)); gsettings_command_get_key_value(key, &storedGValue); g_assert(mkdg_g_value_is_equal(newValue, &storedGValue)); g_value_unset(&storedGValue); } void write_test(const gchar *key, GType gType) { GValue origGValue = {0}; backup_key_to_g_value(key, gType, &origGValue); GValue newGValue = {0}; change_new_value_from_orig_value(&newGValue,&origGValue); write_key_with_g_value(key, &newGValue); assert_new_value_is_written(key,&newGValue); /* Restore the origValue */ write_key_with_g_value(key, &origGValue); g_value_unset(&origGValue); g_value_unset(&newGValue); } void write_boolean_test() { write_test("plain-zhuyin", G_TYPE_BOOLEAN); } void write_int_test() { write_test("max-chi-symbol-len", G_TYPE_INT); } void write_uint_test() { write_test("cand-per-page", G_TYPE_UINT); } void write_string_test() { write_test("max-chi-symbol-len", G_TYPE_INT); } void int_w_test() { #define GCONF_KEY "max-chi-symbol-len" GValue origValue = { 0 }; g_value_init(&origValue, G_TYPE_BOOLEAN); gsettings_command_get_key_value(GCONF_KEY, &origValue); GValue newValue = { 0 }; g_value_init(&newValue, G_TYPE_BOOLEAN); g_value_set_int(&newValue, !g_value_get_int(&origValue)); mkdg_backend_write(backend, &newValue, QUOTE_ME(PROJECT_SCHEMA_DIR), GCONF_KEY, NULL); GValue storedValue = { 0 }; g_value_init(&storedValue, G_TYPE_BOOLEAN); gsettings_command_get_key_value(GCONF_KEY, &storedValue); g_assert(mkdg_g_value_is_equal(&newValue, &storedValue)); /* Restore the original value */ gsettings_command_set_key_value(GCONF_KEY, &origValue); #undef GCONF_KEY } gint main(gint argc, gchar ** argv) { g_test_init(&argc, &argv, NULL); #ifdef GSETTINGS_SUPPORT backend = mkdg_g_settings_backend_new(QUOTE_ME(PROJECT_SCHEMA_ID), QUOTE_ME(PROJECT_SCHEMA_DIR), NULL); #elif GCONF2_SUPPORT backend = gconf2_backend_new("/desktop/ibus/engine", NULL); #else g_error("Flag GSETTINGS_SUPPORT or GCONF2_SUPPORT are required!"); return 2; #endif /* GSETTINGS_SUPPORT */ mkdg_log_set_level(DEBUG); TEST_RUN_THIS(write_boolean_test); TEST_RUN_THIS(write_int_test); TEST_RUN_THIS(write_uint_test); TEST_RUN_THIS(write_string_test); return g_test_run(); } ibus-chewing-1.4.14/test/MakerDialogUtil-test.c000066400000000000000000000067021244356534300213200ustar00rootroot00000000000000#include #include "test-util.h" #include "MakerDialogUtil.h" #define TEST_RUN_THIS(f) add_test_case("MakerDialogUtil", f) void mkdg_g_value_to_string_test() { /* Test int */ GValue intValue={0}; g_value_init(&intValue, G_TYPE_INT); g_value_set_int(&intValue, 0); g_assert_cmpstr("0", ==, mkdg_g_value_to_string(&intValue)); g_value_set_int(&intValue, -1); g_assert_cmpstr("-1", ==, mkdg_g_value_to_string(&intValue)); g_value_unset(&intValue); /* Test boolean */ GValue booleanValue={0}; g_value_init(&booleanValue, G_TYPE_BOOLEAN); g_value_set_boolean(&booleanValue, TRUE); g_assert_cmpstr("1", ==, mkdg_g_value_to_string(&booleanValue)); g_value_set_boolean(&booleanValue,FALSE); g_assert_cmpstr("0", ==, mkdg_g_value_to_string(&booleanValue)); g_value_unset(&booleanValue); } void mkdg_g_value_from_string_test() { /* Test int */ GValue intValue={0}; g_value_init(&intValue, G_TYPE_INT); mkdg_g_value_from_string(&intValue, "0"); g_assert_cmpint(0, ==, g_value_get_int(&intValue)); mkdg_g_value_from_string(&intValue, "-1"); g_assert_cmpint(-1, ==, g_value_get_int(&intValue)); g_value_unset(&intValue); /* Test boolean */ GValue booleanValue={0}; g_value_init(&booleanValue, G_TYPE_BOOLEAN); mkdg_g_value_from_string(&booleanValue, "1"); g_assert(g_value_get_boolean(&booleanValue)); mkdg_g_value_from_string(&booleanValue, "0"); g_assert(!g_value_get_boolean(&booleanValue)); mkdg_g_value_from_string(&booleanValue, "T"); g_assert(g_value_get_boolean(&booleanValue)); mkdg_g_value_from_string(&booleanValue, "F"); g_assert(!g_value_get_boolean(&booleanValue)); mkdg_g_value_from_string(&booleanValue, "true"); g_assert(g_value_get_boolean(&booleanValue)); mkdg_g_value_from_string(&booleanValue, "false"); g_assert(!g_value_get_boolean(&booleanValue)); g_value_unset(&booleanValue); } /************************************** * String Utility Macros */ void QUOTE_ME_test() { #define PRJ_TEST MKDG g_assert_cmpstr("MKDG",==,QUOTE_ME(PRJ_TEST)); #undef PRJ_TEST } void STRING_IS_EMPTY_test() { gchar *nulStr=NULL; g_assert( STRING_IS_EMPTY(nulStr)); g_assert( STRING_IS_EMPTY("")); g_assert(!STRING_IS_EMPTY("NULL")); } void STRING_EQUALS_test() { gchar *nulStr=NULL; g_assert(STRING_EQUALS("", "")); g_assert(!STRING_EQUALS("", nulStr)); g_assert(STRING_EQUALS(nulStr, nulStr)); g_assert(!STRING_EQUALS("HI","Hi")); g_assert(STRING_EQUALS("YO\"","YO\"")); } void mkdg_xml_attr_append_test() { #define BUFFER_SIZE 200 gchar buf[BUFFER_SIZE]; buf[0]='\0'; mkdg_xml_attr_append(buf, BUFFER_SIZE, "", NULL); g_assert_cmpstr("", == , buf); mkdg_xml_attr_append(buf, BUFFER_SIZE, "foo", NULL); g_assert_cmpstr("foo", == , buf); mkdg_xml_attr_append(buf, BUFFER_SIZE, "animal", "sheep"); g_assert_cmpstr("foo animal=\"sheep\"", == , buf); mkdg_xml_attr_append(buf, BUFFER_SIZE, "lang", "zh_TW"); g_assert_cmpstr("foo animal=\"sheep\" lang=\"zh_TW\"", == , buf); } gint main(gint argc, gchar ** argv) { g_test_init(&argc, &argv, NULL); TEST_RUN_THIS(mkdg_g_value_to_string_test); TEST_RUN_THIS(mkdg_g_value_from_string_test); TEST_RUN_THIS(QUOTE_ME_test); TEST_RUN_THIS(STRING_IS_EMPTY_test); #if 0 TEST_RUN_THIS(STRING_EQUALS_test); #endif TEST_RUN_THIS(mkdg_xml_attr_append_test); return g_test_run(); } ibus-chewing-1.4.14/test/ibus-chewing-engine-test.c000066400000000000000000000043721244356534300221330ustar00rootroot00000000000000#include #include "ibus-chewing-engine.h" #include "ibus-chewing-engine-private.h" #include "MakerDialogUtil.h" #include "test-util.h" #define TEST_RUN_THIS(f) add_test_case("ibus-chewing-engine", f) static IBusChewingEngine *engine = NULL; IBusChewingEngine *ibus_chewing_engine_new() { return (IBusChewingEngine *) g_object_new(IBUS_TYPE_CHEWING_ENGINE, NULL); } void check_output(const gchar * outgoing, const gchar * preEdit, const gchar * aux) { g_assert(engine->outgoingText); g_assert(engine->outgoingText->text); printf("outgoingText->text=%s\n", engine->outgoingText->text); g_assert_cmpstr(outgoing, ==, engine->outgoingText->text); printf("preEditText->text=%s\n", engine->preEditText->text); g_assert_cmpstr(preEdit, ==, engine->preEditText->text); printf("auxText->text=%s\n", engine->auxText->text); g_assert_cmpstr(aux, ==, engine->auxText->text); } void focus_out_then_focus_in_with_aux_text_test() { ibus_chewing_engine_set_status_flag(engine, ENGINE_FLAG_CAP_AUXILIARY_TEXT); ibus_chewing_engine_focus_in(engine); ibus_chewing_engine_enable(engine); ibus_chewing_engine_process_key_event(IBUS_ENGINE(engine), 'j', 0x24, 0); ibus_chewing_engine_process_key_event(IBUS_ENGINE(engine), 'j', 0x24, IBUS_RELEASE_MASK); check_output("", "ㄨ", "ㄨ"); /* focus out should not touch Texts */ ibus_chewing_engine_focus_out(engine); check_output("", "ㄨ", "ㄨ"); /* all should be clean */ ibus_chewing_engine_focus_in(engine); check_output("", "", ""); ibus_chewing_pre_edit_clear(engine->icPreEdit); check_output("", "", ""); } gint main(gint argc, gchar ** argv) { g_test_init(&argc, &argv, NULL); mkdg_log_set_level(DEBUG); engine = ibus_chewing_engine_new(); ibus_chewing_pre_edit_set_property_int(engine->icPreEdit, "max-chi-symbol-len", 8); ibus_chewing_pre_edit_apply_property(engine->icPreEdit, "max-chi-symbol-len"); ibus_chewing_pre_edit_set_property_boolean(engine->icPreEdit, "plain-zhuyin", FALSE); ibus_chewing_pre_edit_apply_property(engine->icPreEdit, "plain-zhuyin"); TEST_RUN_THIS(focus_out_then_focus_in_with_aux_text_test); return g_test_run(); } ibus-chewing-1.4.14/test/test-util.h000066400000000000000000000002731244356534300172620ustar00rootroot00000000000000#include "MakerDialogUtil.h" /** * Utility test macros and functions. */ #define add_test_case(item, testCase) g_test_add_func("/ibus-chewing/" item "/" QUOTE_ME(testCase), testCase)