pax_global_header00006660000000000000000000000064127152676400014524gustar00rootroot0000000000000052 comment=5f6a10ae8b54f88403fc03093fd510edae9cb109 scim-chewing-0.5.1/000077500000000000000000000000001271526764000141045ustar00rootroot00000000000000scim-chewing-0.5.1/.gitignore000066400000000000000000000007331271526764000160770ustar00rootroot00000000000000# maintainer files .dir-locals.el ID TAGS GTAGS GPATH GRTAGS GSYMS # autotools generated INSTALL Makefile Makefile.in aclocal.m4 autom4te.cache build-aux/ autotools/ config.log config.status configure libtool /m4/libtool.m4 /m4/lt*.m4 scim-chewing.spec stamp-h1 # compiling output *.dat *.la *.lo *.o .deps .libs config.h config.h.in include/stamp-h1 # intltools po/*.gmo po/POTFILES po/stamp-it intltool-extract.in intltool-merge.in intltool-update.in po/Makefile.in.in scim-chewing-0.5.1/.travis.yml000066400000000000000000000005341271526764000162170ustar00rootroot00000000000000language: c compiler: gcc git: depth: 1 matrix: include: - compiler: clang script: - ./autogen.sh && ./configure && make before_install: - sudo add-apt-repository --yes ppa:chewing/chewing - sudo apt-get update -qq - sudo apt-get install -qq intltool libchewing3-dev libglib2.0-dev libgtk-3-dev libltdl-dev libscim-dev libtool scim-chewing-0.5.1/ABOUT-NLS000066400000000000000000001511161271526764000153400ustar00rootroot00000000000000Notes on the Free Translation Project ************************************* Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work at translations should contact the appropriate team. When reporting bugs in the `intl/' directory or bugs which may be related to internationalization, you should tell about the version of `gettext' which is used. The information can be found in the `intl/VERSION' file, in internationalized packages. Quick configuration advice ========================== If you want to exploit the full power of internationalization, you should configure it using ./configure --with-included-gettext to force usage of internationalizing routines provided within this package, despite the existence of internationalizing capabilities in the operating system where this package is being installed. So far, only the `gettext' implementation in the GNU C library version 2 provides as many features (such as locale alias, message inheritance, automatic charset conversion or plural form handling) as the implementation here. It is also not possible to offer this additional functionality on top of a `catgets' implementation. Future versions of GNU `gettext' will very likely convey even more functionality. So it might be a good idea to change to GNU `gettext' as soon as possible. So you need _not_ provide this option if you are using GNU libc 2 or you have installed a recent copy of the GNU gettext package with the included `libintl'. INSTALL Matters =============== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. If not, the GNU `gettext' own library will be used. This library is wholly contained within this package, usually in the `intl/' subdirectory, so prior installation of the GNU `gettext' package is _not_ required. Installers may use special options at configuration time for changing the default behaviour. The commands: ./configure --with-included-gettext ./configure --disable-nls will respectively bypass any pre-existing `gettext' to use the internationalizing routines provided within this package, or else, _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl.a' file and will decide to use this. This might be not what is desirable. You should use the more recent version of the GNU `gettext' library. I.e. if the file `intl/VERSION' shows that the library which comes with this package is more recent, you should use ./configure --with-included-gettext to prevent auto-detection. The configuration process will not test for the `catgets' function and therefore it will not be used. The reason is that even an emulation of `gettext' on top of `catgets' could not provide all the extensions of the GNU `gettext' library. Internationalized packages have usually many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. Using This Package ================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of `LL_CC', with `LL' denoting the language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of locales supported by your system for your country by running the command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. Special advice for Norwegian users: The language code for Norwegian bokma*l changed from `no' to `nb' recently (in 2003). During the transition period, while some message catalogs for this language are installed under `nb' and some older ones under `no', it's recommended for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and older translations are used. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. Translating Teams ================= For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `translation@iro.umontreal.ca' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skill are praised more than programming skill, here. Available Packages ================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of January 2004. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files af am ar az be bg bs ca cs da de el en en_GB eo es +----------------------------------------------------+ a2ps | [] [] [] [] | aegis | () | ant-phone | () | anubis | | ap-utils | | aspell | [] | bash | [] [] [] [] | batchelor | | bfd | [] [] | binutils | [] [] | bison | [] [] [] | bluez-pin | [] [] [] | clisp | | clisp | [] [] [] | console-tools | [] [] | coreutils | [] [] [] [] | cpio | [] [] [] | darkstat | [] () [] | diffutils | [] [] [] [] [] [] [] | e2fsprogs | [] [] [] | enscript | [] [] [] [] | error | [] [] [] [] [] | fetchmail | [] () [] [] [] [] | fileutils | [] [] [] | findutils | [] [] [] [] [] [] [] | flex | [] [] [] [] | fslint | | gas | [] | gawk | [] [] [] [] | gbiff | [] | gcal | [] | gcc | [] [] | gettext | [] [] [] [] [] | gettext-examples | [] [] [] [] | gettext-runtime | [] [] [] [] [] | gettext-tools | [] [] [] | gimp-print | [] [] [] [] [] | gliv | | glunarclock | [] [] | gnubiff | [] | gnucash | [] () [] [] | gnucash-glossary | [] () [] | gnupg | [] () [] [] [] [] | gpe-aerial | [] | gpe-beam | [] [] | gpe-calendar | [] [] | gpe-clock | [] [] | gpe-conf | [] [] | gpe-contacts | [] [] | gpe-edit | [] | gpe-go | [] | gpe-login | [] [] | gpe-ownerinfo | [] [] | gpe-sketchbook | [] [] | gpe-su | [] [] | gpe-taskmanager | [] [] | gpe-timesheet | [] | gpe-today | [] [] | gpe-todo | [] [] | gphoto2 | [] [] [] [] | gprof | [] [] [] | gpsdrive | () () () | gramadoir | [] | grep | [] [] [] [] [] [] | gretl | [] | gtick | [] () | hello | [] [] [] [] [] [] | id-utils | [] [] | indent | [] [] [] [] | iso_3166 | [] [] [] [] [] [] [] [] [] [] | iso_3166_1 | [] [] [] [] [] [] | iso_3166_2 | | iso_3166_3 | [] | iso_4217 | [] [] [] [] | iso_639 | | jpilot | [] [] [] | jtag | | jwhois | [] | kbd | [] [] [] [] [] | latrine | () | ld | [] [] | libc | [] [] [] [] [] [] | libgpewidget | [] [] | libiconv | [] [] [] [] [] | lifelines | [] () | lilypond | [] | lingoteach | | lingoteach_lessons | () () | lynx | [] [] [] [] | m4 | [] [] [] [] | mailutils | [] [] | make | [] [] [] | man-db | [] () [] [] () | minicom | [] [] [] | mysecretdiary | [] [] [] | nano | [] () [] [] [] | nano_1_0 | [] () [] [] [] | opcodes | [] | parted | [] [] [] [] [] | ptx | [] [] [] [] [] | python | | radius | [] | recode | [] [] [] [] [] [] [] | rpm | [] [] | screem | | scrollkeeper | [] [] [] [] [] [] | sed | [] [] [] [] [] [] | sh-utils | [] [] [] | shared-mime-info | | sharutils | [] [] [] [] [] [] | silky | () | skencil | [] () [] | sketch | [] () [] | soundtracker | [] [] [] | sp | [] | tar | [] [] [] [] | texinfo | [] [] [] | textutils | [] [] [] [] | tin | () () | tp-robot | | tuxpaint | [] [] [] [] [] [] [] | unicode-han-tra... | | unicode-transla... | | util-linux | [] [] [] [] [] | vorbis-tools | [] [] [] [] | wastesedge | () | wdiff | [] [] [] [] | wget | [] [] [] [] [] [] | xchat | [] [] [] [] | xfree86_xkb_xml | [] [] | xpad | [] | +----------------------------------------------------+ af am ar az be bg bs ca cs da de el en en_GB eo es 4 0 0 1 9 4 1 40 41 60 78 17 1 5 13 68 et eu fa fi fr ga gl he hr hu id is it ja ko lg +-------------------------------------------------+ a2ps | [] [] [] () () | aegis | | ant-phone | [] | anubis | [] | ap-utils | [] | aspell | [] [] | bash | [] [] | batchelor | [] [] | bfd | [] | binutils | [] [] | bison | [] [] [] [] | bluez-pin | [] [] [] [] [] | clisp | | clisp | [] | console-tools | | coreutils | [] [] [] [] [] [] | cpio | [] [] [] [] | darkstat | () [] [] [] | diffutils | [] [] [] [] [] [] [] | e2fsprogs | | enscript | [] [] | error | [] [] [] [] | fetchmail | [] | fileutils | [] [] [] [] [] [] | findutils | [] [] [] [] [] [] [] [] [] [] [] | flex | [] [] [] | fslint | [] | gas | [] | gawk | [] [] [] | gbiff | [] | gcal | [] | gcc | [] | gettext | [] [] [] | gettext-examples | [] [] | gettext-runtime | [] [] [] [] [] | gettext-tools | [] [] [] | gimp-print | [] [] | gliv | () | glunarclock | [] [] [] [] | gnubiff | [] | gnucash | () [] | gnucash-glossary | [] | gnupg | [] [] [] [] [] [] [] | gpe-aerial | [] | gpe-beam | [] | gpe-calendar | [] [] [] | gpe-clock | [] | gpe-conf | [] | gpe-contacts | [] [] | gpe-edit | [] [] | gpe-go | [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] | gpe-sketchbook | [] | gpe-su | [] | gpe-taskmanager | [] | gpe-timesheet | [] [] [] | gpe-today | [] [] | gpe-todo | [] [] | gphoto2 | [] [] [] | gprof | [] [] | gpsdrive | () () () | gramadoir | [] [] | grep | [] [] [] [] [] [] [] [] [] [] [] | gretl | [] [] | gtick | [] [] [] | hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | id-utils | [] [] [] [] | indent | [] [] [] [] [] [] [] [] [] | iso_3166 | [] [] [] [] [] [] [] | iso_3166_1 | [] [] [] [] [] | iso_3166_2 | | iso_3166_3 | | iso_4217 | [] [] [] [] [] [] | iso_639 | | jpilot | [] () | jtag | [] | jwhois | [] [] [] [] | kbd | [] | latrine | [] | ld | [] | libc | [] [] [] [] [] [] | libgpewidget | [] [] [] [] | libiconv | [] [] [] [] [] [] [] [] [] | lifelines | () | lilypond | [] | lingoteach | [] [] | lingoteach_lessons | | lynx | [] [] [] [] | m4 | [] [] [] [] | mailutils | | make | [] [] [] [] [] [] | man-db | () () | minicom | [] [] [] [] | mysecretdiary | [] [] | nano | [] [] [] [] | nano_1_0 | [] [] [] [] | opcodes | [] | parted | [] [] [] | ptx | [] [] [] [] [] [] [] | python | | radius | [] | recode | [] [] [] [] [] [] | rpm | [] [] | screem | | scrollkeeper | [] | sed | [] [] [] [] [] [] [] [] [] | sh-utils | [] [] [] [] [] [] [] | shared-mime-info | [] [] [] | sharutils | [] [] [] [] [] | silky | () [] () () | skencil | [] | sketch | [] | soundtracker | [] [] | sp | [] () | tar | [] [] [] [] [] [] [] [] [] | texinfo | [] [] [] [] | textutils | [] [] [] [] [] [] | tin | [] () | tp-robot | [] | tuxpaint | [] [] [] [] [] [] [] [] [] | unicode-han-tra... | | unicode-transla... | [] [] | util-linux | [] [] [] [] () [] | vorbis-tools | [] | wastesedge | () | wdiff | [] [] [] [] [] [] | wget | [] [] [] [] [] [] [] | xchat | [] [] [] | xfree86_xkb_xml | [] [] | xpad | [] [] | +-------------------------------------------------+ et eu fa fi fr ga gl he hr hu id is it ja ko lg 22 2 1 26 106 28 24 8 10 41 33 1 26 33 12 0 lt lv mk mn ms mt nb nl nn no nso pl pt pt_BR ro ru +-----------------------------------------------------+ a2ps | [] [] () () [] [] [] | aegis | () () () | ant-phone | [] [] | anubis | [] [] [] [] [] [] | ap-utils | [] () [] | aspell | [] | bash | [] [] [] | batchelor | [] | bfd | [] | binutils | [] | bison | [] [] [] [] [] | bluez-pin | [] [] [] | clisp | | clisp | [] | console-tools | [] | coreutils | [] [] | cpio | [] [] [] [] [] | darkstat | [] [] [] [] | diffutils | [] [] [] [] [] [] | e2fsprogs | [] | enscript | [] [] [] [] | error | [] [] [] | fetchmail | [] [] () [] | fileutils | [] [] [] | findutils | [] [] [] [] [] | flex | [] [] [] [] | fslint | [] [] | gas | | gawk | [] [] [] | gbiff | [] [] | gcal | | gcc | | gettext | [] [] [] | gettext-examples | [] [] [] | gettext-runtime | [] [] [] [] | gettext-tools | [] [] | gimp-print | [] | gliv | [] [] [] | glunarclock | [] [] [] [] | gnubiff | [] | gnucash | [] [] () [] | gnucash-glossary | [] [] | gnupg | [] | gpe-aerial | [] [] [] [] | gpe-beam | [] [] [] [] | gpe-calendar | [] [] [] [] | gpe-clock | [] [] [] [] | gpe-conf | [] [] [] [] | gpe-contacts | [] [] [] [] | gpe-edit | [] [] [] [] | gpe-go | [] [] [] | gpe-login | [] [] [] [] | gpe-ownerinfo | [] [] [] [] | gpe-sketchbook | [] [] [] [] | gpe-su | [] [] [] [] | gpe-taskmanager | [] [] [] [] | gpe-timesheet | [] [] [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] [] [] | gphoto2 | [] | gprof | [] [] | gpsdrive | () () [] | gramadoir | () [] | grep | [] [] [] [] [] | gretl | | gtick | [] [] [] | hello | [] [] [] [] [] [] [] [] [] [] | id-utils | [] [] [] [] | indent | [] [] [] [] | iso_3166 | [] [] [] | iso_3166_1 | [] [] | iso_3166_2 | | iso_3166_3 | [] | iso_4217 | [] [] [] [] [] [] [] [] | iso_639 | [] | jpilot | () () | jtag | | jwhois | [] [] [] [] () | kbd | [] [] [] | latrine | [] | ld | | libc | [] [] [] [] | libgpewidget | [] [] [] | libiconv | [] [] [] [] [] | lifelines | | lilypond | | lingoteach | | lingoteach_lessons | | lynx | [] [] [] | m4 | [] [] [] [] [] | mailutils | [] [] [] | make | [] [] [] [] | man-db | [] | minicom | [] [] [] [] | mysecretdiary | [] [] [] | nano | [] [] [] [] [] | nano_1_0 | [] [] [] [] [] [] | opcodes | [] [] | parted | [] [] [] [] | ptx | [] [] [] [] [] [] [] [] | python | | radius | [] [] | recode | [] [] [] [] | rpm | [] [] [] | screem | | scrollkeeper | [] [] [] [] [] | sed | [] [] [] | sh-utils | [] [] | shared-mime-info | [] [] | sharutils | [] [] | silky | () | skencil | [] [] | sketch | [] [] | soundtracker | | sp | | tar | [] [] [] [] [] [] | texinfo | [] [] [] [] | textutils | [] [] | tin | | tp-robot | [] | tuxpaint | [] [] [] [] [] [] [] [] | unicode-han-tra... | | unicode-transla... | | util-linux | [] [] [] | vorbis-tools | [] [] [] | wastesedge | | wdiff | [] [] [] [] [] | wget | [] [] [] | xchat | [] [] [] | xfree86_xkb_xml | [] [] | xpad | [] [] | +-----------------------------------------------------+ lt lv mk mn ms mt nb nl nn no nso pl pt pt_BR ro ru 1 2 0 3 12 0 10 69 6 7 1 40 26 36 76 63 sk sl sr sv ta th tr uk ven vi wa xh zh_CN zh_TW zu +-----------------------------------------------------+ a2ps | [] [] [] [] | 16 aegis | | 0 ant-phone | | 3 anubis | [] [] | 9 ap-utils | () | 3 aspell | | 4 bash | | 9 batchelor | | 3 bfd | [] [] | 6 binutils | [] [] [] | 8 bison | [] [] | 14 bluez-pin | [] [] [] | 14 clisp | | 0 clisp | | 5 console-tools | | 3 coreutils | [] [] [] [] | 16 cpio | [] [] | 14 darkstat | [] [] [] () () | 12 diffutils | [] [] [] | 23 e2fsprogs | [] [] | 6 enscript | [] [] | 12 error | [] [] [] | 15 fetchmail | [] [] | 11 fileutils | [] [] [] [] [] | 17 findutils | [] [] [] [] [] [] | 29 flex | [] [] | 13 fslint | | 3 gas | [] | 3 gawk | [] [] | 12 gbiff | | 4 gcal | [] [] | 4 gcc | [] | 4 gettext | [] [] [] [] [] | 16 gettext-examples | [] [] [] [] [] | 14 gettext-runtime | [] [] [] [] [] [] [] [] | 22 gettext-tools | [] [] [] [] [] [] | 14 gimp-print | [] [] | 10 gliv | | 3 glunarclock | [] [] [] | 13 gnubiff | | 3 gnucash | [] [] | 9 gnucash-glossary | [] [] [] | 8 gnupg | [] [] [] [] | 17 gpe-aerial | [] | 7 gpe-beam | [] | 8 gpe-calendar | [] [] [] [] | 13 gpe-clock | [] [] [] | 10 gpe-conf | [] [] | 9 gpe-contacts | [] [] [] | 11 gpe-edit | [] [] [] [] [] | 12 gpe-go | | 5 gpe-login | [] [] [] [] [] | 13 gpe-ownerinfo | [] [] [] [] | 13 gpe-sketchbook | [] [] | 9 gpe-su | [] [] [] | 10 gpe-taskmanager | [] [] [] | 10 gpe-timesheet | [] [] [] [] | 12 gpe-today | [] [] [] [] [] | 13 gpe-todo | [] [] [] [] | 12 gphoto2 | [] [] [] | 11 gprof | [] [] | 9 gpsdrive | [] [] | 3 gramadoir | [] | 5 grep | [] [] [] [] | 26 gretl | | 3 gtick | | 7 hello | [] [] [] [] [] | 34 id-utils | [] [] | 12 indent | [] [] [] [] | 21 iso_3166 | [] [] [] [] [] [] [] | 27 iso_3166_1 | [] [] [] | 16 iso_3166_2 | | 0 iso_3166_3 | | 2 iso_4217 | [] [] [] [] [] [] | 24 iso_639 | | 1 jpilot | [] [] [] [] [] | 9 jtag | [] | 2 jwhois | () [] [] | 11 kbd | [] [] | 11 latrine | | 2 ld | [] [] | 5 libc | [] [] [] [] | 20 libgpewidget | [] [] [] [] | 13 libiconv | [] [] [] [] [] [] [] [] | 27 lifelines | [] | 2 lilypond | [] | 3 lingoteach | | 2 lingoteach_lessons | () | 0 lynx | [] [] [] | 14 m4 | [] [] | 15 mailutils | | 5 make | [] [] [] | 16 man-db | [] | 5 minicom | | 11 mysecretdiary | [] [] | 10 nano | [] [] [] [] | 17 nano_1_0 | [] [] [] | 17 opcodes | [] [] | 6 parted | [] [] [] | 15 ptx | [] [] | 22 python | | 0 radius | | 4 recode | [] [] [] | 20 rpm | [] [] | 9 screem | [] [] | 2 scrollkeeper | [] [] [] | 15 sed | [] [] [] [] [] [] | 24 sh-utils | [] [] | 14 shared-mime-info | [] [] | 7 sharutils | [] [] [] [] | 17 silky | () | 3 skencil | [] | 6 sketch | [] | 6 soundtracker | [] [] | 7 sp | [] | 3 tar | [] [] [] [] [] | 24 texinfo | [] [] [] | 14 textutils | [] [] [] [] | 16 tin | | 1 tp-robot | | 2 tuxpaint | [] [] [] [] [] | 29 unicode-han-tra... | | 0 unicode-transla... | | 2 util-linux | [] [] | 15 vorbis-tools | | 8 wastesedge | | 0 wdiff | [] [] [] | 18 wget | [] [] [] [] [] [] [] [] | 24 xchat | [] [] [] [] [] | 15 xfree86_xkb_xml | [] [] [] [] [] | 11 xpad | | 5 +-----------------------------------------------------+ 63 teams sk sl sr sv ta th tr uk ven vi wa xh zh_CN zh_TW zu 131 domains 47 19 28 83 0 0 59 13 1 1 11 0 22 22 0 1373 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If January 2004 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'. Using `gettext' in new packages =============================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle the use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `translation@iro.umontreal.ca' to make the `.pot' files available to the translation teams. scim-chewing-0.5.1/AUTHORS000066400000000000000000000004601271526764000151540ustar00rootroot00000000000000SCIM-chewing Developers ----------------------- Kan-Ru Chen Jim Huang Caius Chance Jeff Chen Tz-Huan Huang Contributors ------------ Andrew Lee Youchen Lee scim-chewing-0.5.1/COPYING000066400000000000000000000431101271526764000151360ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library General Public License instead of this License. scim-chewing-0.5.1/Makefile.am000066400000000000000000000012131271526764000161350ustar00rootroot00000000000000## Makefile.am -- Process this file with automake to produce Makefile.in AUX_DIST = \ $(ac_aux_dir)/config.guess \ $(ac_aux_dir)/config.sub \ $(ac_aux_dir)/install-sh \ $(ac_aux_dir)/ltconfig \ $(ac_aux_dir)/ltmain.sh \ $(ac_aux_dir)/missing \ $(ac_aux_dir)/depcomp EXTRA_DIST = \ mkinstalldirs \ autogen.sh \ scim-chewing.spec \ intltool-extract.in \ intltool-merge.in \ intltool-update.in ## @end 1 AUTOMAKE_OPTIONS = gnu SUBDIRS = src data po ## @start 1 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure config.h.in $(AUX_DIST) CLEANFILES = *.bak src/*.bak DISTCLEANFILES = intltool-extract intltool-merge intltool-update scim-chewing-0.5.1/NEWS000066400000000000000000000054721271526764000146130ustar00rootroot00000000000000What's New in SCIM-chewing 0.5.1 --------------------------------------------------------- * Support libchewing 0.4.0 APIs * Fix THL and MPS2 Pinyin configurations * Add travis-ci support What's New in SCIM-chewing 0.3.5 --------------------------------------------------------- * Gtk+ 3.x support * Handle translated Chi-Eng mode switch properly * Fix incorrect color cand problem * Support THL (Taiwan Huayu Luomapinyin) and MPS2 Pinyin keyboard What's New in SCIM-chewing 0.3.4 --------------------------------------------------------- * Handle 0-9, "+-*/" keys, Enter and '.' in keypad. * Handle F1-F18 keys properly. * Fix the unexpected behavior on candidate phrases in Google search bar browsed by Firefox. * Be aware of the "Keyboard Layout" setting in SCIM, Thus, users can use a French AZERTY or German QWERTZ without having to switch to a US layout beforehand. What's New in SCIM-chewing 0.3.3 ---------------------------------------------------------- * New configuration options: - Automatically shifting cursor after selection. - The direction of phrase choice. * Sync with libchewing 0.3.2 API changes. What's New in SCIM-chewing 0.3.2 ---------------------------------------------------------- * Add selectable PinYin method support. * Fixed trigger key "Control-Space". * Fixed gedit crash problem. * Nederlands translation. * Keyboard layout toggle button on toolbar. * Added Chinese/English mode fast switch on toolbar. * Sync with libchewing API change. What's New in SCIM-chewing 0.3.1 ---------------------------------------------------------- * Fix intltool build process. * Fix invalid memory access in scim-setup. * Handle unknown input key event in IM engine. What's New in SCIM-chewing 0.3.0 ---------------------------------------------------------- * Support major changes in libchewing 0.3 . * Pure UTF-8 based, no more Big5 <-> UTF-8 converting required. * Add Full/Half shape property. * Better Chewing IM factory/instance handling. * UI enhancements to preedit area with colorized decorations. * Allow customized selection keys. * Add new option to assign Esc key to clean all keyboard buffer or not. What's New in SCIM-chewing 0.2.1 ---------------------------------------------------------- * Zuin output looks much pretty. * Add options to specify Chinese/English mode trigger key. * Support new function in libchewing 0.2.7 to decide if perform old style of space key. * Handle key mask to make working under SCIM 1.2.1 . * Fix CtrlNum failure. What's New in SCIM-chewing 0.2.0 ---------------------------------------------------------- * User-friendly SetupUI * Add functionality to show phrase interval using fonts decorated by underline, caret by highlight fonts, and Zuin symbol after the specific caret. * Support experimental feature -- HanYu PinYing Keyboard layout. * Settings-reload mechanism. scim-chewing-0.5.1/README000066400000000000000000000016041271526764000147650ustar00rootroot00000000000000How to build SCIM-chewing ========================= 1. Make sure you have installed development packages of SCIM, whose version must be 1.0.0 or above. Take Debian/Ubuntu as example: # apt-get install scim-dev 2. Make sure you have installed libchewing 0.4.0 (or above version). # ./autogen.sh # ./configure # make # sudo make install 3. Now, it's ready to build SCIM-chewing. # ./autogen.sh (Ignore this line if you don't check out from svn.) # ./configure # make # sudo make install How to launch SCIM-chewing ========================== 1. Make sure you have alread installed SCIM-chewing, to see if the following file exists or not. # ls /usr/lib/scim-1.0/*/IMEngine/chewing.so 2. Set up SCIM, and specify the proper modules, such as XIM frontend, GTK+ im-module, and QT im-module. 3. Assign IM engine to Traditional Chinese/Chewing. Have Fun! scim-chewing-0.5.1/TODO000066400000000000000000000004301271526764000145710ustar00rootroot000000000000001) Improve SetupUI to follow the options listed in win32-chewing/UserGuide . - Three tabs: behaviors, UI, special symbols. 2) Merge PhraseEd utility in scim-setup. - chewing-utils rework. 3) SCIM toolbar UI tweaks. - Allow variant representations of visual components. scim-chewing-0.5.1/autogen.sh000077500000000000000000000010701271526764000161030ustar00rootroot00000000000000#! /bin/sh AM_VERSION= AC_VERSION= set -x if [ "x${ACLOCAL_DIR}" != "x" ]; then ACLOCAL_ARG=-I ${ACLOCAL_DIR} fi # ChangeLog is deprecated, but autotool expects one. touch ChangeLog AUTOMAKE=${AUTOMAKE:-automake$AM_VERSION} libtoolize -c --automake AUTOMAKE=${AUTOMAKE:-automake$AM_VERSION} intltoolize -c --automake ${ACLOCAL:-aclocal$AM_VERSION} ${ACLOCAL_ARG} ${AUTOHEADER:-autoheader$AC_VERSION} ${AUTOMAKE:-automake$AM_VERSION} --add-missing --copy --include-deps ${AUTOCONF:-autoconf$AC_VERSION} if [ -d autom4te.cache ]; then rm -rf autom4te.cache fi scim-chewing-0.5.1/autotools/000077500000000000000000000000001271526764000161355ustar00rootroot00000000000000scim-chewing-0.5.1/autotools/config.rpath000077500000000000000000000352131271526764000204510ustar00rootroot00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2003 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # 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. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; mingw* | pw32* | os2*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; newsos6) ;; linux*) case $CC in icc|ecc) wl='-Wl,' ;; ccc) wl='-Wl,' ;; esac ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; sco3.2v5*) ;; solaris*) wl='-Wl,' ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) wl='-Wl,' ;; sysv4*MP*) ;; uts4*) ;; esac fi # Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then case "$host_os" in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi4*) ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then hardcode_direct=no fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd1*) ld_shlibs=no ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10* | hpux11*) if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=no ;; ia64*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; *) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; openbsd*) hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4.2uw2*) hardcode_direct=yes hardcode_minus_L=no ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) ;; sysv5*) hardcode_libdir_flag_spec= ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. libname_spec='lib$name' case "$host_os" in aix3*) ;; aix4* | aix5*) ;; amigaos*) ;; beos*) ;; bsdi4*) ;; cygwin* | mingw* | pw32*) shrext=.dll ;; darwin* | rhapsody*) shrext=.dylib ;; dgux*) ;; freebsd1*) ;; freebsd*) ;; gnu*) ;; hpux9* | hpux10* | hpux11*) case "$host_cpu" in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac ;; irix5* | irix6* | nonstopux*) case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux*) ;; netbsd*) ;; newsos6) ;; nto-qnx) ;; openbsd*) ;; os2*) libname_spec='$name' shrext=.dll ;; osf3* | osf4* | osf5*) ;; sco3.2v5*) ;; solaris*) ;; sunos4*) ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) ;; sysv4*MP*) ;; uts4*) ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <= $SCIM_VERSION]) # Check if we should build setup module PKG_CHECK_MODULES(SCIM_GTKUTILS,[scim-gtkutils >= $SCIM_VERSION], [SCIM_HAS_GTKUTILS=yes], [SCIM_HAS_GTKUTILS=no]) AC_SUBST(SCIM_VERSION) PKG_CHECK_MODULES(CHEWING, [chewing >= $CHEWING_VERSION]) AC_SUBST(CHEWING_VERSION) AM_CONDITIONAL(SCIM_BUILD_SETUP, [test "$SCIM_HAS_GTKUTILS" = "yes"]) if test "$SCIM_HAS_GTKUTILS" = "yes"; then SCIM_BUILD_SETUP=1 else SCIM_BUILD_SETUP=0 fi AC_SUBST(SCIM_BUILD_SETUP) # Checks for header files. AC_HEADER_STDC # Checks for library functions. AC_SUBST(ac_aux_dir) # libtool option to control which symbols are exported # right now, symbols starting with _ are not exported LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"' AC_SUBST(LIBTOOL_EXPORT_OPTIONS) # Extra args. AC_ARG_ENABLE(debug, [ --enable-debug Turn on debugging], [case "${enableval}" in yes) debug=yes ;; no) debug=no ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; esac],[debug=no]) if test "x$debug" = "xyes"; then test "$cflags_set" = set || CFLAGS="$CFLAGS -g" test "$cppflags_set" = set || CPPFLAGS="$CXXFLAGS -g" SCIM_DEBUG_FLAGS="-DENABLE_DEBUG=1" else SCIM_DEBUG_FLAGS="" fi AC_SUBST(SCIM_DEBUG_FLAGS) SCIM_ICONDIR=`$PKG_CONFIG --variable=icondir scim` SCIM_MODULEDIR=`$PKG_CONFIG --variable=moduledir scim` SCIM_DATADIR=`$PKG_CONFIG --variable=scimdatadir scim` if test "x$SCIM_ICONDIR" = "x"; then SCIM_ICONDIR=%{prefix}/share/scim/icons fi if test "x$SCIM_MODULEDIR" = "x"; then SCIM_MODULEDIR=${libdir}/scim-1.0 fi if test "x$SCIM_DATADIR" = "x"; then SCIM_DATADIR=${datadir}/scim fi AC_SUBST(SCIM_ICONDIR) AC_SUBST(SCIM_MODULEDIR) AC_SUBST(SCIM_DATADIR) CHEWING_DATADIR=`$PKG_CONFIG --variable=datadir chewing` if test "x$CHEWING_DATADIR" = "x"; then CHEWING_DATADIR=%{prefix}/share/chewing fi AC_SUBST(CHEWING_DATADIR) AC_DEFINE_UNQUOTED(CHEWING_DATADIR,"$CHEWING_DATADIR", [Chewing Runtime data dir]) AC_CONFIG_FILES([ Makefile po/Makefile.in src/Makefile data/Makefile scim-chewing.spec ]) AC_OUTPUT scim-chewing-0.5.1/data/000077500000000000000000000000001271526764000150155ustar00rootroot00000000000000scim-chewing-0.5.1/data/Makefile.am000066400000000000000000000002231271526764000170460ustar00rootroot00000000000000MAINTAINERCLEANFILES = Makefile.in icondir = $(SCIM_ICONDIR) icon_DATA = scim-chewing.png scim-chewing-swap-colors.png EXTRA_DIST = $(icon_DATA) scim-chewing-0.5.1/data/scim-chewing-swap-colors.png000066400000000000000000000003541271526764000223510ustar00rootroot00000000000000‰PNG  IHDRľ‹bKGDÿÿÿ ½§“ pHYs  šœtIMEÕ82ià·—tEXtCommentCreated with The GIMPïd%nPIDATÓuλ À0ƒá/Cã2…[‘ÝÆÃÄ5§Ÿ“øT°Y¨¢ãø ŸFߨtŽ[@FBÃ5 ¾ÚÒ¦ª2)ÔÕ¿9l/L$NJIEND®B`‚scim-chewing-0.5.1/data/scim-chewing.png000066400000000000000000000110641271526764000201020ustar00rootroot00000000000000‰PNG  IHDR00Wù‡bKGDùC» pHYs  šœ«IDAThÞµšit\Õ‘ÇoíE­nµvÉ’,ÛX¶Œñ¢fÀ`H À'xXÆC !à I³“„0bÌæLH&dB 8!`‚ÍfclY–dI­½[RK½¾õ·–e5’·ä¤Îѽw«nýoÕ­û¿õ1I-±`Á>1kÖ^±}{Jü-}ôÇbÿÒ³ElÓÏ„“NÿM¶&‹ëØÂÈÄ…eælªL’®.“hÔ&µùË_’,[æç¯Ùï'½s'Ö=÷SpÖxÌ;a®ë  ËL`¤†±Ì$±È{Dö¾H°t.'Ÿs3 ‡‡ŽÚ¬][Ìš5á)ûû-b1‡yóüˆÐê/¾â2d¿ŸpÕb*çœKoëŸ8ëòM„ÊQT/’¬L€ü¤x!¨œs.ꊭôôXh´´ Xœt’‡óÏ0w®‡Y³tÂa•pXaxØæÊ+»Ø¾=…¢Àdûn:ƒÑÒJlã&’[ߤàì³è»íìþœ±F{;ÂÌxc jQ¡K?‡$I–ÌÆÛ·›`Yš'p|{LV)©^ŠÚ×gSS£±fM˜K/ 1w®‡`PF–§¢/*Rhlô²kW†5kŠP”Ãc¢ëeðõ¸†§¡­º Ó<óÐëkqSi:ÿùËö8{9Þ…ºž‚Rl3…e$н¡ãp_ )*¾`êK/ÍbÖ,9sôiž,Ž#H$JJjjôü) à[º˜’ë¯%ðésPKK%7ÄÖ?ŠÙÖŽï”EÌØøž†“§DA)®câX™ãZýÉ¢®\Yx܃GGöï7hlôRY™¿KoøÅ׬A¸.J¸(/S[ÞbàõÈ>*îþÞy'åéê¾0Šæ;açä|à€AG‡Éòåx½ùª’¦áš&ýëî£ïÛw‘Ù½!fG}ëîÅŽF)»å„>¿jŠ]ÝÀÌŽxNdðæÍ \W°bÅôM+/£üÛ7Ýð$]W]GÁò3°úûIo—⫯¤ì–¯#©ÓM)áXÌÌÈßÀÀ€Åóϲx±¦¦#‡[¯ŸIõCßeìÅW‰|õF¬Á^<õ ”Þø”`pz%!Âű²' à¸Sèw¿cïÞ,W\&TŽ:Ö!¹å-Üd ÿ)M8##D¾t#ñ_>kSÆgRƒ˜™8é±¾cúáº6fv”C;,@<îðë_ǰò”ÚÛ 6nŒ±`—Ë/?z™3vÒ}ÃÍÄÛDñµ×0ûÕ穼gF{;]×Þ@ß­wbõæ¶²¸®¸ÇàX©ØôðûeöìÉrÅüâ#ŒŒ8D"&·ÜÒ˾}Y®¿¾„ª*mZÃÂ$·þ…ÎÕÿBêÍíÌøáýTÿç½hÕ•”~íKÔ>ùJ(Dô‘D¾ü ²Í-º1ªæÄq惄$«(ª7èºÄ­·–ÓÑa²vm‹û0MÁ‡f¸òÊ0W]žÖœ=<ÂÐãO1ôäSø–,¢æÑ‡ð¶Iέ¤i„¯\ì÷Ñóo·2úò‹8ñ83Ÿý z] ðLü¡zþï‡?¼?Âé§é,]êC×§Ïp!t_˜@q=LǹÛÛ ±hQ³€vˆ+ˆŽc*7·,‘Øò–h»à2±¿é1ôÓŸ ;‘<2—w]1ö‡×ÅÇ5óÅNü¢ç›·"ùâÀ®×Å©Kß°K$Ö®ímmÙil8bÇ«wŠw_¼Uض!8Òd?üá v‹K.i{÷f¦²m1¸áqѶòŸDô‘'…5xçd²ÂìîVlX¸®;Ewä¹Äî`8xù5µ¬‰ç>8(`—€vˆï~·ZßÌì˜02q!„’bÚÄ‹ÇZÛLƹÑáðå† Ã ½ý=P$]ÇŠô`ìÄìèÄ<Ø…±ÿJ(DðóP|íÕèu5‡mØ6©­o¡‡ñ-]<ñ|ÿþ,ç×F_Ÿ…¢H<óLÝ´÷’É2í9 ‡×âS³ÒXCƒ¤[†±zúp†‡1»º±º{±û±úú±zûqFâ¸Ù ‚É•D©ï‘xå5êžý/<ã…lÓ üùÜ«¼\¥ªJ£¯Ï"V8ùdï1·³šzûÜT«»gt+ÒƒÕ7€ÕÛÝ?€›N㌎!Ld×È¥¨ïüyHsê#A!ü>ÜDrâÑž=Y®½6BMÆuו°re!š&áñÈøý9àåå*Ç>gÕ®«¯ÃŒDã§ ¤è(Ea´UÈ…­­Ç$xÁT¬û&Vß=ßøÖ@J0Hͦ xæÎ÷(5\–‘<ž‰5M¢§ÇdçÎ[¶$y챚)®¤D¥°ðè&€Z÷ô“Äõ[ìh ϼ“ð-]Œ§aZe9ÎX’ƒ­&½gr0ˆÿÌeËbø§ÿƒùJÙïC--Fö;ÔŸÀ3ÎV%l[àóM^uµ†ªJD"&Û¶¥Ù·/‹,CS“ŸóÎ ŒG Ô‚³–á?ót$)ËÁ¾O-!½gGî= {þ8 HlÛ–bÛ¶$²,+Ìží£©ÉÏgø9ýôÃížcî½¾˜š‹9ÇGž}ޱ—6“zómìØÞÆy„¯þ"᫯@--™¢×ÜlðûßN¤ÒwôcÛ‚8œ ^.½4Ä’%>=ÔÕéÓ^u'8£c Ë(…ù\_òxpbCŒ>ÿ"Vw/‰Í¯ƒ<Œ0²×âPJïÜAæÃÝŒ½üª×ß)'OزmÁcÅèì48óÌëÖUÐÖfÐÙiQV¦R[«ñôÓ#lÞ<ÊÚµan»­â˜é¨B®î÷ßù=2î¡på§‘}Þ\­‰“ýèc@!ùç·Im{ÙëÁ5²È¾ŠV_‚oÉ)ÈÁ Â4I¼òGÆ^ÚŒp]zô»äؼ9Á3ÏŒPWçáþû«8眩£×^KàñÓÏíEA. Øú:É­ΕÒÂJY 8. ®:Ÿâ¯ü+zM5}·ßGfçGTÞûè3ë&ŒÎ=›ô»°z»ñÎk¤ðÓ+&Þ½ûnš›nê!RØ´©fZç³Y—H$ÍÒÒc—м ¬XŽòPaZTÞ·ŽÐ.F-+!ö£'é¿ï{,ÿBŸ»áºÈ¾C7²ü|ÔjªÐëë0{;ð.lD§##6·ßÞ‡¢H<öX Gj$¸.d³I’¦tý„d³bœâ[tt˜´µ‡xæ7 ÕÌÀ<ØoÉ)x°úû‘$ Ïü†ICÇAXvÞ$²×‹.Ä¡b@*årá…A.¾8ÈܹŽ%²œÓii1hm5hk3hnÎýE"&ýý¹Ž¡ëŠÃÔâ0ZE9fÛÁ CN*…±ïjU%Þó'{h£µ ÏI‡·’¦¡×ÕNq¨¦Fçæ›Ë&­´À¶sNŽŒØ 9ôöZ´´tv8ŽàÖ[{I$\âqÇÉU)iüœ’eP((P&•QiJF`u÷b´À¿ìÔ‰td­ª×I3üãÿÆ;o.jeE®a+ËH^ aǤâ C%µ‰Ål"‹Þ^‹öv“®®ÜJ Ùd2¹Ìç“).VX¾ÜCI‰BII®2…B ² uu:^ïa'‹Š&Pä‚‚<™vaÇã/Y…¬îÄ®ü CO=Mü·/Ùµ­¶½nÁKV‰æ·»¹aU3Ã>bQ›dÒÁ¶º.SQ¡R_¯ÓÔ䣡ÁCCƒ‡ÊJŠ •PH¡ @FÓ¤£¶ð'2g"ï<´U”`ìåÍxÌ'¸ê³yJ<—Ê;¾CìñŸàŒ&pâc4ïÇ»pÁD“)—wÞIcûUêgj,YRȲe~.ôÒÐà¡´TÅ㑎Ùμu5 |ÿ!\$êgê;¦ä®3ŽC"»w?E—]B𒋦@RÕ¼[Ö!Ѫ*…œ¤é3z]þg*!4‰6!pqI¸ z­~öf÷ñNú}ÞNmgwö#’Î( ó£Øã¬-¾Š¯_K…VžÀÍf±"=ÈJI1+Î"xÑg'¾®@®'“MÅH µb¤GâêÅøƒÕS€¸©nzj·y[ú6De†6ƒ¥¾Å88´h1Zi5ÚˆXÝŒ:cÈÈ„Õ"êõ™DÌnFQÚVî컇3ñ³ÚM”‚Ip]ÜlI× üÈéÑ^ú÷n!=Ö™“í&>°ôX/Žm I5ó.äŒK7Ž÷u¦¦ã`ÂeóØ«Œº£H’†ŒBH R®–S¯×qN`9 ½ 8IŸC­>ƒRµ”±'¸³ï½V6ö'"ÉâŽ%óhµm¥ˆì{™X÷û¸¶¬èxü¥”Ìh"žI ¸ž’ê¥ÈŠ>Åy7›ÍÄOÈiþOqahÿ;ò ä߯¼›ó Ï£L-#(¢Ëú¥øPŽS£ÏäîÊ;(RBùœáìh,@°t.g^ö©xËH j~¼r4Oáøw¬i—íŒ/Hgxj·Ù#{Xº”ßÄ_ÀÅe±oÞùMZvÀA’4n*½‘•…Ÿ™x7ÀêéÉÇQ óyŠæ)¤¨bÁ£BˆÜ*ÇG†‰ZZ‚\àÇìè\ ,kZ‡–œÆÏlš³ûé±zŽê|ÆÍ²×ØÂe·‘/]–÷~€ÑÒŠ›ÍäµÀ…ë"L 1žö`«§³½ã@FÛA¬®nÜtÿ²S©¼wN*„mbuF¦uªJ­ä ÿé4gvsÀh;*€ˆaöH2/¤Vϯ|‡hÜTŠØÆ£ 1v`dž±s)62ŠÈ¤ÂBà"!#É:H2ñ_ÿ³ý N|ŒÜ N1²$³Ì?þ){}˜®‰ƒK܉ÓoÐivÑj´Ñb´²#³‹.« Ø–ÞÎîÌùN yt@ÂI¥ˆ=¾ Å@¢–•¢”ã[²ISѪ«PŠÃ \$݃6³I×Hm}‹Áõ ² 'G+ '{ñËAÞL¾Íš®µÄì!º­¢v””›Æ6ª¤£H åj9º¤sÐìdkêÍéÎ=›èâ–SyßxÌË9 "y=¹«¥tä“4pΙ8#qbO<•;¨túìú#ŽoðÌe¶^ÏÇÙ½¼Ÿþ€2µŒS}MÔè3¨×g” ©ÕjÐ%Rµ¿ìCB¢LýD“a¢!›ÍŠž_'úîþpmû¯ú%‰ÙÓ'ZÎZ)vàûN>]‘ž£Ž4ú¤8¥ù4±#½KŒÙ a»'>o^wÚIg„“Íž°‘Éá%ñQél1¸á‰cŽÍ8ñnê}‘q2Çayzù“l'mRg_tEXtCommentCreated with The GIMPïd%nIEND®B`‚scim-chewing-0.5.1/po/000077500000000000000000000000001271526764000145225ustar00rootroot00000000000000scim-chewing-0.5.1/po/ChangeLog000066400000000000000000000000001271526764000162620ustar00rootroot00000000000000scim-chewing-0.5.1/po/LINGUAS000066400000000000000000000000501271526764000155420ustar00rootroot00000000000000# Set of available languages. zh_TW nl scim-chewing-0.5.1/po/POTFILES.in000066400000000000000000000001021271526764000162700ustar00rootroot00000000000000src/scim_chewing_imengine.cpp src/scim_chewing_imengine_setup.cpp scim-chewing-0.5.1/po/nl.po000066400000000000000000000230661271526764000155020ustar00rootroot00000000000000# translation of nl.po to Nederlands # Ronald Stroethoff , 2007, 2008. # Copyright (c) 2004, 2005, 2006 Chewing Developers # Under same license as SCIM-chewing msgid "" msgstr "" "Project-Id-Version: nl\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-04-19 23:41+0800\n" "PO-Revision-Date: 2008-12-09 09:57+0100\n" "Last-Translator: Ronald Stroethoff \n" "Language-Team: Nederlands\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" #: ../src/scim_chewing_imengine.cpp:81 msgid "The status of the current input method. Click to change it." msgstr "" "De status van de nu gebruikte invoer-methode. Klik hierop om deze te " "veranderen." #: ../src/scim_chewing_imengine.cpp:83 ../src/scim_chewing_imengine.cpp:726 #: ../src/scim_chewing_imengine_setup.cpp:539 msgid "Eng" msgstr "Ned" #: ../src/scim_chewing_imengine.cpp:84 ../src/scim_chewing_imengine.cpp:769 msgid "Half" msgstr "Half" #: ../src/scim_chewing_imengine.cpp:85 ../src/scim_chewing_imengine.cpp:739 #: ../src/scim_chewing_imengine.cpp:761 msgid "Default" msgstr "Standaard" #: ../src/scim_chewing_imengine.cpp:205 #: ../src/scim_chewing_imengine_setup.cpp:109 msgid "Chewing" msgstr "Chewing" #: ../src/scim_chewing_imengine.cpp:220 msgid "Chewing core team " msgstr "Chewing kern groep " #: ../src/scim_chewing_imengine.cpp:236 msgid "Hot Keys:" msgstr "Snel toetsen:" #: ../src/scim_chewing_imengine.cpp:238 msgid " Switch between English/Chinese mode." msgstr " Schakelen tussen de Nederlandse/Chinese invoer." #: ../src/scim_chewing_imengine.cpp:239 msgid "" "\n" "\n" " Space:\n" " Use space key to select candidate phrases.\n" "\n" " Tab:\n" " Use tab key to dispart or connect a phrase.\n" "\n" " Ctrl + [number]:\n" " Use Ctrl + number key to add a user-defined phrase.\n" " (Here number stands for the length of the user-defined phrase.)\n" "\n" " Ctrl + 0:\n" " Use Ctrl + 0 to specify symbolic input.\n" "\n" " j / k:\n" " While selecting candidate phrases, it could invoke \n" " switching between the previous and the next one." msgstr "" "\n" "\n" " Spatie:\n" " Gebruik de spatie toets om een uitdrukking te selecteren.\n" "\n" " Tab:\n" " Gebruik de tab toets om een zin te splitsen of te verbinden.\n" "\n" " Ctrl + [nummer]:\n" " Gebruik ctrl + nummer-toets om een eigen uitdrukking toe te voegen.\n" " (Het nummer is de lengte van de eigen uitdrukking.)\n" "\n" " Ctrl + 0:\n" " Gebruik Ctrl + 0 voor een nummerieke invoer.\n" "\n" " J / k:\n" " Wanneer een uitdrukking wordt geselecteerd, dan kan dat een heen en " "weer schakelen tussen de volgende en de vorige veroorzaken." #: ../src/scim_chewing_imengine.cpp:728 #: ../src/scim_chewing_imengine_setup.cpp:538 msgid "Chi" msgstr "Chi" #: ../src/scim_chewing_imengine.cpp:741 msgid "Hsu's" msgstr "Hsu's" #: ../src/scim_chewing_imengine.cpp:743 msgid "IBM" msgstr "IBM" #: ../src/scim_chewing_imengine.cpp:745 msgid "Gin-Yieh" msgstr "Gin-Yieh" #: ../src/scim_chewing_imengine.cpp:747 msgid "ETen" msgstr "ETen" #: ../src/scim_chewing_imengine.cpp:749 msgid "ETen 26-key" msgstr "ETen 26-key toets" #: ../src/scim_chewing_imengine.cpp:751 msgid "Dvorak" msgstr "Dvorak" #: ../src/scim_chewing_imengine.cpp:753 msgid "Dvorak Hsu's" msgstr "Dvorak Hsu's" #: ../src/scim_chewing_imengine.cpp:755 msgid "Han-Yu Pinyin" msgstr "" #: ../src/scim_chewing_imengine.cpp:757 msgid "THL Pinyin" msgstr "" #: ../src/scim_chewing_imengine.cpp:759 msgid "MPS2 Pinyin" msgstr "" #: ../src/scim_chewing_imengine.cpp:771 msgid "Full" msgstr "Vol" #: ../src/scim_chewing_imengine_setup.cpp:114 msgid "An Intelligent Chinese Phonetic IMEngine Module." msgstr "Een intelligent fonetisch Chinees invoer methode." #. label #: ../src/scim_chewing_imengine_setup.cpp:200 msgid "Trigger keys:" msgstr "Schakel toetsen:" #. title #: ../src/scim_chewing_imengine_setup.cpp:202 msgid "Select trigger keys" msgstr "Schakel-toetsen kiezen" #. tooltip #: ../src/scim_chewing_imengine_setup.cpp:204 msgid "" "The key events to switch Chewing input mode. Click on the button on the " "right to edit it." msgstr "" "Toets-combinatie, waarmee de Chewing invoer-methode wordt gewisseld. Klik om " "te veranderen op de rechter muisknop." #. label #: ../src/scim_chewing_imengine_setup.cpp:217 msgid "Chewing CHI/ENG keys:" msgstr "Chewing CHI/NED-toetsen:" #. title #: ../src/scim_chewing_imengine_setup.cpp:219 msgid "Select CHI/ENG keys" msgstr "Kies de CHI/NED-toetsen" #. tooltip #: ../src/scim_chewing_imengine_setup.cpp:221 msgid "" "The key events to switch English and Chinese mode. Click on the button on " "the right to edit it." msgstr "" "Toets-combinatie, waarmee tussen de Nederlandse en de Chinesche invoer-" "methode wordt gewisseld. Klik om te veranderen op de rechter muisknop." #: ../src/scim_chewing_imengine_setup.cpp:260 msgid "Color #1" msgstr "Kleur 1" #: ../src/scim_chewing_imengine_setup.cpp:261 #: ../src/scim_chewing_imengine_setup.cpp:274 #: ../src/scim_chewing_imengine_setup.cpp:287 #: ../src/scim_chewing_imengine_setup.cpp:300 #: ../src/scim_chewing_imengine_setup.cpp:313 msgid "The color of preediting text" msgstr "De kleur van de ingevoerde tekst" #: ../src/scim_chewing_imengine_setup.cpp:273 msgid "Color #2" msgstr "Kleur 2" #: ../src/scim_chewing_imengine_setup.cpp:286 msgid "Color #3" msgstr "Kleur 3" #: ../src/scim_chewing_imengine_setup.cpp:299 msgid "Color #4" msgstr "Kleur 4" #: ../src/scim_chewing_imengine_setup.cpp:312 msgid "Color #5" msgstr "Kleur 5" #: ../src/scim_chewing_imengine_setup.cpp:357 msgid "Add _Phrase forward" msgstr "Directe invoer(_P)" #: ../src/scim_chewing_imengine_setup.cpp:368 msgid "Whether to add Phrase forward or not." msgstr "Wanneer deze optie is gekozen, is directe invoer ingeschakeld." #: ../src/scim_chewing_imengine_setup.cpp:380 msgid "_Rearward phrase choice" msgstr "Sorteren op achterkant" #: ../src/scim_chewing_imengine_setup.cpp:391 msgid "The behavior for phrase choice to be rearward or not." msgstr "Sorteren op voorkant of achterkant." #: ../src/scim_chewing_imengine_setup.cpp:403 msgid "_Automatically shift cursor" msgstr "_Automatisch cursor opschuiven" #: ../src/scim_chewing_imengine_setup.cpp:426 msgid "_Esc key to clean all buffer" msgstr "_Escape-toets voor het legen van alle buffers" #: ../src/scim_chewing_imengine_setup.cpp:437 msgid "Assign Esc key to clean all keyboard buffer or not." msgstr "Escape-toets toewijzen voor het wel of niet legen van alle buffers" #: ../src/scim_chewing_imengine_setup.cpp:449 msgid "_SpaceKey as selection key" msgstr "_Spatiebalk als selectietoets" #: ../src/scim_chewing_imengine_setup.cpp:460 msgid "Whether SpaceKey is used as selection key or not." msgstr "Bepaal of de spatiebalk wordt gebruikt als selectietoets." #: ../src/scim_chewing_imengine_setup.cpp:480 msgid "Default Keyboard" msgstr "Standaard toetsenbord" #: ../src/scim_chewing_imengine_setup.cpp:483 msgid "Hsu's Keyboard" msgstr "Hsu's toetsenbord" #: ../src/scim_chewing_imengine_setup.cpp:486 msgid "IBM Keyboard" msgstr "IBM Toetsenbord" #: ../src/scim_chewing_imengine_setup.cpp:489 msgid "Gin-Yieh Keyboard" msgstr "Gin-Yieh toetsenbord" #: ../src/scim_chewing_imengine_setup.cpp:492 msgid "ETen Keyboard" msgstr "ETen toetsenbord" #: ../src/scim_chewing_imengine_setup.cpp:495 msgid "ETen 26-key Keyboard" msgstr "ETen 26-key toetsenbord" #: ../src/scim_chewing_imengine_setup.cpp:498 msgid "Dvorak Keyboard" msgstr "Dvorak toetsenbord" #: ../src/scim_chewing_imengine_setup.cpp:501 msgid "Dvorak Keyboard with Hsu's support" msgstr "Dvorak toetsenbord met Hsu's ondersteuning" #: ../src/scim_chewing_imengine_setup.cpp:504 msgid "DACHEN_CP26 Keyboard" msgstr "Dachen_CP26 Toetsenbord" #: ../src/scim_chewing_imengine_setup.cpp:507 msgid "Han-Yu PinYin Keyboard" msgstr "Han-Yu PinYin toetsenbord" #: ../src/scim_chewing_imengine_setup.cpp:510 msgid "Taiwan Huayu Luomapinyin Keyboard" msgstr "" #: ../src/scim_chewing_imengine_setup.cpp:513 msgid "MPS2 PinYin Keyboard" msgstr "" #: ../src/scim_chewing_imengine_setup.cpp:628 msgid "Initial trigger Chinese/English mode:" msgstr "Beginstand Chinees/Nederlands:" #: ../src/scim_chewing_imengine_setup.cpp:640 msgid "Change the default Chinese/English mode on every trigger" msgstr "Verander de standaard selectie-toetsen met iedere wisseling" #: ../src/scim_chewing_imengine_setup.cpp:690 msgid "Number of Selection Keys :" msgstr "Aantal selectie-toetsen :" #: ../src/scim_chewing_imengine_setup.cpp:702 msgid "Change the default number of selection keys" msgstr "Verander het standaard aantal selectie-toetsen" #: ../src/scim_chewing_imengine_setup.cpp:749 msgid "Customized Selection Keys:" msgstr "Aangepaste selectie-toetsen:" #: ../src/scim_chewing_imengine_setup.cpp:761 msgid "Change the default selection keys" msgstr "Verander de standaard selectie-toetsen" #: ../src/scim_chewing_imengine_setup.cpp:810 msgid "Use keyboard type:" msgstr "Kies toetsenbord-type:" #: ../src/scim_chewing_imengine_setup.cpp:822 msgid "Change the default keyboard layout type" msgstr "Een toetsenbord layout als standaard kiezen" #. Create the label for this note page. #: ../src/scim_chewing_imengine_setup.cpp:893 msgid "Options" msgstr "Optie's" #. Create the label for this note page. #: ../src/scim_chewing_imengine_setup.cpp:904 msgid "Keyboard" msgstr "Toetsenbord" #. Create the label for this note page. #: ../src/scim_chewing_imengine_setup.cpp:912 msgid "Decorative Color" msgstr "Decoratie-kleur" #~ msgid "Automatically shift cursor after selection." #~ msgstr "Automatisch cursor na keuze opschuiven." scim-chewing-0.5.1/po/zh_TW.po000066400000000000000000000225311271526764000161200ustar00rootroot00000000000000# Copyright (c) 2004, 2005, 2006, 2008 Chewing Developers # Under same license as SCIM-chewing # msgid "" msgstr "" "Project-Id-Version: scim-chewing 0.3.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-04-19 23:41+0800\n" "PO-Revision-Date: 2006-06-19 22:34+0800\n" "Last-Translator: Jim Huang \n" "Language-Team: Chewing Developers \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/scim_chewing_imengine.cpp:81 msgid "The status of the current input method. Click to change it." msgstr "ç›®å‰è¼¸å…¥æ³•çš„ç‹€æ…‹ï¼ŒæŒ‰ä¸€ä¸‹å¯æ›´æ”¹" #: ../src/scim_chewing_imengine.cpp:83 ../src/scim_chewing_imengine.cpp:726 #: ../src/scim_chewing_imengine_setup.cpp:539 msgid "Eng" msgstr "英" #: ../src/scim_chewing_imengine.cpp:84 ../src/scim_chewing_imengine.cpp:769 msgid "Half" msgstr "åŠå½¢" #: ../src/scim_chewing_imengine.cpp:85 ../src/scim_chewing_imengine.cpp:739 #: ../src/scim_chewing_imengine.cpp:761 msgid "Default" msgstr "é è¨­éµç›¤" #: ../src/scim_chewing_imengine.cpp:205 #: ../src/scim_chewing_imengine_setup.cpp:109 msgid "Chewing" msgstr "新酷音" #: ../src/scim_chewing_imengine.cpp:220 msgid "Chewing core team " msgstr "新酷音發展團隊 " #: ../src/scim_chewing_imengine.cpp:236 msgid "Hot Keys:" msgstr "快速éµ" #: ../src/scim_chewing_imengine.cpp:238 msgid " Switch between English/Chinese mode." msgstr " 在中英模å¼åˆ‡æ›" #: ../src/scim_chewing_imengine.cpp:239 msgid "" "\n" "\n" " Space:\n" " Use space key to select candidate phrases.\n" "\n" " Tab:\n" " Use tab key to dispart or connect a phrase.\n" "\n" " Ctrl + [number]:\n" " Use Ctrl + number key to add a user-defined phrase.\n" " (Here number stands for the length of the user-defined phrase.)\n" "\n" " Ctrl + 0:\n" " Use Ctrl + 0 to specify symbolic input.\n" "\n" " j / k:\n" " While selecting candidate phrases, it could invoke \n" " switching between the previous and the next one." msgstr "" "\n" "\n" " Space:\n" " 使用空白éµé¸æ“‡å€™é¸å­—詞。\n" "\n" " Tab:\n" " 使用 [Tab] éµä¾†æ–·å­—或連çµå­—詞。\n" "\n" " Ctrl + [數字éµ]:\n" " 使用 Ctrl + 數字éµå¯æ–°å¢žä½¿ç”¨è€…自訂字詞\n" " (數字éµè¡¨ç¤ºå­—詞長度)。\n" "\n" " Ctrl + 0:\n" " 使用 Ctrl + 0 å¯è¼¸å…¥ç¬¦è™Ÿã€‚\n" " j / k:\n" " ç•¶é¸æ“‡å€™é¸è©žæ™‚,按下 j 或 k 按éµï¼Œå¯åœ¨å‰ä¸€\n" " 或次一字詞間切æ›ã€‚" #: ../src/scim_chewing_imengine.cpp:728 #: ../src/scim_chewing_imengine_setup.cpp:538 msgid "Chi" msgstr "中" #: ../src/scim_chewing_imengine.cpp:741 msgid "Hsu's" msgstr "許æ°éµç›¤æŽ’列" #: ../src/scim_chewing_imengine.cpp:743 msgid "IBM" msgstr "IBMéµç›¤" #: ../src/scim_chewing_imengine.cpp:745 msgid "Gin-Yieh" msgstr "精業éµç›¤" #: ../src/scim_chewing_imengine.cpp:747 msgid "ETen" msgstr "倚天" #: ../src/scim_chewing_imengine.cpp:749 msgid "ETen 26-key" msgstr "倚天26éµ" #: ../src/scim_chewing_imengine.cpp:751 msgid "Dvorak" msgstr "Dvorakéµç›¤" #: ../src/scim_chewing_imengine.cpp:753 msgid "Dvorak Hsu's" msgstr "Dvorak+許æ°éµç›¤" #: ../src/scim_chewing_imengine.cpp:755 msgid "Han-Yu Pinyin" msgstr "漢語拼音排列" #: ../src/scim_chewing_imengine.cpp:757 msgid "THL Pinyin" msgstr "å°ç£è¯èªžç¾…馬拼音" #: ../src/scim_chewing_imengine.cpp:759 msgid "MPS2 Pinyin" msgstr "注音二å¼" #: ../src/scim_chewing_imengine.cpp:771 msgid "Full" msgstr "全形" #: ../src/scim_chewing_imengine_setup.cpp:114 msgid "An Intelligent Chinese Phonetic IMEngine Module." msgstr "智慧型注音輸入法模組" #. label #: ../src/scim_chewing_imengine_setup.cpp:200 msgid "Trigger keys:" msgstr "切æ›éµï¼š" #. title #: ../src/scim_chewing_imengine_setup.cpp:202 msgid "Select trigger keys" msgstr "鏿“‡åˆ‡æ›éµ" #. tooltip #: ../src/scim_chewing_imengine_setup.cpp:204 msgid "" "The key events to switch Chewing input mode. Click on the button on the " "right to edit it." msgstr "鏿“‡åˆ‡æ›é…·éŸ³è¼¸å…¥æ¨¡å¼çš„æŒ‰éµäº‹ä»¶ï¼ŒæŒ‰å³é‚Šçš„æŒ‰éˆ•坿›´æ”¹ã€‚" #. label #: ../src/scim_chewing_imengine_setup.cpp:217 msgid "Chewing CHI/ENG keys:" msgstr "酷音中英切æ›éµï¼š" #. title #: ../src/scim_chewing_imengine_setup.cpp:219 msgid "Select CHI/ENG keys" msgstr "鏿“‡ä¸­è‹±åˆ‡æ›éµ" #. tooltip #: ../src/scim_chewing_imengine_setup.cpp:221 msgid "" "The key events to switch English and Chinese mode. Click on the button on " "the right to edit it." msgstr "用以切æ›ä¸­è‹±æ¨¡å¼çš„æŒ‰éµï¼ŒæŒ‰å³é‚Šçš„æŒ‰éˆ•坿›´æ”¹ã€‚" #: ../src/scim_chewing_imengine_setup.cpp:260 msgid "Color #1" msgstr "色調 (一)" #: ../src/scim_chewing_imengine_setup.cpp:261 #: ../src/scim_chewing_imengine_setup.cpp:274 #: ../src/scim_chewing_imengine_setup.cpp:287 #: ../src/scim_chewing_imengine_setup.cpp:300 #: ../src/scim_chewing_imengine_setup.cpp:313 msgid "The color of preediting text" msgstr "é å…ˆç·¨è¼¯æ–‡å­—çš„é¡è‰²" #: ../src/scim_chewing_imengine_setup.cpp:273 msgid "Color #2" msgstr "色調 (二)" #: ../src/scim_chewing_imengine_setup.cpp:286 msgid "Color #3" msgstr "色調 (三)" #: ../src/scim_chewing_imengine_setup.cpp:299 msgid "Color #4" msgstr "色調 (å››)" #: ../src/scim_chewing_imengine_setup.cpp:312 msgid "Color #5" msgstr "色調 (五)" #: ../src/scim_chewing_imengine_setup.cpp:357 msgid "Add _Phrase forward" msgstr "剿–¹åŠ è©ž (_P)" #: ../src/scim_chewing_imengine_setup.cpp:368 msgid "Whether to add Phrase forward or not." msgstr "是å¦åœ¨ä½¿ç”¨è€…å­—è©žå‰æ–¹åŠ è©ž" #: ../src/scim_chewing_imengine_setup.cpp:380 msgid "_Rearward phrase choice" msgstr "å¾Œæ–¹é¸æ“‡å­—詞(_R)" #: ../src/scim_chewing_imengine_setup.cpp:391 msgid "The behavior for phrase choice to be rearward or not." msgstr "是å¦åœ¨å­—è©žå¾Œæ–¹ä½œé¸æ“‡å‹•作" #: ../src/scim_chewing_imengine_setup.cpp:403 msgid "_Automatically shift cursor" msgstr "é¸å­—完畢自動移到下一個字(_A)" #: ../src/scim_chewing_imengine_setup.cpp:426 msgid "_Esc key to clean all buffer" msgstr "_Esc 鵿¸…除所有的éµç›¤ç·©è¡å€" #: ../src/scim_chewing_imengine_setup.cpp:437 msgid "Assign Esc key to clean all keyboard buffer or not." msgstr "指定 Esc 鵿¸…除所有按éµç·©è¡å€èˆ‡å¦" #: ../src/scim_chewing_imengine_setup.cpp:449 msgid "_SpaceKey as selection key" msgstr "ä½¿ç”¨ç©ºç™½éµæŒ‘é¸å€™é¸å­—詞 (_S)" #: ../src/scim_chewing_imengine_setup.cpp:460 msgid "Whether SpaceKey is used as selection key or not." msgstr "決定是å¦ä½¿ç”¨ç©ºç™½éµä¾†æŒ‘é¸å€™é¸å­—詞" #: ../src/scim_chewing_imengine_setup.cpp:480 msgid "Default Keyboard" msgstr "é è¨­éµç›¤" #: ../src/scim_chewing_imengine_setup.cpp:483 msgid "Hsu's Keyboard" msgstr "許æ°éµç›¤" #: ../src/scim_chewing_imengine_setup.cpp:486 msgid "IBM Keyboard" msgstr "IBM éµç›¤" #: ../src/scim_chewing_imengine_setup.cpp:489 msgid "Gin-Yieh Keyboard" msgstr "精業éµç›¤" #: ../src/scim_chewing_imengine_setup.cpp:492 msgid "ETen Keyboard" msgstr "倚天éµç›¤" #: ../src/scim_chewing_imengine_setup.cpp:495 msgid "ETen 26-key Keyboard" msgstr "倚天26éµ" #: ../src/scim_chewing_imengine_setup.cpp:498 msgid "Dvorak Keyboard" msgstr "Dvorak éµç›¤" #: ../src/scim_chewing_imengine_setup.cpp:501 msgid "Dvorak Keyboard with Hsu's support" msgstr "Dvorak éµç›¤ + è¨±æ°æ³¨éŸ³" #: ../src/scim_chewing_imengine_setup.cpp:504 msgid "DACHEN_CP26 Keyboard" msgstr "大åƒ26éµ" #: ../src/scim_chewing_imengine_setup.cpp:507 msgid "Han-Yu PinYin Keyboard" msgstr "漢語拼音排列" #: ../src/scim_chewing_imengine_setup.cpp:510 msgid "Taiwan Huayu Luomapinyin Keyboard" msgstr "å°ç£è¯èªžç¾…馬拼音" #: ../src/scim_chewing_imengine_setup.cpp:513 msgid "MPS2 PinYin Keyboard" msgstr "注音二å¼" #: ../src/scim_chewing_imengine_setup.cpp:628 msgid "Initial trigger Chinese/English mode:" msgstr "輸入法起始的中英模å¼ï¼š" #: ../src/scim_chewing_imengine_setup.cpp:640 msgid "Change the default Chinese/English mode on every trigger" msgstr "改變é è¨­è¼¸å…¥æ³•切æ›çš„中英模å¼" #: ../src/scim_chewing_imengine_setup.cpp:690 msgid "Number of Selection Keys :" msgstr "自訂é¸å­—鵿•¸é‡ï¼š" #: ../src/scim_chewing_imengine_setup.cpp:702 msgid "Change the default number of selection keys" msgstr "改變é è¨­é¸å­—鵿•¸é‡" #: ../src/scim_chewing_imengine_setup.cpp:749 msgid "Customized Selection Keys:" msgstr "自訂é¸å­—按éµçµ„åˆï¼š" #: ../src/scim_chewing_imengine_setup.cpp:761 msgid "Change the default selection keys" msgstr "改變é è¨­é¸å­—按éµçµ„åˆ" #: ../src/scim_chewing_imengine_setup.cpp:810 msgid "Use keyboard type:" msgstr "使用éµç›¤æŽ’列方å¼ï¼š" #: ../src/scim_chewing_imengine_setup.cpp:822 msgid "Change the default keyboard layout type" msgstr "改變é è¨­éµç›¤æŽ’列方å¼" #. Create the label for this note page. #: ../src/scim_chewing_imengine_setup.cpp:893 msgid "Options" msgstr "é¸é …" #. Create the label for this note page. #: ../src/scim_chewing_imengine_setup.cpp:904 msgid "Keyboard" msgstr "éµç›¤" #. Create the label for this note page. #: ../src/scim_chewing_imengine_setup.cpp:912 msgid "Decorative Color" msgstr "è£é£¾é¡è‰²" #~ msgid "Automatically shift cursor after selection." #~ msgstr "一旦é¸å­—完畢,自訂移動游標到下個字" #~ msgid "Select a file" #~ msgstr "鏿“‡æª”案" #~ msgid "Built-in Method:" #~ msgstr "內建:" #~ msgid "External Method:" #~ msgstr "自訂:" #~ msgid "PinYin Configuration" #~ msgstr "拼音輸入設定" scim-chewing-0.5.1/scim-chewing.spec.in000066400000000000000000000050121271526764000177400ustar00rootroot00000000000000%define version @PACKAGE_VERSION@ %define release 1mdk %define libname_orig lib%{name} %define libname %mklibname %{name} 0 Name: scim-chewing Summary: SCIM-chewing is an SCIM IMEngine module for chewing Version: %{version} Release: %{release} Group: System/Internationalization License: GPL URL: http://chewing.im/ Source0: %{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Requires: %{libname} = %{version}-%{release} Requires: libchewing >= @CHEWING_VERSION@ Requires: scim >= 1.0.1 BuildRequires: libchewing-devel >= @CHEWING_VERSION@ BuildRequires: scim-devel >= 1.0.1 BuildRequires: automake1.8 %description SCIM-chewing is an SCIM IMEngine module for chewing, an intelligent Chinese phonetic input method. %package -n %{libname} Summary: Scim-chewing library. Group: System/Internationalization Provides: %{libname_orig} = %{version}-%{release} %description -n %{libname} scim-chewing library. %package -n %{libname}-devel Summary: Headers of scim-chewing for development. Group: Development/C Requires: %{libname} = %{version}-%{release} Provides: %{name}-devel = %{version}-%{release} Provides: %{libname_orig}-devel = %{version}-%{release} %description -n %{libname}-devel Headers of %{name} for development. %prep %setup -q cp /usr/share/automake-1.8/mkinstalldirs . %build [[ ! -x configure ]] && ./bootstrap %configure2_5x %make %install rm -rf $RPM_BUILD_ROOT %makeinstall_std %find_lang %{name} %clean rm -rf $RPM_BUILD_ROOT %post -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig %files -f %{name}.lang %defattr(-,root,root) %doc AUTHORS COPYING ChangeLog README %{_datadir}/scim/icons/* %files -n %{libname} %defattr(-,root,root) %doc COPYING %{_libdir}/scim-1.0/IMEngine/*.so %{_libdir}/scim-1.0/SetupUI/*.so %files -n %{libname}-devel %defattr(-,root,root) %doc COPYING %{_libdir}/scim-1.0/IMEngine/*.a %{_libdir}/scim-1.0/IMEngine/*.la %{_libdir}/scim-1.0/SetupUI/*.a %{_libdir}/scim-1.0/SetupUI/*.la %changelog * Wed Dec 22 2004 Shiva Huang 0.1.1-1shiva - Update to 0.1.1 * Sat Dec 18 2004 Shiva Huang 0.1.0-2.20041130.2shiva - modify Requires/BuildRequires - modify URL * Tue Dec 14 2004 UTUMI Hirosi 0.1.0-2.20041130.1ut - modify Requires/BuildRequires - add URL * Thu Dec 02 2004 Shiva Huang 0.1.0-1mdk - initial release - this spec file is based on scim-anthy, thanks to UTUMI Hirosi and Thierry Vignaud scim-chewing-0.5.1/scripts/000077500000000000000000000000001271526764000155735ustar00rootroot00000000000000scim-chewing-0.5.1/scripts/ChangeLog-svn000066400000000000000000000571651271526764000201670ustar00rootroot000000000000002011-02-27 Jim Huang * configure.ac: Bump version to 0.3.4 Bump libchewing dependency to version 0.3.3 (equal) * NEWS: ditto. 2010-08-26 Jim Huang * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::process_key_event): Be aware of the "Keyboard Layout" setting in SCIM, Thus, users can use a French AZERTY or German QWERTZ without having to switch to a US layout beforehand. Patched by Matthieu Valleton 2010-01-14 Jim Huang * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::process_key_event): Fix the unexpected behavior on candidate phrases in Google search bar browsed by Firefox. Reported by Youchen Lee . NOTE: the workaround for OpenOffice might not fit anymore since the usage of GTK-IM API changes a lot. 2010-01-14 Jim Huang * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::process_key_event): Release F1-F19 Keys. Patched by Youchen Lee . 2010-01-14 Jim Huang * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::process_key_event): Added the support of "+-*/" keys on numpad. Patched by Youchen Lee . 2009-05-14 Jim Huang * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::process_key_event): Handle Enter and '.' in keypad. Patched by Sprite93@ptt.cc . 2009-01-24 Jim Huang * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::process_key_event): Handle 0-9 in keypad. 2008-12-09 Jim Huang * po/nl.po: Update Nederlands translation contributed by Ronald Stroethoff . 2008-12-01 Jim Huang * configure.ac: Bump version to 0.3.3 Bump libchewing dependency to version 0.3.2 (equal) 2008-11-30 Kanru Chen * src/scim_chewing_imengine.cpp: Fix off-by-one bug. 2008-11-30 Kanru Chen * src/scim_chewing_imengine.cpp, src/scim_chewing_imengine.h: Set selection key correctly. 2008-11-30 Jim Huang * po/zh_TW.po: Update translations. 2008-11-30 Jim Huang * src/scim_chewing_imengine.h (class ChewingIMEngineFactory) src/scim_chewing_config_entry.h (SCIM_CONFIG_IMENGINE_CHEWING_AUTO_SHIFT_CURSOR): Added entries for the feature: automatically shifting cursor after selection. * src/scim_chewing_imengine.cpp (ChewingIMEngineFactory::reload_conf), src/scim_chewing_imengine_setup.cpp (create_options_page) (setup_widget_value) (load_config) (save_config): Implemented. 2008-11-29 Jim Huang * src/scim_chewing_imengine_setup.cpp (scim_setup_module_get_description): Fix typo. * po/zh_TW.po: Improve messages. 2008-11-29 Jim Huang * po/zh_TW.po: Update translations. 2008-11-29 Jim Huang * src/scim_chewing_imengine.h (class ChewingIMEngineFactory), src/scim_chewing_config_entry.h (SCIM_CONFIG_IMENGINE_CHEWING_PHRASE_CHOICE_REARWARD): Added entries for the direction of phrase choice. * src/scim_chewing_imengine.cpp (ChewingIMEngineFactory::reload_conf), src/scim_chewing_imengine_setup.cpp (create_options_page) (setup_widget_value) (load_config) (save_config): Implemented. 2008-11-27 Kanru Chen * src/scim_chewing_imengine.cpp: Adapt the libchewing APIs. 2008-10-30 Jim Huang * configure.ac: Specify the qualication of libchewing dependency version as "equal" instead of "larger than or equal" because of the fact that libchewing 0.3.x stands for development branch. We intend to break API/ABI at the stage. 2008-10-25 Kanru Chen * src/scim_chewing_imengine.cpp, src/scim_chewing_imengine_setup.cpp: Remove hanyupinyin setting page. Now libchewing load the table from data directory or user data directory. 2008-10-19 Jim Huang * src/scim_chewing_imengine_setup.cp (__config_keyboards): Fix Trigger key settings due to typo. RedHat bugzilla #206125, rt #23574 2008-10-18 Kanru Chen * src/scim_chewing_imengine.cpp: Proper include path. (ChewingIMEngineInstance::commit): Remove semi-colon after if statement. 2008-10-18 Jim Huang * src/scim_chewing_imengine_setup.cpp (create_keyboard_page) (create_pinyin_config_page): Eliminate compilation warnings. 2008-10-18 Jeff Chen * src/scim_chewing_imengine_setup.cpp: Fix the layout of keyboard setting page. * src/scim_chewing_imengine.h, src/scim_chewing_imengine.cpp: Adapt the libchewing APIs. 2008-10-01 Kanru Chen * configure.ac: Make use of AC_CONFIG_AUX_DIR. * autotools: New directory containing files generated by autotools. * scripts/remove-autotool.sh: Likewise. 2008-10-01 Kanru Chen * configure.ac: Bump version to 0.3.2 Bump libchewing dependency to version 0.3.1 2008-09-20 Kanru Chen * configure.ac: Bump version to 0.3.1.902 Bump libchewing dependency to version 0.3.0.902 2008-09-20 Kanru Chen * configure.ac: Bump libchewing dependency to version 0.3.0.901 2008-07-07 Kanru Chen * src/scim_chewing_imengine.cpp: Corret candidate number setting. 2008-04-28 Caius Chance * src/scim_chewing_config_entry.h, src/scim_chewing_imengine.cpp, src/scim_chewing_imengine.h, src/scim_chewing_imengine_setup.cpp: Added Chinese/English mode fast switch on toolbar. Added Chinese/English mode initial preference in setup menus. Minor refactorization. 2008-04-09 Caius Chance * src/scim_chewing_imengine.cpp: Fixes texts pasting to preedit buffer (graphically only) in KDE4/Qt4. (Paste of texts will be ignored and cursor will be moved to the end of preedit buffer.) 2008-04-01 Jeff Chen * src/scim_chewing_imengine_setup.cpp: The maximum value of SelectionKeysNum should be 10. Fix wrong layout parameters in keyboard page. 2008-03-22 Kanru Chen * src/scim_chewing_imengine.cpp, src/scim_chewing_imengine_setup.cpp: Adapting g++-4.3 compatibility patch from Cyril Brulebois. 2008-02-05 Jeff Chen * src/scim_chewing_imengine_setup.cpp: Use const char* for string literal. * src/scim_chewing_imengine.cpp: Typo fixed. 2008-02-03 Jeff Chen * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::trigger_property) (ChewingIMEngineInstance::refresh_kbtype_property): Correct some keyboard types (ChewingIMEngineInstance::match_key_event): Correct the missing increase operator. (ChewingIMEngineFactory::get_help): Add missing plus operators. 2008-01-16 Kanru Chen * src/scim_chewing_imengine.cpp: Use the KB_* definition from zuin.h. 2008-01-16 Kanru Chen * src/scim_chewing_imengine.cpp: Fix the missing plusses. 2008-01-08 Caius Chance * src/scim_chewing_imengine.cpp: * src/scim_chewing_imengine.h: Keyboard layout toggle button on toolbar. (Added a button for keyboard type change. It won't save to config but just for input a character occasionally if such combination keys are suddenly forgotten.) 2007-12-20 Caius Chance * src/scim_chewing_imengine.cpp: Last candidate on lookup table is not a valid candidate. ( Refit lookup table page size for last lookup page. i.e. m_lookup_table.set_page_size([last_page_candidate_amount]) ) 2007-07-25 Jim Huang * po/nl.po: New file. Nederlands translation contributed by Ronald Stroethoff . * po/LINGUAS: Likewise. 2007-05-22 Jim Huang * src/scim_color_button.cpp, src/scim_color_button.h, src/scim_chewing_imengine_setup.cpp: s/ScimColorButton/ScimChewingColorButton/g . To avoid setup GUI modules not able to initialize due to naming pollution. Reported by Yong Sun . * po/zh_TW.po: Fix translation item of "Han-Yu PinYin Keyboard". 2006-11-22 Caius Chance Release Page Up / Page Down key event to running applications. (Fixed Page Up / Page Down key doesn't work when Chewing is activated.) * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::process_key_event): Add redirection of SCIM_KEY_Page_Up() and SCIM_KEY_Page_Down() to libchewing's chewing_handle_PageUp() and chewing_handle_PageDown(), which eventually pass page up and page down key event to running applications. 2006-11-16 Jim Huang * src/Makefile.am: Added scim_chewing_config_entry.h and scim_chewing_imengine.h into chewing_la_SOURCES. * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::reload_config) (ChewingIMEngineInstance::update_lookup_table_page_size): Rename config.selectAreaLen to config.candPerPage . * configure.ac: Depends on libchewing 0.3.091 . Downgrade intltools from 0.35 to 0.34 . * AUTHORS: Updated. 2006-11-09 Caius Chance * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::reset): Re-focus to clear preedit, to avoid gedit crash when select-all. 2006-10-30 Caius Chance * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::reload_config): Esc key to clean all buffer couldn't be disabled. Esc clear all buffer was not functioning and setup page wasn't reflecting changes. * src/scim_chewing_imengine_setup.cpp (setup_widget_value): As Above 2006-10-30 Caius Chance * src/scim_chewing_imengine_setup.cpp (__config_keyboards[]): Fixed trigger key "Control-Space". (It was recognised as "Space" because it was written "Ctrl-Space".) 2006-08-15 Kanru Chen * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::focus_out): Add chewing_handle_Esc() after committing to clear rest pre-edit buffer. 2006-06-19 Jeff Chen * po/zh_TW.po: Updated. * src/scim_chewing_imengine.h: Add new members for selectable PinYin method. * src/scim_chewing_config_entry.h: Add new configurations to scim repository. * src/scim_chewing_imengine.cpp (ChewingIMEngineFactory::reload_config) (ChewingIMEngineInstance::reset), src/scim_chewing_imengine_setup.cpp (create_pinyin_config_page) (create_setup_window) (load_config) (save_config) (set_pinyin_typ) (on_builtin_pinyin_method_changed) (on_builtin_pinyin_method_toggled) (on_external_pinyin_method_changed): Add selectable PinYin method support. 2006-05-30 Kanru Chen * configure.ac: Bump version to 0.3.1. * po/ChangeLog: New file, used by intltool. * autogen.sh: Reordering the scripts. 2006-05-28 Kanru Chen * configure.ac: Add IT_PROG_INTLTOOL which will include intltool.m4. Require intltool version 0.35.0 to use LINGUAS file. * autogen.sh: Reordering the scripts. Call aclocal after libtoolize and intltoolize. * po/LINGUAS: New file. 2006-05-21 Jim Huang * src/scim_chewing_imengine_setup.cpp (setup_widget_value) (load_config) (save_config) (find_color_config_entry): Fixlet. There's no "end marker" where the bg_key is False. This of course causes invalid memory access thus crashing "scim-setup". Patched by Scott Tsai . 2006-05-18 Kanru Chen * src/scimm_chewing_imengine.cpp (ChewingIMEngineInstance::process_key_event): Pass unknown input key event. 2006-05-16 Kanru Chen * scrpits/remove-autotool.sh: Add config.status.lineno to removing list. 2006-05-15 Jim Huang * configure.ac: Bump version to 0.3.0 (final). SCIM-chewing 0.3.x depends on libchewing 0.3.x series. 2006-05-15 Jim Huang * src/scim_chewing_imengine.h (m_selection_keys_num): New member for the number of selection keys. * src/scim_chewing_config_entry.h (SCIM_CHEWING_SELECTION_KEYS_NUM): Put key entry name instead of hard-coded constant. * src/scim_chewing_imengine.cpp (ChewingIMEngineFactory::reload_conf) (ChewingIMEngineInstance::ChewingIMEngine) (ChewingIMEngineInstance::reload_config) (ChewingIMEngineInstance::update_lookup_table_page_size) (ChewingIMEngineInstance::reset) (ChewingLookupTable::ChewingLookupTable) (ChewingLookupTable::init): Continue the previous work from Kanru Chen to be more complete. * src/scim_chewing_imengine_setup.cpp (create_keyboard_page) (create_keyboard_page) (setup_widget_value) (load_config) (save_config): Likewise. Complete SetupUI for customized selection keys and number. * po/zh_TW.po: Updated. 2006-05-15 Jim Huang * configure.ac: Fill chewing-devel@googlegroups.com as contact address. 2006-05-13 Kanru Chen * src/scim_chewing_imengine.cpp (ChewingLookupTable::init): Accpet custom selection keys. (ChewingIMEngineInstance::reset): Update selection keys. 2006-05-12 Jim Huang * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::reset): Added suffix '\0'. * src/scim_chewing_imengine_setup.cpp (_builtin_selectmap): Reduced to char *builtin_selectkeys. (create_keyboard_page) (setup_widget_value) (save_config): Use fixed-length selection keys. 2006-05-12 Jim Huang * src/scim_chewing_imengine.h (m_default_KeyboardType): Rename to m_KeyboardType for better readability. (m_selection_keys): New member for selection keys. * src/scim_chewing_config_entry.h (SCIM_CONFIG_IMENGINE_CHEWING_SELECTION_KEYS): New macro. Default selection keys. * src/scim_chewing_imengine.cpp (ChewingIMEngineFactory::reload_conf) (ChewingIMEngineInstance::reload_config) (ChewingIMEngineInstance::reset), src/scim_chewing_imengine_setup.cpp (create_keyboard_page) (create_keyboard_page) (setup_widget_value) (load_config) (save_config): Implement customized selection keys, such as "123...", "asdf...", etc. * po/zh_TW.po: Updated. 2006-05-11 Jim Huang * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::process_key): Fixlet to use chewing_handle_ShiftSpace. 2006-05-10 Jim Huang * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::process_key): Toggle Full/Half shape via shift-space. 2006-05-10 Jim Huang * configure.ac: Bump version to 0.2.92 . 2006-05-10 Jim Huang * src/scim_chewing_config_entry.h (SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_NUM): New macro. * src/scim_chewing_imengine.cpp (ChewingIMEngineFactory::reload_conf): Increment color index. (ChewingIMEngineInstance::commit): Cleanup. NOTE: Only the color setting of preedit area background is implemented. * src/scim_chewing_imengine_setup.cpp (create_color_button_page): Cleanup. TODO: Enable tooltip in create_color_button. * po/zh_TW.po: Improved. 2006-05-10 Jim Huang * src/scim_color_button.cpp, src/scim_color_button.h: New files. ScimColorButton implementation. * src/Makefile.am: Ditto. * src/scim_chewing_config_entry.h (SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_[1-5]): Default color index for preedit area background. * src/scim_chewing_imengine.cpp (chewing_preedit_bgcolor): Fill with default values. * src/scim_chewing_imengine_setup.cpp (config_color_common): New member for color index storage. (create_color_button) (on_color_button_changed) (find_color_config_entry): New function to handling color buttons. (create_setup_window): Added decorative color page. (setup_widget_value) (load_config) (save_config): Use ColorConfigData. * data/scim-chewing-swap-colors.png: New file. Indicate color swapping. * data/Makefile.am: Ditto. 2006-05-09 Jim Huang * src/scim_chewing_imengine.h (ChewingIMEngineFactory::m_preedit_bgcolor[]): New property. Used for storing preedit background color indexes. * src/Makefile.am: Added SCIM_CHEWING_LOCALEDIR. * src/scim_chewing_imengine.cpp (scim_module_init): Bind text domain. (ChewingIMEngineFactory::reload_config): Reload various preedit background color indexes for SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_ . (ChewingIMEngineFactory::get_help): Tweak help messages. * src/scim_chewing_imengine_setup.cpp (scim_module_init): Bind text domain. TODO: use ScimColorButton in SetupUI for customized color indexes. * po/zh_TW.po: Updated. 2006-05-08 Jim Huang * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::process_key): Fixlet to Caps Lock. 2006-05-08 Jim Huang * scim-chewing.spec.in: Added rules for dependency checks. 2006-05-08 Jim Huang * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::trigger_property): Fixlet to Full/Half shape trigger. 2006-05-08 Jim Huang * src/scim_chewing_imengine.cpp (_builtin_keymap): Fix typo of Han-Yu PinYin Keyboard. 2006-05-07 Jim Huang * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::process_key): Temporary workaround for avoiding crashes with shift key combinations. 2006-05-06 Jim Huang * configure.ac: SCIM-chewing 0.2.91 depends on libchewing 0.2.93 . 2006-05-02 Jim Huang * src/scim_chewing_imengine.h (ChewingIMEngineFactory::m_esc_clean_all_buffer), src/scim_chewing_imengine.cpp (ChewingIMEngineFactory::reload_conf) (ChewingIMEngineInstance::reload_con): New property: m_esc_clean_all_buffer. Decide to assign Esc key to clean all keyboard buffer or not. * src/scim_chewing_imengine_setup.cpp (create_options_page) (load_config) (save_config): Implement UI for configure the above option. * po/scim-chewing.pot, po/zh_TW.po: Update gettext message template and zh_TW translation. * configure.ac: Bump version to 0.2.91 . 2006-04-29 Jim Huang * src/scim_chewing_imengine.cpp (builtin_keymaps): Rename KB_HANYU_PINYING to KB_HANYUPINYIN to fit SVN HEAD libchewing changes. 2006-03-23 Jim Huang * src/Makefile.am: Trivial change for libtool symbols. 2005-12-07 Kanru Chen * src/scim_chewing_imengine.cpp: Use new buffer size. 2005-12-07 Kanru Chen * configure.ac: Use SVN HEAD libchewing. * src/scim_chewing_imengine.cpp: Add Full/Half shape property. Use new API. 2005-10-10 Jim Huang * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::~ChewingIMEngineInstance): Add TerminateChewing API call. 2005-08-08 Jim Huang * configure.ac: Bump version to 0.2.1 . SCIM/Chewing now depends on libchewing 0.2.7 . * NEWS: Updated. 2005-04-24 Kanru Chen * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::process_key_event): Fix CtrlNum failure. 2005-04-17 Kanru Chen * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::process_key_event): Handle key mask to make working under SCIM 1.2.1 . (ChewingIMEngineInstance::commit): Validate the content in lookup table. 2005-03-20 Jim Huang * src/scim_chewing_imengine.h (class ChewingIMEngineFactory), src/scim_chewing_config_entry.h: New member for SpaceAsSelection to decide if perform old style of space key. * src/scim_chewing_imengine.cpp (ChewingIMEngineFactory::reload_config), (ChewingIMEngineInstance::reload_config), src/scim_chewing_imengine_setup.cpp (create_options_page), (setup_widget_value), (load_config), (save_config): Support the switch of the above option. 2005-03-18 Kanru Chen * scim_chewing_imengine.cpp (ChewingIMEngineInstance::trigger_property): Use trigger_property to change the chi/eng mode, so we can use property button to change the mode. 2005-03-18 Kanru Chen * scim_chewing_imengine.cpp (ChewingIMEngineInstance::commit): Make Zuin output much pretty and readable. 2005-02-28 Jim Huang * configure.ac: Bump version to 0.2.0. Depends on libchewing 0.2.6 (and above). clean up version definition macros. * scim-chewing.spec.in: Fix package version definition. 2005-02-25 Kanru Chen * src/scim_chewing_config_entry.h: Fix typo. 2005-02-24 Jim Huang * src/scim_chewing_imengine_setup.cpp: Handle the keyboard mapping configuration with translated message. * po/zh_TW.po: Updated with keyboard mapping message. 2005-02-24 Kanru Chen * src/scim_chewing_config_entry.h, src/scim_chewing_imengine_setup.cpp: Remove unused SCIM_CONFIG_IMENGINE_CHEWING_USE_DVORAK * src/scim_chewing_imengine.cpp, src/scim_chewing_imengine.h: New function: ChewingIMEngineFactory::reload_config, reorder initialize sequence, save config data in Factory. After scim-setup, changes can immediately be reloaded. * src/scim_chewing_imengine.cpp (ChewingIMEngineFactory::get_help): Fill help messages. (ChewingIMEngineInstance::select_candidate): Now we can use mouse to select the candidate. (ChewingIMEngineInstance::commit): Pass correct length to iconv. (fix rt#7503) Use different foreground color to highlight phrases. 2005-02-21 Kanru Chen * src/scim_chewing_imengine.cpp (reload_config): Let selectAreaLen have correct value. 2005-02-21 Jim Huang * src/scim_chewing_imengine.h, src/scim_chewing_config_entry.h, src/scim_chewing_imengine.cpp, src/scim_chewing_imengine_setup.cpp: Bump copyright date. * src/scim_chewing_imengine_setup.cpp: Fix intl macro. * po/zh_TW.po: Update zh_TW translation to adapt recent SetupIM changes. 2005-02-20 Kanru Chen * po/scim-chewing.pot, po/zh_TW.po: Update gettext message template and zh_TW translation. * src/scim_chewing_imengine.h, src/scim_chewing_imengine.cpp: Add ChiEngMode property, functionality to show current mode is Chinese Mode or English Mode. * src/scim_chewing_imengime_setup.cpp: New chewing keyboard type - KB_HANYU_PINYING. 2005-02-07 Kanru Chen * src/scim_chewing_imengine.h, src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::commit): Add functionality to show phrase interval using fonts decorated by underline, caret by highlight fonts, and Zuin symbol after the specific caret. * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::match_key_event): New method. Make checking keys more convenient. 2005-02-06 Kanru Chen * src/scim_chewing_imengine.cpp, src/scim_chewing_imengine_setup.cpp: Initial working SetupUI. Support USER_KB_TYPE entry. 2004-12-21 Jim Huang * configure.ac: Bump version to 0.1.1 2004-12-15 Jim Huang * src/scim_chewing_imengine.cpp (ChewingIMEngineInstance::process_key_event): Add a workaround against the known issue in OpenOffice with GTK+ im module hanlding key pressed/released events. 2004-12-14 Jim Huang * src/scim_chewing_imengine.cpp (ChewingIMEngineFactory::init): Replace scim_get_home_dir() with CHEWING_DATADIR (prefix) for consistency. (ChewingIMEngineFactory::validate_encoding), (ChewingIMEngineFactory::validate_locale): Implemented. (ChewingIMEngineInstance::reload_config): Handle evil Null character in C-style string. 2004-12-07 Jim Huang * src/scim_chewing_imengine.cpp: Remove the implementation of the invalid methods, ChewingIMEngineFactory::validate_encoding and ChewingIMEngineFactory::validate_locale. Just use the ones derived from base class according to the advice of James Su. 2004-11-30 Jim Huang * First working snapshot. * Adapt the codebase from Kanru Chen. scim-chewing-0.5.1/scripts/git2cl000077500000000000000000000246671271526764000167240ustar00rootroot00000000000000#!/usr/bin/perl # Copyright (C) 2007, 2008 Simon Josefsson # Copyright (C) 2007 Luis Mondesi # * calls git directly. To use it just: # cd ~/Project/my_git_repo; git2cl > ChangeLog # * implements strptime() # * fixes bugs in $comment parsing # - copy input before we remove leading spaces # - skip "merge branch" statements as they don't # have information about files (i.e. we never # go into $state 2) # - behaves like a pipe/filter if input is given from the CLI # else it calls git log by itself # # The functions mywrap, last_line_len, wrap_log_entry are derived from # the cvs2cl tool, see : # Copyright (C) 2001,2002,2003,2004 Martyn J. Pearce # Copyright (C) 1999 Karl Fogel # # git2cl 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. # # git2cl 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 git2cl; see the file COPYING. If not, write to the Free # Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. use strict; use POSIX qw(strftime); use Text::Wrap qw(wrap); use FileHandle; use constant EMPTY_LOG_MESSAGE => '*** empty log message ***'; # this is a helper hash for stptime. # Assumes you are calling 'git log ...' with LC_ALL=C my %month = ( 'Jan'=>0, 'Feb'=>1, 'Mar'=>2, 'Apr'=>3, 'May'=>4, 'Jun'=>5, 'Jul'=>6, 'Aug'=>7, 'Sep'=>8, 'Oct'=>9, 'Nov'=>10, 'Dec'=>11, ); my $fh = new FileHandle; sub key_ready { my ($rin, $nfd); vec($rin, fileno(STDIN), 1) = 1; return $nfd = select($rin, undef, undef, 0); } sub strptime { my $str = shift; return undef if not defined $str; # we are parsing this format # Fri Oct 26 00:42:56 2007 -0400 # to these fields # sec, min, hour, mday, mon, year, wday = -1, yday = -1, isdst = -1 # Luis Mondesi my @date; if ($str =~ /([[:alpha:]]{3})\s+([[:alpha:]]{3})\s+([[:digit:]]{1,2})\s+([[:digit:]]{1,2}):([[:digit:]]{1,2}):([[:digit:]]{1,2})\s+([[:digit:]]{4})/){ push(@date,$6,$5,$4,$3,$month{$2},($7 - 1900),-1,-1,-1); } else { die ("Cannot parse date '$str'\n'"); } return @date; } sub mywrap { my ($indent1, $indent2, @text) = @_; # If incoming text looks preformatted, don't get clever my $text = Text::Wrap::wrap($indent1, $indent2, @text); if ( grep /^\s+/m, @text ) { return $text; } my @lines = split /\n/, $text; $indent2 =~ s!^((?: {8})+)!"\t" x (length($1)/8)!e; $lines[0] =~ s/^$indent1\s+/$indent1/; s/^$indent2\s+/$indent2/ for @lines[1..$#lines]; my $newtext = join "\n", @lines; $newtext .= "\n" if substr($text, -1) eq "\n"; return $newtext; } sub last_line_len { my $files_list = shift; my @lines = split (/\n/, $files_list); my $last_line = pop (@lines); return length ($last_line); } # A custom wrap function, sensitive to some common constructs used in # log entries. sub wrap_log_entry { my $text = shift; # The text to wrap. my $left_pad_str = shift; # String to pad with on the left. # These do NOT take left_pad_str into account: my $length_remaining = shift; # Amount left on current line. my $max_line_length = shift; # Amount left for a blank line. my $wrapped_text = ''; # The accumulating wrapped entry. my $user_indent = ''; # Inherited user_indent from prev line. my $first_time = 1; # First iteration of the loop? my $suppress_line_start_match = 0; # Set to disable line start checks. my @lines = split (/\n/, $text); while (@lines) # Don't use `foreach' here, it won't work. { my $this_line = shift (@lines); chomp $this_line; if ($this_line =~ /^(\s+)/) { $user_indent = $1; } else { $user_indent = ''; } # If it matches any of the line-start regexps, print a newline now... if ($suppress_line_start_match) { $suppress_line_start_match = 0; } elsif (($this_line =~ /^(\s*)\*\s+[a-zA-Z0-9]/) || ($this_line =~ /^(\s*)\* [a-zA-Z0-9_\.\/\+-]+/) || ($this_line =~ /^(\s*)\([a-zA-Z0-9_\.\/\+-]+(\)|,\s*)/) || ($this_line =~ /^(\s+)(\S+)/) || ($this_line =~ /^(\s*)- +/) || ($this_line =~ /^()\s*$/) || ($this_line =~ /^(\s*)\*\) +/) || ($this_line =~ /^(\s*)[a-zA-Z0-9](\)|\.|\:) +/)) { $length_remaining = $max_line_length - (length ($user_indent)); } # Now that any user_indent has been preserved, strip off leading # whitespace, so up-folding has no ugly side-effects. $this_line =~ s/^\s*//; # Accumulate the line, and adjust parameters for next line. my $this_len = length ($this_line); if ($this_len == 0) { # Blank lines should cancel any user_indent level. $user_indent = ''; $length_remaining = $max_line_length; } elsif ($this_len >= $length_remaining) # Line too long, try breaking it. { # Walk backwards from the end. At first acceptable spot, break # a new line. my $idx = $length_remaining - 1; if ($idx < 0) { $idx = 0 }; while ($idx > 0) { if (substr ($this_line, $idx, 1) =~ /\s/) { my $line_now = substr ($this_line, 0, $idx); my $next_line = substr ($this_line, $idx); $this_line = $line_now; # Clean whitespace off the end. chomp $this_line; # The current line is ready to be printed. $this_line .= "\n${left_pad_str}"; # Make sure the next line is allowed full room. $length_remaining = $max_line_length - (length ($user_indent)); # Strip next_line, but then preserve any user_indent. $next_line =~ s/^\s*//; # Sneak a peek at the user_indent of the upcoming line, so # $next_line (which will now precede it) can inherit that # indent level. Otherwise, use whatever user_indent level # we currently have, which might be none. my $next_next_line = shift (@lines); if ((defined ($next_next_line)) && ($next_next_line =~ /^(\s+)/)) { $next_line = $1 . $next_line if (defined ($1)); # $length_remaining = $max_line_length - (length ($1)); $next_next_line =~ s/^\s*//; } else { $next_line = $user_indent . $next_line; } if (defined ($next_next_line)) { unshift (@lines, $next_next_line); } unshift (@lines, $next_line); # Our new next line might, coincidentally, begin with one of # the line-start regexps, so we temporarily turn off # sensitivity to that until we're past the line. $suppress_line_start_match = 1; last; } else { $idx--; } } if ($idx == 0) { # We bottomed out because the line is longer than the # available space. But that could be because the space is # small, or because the line is longer than even the maximum # possible space. Handle both cases below. if ($length_remaining == ($max_line_length - (length ($user_indent)))) { # The line is simply too long -- there is no hope of ever # breaking it nicely, so just insert it verbatim, with # appropriate padding. $this_line = "\n${left_pad_str}${this_line}"; } else { # Can't break it here, but may be able to on the next round... unshift (@lines, $this_line); $length_remaining = $max_line_length - (length ($user_indent)); $this_line = "\n${left_pad_str}"; } } } else # $this_len < $length_remaining, so tack on what we can. { # Leave a note for the next iteration. $length_remaining = $length_remaining - $this_len; if ($this_line =~ /\.$/) { $this_line .= " "; $length_remaining -= 2; } else # not a sentence end { $this_line .= " "; $length_remaining -= 1; } } # Unconditionally indicate that loop has run at least once. $first_time = 0; $wrapped_text .= "${user_indent}${this_line}"; } # One last bit of padding. $wrapped_text .= "\n"; return $wrapped_text; } # main my @date; my $author; my @files; my $comment; my $state; # 0-header 1-comment 2-files my $done = 0; $state = 0; # if reading from STDIN, we assume that we are # getting git log as input if (key_ready()) { #my $dummyfh; # don't care about writing #($fh,$dummyfh) = FileHandle::pipe; $fh->fdopen(*STDIN, 'r'); } else { $fh->open("LC_ALL=C git log --pretty --numstat --summary 46db0edce2c2ef36285f0328b561b5f7c97afce1..HEAD |") or die("Cannot execute git log...$!\n"); } while (my $_l = <$fh>) { #print STDERR "debug ($state, " . (@date ? (strftime "%Y-%m-%d", @date) : "") . "): `$_'\n"; if ($state == 0) { if ($_l =~ m,^Author: (.*),) { $author = $1; } if ($_l =~ m,^Date: (.*),) { @date = strptime($1); } $state = 1 if ($_l =~ m,^$, and $author and (@date+0>0)); } elsif ($state == 1) { # * modifying our input text is a bad choice # let's make a copy of it first, then we remove spaces # * if we meet a "merge branch" statement, we need to start # over and find a real entry # Luis Mondesi my $_s = $_l; $_s =~ s/^ //g; if ($_s =~ m/^Merge branch/) { $state=0; next; } $comment = $comment . $_s; $state = 2 if ($_l =~ m,^$,); } elsif ($state == 2) { if ($_l =~ m,^([0-9]+)\t([0-9]+)\t(.*)$,) { push @files, $3; } $done = 1 if ($_l =~ m,^$,); } if ($done) { print (strftime "%Y-%m-%d $author\n\n", @date); my $files = join (", ", @files); $files = mywrap ("\t", "\t", "* $files"), ": "; if (index($comment, EMPTY_LOG_MESSAGE) > -1 ) { $comment = "[no log message]\n"; } my $files_last_line_len = 0; $files_last_line_len = last_line_len($files) + 1; my $msg = wrap_log_entry($comment, "\t", 69-$files_last_line_len, 69); $msg =~ s/[ \t]+\n/\n/g; print "$files: $msg\n"; @date = (); $author = ""; @files = (); $comment = ""; $state = 0; $done = 0; } } if (@date + 0) { print (strftime "%Y-%m-%d $author\n\n", @date); my $msg = wrap_log_entry($comment, "\t", 69, 69); $msg =~ s/[ \t]+\n/\n/g; print "\t* $msg\n"; } scim-chewing-0.5.1/scripts/remove-autotool.sh000077500000000000000000000014731271526764000213000ustar00rootroot00000000000000#!/bin/sh if [ -f Makefile ]; then if [ -f test/Makefile ]; then make -C test distclean fi make distclean fi rm -rf autom4te.cache find -name Makefile | xargs rm -f find -name Makefile.in | xargs rm -f find -name .deps | xargs rm -rf find -name '*.gmo' | xargs rm -f rm -rf \ aclocal.m4 \ autotools/config.sub \ autotools/config.guess \ config.status.lineno \ configure \ autotools/install-sh \ autom4te.cache \ config.log \ autotools/depcomp \ libtool \ config.status \ autotools/ltmain.sh \ autotools/missing \ config.h.in \ intltool-* \ po/boldquot.sed \ po/insert-header.sin \ po/Makevars.template \ po/remove-potcdate.sin \ po/stamp-po \ po/Makefile.in.in \ po/Rules-quot \ po/Makevars \ po/quot.sed LINK_KEY=src/tools/key2pho.c if [ -f $LINK_KEY ]; then rm -f $LINK_KEY fi scim-chewing-0.5.1/src/000077500000000000000000000000001271526764000146735ustar00rootroot00000000000000scim-chewing-0.5.1/src/Makefile.am000066400000000000000000000030171271526764000167300ustar00rootroot00000000000000## Makefile.am -- Process this file with automake to produce Makefile.in MAINTAINERCLEANFILES = Makefile.in AM_CPPFLAGS = \ -I$(top_builddir) \ -I$(top_srcdir) \ -I$(top_srcdir)/src \ -DSCIM_ICONDIR=\"@SCIM_ICONDIR@\" \ -DSCIM_CHEWING_LOCALEDIR=\"$(datadir)/locale\" \ -DSCIM_CHEWING_ICON_FILE=\"@SCIM_ICONDIR@/scim-chewing.png\" noinst_HEADERS = scim_chewing_imengine.h scim_chewing_config_entry.h moduledir = @SCIM_MODULEDIR@/IMEngine module_LTLIBRARIES = chewing.la chewing_la_SOURCES = \ scim_chewing_config_entry.h \ scim_chewing_imengine.h \ scim_chewing_imengine.cpp chewing_la_CFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ @CHEWING_CFLAGS@ chewing_la_CXXFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ @CHEWING_CFLAGS@ chewing_la_LDFLAGS = \ -avoid-version \ -rpath $(moduledir) \ -module \ $(LIBTOOL_EXPORT_OPTIONS) \ @INTLLIBS@ @SCIM_LIBS@ \ @CHEWING_LIBS@ if SCIM_BUILD_SETUP SETUP_MODULE = chewing-imengine-setup.la endif setupmoduledir = @SCIM_MODULEDIR@/SetupUI setupmodule_LTLIBRARIES = $(SETUP_MODULE) chewing_imengine_setup_la_SOURCES = \ scim_chewing_config_entry.h \ scim_color_button.h \ scim_color_button.cpp \ scim_chewing_imengine_setup.cpp chewing_imengine_setup_la_CFLAGS = \ @SCIM_GTKUTILS_CFLAGS@ @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ chewing_imengine_setup_la_CXXFLAGS = \ @SCIM_GTKUTILS_CFLAGS@ @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ chewing_imengine_setup_la_LDFLAGS = \ -avoid-version \ -rpath $(setupmoduledir) \ -module \ $(LIBTOOL_EXPORT_OPTIONS) \ @SCIM_GTKUTILS_LIBS@ \ @INTLLIBS@ \ @SCIM_LIBS@ scim-chewing-0.5.1/src/scim_chewing_config_entry.h000066400000000000000000000045751271526764000222640ustar00rootroot00000000000000/* * SCIM-chewing - * Intelligent Chinese Phonetic IM Engine for SCIM. * * Copyright (c) 2004, 2005, 2006, 2008 * SCIM-chewing Developers. See ChangeLog for details. * * See the file "COPYING" for information on usage and redistribution * of this file. */ #ifndef SCIM_CHEWING_CONFIG_ENTRY_H #define SCIM_CHEWING_CONFIG_ENTRY_H #define SCIM_CHEWING_SELECTION_KEYS_NUM \ "/IMEngine/Chewing/SelectionKeysNum" #define SCIM_CONFIG_IMENGINE_CHEWING_SELECTION_KEYS \ "1234567890" #define SCIM_CONFIG_IMENGINE_CHEWING_USER_SELECTION_KEYS \ "/IMEngine/Chewing/SelectionKeys" #define SCIM_CONFIG_IMENGINE_CHEWING_USER_KB_TYPE \ "/IMEngine/Chewing/KeyboardType" #define SCIM_CONFIG_IMENGINE_CHEWING_ADD_PHRASE_FORWARD \ "/IMEngine/Chewing/AddPhraseForward" #define SCIM_CONFIG_IMENGINE_CHEWING_SPACE_AS_SELECTION \ "/IMEngine/Chewing/SpaceAsSelection" #define SCIM_CONFIG_IMENGINE_CHEWING_ESC_CLEAN_ALL_BUFFER \ "/IMEngine/Chewing/EscCleanAllBuffer" #define SCIM_CONFIG_IMENGINE_CHEWING_TRIGGER_KEY \ "/IMEngine/Chewing/TriggerKey" #define SCIM_CONFIG_IMENGINE_CHEWING_CHI_ENG_KEY \ "/IMEngine/Chewing/ChiEngKey" #define SCIM_CONFIG_IMENGINE_CHEWING_CHI_ENG_MODE \ "/IMEngine/Chewing/ChiEngMode" #define SCIM_CONFIG_IMENGINE_CHEWING_USE_CAPSLOCK \ "/IMEngine/Chewing/UseCapslock" #define SCIM_CONFIG_IMENGINE_CHEWING_SHOW_CANDIDATE_COMMENT \ "/IMEngine/Chewing/ShowCandidateComment" #define SCIM_CONFIG_IMENGINE_CHEWING_PINYIN_METHD \ "/IMEngine/Chewing/PinYinMethod" #define SCIM_CONFIG_IMENGINE_CHEWING_EXTERNAL_PINYIN_PATH \ "/IMEngine/Chewing/ExternalPinYinPath" /* It's known to be at least 5. */ #define SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_NUM (5) #define SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_ \ "/IMEngine/Chewing/PreeditBackgroundColor" #define SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_1 \ "#A7A7A7" #define SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_2 \ "#C5C5C5" #define SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_3 \ "#A7A7A7" #define SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_4 \ "#F0F0F0" #define SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_5 \ "#AAAAAA" #define SCIM_CONFIG_IMENGINE_CHEWING_PHRASE_CHOICE_REARWARD \ "/IMEngine/Chewing/PhraseChoiceRearward" #define SCIM_CONFIG_IMENGINE_CHEWING_AUTO_SHIFT_CURSOR \ "/IMEngine/Chewing/AutoShiftCursor" #endif scim-chewing-0.5.1/src/scim_chewing_imengine.cpp000066400000000000000000000604721271526764000217220ustar00rootroot00000000000000/* * SCIM-chewing - * Intelligent Chinese Phonetic IM Engine for SCIM. * * Copyright (c) 2004-2010, 2012-2014 * SCIM-chewing Developers. See ChangeLog for details. * * See the file "COPYING" for information on usage and redistribution * of this file. */ #define Uses_SCIM_UTILITY #define Uses_SCIM_IMENGINE #define Uses_SCIM_CONFIG_BASE #define Uses_SCIM_CONFIG_PATH #define Uses_SCIM_LOOKUP_TABLE #define Uses_SCIM_IMENGINE_MODULE #define Uses_SCIM_ICONV #define Uses_SCIM_DEBUG #define Uses_SCIM_C_STRING #ifdef HAVE_CONFIG_H # include #endif #ifdef HAVE_GETTEXT # include # define _(String) dgettext(PACKAGE,String) # define N_(String) (String) #else # define _(String) (String) # define N_(String) (String) # define bindtextdomain(Package,Directory) # define textdomain(domain) # define bind_textdomain_codeset(domain,codeset) #endif #define SCIM_PROP_CHI_ENG_MODE \ "/IMEngine/Chinese/Chewing/ChiEngMode" #define SCIM_PROP_LETTER \ "/IMEngine/Chinese/Chewing/FullHalfLetter" #define SCIM_PROP_KBTYPE \ "/IMEngine/Chinese/Chewing/KeyboardType" #define SCIM_CHEWING_SELECTION_KEYS_NUM_DEF 9 static int _selection_keys_num; #include #include #include "scim_chewing_imengine.h" #include "scim_chewing_config_entry.h" #include using namespace scim; static IMEngineFactoryPointer _scim_chewing_factory(0); static ConfigPointer _scim_config(0); static Property _chieng_property(SCIM_PROP_CHI_ENG_MODE, ""); static Property _letter_property(SCIM_PROP_LETTER, ""); static Property _kbtype_property(SCIM_PROP_KBTYPE, ""); //static Property _punct_property (SCIM_PROP_PUNCT, _("Full/Half Punct")); extern "C" { void scim_module_init() { bindtextdomain(GETTEXT_PACKAGE, SCIM_CHEWING_LOCALEDIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); } void scim_module_exit() { _scim_config.reset(); } unsigned int scim_imengine_module_init(const ConfigPointer & config) { _chieng_property.set_tip(_("The status of the current input method. " "Click to change it.")); _chieng_property.set_label(_("Eng")); _letter_property.set_label(_("Half")); _kbtype_property.set_label(_("Default")); _scim_config = config; return 1; } IMEngineFactoryPointer scim_imengine_module_create_factory(uint32 engine) { if (engine != 0) return IMEngineFactoryPointer(0); if (_scim_chewing_factory.null()) { ChewingIMEngineFactory *factory = new ChewingIMEngineFactory(_scim_config); if (factory && factory->valid()) _scim_chewing_factory = factory; else delete factory; } return _scim_chewing_factory; } /* extern "C" */ } /** * Implementation of ChewingIMEngineFactory. */ ChewingIMEngineFactory::ChewingIMEngineFactory(const ConfigPointer & config) : m_config(config), m_valid(false) { reload_config(config); set_languages("zh_TW,zh_HK,zh_SG"); m_valid = init(); m_reload_signal_connection = m_config->signal_connect_reload(slot(this, &ChewingIMEngineFactory::reload_config)); } bool ChewingIMEngineFactory::init() { return true; } static const char *chewing_preedit_bgcolor[] = { SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_1, SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_2, SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_3, SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_4, SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_5 }; void ChewingIMEngineFactory::reload_config(const ConfigPointer & scim_config) { String str; SCIM_DEBUG_IMENGINE(2) << "ReloadConfig\n"; // Load Chi/Eng mode keys SCIM_DEBUG_IMENGINE(2) << "Load input mode\n"; m_input_mode = m_config->read(String(SCIM_CONFIG_IMENGINE_CHEWING_CHI_ENG_MODE), String("Chi")); // Load keyboard type SCIM_DEBUG_IMENGINE(2) << "Load Chi/Eng mode keys\n"; str = m_config->read(String(SCIM_CONFIG_IMENGINE_CHEWING_CHI_ENG_KEY), String("Shift+Shift_L+KeyRelease") + String("Shift+Shift_R+KeyRelease")); scim_string_to_key_list(m_chi_eng_keys, str); // Load input mode SCIM_DEBUG_IMENGINE(2) << "Load keyboard type\n"; m_KeyboardType = m_config->read(String(SCIM_CONFIG_IMENGINE_CHEWING_USER_KB_TYPE), String("KB_DEFAULT")); // SCIM_CONFIG_IMENGINE_CHEWING_USER_SELECTION_KEYS m_selection_keys = m_config->read(String(SCIM_CONFIG_IMENGINE_CHEWING_USER_SELECTION_KEYS), String(SCIM_CONFIG_IMENGINE_CHEWING_SELECTION_KEYS)); // SCIM_CHEWING_SELECTION_KEYS_NUM m_selection_keys_num = _selection_keys_num = m_config->read(String(SCIM_CHEWING_SELECTION_KEYS_NUM), 9); // SCIM_CONFIG_IMENGINE_CHEWING_ADD_PHRASE_FORWARD m_add_phrase_forward = m_config->read(String(SCIM_CONFIG_IMENGINE_CHEWING_ADD_PHRASE_FORWARD), false); // SCIM_CONFIG_IMENGINE_CHEWING_PHRASE_CHOICE_REARWARD m_phrase_choice_rearward = m_config->read(String(SCIM_CONFIG_IMENGINE_CHEWING_PHRASE_CHOICE_REARWARD), true); // SCIM_CONFIG_IMENGINE_CHEWING_AUTO_SHIFT_CURSOR m_auto_shift_cursor = m_config->read(String(SCIM_CONFIG_IMENGINE_CHEWING_AUTO_SHIFT_CURSOR), true); // SCIM_CONFIG_IMENGINE_CHEWING_ESC_CLEAN_ALL_BUFFER m_esc_clean_all_buffer = m_config->read(String(SCIM_CONFIG_IMENGINE_CHEWING_ESC_CLEAN_ALL_BUFFER), false); // SCIM_CONFIG_IMENGINE_CHEWING_SPACE_AS_SELECTION m_space_as_selection = m_config->read(String(SCIM_CONFIG_IMENGINE_CHEWING_SPACE_AS_SELECTION), true); // SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_ for (int i = 0; i < SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_NUM; i++) { int red, green, blue; char bgcolor_str[64]; String str; sprintf(bgcolor_str, SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_ "_%d", i + 1); str = m_config->read(String(bgcolor_str), String(chewing_preedit_bgcolor[i])); sscanf(str.c_str(), "#%02X%02X%02X", &red, &green, &blue); m_preedit_bgcolor[i] = SCIM_RGB_COLOR(red, green, blue); } } ChewingIMEngineFactory::~ChewingIMEngineFactory() { m_reload_signal_connection.disconnect(); } WideString ChewingIMEngineFactory::get_name() const { return utf8_mbstowcs(_("Chewing")); } String ChewingIMEngineFactory::get_uuid() const { return String("fcff66b6-4d3e-4cf2-833c-01ef66ac6025"); } String ChewingIMEngineFactory::get_icon_file() const { return String(SCIM_CHEWING_ICON_FILE); } WideString ChewingIMEngineFactory::get_authors() const { return utf8_mbstowcs(_("Chewing core team ")); } WideString ChewingIMEngineFactory::get_credits() const { return WideString(); } WideString ChewingIMEngineFactory::get_help() const { String help; String chi_eng_mode_switch; scim_key_list_to_string(chi_eng_mode_switch, m_chi_eng_keys); help = String(_("Hot Keys:")) + String("\n\n ") + chi_eng_mode_switch + String(":\n") + String(_(" Switch between English/Chinese mode.")) + String(_("\n\n Space:\n" " Use space key to select candidate phrases." "\n\n Tab:\n" " Use tab key to dispart or connect a phrase." "\n\n Ctrl + [number]:\n" " Use Ctrl + number key to add a user-defined phrase.\n" " (Here number stands for the length of the user-defined phrase.)" "\n\n Ctrl + 0:\n" " Use Ctrl + 0 to specify symbolic input." "\n\n j / k:\n" " While selecting candidate phrases, it could invoke \n" " switching between the previous and the next one.")); return utf8_mbstowcs(help); } IMEngineInstancePointer ChewingIMEngineFactory::create_instance( const String & encoding, int id) { return new ChewingIMEngineInstance(this, encoding, id); } bool ChewingIMEngineFactory::validate_encoding(const String & encoding) const { return IMEngineFactoryBase::validate_encoding(encoding); } bool ChewingIMEngineFactory::validate_locale(const String & locale) const { return IMEngineFactoryBase::validate_locale(locale); } /** * Implementation of ChewingIMEngineInstance */ ChewingIMEngineInstance::ChewingIMEngineInstance( ChewingIMEngineFactory *factory, const String & encoding, int id) : IMEngineInstanceBase(factory, encoding, id), m_factory(factory) { SCIM_DEBUG_IMENGINE(2) << "Create IMEngineInstance\n"; ctx = chewing_new(); reload_config(m_factory->m_config); m_lookup_table.init(m_factory->m_selection_keys, m_factory->m_selection_keys_num); m_reload_signal_connection = m_factory->m_config->signal_connect_reload(slot(this, &ChewingIMEngineInstance::reload_config)); } void ChewingIMEngineInstance::reload_config(const ConfigPointer & scim_config) { SCIM_DEBUG_IMENGINE(2) << "IMEngine Instance ReloadConfig\n"; // Reset all data. reset(); chewing_set_candPerPage(ctx, m_factory->m_selection_keys_num); chewing_set_maxChiSymbolLen(ctx, 16); // SCIM_CONFIG_IMENGINE_CHEWING_ADD_PHRASE_FORWARD chewing_set_addPhraseDirection(ctx, m_factory->m_add_phrase_forward ? 0 : 1); // SCIM_CONFIG_IMENGINE_CHEWING_PHRASE_CHOICE_REARWARD chewing_set_phraseChoiceRearward(ctx, m_factory->m_phrase_choice_rearward ? 1 : 0); // SCIM_CONFIG_IMENGINE_CHEWING_AUTO_SHIFT_CURSOR chewing_set_autoShiftCur(ctx, m_factory->m_auto_shift_cursor ? 1 : 0); // SCIM_CONFIG_IMENGINE_CHEWING_SPACE_AS_SELECTION chewing_set_spaceAsSelection(ctx, m_factory->m_space_as_selection ? 1 : 0); // SCIM_CONFIG_IMENGINE_CHEWING_ESC_CLEAN_ALL_BUFFER chewing_set_escCleanAllBuf(ctx, m_factory->m_esc_clean_all_buffer ? 1 : 0); } ChewingIMEngineInstance::~ChewingIMEngineInstance() { chewing_delete(ctx); m_reload_signal_connection.disconnect(); } bool ChewingIMEngineInstance::process_key_event(const KeyEvent & rawkey) { SCIM_DEBUG_IMENGINE(2) << "Process Key Event\n"; KeyEvent key = rawkey.map_to_layout(SCIM_KEYBOARD_Default); if (match_key_event(m_factory->m_chi_eng_keys, key)) { m_prev_key = key; trigger_property(SCIM_PROP_CHI_ENG_MODE); SCIM_DEBUG_IMENGINE(2) << "Match Chi/Eng Key, End Process\n"; return true; } m_prev_key = key; /* * This is a workaround against the known issue in OpenOffice with * GTK+ im module hanlding key pressed/released events. */ if (key.is_key_release()) { SCIM_DEBUG_IMENGINE(2) << "Key Release, End Process Key\n"; return false; } if (key.mask == 0) { switch (key.code) { case SCIM_KEY_Left: chewing_handle_Left(ctx); break; case SCIM_KEY_Right: chewing_handle_Right(ctx); break; case SCIM_KEY_Up: chewing_handle_Up(ctx); break; case SCIM_KEY_Down: chewing_handle_Down(ctx); break; case SCIM_KEY_space: chewing_handle_Space(ctx); break; case SCIM_KEY_Return: chewing_handle_Enter(ctx); break; case SCIM_KEY_BackSpace: chewing_handle_Backspace(ctx); break; case SCIM_KEY_Escape: chewing_handle_Esc(ctx); break; case SCIM_KEY_Delete: chewing_handle_Del(ctx); break; case SCIM_KEY_Home: chewing_handle_Home(ctx); break; case SCIM_KEY_End: chewing_handle_End(ctx); break; case SCIM_KEY_Tab: chewing_handle_Tab(ctx); break; case SCIM_KEY_Caps_Lock: chewing_handle_Capslock(ctx); break; case SCIM_KEY_Page_Up: chewing_handle_PageUp(ctx); break; case SCIM_KEY_Page_Down: chewing_handle_PageDown(ctx); break; case SCIM_KEY_KP_Enter: chewing_handle_Enter(ctx); break; case SCIM_KEY_Shift_L: case SCIM_KEY_Shift_R: case SCIM_KEY_Control_L: case SCIM_KEY_Control_R: case SCIM_KEY_Alt_L: case SCIM_KEY_Alt_R: SCIM_DEBUG_IMENGINE(2) << "Unused keys, End Process Key\n"; return true; case SCIM_KEY_KP_0: case SCIM_KEY_KP_1: case SCIM_KEY_KP_2: case SCIM_KEY_KP_3: case SCIM_KEY_KP_4: case SCIM_KEY_KP_5: case SCIM_KEY_KP_6: case SCIM_KEY_KP_7: case SCIM_KEY_KP_8: case SCIM_KEY_KP_9: case SCIM_KEY_KP_Decimal: case SCIM_KEY_KP_Add: case SCIM_KEY_KP_Subtract: case SCIM_KEY_KP_Multiply: case SCIM_KEY_KP_Divide: chewing_handle_Numlock(ctx, '0' + key.code - SCIM_KEY_KP_0); break; case SCIM_KEY_F1: case SCIM_KEY_F2: case SCIM_KEY_F3: case SCIM_KEY_F4: case SCIM_KEY_F5: case SCIM_KEY_F6: case SCIM_KEY_F7: case SCIM_KEY_F8: case SCIM_KEY_F9: case SCIM_KEY_F10: case SCIM_KEY_F11: case SCIM_KEY_F12: case SCIM_KEY_F13: case SCIM_KEY_F14: case SCIM_KEY_F15: case SCIM_KEY_F16: case SCIM_KEY_F17: case SCIM_KEY_F18: case SCIM_KEY_F19: SCIM_DEBUG_IMENGINE(2) << "Release function keys.\n"; return false; default: SCIM_DEBUG_IMENGINE(2) << "Begin OnKeyDefault\n"; chewing_handle_Default(ctx, key.get_ascii_code()); SCIM_DEBUG_IMENGINE(2) << "End OnKeyDefault\n"; break; } } else if (key.mask == SCIM_KEY_ShiftMask) { switch (key.code) { case SCIM_KEY_Left: chewing_handle_ShiftLeft(ctx); break; case SCIM_KEY_Right: chewing_handle_ShiftRight(ctx); break; case SCIM_KEY_space: chewing_handle_ShiftSpace(ctx); chewing_set_ShapeMode(ctx, !chewing_get_ShapeMode(ctx)); refresh_letter_property(); break; /* Workaround with shift */ case SCIM_KEY_Home: case SCIM_KEY_Page_Up: case SCIM_KEY_Page_Down: case SCIM_KEY_End: case SCIM_KEY_Begin: case SCIM_KEY_Insert: case SCIM_KEY_Delete: break; default: chewing_handle_Default(ctx, key.get_ascii_code()); break; } } else if (key.mask == SCIM_KEY_ControlMask) { if (key.code <= SCIM_KEY_9 && key.code >= SCIM_KEY_0) { chewing_handle_CtrlNum(ctx, key.get_ascii_code()); } else if (key.code == SCIM_KEY_v || key.code == SCIM_KEY_V) { chewing_handle_Right(ctx); } else { // chewing_handle_CtrlOption( ctx, key.get_ascii_code() ); return false; } } else { return false; } have_input = true; SCIM_DEBUG_IMENGINE(2) << "End Process Key\n"; return commit(ctx); } void ChewingIMEngineInstance::move_preedit_caret(unsigned int pos) { } void ChewingIMEngineInstance::select_candidate(unsigned int index) { chewing_handle_Default(ctx, '1' + index); commit(ctx); } void ChewingIMEngineInstance::update_lookup_table_page_size( unsigned int page_size) { chewing_set_candPerPage(ctx, page_size); m_lookup_table.set_page_size(page_size); } void ChewingIMEngineInstance::lookup_table_page_up() { chewing_handle_Space(ctx); commit(ctx); } void ChewingIMEngineInstance::lookup_table_page_down() { chewing_handle_Space(ctx); commit(ctx); } void ChewingIMEngineInstance::reset() { chewing_Reset(ctx); /* Configure Keyboard Type */ chewing_set_KBType(ctx, chewing_KBStr2Num((char *) m_factory->m_KeyboardType.c_str())); /* Configure Chinese/English Input Mode */ int chieng_mode_flag; if (m_factory->m_input_mode == "Chi") chieng_mode_flag = 1; else chieng_mode_flag = 0; chewing_set_ChiEngMode(ctx, chieng_mode_flag); /* Configure selection keys definition */ int i = 0; int *selkey = new int[m_factory->m_selection_keys_num]; for (; m_factory->m_selection_keys[i] && i < m_factory->m_selection_keys_num; i++) { selkey[i] = m_factory->m_selection_keys[i]; } chewing_set_selKey(ctx, selkey, m_factory->m_selection_keys_num); m_lookup_table.init(m_factory->m_selection_keys, m_factory->m_selection_keys_num); delete[]selkey; /* Re-focus to clear preedit, to avoid gedit crash when select-all. */ focus_out(); focus_in(); } void ChewingIMEngineInstance::focus_in() { SCIM_DEBUG_IMENGINE(2) << "Focus In\n"; initialize_all_properties(); } void ChewingIMEngineInstance::focus_out() { SCIM_DEBUG_IMENGINE(2) << "Focus Out\n"; if (have_input == true) { chewing_handle_Enter(ctx); commit(ctx); chewing_handle_Esc(ctx); have_input = false; } } void ChewingIMEngineInstance::trigger_property(const String & property) { if (property == SCIM_PROP_CHI_ENG_MODE) { commit(ctx); chewing_set_ChiEngMode(ctx, !chewing_get_ChiEngMode(ctx)); } else if (property == SCIM_PROP_LETTER) { chewing_set_ShapeMode(ctx, !chewing_get_ShapeMode(ctx)); } else if (property == SCIM_PROP_KBTYPE) { chewing_set_KBType(ctx, chewing_get_KBType(ctx) + 1); } refresh_all_properties(); } bool ChewingIMEngineInstance::commit(ChewingContext *ctx) { AttributeList attr; SCIM_DEBUG_IMENGINE(2) << "IMEngine Instance Commit\n"; // commit string if (chewing_commit_Check(ctx)) { char *str = chewing_commit_String(ctx); if (str) { commit_string(utf8_mbstowcs(str)); chewing_free(str); } } // preedit string WideString preedit_string; if (chewing_buffer_Check(ctx)) { char *chibuf = chewing_buffer_String(ctx); if (chibuf) { preedit_string = utf8_mbstowcs(chibuf); chewing_free(chibuf); } } const char *zuin_str = chewing_bopomofo_String_static(ctx); if (zuin_str) { preedit_string += utf8_mbstowcs(zuin_str); } chewing_interval_Enumerate(ctx); int interval_count = 0; while (chewing_interval_hasNext(ctx)) { IntervalType it; chewing_interval_Get(ctx, &it); int len = it.to - it.from; if (len > 1) { attr.push_back(Attribute(it.from, len, SCIM_ATTR_DECORATE, SCIM_ATTR_DECORATE_UNDERLINE)); attr.push_back(Attribute(it.from, len, SCIM_ATTR_BACKGROUND, m_factory->m_preedit_bgcolor[interval_count % SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_NUM])); } ++interval_count; } // cursor decoration int current_cursor = chewing_cursor_Current(ctx); if (!chewing_bopomofo_Check(ctx)) { attr.push_back(Attribute(current_cursor, 1, SCIM_ATTR_DECORATE, SCIM_ATTR_DECORATE_REVERSE)); } // update display update_preedit_string(preedit_string, attr); update_preedit_caret(current_cursor); // show preedit string if (preedit_string.empty()) { hide_preedit_string(); } else { show_preedit_string(); } // show lookup table if (chewing_cand_CheckDone(ctx)) return true; int total_pages = chewing_cand_TotalPage(ctx); if (total_pages != 0) { m_lookup_table.update(ctx); show_lookup_table(); int choice_per_page = chewing_cand_ChoicePerPage(ctx); if (chewing_cand_CurrentPage(ctx) < total_pages) m_lookup_table.set_page_size(choice_per_page); else m_lookup_table.set_page_size(chewing_cand_TotalChoice(ctx) % choice_per_page); update_lookup_table(m_lookup_table); } else { hide_lookup_table(); } // show aux string if (chewing_aux_Check(ctx)) { char *aux_str = chewing_aux_String(ctx); if (aux_str) { update_aux_string(utf8_mbstowcs(aux_str)); chewing_free(aux_str); show_aux_string(); } } else { hide_aux_string(); } if (chewing_keystroke_CheckAbsorb(ctx)) return true; if (chewing_keystroke_CheckIgnore(ctx)) return false; return true; } bool ChewingIMEngineInstance::match_key_event(const KeyEventList & keylist, const KeyEvent & key) { KeyEventList::const_iterator kit; for (kit = keylist.begin(); kit != keylist.end(); ++kit) { if (key.code == kit->code && key.mask == kit->mask) if (!(key.mask & SCIM_KEY_ReleaseMask) || m_prev_key.code == key.code) return true; } return false; } void ChewingIMEngineInstance::initialize_all_properties() { PropertyList proplist; proplist.push_back(_chieng_property); proplist.push_back(_letter_property); proplist.push_back(_kbtype_property); register_properties(proplist); refresh_all_properties(); } void ChewingIMEngineInstance::refresh_all_properties() { refresh_chieng_property(); refresh_letter_property(); refresh_kbtype_property(); } void ChewingIMEngineInstance::refresh_chieng_property() { if (chewing_get_ChiEngMode(ctx) != CHINESE_MODE) _chieng_property.set_label(_("Eng")); else _chieng_property.set_label(_("Chi")); update_property(_chieng_property); } void ChewingIMEngineInstance::refresh_kbtype_property() { /* look forward to be evoluted into drop-down list */ char *s = chewing_get_KBString(ctx); if (!strcmp(s, "KB_DEFAULT")) _kbtype_property.set_label(_("Default")); else if (!strcmp(s, "KB_HSU")) _kbtype_property.set_label(_("Hsu's")); else if (!strcmp(s, "KB_IBM")) _kbtype_property.set_label(_("IBM")); else if (!strcmp(s, "KB_GIN_YIEH")) _kbtype_property.set_label(_("Gin-Yieh")); else if (!strcmp(s, "KB_ET")) _kbtype_property.set_label(_("ETen")); else if (!strcmp(s, "KB_ET26")) _kbtype_property.set_label(_("ETen 26-key")); else if (!strcmp(s, "KB_DVORAK")) _kbtype_property.set_label(_("Dvorak")); else if (!strcmp(s, "KB_DVORAK_HSU")) _kbtype_property.set_label(_("Dvorak Hsu's")); else if (!strcmp(s, "KB_HANYU_PINYIN")) _kbtype_property.set_label(_("Han-Yu Pinyin")); else if (!strcmp(s, "KB_THL_PINYIN")) _kbtype_property.set_label(_("THL Pinyin")); else if (!strcmp(s, "KB_MPS2_PINYIN")) _kbtype_property.set_label(_("MPS2 Pinyin")); else _kbtype_property.set_label(_("Default")); chewing_free(s); update_property(_kbtype_property); } void ChewingIMEngineInstance::refresh_letter_property() { if (chewing_get_ShapeMode(ctx) != FULLSHAPE_MODE) _letter_property.set_label(_("Half")); else _letter_property.set_label(_("Full")); update_property(_letter_property); } ChewingLookupTable::ChewingLookupTable() : LookupTable(_selection_keys_num) { } ChewingLookupTable::~ChewingLookupTable() { } WideString ChewingLookupTable::get_candidate(int index) const { if (index == 0) chewing_cand_Enumerate(ctx); WideString converted_string; if (chewing_cand_hasNext(ctx)) { char *str = chewing_cand_String(ctx); if (str) { converted_string = utf8_mbstowcs(str); chewing_free(str); } } return converted_string; } AttributeList ChewingLookupTable::get_attributes(int index) const { return AttributeList(); } unsigned int ChewingLookupTable::number_of_candidates() const { return chewing_cand_TotalChoice(ctx); } void ChewingLookupTable::clear() { } void ChewingLookupTable::init(String selection_keys, int selection_keys_num) { std::vector < WideString > labels; SCIM_DEBUG_IMENGINE(2) << "LookupTable Init\n"; char buf[2] = { 0, 0 }; for (int i = 0; i < selection_keys_num; ++i) { buf[0] = selection_keys[i]; labels.push_back(utf8_mbstowcs(buf)); } set_candidate_labels(labels); } void ChewingLookupTable::update(ChewingContext *ctx) { this->ctx = ctx; } scim-chewing-0.5.1/src/scim_chewing_imengine.h000066400000000000000000000066101271526764000213610ustar00rootroot00000000000000/* * SCIM-chewing - * Intelligent Chinese Phonetic IM Engine for SCIM. * * Copyright (c) 2004, 2005, 2006 * SCIM-chewing Developers. See ChangeLog for details. * * See the file "COPYING" for information on usage and redistribution * of this file. */ #ifndef SCIM_CHEWING_H # define SCIM_CHEWING_H using namespace scim; class ChewingLookupTable : public LookupTable { public: ChewingLookupTable(); virtual ~ ChewingLookupTable(); virtual WideString get_candidate(int index) const; virtual AttributeList get_attributes(int index) const; virtual unsigned int number_of_candidates() const; virtual void clear(); void init(String s, int num); void update(ChewingContext *ctx); private: ChewingContext *ctx; }; class ChewingIMEngineFactory : public IMEngineFactoryBase { public: ChewingIMEngineFactory(const ConfigPointer & config); virtual ~ChewingIMEngineFactory(); virtual WideString get_name() const; virtual String get_uuid() const; virtual String get_icon_file() const; virtual WideString get_authors() const; virtual WideString get_credits() const; virtual WideString get_help() const; virtual bool validate_encoding(const String & encoding) const; virtual bool validate_locale(const String & locale) const; virtual IMEngineInstancePointer create_instance(const String & encoding, int id = -1); bool valid() const { return m_valid; } ConfigPointer m_config; private: bool init(); bool m_valid; void reload_config(const ConfigPointer & scim_config); Connection m_reload_signal_connection; KeyEventList m_chi_eng_keys; String m_KeyboardType; int m_PinYinType; String m_ExternPinYinPath; String m_selection_keys; String m_input_mode; int m_selection_keys_num; bool m_add_phrase_forward; bool m_phrase_choice_rearward; bool m_auto_shift_cursor; bool m_space_as_selection; bool m_esc_clean_all_buffer; /* A series of background colors used in preedit area */ unsigned int m_preedit_bgcolor[5]; friend class ChewingIMEngineInstance; }; class ChewingIMEngineInstance : public IMEngineInstanceBase { public: ChewingIMEngineInstance(ChewingIMEngineFactory *factory, const String & encoding, int id = -1); virtual ~ChewingIMEngineInstance(); virtual bool process_key_event(const KeyEvent & key); virtual void move_preedit_caret(unsigned int pos); virtual void select_candidate(unsigned int index); virtual void update_lookup_table_page_size(unsigned int page_size); virtual void lookup_table_page_up(); virtual void lookup_table_page_down(); virtual void reset(); virtual void focus_in(); virtual void focus_out(); virtual void trigger_property(const String & property); private: bool commit(ChewingContext *ctx); void reload_config(const ConfigPointer & scim_config); bool match_key_event(const KeyEventList & keylist, const KeyEvent & key); void initialize_all_properties(); void refresh_all_properties(); void refresh_chieng_property(); void refresh_letter_property(); void refresh_kbtype_property(); Connection m_reload_signal_connection; KeyEvent m_prev_key; ChewingIMEngineFactory *m_factory; ChewingLookupTable m_lookup_table; ChewingContext *ctx; bool have_input; }; #endif scim-chewing-0.5.1/src/scim_chewing_imengine_setup.cpp000066400000000000000000001213041271526764000231320ustar00rootroot00000000000000/** @file scim_chewing_imengine_setup.cpp * implementation of SetupUI Module of chewing imengine module. */ /* * SCIM-chewing - * Intelligent Chinese Phonetic IM Engine for SCIM. * * Copyright (c) 2005, 2006, 2008, 2012 * SCIM-chewing Developers. See ChangeLog for details. * * See the file "COPYING" for information on usage and redistribution * of this file. */ #define Uses_SCIM_CONFIG_BASE #include #ifdef HAVE_CONFIG_H # include #endif #ifdef HAVE_GETTEXT # include # define _(String) dgettext(GETTEXT_PACKAGE,String) # define N_(String) (String) #else # define _(String) (String) # define N_(String) (String) # define bindtextdomain(Package,Directory) # define textdomain(domain) # define bind_textdomain_codeset(domain,codeset) #endif #include #include #include #include "scim_chewing_config_entry.h" #include "scim_color_button.h" #include #if !GTK_CHECK_VERSION(2, 12, 0) # define SCIM_TABLES_USE_GTK_TOOLTIPS #endif #if !GTK_CHECK_VERSION(2, 22, 0) # define SCIM_TABLES_USE_GTK_DIALOG_SEPARATOR #endif #if GTK_CHECK_VERSION(2, 14, 0) # define SCIM_TABLES_USE_GTK_DIALOG_GET_CONTENT_AREA # define SCIM_TABLES_USE_GTK_DIALOG_GET_ACTION_AREA #endif #if GTK_CHECK_VERSION(2, 18, 0) # define SCIM_TABLES_USE_GTK_WIDGET_GET_CAN_DEFAULT #endif #if GTK_CHECK_VERSION(3, 0, 0) # define SCIM_TABLES_USE_GTK_BOX # define SCIM_TABLES_USE_GTK_FILE_CHOOSER #endif using namespace scim; #define scim_module_init chewing_imengine_setup_LTX_scim_module_init #define scim_module_exit chewing_imengine_setup_LTX_scim_module_exit #define scim_setup_module_create_ui chewing_imengine_setup_LTX_scim_setup_module_create_ui #define scim_setup_module_get_category chewing_imengine_setup_LTX_scim_setup_module_get_category #define scim_setup_module_get_name chewing_imengine_setup_LTX_scim_setup_module_get_name #define scim_setup_module_get_description chewing_imengine_setup_LTX_scim_setup_module_get_description #define scim_setup_module_load_config chewing_imengine_setup_LTX_scim_setup_module_load_config #define scim_setup_module_save_config chewing_imengine_setup_LTX_scim_setup_module_save_config #define scim_setup_module_query_changed chewing_imengine_setup_LTX_scim_setup_module_query_changed static GtkWidget *create_setup_window(); static void load_config(const ConfigPointer & config); static void save_config(const ConfigPointer & config); static bool query_changed(); // Module Interface. extern "C" { void scim_module_init() { bindtextdomain(GETTEXT_PACKAGE, SCIM_CHEWING_LOCALEDIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); } void scim_module_exit() { } GtkWidget *scim_setup_module_create_ui() { return create_setup_window(); } String scim_setup_module_get_category() { return String("IMEngine"); } String scim_setup_module_get_name() { return String(_("Chewing")); } String scim_setup_module_get_description() { return String(_("An Intelligent Chinese Phonetic IMEngine Module.")); } void scim_setup_module_load_config(const ConfigPointer & config) { load_config(config); } void scim_setup_module_save_config(const ConfigPointer & config) { save_config(config); } bool scim_setup_module_query_changed() { return query_changed(); } } // extern "C" // Internal data structure struct KeyboardConfigData { const char *key; const char *label; const char *title; const char *tooltip; GtkWidget *entry; GtkWidget *button; String data; }; struct ColorConfigData { const char *fg_key; String fg_value; String fg_default_value; const char *bg_key; String bg_value; String bg_default_valuel; const char *label; const char *title; void *widget; bool changed; }; // Internal data declaration. // static bool __config_use_capslock = true; static bool __config_add_phrase_forward = false; static bool __config_phrase_choice_rearward = true; static bool __config_auto_shift_cursor = true; static bool __config_esc_clean_all_buffer = false; static bool __config_space_as_selection = true; // static bool __config_show_candidate_comment= true; static String __config_kb_type_data; static String __config_kb_type_data_translated; static String __config_selKey_type_data; static String __config_selKey_num_data; static String __config_chieng_mode_data; static bool __have_changed = false; // static GtkWidget *__widget_use_capslock = 0; static GtkWidget *__widget_add_phrase_forward = 0; static GtkWidget *__widget_phrase_choice_rearward = 0; static GtkWidget *__widget_auto_shift_cursor = 0; static GtkWidget *__widget_esc_clean_all_buffer = 0; static GtkWidget *__widget_space_as_selection = 0; static GtkWidget *__widget_kb_type = 0; static GtkWidget *__radio_builtin = 0; static GtkWidget *__radio_external = 0; static GtkWidget *__file_btn = 0; static GList *kb_type_list = 0; static GtkWidget *__widget_selKey_type = 0; static GtkWidget *__widget_selKey_num = 0; static GtkWidget *__widget_chieng_mode = 0; static GList *selKey_type_list = 0; static GList *selKey_num_list = 0; static GList *chieng_mode_list = 0; // static GtkWidget *__widget_show_candidate_comment= 0; #ifdef SCIM_TABLES_USE_GTK_TOOLTIPS static GtkTooltips *__widget_tooltips = 0; #endif static KeyboardConfigData __config_keyboards[] = { { // key SCIM_CONFIG_IMENGINE_CHEWING_TRIGGER_KEY, // label _("Trigger keys:"), // title _("Select trigger keys"), // tooltip _("The key events to switch Chewing input mode. " "Click on the button on the right to edit it."), // entry NULL, // button NULL, // data "Control+space" }, { // key SCIM_CONFIG_IMENGINE_CHEWING_CHI_ENG_KEY, // label _("Chewing CHI/ENG keys:"), // title _("Select CHI/ENG keys"), // tooltip _("The key events to switch English and Chinese mode. " "Click on the button on the right to edit it."), // entry NULL, // button NULL, // data "Shift+Shift_L+KeyRelease"}, { // key NULL, // label NULL, // title NULL, // tooltip NULL, // entry NULL, // button NULL, // data "" }, }; /* XXX: It should be a pair of fg/bg colors */ #define FG_COLOR_DEFAULT "#000000" #define FG_COLOR "" static ColorConfigData config_color_common[] = { { FG_COLOR, FG_COLOR_DEFAULT, FG_COLOR_DEFAULT, SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_ "_1", SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_1, SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_1, _("Color #1"), _("The color of preediting text"), NULL, false }, { FG_COLOR, FG_COLOR_DEFAULT, FG_COLOR_DEFAULT, SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_ "_2", SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_2, SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_2, _("Color #2"), _("The color of preediting text"), NULL, false }, { FG_COLOR, FG_COLOR_DEFAULT, FG_COLOR_DEFAULT, SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_ "_3", SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_3, SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_3, _("Color #3"), _("The color of preediting text"), NULL, false }, { FG_COLOR, FG_COLOR_DEFAULT, FG_COLOR_DEFAULT, SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_ "_4", SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_4, SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_4, _("Color #4"), _("The color of preediting text"), NULL, false }, { FG_COLOR, FG_COLOR_DEFAULT, FG_COLOR_DEFAULT, SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_ "_5", SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_5, SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_DEF_5, _("Color #5"), _("The color of preediting text"), NULL, false } }; // Declaration of internal functions. static void on_default_editable_changed(GtkEditable *editable, gpointer user_data); static void on_default_toggle_button_toggled(GtkToggleButton *togglebutton, gpointer user_data); static void on_default_key_selection_clicked(GtkButton * button, gpointer user_data); static GtkWidget *create_color_button(const char *config_key); static void on_color_button_changed(ScimChewingColorButton * button, gpointer user_data); static void setup_widget_value(); static GtkWidget *create_options_page(); static GtkWidget *create_keyboard_page(); // Function implementations. static GtkWidget *create_options_page() { GtkWidget *vbox; #ifdef SCIM_TABLES_USE_GTK_BOX vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); #else vbox = gtk_vbox_new(FALSE, 0); #endif gtk_widget_show(vbox); __widget_add_phrase_forward = gtk_check_button_new_with_mnemonic(_("Add _Phrase forward")); gtk_widget_show(__widget_add_phrase_forward); gtk_box_pack_start(GTK_BOX(vbox), __widget_add_phrase_forward, FALSE, FALSE, 4); gtk_container_set_border_width(GTK_CONTAINER(__widget_add_phrase_forward), 4); g_signal_connect((gpointer) __widget_add_phrase_forward, "toggled", G_CALLBACK(on_default_toggle_button_toggled), &__config_add_phrase_forward); const gchar *show_add_phrase_forward_tooltip = _("Whether to add Phrase forward or not."); #ifndef SCIM_TABLES_USE_GTK_TOOLTIPS gtk_widget_set_tooltip_text(__widget_add_phrase_forward, show_add_phrase_forward_tooltip); #else gtk_tooltips_set_tip(__widget_tooltips, __widget_add_phrase_forward, show_add_phrase_forward_tooltip, NULL); #endif __widget_phrase_choice_rearward = gtk_check_button_new_with_mnemonic(_("_Rearward phrase choice")); gtk_widget_show(__widget_phrase_choice_rearward); gtk_box_pack_start(GTK_BOX(vbox), __widget_phrase_choice_rearward, FALSE, FALSE, 4); gtk_container_set_border_width(GTK_CONTAINER(__widget_phrase_choice_rearward), 4); g_signal_connect((gpointer) __widget_phrase_choice_rearward, "toggled", G_CALLBACK(on_default_toggle_button_toggled), &__config_phrase_choice_rearward); const gchar *show_phrase_choice_rearward_tooltip = _("The behavior for phrase choice to be rearward or not."); #ifndef SCIM_TABLES_USE_GTK_TOOLTIPS gtk_widget_set_tooltip_text(__widget_phrase_choice_rearward, show_phrase_choice_rearward_tooltip); #else gtk_tooltips_set_tip(__widget_tooltips, __widget_phrase_choice_rearward, show_phrase_choice_rearward_tooltip, NULL); #endif __widget_auto_shift_cursor = gtk_check_button_new_with_mnemonic(_("_Automatically shift cursor")); gtk_widget_show(__widget_auto_shift_cursor); gtk_box_pack_start(GTK_BOX(vbox), __widget_auto_shift_cursor, FALSE, FALSE, 4); gtk_container_set_border_width(GTK_CONTAINER(__widget_auto_shift_cursor), 4); g_signal_connect((gpointer) __widget_auto_shift_cursor, "toggled", G_CALLBACK(on_default_toggle_button_toggled), &__config_auto_shift_cursor); const gchar *show_auto_shift_cursor_tooltip = ("Automatically shift cursor after selection."); #ifndef SCIM_TABLES_USE_GTK_TOOLTIPS gtk_widget_set_tooltip_text(__widget_auto_shift_cursor, show_auto_shift_cursor_tooltip); #else gtk_tooltips_set_tip(__widget_tooltips, __widget_auto_shift_cursor, show_auto_shift_cursor_tooltip, NULL); #endif __widget_esc_clean_all_buffer = gtk_check_button_new_with_mnemonic(_("_Esc key to clean all buffer")); gtk_widget_show(__widget_esc_clean_all_buffer); gtk_box_pack_start(GTK_BOX(vbox), __widget_esc_clean_all_buffer, FALSE, FALSE, 4); gtk_container_set_border_width(GTK_CONTAINER(__widget_esc_clean_all_buffer), 4); g_signal_connect((gpointer) __widget_esc_clean_all_buffer, "toggled", G_CALLBACK(on_default_toggle_button_toggled), &__config_esc_clean_all_buffer); const gchar *show_esc_clean_all_buffer_tooltip = _("Assign Esc key to clean all keyboard buffer or not."); #ifndef SCIM_TABLES_USE_GTK_TOOLTIPS gtk_widget_set_tooltip_text(__widget_esc_clean_all_buffer, show_esc_clean_all_buffer_tooltip); #else gtk_tooltips_set_tip(__widget_tooltips, __widget_esc_clean_all_buffer, show_esc_clean_all_buffer_tooltip, NULL); #endif __widget_space_as_selection = gtk_check_button_new_with_mnemonic(_("_SpaceKey as selection key")); gtk_widget_show(__widget_space_as_selection); gtk_box_pack_start(GTK_BOX(vbox), __widget_space_as_selection, FALSE, FALSE, 4); gtk_container_set_border_width(GTK_CONTAINER(__widget_space_as_selection), 4); g_signal_connect((gpointer) __widget_space_as_selection, "toggled", G_CALLBACK(on_default_toggle_button_toggled), &__config_space_as_selection); const gchar *show_space_as_selection_tooltip = _("Whether SpaceKey is used as selection key or not."); #ifndef SCIM_TABLES_USE_GTK_TOOLTIPS gtk_widget_set_tooltip_text(__widget_space_as_selection, show_space_as_selection_tooltip); #else gtk_tooltips_set_tip(__widget_tooltips, __widget_space_as_selection, show_space_as_selection_tooltip, NULL); #endif return vbox; } struct _builtin_keymap { const char *entry; String translated_name; } builtin_keymaps[] = { { "KB_DEFAULT", String(_("Default Keyboard")) }, { "KB_HSU", String(_("Hsu's Keyboard")) }, { "KB_IBM", String(_("IBM Keyboard")) }, { "KB_GIN_YEIH", String(_("Gin-Yieh Keyboard")) }, { "KB_ET", String(_("ETen Keyboard")) }, { "KB_ET26", String(_("ETen 26-key Keyboard")) }, { "KB_DVORAK", String(_("Dvorak Keyboard")) }, { "KB_DVORAK_HSU", String(_("Dvorak Keyboard with Hsu's support")) }, { "KB_DACHEN_CP26", String(_("DACHEN_CP26 Keyboard")) }, { "KB_HANYU_PINYIN", String(_("Han-Yu PinYin Keyboard")) }, { "KB_THL_PINYIN", String(_("Taiwan Huayu Luomapinyin Keyboard")) }, { "KB_MPS2_PINYIN", String(_("MPS2 PinYin Keyboard")) }, }; static const char *builtin_selectkeys[] = { SCIM_CONFIG_IMENGINE_CHEWING_SELECTION_KEYS, "asdfghjkl;", "asdfzxcv89", "asdfjkl789", "aoeuhtn789", "1234qweras", }; static const char *builtin_selectkeys_num[] = { "10", "9", "8", "7", "6", "5" }; static const struct _builtin_chieng_mode { const char *entry; const char *translated_name; } builtin_chieng_mode[] = { { "Chi", _("Chi") }, { "Eng", _("Eng") } }; static GtkWidget *create_keyboard_page() { GtkWidget *table; GtkWidget *label; table = gtk_table_new(6, 3, FALSE); gtk_widget_show(table); size_t i; // Create keyboard setting. for (i = 0; __config_keyboards[i].key; ++i) { label = gtk_label_new(NULL); gtk_label_set_text_with_mnemonic(GTK_LABEL(label), _(__config_keyboards[i].label)); gtk_widget_show(label); gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); gtk_misc_set_padding(GTK_MISC(label), 4, 0); gtk_table_attach(GTK_TABLE(table), label, 0, 1, i, i + 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 4, 4); __config_keyboards[i].entry = gtk_entry_new(); gtk_widget_show(__config_keyboards[i].entry); gtk_table_attach(GTK_TABLE(table), __config_keyboards[i].entry, 1, 2, i, i + 1, (GtkAttachOptions) (GTK_FILL | GTK_EXPAND), (GtkAttachOptions) (GTK_FILL), 4, 4); gtk_editable_set_editable(GTK_EDITABLE(__config_keyboards[i].entry), FALSE); __config_keyboards[i].button = gtk_button_new_with_label("..."); gtk_widget_show(__config_keyboards[i].button); gtk_table_attach(GTK_TABLE(table), __config_keyboards[i].button, 2, 3, i, i + 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 4, 4); gtk_label_set_mnemonic_widget(GTK_LABEL(label), __config_keyboards[i].button); } // keyboard: trigger keys for (i = 0; __config_keyboards[i].key; ++i) { g_signal_connect((gpointer) __config_keyboards[i].button, "clicked", G_CALLBACK(on_default_key_selection_clicked), &(__config_keyboards[i])); g_signal_connect((gpointer) __config_keyboards[i].entry, "changed", G_CALLBACK(on_default_editable_changed), &(__config_keyboards[i].data)); } for (i = 0; __config_keyboards[i].key; ++i) { #ifndef SCIM_TABLES_USE_GTK_TOOLTIPS gtk_widget_set_tooltip_text(__config_keyboards[i].entry, _(__config_keyboards[i].tooltip)); #else gtk_tooltips_set_tip(__widget_tooltips, __config_keyboards[i].entry, _(__config_keyboards[i].tooltip), NULL); #endif } #if GTK_CHECK_VERSION(2, 4, 0) __widget_chieng_mode = gtk_combo_box_text_new_with_entry(); #else // Setup chieng_mode combo box __widget_chieng_mode = gtk_combo_new(); #endif gtk_widget_show(__widget_chieng_mode); for (i = 0; i < (sizeof(builtin_chieng_mode) / sizeof(builtin_chieng_mode[0])); i++) { #if GTK_CHECK_VERSION(2, 4, 0) gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(__widget_chieng_mode), builtin_chieng_mode[i].translated_name); #else chieng_mode_list = g_list_append(chieng_mode_list, (void *) builtin_chieng_mode[i].translated_name); #endif } #if GTK_CHECK_VERSION(2, 4, 0) gtk_editable_set_editable(GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(__widget_chieng_mode))), FALSE); #else gtk_combo_set_popdown_strings(GTK_COMBO(__widget_chieng_mode), chieng_mode_list); g_list_free(chieng_mode_list); gtk_combo_set_use_arrows(GTK_COMBO(__widget_chieng_mode), TRUE); gtk_editable_set_editable(GTK_EDITABLE(GTK_ENTRY(GTK_COMBO(__widget_chieng_mode)->entry)), FALSE); #endif label = gtk_label_new(_("Initial trigger Chinese/English mode:")); gtk_widget_show(label); gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); gtk_misc_set_padding(GTK_MISC(label), 4, 0); gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 4, 4); gtk_table_attach(GTK_TABLE(table), __widget_chieng_mode, 1, 2, 2, 3, (GtkAttachOptions) (GTK_FILL | GTK_EXPAND), (GtkAttachOptions) (GTK_FILL), 4, 4); const gchar *show_chieng_mode_tooltip = _("Change the default Chinese/English mode on every trigger"); #ifndef SCIM_TABLES_USE_GTK_TOOLTIPS gtk_widget_set_tooltip_text(gtk_bin_get_child(GTK_BIN(__widget_chieng_mode)), show_chieng_mode_tooltip); #else gtk_tooltips_set_tip(__widget_tooltips, GTK_COMBO(__widget_chieng_mode)->entry, show_chieng_mode_tooltip, NULL); #endif g_signal_connect( #if GTK_CHECK_VERSION(2, 4, 0) G_OBJECT(gtk_bin_get_child(GTK_BIN(__widget_chieng_mode))), #else (gpointer) GTK_ENTRY(GTK_COMBO(__widget_chieng_mode)->entry), #endif "changed", G_CALLBACK(on_default_editable_changed), &(__config_chieng_mode_data)); #if GTK_CHECK_VERSION(2, 4, 0) __widget_selKey_num = gtk_combo_box_text_new_with_entry(); #else // Setup selKey_num combo box __widget_selKey_num = gtk_combo_new(); #endif gtk_widget_show(__widget_selKey_num); for (i = 0; i < (sizeof(builtin_selectkeys_num) / sizeof(builtin_selectkeys_num[0])); i++) { #if GTK_CHECK_VERSION(2, 4, 0) gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(__widget_selKey_num), builtin_selectkeys_num[i]); #else selKey_num_list = g_list_append(selKey_num_list, (void *) builtin_selectkeys_num[i]); #endif } #if GTK_CHECK_VERSION(2, 4, 0) gtk_editable_set_editable(GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(__widget_selKey_num))), FALSE); #else gtk_combo_set_popdown_strings(GTK_COMBO(__widget_selKey_num), selKey_num_list); g_list_free(selKey_num_list); gtk_combo_set_use_arrows(GTK_COMBO(__widget_selKey_num), TRUE); gtk_editable_set_editable(GTK_EDITABLE(GTK_ENTRY(GTK_COMBO(__widget_selKey_num)->entry)), FALSE); #endif label = gtk_label_new(_("Number of Selection Keys :")); gtk_widget_show(label); gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); gtk_misc_set_padding(GTK_MISC(label), 4, 0); gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 4, 4); gtk_table_attach(GTK_TABLE(table), __widget_selKey_num, 1, 2, 3, 4, (GtkAttachOptions) (GTK_FILL | GTK_EXPAND), (GtkAttachOptions) (GTK_FILL), 4, 4); const gchar *show_selKey_num_tooltip = _("Change the default number of selection keys"); #ifndef SCIM_TABLES_USE_GTK_TOOLTIPS gtk_widget_set_tooltip_text(gtk_bin_get_child(GTK_BIN(__widget_selKey_num)), show_selKey_num_tooltip); #else gtk_tooltips_set_tip(__widget_tooltips, GTK_COMBO(__widget_selKey_num)->entry, show_selKey_num_tooltip, NULL); #endif g_signal_connect( #if GTK_CHECK_VERSION(2, 4, 0) G_OBJECT(gtk_bin_get_child(GTK_BIN(__widget_selKey_num))), #else (gpointer) GTK_ENTRY(GTK_COMBO(__widget_selKey_num)->entry), #endif "changed", G_CALLBACK(on_default_editable_changed), &(__config_selKey_num_data)); #if GTK_CHECK_VERSION(2, 4, 0) __widget_selKey_type = gtk_combo_box_text_new_with_entry(); #else // Setup selKey combo box __widget_selKey_type = gtk_combo_new(); #endif gtk_widget_show(__widget_selKey_type); for (i = 0; i < (sizeof(builtin_selectkeys) / sizeof(builtin_selectkeys[0])); i++) { #if GTK_CHECK_VERSION(2, 4, 0) gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(__widget_selKey_type), builtin_selectkeys[i]); #else selKey_type_list = g_list_append(selKey_type_list, (void *) builtin_selectkeys[i]); #endif } #if GTK_CHECK_VERSION(2, 4, 0) gtk_editable_set_editable(GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(__widget_selKey_type))), FALSE); #else gtk_combo_set_popdown_strings(GTK_COMBO(__widget_selKey_type), selKey_type_list); g_list_free(selKey_type_list); gtk_combo_set_use_arrows(GTK_COMBO(__widget_selKey_type), TRUE); gtk_editable_set_editable(GTK_EDITABLE(GTK_ENTRY(GTK_COMBO(__widget_selKey_type)->entry)), FALSE); #endif label = gtk_label_new(_("Customized Selection Keys:")); gtk_widget_show(label); gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); gtk_misc_set_padding(GTK_MISC(label), 4, 0); gtk_table_attach(GTK_TABLE(table), label, 0, 1, 4, 5, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 4, 4); gtk_table_attach(GTK_TABLE(table), __widget_selKey_type, 1, 2, 4, 5, (GtkAttachOptions) (GTK_FILL | GTK_EXPAND), (GtkAttachOptions) (GTK_FILL), 4, 4); const gchar *show_selKey_type_tooltip = _("Change the default selection keys"); #ifndef SCIM_TABLES_USE_GTK_TOOLTIPS gtk_widget_set_tooltip_text(gtk_bin_get_child(GTK_BIN(__widget_selKey_type)), show_selKey_type_tooltip); #else gtk_tooltips_set_tip(__widget_tooltips, GTK_COMBO(__widget_selKey_type)->entry, show_selKey_type_tooltip, NULL); #endif g_signal_connect( #if GTK_CHECK_VERSION(2, 4, 0) G_OBJECT(gtk_bin_get_child(GTK_BIN(__widget_selKey_type))), #else (gpointer) GTK_ENTRY(GTK_COMBO(__widget_selKey_type)->entry), #endif "changed", G_CALLBACK(on_default_editable_changed), &(__config_selKey_type_data)); #if GTK_CHECK_VERSION(2, 4, 0) __widget_kb_type = gtk_combo_box_text_new_with_entry(); #else // Setup KB_TYPE combo box __widget_kb_type = gtk_combo_new(); #endif gtk_widget_show(__widget_kb_type); for (i = 0; i < (int) (sizeof(builtin_keymaps) / sizeof(_builtin_keymap)); i++) { #if GTK_CHECK_VERSION(2, 4, 0) gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(__widget_kb_type), builtin_keymaps[i].translated_name.c_str()); #else kb_type_list = g_list_append(kb_type_list, (void *) builtin_keymaps[i].translated_name.c_str()); #endif } #if GTK_CHECK_VERSION(2, 4, 0) gtk_editable_set_editable(GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(__widget_kb_type))), FALSE); #else gtk_combo_set_popdown_strings(GTK_COMBO(__widget_kb_type), kb_type_list); g_list_free(kb_type_list); gtk_combo_set_use_arrows(GTK_COMBO(__widget_kb_type), TRUE); gtk_editable_set_editable(GTK_EDITABLE(GTK_ENTRY(GTK_COMBO(__widget_kb_type)->entry)), FALSE); #endif label = gtk_label_new(_("Use keyboard type:")); gtk_widget_show(label); gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); gtk_misc_set_padding(GTK_MISC(label), 4, 0); gtk_table_attach(GTK_TABLE(table), label, 0, 1, 5, 6, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 4, 4); gtk_table_attach(GTK_TABLE(table), __widget_kb_type, 1, 2, 5, 6, (GtkAttachOptions) (GTK_FILL | GTK_EXPAND), (GtkAttachOptions) (GTK_FILL), 4, 4); const gchar *show_kb_type_tooltip = _("Change the default keyboard layout type"); #ifndef SCIM_TABLES_USE_GTK_TOOLTIPS gtk_widget_set_tooltip_text(gtk_bin_get_child(GTK_BIN(__widget_kb_type)), show_kb_type_tooltip); #else gtk_tooltips_set_tip(__widget_tooltips, GTK_COMBO(__widget_kb_type)->entry, show_kb_type_tooltip, NULL); #endif g_signal_connect( #if GTK_CHECK_VERSION(2, 4, 0) G_OBJECT(gtk_bin_get_child(GTK_BIN(__widget_kb_type))), #else (gpointer) GTK_ENTRY(GTK_COMBO(__widget_kb_type)->entry), #endif "changed", G_CALLBACK(on_default_editable_changed), &(__config_kb_type_data_translated)); return table; } static GtkWidget *create_color_button_page() { GtkWidget *widget; GtkWidget *hbox; GtkWidget *table; char color_button_name_string[64] = { 0 }; table = gtk_table_new(4, 5, FALSE); gtk_widget_show(table); for (int i = 0; i < SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_NUM; i++) { #ifdef SCIM_TABLES_USE_GTK_BOX hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); #else hbox = gtk_hbox_new(FALSE, 0); #endif gtk_widget_show(hbox); sprintf(color_button_name_string, SCIM_CONFIG_IMENGINE_CHEWING_PREEDIT_BGCOLOR_ "_%d", i + 1); widget = create_color_button(color_button_name_string); gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, FALSE, 0); gtk_table_attach(GTK_TABLE(table), hbox, 4, 5, i, i + 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 5, 5); } return table; } static GtkWidget *create_setup_window() { static GtkWidget *window = 0; if (!window) { GtkWidget *notebook; GtkWidget *label; GtkWidget *page; #ifdef SCIM_TABLES_USE_GTK_TOOLTIPS __widget_tooltips = gtk_tooltips_new(); #endif // Create the Notebook. notebook = gtk_notebook_new(); gtk_widget_show(notebook); // Create the first page. page = create_options_page(); gtk_container_add(GTK_CONTAINER(notebook), page); // Create the label for this note page. label = gtk_label_new(_("Options")); gtk_widget_show(label); gtk_notebook_set_tab_label(GTK_NOTEBOOK(notebook), gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), 0), label); // Create the second page. page = create_keyboard_page(); // Create the label for this note page. label = gtk_label_new(_("Keyboard")); gtk_widget_show(label); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), page, label); // Create the third page. page = create_color_button_page(); // Create the label for this note page. label = gtk_label_new(_("Decorative Color")); gtk_widget_show(label); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), page, label); window = notebook; setup_widget_value(); } return window; } void setup_widget_value() { if (__widget_add_phrase_forward) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(__widget_add_phrase_forward), __config_add_phrase_forward); } if (__widget_phrase_choice_rearward) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(__widget_phrase_choice_rearward), __config_phrase_choice_rearward); } if (__widget_auto_shift_cursor) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(__widget_auto_shift_cursor), __config_auto_shift_cursor); } if (__widget_space_as_selection) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(__widget_space_as_selection), __config_space_as_selection); } if (__widget_esc_clean_all_buffer) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(__widget_esc_clean_all_buffer), __config_esc_clean_all_buffer); } for (int i = 0; __config_keyboards[i].key; ++i) { if (__config_keyboards[i].entry) { gtk_entry_set_text(GTK_ENTRY(__config_keyboards[i].entry), __config_keyboards[i].data.c_str()); } } for (unsigned int i = 0; i < (sizeof(config_color_common) / sizeof((config_color_common)[0])); i++) { ColorConfigData & entry = config_color_common[i]; if (entry.widget) { scim_color_button_set_colors(SCIM_COLOR_BUTTON(entry.widget), entry.fg_value, entry.bg_value); } } /* KB_TYPE */ int index_keymap = (sizeof(builtin_keymaps) / sizeof(_builtin_keymap)) - 1; for (; index_keymap >= 0; index_keymap--) { if (__config_kb_type_data == builtin_keymaps[index_keymap].entry) { break; } } if (index_keymap < 0) index_keymap = 0; #if GTK_CHECK_VERSION(2, 4, 0) gtk_combo_box_set_active(GTK_COMBO_BOX(__widget_kb_type), index_keymap); #else gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(__widget_kb_type)->entry), builtin_keymaps[index_keymap].translated_name.c_str() ); #endif /* selKey */ int index_selectkeys = sizeof(builtin_selectkeys) / sizeof(builtin_selectkeys[0]) - 1; for (; index_selectkeys >= 0; index_selectkeys--) { if (__config_selKey_type_data == builtin_selectkeys[index_selectkeys]) { break; } } if (index_selectkeys < 0) index_selectkeys = 0; #if GTK_CHECK_VERSION(2, 4, 0) gtk_combo_box_set_active(GTK_COMBO_BOX(__widget_selKey_type), index_selectkeys); #else gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(__widget_selKey_type)->entry), builtin_selectkeys[index_selectkeys] ); #endif /* selKey_num */ int index_selectkeys_num = sizeof(builtin_selectkeys_num) / sizeof(builtin_selectkeys_num[0]) - 1; for (; index_selectkeys_num >= 0; index_selectkeys_num--) { if (__config_selKey_num_data == builtin_selectkeys_num[index_selectkeys_num]) { break; } } if (index_selectkeys_num < 0) index_selectkeys_num = 0; #if GTK_CHECK_VERSION(2, 4, 0) gtk_combo_box_set_active(GTK_COMBO_BOX(__widget_selKey_num), index_selectkeys_num); #else gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(__widget_selKey_num)->entry), builtin_selectkeys_num[index_selectkeys_num] ); #endif /* chieng_mode */ int index_chieng_mode = sizeof(builtin_chieng_mode) / sizeof(builtin_chieng_mode[0]) - 1; for (; index_chieng_mode >= 0; index_chieng_mode--) { if (__config_chieng_mode_data == builtin_chieng_mode[index_chieng_mode].entry) { break; } } if (index_chieng_mode < 0) index_chieng_mode = 0; #if GTK_CHECK_VERSION(2, 4, 0) gtk_combo_box_set_active(GTK_COMBO_BOX(__widget_chieng_mode), index_chieng_mode); #else gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(__widget_chieng_mode)->entry), builtin_chieng_mode[index_chieng_mode].translated_name); #endif } void load_config(const ConfigPointer & config) { if (!config.null()) { __config_add_phrase_forward = config->read(String(SCIM_CONFIG_IMENGINE_CHEWING_ADD_PHRASE_FORWARD), __config_add_phrase_forward); __config_phrase_choice_rearward = config->read(String(SCIM_CONFIG_IMENGINE_CHEWING_PHRASE_CHOICE_REARWARD), __config_phrase_choice_rearward); __config_auto_shift_cursor = config->read(String(SCIM_CONFIG_IMENGINE_CHEWING_AUTO_SHIFT_CURSOR), __config_auto_shift_cursor); __config_esc_clean_all_buffer = config->read(String(SCIM_CONFIG_IMENGINE_CHEWING_ESC_CLEAN_ALL_BUFFER), __config_esc_clean_all_buffer); __config_space_as_selection = config->read(String(SCIM_CONFIG_IMENGINE_CHEWING_SPACE_AS_SELECTION), __config_space_as_selection); __config_kb_type_data = config->read(String(SCIM_CONFIG_IMENGINE_CHEWING_USER_KB_TYPE), __config_kb_type_data); __config_selKey_type_data = config->read(String(SCIM_CONFIG_IMENGINE_CHEWING_USER_SELECTION_KEYS), __config_selKey_type_data); __config_selKey_num_data = config->read(String(SCIM_CHEWING_SELECTION_KEYS_NUM), __config_selKey_num_data); __config_chieng_mode_data = config->read(String(SCIM_CONFIG_IMENGINE_CHEWING_CHI_ENG_MODE), __config_chieng_mode_data); for (int i = 0; __config_keyboards[i].key; ++i) { __config_keyboards[i].data = config->read(String(__config_keyboards[i].key), __config_keyboards[i].data); } for (unsigned int i = 0; i < (sizeof(config_color_common) / sizeof((config_color_common)[0])); i++) { ColorConfigData & entry = config_color_common[i]; entry.bg_value = config->read(String(entry.bg_key), entry.bg_value); } setup_widget_value(); __have_changed = false; } } void save_config(const ConfigPointer & config) { if (!config.null()) { config->write(String(SCIM_CONFIG_IMENGINE_CHEWING_ADD_PHRASE_FORWARD), __config_add_phrase_forward); config->write(String(SCIM_CONFIG_IMENGINE_CHEWING_PHRASE_CHOICE_REARWARD), __config_phrase_choice_rearward); config->write(String(SCIM_CONFIG_IMENGINE_CHEWING_AUTO_SHIFT_CURSOR), __config_auto_shift_cursor); config->write(String(SCIM_CONFIG_IMENGINE_CHEWING_ESC_CLEAN_ALL_BUFFER), __config_esc_clean_all_buffer); config->write(String(SCIM_CONFIG_IMENGINE_CHEWING_SPACE_AS_SELECTION), __config_space_as_selection); // SCIM_CONFIG_IMENGINE_CHEWING_USER_KB_TYPE int index_keymap = (sizeof(builtin_keymaps) / sizeof(_builtin_keymap)) - 1; for (; index_keymap >= 0; index_keymap--) { if (__config_kb_type_data_translated == builtin_keymaps[index_keymap].translated_name) { break; } } if (index_keymap < 0) index_keymap = 0; __config_kb_type_data = builtin_keymaps[index_keymap].entry; config->write(String(SCIM_CONFIG_IMENGINE_CHEWING_USER_KB_TYPE), __config_kb_type_data); // SCIM_CONFIG_IMENGINE_CHEWING_USER_SELECTION_KEYS int index_selectkeys = sizeof(builtin_selectkeys) / sizeof(builtin_selectkeys[0]) - 1; for (; index_selectkeys >= 0; index_selectkeys--) { if (__config_selKey_type_data == builtin_selectkeys[index_selectkeys]) { break; } } if (index_selectkeys < 0) index_selectkeys = 0; __config_selKey_type_data = builtin_selectkeys[index_selectkeys]; config->write(String(SCIM_CONFIG_IMENGINE_CHEWING_USER_SELECTION_KEYS), __config_selKey_type_data); // SCIM_CHEWING_SELECTION_KEYS_NUM int index_selectkeys_num = sizeof(builtin_selectkeys_num) / sizeof(builtin_selectkeys_num[0]) - 1; for (; index_selectkeys_num >= 0; index_selectkeys_num--) { if (__config_selKey_num_data == builtin_selectkeys_num[index_selectkeys_num]) { break; } } if (index_selectkeys_num < 0) index_selectkeys_num = 0; __config_selKey_num_data = builtin_selectkeys_num[index_selectkeys_num]; config->write(String(SCIM_CHEWING_SELECTION_KEYS_NUM), __config_selKey_num_data); // SCIM_CONFIG_IMENGINE_CHEWING_CHI_ENG_MODE int index_chieng_mode = sizeof(builtin_chieng_mode) / sizeof(builtin_chieng_mode[0]) - 1; for (; index_chieng_mode >= 0; index_chieng_mode--) { if (__config_chieng_mode_data == builtin_chieng_mode[index_chieng_mode].entry || __config_chieng_mode_data == builtin_chieng_mode[index_chieng_mode].translated_name) { break; } } if (index_chieng_mode < 0) index_chieng_mode = 0; __config_chieng_mode_data = builtin_chieng_mode[index_chieng_mode].entry; config->write(String(SCIM_CONFIG_IMENGINE_CHEWING_CHI_ENG_MODE), __config_chieng_mode_data); for (int i = 0; __config_keyboards[i].key; ++i) { config->write(String(__config_keyboards[i].key), __config_keyboards[i].data); } for (unsigned int i = 0; i < (sizeof(config_color_common) / sizeof((config_color_common)[0])); i++) { ColorConfigData & entry = config_color_common[i]; if (entry.changed) { entry.bg_value = config->write(String(entry.bg_key), entry.bg_value); } entry.changed = false; } __have_changed = false; } } bool query_changed() { return __have_changed; } static void on_default_editable_changed(GtkEditable * editable, gpointer user_data) { String *str = static_cast < String * >(user_data); if (str) { *str = String(gtk_entry_get_text(GTK_ENTRY(editable))); __have_changed = true; } } static void on_default_toggle_button_toggled(GtkToggleButton * togglebutton, gpointer user_data) { bool *toggle = static_cast < bool * >(user_data); if (toggle) { *toggle = gtk_toggle_button_get_active(togglebutton); __have_changed = true; } } static void on_default_key_selection_clicked(GtkButton * button, gpointer user_data) { KeyboardConfigData *data = static_cast < KeyboardConfigData * >(user_data); if (data) { GtkWidget *dialog = scim_key_selection_dialog_new(_(data->title)); gint result; scim_key_selection_dialog_set_keys(SCIM_KEY_SELECTION_DIALOG(dialog), gtk_entry_get_text(GTK_ENTRY(data->entry))); result = gtk_dialog_run(GTK_DIALOG(dialog)); if (result == GTK_RESPONSE_OK) { const gchar *keys = scim_key_selection_dialog_get_keys(SCIM_KEY_SELECTION_DIALOG(dialog)); if (!keys) keys = ""; if (strcmp(keys, gtk_entry_get_text(GTK_ENTRY(data->entry))) != 0) gtk_entry_set_text(GTK_ENTRY(data->entry), keys); } gtk_widget_destroy(dialog); } } static ColorConfigData *find_color_config_entry(const char *config_key) { if (!config_key) return NULL; for (unsigned int i = 0; i < (sizeof(config_color_common) / sizeof((config_color_common)[0])); i++) { ColorConfigData *entry = &config_color_common[i]; if (entry->fg_key && !strcmp(entry->bg_key, config_key)) return entry; } return NULL; } static GtkWidget *create_color_button(const char *config_key) { ColorConfigData *entry = find_color_config_entry(config_key); if (!entry) return NULL; #ifdef SCIM_TABLES_USE_GTK_BOX GtkWidget *hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); #else GtkWidget *hbox = gtk_hbox_new(FALSE, 0); #endif gtk_container_set_border_width(GTK_CONTAINER(hbox), 4); gtk_widget_show(hbox); GtkWidget *label = NULL; if (entry->label) { label = gtk_label_new_with_mnemonic(_(entry->label)); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); gtk_widget_show(label); } entry->widget = scim_color_button_new(); gtk_widget_set_size_request(GTK_WIDGET(entry->widget), 32, 24); g_signal_connect(G_OBJECT(entry->widget), "color-changed", G_CALLBACK(on_color_button_changed), entry); gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(entry->widget), FALSE, FALSE, 2); gtk_widget_show(GTK_WIDGET(entry->widget)); if (label) { gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(entry->widget)); #if 0 /* XXX: not functioned. */ gtk_tooltips_set_tip(__widget_tooltips, GTK_WIDGET(label), _(entry->title), NULL); #endif } return hbox; } static void on_color_button_changed(ScimChewingColorButton * button, gpointer user_data) { ColorConfigData *entry = static_cast < ColorConfigData * >(user_data); if (entry->widget) { scim_color_button_get_colors(button, &entry->fg_value, &entry->bg_value); entry->changed = true; __have_changed = true; } } scim-chewing-0.5.1/src/scim_color_button.cpp000066400000000000000000000462331271526764000211330ustar00rootroot00000000000000/* * Copyright (C) 2005 Hiroyuki Ikezoe * * 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. */ /* * The original code is gimpfgbgeditor.c in GIMP-2.3.2. * Copyright (C) 2004 Michael Natterer */ #ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_GETTEXT #include #define _(String) dgettext(GETTEXT_PACKAGE,String) #define N_(String) (String) #else #define _(String) (String) #define N_(String) (String) #define bindtextdomain(Package,Directory) #define textdomain(domain) #define bind_textdomain_codeset(domain,codeset) #endif #include #include "scim_color_button.h" enum { PROP_0, PROP_ACTIVE_COLOR }; enum { COLOR_CHANGED, LAST_SIGNAL }; typedef enum { INVALID_AREA, FOREGROUND_AREA, BACKGROUND_AREA, SWAP_AREA, DEFAULT_AREA } FgBgTarget; #define WIDGET_WIDTH 32 #define WIDGET_HEIGHT 32 static void scim_color_button_class_init (ScimChewingColorButtonClass *klass); static void scim_color_button_init (ScimChewingColorButton *object); #if GTK_CHECK_VERSION(3, 0, 0) static void scim_color_button_destroy (GtkWidget *object); static gboolean scim_color_button_draw (GtkWidget *widget, cairo_t *cr); #else static void scim_color_button_destroy (GtkObject *object); static gboolean scim_color_button_expose (GtkWidget *widget, GdkEventExpose *eevent); #endif static gboolean scim_color_button_button_press (GtkWidget *widget, GdkEventButton *bevent); static gboolean scim_color_button_button_release (GtkWidget *widget, GdkEventButton *bevent); static guint button_signals[LAST_SIGNAL] = { 0 }; static GtkDrawingAreaClass *parent_class = NULL; GType scim_color_button_get_type (void) { static GType type = 0; if (!type) { static const GTypeInfo info = { sizeof (ScimChewingColorButtonClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc) scim_color_button_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof (ScimChewingColorButton), 0, /* n_preallocs */ (GInstanceInitFunc) scim_color_button_init, }; type = g_type_register_static (GTK_TYPE_DRAWING_AREA, "ScimChewingColorButton", &info, (GTypeFlags) 0); } return type; } static void scim_color_button_class_init (ScimChewingColorButtonClass *klass) { GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); parent_class = (GtkDrawingAreaClass *) g_type_class_peek_parent (klass); button_signals[COLOR_CHANGED] = g_signal_new ("color-changed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (ScimChewingColorButtonClass, color_changed), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); #if GTK_CHECK_VERSION(3, 0, 0) widget_class->destroy = scim_color_button_destroy; widget_class->draw = scim_color_button_draw; #else GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass); gtk_object_class->destroy = scim_color_button_destroy; widget_class->expose_event = scim_color_button_expose; #endif widget_class->button_press_event = scim_color_button_button_press; widget_class->button_release_event = scim_color_button_button_release; } static void scim_color_button_init (ScimChewingColorButton *object) { /*set default color */ #if GTK_CHECK_VERSION(3, 0, 0) gdk_rgba_parse (&object->fg_color, "#000000"); gdk_rgba_parse (&object->bg_color, "#ffffff"); #else gdk_color_parse ("#000000", &object->fg_color); gdk_color_parse ("#ffffff", &object->bg_color); #endif gtk_widget_add_events (GTK_WIDGET (object), GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); } static void #if GTK_CHECK_VERSION(3, 0, 0) scim_color_button_destroy (GtkWidget *object) #else scim_color_button_destroy (GtkObject *object) #endif { ScimChewingColorButton *button = SCIM_COLOR_BUTTON (object); if (button->render_buf) { g_free (button->render_buf); button->render_buf = NULL; button->render_buf_size = 0; } if (button->swap_icon) { g_object_unref (button->swap_icon); button->swap_icon = NULL; } #if GTK_CHECK_VERSION(3, 0, 0) GTK_WIDGET_CLASS (parent_class)->destroy (object); #else GTK_OBJECT_CLASS (parent_class)->destroy (object); #endif } static void scim_color_button_draw_rect (ScimChewingColorButton *button, #if GTK_CHECK_VERSION(3, 0, 0) GdkWindow *drawable, cairo_t *cr, #else GdkDrawable *drawable, GdkGC *gc, #endif gint x, gint y, gint width, gint height, #if GTK_CHECK_VERSION(3, 0, 0) GdkRGBA *color #else GdkColor *color #endif ) { #if GTK_CHECK_VERSION(3, 0, 0) gdk_cairo_set_source_rgba (cr, color); cairo_rectangle (cr, x, y, width, height); cairo_fill (cr); #else gint rowstride; guchar r, g, b; gint xx, yy; guchar *bp; g_return_if_fail (width > 0 && height > 0); r = (color->red >> 8); g = (color->green >> 8); b = (color->blue >> 8); rowstride = 3 * ((width + 3) & -4); if (! button->render_buf || button->render_buf_size < height * rowstride) { button->render_buf_size = rowstride * height; g_free (button->render_buf); button->render_buf = (guchar *) g_malloc (button->render_buf_size); } bp = button->render_buf; for (xx = 0; xx < width; xx++) { *bp++ = r; *bp++ = g; *bp++ = b; } bp = button->render_buf; for (yy = 1; yy < height; yy++) { bp += rowstride; memcpy (bp, button->render_buf, rowstride); } gdk_draw_rgb_image (drawable, gc, x, y, width, height, GDK_RGB_DITHER_MAX, button->render_buf, rowstride); #endif } static gboolean #if GTK_CHECK_VERSION(3, 0, 0) scim_color_button_draw (GtkWidget *widget, cairo_t *cr) #else scim_color_button_expose (GtkWidget *widget, GdkEventExpose *eevent) #endif { ScimChewingColorButton *button = SCIM_COLOR_BUTTON (widget); gint width, height; gint swap_w = 0, swap_h = 0; gint rect_w, rect_h; #if GTK_CHECK_VERSION(2, 18, 0) if (!gtk_widget_is_drawable (widget)) #else if (!GTK_WIDGET_DRAWABLE (widget)) #endif return FALSE; #if GTK_CHECK_VERSION(3, 0, 0) width = gdk_window_get_width(gtk_widget_get_window (widget)); height = gdk_window_get_height(gtk_widget_get_window (widget)); #else width = widget->allocation.width; height = widget->allocation.height; #endif /* draw the swap colors pixbuf */ if (!button->swap_icon) { button->swap_icon = gdk_pixbuf_new_from_file (SCIM_ICONDIR"/scim-chewing-swap-colors.png", NULL); } if (button->swap_icon) { swap_w = gdk_pixbuf_get_width (button->swap_icon); swap_h = gdk_pixbuf_get_height (button->swap_icon); } if (swap_w < width / 2 && swap_h < height / 2) { #if GTK_CHECK_VERSION(3, 0, 0) gdk_cairo_set_source_pixbuf (cr, button->swap_icon, width - swap_w, 0); cairo_paint (cr); #else gdk_draw_pixbuf (widget->window, NULL, button->swap_icon, 0, 0, width - swap_w, 0, swap_w, swap_h, GDK_RGB_DITHER_NORMAL, 0, 0); #endif } else { swap_w = swap_h = 0; } rect_h = height - swap_h - 2; rect_w = width - swap_w - 4; if (rect_h > (height * 3 / 4)) { rect_w = MAX (rect_w - (rect_h - ((height * 3 / 4))), width * 2 / 3); } button->rect_width = rect_w; button->rect_height = rect_h; /* draw the background area */ scim_color_button_draw_rect (button, #if GTK_CHECK_VERSION(2, 14, 0) gtk_widget_get_window (widget), #else widget->window, #endif #if GTK_CHECK_VERSION(3, 0, 0) cr, #else widget->style->fg_gc[0], #endif (width - rect_w), (height - rect_h), rect_w, rect_h, &button->bg_color); #if GTK_CHECK_VERSION(3, 0, 0) GtkStyleContext *style = gtk_widget_get_style_context(widget); gtk_style_context_save (style); gtk_style_context_set_state (style, GTK_STATE_FLAG_NORMAL); gtk_render_frame (style, cr, width - rect_w, height - rect_h, rect_w, rect_h); #else gtk_paint_shadow (widget->style, #if GTK_CHECK_VERSION(2, 14, 0) gtk_widget_get_window (widget), #else widget->window, #endif GTK_STATE_NORMAL, GTK_SHADOW_IN, NULL, widget, NULL, (width - rect_w), (height - rect_h), rect_w, rect_h); #endif /* draw the foreground area */ scim_color_button_draw_rect (button, #if GTK_CHECK_VERSION(2, 14, 0) gtk_widget_get_window (widget), #else widget->window, #endif #if GTK_CHECK_VERSION(3, 0, 0) cr, #else widget->style->fg_gc[0], #endif 0, 0, rect_w, rect_h, &button->fg_color); #if GTK_CHECK_VERSION(3, 0, 0) style = gtk_widget_get_style_context(widget); gtk_style_context_save (style); gtk_style_context_set_state (style, GTK_STATE_FLAG_NORMAL); gtk_render_frame (style, cr, 0, 0, rect_w, rect_h); #else gtk_paint_shadow ( widget->style, #if GTK_CHECK_VERSION(2, 14, 0) gtk_widget_get_window (widget), #else widget->window, #endif GTK_STATE_NORMAL, GTK_SHADOW_IN, NULL, widget, NULL, 0, 0, rect_w, rect_h); #endif return TRUE; } static FgBgTarget scim_color_button_target (ScimChewingColorButton *button, gint x, gint y) { #if GTK_CHECK_VERSION(3, 0, 0) gint width = gdk_window_get_width(gtk_widget_get_window (GTK_WIDGET(button))); gint height = gdk_window_get_height(gtk_widget_get_window (GTK_WIDGET(button))); #else gint width = GTK_WIDGET (button)->allocation.width; gint height = GTK_WIDGET (button)->allocation.height; #endif gint rect_w = button->rect_width; gint rect_h = button->rect_height; if (x > 0 && x < rect_w && y > 0 && y < rect_h) return FOREGROUND_AREA; else if (x > (width - rect_w) && x < width && y > (height - rect_h) && y < height) return BACKGROUND_AREA; else if (x > 0 && x < (width - rect_w) && y > rect_h && y < height) return DEFAULT_AREA; else if (x > rect_w && x < width && y > 0 && y < (height - rect_h)) return SWAP_AREA; return INVALID_AREA; } static void scim_color_button_open_color_dialog (ScimChewingColorButton *button, gboolean fg) { GtkWidget *dialog; const gchar *title; #if GTK_CHECK_VERSION(3, 0, 0) GdkRGBA *color; #else GdkColor *color; #endif gint result; title = fg ? _("Foreground color") : _("Background color"); color = fg ? &button->fg_color : &button->bg_color; dialog = gtk_color_selection_dialog_new (title); #if GTK_CHECK_VERSION(3, 0, 0) gtk_color_selection_set_current_rgba ( GTK_COLOR_SELECTION (gtk_color_selection_dialog_get_color_selection (GTK_COLOR_SELECTION_DIALOG (dialog))), color); #else gtk_color_selection_set_current_color ( #if GTK_CHECK_VERSION(2, 14, 0) GTK_COLOR_SELECTION (gtk_color_selection_dialog_get_color_selection (GTK_COLOR_SELECTION_DIALOG (dialog))), #else GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dialog)->colorsel), #endif color); #endif gtk_widget_show (dialog); result = gtk_dialog_run (GTK_DIALOG (dialog)); switch (result) { case GTK_RESPONSE_OK: #if GTK_CHECK_VERSION(3, 0, 0) gtk_color_selection_get_current_rgba ( GTK_COLOR_SELECTION (gtk_color_selection_dialog_get_color_selection (GTK_COLOR_SELECTION_DIALOG (dialog))), color); #else gtk_color_selection_get_current_color ( #if GTK_CHECK_VERSION(2, 14, 0) GTK_COLOR_SELECTION (gtk_color_selection_dialog_get_color_selection (GTK_COLOR_SELECTION_DIALOG (dialog))), #else GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dialog)->colorsel), #endif color); #endif g_signal_emit (button, button_signals[COLOR_CHANGED], 0); break; default: break; } gtk_widget_destroy (dialog); gtk_widget_queue_draw (GTK_WIDGET (button)); } static void scim_color_button_swap_color (ScimChewingColorButton *button) { #if GTK_CHECK_VERSION(3, 0, 0) GdkRGBA tmp = button->fg_color; button->fg_color = button->bg_color; button->bg_color = tmp; #else GdkColor tmp; tmp.red = button->fg_color.red; tmp.green = button->fg_color.green; tmp.blue = button->fg_color.blue; button->fg_color.red = button->bg_color.red; button->fg_color.green = button->bg_color.green; button->fg_color.blue = button->bg_color.blue; button->bg_color.red = tmp.red; button->bg_color.green = tmp.green; button->bg_color.blue = tmp.blue; #endif g_signal_emit (button, button_signals[COLOR_CHANGED], 0); } static gboolean scim_color_button_button_press (GtkWidget *widget, GdkEventButton *bevent) { ScimChewingColorButton *button = SCIM_COLOR_BUTTON (widget); if (bevent->button == 1 && bevent->type == GDK_BUTTON_PRESS) { FgBgTarget target = scim_color_button_target (button, (gint) bevent->x, (gint) bevent->y); button->click_target = INVALID_AREA; switch (target) { case FOREGROUND_AREA: button->click_target = FOREGROUND_AREA; scim_color_button_open_color_dialog (button, TRUE); break; case BACKGROUND_AREA: button->click_target = BACKGROUND_AREA; scim_color_button_open_color_dialog (button, FALSE); break; case SWAP_AREA: scim_color_button_swap_color (button); gtk_widget_queue_draw (GTK_WIDGET (button)); break; case DEFAULT_AREA: break; default: break; } } return FALSE; } static gboolean scim_color_button_button_release (GtkWidget *widget, GdkEventButton *bevent) { ScimChewingColorButton *button = SCIM_COLOR_BUTTON (widget); if (bevent->button == 1) { FgBgTarget target = scim_color_button_target (button, (gint) bevent->x, (gint) bevent->y); if (target == button->click_target) { switch (target) { case FOREGROUND_AREA: break; case BACKGROUND_AREA: break; default: break; } } button->click_target = INVALID_AREA; } return FALSE; } /* public functions */ GtkWidget * scim_color_button_new (void) { return GTK_WIDGET(g_object_new (SCIM_TYPE_COLOR_BUTTON, NULL)); } gboolean scim_color_button_get_colors (ScimChewingColorButton *button, String *fg_value, String *bg_value) { gchar fg_color_str[8], bg_color_str[8]; g_snprintf (fg_color_str, G_N_ELEMENTS (fg_color_str), "#%02X%02X%02X", #if GTK_CHECK_VERSION(3, 0, 0) static_cast(255*button->fg_color.red), static_cast(255*button->fg_color.green), static_cast(255*button->fg_color.blue) #else ((button->fg_color.red)>>8), ((button->fg_color.green)>>8), ((button->fg_color.blue)>>8) #endif ); g_snprintf (bg_color_str, G_N_ELEMENTS (bg_color_str), "#%02X%02X%02X", #if GTK_CHECK_VERSION(3, 0, 0) static_cast(255*button->bg_color.red), static_cast(255*button->bg_color.green), static_cast(255*button->bg_color.blue) #else ((button->bg_color.red)>>8), ((button->bg_color.green)>>8), ((button->bg_color.blue)>>8) #endif ); *fg_value = String (fg_color_str); *bg_value = String (bg_color_str); return TRUE; } gboolean scim_color_button_set_colors (ScimChewingColorButton *button, const String &fg_value, const String &bg_value) { #if GTK_CHECK_VERSION(3, 0, 0) gdk_rgba_parse (&button->fg_color, fg_value.c_str()); gdk_rgba_parse (&button->bg_color, bg_value.c_str()); #else GdkColor fg_color, bg_color; gdk_color_parse (fg_value.c_str (), &fg_color); gdk_color_parse (bg_value.c_str (), &bg_color); button->fg_color.red = fg_color.red; button->fg_color.green = fg_color.green; button->fg_color.blue = fg_color.blue; button->bg_color.red = bg_color.red; button->bg_color.green = bg_color.green; button->bg_color.blue = bg_color.blue; #endif return TRUE; } /* vi:ts=4:nowrap:ai:expandtab */ scim-chewing-0.5.1/src/scim_color_button.h000066400000000000000000000054421271526764000205750ustar00rootroot00000000000000/* * Copyright (C) 2005 Hiroyuki Ikezoe * * 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. */ /* * The original code is gimpfgbgeditor.h in GIMP-2.3.2. * Copyright (C) 2004 Michael Natterer */ #ifndef __SCIM_COLOR_BUTTON_H__ #define __SCIM_COLOR_BUTTON_H__ #include #include using namespace scim; #define SCIM_TYPE_COLOR_BUTTON (scim_color_button_get_type ()) #define SCIM_COLOR_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCIM_TYPE_COLOR_BUTTON, ScimChewingColorButton)) #define SCIM_COLOR_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCIM_TYPE_COLOR_BUTTON, ScimChewingColorButtonClass)) #define SCIM_IS_COLOR_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCIM_TYPE_COLOR_BUTTON)) #define SCIM_IS_COLOR_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCIM_TYPE_COLOR_BUTTON)) #define SCIM_COLOR_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCIM_TYPE_COLOR_BUTTON, ScimChewingColorButtonClass)) typedef struct _ScimChewingColorButtonClass ScimChewingColorButtonClass; typedef struct _ScimChewingColorButton ScimChewingColorButton; struct _ScimChewingColorButton { GtkDrawingArea parent_instance; guchar *render_buf; gint render_buf_size; GdkPixbuf *swap_icon; gint rect_width; gint rect_height; gint click_target; #if GTK_CHECK_VERSION(3, 0, 0) GdkRGBA fg_color; GdkRGBA bg_color; #else GdkColor fg_color; GdkColor bg_color; #endif }; struct _ScimChewingColorButtonClass { GtkDrawingAreaClass parent_class; /* signals */ void (* color_changed) (ScimChewingColorButton *button); }; GType scim_color_button_get_type (void) G_GNUC_CONST; GtkWidget * scim_color_button_new (void); gboolean scim_color_button_get_colors (ScimChewingColorButton *button, String *fg_value, String *bg_value); gboolean scim_color_button_set_colors (ScimChewingColorButton *button, const String &fg_value, const String &bg_value); #endif /* __SCIM_COLOR_BUTTON_H__ */