pax_global_header00006660000000000000000000000064144234474540014525gustar00rootroot0000000000000052 comment=aa4b71c69cf9d77466e9c6713c99d6bdffee6a68 ibus-hangul-1.5.5/000077500000000000000000000000001442344745400137535ustar00rootroot00000000000000ibus-hangul-1.5.5/.gitignore000066400000000000000000000013101442344745400157360ustar00rootroot00000000000000*.pyc *.la *.lo *.loT *.o *.so *~ tags out Makefile.qmake Makefile Makefile.in .deps .libs ABOUT-NLS INSTALL aclocal.m4 autom4te.cache compile config.guess config.h config.h.in config.log config.rpath config.status config.sub configure depcomp gtk-doc.make install-sh libtool ltmain.sh missing stamp-h1 py-compile ibus-hangul*.tar.* ibus-hangul.spec # vim temp backup file .*.swp # files for data data/org.freedesktop.ibus.engine.hangul.metainfo.xml data/org.freedesktop.ibus.engine.hangul.metainfo.xml.h # files for po po/*.gmo po/*.pot po/stamp-po po/stamp-it # files for setup setup/config.py setup/ibus-setup-hangul # files for engine src/test.sh src/hangul.xml src/hangul.xml.in src/ibus-engine-hangul ibus-hangul-1.5.5/AUTHORS000066400000000000000000000001131442344745400150160ustar00rootroot00000000000000Huang Peng Choe Hwanjin ibus-hangul-1.5.5/COPYING000066400000000000000000000431031442344745400150070ustar00rootroot00000000000000 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-hangul-1.5.5/ChangeLog000066400000000000000000000000001442344745400155130ustar00rootroot00000000000000ibus-hangul-1.5.5/Makefile.am000066400000000000000000000032741442344745400160150ustar00rootroot00000000000000# vim:set noet ts=4: # # ibus-hangul - The Hangul engine for IBus # # Copyright (c) 2007-2008 Huang Peng # # 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. SUBDIRS = \ src \ tests \ setup \ icons \ data \ m4 \ po \ $(NULL) ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ autogen.sh \ ibus-hangul.spec.in \ $(NULL) noinst_DIST = \ $(NULL) DISTCLEANFILES = \ po/stamp-it \ $(NULL) rpm: dist @PACKAGE_NAME@.spec rpmbuild -bb \ --define "_sourcedir `pwd`" \ --define "_builddir `pwd`" \ --define "_srcrpmdir `pwd`" \ --define "_rpmdir `pwd`" \ --define "_specdir `pwd`" \ @PACKAGE_NAME@.spec srpm: dist @PACKAGE_NAME@.spec rpmbuild -bs \ --define "_sourcedir `pwd`" \ --define "_builddir `pwd`" \ --define "_srcrpmdir `pwd`" \ --define "_rpmdir `pwd`" \ --define "_specdir `pwd`" \ @PACKAGE_NAME@.spec clean-rpm: $(RM) -r "`uname -i`" clean-local: clean-rpm dist-hook: if test -d $(top_srcdir)/.git ; then \ git -C $(top_srcdir) log --name-status --date=iso > $(distdir)/ChangeLog ; \ fi ibus-hangul-1.5.5/NEWS000066400000000000000000000010021442344745400144430ustar00rootroot000000000000001.4.2 * Use Gobject Introspection * GNOME Control Center integration * Miscellaneous bug fixes 1.4.1 * Handle exceptions properly in ibus-setup-hangul https://github.com/choehwanjin/ibus-hangul/pull/5 * Update icon files * Support ibus icon symbol feature 1.4.0 * Require ibus 1.4 * Add desktop menu for ibus-setup-hangul * Add an option for automatic reordering * Add an option for a word preedit text * Update MS IME compatible symbol table * Use surrounding text feature on converting to hanja ibus-hangul-1.5.5/README000066400000000000000000000007311442344745400146340ustar00rootroot00000000000000ibus-hangul ----------- ibus-hangul is a Korean input method engine for IBus. The official web site is: ibus: https://github.com/ibus/ibus/wiki ibus-hangul: https://github.com/libhangul/ibus-hangul/wiki Installation ------------ ibus-hangul requires ibus. Install procedure: $ ./configure $ make $ make install Bug report ---------- https://github.com/libhangul/ibus-hangul/issues Download -------- https://github.com/libhangul/ibus-hangul/releases ibus-hangul-1.5.5/autogen.sh000077500000000000000000000020371442344745400157560ustar00rootroot00000000000000#!/bin/sh # Run this to generate all the initial makefiles, etc. test -n "$srcdir" || srcdir=$(dirname "$0") test -n "$srcdir" || srcdir=. olddir=$(pwd) cd "$srcdir" (test -f configure.ac) || { echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" echo " top-level $PKG_NAME directory" exit 1 } # shellcheck disable=SC2016 PKG_NAME=$(autoconf --trace 'AC_INIT:$1' configure.ac) if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then echo "*** WARNING: I am going to run 'configure' with no arguments." >&2 echo "*** If you wish to pass any to it, please specify them on the" >&2 echo "*** '$0' command line." >&2 echo "" >&2 fi aclocal --install || exit 1 autoreconf --verbose --force --install || exit 1 cd "$olddir" if [ "$NOCONFIGURE" = "" ]; then $srcdir/configure "$@" || exit 1 if [ "$1" = "--help" ]; then exit 0 else echo "Now type 'make' to compile $PKG_NAME" || exit 1 fi else echo "Skipping configure process." fi ibus-hangul-1.5.5/configure.ac000066400000000000000000000057751442344745400162570ustar00rootroot00000000000000# vim:set et ts=4: # # ibus-hangul - The Hangul engine for IBus # # Copyright (c) 2007-2008 Huang Peng # # 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. # if not 1, append datestamp to the version number. m4_define([ibus_released], [1]) m4_define([ibus_major_version], [1]) m4_define([ibus_minor_version], [5]) m4_define([ibus_micro_version], [5]) m4_define(ibus_maybe_datestamp, m4_esyscmd([if test x]ibus_released[ != x1; then date +.%Y%m%d | tr -d '\n\r'; fi])) m4_define([ibus_version], ibus_major_version.ibus_minor_version.ibus_micro_version[]ibus_maybe_datestamp) AC_INIT([ibus-hangul], [ibus_version], [https://github.com/libhangul/ibus-hangul/issues],[ibus-hangul]) AM_INIT_AUTOMAKE([1.10 no-dist-gzip dist-xz]) AC_GNU_SOURCE AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) # define PACKAGE_VERSION_* variables AS_VERSION AS_NANO AM_SANITY_CHECK AM_MAINTAINER_MODE AM_DISABLE_STATIC AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CXX AC_PROG_LN_S AC_PROG_MKDIR_P AC_ISC_POSIX AC_HEADER_STDC AM_PROG_LIBTOOL AM_GNU_GETTEXT_VERSION([0.19.8]) AM_GNU_GETTEXT([external]) # check ibus PKG_CHECK_MODULES(IBUS, [ ibus-1.0 >= 1.5.4 ]) # check libhangul PKG_CHECK_MODULES(HANGUL, [ libhangul >= 0.1.0 ]) # check gtk PKG_CHECK_MODULES(GTK, [ gtk+-3.0 >= 3.0.0 ]) # check env AC_PATH_PROG(ENV_PROG, env) AC_SUBST(ENV_PROG) # Define python version AC_ARG_WITH(python, AS_HELP_STRING([--with-python[=PATH]], [Select python2 or python3]), [PYTHON=$with_python], [] ) AM_PATH_PYTHON([2.5]) # define GETTEXT_* variables GETTEXT_PACKAGE=AC_PACKAGE_NAME AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED( GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Define to the read-only architecture-independent data directory.] ) # --enable-installed-tests AC_ARG_ENABLE(installed-tests, AS_HELP_STRING([--enable-installed-tests], [Enable to installed tests]), [enable_installed_tests=$enableval], [enable_installed_tests=no] ) AM_CONDITIONAL([ENABLE_INSTALLED_TESTS], [test x"$enable_installed_tests" = x"yes"]) if test x"$enable_installed_tests" = x"no"; then enable_installed_tests="no (disabled, use --enable-installed-tests to enable)" fi # OUTPUT files AC_CONFIG_FILES([ po/Makefile.in Makefile ibus-hangul.spec src/Makefile src/hangul.xml.in tests/Makefile setup/Makefile icons/Makefile data/Makefile m4/Makefile ]) AC_OUTPUT ibus-hangul-1.5.5/data/000077500000000000000000000000001442344745400146645ustar00rootroot00000000000000ibus-hangul-1.5.5/data/Makefile.am000066400000000000000000000035561442344745400167310ustar00rootroot00000000000000# vim:set noet ts=4: # # ibus-hangul - The Hangul engine for IBus # # Copyright (c) 2009 Choe Hwanjin # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library 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 Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, write to the # Free Software Foundation, Inc., 59 Temple Place, Suite 330, # Boston, MA 02111-1307 USA schemas_DATA = \ org.freedesktop.ibus.engine.hangul.gschema.xml $(NULL) schemasdir = $(datadir)/glib-2.0/schemas symboltable_DATA = \ symbol.txt \ $(NULL) symboltabledir = $(datadir)/ibus-hangul/data appstream_in_files = org.freedesktop.ibus.engine.hangul.metainfo.xml.in appstream_files = $(appstream_in_files:.xml.in=.xml) appstream_DATA = $(appstream_files) appstreamdir=$(datadir)/metainfo $(appstream_files): $(appstream_in_files) Makefile $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@ install-data-hook: if test -z "$(DESTDIR)"; then \ glib-compile-schemas $(schemasdir); \ fi uninstall-hook: SCHEMAS_FILES=`ls $(schemasdir)/*.gschema.xml` || true; \ if test -z "$$SCHEMAS_FILES" && \ test -f $(schemasdir)/gschemas.compiled; then \ rm $(schemasdir)/gschemas.compiled; \ fi EXTRA_DIST = \ $(schemas_DATA) \ $(symboltable_DATA) \ $(appstream_in_files) \ $(NULL) CLEANFILES = \ $(appstream_DATA) \ $(NULL) ibus-hangul-1.5.5/data/org.freedesktop.ibus.engine.hangul.gschema.xml000066400000000000000000000037721442344745400256100ustar00rootroot00000000000000 '2' Hangul keyboard 'latin' Initial input mode false Word commit true Auto reorder 'Hangul,Shift+space' Switch keys 'Hangul_Hanja,F9' Hanja keys '' On keys 'Escape' Off keys false Disable Latin mode true Enable event forwarding workaround 'syllable' Preedit mode ibus-hangul-1.5.5/data/org.freedesktop.ibus.engine.hangul.metainfo.xml.in000066400000000000000000000011671442344745400264040ustar00rootroot00000000000000 org.freedesktop.ibus.engine.hangul ibus-hangul CC0-1.0 GPL-2 Hangul engine for IBus

IBus-Hangul is a Korean input method engine for IBus.

IBus https://github.com/libhangul/ibus-hangul https://github.com/libhangul/ibus-hangul/issues ibus-hangul
ibus-hangul-1.5.5/data/symbol.txt000066400000000000000000000240171442344745400167360ustar00rootroot00000000000000# Copyright (c) 2005,2006 Choe Hwanjin # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # 3. Neither the name of the author nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. ㄱ: : ㄱ:!: ㄱ:': ㄱ:,: ㄱ:.: ㄱ:/: ㄱ::: ㄱ:;: ㄱ:?: ㄱ:^: ㄱ:_: ㄱ:`: ㄱ:|: ㄱ: ̄: ㄱ:、: ㄱ:。: ㄱ:·: ㄱ:‥: ㄱ:…: ㄱ:¨: ㄱ:〃: ㄱ:­: ㄱ:―: ㄱ:∥: ㄱ:\: ㄱ:∼: ㄱ:´: ㄱ:~: ㄱ:ˇ: ㄱ:˘: ㄱ:˝: ㄱ:˚: ㄱ:˙: ㄱ:¸: ㄱ:˛: ㄱ:¡: ㄱ:¿: ㄱ:ː: ㄲ:Æ: ㄲ:Ð: ㄲ:Ħ: ㄲ:IJ: ㄲ:Ŀ: ㄲ:Ł: ㄲ:Ø: ㄲ:Œ: ㄲ:Þ: ㄲ:Ŧ: ㄲ:Ŋ: ㄲ:æ: ㄲ:đ: ㄲ:ð: ㄲ:ħ: ㄲ:ı: ㄲ:ij: ㄲ:ĸ: ㄲ:ŀ: ㄲ:ł: ㄲ:ø: ㄲ:œ: ㄲ:ß: ㄲ:þ: ㄲ:ŧ: ㄲ:ŋ: ㄲ:ʼn: ㄴ:": ㄴ:(: ㄴ:): ㄴ:[: ㄴ:]: ㄴ:{: ㄴ:}: ㄴ:‘: ㄴ:’: ㄴ:“: ㄴ:”: ㄴ:〔: ㄴ:〕: ㄴ:〈: ㄴ:〉: ㄴ:《: ㄴ:》: ㄴ:「: ㄴ:」: ㄴ:『: ㄴ:』: ㄴ:【: ㄴ:】: ㄷ:+: ㄷ:-: ㄷ:<: ㄷ:=: ㄷ:>: ㄷ:±: ㄷ:×: ㄷ:÷: ㄷ:≠: ㄷ:≤: ㄷ:≥: ㄷ:∞: ㄷ:∴: ㄷ:♂: ㄷ:♀: ㄷ:∠: ㄷ:⊥: ㄷ:⌒: ㄷ:∂: ㄷ:∇: ㄷ:≡: ㄷ:≒: ㄷ:≪: ㄷ:≫: ㄷ:√: ㄷ:∽: ㄷ:∝: ㄷ:∵: ㄷ:∫: ㄷ:∬: ㄷ:∈: ㄷ:∋: ㄷ:⊆: ㄷ:⊇: ㄷ:⊂: ㄷ:⊃: ㄷ:∪: ㄷ:∩: ㄷ:∧: ㄷ:∨: ㄷ:¬: ㄷ:⇒: ㄷ:⇔: ㄷ:∀: ㄷ:∃: ㄷ:∮: ㄷ:∑: ㄷ:∏: ㄸ:ぁ: ㄸ:あ: ㄸ:ぃ: ㄸ:い: ㄸ:ぅ: ㄸ:う: ㄸ:ぇ: ㄸ:え: ㄸ:ぉ: ㄸ:お: ㄸ:か: ㄸ:が: ㄸ:き: ㄸ:ぎ: ㄸ:く: ㄸ:ぐ: ㄸ:け: ㄸ:げ: ㄸ:こ: ㄸ:ご: ㄸ:さ: ㄸ:ざ: ㄸ:し: ㄸ:じ: ㄸ:す: ㄸ:ず: ㄸ:せ: ㄸ:ぜ: ㄸ:そ: ㄸ:ぞ: ㄸ:た: ㄸ:だ: ㄸ:ち: ㄸ:ぢ: ㄸ:っ: ㄸ:つ: ㄸ:づ: ㄸ:て: ㄸ:で: ㄸ:と: ㄸ:ど: ㄸ:な: ㄸ:に: ㄸ:ぬ: ㄸ:ね: ㄸ:の: ㄸ:は: ㄸ:ば: ㄸ:ぱ: ㄸ:ひ: ㄸ:び: ㄸ:ぴ: ㄸ:ふ: ㄸ:ぶ: ㄸ:ぷ: ㄸ:へ: ㄸ:べ: ㄸ:ぺ: ㄸ:ほ: ㄸ:ぼ: ㄸ:ぽ: ㄸ:ま: ㄸ:み: ㄸ:む: ㄸ:め: ㄸ:も: ㄸ:ゃ: ㄸ:や: ㄸ:ゅ: ㄸ:ゆ: ㄸ:ょ: ㄸ:よ: ㄸ:ら: ㄸ:り: ㄸ:る: ㄸ:れ: ㄸ:ろ: ㄸ:ゎ: ㄸ:わ: ㄸ:ゐ: ㄸ:ゑ: ㄸ:を: ㄸ:ん: ㄹ:$: ㄹ:%: ㄹ:₩: ㄹ:F: ㄹ:′: ㄹ:″: ㄹ:℃: ㄹ:Å: ㄹ:¢: ㄹ:£: ㄹ:¥: ㄹ:¤: ㄹ:℉: ㄹ:‰: ㄹ:€: ㄹ:㎕: ㄹ:㎖: ㄹ:㎗: ㄹ:ℓ: ㄹ:㎘: ㄹ:㏄: ㄹ:㎣: ㄹ:㎤: ㄹ:㎥: ㄹ:㎦: ㄹ:㎙: ㄹ:㎚: ㄹ:㎛: ㄹ:㎜: ㄹ:㎝: ㄹ:㎞: ㄹ:㎟: ㄹ:㎠: ㄹ:㎡: ㄹ:㎢: ㄹ:㏊: ㄹ:㎍: ㄹ:㎎: ㄹ:㎏: ㄹ:㏏: ㄹ:㎈: ㄹ:㎉: ㄹ:㏈: ㄹ:㎧: ㄹ:㎨: ㄹ:㎰: ㄹ:㎱: ㄹ:㎲: ㄹ:㎳: ㄹ:㎴: ㄹ:㎵: ㄹ:㎶: ㄹ:㎷: ㄹ:㎸: ㄹ:㎹: ㄹ:㎀: ㄹ:㎁: ㄹ:㎂: ㄹ:㎃: ㄹ:㎄: ㄹ:㎺: ㄹ:㎻: ㄹ:㎼: ㄹ:㎽: ㄹ:㎾: ㄹ:㎿: ㄹ:㎐: ㄹ:㎑: ㄹ:㎒: ㄹ:㎓: ㄹ:㎔: ㄹ:Ω: ㄹ:㏀: ㄹ:㏁: ㄹ:㎊: ㄹ:㎋: ㄹ:㎌: ㄹ:㏖: ㄹ:㏅: ㄹ:㎭: ㄹ:㎮: ㄹ:㎯: ㄹ:㏛: ㄹ:㎩: ㄹ:㎪: ㄹ:㎫: ㄹ:㎬: ㄹ:㏝: ㄹ:㏐: ㄹ:㏓: ㄹ:㏃: ㄹ:㏉: ㄹ:㏜: ㄹ:㏆: ㅁ:#: ㅁ:&: ㅁ:*: ㅁ:@: ㅁ:§: ㅁ:※: ㅁ:☆: ㅁ:★: ㅁ:○: ㅁ:●: ㅁ:◎: ㅁ:◇: ㅁ:◆: ㅁ:□: ㅁ:■: ㅁ:△: ㅁ:▲: ㅁ:▽: ㅁ:▼: ㅁ:→: ㅁ:←: ㅁ:↑: ㅁ:↓: ㅁ:↔: ㅁ:〓: ㅁ:◁: ㅁ:◀: ㅁ:▷: ㅁ:▶: ㅁ:♤: ㅁ:♠: ㅁ:♡: ㅁ:♥: ㅁ:♧: ㅁ:♣: ㅁ:⊙: ㅁ:◈: ㅁ:▣: ㅁ:◐: ㅁ:◑: ㅁ:▒: ㅁ:▤: ㅁ:▥: ㅁ:▨: ㅁ:▧: ㅁ:▦: ㅁ:▩: ㅁ:♨: ㅁ:☏: ㅁ:☎: ㅁ:☜: ㅁ:☞: ㅁ:¶: ㅁ:†: ㅁ:‡: ㅁ:↕: ㅁ:↗: ㅁ:↙: ㅁ:↖: ㅁ:↘: ㅁ:♭: ㅁ:♩: ㅁ:♪: ㅁ:♬: ㅁ:㉿: ㅁ:㈜: ㅁ:№: ㅁ:㏇: ㅁ:™: ㅁ:㏂: ㅁ:㏘: ㅁ:℡: ㅁ:®: ㅁ:ª: ㅁ:º: ㅂ:─: ㅂ:│: ㅂ:┌: ㅂ:┐: ㅂ:┘: ㅂ:└: ㅂ:├: ㅂ:┬: ㅂ:┤: ㅂ:┴: ㅂ:┼: ㅂ:━: ㅂ:┃: ㅂ:┏: ㅂ:┓: ㅂ:┛: ㅂ:┗: ㅂ:┣: ㅂ:┳: ㅂ:┫: ㅂ:┻: ㅂ:╋: ㅂ:┠: ㅂ:┯: ㅂ:┨: ㅂ:┷: ㅂ:┿: ㅂ:┝: ㅂ:┰: ㅂ:┥: ㅂ:┸: ㅂ:╂: ㅂ:┒: ㅂ:┑: ㅂ:┚: ㅂ:┙: ㅂ:┖: ㅂ:┕: ㅂ:┎: ㅂ:┍: ㅂ:┞: ㅂ:┟: ㅂ:┡: ㅂ:┢: ㅂ:┦: ㅂ:┧: ㅂ:┩: ㅂ:┪: ㅂ:┭: ㅂ:┮: ㅂ:┱: ㅂ:┲: ㅂ:┵: ㅂ:┶: ㅂ:┹: ㅂ:┺: ㅂ:┽: ㅂ:┾: ㅂ:╀: ㅂ:╁: ㅂ:╃: ㅂ:╄: ㅂ:╅: ㅂ:╆: ㅂ:╇: ㅂ:╈: ㅂ:╉: ㅂ:╊: ㅃ:ァ: ㅃ:ア: ㅃ:ィ: ㅃ:イ: ㅃ:ゥ: ㅃ:ウ: ㅃ:ェ: ㅃ:エ: ㅃ:ォ: ㅃ:オ: ㅃ:カ: ㅃ:ガ: ㅃ:キ: ㅃ:ギ: ㅃ:ク: ㅃ:グ: ㅃ:ケ: ㅃ:ゲ: ㅃ:コ: ㅃ:ゴ: ㅃ:サ: ㅃ:ザ: ㅃ:シ: ㅃ:ジ: ㅃ:ス: ㅃ:ズ: ㅃ:セ: ㅃ:ゼ: ㅃ:ソ: ㅃ:ゾ: ㅃ:タ: ㅃ:ダ: ㅃ:チ: ㅃ:ヂ: ㅃ:ッ: ㅃ:ツ: ㅃ:ヅ: ㅃ:テ: ㅃ:デ: ㅃ:ト: ㅃ:ド: ㅃ:ナ: ㅃ:ニ: ㅃ:ヌ: ㅃ:ネ: ㅃ:ノ: ㅃ:ハ: ㅃ:バ: ㅃ:パ: ㅃ:ヒ: ㅃ:ビ: ㅃ:ピ: ㅃ:フ: ㅃ:ブ: ㅃ:プ: ㅃ:ヘ: ㅃ:ベ: ㅃ:ペ: ㅃ:ホ: ㅃ:ボ: ㅃ:ポ: ㅃ:マ: ㅃ:ミ: ㅃ:ム: ㅃ:メ: ㅃ:モ: ㅃ:ャ: ㅃ:ヤ: ㅃ:ュ: ㅃ:ユ: ㅃ:ョ: ㅃ:ヨ: ㅃ:ラ: ㅃ:リ: ㅃ:ル: ㅃ:レ: ㅃ:ロ: ㅃ:ヮ: ㅃ:ワ: ㅃ:ヰ: ㅃ:ヱ: ㅃ:ヲ: ㅃ:ン: ㅃ:ヴ: ㅃ:ヵ: ㅃ:ヶ: ㅅ:㉠: ㅅ:㉡: ㅅ:㉢: ㅅ:㉣: ㅅ:㉤: ㅅ:㉥: ㅅ:㉦: ㅅ:㉧: ㅅ:㉨: ㅅ:㉩: ㅅ:㉪: ㅅ:㉫: ㅅ:㉬: ㅅ:㉭: ㅅ:㉮: ㅅ:㉯: ㅅ:㉰: ㅅ:㉱: ㅅ:㉲: ㅅ:㉳: ㅅ:㉴: ㅅ:㉵: ㅅ:㉶: ㅅ:㉷: ㅅ:㉸: ㅅ:㉹: ㅅ:㉺: ㅅ:㉻: ㅅ:㈀: ㅅ:㈁: ㅅ:㈂: ㅅ:㈃: ㅅ:㈄: ㅅ:㈅: ㅅ:㈆: ㅅ:㈇: ㅅ:㈈: ㅅ:㈉: ㅅ:㈊: ㅅ:㈋: ㅅ:㈌: ㅅ:㈍: ㅅ:㈎: ㅅ:㈏: ㅅ:㈐: ㅅ:㈑: ㅅ:㈒: ㅅ:㈓: ㅅ:㈔: ㅅ:㈕: ㅅ:㈖: ㅅ:㈗: ㅅ:㈘: ㅅ:㈙: ㅅ:㈚: ㅅ:㈛: ㅆ:А: ㅆ:Б: ㅆ:В: ㅆ:Г: ㅆ:Д: ㅆ:Е: ㅆ:Ё: ㅆ:Ж: ㅆ:З: ㅆ:И: ㅆ:Й: ㅆ:К: ㅆ:Л: ㅆ:М: ㅆ:Н: ㅆ:О: ㅆ:П: ㅆ:Р: ㅆ:С: ㅆ:Т: ㅆ:У: ㅆ:Ф: ㅆ:Х: ㅆ:Ц: ㅆ:Ч: ㅆ:Ш: ㅆ:Щ: ㅆ:Ъ: ㅆ:Ы: ㅆ:Ь: ㅆ:Э: ㅆ:Ю: ㅆ:Я: ㅆ:а: ㅆ:б: ㅆ:в: ㅆ:г: ㅆ:д: ㅆ:е: ㅆ:ё: ㅆ:ж: ㅆ:з: ㅆ:и: ㅆ:й: ㅆ:к: ㅆ:л: ㅆ:м: ㅆ:н: ㅆ:о: ㅆ:п: ㅆ:р: ㅆ:с: ㅆ:т: ㅆ:у: ㅆ:ф: ㅆ:х: ㅆ:ц: ㅆ:ч: ㅆ:ш: ㅆ:щ: ㅆ:ъ: ㅆ:ы: ㅆ:ь: ㅆ:э: ㅆ:ю: ㅆ:я: ㅇ:ⓐ: ㅇ:ⓑ: ㅇ:ⓒ: ㅇ:ⓓ: ㅇ:ⓔ: ㅇ:ⓕ: ㅇ:ⓖ: ㅇ:ⓗ: ㅇ:ⓘ: ㅇ:ⓙ: ㅇ:ⓚ: ㅇ:ⓛ: ㅇ:ⓜ: ㅇ:ⓝ: ㅇ:ⓞ: ㅇ:ⓟ: ㅇ:ⓠ: ㅇ:ⓡ: ㅇ:ⓢ: ㅇ:ⓣ: ㅇ:ⓤ: ㅇ:ⓥ: ㅇ:ⓦ: ㅇ:ⓧ: ㅇ:ⓨ: ㅇ:ⓩ: ㅇ:①: ㅇ:②: ㅇ:③: ㅇ:④: ㅇ:⑤: ㅇ:⑥: ㅇ:⑦: ㅇ:⑧: ㅇ:⑨: ㅇ:⑩: ㅇ:⑪: ㅇ:⑫: ㅇ:⑬: ㅇ:⑭: ㅇ:⑮: ㅇ:⒜: ㅇ:⒝: ㅇ:⒞: ㅇ:⒟: ㅇ:⒠: ㅇ:⒡: ㅇ:⒢: ㅇ:⒣: ㅇ:⒤: ㅇ:⒥: ㅇ:⒦: ㅇ:⒧: ㅇ:⒨: ㅇ:⒩: ㅇ:⒪: ㅇ:⒫: ㅇ:⒬: ㅇ:⒭: ㅇ:⒮: ㅇ:⒯: ㅇ:⒰: ㅇ:⒱: ㅇ:⒲: ㅇ:⒳: ㅇ:⒴: ㅇ:⒵: ㅇ:⑴: ㅇ:⑵: ㅇ:⑶: ㅇ:⑷: ㅇ:⑸: ㅇ:⑹: ㅇ:⑺: ㅇ:⑻: ㅇ:⑼: ㅇ:⑽: ㅇ:⑾: ㅇ:⑿: ㅇ:⒀: ㅇ:⒁: ㅇ:⒂: ㅈ:0: ㅈ:1: ㅈ:2: ㅈ:3: ㅈ:4: ㅈ:5: ㅈ:6: ㅈ:7: ㅈ:8: ㅈ:9: ㅈ:ⅰ: ㅈ:ⅱ: ㅈ:ⅲ: ㅈ:ⅳ: ㅈ:ⅴ: ㅈ:ⅵ: ㅈ:ⅶ: ㅈ:ⅷ: ㅈ:ⅸ: ㅈ:ⅹ: ㅈ:Ⅰ: ㅈ:Ⅱ: ㅈ:Ⅲ: ㅈ:Ⅳ: ㅈ:Ⅴ: ㅈ:Ⅵ: ㅈ:Ⅶ: ㅈ:Ⅷ: ㅈ:Ⅸ: ㅈ:Ⅹ: ㅊ:½: ㅊ:⅓: ㅊ:⅔: ㅊ:¼: ㅊ:¾: ㅊ:⅛: ㅊ:⅜: ㅊ:⅝: ㅊ:⅞: ㅊ:¹: ㅊ:²: ㅊ:³: ㅊ:⁴: ㅊ:ⁿ: ㅊ:₁: ㅊ:₂: ㅊ:₃: ㅊ:₄: ㅋ:ㄱ: ㅋ:ㄲ: ㅋ:ㄳ: ㅋ:ㄴ: ㅋ:ㄵ: ㅋ:ㄶ: ㅋ:ㄷ: ㅋ:ㄸ: ㅋ:ㄹ: ㅋ:ㄺ: ㅋ:ㄻ: ㅋ:ㄼ: ㅋ:ㄽ: ㅋ:ㄾ: ㅋ:ㄿ: ㅋ:ㅀ: ㅋ:ㅁ: ㅋ:ㅂ: ㅋ:ㅃ: ㅋ:ㅄ: ㅋ:ㅅ: ㅋ:ㅆ: ㅋ:ㅇ: ㅋ:ㅈ: ㅋ:ㅉ: ㅋ:ㅊ: ㅋ:ㅋ: ㅋ:ㅌ: ㅋ:ㅍ: ㅋ:ㅎ: ㅋ:ㅏ: ㅋ:ㅐ: ㅋ:ㅑ: ㅋ:ㅒ: ㅋ:ㅓ: ㅋ:ㅔ: ㅋ:ㅕ: ㅋ:ㅖ: ㅋ:ㅗ: ㅋ:ㅘ: ㅋ:ㅙ: ㅋ:ㅚ: ㅋ:ㅛ: ㅋ:ㅜ: ㅋ:ㅝ: ㅋ:ㅞ: ㅋ:ㅟ: ㅋ:ㅠ: ㅋ:ㅡ: ㅋ:ㅢ: ㅋ:ㅣ: ㅌ:ㅥ: ㅌ:ㅦ: ㅌ:ㅧ: ㅌ:ㅨ: ㅌ:ㅩ: ㅌ:ㅪ: ㅌ:ㅫ: ㅌ:ㅬ: ㅌ:ㅭ: ㅌ:ㅮ: ㅌ:ㅯ: ㅌ:ㅰ: ㅌ:ㅱ: ㅌ:ㅲ: ㅌ:ㅳ: ㅌ:ㅴ: ㅌ:ㅵ: ㅌ:ㅶ: ㅌ:ㅷ: ㅌ:ㅸ: ㅌ:ㅹ: ㅌ:ㅺ: ㅌ:ㅻ: ㅌ:ㅼ: ㅌ:ㅽ: ㅌ:ㅾ: ㅌ:ㅿ: ㅌ:ㆀ: ㅌ:ㆁ: ㅌ:ㆂ: ㅌ:ㆃ: ㅌ:ㆄ: ㅌ:ㆅ: ㅌ:ㆆ: ㅌ:ㆇ: ㅌ:ㆈ: ㅌ:ㆉ: ㅌ:ㆊ: ㅌ:ㆋ: ㅌ:ㆌ: ㅌ:ㆍ: ㅌ:ㆎ: ㅍ:A: ㅍ:B: ㅍ:C: ㅍ:D: ㅍ:E: ㅍ:F: ㅍ:G: ㅍ:H: ㅍ:I: ㅍ:J: ㅍ:K: ㅍ:L: ㅍ:M: ㅍ:N: ㅍ:O: ㅍ:P: ㅍ:Q: ㅍ:R: ㅍ:S: ㅍ:T: ㅍ:U: ㅍ:V: ㅍ:W: ㅍ:X: ㅍ:Y: ㅍ:Z: ㅍ:a: ㅍ:b: ㅍ:c: ㅍ:d: ㅍ:e: ㅍ:f: ㅍ:g: ㅍ:h: ㅍ:i: ㅍ:j: ㅍ:k: ㅍ:l: ㅍ:m: ㅍ:n: ㅍ:o: ㅍ:p: ㅍ:q: ㅍ:r: ㅍ:s: ㅍ:t: ㅍ:u: ㅍ:v: ㅍ:w: ㅍ:x: ㅍ:y: ㅍ:z: ㅎ:Α: ㅎ:Β: ㅎ:Γ: ㅎ:Δ: ㅎ:Ε: ㅎ:Ζ: ㅎ:Η: ㅎ:Θ: ㅎ:Ι: ㅎ:Κ: ㅎ:Λ: ㅎ:Μ: ㅎ:Ν: ㅎ:Ξ: ㅎ:Ο: ㅎ:Π: ㅎ:Ρ: ㅎ:Σ: ㅎ:Τ: ㅎ:Υ: ㅎ:Φ: ㅎ:Χ: ㅎ:Ψ: ㅎ:Ω: ㅎ:α: ㅎ:β: ㅎ:γ: ㅎ:δ: ㅎ:ε: ㅎ:ζ: ㅎ:η: ㅎ:θ: ㅎ:ι: ㅎ:κ: ㅎ:λ: ㅎ:μ: ㅎ:ν: ㅎ:ξ: ㅎ:ο: ㅎ:π: ㅎ:ρ: ㅎ:σ: ㅎ:τ: ㅎ:υ: ㅎ:φ: ㅎ:χ: ㅎ:ψ: ㅎ:ω: ibus-hangul-1.5.5/ibus-hangul.spec.in000066400000000000000000000025631442344745400174600ustar00rootroot00000000000000%define mod_path ibus-@PACKAGE_VERSION_MAJOR@.@PACKAGE_VERSION_MINOR@ Name: @PACKAGE_NAME@ Version: @PACKAGE_VERSION@ Release: 1%{?dist} Summary: The Hangul engine for IBus input platform License: GPLv2+ Group: System Environment/Libraries URL: https://github.com/libhangul/ibus-hangul Source0: https://github.com/libhangul/ibus-hangul/releases/download/%{version}/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: ibus-devel BuildRequires: gettext-devel BuildRequires: libtool BuildRequires: libhangul-devel BuildRequires: pkgconfig Requires: ibus %description The Hangul engine for IBus platform. It provides Korean input method from libhangul. %prep %setup -q %build %configure --disable-static # make -C po update-gmo make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT make DESTDIR=${RPM_BUILD_ROOT} install %find_lang %{name} %check make check DISABLE_GUI_TESTS=ibus-hangul %clean rm -rf $RPM_BUILD_ROOT %files -f %{name}.lang %defattr(-,root,root,-) %doc AUTHORS COPYING README %{_bindir}/ibus-setup-hangul %{_libexecdir}/ibus-engine-hangul %{_libexecdir}/ibus-setup-hangul %{_datadir}/applications %{_datadir}/@PACKAGE@ %{_datadir}/ibus/component/* %{_datadir}/icons %changelog * Fri Aug 08 2008 Huang Peng - @VERSION@-1 - The first version. ibus-hangul-1.5.5/icons/000077500000000000000000000000001442344745400150665ustar00rootroot00000000000000ibus-hangul-1.5.5/icons/Makefile.am000066400000000000000000000022611442344745400171230ustar00rootroot00000000000000# vim:set noet ts=4: # # ibus-hangul - The Hangul engine for IBus # # Copyright (c) 2007-2008 Huang Peng # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library 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 Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, write to the # Free Software Foundation, Inc., 59 Temple Place, Suite 330, # Boston, MA 02111-1307 USA icons_DATA = \ ibus-hangul.png \ ibus-hangul.svg \ $(NULL) iconsdir = $(pkgdatadir)/icons hicolor_icon_64_DATA = ibus-hangul.png hicolor_icon_64dir = $(datadir)/icons/hicolor/64x64/apps hicolor_icon_scalable_DATA = ibus-hangul.svg hicolor_icon_scalabledir = $(datadir)/icons/hicolor/scalable/apps EXTRA_DIST = \ $(icons_DATA) \ $(NULL) ibus-hangul-1.5.5/icons/ibus-hangul.inkscape.svg000066400000000000000000000161141442344745400216240ustar00rootroot00000000000000 image/svg+xml ibus-hangul-1.5.5/icons/ibus-hangul.png000066400000000000000000000070221442344745400200130ustar00rootroot00000000000000PNG  IHDR@@iqsBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org< IDATx{pŝ?٧Ò0v,|'ǐ_#pw*ܙ"!qa*W!0qB`(&&y@Y 2%kݙYIWE~ۿu{D)Ň9it? )Kj!hJrNi*JaWJM̝4"5@*XXMKy)aJ4Fc FqFqOj 8>J4_ JwLa ||AWVDž ^SO|^NFA4QgG韊ZJ#VY "a_/g/M8r\\W<^??:Žc'i>`Rjt"^ O=>@1>TۀKxpU+t,QʔWV/l9e-1i+ C?Z߫fV:o{'3&eD]P^G|) Y\ K ="iBfM"-mi| \S! p5tTG\{JV@2}Kѹ12#ŋ%n>+"r ^sAZ +/9e,v|>#ܾEDJ"@Dw\|6^5M.#BޙmUR>p-p ~W `iOY ),BWI!7wm|u"2lc%,ǧLgb% 8'o.@hsS#Vj OSewt5}'ShI~drs:)e)HMA5@ykiOT=M{)Ȳ>+H*0{O̲K>_*qؚs"*WVzrtv)FYNeEsZuD) L}v i)0{]qH+&;@i{]u F~Ve_JP EC@RԐ ~g\܁y 4l[BܕDžQC}^PM@H#@ PͰ^a~Nrq wQ3q.nGFKPJBDTcKxqţC00—û/3Uض!D <9̗jd-?mX̖G."l~,>ZN߀EvaQ]UB Y1SQ9!5i vv}dp|Nx [5<4A)nM`3gǩ6 ̋@}m#G,@̉AZ5024rJT[tS@)I KFY}4v^z) t,>iϪ2Ɍace{efꚋ8Cxf{<|PJu{v# DDx!B %{`'*, h~ j(/(Xj;" Q򶾘De~ n֐"D-E4$N$ۦӠǁI;>ac6 )P]$]Yg'))=Lÿszʿۓqt8lZe-+z鱦D N4yau00=V^ %~$*ʬsrMzy{wv8GO $Z /s6[k 8|t`<?"LNG7p$y`:h ~ O%L^3G`sPJ~02+ը=Γ&%웯iea8xIH$FRcqB"|D e#1wOKgkg>@t=NL<6ֳwQlJOڼv6F^/qTJ]/H 4\χ'G浆 =C\f/صy_o[5e>~<."~`?S,^|kN@b3ݬHcQB*JH=^ZTAR;f"@?]XGɤƪ ƀIw ]o*"u񡡝TT.O Vi-ѝ7ѝcònc#Le˂$D\o˗`͜7|=9Bc\h4 Ɗ&Oءfr?`-p<Сbb|ګsi=6kOcmZ 8dt/ii {u6$='14㊧c/ d_k(~qѷ8pnͺW.}- &yd1D`|"ek^oLI126]]I&OzZ̅HoOs.z{-5f?+ȓfrQ~KU,Yr g9\OyJ)_k^n5'-1`GR{ >6 B}47_g*\l1ɖR p?FgUeo-& !^̓p@ nS[@?7۝شc^Jn^N0IЀvLS[{ 4OܰU+qش]WIGyG?yY`#b)p!p=yM PYy~bI_"*b'`"N-"R| 2:`Y3p"A4-HDbhh1tz{0>&˜H Rq1})g2Ly/>nֿ[g9jL`2lΒ1BVKz0.g 7aR*P_sM@D @=橬cACIa|F) <]SE@F#:S0z>G f co`.zQ .! 2_є_҇hBIENDB`ibus-hangul-1.5.5/icons/ibus-hangul.svg000066400000000000000000000121421442344745400200250ustar00rootroot00000000000000 image/svg+xml ibus-hangul-1.5.5/m4/000077500000000000000000000000001442344745400142735ustar00rootroot00000000000000ibus-hangul-1.5.5/m4/.gitignore000066400000000000000000000000051442344745400162560ustar00rootroot00000000000000*.m4 ibus-hangul-1.5.5/m4/Makefile.am000066400000000000000000000017251442344745400163340ustar00rootroot00000000000000# vim:set noet ts=4: # # ibus-tmpl - The Input Bus template project # # Copyright (c) 2007-2008 Huang Peng # # 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. EXTRA_DIST = \ as-version.m4 \ gettext.m4 \ iconv.m4 \ lib-ld.m4 \ lib-link.m4 \ lib-prefix.m4 \ nls.m4 \ po.m4 \ progtest.m4 \ $(NULL) ibus-hangul-1.5.5/m4/as-version.m4000066400000000000000000000037701442344745400166320ustar00rootroot00000000000000dnl as-version.m4 0.2.0 dnl autostars m4 macro for versioning dnl Thomas Vander Stichele dnl $Id: as-version.m4,v 1.4 2004/06/01 09:40:05 thomasvs Exp $ dnl AS_VERSION dnl example dnl AS_VERSION dnl this macro dnl - AC_SUBST's PACKAGE_VERSION_MAJOR, _MINOR, _MICRO dnl - AC_SUBST's PACKAGE_VERSION_RELEASE, dnl which can be used for rpm release fields dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents dnl maintainer mode from running correctly dnl dnl don't forget to put #undef PACKAGE_VERSION_RELEASE in acconfig.h dnl if you use acconfig.h AC_DEFUN([AS_VERSION], [ PACKAGE_VERSION_MAJOR=$(echo AC_PACKAGE_VERSION | cut -d'.' -f1) PACKAGE_VERSION_MINOR=$(echo AC_PACKAGE_VERSION | cut -d'.' -f2) PACKAGE_VERSION_MICRO=$(echo AC_PACKAGE_VERSION | cut -d'.' -f3) AC_SUBST(PACKAGE_VERSION_MAJOR) AC_SUBST(PACKAGE_VERSION_MINOR) AC_SUBST(PACKAGE_VERSION_MICRO) ]) dnl AS_NANO(ACTION-IF-NO-NANO, [ACTION-IF-NANO]) dnl requires AC_INIT to be called before dnl For projects using a fourth or nano number in your versioning to indicate dnl development or prerelease snapshots, this macro allows the build to be dnl set up differently accordingly. dnl this macro: dnl - parses AC_PACKAGE_VERSION, set by AC_INIT, and extracts the nano number dnl - sets the variable PACKAGE_VERSION_NANO dnl - sets the variable PACKAGE_VERSION_RELEASE, which can be used dnl for rpm release fields dnl - executes ACTION-IF-NO-NANO or ACTION-IF-NANO dnl example: dnl AS_NANO(RELEASE="yes", RELEASE="no") AC_DEFUN([AS_NANO], [ AC_MSG_CHECKING(nano version) NANO=$(echo AC_PACKAGE_VERSION | cut -d'.' -f4) if test x"$NANO" = x || test "x$NANO" = "x0" ; then AC_MSG_RESULT([0 (release)]) NANO=0 PACKAGE_VERSION_RELEASE=1 ifelse([$1], , :, [$1]) else AC_MSG_RESULT($NANO) PACKAGE_VERSION_RELEASE=0.`date +%Y%m%d.%H%M%S` ifelse([$2], , :, [$2]) fi PACKAGE_VERSION_NANO=$NANO AC_SUBST(PACKAGE_VERSION_NANO) AC_SUBST(PACKAGE_VERSION_RELEASE) ]) ibus-hangul-1.5.5/po/000077500000000000000000000000001442344745400143715ustar00rootroot00000000000000ibus-hangul-1.5.5/po/.gitignore000066400000000000000000000002741442344745400163640ustar00rootroot00000000000000Makefile Makefile.in Makefile.in.in Makevars.template POTFILES Rules-quot boldquot.sed en@boldquot.header en@quot.header insert-header.sin quot.sed remove-potcdate.sed remove-potcdate.sin ibus-hangul-1.5.5/po/LINGUAS000066400000000000000000000000111442344745400154060ustar00rootroot00000000000000ko zh_CN ibus-hangul-1.5.5/po/Makevars000066400000000000000000000066551442344745400161010ustar00rootroot00000000000000# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 --add-comments # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Huang Peng # This tells whether or not to prepend "GNU " prefix to the package # name that gets inserted into the header of the $(DOMAIN).pot file. # Possible values are "yes", "no", or empty. If it is empty, try to # detect it automatically by scanning the files in $(top_srcdir) for # "GNU packagename" string. PACKAGE_GNU = no # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = $(PACKAGE_BUGREPORT) # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = # This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' # context. Possible values are "yes" and "no". Set this to yes if the # package uses functions taking also a message context, like pgettext(), or # if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. USE_MSGCTXT = yes # These options get passed to msgmerge. # Useful options are in particular: # --previous to keep previous msgids of translated messages, # --quiet to reduce the verbosity. MSGMERGE_OPTIONS = # These options get passed to msginit. # If you want to disable line wrapping when writing PO files, add # --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and # MSGINIT_OPTIONS. MSGINIT_OPTIONS = # This tells whether or not to regenerate a PO file when $(DOMAIN).pot # has changed. Possible values are "yes" and "no". Set this to no if # the POT file is checked in the repository and the version control # program ignores timestamps. PO_DEPENDS_ON_POT = no # This tells whether or not to forcibly update $(DOMAIN).pot and # regenerate PO files on "make dist". Possible values are "yes" and # "no". Set this to no if the POT file and PO files are maintained # externally. DIST_DEPENDS_ON_UPDATE_PO = no ibus-hangul-1.5.5/po/POTFILES.in000066400000000000000000000002521442344745400161450ustar00rootroot00000000000000data/org.freedesktop.ibus.engine.hangul.metainfo.xml.in setup/keycapturedialog.py setup/main.py setup/ibus-setup-hangul.desktop.in setup/setup.ui src/engine.c src/main.c ibus-hangul-1.5.5/po/ko.po000066400000000000000000000100761442344745400153460ustar00rootroot00000000000000# ibus-hangul Korean Translation # Copyright (C) 2009 Huang Peng # This file is distributed under the same license as the ibus-hangul package. # Choe Hwanjin , 2009. # msgid "" msgstr "" "Project-Id-Version: ibus-hangul\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-08-15 18:52+0900\n" "PO-Revision-Date: 2009-02-18 23:32+0900\n" "Last-Translator: Choe Hwanjin \n" "Language-Team: Choe Hwanjin \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../setup/main.py:220 msgid "Select Hangul toggle key" msgstr "한영전환키를 선택하시오" #: ../setup/main.py:221 msgid "" "Press any key which you want to use as hangul toggle key. The key you " "pressed is displayed below.\n" "If you want to use it, click \"Ok\" or click \"Cancel\"" msgstr "" "한글키로 사용하고자 하는 키를 입력하십시오. 그러면 그 키가 아래에 표시됩니다.\n" "그 키를 사용하시려면 \"확인\"을 누르시고, 사용하지 않으시려면 \"취소\"를 누르십시오." #: ../setup/main.py:228 msgid "Select Hanja key" msgstr "한자키를 선택하시오" #: ../setup/main.py:248 msgid "" "Press any key which you want to use as hanja key. The key you pressed is " "displayed below.\n" "If you want to use it, click \"Ok\" or click \"Cancel\"" msgstr "" "한자키로 사용하고자 하는 키를 입력하십시오. 그러면 그 키가 아래에 표시됩니다.\n" "그 키를 사용하시려면 \"확인\"을 누르시고, 사용하지 않으시려면 \"취소\"를 누르십시오." #: ../setup/main.py:303 msgid "" "IBus daemon is not running.\n" "Hangul engine settings cannot be saved." msgstr "" "IBus 데몬이 실행중이지 않습니다.\n" "한글 엔진 설정을 저장할 수 없습니다." #: ../setup/ibus-setup-hangul.desktop.in.h:1 msgid "IBus Hangul Preferences" msgstr "IBus 한글 설정" #: ../setup/ibus-setup-hangul.desktop.in.h:2 msgid "Set IBus Hangul Preferences" msgstr "IBus 한글 엔진을 설정합니다" #: ../setup/setup.ui.h:1 msgid "IBusHangul Setup" msgstr "IBus 한글 설정" #: ../setup/setup.ui.h:2 msgid "Keyboard Layout" msgstr "자판 설정" #: ../setup/setup.ui.h:3 msgid "Hangul _keyboard:" msgstr "한글 자판(_K):" #: ../setup/setup.ui.h:4 msgid "Etc" msgstr "기타" #: ../setup/setup.ui.h:5 msgid "Start in _Hangul mode" msgstr "한글 모드로 시작(_H)" #: ../setup/setup.ui.h:6 msgid "Commit in _word unit" msgstr "단어 단위로 입력(_W)" #: ../setup/setup.ui.h:7 msgid "Automatic _reordering" msgstr "자동 순서 교정(_R)" #: ../setup/setup.ui.h:8 msgid "Hangul Toggle Key" msgstr "한영전환키" #: ../setup/setup.ui.h:9 msgid "Hangul" msgstr "한글" #: ../setup/setup.ui.h:10 msgid "Hanja Key" msgstr "한자키" #: ../setup/setup.ui.h:11 msgid "Hanja" msgstr "한자" #: ../setup/setup.ui.h:12 msgid "Advanced" msgstr "고급" #: ../src/engine.c:425 msgid "Hangul mode" msgstr "한글 상태" #: ../src/engine.c:426 msgid "Enable/Disable Hangul mode" msgstr "한글 입력 모드를 선택합니다" #: ../src/engine.c:440 msgid "Hanja lock" msgstr "한자 전용" #: ../src/engine.c:441 msgid "Enable/Disable Hanja mode" msgstr "한자 전용 모드 선택합니다" #: ../src/engine.c:452 msgid "Setup" msgstr "설정" #: ../src/engine.c:453 msgid "Configure hangul engine" msgstr "한글 입력기를 설정합니다" #: ../src/main.c:71 msgid "Korean input method" msgstr "한글 입력기" #: ../src/main.c:80 ../src/main.c:81 msgid "Korean Input Method" msgstr "한글 입력기" #~ msgid "IBus daemon is not running" #~ msgstr "IBus 데몬이 실행중이지 않습니다" #~ msgid "Dubeolsik" #~ msgstr "두벌식" #~ msgid "Sebeolsik Final" #~ msgstr "세벌식 최종" #~ msgid "Sebeolsik 390" #~ msgstr "세벌식 390" #~ msgid "Sebeolsik No-shift" #~ msgstr "세벌식 순아래" #~ msgid "Sebeolsik 2 set" #~ msgstr "세벌식 두벌배열" #~ msgid "Romaja" #~ msgstr "로마자" ibus-hangul-1.5.5/po/zh_CN.po000066400000000000000000000046141442344745400157370ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Huang Peng # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-08-15 18:52+0900\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../setup/keycapturedialog.py:15 msgid "" "Press any key which you want to use as hanja key. The key you pressed is " "displayed below.\n" "If you want to use it, click \"Ok\" or click \"Cancel\"" msgstr "" #: ../setup/main.py:204 msgid "Select Hangul toggle key" msgstr "" #: ../setup/main.py:228 msgid "Select Hanja key" msgstr "" #: ../setup/main.py:281 msgid "" "IBus daemon is not running.\n" "Hangul engine settings cannot be saved." msgstr "" #: ../setup/ibus-setup-hangul.desktop.in.h:1 msgid "IBus Hangul Preferences" msgstr "" #: ../setup/ibus-setup-hangul.desktop.in.h:2 msgid "Set IBus Hangul Preferences" msgstr "" #: ../setup/setup.ui.h:1 msgid "IBusHangul Setup" msgstr "" #: ../setup/setup.ui.h:2 msgid "Keyboard Layout" msgstr "" #: ../setup/setup.ui.h:3 msgid "Hangul _keyboard:" msgstr "" #: ../setup/setup.ui.h:4 msgid "Etc" msgstr "" #: ../setup/setup.ui.h:5 msgid "Start in _hangul mode" msgstr "" #: ../setup/setup.ui.h:6 msgid "Commit in _word unit" msgstr "" #: ../setup/setup.ui.h:7 msgid "Automatic _reordering" msgstr "" #: ../setup/setup.ui.h:8 msgid "Hangul toggle key" msgstr "" #: ../setup/setup.ui.h:9 msgid "Hangul" msgstr "" #: ../setup/setup.ui.h:10 msgid "Hanja key" msgstr "" #: ../setup/setup.ui.h:11 msgid "Hanja" msgstr "" #: ../setup/setup.ui.h:12 msgid "Advanced" msgstr "" #: ../src/engine.c:425 msgid "Hangul mode" msgstr "" #: ../src/engine.c:426 msgid "Enable/Disable Hangul mode" msgstr "" #: ../src/engine.c:440 msgid "Hanja lock" msgstr "" #: ../src/engine.c:441 msgid "Enable/Disable Hanja mode" msgstr "" #: ../src/engine.c:452 msgid "Setup" msgstr "" #: ../src/engine.c:453 msgid "Configure hangul engine" msgstr "" #: ../src/main.c:71 msgid "Korean input method" msgstr "" #: ../src/main.c:80 ../src/main.c:81 msgid "Korean Input Method" msgstr "" ibus-hangul-1.5.5/setup/000077500000000000000000000000001442344745400151135ustar00rootroot00000000000000ibus-hangul-1.5.5/setup/Makefile.am000066400000000000000000000052601442344745400171520ustar00rootroot00000000000000# vim:set noet ts=4: # # ibus-hangul - The Hangul Engine For IBus # # Copyright (c) 2009 Choe Hwanjin # # 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. setup_hangul_PYTHON = \ main.py \ keycapturedialog.py \ setup.ui \ $(NULL) nodist_setup_hangul_PYTHON = config.py setup_hanguldir = $(pkgdatadir)/setup libexec_SCRIPTS = ibus-setup-hangul desktop_in_files = ibus-setup-hangul.desktop.in desktop_files = $(desktop_in_files:.desktop.in=.desktop) desktop_DATA = $(desktop_files) desktopdir = $(datadir)/applications $(desktop_files): $(desktop_in_files) Makefile $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@ hicolor_icon_64_DATA = ibus-setup-hangul.png hicolor_icon_64dir = $(datadir)/icons/hicolor/64x64/apps hicolor_icon_scalable_DATA = ibus-setup-hangul.svg hicolor_icon_scalabledir = $(datadir)/icons/hicolor/scalable/apps CLEANFILES = \ ibus-setup-hangul \ config.py \ *.pyc \ ibus-setup-hangul.desktop \ $(NULL) EXTRA_DIST = \ config.py.in \ ibus-setup-hangul.in \ ibus-setup-hangul.desktop.in \ $(hicolor_icon_64_DATA) \ $(hicolor_icon_scalable_DATA) \ $(NULL) test: $(ENV_PROG) DBUS_DEBUG=true \ PYTHONPATH=$(abs_builddir):$(pyexecdir) \ $(PYTHON) $(srcdir)/main.py config.py: config.py.in Makefile sed -e 's&@SETUP_GETTEXT_PACKAGE@&$(GETTEXT_PACKAGE)&g' \ -e 's&@SETUP_LOCALEDIR@&$(localedir)&g' \ -e 's&@SETUP_PKGDATADIR@&$(pkgdatadir)&g' $< > $@ ibus-setup-hangul: ibus-setup-hangul.in config.py Makefile sed -e 's&@SETUP_PKGDATADIR@&$(pkgdatadir)&g' \ -e 's&\@PYTHON\@&$(PYTHON)&g' $< > $@ install-exec-hook: $(MKDIR_P) $(DESTDIR)$(bindir) cd $(DESTDIR)$(bindir) && \ rm -f ibus-setup-hangul && \ a="$(bindir)"; b="$(libexecdir)"; updir=""; downdir=""; \ while test "$$a" != "$$b"; do \ bbase=`basename $$b`; \ updir="../$$updir"; \ downdir="$$bbase/$$downdir"; \ a=`dirname $$a`; b=`dirname $$b`; \ done; \ $(LN_S) $$updir$${downdir}ibus-setup-hangul ibus-setup-hangul uninstall-hook: cd "$(DESTDIR)$(bindir)" && rm -f ibus-setup-hangul ibus-hangul-1.5.5/setup/config.py.in000066400000000000000000000017361442344745400173460ustar00rootroot00000000000000# vim:set et sts=4 sw=4: # # ibus-hangul - The Hangul Engine For IBus # # Copyright (c) 2009-2011 Choe Hwanjin # # 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. gettext_package = '@SETUP_GETTEXT_PACKAGE@' localedir = '@SETUP_LOCALEDIR@' pkgdatadir = '@SETUP_PKGDATADIR@' setupdatadir = pkgdatadir + '/setup' ibus-hangul-1.5.5/setup/ibus-setup-hangul.desktop.in000066400000000000000000000003261442344745400224700ustar00rootroot00000000000000[Desktop Entry] Name=IBus Hangul Preferences Comment=Set IBus Hangul Preferences Exec=ibus-setup-hangul Icon=ibus-setup-hangul NoDisplay=true Terminal=false Type=Application StartupNotify=true Categories=Settings; ibus-hangul-1.5.5/setup/ibus-setup-hangul.in000066400000000000000000000016041442344745400210200ustar00rootroot00000000000000#!/bin/sh # vim:set noet ts=4: # # ibus-hangul - The Hangul Engine For IBus # # Copyright (c) 2009-2011 Choe Hwanjin # # 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. exec @PYTHON@ @SETUP_PKGDATADIR@/setup/main.py $@ ibus-hangul-1.5.5/setup/ibus-setup-hangul.inkscape.svg000066400000000000000000000525261442344745400230160ustar00rootroot00000000000000 image/svg+xml System Applications Jakub Steiner http://jimmac.musichall.cz/ system applications group category admin root ibus-hangul-1.5.5/setup/ibus-setup-hangul.png000066400000000000000000000151631442344745400212030ustar00rootroot00000000000000PNG  IHDR@@iqsBIT|d pHYsttfxtEXtSoftwarewww.inkscape.org<tEXtTitleSystem Applications|{3tEXtAuthorJakub Steiner/"tEXtSourcehttp://jimmac.musichall.cz/iItEXtCopyrightPublic Domain http://creativecommons.org/licenses/publicdomain/Y(IDATxݛwřUݓw9 ]B"(d}>X6>36G:d0'cy1pI JڨͳaBwGlV`ϧ߯~SO51B"/&J[phT ݢh6j]cւsd-x,o>2+ےmd:EJ~ʰ2MHJVsˍK:;@7$M|H0 ciƺnA 0 ÊR$n7J4䔒a%2jka`ئ#**_ 1ͫȰVIQq!Q[c+bE5JkF:j}Q1V yDQQ/eH\mP 3gYk)BT\<4_ ^>toU3[f/-4K9jښn Dq BYXxd+XsS Qq`/yD!*f Qa~یyW pŻ.Ӽkp]> 'Xq"LbМy70aX:oe=)Np&p֕3/Z'l-Cj͂ [% iHLin蚛Du5AkDk|oւWR>4lXnU\7a'|IL4i]D] 鶛W>4o>yz͍vH(>г~E#G)Ϛee'IC<MlݼLѣضiI)=^%.4$QqI ڢa͚d$؞ZW>5o!鶟pi#(,[cHA[bUu47| ÇraG lR!~k ܆@khnn嵗Wޛ epOcԨaJc.Cb G^غYk]Y̽pe%*–FO !>;||{QvHÚ` I_[Ā[y5&]MvfpW+WE9AR 3Oq]"+;J"9 I#@QVV:!Dlǟ%Đ ( Y KL>>ؖ_+kJi^}wEQ)@Vi ):#}m[ X\`iǶbvgDeVtDlB3߯C[x llKˎoP`Ȋ_t{k$l)Ҵl": [ ~z1[Nɮ3zekpښz)헴 \u屯L4}9YS@[Ar`w2B/H /t13=vD,M{ v-Zhr9~ dWbJg ۚΈ+h )"F*!Z=:>!֔pά4ԃr2lwQ֕33LqBh'&@Ύ2Fg9Vӄ|.Z;9|{pp~豣ᥔQH[-tbOR H@ ,-7Q:!7>if}pxz% RNq8lAm%PŊy?̀nTC79ʲJMTeryg38!jǜ*q*bC!i̾|B5>hU7\>|ꈨX'44;Ch Yc*C4u;bqk#_?}l,kœ΍6ʕ]m^Vq d i3)BTk]s XZ .]hh|ʕCfOȱN {Ba)?`s!]}-ʦ\ʣ}֬y+ S<&;̈p1#^oaLDQ͝~;ְo$o$J U9{xT$vi59Ǻ,,&y xw|tK<_ed >B╱,B>J^B)6ۘ85b|P̅ZItY(,fKov@@ǘi3ޕKFl:#ʑ? Β6jk6(a~xt}%J8KAe`f_p9߮'!`BX9 0%1LaK#>TԈVάbMkyˮG|*9eUtwQi1ydgґY}G7En2Gl1mw$lȤj]y`Ǐ3.~" ^_UGjhm. 9eh.\̌Dc!+KetϷU/."Ђ)S++6-bro i,ea_/vsB ]H|{Ԣ`@ ! x!)rfwI:a-%kxOxx9{|.QeLC1.ILU/rk" LPaG"=-cnL)ᄳ {$U `;!Bʦgr՘R,"¡7:p=/}ּŒEzðHˉ!nt#!^@RtF(%B6dv丙TcHXÈEl~w&ؚo[,[9ƍԌ@2ʍ-IYr)++z}s_2m[yBr; Y !li^=1]\NGRnv{#wXtFT"Jӱ>D73 ! 鏝[E%΍؎Àc fa0Ln "[@Ah.8n|v/\ßnA3x 0TRت%HSEMBҳ:;"S)!EJc52$3ӧ>XzfŅEYhN*ڶEyUdߴ1.2)Lx$J.u%s YJnl Fkdi\W>S#C26OTi>D(}li)>@{iPaϏL~} m{8w> p Ƥr],ATqĶ-(*4OJz^n[FK|s1|aua$;ΰӢ)9yc`g]z\1NH>Ucxo%gz:;vyهٽ}ק#Cɶ-= IҥK`he Z BIy.BP4i=qeƖ]rW*;bIY:y6v4%ˠ ^u%S{Z֝8Z`EWE=ˑ7RTwIۣ!S3*L}q'w? OtZ}>wiIGCVCo xjW+g0#gۻ]'4Z_%& NBWSwI|.9@Ekw0bX1߿,/b31.Ȁ\Kޭ-?>Lz}(T(ކ7#v3.h0 rzY>Zg{M\s"\O[>0k^^uA>mc[]C$RҀifhg=>!l[}DVrU&H?.%WŁ =b|Mb{c(Q"F)RjfL3j;mפk&tAԼlza cC,t֚13fHz|Hx9 WFʌ30ԑo}V e21 /@l_T) !;vCi"K^p啘fϣpkut?Ow!SKȞ@?N1~-;1KSޕ/n7 Ѓ" =1+]p W&;Iא<&L֌p ?/J"&U>.YQ 9,[7 ͬLvԇ1*0˴>zIO]q'Z@[)4DV1JQ8.0NpǮc@:.BM2OG)B{8uK,L)Q䇝wX%!Nݽ%=̾-}?|@`U|Zt,lkRq ZkGJuw5R\JqY>tKQag#Ye?eyxș0`35Fr7WEGڶ(: 00j|dm'T@{W >}Q+Wv1Ћ+Pfz>~~4+?ٺfJw7ǶԦGv @^^hn~)%g%X~%p=<"5ap|@,Go:zufNn4 :V/?P_sn2$'0l@\pMmJ#/ջ~^ƍBafXXl8ca+LU?SJrtnWvpqíب>6(c9ŧڐ윲g0>ڶ{]m3hşM*0i#&M)qSԹYy< ˛J͘>" ڷl㙇9XMٴUD"v#Ek>x1c7Vܾi_57<\%4FpFU uZ;w9 n:VcAosZ (ap Tm=h`WqCa- а@mp 'vmQvhU;ٻƌl,M o{񏉛BدtR( _  ZD00@N.`0R[{(_ZA3{w1ص45}Rx/YsY@7- ah/w$pGg~V|.7?Y'C~ѣ GKwZ[oE&zhSA֖ŽՉxO8dоNU]M?,Li_ JJE=bh;s QXjz/FR*9 _r3/kĬECGM;/MSgCA^mo¶C%?"OGq=gih7#)07k~9D{{ڶvYHӅ6BEiGUiXv>^u࣌=s;:xEc04p#I$L8\C8\mQO82 u;=n>BV!jv u!-N&gBB ⌃v?HhviO/5Ǔ "@cmǩZvx`'Me!ob+yd[!K]IENDB`ibus-hangul-1.5.5/setup/ibus-setup-hangul.svg000066400000000000000000000433771442344745400212260ustar00rootroot00000000000000 image/svg+xml System Applications Jakub Steiner http://jimmac.musichall.cz/ system applications group category admin root ibus-hangul-1.5.5/setup/keycapturedialog.py000066400000000000000000000025641442344745400210300ustar00rootroot00000000000000from gi.repository import Gtk from gi.repository import Gdk import gettext _ = lambda a : gettext.dgettext("ibus-hangul", a) class KeyCaptureDialog (): def __init__ (self, title, parent): self.__key_str = '' self.__dialog = Gtk.MessageDialog(parent, Gtk.DialogFlags.MODAL, Gtk.MessageType.INFO, Gtk.ButtonsType.OK_CANCEL, "") self.__dialog.set_markup(" ") self.__dialog.format_secondary_markup(" ") self.__dialog.connect("key-press-event", self.on_keypress, None) def destroy(self): self.__dialog.destroy() def run(self): return self.__dialog.run() def set_markup(self, text): self.__dialog.set_markup(text) def get_key_string(self): return self.__key_str def on_keypress(self, widget, event, data = None): self.__key_str = "" if event.state & Gdk.ModifierType.CONTROL_MASK : self.__key_str += "Control+" if event.state & Gdk.ModifierType.MOD1_MASK : self.__key_str += "Alt+" if event.state & Gdk.ModifierType.SHIFT_MASK : self.__key_str += "Shift+" self.__key_str += Gdk.keyval_name(event.keyval) self.__dialog.format_secondary_markup('%s' % self.__key_str) ibus-hangul-1.5.5/setup/main.py000066400000000000000000000267231442344745400164230ustar00rootroot00000000000000# vim:set et sts=4 sw=4: # # ibus-hangul - The Hangul Engine For IBus # # Copyright (c) 2009-2011 Choe Hwanjin # # 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. import sys import os import gi from gi.repository import Gio from gi.repository import GLib gi.require_version('Gtk', '3.0') from gi.repository import Gtk gi.require_version('IBus', '1.0') from gi.repository import IBus import locale import gettext import config from keycapturedialog import KeyCaptureDialog _ = lambda a : gettext.dgettext(config.gettext_package, a) def get_hangul_keyboard_list(): from ctypes import CDLL, c_int, c_char_p libhangul = CDLL('libhangul.so.1') libhangul.hangul_ic_get_n_keyboards.argtypes = [] libhangul.hangul_ic_get_n_keyboards.restype = c_int libhangul.hangul_ic_get_keyboard_id.argtypes = [c_int] libhangul.hangul_ic_get_keyboard_id.restype = c_char_p libhangul.hangul_ic_get_keyboard_name.argtypes = [c_int] libhangul.hangul_ic_get_keyboard_name.restype = c_char_p n = libhangul.hangul_ic_get_n_keyboards() list = [] for i in range(n): id = libhangul.hangul_ic_get_keyboard_id(i).decode('UTF-8') name = libhangul.hangul_ic_get_keyboard_name(i).decode('UTF-8') list.append((id, name)) return list class Setup (): def __init__ (self, bus): self.__bus = bus self.__settings = Gio.Settings(schema="org.freedesktop.ibus.engine.hangul") self.__settings.connect("changed", self.on_value_changed) ui_file = os.path.join(os.path.dirname(__file__), "setup.ui") self.__builder = Gtk.Builder() self.__builder.set_translation_domain(config.gettext_package) self.__builder.add_from_file(ui_file) # Hangul tab list = get_hangul_keyboard_list() self.__hangul_keyboard = self.__builder.get_object("HangulKeyboard") model = Gtk.ListStore(str, str, int) i = 0 for (id, name) in list: model.append([name, id, i]) i+=1 self.__hangul_keyboard.set_model(model) renderer = Gtk.CellRendererText() self.__hangul_keyboard.pack_start(renderer, True) self.__hangul_keyboard.add_attribute(renderer, "text", 0) current = self.__read("hangul-keyboard").get_string() for i in model: if i[1] == current: self.__hangul_keyboard.set_active(i[2]) break self.__start_in_hangul_mode = self.__builder.get_object("StartInHangulMode") initial_input_mode = self.__read("initial-input-mode").get_string() self.__start_in_hangul_mode.set_active(initial_input_mode == "hangul") self.__word_commit = self.__builder.get_object("WordCommit") word_commit = self.__read("word-commit").get_boolean() self.__word_commit.set_active(word_commit) self.__auto_reorder = self.__builder.get_object("AutoReorder") auto_reorder = self.__read("auto-reorder").get_boolean() self.__auto_reorder.set_active(auto_reorder) button = self.__builder.get_object("HangulKeyListAddButton") button.connect("clicked", self.on_hangul_key_add, None) button = self.__builder.get_object("HangulKeyListRemoveButton") button.connect("clicked", self.on_hangul_key_remove, None) model = Gtk.ListStore(str) keylist_str = self.__read("switch-keys").get_string() self.__hangul_key_list_str = keylist_str.split(',') for i in self.__hangul_key_list_str: model.append([i]) self.__hangul_key_list = self.__builder.get_object("HangulKeyList") self.__hangul_key_list.set_model(model) column = Gtk.TreeViewColumn() column.set_title("key") renderer = Gtk.CellRendererText() column.pack_start(renderer, True) column.add_attribute(renderer, "text", 0) self.__hangul_key_list.append_column(column) # hanja tab button = self.__builder.get_object("HanjaKeyListAddButton") button.connect("clicked", self.on_hanja_key_add, None) button = self.__builder.get_object("HanjaKeyListRemoveButton") button.connect("clicked", self.on_hanja_key_remove, None) model = Gtk.ListStore(str) keylist_str = self.__read("hanja-keys").get_string() self.__hanja_key_list_str = keylist_str.split(',') for i in self.__hanja_key_list_str: model.append([i]) self.__hanja_key_list = self.__builder.get_object("HanjaKeyList") self.__hanja_key_list.set_model(model) column = Gtk.TreeViewColumn() column.set_title("key") renderer = Gtk.CellRendererText() column.pack_start(renderer, True) column.add_attribute(renderer, "text", 0) self.__hanja_key_list.append_column(column) # advanced tab notebook = self.__builder.get_object("SetupNotebook") notebook.remove_page(2) # setup dialog self.__window = self.__builder.get_object("SetupDialog") icon_file = os.path.join(config.pkgdatadir, "icons", "ibus-hangul.svg") self.__window.set_icon_from_file(icon_file) self.__window.connect("destroy", Gtk.main_quit) self.__window.show() button = self.__builder.get_object("button_apply") button.connect("clicked", self.on_apply, None) button = self.__builder.get_object("button_cancel") button.connect("clicked", self.on_cancel, None) #button.grap_focus() button = self.__builder.get_object("button_ok") button.connect("clicked", self.on_ok, None) def run(self): Gtk.main() def apply(self): model = self.__hangul_keyboard.get_model() i = self.__hangul_keyboard.get_active() self.__write("hangul-keyboard", GLib.Variant.new_string(model[i][1])) start_in_hangul_mode = self.__start_in_hangul_mode.get_active() if start_in_hangul_mode: self.__write("initial-input-mode", GLib.Variant.new_string("hangul")) else: self.__write("initial-input-mode", GLib.Variant.new_string("latin")) word_commit = self.__word_commit.get_active() self.__write("word-commit", GLib.Variant.new_boolean(word_commit)) auto_reorder = self.__auto_reorder.get_active() self.__write("auto-reorder", GLib.Variant.new_boolean(auto_reorder)) model = self.__hangul_key_list.get_model() str = "" iter = model.get_iter_first() while iter: if len(str) > 0: str += "," str += model.get_value(iter, 0) else: str += model.get_value(iter, 0) iter = model.iter_next(iter) self.__write("switch-keys", GLib.Variant.new_string(str)) model = self.__hanja_key_list.get_model() str = "" iter = model.get_iter_first() while iter: if len(str) > 0: str += "," str += model.get_value(iter, 0) else: str += model.get_value(iter, 0) iter = model.iter_next(iter) self.__write("hanja-keys", GLib.Variant.new_string(str)) def on_apply(self, widget, data): self.apply() def on_cancel(self, widget, data): self.__window.destroy() Gtk.main_quit() def on_ok(self, widget, data): self.apply() self.__window.destroy() Gtk.main_quit() def on_hangul_key_add(self, widget, data = None): dialog = KeyCaptureDialog(_("Select Hangul toggle key"), self.__window) dialog.set_markup(_("Press any key which you want to use as hangul toggle key. " "The key you pressed is displayed below.\n" "If you want to use it, click \"Ok\" or click \"Cancel\"")) res = dialog.run() if res == Gtk.ResponseType.OK: key_str = dialog.get_key_string() if len(key_str) > 0: model = self.__hangul_key_list.get_model() iter = model.get_iter_first() while iter: str = model.get_value(iter, 0) if str == key_str: model.remove(iter) break iter = model.iter_next(iter) model.append([key_str]) dialog.destroy() def on_hangul_key_remove(self, widget, data = None): selection = self.__hangul_key_list.get_selection() (model, iter) = selection.get_selected() if model and iter: model.remove(iter) def on_hanja_key_add(self, widget, data = None): dialog = KeyCaptureDialog(_("Select Hanja key"), self.__window) dialog.set_markup(_("Press any key which you want to use as hanja key. " "The key you pressed is displayed below.\n" "If you want to use it, click \"Ok\" or click \"Cancel\"")) res = dialog.run() if res == Gtk.ResponseType.OK: key_str = dialog.get_key_string() if len(key_str) > 0: model = self.__hanja_key_list.get_model() iter = model.get_iter_first() while iter: str = model.get_value(iter, 0) if str == key_str: model.remove(iter) break iter = model.iter_next(iter) model.append([key_str]) dialog.destroy() def on_hanja_key_remove(self, widget, data = None): selection = self.__hanja_key_list.get_selection() (model, iter) = selection.get_selected() if model and iter: model.remove(iter) def on_value_changed(self, settings, key): value = settings.get_value(key) if key == "hangul-keyboard": model = self.__hangul_keyboard.get_model() for i in model: if i[1] == value.get_string(): self.__hangul_keyboard.set_active(i[2]) break elif key == "switch-keys": self.__hangul_key_list_str = value.get_string().split(',') elif key == "hanja-keys": self.__hanja_key_list_str = value.get_string().split(',') def __read(self, key): return self.__settings.get_value(key) def __write(self, key, v): self.__settings.set_value(key, v) if __name__ == "__main__": locale.bindtextdomain(config.gettext_package, config.localedir) GLib.set_prgname("ibus-setup-hangul") GLib.set_application_name(_("IBusHangul Setup")) bus = IBus.Bus() if bus.is_connected(): Setup(bus).run() else: message = _("IBus daemon is not running.\nHangul engine settings cannot be saved.") dialog = Gtk.MessageDialog(type = Gtk.MessageType.ERROR, buttons = Gtk.ButtonsType.CLOSE, message_format = message) dialog.run() sys.exit(1) ibus-hangul-1.5.5/setup/setup.ui000066400000000000000000001102151442344745400166120ustar00rootroot00000000000000 False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 IBusHangul Setup center-on-parent dialog True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 6 vertical 8 True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 vertical 18 True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK vertical 6 True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Keyboard Layout</b> True 0 False True 0 False True 0 True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 12 True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Hangul _keyboard: True HangulKeyboard False False 0 True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True True 1 False True 1 False True 0 True False vertical True False vertical 6 True False True False <b>Etc</b> True False True 0 True True 0 True False Start in _Hangul mode True True False True 0 True False True 12 0 False True 1 True False Commit in _word unit True True False True 0.5 True True True 12 0 True True 2 True False Automatic _reordering True True False True 0.5 True True True True 12 0 True True 3 False True 0 False True 1 True False vertical 6 True False start <b>Hangul Toggle Key</b> True False True 0 True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 12 True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK in True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK False False True True 0 True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 6 6 start gtk-add True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True False False 0 gtk-remove True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True False False 1 False True 1 True True 1 True True 2 True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Hangul False True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 6 vertical 12 True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK vertical 6 True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Hanja Key</b> True word-char False True 0 False True 0 True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 12 True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK in True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK False False False True True 0 True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 6 6 start gtk-add True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True False False 0 gtk-remove True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True False False 1 False True 1 True True 1 True True 0 1 True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Hanja 1 False True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Not implemented</b> True 2 True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Advanced 2 False True True 1 True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 4 True end gtk-apply True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True False False 0 gtk-cancel True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True False False 1 gtk-ok True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True False False 2 False True end 1 ibus-hangul-1.5.5/src/000077500000000000000000000000001442344745400145425ustar00rootroot00000000000000ibus-hangul-1.5.5/src/Makefile.am000066400000000000000000000045101442344745400165760ustar00rootroot00000000000000# vim:set noet ts=4: # # ibus-hangul - The Hangul engine for IBus # # Copyright (c) 2007-2008 Huang Peng # # 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. AM_CFLAGS = \ @IBUS_CFLAGS@ \ @HANGUL_CFLAGS@ \ -DPKGDATADIR=\"$(pkgdatadir)\" \ $(NULL) AM_LDFLAGS = \ @IBUS_LIBS@ \ @HANGUL_LIBS@ \ $(NULL) noinst_LIBRARIES = \ libinternal.a $(NULL) libinternal_a_SOURCES = \ engine.c \ engine.h \ ustring.c \ ustring.h \ i18n.h \ $(NULL) libinternal_a_CFLAGS = \ @IBUS_CFLAGS@ \ @HANGUL_CFLAGS@ \ -DPKGDATADIR=\"$(pkgdatadir)\" \ -DLOCALEDIR=\"$(localedir)\" \ -DLIBEXECDIR=\"$(libexecdir)\" \ -DIBUSHANGUL_DATADIR=\"$(datadir)/ibus-hangul\" \ $(NULL) check_PROGRAMS = \ test-ustring $(NULL) TESTS = \ $(check_PROGRAMS) \ $(NULL) libexec_PROGRAMS = ibus-engine-hangul ibus_engine_hangul_SOURCES = \ main.c \ $(NULL) ibus_engine_hangul_CFLAGS = \ @IBUS_CFLAGS@ \ @HANGUL_CFLAGS@ \ -DPKGDATADIR=\"$(pkgdatadir)\" \ -DLOCALEDIR=\"$(localedir)\" \ -DLIBEXECDIR=\"$(libexecdir)\" \ -DIBUSHANGUL_DATADIR=\"$(datadir)/ibus-hangul\" \ $(NULL) ibus_engine_hangul_LDADD = \ libinternal.a \ @IBUS_LIBS@ \ @HANGUL_LIBS@ \ $(NULL) component_DATA = \ hangul.xml \ $(NULL) componentdir = @datadir@/ibus/component EXTRA_DIST = \ $(NULL) CLEANFILES = \ hangul.xml \ $(NULL) hangul.xml: hangul.xml.in ( \ libexecdir=${libexecdir}; \ pkgdatadir=${pkgdatadir}; \ s=`cat $<`; \ eval "echo \"$${s}\""; \ ) > $@ test: ibus-engine-hangul $(builddir)/ibus-engine-hangul test_ustring_CFLAGS = $(IBUS_CFLAGS) $(HANGUL_CFLAGS) test_ustring_LDADD = $(IBUS_LIBS) test_ustring_SOURCES = test-ustring.c ustring.c ustring.h check-local: $(builddir)/test-ustring ibus-hangul-1.5.5/src/engine.c000066400000000000000000002171741442344745400161670ustar00rootroot00000000000000/* vim:set et sts=4: */ /* ibus-hangul - The Hangul Engine For IBus * Copyright (C) 2008-2009 Peng Huang * Copyright (C) 2009-2011 Choe Hwanjin * * 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. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "i18n.h" #include "engine.h" #include "ustring.h" typedef struct _IBusHangulEngine IBusHangulEngine; typedef struct _IBusHangulEngineClass IBusHangulEngineClass; typedef struct _HotkeyList HotkeyList; enum { INPUT_MODE_HANGUL, INPUT_MODE_LATIN, INPUT_MODE_COUNT, }; /** * ibus-hangul supports 3 preedit modes. */ typedef enum { /** * @brief zero length preedit mode * An option to use zero length preedit text. * ibus-hangul will utilize surrounding text feature to draw "composing text". * So the "composing text" will not be shown in preedit style but normal text. */ PREEDIT_MODE_NONE, /** * @brief syllable preedit mode * An option to use syllable length preedit text. * This option utilizes preedit text feature. */ PREEDIT_MODE_SYLLABLE, /** * @brief word preedit mode * An option to use word length preedit text. */ PREEDIT_MODE_WORD, } IBusHangulPreeditMode; struct _IBusHangulEngine { IBusEngineSimple parent; /* members */ /* unique context id */ guint id; HangulInputContext *context; UString* preedit; /* Every instance's preedit_mode may be different from global settings. * So we need a value for each instance. */ IBusHangulPreeditMode preedit_mode; int input_mode; unsigned int input_purpose; gboolean hanja_mode; HanjaList* hanja_list; int last_lookup_method; guint caps; IBusLookupTable *table; IBusProperty *prop_hangul_mode; IBusProperty *prop_hanja_mode; IBusPropList *prop_list; IBusText *input_mode_symbols[INPUT_MODE_COUNT]; }; struct _IBusHangulEngineClass { IBusEngineSimpleClass parent; }; struct KeyEvent { guint keyval; guint modifiers; }; struct _HotkeyList { guint all_modifiers; GArray *keys; }; enum { LOOKUP_METHOD_EXACT, LOOKUP_METHOD_PREFIX, LOOKUP_METHOD_SUFFIX, }; /* functions prototype */ static void ibus_hangul_engine_class_init (IBusHangulEngineClass *klass); static void ibus_hangul_engine_init (IBusHangulEngine *hangul); static GObject* ibus_hangul_engine_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params); static void ibus_hangul_engine_destroy (IBusHangulEngine *hangul); static gboolean ibus_hangul_engine_process_key_event (IBusEngine *engine, guint keyval, guint keycode, guint modifiers); static void ibus_hangul_engine_focus_in (IBusEngine *engine); static void ibus_hangul_engine_focus_out (IBusEngine *engine); static void ibus_hangul_engine_reset (IBusEngine *engine); static void ibus_hangul_engine_enable (IBusEngine *engine); static void ibus_hangul_engine_disable (IBusEngine *engine); #if 0 static void ibus_engine_set_cursor_location (IBusEngine *engine, gint x, gint y, gint w, gint h); #endif static void ibus_hangul_engine_set_capabilities (IBusEngine *engine, guint caps); static void ibus_hangul_engine_page_up (IBusEngine *engine); static void ibus_hangul_engine_page_down (IBusEngine *engine); static void ibus_hangul_engine_cursor_up (IBusEngine *engine); static void ibus_hangul_engine_cursor_down (IBusEngine *engine); static void ibus_hangul_engine_property_activate (IBusEngine *engine, const gchar *prop_name, guint prop_state); #if 0 static void ibus_hangul_engine_property_show (IBusEngine *engine, const gchar *prop_name); static void ibus_hangul_engine_property_hide (IBusEngine *engine, const gchar *prop_name); #endif static void ibus_hangul_engine_candidate_clicked (IBusEngine *engine, guint index, guint button, guint state); static void ibus_hangul_engine_set_content_type (IBusEngine *engine, guint purpose, guint hints); static void ibus_hangul_engine_flush (IBusHangulEngine *hangul); static void ibus_hangul_engine_clear_preedit_text (IBusHangulEngine *hangul); static void ibus_hangul_engine_update_preedit_text (IBusHangulEngine *hangul); static void ibus_hangul_engine_process_commit_and_edit (IBusHangulEngine *hangul); static void ibus_hangul_engine_update_lookup_table (IBusHangulEngine *hangul); static gboolean ibus_hangul_engine_has_preedit (IBusHangulEngine *hangul); static void ibus_hangul_engine_switch_input_mode (IBusHangulEngine *hangul); static void ibus_hangul_engine_set_input_mode (IBusHangulEngine *hangul, int input_mode); static IBusText* ibus_hangul_engine_get_input_mode_symbol (IBusHangulEngine *hangul, int input_mode); static bool ibus_hangul_engine_on_transition (HangulInputContext *hic, ucschar c, const ucschar *preedit, void *data); static void settings_changed (GSettings *settings, const gchar *key, gpointer user_data); static void lookup_table_set_visible (IBusLookupTable *table, gboolean flag); static gboolean lookup_table_is_visible (IBusLookupTable *table); static gboolean key_event_list_match (GArray *list, guint keyval, guint modifiers); static void hotkey_list_init (HotkeyList *list); static void hotkey_list_fini (HotkeyList *list); static void hotkey_list_set_from_string (HotkeyList *list, const char *str); static void hotkey_list_append (HotkeyList *list, guint keyval, guint modifiers); static gboolean hotkey_list_match (HotkeyList *list, guint keyval, guint modifiers); static gboolean hotkey_list_has_modifier (HotkeyList *list, guint keyval); static glong ucschar_strlen (const ucschar* str); static gint ibus_version[3] = { IBUS_MAJOR_VERSION, IBUS_MINOR_VERSION, IBUS_MICRO_VERSION }; static IBusEngineSimpleClass *parent_class = NULL; static guint last_context_id = 0; static HanjaTable *hanja_table = NULL; static HanjaTable *symbol_table = NULL; static GSettings *settings_hangul = NULL; static GSettings *settings_panel = NULL; static GString *hangul_keyboard = NULL; static HotkeyList hanja_keys; static HotkeyList switch_keys; static HotkeyList on_keys; static HotkeyList off_keys; static int lookup_table_orientation = 0; static IBusKeymap *keymap = NULL; static gboolean word_commit = FALSE; static gboolean auto_reorder = TRUE; static gboolean disable_latin_mode = FALSE; static int initial_input_mode = INPUT_MODE_LATIN; /** * whether to use event forwarding workaround * See: https://github.com/libhangul/ibus-hangul/issues/42 */ static gboolean use_event_forwarding = TRUE; /** * whether to use client commit * See: https://github.com/libhangul/ibus-hangul/pull/68 */ static gboolean use_client_commit = FALSE; /** * global preedit mode * This option may have a value, one of the IBusHangulPreeditMode. * See: https://github.com/libhangul/ibus-hangul/issues/69 */ static IBusHangulPreeditMode global_preedit_mode = PREEDIT_MODE_SYLLABLE; static glong ucschar_strlen (const ucschar* str) { const ucschar* p = str; while (*p != 0) p++; return p - str; } static void check_ibus_version () { gboolean retval; gchar* standard_output = NULL; const gchar* version_str; gchar** version_str_array; gint version[3]; retval = g_spawn_command_line_sync ("ibus version", &standard_output, NULL, NULL, NULL); if (!retval) goto fail; version_str = strpbrk (standard_output, " \t"); if (version_str == NULL) { g_free (standard_output); goto fail; } while (*version_str == ' ' || *version_str == '\t') version_str++; version_str_array = g_strsplit (version_str, ".", 3); g_free (standard_output); if (version_str_array == NULL) { goto fail; } version[0] = 0; version[1] = 0; version[2] = 0; for (gint i = 0; version_str_array[i] != NULL; ++i) { version[i] = g_ascii_strtoll (version_str_array[i], NULL, 10); } g_strfreev (version_str_array); if (version[0] == 0 && version[1] == 0 && version[2] == 0) { goto fail; } ibus_version[0] = version[0]; ibus_version[1] = version[1]; ibus_version[2] = version[2]; g_debug ("ibus version detected: %d.%d.%d", ibus_version[0], ibus_version[1], ibus_version[2]); return; fail: g_debug ("ibus version detection failed: use default value: %d.%d.%d", ibus_version[0], ibus_version[1], ibus_version[2]); } static gboolean ibus_hangul_check_ibus_version (gint required_major, gint required_minor, gint required_micro) { gint major = ibus_version[0]; gint minor = ibus_version[1]; gint micro = ibus_version[2]; return major > required_major || (major == required_major && minor > required_minor) || (major == required_major && minor == required_minor && micro >= required_micro); } static gboolean check_client_commit () { gboolean client_commit = FALSE; client_commit = ibus_hangul_check_ibus_version (1, 5, 20); g_debug ("client_commit: %d", client_commit); return client_commit; } GType ibus_hangul_engine_get_type (void) { static GType type = 0; static const GTypeInfo type_info = { sizeof (IBusHangulEngineClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ibus_hangul_engine_class_init, NULL, NULL, sizeof (IBusHangulEngine), 0, (GInstanceInitFunc) ibus_hangul_engine_init, }; if (type == 0) { type = g_type_register_static (IBUS_TYPE_ENGINE_SIMPLE, "IBusHangulEngine", &type_info, (GTypeFlags) 0); } return type; } void ibus_hangul_init (IBusBus *bus) { GVariant* value = NULL; last_context_id = 0; hanja_table = hanja_table_load (NULL); symbol_table = hanja_table_load (IBUSHANGUL_DATADIR "/data/symbol.txt"); check_ibus_version (); settings_hangul = g_settings_new ("org.freedesktop.ibus.engine.hangul"); settings_panel = g_settings_new ("org.freedesktop.ibus.panel"); hangul_keyboard = g_string_new_len (NULL, 8); value = g_settings_get_value (settings_hangul, "hangul-keyboard"); if (value != NULL) { const gchar* str = g_variant_get_string (value, NULL); g_string_assign (hangul_keyboard, str); g_clear_pointer (&value, g_variant_unref); } hotkey_list_init(&switch_keys); value = g_settings_get_value (settings_hangul, "switch-keys"); if (value != NULL) { const gchar* str = g_variant_get_string (value, NULL); hotkey_list_set_from_string(&switch_keys, str); g_clear_pointer (&value, g_variant_unref); } else { hotkey_list_append(&switch_keys, IBUS_Hangul, 0); hotkey_list_append(&switch_keys, IBUS_space, IBUS_SHIFT_MASK); } hotkey_list_init(&hanja_keys); value = g_settings_get_value (settings_hangul, "hanja-keys"); if (value != NULL) { const gchar* str = g_variant_get_string (value, NULL); hotkey_list_set_from_string(&hanja_keys, str); g_clear_pointer (&value, g_variant_unref); } else { hotkey_list_append(&hanja_keys, IBUS_Hangul_Hanja, 0); hotkey_list_append(&hanja_keys, IBUS_F9, 0); } hotkey_list_init (&on_keys); value = g_settings_get_value (settings_hangul, "on-keys"); if (value != NULL) { const gchar* str = g_variant_get_string (value, NULL); hotkey_list_set_from_string (&on_keys, str); g_clear_pointer (&value, g_variant_unref); } hotkey_list_init (&off_keys); value = g_settings_get_value (settings_hangul, "off-keys"); if (value != NULL) { const gchar* str = g_variant_get_string (value, NULL); hotkey_list_set_from_string (&off_keys, str); g_clear_pointer (&value, g_variant_unref); } value = g_settings_get_value (settings_hangul, "word-commit"); if (value != NULL) { word_commit = g_variant_get_boolean (value); g_clear_pointer (&value, g_variant_unref); } value = g_settings_get_value (settings_hangul, "auto-reorder"); if (value != NULL) { auto_reorder = g_variant_get_boolean (value); g_clear_pointer (&value, g_variant_unref); } value = g_settings_get_value (settings_hangul, "disable-latin-mode"); if (value != NULL) { disable_latin_mode = g_variant_get_boolean (value); g_clear_pointer (&value, g_variant_unref); } value = g_settings_get_value (settings_hangul, "initial-input-mode"); if (value != NULL) { const gchar* str = g_variant_get_string (value, NULL); if (strcmp(str, "latin") == 0) { initial_input_mode = INPUT_MODE_LATIN; } else if (strcmp(str, "hangul") == 0) { initial_input_mode = INPUT_MODE_HANGUL; } g_clear_pointer (&value, g_variant_unref); } value = g_settings_get_value (settings_hangul, "use-event-forwarding"); if (value != NULL) { use_event_forwarding = g_variant_get_boolean (value); g_clear_pointer (&value, g_variant_unref); } value = g_settings_get_value (settings_hangul, "preedit-mode"); if (value != NULL) { const gchar* str = g_variant_get_string (value, NULL); if (strcmp(str, "none") == 0) { global_preedit_mode = PREEDIT_MODE_NONE; } else if (strcmp(str, "word") == 0) { global_preedit_mode = PREEDIT_MODE_WORD; } else { global_preedit_mode = PREEDIT_MODE_SYLLABLE; } g_clear_pointer (&value, g_variant_unref); } value = g_settings_get_value (settings_panel, "lookup-table-orientation"); if (value != NULL) { lookup_table_orientation = g_variant_get_int32(value); g_clear_pointer (&value, g_variant_unref); } keymap = ibus_keymap_get("us"); use_client_commit = check_client_commit (); g_debug ("init"); } void ibus_hangul_exit (void) { g_debug ("exit"); if (keymap != NULL) { g_object_unref(keymap); keymap = NULL; } hotkey_list_fini (&switch_keys); hotkey_list_fini (&hanja_keys); hotkey_list_fini (&on_keys); hotkey_list_fini (&off_keys); hanja_table_delete (hanja_table); hanja_table = NULL; hanja_table_delete (symbol_table); symbol_table = NULL; g_clear_object (&settings_hangul); g_clear_object (&settings_panel); g_string_free (hangul_keyboard, TRUE); hangul_keyboard = NULL; } /* static void ibus_hangul_engine_set_surrounding_text (IBusEngine *engine, IBusText *text, guint cursor_index, guint anchor_pos) { g_debug ("set_surrounding_text: %s %d %d", ibus_text_get_text (text), cursor_index, anchor_pos); } */ static void ibus_hangul_engine_class_init (IBusHangulEngineClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass); IBusEngineClass *engine_class = IBUS_ENGINE_CLASS (klass); parent_class = (IBusEngineSimpleClass *) g_type_class_peek_parent (klass); object_class->constructor = ibus_hangul_engine_constructor; ibus_object_class->destroy = (IBusObjectDestroyFunc) ibus_hangul_engine_destroy; engine_class->process_key_event = ibus_hangul_engine_process_key_event; engine_class->reset = ibus_hangul_engine_reset; engine_class->enable = ibus_hangul_engine_enable; engine_class->disable = ibus_hangul_engine_disable; engine_class->focus_in = ibus_hangul_engine_focus_in; engine_class->focus_out = ibus_hangul_engine_focus_out; engine_class->set_capabilities = ibus_hangul_engine_set_capabilities; engine_class->page_up = ibus_hangul_engine_page_up; engine_class->page_down = ibus_hangul_engine_page_down; engine_class->cursor_up = ibus_hangul_engine_cursor_up; engine_class->cursor_down = ibus_hangul_engine_cursor_down; engine_class->property_activate = ibus_hangul_engine_property_activate; engine_class->candidate_clicked = ibus_hangul_engine_candidate_clicked; //engine_class->set_surrounding_text = ibus_hangul_engine_set_surrounding_text; engine_class->set_content_type = ibus_hangul_engine_set_content_type; } static void ibus_hangul_engine_init (IBusHangulEngine *hangul) { IBusProperty* prop; IBusText* label; IBusText* tooltip; IBusText* symbol; hangul->id = last_context_id; ++last_context_id; hangul->context = hangul_ic_new (hangul_keyboard->str); hangul_ic_connect_callback (hangul->context, "transition", ibus_hangul_engine_on_transition, hangul); hangul->preedit = ustring_new(); hangul->preedit_mode = global_preedit_mode; hangul->hanja_list = NULL; hangul->input_mode = initial_input_mode; hangul->input_purpose = IBUS_INPUT_PURPOSE_FREE_FORM; hangul->hanja_mode = FALSE; hangul->last_lookup_method = LOOKUP_METHOD_PREFIX; hangul->caps = 0; if (disable_latin_mode) { hangul->input_mode = INPUT_MODE_HANGUL; } hangul->prop_list = ibus_prop_list_new (); g_object_ref_sink (hangul->prop_list); label = ibus_text_new_from_string (_("Hangul mode")); tooltip = ibus_text_new_from_string (_("Enable/Disable Hangul mode")); prop = ibus_property_new ("InputMode", PROP_TYPE_TOGGLE, label, NULL, tooltip, TRUE, TRUE, PROP_STATE_UNCHECKED, NULL); symbol = ibus_hangul_engine_get_input_mode_symbol (hangul, hangul->input_mode); ibus_property_set_symbol(prop, symbol); g_object_ref_sink (prop); ibus_prop_list_append (hangul->prop_list, prop); hangul->prop_hangul_mode = prop; label = ibus_text_new_from_string (_("Hanja lock")); tooltip = ibus_text_new_from_string (_("Enable/Disable Hanja mode")); prop = ibus_property_new ("hanja_mode", PROP_TYPE_TOGGLE, label, NULL, tooltip, TRUE, TRUE, PROP_STATE_UNCHECKED, NULL); g_object_ref_sink (prop); ibus_prop_list_append (hangul->prop_list, prop); hangul->prop_hanja_mode = prop; label = ibus_text_new_from_string (_("Setup")); tooltip = ibus_text_new_from_string (_("Configure hangul engine")); prop = ibus_property_new ("setup", PROP_TYPE_NORMAL, label, "gtk-preferences", tooltip, TRUE, TRUE, PROP_STATE_UNCHECKED, NULL); ibus_prop_list_append (hangul->prop_list, prop); hangul->table = ibus_lookup_table_new (9, 0, TRUE, FALSE); g_object_ref_sink (hangul->table); g_signal_connect (settings_hangul, "changed", G_CALLBACK (settings_changed), hangul); g_signal_connect (settings_panel, "changed", G_CALLBACK (settings_changed), hangul); g_debug ("context new:%u", hangul->id); } static GObject* ibus_hangul_engine_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params) { IBusHangulEngine *hangul; hangul = (IBusHangulEngine *) G_OBJECT_CLASS (parent_class)->constructor (type, n_construct_params, construct_params); return (GObject *)hangul; } static void ibus_hangul_engine_destroy (IBusHangulEngine *hangul) { int i; IBusText **symbols; g_debug ("context delete:%u", hangul->id); if (hangul->prop_hangul_mode) { g_object_unref (hangul->prop_hangul_mode); hangul->prop_hangul_mode = NULL; } if (hangul->prop_hanja_mode) { g_object_unref (hangul->prop_hanja_mode); hangul->prop_hanja_mode = NULL; } if (hangul->prop_list) { g_object_unref (hangul->prop_list); hangul->prop_list = NULL; } if (hangul->preedit != NULL) { ustring_delete (hangul->preedit); hangul->preedit = NULL; } if (hangul->table) { g_object_unref (hangul->table); hangul->table = NULL; } if (hangul->context) { hangul_ic_delete (hangul->context); hangul->context = NULL; } symbols = hangul->input_mode_symbols; for (i = 0; i < INPUT_MODE_COUNT; ++i) { if (symbols[i] != NULL) { g_object_unref(symbols[i]); symbols[i] = NULL; } } IBUS_OBJECT_CLASS (parent_class)->destroy ((IBusObject *)hangul); } /** * @brief a function to check whether the caret has moved * * An ibus client should inform to the engine that the caret has moved * by calling reset method. But many implementations don't follow this rule. * So we need to check whether the caret pos is changed. * If so, we will reset the context. * * Usually we don't need this function. Only when the preedit mode is * PREEDIT_MODE_NONE, it is critical to have same surrounding text and * internal cached preedit text. */ static void ibus_hangul_engine_check_caret_pos_sanity (IBusHangulEngine *hangul) { size_t preedit_len = ustring_length (hangul->preedit); if (preedit_len == 0) return; IBusText* ibus_text = NULL; guint cursor_pos = 0; guint anchor_pos = 0; ibus_engine_get_surrounding_text ((IBusEngine *)hangul, &ibus_text, &cursor_pos, &anchor_pos); const gchar* text = ibus_text_get_text (ibus_text); if (text == NULL || cursor_pos == 0) return; const gchar* text_on_cursor = g_utf8_offset_to_pointer (text, cursor_pos - 1); gchar* preedit_utf8 = ustring_to_utf8 (hangul->preedit, -1); if (preedit_utf8 == NULL) { g_object_unref (ibus_text); return; } size_t n = strlen(preedit_utf8); // Ok, Just comparing text value is not perfect. But any other idea? if (strncmp(preedit_utf8, text_on_cursor, n) != 0) { // If the text_on_cursor is different from preedit cache, there's a possibility // that the cursor was moved by the user. Then we need to reset the context. hangul_ic_reset (hangul->context); ustring_clear (hangul->preedit); } g_free (preedit_utf8); g_object_unref (ibus_text); } static void ibus_hangul_engine_update_preedit_mode (IBusHangulEngine *hangul) { if (global_preedit_mode == PREEDIT_MODE_NONE && !(hangul->caps & IBUS_CAP_SURROUNDING_TEXT)) { // If an instance doesn't support surrounding text, ibus-hangul will change // preedit mode of this instance to PREEDIT_MODE_SYLLABLE. // Because without surrounding text feature, users cannot see "composing text". // This is pretty inconvenient for korean users. hangul->preedit_mode = PREEDIT_MODE_SYLLABLE; } else { hangul->preedit_mode = global_preedit_mode; } } static void ibus_hangul_engine_clear_preedit_text (IBusHangulEngine *hangul) { IBusText *text; text = ibus_text_new_from_static_string (""); ibus_engine_update_preedit_text ((IBusEngine *)hangul, text, 0, FALSE); } static void ibus_hangul_engine_update_preedit_text (IBusHangulEngine *hangul) { const ucschar *hic_preedit; IBusText *text; UString *preedit; gint preedit_len; if (hangul->preedit_mode == PREEDIT_MODE_NONE) { return; } // ibus-hangul's preedit string is made up of ibus context's // internal preedit string and libhangul's preedit string. // libhangul only supports one syllable preedit string. // In order to make longer preedit string, ibus-hangul maintains // internal preedit string. hic_preedit = hangul_ic_get_preedit_string (hangul->context); preedit = ustring_dup (hangul->preedit); preedit_len = ustring_length(preedit); ustring_append_ucs4 (preedit, hic_preedit, -1); if (ustring_length(preedit) > 0) { IBusPreeditFocusMode preedit_option = IBUS_ENGINE_PREEDIT_COMMIT; if (hangul->hanja_list != NULL) preedit_option = IBUS_ENGINE_PREEDIT_CLEAR; text = ibus_text_new_from_ucs4 ((gunichar*)preedit->data); // ibus-hangul's internal preedit string ibus_text_append_attribute (text, IBUS_ATTR_TYPE_UNDERLINE, IBUS_ATTR_UNDERLINE_SINGLE, 0, preedit_len); // Preedit string from libhangul context. // This is currently composing syllable. ibus_text_append_attribute (text, IBUS_ATTR_TYPE_FOREGROUND, 0x00ffffff, preedit_len, -1); ibus_text_append_attribute (text, IBUS_ATTR_TYPE_BACKGROUND, 0x00000000, preedit_len, -1); ibus_engine_update_preedit_text_with_mode ((IBusEngine *)hangul, text, ibus_text_get_length (text), TRUE, preedit_option); } else { text = ibus_text_new_from_static_string (""); ibus_engine_update_preedit_text ((IBusEngine *)hangul, text, 0, FALSE); } ustring_delete(preedit); } static void ibus_hangul_engine_process_commit_and_edit (IBusHangulEngine *hangul) { // commit current commit_text + preedit_text const ucschar *hic_commit_text = hangul_ic_get_commit_string (hangul->context); const ucschar *hic_preedit_text = hangul_ic_get_preedit_string (hangul->context); UString *commit_text = ustring_new (); ustring_append_ucs4 (commit_text, hic_commit_text, -1); ustring_append_ucs4 (commit_text, hic_preedit_text, -1); // commit only when the final result is different from preedit text cache if (ustring_compare (commit_text, hangul->preedit) != 0) { IBusEngine *engine = (IBusEngine *)hangul; // remove composing text guint preedit_text_len = ustring_length (hangul->preedit); ibus_engine_delete_surrounding_text (engine, -preedit_text_len, preedit_text_len); const ucschar *s = ustring_begin (commit_text); IBusText *text = ibus_text_new_from_ucs4 (s); ibus_engine_commit_text (engine, text); } ustring_delete (commit_text); // update preedit_text cache ustring_clear (hangul->preedit); ustring_append_ucs4 (hangul->preedit, hic_preedit_text, -1); } static void ibus_hangul_engine_process_edit_and_commit (IBusHangulEngine *hangul) { IBusEngine *engine = (IBusEngine *)hangul; const ucschar *hic_commit_text = hangul_ic_get_commit_string (hangul->context); const ucschar *hic_preedit_text = hangul_ic_get_preedit_string (hangul->context); if (hangul->preedit_mode == PREEDIT_MODE_WORD || hangul->hanja_mode) { ustring_append_ucs4 (hangul->preedit, hic_commit_text, -1); if (hic_preedit_text == NULL || hic_preedit_text[0] == 0) { if (ustring_length (hangul->preedit) > 0) { IBusText *text; const ucschar* preedit_text; /* clear preedit text before commit */ ibus_hangul_engine_clear_preedit_text (hangul); preedit_text = ustring_begin (hangul->preedit); text = ibus_text_new_from_ucs4 ((gunichar*)preedit_text); ibus_engine_commit_text (engine, text); ustring_clear (hangul->preedit); } } } else { if (hic_commit_text != NULL && hic_commit_text[0] != 0) { IBusText *text; /* clear preedit text before commit */ ibus_hangul_engine_clear_preedit_text (hangul); text = ibus_text_new_from_ucs4 (hic_commit_text); ibus_engine_commit_text (engine, text); } } ibus_hangul_engine_update_preedit_text (hangul); } static void ibus_hangul_engine_update_lookup_table_ui (IBusHangulEngine *hangul) { guint cursor_pos; const char* comment; IBusText* text; // update aux text cursor_pos = ibus_lookup_table_get_cursor_pos (hangul->table); comment = hanja_list_get_nth_comment (hangul->hanja_list, cursor_pos); text = ibus_text_new_from_string (comment); ibus_engine_update_auxiliary_text ((IBusEngine *)hangul, text, TRUE); // update lookup table ibus_engine_update_lookup_table ((IBusEngine *)hangul, hangul->table, TRUE); } static void ibus_hangul_engine_commit_current_candidate (IBusHangulEngine *hangul) { guint cursor_pos; const char* key; const char* value; const ucschar* hic_preedit; glong key_len; glong hic_preedit_len; glong preedit_len; IBusText* text; cursor_pos = ibus_lookup_table_get_cursor_pos (hangul->table); key = hanja_list_get_nth_key (hangul->hanja_list, cursor_pos); value = hanja_list_get_nth_value (hangul->hanja_list, cursor_pos); hic_preedit = hangul_ic_get_preedit_string (hangul->context); key_len = g_utf8_strlen(key, -1); preedit_len = ustring_length(hangul->preedit); hic_preedit_len = ucschar_strlen (hic_preedit); if (hangul->last_lookup_method == LOOKUP_METHOD_PREFIX) { if (preedit_len == 0 && hic_preedit_len == 0) { /* remove surrounding_text */ if (key_len > 0) { ibus_engine_delete_surrounding_text ((IBusEngine *)hangul, -key_len , key_len); } } else { /* remove ibus preedit text */ if (key_len > 0) { glong n = MIN(key_len, preedit_len); ustring_erase (hangul->preedit, 0, n); key_len -= preedit_len; } /* remove hic preedit text */ if (key_len > 0) { hangul_ic_reset (hangul->context); key_len -= hic_preedit_len; } } } else { /* remove hic preedit text */ if (hic_preedit_len > 0) { hangul_ic_reset (hangul->context); if (hangul->preedit_mode == PREEDIT_MODE_NONE) { if (preedit_len > hic_preedit_len) { guint pos = preedit_len - hic_preedit_len; ustring_erase (hangul->preedit, pos, hic_preedit_len); } else { ustring_clear (hangul->preedit); } preedit_len = ustring_length(hangul->preedit); } else { key_len -= hic_preedit_len; } } /* remove ibus preedit text */ if (key_len > preedit_len) { ustring_erase (hangul->preedit, 0, preedit_len); key_len -= preedit_len; } else if (key_len > 0) { ustring_erase (hangul->preedit, 0, key_len); key_len = 0; } /* remove surrounding_text */ if (key_len > 0) { ibus_engine_delete_surrounding_text ((IBusEngine *)hangul, -key_len , key_len); } } /* clear preedit text before commit */ ibus_hangul_engine_clear_preedit_text (hangul); text = ibus_text_new_from_string (value); ibus_engine_commit_text ((IBusEngine *)hangul, text); ibus_hangul_engine_update_preedit_text (hangul); } static gchar* h_ibus_text_get_substring (IBusText* ibus_text, glong p1, glong p2) { const gchar* text; const gchar* begin; const gchar* end; gchar* substring; glong limit; glong pos; glong n; text = ibus_text_get_text (ibus_text); limit = ibus_text_get_length (ibus_text) + 1; if (text == NULL || limit == 0) return NULL; p1 = MAX(0, p1); p2 = MAX(0, p2); pos = MIN(p1, p2); n = ABS(p2 - p1); if (pos + n > limit) n = limit - pos; begin = g_utf8_offset_to_pointer (text, pos); end = g_utf8_offset_to_pointer (begin, n); substring = g_strndup (begin, end - begin); return substring; } static HanjaList* ibus_hangul_engine_lookup_hanja_table (const char* key, int method) { HanjaList* list = NULL; if (key == NULL) return NULL; switch (method) { case LOOKUP_METHOD_EXACT: if (symbol_table != NULL) list = hanja_table_match_exact (symbol_table, key); if (list == NULL) list = hanja_table_match_exact (hanja_table, key); break; case LOOKUP_METHOD_PREFIX: if (symbol_table != NULL) list = hanja_table_match_prefix (symbol_table, key); if (list == NULL) list = hanja_table_match_prefix (hanja_table, key); break; case LOOKUP_METHOD_SUFFIX: if (symbol_table != NULL) list = hanja_table_match_suffix (symbol_table, key); if (list == NULL) list = hanja_table_match_suffix (hanja_table, key); break; } g_debug("lookup hanja table: %s", key); return list; } static void ibus_hangul_engine_update_hanja_list (IBusHangulEngine *hangul) { gchar* hanja_key; gchar* preedit_utf8; const ucschar* hic_preedit; UString* preedit = NULL; int lookup_method; IBusText* ibus_text = NULL; guint cursor_pos = 0; guint anchor_pos = 0; if (hangul->hanja_list != NULL) { hanja_list_delete (hangul->hanja_list); hangul->hanja_list = NULL; } hic_preedit = hangul_ic_get_preedit_string (hangul->context); hanja_key = NULL; lookup_method = LOOKUP_METHOD_PREFIX; if (hangul->preedit_mode != PREEDIT_MODE_NONE) { preedit = ustring_dup (hangul->preedit); ustring_append_ucs4 (preedit, hic_preedit, -1); } if (preedit != NULL && ustring_length(preedit) > 0) { preedit_utf8 = ustring_to_utf8 (preedit, -1); if (hangul->preedit_mode == PREEDIT_MODE_WORD || hangul->hanja_mode) { hanja_key = preedit_utf8; lookup_method = LOOKUP_METHOD_PREFIX; } else { gchar* substr; ibus_engine_get_surrounding_text ((IBusEngine *)hangul, &ibus_text, &cursor_pos, &anchor_pos); substr = h_ibus_text_get_substring (ibus_text, (glong)cursor_pos - 32, cursor_pos); if (substr != NULL) { hanja_key = g_strconcat (substr, preedit_utf8, NULL); g_free (preedit_utf8); } else { hanja_key = preedit_utf8; } lookup_method = LOOKUP_METHOD_SUFFIX; } } else { ibus_engine_get_surrounding_text ((IBusEngine *)hangul, &ibus_text, &cursor_pos, &anchor_pos); if (cursor_pos != anchor_pos) { // If we have selection in surrounding text, we use that. hanja_key = h_ibus_text_get_substring (ibus_text, cursor_pos, anchor_pos); lookup_method = LOOKUP_METHOD_EXACT; } else { hanja_key = h_ibus_text_get_substring (ibus_text, (glong)cursor_pos - 32, cursor_pos); lookup_method = LOOKUP_METHOD_SUFFIX; } } if (hanja_key != NULL) { hangul->hanja_list = ibus_hangul_engine_lookup_hanja_table (hanja_key, lookup_method); hangul->last_lookup_method = lookup_method; g_free (hanja_key); } if (preedit != NULL) ustring_delete (preedit); if (ibus_text != NULL) g_object_unref (ibus_text); } static void ibus_hangul_engine_apply_hanja_list (IBusHangulEngine *hangul) { HanjaList* list = hangul->hanja_list; if (list != NULL) { int i, n; n = hanja_list_get_size (list); ibus_lookup_table_clear (hangul->table); for (i = 0; i < n; i++) { const char* value = hanja_list_get_nth_value (list, i); IBusText* text = ibus_text_new_from_string (value); ibus_lookup_table_append_candidate (hangul->table, text); } ibus_lookup_table_set_cursor_pos (hangul->table, 0); ibus_hangul_engine_update_lookup_table_ui (hangul); lookup_table_set_visible (hangul->table, TRUE); } } static void ibus_hangul_engine_hide_lookup_table (IBusHangulEngine *hangul) { gboolean is_visible; is_visible = lookup_table_is_visible (hangul->table); // Sending hide lookup table message when the lookup table // is not visible results wrong behavior. So I have to check // whether the table is visible or not before to hide. if (is_visible) { ibus_engine_hide_lookup_table ((IBusEngine *)hangul); ibus_engine_hide_auxiliary_text ((IBusEngine *)hangul); lookup_table_set_visible (hangul->table, FALSE); } if (hangul->hanja_list != NULL) { hanja_list_delete (hangul->hanja_list); hangul->hanja_list = NULL; } } static void ibus_hangul_engine_update_lookup_table (IBusHangulEngine *hangul) { ibus_hangul_engine_update_hanja_list (hangul); if (hangul->hanja_list != NULL) { // We should redraw preedit text with IBUS_ENGINE_PREEDIT_CLEAR option // here to prevent committing it on focus out event incidentally. ibus_hangul_engine_update_preedit_text (hangul); ibus_hangul_engine_apply_hanja_list (hangul); } else { ibus_hangul_engine_hide_lookup_table (hangul); } } static gboolean ibus_hangul_engine_process_candidate_key_event (IBusHangulEngine *hangul, guint keyval, guint modifiers) { if (keyval == IBUS_Escape) { ibus_hangul_engine_hide_lookup_table (hangul); // When the lookup table is poped up, preedit string is // updated with IBUS_ENGINE_PREEDIT_CLEAR option. // So, when focus is out, the preedit text will not be committed. // To prevent this problem, we have to update preedit text here // with IBUS_ENGINE_PREEDIT_COMMIT option. ibus_hangul_engine_update_preedit_text (hangul); return TRUE; } else if (keyval == IBUS_Return) { ibus_hangul_engine_commit_current_candidate (hangul); if (hangul->hanja_mode && ibus_hangul_engine_has_preedit (hangul)) { ibus_hangul_engine_update_lookup_table (hangul); } else { ibus_hangul_engine_hide_lookup_table (hangul); } return TRUE; } else if (keyval >= IBUS_1 && keyval <= IBUS_9) { guint page_no; guint page_size; guint cursor_pos; page_size = ibus_lookup_table_get_page_size (hangul->table); cursor_pos = ibus_lookup_table_get_cursor_pos (hangul->table); page_no = cursor_pos / page_size; cursor_pos = page_no * page_size + (keyval - IBUS_1); ibus_lookup_table_set_cursor_pos (hangul->table, cursor_pos); ibus_hangul_engine_commit_current_candidate (hangul); if (hangul->hanja_mode && ibus_hangul_engine_has_preedit (hangul)) { ibus_hangul_engine_update_lookup_table (hangul); } else { ibus_hangul_engine_hide_lookup_table (hangul); } return TRUE; } else if (keyval == IBUS_Page_Up) { ibus_lookup_table_page_up (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); return TRUE; } else if (keyval == IBUS_Page_Down) { ibus_lookup_table_page_down (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); return TRUE; } else { if (lookup_table_orientation == 0) { // horizontal if (keyval == IBUS_Left) { ibus_lookup_table_cursor_up (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); return TRUE; } else if (keyval == IBUS_Right) { ibus_lookup_table_cursor_down (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); return TRUE; } else if (keyval == IBUS_Up) { ibus_lookup_table_page_up (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); return TRUE; } else if (keyval == IBUS_Down) { ibus_lookup_table_page_down (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); return TRUE; } } else { // vertical if (keyval == IBUS_Left) { ibus_lookup_table_page_up (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); return TRUE; } else if (keyval == IBUS_Right) { ibus_lookup_table_page_down (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); return TRUE; } else if (keyval == IBUS_Up) { ibus_lookup_table_cursor_up (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); return TRUE; } else if (keyval == IBUS_Down) { ibus_lookup_table_cursor_down (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); return TRUE; } } } if (!hangul->hanja_mode) { if (lookup_table_orientation == 0) { // horizontal if (keyval == IBUS_h) { ibus_lookup_table_cursor_up (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); return TRUE; } else if (keyval == IBUS_l) { ibus_lookup_table_cursor_down (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); return TRUE; } else if (keyval == IBUS_k) { ibus_lookup_table_page_up (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); return TRUE; } else if (keyval == IBUS_j) { ibus_lookup_table_page_down (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); return TRUE; } } else { // vertical if (keyval == IBUS_h) { ibus_lookup_table_page_up (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); return TRUE; } else if (keyval == IBUS_l) { ibus_lookup_table_page_down (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); return TRUE; } else if (keyval == IBUS_k) { ibus_lookup_table_cursor_up (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); return TRUE; } else if (keyval == IBUS_j) { ibus_lookup_table_cursor_down (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); return TRUE; } } } return FALSE; } static gboolean ibus_hangul_engine_process_key_event (IBusEngine *engine, guint keyval, guint keycode, guint modifiers) { IBusHangulEngine *hangul = (IBusHangulEngine *) engine; guint mask; gboolean retval; guint orig_keyval = keyval; if (modifiers & IBUS_RELEASE_MASK) return FALSE; // if we don't ignore shift keys, shift key will make flush the preedit // string. So you cannot input shift+key. // Let's think about these examples: // dlTek (2 set) // qhRdmaqkq (2 set) if (keyval == IBUS_Shift_L || keyval == IBUS_Shift_R) return FALSE; // On password mode, we ignore hotkeys if (hangul->input_purpose == IBUS_INPUT_PURPOSE_PASSWORD) return IBUS_ENGINE_CLASS (parent_class)->process_key_event (engine, keyval, keycode, modifiers); /* Process candidate key event before hot keys, * or lookup table can't receive important events. * For example, if Esc key is pressed, this key event should be used for * closing lookup table, not for turning to latin mode. */ if (hangul->hanja_list != NULL) { retval = ibus_hangul_engine_process_candidate_key_event (hangul, keyval, modifiers); if (hangul->hanja_mode) { if (retval) return TRUE; } else { return TRUE; } } // If a hotkey has any modifiers, we ignore that modifier // keyval, or we cannot make the hanja key work. // Because when we get the modifier key alone, we commit the // current preedit string. So after that, even if we get the // right hanja key event, we don't have preedit string to be changed // to hanja word. // See this bug: http://code.google.com/p/ibus/issues/detail?id=1036 if (hotkey_list_has_modifier(&switch_keys, keyval)) return FALSE; if (hotkey_list_match(&switch_keys, keyval, modifiers)) { ibus_hangul_engine_switch_input_mode (hangul); return TRUE; } if (hotkey_list_match (&on_keys, keyval, modifiers)) { ibus_hangul_engine_set_input_mode (hangul, INPUT_MODE_HANGUL); return FALSE; } if (hangul->input_mode == INPUT_MODE_LATIN) return IBUS_ENGINE_CLASS (parent_class)->process_key_event (engine, keyval, keycode, modifiers); /* This feature is for vi* users. * On Esc, the input mode is changed to latin */ if (hotkey_list_match (&off_keys, keyval, modifiers)) { ibus_hangul_engine_set_input_mode (hangul, INPUT_MODE_LATIN); /* If we return TRUE, then vi will not receive "ESC" key event. */ return FALSE; } if (hotkey_list_has_modifier(&hanja_keys, keyval)) return FALSE; if (hotkey_list_match(&hanja_keys, keyval, modifiers)) { if (hangul->hanja_list == NULL) { ibus_hangul_engine_update_lookup_table (hangul); } else { ibus_hangul_engine_hide_lookup_table (hangul); } return TRUE; } // If we've got a key event with some modifiers, commit current // preedit string and ignore this key event. // So, if you want to add some key event handler, put it // before this code. // Ignore key event with control, alt, super or mod5 mask = IBUS_CONTROL_MASK | IBUS_MOD1_MASK | IBUS_MOD3_MASK | IBUS_MOD4_MASK | IBUS_MOD5_MASK; if (modifiers & mask) { ibus_hangul_engine_flush (hangul); return FALSE; } if (hangul->preedit_mode == PREEDIT_MODE_NONE) { ibus_hangul_engine_check_caret_pos_sanity (hangul); } if (keyval == IBUS_BackSpace) { retval = hangul_ic_backspace (hangul->context); if (!retval) { guint preedit_len = ustring_length (hangul->preedit); if (preedit_len > 0) { ustring_erase (hangul->preedit, preedit_len - 1, 1); retval = TRUE; } } if (hangul->preedit_mode == PREEDIT_MODE_NONE) { ibus_hangul_engine_process_commit_and_edit (hangul); } else { ibus_hangul_engine_update_preedit_text (hangul); } if (hangul->hanja_mode) { if (ibus_hangul_engine_has_preedit (hangul)) { ibus_hangul_engine_update_lookup_table (hangul); } else { ibus_hangul_engine_hide_lookup_table (hangul); } } } else { // We need to normalize the keyval to US qwerty keylayout, // because the korean input method is depend on the position of // each key, not the character. We make the keyval from keycode // as if the keyboard is US qwerty layout. Then we can assume the // keyval represent the position of the each key. // But if the hic is in transliteration mode, then we should not // normalize the keyval. bool is_transliteration_mode = hangul_ic_is_transliteration(hangul->context); if (!is_transliteration_mode) { if (keymap != NULL) keyval = ibus_keymap_lookup_keysym(keymap, keycode, modifiers); } // ignore capslock if (modifiers & IBUS_LOCK_MASK) { if (keyval >= 'A' && keyval <= 'z') { if (isupper(keyval)) keyval = tolower(keyval); else keyval = toupper(keyval); } } retval = hangul_ic_process (hangul->context, keyval); if (hangul->preedit_mode == PREEDIT_MODE_NONE) { ibus_hangul_engine_process_commit_and_edit (hangul); } else { ibus_hangul_engine_process_edit_and_commit (hangul); } if (hangul->hanja_mode) { ibus_hangul_engine_update_lookup_table (hangul); } if (!retval) ibus_hangul_engine_flush (hangul); } /* We always return TRUE here even if we didn't use this event. * Instead, we forward the event to clients. * * Because IBus has a problem with sync mode. * I think it's limitations of IBus implementation. * We call several engine functions(updating preedit text and committing * text) inside this function. * But clients cannot receive the results of other calls until this * function ends. Clients only get one result from a remote call at a time * because clients may run on event loop. * Clients may process this event first and then get the results which * may change the preedit text or commit text. * So the event order is broken. * Call order: * engine client * call process_key_event * begin process_key_event * call commit_text * call update_preedit_text * return the event as unused * receive the result of process_key_event * receive the result of commit_text * receive the result of update_preedit_text * * To solve this problem, we return TRUE as if we consumed this event. * After that, we forward this event to clients. * Then clients may get the events in correct order. * This approach is a kind of async processing. * Call order: * engine client * call process_key_event * begin process_key_event * call commit_text * call update_preedit_text * call forward_key_event * return the event as used * receive the result of process_key_event * receive the result of commit_text * receive the result of update_preedit_text * receive the forwarded key event * * See: https://github.com/choehwanjin/ibus-hangul/issues/42 */ if (use_event_forwarding #if IBUS_CHECK_VERSION(1, 5, 28) && (hangul->caps & IBUS_CAP_SYNC_PROCESS_KEY_V2) #endif ) { if (!retval) { ibus_engine_forward_key_event (engine, orig_keyval, keycode, modifiers); } return TRUE; } return retval; } static void ibus_hangul_engine_flush (IBusHangulEngine *hangul) { const gunichar *str; IBusText *text; ibus_hangul_engine_hide_lookup_table (hangul); str = hangul_ic_flush (hangul->context); ustring_append_ucs4 (hangul->preedit, str, -1); if (ustring_length (hangul->preedit) != 0) { /* clear preedit text before commit */ ibus_hangul_engine_clear_preedit_text (hangul); str = ustring_begin (hangul->preedit); text = ibus_text_new_from_ucs4 (str); g_debug ("flush:%u: %s", hangul->id, text->text); ibus_engine_commit_text ((IBusEngine *) hangul, text); ustring_clear(hangul->preedit); } ibus_hangul_engine_update_preedit_text (hangul); } static void ibus_hangul_engine_focus_in (IBusEngine *engine) { IBusHangulEngine *hangul = (IBusHangulEngine *) engine; //g_debug ("focus_in: %u", hangul->id); ibus_hangul_engine_update_preedit_mode (hangul); if (hangul->input_mode == INPUT_MODE_HANGUL) { ibus_property_set_state (hangul->prop_hangul_mode, PROP_STATE_CHECKED); } else { ibus_property_set_state (hangul->prop_hangul_mode, PROP_STATE_UNCHECKED); } if (hangul->hanja_mode) { ibus_property_set_state (hangul->prop_hanja_mode, PROP_STATE_CHECKED); } else { ibus_property_set_state (hangul->prop_hanja_mode, PROP_STATE_UNCHECKED); } ibus_engine_register_properties (engine, hangul->prop_list); ibus_hangul_engine_update_preedit_text (hangul); if (hangul->hanja_list != NULL) { ibus_hangul_engine_update_lookup_table_ui (hangul); } IBUS_ENGINE_CLASS (parent_class)->focus_in (engine); } static void ibus_hangul_engine_focus_out (IBusEngine *engine) { IBusHangulEngine *hangul = (IBusHangulEngine *) engine; //g_debug ("focus_out: %u", hangul->id); if (hangul->hanja_list == NULL) { // ibus-hangul uses // ibus_engine_update_preedit_text_with_mode() function which makes // the preedit string committed automatically when the focus is out. // So we don't need to commit the preedit here. hangul_ic_reset (hangul->context); ustring_clear (hangul->preedit); } else { ibus_engine_hide_lookup_table (engine); ibus_engine_hide_auxiliary_text (engine); } IBUS_ENGINE_CLASS (parent_class)->focus_out ((IBusEngine *) hangul); } static void ibus_hangul_engine_reset (IBusEngine *engine) { IBusHangulEngine *hangul = (IBusHangulEngine *) engine; g_debug ("reset:%u", hangul->id); if (hangul->preedit_mode == PREEDIT_MODE_NONE) { hangul_ic_reset (hangul->context); ustring_clear (hangul->preedit); } if (use_client_commit) { // ibus-hangul uses // ibus_engine_update_preedit_text_with_mode() function which makes // the preedit string committed automatically when the reset is received // So we don't need to commit the preedit here. hangul_ic_reset (hangul->context); ustring_clear (hangul->preedit); } ibus_hangul_engine_flush (hangul); IBUS_ENGINE_CLASS (parent_class)->reset (engine); } static void ibus_hangul_engine_enable (IBusEngine *engine) { IBUS_ENGINE_CLASS (parent_class)->enable (engine); g_debug ("enable:%u", ((IBusHangulEngine*) engine)->id); ibus_engine_get_surrounding_text (engine, NULL, NULL, NULL); } static void ibus_hangul_engine_disable (IBusEngine *engine) { g_debug ("disable:%u", ((IBusHangulEngine*) engine)->id); ibus_hangul_engine_focus_out (engine); IBUS_ENGINE_CLASS (parent_class)->disable (engine); } static void ibus_hangul_engine_set_capabilities (IBusEngine *engine, guint caps) { IBusHangulEngine *hangul = (IBusHangulEngine *) engine; hangul->caps = caps; ibus_hangul_engine_update_preedit_mode (hangul); g_debug ("set_capabilities:%u: %x", hangul->id, caps); } static void ibus_hangul_engine_page_up (IBusEngine *engine) { IBUS_ENGINE_CLASS (parent_class)->page_up (engine); } static void ibus_hangul_engine_page_down (IBusEngine *engine) { IBUS_ENGINE_CLASS (parent_class)->page_down (engine); } static void ibus_hangul_engine_cursor_up (IBusEngine *engine) { IBusHangulEngine *hangul = (IBusHangulEngine *) engine; if (hangul->hanja_list != NULL) { ibus_lookup_table_cursor_up (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); } IBUS_ENGINE_CLASS (parent_class)->cursor_up (engine); } static void ibus_hangul_engine_cursor_down (IBusEngine *engine) { IBusHangulEngine *hangul = (IBusHangulEngine *) engine; if (hangul->hanja_list != NULL) { ibus_lookup_table_cursor_down (hangul->table); ibus_hangul_engine_update_lookup_table_ui (hangul); } IBUS_ENGINE_CLASS (parent_class)->cursor_down (engine); } static void ibus_hangul_engine_property_activate (IBusEngine *engine, const gchar *prop_name, guint prop_state) { if (strcmp(prop_name, "setup") == 0) { GError *error = NULL; gchar *argv[2] = { NULL, }; argv[0] = "ibus-setup-hangul"; argv[1] = NULL; g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error); } else if (strcmp(prop_name, "InputMode") == 0) { IBusHangulEngine *hangul = (IBusHangulEngine *) engine; ibus_hangul_engine_switch_input_mode (hangul); } else if (strcmp(prop_name, "hanja_mode") == 0) { IBusHangulEngine *hangul = (IBusHangulEngine *) engine; hangul->hanja_mode = !hangul->hanja_mode; if (hangul->hanja_mode) { ibus_property_set_state (hangul->prop_hanja_mode, PROP_STATE_CHECKED); } else { ibus_property_set_state (hangul->prop_hanja_mode, PROP_STATE_UNCHECKED); } ibus_engine_update_property (engine, hangul->prop_hanja_mode); ibus_hangul_engine_flush (hangul); } } static gboolean ibus_hangul_engine_has_preedit (IBusHangulEngine *hangul) { guint preedit_len; const ucschar *hic_preedit; hic_preedit = hangul_ic_get_preedit_string (hangul->context); if (hic_preedit[0] != 0) return TRUE; preedit_len = ustring_length (hangul->preedit); if (preedit_len > 0) return TRUE; return FALSE; } static void ibus_hangul_engine_switch_input_mode (IBusHangulEngine *hangul) { int input_mode = hangul->input_mode + 1; if (input_mode >= INPUT_MODE_COUNT) { input_mode = INPUT_MODE_HANGUL; } if (hangul->preedit_mode == PREEDIT_MODE_NONE) { hangul_ic_reset (hangul->context); ustring_clear (hangul->preedit); } ibus_hangul_engine_set_input_mode (hangul, input_mode); } static IBusText * ibus_hangul_engine_get_input_mode_symbol (IBusHangulEngine *hangul, int input_mode) { IBusText **symbols = hangul->input_mode_symbols; if (symbols[0] == NULL) { symbols[INPUT_MODE_HANGUL] = ibus_text_new_from_string ("한"); g_object_ref_sink(symbols[INPUT_MODE_HANGUL]); symbols[INPUT_MODE_LATIN] = ibus_text_new_from_string ("EN"); g_object_ref_sink(symbols[INPUT_MODE_LATIN]); } if (input_mode >= INPUT_MODE_COUNT) return symbols[INPUT_MODE_HANGUL]; return symbols[input_mode]; } static void ibus_hangul_engine_set_input_mode (IBusHangulEngine *hangul, int input_mode) { IBusText* symbol; IBusProperty* prop; ibus_hangul_engine_flush (hangul); if (disable_latin_mode) { return; } prop = hangul->prop_hangul_mode; hangul->input_mode = input_mode; g_debug("input_mode:%u: %s", hangul->id, (input_mode == INPUT_MODE_HANGUL) ? "hangul" : "latin"); symbol = ibus_hangul_engine_get_input_mode_symbol (hangul, input_mode); ibus_property_set_symbol(prop, symbol); if (hangul->input_mode == INPUT_MODE_HANGUL) { ibus_property_set_state (prop, PROP_STATE_CHECKED); } else { ibus_property_set_state (prop, PROP_STATE_UNCHECKED); } ibus_engine_update_property (IBUS_ENGINE (hangul), prop); } static bool ibus_hangul_engine_on_transition (HangulInputContext *hic, ucschar c, const ucschar *preedit, void *data) { if (!auto_reorder) { if (hangul_is_choseong (c)) { if (hangul_ic_has_jungseong (hic) || hangul_ic_has_jongseong (hic)) return false; } if (hangul_is_jungseong (c)) { if (hangul_ic_has_jongseong (hic)) return false; } } return true; } static void print_changed_settings (const gchar *schema_id, const gchar *key, GVariant *value) { gchar *variant_printable = g_variant_print (value, FALSE); g_debug ("settings_changed: %s/%s: %s", schema_id, key, variant_printable); g_free (variant_printable); } static void settings_changed (GSettings *settings, const gchar *key, gpointer user_data) { IBusHangulEngine *hangul = (IBusHangulEngine *) user_data; GValue schema_value = G_VALUE_INIT; const gchar *schema_id; GVariant *value; g_return_if_fail (G_IS_SETTINGS (settings)); g_value_init (&schema_value, G_TYPE_STRING); g_object_get_property (G_OBJECT (settings), "schema-id", &schema_value); schema_id = g_value_get_string (&schema_value); value = g_settings_get_value (settings, key); if (strcmp (schema_id, "org.freedesktop.ibus.engine.hangul") == 0) { if (strcmp(key, "hangul-keyboard") == 0) { const gchar *str = g_variant_get_string(value, NULL); g_string_assign (hangul_keyboard, str); hangul_ic_select_keyboard (hangul->context, hangul_keyboard->str); print_changed_settings (schema_id, key, value); } else if (strcmp (key, "hanja-keys") == 0) { const gchar* str = g_variant_get_string(value, NULL); hotkey_list_set_from_string(&hanja_keys, str); print_changed_settings (schema_id, key, value); } else if (strcmp (key, "word-commit") == 0) { word_commit = g_variant_get_boolean (value); print_changed_settings (schema_id, key, value); } else if (strcmp (key, "auto-reorder") == 0) { auto_reorder = g_variant_get_boolean (value); print_changed_settings (schema_id, key, value); } else if (strcmp (key, "switch-keys") == 0) { const gchar* str = g_variant_get_string(value, NULL); hotkey_list_set_from_string(&switch_keys, str); print_changed_settings (schema_id, key, value); } else if (strcmp (key, "on-keys") == 0) { const gchar* str = g_variant_get_string(value, NULL); hotkey_list_set_from_string(&on_keys, str); print_changed_settings (schema_id, key, value); } else if (strcmp (key, "off-keys") == 0) { const gchar* str = g_variant_get_string(value, NULL); hotkey_list_set_from_string(&off_keys, str); print_changed_settings (schema_id, key, value); } else if (strcmp (key, "initial-input-mode") == 0) { const gchar* str = g_variant_get_string (value, NULL); if (strcmp(str, "latin") == 0) { initial_input_mode = INPUT_MODE_LATIN; } else if (strcmp(str, "hangul") == 0) { initial_input_mode = INPUT_MODE_HANGUL; } print_changed_settings (schema_id, key, value); } else if (strcmp (key, "use-event-forwarding") == 0) { use_event_forwarding = g_variant_get_boolean (value); print_changed_settings (schema_id, key, value); } else if (strcmp (key, "preedit-mode") == 0) { const gchar* str = g_variant_get_string (value, NULL); if (strcmp(str, "none") == 0) { global_preedit_mode = PREEDIT_MODE_NONE; } else if (strcmp(str, "word") == 0) { global_preedit_mode = PREEDIT_MODE_WORD; } else { global_preedit_mode = PREEDIT_MODE_SYLLABLE; } print_changed_settings (schema_id, key, value); } } else if (strcmp (schema_id, "org.freedesktop.ibus.panel") == 0) { if (strcmp (key, "lookup-table-orientation") == 0) { lookup_table_orientation = g_variant_get_int32(value); print_changed_settings (schema_id, key, value); } } g_variant_unref (value); g_value_unset (&schema_value); } static void lookup_table_set_visible (IBusLookupTable *table, gboolean flag) { g_object_set_data (G_OBJECT(table), "visible", GUINT_TO_POINTER(flag)); } static gboolean lookup_table_is_visible (IBusLookupTable *table) { gpointer res = g_object_get_data (G_OBJECT(table), "visible"); return GPOINTER_TO_UINT(res); } static void key_event_list_append(GArray* list, guint keyval, guint modifiers) { struct KeyEvent ev = { keyval, modifiers}; g_array_append_val(list, ev); } static gboolean key_event_list_match(GArray* list, guint keyval, guint modifiers) { guint i; guint mask; /* ignore capslock and numlock */ mask = IBUS_SHIFT_MASK | IBUS_CONTROL_MASK | IBUS_MOD1_MASK | IBUS_MOD3_MASK | IBUS_MOD4_MASK | IBUS_MOD5_MASK; modifiers &= mask; for (i = 0; i < list->len; ++i) { struct KeyEvent* ev = &g_array_index(list, struct KeyEvent, i); if (ev->keyval == keyval && ev->modifiers == modifiers) { return TRUE; } } return FALSE; } static void ibus_hangul_engine_candidate_clicked (IBusEngine *engine, guint index, guint button, guint state) { IBusHangulEngine *hangul = (IBusHangulEngine *) engine; if (hangul == NULL) return; if (hangul->table == NULL) return; ibus_lookup_table_set_cursor_pos (hangul->table, index); ibus_hangul_engine_commit_current_candidate (hangul); if (hangul->hanja_mode) { ibus_hangul_engine_update_lookup_table (hangul); } else { ibus_hangul_engine_hide_lookup_table (hangul); } } static void ibus_hangul_engine_set_content_type (IBusEngine *engine, guint purpose, guint hints) { IBusHangulEngine *hangul = (IBusHangulEngine *) engine; if (hangul == NULL) return; hangul->input_purpose = purpose; } static void hotkey_list_init(HotkeyList* list) { list->all_modifiers = 0; list->keys = g_array_sized_new(FALSE, TRUE, sizeof(struct KeyEvent), 4); } static void hotkey_list_fini(HotkeyList* list) { g_array_free(list->keys, TRUE); list->keys = NULL; } static void hotkey_list_append_from_string(HotkeyList *list, const char* str) { guint keyval = 0; guint modifiers = 0; gboolean res; res = ibus_key_event_from_string(str, &keyval, &modifiers); if (res) { hotkey_list_append(list, keyval, modifiers); } } static void hotkey_list_append(HotkeyList *list, guint keyval, guint modifiers) { list->all_modifiers |= modifiers; key_event_list_append(list->keys, keyval, modifiers); } static void hotkey_list_set_from_string(HotkeyList *list, const char* str) { gchar** items = g_strsplit(str, ",", 0); list->all_modifiers = 0; g_array_set_size(list->keys, 0); if (items != NULL) { int i; for (i = 0; items[i] != NULL; ++i) { hotkey_list_append_from_string(list, items[i]); } g_strfreev(items); } } static gboolean hotkey_list_match(HotkeyList* list, guint keyval, guint modifiers) { return key_event_list_match(list->keys, keyval, modifiers); } static gboolean hotkey_list_has_modifier(HotkeyList* list, guint keyval) { if (list->all_modifiers & IBUS_CONTROL_MASK) { if (keyval == IBUS_Control_L || keyval == IBUS_Control_R) return TRUE; } if (list->all_modifiers & IBUS_MOD1_MASK) { if (keyval == IBUS_Alt_L || keyval == IBUS_Alt_R) return TRUE; } if (list->all_modifiers & IBUS_SUPER_MASK) { if (keyval == IBUS_Super_L || keyval == IBUS_Super_R) return TRUE; } if (list->all_modifiers & IBUS_HYPER_MASK) { if (keyval == IBUS_Hyper_L || keyval == IBUS_Hyper_R) return TRUE; } if (list->all_modifiers & IBUS_META_MASK) { if (keyval == IBUS_Meta_L || keyval == IBUS_Meta_R) return TRUE; } return FALSE; } ibus-hangul-1.5.5/src/engine.h000066400000000000000000000022371442344745400161640ustar00rootroot00000000000000/* vim:set et sts=4: */ /* ibus-hangul - The Hangul Engine For IBus * Copyright (C) 2008-2009 Peng Huang * Copyright (C) 2009-2011 Choe Hwanjin * * 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 __ENGINE_H__ #define __ENGINE_H__ #include #define IBUS_TYPE_HANGUL_ENGINE \ (ibus_hangul_engine_get_type ()) GType ibus_hangul_engine_get_type (void); void ibus_hangul_init (IBusBus *bus); void ibus_hangul_exit (void); #endif ibus-hangul-1.5.5/src/hangul.xml.in.in000066400000000000000000000016221442344745400175550ustar00rootroot00000000000000 org.freedesktop.IBus.Hangul Korean Component ${libexecdir}/ibus-engine-hangul --ibus @VERSION@ Peng Huang <shawn.p.huang@gmail.com> GPL https://github.com/libhangul/ibus-hangul ibus-hangul hangul ko GPL Peng Huang <shawn.p.huang@gmail.com> ibus-hangul kr kr104 Hangul Korean Input Method 99 ${libexecdir}/ibus-setup-hangul ibus-hangul-1.5.5/src/i18n.h000066400000000000000000000021021442344745400154650ustar00rootroot00000000000000/* vim:set et sts=4: */ /* ibus-hangul - The Hangul Engine For IBus * Copyright (C) 2008-2009 Peng Huang * Copyright (C) 2009-2011 Choe Hwanjin * * 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_hangul_i18n_h #define ibus_hangul_i18n_h #include #define _(str) gettext(str) #define N_(str) (str) #endif /* ibus_hangul_i18n_h */ ibus-hangul-1.5.5/src/main.c000066400000000000000000000105131442344745400156320ustar00rootroot00000000000000/* vim:set et sts=4: */ /* ibus-hangul - The Hangul Engine For IBus * Copyright (C) 2008-2009 Peng Huang * Copyright (C) 2009-2011 Choe Hwanjin * * 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. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "i18n.h" #include "engine.h" static IBusBus *bus = NULL; static IBusFactory *factory = NULL; /* options */ static gboolean ibus = FALSE; static gboolean verbose = FALSE; static const GOptionEntry entries[] = { { "ibus", 'i', 0, G_OPTION_ARG_NONE, &ibus, "component is executed by ibus", NULL }, { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "verbose", NULL }, { NULL }, }; static void ibus_disconnected_cb (IBusBus *bus, gpointer user_data) { g_debug ("bus disconnected"); ibus_quit (); } static void start_component (void) { IBusComponent *component; IBusConfig* config; gboolean res; ibus_init (); bus = ibus_bus_new (); res = ibus_bus_is_connected (bus); if (!res) { g_warning ("Unable to connect to IBus"); exit (2); } config = ibus_bus_get_config (bus); if (config == NULL) { g_warning ("Unable to connect to IBus config component"); exit (3); } g_signal_connect (bus, "disconnected", G_CALLBACK (ibus_disconnected_cb), NULL); ibus_hangul_init (bus); component = ibus_component_new ("org.freedesktop.IBus.Hangul", N_("Korean input method"), "0.1.0", "GPL", "Peng Huang ", "https://github.com/libhangul/ibus-hangul", "", "ibus-hangul"); ibus_component_add_engine (component, ibus_engine_desc_new ("hangul", N_("Korean Input Method"), N_("Korean Input Method"), "ko", "GPL", "Peng Huang ", PKGDATADIR"/icon/ibus-hangul.svg", "us")); factory = ibus_factory_new (ibus_bus_get_connection (bus)); ibus_factory_add_engine (factory, "hangul", IBUS_TYPE_HANGUL_ENGINE); if (ibus) { ibus_bus_request_name (bus, "org.freedesktop.IBus.Hangul", 0); } else { ibus_bus_register_component (bus, component); } g_object_unref (component); ibus_main (); ibus_hangul_exit (); } int main (gint argc, gchar **argv) { GError *error = NULL; GOptionContext *context; setlocale (LC_ALL, ""); bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); textdomain(GETTEXT_PACKAGE); context = g_option_context_new ("- ibus hangul engine component"); g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE); if (!g_option_context_parse (context, &argc, &argv, &error)) { g_print ("Option parsing failed: %s\n", error->message); exit (-1); } if (verbose) { const gchar* value = g_getenv ("G_MESSAGES_DEBUG"); if (value == NULL) { g_setenv ("G_MESSAGES_DEBUG", "all", TRUE); } } start_component (); return 0; } ibus-hangul-1.5.5/src/test-ustring.c000066400000000000000000000032761442344745400173660ustar00rootroot00000000000000/* vim: set et sts=4: */ /* ibus-hangul - The Hangul Engine For IBus * Copyright (C) 2018 Choe Hwanjin * * 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 "ustring.h" #include static void test_ustring_compare(void) { UString* s1 = ustring_new(); UString* s2 = ustring_new(); ustring_append_utf8(s1, "abc"); ustring_append_utf8(s2, "abd"); g_assert_cmpint(ustring_compare(s1, s2), <, 0); ustring_clear(s1); ustring_clear(s2); ustring_append_utf8(s1, "abc"); ustring_append_utf8(s2, "abb"); g_assert_cmpint(ustring_compare(s1, s2), >, 0); ustring_clear(s1); ustring_clear(s2); ustring_append_utf8(s1, "abc"); ustring_append_utf8(s2, "abc"); g_assert_cmpint(ustring_compare(s1, s2), ==, 0); ustring_delete(s1); ustring_delete(s2); } int main(int argc, char* argv[]) { g_test_init(&argc, &argv, NULL); g_test_add_func("/ibus-hangul/ustring/compare", test_ustring_compare); int result = g_test_run(); return result; } ibus-hangul-1.5.5/src/ustring.c000066400000000000000000000052161442344745400164050ustar00rootroot00000000000000/* ibus-hangul - korean input method engine for IBus * This file is from Korean XIM Nabi. */ /* Nabi - X Input Method server for hangul * Copyright (C) 2008 Choe Hwanjin * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "ustring.h" UString* ustring_new() { return g_array_new(TRUE, TRUE, sizeof(ucschar)); } UString* ustring_dup(const UString* str) { UString* dup; dup = ustring_new(); ustring_append(dup, str); return dup; } void ustring_delete(UString* str) { g_array_free(str, TRUE); } void ustring_clear(UString* str) { if (str->len > 0) g_array_remove_range(str, 0, str->len); } UString* ustring_erase(UString* str, guint pos, guint len) { if (len > 0) return g_array_remove_range(str, pos, len); else return str; } ucschar* ustring_begin(UString* str) { return (ucschar*)str->data; } ucschar* ustring_end(UString* str) { return &g_array_index(str, ucschar, str->len); } guint ustring_length(const UString* str) { return str->len; } UString* ustring_append(UString* str, const UString* s) { return g_array_append_vals(str, s->data, s->len); } UString* ustring_append_ucs4(UString* str, const ucschar* s, gint len) { if (len < 0) { const ucschar*p = s; while (*p != 0) p++; len = p - s; } return g_array_append_vals(str, s, len); } UString* ustring_append_utf8(UString* str, const char* utf8) { while (*utf8 != '\0') { ucschar c = g_utf8_get_char(utf8); g_array_append_vals(str, &c, 1); utf8 = g_utf8_next_char(utf8); } return str; } gchar* ustring_to_utf8(const UString* str, guint len) { if (len < 0) len = str->len; return g_ucs4_to_utf8((const gunichar*)str->data, len, NULL, NULL, NULL); } int ustring_compare(const UString* str, const UString* other) { const ucschar* p1 = (const ucschar*)str->data; const ucschar* p2 = (const ucschar*)other->data; while (*p1 != 0 && *p2 != 0) { if (*p1 != *p2) break; ++p1; ++p2; } return *p1 - *p2; } ibus-hangul-1.5.5/src/ustring.h000066400000000000000000000032131442344745400164050ustar00rootroot00000000000000/* ibus-hangul - korean input method engine for IBus * This file is from Korean XIM Nabi. */ /* Nabi - X Input Method server for hangul * Copyright (C) 2008 Choe Hwanjin * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef nabi_ustring_h #define nabi_ustring_h #include #include typedef GArray UString; UString* ustring_new(); UString* ustring_dup(const UString* str); void ustring_delete(UString* str); void ustring_clear(UString* str); UString* ustring_erase(UString* str, guint pos, guint len); ucschar* ustring_begin(UString* str); ucschar* ustring_end(UString* str); guint ustring_length(const UString* str); UString* ustring_append(UString* str, const UString* s); UString* ustring_append_ucs4(UString* str, const ucschar* s, gint len); UString* ustring_append_utf8(UString* str, const char* utf8); gchar* ustring_to_utf8(const UString* str, guint len); int ustring_compare(const UString* str, const UString* other); #endif // nabi_ustring_h ibus-hangul-1.5.5/tests/000077500000000000000000000000001442344745400151155ustar00rootroot00000000000000ibus-hangul-1.5.5/tests/Makefile.am000066400000000000000000000044221442344745400171530ustar00rootroot00000000000000# vim:set noet ts=4: # # ibus-hangul - The Hangul engine for IBus # # Copyright (c) 2019 Peng Wu # # 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. TESTS = \ ibus-hangul \ $(NULL) CLEANFILES = $(test_metas) EXTRA_DIST = $(test_metas_in) runtest noinst_PROGRAMS = $(TESTS) TESTS_ENVIRONMENT = \ top_builddir=$(top_builddir) \ top_srcdir=$(top_srcdir) \ builddir=$(builddir) \ srcdir=$(srcdir) \ LD_LIBRARY_PATH="$(top_builddir)/src/.libs:$(top_builddir)/src" \ DISABLE_GUI_TESTS="$(DISABLE_GUI_TESTS)" \ $(NULL) LOG_COMPILER = $(srcdir)/runtest test_metas_in = meta.test.in if ENABLE_INSTALLED_TESTS test_execs = ibus-hangul test_metas = $(addsuffix .test, $(test_execs)) test_sources_DATA = $(test_metas) test_sourcesdir = $(datadir)/installed-tests/ibus-hangul test_execs_PROGRAMS = $(TESTS) test_execsdir = $(libexecdir)/installed-tests/ibus-hangul endif ibus_hangul_SOURCES = ibus-hangul.c ibus_hangul_CFLAGS = \ @IBUS_CFLAGS@ \ @HANGUL_CFLAGS@ \ @GTK_CFLAGS@ \ -I$(top_srcdir)/src \ -I$(top_builddir)/src \ -DPKGDATADIR=\"$(pkgdatadir)\" \ -DLOCALEDIR=\"$(localedir)\" \ -DLIBEXECDIR=\"$(libexecdir)\" \ -DIBUSHANGUL_DATADIR=\"$(datadir)/ibus-hangul\" \ $(NULL) ibus_hangul_LDADD = \ ../src/libinternal.a \ @IBUS_LIBS@ \ @HANGUL_LIBS@ \ @GTK_LIBS@ \ $(NULL) $(test_metas): $(test_metas_in) $(test_programs) f=`echo $@ | sed -e 's/\.test//'`; \ TEST_EXEC=$(test_execsdir)/$$f; \ sed -e "s|@TEST_EXEC[@]|$$TEST_EXEC|g" $(test_metas_in) > $@.tmp; \ mv $@.tmp $@; \ $(NULL) ibus-hangul-1.5.5/tests/ibus-hangul.c000066400000000000000000000215301442344745400175000ustar00rootroot00000000000000#include #include #include "ibus.h" #include "engine.h" #define GREEN "\033[0;32m" #define RED "\033[0;31m" #define NC "\033[0m" typedef struct { const gchar * input; const gchar * output; }TestCase; IBusBus *m_bus; IBusEngine *m_engine; gchar *m_srcdir; IBusKeymap *keymap = NULL; const guint m_switch_hangul[3] = {IBUS_Hangul, 122, 0}; const TestCase m_test_cases[] = { {"rk ", "가"} }; static gboolean window_focus_in_event_cb (GtkWidget *entry, GdkEventFocus *event, gpointer data); static guint16 guess_keycode (IBusKeymap *keymap, guint keyval, guint32 modifiers) { /* The IBusKeymap only have 256 entries here, Use Brute Force method to get keycode from keyval. */ guint16 keycode = 0; for (; keycode < 256; ++keycode) { if (keyval == ibus_keymap_lookup_keysym (keymap, keycode, modifiers)) return keycode; } return 0; } static IBusEngine * create_engine_cb (IBusFactory *factory, const gchar *name, gpointer data) { static int i = 1; gchar *engine_path = g_strdup_printf ("/org/freedesktop/IBus/engine/hangultest/%d", i++); m_engine = ibus_engine_new_with_type (IBUS_TYPE_HANGUL_ENGINE, name, engine_path, ibus_bus_get_connection (m_bus)); g_free (engine_path); return m_engine; } static gboolean register_ibus_engine () { IBusFactory *factory; IBusComponent *component; IBusEngineDesc *desc; m_bus = ibus_bus_new (); if (!ibus_bus_is_connected (m_bus)) { g_critical ("ibus-daemon is not running."); return FALSE; } factory = ibus_factory_new (ibus_bus_get_connection (m_bus)); g_signal_connect (factory, "create-engine", G_CALLBACK (create_engine_cb), NULL); component = ibus_component_new ( "org.freedesktop.IBus.HangulTest", "Hangul Engine Test", "1.5.1", "GPL", "Peng Huang ", "https://github.com/ibus/ibus/wiki", "", "ibus-hangul"); desc = ibus_engine_desc_new ( "hangultest", "Hangul Test", "Hangul Test", "en", "GPL", "Peng Huang ", "ibus-hangul", "us"); ibus_component_add_engine (component, desc); ibus_bus_register_component (m_bus, component); return TRUE; } static gboolean finit (gpointer data) { g_test_incomplete ("time out"); gtk_main_quit (); return FALSE; } static void set_engine_cb (GObject *object, GAsyncResult *res, gpointer data) { IBusBus *bus = IBUS_BUS (object); GtkWidget *entry = GTK_WIDGET (data); GError *error = NULL; gint i; const gchar *p = NULL; if (!ibus_bus_set_global_engine_async_finish (bus, res, &error)) { gchar *msg = g_strdup_printf ("set engine failed: %s", error->message); g_test_incomplete (msg); g_free (msg); g_error_free (error); return; } { /* Switch hangul mode. */ guint keyval = m_switch_hangul[0]; guint keycode = m_switch_hangul[1]; guint modifiers = m_switch_hangul[2]; gboolean retval; if (keyval == 0) { g_test_incomplete ("ibus-hangul switch key is not set correctly."); return; } g_signal_emit_by_name (m_engine, "process-key-event", keyval, keycode, modifiers, &retval); modifiers |= IBUS_RELEASE_MASK; sleep(1); g_signal_emit_by_name (m_engine, "process-key-event", keyval, keycode, modifiers, &retval); } { /* Run test cases */ for (i = 0; i < G_N_ELEMENTS(m_test_cases); i++) { for (p = m_test_cases[i].input; *p; p++) { gboolean retval; guint keyval = *p; guint modifiers = 0; guint keycode = guess_keycode (keymap, keyval, modifiers); if (keyval == 0) break; g_signal_emit_by_name (m_engine, "process-key-event", keyval, keycode, modifiers, &retval); modifiers |= IBUS_RELEASE_MASK; sleep(1); g_signal_emit_by_name (m_engine, "process-key-event", keyval, keycode, modifiers, &retval); } } } g_signal_handlers_disconnect_by_func (entry, G_CALLBACK (window_focus_in_event_cb), NULL); g_timeout_add_seconds (10, finit, NULL); } static gboolean window_focus_in_event_cb (GtkWidget *entry, GdkEventFocus *event, gpointer data) { g_assert (m_bus != NULL); ibus_bus_set_global_engine_async (m_bus, "hangultest", -1, NULL, set_engine_cb, entry); return FALSE; } static void window_inserted_text_cb (GtkEntryBuffer *buffer, guint position, const gchar *chars, guint nchars, gpointer data) { /* https://gitlab.gnome.org/GNOME/gtk/commit/9981f46e0b * The latest GTK does not emit "inserted-text" when the text is "". */ #if !GTK_CHECK_VERSION (3, 22, 16) static int n_loop = 0; #endif static guint index = 0; gunichar code = g_utf8_get_char (chars); const gchar *test; GtkEntry *entry = GTK_ENTRY (data); (void)code; #if !GTK_CHECK_VERSION (3, 22, 16) if (n_loop % 2 == 1) { n_loop = 0; return; } #endif { /* Run test case */ const gchar *p = chars; const gchar *output = m_test_cases[index].output; gboolean valid_output = TRUE; if (0 != g_strcmp0 (p, output)) valid_output = FALSE; index++; if (valid_output) { test = GREEN "PASS" NC; } else { test = RED "FAIL" NC; g_test_fail (); } g_print ("%05d %s expected: %s typed: %s\n", index, test, output, p); } if (index == G_N_ELEMENTS(m_test_cases)) { gtk_main_quit (); return; } #if !GTK_CHECK_VERSION (3, 22, 16) n_loop++; #endif gtk_entry_set_text (entry, ""); } static void create_window () { GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL); GtkWidget *entry = gtk_entry_new (); GtkEntryBuffer *buffer; g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL); g_signal_connect (entry, "focus-in-event", G_CALLBACK (window_focus_in_event_cb), NULL); buffer = gtk_entry_get_buffer (GTK_ENTRY (entry)); g_signal_connect (buffer, "inserted-text", G_CALLBACK (window_inserted_text_cb), entry); gtk_container_add (GTK_CONTAINER (window), entry); gtk_widget_show_all (window); } static void test_hangul (void) { GLogLevelFlags flags; if (!register_ibus_engine ()) { g_test_fail (); return; } ibus_hangul_init (m_bus); create_window (); /* FIXME: * IBusIMContext opens GtkIMContextSimple as the slave and * GtkIMContextSimple opens the compose table on el_GR.UTF-8, and the * multiple outputs in el_GR's compose causes a warning in gtkcomposetable * and the warning always causes a fatal in GTest: " "GTK+ supports to output one char only: " */ flags = g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL); gtk_main (); g_log_set_always_fatal (flags); } int main (int argc, char *argv[]) { const gchar *test_name; gchar *test_path; /* Run test cases with X Window. */ g_setenv ("GDK_BACKEND", "x11", TRUE); ibus_init (); /* Avoid a warning of "AT-SPI: Could not obtain desktop path or name" * with gtk_main(). */ g_setenv ("NO_AT_BRIDGE", "1", TRUE); g_test_init (&argc, &argv, NULL); gtk_init (&argc, &argv); m_srcdir = argc > 1 ? g_strdup (argv[1]) : g_strdup ("."); #if GLIB_CHECK_VERSION (2, 58, 0) test_name = g_get_language_names_with_category ("LC_CTYPE")[0]; #else test_name = g_getenv ("LANG"); #endif test_path = g_build_filename ("/ibus-hangul", test_name, NULL); g_test_add_func (test_path, test_hangul); g_free (test_path); keymap = ibus_keymap_get("us"); return g_test_run (); } ibus-hangul-1.5.5/tests/meta.test.in000066400000000000000000000000661442344745400173530ustar00rootroot00000000000000[Test] Type=session Exec=@TEST_EXEC@ --tap Output=TAP ibus-hangul-1.5.5/tests/runtest000077500000000000000000000005261442344745400165520ustar00rootroot00000000000000#!/bin/bash : ${top_builddir:=../..} : ${top_srcdir:=../..} : ${builddir:=.} : ${srcdir:=.} : ${DISABLE_GUI_TESTS:=''} ibus-daemon --xim --panel disable --config disable & sleep 30 tst=$1 for t in $DISABLE_GUI_TESTS; do if test $t = `basename $tst`; then exit 77 fi done $builddir/$tst retval=$? ibus exit exit $retval