--- /dev/null
+Notes 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 free software 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 on translations can 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 included GNU
+`gettext' 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 not be 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 usually have 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.
+
--- /dev/null
+Developer:
+ Takuro Ashie <ashie@homa.ne.jp>
+ Hiroyuki Ikezoe <poincare@ikezoe.net>
+
+Art work:
+ SHIMODA Hiroshi <piro@p.club.ne.jp>
--- /dev/null
+ 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.
+\f
+ 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.)
+\f
+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.
+\f
+ 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.
+\f
+ 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
+\f
+ 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.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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.
+
+ <signature of Ty Coon>, 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.
--- /dev/null
+2012-11-25 Li Zhang <li2012.zhang@samsung.com>
+
+ * commit preedit string when reset, Version-0.0.0125.
+
+2009-0l-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-1.2.7.
+
+2009-01-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.cpp: Add missing include file.
+ Thanks Utumi-san, Ikuya-san.
+
+2009-0l-15 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.cpp, src/scim_anthy_setup.cpp,
+ src/scim_anthy_prefs.h:
+ Set UTF-8 as default encoding (ported from 1.4 branch).
+
+2009-0l-14 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Removed a needless line.
+
+2008-08-04 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_reading.cpp: Set NICOLA engine as case sensitive.
+
+2008-03-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-1.2.6.
+
+2008-03-28 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.cpp, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_prefs.cpp:
+ Fix typo. Thanks Malcolm Parsons and Ikuya Awashiro.
+
+2008-02-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-1.2.5.
+
+2008-02-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Sort style file list by name.
+
+2008-02-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.cpp: Update credit.
+
+2008-01-23 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_kana.cpp,
+ src/scim_anthy_preedit.cpp, src/scim_anthy_prefs.cpp,
+ src/scim_anthy_setup.cpp, src/scim_anthy_utils.cpp:
+ Added missing include files to build against gcc-4.3.
+
+2007-10-12 Takuro Ashie <ashie@homa.ne.jp>
+
+ * po/de.po: Add. Thanks Gerrit Sangel.
+ * data/nicola-f.sty: Backport from trunk.
+
+2007-05-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-1.2.4.
+
+2007-05-21 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_color_button.{cpp,h}: Renamed to
+ scim_anthy_color_button.{cpp,h}.
+ * src/scim_anthy_color_button.{cpp.h]: Added.
+ * src/Makefile.am, scim_anthy_setup.cpp: Renamed to
+ scim_anthy_color_button* and ScimAnthyColorButton*.
+
+2007-05-14 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_key2kana.cpp: Clear m_last_key on clear().
+
+2007-05-14 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_key2kana.cpp: Fix a bug that voiced consonants are
+ gone after inputing "Ro" has been fixed. Thanks MORIYAMA Masayuki.
+
+2007-04-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-1.2.3.
+
+2007-04-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/Makefile.am: Remove binary version from the install path of the
+ helper module.
+ * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_key2kana.{cpp,h},
+ src/scim_anthy_prefs.h, src/scim_anthy_default_table.cpp:
+ Add spcial treatment for "RO" key of JIS kana layout. It requires
+ scim-1.4.6 or later (it is not released yet).
+
+2007-03-28 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.{cpp,h}: Show aux string again if the lookup
+ table is activated on focus in event.
+ Thanks TAGOH-san and somebody who contributes the patch.
+
+2007-01-06 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_utils.h: Include missing header files.
+ Thanks Gregor Waltz.
+
+2006-11-14 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac; Version-1.2.2.
+
+2006-10-30 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.cpp: Fix a bug that a wrong partial string
+ is converted on direct kana conversion after commiting a piece of
+ segments.
+
+2006-09-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-1.2.1.
+
+2006-09-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Enable dictionary encoding prefs.
+ * src/scim_anthy_prefs.h: Revert default dictionary encoding to EUC-JP.
+
+2006-09-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_reading.cpp, src/scim_anthy_key2kana.cpp:
+ Apply TAGOH-san's solution for the previous problem. Thanks.
+
+2006-09-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_reading.cpp: Give a first aid to the problem that
+ codes of pseudo ASCII mode breaks pending state of normal kana input
+ mode. Thanks Ryo Dairiki for your report.
+ Fix indent.
+ * src/scim_anthy_key2kana.cpp: Fix indent.
+
+2006-09-11 Takuro Ashie <ashie@homa.ne.jp>
+
+ * README, src/scim_anthy_factory.cpp: Change Dairiki-san's mail address.
+ * po/ja.po: Update.
+
+2006-08-06 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Add AC_SUBST(LIBTOOL_EXPORT_OPTIONS).
+ Thanks Kouhei Sutou.
+
+2006-07-31 Takuro Ashie <ashie@homa.ne.jp>
+
+ * NEWS: Add a missing entry (The description about the tsuki layout).
+
+2006-07-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-1.2.0.
+
+2006-07-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.cpp: Raise priority of "pseudo ascii mode
+ cancel" key.
+ * src/scim_anthy_imengine.cpp: Ignore key event without relation
+ at AnthyInstance::action_cancel_pseudo_ascii_mode().
+ * src/scim_anthy_prefs.h: Add "Escape" into
+ SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR_DEFAULT key.
+
+2006-07-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Insert a half space on pressing space
+ key during pseudo ascii mode.
+
+2006-07-24 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Hide dictionary encoding option.
+
+2006-07-24 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_factory.{cpp,h},
+ src/scim_anthy_imengine.cpp, src/scim_anthy_preedit.{cpp,h},
+ src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_reading.cpp,
+ src/scim_anthy_setup.cpp, src/scim_anthy_setup_romaji.cpp:
+ DIC_ENCODING -> DICT_ENCODING. And fix compile time warnings.
+
+2006-07-21 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp:
+ EUCJP-MS -> EUC-JP-MS and set default encoding as EUC-JP-MS.
+ * po/ja.po: Update.
+
+2006-07-20 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_factory.{cpp,h},
+ src/scim_anthy_imengine.cpp, src/scim_anthy_preedit.{cpp,h},
+ src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp:
+ Add "Encoding of dictionary" preference to improve
+ interoperatability with Microsoft Windows.
+ * src/scim_anthy_key2kana_base.h: Fix compile time warning.
+ * po/ja.po: Update.
+
+2006-07-18 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.cpp: Fix some messages.
+ * po/ja.po: Update.
+
+2006-07-13 Akira TAGOH <at@gclab.org>
+
+ * src/scim_anthy_action.{cpp,h}, src/scim_anthy_factory.{cpp,h},
+ src/scim_anthy_imengine.{cpp,h}, src/scim_anthy_kana.{cpp,h},
+ src/scim_anthy_key2kana.{cpp,h}, src/scim_anthy_key2kana_base.h,
+ src/scim_anthy_nicola.{cpp,h}, src/scim_anthy_preedit.{cpp,h},
+ src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_reading.{cpp,h},
+ src/scim_anthy_setup.cpp, src/scim_anthy_setup_romaji.cpp:
+ Enable to enter space during pseudo ASCII mode.
+
+2006-07-11 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/Makefile.am, data/tsuki-2-203-101.sty,
+ data/tsuki-2-203-106.sty: Add "tsuki" layout. Thanks Tatsuki Sugiura.
+
+2006-07-11 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Enable reconversion feature on non-GTK+
+ application. But it's a ad-hoc solution.
+ Thank you for your patch > Takashi Nakamoto
+
+2006-07-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.cpp: Fix a bug that scim-anthy never
+ switch to conversion mode when the auto prediction feature is enabled.
+
+2006-07-04 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_prefs.h,
+ src/scim_anthy_setup.cpp: Add a preference to choose behavior on
+ focus out.
+
+2006-06-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Fix indent.
+
+2006-06-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_preedit.h: Fix some comments.
+
+2006-06-18 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_preedit.{cpp,h}: Add an arguemnt to Preedit::clear()
+ and Conversion::clear() to specify segment_id to enable partial clear.
+ It is needed for commiting without learn. Thanks Jun Oizumi for your
+ report.
+
+2006-06-17 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Fix a typo in a comment.
+
+2006-06-02 Ikuya Awashiro <ikuya@oooug.jp>
+
+ * data/msime.sty: Add predict keys.
+ * data/wnn.sty: ditto.
+ * data/canna.sty: ditto.
+
+2006-06-01 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty, data/msime.sty: Fix some wrong entries in Romaji
+ table. Thanks Jun Oizumi.
+
+2006-05-31 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: The bug that direct select keys didn't
+ work while predicting has been fixed. Thank you for reporting >
+ TAGOH-san, UTUMI-san, Bando-san.
+
+2006-04-10 Akira TAGOH <at@gclab.org>
+
+ * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_key2kana.{cpp,h}, src/scim_anthy_key2kana_base.h,
+ src/scim_anthy_preedit.{cpp,h}, src/scim_anthy_prefs.{cpp,h},
+ src/scim_anthy_reading.{cpp,h}, src/scim_anthy_setup_romaji.cpp:
+ Add pseudo ASCII input mode.
+
+2006-03-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-1.0.0.
+
+2006-03-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Don't activate direct select key when
+ the lookup window isn't shown. Thanks TAGOH-san.
+
+2006-02-28 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.cpp: Strange bihavior of resizing segment
+ after partial commit has been fixed.
+
+2006-02-14 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Modify order of symbol style.
+
+2006-02-14 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Install symbol style properties.
+ * src/scim_anthy_setup.cpp: Show check box for symbol style label.
+
+2006-02-13 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty, data/canna.sty, data/msime.sty, data/vje-delta.sty,
+ data/wnn.sty: "/", "[", "]" entries in romaji table aren't needed
+ anymore.
+
+2006-02-13 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp:
+ Add a preference to show or hide symbol style label on toolbar.
+ But label itself is not added yet.
+
+2006-02-13 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Split symbol related preferences from
+ "Common" page. Change order of candidates in some combos.
+
+2006-02-13 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.cpp: Fix credit.
+ * po/ja.po: Update.
+
+2006-02-08 Takuro Ashie <ashie@homa.ne.jp>
+
+ * po/ja.po: Update.
+
+2006-02-08 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Add version information.
+
+2006-02-08 Akira TAGOH <at@gclab.org>
+
+ * src/scim_anthy_default_tables.{cpp,h},
+ src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.{cpp,h},
+ src/scim_anthy_key2kana_table.{cpp,h},
+ src/scim_anthy_preedit.{cpp,h}, src/scim_anthy_prefs.{cpp,h},
+ src/scim_anthy_reading.{cpp,h}, src/scim_anthy_setup.cpp:
+ Add symbol style preference.
+
+2006-01-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-0.9.0.
+
+2006-01-21 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Fix double commiting on wide latin mode.
+ Thanks UTUMI-san and Dairiki-san.
+
+2006-01-13 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Fix typo (ANthy -> Anthy).
+
+2005-12-27 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.{cpp,h}: Minor fix.
+
+2005-12-27 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_key2kana_table.h, src/scim_anthy_style_file.h:
+ Remove needless #include.
+
+2005-12-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/wnn.sty: Fix typo (shrink segment).
+
+2005-12-20 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_style_file.cpp: Remove needless code.
+
+2005-12-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Avoid double deleting both former and
+ later mathced text when start reconversion.
+
+2005-12-15 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_default_tables.cpp: NULL terminate for voiced
+ contonant table.
+
+2005-12-14 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Half space character was never outputed
+ by space key when the typing method is NICOLA mode.
+
+2005-12-08 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.cpp, po/ja.po: Fix typo.
+
+2005-12-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Through space key event on
+ action_insert_space() family to activate application's specific
+ features.
+
+2005-12-06 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_nicola.cpp: Timer didn't work correctly when both
+ a normal key and a thumb shift key was pressed.
+
+2005-11-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty: Add predict keys.
+
+2005-11-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * Version-0.8.0.
+
+2005-11-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_reading.cpp: Don't set NICOLA engine as case
+ sensitive by default.
+
+2005-11-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/tron-dvorak.sty, src/tron-qwerty-jp.sty:
+ Add TRON layout. Thanks Okano, Shinchi <shinchan.okano@nifty.com>.
+
+2005-11-19 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.cpp: Add mnemonic.
+ * po/ja.po: Update.
+
+2005-11-19 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_key2kana_table.cpp: Remove needless comment.
+
+2005-11-19 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_preedit.h: Rename SCIM_ANTHY_CANDIDATE_NORMAL to
+ SCIM_ANTHY_CANDIDATE_DEFAULT.
+
+2005-11-19 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_reading.{cpp,h}, src/scim_anthy_conversion.cpp,
+ src/scim_anthy_preedit.cpp: Remove needless code in Reading class.
+
+2005-11-19 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_reading.cpp: Remove debug print.
+
+2005-11-19 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_nicola.cpp: Don't eat unknown key release event.
+ * src/scim_anthy_imengine.cpp: Add a comment.
+
+2005-11-19 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_key2kana_base.h, src/scim_anthy_kana.{cpp,h},
+ src/scim_anthy_key2kana.{cpp,h}, src/scim_anthy_nicola.{cpp,h}:
+ Move implementation of set_case_sensitive() and get_case_sensitive() to
+ Key2KanaConvertorBase.
+
+2005-11-19 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_key2kana_base.h, src/scim_anthy_kana.{cpp,h},
+ src/scim_anthy_key2kana.{cpp,h}, src/scim_anthy_nicola.{cpp,h},
+ src/scim_anthy_reading.cpp:
+ Add reset_pending () to Key2KanaConvertorBase class.
+
+2005-11-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Remove needless code.
+
+2005-11-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_nicola.cpp: Sorry, forgot to set alarm at some place.
+
+2005-11-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_default_tables.cpp: Add voiced consonants as shift
+ modifired keys into default NICOLA table.
+
+2005-11-15 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.cpp: Add remaining HAS_ANTHY_PREDICTION
+ condition.
+
+2005-11-15 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp:
+ Add UI for preferences of prediction.
+ * po/ja.po: Update.
+
+2005-11-15 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_prefs.h: Enable to choose whether use direct select key
+ while predicting or not.
+
+2005-11-15 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_helper.h: Fix typo.
+
+2005-11-15 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Enable to select a candidte by direct
+ select key on prediction.
+
+2005-11-15 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Enable to select a candidte on
+ prediction.
+
+2005-11-15 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_reading.cpp: NICOLA engine should be case sensitive.
+ * src/scim_anthy_default_tables.cpp: Add some shift modifired keys into
+ NICOLA table.
+
+2005-11-15 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup_kana.cpp: Fix some messages.
+ * po/ja.po: Update.
+
+2005-11-15 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Don't to use m_lookup_table for\
+ prediction to avoid conflict.
+
+2005-11-15 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_prefs.h: Add a preference to select whether predict
+ while inputting or not.
+
+2005-11-15 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.{cpp,h}, src/scim_anthy_factory.cpp,
+ src/scim_anthy_prefs.{cpp,h}: Add key bindings for prediction, and
+ comment out realtime prediction.
+ * src/scim_anthy_preedit.{cpp,h}: Add is_predicting ().
+ * src/scim_anthy_conversion.{cpp,h}: Add a feature for getting predicted
+ candidates.
+ * po/ja.po: Update.
+
+2005-11-14 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_preedit.cpp:
+ Cleanup.
+
+2005-11-14 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.{cpp,h}: Add test code for prediction.
+
+2005-11-14 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.{cpp,h}: Cleanup.
+
+2005-11-14 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_preedit.{cpp,h}:
+ Add prediction. Other minor fix.
+
+2005-11-14 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.h: Fix typo.
+ * src/scim_anthy_conversion.cpp: Fix indent.
+
+2005-11-13 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Requires scim-1.2.0.
+
+2005-11-13 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Add a comment.
+
+2005-11-13 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_nicola.cpp, src/scim_anthy_prefs.cpp,
+ src/scim_anthy_setup_kana.cpp:
+ Add a preference for simultaneous key pressing time.
+
+2005-11-12 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_helper.h: Add new commands for creating and deleting
+ input context.
+
+2005-11-12 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_nicola.cpp: Set limit of timer to 5ms < time < 1000ms.
+
+2005-11-12 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_nicola.{cpp,h}: Process single pressing more strictly
+ using timer.
+
+2005-11-12 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_helper.cpp, src/scim_anthy_imengine.cpp:
+ The timer feature has been tested and minor fix.
+
+2005-11-12 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_helper.cpp, src/scim_anthy_imengine.cpp:
+ Add timer, but it isn't tested yet.
+
+2005-11-12 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.cpp, data/atok.sty, data/msime.sty:
+ Add reconversion key.
+ * po/ja.po: Update.
+
+2005-11-12 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_preedit.{cpp,h}:
+ Fix some bit problems in reconversion feature.
+
+2005-11-12 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_preedit.{cpp,h},
+ src/scim_anthy_imengine.cpp: Add reconversion feature, but it has some
+ bit problems yet.
+
+2005-11-12 Takuro Ashie <ashie@homa.ne.jp>
+
+ * Makefile.am, src/scim_anthy_helper.cpp,
+ src/scim_anthy_imengine.{cpp,h}: Add test code getting selection text.
+
+2005-11-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.{cpp,h}, src/scim_anthy_factory.{cpp,h},
+ src/scim_anthy_prefs.h: Add reconvert key, but not implemented yet.
+
+2005-11-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac, src/scim_anthy_helper.cpp, src/Makefile.am:
+ Add anthy-imengine-helper. But it does nothing yet.
+
+2005-11-09 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.cpp:
+ Add package name and version into authors text.
+ Thank you for your notifying > Masatake YAMATO <jet@gyve.org>
+
+2005-11-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ *po/ja.po: Update.
+
+2005-11-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.cpp: Add help text.
+
+2005-11-06 Takuro Ashie <ashie@homa.ne.jp>
+
+ *po/ja.po: Update.
+
+2005-11-06 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.h: Modify some default key bindings.
+
+2005-11-06 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_nicola.cpp:
+ Handle keypad correctly on thumb shift typing method.
+
+2005-11-06 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_key2kana.cpp:
+ Handle keypad correctly on kana typing method.
+
+2005-11-06 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_key2kana.cpp,
+ src/scim_anthy_utils.{cpp,h}:
+ Apply ten key setting exactly. But it's not enough yet for kana and
+ thumb shift typing method.
+
+2005-11-05 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_imengine.{cpp,h},
+ src/scim_anthy_factgory.cpp: Change & add some key bindings.
+ Now previous "LatinModeKey" is renamed to "OnOffKey". Please reset your
+ configuration if you use non-default key bindings.
+ * data/atok.sty, data/canna.sty, data/msime.sty, data/vje-delta.sty,
+ data/wnn.sty:
+ Sync with new key bindings.
+
+2005-11-01 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/nicola-a.sty, data/nicola-j.sty, data/oasys100j.sty:
+ Use wide character for numbers.
+
+2005-11-01 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_default_tables.cpp: Fix NICOLA table.
+
+2005-10-23 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.cpp: Change uuid to increase priority.
+
+2005-10-21 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty: Fix typo in romaji table.
+
+2005-10-20 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.h: Remove needless entry.
+
+2005-10-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.cpp: Fix typo.
+ * po/ja.po: Update.
+
+2005-10-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.h: Add Henkan key to "Convert key" and "Next
+ candidate" key.
+
+2005-10-15 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/Makefile.am: Add wnn.sty.
+ * data/wnn.sty: Add "Shift+space" to "Latin mode".
+
+2005-10-14 Takuro Ashie <ashie@homa.ne.jp>
+
+ * Version-0.7.1 (BRANCH-0.7.0).
+
+2005-10-14 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.cpp, src/scim_anthy_prefs.cpp: Fix typo.
+ * po/ja.po: Translate some untranslated messages.
+
+2005-10-11 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.cpp: Fix typo.
+
+2005-10-04 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_table_editor.cpp: Fix a crash bug.
+ Thanks reporting! > Yukiko Bando & AWASHIRO Ikuya
+
+2005-09-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-0.7.0.
+
+2005-09-28 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/canna.sty: Comment out non-implemented key bind.
+
+2005-09-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * AUTHORS, src/scim_anthy_factory.cpp: Change order of authors list.
+
+2005-09-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/wnn.sty: Add Wnn like romaji table and key map.
+
+2005-09-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/canna.sty: Fix typo.
+ * src/scim_anthy_factory.cpp, src/scim_anthy_imengine.{cpp,h},
+ src/scim_anthy_prefs.{cpp,h}: Add some key bindings.
+ (CancelAllKey, ConvertCharTypeForwardKey, ConvertCharTypeBackwardKey)
+
+2005-08-30 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/canna.sty, data/msime.sty, data/vje-delta.sty: Fix typo.
+
+2005-08-30 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.h: Show dictionary menu on the panel by default.
+
+2005-08-30 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/scim-anthy.png: Replace with new icon.
+
+2005-08-30 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Sorry, wrong key was set on startup.
+
+2005-08-30 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/vje-delta.sty: Add.
+ * data/atok.sty, data/canna.sty, data/msime.sty: Minor fix.
+
+2005-08-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/Makefile.am, data/canna.sty: Add Canna like style.
+
+2005-08-23 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup_romaji.cpp, src/scim_anthy_setup_kana.cpp:
+ Minor fix.
+
+2005-08-23 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Minor fix.
+
+2005-08-23 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Show all key bindings by default.
+
+2005-08-23 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.cpp: Add authors.
+
+2005-08-14 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configfure.ac: Version-0.6.1 (Branch 0.6.0).
+
+2005-08-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_table_editor.cpp: Fix a stupid bug.
+ Thank you very much :D > Yukiko Bando
+
+2005-08-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Revive multi/dead key related code.
+ Thanks Yukiko Bando.
+
+2005-08-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_table_editor.cpp: NULL check before strcmp().
+
+2005-08-09 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.cpp: Set correct default value.
+
+2005-08-08 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.cpp: Plug memory leak. Check file name length
+ of style file before load it.
+ * src/scim_anthy_imengine.cpp: Set custom typing table correctly even if
+ typing method label on toolbar is shown.
+ * src/scim_anthy_table_editor.cpp: Compare all columns on sorting.
+
+2005-08-05 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup_kana.cpp: Fix initial window size.
+
+2005-08-05 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.cpp: Minor fix.
+ * po/ja.po, src/scim_anthy_setup_kana.cpp,
+ src/scim_anthy_setup_romaji.cpp, src/scim_anthy_table_editor.{cpp,h}:
+ Add NICOLA customize window.
+
+2005-08-05 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup_kana.cpp: Enable to switch NICOLA layout by
+ option menu.
+
+2005-08-04 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_key2kana_table.cpp, src/scim_anthy_reading.cpp,
+ src/scim_anthy_style_file.cpp: Bug fix. Now loading custom NICOLA
+ layout is available.
+
+2005-08-04 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.{cpp,h},
+ src/scim_anthy_preedit.{cpp,h}, src/scim_anthy_reading.{cpp,h}:
+ Load custom NICOLA layout. Some minor fix.
+
+2005-08-04 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_preedit.{cpp,h},
+ src/scim_anthy_reading.{cpp,h}: Clean up.
+
+2005-08-03 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_key2kana_table.{cpp,h}, src/scim_anthy_nicola.{cpp,h},
+ src/scim_anthy_reading.{cpp,h}: Ready for customizable NICOLA layout.
+
+2005-08-03 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_key2kana.cpp, scim_anthy_key2kana_table.{cpp,h},
+ scim_anthy_style_file.cpp: Ready for customizable NICOLA layout.
+
+2005-08-02 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.{cpp,h}: Add get_typing_method() and
+ get_input_mode ().
+
+2005-08-02 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anhthy_conversion.h: Remove needless code.
+ * src/scim_anhthy_conversion.h, src/scim_anthy_reading.h: Minor fix.
+
+2005-08-02 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.{cpp,h}, src/scim_anthy_kana.{cpp,h},
+ src/scim_anthy_key2kana.{cpp,h}, src/scim_anthy_key2kana_base.h,
+ src/scim_anthy_nicola.{cpp,h}, src/scim_anthy_preedit.{cpp,h},
+ src/scim_anthy_reading.{cpp,h}:
+ Make each object to read static configurations directly from
+ AnthyFactory.
+
+2005-08-02 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.{cpp,h},
+ src/scim_anthy_setup_kana.cpp: Clean up.
+
+2005-08-02 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_key2kana_table.cpp: Remove needless code.
+
+2005-08-02 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_style_file.cpp: Always set file name of style file
+ object on loading even if it fails.
+
+2005-08-02 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Process user defined key bindings before
+ input key event for [Scim-imengine-dev 573] issue.
+ Only thumb shift keys should be processed before user defined key
+ bindings.
+ Thanks Ryo Dairiki.
+
+2005-08-01 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_preedit.cpp, src/scim_anthy_conversion.cpp:
+ Remove needless code.
+
+2005-07-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-0.6.0.
+
+2005-07-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-0.5.3 (BRNACH_0_5_0).
+
+2005-07-28 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/nicola-a.sty, data/nicola-j.sty, data/oasys100j.sty:
+ Add copyright notice.
+
+2005-07-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup_kana.cpp: Comment out NICOLA time setting.
+
+2005-07-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.cpp: Sorry, wrong step size for NICOLA time was
+ set.
+
+2005-07-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_default_tables.{cpp,h}, src/scim_anthy_kana.cpp,
+ src/scim_anthy_reading.cpp:
+ Add keypad table to KanaConvertor, but it's not used yet.
+ Class name should be renamed.
+
+2005-07-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_preedit.cpp:
+ Don't flush pending string on realtime conversion.
+
+2005-07-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.h, src/scim_anthy_setup_romaji.cpp,
+ src/scim_anthy_setup_kana.cpp:
+ Don't save romaji theme & kana layout name.
+ * src/scim_anthy_setup.cpp: The bug that user defined key bindings
+ aren't loaded has been fixed.
+
+2005-07-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_reading.cpp: Don't create new segment if empty string
+ is returned from Key2KanaConvertor.
+
+2005-07-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.cpp, src/scim_anthy_factory.{cpp,h},
+ src/scim_anthy_preedit.cpp, src/scim_anthy_prefs.h,
+ src/scim_anthy_utils.{cpp,h}:
+ Apply preedit style preference. Fixed default settings of preedit style.
+
+2005-07-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * po/ja.po: Update.
+ * src/scim_anthy_setup.cpp: Bug fix.
+
+2005-07-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_factory.h,
+ src/scim_anthy_imengine.cpp, src/scim_anthy_preedit.{cpp,h},
+ src/scim_anthy_reading.{cpp,h}, src/scim_anthy_setup.cpp:
+ Each object should read its configuration directly.
+
+2005-07-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_preedit.cpp: Flush pending string in reading before
+ start conversion. Thanks 428 of SCIM thread in 2ch Linux borad.
+
+2005-07-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_factory.{cpp,h},
+ src/scim_anthy_preedit.{cpp,h}, src/scim_anthy_prefs.{cpp,h},
+ src/scim_anthy_setup.{cpp,h}:
+ Add preferences for color of conversion string.
+ Add UI for preference of preedit style, but it's not applied yet.
+
+2005-07-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_nicola.h: Don't use operator "!=" for KeyEvent class.
+
+2005-07-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/msime.sty: Fix a wrong key binding.
+
+2005-07-23 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/Makefile.am, data/nicola-a.sty, data/nicola-j.sty,oasys100j.sty:
+ Add NICOLA layouts. Thanks Hatuka*nezumi.
+
+2005-07-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.{cpp,h}: Always load mode settings on
+ initializing.
+
+2005-07-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_action.cpp, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_nicola.cpp, src/scim_anthy_utils.{cpp,h}:
+ Specify ignore mask when matching key event.
+
+2005-07-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * po/ja.po, src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp,
+ Show units for integer type configurations.
+
+2005-07-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * po/ja.po, src/scim_anthy_factory.h, src/scim_anthy_imengine.h,
+ src/scim_anthy_nicola.{cpp,h}, src/scim_anthy_setup.{cpp,h},
+ src/scim_anthy_setup_kana.cpp:
+ Apply preferences for NICOLA except layout setting.
+
+2005-07-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_setup.cpp, src/scim_anthy_utils.{cpp,h}:
+ Load preferenes for NICOLA.
+
+2005-07-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * po/ja.po, src/scim_anthy_factory.cpp, src/scim_anthy_prefs.{cpp,h},
+ src/scim_anthy_setup.{cpp,h}, src/scim_anthy_setup_kana.cpp:
+ Add preferences for NICOLA.
+
+2005-07-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_nicola.cpp: Ignore Control and Alt modifiered keys.
+
+2005-07-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imenginne.cpp, src/scim_anthy_setup.cpp:
+ Remove #define ENABLE_NICOLA.
+
+2005-07-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.{cpp,h}, src/scim_anthy_nicola.cpp:
+ Temporary solution for handling single thumb shift key pressing.
+
+2005-07-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.{cpp,h}, src/scim_anthy_nicola.{cpp,h},
+ src/scim_anthy_preedit.{cpp,h}, src/scim_anthy_reading.{cpp,h}:
+ Handle single thumb shift key pressing. Still has some bugs.
+
+2005-07-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_nicola.cpp: Fix indent and other minor fix.
+
+2005-07-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_nicola.{cpp,h}: Refactoring.
+
+2005-07-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_nicola.cpp: Bug fix of handling key repeat.
+
+2005-07-21 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_nicola.{cpp,h}: Minor fixes.
+
+2005-07-21 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_nicola.{cpp,h}: Rewrite. But still has some bugs.
+
+2005-07-21 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp, po/ja.po:
+ Add a preferenece to show/hide the "Candidates" label.
+
+2005-07-21 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Show the "Candidates" label for lookup
+ window using aux string like honoka-tan.
+
+2005-07-20 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Don't apply some setting which can be
+ changed from toolabr.
+
+2005-07-20 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_reding.{cpp,h}: Support voiced sound on X's kana
+ typing.
+
+2005-07-20 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_reding.{cpp,h}: Test for supporting kana symbol of X.
+
+2005-07-20 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_kana.{cpp,h}: Added to support kana symbol of X.
+
+2005-07-20 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_key2kana_table.{cpp,h},
+ src/scim_anthy_default_tables.{cpp,h}:
+ Create voiced consonant table automatically.
+
+2005-07-19 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Don't use convert as you type on Latin
+ or Wide Latin mode.
+
+2005-07-19 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_setup.cpp:
+ Disable NICOLA by default because some required features aren't
+ implemented yet. To enable it, please define ENABLE_NICOLA macro.
+
+2005-07-19 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_default_tables.{cpp,h}: Add KanaRule.
+
+2005-07-19 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty, data/msime.sty: Add "Zenkaku_Hankaku" to LatinModeKey.
+ * src/scim_anthy_factory.cpp, src/scim_anthy_setup.cpp:
+ Load key bindings from system wide style file.
+
+2005-07-17 Takuro Ashie <ashie@homa.ne.jp>
+
+ * po/ja.po, src/scim_anthy_prefs.cpp, src/scim_anthy_setup.cpp:
+ Set mnemonic for spin button and fix typo.
+
+2005-07-17 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp:
+ Added preference to set the page size of the lookup table.
+ * po/ja.po: Update.
+
+2005-07-17 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/Makefile.am, data/101kana.sty: Added a kana table for 101
+ keyboard. Voiced consonants aren't handled yet by this table.
+
+2005-07-17 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_default_tables.cpp: Sort Kana and NICOLA table by
+ QWERTY order.
+
+2005-07-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_key2kana_table.cpp: Minor bug fix.
+
+2005-07-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_default_tables.cpp: Modified Kana table.
+
+2005-07-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_default_tables.cpp: Modified NICOLA table.
+
+2005-07-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_default_tables.{cpp,h},
+ src/scim_anthy_key2kana_table.cpp:
+ Use half/wide setting of symbols and numbers also on kana mode.
+
+2005-07-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-0.5.2 (BRANCH_0_5_0 branch).
+
+2005-07-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_default_tables.cpp, src/scim_anthy_key2kana_table.cpp:
+ The bug that preferences for period, comma and width of numbers aren't
+ applied correctly has been fixed.
+
+2005-07-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp:
+ Added a widget to set the previous added preference.
+
+2005-07-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp:
+ src/scim_anthy_prefs.h:
+ Add a preference to set number of triggers to show lookup table.
+
+2005-07-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.cpp: Set initial cursor position of lookup
+ table.
+ * src/scim_anthy_factory.cpp, src/scim_anthy_imengine.{cpp,h}:
+ Count the number of times on which the convertion key was pressed.
+
+2005-07-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/Makefile.am, data/azik.sty: Add AZIK extended romaji table.
+
+2005-07-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_style_file.cpp: Minor fix.
+
+2005-07-15 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_prefs.h,
+ src/scim_anthy_setup_kana.cpp, src/scim_anthy_setup_romaji.cpp,
+ src/scim_anthy_style_file.{cpp,h}:
+ Load romaji or kana table directly from system wide theme file instead
+ of user's config file when the file name is specified at ~/.scim/config.
+
+2005-07-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * po/ja.po, po/POTFILES.in: Update.
+ * src/Makefile.am, src/scim_anthy_prefs.h, src/scim_anthy_setup.cpp,
+ src/scim_anthy_setup_kana.{cpp,h}: Enable to customize kana table.
+ * src/scim_anthy_setup_romaji.cpp: Minor bugfix.
+
+2005-07-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup_romaji.cpp, src/scim_anthy_table_editor.{cpp,h}:
+ Use ScimAnthyTableEditor class.
+
+2005-07-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup_romaji.cpp: Minor fix.
+ * src/scim_anthy_table_editor.{cpp,h}: Add.
+ * src/Makefile.am: Add above file.
+
+2005-07-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * po/ja.po: Update.
+
+2005-07-08 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_style_file.{cpp,h}, src/scim_anthy_setup_romaji.cpp:
+ Use UTF-8 as internal encoding. Add some functions for setting array.
+
+2005-07-08 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-0.5.1 (BRANCH_0_5_0 branch).
+
+2005-07-08 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup_romaji.cpp: Use new functions to getting array.
+
+2005-07-08 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_style_file.{cpp,h}: Refactoring.
+
+2005-07-08 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_style_file.{cpp,h}: Add functions for getting array.
+
+2005-07-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp:
+ Load kana typing table from "KanaTable/FundamentalTable" section in
+ ~/.scim/Anthy/config.sty.
+
+2005-07-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_reading.cpp: Set Key2KanaConvertor as case sensitive
+ when switch typing method to kana typing mode.
+ * src/scim_anthy_style_file.cpp: Enable to treate "continue" field of
+ key2kana conversion rule.
+
+2005-07-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.cpp, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_preedit.cpp, src/scim_anthy_setup.cpp,
+ src/scim_anthy_utils.{cpp,h}:
+ Changed naming rule of global functions.
+
+2005-07-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_key2kana.cpp:
+ It's the ashie's refactoring ;-P
+ It's ashie quality ;-P
+ - for (unsigned int i = 0; i < seq.length (); i++)
+ - seq[i] = tolower (seq[i]);
+ + for (unsigned int j = 0; j < seq.length (); i++)
+ + seq[i] = tolower (seq[j]);
+
+2005-07-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.cpp, src/scim_anthy_key2kana.cpp,
+ src/scim_anthy_key2kana_table.{cpp,h}, src/scim_anthy_setup.cpp,
+ src/scim_anthy_setup_romaji.cpp, src/scim_anthy_style_file.{cpp,h}:
+ Refactoring.
+
+2005-07-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_default_table.{cpp,h}, scim_anthy_key2kana_table.cpp:
+ Split voiced consonant rule from kana typing table.
+
+2005-07-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_preedit.{cpp,h}:
+ Revive set_typing_method() and get_typing_method() of Preedit class.
+
+2005-07-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_color_button.cpp: Remove compile time & run time warnings.
+
+2005-07-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.cpp, src/scim_anthy_setup.cpp: Fix typo.
+ * po/POTFILES.in, po/ja.po: Update.
+
+2005-07-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Set border width of color choice button.
+ * po/ja.po: Update.
+
+2005-07-06 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.cpp, src/scim_anthy_imengine.{cpp,h},
+ src/scim_anthy_prefs.{cpp,h}:
+ Add "Do nothing" action to disable a certain key event such as the space
+ key. It may be needed to use the space key as thumb shift key, or to
+ insert a space at a release event of space key, not a press event.
+
+2005-07-06 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Fixed order of buttons for showing/hiding
+ toolbar items.
+
+2005-07-06 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_nicola.{cpp,h}: Fix a problem that NicolaConvertor
+ ignores a shift modifiered key event.
+
+2005-07-06 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/Makefile.am, src/scim_anthy_default_tables.{cpp,h},
+ src/scim_anthy_imengine.{cpp,h}, src/scim_anthy_key2kana.{cpp,h},
+ src/scim_anthy_key2kana_base.h, src/scim_anthy_key2kana_table.h,
+ src/scim_anthy_nicola.{cpp,h}, src/scim_anthy_preedit.{cpp,h},
+ src/scim_anthy_reading.{cpp,h}, src/scim_anthy_setup.cpp:
+ Started to implement NICOLA support.
+
+2005-07-04 Hiroyuki Ikezoe <poincare@ikezoe.net>
+
+ * src/scim_anthy_conversion.cpp:
+ Removed foreground attribute from selected segment text
+ since Gecko handles text as reversed text if foreground color is set.
+
+2005-07-04 Hiroyuki Ikezoe <poincare@ikezoe.net>
+
+ * src/scim_color_button.{cpp,h},
+ src/scim_anthy_setup.cpp:
+ Use String class for color value.
+
+2005-07-03 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty: Fixed typo.
+ src/scim_anthy_factory: Raise priority of PageUp and PageDown.
+ Thanks AWASHIRO ikuya.
+
+2005-07-01 Hiroyuki Ikezoe <poincare@ikezoe.net>
+
+ * data/scim-anthy-swap-colors.png,
+ src/scim_color_button.{cpp,h},
+ src/scim_anthy_conversion.{cpp,h},
+ src/scim_anthy_factory.{cpp,h},
+ src/scim_anthy_imengine.cpp,
+ src/scim_anthy_preedit.{cpp,h},
+ src/scim_anthy_prefs.{cpp,h},
+ src/scim_anthy_setup.cpp:
+ Preference of preedit and segment text color.
+
+2005-06-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-0.5.0.
+
+2005-06-28 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/Makefile.am: Add header files.
+
+2005-06-27 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup_romaji.cpp: Changed widget order.
+
+2005-06-27 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Minor bug fix.
+
+2005-06-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.{cpp,h}: Fixed order of configurations.
+
+2005-06-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.h: Remove needless code.
+
+2005-06-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imnegine.cpp: Reconvert before auto commit on
+ "Convert as you type".
+
+2005-06-24 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_preedit.{cpp,h}, src/scim_anthy_prefs.{cpp,h},
+ src/scim_anthy_setup.cpp:
+ Add preference to commit on inputting period or comma.
+ * po/ja.po: Update.
+
+2005-06-24 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_utils.{h,cpp}:
+ Move launch_program () into scim_anthy_utils.cpp
+ * src/scim_anthy_setup.cpp: Add "Launch" button for dictionary relates
+ commands.
+ * po/ja.po: Update.
+
+2005-06-24 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp:
+ Enable F6-F10 keys while "Convert as you type".
+
+2005-06-24 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.h: Make "Allow split romaji" setting as ture by
+ default.
+
+2005-06-24 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp:
+ Add "Input mode" and "Conversion mode" preference.
+ * po/ja.po: Update.
+
+2005-06-23 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp:
+ Add preference to show/hide conversion mode label on toolbar.
+ * po/ja.po: Update.
+
+2005-06-23 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Enable to delete letters on "Convert as
+ you type".
+
+2005-06-23 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Select last segment when start selecting
+ candidates on "Convert as you type".
+
+2005-06-23 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_imengine.{cpp,h}:
+ Started to implement "Convert as you type" feature.
+ * po/ja.po: Update.
+
+2005-06-23 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_key2kana.cpp: Make Key2KanaConvertor as case
+ insensitive by default.
+
+2005-06-23 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_action.cpp: Ignore CapsLock on matching key bindings.
+
+2005-06-23 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_utils.{cpp,h}:
+ Rotate case of alphabet letters on pressing F8, F9 and F10 key like ATOK
+ or Microsoft IME.
+ * TODO: update.
+
+2005-06-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.cpp: Set reading length to ConversionSegment
+ class correctly.
+
+2005-06-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.{cpp.h}: implement get_segment_length ()
+ of Conversion class correctly.
+
+2005-06-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.{cpp.h}, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_preedit.{cpp,h}:
+ Unify some functions.
+
+2005-06-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.{cpp,h}: Refactoring.
+
+2005-06-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.{cpp,h}: Added some members into
+ ConversionSegment class.
+
+2005-06-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.h: Swap F9 and F10.
+
+2005-06-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * TODO, data/atok.sty, data/msime.sty, po/ja.po,
+ src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_factory.cpp,
+ src/scim_anthy_imengine.{cpp,h}, src/scim_anthy_preedit.h,
+ src/scim_anthy_prefs.{cpp,h}:
+ Add half width conversion feature.
+ (The function binded to F8 key)
+
+2005-06-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Add "User defined" label for key theme.
+
+2005-06-21 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup_romaji.cpp: Add "User defined" label.
+
+2005-06-21 Takuro Ashie <ashie@homa.ne.jp>
+
+ * po/ja.po: Update.
+
+2005-06-20 Takuro Ashie <ashie@homa.ne.jp>
+
+ * po/POTFILES.in, po/ja.po: Update.
+
+2005-06-19 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty, data/msime.sty, src/scim_anthy_default_tables.cpp:
+ Add some symbols.
+
+2005-06-19 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_key2kana_table.cpp: Changed priority of tables.
+
+2005-06-15 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Changed page order.
+
+2005-06-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty: Remove needless entry in romaji table.
+ * data/msime.sty: Fix order of romaji table.
+
+2005-06-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_key2kana_table.cpp: Disable auto convert when
+ preedition is started with comma or period.
+ Thanks reporting > UTUMI-san.
+
+2005-06-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * scim_anthy_key2kana_table.cpp: Sorry, wrong comma table is set.
+
+2005-06-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_style_file.cpp: Set compare func to sort correctly.
+ Thanks reporting > UTUMI-san.
+
+2005-06-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_style_file.cpp: Don't reduce trailing space.
+
+2005-06-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_style_file.cpp: Bug fix.
+
+2005-06-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/msime.sty: Add "-" entry into romaji table.
+
+2005-06-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_style_file.cpp: Handle escaped "=" correctly.
+
+2005-06-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_style_file.cpp: Also "[" and "]" should be escaped.
+
+2005-06-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_style_file.cpp: Also "=" should be escaped.
+
+2005-06-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup_romaji.cpp: Fix typo.
+ * src/scim_anthy_style_file.cpp: Escape string.
+
+2005-06-10 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Minor fix.
+
+2005-06-09 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.h, scim_anthy_setup.{cpp,h}:
+ Split from scim_anthy_setup.cpp.
+
+2005-06-08 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Add romaji theme menu onto romaji window.
+ Thanks suggestion > UTUMI-san.
+ Also other minor bug fixes are made.
+
+2005-06-08 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Skip style files which contains no key bind
+ or romaji settings.
+
+2005-06-08 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Set fundamental key2kana table for kana
+ typing method as NULL. It's not support customizing yet.
+ * src/scim_anthy_setup.cpp: Code clean up.
+
+2005-06-08 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Make columns on romaji table as sortable.
+ Thank you for suggestion > UTUMI-san.
+
+2005-06-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp:
+ Don't allow inserting non-ascii character for romaji string.
+ Set sensitivity of add button on romaji window.
+
+2005-06-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Minor tunings for adding romaji.
+
+2005-06-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Implement add button on romaji table, but
+ it's not enough yet. Exception handling is too poor.
+
+2005-06-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Add entries to edit romaji, but it doesn't
+ work yet.
+ * po/ja.po, po/POTFILES.in: Update.
+
+2005-06-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Reset preedit string on changing input
+ mode.
+
+2005-06-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Set sensitivity of remove button on romaji
+ window.
+
+2005-06-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty: Add some key bindings.
+
+2005-06-07 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_default_tables.cpp: Changed romaji order.
+ * src/scim_anthy_setup.cpp: Implement remove button of romaji window.
+
+2005-06-06 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_setup.cpp: Rename from scim_anthy_imengine_setup.cpp.
+
+2005-06-06 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_style_file.cpp: Bug fix.
+ * src/scim_anthy_imengine_setup.cpp: Add UI for cutomizing romaji table,
+ but it doesn't work yet.
+
+2005-06-04 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-0.4.3 (BRANCH_0_4_3 branch).
+
+2005-06-03 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.cpp, src/scim_anthy_imengine.{cpp,h},
+ src/scim_anthy_preedit.{cpp,h}, src/scim_anthy_reading.{cpp,h}:
+ Reading::commit -> Reading::finish.
+ Preedit::flush_pending -> Preedit::finish.
+
+2005-06-02 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/msime.sty: Fixed typo in romaji table.
+
+2005-06-02 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_action.{cpp,h}, src/scim_anthy_factory.cpp:
+ Fix for gcc-4.0. It's ad-hoc solution.
+ * src/scim_anthy_imengine.cpp: Fix indent.
+
+2005-06-02 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.{cpp,h}: Split from scim_anthy_imengine_setup.cpp
+
+2005-06-02 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_style_file.{cpp,h}:
+ Insert space before new section.
+ Remove "m_iconv" member from StyleLine.
+
+2005-06-01 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty, data/msime.sty: Add "Setting" section.
+
+2005-06-01 Takuro Ashie <ashie@homa.ne.jp>
+
+ * Makefile.am, scim_anthy_imengine_setup.cpp,
+ scim_anthy_style_file.cpp, scim_anthy_style_file.h:
+ Add test code for switching romaji table.
+
+2005-06-01 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_style_file.cpp: Add functions deleting key/section &
+ adding new section.
+
+2005-06-01 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty, data/msime.sty: Add "n" entry for romaji table.
+
+2005-06-01 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.cpp: Sorry, previous code had a clash bug.
+
+2005-06-01 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_factory.cpp, src/scim_anthy_factory.h,
+ src/scim_anthy_imengine.cpp, src/scim_anthy_key2kana.cpp,
+ src/scim_anthy_key2kana.h, src/scim_anthy_key2kana_table.cpp,
+ src/scim_anthy_key2kana_table.h, src/scim_anthy_style_file.cpp,
+ src/scim_anthy_style_file.h:
+ Add test code for loading a custom romaji table.
+ If you want to test it, please copy data/atok.sty or data/msime.sty to
+ ~/.scim/Anthy/config.sty, and edit it. Currently AdditionalTableList
+ isn't loaded yet.
+
+2005-05-31 Takuro Ashie <ashie@homa.ne.jp>
+
+ * po/ja.po: Fix typo.
+
+2005-05-31 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine_setup.cpp: Add UI for switching romaji table,
+ but it doesn't work yet.
+
+2005-05-31 Takuro Ashie <ashie@homa.ne.jp>
+
+ * TODO: Update.
+
+2005-05-30 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty, data/msime.sty: Minor fix.
+ * data/scim_style_file.{cpp,h}: Add m_format_version and m_version.
+
+2005-05-30 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty, data/msime.sty: Remove ID entry.
+
+2005-05-30 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine_setup.cpp: Set "Key bindings" column as
+ resizable.
+
+2005-05-30 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine_setup.cpp: Add "Choose keys..." button for
+ key preference.
+
+2005-05-30 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine_setup.cpp: Add a label for key theme.
+
+2005-05-30 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.h: Revert.
+ * src/scim_anthy_imengine_setup.cpp: Save current key theme name.
+
+2005-05-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.h: Use space character for empty key bind.
+ * src/scim_anthy_imengine_setup.cpp: Add test UI for changing key theme.
+
+2005-05-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty: Fix wrong key bindings
+ * src/scim_anthy_imengine.cpp: Bug fixes for committing first or
+ selected segment.
+
+2005-05-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/msime.sty: Fix wrong key bindings.
+
+2005-05-28 Takuro Ashie <ashie@homa.ne.jp>
+
+ * scim_anthy_imengine_setup.cpp, scim_anthy_style_file.h:
+ Load style files.
+
+2005-05-28 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_preedit.cpp:
+ get_current_segment_pos() -> get_segment_pos().
+
+2005-05-28 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_utils.{cpp,h}:
+ Split from scim_anthy_preedit.{cpp,h}.
+
+2005-05-27 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_key2kana.{cpp,h}:
+ Rename from scim_anthy_key2kana_convertor.{cpp,h}.
+ * src/scim_anthy_factory.{cpp,h}:
+ Rename from scim_anthy_imengine_factory.{cpp,h}.
+
+2005-05-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_preedit.cpp: Fix length of vocied consonant in half
+ width katakana letters. Thanks reporting! > Seiichi SATO
+
+2005-05-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_reading.cpp, src/scim_anthy_reading.h:
+ Split the segment when append a letter between letters in the segment.
+
+2005-05-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_reading.cpp: Reset values for caret position when
+ segment is splitted.
+
+2005-05-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_reading.cpp: Make enable to split a segment which
+ contains only alphabet letters.
+
+2005-05-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine_setup.cpp:
+ Add a check button for the preference to split ReadingSegment.
+ * po/ja.po: Update.
+
+2005-05-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine_factory.cpp,
+ src/scim_anthy_imengine_factory.h, src/scim_anthy_preedit.cpp,
+ src/scim_anthy_preedit.h, src/scim_anthy_prefs.h,
+ src/scim_anthy_reading.cpp, src/scim_anthy_reading.h:
+ Add a setting to choose whether allow splitting ReadingSegment or not.
+
+2005-05-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_reading.{cpp,h}: Make enable to choose whether allow
+ splitting ReadingSegment or not on Reading::erase().
+
+2005-05-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_reading.cpp: Bug fixes for previous commited code.
+
+2005-05-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_reading.cpp: Make enable to split ReadingSegment.
+
+2005-05-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_dfault_table.{cpp,h},
+ src/scim_anthy_key2kana_table.cpp:
+ Split consonant rule from fundamental table.
+
+2005-05-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_preedit.cpp: Sorry, new erase() implementation didn't
+ work correctly on certain condition.
+
+2005-05-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_default_table.cpp, src/scim_anthy_default_table.h:
+ Rename from src/scim_anthy_key2kana_table_default.{cpp,h}.
+
+2005-05-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h:
+ Erase commited string in m_reading.
+
+2005-05-24 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h
+ src/scim_anthy_reading.cpp. src/scim_anthy_reading.h:
+ Fixed arguments and implementation of Reading::erase().
+
+2005-05-24 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h:
+ Minor fix.
+ * src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h,
+ src/scim_anthy_reading.cpp, src/scim_anrhy_reading.h:
+ Divide. Currently partial commiting is broken.
+
+2005-05-18 Takuro Ashie <ashie@homa.ne.jp>
+
+ * all files: Use "scim_anthy" name space.
+
+2005-05-17 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Sorry, AM_INIT_AUTOMAKE(1.9), not AM_PREREQ.
+
+2005-05-17 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-0.4.2 (BRANCH_0_4_0 branch).
+
+2005-05-17 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Add AM_PREREQ & AC_PREREQ.
+
+2005-05-17 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.src/scim_anthy_imengine.cpp: Clean up.
+
+2005-05-17 Takuro Ashie <ashie@homa.ne.jp>
+
+ * po/ja.po: Fix typo. Thanks DAIRIKI-san.
+
+2005-05-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/configure.ac: Version-0.4.1.
+ * NEWS: Uppdate.
+
+2005-05-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_preedit.cpp: Revive key mask checking to enable
+ apllication's short cut key on non-preedition state.
+ Thanks DAIRIKI-san.
+
+22005-05-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imegnine_table.cpp: Priority of symbol and number
+ tables are lower than comma and period.
+
+2005-05-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h:
+ Revive key mask checking to enable apllication's short cut key on
+ non-preedition state. Thanks DAIRIKI-san.
+ Rename AnthyPreeditChar to AnthyPreeditSegment, and remove "pending"
+ member.
+
+2005-05-16 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_intl.h, src/scim_anthy_key2kana_convertor.cpp,
+ src/scim_anthy_key2kana_convertor.cpp,
+ src/scim_anthy_key2kana_table.cpp, src/scim_anthy_key2kana_table.h,
+ src/scim_anthy_key2kana_table_default.cpp,
+ src/scim_anthy_key2kana_table_default.h:
+ Add.
+ * src/scim_anthy_conv_table.cpp, src/scim_anthy_conv_table.h,
+ src/scim_anthy_automaton.cpp, src/scim_anthy_automaton.h:
+ Remove.
+
+2005-05-15 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/configure.ac: Version-0.4.0.
+ * NEWS: Uppdate.
+
+2005-05-14 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine_setup.cpp: Set editable of key prefs entry to
+ FALSE.
+
+2005-05-13 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Remove mask checking to compile against
+ scim-1.3.0. Thanks UTUMI-san.
+
+2005-05-12 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine_setup.cpp: Add "Group:" label.
+ * po/ja.po: Update.
+
+2005-05-12 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/src/scim_anthy_imengine.h:
+ Restore visibility of preedit string and lookup table window on focus
+ in.
+
+2005-05-12 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h,
+ src/scim_anthy_imengine_factory.cpp,
+ src/scim_anthy_imengine_factory.h,
+ src/scim_anthy_imengine_setup.cpp, src/scim_anthy_preedit.cpp,
+ src/scim_anthy_preedit.h, src/scim_anthy_prefs.h:
+ Added learning preferences.
+
+2005-05-11 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine_factory.cpp: Don't reverse key list.
+
+2005-05-11 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Eat all key event while preediting.
+ * src/scim_anthy_preedit.cpp: Don't process space character.
+
+2005-05-11 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty, data/msime.sty: Fixed typo.
+
+2005-05-09 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-0.3.2 (BRANCH_0_3_0 branch).
+
+2005-05-09 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.h: Fixed typo.
+ Thanks to UTUMI-san & DAIRIKI-san.
+ * src/scim_anthy_preedit.cpp: Fixed some clash bugs.
+ This patch is contributed by Ryo Dairiki <ryo-dairiki@mbm.nifty.com>.
+ Thanks reporting.
+
+2005-05-03 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac, data/Makefile.am, src/Makefile.am: Install style file.
+
+2005-05-02 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/Makefile.am, src/scim_anthy_imengine_setup.cpp,
+ src/scim_anthy_style_file.cpp, src/scim_anthy_style_file.h:
+ Added style file parser.
+
+2005-05-02 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty, data/msime.sty: Added missing keys.
+
+2005-05-02 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.h, data/msime.sty: Fixed typo.
+
+2005-05-02 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty, data/msime.sty: Fixed typo.
+
+2005-05-02 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty, data/msime.sty: Minor fix.
+
+2005-04-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anhy_imengine_setup.cpp, src/scim_anthy_imengine.cpp,
+ po/ja.po:
+ Fixed typo.
+
+2005-04-27 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h,
+ src/scim_anthy_imengine_factory.cpp,
+ src/scim_anthy_imengine_setup.cpp,
+ src/scim_anthy_prefs.h:
+ Add hiragana mode, katakana mode, circle typing method keys.
+ * po/ja.po: Update.
+
+2005-04-27 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h,
+ src/scim_anthy_imengine_factory.cpp,
+ src/scim_anthy_imengine_setup.cpp,
+ src/scim_anthy_prefs.h:
+ Add key bindings to inserting half & wide space.
+ * po/ja.po: Update.
+
+2005-04-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_style_file.cpp, src/scim_anthy_style_file.h: Add.
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h,
+ src/scim_anthy_imengine_factory.cpp,
+ src/scim_anthy_imengine_setup.cpp, scim_anthy_prefs.h:
+ Add key binding for selecting first & last candidate.
+
+2005-04-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty: Add key bindings.
+ * data/msime.sty: Fix some entries.
+
+2005-04-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/atok.sty: Added ATOK like style definition file.
+
+2005-04-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/msime.sty: Add Version field.
+
+2005-04-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * data/msime.sty: Added Microsoft IME like style definition file.
+
+2005-04-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conv_table.cpp: Don't treat "-" as symbol.
+ Thanks to UTUMI-san.
+
+2005-04-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine_setup.cpp: Minor fixes.
+
+2005-04-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine_setup.cpp: Add description field to key list
+ view.
+ * po/ja.po: Update.
+
+2005-04-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h,
+ src/scim_anthy_imengine_factory.cpp,
+ src/scim_anthy_imengine_setup.cpp, src/scim_anthy_preedit.cpp,
+ src/scim_anthy_preedit.h, src/scim_anthy_prefs.h:
+ Add inserting space & alternative space action.
+
+2005-04-22 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine_setup.cpp: Use new key list view.
+ * src/scim_anthy_prefs.h: Remove some wasted key settings.
+ * po/ja.po: Update.
+
+2005-04-21 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine_setup.cpp: Now start to create a new key
+ preference widget.
+
+2005-04-21 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine_factory.cpp: Fixed typo.
+
+2005-04-21 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine_factory.cpp,
+ src/scim_anthy_imengine_factory.h, src/scim_anthy_imengine_setup.cpp,
+ src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h,
+ src/scim_anthy_prefs.h:
+ Added preference for ten key.
+
+2005-04-21 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Remove debug code.
+ * src/scim_anthy_preedit.cpp: Always use half width character for
+ pressing keys on key pad. This feature should be customizable.
+
+2005-04-21 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_preedit.cpp,
+ src/scim_anthy_preedit.h:
+ Added key pad support.
+
+2005-04-21 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h,
+ src/scim_anthy_imengine_factory.cpp,
+ src/scim_anthy_imengine_factory.h:
+ Apply most preferences immediately.
+
+2005-04-20 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Added mnemonic.
+ * po/ja.po: Updated.
+
+2005-04-20 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.cpp: Don't show the typing method label by
+ default.
+
+2005-04-20 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine_factory.cpp,
+ src/scim_anthy_imengine_factory.h, src/scim_anthy_imengine_setup.cpp,
+ src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h,
+ src/scim_anthy_prefs.h: Added preferences for symbols & numbers width.
+ * po/ja.po: Updated.
+
+2005-04-20 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Refactoring.
+ * src/scim_anthy_prefs.h: Fixed typo.
+ * po/ja.po: Updated.
+
+2005-04-19 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_conv_table.cpp, src/scim_anthy_conv_table.h,
+ src/scim_anthy_preedit.cpp:
+ Fixed naming rule of conversion tables.
+ Divide symbol & number conversion rule from roma-kana table.
+
+2005-04-19 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/conv_table.cpp: Remove.
+ * src/scim_anthy_conv_table.cpp: Renamed from src/conv_table.cpp
+ * src/scim_anthy_conv_table.h: Added.
+ * src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h,
+ src/scim_anthy_imengine.h:
+ Rename Preedit class to AnthyPreedit.
+
+2005-04-18 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/conv_table.cpp: Added wide number rule.
+ * src/scim_anthy_prefs.h: Fixed some key name.
+
+2005-03-21 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Modified labels for input mode to make
+ easy to recognize.
+
+2005-03-15 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine_factory.cpp,
+ src/scim_anthy_imengine_factory.h, intl.h:
+ Divided from scim_anthy_imengine.{cpp,h}.
+ * src/scim_anthy_action.cpp, src/scim_anthy_action.h,
+ src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h,
+ Introduced action manager.
+ * po/POTFILES.in, ja.po: Updated.
+
+2005-02-01 Hiroyuki Ikezoe <poincare@ikezoe.net>
+
+ * src/scim_anthy_imengine.cpp:
+ Removed comment lines about commiting the preediting string when
+ focusing out. It should not be so.
+ We need get the event(?) of switching off scim and clear the preedit
+ string at that time.
+
+2005-01-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * Applied patches provided by David Oftedal <david@start.no> and
+ Yukiko Bando <ybando@k6.dion.ne.jp> to input some symbols.
+ Thank you!
+
+2005-01-29 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Version-0.3.1.
+ Updated automake (no changes in source code).
+
+2005-01-27 Takuro Ashie <ashie@homa.ne.jp>
+
+ * configure.ac: Inclemented version number.
+
+2005-01-27 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h,
+ src/scim_anthy_imengine_setup.cpp, src/scim_anthy_prefs.h, po/ja.po:
+ Added an option to close candidate window on direct selecting.
+
+2005-01-27 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h,
+ src/scim_anthy_imengine_setup.cpp, src/scim_anthy_prefs.h, po/ja.po:
+ Enabled to select keys to select candidates directly.
+
+2005-01-27 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine_setup.cpp:
+ Added popup menu to switching notebook pages.
+
+2005-01-02 Hiroyuki Ikezoe <poincare@ikezoe.net>
+
+ * src/scim_anthy_imengine.cpp:
+ Applied the patch from james Su <james.su@gmail.com>.
+ Do not disconnect a signal-slot with in the slot function.
+
+2004-12-24 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Clear preedit string on reset().
+ See http://lists.freedesktop.org/pipermail/scim/2004-December/001298.html
+ for more detail.
+
+2004-12-17 Hiroyuki Ikezoe <poincare@ikezoe.net>
+
+ * src/scim_anthy_imengine.cpp:
+ Comment out action_commit() in foucs_out().
+
+2004-12-15 Hiroyuki Ikezoe <poincare@ikezoe.net>
+
+ * src/scim_anthy_imengine.cpp, src/scim_anthy_preedit.cpp:
+ Fixed a bug that Up key indicates 'R' on LC_CTYPE=en_US.UTF-8
+ environment.
+
+2004-12-15 Hiroyuki Ikezoe <poincare@ikezoe.net>
+
+ * src/scim_anthy_imengine.cpp:
+ Fixed a bug that dead key does not work.
+
+2004-12-15 Hiroyuki Ikezoe <poincare@ikezoe.net>
+
+ * src/scim_anthy_imengine.cpp:
+ Applied two patches from James Su.
+ It fixed
+ http://lists.sourceforge.jp/mailman/archives/scim-imengine-dev/2004-December/000041.html
+
+2004-12-02 Hiroyuki Ikezoe <poincare@ikezoe.net>
+
+ * src/scim_anthy_imengine_setup.cpp:
+ Fixed an issue that left arrow on the left of the tab label
+ is enabled on starup time.
+
+2004-12-02 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Remove dictionary label string.
+
+2004-12-02 Takuro Ashie <ashie@homa.ne.jp>
+ * po/ja.po, src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h,
+ src/scim_anthy_imengine_setup.cpp, src/scim_anthy_prefs.h:
+ Added key bindings for dictionary related actions.
+
+2004-12-01 Takuro Ashie <ashie@homa.ne.jp>
+
+ * po/ja.po, src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h,
+ src/scim_anthy_imengine_setup.cpp, src/scim_anthy_prefs.h:
+ Add dictionary menu.
+ * src/scim_anthy_preedit.cpp: bug fix.
+
+2004-12-01 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.h: Added Zenkaku_Hankaku and Shift+space key
+ bind for toggling latin mode. Thanks suggestion > UTUMI-san
+
+2004-11-30 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine_setup.cpp: Changed page order.
+ Thank your for your suggestion > UTUMI Hirosi <utuhiro78@yahoo.co.jp>
+
+2004-11-30 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/conv_table.cpp, src/scim_anthy_imengine_setup.cpp,
+ src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h,
+ src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h,
+ src/scim_anthy_prefs.h:
+ Added a comma and period type. Also other minor fixes are made.
+
+2004-11-30 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine_setup.cpp: Declare some functions as static.
+
+2004-11-30 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine_setup.cpp: Set tooltips.
+
+2004-11-29 Hiroyuki Ikezoe <poincare@ikezoe.net>
+
+ * version 0.2.0.
+
+2004-11-27 Hiroyuki Ikezoe <poincare@ikezoe.net>
+
+ * src/scim_anthy_imengine.cpp: pressing space key
+ at the tail of candidates returns the head of the candidates.
+
+2004-11-27 Hiroyuki Ikezoe <poincare@ikezoe.net>
+
+ * src/scim_anthy_imengine.cpp: select next/prev candidate is loop.
+ But there is a bug that pressing space key at the tail of the candidates
+ cannot be moved at the head of the candidates. Why?
+
+2004-11-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_imengine.cpp: Bug fix for selecting candidate by
+ SCIM_KEY_0.
+
+2004-11-26 Takuro Ashie <ashie@homa.ne.jp>
+
+ * src/scim_anthy_prefs.h: Added some key bindings.
+ Thank you for your suggestion > Yukiko Bando <ybando@k6.dion.ne.jp>
+
+2004-11-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * po/ja.po, src/scim_anthy_imengine_setup.cpp,
+ src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h,
+ src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h,
+ src/scim_anthy_prefs.h:
+ Added partial commit feature, but this work is not completed yet.
+ The caret position isn't reset yet.
+
+2004-11-25 Takuro Ashie <ashie@homa.ne.jp>
+
+ * po/ja.po, src/conv_table.cpp, src/scim_anthy_imengine.cpp,
+ src/scim_anthy_imengine.h, src/scim_anthy_imengine_setup.cpp,
+ src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h,
+ src/scim_anthy_prefs.h:
+ Added space type preference.
+
+2004-11-19 gettextize <bug-gnu-gettext@gnu.org>
+
+ * Makefile.am (SUBDIRS): Add intl,
+ (ACLOCAL_AMFLAGS): New variable.
+ (EXTRA_DIST): New variable.
+ * configure.ac (AC_CONFIG_FILES): Add intl/Makefile,
+
+2004-11-19 Takuro Ashie <ashie@homa.ne.jp>
+
+ * Implemented almost all basic features.
--- /dev/null
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
+Foundation, Inc.
+
+ This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. (Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.)
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
+
+ ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory. After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=PATH' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the `--target=TYPE' option to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+ Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+will cause the specified gcc to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+`configure' Invocation
+======================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+ Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
+
--- /dev/null
+## Copyright (C) 2004 Hiroyuki Ikezoe
+## Copyright (C) 2004-2005 Takuro Ashie
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+SUBDIRS = intl po m4 src data
+
+ACLOCAL_AMFLAGS = -I m4
+
+EXTRA_DIST = config.rpath
--- /dev/null
+Overview of Changes from scim-anthy-1.2.6 to scim-anthy-1.2.7
+==============================================================
+* Changed default encoding (for getting strings from Anthy) to UTF-8.
+* Now NICOLA engine is case sensitive.
+
+Overview of Changes from scim-anthy-1.2.5 to scim-anthy-1.2.6
+==============================================================
+* Fix packaging misstake.
+* Fix typo (Thanks Malcolm Parsons and Ikuya Awashiro).
+
+Overview of Changes from scim-anthy-1.2.4 to scim-anthy-1.2.5
+==============================================================
+* Fixed a build problem against gcc-4.3.
+* Addd de.po (Thanks Gerrit Sangel).
+* Added a style file for NICOLA-F layout (Thanks MORIYAMA Masayuki).
+* Sort style list by name.
+
+Overview of Changes from scim-anthy-1.2.3 to scim-anthy-1.2.4
+==============================================================
+* Fixed a bug that a character which is possible to become a voiced consonant
+ is gone after inputing "Ro" has been fixed.
+* Fixed a name collision issue of ScimColorButton. Now you can use scim-anthy
+ with scim-chewing, maybe.
+
+Overview of Changes from scim-anthy-1.2.2 to scim-anthy-1.2.3
+==============================================================
+* Fix install path of helper module.
+* Distinguish two backslash key of jp106 keybord. It requires scim-1.4.6.
+ Please clear ~/.scim/config after install scim-1.4.6.
+* Some minor fixes.
+
+Overview of Changes from scim-anthy-1.2.1 to scim-anthy-1.2.2
+==============================================================
+* Fix a bug that a wrong partial string is converted on direct kana conversion
+ after commiting a piece of segments.
+
+Overview of Changes from scim-anthy-1.2.0 to scim-anthy-1.2.1
+==============================================================
+* Fix a problem that the romaji pending state aren't restored on pressing a
+ backspace or moving the caret has been fixed.
+ (Thanks Ryo Dairiki and Akira TAGOH)
+* Add a dictionary encoding preference into setup UI.
+* Revert the default dictionary encoding preference to EUC-JP.
+* Other minor fixes (Thanks Sutou).
+
+Overview of Changes from scim-anthy-1.0.0 to scim-anthy-1.2.0
+==============================================================
+* Add pseudo ASCII input mode. It enables users to enter ASCII letters during
+ Japanese mode. Thanks Akira TAGOH for your patch.
+* Enable reconversion feature on non-GTK+ application (It's a ad-hoc solition).
+ Thanks Takashi Nakamoto.
+* Enable to choose behavior on focus out.
+* Add predict key into some key bindings themes. Thanks Ikuya Awashiro.
+* Try EUC-JP-MS first when convert characters from Anthy to Unicode.
+* Add tsuki layout into the list of kana typing layouts. Thanks Sugi.
+* The bug that direct select keys doesn't work during predicting has been fixed.
+ Thanks TAGOH, UTUMI, Bando for your report.
+* Fix some wrong entries in Romaji tables. Thanks Jun Oizumi.
+* Fix a bug that commited clauses aren't cleared when the learning preferenece
+ is disabled. Thanks Jun Oizumi.
+
+Overview of Changes from scim-anthy-0.9.0 to scim-anthy-1.0.0
+==============================================================
+* Add symbol style preference (Thanks Akira TAGOH).
+* Don't activate direct select key when the lookup window isn't shown
+ (Thanks Akira TAGOH).
+* Fix credit.
+
+Overview of Changes from scim-anthy-0.8.0 to scim-anthy-0.9.0
+=============================================================
+* Add SKIM support (Provide as external package).
+* Add prediction key bindings to ATOK like key bindings theme.
+* Ensure to through space key event to enable application's specific feature
+ like Mozilla's scrolling feature (Thanks reporting > Yukiko Bando).
+* Fix double commiting bug on Wide Latin mode.
+ (Thanks Ryo Dairiki and UTUMI Hirosi)
+* Other minor fixes.
+
+Overview of Changes from scim-anthy-0.7.1 to scim-anthy-0.8.0
+=============================================================
+* Now scim-anthy requires scim-1.2.0 or later.
+* Add prediction feature.
+* Add reconversion feature. It can reconvert already commited string.
+ Currently this feature will be enabled only on Gtk+2.
+* Default thumb shift layout has been improved.
+* Add timer for thumb shift layout.
+* Some key bindings are modified. Please select "Default" key bindings theme
+ in the setup window once to upgrade safely.
+* Add Wnn like style file.
+* Add TRON layout. Thanks Okano Shinchi.
+* Apply ten key setting exactly on all input modes.
+* Add help text.
+
+Overview of Changes from scim-anthy-0.7.0 to scim-anthy-0.7.1
+=============================================================
+* Fix a bug that sicm-setup crashes when close romaji editor.
+
+Overview of Changes from scim-anthy-0.6.1 to scim-anthy-0.7.0
+=============================================================
+* Show dictionary menu on the panel by default.
+ It uses kasumi (http://kasumi.sourceforge.jp/).
+ It's very important package for scim-anthy.
+ Distributors, please install also kasumi when install scim-anthy.
+* Enable to customize NICOLA table.
+* Replace the scim-anthy icon with new one. Thanks SHIMODA-san.
+* Show all key bindings on key bindings view by default.
+* Add some style files (Canna, VJE-Delta).
+* Fix typo in some style files.
+
+Overview of Changes from scim-anthy-0.6.0 to scim-anthy-0.6.1
+=============================================================
+* The bug that some key bindings is dead has been fixed.
+ Thanks Ryo Dairiki.
+* The bug that custom typing tables aren't set correctly has been fixed.
+* Pluged a memory leak.
+
+Overview of Changes from scim-anthy-0.5.3 to scim-anthy-0.6.0
+=============================================================
+* Method of loading romaji table has been changed.
+ Old user settings will be cleared when you change it by scim-setup.
+* Add preedit color preference.
+* Add some prefereneces for lookup window.
+* Add AZIK extended romaji table.
+* Enable to customize kana typing table.
+* Add a kana table for 101 keyborad.
+* Support kana key symbols of X Window System.
+ But this feature has some limitations:
+ - You can't switch to X's kana typing mode from scim-anthy.
+ You should customize /etc/X11/xorg.conf to switch it.
+ See http://ikumi.revery.net/cmp/kanainputonx.htm for more details.
+ - Typing method indicator on the panel can't indicate X's kana lock state.
+* Experimental NICOLA support.
+* Other minor fixes.
+
+Overview of Changes from scim-anthy-0.5.2 to scim-anthy-0.5.3
+=============================================================
+* Fix a wrong key binding in the Microsoft IME like key bindings.
+
+Overview of Changes from scim-anthy-0.5.1 to scim-anthy-0.5.2
+=============================================================
+* The bug that preferences of period, comma and width of numbers aren't
+ applied correctly has been fixed.
+
+Overview of Changes from scim-anthy-0.5.0 to scim-anthy-0.5.1
+=============================================================
+* The bug that some letters cannot be typed correctly on kana typing mode has
+ been fixed.
+* The bug that some key bindings of ATOK style aren't set correctly has been
+ fixed. (Thanks AWASHIRO Ikuya)
+
+Overview of Changes from scim-anthy-0.4.3 to scim-anthy-0.5.0
+=============================================================
+* Enable to customize romaji table.
+* Add "Key bindings theme" and "Romaji table theme" features.
+ (Thank you for testing and many suggestions > UTUMI-san and Bando-san)
+* Add "Convert as you type" feature.
+* Enable to split a romaji sequence. (Thanks! DAIRIKI-san)
+* Enable to rotate case of alphabet letters on pressing F8, F9 and F10 key like ATOK or Microsoft IME.
+* Other minor bug fixes. (Thanks! UTUMI-san, SATO-san)
+
+Overview of Changes from scim-anthy-0.4.2 to scim-anthy-0.4.3
+=============================================================
+* Fix for gcc-4.0. Thanks UTUMI-san.
+* Fix a bug that selecting first & last candidate feature doesn't work.
+ Thanks BANDO-san.
+
+Overview of Changes from scim-anthy-0.4.1 to scim-anthy-0.4.2
+=============================================================
+* Fix typo in Japanese message (Thanks! DAIRIKI-san).
+* Update automake version because previous version reduce filename extension
+ of the module.
+
+Overview of Changes from scim-anthy-0.4.0 to scim-anthy-0.4.1
+=============================================================
+* Fix a bug that scim-anthy eats all key events although it doesn't have
+ preedit string (Thanks! DAIRIKI-san).
+
+Overview of Changes from scim-anthy-0.3.2 to scim-anthy-0.4.0
+=============================================================
+* Add preference for width of symbols and numbers.
+* Add ten keys support.
+* Enable to insert a alternative width space by "Shift + Space".
+ Now this key binding doesn't use as changing input mode by default anymore.
+* Modify to apply most preferences immediately.
+* Refine key bindings preference.
+* Add some miscellaneous key bindings.
+* Add preferences for learning.
+* Modify label text on toolbar to make easy to recognize.
+* Don't show typing method label on toolbar by default anymore.
+* Add some symbols to romaji-table (Thanks! David Oftedal and Yukiko Bando).
+* Other minor bug fixes (Thaks! UTUMI Hirosi).
+
+Overview of Changes from scim-anthy-0.3.1 to scim-anthy-0.3.2
+=============================================================
+* Fixed a bug that the 10th candidate on the lookup window can't be selected by
+ direct selecting key. To enable this, please clear previous setting
+ ("/IMEngine/PRIME/SelectCandidates10Key" in ~/.scim/config).
+ Thanks to UTUMI-san and DAIRIKI-san.
+* Fixed some clash bugs. Thanks to DAIRIKI-san.
+
+Overview of Changes from scim-anthy-0.3.0 to scim-anthy-0.3.1
+=============================================================
+* Update automake version.
+
+Overview of Changes from scim-anthy-0.2.0 to scim-anthy-0.3.0
+=============================================================
+* Enable to select short cut keys to choose candidate directly.
+* Added an option to close candidate window on direct selecting.
+* Added period and comma style preference.
+* Launch dictionary administration tools from toolbar or short cut key.
+* Fixed a bug which clashes the scim-setup when reload the config.
+ (Thanks! James Su)
+* Other minor fixes (Thanks! UTUMI-san, Bando-san)
+
+scim-anthy-0.2.0
+=============================================================
+* Initial release.
--- /dev/null
+1. What's this?
+===============
+
+scim-anthy is a SCIM IMEngine module for anthy.
+
+SCIM is Smart Common Input Method platform, it provides user friendly/full
+featured user interface and development platform to make input method
+developer's life easier.
+
+Anthy is a system for Japanese input method.
+It converts Hiragana text to Kana Kanji mixed text.
+
+scim-anthy provides some usefull user interfaces for Anthy using SCIM.
+
+
+2. Requirements
+===============
+
+2.1 Necessary
+
+ * scim-1.2.0 or later.
+ - http://www.scim-im.org/
+
+ * Anthy-5100 or later.
+ - http://anthy.sourceforge.jp/
+ - http://sourceforge.jp/projects/anthy/
+
+3.2 Optional
+
+ * kasumi-0.6 or later:
+ - Dictionary management tool. Invoked from scim-anthy.
+ - http://kasumi.sourceforge.jp/
+
+
+3. Install
+==========
+
+ You can build & install scim, anthy, and scim-anthy by following command:
+
+ $ ./configure
+ $ make
+ # make install
+
+ If you installed the SCIM into /usr/local or any other non-standard
+ diretories, you should specify the PKG_CONFIG_PATH environment variable like
+ this:
+
+ $ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure
+
+ You'll find distribution-specific installation method from following site:
+
+ http://home.nyc.rr.com/computertaijutsu/jpninpt.html
+
+
+4. Usage
+========
+
+Yukiko Bando wrote some efficient documents of scim-anthy.
+These documents are written for Mandriva users, but also usefull for all users
+using other distributions.
+
+Please see them to learn usage of the scim-anthy:
+
+ * http://www.h4.dion.ne.jp/~apricots/scim-anthy/howto.html
+ * http://www.h4.dion.ne.jp/~apricots/scim-anthy/romakana.html
+
+
+5. License
+==========
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+6. Credit
+=========
+
+Special thanks to all scim-anthy developers and users!
+
+ * Hiroyuki Ikezoe <poincare at ikezoe.net>
+ - Originator of this project.
+
+ * Takuro Ashie <ashie at homa.ne.jp>
+ - Developer.
+
+ * SHIMODA Hiroshi <piro@p.club.ne.jp>
+ - Art work.
+
+ * James Su <james.su at gmail.com>
+ - Anthor of scim
+
+ * Yusuke Tabata <yusuke at cherubim.icw.co.jp>
+ - Author of Anthy.
+
+ * Yukiko Bando <ybando at k6.dion.ne.jp>
+ - Wrote some efficient documents of scim-anthy.
+
+ * UTUMI Hirosi <utuhiro78 at yahoo.co.jp>
+ - Packager of RPM package for Mandriva.
+
+ * Ryo DAIRIKI <ryo-dairiki at users.sourceforge.jp>
+ - Packager of RPM package for Fedora Core.
+
+ * Mike Fabian <mfabian at suse.de>
+ - Packager of RPM package for SUSE.
+
+ * Ikuya AWASHIRO <ikuya at oooug.jp>
+ - Packager of deb package for Debian and Ubuntu.
+
+ * Mamoru Komachi <usata at usata.org>
+ - Packager of Gentoo package.
--- /dev/null
+#! /bin/sh
+
+set -x
+aclocal -I m4
+autoheader
+libtoolize -c --automake
+automake --add-missing --copy --include-deps
+autoconf
+## @end 1
--- /dev/null
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+# Inc.
+
+timestamp='2007-03-06'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# 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.
+
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[45])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep __LP64__ >/dev/null
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ case ${UNAME_MACHINE} in
+ pc98)
+ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:[3456]*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ EM64T | authenticamd)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ arm*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+ exit ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+ echo frv-unknown-linux-gnu
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ mips:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips64
+ #undef mips64el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mips64el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips64
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ or32:Linux:*:*)
+ echo or32-unknown-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit ;;
+ xtensa:Linux:*:*)
+ echo xtensa-unknown-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+ # Set LC_ALL=C to ensure ld outputs messages in English.
+ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported targets: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_targets" in
+ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+ ;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+ exit ;;
+ coff-i386)
+ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+ exit ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+ exit ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #ifdef __ELF__
+ # ifdef __GLIBC__
+ # if __GLIBC__ >= 2
+ LIBC=gnu
+ # else
+ LIBC=gnulibc1
+ # endif
+ # else
+ LIBC=gnulibc1
+ # endif
+ #else
+ #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^LIBC/{
+ s: ::g
+ p
+ }'`"
+ test x"${LIBC}" != x && {
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit
+ }
+ test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ c34*)
+ echo c34-convex-bsd
+ exit ;;
+ c38*)
+ echo c38-convex-bsd
+ exit ;;
+ c4*)
+ echo c4-convex-bsd
+ exit ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
--- /dev/null
+#! /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 <gord@gnu.ai.mit.edu>, 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 <kc5tja@dolphin.openprojects.net> 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=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
--- /dev/null
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+# Inc.
+
+timestamp='2007-01-18'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# 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.
+
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray)
+ os=
+ basic_machine=$1
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | bfin \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | mcore | mep \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64vr | mips64vrel \
+ | mips64orion | mips64orionel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | mt \
+ | msp430 \
+ | nios | nios2 \
+ | ns16k | ns32k \
+ | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu | strongarm \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | z8k)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nios-* | nios2-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa-* \
+ | ymp-* \
+ | z8k-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16c)
+ basic_machine=cr16c-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
--- /dev/null
+# Process this file with autoconf to produce a configure script.
+AC_PREREQ(2.59)
+# base on scim-anthy-1.2.7
+AC_INIT(ise-engine-anthy, 0.0.0125, ashie@homa.ne.jp)
+AC_CONFIG_SRCDIR([configure.ac])
+
+# Save this value here, since automake will set cflags and cxxflags later
+cflags_set=${CFLAGS+set}
+cppflags_set=${CPPFLAGS+set}
+
+SCIM_ANTHY_MAJOR_VERSION=0
+SCIM_ANTHY_MINOR_VERSION=0
+SCIM_ANTHY_MICRO_VERSION=0125
+
+SCIM_ANTHY_VERSION=$SCIM_ANTHY_MAJOR_VERSION.$SCIM_ANTHY_MINOR_VERSION.$SCIM_ANTHY_MICRO_VERSION
+
+AC_SUBST(SCIM_ANTHY_MAJOR_VERSION)
+AC_SUBST(SCIM_ANTHY_MINOR_VERSION)
+AC_SUBST(SCIM_ANTHY_MICRO_VERSION)
+AC_SUBST(SCIM_ANTHY_VERSION)
+
+# Init automake stuff
+AM_INIT_AUTOMAKE(1.9)
+AM_CONFIG_HEADER(config.h)
+
+# Init gettext
+ALL_LINGUAS="de ja"
+AM_GNU_GETTEXT
+
+GETTEXT_PACKAGE=ise-engine-anthy
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext domain])
+
+# Init libtool
+AC_LIBTOOL_DLOPEN
+AC_PROG_LIBTOOL
+AC_LIB_LTDL
+AC_SUBST(LIBTOOL_DEPS)
+
+# Checks for programs.
+AC_PROG_CXX
+AC_PROG_CC
+AC_LANG(C++)
+
+AC_C_CONST
+AC_TYPE_SIZE_T
+
+# Checks for libraries.
+
+SCIM_VERSION=1.2.0
+
+PKG_CHECK_MODULES(SCIM,[isf >= $SCIM_VERSION])
+
+PKG_CHECK_MODULES(ECORE,[ecore])
+
+AC_SUBST(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])
+SCIM_HAS_GTKUTILS="no"
+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
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_FUNC_ALLOCA
+AC_CHECK_HEADERS([argz.h fcntl.h float.h inttypes.h langinfo.h libintl.h limits.h locale.h malloc.h stddef.h stdint.h stdio_ext.h stdlib.h string.h strings.h sys/param.h unistd.h wchar.h])
+
+# Checks for library functions.
+AC_SUBST(ac_aux_dir)
+
+# Checks for anthy
+AC_CHECK_HEADER(anthy/anthy.h, [], [AC_MSG_ERROR(anthy/anthy.h was not found.)])
+ANTHY_LIBS="-lanthy -lanthydic"
+ANTHY_CFLAGS=""
+AC_SUBST(ANTHY_LIBS)
+AC_SUBST(ANTHY_CFLAGS)
+
+
+# Check gtk2
+#PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.4.0],
+# [HAS_GTK=yes],
+# [HAS_GTK=no])
+HAS_GTK="no"
+AM_CONDITIONAL(SCIM_BUILD_HELPER, [test "$HAS_GTK" = "yes"])
+
+if test "$HAS_GTK" = "yes"; then
+ SCIM_BUILD_HELPER=1
+else
+ SCIM_BUILD_HELPER=0
+fi
+AC_SUBST(SCIM_BUILD_HELPER)
+
+# 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_DATADIR=`$PKG_CONFIG --variable=scimdatadir scim`
+SCIM_ICONDIR=`$PKG_CONFIG --variable=icondir scim`
+SCIM_MODULEDIR=`$PKG_CONFIG --variable=moduledir scim`
+
+if test "x$SCIM_DATADIR" = "x"; then
+ SCIM_DATADIR=${datadir}/scim
+fi
+
+if test "x$SCIM_ICONDIR" = "x"; then
+ SCIM_ICONDIR=${datadir}/scim/icons
+fi
+
+if test "x$SCIM_MODULEDIR" = "x"; then
+ SCIM_MODULEDIR=${libdir}/scim-1.0
+fi
+
+SCIM_ANTHY_DATADIR=${SCIM_DATADIR}/Anthy
+
+AC_SUBST(SCIM_DATADIR)
+AC_SUBST(SCIM_ICONDIR)
+AC_SUBST(SCIM_MODULEDIR)
+AC_SUBST(SCIM_ANTHY_DATADIR)
+
+AC_CONFIG_FILES([
+Makefile
+intl/Makefile
+po/Makefile.in
+m4/Makefile
+src/Makefile
+data/Makefile
+])
+
+AC_OUTPUT
--- /dev/null
+#
+# 101kana.sty - Kana typing table for 101 keyboard.
+# Copyright (C) 2005 Takuro Ashie <ashie@homa.ne.jp>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+FormatVersion = 0.0.0
+Encoding = EUC-JP
+Title = 101±Ñ¸ì¥¡¼¥Ü¡¼¥ÉÍѤ«¤ÊÇÛÎó
+Version = 0.0.0
+
+[KanaTable/FundamentalTable]
+# non modifiered keys
+~=¤í
+1=¤Ì
+2=,¤Õ
+3=¤¢
+4=¤¦
+5=¤¨
+6=¤ª
+7=¤ä
+8=¤æ
+9=¤è
+0=¤ï
+-=,¤Û
+\==,¤Ø
+
+q=,¤¿
+w=,¤Æ
+e=¤¤
+r=,¤¹
+t=,¤«
+y=¤ó
+u=¤Ê
+i=¤Ë
+o=¤é
+p=,¤»
+\[=¡«
+\]=¡¬
+\\=¤à
+
+a=,¤Á
+s=,¤È
+d=,¤·
+f=,¤Ï
+g=,¤
+h=,¤¯
+j=¤Þ
+k=¤Î
+l=¤ê
+;=¤ì
+'=,¤±
+
+z=,¤Ä
+x=,¤µ
+c=,¤½
+v=,¤Ò
+b=,¤³
+n=¤ß
+m=¤â
+\,=¤Í
+.=¤ë
+/=¤á
+
+# shift modifiered keys
+`=¤í
+!=¤Ì
+@=,¤Õ
+\#=¤¡
+$=¤¥
+%=¤§
+^=¤©
+&=¤ã
+*=¤å
+(=¤ç
+)=¤ò
+_=¡¼
++=¤ñ
+
+Q=,¤¿
+W=,¤Æ
+E=¤£
+R=,¤¹
+T=¥õ
+Y=¤ó
+U=¤Ê
+I=¤Ë
+O=¤é
+P=,¤»
+{=¡Ö
+}=¡×
+|=¤à
+
+A=,¤Á
+S=,¤È
+D=,¤·
+F=,¤î
+G=,¤
+H=,¤¯
+J=¤Þ
+K=¤Î
+L=¤ê
+:=¤ì
+"=¥ö
+
+Z=¤Ã
+X=,¤µ
+C=,¤½
+V=,¤ð
+B=,¤³
+N=¤ß
+M=¤â
+?=¡¦
--- /dev/null
+## Copyright (C) 2004 Hiroyuki Ikezoe
+## Copyright (C) 2004-2005 Takuro Ashie
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+MAINTAINERCLEANFILES = Makefile.in
+
+icondir = $(SCIM_ICONDIR)
+icon_DATA = scim-anthy.png \
+ scim-anthy-dict.png \
+ scim-anthy-swap-colors.png
+
+styledir = $(SCIM_ANTHY_DATADIR)/style
+style_DATA = atok.sty \
+ msime.sty \
+ canna.sty \
+ wnn.sty \
+ vje-delta.sty \
+ azik.sty \
+ 101kana.sty \
+ nicola-a.sty \
+ nicola-f.sty \
+ nicola-j.sty \
+ oasys100j.sty \
+ tron-dvorak.sty \
+ tron-qwerty-jp.sty \
+ tsuki-2-203-101.sty \
+ tsuki-2-203-106.sty
+EXTRA_DIST = $(icon_DATA) $(style_DATA)
--- /dev/null
+#
+# atok.sty - Justsytem ATOK like style definition file for scim-anthy.
+# Copyright (C) 2005 Takuro Ashie <ashie@homa.ne.jp>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+FormatVersion = 0.0.0
+Encoding = EUC-JP
+Title = ATOK
+Version = 0.0.0
+
+[KeyBindings]
+OnOffKey = Henkan,Eisu_toggle,Zenkaku_Hankaku
+CircleInputModeKey = F10
+CircleKanaModeKey =
+LatinModeKey =
+HiraganaModeKey = Hiragana_Katakana
+KatakanaModeKey = Shift+Hiragana_Katakana
+HalfKatakanaModeKey =
+CircleTypingMethodKey = Romaji,Alt+Romaji
+
+ConvertKey = space,Henkan,Shift+space,Shift+Henkan
+PredictKey = Tab
+CancelKey = Escape,BackSpace,Control+h,Control+bracketleft
+CommitKey = Return,Control+m
+ReconvertKey = Shift+Henkan
+
+InsertSpaceKey = space
+InsertAltSpaceKey = Shift+space
+BackSpaceKey = BackSpace,Control+h
+DeleteKey = Delete,Control+g
+
+MoveCaretBackwardKey = Left,Control+k
+MoveCaretForwardKey = Right,Control+l
+MoveCaretFirstKey = Control+Left
+MoveCaretLastKey = Control+Right
+
+SelectPrevSegmentKey = Shift+Left
+SelectNextSegmentKey = Shift+Right
+SelectFirstSegmentKey = Control+Left
+SelectLastSegmentKey = Control+Right
+ExpandSegmentKey = Right,Control+l
+ShrinkSegmentKey = Left,Control+k
+CommitSelectedSegmentKey = Down
+
+CandidatesPageUpKey = Shift+Henkan
+CandidatesPageDownKey = Henkan
+SelectNextCandidateKey = space,Tab,Henkan,Shift+space,Shift+Henkan
+SelectPrevCandidateKey = Up
+
+SelectCandidates1Key = 1
+SelectCandidates2Key = 2
+SelectCandidates3Key = 3
+SelectCandidates4Key = 4
+SelectCandidates5Key = 5
+SelectCandidates6Key = 6
+SelectCandidates7Key = 7
+SelectCandidates8Key = 8
+SelectCandidates9Key = 9
+SelectCandidates10Key = 0
+
+ConvertToHiraganaKey = F6,Control+u
+ConvertToKatakanaKey = F7,Control+i
+ConvertToHalfKey = F8,Control+o
+ConvertToHalfKatakanaKey = Shift+F8
+ConvertToWideLatinKey = F9,Control+p
+ConvertToLatinKey = F10,Control+at
+
+AddWordKey = Control+F7
+
+
+# Override fundamental table
+[RomajiTable/FundamentalTable]
+- = ¡¼
+#/ = ¡¦
+#[ = ¡Ö
+#] = ¡×
+a = ¤¢
+ba = ¤Ð
+be = ¤Ù
+bi = ¤Ó
+bo = ¤Ü
+bu = ¤Ö
+bya = ¤Ó¤ã
+bye = ¤Ó¤§
+byi = ¤Ó¤£
+byo = ¤Ó¤ç
+byu = ¤Ó¤å
+cha = ¤Á¤ã
+che = ¤Á¤§
+chi = ¤Á
+cho = ¤Á¤ç
+chu = ¤Á¤å
+cya = ¤Á¤ã
+cye = ¤Á¤§
+cyi = ¤Á¤£
+cyo = ¤Á¤ç
+cyu = ¤Á¤å
+da = ¤À
+de = ¤Ç
+dha = ¤Ç¤ã
+dhe = ¤Ç¤§
+dhi = ¤Ç¤£
+dho = ¤Ç¤ç
+dhu = ¤Ç¤å
+di = ¤Â
+do = ¤É
+du = ¤Å
+dwu = ¤É¤¥
+dya = ¤Â¤ã
+dye = ¤Â¤§
+dyi = ¤Â¤£
+dyo = ¤Â¤ç
+dyu = ¤Â¤å
+e = ¤¨
+fa = ¤Õ¤¡
+fe = ¤Õ¤§
+fi = ¤Õ¤£
+fo = ¤Õ¤©
+fu = ¤Õ
+fya = ¤Õ¤ã
+fye = ¤Õ¤§
+fyi = ¤Õ¤£
+fyo = ¤Õ¤ç
+fyu = ¤Õ¤å
+ga = ¤¬
+ge = ¤²
+gi = ¤®
+go = ¤´
+gu = ¤°
+gwa = ¤°¤¡
+gya = ¤®¤ã
+gye = ¤®¤§
+gyi = ¤®¤£
+gyo = ¤®¤ç
+gyu = ¤®¤å
+ha = ¤Ï
+he = ¤Ø
+hi = ¤Ò
+ho = ¤Û
+hu = ¤Õ
+hya = ¤Ò¤ã
+hye = ¤Ò¤§
+hyi = ¤Ò¤£
+hyo = ¤Ò¤ç
+hyu = ¤Ò¤å
+i = ¤¤
+ja = ¤¸¤ã
+je = ¤¸¤§
+ji = ¤¸
+jo = ¤¸¤ç
+ju = ¤¸¤å
+jya = ¤¸¤ã
+jye = ¤¸¤§
+jyi = ¤¸¤£
+jyo = ¤¸¤ç
+jyu = ¤¸¤å
+ka = ¤«
+ke = ¤±
+ki = ¤
+ko = ¤³
+ku = ¤¯
+kwa = ¤¯¤¡
+kya = ¤¤ã
+kye = ¤¤§
+kyi = ¤¤£
+kyo = ¤¤ç
+kyu = ¤¤å
+la = ¤¡
+le = ¤§
+li = ¤£
+lka = ¥õ
+lke = ¥ö
+lo = ¤©
+ltsu = ¤Ã
+ltu = ¤Ã
+lu = ¤¥
+lwa = ¤î
+lya = ¤ã
+lye = ¤§
+lyi = ¤£
+lyo = ¤ç
+lyu = ¤å
+ma = ¤Þ
+me = ¤á
+mi = ¤ß
+mo = ¤â
+mu = ¤à
+mya = ¤ß¤ã
+mye = ¤ß¤§
+myi = ¤ß¤£
+myo = ¤ß¤ç
+myu = ¤ß¤å
+n' = ¤ó
+na = ¤Ê
+ne = ¤Í
+ni = ¤Ë
+n = ¤ó
+nn = ¤ó
+no = ¤Î
+nu = ¤Ì
+nya = ¤Ë¤ã
+nye = ¤Ë¤§
+nyi = ¤Ë¤£
+nyo = ¤Ë¤ç
+nyu = ¤Ë¤å
+o = ¤ª
+pa = ¤Ñ
+pe = ¤Ú
+pi = ¤Ô
+po = ¤Ý
+pu = ¤×
+pya = ¤Ô¤ã
+pye = ¤Ô¤§
+pyi = ¤Ô¤£
+pyo = ¤Ô¤ç
+pyu = ¤Ô¤å
+ra = ¤é
+re = ¤ì
+ri = ¤ê
+ro = ¤í
+ru = ¤ë
+rya = ¤ê¤ã
+rye = ¤ê¤§
+ryi = ¤ê¤£
+ryo = ¤ê¤ç
+ryu = ¤ê¤å
+sa = ¤µ
+se = ¤»
+sha = ¤·¤ã
+she = ¤·¤§
+shi = ¤·
+sho = ¤·¤ç
+shu = ¤·¤å
+si = ¤·
+so = ¤½
+su = ¤¹
+sya = ¤·¤ã
+sye = ¤·¤§
+syi = ¤·¤£
+syo = ¤·¤ç
+syu = ¤·¤å
+ta = ¤¿
+te = ¤Æ
+tha = ¤Æ¤ã
+the = ¤Æ¤§
+thi = ¤Æ¤£
+tho = ¤Æ¤ç
+thu = ¤Æ¤å
+ti = ¤Á
+to = ¤È
+tsa = ¤Ä¤¡
+tse = ¤Ä¤§
+tsi = ¤Ä¤£
+tso = ¤Ä¤©
+tsu = ¤Ä
+tu = ¤Ä
+twu = ¤È¤¥
+tya = ¤Á¤ã
+tye = ¤Á¤§
+tyi = ¤Á¤£
+tyo = ¤Á¤ç
+tyu = ¤Á¤å
+u = ¤¦
+va = ¤¦¡«¤¡
+ve = ¤¦¡«¤§
+vi = ¤¦¡«¤£
+vo = ¤¦¡«¤©
+vu = ¤¦¡«
+wa = ¤ï
+we = ¤¦¤§
+wi = ¤¦¤£
+wo = ¤ò
+wu = ¤¦
+wye = ¤ñ
+wyi = ¤ð
+xa = ¤¡
+xe = ¤§
+xi = ¤£
+xka = ¥õ
+xke = ¥ö
+xo = ¤©
+xtsu = ¤Ã
+xtu = ¤Ã
+xu = ¤¥
+xwa = ¤î
+xya = ¤ã
+xye = ¤§
+xyi = ¤£
+xyo = ¤ç
+xyu = ¤å
+ya = ¤ä
+ye = ¤¤¤§
+yi = ¤¤
+yo = ¤è
+yu = ¤æ
+za = ¤¶
+ze = ¤¼
+zi = ¤¸
+zo = ¤¾
+zu = ¤º
+zya = ¤¸¤ã
+zye = ¤¸¤§
+zyi = ¤¸¤£
+zyo = ¤¸¤ç
+zyu = ¤¸¤å
+
+
+[PreeditStyle]
+
+
+[Setting]
+RomajiAllowSplit = false
--- /dev/null
+#
+# azik.sty - AZIK extended romaji table definition file.
+# Copyright (C) 2005 Takuro Ashie <ashie@homa.ne.jp>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+FormatVersion = 0.0.0
+Encoding = EUC-JP
+Title = AZIK
+Version = 0.0.0
+
+# Override fundamental table
+[RomajiTable/FundamentalTable]
+# À¶²»
+a = ¤¢
+i = ¤¤
+u = ¤¦
+e = ¤¨
+o = ¤ª
+
+ka = ¤«
+ki = ¤
+ku = ¤¯
+ke = ¤±
+ko = ¤³
+
+sa = ¤µ
+si = ¤·
+su = ¤¹
+se = ¤»
+so = ¤½
+
+ta = ¤¿
+ti = ¤Á
+tu = ¤Ä
+te = ¤Æ
+to = ¤È
+
+na = ¤Ê
+ni = ¤Ë
+nu = ¤Ì
+ne = ¤Í
+no = ¤Î
+
+ha = ¤Ï
+hi = ¤Ò
+hu = ¤Õ
+he = ¤Ø
+ho = ¤Û
+
+fu = ¤Õ
+
+ma = ¤Þ
+mi = ¤ß
+mu = ¤à
+me = ¤á
+mo = ¤â
+
+ya = ¤ä
+yu = ¤æ
+yo = ¤è
+
+ra = ¤é
+ri = ¤ê
+ru = ¤ë
+re = ¤ì
+ro = ¤í
+
+wa = ¤ï
+wo = ¤ò
+
+# Ùû²»³ÈÄ¥
+kz = ¤«¤ó
+kn = ¤«¤ó
+kk = ¤¤ó
+kj = ¤¯¤ó
+kd = ¤±¤ó
+kl = ¤³¤ó
+
+sz = ¤µ¤ó
+sn = ¤µ¤ó
+sk = ¤·¤ó
+sj = ¤¹¤ó
+sd = ¤»¤ó
+sl = ¤½¤ó
+
+tz = ¤¿¤ó
+tn = ¤¿¤ó
+tk = ¤Á¤ó
+tj = ¤Ä¤ó
+td = ¤Æ¤ó
+tl = ¤È¤ó
+
+nz = ¤Ê¤ó
+nn = ¤ó
+nk = ¤Ë¤ó
+nj = ¤Ì¤ó
+nd = ¤Í¤ó
+nl = ¤Î¤ó
+
+hz = ¤Ï¤ó
+hn = ¤Ï¤ó
+hk = ¤Ò¤ó
+hj = ¤Õ¤ó
+hd = ¤Ø¤ó
+hl = ¤Û¤ó
+
+fz = ¤Õ¤¡¤ó
+fn = ¤Õ¤¡¤ó
+fk = ¤Õ¤£¤ó
+fj = ¤Õ¤ó
+fd = ¤Õ¤§¤ó
+fl = ¤Õ¤©¤ó
+
+mz = ¤Þ¤ó
+mk = ¤ß¤ó
+mj = ¤à¤ó
+md = ¤á¤ó
+ml = ¤â¤ó
+
+yz = ¤ä¤ó
+yn = ¤ä¤ó
+yj = ¤æ¤ó
+yl = ¤è¤ó
+
+rz = ¤é¤ó
+rn = ¤é¤ó
+rk = ¤ê¤ó
+rj = ¤ë¤ó
+rd = ¤ì¤ó
+rl = ¤í¤ó
+
+wz = ¤ï¤ó
+wn = ¤ï¤ó
+wk = ¤¦¤£¤ó
+wd = ¤¦¤§¤ó
+wl = ¤¦¤©¤ó
+
+# Æó½ÅÊì²»³ÈÄ¥
+kq = ¤«¤¤
+kh = ¤¯¤¦
+kw = ¤±¤¤
+kp = ¤³¤¦
+
+sq = ¤µ¤¤
+sh = ¤¹¤¦
+sw = ¤»¤¤
+sp = ¤½¤¦
+
+tq = ¤¿¤¤
+th = ¤Ä¤¦
+tw = ¤Æ¤¤
+tp = ¤È¤¦
+
+nq = ¤Ê¤¤
+nh = ¤Ì¤¦
+nw = ¤Í¤¤
+np = ¤Î¤¦
+
+hq = ¤Ï¤¤
+hh = ¤Õ¤¦
+hw = ¤Ø¤¤
+hp = ¤Û¤¦
+
+fq = ¤Õ¤¡¤¤
+fh = ¤Õ¤¦
+fw = ¤Õ¤§¤¤
+fp = ¤Õ¤©¡¼
+
+mq = ¤Þ¤¤
+mh = ¤à¤¦
+mw = ¤á¤¤
+mp = ¤â¤¦
+
+yq = ¤ä¤¤
+yh = ¤æ¤¦
+yp = ¤è¤¦
+
+rq = ¤é¤¤
+rh = ¤ë¤¦
+rw = ¤ì¤¤
+rp = ¤í¤¦
+
+wq = ¤ï¤¤
+wp = ¤¦¤©¡¼
+
+# Ùû²»³ÈÄ¥¸ß´¹¥¡¼
+kn = ¤«¤ó
+sn = ¤µ¤ó
+tn = ¤¿¤ó
+nn = ¤ó
+hn = ¤Ï¤ó
+fn = ¤Õ¤¡¤ó
+mn = ¤â¤Î
+yn = ¤ä¤ó
+rn = ¤é¤ó
+wn = ¤ï¤ó
+
+# Âù²»¡¢È¾Âù²» Ùû²»³ÈÄ¥¡¢Æó½ÅÊì²»³ÈÄ¥
+ga = ¤¬
+gi = ¤®
+gu = ¤°
+ge = ¤²
+go = ¤´
+
+za = ¤¶
+zi = ¤¸
+zu = ¤º
+ze = ¤¼
+zo = ¤¾
+
+da = ¤À
+di = ¤Â
+du = ¤Å
+de = ¤Ç
+do = ¤É
+
+ba = ¤Ð
+bi = ¤Ó
+bu = ¤Ö
+be = ¤Ù
+bo = ¤Ü
+
+pa = ¤Ñ
+pi = ¤Ô
+pu = ¤×
+pe = ¤Ú
+po = ¤Ý
+
+gz = ¤¬¤ó
+gn = ¤¬¤ó
+gk = ¤®¤ó
+gj = ¤°¤ó
+gd = ¤²¤ó
+gl = ¤´¤ó
+
+zz = ¤¶¤ó
+zn = ¤¶¤ó
+zk = ¤¸¤ó
+zj = ¤º¤ó
+zd = ¤¼¤ó
+zl = ¤¾¤ó
+
+dz = ¤À¤ó
+dn = ¤À¤ó
+dk = ¤Â¤ó
+dj = ¤Å¤ó
+dd = ¤Ç¤ó
+dl = ¤É¤ó
+
+bz = ¤Ð¤ó
+bn = ¤Ð¤ó
+bk = ¤Ó¤ó
+bj = ¤Ö¤ó
+bd = ¤Ù¤ó
+bl = ¤Ü¤ó
+
+pz = ¤Ñ¤ó
+pn = ¤Ñ¤ó
+pk = ¤Ô¤ó
+pj = ¤×¤ó
+pd = ¤Ú¤ó
+pl = ¤Ý¤ó
+
+gq = ¤¬¤¤
+gh = ¤°¤¦
+gw = ¤²¤¤
+gp = ¤´¤¦
+
+zq = ¤¶¤¤
+zh = ¤º¤¦
+zw = ¤¼¤¤
+zp = ¤¾¤¦
+
+dq = ¤À¤¤
+dh = ¤Å¤¦
+dw = ¤Ç¤¤
+dp = ¤É¤¦
+
+bq = ¤Ð¤¤
+bh = ¤Ö¤¦
+bw = ¤Ù¤¤
+bp = ¤Ü¤¦
+
+pq = ¤Ñ¤¤
+ph = ¤×¤¦
+pw = ¤Ú¤¤
+pp = ¤Ý¤¦
+
+zc = ¤¶
+zv = ¤¶¤¤
+zx = ¤¼¤¤
+
+# Ù¹²»¡¢Ù¹²»¸ß´¹
+kya = ¤¤ã
+kyu = ¤¤å
+kye = ¤¤§
+kyo = ¤¤ç
+
+kga = ¤¤ã
+kgu = ¤¤å
+kge = ¤¤§
+kgo = ¤¤ç
+
+sya = ¤·¤ã
+syu = ¤·¤å
+sye = ¤·¤§
+syo = ¤·¤ç
+
+xa = ¤·¤ã
+xu = ¤·¤å
+xe = ¤·¤§
+xo = ¤·¤ç
+
+tya = ¤Á¤ã
+tyu = ¤Á¤å
+tye = ¤Á¤§
+tyo = ¤Á¤ç
+
+ca = ¤Á¤ã
+cu = ¤Á¤å
+ce = ¤Á¤§
+co = ¤Á¤ç
+
+nya = ¤Ë¤ã
+nyu = ¤Ë¤å
+nye = ¤Ë¤§
+nyo = ¤Ë¤ç
+
+nga = ¤Ë¤ã
+ngu = ¤Ë¤å
+nge = ¤Ë¤§
+ngo = ¤Ë¤ç
+
+hya = ¤Ò¤ã
+hyu = ¤Ò¤å
+hye = ¤Ò¤§
+hyo = ¤Ò¤ç
+
+hga = ¤Ò¤ã
+hgu = ¤Ò¤å
+hge = ¤Ò¤§
+hgo = ¤Ò¤ç
+
+mya = ¤ß¤ã
+myu = ¤ß¤å
+mye = ¤ß¤§
+myo = ¤ß¤ç
+
+mga = ¤ß¤ã
+mgu = ¤ß¤å
+mge = ¤ß¤§
+mgo = ¤ß¤ç
+
+rya = ¤ê¤ã
+ryu = ¤ê¤å
+rye = ¤ê¤§
+ryo = ¤ê¤ç
+
+kyz = ¤¤ã¤ó
+kyn = ¤¤ã¤ó
+kyj = ¤¤å¤ó
+kyd = ¤¤§¤ó
+kyl = ¤¤ç¤ó
+
+kgz = ¤¤ã¤ó
+kgn = ¤¤ã¤ó
+kgj = ¤¤å¤ó
+kgd = ¤¤§¤ó
+kgl = ¤¤ç¤ó
+
+syz = ¤·¤ã¤ó
+syn = ¤·¤ã¤ó
+syj = ¤·¤å¤ó
+syd = ¤·¤§¤ó
+syl = ¤·¤ç¤ó
+
+xz = ¤·¤ã¤ó
+xn = ¤·¤ã¤ó
+xj = ¤·¤å¤ó
+xd = ¤·¤§¤ó
+xl = ¤·¤ç¤ó
+
+tyz = ¤Á¤ã¤ó
+tyn = ¤Á¤ã¤ó
+tyj = ¤Á¤å¤ó
+tyd = ¤Á¤§¤ó
+tyl = ¤Á¤ç¤ó
+
+cz = ¤Á¤ã¤ó
+cn = ¤Á¤ã¤ó
+cj = ¤Á¤å¤ó
+cd = ¤Á¤§¤ó
+cl = ¤Á¤ç¤ó
+
+nyz = ¤Ë¤ã¤ó
+nyn = ¤Ë¤ã¤ó
+nyj = ¤Ë¤å¤ó
+nyd = ¤Ë¤§¤ó
+nyl = ¤Ë¤ç¤ó
+
+ngz = ¤Ë¤ã¤ó
+ngn = ¤Ë¤ã¤ó
+ngj = ¤Ë¤å¤ó
+ngd = ¤Ë¤§¤ó
+ngl = ¤Ë¤ç¤ó
+
+hyz = ¤Ò¤ã¤ó
+hyn = ¤Ò¤ã¤ó
+hyj = ¤Ò¤å¤ó
+hyd = ¤Ò¤§¤ó
+hyl = ¤Ò¤ç¤ó
+
+hgz = ¤Ò¤ã¤ó
+hgn = ¤Ò¤ã¤ó
+hgj = ¤Ò¤å¤ó
+hgd = ¤Ò¤§¤ó
+hgl = ¤Ò¤ç¤ó
+
+myz = ¤ß¤ã¤ó
+myn = ¤ß¤ã¤ó
+myj = ¤ß¤å¤ó
+myd = ¤ß¤§¤ó
+myl = ¤ß¤ç¤ó
+
+mgz = ¤ß¤ã¤ó
+mgn = ¤ß¤ã¤ó
+mgj = ¤ß¤å¤ó
+mgd = ¤ß¤§¤ó
+mgl = ¤ß¤ç¤ó
+
+ryz = ¤ê¤ã¤ó
+ryn = ¤ê¤ã¤ó
+ryj = ¤ê¤å¤ó
+ryd = ¤ê¤§¤ó
+ryl = ¤ê¤ç¤ó
+
+kyq = ¤¤ã¤¤
+kyh = ¤¤å¤¦
+kyw = ¤¤§¤¤
+kyp = ¤¤ç¤¦
+
+kgq = ¤¤ã¤¤
+kgh = ¤¤å¤¦
+kgw = ¤¤§¤¤
+kgp = ¤¤ç¤¦
+
+syq = ¤·¤ã¤¤
+syh = ¤·¤å¤¦
+syw = ¤·¤§¤¤
+syp = ¤·¤ç¤¦
+
+xq = ¤·¤ã¤¤
+xh = ¤·¤å¤¦
+xw = ¤·¤§¤¤
+xp = ¤·¤ç¤¦
+
+tyq = ¤Á¤ã¤¤
+tyh = ¤Á¤å¤¦
+tyw = ¤Á¤§¤¤
+typ = ¤Á¤ç¤¦
+
+cq = ¤Á¤ã¤¤
+ch = ¤Á¤å¤¦
+cw = ¤Á¤§¤¤
+cp = ¤Á¤ç¤¦
+
+nyq = ¤Ë¤ã¤¤
+nyh = ¤Ë¤å¤¦
+nyw = ¤Ë¤§¤¤
+nyp = ¤Ë¤ç¤¦
+
+ngq = ¤Ë¤ã¤¤
+ngh = ¤Ë¤å¤¦
+ngw = ¤Ë¤§¤¤
+ngp = ¤Ë¤ç¤¦
+
+hyq = ¤Ò¤ã¤¤
+hyh = ¤Ò¤å¤¦
+hyw = ¤Ò¤§¤¤
+hyp = ¤Ò¤ç¤¦
+
+hgq = ¤Ò¤ã¤¤
+hgh = ¤Ò¤å¤¦
+hgw = ¤Ò¤§¤¤
+hgp = ¤Ò¤ç¤¦
+
+myq = ¤ß¤ã¤¤
+myh = ¤ß¤å¤¦
+myw = ¤ß¤§¤¤
+myp = ¤ß¤ç¤¦
+
+mgq = ¤ß¤ã¤¤
+mgh = ¤ß¤å¤¦
+mgw = ¤ß¤§¤¤
+mgp = ¤ß¤ç¤¦
+
+ryq = ¤ê¤ã¤¤
+ryh = ¤ê¤å¤¦
+ryw = ¤ê¤§¤¤
+ryp = ¤ê¤ç¤¦
+
+# Ù¹²» (Âù²»¡¢È¾Âù²»)
+gya = ¤®¤ã
+gyu = ¤®¤å
+gye = ¤®¤§
+gyo = ¤®¤ç
+
+zya = ¤¸¤ã
+zyu = ¤¸¤å
+zye = ¤¸¤§
+zyo = ¤¸¤ç
+
+ja = ¤¸¤ã
+ju = ¤¸¤å
+je = ¤¸¤§
+jo = ¤¸¤ç
+
+bya = ¤Ó¤ã
+byu = ¤Ó¤å
+bye = ¤Ó¤§
+byo = ¤Ó¤ç
+
+pya = ¤Ô¤ã
+pyu = ¤Ô¤å
+pye = ¤Ô¤§
+pyo = ¤Ô¤ç
+
+pga = ¤Ô¤ã
+pgu = ¤Ô¤å
+pge = ¤Ô¤§
+pgo = ¤Ô¤ç
+
+gyz = ¤®¤ã¤ó
+gyn = ¤®¤ã¤ó
+gyj = ¤®¤å¤ó
+gyd = ¤®¤§¤ó
+gyl = ¤®¤ç¤ó
+
+zyz = ¤¸¤ã¤ó
+zyn = ¤¸¤ã¤ó
+zyj = ¤¸¤å¤ó
+zyd = ¤¸¤§¤ó
+zyl = ¤¸¤ç¤ó
+
+jz = ¤¸¤ã¤ó
+jn = ¤¸¤ã¤ó
+jj = ¤¸¤å¤ó
+jd = ¤¸¤§¤ó
+jl = ¤¸¤ç¤ó
+
+byz = ¤Ó¤ã¤ó
+byn = ¤Ó¤ã¤ó
+byj = ¤Ó¤å¤ó
+byd = ¤Ó¤§¤ó
+byl = ¤Ó¤ç¤ó
+
+pyz = ¤Ô¤ã¤ó
+pyn = ¤Ô¤ã¤ó
+pyj = ¤Ô¤å¤ó
+pyd = ¤Ô¤§¤ó
+pyl = ¤Ô¤ç¤ó
+
+pgz = ¤Ô¤ã¤ó
+pgn = ¤Ô¤ã¤ó
+pgj = ¤Ô¤å¤ó
+pgd = ¤Ô¤§¤ó
+pgl = ¤Ô¤ç¤ó
+
+gyq = ¤®¤ã¤¤
+gyh = ¤®¤å¤¦
+gyw = ¤®¤§¤¤
+gyp = ¤®¤ç¤¦
+
+zyq = ¤¸¤ã¤¤
+zyh = ¤¸¤å¤¦
+zyw = ¤¸¤§¤¤
+zyp = ¤¸¤ç¤¦
+
+jq = ¤¸¤ã¤¤
+jh = ¤¸¤å¤¦
+jw = ¤¸¤§¤¤
+jp = ¤¸¤ç¤¦
+
+byq = ¤Ó¤ã¤¤
+byh = ¤Ó¤å¤¦
+byw = ¤Ó¤§¤¤
+byp = ¤Ó¤ç¤¦
+
+pyq = ¤Ô¤ã¤¤
+pyh = ¤Ô¤å¤¦
+pyw = ¤Ô¤§¤¤
+pyp = ¤Ô¤ç¤¦
+
+pgq = ¤Ô¤ã¤¤
+pgh = ¤Ô¤å¤¦
+pgw = ¤Ô¤§¤¤
+pgp = ¤Ô¤ç¤¦
+
+# Ù¹²» (³°Íè¸ì¡¢Â¾)
+fa = ¤Õ¤¡
+fi = ¤Õ¤£
+fu = ¤Õ
+fe = ¤Õ¤§
+fo = ¤Õ¤©
+
+va = ¥ô¤¡
+vi = ¥ô¤£
+vu = ¥ô
+ve = ¥ô¤§
+vo = ¥ô¤©
+
+tgi = ¤Æ¤£
+tgu = ¤È¤¥
+
+dci = ¤Ç¤£
+dcu = ¤É¤¥
+
+wi = ¤¦¤£
+we = ¤¦¤§
+wo = ¤ò
+
+wso = ¤¦¤©
+
+la = ¤¡
+li = ¤£
+lu = ¤¥
+le = ¤§
+lo = ¤©
+
+lya = ¤ã
+lyu = ¤å
+lyo = ¤ç
+
+# Â¥²»¡¢Ùû²»¡¢Ä¹²»Éä
+; = ¤Ã
+q = ¤ó
+- = ¡¼
+: = ¡¼
+\[ = ¡Ö
+\] = ¡×
+
+# Æüì³ÈÄ¥
+kt = ¤³¤È
+wt = ¤ï¤¿
+km = ¤«¤â
+sr = ¤¹¤ë
+rr = ¤é¤ì
+nb = ¤Í¤Ð
+nt = ¤Ë¤Á
+st = ¤·¤¿
+mn = ¤â¤Î
+tm = ¤¿¤á
+tr = ¤¿¤é
+zr = ¤¶¤ë
+bt = ¤Ó¤È
+dt = ¤À¤Á
+tt = ¤¿¤Á
+ms = ¤Þ¤¹
+dm = ¤Ç¤â
+nr = ¤Ê¤ë
+mt = ¤Þ¤¿
+gr = ¤¬¤é
+wr = ¤ï¤ì
+ht = ¤Ò¤È
+ds = ¤Ç¤¹
+kr = ¤«¤é
+yr = ¤è¤ë
+tb = ¤¿¤Ó
+gt = ¤´¤È
--- /dev/null
+#
+# canna.sty - Canna like style definition file for scim-anthy.
+# Copyright (C) 2005 Takuro Ashie <ashie@homa.ne.jp>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+FormatVersion = 0.0.0
+Encoding = EUC-JP
+Title = Canna
+Version = 0.0.0
+
+[KeyBindings]
+OnOffKey = Zenkaku_Hankaku,Shift+space,Control+o,Control+backslash
+CircleInputModeKey =
+CircleKanaModeKey =
+LatinModeKey =
+WideLatinModeKey =
+HiraganaModeKey = Hiragana_Katakana
+KatakanaModeKey = Shift+Hiragana_Katakana
+HalfKatakanaModeKey =
+CircleTypingMethodKey = Romaji,Alt+Romaji
+
+ConvertKey = space
+PredictKey = Control+q,Control+Q
+CancelKey = Escape,Control+g,Control+G
+CommitKey = Return,Control+m,Control+M
+
+InsertSpaceKey = space
+InsertAltSpaceKey =
+BackSpaceKey = BackSpace,Control+h,Control+H
+DeleteKey = Delete,Control+d,Control+D
+
+MoveCaretBackwardKey = Left,Control+b,Control+B
+MoveCaretForwardKey = Right,Control+f,Control+F
+MoveCaretFirstKey = Control+a,Control+A
+MoveCaretLastKey = Control+e,Control+E
+
+SelectPrevSegmentKey = Left,Control+b,Control+B
+SelectNextSegmentKey = Right,Control+f,Control+F
+SelectFirstSegmentKey = Control+a,Control+A
+SelectLastSegmentKey = Control+e,Control+E
+ExpandSegmentKey = Control+o,Control+O
+ShrinkSegmentKey = Tab,Control+i,Control+I
+CommitSelectedSegmentKey = Control+k,Control+K
+
+CandidatesPageUpKey = Up,Control+p,Control+P
+CandidatesPageDownKey = Down,Control+n,Control+N
+SelectNextCandidateKey = space,Control+q,Control+Q,Right,Control+f,Control+F
+SelectPrevCandidateKey = Left,Control+b,Control+B
+
+SelectCandidates1Key = 1
+SelectCandidates2Key = 2
+SelectCandidates3Key = 3
+SelectCandidates4Key = 4
+SelectCandidates5Key = 5
+SelectCandidates6Key = 6
+SelectCandidates7Key = 7
+SelectCandidates8Key = 8
+SelectCandidates9Key = 9
+SelectCandidates10Key = 0
+
+ConvertCharTypeForwardKey = Control+n,Control+N
+ConvertCharTypeBackwardKey = Control+p,Control+P
+ConvertToHiraganaKey =
+ConvertToKatakanaKey =
+ConvertToHalfKey =
+ConvertToHalfKatakanaKey =
+ConvertToWideLatinKey =
+ConvertToLatinKey =
+# FIXME!
+#ConvertToUpperKey = Control+u,Control+U
+#ConvertToLowerKey = Control+l,Control+L
+
+AddWordKey =
+
+# Override fundamental table
+[RomajiTable/FundamentalTable]
+a = ¤¢
+i = ¤¤
+u = ¤¦
+e = ¤¨
+o = ¤ª
+ka = ¤«
+ki = ¤
+ku = ¤¯
+ke = ¤±
+ko = ¤³
+sa = ¤µ
+si = ¤·
+su = ¤¹
+se = ¤»
+so = ¤½
+ta = ¤¿
+ti = ¤Á
+tu = ¤Ä
+te = ¤Æ
+to = ¤È
+na = ¤Ê
+ni = ¤Ë
+nu = ¤Ì
+ne = ¤Í
+no = ¤Î
+ha = ¤Ï
+hi = ¤Ò
+hu = ¤Õ
+he = ¤Ø
+ho = ¤Û
+ma = ¤Þ
+mi = ¤ß
+mu = ¤à
+me = ¤á
+mo = ¤â
+ya = ¤ä
+yi = ¤¤
+yu = ¤æ
+ye = ¤¤¤§
+yo = ¤è
+ra = ¤é
+ri = ¤ê
+ru = ¤ë
+re = ¤ì
+ro = ¤í
+wa = ¤ï
+wi = ¥ð
+wu = ¤¦
+we = ¥ñ
+wo = ¤ò
+ga = ¤¬
+gi = ¤®
+gu = ¤°
+ge = ¤²
+go = ¤´
+za = ¤¶
+zi = ¤¸
+zu = ¤º
+ze = ¤¼
+zo = ¤¾
+da = ¤À
+di = ¤Â
+du = ¤Å
+de = ¤Ç
+do = ¤É
+ba = ¤Ð
+bi = ¤Ó
+bu = ¤Ö
+be = ¤Ù
+bo = ¤Ü
+pa = ¤Ñ
+pi = ¤Ô
+pu = ¤×
+pe = ¤Ú
+po = ¤Ý
+kya = ¤¤ã
+kyi = ¤¤£
+kyu = ¤¤å
+kye = ¤¤§
+kyo = ¤¤ç
+gya = ¤®¤ã
+gyi = ¤®¤£
+gyu = ¤®¤å
+gye = ¤®¤§
+gyo = ¤®¤ç
+sya = ¤·¤ã
+syi = ¤·¤£
+syu = ¤·¤å
+sye = ¤·¤§
+syo = ¤·¤ç
+zya = ¤¸¤ã
+zyi = ¤¸¤£
+zyu = ¤¸¤å
+zye = ¤¸¤§
+zyo = ¤¸¤ç
+tya = ¤Á¤ã
+tyi = ¤Á¤£
+tyu = ¤Á¤å
+tye = ¤Á¤§
+tyo = ¤Á¤ç
+nya = ¤Ë¤ã
+nyi = ¤Ë¤£
+nyu = ¤Ë¤å
+nye = ¤Ë¤§
+nyo = ¤Ë¤ç
+hya = ¤Ò¤ã
+hyi = ¤Ò¤£
+hyu = ¤Ò¤å
+hye = ¤Ò¤§
+hyo = ¤Ò¤ç
+bya = ¤Ó¤ã
+byi = ¤Ó¤£
+byu = ¤Ó¤å
+bye = ¤Ó¤§
+byo = ¤Ó¤ç
+pya = ¤Ô¤ã
+pyi = ¤Ô¤£
+pyu = ¤Ô¤å
+pye = ¤Ô¤§
+pyo = ¤Ô¤ç
+mya = ¤ß¤ã
+myi = ¤ß¤£
+myu = ¤ß¤å
+mye = ¤ß¤§
+myo = ¤ß¤ç
+rya = ¤ê¤ã
+ryi = ¤ê¤£
+ryu = ¤ê¤å
+rye = ¤ê¤§
+ryo = ¤ê¤ç
+tsa = ¤Ä¤¡
+tyi = ¤Ä¤£
+tyu = ¤Ä
+tye = ¤Ä¤§
+tyo = ¤Ä¤©
+sha = ¤·¤ã
+shi = ¤·
+shu = ¤·¤å
+she = ¤·¤§
+sho = ¤·¤ç
+tha = ¤Æ¤¡
+thi = ¤Æ¤£
+thu = ¤Æ¤å
+the = ¤Æ¤§
+tho = ¤Æ¤ç
+ja = ¤¸¤ã
+ji = ¤¸
+ju = ¤¸¤å
+je = ¤¸¤§
+jo = ¤¸¤ç
+cha = ¤Á¤ã
+chi = ¤Á
+chu = ¤Á¤å
+che = ¤Á¤§
+cho = ¤Á¤ç
+fa = ¤Õ¤¡
+fi = ¤Õ¤£
+fu = ¤Õ
+fe = ¤Õ¤§
+fo = ¤Õ¤©
+va = ¤¦¡«¤¡
+vi = ¤¦¡«¤£
+vu = ¤¦¡«
+ve = ¤¦¡«¤§
+vo = ¤¦¡«¤©
+gwa = ¤°¤¡
+gwi = ¤°¤£
+gwu = ¤°¤¥
+gwe = ¤°¤§
+gwo = ¤°¤©
+dya = ¤Â¤ã
+dyi = ¤Â¤£
+dyu = ¤Â¤å
+dye = ¤Â¤§
+dyo = ¤Â¤ç
+dha = ¤Ç¤ã
+dhi = ¤Ç¤£
+dhu = ¤Ç¤å
+dhe = ¤Ç¤§
+dho = ¤Ç¤ç
+ca = ¤«
+cu = ¤¯
+co = ¤³
+cya = ¤Á¤ã
+cyi = ¤Á¤£
+cyu = ¤Á¤¥
+cye = ¤Á¤§
+cyo = ¤Á¤©
+jya = ¤¸¤ã
+jyi = ¤¸¤£
+jyu = ¤¸¤å
+jye = ¤¸¤§
+jyo = ¤¸¤ç
+la = ¤é
+li = ¤ê
+lu = ¤ë
+le = ¤ì
+lo = ¤í
+lya = ¤ê¤ã
+lyi = ¤ê¤£
+lyu = ¤ê¤å
+lye = ¤ê¤§
+lyo = ¤ê¤ç
+xa = ¤¡
+xi = ¤£
+xu = ¤¥
+xe = ¤§
+xo = ¤©
+xwa = ¤î
+xtu = ¤Ã
+xtsu = ¤Ã
+xya = ¤ã
+xyu = ¤å
+xyo = ¤ç
+n = ¤ó
+nn = ¤ó
+mn = ¤ó
+n' = ¤ó
+@@ = ¡¡
+- = ¡¼
+#[ = ¡Ö
+#] = ¡×
+#, = ¡¢
+#. = ¡£
+@( = ¡Ê
+@) = ¡Ë
+@{ = ¡Ð
+@} = ¡Ñ
+@[ = ¡Î
+@] = ¡Ï
+@, = ,
+@. = .
+@~ = ¡Á
+@\ = ¡À
+@/ = ¡¦
+@- = ¡¾
+@2 = ¡Å
+@3 = ¡Ä
+@|| = ¡Â
+@| = ¡Ã
--- /dev/null
+#
+# msime.sty - Microsoft IME like style definition file for scim-anthy.
+# Copyright (C) 2005 Takuro Ashie <ashie@homa.ne.jp>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+FormatVersion = 0.0.0
+Encoding = EUC-JP
+Title = Microsoft IME
+Version = 0.0.0
+
+[KeyBindings]
+OnOffKey = Eisu_toggle,Zenkaku_Hankaku
+CircleKanaModeKey = Muhenkan
+LatinModeKey =
+WideLatinModeKey =
+HiraganaModeKey = Hiragana_Katakana
+KatakanaModeKey = Shift+Hiragana_Katakana
+HalfKatakanaModeKey =
+CircleTypingMethodKey = Alt+Romaji
+
+ConvertKey = space,Shift+space,Henkan
+PredictKey = Tab
+CancelKey = BackSpace,Control+BackSpace,Escape,Control+h,Control+z
+CommitKey = Return,Control+Return,Control+m
+ReconvertKey = Henkan,F13
+
+InsertSpaceKey = space
+InsertAltSpaceKey = Shift+space
+BackSpaceKey = BackSpace,Control+h
+DeleteKey = Delete,Control+g
+
+MoveCaretFirstKey = Home,Control+Left,Down,Control+a,Control+e
+MoveCaretLastKey = End,Control+Right,Down,Control+f,Control+n,Control+x
+MoveCaretForwardKey = Right,Shift+Right,Control+d,Control+l
+MoveCaretBackwardKey = Left,Shift+Left,Control+s,Control+k
+
+SelectFirstSegmentKey = Home,Control+Left,Control+a
+SelectLastSegmentKey = End,Control+Right,Control+f
+SelectNextSegmentKey = Right,Control+d
+SelectPrevSegmentKey = Left,Control+s
+ShrinkSegmentKey = Shift+Left,Control+e,Control+k
+ExpandSegmentKey = Shift+Right,Control+l,Control+x
+CommitFirstSegmentKey = Shift+Down
+CommitSelectedSegmentKey = Control+Down,Control+n
+
+CandidatesPageUpKey = Page_Up,Shift+Up
+CandidatesPageDownKey = Page_Down,Shift+Down
+SelectFirstCandidateKey = Home
+SelectLastCandidateKey = End
+SelectPrevCandidateKey = Up,Control+e,Shift+space,Shift+Henkan
+SelectNextCandidateKey = space,Tab,Henkan,Down,Control+x
+
+SelectCandidates1Key = 1
+SelectCandidates2Key = 2
+SelectCandidates3Key = 3
+SelectCandidates4Key = 4
+SelectCandidates5Key = 5
+SelectCandidates6Key = 6
+SelectCandidates7Key = 7
+SelectCandidates8Key = 8
+SelectCandidates9Key = 9
+SelectCandidates10Key = 0
+
+ConvertToHiraganaKey = Control+u,F6
+ConvertToKatakanaKey = Control+i,F7
+ConvertToHalfKey = Control+o,F8
+ConvertToHalfKatakanaKey = Shift+F8
+ConvertToWideLatinKey = Control+p,F9
+ConvertToLatinKey = Control+t,F10
+
+
+# Override fundamental table
+[RomajiTable/FundamentalTable]
+- = ¡¼
+#/ = ¡¦
+#[ = ¡Ö
+#] = ¡×
+la = ¤¡
+xa = ¤¡
+a = ¤¢
+li = ¤£
+lyi = ¤£
+xi = ¤£
+xyi = ¤£
+i = ¤¤
+yi = ¤¤
+ye = ¤¤¤§
+lu = ¤¥
+xu = ¤¥
+u = ¤¦
+whu = ¤¦
+wu = ¤¦
+wha = ¤¦¤¡
+whi = ¤¦¤£
+wi = ¤¦¤£
+we = ¤¦¤§
+whe = ¤¦¤§
+who = ¤¦¤©
+le = ¤§
+lye = ¤§
+xe = ¤§
+xye = ¤§
+e = ¤¨
+lo = ¤©
+xo = ¤©
+o = ¤ª
+ca = ¤«
+ka = ¤«
+ga = ¤¬
+ki = ¤
+kyi = ¤¤£
+kye = ¤¤§
+kya = ¤¤ã
+kyu = ¤¤å
+kyo = ¤¤ç
+gi = ¤®
+gyi = ¤®¤£
+gye = ¤®¤§
+gya = ¤®¤ã
+gyu = ¤®¤å
+gyo = ¤®¤ç
+cu = ¤¯
+ku = ¤¯
+qu = ¤¯
+kwa = ¤¯¤¡
+qa = ¤¯¤¡
+qwa = ¤¯¤¡
+qi = ¤¯¤£
+qwi = ¤¯¤£
+qyi = ¤¯¤£
+qwu = ¤¯¤¥
+qe = ¤¯¤§
+qwe = ¤¯¤§
+qye = ¤¯¤§
+qo = ¤¯¤©
+qwo = ¤¯¤©
+qya = ¤¯¤ã
+qyu = ¤¯¤å
+qyo = ¤¯¤ç
+gu = ¤°
+gwa = ¤°¤¡
+gwi = ¤°¤£
+gwu = ¤°¤¥
+gwe = ¤°¤§
+gwo = ¤°¤©
+ke = ¤±
+ge = ¤²
+co = ¤³
+ko = ¤³
+go = ¤´
+sa = ¤µ
+za = ¤¶
+ci = ¤·
+shi = ¤·
+si = ¤·
+syi = ¤·¤£
+she = ¤·¤§
+sye = ¤·¤§
+sha = ¤·¤ã
+sya = ¤·¤ã
+shu = ¤·¤å
+syu = ¤·¤å
+sho = ¤·¤ç
+syo = ¤·¤ç
+ji = ¤¸
+zi = ¤¸
+jyi = ¤¸¤£
+zyi = ¤¸¤£
+je = ¤¸¤§
+jye = ¤¸¤§
+zye = ¤¸¤§
+ja = ¤¸¤ã
+jya = ¤¸¤ã
+zya = ¤¸¤ã
+ju = ¤¸¤å
+jyu = ¤¸¤å
+zyu = ¤¸¤å
+jo = ¤¸¤ç
+jyo = ¤¸¤ç
+zyo = ¤¸¤ç
+su = ¤¹
+swa = ¤¹¤¡
+swi = ¤¹¤£
+swu = ¤¹¤¥
+swe = ¤¹¤§
+swo = ¤¹¤©
+zu = ¤º
+ce = ¤»
+se = ¤»
+ze = ¤¼
+so = ¤½
+zo = ¤¾
+ta = ¤¿
+da = ¤À
+chi = ¤Á
+ti = ¤Á
+cyi = ¤Á¤£
+tyi = ¤Á¤£
+che = ¤Á¤§
+cye = ¤Á¤§
+tye = ¤Á¤§
+cha = ¤Á¤ã
+cya = ¤Á¤ã
+tya = ¤Á¤ã
+chu = ¤Á¤å
+cyu = ¤Á¤å
+tyu = ¤Á¤å
+cho = ¤Á¤ç
+cyo = ¤Á¤ç
+tyo = ¤Á¤ç
+di = ¤Â
+dyi = ¤Â¤£
+dye = ¤Â¤§
+dya = ¤Â¤ã
+dyu = ¤Â¤å
+dyo = ¤Â¤ç
+ltsu = ¤Ã
+ltu = ¤Ã
+xtsu = ¤Ã
+xtu = ¤Ã
+tsu = ¤Ä
+tu = ¤Ä
+tsa = ¤Ä¤¡
+tsi = ¤Ä¤£
+tse = ¤Ä¤§
+tso = ¤Ä¤©
+du = ¤Å
+te = ¤Æ
+thi = ¤Æ¤£
+the = ¤Æ¤§
+tha = ¤Æ¤ã
+thu = ¤Æ¤å
+tho = ¤Æ¤ç
+de = ¤Ç
+dhi = ¤Ç¤£
+dhe = ¤Ç¤§
+dha = ¤Ç¤ã
+dhu = ¤Ç¤å
+dho = ¤Ç¤ç
+to = ¤È
+twa = ¤È¤¡
+twi = ¤È¤£
+twu = ¤È¤¥
+twe = ¤È¤§
+two = ¤È¤©
+do = ¤É
+dwa = ¤É¤¡
+dwi = ¤É¤£
+dwu = ¤É¤¥
+dwe = ¤É¤§
+dwo = ¤É¤©
+na = ¤Ê
+ni = ¤Ë
+nyi = ¤Ë¤£
+nye = ¤Ë¤§
+nya = ¤Ë¤ã
+nyu = ¤Ë¤å
+nyo = ¤Ë¤ç
+nu = ¤Ì
+ne = ¤Í
+no = ¤Î
+ha = ¤Ï
+ba = ¤Ð
+pa = ¤Ñ
+hi = ¤Ò
+hyi = ¤Ò¤£
+hye = ¤Ò¤§
+hya = ¤Ò¤ã
+hyu = ¤Ò¤å
+hyo = ¤Ò¤ç
+bi = ¤Ó
+byi = ¤Ó¤£
+bye = ¤Ó¤§
+bya = ¤Ó¤ã
+byu = ¤Ó¤å
+byo = ¤Ó¤ç
+pi = ¤Ô
+pyi = ¤Ô¤£
+pye = ¤Ô¤§
+pya = ¤Ô¤ã
+pyu = ¤Ô¤å
+pyo = ¤Ô¤ç
+fu = ¤Õ
+hu = ¤Õ
+fa = ¤Õ¤¡
+fwa = ¤Õ¤¡
+fi = ¤Õ¤£
+fwi = ¤Õ¤£
+fyi = ¤Õ¤£
+fwu = ¤Õ¤¥
+fe = ¤Õ¤§
+fwe = ¤Õ¤§
+fye = ¤Õ¤§
+fo = ¤Õ¤©
+fwo = ¤Õ¤©
+fya = ¤Õ¤ã
+fyu = ¤Õ¤å
+fyo = ¤Õ¤ç
+bu = ¤Ö
+pu = ¤×
+he = ¤Ø
+be = ¤Ù
+pe = ¤Ú
+ho = ¤Û
+bo = ¤Ü
+po = ¤Ý
+ma = ¤Þ
+mi = ¤ß
+myi = ¤ß¤£
+mye = ¤ß¤§
+mya = ¤ß¤ã
+myu = ¤ß¤å
+myo = ¤ß¤ç
+mu = ¤à
+me = ¤á
+mo = ¤â
+lya = ¤ã
+xya = ¤ã
+ya = ¤ä
+lyu = ¤å
+xyu = ¤å
+yu = ¤æ
+lyo = ¤ç
+xyo = ¤ç
+yo = ¤è
+ra = ¤é
+ri = ¤ê
+ryi = ¤ê¤£
+rye = ¤ê¤§
+rya = ¤ê¤ã
+ryu = ¤ê¤å
+ryo = ¤ê¤ç
+ru = ¤ë
+re = ¤ì
+ro = ¤í
+lwa = ¤î
+xwa = ¤î
+wa = ¤ï
+wo = ¤ò
+n = ¤ó
+nn = ¤ó
+xn = ¤ó
+vu = ¥ô
+va = ¥ô¤¡
+vi = ¥ô¤£
+vyi = ¥ô¤£
+ve = ¥ô¤§
+vye = ¥ô¤§
+vo = ¥ô¤©
+vya = ¥ô¤ã
+vyu = ¥ô¤å
+vyo = ¥ô¤ç
+lka = ¥õ
+xka = ¥õ
+lke = ¥ö
+xke = ¥ö
+
+
+[PreeditStyle]
+
+
+[Setting]
+RomajiAllowSplit = true
--- /dev/null
+#
+# nicola-a.sty - NICOLA A type layout definition file
+# Copyright (C) 2005 Hatuka*nezumi <nezumi@jca.apc.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+FormatVersion = 0.0.0
+Encoding = EUC-JP
+Title = NICOLA A·¿ÇÛÎó
+Version = 0.0.0
+
+[NICOLATable/FundamentalTable]
+# non modifiered keys
+'=',,
+1=£±,¡©,¡©
+2=£²,¡¿,¡¿
+3=£³,,
+4=£´,¡Ö,¡Ö
+5=£µ,¡×,¡×
+6=£¶,¡Î,¡Î
+7=£·,¡Ï,¡Ï
+8=£¸,,
+9=£¹,¡Ê,¡Ê
+0=£°,¡Ë,¡Ë
+-=¡Ý,,
+\==¡á,,
+
+q=¡£,¤¡,¤ð
+w=¤«,¤¨,¤¬
+e=¤¿,¤ê,¤À
+r=¤³,¤ã,¤´
+t=¤µ,¤ì,¤¶
+y=¤é,¤Ñ,¤è
+u=¤Á,¤Â,¤Ë
+i=¤¯,¤°,¤ë
+o=¤Ä,¤Å,¤Þ
+p=¡¤,¤Ô,¤§
+\[=¡¢,,
+\]=¡«,,¡¬
+\\=
+
+a=¤¦,¤ò,¥ô
+s=¤·,¤¢,¤¸
+d=¤Æ,¤Ê,¤Ç
+f=¤±,¤å,¤²
+g=¤»,¤â,¤¼
+h=¤Ï,¤Ð,¤ß
+j=¤È,¤É,¤ª
+k=¤,¤®,¤Î
+l=¤¤,¤Ý,¤ç
+;=¤ó,,¤Ã
+'=
+
+z=¡¥,¤¥,¤ñ
+x=¤Ò,¡¼,¤Ó
+c=¤¹,¤í,¤º
+v=¤Õ,¤ä,¤Ö
+b=¤Ø,¤£,¤Ù
+n=¤á,¤×,¤Ì
+m=¤½,¤¾,¤æ
+\,=¤Í,¤Ú,¤à
+.=¤Û,¤Ü,¤ï
+/=¡¦,¤î,¤©
+
+# shift modifiered keys
+~=¡Á
+!=¡ª
+@=¡÷
+\#=¡ô
+$=¡ð
+%=¡ó
+^=¡°
+&=¡õ
+*=¡ö
+(=¡Ê
+)=¡Ë
+_=¡²
++=¡Ü
+
+H=¤Ñ
+X=¤Ô
+V=¤×
+B=¤Ú
+>=¤Ý
--- /dev/null
+#
+# nicola-f.sty - NICOLA F type layout definition file
+# Copyright (C) 2005 Hatuka*nezumi <nezumi@jca.apc.org>
+# Copyright (C) 2005 MORIYAMA Masayuki <msyk@mtg.biglobe.ne.jp>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+FormatVersion = 0.0.0
+Encoding = EUC-JP
+Title = NICOLA F·¿ÇÛÎó
+Version = 0.0.0
+
+[NICOLATable/FundamentalTable]
+# non modifiered keys
+1=1,¡©,¡©
+2=2,¡¿,¡¿
+3=3,¡Á,¡Á
+4=4,¡Ö,¡Ö
+5=5,¡×,¡×
+6=6,¡Î,¡Î
+7=7,¡Ï,¡Ï
+8=8,¡Ê,¡Ê
+9=9,¡Ë,¡Ë
+0=0,¡Ø,¡Ø
+-=¡Ý,¡Ù,¡Ù
+^=¡°,,
+\\=¡ï,,
+
+q=¡£,¤¡,¤ð
+w=¤«,¤¨,¤¬
+e=¤¿,¤ê,¤À
+r=¤³,¤ã,¤´
+t=¤µ,¤ì,¤¶
+y=¤é,¤Ñ,¤è
+u=¤Á,¤Â,¤Ë
+i=¤¯,¤°,¤ë
+o=¤Ä,¤Å,¤Þ
+p=¡¤,¤Ô,¤§
+@=
+\[=¡«,,¡¬
+
+a=¤¦,¤ò,¥ô
+s=¤·,¤¢,¤¸
+d=¤Æ,¤Ê,¤Ç
+f=¤±,¤å,¤²
+g=¤»,¤â,¤¼
+h=¤Ï,¤Ð,¤ß
+j=¤È,¤É,¤ª
+k=¤,¤®,¤Î
+l=¤¤,¤Ý,¤ç
+;=¤ó,,¤Ã
+:=¡¢,,
+\]=
+
+z=¡¥,¤¥,¤ñ
+x=¤Ò,¡¼,¤Ó
+c=¤¹,¤í,¤º
+v=¤Õ,¤ä,¤Ö
+b=¤Ø,¤£,¤Ù
+n=¤á,¤×,¤Ì
+m=¤½,¤¾,¤æ
+,=¤Í,¤Ú,¤à
+.=¤Û,¤Ü,¤ï
+/=¡¦,¤î,¤©
+
+# shift modifiered keys
+!=¡ª
+"=¡É
+\#=¡ô
+$=¡ð
+%=¡ó
+&=¡õ
+'=¡Ç
+(=¡Ê
+)=¡Ë
+
+\==¡á
+~=¡±
+|=¡Ã
+
+H=¤Ñ
+X=¤Ô
+V=¤×
+B=¤Ú
+>=¤Ý
--- /dev/null
+#
+# nicola-j.sty - NICOLA J type layout definition file
+# Copyright (C) 2005 Hatuka*nezumi <nezumi@jca.apc.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+FormatVersion = 0.0.0
+Encoding = EUC-JP
+Title = NICOLA J·¿ÇÛÎó
+Version = 0.0.0
+
+[NICOLATable/FundamentalTable]
+# non modifiered keys
+1=£±,¡©,¡©
+2=£²,¡¿,¡¿
+3=£³,¡Á,¡Á
+4=£´,¡Ö,¡Ö
+5=£µ,¡×,¡×
+6=£¶,¡Î,¡Î
+7=£·,¡Ï,¡Ï
+8=£¸,¡Ê,¡Ê
+9=£¹,¡Ë,¡Ë
+0=£°,¡Ø,¡Ø
+-=¡Ý,¡Ù,¡Ù
+^=¡°,,
+\\=¡ï,,
+
+q=¡£,¤¡,¤ð
+w=¤«,¤¨,¤¬
+e=¤¿,¤ê,¤À
+r=¤³,¤ã,¤´
+t=¤µ,¤ì,¤¶
+y=¤é,¤Ñ,¤è
+u=¤Á,¤Â,¤Ë
+i=¤¯,¤°,¤ë
+o=¤Ä,¤Å,¤Þ
+p=¡¤,¤Ô,¤§
+@=¡¢,,
+\[=¡«,,¡¬
+
+a=¤¦,¤ò,¥ô
+s=¤·,¤¢,¤¸
+d=¤Æ,¤Ê,¤Ç
+f=¤±,¤å,¤²
+g=¤»,¤â,¤¼
+h=¤Ï,¤Ð,¤ß
+j=¤È,¤É,¤ª
+k=¤,¤®,¤Î
+l=¤¤,¤Ý,¤ç
+;=¤ó,,¤Ã
+:=
+\]=
+
+z=¡¥,¤¥,¤ñ
+x=¤Ò,¡¼,¤Ó
+c=¤¹,¤í,¤º
+v=¤Õ,¤ä,¤Ö
+b=¤Ø,¤£,¤Ù
+n=¤á,¤×,¤Ì
+m=¤½,¤¾,¤æ
+,=¤Í,¤Ú,¤à
+.=¤Û,¤Ü,¤ï
+/=¡¦,¤î,¤©
+
+# shift modifiered keys
+!=¡ª
+"=¡É
+\#=¡ô
+$=¡ð
+%=¡ó
+&=¡õ
+'=¡Ç
+(=¡Ê
+)=¡Ë
+
+\==¡á
+~=¡±
+|=¡Ã
+
+H=¤Ñ
+X=¤Ô
+V=¤×
+B=¤Ú
+>=¤Ý
--- /dev/null
+#
+# oasys100j.sty - OASYS 100J like layout definition file
+# Copyright (C) 2005 Hatuka*nezumi <nezumi@jca.apc.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+FormatVersion = 0.0.0
+Encoding = EUC-JP
+Title = OASYS 100J¸ß´¹ÇÛÎó
+Version = 0.0.0
+
+[NICOLATable/FundamentalTable]
+# non modifiered keys
+1=£±,¡©,¡©
+2=£²,¡¿,¡¿
+3=£³,¡Á,¡Á
+4=£´,¡Ö,¡Ö
+5=£µ,¡×,¡×
+6=£¶,¡Î,¡Î
+7=£·,¡Ï,¡Ï
+8=£¸,¡Ê,¡Ê
+9=£¹,¡Ë,¡Ë
+0=£°,¡Ø,¡Ø
+-=¡½,¡Ù,¡Ù
+^=¡Ã,¡ï,¡ï
+\\=
+
+q=¡£,¤¡,¤ð
+w=¤«,¤¨,¤¬
+e=¤¿,¤ê,¤À
+r=¤³,¤ã,¤´
+t=¤µ,¤ì,¤¶
+y=¤é,¤Ñ,¤è
+u=¤Á,¤Â,¤Ë
+i=¤¯,¤°,¤ë
+o=¤Ä,¤Å,¤Þ
+p=¡¤,¤Ô,¤§
+@=¡¢,¡Ý,¡Ý
+\[=¡«,,¡¬
+
+a=¤¦,¤ò,¥ô
+s=¤·,¤¢,¤¸
+d=¤Æ,¤Ê,¤Ç
+f=¤±,¤å,¤²
+g=¤»,¤â,¤¼
+h=¤Ï,¤Ð,¤ß
+j=¤È,¤É,¤ª
+k=¤,¤®,¤Î
+l=¤¤,¤Ý,¤ç
+;=¤ó,,¤Ã
+:=
+\]=
+
+z=¡¥,¤¥,¤ñ
+x=¤Ò,¡¼,¤Ó
+c=¤¹,¤í,¤º
+v=¤Õ,¤ä,¤Ö
+b=¤Ø,¤£,¤Ù
+n=¤á,¤×,¤Ì
+m=¤½,¤¾,¤æ
+,=¤Í,¤Ú,¤à
+.=¤Û,¤Ü,¤ï
+/=¡¦,¤î,¤©
+
+# shift modifiered keys
+!=¡ª
+"=¡É
+\#=¡ô
+$=¡ð
+%=¡ó
+&=¡õ
+'=¡Ç
+(=¡Ê
+)=¡Ë
+
+\==¡á
+~=¡È
+|=
+
+H=¤Ñ
+X=¤Ô
+V=¤×
+B=¤Ú
+>=¤Ý
--- /dev/null
+#
+# tron-dvorak.sty - TRON type layout definition file
+# Copyright (C) 2005 Okano, Shinchi <shinchan.okano@nifty.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+FormatVersion = 0.0.0
+Encoding = EUC-JP
+Title = TRONÇÛÎó
+Version = 0.0.0
+
+[NICOLATable/FundamentalTable]
+# non modifiered keys
+1=1,¡Ä,¡Á
+2=2,¡®,¡Ç
+3=3,¡È,¡É
+4=4,¡Ö,¡×
+5=5,¡Ø,¡Ù
+6=6,¡ã,¡ä
+7=7,¡Ê,¡Ë
+8=8,¡Ð,¡Ñ
+9=9,¡Î,¡Ï
+0=0,¡À,¡Ã
+!=1,¡Ä,¡Á
+@=2,¡®,¡Ç
+\#=3,¡È,¡É
+$=4,¡Ö,¡×
+%=5,¡Ø,¡Ù
+^=6,¡ã,¡ä
+&=7,¡Ê,¡Ë
+*=8,¡Ð,¡Ñ
+(=9,¡Î,¡Ï
+)=0,¡À,¡Ã
+"=¤é,¤Ò,¤Ó
+'=¤é,¤Ò,¤Ó
+<=¤ë,¤½,¤¾
+\,=¤ë,¤½,¤¾
+>=¤³,¡¦,¤´
+.=¤³,¡¦,¤´
+p=¤Ï,¤ã,¤Ð
+y=¤ç,¤Û,¤Ü
+f=¤,¤®,¤¨
+g=¤Î,¤²,¤±
+c=¤¯,¤°,¤á
+r=¤¢, ,¤à
+l=¤ì,¤ð,¤í
+a=¤¿,¤Ì,¤À
+o=¤È,¤Í,¤É
+e=¤«,¤å,¤¬
+u=¤Æ,¤è,¤Ç
+i=¤â,¤Õ,¤Ö
+d=¤ò,¡«,¤ª
+h=¤¤,¤Â,¤Á
+t=¤¦,¥ô,¡¼
+n=¤·,¤¸,¤ß
+s=¤ó,¤ñ,¤ä
+;=¤Þ,¤§,¥õ
+:=¤Þ,¤§,¥õ
+q=¤ê,¤©,¥ö
+j=¤Ë,¤»,¤¼
+k=¤µ,¤æ,¤¶
+x=¤Ê,¤Ø,¤Ù
+b=¤¹,¤º,¤ï
+m=¤Ä,¤Å,¤£
+w=¡¢,\,,¤¡
+v=¡£,.,¡¬
+z=¤Ã,¤î,¤¥
+
++=¡Ý,¡Ü,¡à
+\==¡Ý,¡Ü,¡à
+\[=¡á,¡ô,¡ó
+{=¡á,¡ô,¡ó
+/=¡¿,¡ö,¡ß
+?=¡¿,¡ö,¡ß
+
+\\=¡÷,¡ð,¡ï
+|=¡÷,¡ð,¡ï
+\]=¡²,¡ª,¡ª
+}=¡²,¡ª,¡ª
+-=_,¡©,¡©
+_=_,¡©,¡©
--- /dev/null
+#
+# tron-qwerty-jp.sty - TRON type layout definition file
+# Copyright (C) 2005 Okano, Shinchi <shinchan.okano@nifty.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+FormatVersion = 0.0.0
+Encoding = EUC-JP
+Title = TRON-QWERTY-JPÇÛÎó
+Version = 0.0.0
+
+[NICOLATable/FundamentalTable]
+# non modifiered keys
+1=1,¡Ä,¡Á
+2=2,¡®,¡Ç
+3=3,¡È,¡É
+4=4,¡Ö,¡×
+5=5,¡Ø,¡Ù
+6=6,¡ã,¡ä
+7=7,¡Ê,¡Ë
+8=8,¡Ð,¡Ñ
+9=9,¡Î,¡Ï
+0=0,¡À,¡Ã
+!=1,¡Ä,¡Á
+"=2,¡®,¡Ç
+\#=3,¡È,¡É
+$=4,¡Ö,¡×
+%=5,¡Ø,¡Ù
+&=6,¡ã,¡ä
+'=7,¡Ê,¡Ë
+(=8,¡Ð,¡Ñ
+)=9,¡Î,¡Ï
+~=0,¡À,¡Ã
+q=¤é,¤Ò,¤Ó
+w=¤ë,¤½,¤¾
+e=¤³,¡¦,¤´
+r=¤Ï,¤ã,¤Ð
+t=¤ç,¤Û,¤Ü
+y=¤,¤®,¤¨
+u=¤Î,¤²,¤±
+i=¤¯,¤°,¤á
+o=¤¢, ,¤à
+#o=¤¢,¤×,¤à
+p=¤ì,¤ð,¤í
+#p=¤ì,¤Ý,¤í
+a=¤¿,¤Ì,¤À
+s=¤È,¤Í,¤É
+d=¤«,¤å,¤¬
+f=¤Æ,¤è,¤Ç
+g=¤â,¤Õ,¤Ö
+h=¤ò,¡«,¤ª
+j=¤¤,¤Â,¤Á
+k=¤¦,¥ô,¡¼
+l=¤·,¤¸,¤ß
+;=¤ó,¤ñ,¤ä
+:=¤ó,¤ñ,¤ä
+#;=¤ó,¤Ñ,¤ä
+#:=¤ó,¤Ñ,¤ä
+z=¤Þ,¤§,¥õ
+#z=¤Þ,¤§,¤Ô
+x=¤ê,¤©,¥ö
+#x=¤ê,¤©,¤Ú
+c=¤Ë,¤»,¤¼
+v=¤µ,¤æ,¤¶
+b=¤Ê,¤Ø,¤Ù
+n=¤¹,¤º,¤ï
+m=¤Ä,¤Å,¤£
+,=¡¢,\,,¤¡
+<=¡¢,\,,¤¡
+.=¡£,.,¡¬
+>=¡£,.,¡¬
+/=¤Ã,¤î,¤¥
+
+-=¡Ý,¡Ü,¡à
+\==¡Ý,¡Ü,¡à
+\[=¡á,¡ô,¡ó
+{=¡á,¡ô,¡ó
+\]=¡¿,¡ö,¡ß
+}=¡¿,¡ö,¡ß
+
+@=¡÷,¡ð,¡ï
+`=¡÷,¡ð,¡ï
+^=¡²,¡ª,¡ª
+~=¡²,¡ª,¡ª
+\\=_,¡©,¡©
+_=_,¡©,¡©
--- /dev/null
+#
+# tsuki-2-203_106.sty - Tsuki 2-236 style for 101 US keybord
+# Copyright (C) 2006 Tatsuki Sugiura <sugi@nemui.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+FormatVersion = 0.0.0
+Encoding = EUC-JP
+Title = ·î (2-263) 101US
+Version = 0.0.2
+
+# Override fundamental table
+[KanaTable/FundamentalTable]
+q=,¤½
+w=,¤³
+e=,¤·
+r=,¤Æ
+t=¤ç
+y=,¤Ä
+u=¤ó
+i=¤¤
+o=¤Î
+p=¤ê
+\[=,¤Á
+a=,¤Ï
+s=,¤«
+f=,¤È
+g=,¤¿
+h=,¤¯
+j=¤¦
+l=¡«
+;=,¤
+'=¤ì
+z=,¤¹
+x=,¤±
+c=¤Ë
+v=¤Ê
+b=,¤µ
+n=¤Ã
+m=¤ë
+,=¡¢
+.=¡£
+/=¡¬
+\\=¡¦
+d\\=¡©
+kq=¤¡
+kw=,¤Ò
+ke=,¤Û
+kr=,¤Õ
+kt=¤á
+ka=¤£
+ks=¤ò
+kd=¤é
+kf=¤¢
+kg=¤è
+kz=¤¥
+kx=,¤Ø
+kc=,¤»
+kv=¤å
+kb=¤ã
+dy=¤Ì
+du=¤¨
+di=¤ß
+do=¤ä
+dp=¤§
+d\[=¡Ö
+dh=¤Þ
+dj=¤ª
+dk=¤â
+dl=¤ï
+d;=¤æ
+d'=¡×
+dn=¤à
+dm=¤í
+d,=¤Í
+d.=¡¼
+d/=¤©
--- /dev/null
+#
+# tsuki-2-203_106.sty - Tsuki 2-236 style for 106/109 JP keybord
+# Copyright (C) 2006 Tatsuki Sugiura <sugi@nemui.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+FormatVersion = 0.0.0
+Encoding = EUC-JP
+Title = ·î (2-263) 106JP
+Version = 0.0.2
+
+# Override fundamental table
+[KanaTable/FundamentalTable]
+q=,¤½
+w=,¤³
+e=,¤·
+r=,¤Æ
+t=¤ç
+y=,¤Ä
+u=¤ó
+i=¤¤
+o=¤Î
+p=¤ê
+@=,¤Á
+a=,¤Ï
+s=,¤«
+f=,¤È
+g=,¤¿
+h=,¤¯
+j=¤¦
+l=¡«
+;=,¤
+:=¤ì
+z=,¤¹
+x=,¤±
+c=¤Ë
+v=¤Ê
+b=,¤µ
+n=¤Ã
+m=¤ë
+,=¡¢
+.=¡£
+/=¡¬
+\\=¡¦
+d\\=¡©
+kq=¤¡
+kw=,¤Ò
+ke=,¤Û
+kr=,¤Õ
+kt=¤á
+ka=¤£
+ks=¤ò
+kd=¤é
+kf=¤¢
+kg=¤è
+kz=¤¥
+kx=,¤Ø
+kc=,¤»
+kv=¤å
+kb=¤ã
+dy=¤Ì
+du=¤¨
+di=¤ß
+do=¤ä
+dp=¤§
+d@=¡Ö
+dh=¤Þ
+dj=¤ª
+dk=¤â
+dl=¤ï
+d;=¤æ
+d:=¡×
+dn=¤à
+dm=¤í
+d,=¤Í
+d.=¡¼
+d/=¤©
+
--- /dev/null
+#
+# vje-delta.sty - VACS VJE-Delta like style definition file for scim-anthy.
+# Copyright (C) 2005 Takuro Ashie <ashie@homa.ne.jp>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+FormatVersion = 0.0.0
+Encoding = EUC-JP
+Title = VJE-Delta
+Version = 0.0.0
+
+[KeyBindings]
+OnOffKey = Zenkaku_Hankaku,Henkan,Control+F8,Control+Shift+l,Control+Shift+L
+CircleInputModeKey =
+CircleKanaModeKey =
+LatinModeKey =
+WideLatinModeKey =
+HiraganaModeKey = Control+F6,Control+Shift+j,Control+Shift+J
+KatakanaModeKey = Control+F7,Control+Shift+k,Control+Shift+K
+HalfKatakanaModeKey =
+CircleTypingMethodKey = Control+F3,Control+Shift+r,Control+Shift+R
+
+ConvertKey = space,Henkan,Down
+CancelKey = Escape
+CancelAllKey = Shift+BackSpace,Control+y,Control+Y
+CommitKey = Return,Muhenkan
+
+InsertSpaceKey = space
+InsertAltSpaceKey = Shift+space
+BackSpaceKey = BackSpace,Control+h,Control+H
+DeleteKey = Delete,Control+g,Control+G
+
+MoveCaretBackwardKey = Left,Control+s,Control+S
+MoveCaretForwardKey = Right,Control+d,Control+D
+MoveCaretFirstKey =
+MoveCaretLastKey =
+
+SelectPrevSegmentKey = Left,Control+s,Control+S
+SelectNextSegmentKey = Right,Control+d,Control+D
+SelectFirstSegmentKey = Page_Up,Control+a,Control+A
+SelectLastSegmentKey = Page_Down,Control+f,Control+F
+ExpandSegmentKey = Shift+Right,Control+w,Control+W
+ShrinkSegmentKey = Shift+Left,Control+q,Control+Q
+CommitSelectedSegmentKey =
+
+CandidatesPageUpKey = Shift+Up,Control+e,Control+E
+CandidatesPageDownKey = Shift+Down,Control+x,Control+X
+SelectNextCandidateKey = space,Henkan,Down
+SelectPrevCandidateKey = Up
+
+SelectCandidates1Key = 1
+SelectCandidates2Key = 2
+SelectCandidates3Key = 3
+SelectCandidates4Key = 4
+SelectCandidates5Key = 5
+SelectCandidates6Key = 6
+SelectCandidates7Key = 7
+SelectCandidates8Key = 8
+SelectCandidates9Key = 9
+SelectCandidates10Key = 0
+
+ConvertToHiraganaKey = F6,Control+j
+ConvertToKatakanaKey = F7,Control+k
+ConvertToHalfKey = F9,Control+o
+ConvertToHalfKatakanaKey =
+ConvertToWideLatinKey = F8,Control+l
+ConvertToLatinKey =
+
+AddWordKey =
+
+
+# Override fundamental table
+[RomajiTable/FundamentalTable]
+- = ¡¼
+#[ = ¡Ö
+#] = ¡×
+a = ¤¢
+i = ¤¤
+u = ¤¦
+e = ¤¨
+o = ¤ª
+xa = ¤¡
+xi = ¤£
+xu = ¤¥
+xe = ¤§
+xo = ¤©
+ka = ¤«
+ki = ¤
+ku = ¤¯
+ke = ¤±
+ko = ¤³
+xka = ¥õ
+xke = ¥ö
+kya = ¤¤ã
+kyi = ¤¤£
+kyu = ¤¤å
+cu = ¤¤å
+kye = ¤¤§
+kyo = ¤¤ç
+kwa = ¤¯¤¡
+qa = ¤¯¤¡
+kwi = ¤¯¤£
+qi = ¤¯¤£
+kwe = ¤¯¤§
+qe = ¤¯¤§
+kwo = ¤¯¤©
+qo = ¤¯¤©
+qya = ¤¯¤ã
+qyi = ¤¯¤£
+qyu = ¤¯¤å
+qye = ¤¯¤§
+quo = ¤¯¤ç
+sa = ¤µ
+si = ¤·
+shi = ¤·
+ci = ¤·
+su = ¤¹
+se = ¤»
+ce = ¤»
+so = ¤½
+sya = ¤·¤ã
+sha = ¤·¤ã
+syi = ¤·¤£
+syu = ¤·¤å
+shu = ¤·¤å
+sye = ¤·¤§
+she = ¤·¤§
+syo = ¤·¤ç
+sho = ¤·¤ç
+ta = ¤¿
+ti = ¤Á
+chi = ¤Á
+tu = ¤Ä
+tsu = ¤Ä
+te = ¤Æ
+to = ¤È
+tya = ¤Á¤ã
+cya = ¤Á¤ã
+cha = ¤Á¤ã
+tyi = ¤Á¤£
+cyi = ¤Á¤£
+tyu = ¤Á¤å
+cyu = ¤Á¤å
+chu = ¤Á¤å
+tye = ¤Á¤§
+cye = ¤Á¤§
+che = ¤Á¤§
+tyo = ¤Á¤ç
+cyo = ¤Á¤ç
+cho = ¤Á¤ç
+xtu = ¤Ã
+tsa = ¤Ä¤¡
+tsi = ¤Ä¤£
+tse = ¤Ä¤§
+tso = ¤Ä¤©
+tha = ¤Æ¤ã
+thi = ¤Æ¤£
+thu = ¤Æ¤å
+the = ¤Æ¤§
+tho = ¤Æ¤ç
+twu = ¤È¤¥
+na = ¤Ê
+ni = ¤Ë
+nu = ¤Ì
+ne = ¤Í
+no = ¤Î
+nya = ¤Ë¤ã
+nyi = ¤Ë¤£
+nyu = ¤Ë¤å
+nye = ¤Ë¤§
+nyo = ¤Ë¤ç
+ha = ¤Ï
+hi = ¤Ò
+hu = ¤Õ
+fu = ¤Õ
+he = ¤Ø
+ho = ¤Û
+hya = ¤Ò¤ã
+hyi = ¤Ò¤£
+hyu = ¤Ò¤å
+hye = ¤Ò¤§
+hyo = ¤Ò¤ç
+fa = ¤Õ¤¡
+fi = ¤Õ¤£
+fe = ¤Õ¤§
+fo = ¤Õ¤©
+fya = ¤Õ¤ã
+fyi = ¤Õ¤£
+fyu = ¤Õ¤å
+fye = ¤Õ¤§
+fyo = ¤Õ¤ç
+ma = ¤Þ
+mi = ¤ß
+mu = ¤à
+me = ¤á
+mo = ¤â
+mya = ¤ß¤ã
+myi = ¤ß¤£
+myu = ¤ß¤å
+mye = ¤ß¤§
+myo = ¤ß¤ç
+ya = ¤ä
+yi = ¤¤
+yu = ¤æ
+ye = ¤¤¤§
+yo = ¤è
+xya = ¤ã
+xyi = ¤£
+xyu = ¤å
+xye = ¤§
+xyo = ¤ç
+la = ¤é
+ra = ¤é
+li = ¤ê
+ri = ¤ê
+lu = ¤ë
+ru = ¤ë
+le = ¤ì
+re = ¤ì
+lo = ¤í
+ro = ¤í
+lya = ¤ê¤ã
+rya = ¤ê¤ã
+lyi = ¤ê¤£
+ryi = ¤ê¤£
+lyu = ¤ê¤å
+ryu = ¤ê¤å
+lye = ¤ê¤§
+rye = ¤ê¤§
+lyo = ¤ê¤ç
+ryo = ¤ê¤ç
+wa = ¤ï
+wi = ¤¦¤£
+wu = ¤¦
+we = ¤¦¤§
+wo = ¤ò
+xwa = ¤î
+wha = ¤¦¤¡
+whi = ¤¦¤£
+whu = ¤¦
+whe = ¤¦¤§
+who = ¤¦¤©
+nn = ¤ó
+n' = ¤ó
+ga = ¤¬
+gi = ¤®
+gu = ¤°
+ge = ¤²
+go = ¤´
+gwa = ¤°¤¡
+gwi = ¤°¤£
+gwu = ¤°¤å
+gwe = ¤°¤§
+gwo = ¤°¤©
+gya = ¤®¤ã
+gyi = ¤®¤£
+gyu = ¤®¤å
+gye = ¤®¤§
+gyo = ¤®¤ç
+za = ¤¶
+zi = ¤¸
+ji = ¤¸
+zu = ¤º
+ze = ¤¼
+zo = ¤¾
+zya = ¤¸¤ã
+ja = ¤¸¤ã
+jya = ¤¸¤ã
+zyi = ¤¸¤£
+ji = ¤¸¤£
+jyi = ¤¸¤£
+zyu = ¤¸¤å
+ju = ¤¸¤å
+jyu = ¤¸¤å
+zye = ¤¸¤§
+je = ¤¸¤§
+jye = ¤¸¤§
+zyo = ¤¸¤ç
+jo = ¤¸¤ç
+jyo = ¤¸¤ç
+da = ¤À
+di = ¤Â
+du = ¤Å
+de = ¤Ç
+do = ¤É
+dya = ¤Â¤ã
+dyi = ¤Ç¤£
+dyu = ¤Â¤å
+dye = ¤Â¤§
+dyo = ¤Â¤ç
+dha = ¤Ç¤ã
+dhi = ¤Ç¤£
+dhu = ¤Ç¤å
+dhe = ¤Ç¤§
+dho = ¤Ç¤ç
+dwu = ¤É¤¥
+ba = ¤Ð
+bi = ¤Ó
+bu = ¤Ö
+be = ¤Ù
+bo = ¤Ü
+bya = ¤Ó¤ã
+byi = ¤Ó¤£
+byu = ¤Ó¤å
+bye = ¤Ó¤§
+byo = ¤Ó¤ç
+pa = ¤Ñ
+pi = ¤Ô
+pu = ¤×
+pe = ¤Ú
+po = ¤Ý
+pya = ¤Ô¤ã
+pyi = ¤Ô¤£
+pyu = ¤Ô¤å
+pye = ¤Ô¤§
+pyo = ¤Ô¤ç
+va = ¥ô¤¡
+vi = ¥ô¤£
+vu = ¥ô¤¥
+ve = ¥ô¤§
+vo = ¥ô¤©
+vya = ¥ô¤ã
+vyi = ¥ô¤£
+vyu = ¥ô¤å
+vye = ¥ô¤§
+vyo = ¥ô¤ç
--- /dev/null
+#
+# wnn.sty - Wnn like style definition file for scim-anthy.
+# Copyright (C) 2005 Takuro Ashie <ashie@homa.ne.jp>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+FormatVersion = 0.0.0
+Encoding = EUC-JP
+Title = Wnn
+Version = 0.0.0
+
+[KeyBindings]
+OnOffKey = Shift+space
+CircleInputModeKey =
+CircleKanaModeKey =
+LatinModeKey =
+WideLatinModeKey =
+HiraganaModeKey =
+KatakanaModeKey =
+HalfKatakanaModeKey =
+CircleTypingMethodKey =
+
+ConvertKey = space
+PredictKey = Control+q,Control+Q
+CancelKey = Escape,Control+g,Control+G,Alt+Down,Muhenkan
+CommitKey = Control+l,Control+L,Control+m,Control+M,Control+j,Control+J,Return
+
+InsertSpaceKey = space
+InsertAltSpaceKey =
+BackSpaceKey = Control+h,Backspace
+DeleteKey = Control+d,Delete
+
+MoveCaretBackwardKey = Control+b,Control+B,Left
+MoveCaretForwardKey = Control+f,Control+F,Right
+MoveCaretFirstKey = Control+a,Control+A,Alt+Left
+MoveCaretLastKey = Control+e,Control+E,Alt+Right
+
+SelectPrevSegmentKey = Control+b,Control+B,Left
+SelectNextSegmentKey = Control+f,Control+F,Right
+SelectFirstSegmentKey = Control+a,Control+A,Alt+Left
+SelectLastSegmentKey = Control+e,Control+E,Alt+Right
+ExpandSegmentKey = Control+o,Control+O,F14
+ShrinkSegmentKey = Control+i,Control+I,F13
+CommitSelectedSegmentKey =
+
+CandidatesPageUpKey = Tab
+CandidatesPageDownKey = Shift+Tab
+SelectNextCandidateKey = space,Control+q,Control+Q,Control+p,Control+P,Up
+SelectPrevCandidateKey = Control+n,Control+N,Down
+
+SelectCandidates1Key = 1
+SelectCandidates2Key = 2
+SelectCandidates3Key = 3
+SelectCandidates4Key = 4
+SelectCandidates5Key = 5
+SelectCandidates6Key = 6
+SelectCandidates7Key = 7
+SelectCandidates8Key = 8
+SelectCandidates9Key = 9
+SelectCandidates10Key = 0
+
+ConvertToHiraganaKey = F6
+ConvertToKatakanaKey = F7
+ConvertToHalfKey = F8
+ConvertToHalfKatakanaKey =
+ConvertToWideLatinKey = F9
+ConvertToLatinKey = F10
+
+AddWordKey =
+
+# Override fundamental table
+[RomajiTable/FundamentalTable]
+- = ¡¼
+#/ = ¡¦
+#[ = ¡Ö
+#] = ¡×
+z. = ¡Ä
+z- = ¡Á
+a = ¤¢
+i = ¤¤
+u = ¤¦
+e = ¤¨
+o = ¤ª
+ka = ¤«
+ki = ¤
+ku = ¤¯
+ke = ¤±
+ko = ¤³
+kya = ¤¤ã
+kyi = ¤¤£
+kyu = ¤¤å
+kye = ¤¤§
+kyo = ¤¤ç
+sa = ¤µ
+si = ¤·
+su = ¤¹
+se = ¤»
+so = ¤½
+sya = ¤·¤ã
+syi = ¤·¤£
+syu = ¤·¤å
+sye = ¤·¤§
+syo = ¤·¤ç
+sha = ¤·¤ã
+shi = ¤·
+shu = ¤·¤å
+she = ¤·¤§
+sho = ¤·¤ç
+ta = ¤¿
+ti = ¤Á
+tu = ¤Ä
+te = ¤Æ
+to = ¤È
+tya = ¤Á¤ã
+tyi = ¤Æ¤£
+tyu = ¤Á¤å
+tye = ¤Á¤§
+tyo = ¤Á¤ç
+tha = ¤Æ¤ã
+thi = ¤Æ¤£
+thu = ¤Æ¤å
+the = ¤Æ¤§
+tho = ¤Æ¤ç
+tsu = ¤Ä
+cha = ¤Á¤ã
+chi = ¤Á
+chu = ¤Á¤å
+che = ¤Á¤§
+cho = ¤Á¤ç
+na = ¤Ê
+ni = ¤Ë
+nu = ¤Ì
+ne = ¤Í
+no = ¤Î
+nya = ¤Ë¤ã
+nyi = ¤Ë¤£
+nyu = ¤Ë¤å
+nye = ¤Ë¤§
+nyo = ¤Ë¤ç
+ha = ¤Ï
+hi = ¤Ò
+hu = ¤Õ
+he = ¤Ø
+ho = ¤Û
+hya = ¤Ò¤ã
+hyi = ¤Ò¤£
+hyu = ¤Ò¤å
+hye = ¤Ò¤§
+hyo = ¤Ò¤ç
+fa = ¤Õ¤¡
+fi = ¤Õ¤£
+fu = ¤Õ
+fe = ¤Õ¤§
+fo = ¤Õ¤©
+fya = ¤Õ¤ã
+fyi = ¤Õ¤£
+fyu = ¤Õ¤å
+fye = ¤Õ¤§
+fyo = ¤Õ¤ç
+ma = ¤Þ
+mi = ¤ß
+mu = ¤à
+me = ¤á
+mo = ¤â
+mya = ¤ß¤ã
+myu = ¤ß¤å
+mye = ¤ß¤§
+myo = ¤ß¤ç
+ya = ¤ä
+yi = ¤¤
+yu = ¤æ
+ye = ¤¤¤§
+yo = ¤è
+ra = ¤é
+ri = ¤ê
+ru = ¤ë
+re = ¤ì
+ro = ¤í
+la = ¤é
+li = ¤ê
+lu = ¤ë
+le = ¤ì
+lo = ¤í
+rya = ¤ê¤ã
+ryi = ¤ê¤£
+ryu = ¤ê¤å
+rye = ¤ê¤§
+ryo = ¤ê¤ç
+lya = ¤ê¤ã
+lyi = ¤ê¤£
+lyu = ¤ê¤å
+lye = ¤ê¤§
+lyo = ¤ê¤ç
+wa = ¤ï
+wi = ¤ð
+wu = ¤¦
+we = ¤ñ
+wo = ¤ò
+ga = ¤¬
+gi = ¤®
+gu = ¤°
+ge = ¤²
+go = ¤´
+gya = ¤®¤ã
+gyi = ¤®¤£
+gyu = ¤®¤å
+gye = ¤®¤§
+gyo = ¤®¤ç
+za = ¤¶
+zi = ¤¸
+zu = ¤º
+ze = ¤¼
+zo = ¤¾
+zya = ¤¸¤ã
+zyi = ¤¸¤£
+zyu = ¤¸¤å
+zye = ¤¸¤§
+zyo = ¤¸¤ç
+ja = ¤¸¤ã
+ji = ¤¸
+ju = ¤¸¤å
+je = ¤¸¤§
+jo = ¤¸¤ç
+da = ¤À
+di = ¤Â
+du = ¤Å
+de = ¤Ç
+do = ¤É
+dya = ¤Â¤ã
+dyi = ¤Ç¤£
+dyu = ¤Â¤å
+dye = ¤Â¤§
+dyo = ¤Â¤ç
+dha = ¤Ç¤ã
+dhi = ¤Ç¤£
+dhu = ¤Ç¤å
+dhe = ¤Ç¤§
+dho = ¤Ç¤ç
+ba = ¤Ð
+bi = ¤Ó
+bu = ¤Ö
+be = ¤Ù
+bo = ¤Ü
+bya = ¤Ó¤ã
+byi = ¤Ó¤å
+byu = ¤Ó¤å
+bye = ¤Ó¤§
+byo = ¤Ó¤ç
+pa = ¤Ñ
+pi = ¤Ô
+pu = ¤×
+pe = ¤Ú
+po = ¤Ý
+pya = ¤Ô¤ã
+pyi = ¤Ô¤£
+pyu = ¤Ô¤å
+pye = ¤Ô¤§
+pyo = ¤Ô¤ç
+va = ¥ô¤¡
+vi = ¥ô¤£
+vu = ¥ô
+ve = ¥ô¤§
+vo = ¥ô¤©
+kwa = ¤¯¤î
+kwi = ¤¯¤£
+kwu = ¤¯
+kwe = ¤¯¤§
+kwo = ¤¯¤©
+gwa = ¤°¤î
+gwi = ¤°¤£
+gwu = ¤°
+gwe = ¤°¤§
+gwo = ¤°¤©
+tsa = ¤Ä¤¡
+tsi = ¤Ä¤£
+tse = ¤Ä¤§
+tso = ¤Ä¤©
+n = ¤ó
+n' = ¤ó
+nn = ¤ó
+xa = ¤¡
+xi = ¤£
+xu = ¤¥
+xe = ¤§
+xo = ¤©
+xya = ¤ã
+xyu = ¤å
+xyo = ¤ç
+xtu = ¤Ã
+xwa = ¤î
+xti = ¤Æ¤£
+xdi = ¤Ç¤£
+xdu = ¤É¤¥
+xde = ¤Ç¤§
+xdo = ¤É¤©
+xwi = ¤¦¤£
+xwe = ¤¦¤§
+xwo = ¤¦¤©
--- /dev/null
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2006-10-15.18
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
+# Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, 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.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by `PROGRAMS ARGS'.
+ object Object file output by `PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputing dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> $depfile
+ echo >> $depfile
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> $depfile
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts `$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+ tmpdepfile="$stripped.u"
+ if test "$libtool" = yes; then
+ "$@" -Wc,-M
+ else
+ "$@" -M
+ fi
+ stat=$?
+
+ if test -f "$tmpdepfile"; then :
+ else
+ stripped=`echo "$stripped" | sed 's,^.*/,,'`
+ tmpdepfile="$stripped.u"
+ fi
+
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile"; then
+ outname="$stripped.o"
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+ sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+icc)
+ # Intel's C compiler understands `-MD -MF file'. However on
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # ICC 7.0 will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want:
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+ # ICC 7.1 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using \ :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+ sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add `dependent.h:' lines.
+ sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+ if test "$libtool" = yes; then
+ # With Tru64 cc, shared objects can also be used to make a
+ # static library. This mechanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+ # compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.o.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ tmpdepfile4=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for `:'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+ "$@" $dashmflag |
+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no
+ for arg in "$@"; do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E |
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ "$@" || exit $?
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
--- /dev/null
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2006-10-14.15
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+posix_glob=
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chmodcmd=$chmodprog
+chowncmd=
+chgrpcmd=
+stripcmd=
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=
+dst=
+dir_arg=
+dstarg=
+no_target_directory=
+
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+-c (ignored)
+-d create directories instead of installing files.
+-g GROUP $chgrpprog installed files to GROUP.
+-m MODE $chmodprog installed files to MODE.
+-o USER $chownprog installed files to USER.
+-s $stripprog installed files.
+-t DIRECTORY install into DIRECTORY.
+-T report an error if DSTFILE is a directory.
+--help display this help and exit.
+--version display version info and exit.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ shift
+ shift
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd=$stripprog
+ shift
+ continue;;
+
+ -t) dstarg=$2
+ shift
+ shift
+ continue;;
+
+ -T) no_target_directory=true
+ shift
+ continue;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dstarg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dstarg"
+ shift # fnord
+ fi
+ shift # arg
+ dstarg=$arg
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src ;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dstarg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dstarg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst ;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dstarg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix=/ ;;
+ -*) prefix=./ ;;
+ *) prefix= ;;
+ esac
+
+ case $posix_glob in
+ '')
+ if (set -f) 2>/dev/null; then
+ posix_glob=true
+ else
+ posix_glob=false
+ fi ;;
+ esac
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob && set -f
+ set fnord $dstdir
+ shift
+ $posix_glob && set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # Now rename the file to the real destination.
+ { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
+ || {
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ if test -f "$dst"; then
+ $doit $rmcmd -f "$dst" 2>/dev/null \
+ || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
+ && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
+ || {
+ echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ else
+ :
+ fi
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ } || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
--- /dev/null
+2004-01-29 GNU <bug-gnu-gettext@gnu.org>
+
+ * Version 0.14.1 released.
+
--- /dev/null
+# Makefile for directory with message catalog handling library of GNU gettext
+# Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Library General Public License as published
+# by the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library 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.
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+SHELL = /bin/sh
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = ..
+VPATH = $(srcdir)
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+transform = @program_transform_name@
+libdir = @libdir@
+includedir = @includedir@
+datadir = @datadir@
+localedir = $(datadir)/locale
+gettextsrcdir = $(datadir)/gettext/intl
+aliaspath = $(localedir)
+subdir = intl
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
+
+l = @INTL_LIBTOOL_SUFFIX_PREFIX@
+
+AR = ar
+CC = @CC@
+LIBTOOL = @LIBTOOL@
+RANLIB = @RANLIB@
+YACC = @INTLBISON@ -y -d
+YFLAGS = --name-prefix=__gettext
+
+DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
+-DLIBDIR=\"$(libdir)\" -DIN_LIBINTL \
+-DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \
+-Dset_relocation_prefix=libintl_set_relocation_prefix \
+-Drelocate=libintl_relocate \
+-DDEPENDS_ON_LIBICONV=1 @DEFS@
+CPPFLAGS = @CPPFLAGS@
+CFLAGS = @CFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+
+COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
+
+HEADERS = \
+ gmo.h \
+ gettextP.h \
+ hash-string.h \
+ loadinfo.h \
+ plural-exp.h \
+ eval-plural.h \
+ localcharset.h \
+ relocatable.h \
+ xsize.h \
+ printf-args.h printf-args.c \
+ printf-parse.h wprintf-parse.h printf-parse.c \
+ vasnprintf.h vasnwprintf.h vasnprintf.c \
+ os2compat.h \
+ libgnuintl.h.in
+SOURCES = \
+ bindtextdom.c \
+ dcgettext.c \
+ dgettext.c \
+ gettext.c \
+ finddomain.c \
+ loadmsgcat.c \
+ localealias.c \
+ textdomain.c \
+ l10nflist.c \
+ explodename.c \
+ dcigettext.c \
+ dcngettext.c \
+ dngettext.c \
+ ngettext.c \
+ plural.y \
+ plural-exp.c \
+ localcharset.c \
+ relocatable.c \
+ localename.c \
+ log.c \
+ printf.c \
+ osdep.c \
+ os2compat.c \
+ intl-compat.c
+OBJECTS = \
+ bindtextdom.$lo \
+ dcgettext.$lo \
+ dgettext.$lo \
+ gettext.$lo \
+ finddomain.$lo \
+ loadmsgcat.$lo \
+ localealias.$lo \
+ textdomain.$lo \
+ l10nflist.$lo \
+ explodename.$lo \
+ dcigettext.$lo \
+ dcngettext.$lo \
+ dngettext.$lo \
+ ngettext.$lo \
+ plural.$lo \
+ plural-exp.$lo \
+ localcharset.$lo \
+ relocatable.$lo \
+ localename.$lo \
+ log.$lo \
+ printf.$lo \
+ osdep.$lo \
+ intl-compat.$lo
+DISTFILES.common = Makefile.in \
+config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
+DISTFILES.generated = plural.c
+DISTFILES.normal = VERSION
+DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc \
+libgnuintl.h_vms Makefile.vms \
+libgnuintl.h.msvc-static libgnuintl.h.msvc-shared README.woe32 Makefile.msvc
+DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \
+COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h
+
+all: all-@USE_INCLUDED_LIBINTL@
+all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
+all-no: all-no-@BUILD_INCLUDED_LIBINTL@
+all-no-yes: libgnuintl.$la
+all-no-no:
+
+libintl.a libgnuintl.a: $(OBJECTS)
+ rm -f $@
+ $(AR) cru $@ $(OBJECTS)
+ $(RANLIB) $@
+
+libintl.la libgnuintl.la: $(OBJECTS)
+ $(LIBTOOL) --mode=link \
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
+ $(OBJECTS) @LTLIBICONV@ $(LIBS) -lc \
+ -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
+ -rpath $(libdir) \
+ -no-undefined
+
+# Libtool's library version information for libintl.
+# Before making a gettext release, the gettext maintainer must change this
+# according to the libtool documentation, section "Library interface versions".
+# Maintainers of other packages that include the intl directory must *not*
+# change these values.
+LTV_CURRENT=7
+LTV_REVISION=0
+LTV_AGE=4
+
+.SUFFIXES:
+.SUFFIXES: .c .y .o .lo .sin .sed
+
+.c.o:
+ $(COMPILE) $<
+
+.y.c:
+ $(YACC) $(YFLAGS) --output $@ $<
+ rm -f $*.h
+
+bindtextdom.lo: $(srcdir)/bindtextdom.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
+dcgettext.lo: $(srcdir)/dcgettext.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
+dgettext.lo: $(srcdir)/dgettext.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c
+gettext.lo: $(srcdir)/gettext.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
+finddomain.lo: $(srcdir)/finddomain.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
+loadmsgcat.lo: $(srcdir)/loadmsgcat.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
+localealias.lo: $(srcdir)/localealias.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c
+textdomain.lo: $(srcdir)/textdomain.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c
+l10nflist.lo: $(srcdir)/l10nflist.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
+explodename.lo: $(srcdir)/explodename.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c
+dcigettext.lo: $(srcdir)/dcigettext.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
+dcngettext.lo: $(srcdir)/dcngettext.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
+dngettext.lo: $(srcdir)/dngettext.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c
+ngettext.lo: $(srcdir)/ngettext.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c
+plural.lo: $(srcdir)/plural.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c
+plural-exp.lo: $(srcdir)/plural-exp.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
+localcharset.lo: $(srcdir)/localcharset.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
+relocatable.lo: $(srcdir)/relocatable.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
+localename.lo: $(srcdir)/localename.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c
+log.lo: $(srcdir)/log.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c
+printf.lo: $(srcdir)/printf.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/printf.c
+osdep.lo: $(srcdir)/osdep.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c
+intl-compat.lo: $(srcdir)/intl-compat.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c
+
+ref-add.sed: $(srcdir)/ref-add.sin
+ sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
+ mv t-ref-add.sed ref-add.sed
+ref-del.sed: $(srcdir)/ref-del.sin
+ sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
+ mv t-ref-del.sed ref-del.sed
+
+INCLUDES = -I. -I$(srcdir) -I..
+
+libgnuintl.h: $(srcdir)/libgnuintl.h.in
+ sed -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
+ -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
+ -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
+ -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
+ < $(srcdir)/libgnuintl.h.in > libgnuintl.h
+
+libintl.h: libgnuintl.h
+ cp libgnuintl.h libintl.h
+
+charset.alias: $(srcdir)/config.charset
+ $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
+ mv t-$@ $@
+
+check: all
+
+# We must not install the libintl.h/libintl.a files if we are on a
+# system which has the GNU gettext() function in its C library or in a
+# separate library.
+# If you want to use the one which comes with this version of the
+# package, you have to use `configure --with-included-gettext'.
+install: install-exec install-data
+install-exec: all
+ if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
+ && test '@USE_INCLUDED_LIBINTL@' = yes; then \
+ $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
+ $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
+ $(LIBTOOL) --mode=install \
+ $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
+ if test "@RELOCATABLE@" = yes; then \
+ dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
+ if test -n "$$dependencies"; then \
+ rm -f $(DESTDIR)$(libdir)/libintl.la; \
+ fi; \
+ fi; \
+ else \
+ : ; \
+ fi
+ if test "$(PACKAGE)" = "gettext-tools" \
+ && test '@USE_INCLUDED_LIBINTL@' = no; then \
+ $(mkinstalldirs) $(DESTDIR)$(libdir); \
+ $(LIBTOOL) --mode=install \
+ $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \
+ rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
+ $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \
+ $(LIBTOOL) --mode=uninstall \
+ rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \
+ else \
+ : ; \
+ fi
+ if test '@USE_INCLUDED_LIBINTL@' = yes; then \
+ test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
+ temp=$(DESTDIR)$(libdir)/t-charset.alias; \
+ dest=$(DESTDIR)$(libdir)/charset.alias; \
+ if test -f $(DESTDIR)$(libdir)/charset.alias; then \
+ orig=$(DESTDIR)$(libdir)/charset.alias; \
+ sed -f ref-add.sed $$orig > $$temp; \
+ $(INSTALL_DATA) $$temp $$dest; \
+ rm -f $$temp; \
+ else \
+ if test @GLIBC21@ = no; then \
+ orig=charset.alias; \
+ sed -f ref-add.sed $$orig > $$temp; \
+ $(INSTALL_DATA) $$temp $$dest; \
+ rm -f $$temp; \
+ fi; \
+ fi; \
+ $(mkinstalldirs) $(DESTDIR)$(localedir); \
+ test -f $(DESTDIR)$(localedir)/locale.alias \
+ && orig=$(DESTDIR)$(localedir)/locale.alias \
+ || orig=$(srcdir)/locale.alias; \
+ temp=$(DESTDIR)$(localedir)/t-locale.alias; \
+ dest=$(DESTDIR)$(localedir)/locale.alias; \
+ sed -f ref-add.sed $$orig > $$temp; \
+ $(INSTALL_DATA) $$temp $$dest; \
+ rm -f $$temp; \
+ else \
+ : ; \
+ fi
+install-data: all
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
+ $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
+ $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
+ dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
+ for file in $$dists; do \
+ $(INSTALL_DATA) $(srcdir)/$$file \
+ $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
+ dists="$(DISTFILES.generated)"; \
+ for file in $$dists; do \
+ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
+ $(INSTALL_DATA) $$dir/$$file \
+ $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ dists="$(DISTFILES.obsolete)"; \
+ for file in $$dists; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+
+install-strip: install
+
+installdirs:
+ if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
+ && test '@USE_INCLUDED_LIBINTL@' = yes; then \
+ $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
+ else \
+ : ; \
+ fi
+ if test "$(PACKAGE)" = "gettext-tools" \
+ && test '@USE_INCLUDED_LIBINTL@' = no; then \
+ $(mkinstalldirs) $(DESTDIR)$(libdir); \
+ else \
+ : ; \
+ fi
+ if test '@USE_INCLUDED_LIBINTL@' = yes; then \
+ test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
+ $(mkinstalldirs) $(DESTDIR)$(localedir); \
+ else \
+ : ; \
+ fi
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
+ else \
+ : ; \
+ fi
+
+# Define this as empty until I found a useful application.
+installcheck:
+
+uninstall:
+ if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
+ && test '@USE_INCLUDED_LIBINTL@' = yes; then \
+ rm -f $(DESTDIR)$(includedir)/libintl.h; \
+ $(LIBTOOL) --mode=uninstall \
+ rm -f $(DESTDIR)$(libdir)/libintl.$la; \
+ else \
+ : ; \
+ fi
+ if test "$(PACKAGE)" = "gettext-tools" \
+ && test '@USE_INCLUDED_LIBINTL@' = no; then \
+ rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
+ else \
+ : ; \
+ fi
+ if test '@USE_INCLUDED_LIBINTL@' = yes; then \
+ if test -f $(DESTDIR)$(libdir)/charset.alias; then \
+ temp=$(DESTDIR)$(libdir)/t-charset.alias; \
+ dest=$(DESTDIR)$(libdir)/charset.alias; \
+ sed -f ref-del.sed $$dest > $$temp; \
+ if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
+ rm -f $$dest; \
+ else \
+ $(INSTALL_DATA) $$temp $$dest; \
+ fi; \
+ rm -f $$temp; \
+ fi; \
+ if test -f $(DESTDIR)$(localedir)/locale.alias; then \
+ temp=$(DESTDIR)$(localedir)/t-locale.alias; \
+ dest=$(DESTDIR)$(localedir)/locale.alias; \
+ sed -f ref-del.sed $$dest > $$temp; \
+ if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
+ rm -f $$dest; \
+ else \
+ $(INSTALL_DATA) $$temp $$dest; \
+ fi; \
+ rm -f $$temp; \
+ fi; \
+ else \
+ : ; \
+ fi
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+
+info dvi ps pdf html:
+
+$(OBJECTS): ../config.h libgnuintl.h
+bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: $(srcdir)/gettextP.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h
+dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
+explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
+dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
+dcigettext.$lo: $(srcdir)/eval-plural.h
+localcharset.$lo: $(srcdir)/localcharset.h
+localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
+printf.$lo: $(srcdir)/printf-args.h $(srcdir)/printf-args.c $(srcdir)/printf-parse.h $(srcdir)/wprintf-parse.h $(srcdir)/xsize.h $(srcdir)/printf-parse.c $(srcdir)/vasnprintf.h $(srcdir)/vasnwprintf.h $(srcdir)/vasnprintf.c
+
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES)
+ here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
+
+ctags: CTAGS
+
+CTAGS: $(HEADERS) $(SOURCES)
+ here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
+
+id: ID
+
+ID: $(HEADERS) $(SOURCES)
+ here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
+
+
+mostlyclean:
+ rm -f *.a *.la *.o *.obj *.lo core core.*
+ rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
+ rm -f -r .libs _libs
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile ID TAGS
+ if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
+ rm -f ChangeLog.inst $(DISTFILES.normal); \
+ else \
+ : ; \
+ fi
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+
+# GNU gettext needs not contain the file `VERSION' but contains some
+# other files which should not be distributed in other packages.
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: Makefile
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ : ; \
+ else \
+ if test "$(PACKAGE)" = "gettext-runtime"; then \
+ additional="$(DISTFILES.gettext)"; \
+ else \
+ additional="$(DISTFILES.normal)"; \
+ fi; \
+ $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
+ for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
+ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
+ cp -p $$dir/$$file $(distdir); \
+ done; \
+ fi
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status
+# This would be more efficient, but doesn't work any more with autoconf-2.57,
+# when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used.
+# cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null
+GNU gettext library from gettext-0.14.1
--- /dev/null
+/* Implementation of the bindtextdomain(3) function
+ Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+#include "gettextP.h"
+
+#ifdef _LIBC
+/* We have to handle multi-threaded applications. */
+# include <bits/libc-lock.h>
+#else
+/* Provide dummy implementation if this is outside glibc. */
+# define __libc_rwlock_define(CLASS, NAME)
+# define __libc_rwlock_wrlock(NAME)
+# define __libc_rwlock_unlock(NAME)
+#endif
+
+/* The internal variables in the standalone libintl.a must have different
+ names than the internal variables in GNU libc, otherwise programs
+ using libintl.a cannot be linked statically. */
+#if !defined _LIBC
+# define _nl_default_dirname libintl_nl_default_dirname
+# define _nl_domain_bindings libintl_nl_domain_bindings
+#endif
+
+/* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>. */
+#ifndef offsetof
+# define offsetof(type,ident) ((size_t)&(((type*)0)->ident))
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Contains the default location of the message catalogs. */
+extern const char _nl_default_dirname[];
+#ifdef _LIBC
+extern const char _nl_default_dirname_internal[] attribute_hidden;
+#else
+# define INTUSE(name) name
+#endif
+
+/* List with bindings of specific domains. */
+extern struct binding *_nl_domain_bindings;
+
+/* Lock variable to protect the global data in the gettext implementation. */
+__libc_rwlock_define (extern, _nl_state_lock attribute_hidden)
+
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define BINDTEXTDOMAIN __bindtextdomain
+# define BIND_TEXTDOMAIN_CODESET __bind_textdomain_codeset
+# ifndef strdup
+# define strdup(str) __strdup (str)
+# endif
+#else
+# define BINDTEXTDOMAIN libintl_bindtextdomain
+# define BIND_TEXTDOMAIN_CODESET libintl_bind_textdomain_codeset
+#endif
+
+/* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP
+ to be used for the DOMAINNAME message catalog.
+ If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not
+ modified, only the current value is returned.
+ If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither
+ modified nor returned. */
+static void
+set_binding_values (const char *domainname,
+ const char **dirnamep, const char **codesetp)
+{
+ struct binding *binding;
+ int modified;
+
+ /* Some sanity checks. */
+ if (domainname == NULL || domainname[0] == '\0')
+ {
+ if (dirnamep)
+ *dirnamep = NULL;
+ if (codesetp)
+ *codesetp = NULL;
+ return;
+ }
+
+ __libc_rwlock_wrlock (_nl_state_lock);
+
+ modified = 0;
+
+ for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
+ {
+ int compare = strcmp (domainname, binding->domainname);
+ if (compare == 0)
+ /* We found it! */
+ break;
+ if (compare < 0)
+ {
+ /* It is not in the list. */
+ binding = NULL;
+ break;
+ }
+ }
+
+ if (binding != NULL)
+ {
+ if (dirnamep)
+ {
+ const char *dirname = *dirnamep;
+
+ if (dirname == NULL)
+ /* The current binding has be to returned. */
+ *dirnamep = binding->dirname;
+ else
+ {
+ /* The domain is already bound. If the new value and the old
+ one are equal we simply do nothing. Otherwise replace the
+ old binding. */
+ char *result = binding->dirname;
+ if (strcmp (dirname, result) != 0)
+ {
+ if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0)
+ result = (char *) INTUSE(_nl_default_dirname);
+ else
+ {
+#if defined _LIBC || defined HAVE_STRDUP
+ result = strdup (dirname);
+#else
+ size_t len = strlen (dirname) + 1;
+ result = (char *) malloc (len);
+ if (__builtin_expect (result != NULL, 1))
+ memcpy (result, dirname, len);
+#endif
+ }
+
+ if (__builtin_expect (result != NULL, 1))
+ {
+ if (binding->dirname != INTUSE(_nl_default_dirname))
+ free (binding->dirname);
+
+ binding->dirname = result;
+ modified = 1;
+ }
+ }
+ *dirnamep = result;
+ }
+ }
+
+ if (codesetp)
+ {
+ const char *codeset = *codesetp;
+
+ if (codeset == NULL)
+ /* The current binding has be to returned. */
+ *codesetp = binding->codeset;
+ else
+ {
+ /* The domain is already bound. If the new value and the old
+ one are equal we simply do nothing. Otherwise replace the
+ old binding. */
+ char *result = binding->codeset;
+ if (result == NULL || strcmp (codeset, result) != 0)
+ {
+#if defined _LIBC || defined HAVE_STRDUP
+ result = strdup (codeset);
+#else
+ size_t len = strlen (codeset) + 1;
+ result = (char *) malloc (len);
+ if (__builtin_expect (result != NULL, 1))
+ memcpy (result, codeset, len);
+#endif
+
+ if (__builtin_expect (result != NULL, 1))
+ {
+ if (binding->codeset != NULL)
+ free (binding->codeset);
+
+ binding->codeset = result;
+ binding->codeset_cntr++;
+ modified = 1;
+ }
+ }
+ *codesetp = result;
+ }
+ }
+ }
+ else if ((dirnamep == NULL || *dirnamep == NULL)
+ && (codesetp == NULL || *codesetp == NULL))
+ {
+ /* Simply return the default values. */
+ if (dirnamep)
+ *dirnamep = INTUSE(_nl_default_dirname);
+ if (codesetp)
+ *codesetp = NULL;
+ }
+ else
+ {
+ /* We have to create a new binding. */
+ size_t len = strlen (domainname) + 1;
+ struct binding *new_binding =
+ (struct binding *) malloc (offsetof (struct binding, domainname) + len);
+
+ if (__builtin_expect (new_binding == NULL, 0))
+ goto failed;
+
+ memcpy (new_binding->domainname, domainname, len);
+
+ if (dirnamep)
+ {
+ const char *dirname = *dirnamep;
+
+ if (dirname == NULL)
+ /* The default value. */
+ dirname = INTUSE(_nl_default_dirname);
+ else
+ {
+ if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0)
+ dirname = INTUSE(_nl_default_dirname);
+ else
+ {
+ char *result;
+#if defined _LIBC || defined HAVE_STRDUP
+ result = strdup (dirname);
+ if (__builtin_expect (result == NULL, 0))
+ goto failed_dirname;
+#else
+ size_t len = strlen (dirname) + 1;
+ result = (char *) malloc (len);
+ if (__builtin_expect (result == NULL, 0))
+ goto failed_dirname;
+ memcpy (result, dirname, len);
+#endif
+ dirname = result;
+ }
+ }
+ *dirnamep = dirname;
+ new_binding->dirname = (char *) dirname;
+ }
+ else
+ /* The default value. */
+ new_binding->dirname = (char *) INTUSE(_nl_default_dirname);
+
+ new_binding->codeset_cntr = 0;
+
+ if (codesetp)
+ {
+ const char *codeset = *codesetp;
+
+ if (codeset != NULL)
+ {
+ char *result;
+
+#if defined _LIBC || defined HAVE_STRDUP
+ result = strdup (codeset);
+ if (__builtin_expect (result == NULL, 0))
+ goto failed_codeset;
+#else
+ size_t len = strlen (codeset) + 1;
+ result = (char *) malloc (len);
+ if (__builtin_expect (result == NULL, 0))
+ goto failed_codeset;
+ memcpy (result, codeset, len);
+#endif
+ codeset = result;
+ new_binding->codeset_cntr++;
+ }
+ *codesetp = codeset;
+ new_binding->codeset = (char *) codeset;
+ }
+ else
+ new_binding->codeset = NULL;
+
+ /* Now enqueue it. */
+ if (_nl_domain_bindings == NULL
+ || strcmp (domainname, _nl_domain_bindings->domainname) < 0)
+ {
+ new_binding->next = _nl_domain_bindings;
+ _nl_domain_bindings = new_binding;
+ }
+ else
+ {
+ binding = _nl_domain_bindings;
+ while (binding->next != NULL
+ && strcmp (domainname, binding->next->domainname) > 0)
+ binding = binding->next;
+
+ new_binding->next = binding->next;
+ binding->next = new_binding;
+ }
+
+ modified = 1;
+
+ /* Here we deal with memory allocation failures. */
+ if (0)
+ {
+ failed_codeset:
+ if (new_binding->dirname != INTUSE(_nl_default_dirname))
+ free (new_binding->dirname);
+ failed_dirname:
+ free (new_binding);
+ failed:
+ if (dirnamep)
+ *dirnamep = NULL;
+ if (codesetp)
+ *codesetp = NULL;
+ }
+ }
+
+ /* If we modified any binding, we flush the caches. */
+ if (modified)
+ ++_nl_msg_cat_cntr;
+
+ __libc_rwlock_unlock (_nl_state_lock);
+}
+
+/* Specify that the DOMAINNAME message catalog will be found
+ in DIRNAME rather than in the system locale data base. */
+char *
+BINDTEXTDOMAIN (const char *domainname, const char *dirname)
+{
+ set_binding_values (domainname, &dirname, NULL);
+ return (char *) dirname;
+}
+
+/* Specify the character encoding in which the messages from the
+ DOMAINNAME message catalog will be returned. */
+char *
+BIND_TEXTDOMAIN_CODESET (const char *domainname, const char *codeset)
+{
+ set_binding_values (domainname, NULL, &codeset);
+ return (char *) codeset;
+}
+
+#ifdef _LIBC
+/* Aliases for function names in GNU C Library. */
+weak_alias (__bindtextdomain, bindtextdomain);
+weak_alias (__bind_textdomain_codeset, bind_textdomain_codeset);
+#endif
--- /dev/null
+#! /bin/sh
+# Output a system dependent table of character encoding aliases.
+#
+# Copyright (C) 2000-2004 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Library General Public License as published
+# by the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library 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 table consists of lines of the form
+# ALIAS CANONICAL
+#
+# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)".
+# ALIAS is compared in a case sensitive way.
+#
+# CANONICAL is the GNU canonical name for this character encoding.
+# It must be an encoding supported by libiconv. Support by GNU libc is
+# also desirable. CANONICAL is case insensitive. Usually an upper case
+# MIME charset name is preferred.
+# The current list of GNU canonical charset names is as follows.
+#
+# name MIME? used by which systems
+# ASCII, ANSI_X3.4-1968 glibc solaris freebsd darwin
+# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd darwin
+# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd darwin
+# ISO-8859-3 Y glibc solaris
+# ISO-8859-4 Y osf solaris freebsd darwin
+# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd darwin
+# ISO-8859-6 Y glibc aix hpux solaris
+# ISO-8859-7 Y glibc aix hpux irix osf solaris
+# ISO-8859-8 Y glibc aix hpux osf solaris
+# ISO-8859-9 Y glibc aix hpux irix osf solaris
+# ISO-8859-13 glibc
+# ISO-8859-14 glibc
+# ISO-8859-15 glibc aix osf solaris freebsd
+# KOI8-R Y glibc solaris freebsd darwin
+# KOI8-U Y glibc freebsd darwin
+# KOI8-T glibc
+# CP437 dos
+# CP775 dos
+# CP850 aix osf dos
+# CP852 dos
+# CP855 dos
+# CP856 aix
+# CP857 dos
+# CP861 dos
+# CP862 dos
+# CP864 dos
+# CP865 dos
+# CP866 freebsd darwin dos
+# CP869 dos
+# CP874 woe32 dos
+# CP922 aix
+# CP932 aix woe32 dos
+# CP943 aix
+# CP949 osf woe32 dos
+# CP950 woe32 dos
+# CP1046 aix
+# CP1124 aix
+# CP1125 dos
+# CP1129 aix
+# CP1250 woe32
+# CP1251 glibc solaris darwin woe32
+# CP1252 aix woe32
+# CP1253 woe32
+# CP1254 woe32
+# CP1255 glibc woe32
+# CP1256 woe32
+# CP1257 woe32
+# GB2312 Y glibc aix hpux irix solaris freebsd darwin
+# EUC-JP Y glibc aix hpux irix osf solaris freebsd darwin
+# EUC-KR Y glibc aix hpux irix osf solaris freebsd darwin
+# EUC-TW glibc aix hpux irix osf solaris
+# BIG5 Y glibc aix hpux osf solaris freebsd darwin
+# BIG5-HKSCS glibc solaris
+# GBK glibc aix osf solaris woe32 dos
+# GB18030 glibc solaris
+# SHIFT_JIS Y hpux osf solaris freebsd darwin
+# JOHAB glibc solaris woe32
+# TIS-620 glibc aix hpux osf solaris
+# VISCII Y glibc
+# TCVN5712-1 glibc
+# GEORGIAN-PS glibc
+# HP-ROMAN8 hpux
+# HP-ARABIC8 hpux
+# HP-GREEK8 hpux
+# HP-HEBREW8 hpux
+# HP-TURKISH8 hpux
+# HP-KANA8 hpux
+# DEC-KANJI osf
+# DEC-HANYU osf
+# UTF-8 Y glibc aix hpux osf solaris
+#
+# Note: Names which are not marked as being a MIME name should not be used in
+# Internet protocols for information interchange (mail, news, etc.).
+#
+# Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
+# must understand both names and treat them as equivalent.
+#
+# The first argument passed to this file is the canonical host specification,
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+
+host="$1"
+os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'`
+echo "# This file contains a table of character encoding aliases,"
+echo "# suitable for operating system '${os}'."
+echo "# It was automatically generated from config.charset."
+# List of references, updated during installation:
+echo "# Packages using this file: "
+case "$os" in
+ linux-gnulibc1*)
+ # Linux libc5 doesn't have nl_langinfo(CODESET); therefore
+ # localcharset.c falls back to using the full locale name
+ # from the environment variables.
+ echo "C ASCII"
+ echo "POSIX ASCII"
+ for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \
+ en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \
+ en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \
+ es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \
+ et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \
+ fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \
+ it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \
+ sv_FI sv_SE; do
+ echo "$l ISO-8859-1"
+ echo "$l.iso-8859-1 ISO-8859-1"
+ echo "$l.iso-8859-15 ISO-8859-15"
+ echo "$l.iso-8859-15@euro ISO-8859-15"
+ echo "$l@euro ISO-8859-15"
+ echo "$l.cp-437 CP437"
+ echo "$l.cp-850 CP850"
+ echo "$l.cp-1252 CP1252"
+ echo "$l.cp-1252@euro CP1252"
+ #echo "$l.atari-st ATARI-ST" # not a commonly used encoding
+ echo "$l.utf-8 UTF-8"
+ echo "$l.utf-8@euro UTF-8"
+ done
+ for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \
+ sl_SI sr sr_CS sr_YU; do
+ echo "$l ISO-8859-2"
+ echo "$l.iso-8859-2 ISO-8859-2"
+ echo "$l.cp-852 CP852"
+ echo "$l.cp-1250 CP1250"
+ echo "$l.utf-8 UTF-8"
+ done
+ for l in mk mk_MK ru ru_RU; do
+ echo "$l ISO-8859-5"
+ echo "$l.iso-8859-5 ISO-8859-5"
+ echo "$l.koi8-r KOI8-R"
+ echo "$l.cp-866 CP866"
+ echo "$l.cp-1251 CP1251"
+ echo "$l.utf-8 UTF-8"
+ done
+ for l in ar ar_SA; do
+ echo "$l ISO-8859-6"
+ echo "$l.iso-8859-6 ISO-8859-6"
+ echo "$l.cp-864 CP864"
+ #echo "$l.cp-868 CP868" # not a commonly used encoding
+ echo "$l.cp-1256 CP1256"
+ echo "$l.utf-8 UTF-8"
+ done
+ for l in el el_GR gr gr_GR; do
+ echo "$l ISO-8859-7"
+ echo "$l.iso-8859-7 ISO-8859-7"
+ echo "$l.cp-869 CP869"
+ echo "$l.cp-1253 CP1253"
+ echo "$l.cp-1253@euro CP1253"
+ echo "$l.utf-8 UTF-8"
+ echo "$l.utf-8@euro UTF-8"
+ done
+ for l in he he_IL iw iw_IL; do
+ echo "$l ISO-8859-8"
+ echo "$l.iso-8859-8 ISO-8859-8"
+ echo "$l.cp-862 CP862"
+ echo "$l.cp-1255 CP1255"
+ echo "$l.utf-8 UTF-8"
+ done
+ for l in tr tr_TR; do
+ echo "$l ISO-8859-9"
+ echo "$l.iso-8859-9 ISO-8859-9"
+ echo "$l.cp-857 CP857"
+ echo "$l.cp-1254 CP1254"
+ echo "$l.utf-8 UTF-8"
+ done
+ for l in lt lt_LT lv lv_LV; do
+ #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name
+ echo "$l ISO-8859-13"
+ done
+ for l in ru_UA uk uk_UA; do
+ echo "$l KOI8-U"
+ done
+ for l in zh zh_CN; do
+ #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name
+ echo "$l GB2312"
+ done
+ for l in ja ja_JP ja_JP.EUC; do
+ echo "$l EUC-JP"
+ done
+ for l in ko ko_KR; do
+ echo "$l EUC-KR"
+ done
+ for l in th th_TH; do
+ echo "$l TIS-620"
+ done
+ for l in fa fa_IR; do
+ #echo "$l ISIRI-3342" # a broken encoding
+ echo "$l.utf-8 UTF-8"
+ done
+ ;;
+ linux* | *-gnu*)
+ # With glibc-2.1 or newer, we don't need any canonicalization,
+ # because glibc has iconv and both glibc and libiconv support all
+ # GNU canonical names directly. Therefore, the Makefile does not
+ # need to install the alias file at all.
+ # The following applies only to glibc-2.0.x and older libcs.
+ echo "ISO_646.IRV:1983 ASCII"
+ ;;
+ aix*)
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-6 ISO-8859-6"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-8 ISO-8859-8"
+ echo "ISO8859-9 ISO-8859-9"
+ echo "ISO8859-15 ISO-8859-15"
+ echo "IBM-850 CP850"
+ echo "IBM-856 CP856"
+ echo "IBM-921 ISO-8859-13"
+ echo "IBM-922 CP922"
+ echo "IBM-932 CP932"
+ echo "IBM-943 CP943"
+ echo "IBM-1046 CP1046"
+ echo "IBM-1124 CP1124"
+ echo "IBM-1129 CP1129"
+ echo "IBM-1252 CP1252"
+ echo "IBM-eucCN GB2312"
+ echo "IBM-eucJP EUC-JP"
+ echo "IBM-eucKR EUC-KR"
+ echo "IBM-eucTW EUC-TW"
+ echo "big5 BIG5"
+ echo "GBK GBK"
+ echo "TIS-620 TIS-620"
+ echo "UTF-8 UTF-8"
+ ;;
+ hpux*)
+ echo "iso88591 ISO-8859-1"
+ echo "iso88592 ISO-8859-2"
+ echo "iso88595 ISO-8859-5"
+ echo "iso88596 ISO-8859-6"
+ echo "iso88597 ISO-8859-7"
+ echo "iso88598 ISO-8859-8"
+ echo "iso88599 ISO-8859-9"
+ echo "iso885915 ISO-8859-15"
+ echo "roman8 HP-ROMAN8"
+ echo "arabic8 HP-ARABIC8"
+ echo "greek8 HP-GREEK8"
+ echo "hebrew8 HP-HEBREW8"
+ echo "turkish8 HP-TURKISH8"
+ echo "kana8 HP-KANA8"
+ echo "tis620 TIS-620"
+ echo "big5 BIG5"
+ echo "eucJP EUC-JP"
+ echo "eucKR EUC-KR"
+ echo "eucTW EUC-TW"
+ echo "hp15CN GB2312"
+ #echo "ccdc ?" # what is this?
+ echo "SJIS SHIFT_JIS"
+ echo "utf8 UTF-8"
+ ;;
+ irix*)
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-9 ISO-8859-9"
+ echo "eucCN GB2312"
+ echo "eucJP EUC-JP"
+ echo "eucKR EUC-KR"
+ echo "eucTW EUC-TW"
+ ;;
+ osf*)
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-4 ISO-8859-4"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-8 ISO-8859-8"
+ echo "ISO8859-9 ISO-8859-9"
+ echo "ISO8859-15 ISO-8859-15"
+ echo "cp850 CP850"
+ echo "big5 BIG5"
+ echo "dechanyu DEC-HANYU"
+ echo "dechanzi GB2312"
+ echo "deckanji DEC-KANJI"
+ echo "deckorean EUC-KR"
+ echo "eucJP EUC-JP"
+ echo "eucKR EUC-KR"
+ echo "eucTW EUC-TW"
+ echo "GBK GBK"
+ echo "KSC5601 CP949"
+ echo "sdeckanji EUC-JP"
+ echo "SJIS SHIFT_JIS"
+ echo "TACTIS TIS-620"
+ echo "UTF-8 UTF-8"
+ ;;
+ solaris*)
+ echo "646 ASCII"
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-3 ISO-8859-3"
+ echo "ISO8859-4 ISO-8859-4"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-6 ISO-8859-6"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-8 ISO-8859-8"
+ echo "ISO8859-9 ISO-8859-9"
+ echo "ISO8859-15 ISO-8859-15"
+ echo "koi8-r KOI8-R"
+ echo "ansi-1251 CP1251"
+ echo "BIG5 BIG5"
+ echo "Big5-HKSCS BIG5-HKSCS"
+ echo "gb2312 GB2312"
+ echo "GBK GBK"
+ echo "GB18030 GB18030"
+ echo "cns11643 EUC-TW"
+ echo "5601 EUC-KR"
+ echo "ko_KR.johap92 JOHAB"
+ echo "eucJP EUC-JP"
+ echo "PCK SHIFT_JIS"
+ echo "TIS620.2533 TIS-620"
+ #echo "sun_eu_greek ?" # what is this?
+ echo "UTF-8 UTF-8"
+ ;;
+ freebsd* | os2*)
+ # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
+ # localcharset.c falls back to using the full locale name
+ # from the environment variables.
+ # Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just
+ # reuse FreeBSD's locale data for OS/2.
+ echo "C ASCII"
+ echo "US-ASCII ASCII"
+ for l in la_LN lt_LN; do
+ echo "$l.ASCII ASCII"
+ done
+ for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
+ fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
+ lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do
+ echo "$l.ISO_8859-1 ISO-8859-1"
+ echo "$l.DIS_8859-15 ISO-8859-15"
+ done
+ for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do
+ echo "$l.ISO_8859-2 ISO-8859-2"
+ done
+ for l in la_LN lt_LT; do
+ echo "$l.ISO_8859-4 ISO-8859-4"
+ done
+ for l in ru_RU ru_SU; do
+ echo "$l.KOI8-R KOI8-R"
+ echo "$l.ISO_8859-5 ISO-8859-5"
+ echo "$l.CP866 CP866"
+ done
+ echo "uk_UA.KOI8-U KOI8-U"
+ echo "zh_TW.BIG5 BIG5"
+ echo "zh_TW.Big5 BIG5"
+ echo "zh_CN.EUC GB2312"
+ echo "ja_JP.EUC EUC-JP"
+ echo "ja_JP.SJIS SHIFT_JIS"
+ echo "ja_JP.Shift_JIS SHIFT_JIS"
+ echo "ko_KR.EUC EUC-KR"
+ ;;
+ netbsd*)
+ echo "646 ASCII"
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-4 ISO-8859-4"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-15 ISO-8859-15"
+ echo "eucCN GB2312"
+ echo "eucJP EUC-JP"
+ echo "eucKR EUC-KR"
+ echo "eucTW EUC-TW"
+ echo "BIG5 BIG5"
+ echo "SJIS SHIFT_JIS"
+ ;;
+ darwin*)
+ # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore
+ # localcharset.c falls back to using the full locale name
+ # from the environment variables.
+ echo "C ASCII"
+ for l in en_AU en_CA en_GB en_US la_LN; do
+ echo "$l.US-ASCII ASCII"
+ done
+ for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
+ fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \
+ nl_NL no_NO pt_PT sv_SE; do
+ echo "$l ISO-8859-1"
+ echo "$l.ISO8859-1 ISO-8859-1"
+ echo "$l.ISO8859-15 ISO-8859-15"
+ done
+ for l in la_LN; do
+ echo "$l.ISO8859-1 ISO-8859-1"
+ echo "$l.ISO8859-15 ISO-8859-15"
+ done
+ for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do
+ echo "$l.ISO8859-2 ISO-8859-2"
+ done
+ for l in la_LN lt_LT; do
+ echo "$l.ISO8859-4 ISO-8859-4"
+ done
+ for l in ru_RU; do
+ echo "$l.KOI8-R KOI8-R"
+ echo "$l.ISO8859-5 ISO-8859-5"
+ echo "$l.CP866 CP866"
+ done
+ for l in bg_BG; do
+ echo "$l.CP1251 CP1251"
+ done
+ echo "uk_UA.KOI8-U KOI8-U"
+ echo "zh_TW.BIG5 BIG5"
+ echo "zh_TW.Big5 BIG5"
+ echo "zh_CN.EUC GB2312"
+ echo "ja_JP.EUC EUC-JP"
+ echo "ja_JP.SJIS SHIFT_JIS"
+ echo "ko_KR.EUC EUC-KR"
+ ;;
+ beos*)
+ # BeOS has a single locale, and it has UTF-8 encoding.
+ echo "* UTF-8"
+ ;;
+ msdosdjgpp*)
+ # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
+ # localcharset.c falls back to using the full locale name
+ # from the environment variables.
+ echo "#"
+ echo "# The encodings given here may not all be correct."
+ echo "# If you find that the encoding given for your language and"
+ echo "# country is not the one your DOS machine actually uses, just"
+ echo "# correct it in this file, and send a mail to"
+ echo "# Juan Manuel Guerrero <st001906@hrz1.hrz.tu-darmstadt.de>"
+ echo "# and Bruno Haible <bruno@clisp.org>."
+ echo "#"
+ echo "C ASCII"
+ # ISO-8859-1 languages
+ echo "ca CP850"
+ echo "ca_ES CP850"
+ echo "da CP865" # not CP850 ??
+ echo "da_DK CP865" # not CP850 ??
+ echo "de CP850"
+ echo "de_AT CP850"
+ echo "de_CH CP850"
+ echo "de_DE CP850"
+ echo "en CP850"
+ echo "en_AU CP850" # not CP437 ??
+ echo "en_CA CP850"
+ echo "en_GB CP850"
+ echo "en_NZ CP437"
+ echo "en_US CP437"
+ echo "en_ZA CP850" # not CP437 ??
+ echo "es CP850"
+ echo "es_AR CP850"
+ echo "es_BO CP850"
+ echo "es_CL CP850"
+ echo "es_CO CP850"
+ echo "es_CR CP850"
+ echo "es_CU CP850"
+ echo "es_DO CP850"
+ echo "es_EC CP850"
+ echo "es_ES CP850"
+ echo "es_GT CP850"
+ echo "es_HN CP850"
+ echo "es_MX CP850"
+ echo "es_NI CP850"
+ echo "es_PA CP850"
+ echo "es_PY CP850"
+ echo "es_PE CP850"
+ echo "es_SV CP850"
+ echo "es_UY CP850"
+ echo "es_VE CP850"
+ echo "et CP850"
+ echo "et_EE CP850"
+ echo "eu CP850"
+ echo "eu_ES CP850"
+ echo "fi CP850"
+ echo "fi_FI CP850"
+ echo "fr CP850"
+ echo "fr_BE CP850"
+ echo "fr_CA CP850"
+ echo "fr_CH CP850"
+ echo "fr_FR CP850"
+ echo "ga CP850"
+ echo "ga_IE CP850"
+ echo "gd CP850"
+ echo "gd_GB CP850"
+ echo "gl CP850"
+ echo "gl_ES CP850"
+ echo "id CP850" # not CP437 ??
+ echo "id_ID CP850" # not CP437 ??
+ echo "is CP861" # not CP850 ??
+ echo "is_IS CP861" # not CP850 ??
+ echo "it CP850"
+ echo "it_CH CP850"
+ echo "it_IT CP850"
+ echo "lt CP775"
+ echo "lt_LT CP775"
+ echo "lv CP775"
+ echo "lv_LV CP775"
+ echo "nb CP865" # not CP850 ??
+ echo "nb_NO CP865" # not CP850 ??
+ echo "nl CP850"
+ echo "nl_BE CP850"
+ echo "nl_NL CP850"
+ echo "nn CP865" # not CP850 ??
+ echo "nn_NO CP865" # not CP850 ??
+ echo "no CP865" # not CP850 ??
+ echo "no_NO CP865" # not CP850 ??
+ echo "pt CP850"
+ echo "pt_BR CP850"
+ echo "pt_PT CP850"
+ echo "sv CP850"
+ echo "sv_SE CP850"
+ # ISO-8859-2 languages
+ echo "cs CP852"
+ echo "cs_CZ CP852"
+ echo "hr CP852"
+ echo "hr_HR CP852"
+ echo "hu CP852"
+ echo "hu_HU CP852"
+ echo "pl CP852"
+ echo "pl_PL CP852"
+ echo "ro CP852"
+ echo "ro_RO CP852"
+ echo "sk CP852"
+ echo "sk_SK CP852"
+ echo "sl CP852"
+ echo "sl_SI CP852"
+ echo "sq CP852"
+ echo "sq_AL CP852"
+ echo "sr CP852" # CP852 or CP866 or CP855 ??
+ echo "sr_CS CP852" # CP852 or CP866 or CP855 ??
+ echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
+ # ISO-8859-3 languages
+ echo "mt CP850"
+ echo "mt_MT CP850"
+ # ISO-8859-5 languages
+ echo "be CP866"
+ echo "be_BE CP866"
+ echo "bg CP866" # not CP855 ??
+ echo "bg_BG CP866" # not CP855 ??
+ echo "mk CP866" # not CP855 ??
+ echo "mk_MK CP866" # not CP855 ??
+ echo "ru CP866"
+ echo "ru_RU CP866"
+ echo "uk CP1125"
+ echo "uk_UA CP1125"
+ # ISO-8859-6 languages
+ echo "ar CP864"
+ echo "ar_AE CP864"
+ echo "ar_DZ CP864"
+ echo "ar_EG CP864"
+ echo "ar_IQ CP864"
+ echo "ar_IR CP864"
+ echo "ar_JO CP864"
+ echo "ar_KW CP864"
+ echo "ar_MA CP864"
+ echo "ar_OM CP864"
+ echo "ar_QA CP864"
+ echo "ar_SA CP864"
+ echo "ar_SY CP864"
+ # ISO-8859-7 languages
+ echo "el CP869"
+ echo "el_GR CP869"
+ # ISO-8859-8 languages
+ echo "he CP862"
+ echo "he_IL CP862"
+ # ISO-8859-9 languages
+ echo "tr CP857"
+ echo "tr_TR CP857"
+ # Japanese
+ echo "ja CP932"
+ echo "ja_JP CP932"
+ # Chinese
+ echo "zh_CN GBK"
+ echo "zh_TW CP950" # not CP938 ??
+ # Korean
+ echo "kr CP949" # not CP934 ??
+ echo "kr_KR CP949" # not CP934 ??
+ # Thai
+ echo "th CP874"
+ echo "th_TH CP874"
+ # Other
+ echo "eo CP850"
+ echo "eo_EO CP850"
+ ;;
+esac
--- /dev/null
+/* Implementation of the dcgettext(3) function.
+ Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define DCGETTEXT __dcgettext
+# define DCIGETTEXT __dcigettext
+#else
+# define DCGETTEXT libintl_dcgettext
+# define DCIGETTEXT libintl_dcigettext
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+ locale. */
+char *
+DCGETTEXT (const char *domainname, const char *msgid, int category)
+{
+ return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+INTDEF(__dcgettext)
+weak_alias (__dcgettext, dcgettext);
+#endif
--- /dev/null
+/* Implementation of the internal dcigettext function.
+ Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+/* Tell glibc's <string.h> to provide a prototype for mempcpy().
+ This must come before <config.h> because <config.h> may include
+ <features.h>, and once <features.h> has been included, it's too late. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <sys/types.h>
+
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+# define HAVE_ALLOCA 1
+#else
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# if defined HAVE_ALLOCA_H || defined _LIBC
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca
+char *alloca ();
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#include <errno.h>
+#ifndef errno
+extern int errno;
+#endif
+#ifndef __set_errno
+# define __set_errno(val) errno = (val)
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined HAVE_UNISTD_H || defined _LIBC
+# include <unistd.h>
+#endif
+
+#include <locale.h>
+
+#ifdef _LIBC
+ /* Guess whether integer division by zero raises signal SIGFPE.
+ Set to 1 only if you know for sure. In case of doubt, set to 0. */
+# if defined __alpha__ || defined __arm__ || defined __i386__ \
+ || defined __m68k__ || defined __s390__
+# define INTDIV0_RAISES_SIGFPE 1
+# else
+# define INTDIV0_RAISES_SIGFPE 0
+# endif
+#endif
+#if !INTDIV0_RAISES_SIGFPE
+# include <signal.h>
+#endif
+
+#if defined HAVE_SYS_PARAM_H || defined _LIBC
+# include <sys/param.h>
+#endif
+
+#include "gettextP.h"
+#include "plural-exp.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+#include "hash-string.h"
+
+/* Thread safetyness. */
+#ifdef _LIBC
+# include <bits/libc-lock.h>
+#else
+/* Provide dummy implementation if this is outside glibc. */
+# define __libc_lock_define_initialized(CLASS, NAME)
+# define __libc_lock_lock(NAME)
+# define __libc_lock_unlock(NAME)
+# define __libc_rwlock_define_initialized(CLASS, NAME)
+# define __libc_rwlock_rdlock(NAME)
+# define __libc_rwlock_unlock(NAME)
+#endif
+
+/* Alignment of types. */
+#if defined __GNUC__ && __GNUC__ >= 2
+# define alignof(TYPE) __alignof__ (TYPE)
+#else
+# define alignof(TYPE) \
+ ((int) &((struct { char dummy1; TYPE dummy2; } *) 0)->dummy2)
+#endif
+
+/* The internal variables in the standalone libintl.a must have different
+ names than the internal variables in GNU libc, otherwise programs
+ using libintl.a cannot be linked statically. */
+#if !defined _LIBC
+# define _nl_default_default_domain libintl_nl_default_default_domain
+# define _nl_current_default_domain libintl_nl_current_default_domain
+# define _nl_default_dirname libintl_nl_default_dirname
+# define _nl_domain_bindings libintl_nl_domain_bindings
+#endif
+
+/* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>. */
+#ifndef offsetof
+# define offsetof(type,ident) ((size_t)&(((type*)0)->ident))
+#endif
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ANSI C functions. This is required by the standard
+ because some ANSI C functions will require linking with this object
+ file and the name space must not be polluted. */
+# define getcwd __getcwd
+# ifndef stpcpy
+# define stpcpy __stpcpy
+# endif
+# define tfind __tfind
+#else
+# if !defined HAVE_GETCWD
+char *getwd ();
+# define getcwd(buf, max) getwd (buf)
+# else
+# if VMS
+# define getcwd(buf, max) (getcwd) (buf, max, 0)
+# else
+char *getcwd ();
+# endif
+# endif
+# ifndef HAVE_STPCPY
+static char *stpcpy (char *dest, const char *src);
+# endif
+# ifndef HAVE_MEMPCPY
+static void *mempcpy (void *dest, const void *src, size_t n);
+# endif
+#endif
+
+/* Amount to increase buffer size by in each try. */
+#define PATH_INCR 32
+
+/* The following is from pathmax.h. */
+/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define
+ PATH_MAX but might cause redefinition warnings when sys/param.h is
+ later included (as on MORE/BSD 4.3). */
+#if defined _POSIX_VERSION || (defined HAVE_LIMITS_H && !defined __GNUC__)
+# include <limits.h>
+#endif
+
+#ifndef _POSIX_PATH_MAX
+# define _POSIX_PATH_MAX 255
+#endif
+
+#if !defined PATH_MAX && defined _PC_PATH_MAX
+# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX))
+#endif
+
+/* Don't include sys/param.h if it already has been. */
+#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
+# include <sys/param.h>
+#endif
+
+#if !defined PATH_MAX && defined MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+#endif
+
+#ifndef PATH_MAX
+# define PATH_MAX _POSIX_PATH_MAX
+#endif
+
+/* Pathname support.
+ ISSLASH(C) tests whether C is a directory separator character.
+ IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not,
+ it may be concatenated to a directory pathname.
+ IS_PATH_WITH_DIR(P) tests whether P contains a directory specification.
+ */
+#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
+ /* Win32, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+# define HAS_DEVICE(P) \
+ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
+ && (P)[1] == ':')
+# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
+# define IS_PATH_WITH_DIR(P) \
+ (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
+#else
+ /* Unix */
+# define ISSLASH(C) ((C) == '/')
+# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
+# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
+#endif
+
+/* This is the type used for the search tree where known translations
+ are stored. */
+struct known_translation_t
+{
+ /* Domain in which to search. */
+ char *domainname;
+
+ /* The category. */
+ int category;
+
+ /* State of the catalog counter at the point the string was found. */
+ int counter;
+
+ /* Catalog where the string was found. */
+ struct loaded_l10nfile *domain;
+
+ /* And finally the translation. */
+ const char *translation;
+ size_t translation_length;
+
+ /* Pointer to the string in question. */
+ char msgid[ZERO];
+};
+
+/* Root of the search tree with known translations. We can use this
+ only if the system provides the `tsearch' function family. */
+#if defined HAVE_TSEARCH || defined _LIBC
+# include <search.h>
+
+static void *root;
+
+# ifdef _LIBC
+# define tsearch __tsearch
+# endif
+
+/* Function to compare two entries in the table of known translations. */
+static int
+transcmp (const void *p1, const void *p2)
+{
+ const struct known_translation_t *s1;
+ const struct known_translation_t *s2;
+ int result;
+
+ s1 = (const struct known_translation_t *) p1;
+ s2 = (const struct known_translation_t *) p2;
+
+ result = strcmp (s1->msgid, s2->msgid);
+ if (result == 0)
+ {
+ result = strcmp (s1->domainname, s2->domainname);
+ if (result == 0)
+ /* We compare the category last (though this is the cheapest
+ operation) since it is hopefully always the same (namely
+ LC_MESSAGES). */
+ result = s1->category - s2->category;
+ }
+
+ return result;
+}
+#endif
+
+#ifndef INTVARDEF
+# define INTVARDEF(name)
+#endif
+#ifndef INTUSE
+# define INTUSE(name) name
+#endif
+
+/* Name of the default domain used for gettext(3) prior any call to
+ textdomain(3). The default value for this is "messages". */
+const char _nl_default_default_domain[] attribute_hidden = "messages";
+
+/* Value used as the default domain for gettext(3). */
+const char *_nl_current_default_domain attribute_hidden
+ = _nl_default_default_domain;
+
+/* Contains the default location of the message catalogs. */
+#if defined __EMX__
+extern const char _nl_default_dirname[];
+#else
+const char _nl_default_dirname[] = LOCALEDIR;
+INTVARDEF (_nl_default_dirname)
+#endif
+
+/* List with bindings of specific domains created by bindtextdomain()
+ calls. */
+struct binding *_nl_domain_bindings;
+
+/* Prototypes for local functions. */
+static char *plural_lookup (struct loaded_l10nfile *domain,
+ unsigned long int n,
+ const char *translation, size_t translation_len)
+ internal_function;
+static const char *guess_category_value (int category,
+ const char *categoryname)
+ internal_function;
+#ifdef _LIBC
+# include "../locale/localeinfo.h"
+# define category_to_name(category) _nl_category_names[category]
+#else
+static const char *category_to_name (int category) internal_function;
+#endif
+
+
+/* For those loosing systems which don't have `alloca' we have to add
+ some additional code emulating it. */
+#ifdef HAVE_ALLOCA
+/* Nothing has to be done. */
+# define freea(p) /* nothing */
+# define ADD_BLOCK(list, address) /* nothing */
+# define FREE_BLOCKS(list) /* nothing */
+#else
+struct block_list
+{
+ void *address;
+ struct block_list *next;
+};
+# define ADD_BLOCK(list, addr) \
+ do { \
+ struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \
+ /* If we cannot get a free block we cannot add the new element to \
+ the list. */ \
+ if (newp != NULL) { \
+ newp->address = (addr); \
+ newp->next = (list); \
+ (list) = newp; \
+ } \
+ } while (0)
+# define FREE_BLOCKS(list) \
+ do { \
+ while (list != NULL) { \
+ struct block_list *old = list; \
+ list = list->next; \
+ free (old->address); \
+ free (old); \
+ } \
+ } while (0)
+# undef alloca
+# define alloca(size) (malloc (size))
+# define freea(p) free (p)
+#endif /* have alloca */
+
+
+#ifdef _LIBC
+/* List of blocks allocated for translations. */
+typedef struct transmem_list
+{
+ struct transmem_list *next;
+ char data[ZERO];
+} transmem_block_t;
+static struct transmem_list *transmem_list;
+#else
+typedef unsigned char transmem_block_t;
+#endif
+
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define DCIGETTEXT __dcigettext
+#else
+# define DCIGETTEXT libintl_dcigettext
+#endif
+
+/* Lock variable to protect the global data in the gettext implementation. */
+#ifdef _LIBC
+__libc_rwlock_define_initialized (, _nl_state_lock attribute_hidden)
+#endif
+
+/* Checking whether the binaries runs SUID must be done and glibc provides
+ easier methods therefore we make a difference here. */
+#ifdef _LIBC
+# define ENABLE_SECURE __libc_enable_secure
+# define DETERMINE_SECURE
+#else
+# ifndef HAVE_GETUID
+# define getuid() 0
+# endif
+# ifndef HAVE_GETGID
+# define getgid() 0
+# endif
+# ifndef HAVE_GETEUID
+# define geteuid() getuid()
+# endif
+# ifndef HAVE_GETEGID
+# define getegid() getgid()
+# endif
+static int enable_secure;
+# define ENABLE_SECURE (enable_secure == 1)
+# define DETERMINE_SECURE \
+ if (enable_secure == 0) \
+ { \
+ if (getuid () != geteuid () || getgid () != getegid ()) \
+ enable_secure = 1; \
+ else \
+ enable_secure = -1; \
+ }
+#endif
+
+/* Get the function to evaluate the plural expression. */
+#include "eval-plural.h"
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current
+ CATEGORY locale and, if PLURAL is nonzero, search over string
+ depending on the plural form determined by N. */
+char *
+DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
+ int plural, unsigned long int n, int category)
+{
+#ifndef HAVE_ALLOCA
+ struct block_list *block_list = NULL;
+#endif
+ struct loaded_l10nfile *domain;
+ struct binding *binding;
+ const char *categoryname;
+ const char *categoryvalue;
+ char *dirname, *xdomainname;
+ char *single_locale;
+ char *retval;
+ size_t retlen;
+ int saved_errno;
+#if defined HAVE_TSEARCH || defined _LIBC
+ struct known_translation_t *search;
+ struct known_translation_t **foundp = NULL;
+ size_t msgid_len;
+#endif
+ size_t domainname_len;
+
+ /* If no real MSGID is given return NULL. */
+ if (msgid1 == NULL)
+ return NULL;
+
+#ifdef _LIBC
+ if (category < 0 || category >= __LC_LAST || category == LC_ALL)
+ /* Bogus. */
+ return (plural == 0
+ ? (char *) msgid1
+ /* Use the Germanic plural rule. */
+ : n == 1 ? (char *) msgid1 : (char *) msgid2);
+#endif
+
+ __libc_rwlock_rdlock (_nl_state_lock);
+
+ /* If DOMAINNAME is NULL, we are interested in the default domain. If
+ CATEGORY is not LC_MESSAGES this might not make much sense but the
+ definition left this undefined. */
+ if (domainname == NULL)
+ domainname = _nl_current_default_domain;
+
+ /* OS/2 specific: backward compatibility with older libintl versions */
+#ifdef LC_MESSAGES_COMPAT
+ if (category == LC_MESSAGES_COMPAT)
+ category = LC_MESSAGES;
+#endif
+
+#if defined HAVE_TSEARCH || defined _LIBC
+ msgid_len = strlen (msgid1) + 1;
+
+ /* Try to find the translation among those which we found at
+ some time. */
+ search = (struct known_translation_t *)
+ alloca (offsetof (struct known_translation_t, msgid) + msgid_len);
+ memcpy (search->msgid, msgid1, msgid_len);
+ search->domainname = (char *) domainname;
+ search->category = category;
+
+ foundp = (struct known_translation_t **) tfind (search, &root, transcmp);
+ freea (search);
+ if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr)
+ {
+ /* Now deal with plural. */
+ if (plural)
+ retval = plural_lookup ((*foundp)->domain, n, (*foundp)->translation,
+ (*foundp)->translation_length);
+ else
+ retval = (char *) (*foundp)->translation;
+
+ __libc_rwlock_unlock (_nl_state_lock);
+ return retval;
+ }
+#endif
+
+ /* Preserve the `errno' value. */
+ saved_errno = errno;
+
+ /* See whether this is a SUID binary or not. */
+ DETERMINE_SECURE;
+
+ /* First find matching binding. */
+ for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
+ {
+ int compare = strcmp (domainname, binding->domainname);
+ if (compare == 0)
+ /* We found it! */
+ break;
+ if (compare < 0)
+ {
+ /* It is not in the list. */
+ binding = NULL;
+ break;
+ }
+ }
+
+ if (binding == NULL)
+ dirname = (char *) INTUSE(_nl_default_dirname);
+ else if (IS_ABSOLUTE_PATH (binding->dirname))
+ dirname = binding->dirname;
+ else
+ {
+ /* We have a relative path. Make it absolute now. */
+ size_t dirname_len = strlen (binding->dirname) + 1;
+ size_t path_max;
+ char *ret;
+
+ path_max = (unsigned int) PATH_MAX;
+ path_max += 2; /* The getcwd docs say to do this. */
+
+ for (;;)
+ {
+ dirname = (char *) alloca (path_max + dirname_len);
+ ADD_BLOCK (block_list, dirname);
+
+ __set_errno (0);
+ ret = getcwd (dirname, path_max);
+ if (ret != NULL || errno != ERANGE)
+ break;
+
+ path_max += path_max / 2;
+ path_max += PATH_INCR;
+ }
+
+ if (ret == NULL)
+ /* We cannot get the current working directory. Don't signal an
+ error but simply return the default string. */
+ goto return_untranslated;
+
+ stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname);
+ }
+
+ /* Now determine the symbolic name of CATEGORY and its value. */
+ categoryname = category_to_name (category);
+ categoryvalue = guess_category_value (category, categoryname);
+
+ domainname_len = strlen (domainname);
+ xdomainname = (char *) alloca (strlen (categoryname)
+ + domainname_len + 5);
+ ADD_BLOCK (block_list, xdomainname);
+
+ stpcpy (mempcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"),
+ domainname, domainname_len),
+ ".mo");
+
+ /* Creating working area. */
+ single_locale = (char *) alloca (strlen (categoryvalue) + 1);
+ ADD_BLOCK (block_list, single_locale);
+
+
+ /* Search for the given string. This is a loop because we perhaps
+ got an ordered list of languages to consider for the translation. */
+ while (1)
+ {
+ /* Make CATEGORYVALUE point to the next element of the list. */
+ while (categoryvalue[0] != '\0' && categoryvalue[0] == ':')
+ ++categoryvalue;
+ if (categoryvalue[0] == '\0')
+ {
+ /* The whole contents of CATEGORYVALUE has been searched but
+ no valid entry has been found. We solve this situation
+ by implicitly appending a "C" entry, i.e. no translation
+ will take place. */
+ single_locale[0] = 'C';
+ single_locale[1] = '\0';
+ }
+ else
+ {
+ char *cp = single_locale;
+ while (categoryvalue[0] != '\0' && categoryvalue[0] != ':')
+ *cp++ = *categoryvalue++;
+ *cp = '\0';
+
+ /* When this is a SUID binary we must not allow accessing files
+ outside the dedicated directories. */
+ if (ENABLE_SECURE && IS_PATH_WITH_DIR (single_locale))
+ /* Ingore this entry. */
+ continue;
+ }
+
+ /* If the current locale value is C (or POSIX) we don't load a
+ domain. Return the MSGID. */
+ if (strcmp (single_locale, "C") == 0
+ || strcmp (single_locale, "POSIX") == 0)
+ break;
+
+ /* Find structure describing the message catalog matching the
+ DOMAINNAME and CATEGORY. */
+ domain = _nl_find_domain (dirname, single_locale, xdomainname, binding);
+
+ if (domain != NULL)
+ {
+ retval = _nl_find_msg (domain, binding, msgid1, &retlen);
+
+ if (retval == NULL)
+ {
+ int cnt;
+
+ for (cnt = 0; domain->successor[cnt] != NULL; ++cnt)
+ {
+ retval = _nl_find_msg (domain->successor[cnt], binding,
+ msgid1, &retlen);
+
+ if (retval != NULL)
+ {
+ domain = domain->successor[cnt];
+ break;
+ }
+ }
+ }
+
+ if (retval != NULL)
+ {
+ /* Found the translation of MSGID1 in domain DOMAIN:
+ starting at RETVAL, RETLEN bytes. */
+ FREE_BLOCKS (block_list);
+#if defined HAVE_TSEARCH || defined _LIBC
+ if (foundp == NULL)
+ {
+ /* Create a new entry and add it to the search tree. */
+ struct known_translation_t *newp;
+
+ newp = (struct known_translation_t *)
+ malloc (offsetof (struct known_translation_t, msgid)
+ + msgid_len + domainname_len + 1);
+ if (newp != NULL)
+ {
+ newp->domainname =
+ mempcpy (newp->msgid, msgid1, msgid_len);
+ memcpy (newp->domainname, domainname, domainname_len + 1);
+ newp->category = category;
+ newp->counter = _nl_msg_cat_cntr;
+ newp->domain = domain;
+ newp->translation = retval;
+ newp->translation_length = retlen;
+
+ /* Insert the entry in the search tree. */
+ foundp = (struct known_translation_t **)
+ tsearch (newp, &root, transcmp);
+ if (foundp == NULL
+ || __builtin_expect (*foundp != newp, 0))
+ /* The insert failed. */
+ free (newp);
+ }
+ }
+ else
+ {
+ /* We can update the existing entry. */
+ (*foundp)->counter = _nl_msg_cat_cntr;
+ (*foundp)->domain = domain;
+ (*foundp)->translation = retval;
+ (*foundp)->translation_length = retlen;
+ }
+#endif
+ __set_errno (saved_errno);
+
+ /* Now deal with plural. */
+ if (plural)
+ retval = plural_lookup (domain, n, retval, retlen);
+
+ __libc_rwlock_unlock (_nl_state_lock);
+ return retval;
+ }
+ }
+ }
+
+ return_untranslated:
+ /* Return the untranslated MSGID. */
+ FREE_BLOCKS (block_list);
+ __libc_rwlock_unlock (_nl_state_lock);
+#ifndef _LIBC
+ if (!ENABLE_SECURE)
+ {
+ extern void _nl_log_untranslated (const char *logfilename,
+ const char *domainname,
+ const char *msgid1, const char *msgid2,
+ int plural);
+ const char *logfilename = getenv ("GETTEXT_LOG_UNTRANSLATED");
+
+ if (logfilename != NULL && logfilename[0] != '\0')
+ _nl_log_untranslated (logfilename, domainname, msgid1, msgid2, plural);
+ }
+#endif
+ __set_errno (saved_errno);
+ return (plural == 0
+ ? (char *) msgid1
+ /* Use the Germanic plural rule. */
+ : n == 1 ? (char *) msgid1 : (char *) msgid2);
+}
+
+
+char *
+internal_function
+_nl_find_msg (struct loaded_l10nfile *domain_file,
+ struct binding *domainbinding, const char *msgid,
+ size_t *lengthp)
+{
+ struct loaded_domain *domain;
+ nls_uint32 nstrings;
+ size_t act;
+ char *result;
+ size_t resultlen;
+
+ if (domain_file->decided == 0)
+ _nl_load_domain (domain_file, domainbinding);
+
+ if (domain_file->data == NULL)
+ return NULL;
+
+ domain = (struct loaded_domain *) domain_file->data;
+
+ nstrings = domain->nstrings;
+
+ /* Locate the MSGID and its translation. */
+ if (domain->hash_tab != NULL)
+ {
+ /* Use the hashing table. */
+ nls_uint32 len = strlen (msgid);
+ nls_uint32 hash_val = hash_string (msgid);
+ nls_uint32 idx = hash_val % domain->hash_size;
+ nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2));
+
+ while (1)
+ {
+ nls_uint32 nstr =
+ W (domain->must_swap_hash_tab, domain->hash_tab[idx]);
+
+ if (nstr == 0)
+ /* Hash table entry is empty. */
+ return NULL;
+
+ nstr--;
+
+ /* Compare msgid with the original string at index nstr.
+ We compare the lengths with >=, not ==, because plural entries
+ are represented by strings with an embedded NUL. */
+ if (nstr < nstrings
+ ? W (domain->must_swap, domain->orig_tab[nstr].length) >= len
+ && (strcmp (msgid,
+ domain->data + W (domain->must_swap,
+ domain->orig_tab[nstr].offset))
+ == 0)
+ : domain->orig_sysdep_tab[nstr - nstrings].length > len
+ && (strcmp (msgid,
+ domain->orig_sysdep_tab[nstr - nstrings].pointer)
+ == 0))
+ {
+ act = nstr;
+ goto found;
+ }
+
+ if (idx >= domain->hash_size - incr)
+ idx -= domain->hash_size - incr;
+ else
+ idx += incr;
+ }
+ /* NOTREACHED */
+ }
+ else
+ {
+ /* Try the default method: binary search in the sorted array of
+ messages. */
+ size_t top, bottom;
+
+ bottom = 0;
+ top = nstrings;
+ while (bottom < top)
+ {
+ int cmp_val;
+
+ act = (bottom + top) / 2;
+ cmp_val = strcmp (msgid, (domain->data
+ + W (domain->must_swap,
+ domain->orig_tab[act].offset)));
+ if (cmp_val < 0)
+ top = act;
+ else if (cmp_val > 0)
+ bottom = act + 1;
+ else
+ goto found;
+ }
+ /* No translation was found. */
+ return NULL;
+ }
+
+ found:
+ /* The translation was found at index ACT. If we have to convert the
+ string to use a different character set, this is the time. */
+ if (act < nstrings)
+ {
+ result = (char *)
+ (domain->data + W (domain->must_swap, domain->trans_tab[act].offset));
+ resultlen = W (domain->must_swap, domain->trans_tab[act].length) + 1;
+ }
+ else
+ {
+ result = (char *) domain->trans_sysdep_tab[act - nstrings].pointer;
+ resultlen = domain->trans_sysdep_tab[act - nstrings].length;
+ }
+
+#if defined _LIBC || HAVE_ICONV
+ if (domain->codeset_cntr
+ != (domainbinding != NULL ? domainbinding->codeset_cntr : 0))
+ {
+ /* The domain's codeset has changed through bind_textdomain_codeset()
+ since the message catalog was initialized or last accessed. We
+ have to reinitialize the converter. */
+ _nl_free_domain_conv (domain);
+ _nl_init_domain_conv (domain_file, domain, domainbinding);
+ }
+
+ if (
+# ifdef _LIBC
+ domain->conv != (__gconv_t) -1
+# else
+# if HAVE_ICONV
+ domain->conv != (iconv_t) -1
+# endif
+# endif
+ )
+ {
+ /* We are supposed to do a conversion. First allocate an
+ appropriate table with the same structure as the table
+ of translations in the file, where we can put the pointers
+ to the converted strings in.
+ There is a slight complication with plural entries. They
+ are represented by consecutive NUL terminated strings. We
+ handle this case by converting RESULTLEN bytes, including
+ NULs. */
+
+ if (domain->conv_tab == NULL
+ && ((domain->conv_tab =
+ (char **) calloc (nstrings + domain->n_sysdep_strings,
+ sizeof (char *)))
+ == NULL))
+ /* Mark that we didn't succeed allocating a table. */
+ domain->conv_tab = (char **) -1;
+
+ if (__builtin_expect (domain->conv_tab == (char **) -1, 0))
+ /* Nothing we can do, no more memory. */
+ goto converted;
+
+ if (domain->conv_tab[act] == NULL)
+ {
+ /* We haven't used this string so far, so it is not
+ translated yet. Do this now. */
+ /* We use a bit more efficient memory handling.
+ We allocate always larger blocks which get used over
+ time. This is faster than many small allocations. */
+ __libc_lock_define_initialized (static, lock)
+# define INITIAL_BLOCK_SIZE 4080
+ static unsigned char *freemem;
+ static size_t freemem_size;
+
+ const unsigned char *inbuf;
+ unsigned char *outbuf;
+ int malloc_count;
+# ifndef _LIBC
+ transmem_block_t *transmem_list = NULL;
+# endif
+
+ __libc_lock_lock (lock);
+
+ inbuf = (const unsigned char *) result;
+ outbuf = freemem + sizeof (size_t);
+
+ malloc_count = 0;
+ while (1)
+ {
+ transmem_block_t *newmem;
+# ifdef _LIBC
+ size_t non_reversible;
+ int res;
+
+ if (freemem_size < sizeof (size_t))
+ goto resize_freemem;
+
+ res = __gconv (domain->conv,
+ &inbuf, inbuf + resultlen,
+ &outbuf,
+ outbuf + freemem_size - sizeof (size_t),
+ &non_reversible);
+
+ if (res == __GCONV_OK || res == __GCONV_EMPTY_INPUT)
+ break;
+
+ if (res != __GCONV_FULL_OUTPUT)
+ {
+ __libc_lock_unlock (lock);
+ goto converted;
+ }
+
+ inbuf = result;
+# else
+# if HAVE_ICONV
+ const char *inptr = (const char *) inbuf;
+ size_t inleft = resultlen;
+ char *outptr = (char *) outbuf;
+ size_t outleft;
+
+ if (freemem_size < sizeof (size_t))
+ goto resize_freemem;
+
+ outleft = freemem_size - sizeof (size_t);
+ if (iconv (domain->conv,
+ (ICONV_CONST char **) &inptr, &inleft,
+ &outptr, &outleft)
+ != (size_t) (-1))
+ {
+ outbuf = (unsigned char *) outptr;
+ break;
+ }
+ if (errno != E2BIG)
+ {
+ __libc_lock_unlock (lock);
+ goto converted;
+ }
+# endif
+# endif
+
+ resize_freemem:
+ /* We must allocate a new buffer or resize the old one. */
+ if (malloc_count > 0)
+ {
+ ++malloc_count;
+ freemem_size = malloc_count * INITIAL_BLOCK_SIZE;
+ newmem = (transmem_block_t *) realloc (transmem_list,
+ freemem_size);
+# ifdef _LIBC
+ if (newmem != NULL)
+ transmem_list = transmem_list->next;
+ else
+ {
+ struct transmem_list *old = transmem_list;
+
+ transmem_list = transmem_list->next;
+ free (old);
+ }
+# endif
+ }
+ else
+ {
+ malloc_count = 1;
+ freemem_size = INITIAL_BLOCK_SIZE;
+ newmem = (transmem_block_t *) malloc (freemem_size);
+ }
+ if (__builtin_expect (newmem == NULL, 0))
+ {
+ freemem = NULL;
+ freemem_size = 0;
+ __libc_lock_unlock (lock);
+ goto converted;
+ }
+
+# ifdef _LIBC
+ /* Add the block to the list of blocks we have to free
+ at some point. */
+ newmem->next = transmem_list;
+ transmem_list = newmem;
+
+ freemem = newmem->data;
+ freemem_size -= offsetof (struct transmem_list, data);
+# else
+ transmem_list = newmem;
+ freemem = newmem;
+# endif
+
+ outbuf = freemem + sizeof (size_t);
+ }
+
+ /* We have now in our buffer a converted string. Put this
+ into the table of conversions. */
+ *(size_t *) freemem = outbuf - freemem - sizeof (size_t);
+ domain->conv_tab[act] = (char *) freemem;
+ /* Shrink freemem, but keep it aligned. */
+ freemem_size -= outbuf - freemem;
+ freemem = outbuf;
+ freemem += freemem_size & (alignof (size_t) - 1);
+ freemem_size = freemem_size & ~ (alignof (size_t) - 1);
+
+ __libc_lock_unlock (lock);
+ }
+
+ /* Now domain->conv_tab[act] contains the translation of all
+ the plural variants. */
+ result = domain->conv_tab[act] + sizeof (size_t);
+ resultlen = *(size_t *) domain->conv_tab[act];
+ }
+
+ converted:
+ /* The result string is converted. */
+
+#endif /* _LIBC || HAVE_ICONV */
+
+ *lengthp = resultlen;
+ return result;
+}
+
+
+/* Look up a plural variant. */
+static char *
+internal_function
+plural_lookup (struct loaded_l10nfile *domain, unsigned long int n,
+ const char *translation, size_t translation_len)
+{
+ struct loaded_domain *domaindata = (struct loaded_domain *) domain->data;
+ unsigned long int index;
+ const char *p;
+
+ index = plural_eval (domaindata->plural, n);
+ if (index >= domaindata->nplurals)
+ /* This should never happen. It means the plural expression and the
+ given maximum value do not match. */
+ index = 0;
+
+ /* Skip INDEX strings at TRANSLATION. */
+ p = translation;
+ while (index-- > 0)
+ {
+#ifdef _LIBC
+ p = __rawmemchr (p, '\0');
+#else
+ p = strchr (p, '\0');
+#endif
+ /* And skip over the NUL byte. */
+ p++;
+
+ if (p >= translation + translation_len)
+ /* This should never happen. It means the plural expression
+ evaluated to a value larger than the number of variants
+ available for MSGID1. */
+ return (char *) translation;
+ }
+ return (char *) p;
+}
+
+#ifndef _LIBC
+/* Return string representation of locale CATEGORY. */
+static const char *
+internal_function
+category_to_name (int category)
+{
+ const char *retval;
+
+ switch (category)
+ {
+#ifdef LC_COLLATE
+ case LC_COLLATE:
+ retval = "LC_COLLATE";
+ break;
+#endif
+#ifdef LC_CTYPE
+ case LC_CTYPE:
+ retval = "LC_CTYPE";
+ break;
+#endif
+#ifdef LC_MONETARY
+ case LC_MONETARY:
+ retval = "LC_MONETARY";
+ break;
+#endif
+#ifdef LC_NUMERIC
+ case LC_NUMERIC:
+ retval = "LC_NUMERIC";
+ break;
+#endif
+#ifdef LC_TIME
+ case LC_TIME:
+ retval = "LC_TIME";
+ break;
+#endif
+#ifdef LC_MESSAGES
+ case LC_MESSAGES:
+ retval = "LC_MESSAGES";
+ break;
+#endif
+#ifdef LC_RESPONSE
+ case LC_RESPONSE:
+ retval = "LC_RESPONSE";
+ break;
+#endif
+#ifdef LC_ALL
+ case LC_ALL:
+ /* This might not make sense but is perhaps better than any other
+ value. */
+ retval = "LC_ALL";
+ break;
+#endif
+ default:
+ /* If you have a better idea for a default value let me know. */
+ retval = "LC_XXX";
+ }
+
+ return retval;
+}
+#endif
+
+/* Guess value of current locale from value of the environment variables. */
+static const char *
+internal_function
+guess_category_value (int category, const char *categoryname)
+{
+ const char *language;
+ const char *retval;
+
+ /* The highest priority value is the `LANGUAGE' environment
+ variable. But we don't use the value if the currently selected
+ locale is the C locale. This is a GNU extension. */
+ language = getenv ("LANGUAGE");
+ if (language != NULL && language[0] == '\0')
+ language = NULL;
+
+ /* We have to proceed with the POSIX methods of looking to `LC_ALL',
+ `LC_xxx', and `LANG'. On some systems this can be done by the
+ `setlocale' function itself. */
+#ifdef _LIBC
+ retval = __current_locale_name (category);
+#else
+ retval = _nl_locale_name (category, categoryname);
+#endif
+
+ /* Ignore LANGUAGE if the locale is set to "C" because
+ 1. "C" locale usually uses the ASCII encoding, and most international
+ messages use non-ASCII characters. These characters get displayed
+ as question marks (if using glibc's iconv()) or as invalid 8-bit
+ characters (because other iconv()s refuse to convert most non-ASCII
+ characters to ASCII). In any case, the output is ugly.
+ 2. The precise output of some programs in the "C" locale is specified
+ by POSIX and should not depend on environment variables like
+ "LANGUAGE". We allow such programs to use gettext(). */
+ return language != NULL && strcmp (retval, "C") != 0 ? language : retval;
+}
+
+/* @@ begin of epilog @@ */
+
+/* We don't want libintl.a to depend on any other library. So we
+ avoid the non-standard function stpcpy. In GNU C Library this
+ function is available, though. Also allow the symbol HAVE_STPCPY
+ to be defined. */
+#if !_LIBC && !HAVE_STPCPY
+static char *
+stpcpy (char *dest, const char *src)
+{
+ while ((*dest++ = *src++) != '\0')
+ /* Do nothing. */ ;
+ return dest - 1;
+}
+#endif
+
+#if !_LIBC && !HAVE_MEMPCPY
+static void *
+mempcpy (void *dest, const void *src, size_t n)
+{
+ return (void *) ((char *) memcpy (dest, src, n) + n);
+}
+#endif
+
+
+#ifdef _LIBC
+/* If we want to free all resources we have to do some work at
+ program's end. */
+libc_freeres_fn (free_mem)
+{
+ void *old;
+
+ while (_nl_domain_bindings != NULL)
+ {
+ struct binding *oldp = _nl_domain_bindings;
+ _nl_domain_bindings = _nl_domain_bindings->next;
+ if (oldp->dirname != INTUSE(_nl_default_dirname))
+ /* Yes, this is a pointer comparison. */
+ free (oldp->dirname);
+ free (oldp->codeset);
+ free (oldp);
+ }
+
+ if (_nl_current_default_domain != _nl_default_default_domain)
+ /* Yes, again a pointer comparison. */
+ free ((char *) _nl_current_default_domain);
+
+ /* Remove the search tree with the known translations. */
+ __tdestroy (root, free);
+ root = NULL;
+
+ while (transmem_list != NULL)
+ {
+ old = transmem_list;
+ transmem_list = transmem_list->next;
+ free (old);
+ }
+}
+#endif
--- /dev/null
+/* Implementation of the dcngettext(3) function.
+ Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define DCNGETTEXT __dcngettext
+# define DCIGETTEXT __dcigettext
+#else
+# define DCNGETTEXT libintl_dcngettext
+# define DCIGETTEXT libintl_dcigettext
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+ locale. */
+char *
+DCNGETTEXT (const char *domainname,
+ const char *msgid1, const char *msgid2, unsigned long int n,
+ int category)
+{
+ return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__dcngettext, dcngettext);
+#endif
--- /dev/null
+/* Implementation of the dgettext(3) function.
+ Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "gettextP.h"
+
+#include <locale.h>
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define DGETTEXT __dgettext
+# define DCGETTEXT INTUSE(__dcgettext)
+#else
+# define DGETTEXT libintl_dgettext
+# define DCGETTEXT libintl_dcgettext
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog of the current
+ LC_MESSAGES locale. */
+char *
+DGETTEXT (const char *domainname, const char *msgid)
+{
+ return DCGETTEXT (domainname, msgid, LC_MESSAGES);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__dgettext, dgettext);
+#endif
--- /dev/null
+/* Implementation of the dngettext(3) function.
+ Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "gettextP.h"
+
+#include <locale.h>
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define DNGETTEXT __dngettext
+# define DCNGETTEXT __dcngettext
+#else
+# define DNGETTEXT libintl_dngettext
+# define DCNGETTEXT libintl_dcngettext
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog of the current
+ LC_MESSAGES locale and skip message according to the plural form. */
+char *
+DNGETTEXT (const char *domainname,
+ const char *msgid1, const char *msgid2, unsigned long int n)
+{
+ return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__dngettext, dngettext);
+#endif
--- /dev/null
+/* Plural expression evaluation.
+ Copyright (C) 2000-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef STATIC
+#define STATIC static
+#endif
+
+/* Evaluate the plural expression and return an index value. */
+STATIC
+unsigned long int
+internal_function
+plural_eval (struct expression *pexp, unsigned long int n)
+{
+ switch (pexp->nargs)
+ {
+ case 0:
+ switch (pexp->operation)
+ {
+ case var:
+ return n;
+ case num:
+ return pexp->val.num;
+ default:
+ break;
+ }
+ /* NOTREACHED */
+ break;
+ case 1:
+ {
+ /* pexp->operation must be lnot. */
+ unsigned long int arg = plural_eval (pexp->val.args[0], n);
+ return ! arg;
+ }
+ case 2:
+ {
+ unsigned long int leftarg = plural_eval (pexp->val.args[0], n);
+ if (pexp->operation == lor)
+ return leftarg || plural_eval (pexp->val.args[1], n);
+ else if (pexp->operation == land)
+ return leftarg && plural_eval (pexp->val.args[1], n);
+ else
+ {
+ unsigned long int rightarg = plural_eval (pexp->val.args[1], n);
+
+ switch (pexp->operation)
+ {
+ case mult:
+ return leftarg * rightarg;
+ case divide:
+#if !INTDIV0_RAISES_SIGFPE
+ if (rightarg == 0)
+ raise (SIGFPE);
+#endif
+ return leftarg / rightarg;
+ case module:
+#if !INTDIV0_RAISES_SIGFPE
+ if (rightarg == 0)
+ raise (SIGFPE);
+#endif
+ return leftarg % rightarg;
+ case plus:
+ return leftarg + rightarg;
+ case minus:
+ return leftarg - rightarg;
+ case less_than:
+ return leftarg < rightarg;
+ case greater_than:
+ return leftarg > rightarg;
+ case less_or_equal:
+ return leftarg <= rightarg;
+ case greater_or_equal:
+ return leftarg >= rightarg;
+ case equal:
+ return leftarg == rightarg;
+ case not_equal:
+ return leftarg != rightarg;
+ default:
+ break;
+ }
+ }
+ /* NOTREACHED */
+ break;
+ }
+ case 3:
+ {
+ /* pexp->operation must be qmop. */
+ unsigned long int boolarg = plural_eval (pexp->val.args[0], n);
+ return plural_eval (pexp->val.args[boolarg ? 1 : 2], n);
+ }
+ }
+ /* NOTREACHED */
+ return 0;
+}
--- /dev/null
+/* Copyright (C) 1995-1998, 2000-2001, 2003 Free Software Foundation, Inc.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
+#include "loadinfo.h"
+
+/* On some strange systems still no definition of NULL is found. Sigh! */
+#ifndef NULL
+# if defined __STDC__ && __STDC__
+# define NULL ((void *) 0)
+# else
+# define NULL 0
+# endif
+#endif
+
+/* @@ end of prolog @@ */
+
+char *
+_nl_find_language (const char *name)
+{
+ while (name[0] != '\0' && name[0] != '_' && name[0] != '@'
+ && name[0] != '+' && name[0] != ',')
+ ++name;
+
+ return (char *) name;
+}
+
+
+int
+_nl_explode_name (char *name,
+ const char **language, const char **modifier,
+ const char **territory, const char **codeset,
+ const char **normalized_codeset, const char **special,
+ const char **sponsor, const char **revision)
+{
+ enum { undecided, xpg, cen } syntax;
+ char *cp;
+ int mask;
+
+ *modifier = NULL;
+ *territory = NULL;
+ *codeset = NULL;
+ *normalized_codeset = NULL;
+ *special = NULL;
+ *sponsor = NULL;
+ *revision = NULL;
+
+ /* Now we determine the single parts of the locale name. First
+ look for the language. Termination symbols are `_' and `@' if
+ we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
+ mask = 0;
+ syntax = undecided;
+ *language = cp = name;
+ cp = _nl_find_language (*language);
+
+ if (*language == cp)
+ /* This does not make sense: language has to be specified. Use
+ this entry as it is without exploding. Perhaps it is an alias. */
+ cp = strchr (*language, '\0');
+ else if (cp[0] == '_')
+ {
+ /* Next is the territory. */
+ cp[0] = '\0';
+ *territory = ++cp;
+
+ while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@'
+ && cp[0] != '+' && cp[0] != ',' && cp[0] != '_')
+ ++cp;
+
+ mask |= TERRITORY;
+
+ if (cp[0] == '.')
+ {
+ /* Next is the codeset. */
+ syntax = xpg;
+ cp[0] = '\0';
+ *codeset = ++cp;
+
+ while (cp[0] != '\0' && cp[0] != '@')
+ ++cp;
+
+ mask |= XPG_CODESET;
+
+ if (*codeset != cp && (*codeset)[0] != '\0')
+ {
+ *normalized_codeset = _nl_normalize_codeset (*codeset,
+ cp - *codeset);
+ if (strcmp (*codeset, *normalized_codeset) == 0)
+ free ((char *) *normalized_codeset);
+ else
+ mask |= XPG_NORM_CODESET;
+ }
+ }
+ }
+
+ if (cp[0] == '@' || (syntax != xpg && cp[0] == '+'))
+ {
+ /* Next is the modifier. */
+ syntax = cp[0] == '@' ? xpg : cen;
+ cp[0] = '\0';
+ *modifier = ++cp;
+
+ while (syntax == cen && cp[0] != '\0' && cp[0] != '+'
+ && cp[0] != ',' && cp[0] != '_')
+ ++cp;
+
+ mask |= XPG_MODIFIER | CEN_AUDIENCE;
+ }
+
+ if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_'))
+ {
+ syntax = cen;
+
+ if (cp[0] == '+')
+ {
+ /* Next is special application (CEN syntax). */
+ cp[0] = '\0';
+ *special = ++cp;
+
+ while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_')
+ ++cp;
+
+ mask |= CEN_SPECIAL;
+ }
+
+ if (cp[0] == ',')
+ {
+ /* Next is sponsor (CEN syntax). */
+ cp[0] = '\0';
+ *sponsor = ++cp;
+
+ while (cp[0] != '\0' && cp[0] != '_')
+ ++cp;
+
+ mask |= CEN_SPONSOR;
+ }
+
+ if (cp[0] == '_')
+ {
+ /* Next is revision (CEN syntax). */
+ cp[0] = '\0';
+ *revision = ++cp;
+
+ mask |= CEN_REVISION;
+ }
+ }
+
+ /* For CEN syntax values it might be important to have the
+ separator character in the file name, not for XPG syntax. */
+ if (syntax == xpg)
+ {
+ if (*territory != NULL && (*territory)[0] == '\0')
+ mask &= ~TERRITORY;
+
+ if (*codeset != NULL && (*codeset)[0] == '\0')
+ mask &= ~XPG_CODESET;
+
+ if (*modifier != NULL && (*modifier)[0] == '\0')
+ mask &= ~XPG_MODIFIER;
+ }
+
+ return mask;
+}
--- /dev/null
+/* Handle list of needed message catalogs
+ Copyright (C) 1995-1999, 2000-2001, 2003 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@gnu.org>, 1995.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined HAVE_UNISTD_H || defined _LIBC
+# include <unistd.h>
+#endif
+
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+
+/* @@ end of prolog @@ */
+/* List of already loaded domains. */
+static struct loaded_l10nfile *_nl_loaded_domains;
+
+
+/* Return a data structure describing the message catalog described by
+ the DOMAINNAME and CATEGORY parameters with respect to the currently
+ established bindings. */
+struct loaded_l10nfile *
+internal_function
+_nl_find_domain (const char *dirname, char *locale,
+ const char *domainname, struct binding *domainbinding)
+{
+ struct loaded_l10nfile *retval;
+ const char *language;
+ const char *modifier;
+ const char *territory;
+ const char *codeset;
+ const char *normalized_codeset;
+ const char *special;
+ const char *sponsor;
+ const char *revision;
+ const char *alias_value;
+ int mask;
+
+ /* LOCALE can consist of up to four recognized parts for the XPG syntax:
+
+ language[_territory[.codeset]][@modifier]
+
+ and six parts for the CEN syntax:
+
+ language[_territory][+audience][+special][,[sponsor][_revision]]
+
+ Beside the first part all of them are allowed to be missing. If
+ the full specified locale is not found, the less specific one are
+ looked for. The various parts will be stripped off according to
+ the following order:
+ (1) revision
+ (2) sponsor
+ (3) special
+ (4) codeset
+ (5) normalized codeset
+ (6) territory
+ (7) audience/modifier
+ */
+
+ /* If we have already tested for this locale entry there has to
+ be one data set in the list of loaded domains. */
+ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
+ strlen (dirname) + 1, 0, locale, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, domainname, 0);
+ if (retval != NULL)
+ {
+ /* We know something about this locale. */
+ int cnt;
+
+ if (retval->decided == 0)
+ _nl_load_domain (retval, domainbinding);
+
+ if (retval->data != NULL)
+ return retval;
+
+ for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
+ {
+ if (retval->successor[cnt]->decided == 0)
+ _nl_load_domain (retval->successor[cnt], domainbinding);
+
+ if (retval->successor[cnt]->data != NULL)
+ break;
+ }
+ return cnt >= 0 ? retval : NULL;
+ /* NOTREACHED */
+ }
+
+ /* See whether the locale value is an alias. If yes its value
+ *overwrites* the alias name. No test for the original value is
+ done. */
+ alias_value = _nl_expand_alias (locale);
+ if (alias_value != NULL)
+ {
+#if defined _LIBC || defined HAVE_STRDUP
+ locale = strdup (alias_value);
+ if (locale == NULL)
+ return NULL;
+#else
+ size_t len = strlen (alias_value) + 1;
+ locale = (char *) malloc (len);
+ if (locale == NULL)
+ return NULL;
+
+ memcpy (locale, alias_value, len);
+#endif
+ }
+
+ /* Now we determine the single parts of the locale name. First
+ look for the language. Termination symbols are `_' and `@' if
+ we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
+ mask = _nl_explode_name (locale, &language, &modifier, &territory,
+ &codeset, &normalized_codeset, &special,
+ &sponsor, &revision);
+
+ /* Create all possible locale entries which might be interested in
+ generalization. */
+ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
+ strlen (dirname) + 1, mask, language, territory,
+ codeset, normalized_codeset, modifier, special,
+ sponsor, revision, domainname, 1);
+ if (retval == NULL)
+ /* This means we are out of core. */
+ return NULL;
+
+ if (retval->decided == 0)
+ _nl_load_domain (retval, domainbinding);
+ if (retval->data == NULL)
+ {
+ int cnt;
+ for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
+ {
+ if (retval->successor[cnt]->decided == 0)
+ _nl_load_domain (retval->successor[cnt], domainbinding);
+ if (retval->successor[cnt]->data != NULL)
+ break;
+ }
+ }
+
+ /* The room for an alias was dynamically allocated. Free it now. */
+ if (alias_value != NULL)
+ free (locale);
+
+ /* The space for normalized_codeset is dynamically allocated. Free it. */
+ if (mask & XPG_NORM_CODESET)
+ free ((void *) normalized_codeset);
+
+ return retval;
+}
+
+
+#ifdef _LIBC
+libc_freeres_fn (free_mem)
+{
+ struct loaded_l10nfile *runp = _nl_loaded_domains;
+
+ while (runp != NULL)
+ {
+ struct loaded_l10nfile *here = runp;
+ if (runp->data != NULL)
+ _nl_unload_domain ((struct loaded_domain *) runp->data);
+ runp = runp->next;
+ free ((char *) here->filename);
+ free (here);
+ }
+}
+#endif
--- /dev/null
+/* Implementation of gettext(3) function.
+ Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef _LIBC
+# define __need_NULL
+# include <stddef.h>
+#else
+# include <stdlib.h> /* Just for NULL. */
+#endif
+
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define GETTEXT __gettext
+# define DCGETTEXT INTUSE(__dcgettext)
+#else
+# define GETTEXT libintl_gettext
+# define DCGETTEXT libintl_dcgettext
+#endif
+
+/* Look up MSGID in the current default message catalog for the current
+ LC_MESSAGES locale. If not found, returns MSGID itself (the default
+ text). */
+char *
+GETTEXT (const char *msgid)
+{
+ return DCGETTEXT (NULL, msgid, LC_MESSAGES);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__gettext, gettext);
+#endif
--- /dev/null
+/* Header describing internals of libintl library.
+ Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _GETTEXTP_H
+#define _GETTEXTP_H
+
+#include <stddef.h> /* Get size_t. */
+
+#ifdef _LIBC
+# include "../iconv/gconv_int.h"
+#else
+# if HAVE_ICONV
+# include <iconv.h>
+# endif
+#endif
+
+#include "loadinfo.h"
+
+#include "gmo.h" /* Get nls_uint32. */
+
+/* @@ end of prolog @@ */
+
+#ifndef internal_function
+# define internal_function
+#endif
+
+#ifndef attribute_hidden
+# define attribute_hidden
+#endif
+
+/* Tell the compiler when a conditional or integer expression is
+ almost always true or almost always false. */
+#ifndef HAVE_BUILTIN_EXPECT
+# define __builtin_expect(expr, val) (expr)
+#endif
+
+#ifndef W
+# define W(flag, data) ((flag) ? SWAP (data) : (data))
+#endif
+
+
+#ifdef _LIBC
+# include <byteswap.h>
+# define SWAP(i) bswap_32 (i)
+#else
+static inline nls_uint32
+SWAP (i)
+ nls_uint32 i;
+{
+ return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
+}
+#endif
+
+
+/* In-memory representation of system dependent string. */
+struct sysdep_string_desc
+{
+ /* Length of addressed string, including the trailing NUL. */
+ size_t length;
+ /* Pointer to addressed string. */
+ const char *pointer;
+};
+
+/* The representation of an opened message catalog. */
+struct loaded_domain
+{
+ /* Pointer to memory containing the .mo file. */
+ const char *data;
+ /* 1 if the memory is mmap()ed, 0 if the memory is malloc()ed. */
+ int use_mmap;
+ /* Size of mmap()ed memory. */
+ size_t mmap_size;
+ /* 1 if the .mo file uses a different endianness than this machine. */
+ int must_swap;
+ /* Pointer to additional malloc()ed memory. */
+ void *malloced;
+
+ /* Number of static strings pairs. */
+ nls_uint32 nstrings;
+ /* Pointer to descriptors of original strings in the file. */
+ const struct string_desc *orig_tab;
+ /* Pointer to descriptors of translated strings in the file. */
+ const struct string_desc *trans_tab;
+
+ /* Number of system dependent strings pairs. */
+ nls_uint32 n_sysdep_strings;
+ /* Pointer to descriptors of original sysdep strings. */
+ const struct sysdep_string_desc *orig_sysdep_tab;
+ /* Pointer to descriptors of translated sysdep strings. */
+ const struct sysdep_string_desc *trans_sysdep_tab;
+
+ /* Size of hash table. */
+ nls_uint32 hash_size;
+ /* Pointer to hash table. */
+ const nls_uint32 *hash_tab;
+ /* 1 if the hash table uses a different endianness than this machine. */
+ int must_swap_hash_tab;
+
+ int codeset_cntr;
+#ifdef _LIBC
+ __gconv_t conv;
+#else
+# if HAVE_ICONV
+ iconv_t conv;
+# endif
+#endif
+ char **conv_tab;
+
+ struct expression *plural;
+ unsigned long int nplurals;
+};
+
+/* We want to allocate a string at the end of the struct. But ISO C
+ doesn't allow zero sized arrays. */
+#ifdef __GNUC__
+# define ZERO 0
+#else
+# define ZERO 1
+#endif
+
+/* A set of settings bound to a message domain. Used to store settings
+ from bindtextdomain() and bind_textdomain_codeset(). */
+struct binding
+{
+ struct binding *next;
+ char *dirname;
+ int codeset_cntr; /* Incremented each time codeset changes. */
+ char *codeset;
+ char domainname[ZERO];
+};
+
+/* A counter which is incremented each time some previous translations
+ become invalid.
+ This variable is part of the external ABI of the GNU libintl. */
+extern int _nl_msg_cat_cntr;
+
+#ifndef _LIBC
+const char *_nl_locale_name (int category, const char *categoryname);
+#endif
+
+struct loaded_l10nfile *_nl_find_domain (const char *__dirname, char *__locale,
+ const char *__domainname,
+ struct binding *__domainbinding)
+ internal_function;
+void _nl_load_domain (struct loaded_l10nfile *__domain,
+ struct binding *__domainbinding)
+ internal_function;
+void _nl_unload_domain (struct loaded_domain *__domain)
+ internal_function;
+const char *_nl_init_domain_conv (struct loaded_l10nfile *__domain_file,
+ struct loaded_domain *__domain,
+ struct binding *__domainbinding)
+ internal_function;
+void _nl_free_domain_conv (struct loaded_domain *__domain)
+ internal_function;
+
+char *_nl_find_msg (struct loaded_l10nfile *domain_file,
+ struct binding *domainbinding, const char *msgid,
+ size_t *lengthp)
+ internal_function;
+
+#ifdef _LIBC
+extern char *__gettext (const char *__msgid);
+extern char *__dgettext (const char *__domainname, const char *__msgid);
+extern char *__dcgettext (const char *__domainname, const char *__msgid,
+ int __category);
+extern char *__ngettext (const char *__msgid1, const char *__msgid2,
+ unsigned long int __n);
+extern char *__dngettext (const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int n);
+extern char *__dcngettext (const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n, int __category);
+extern char *__dcigettext (const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ int __plural, unsigned long int __n,
+ int __category);
+extern char *__textdomain (const char *__domainname);
+extern char *__bindtextdomain (const char *__domainname,
+ const char *__dirname);
+extern char *__bind_textdomain_codeset (const char *__domainname,
+ const char *__codeset);
+#else
+/* Declare the exported libintl_* functions, in a way that allows us to
+ call them under their real name. */
+# undef _INTL_REDIRECT_INLINE
+# undef _INTL_REDIRECT_MACROS
+# define _INTL_REDIRECT_MACROS
+# include "libgnuintl.h"
+extern char *libintl_dcigettext (const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ int __plural, unsigned long int __n,
+ int __category);
+#endif
+
+/* @@ begin of epilog @@ */
+
+#endif /* gettextP.h */
--- /dev/null
+/* Description of GNU message catalog format: general file layout.
+ Copyright (C) 1995, 1997, 2000-2002, 2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _GETTEXT_H
+#define _GETTEXT_H 1
+
+#include <limits.h>
+
+/* @@ end of prolog @@ */
+
+/* The magic number of the GNU message catalog format. */
+#define _MAGIC 0x950412de
+#define _MAGIC_SWAPPED 0xde120495
+
+/* Revision number of the currently used .mo (binary) file format. */
+#define MO_REVISION_NUMBER 0
+#define MO_REVISION_NUMBER_WITH_SYSDEP_I 1
+
+/* The following contortions are an attempt to use the C preprocessor
+ to determine an unsigned integral type that is 32 bits wide. An
+ alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
+ as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work
+ when cross-compiling. */
+
+#if __STDC__
+# define UINT_MAX_32_BITS 4294967295U
+#else
+# define UINT_MAX_32_BITS 0xFFFFFFFF
+#endif
+
+/* If UINT_MAX isn't defined, assume it's a 32-bit type.
+ This should be valid for all systems GNU cares about because
+ that doesn't include 16-bit systems, and only modern systems
+ (that certainly have <limits.h>) have 64+-bit integral types. */
+
+#ifndef UINT_MAX
+# define UINT_MAX UINT_MAX_32_BITS
+#endif
+
+#if UINT_MAX == UINT_MAX_32_BITS
+typedef unsigned nls_uint32;
+#else
+# if USHRT_MAX == UINT_MAX_32_BITS
+typedef unsigned short nls_uint32;
+# else
+# if ULONG_MAX == UINT_MAX_32_BITS
+typedef unsigned long nls_uint32;
+# else
+ /* The following line is intended to throw an error. Using #error is
+ not portable enough. */
+ "Cannot determine unsigned 32-bit data type."
+# endif
+# endif
+#endif
+
+
+/* Header for binary .mo file format. */
+struct mo_file_header
+{
+ /* The magic number. */
+ nls_uint32 magic;
+ /* The revision number of the file format. */
+ nls_uint32 revision;
+
+ /* The following are only used in .mo files with major revision 0 or 1. */
+
+ /* The number of strings pairs. */
+ nls_uint32 nstrings;
+ /* Offset of table with start offsets of original strings. */
+ nls_uint32 orig_tab_offset;
+ /* Offset of table with start offsets of translated strings. */
+ nls_uint32 trans_tab_offset;
+ /* Size of hash table. */
+ nls_uint32 hash_tab_size;
+ /* Offset of first hash table entry. */
+ nls_uint32 hash_tab_offset;
+
+ /* The following are only used in .mo files with minor revision >= 1. */
+
+ /* The number of system dependent segments. */
+ nls_uint32 n_sysdep_segments;
+ /* Offset of table describing system dependent segments. */
+ nls_uint32 sysdep_segments_offset;
+ /* The number of system dependent strings pairs. */
+ nls_uint32 n_sysdep_strings;
+ /* Offset of table with start offsets of original sysdep strings. */
+ nls_uint32 orig_sysdep_tab_offset;
+ /* Offset of table with start offsets of translated sysdep strings. */
+ nls_uint32 trans_sysdep_tab_offset;
+};
+
+/* Descriptor for static string contained in the binary .mo file. */
+struct string_desc
+{
+ /* Length of addressed string, not including the trailing NUL. */
+ nls_uint32 length;
+ /* Offset of string in file. */
+ nls_uint32 offset;
+};
+
+/* The following are only used in .mo files with minor revision >= 1. */
+
+/* Descriptor for system dependent string segment. */
+struct sysdep_segment
+{
+ /* Length of addressed string, including the trailing NUL. */
+ nls_uint32 length;
+ /* Offset of string in file. */
+ nls_uint32 offset;
+};
+
+/* Descriptor for system dependent string. */
+struct sysdep_string
+{
+ /* Offset of static string segments in file. */
+ nls_uint32 offset;
+ /* Alternating sequence of static and system dependent segments.
+ The last segment is a static segment, including the trailing NUL. */
+ struct segment_pair
+ {
+ /* Size of static segment. */
+ nls_uint32 segsize;
+ /* Reference to system dependent string segment, or ~0 at the end. */
+ nls_uint32 sysdepref;
+ } segments[1];
+};
+
+/* Marker for the end of the segments[] array. This has the value 0xFFFFFFFF,
+ regardless whether 'int' is 16 bit, 32 bit, or 64 bit. */
+#define SEGMENTS_END ((nls_uint32) ~0)
+
+/* @@ begin of epilog @@ */
+
+#endif /* gettext.h */
--- /dev/null
+/* Description of GNU message catalog format: string hashing function.
+ Copyright (C) 1995, 1997-1998, 2000-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+/* @@ end of prolog @@ */
+
+/* We assume to have `unsigned long int' value with at least 32 bits. */
+#define HASHWORDBITS 32
+
+
+/* Defines the so called `hashpjw' function by P.J. Weinberger
+ [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
+ 1986, 1987 Bell Telephone Laboratories, Inc.] */
+static inline unsigned long int
+hash_string (const char *str_param)
+{
+ unsigned long int hval, g;
+ const char *str = str_param;
+
+ /* Compute the hash value for the given string. */
+ hval = 0;
+ while (*str != '\0')
+ {
+ hval <<= 4;
+ hval += (unsigned char) *str++;
+ g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4));
+ if (g != 0)
+ {
+ hval ^= g >> (HASHWORDBITS - 8);
+ hval ^= g;
+ }
+ }
+ return hval;
+}
--- /dev/null
+/* intl-compat.c - Stub functions to call gettext functions from GNU gettext
+ Library.
+ Copyright (C) 1995, 2000-2003 Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "gettextP.h"
+
+/* @@ end of prolog @@ */
+
+/* This file redirects the gettext functions (without prefix) to those
+ defined in the included GNU libintl library (with "libintl_" prefix).
+ It is compiled into libintl in order to make the AM_GNU_GETTEXT test
+ of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which
+ has the redirections primarily in the <libintl.h> include file.
+ It is also compiled into libgnuintl so that libgnuintl.so can be used
+ as LD_PRELOADable library on glibc systems, to provide the extra
+ features that the functions in the libc don't have (namely, logging). */
+
+
+#undef gettext
+#undef dgettext
+#undef dcgettext
+#undef ngettext
+#undef dngettext
+#undef dcngettext
+#undef textdomain
+#undef bindtextdomain
+#undef bind_textdomain_codeset
+
+
+/* When building a DLL, we must export some functions. Note that because
+ the functions are only defined for binary backward compatibility, we
+ don't need to use __declspec(dllimport) in any case. */
+#if defined _MSC_VER && BUILDING_DLL
+# define DLL_EXPORTED __declspec(dllexport)
+#else
+# define DLL_EXPORTED
+#endif
+
+
+DLL_EXPORTED
+char *
+gettext (const char *msgid)
+{
+ return libintl_gettext (msgid);
+}
+
+
+DLL_EXPORTED
+char *
+dgettext (const char *domainname, const char *msgid)
+{
+ return libintl_dgettext (domainname, msgid);
+}
+
+
+DLL_EXPORTED
+char *
+dcgettext (const char *domainname, const char *msgid, int category)
+{
+ return libintl_dcgettext (domainname, msgid, category);
+}
+
+
+DLL_EXPORTED
+char *
+ngettext (const char *msgid1, const char *msgid2, unsigned long int n)
+{
+ return libintl_ngettext (msgid1, msgid2, n);
+}
+
+
+DLL_EXPORTED
+char *
+dngettext (const char *domainname,
+ const char *msgid1, const char *msgid2, unsigned long int n)
+{
+ return libintl_dngettext (domainname, msgid1, msgid2, n);
+}
+
+
+DLL_EXPORTED
+char *
+dcngettext (const char *domainname,
+ const char *msgid1, const char *msgid2, unsigned long int n,
+ int category)
+{
+ return libintl_dcngettext (domainname, msgid1, msgid2, n, category);
+}
+
+
+DLL_EXPORTED
+char *
+textdomain (const char *domainname)
+{
+ return libintl_textdomain (domainname);
+}
+
+
+DLL_EXPORTED
+char *
+bindtextdomain (const char *domainname, const char *dirname)
+{
+ return libintl_bindtextdomain (domainname, dirname);
+}
+
+
+DLL_EXPORTED
+char *
+bind_textdomain_codeset (const char *domainname, const char *codeset)
+{
+ return libintl_bind_textdomain_codeset (domainname, codeset);
+}
--- /dev/null
+/* Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+/* Tell glibc's <string.h> to provide a prototype for stpcpy().
+ This must come before <config.h> because <config.h> may include
+ <features.h>, and once <features.h> has been included, it's too late. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <string.h>
+
+#if defined _LIBC || defined HAVE_ARGZ_H
+# include <argz.h>
+#endif
+#include <ctype.h>
+#include <sys/types.h>
+#include <stdlib.h>
+
+#include "loadinfo.h"
+
+/* On some strange systems still no definition of NULL is found. Sigh! */
+#ifndef NULL
+# if defined __STDC__ && __STDC__
+# define NULL ((void *) 0)
+# else
+# define NULL 0
+# endif
+#endif
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ANSI C functions. This is required by the standard
+ because some ANSI C functions will require linking with this object
+ file and the name space must not be polluted. */
+# ifndef stpcpy
+# define stpcpy(dest, src) __stpcpy(dest, src)
+# endif
+#else
+# ifndef HAVE_STPCPY
+static char *stpcpy (char *dest, const char *src);
+# endif
+#endif
+
+/* Pathname support.
+ ISSLASH(C) tests whether C is a directory separator character.
+ IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not,
+ it may be concatenated to a directory pathname.
+ */
+#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
+ /* Win32, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+# define HAS_DEVICE(P) \
+ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
+ && (P)[1] == ':')
+# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
+#else
+ /* Unix */
+# define ISSLASH(C) ((C) == '/')
+# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
+#endif
+
+/* Define function which are usually not available. */
+
+#if !defined _LIBC && !defined HAVE___ARGZ_COUNT
+/* Returns the number of strings in ARGZ. */
+static size_t
+argz_count__ (const char *argz, size_t len)
+{
+ size_t count = 0;
+ while (len > 0)
+ {
+ size_t part_len = strlen (argz);
+ argz += part_len + 1;
+ len -= part_len + 1;
+ count++;
+ }
+ return count;
+}
+# undef __argz_count
+# define __argz_count(argz, len) argz_count__ (argz, len)
+#else
+# ifdef _LIBC
+# define __argz_count(argz, len) INTUSE(__argz_count) (argz, len)
+# endif
+#endif /* !_LIBC && !HAVE___ARGZ_COUNT */
+
+#if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY
+/* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
+ except the last into the character SEP. */
+static void
+argz_stringify__ (char *argz, size_t len, int sep)
+{
+ while (len > 0)
+ {
+ size_t part_len = strlen (argz);
+ argz += part_len;
+ len -= part_len + 1;
+ if (len > 0)
+ *argz++ = sep;
+ }
+}
+# undef __argz_stringify
+# define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep)
+#else
+# ifdef _LIBC
+# define __argz_stringify(argz, len, sep) \
+ INTUSE(__argz_stringify) (argz, len, sep)
+# endif
+#endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */
+
+#if !defined _LIBC && !defined HAVE___ARGZ_NEXT
+static char *
+argz_next__ (char *argz, size_t argz_len, const char *entry)
+{
+ if (entry)
+ {
+ if (entry < argz + argz_len)
+ entry = strchr (entry, '\0') + 1;
+
+ return entry >= argz + argz_len ? NULL : (char *) entry;
+ }
+ else
+ if (argz_len > 0)
+ return argz;
+ else
+ return 0;
+}
+# undef __argz_next
+# define __argz_next(argz, len, entry) argz_next__ (argz, len, entry)
+#endif /* !_LIBC && !HAVE___ARGZ_NEXT */
+
+
+/* Return number of bits set in X. */
+static inline int
+pop (int x)
+{
+ /* We assume that no more than 16 bits are used. */
+ x = ((x & ~0x5555) >> 1) + (x & 0x5555);
+ x = ((x & ~0x3333) >> 2) + (x & 0x3333);
+ x = ((x >> 4) + x) & 0x0f0f;
+ x = ((x >> 8) + x) & 0xff;
+
+ return x;
+}
+
+\f
+struct loaded_l10nfile *
+_nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list,
+ const char *dirlist, size_t dirlist_len,
+ int mask, const char *language, const char *territory,
+ const char *codeset, const char *normalized_codeset,
+ const char *modifier, const char *special,
+ const char *sponsor, const char *revision,
+ const char *filename, int do_allocate)
+{
+ char *abs_filename;
+ struct loaded_l10nfile **lastp;
+ struct loaded_l10nfile *retval;
+ char *cp;
+ size_t dirlist_count;
+ size_t entries;
+ int cnt;
+
+ /* If LANGUAGE contains an absolute directory specification, we ignore
+ DIRLIST. */
+ if (IS_ABSOLUTE_PATH (language))
+ dirlist_len = 0;
+
+ /* Allocate room for the full file name. */
+ abs_filename = (char *) malloc (dirlist_len
+ + strlen (language)
+ + ((mask & TERRITORY) != 0
+ ? strlen (territory) + 1 : 0)
+ + ((mask & XPG_CODESET) != 0
+ ? strlen (codeset) + 1 : 0)
+ + ((mask & XPG_NORM_CODESET) != 0
+ ? strlen (normalized_codeset) + 1 : 0)
+ + (((mask & XPG_MODIFIER) != 0
+ || (mask & CEN_AUDIENCE) != 0)
+ ? strlen (modifier) + 1 : 0)
+ + ((mask & CEN_SPECIAL) != 0
+ ? strlen (special) + 1 : 0)
+ + (((mask & CEN_SPONSOR) != 0
+ || (mask & CEN_REVISION) != 0)
+ ? (1 + ((mask & CEN_SPONSOR) != 0
+ ? strlen (sponsor) : 0)
+ + ((mask & CEN_REVISION) != 0
+ ? strlen (revision) + 1 : 0)) : 0)
+ + 1 + strlen (filename) + 1);
+
+ if (abs_filename == NULL)
+ return NULL;
+
+ /* Construct file name. */
+ cp = abs_filename;
+ if (dirlist_len > 0)
+ {
+ memcpy (cp, dirlist, dirlist_len);
+ __argz_stringify (cp, dirlist_len, PATH_SEPARATOR);
+ cp += dirlist_len;
+ cp[-1] = '/';
+ }
+
+ cp = stpcpy (cp, language);
+
+ if ((mask & TERRITORY) != 0)
+ {
+ *cp++ = '_';
+ cp = stpcpy (cp, territory);
+ }
+ if ((mask & XPG_CODESET) != 0)
+ {
+ *cp++ = '.';
+ cp = stpcpy (cp, codeset);
+ }
+ if ((mask & XPG_NORM_CODESET) != 0)
+ {
+ *cp++ = '.';
+ cp = stpcpy (cp, normalized_codeset);
+ }
+ if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0)
+ {
+ /* This component can be part of both syntaces but has different
+ leading characters. For CEN we use `+', else `@'. */
+ *cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@';
+ cp = stpcpy (cp, modifier);
+ }
+ if ((mask & CEN_SPECIAL) != 0)
+ {
+ *cp++ = '+';
+ cp = stpcpy (cp, special);
+ }
+ if ((mask & (CEN_SPONSOR | CEN_REVISION)) != 0)
+ {
+ *cp++ = ',';
+ if ((mask & CEN_SPONSOR) != 0)
+ cp = stpcpy (cp, sponsor);
+ if ((mask & CEN_REVISION) != 0)
+ {
+ *cp++ = '_';
+ cp = stpcpy (cp, revision);
+ }
+ }
+
+ *cp++ = '/';
+ stpcpy (cp, filename);
+
+ /* Look in list of already loaded domains whether it is already
+ available. */
+ lastp = l10nfile_list;
+ for (retval = *l10nfile_list; retval != NULL; retval = retval->next)
+ if (retval->filename != NULL)
+ {
+ int compare = strcmp (retval->filename, abs_filename);
+ if (compare == 0)
+ /* We found it! */
+ break;
+ if (compare < 0)
+ {
+ /* It's not in the list. */
+ retval = NULL;
+ break;
+ }
+
+ lastp = &retval->next;
+ }
+
+ if (retval != NULL || do_allocate == 0)
+ {
+ free (abs_filename);
+ return retval;
+ }
+
+ dirlist_count = (dirlist_len > 0 ? __argz_count (dirlist, dirlist_len) : 1);
+
+ /* Allocate a new loaded_l10nfile. */
+ retval =
+ (struct loaded_l10nfile *)
+ malloc (sizeof (*retval)
+ + (((dirlist_count << pop (mask)) + (dirlist_count > 1 ? 1 : 0))
+ * sizeof (struct loaded_l10nfile *)));
+ if (retval == NULL)
+ return NULL;
+
+ retval->filename = abs_filename;
+
+ /* We set retval->data to NULL here; it is filled in later.
+ Setting retval->decided to 1 here means that retval does not
+ correspond to a real file (dirlist_count > 1) or is not worth
+ looking up (if an unnormalized codeset was specified). */
+ retval->decided = (dirlist_count > 1
+ || ((mask & XPG_CODESET) != 0
+ && (mask & XPG_NORM_CODESET) != 0));
+ retval->data = NULL;
+
+ retval->next = *lastp;
+ *lastp = retval;
+
+ entries = 0;
+ /* Recurse to fill the inheritance list of RETVAL.
+ If the DIRLIST is a real list (i.e. DIRLIST_COUNT > 1), the RETVAL
+ entry does not correspond to a real file; retval->filename contains
+ colons. In this case we loop across all elements of DIRLIST and
+ across all bit patterns dominated by MASK.
+ If the DIRLIST is a single directory or entirely redundant (i.e.
+ DIRLIST_COUNT == 1), we loop across all bit patterns dominated by
+ MASK, excluding MASK itself.
+ In either case, we loop down from MASK to 0. This has the effect
+ that the extra bits in the locale name are dropped in this order:
+ first the modifier, then the territory, then the codeset, then the
+ normalized_codeset. */
+ for (cnt = dirlist_count > 1 ? mask : mask - 1; cnt >= 0; --cnt)
+ if ((cnt & ~mask) == 0
+ && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)
+ && ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0))
+ {
+ if (dirlist_count > 1)
+ {
+ /* Iterate over all elements of the DIRLIST. */
+ char *dir = NULL;
+
+ while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir))
+ != NULL)
+ retval->successor[entries++]
+ = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1,
+ cnt, language, territory, codeset,
+ normalized_codeset, modifier, special,
+ sponsor, revision, filename, 1);
+ }
+ else
+ retval->successor[entries++]
+ = _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len,
+ cnt, language, territory, codeset,
+ normalized_codeset, modifier, special,
+ sponsor, revision, filename, 1);
+ }
+ retval->successor[entries] = NULL;
+
+ return retval;
+}
+\f
+/* Normalize codeset name. There is no standard for the codeset
+ names. Normalization allows the user to use any of the common
+ names. The return value is dynamically allocated and has to be
+ freed by the caller. */
+const char *
+_nl_normalize_codeset (const char *codeset, size_t name_len)
+{
+ int len = 0;
+ int only_digit = 1;
+ char *retval;
+ char *wp;
+ size_t cnt;
+
+ for (cnt = 0; cnt < name_len; ++cnt)
+ if (isalnum ((unsigned char) codeset[cnt]))
+ {
+ ++len;
+
+ if (isalpha ((unsigned char) codeset[cnt]))
+ only_digit = 0;
+ }
+
+ retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1);
+
+ if (retval != NULL)
+ {
+ if (only_digit)
+ wp = stpcpy (retval, "iso");
+ else
+ wp = retval;
+
+ for (cnt = 0; cnt < name_len; ++cnt)
+ if (isalpha ((unsigned char) codeset[cnt]))
+ *wp++ = tolower ((unsigned char) codeset[cnt]);
+ else if (isdigit ((unsigned char) codeset[cnt]))
+ *wp++ = codeset[cnt];
+
+ *wp = '\0';
+ }
+
+ return (const char *) retval;
+}
+
+
+/* @@ begin of epilog @@ */
+
+/* We don't want libintl.a to depend on any other library. So we
+ avoid the non-standard function stpcpy. In GNU C Library this
+ function is available, though. Also allow the symbol HAVE_STPCPY
+ to be defined. */
+#if !_LIBC && !HAVE_STPCPY
+static char *
+stpcpy (char *dest, const char *src)
+{
+ while ((*dest++ = *src++) != '\0')
+ /* Do nothing. */ ;
+ return dest - 1;
+}
+#endif
--- /dev/null
+/* Message catalogs for internationalization.
+ Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _LIBINTL_H
+#define _LIBINTL_H 1
+
+#include <locale.h>
+
+/* The LC_MESSAGES locale category is the category used by the functions
+ gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
+ On systems that don't define it, use an arbitrary value instead.
+ On Solaris, <locale.h> defines __LOCALE_H (or _LOCALE_H in Solaris 2.5)
+ then includes <libintl.h> (i.e. this file!) and then only defines
+ LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES
+ in this case. */
+#if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun))
+# define LC_MESSAGES 1729
+#endif
+
+/* We define an additional symbol to signal that we use the GNU
+ implementation of gettext. */
+#define __USE_GNU_GETTEXT 1
+
+/* Provide information about the supported file formats. Returns the
+ maximum minor revision number supported for a given major revision. */
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
+ ((major) == 0 ? 1 : -1)
+
+/* Resolve a platform specific conflict on DJGPP. GNU gettext takes
+ precedence over _conio_gettext. */
+#ifdef __DJGPP__
+# undef gettext
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* We redirect the functions to those prefixed with "libintl_". This is
+ necessary, because some systems define gettext/textdomain/... in the C
+ library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer).
+ If we used the unprefixed names, there would be cases where the
+ definition in the C library would override the one in the libintl.so
+ shared library. Recall that on ELF systems, the symbols are looked
+ up in the following order:
+ 1. in the executable,
+ 2. in the shared libraries specified on the link command line, in order,
+ 3. in the dependencies of the shared libraries specified on the link
+ command line,
+ 4. in the dlopen()ed shared libraries, in the order in which they were
+ dlopen()ed.
+ The definition in the C library would override the one in libintl.so if
+ either
+ * -lc is given on the link command line and -lintl isn't, or
+ * -lc is given on the link command line before -lintl, or
+ * libintl.so is a dependency of a dlopen()ed shared library but not
+ linked to the executable at link time.
+ Since Solaris gettext() behaves differently than GNU gettext(), this
+ would be unacceptable.
+
+ The redirection happens by default through macros in C, so that &gettext
+ is independent of the compilation unit, but through inline functions in
+ C++, in order not to interfere with the name mangling of class fields or
+ class methods called 'gettext'. */
+
+/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS.
+ If he doesn't, we choose the method. A third possible method is
+ _INTL_REDIRECT_ASM, supported only by GCC. */
+#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
+# if __GNUC__ >= 2 && !defined __APPLE_CC__ && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
+# define _INTL_REDIRECT_ASM
+# else
+# ifdef __cplusplus
+# define _INTL_REDIRECT_INLINE
+# else
+# define _INTL_REDIRECT_MACROS
+# endif
+# endif
+#endif
+/* Auxiliary macros. */
+#ifdef _INTL_REDIRECT_ASM
+# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname))
+# define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring
+# define _INTL_STRINGIFY(prefix) #prefix
+#else
+# define _INTL_ASM(cname)
+#endif
+
+/* Look up MSGID in the current default message catalog for the current
+ LC_MESSAGES locale. If not found, returns MSGID itself (the default
+ text). */
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_gettext (const char *__msgid);
+static inline char *gettext (const char *__msgid)
+{
+ return libintl_gettext (__msgid);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define gettext libintl_gettext
+#endif
+extern char *gettext (const char *__msgid)
+ _INTL_ASM (libintl_gettext);
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current
+ LC_MESSAGES locale. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_dgettext (const char *__domainname, const char *__msgid);
+static inline char *dgettext (const char *__domainname, const char *__msgid)
+{
+ return libintl_dgettext (__domainname, __msgid);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define dgettext libintl_dgettext
+#endif
+extern char *dgettext (const char *__domainname, const char *__msgid)
+ _INTL_ASM (libintl_dgettext);
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+ locale. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_dcgettext (const char *__domainname, const char *__msgid,
+ int __category);
+static inline char *dcgettext (const char *__domainname, const char *__msgid,
+ int __category)
+{
+ return libintl_dcgettext (__domainname, __msgid, __category);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define dcgettext libintl_dcgettext
+#endif
+extern char *dcgettext (const char *__domainname, const char *__msgid,
+ int __category)
+ _INTL_ASM (libintl_dcgettext);
+#endif
+
+
+/* Similar to `gettext' but select the plural form corresponding to the
+ number N. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2,
+ unsigned long int __n);
+static inline char *ngettext (const char *__msgid1, const char *__msgid2,
+ unsigned long int __n)
+{
+ return libintl_ngettext (__msgid1, __msgid2, __n);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define ngettext libintl_ngettext
+#endif
+extern char *ngettext (const char *__msgid1, const char *__msgid2,
+ unsigned long int __n)
+ _INTL_ASM (libintl_ngettext);
+#endif
+
+/* Similar to `dgettext' but select the plural form corresponding to the
+ number N. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_dngettext (const char *__domainname, const char *__msgid1,
+ const char *__msgid2, unsigned long int __n);
+static inline char *dngettext (const char *__domainname, const char *__msgid1,
+ const char *__msgid2, unsigned long int __n)
+{
+ return libintl_dngettext (__domainname, __msgid1, __msgid2, __n);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define dngettext libintl_dngettext
+#endif
+extern char *dngettext (const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n)
+ _INTL_ASM (libintl_dngettext);
+#endif
+
+/* Similar to `dcgettext' but select the plural form corresponding to the
+ number N. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_dcngettext (const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n, int __category);
+static inline char *dcngettext (const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n, int __category)
+{
+ return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define dcngettext libintl_dcngettext
+#endif
+extern char *dcngettext (const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n, int __category)
+ _INTL_ASM (libintl_dcngettext);
+#endif
+
+
+/* Set the current default message catalog to DOMAINNAME.
+ If DOMAINNAME is null, return the current default.
+ If DOMAINNAME is "", reset to the default of "messages". */
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_textdomain (const char *__domainname);
+static inline char *textdomain (const char *__domainname)
+{
+ return libintl_textdomain (__domainname);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define textdomain libintl_textdomain
+#endif
+extern char *textdomain (const char *__domainname)
+ _INTL_ASM (libintl_textdomain);
+#endif
+
+/* Specify that the DOMAINNAME message catalog will be found
+ in DIRNAME rather than in the system locale data base. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_bindtextdomain (const char *__domainname,
+ const char *__dirname);
+static inline char *bindtextdomain (const char *__domainname,
+ const char *__dirname)
+{
+ return libintl_bindtextdomain (__domainname, __dirname);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define bindtextdomain libintl_bindtextdomain
+#endif
+extern char *bindtextdomain (const char *__domainname, const char *__dirname)
+ _INTL_ASM (libintl_bindtextdomain);
+#endif
+
+/* Specify the character encoding in which the messages from the
+ DOMAINNAME message catalog will be returned. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_bind_textdomain_codeset (const char *__domainname,
+ const char *__codeset);
+static inline char *bind_textdomain_codeset (const char *__domainname,
+ const char *__codeset)
+{
+ return libintl_bind_textdomain_codeset (__domainname, __codeset);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define bind_textdomain_codeset libintl_bind_textdomain_codeset
+#endif
+extern char *bind_textdomain_codeset (const char *__domainname,
+ const char *__codeset)
+ _INTL_ASM (libintl_bind_textdomain_codeset);
+#endif
+
+
+/* Support for format strings with positions in *printf(), following the
+ POSIX/XSI specification.
+ Note: These replacements for the *printf() functions are visible only
+ in source files that #include <libintl.h> or #include "gettext.h".
+ Packages that use *printf() in source files that don't refer to _()
+ or gettext() but for which the format string could be the return value
+ of _() or gettext() need to add this #include. Oh well. */
+
+#if !@HAVE_POSIX_PRINTF@
+
+#include <stdio.h>
+#include <stddef.h>
+
+/* Get va_list. */
+#if __STDC__ || defined __cplusplus || defined _MSC_VER
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
+#undef fprintf
+#define fprintf libintl_fprintf
+extern int fprintf (FILE *, const char *, ...);
+#undef vfprintf
+#define vfprintf libintl_vfprintf
+extern int vfprintf (FILE *, const char *, va_list);
+
+#undef printf
+#define printf libintl_printf
+extern int printf (const char *, ...);
+#undef vprintf
+#define vprintf libintl_vprintf
+extern int vprintf (const char *, va_list);
+
+#undef sprintf
+#define sprintf libintl_sprintf
+extern int sprintf (char *, const char *, ...);
+#undef vsprintf
+#define vsprintf libintl_vsprintf
+extern int vsprintf (char *, const char *, va_list);
+
+#if @HAVE_SNPRINTF@
+
+#undef snprintf
+#define snprintf libintl_snprintf
+extern int snprintf (char *, size_t, const char *, ...);
+#undef vsnprintf
+#define vsnprintf libintl_vsnprintf
+extern int vsnprintf (char *, size_t, const char *, va_list);
+
+#endif
+
+#if @HAVE_ASPRINTF@
+
+#undef asprintf
+#define asprintf libintl_asprintf
+extern int asprintf (char **, const char *, ...);
+#undef vasprintf
+#define vasprintf libintl_vasprintf
+extern int vasprintf (char **, const char *, va_list);
+
+#endif
+
+#if @HAVE_WPRINTF@
+
+#undef fwprintf
+#define fwprintf libintl_fwprintf
+extern int fwprintf (FILE *, const wchar_t *, ...);
+#undef vfwprintf
+#define vfwprintf libintl_vfwprintf
+extern int vfwprintf (FILE *, const wchar_t *, va_list);
+
+#undef wprintf
+#define wprintf libintl_wprintf
+extern int wprintf (const wchar_t *, ...);
+#undef vwprintf
+#define vwprintf libintl_vwprintf
+extern int vwprintf (const wchar_t *, va_list);
+
+#undef swprintf
+#define swprintf libintl_swprintf
+extern int swprintf (wchar_t *, size_t, const wchar_t *, ...);
+#undef vswprintf
+#define vswprintf libintl_vswprintf
+extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list);
+
+#endif
+
+#endif
+
+
+/* Support for relocatable packages. */
+
+/* Sets the original and the current installation prefix of the package.
+ Relocation simply replaces a pathname starting with the original prefix
+ by the corresponding pathname with the current prefix instead. Both
+ prefixes should be directory names without trailing slash (i.e. use ""
+ instead of "/"). */
+#define libintl_set_relocation_prefix libintl_set_relocation_prefix
+extern void
+ libintl_set_relocation_prefix (const char *orig_prefix,
+ const char *curr_prefix);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* libintl.h */
--- /dev/null
+/* Copyright (C) 1996-1999, 2000-2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _LOADINFO_H
+#define _LOADINFO_H 1
+
+/* Declarations of locale dependent catalog lookup functions.
+ Implemented in
+
+ localealias.c Possibly replace a locale name by another.
+ explodename.c Split a locale name into its various fields.
+ l10nflist.c Generate a list of filenames of possible message catalogs.
+ finddomain.c Find and open the relevant message catalogs.
+
+ The main function _nl_find_domain() in finddomain.c is declared
+ in gettextP.h.
+ */
+
+#ifndef internal_function
+# define internal_function
+#endif
+
+/* Tell the compiler when a conditional or integer expression is
+ almost always true or almost always false. */
+#ifndef HAVE_BUILTIN_EXPECT
+# define __builtin_expect(expr, val) (expr)
+#endif
+
+/* Separator in PATH like lists of pathnames. */
+#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
+ /* Win32, OS/2, DOS */
+# define PATH_SEPARATOR ';'
+#else
+ /* Unix */
+# define PATH_SEPARATOR ':'
+#endif
+
+/* Encoding of locale name parts. */
+#define CEN_REVISION 1
+#define CEN_SPONSOR 2
+#define CEN_SPECIAL 4
+#define XPG_NORM_CODESET 8
+#define XPG_CODESET 16
+#define TERRITORY 32
+#define CEN_AUDIENCE 64
+#define XPG_MODIFIER 128
+
+#define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE)
+#define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER)
+
+
+struct loaded_l10nfile
+{
+ const char *filename;
+ int decided;
+
+ const void *data;
+
+ struct loaded_l10nfile *next;
+ struct loaded_l10nfile *successor[1];
+};
+
+
+/* Normalize codeset name. There is no standard for the codeset
+ names. Normalization allows the user to use any of the common
+ names. The return value is dynamically allocated and has to be
+ freed by the caller. */
+extern const char *_nl_normalize_codeset (const char *codeset,
+ size_t name_len);
+
+/* Lookup a locale dependent file.
+ *L10NFILE_LIST denotes a pool of lookup results of locale dependent
+ files of the same kind, sorted in decreasing order of ->filename.
+ DIRLIST and DIRLIST_LEN are an argz list of directories in which to
+ look, containing at least one directory (i.e. DIRLIST_LEN > 0).
+ MASK, LANGUAGE, TERRITORY, CODESET, NORMALIZED_CODESET, MODIFIER,
+ SPECIAL, SPONSOR, REVISION are the pieces of the locale name, as
+ produced by _nl_explode_name(). FILENAME is the filename suffix.
+ The return value is the lookup result, either found in *L10NFILE_LIST,
+ or - if DO_ALLOCATE is nonzero - freshly allocated, or possibly NULL.
+ If the return value is non-NULL, it is added to *L10NFILE_LIST, and
+ its ->next field denotes the chaining inside *L10NFILE_LIST, and
+ furthermore its ->successor[] field contains a list of other lookup
+ results from which this lookup result inherits. */
+extern struct loaded_l10nfile *
+_nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list,
+ const char *dirlist, size_t dirlist_len, int mask,
+ const char *language, const char *territory,
+ const char *codeset, const char *normalized_codeset,
+ const char *modifier, const char *special,
+ const char *sponsor, const char *revision,
+ const char *filename, int do_allocate);
+
+/* Lookup the real locale name for a locale alias NAME, or NULL if
+ NAME is not a locale alias (but possibly a real locale name).
+ The return value is statically allocated and must not be freed. */
+extern const char *_nl_expand_alias (const char *name);
+
+/* Split a locale name NAME into its pieces: language, modifier,
+ territory, codeset, special, sponsor, revision.
+ NAME gets destructively modified: NUL bytes are inserted here and
+ there. *LANGUAGE gets assigned NAME. Each of *MODIFIER, *TERRITORY,
+ *CODESET, *SPECIAL, *SPONSOR, *REVISION gets assigned either a
+ pointer into the old NAME string, or NULL. *NORMALIZED_CODESET
+ gets assigned the expanded *CODESET, if it is different from *CODESET;
+ this one is dynamically allocated and has to be freed by the caller.
+ The return value is a bitmask, where each bit corresponds to one
+ filled-in value:
+ XPG_MODIFIER, CEN_AUDIENCE for *MODIFIER,
+ TERRITORY for *TERRITORY,
+ XPG_CODESET for *CODESET,
+ XPG_NORM_CODESET for *NORMALIZED_CODESET,
+ CEN_SPECIAL for *SPECIAL,
+ CEN_SPONSOR for *SPONSOR,
+ CEN_REVISION for *REVISION.
+ */
+extern int _nl_explode_name (char *name, const char **language,
+ const char **modifier, const char **territory,
+ const char **codeset,
+ const char **normalized_codeset,
+ const char **special, const char **sponsor,
+ const char **revision);
+
+/* Split a locale name NAME into a leading language part and all the
+ rest. Return a pointer to the first character after the language,
+ i.e. to the first byte of the rest. */
+extern char *_nl_find_language (const char *name);
+
+#endif /* loadinfo.h */
--- /dev/null
+/* Load needed message catalogs.
+ Copyright (C) 1995-1999, 2000-2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+/* Tell glibc's <string.h> to provide a prototype for mempcpy().
+ This must come before <config.h> because <config.h> may include
+ <features.h>, and once <features.h> has been included, it's too late. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifdef __GNUC__
+# undef alloca
+# define alloca __builtin_alloca
+# define HAVE_ALLOCA 1
+#else
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# if defined HAVE_ALLOCA_H || defined _LIBC
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca
+char *alloca ();
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#if defined HAVE_UNISTD_H || defined _LIBC
+# include <unistd.h>
+#endif
+
+#ifdef _LIBC
+# include <langinfo.h>
+# include <locale.h>
+#endif
+
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+ || (defined _LIBC && defined _POSIX_MAPPED_FILES)
+# include <sys/mman.h>
+# undef HAVE_MMAP
+# define HAVE_MMAP 1
+#else
+# undef HAVE_MMAP
+#endif
+
+#if defined HAVE_STDINT_H_WITH_UINTMAX || defined _LIBC
+# include <stdint.h>
+#endif
+#if defined HAVE_INTTYPES_H || defined _LIBC
+# include <inttypes.h>
+#endif
+
+#include "gmo.h"
+#include "gettextP.h"
+#include "hash-string.h"
+#include "plural-exp.h"
+
+#ifdef _LIBC
+# include "../locale/localeinfo.h"
+#endif
+
+/* Provide fallback values for macros that ought to be defined in <inttypes.h>.
+ Note that our fallback values need not be literal strings, because we don't
+ use them with preprocessor string concatenation. */
+#if !defined PRId8 || PRI_MACROS_BROKEN
+# undef PRId8
+# define PRId8 "d"
+#endif
+#if !defined PRIi8 || PRI_MACROS_BROKEN
+# undef PRIi8
+# define PRIi8 "i"
+#endif
+#if !defined PRIo8 || PRI_MACROS_BROKEN
+# undef PRIo8
+# define PRIo8 "o"
+#endif
+#if !defined PRIu8 || PRI_MACROS_BROKEN
+# undef PRIu8
+# define PRIu8 "u"
+#endif
+#if !defined PRIx8 || PRI_MACROS_BROKEN
+# undef PRIx8
+# define PRIx8 "x"
+#endif
+#if !defined PRIX8 || PRI_MACROS_BROKEN
+# undef PRIX8
+# define PRIX8 "X"
+#endif
+#if !defined PRId16 || PRI_MACROS_BROKEN
+# undef PRId16
+# define PRId16 "d"
+#endif
+#if !defined PRIi16 || PRI_MACROS_BROKEN
+# undef PRIi16
+# define PRIi16 "i"
+#endif
+#if !defined PRIo16 || PRI_MACROS_BROKEN
+# undef PRIo16
+# define PRIo16 "o"
+#endif
+#if !defined PRIu16 || PRI_MACROS_BROKEN
+# undef PRIu16
+# define PRIu16 "u"
+#endif
+#if !defined PRIx16 || PRI_MACROS_BROKEN
+# undef PRIx16
+# define PRIx16 "x"
+#endif
+#if !defined PRIX16 || PRI_MACROS_BROKEN
+# undef PRIX16
+# define PRIX16 "X"
+#endif
+#if !defined PRId32 || PRI_MACROS_BROKEN
+# undef PRId32
+# define PRId32 "d"
+#endif
+#if !defined PRIi32 || PRI_MACROS_BROKEN
+# undef PRIi32
+# define PRIi32 "i"
+#endif
+#if !defined PRIo32 || PRI_MACROS_BROKEN
+# undef PRIo32
+# define PRIo32 "o"
+#endif
+#if !defined PRIu32 || PRI_MACROS_BROKEN
+# undef PRIu32
+# define PRIu32 "u"
+#endif
+#if !defined PRIx32 || PRI_MACROS_BROKEN
+# undef PRIx32
+# define PRIx32 "x"
+#endif
+#if !defined PRIX32 || PRI_MACROS_BROKEN
+# undef PRIX32
+# define PRIX32 "X"
+#endif
+#if !defined PRId64 || PRI_MACROS_BROKEN
+# undef PRId64
+# define PRId64 (sizeof (long) == 8 ? "ld" : "lld")
+#endif
+#if !defined PRIi64 || PRI_MACROS_BROKEN
+# undef PRIi64
+# define PRIi64 (sizeof (long) == 8 ? "li" : "lli")
+#endif
+#if !defined PRIo64 || PRI_MACROS_BROKEN
+# undef PRIo64
+# define PRIo64 (sizeof (long) == 8 ? "lo" : "llo")
+#endif
+#if !defined PRIu64 || PRI_MACROS_BROKEN
+# undef PRIu64
+# define PRIu64 (sizeof (long) == 8 ? "lu" : "llu")
+#endif
+#if !defined PRIx64 || PRI_MACROS_BROKEN
+# undef PRIx64
+# define PRIx64 (sizeof (long) == 8 ? "lx" : "llx")
+#endif
+#if !defined PRIX64 || PRI_MACROS_BROKEN
+# undef PRIX64
+# define PRIX64 (sizeof (long) == 8 ? "lX" : "llX")
+#endif
+#if !defined PRIdLEAST8 || PRI_MACROS_BROKEN
+# undef PRIdLEAST8
+# define PRIdLEAST8 "d"
+#endif
+#if !defined PRIiLEAST8 || PRI_MACROS_BROKEN
+# undef PRIiLEAST8
+# define PRIiLEAST8 "i"
+#endif
+#if !defined PRIoLEAST8 || PRI_MACROS_BROKEN
+# undef PRIoLEAST8
+# define PRIoLEAST8 "o"
+#endif
+#if !defined PRIuLEAST8 || PRI_MACROS_BROKEN
+# undef PRIuLEAST8
+# define PRIuLEAST8 "u"
+#endif
+#if !defined PRIxLEAST8 || PRI_MACROS_BROKEN
+# undef PRIxLEAST8
+# define PRIxLEAST8 "x"
+#endif
+#if !defined PRIXLEAST8 || PRI_MACROS_BROKEN
+# undef PRIXLEAST8
+# define PRIXLEAST8 "X"
+#endif
+#if !defined PRIdLEAST16 || PRI_MACROS_BROKEN
+# undef PRIdLEAST16
+# define PRIdLEAST16 "d"
+#endif
+#if !defined PRIiLEAST16 || PRI_MACROS_BROKEN
+# undef PRIiLEAST16
+# define PRIiLEAST16 "i"
+#endif
+#if !defined PRIoLEAST16 || PRI_MACROS_BROKEN
+# undef PRIoLEAST16
+# define PRIoLEAST16 "o"
+#endif
+#if !defined PRIuLEAST16 || PRI_MACROS_BROKEN
+# undef PRIuLEAST16
+# define PRIuLEAST16 "u"
+#endif
+#if !defined PRIxLEAST16 || PRI_MACROS_BROKEN
+# undef PRIxLEAST16
+# define PRIxLEAST16 "x"
+#endif
+#if !defined PRIXLEAST16 || PRI_MACROS_BROKEN
+# undef PRIXLEAST16
+# define PRIXLEAST16 "X"
+#endif
+#if !defined PRIdLEAST32 || PRI_MACROS_BROKEN
+# undef PRIdLEAST32
+# define PRIdLEAST32 "d"
+#endif
+#if !defined PRIiLEAST32 || PRI_MACROS_BROKEN
+# undef PRIiLEAST32
+# define PRIiLEAST32 "i"
+#endif
+#if !defined PRIoLEAST32 || PRI_MACROS_BROKEN
+# undef PRIoLEAST32
+# define PRIoLEAST32 "o"
+#endif
+#if !defined PRIuLEAST32 || PRI_MACROS_BROKEN
+# undef PRIuLEAST32
+# define PRIuLEAST32 "u"
+#endif
+#if !defined PRIxLEAST32 || PRI_MACROS_BROKEN
+# undef PRIxLEAST32
+# define PRIxLEAST32 "x"
+#endif
+#if !defined PRIXLEAST32 || PRI_MACROS_BROKEN
+# undef PRIXLEAST32
+# define PRIXLEAST32 "X"
+#endif
+#if !defined PRIdLEAST64 || PRI_MACROS_BROKEN
+# undef PRIdLEAST64
+# define PRIdLEAST64 PRId64
+#endif
+#if !defined PRIiLEAST64 || PRI_MACROS_BROKEN
+# undef PRIiLEAST64
+# define PRIiLEAST64 PRIi64
+#endif
+#if !defined PRIoLEAST64 || PRI_MACROS_BROKEN
+# undef PRIoLEAST64
+# define PRIoLEAST64 PRIo64
+#endif
+#if !defined PRIuLEAST64 || PRI_MACROS_BROKEN
+# undef PRIuLEAST64
+# define PRIuLEAST64 PRIu64
+#endif
+#if !defined PRIxLEAST64 || PRI_MACROS_BROKEN
+# undef PRIxLEAST64
+# define PRIxLEAST64 PRIx64
+#endif
+#if !defined PRIXLEAST64 || PRI_MACROS_BROKEN
+# undef PRIXLEAST64
+# define PRIXLEAST64 PRIX64
+#endif
+#if !defined PRIdFAST8 || PRI_MACROS_BROKEN
+# undef PRIdFAST8
+# define PRIdFAST8 "d"
+#endif
+#if !defined PRIiFAST8 || PRI_MACROS_BROKEN
+# undef PRIiFAST8
+# define PRIiFAST8 "i"
+#endif
+#if !defined PRIoFAST8 || PRI_MACROS_BROKEN
+# undef PRIoFAST8
+# define PRIoFAST8 "o"
+#endif
+#if !defined PRIuFAST8 || PRI_MACROS_BROKEN
+# undef PRIuFAST8
+# define PRIuFAST8 "u"
+#endif
+#if !defined PRIxFAST8 || PRI_MACROS_BROKEN
+# undef PRIxFAST8
+# define PRIxFAST8 "x"
+#endif
+#if !defined PRIXFAST8 || PRI_MACROS_BROKEN
+# undef PRIXFAST8
+# define PRIXFAST8 "X"
+#endif
+#if !defined PRIdFAST16 || PRI_MACROS_BROKEN
+# undef PRIdFAST16
+# define PRIdFAST16 "d"
+#endif
+#if !defined PRIiFAST16 || PRI_MACROS_BROKEN
+# undef PRIiFAST16
+# define PRIiFAST16 "i"
+#endif
+#if !defined PRIoFAST16 || PRI_MACROS_BROKEN
+# undef PRIoFAST16
+# define PRIoFAST16 "o"
+#endif
+#if !defined PRIuFAST16 || PRI_MACROS_BROKEN
+# undef PRIuFAST16
+# define PRIuFAST16 "u"
+#endif
+#if !defined PRIxFAST16 || PRI_MACROS_BROKEN
+# undef PRIxFAST16
+# define PRIxFAST16 "x"
+#endif
+#if !defined PRIXFAST16 || PRI_MACROS_BROKEN
+# undef PRIXFAST16
+# define PRIXFAST16 "X"
+#endif
+#if !defined PRIdFAST32 || PRI_MACROS_BROKEN
+# undef PRIdFAST32
+# define PRIdFAST32 "d"
+#endif
+#if !defined PRIiFAST32 || PRI_MACROS_BROKEN
+# undef PRIiFAST32
+# define PRIiFAST32 "i"
+#endif
+#if !defined PRIoFAST32 || PRI_MACROS_BROKEN
+# undef PRIoFAST32
+# define PRIoFAST32 "o"
+#endif
+#if !defined PRIuFAST32 || PRI_MACROS_BROKEN
+# undef PRIuFAST32
+# define PRIuFAST32 "u"
+#endif
+#if !defined PRIxFAST32 || PRI_MACROS_BROKEN
+# undef PRIxFAST32
+# define PRIxFAST32 "x"
+#endif
+#if !defined PRIXFAST32 || PRI_MACROS_BROKEN
+# undef PRIXFAST32
+# define PRIXFAST32 "X"
+#endif
+#if !defined PRIdFAST64 || PRI_MACROS_BROKEN
+# undef PRIdFAST64
+# define PRIdFAST64 PRId64
+#endif
+#if !defined PRIiFAST64 || PRI_MACROS_BROKEN
+# undef PRIiFAST64
+# define PRIiFAST64 PRIi64
+#endif
+#if !defined PRIoFAST64 || PRI_MACROS_BROKEN
+# undef PRIoFAST64
+# define PRIoFAST64 PRIo64
+#endif
+#if !defined PRIuFAST64 || PRI_MACROS_BROKEN
+# undef PRIuFAST64
+# define PRIuFAST64 PRIu64
+#endif
+#if !defined PRIxFAST64 || PRI_MACROS_BROKEN
+# undef PRIxFAST64
+# define PRIxFAST64 PRIx64
+#endif
+#if !defined PRIXFAST64 || PRI_MACROS_BROKEN
+# undef PRIXFAST64
+# define PRIXFAST64 PRIX64
+#endif
+#if !defined PRIdMAX || PRI_MACROS_BROKEN
+# undef PRIdMAX
+# define PRIdMAX (sizeof (uintmax_t) == sizeof (long) ? "ld" : "lld")
+#endif
+#if !defined PRIiMAX || PRI_MACROS_BROKEN
+# undef PRIiMAX
+# define PRIiMAX (sizeof (uintmax_t) == sizeof (long) ? "li" : "lli")
+#endif
+#if !defined PRIoMAX || PRI_MACROS_BROKEN
+# undef PRIoMAX
+# define PRIoMAX (sizeof (uintmax_t) == sizeof (long) ? "lo" : "llo")
+#endif
+#if !defined PRIuMAX || PRI_MACROS_BROKEN
+# undef PRIuMAX
+# define PRIuMAX (sizeof (uintmax_t) == sizeof (long) ? "lu" : "llu")
+#endif
+#if !defined PRIxMAX || PRI_MACROS_BROKEN
+# undef PRIxMAX
+# define PRIxMAX (sizeof (uintmax_t) == sizeof (long) ? "lx" : "llx")
+#endif
+#if !defined PRIXMAX || PRI_MACROS_BROKEN
+# undef PRIXMAX
+# define PRIXMAX (sizeof (uintmax_t) == sizeof (long) ? "lX" : "llX")
+#endif
+#if !defined PRIdPTR || PRI_MACROS_BROKEN
+# undef PRIdPTR
+# define PRIdPTR \
+ (sizeof (void *) == sizeof (long) ? "ld" : \
+ sizeof (void *) == sizeof (int) ? "d" : \
+ "lld")
+#endif
+#if !defined PRIiPTR || PRI_MACROS_BROKEN
+# undef PRIiPTR
+# define PRIiPTR \
+ (sizeof (void *) == sizeof (long) ? "li" : \
+ sizeof (void *) == sizeof (int) ? "i" : \
+ "lli")
+#endif
+#if !defined PRIoPTR || PRI_MACROS_BROKEN
+# undef PRIoPTR
+# define PRIoPTR \
+ (sizeof (void *) == sizeof (long) ? "lo" : \
+ sizeof (void *) == sizeof (int) ? "o" : \
+ "llo")
+#endif
+#if !defined PRIuPTR || PRI_MACROS_BROKEN
+# undef PRIuPTR
+# define PRIuPTR \
+ (sizeof (void *) == sizeof (long) ? "lu" : \
+ sizeof (void *) == sizeof (int) ? "u" : \
+ "llu")
+#endif
+#if !defined PRIxPTR || PRI_MACROS_BROKEN
+# undef PRIxPTR
+# define PRIxPTR \
+ (sizeof (void *) == sizeof (long) ? "lx" : \
+ sizeof (void *) == sizeof (int) ? "x" : \
+ "llx")
+#endif
+#if !defined PRIXPTR || PRI_MACROS_BROKEN
+# undef PRIXPTR
+# define PRIXPTR \
+ (sizeof (void *) == sizeof (long) ? "lX" : \
+ sizeof (void *) == sizeof (int) ? "X" : \
+ "llX")
+#endif
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ISO C functions. This is required by the standard
+ because some ISO C functions will require linking with this object
+ file and the name space must not be polluted. */
+# define open __open
+# define close __close
+# define read __read
+# define mmap __mmap
+# define munmap __munmap
+#endif
+
+/* For those losing systems which don't have `alloca' we have to add
+ some additional code emulating it. */
+#ifdef HAVE_ALLOCA
+# define freea(p) /* nothing */
+#else
+# define alloca(n) malloc (n)
+# define freea(p) free (p)
+#endif
+
+/* For systems that distinguish between text and binary I/O.
+ O_BINARY is usually declared in <fcntl.h>. */
+#if !defined O_BINARY && defined _O_BINARY
+ /* For MSC-compatible compilers. */
+# define O_BINARY _O_BINARY
+# define O_TEXT _O_TEXT
+#endif
+#ifdef __BEOS__
+ /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */
+# undef O_BINARY
+# undef O_TEXT
+#endif
+/* On reasonable systems, binary I/O is the default. */
+#ifndef O_BINARY
+# define O_BINARY 0
+#endif
+
+
+/* We need a sign, whether a new catalog was loaded, which can be associated
+ with all translations. This is important if the translations are
+ cached by one of GCC's features. */
+int _nl_msg_cat_cntr;
+
+
+/* Expand a system dependent string segment. Return NULL if unsupported. */
+static const char *
+get_sysdep_segment_value (const char *name)
+{
+ /* Test for an ISO C 99 section 7.8.1 format string directive.
+ Syntax:
+ P R I { d | i | o | u | x | X }
+ { { | LEAST | FAST } { 8 | 16 | 32 | 64 } | MAX | PTR } */
+ /* We don't use a table of 14 times 6 'const char *' strings here, because
+ data relocations cost startup time. */
+ if (name[0] == 'P' && name[1] == 'R' && name[2] == 'I')
+ {
+ if (name[3] == 'd' || name[3] == 'i' || name[3] == 'o' || name[3] == 'u'
+ || name[3] == 'x' || name[3] == 'X')
+ {
+ if (name[4] == '8' && name[5] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRId8;
+ if (name[3] == 'i')
+ return PRIi8;
+ if (name[3] == 'o')
+ return PRIo8;
+ if (name[3] == 'u')
+ return PRIu8;
+ if (name[3] == 'x')
+ return PRIx8;
+ if (name[3] == 'X')
+ return PRIX8;
+ abort ();
+ }
+ if (name[4] == '1' && name[5] == '6' && name[6] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRId16;
+ if (name[3] == 'i')
+ return PRIi16;
+ if (name[3] == 'o')
+ return PRIo16;
+ if (name[3] == 'u')
+ return PRIu16;
+ if (name[3] == 'x')
+ return PRIx16;
+ if (name[3] == 'X')
+ return PRIX16;
+ abort ();
+ }
+ if (name[4] == '3' && name[5] == '2' && name[6] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRId32;
+ if (name[3] == 'i')
+ return PRIi32;
+ if (name[3] == 'o')
+ return PRIo32;
+ if (name[3] == 'u')
+ return PRIu32;
+ if (name[3] == 'x')
+ return PRIx32;
+ if (name[3] == 'X')
+ return PRIX32;
+ abort ();
+ }
+ if (name[4] == '6' && name[5] == '4' && name[6] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRId64;
+ if (name[3] == 'i')
+ return PRIi64;
+ if (name[3] == 'o')
+ return PRIo64;
+ if (name[3] == 'u')
+ return PRIu64;
+ if (name[3] == 'x')
+ return PRIx64;
+ if (name[3] == 'X')
+ return PRIX64;
+ abort ();
+ }
+ if (name[4] == 'L' && name[5] == 'E' && name[6] == 'A'
+ && name[7] == 'S' && name[8] == 'T')
+ {
+ if (name[9] == '8' && name[10] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdLEAST8;
+ if (name[3] == 'i')
+ return PRIiLEAST8;
+ if (name[3] == 'o')
+ return PRIoLEAST8;
+ if (name[3] == 'u')
+ return PRIuLEAST8;
+ if (name[3] == 'x')
+ return PRIxLEAST8;
+ if (name[3] == 'X')
+ return PRIXLEAST8;
+ abort ();
+ }
+ if (name[9] == '1' && name[10] == '6' && name[11] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdLEAST16;
+ if (name[3] == 'i')
+ return PRIiLEAST16;
+ if (name[3] == 'o')
+ return PRIoLEAST16;
+ if (name[3] == 'u')
+ return PRIuLEAST16;
+ if (name[3] == 'x')
+ return PRIxLEAST16;
+ if (name[3] == 'X')
+ return PRIXLEAST16;
+ abort ();
+ }
+ if (name[9] == '3' && name[10] == '2' && name[11] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdLEAST32;
+ if (name[3] == 'i')
+ return PRIiLEAST32;
+ if (name[3] == 'o')
+ return PRIoLEAST32;
+ if (name[3] == 'u')
+ return PRIuLEAST32;
+ if (name[3] == 'x')
+ return PRIxLEAST32;
+ if (name[3] == 'X')
+ return PRIXLEAST32;
+ abort ();
+ }
+ if (name[9] == '6' && name[10] == '4' && name[11] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdLEAST64;
+ if (name[3] == 'i')
+ return PRIiLEAST64;
+ if (name[3] == 'o')
+ return PRIoLEAST64;
+ if (name[3] == 'u')
+ return PRIuLEAST64;
+ if (name[3] == 'x')
+ return PRIxLEAST64;
+ if (name[3] == 'X')
+ return PRIXLEAST64;
+ abort ();
+ }
+ }
+ if (name[4] == 'F' && name[5] == 'A' && name[6] == 'S'
+ && name[7] == 'T')
+ {
+ if (name[8] == '8' && name[9] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdFAST8;
+ if (name[3] == 'i')
+ return PRIiFAST8;
+ if (name[3] == 'o')
+ return PRIoFAST8;
+ if (name[3] == 'u')
+ return PRIuFAST8;
+ if (name[3] == 'x')
+ return PRIxFAST8;
+ if (name[3] == 'X')
+ return PRIXFAST8;
+ abort ();
+ }
+ if (name[8] == '1' && name[9] == '6' && name[10] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdFAST16;
+ if (name[3] == 'i')
+ return PRIiFAST16;
+ if (name[3] == 'o')
+ return PRIoFAST16;
+ if (name[3] == 'u')
+ return PRIuFAST16;
+ if (name[3] == 'x')
+ return PRIxFAST16;
+ if (name[3] == 'X')
+ return PRIXFAST16;
+ abort ();
+ }
+ if (name[8] == '3' && name[9] == '2' && name[10] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdFAST32;
+ if (name[3] == 'i')
+ return PRIiFAST32;
+ if (name[3] == 'o')
+ return PRIoFAST32;
+ if (name[3] == 'u')
+ return PRIuFAST32;
+ if (name[3] == 'x')
+ return PRIxFAST32;
+ if (name[3] == 'X')
+ return PRIXFAST32;
+ abort ();
+ }
+ if (name[8] == '6' && name[9] == '4' && name[10] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdFAST64;
+ if (name[3] == 'i')
+ return PRIiFAST64;
+ if (name[3] == 'o')
+ return PRIoFAST64;
+ if (name[3] == 'u')
+ return PRIuFAST64;
+ if (name[3] == 'x')
+ return PRIxFAST64;
+ if (name[3] == 'X')
+ return PRIXFAST64;
+ abort ();
+ }
+ }
+ if (name[4] == 'M' && name[5] == 'A' && name[6] == 'X'
+ && name[7] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdMAX;
+ if (name[3] == 'i')
+ return PRIiMAX;
+ if (name[3] == 'o')
+ return PRIoMAX;
+ if (name[3] == 'u')
+ return PRIuMAX;
+ if (name[3] == 'x')
+ return PRIxMAX;
+ if (name[3] == 'X')
+ return PRIXMAX;
+ abort ();
+ }
+ if (name[4] == 'P' && name[5] == 'T' && name[6] == 'R'
+ && name[7] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdPTR;
+ if (name[3] == 'i')
+ return PRIiPTR;
+ if (name[3] == 'o')
+ return PRIoPTR;
+ if (name[3] == 'u')
+ return PRIuPTR;
+ if (name[3] == 'x')
+ return PRIxPTR;
+ if (name[3] == 'X')
+ return PRIXPTR;
+ abort ();
+ }
+ }
+ }
+ /* Test for a glibc specific printf() format directive flag. */
+ if (name[0] == 'I' && name[1] == '\0')
+ {
+#if defined _LIBC || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
+ /* The 'I' flag, in numeric format directives, replaces ASCII digits
+ with the 'outdigits' defined in the LC_CTYPE locale facet. This is
+ used for Farsi (Persian) and maybe Arabic. */
+ return "I";
+#else
+ return "";
+#endif
+ }
+ /* Other system dependent strings are not valid. */
+ return NULL;
+}
+
+/* Initialize the codeset dependent parts of an opened message catalog.
+ Return the header entry. */
+const char *
+internal_function
+_nl_init_domain_conv (struct loaded_l10nfile *domain_file,
+ struct loaded_domain *domain,
+ struct binding *domainbinding)
+{
+ /* Find out about the character set the file is encoded with.
+ This can be found (in textual form) in the entry "". If this
+ entry does not exist or if this does not contain the `charset='
+ information, we will assume the charset matches the one the
+ current locale and we don't have to perform any conversion. */
+ char *nullentry;
+ size_t nullentrylen;
+
+ /* Preinitialize fields, to avoid recursion during _nl_find_msg. */
+ domain->codeset_cntr =
+ (domainbinding != NULL ? domainbinding->codeset_cntr : 0);
+#ifdef _LIBC
+ domain->conv = (__gconv_t) -1;
+#else
+# if HAVE_ICONV
+ domain->conv = (iconv_t) -1;
+# endif
+#endif
+ domain->conv_tab = NULL;
+
+ /* Get the header entry. */
+ nullentry = _nl_find_msg (domain_file, domainbinding, "", &nullentrylen);
+
+ if (nullentry != NULL)
+ {
+#if defined _LIBC || HAVE_ICONV
+ const char *charsetstr;
+
+ charsetstr = strstr (nullentry, "charset=");
+ if (charsetstr != NULL)
+ {
+ size_t len;
+ char *charset;
+ const char *outcharset;
+
+ charsetstr += strlen ("charset=");
+ len = strcspn (charsetstr, " \t\n");
+
+ charset = (char *) alloca (len + 1);
+# if defined _LIBC || HAVE_MEMPCPY
+ *((char *) mempcpy (charset, charsetstr, len)) = '\0';
+# else
+ memcpy (charset, charsetstr, len);
+ charset[len] = '\0';
+# endif
+
+ /* The output charset should normally be determined by the
+ locale. But sometimes the locale is not used or not correctly
+ set up, so we provide a possibility for the user to override
+ this. Moreover, the value specified through
+ bind_textdomain_codeset overrides both. */
+ if (domainbinding != NULL && domainbinding->codeset != NULL)
+ outcharset = domainbinding->codeset;
+ else
+ {
+ outcharset = getenv ("OUTPUT_CHARSET");
+ if (outcharset == NULL || outcharset[0] == '\0')
+ {
+# ifdef _LIBC
+ outcharset = _NL_CURRENT (LC_CTYPE, CODESET);
+# else
+# if HAVE_ICONV
+ extern const char *locale_charset (void);
+ outcharset = locale_charset ();
+# endif
+# endif
+ }
+ }
+
+# ifdef _LIBC
+ /* We always want to use transliteration. */
+ outcharset = norm_add_slashes (outcharset, "TRANSLIT");
+ charset = norm_add_slashes (charset, NULL);
+ if (__gconv_open (outcharset, charset, &domain->conv,
+ GCONV_AVOID_NOCONV)
+ != __GCONV_OK)
+ domain->conv = (__gconv_t) -1;
+# else
+# if HAVE_ICONV
+ /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5,
+ we want to use transliteration. */
+# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \
+ || _LIBICONV_VERSION >= 0x0105
+ if (strchr (outcharset, '/') == NULL)
+ {
+ char *tmp;
+
+ len = strlen (outcharset);
+ tmp = (char *) alloca (len + 10 + 1);
+ memcpy (tmp, outcharset, len);
+ memcpy (tmp + len, "//TRANSLIT", 10 + 1);
+ outcharset = tmp;
+
+ domain->conv = iconv_open (outcharset, charset);
+
+ freea (outcharset);
+ }
+ else
+# endif
+ domain->conv = iconv_open (outcharset, charset);
+# endif
+# endif
+
+ freea (charset);
+ }
+#endif /* _LIBC || HAVE_ICONV */
+ }
+
+ return nullentry;
+}
+
+/* Frees the codeset dependent parts of an opened message catalog. */
+void
+internal_function
+_nl_free_domain_conv (struct loaded_domain *domain)
+{
+ if (domain->conv_tab != NULL && domain->conv_tab != (char **) -1)
+ free (domain->conv_tab);
+
+#ifdef _LIBC
+ if (domain->conv != (__gconv_t) -1)
+ __gconv_close (domain->conv);
+#else
+# if HAVE_ICONV
+ if (domain->conv != (iconv_t) -1)
+ iconv_close (domain->conv);
+# endif
+#endif
+}
+
+/* Load the message catalogs specified by FILENAME. If it is no valid
+ message catalog do nothing. */
+void
+internal_function
+_nl_load_domain (struct loaded_l10nfile *domain_file,
+ struct binding *domainbinding)
+{
+ int fd;
+ size_t size;
+#ifdef _LIBC
+ struct stat64 st;
+#else
+ struct stat st;
+#endif
+ struct mo_file_header *data = (struct mo_file_header *) -1;
+ int use_mmap = 0;
+ struct loaded_domain *domain;
+ int revision;
+ const char *nullentry;
+
+ domain_file->decided = 1;
+ domain_file->data = NULL;
+
+ /* Note that it would be useless to store domainbinding in domain_file
+ because domainbinding might be == NULL now but != NULL later (after
+ a call to bind_textdomain_codeset). */
+
+ /* If the record does not represent a valid locale the FILENAME
+ might be NULL. This can happen when according to the given
+ specification the locale file name is different for XPG and CEN
+ syntax. */
+ if (domain_file->filename == NULL)
+ return;
+
+ /* Try to open the addressed file. */
+ fd = open (domain_file->filename, O_RDONLY | O_BINARY);
+ if (fd == -1)
+ return;
+
+ /* We must know about the size of the file. */
+ if (
+#ifdef _LIBC
+ __builtin_expect (fstat64 (fd, &st) != 0, 0)
+#else
+ __builtin_expect (fstat (fd, &st) != 0, 0)
+#endif
+ || __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0)
+ || __builtin_expect (size < sizeof (struct mo_file_header), 0))
+ {
+ /* Something went wrong. */
+ close (fd);
+ return;
+ }
+
+#ifdef HAVE_MMAP
+ /* Now we are ready to load the file. If mmap() is available we try
+ this first. If not available or it failed we try to load it. */
+ data = (struct mo_file_header *) mmap (NULL, size, PROT_READ,
+ MAP_PRIVATE, fd, 0);
+
+ if (__builtin_expect (data != (struct mo_file_header *) -1, 1))
+ {
+ /* mmap() call was successful. */
+ close (fd);
+ use_mmap = 1;
+ }
+#endif
+
+ /* If the data is not yet available (i.e. mmap'ed) we try to load
+ it manually. */
+ if (data == (struct mo_file_header *) -1)
+ {
+ size_t to_read;
+ char *read_ptr;
+
+ data = (struct mo_file_header *) malloc (size);
+ if (data == NULL)
+ return;
+
+ to_read = size;
+ read_ptr = (char *) data;
+ do
+ {
+ long int nb = (long int) read (fd, read_ptr, to_read);
+ if (nb <= 0)
+ {
+#ifdef EINTR
+ if (nb == -1 && errno == EINTR)
+ continue;
+#endif
+ close (fd);
+ return;
+ }
+ read_ptr += nb;
+ to_read -= nb;
+ }
+ while (to_read > 0);
+
+ close (fd);
+ }
+
+ /* Using the magic number we can test whether it really is a message
+ catalog file. */
+ if (__builtin_expect (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED,
+ 0))
+ {
+ /* The magic number is wrong: not a message catalog file. */
+#ifdef HAVE_MMAP
+ if (use_mmap)
+ munmap ((caddr_t) data, size);
+ else
+#endif
+ free (data);
+ return;
+ }
+
+ domain = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
+ if (domain == NULL)
+ return;
+ domain_file->data = domain;
+
+ domain->data = (char *) data;
+ domain->use_mmap = use_mmap;
+ domain->mmap_size = size;
+ domain->must_swap = data->magic != _MAGIC;
+ domain->malloced = NULL;
+
+ /* Fill in the information about the available tables. */
+ revision = W (domain->must_swap, data->revision);
+ /* We support only the major revisions 0 and 1. */
+ switch (revision >> 16)
+ {
+ case 0:
+ case 1:
+ domain->nstrings = W (domain->must_swap, data->nstrings);
+ domain->orig_tab = (const struct string_desc *)
+ ((char *) data + W (domain->must_swap, data->orig_tab_offset));
+ domain->trans_tab = (const struct string_desc *)
+ ((char *) data + W (domain->must_swap, data->trans_tab_offset));
+ domain->hash_size = W (domain->must_swap, data->hash_tab_size);
+ domain->hash_tab =
+ (domain->hash_size > 2
+ ? (const nls_uint32 *)
+ ((char *) data + W (domain->must_swap, data->hash_tab_offset))
+ : NULL);
+ domain->must_swap_hash_tab = domain->must_swap;
+
+ /* Now dispatch on the minor revision. */
+ switch (revision & 0xffff)
+ {
+ case 0:
+ domain->n_sysdep_strings = 0;
+ domain->orig_sysdep_tab = NULL;
+ domain->trans_sysdep_tab = NULL;
+ break;
+ case 1:
+ default:
+ {
+ nls_uint32 n_sysdep_strings;
+
+ if (domain->hash_tab == NULL)
+ /* This is invalid. These minor revisions need a hash table. */
+ goto invalid;
+
+ n_sysdep_strings =
+ W (domain->must_swap, data->n_sysdep_strings);
+ if (n_sysdep_strings > 0)
+ {
+ nls_uint32 n_sysdep_segments;
+ const struct sysdep_segment *sysdep_segments;
+ const char **sysdep_segment_values;
+ const nls_uint32 *orig_sysdep_tab;
+ const nls_uint32 *trans_sysdep_tab;
+ nls_uint32 n_inmem_sysdep_strings;
+ size_t memneed;
+ char *mem;
+ struct sysdep_string_desc *inmem_orig_sysdep_tab;
+ struct sysdep_string_desc *inmem_trans_sysdep_tab;
+ nls_uint32 *inmem_hash_tab;
+ unsigned int i, j;
+
+ /* Get the values of the system dependent segments. */
+ n_sysdep_segments =
+ W (domain->must_swap, data->n_sysdep_segments);
+ sysdep_segments = (const struct sysdep_segment *)
+ ((char *) data
+ + W (domain->must_swap, data->sysdep_segments_offset));
+ sysdep_segment_values =
+ alloca (n_sysdep_segments * sizeof (const char *));
+ for (i = 0; i < n_sysdep_segments; i++)
+ {
+ const char *name =
+ (char *) data
+ + W (domain->must_swap, sysdep_segments[i].offset);
+ nls_uint32 namelen =
+ W (domain->must_swap, sysdep_segments[i].length);
+
+ if (!(namelen > 0 && name[namelen - 1] == '\0'))
+ {
+ freea (sysdep_segment_values);
+ goto invalid;
+ }
+
+ sysdep_segment_values[i] = get_sysdep_segment_value (name);
+ }
+
+ orig_sysdep_tab = (const nls_uint32 *)
+ ((char *) data
+ + W (domain->must_swap, data->orig_sysdep_tab_offset));
+ trans_sysdep_tab = (const nls_uint32 *)
+ ((char *) data
+ + W (domain->must_swap, data->trans_sysdep_tab_offset));
+
+ /* Compute the amount of additional memory needed for the
+ system dependent strings and the augmented hash table.
+ At the same time, also drop string pairs which refer to
+ an undefined system dependent segment. */
+ n_inmem_sysdep_strings = 0;
+ memneed = domain->hash_size * sizeof (nls_uint32);
+ for (i = 0; i < n_sysdep_strings; i++)
+ {
+ int valid = 1;
+ size_t needs[2];
+
+ for (j = 0; j < 2; j++)
+ {
+ const struct sysdep_string *sysdep_string =
+ (const struct sysdep_string *)
+ ((char *) data
+ + W (domain->must_swap,
+ j == 0
+ ? orig_sysdep_tab[i]
+ : trans_sysdep_tab[i]));
+ size_t need = 0;
+ const struct segment_pair *p = sysdep_string->segments;
+
+ if (W (domain->must_swap, p->sysdepref) != SEGMENTS_END)
+ for (p = sysdep_string->segments;; p++)
+ {
+ nls_uint32 sysdepref;
+
+ need += W (domain->must_swap, p->segsize);
+
+ sysdepref = W (domain->must_swap, p->sysdepref);
+ if (sysdepref == SEGMENTS_END)
+ break;
+
+ if (sysdepref >= n_sysdep_segments)
+ {
+ /* Invalid. */
+ freea (sysdep_segment_values);
+ goto invalid;
+ }
+
+ if (sysdep_segment_values[sysdepref] == NULL)
+ {
+ /* This particular string pair is invalid. */
+ valid = 0;
+ break;
+ }
+
+ need += strlen (sysdep_segment_values[sysdepref]);
+ }
+
+ needs[j] = need;
+ if (!valid)
+ break;
+ }
+
+ if (valid)
+ {
+ n_inmem_sysdep_strings++;
+ memneed += needs[0] + needs[1];
+ }
+ }
+ memneed += 2 * n_inmem_sysdep_strings
+ * sizeof (struct sysdep_string_desc);
+
+ if (n_inmem_sysdep_strings > 0)
+ {
+ unsigned int k;
+
+ /* Allocate additional memory. */
+ mem = (char *) malloc (memneed);
+ if (mem == NULL)
+ goto invalid;
+
+ domain->malloced = mem;
+ inmem_orig_sysdep_tab = (struct sysdep_string_desc *) mem;
+ mem += n_inmem_sysdep_strings
+ * sizeof (struct sysdep_string_desc);
+ inmem_trans_sysdep_tab = (struct sysdep_string_desc *) mem;
+ mem += n_inmem_sysdep_strings
+ * sizeof (struct sysdep_string_desc);
+ inmem_hash_tab = (nls_uint32 *) mem;
+ mem += domain->hash_size * sizeof (nls_uint32);
+
+ /* Compute the system dependent strings. */
+ k = 0;
+ for (i = 0; i < n_sysdep_strings; i++)
+ {
+ int valid = 1;
+
+ for (j = 0; j < 2; j++)
+ {
+ const struct sysdep_string *sysdep_string =
+ (const struct sysdep_string *)
+ ((char *) data
+ + W (domain->must_swap,
+ j == 0
+ ? orig_sysdep_tab[i]
+ : trans_sysdep_tab[i]));
+ const struct segment_pair *p =
+ sysdep_string->segments;
+
+ if (W (domain->must_swap, p->sysdepref)
+ != SEGMENTS_END)
+ for (p = sysdep_string->segments;; p++)
+ {
+ nls_uint32 sysdepref;
+
+ sysdepref =
+ W (domain->must_swap, p->sysdepref);
+ if (sysdepref == SEGMENTS_END)
+ break;
+
+ if (sysdep_segment_values[sysdepref] == NULL)
+ {
+ /* This particular string pair is
+ invalid. */
+ valid = 0;
+ break;
+ }
+ }
+
+ if (!valid)
+ break;
+ }
+
+ if (valid)
+ {
+ for (j = 0; j < 2; j++)
+ {
+ const struct sysdep_string *sysdep_string =
+ (const struct sysdep_string *)
+ ((char *) data
+ + W (domain->must_swap,
+ j == 0
+ ? orig_sysdep_tab[i]
+ : trans_sysdep_tab[i]));
+ const char *static_segments =
+ (char *) data
+ + W (domain->must_swap, sysdep_string->offset);
+ const struct segment_pair *p =
+ sysdep_string->segments;
+
+ /* Concatenate the segments, and fill
+ inmem_orig_sysdep_tab[k] (for j == 0) and
+ inmem_trans_sysdep_tab[k] (for j == 1). */
+
+ struct sysdep_string_desc *inmem_tab_entry =
+ (j == 0
+ ? inmem_orig_sysdep_tab
+ : inmem_trans_sysdep_tab)
+ + k;
+
+ if (W (domain->must_swap, p->sysdepref)
+ == SEGMENTS_END)
+ {
+ /* Only one static segment. */
+ inmem_tab_entry->length =
+ W (domain->must_swap, p->segsize);
+ inmem_tab_entry->pointer = static_segments;
+ }
+ else
+ {
+ inmem_tab_entry->pointer = mem;
+
+ for (p = sysdep_string->segments;; p++)
+ {
+ nls_uint32 segsize =
+ W (domain->must_swap, p->segsize);
+ nls_uint32 sysdepref =
+ W (domain->must_swap, p->sysdepref);
+ size_t n;
+
+ if (segsize > 0)
+ {
+ memcpy (mem, static_segments, segsize);
+ mem += segsize;
+ static_segments += segsize;
+ }
+
+ if (sysdepref == SEGMENTS_END)
+ break;
+
+ n = strlen (sysdep_segment_values[sysdepref]);
+ memcpy (mem, sysdep_segment_values[sysdepref], n);
+ mem += n;
+ }
+
+ inmem_tab_entry->length =
+ mem - inmem_tab_entry->pointer;
+ }
+ }
+
+ k++;
+ }
+ }
+ if (k != n_inmem_sysdep_strings)
+ abort ();
+
+ /* Compute the augmented hash table. */
+ for (i = 0; i < domain->hash_size; i++)
+ inmem_hash_tab[i] =
+ W (domain->must_swap_hash_tab, domain->hash_tab[i]);
+ for (i = 0; i < n_inmem_sysdep_strings; i++)
+ {
+ const char *msgid = inmem_orig_sysdep_tab[i].pointer;
+ nls_uint32 hash_val = hash_string (msgid);
+ nls_uint32 idx = hash_val % domain->hash_size;
+ nls_uint32 incr =
+ 1 + (hash_val % (domain->hash_size - 2));
+
+ for (;;)
+ {
+ if (inmem_hash_tab[idx] == 0)
+ {
+ /* Hash table entry is empty. Use it. */
+ inmem_hash_tab[idx] = 1 + domain->nstrings + i;
+ break;
+ }
+
+ if (idx >= domain->hash_size - incr)
+ idx -= domain->hash_size - incr;
+ else
+ idx += incr;
+ }
+ }
+
+ domain->n_sysdep_strings = n_inmem_sysdep_strings;
+ domain->orig_sysdep_tab = inmem_orig_sysdep_tab;
+ domain->trans_sysdep_tab = inmem_trans_sysdep_tab;
+
+ domain->hash_tab = inmem_hash_tab;
+ domain->must_swap_hash_tab = 0;
+ }
+ else
+ {
+ domain->n_sysdep_strings = 0;
+ domain->orig_sysdep_tab = NULL;
+ domain->trans_sysdep_tab = NULL;
+ }
+
+ freea (sysdep_segment_values);
+ }
+ else
+ {
+ domain->n_sysdep_strings = 0;
+ domain->orig_sysdep_tab = NULL;
+ domain->trans_sysdep_tab = NULL;
+ }
+ }
+ break;
+ }
+ break;
+ default:
+ /* This is an invalid revision. */
+ invalid:
+ /* This is an invalid .mo file. */
+ if (domain->malloced)
+ free (domain->malloced);
+#ifdef HAVE_MMAP
+ if (use_mmap)
+ munmap ((caddr_t) data, size);
+ else
+#endif
+ free (data);
+ free (domain);
+ domain_file->data = NULL;
+ return;
+ }
+
+ /* Now initialize the character set converter from the character set
+ the file is encoded with (found in the header entry) to the domain's
+ specified character set or the locale's character set. */
+ nullentry = _nl_init_domain_conv (domain_file, domain, domainbinding);
+
+ /* Also look for a plural specification. */
+ EXTRACT_PLURAL_EXPRESSION (nullentry, &domain->plural, &domain->nplurals);
+}
+
+
+#ifdef _LIBC
+void
+internal_function
+_nl_unload_domain (struct loaded_domain *domain)
+{
+ if (domain->plural != &__gettext_germanic_plural)
+ __gettext_free_exp (domain->plural);
+
+ _nl_free_domain_conv (domain);
+
+ if (domain->malloced)
+ free (domain->malloced);
+
+# ifdef _POSIX_MAPPED_FILES
+ if (domain->use_mmap)
+ munmap ((caddr_t) domain->data, domain->mmap_size);
+ else
+# endif /* _POSIX_MAPPED_FILES */
+ free ((void *) domain->data);
+
+ free (domain);
+}
+#endif
--- /dev/null
+/* Determine a canonical name for the current locale's character encoding.
+
+ Copyright (C) 2000-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+/* Written by Bruno Haible <bruno@clisp.org>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification. */
+#include "localcharset.h"
+
+#if HAVE_STDDEF_H
+# include <stddef.h>
+#endif
+
+#include <stdio.h>
+#if HAVE_STRING_H
+# include <string.h>
+#else
+# include <strings.h>
+#endif
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#if defined _WIN32 || defined __WIN32__
+# undef WIN32 /* avoid warning on mingw32 */
+# define WIN32
+#endif
+
+#if defined __EMX__
+/* Assume EMX program runs on OS/2, even if compiled under DOS. */
+# define OS2
+#endif
+
+#if !defined WIN32
+# if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+# else
+# if HAVE_SETLOCALE
+# include <locale.h>
+# endif
+# endif
+#elif defined WIN32
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+#if defined OS2
+# define INCL_DOS
+# include <os2.h>
+#endif
+
+#if ENABLE_RELOCATABLE
+# include "relocatable.h"
+#else
+# define relocate(pathname) (pathname)
+#endif
+
+#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
+ /* Win32, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+#endif
+
+#ifndef DIRECTORY_SEPARATOR
+# define DIRECTORY_SEPARATOR '/'
+#endif
+
+#ifndef ISSLASH
+# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
+#endif
+
+#if HAVE_DECL_GETC_UNLOCKED
+# undef getc
+# define getc getc_unlocked
+#endif
+
+/* The following static variable is declared 'volatile' to avoid a
+ possible multithread problem in the function get_charset_aliases. If we
+ are running in a threaded environment, and if two threads initialize
+ 'charset_aliases' simultaneously, both will produce the same value,
+ and everything will be ok if the two assignments to 'charset_aliases'
+ are atomic. But I don't know what will happen if the two assignments mix. */
+#if __STDC__ != 1
+# define volatile /* empty */
+#endif
+/* Pointer to the contents of the charset.alias file, if it has already been
+ read, else NULL. Its format is:
+ ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */
+static const char * volatile charset_aliases;
+
+/* Return a pointer to the contents of the charset.alias file. */
+static const char *
+get_charset_aliases ()
+{
+ const char *cp;
+
+ cp = charset_aliases;
+ if (cp == NULL)
+ {
+#if !(defined VMS || defined WIN32)
+ FILE *fp;
+ const char *dir = relocate (LIBDIR);
+ const char *base = "charset.alias";
+ char *file_name;
+
+ /* Concatenate dir and base into freshly allocated file_name. */
+ {
+ size_t dir_len = strlen (dir);
+ size_t base_len = strlen (base);
+ int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
+ file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
+ if (file_name != NULL)
+ {
+ memcpy (file_name, dir, dir_len);
+ if (add_slash)
+ file_name[dir_len] = DIRECTORY_SEPARATOR;
+ memcpy (file_name + dir_len + add_slash, base, base_len + 1);
+ }
+ }
+
+ if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL)
+ /* Out of memory or file not found, treat it as empty. */
+ cp = "";
+ else
+ {
+ /* Parse the file's contents. */
+ int c;
+ char buf1[50+1];
+ char buf2[50+1];
+ char *res_ptr = NULL;
+ size_t res_size = 0;
+ size_t l1, l2;
+
+ for (;;)
+ {
+ c = getc (fp);
+ if (c == EOF)
+ break;
+ if (c == '\n' || c == ' ' || c == '\t')
+ continue;
+ if (c == '#')
+ {
+ /* Skip comment, to end of line. */
+ do
+ c = getc (fp);
+ while (!(c == EOF || c == '\n'));
+ if (c == EOF)
+ break;
+ continue;
+ }
+ ungetc (c, fp);
+ if (fscanf (fp, "%50s %50s", buf1, buf2) < 2)
+ break;
+ l1 = strlen (buf1);
+ l2 = strlen (buf2);
+ if (res_size == 0)
+ {
+ res_size = l1 + 1 + l2 + 1;
+ res_ptr = (char *) malloc (res_size + 1);
+ }
+ else
+ {
+ res_size += l1 + 1 + l2 + 1;
+ res_ptr = (char *) realloc (res_ptr, res_size + 1);
+ }
+ if (res_ptr == NULL)
+ {
+ /* Out of memory. */
+ res_size = 0;
+ break;
+ }
+ strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
+ strcpy (res_ptr + res_size - (l2 + 1), buf2);
+ }
+ fclose (fp);
+ if (res_size == 0)
+ cp = "";
+ else
+ {
+ *(res_ptr + res_size) = '\0';
+ cp = res_ptr;
+ }
+ }
+
+ if (file_name != NULL)
+ free (file_name);
+
+#else
+
+# if defined VMS
+ /* To avoid the troubles of an extra file charset.alias_vms in the
+ sources of many GNU packages, simply inline the aliases here. */
+ /* The list of encodings is taken from the OpenVMS 7.3-1 documentation
+ "Compaq C Run-Time Library Reference Manual for OpenVMS systems"
+ section 10.7 "Handling Different Character Sets". */
+ cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
+ "ISO8859-2" "\0" "ISO-8859-2" "\0"
+ "ISO8859-5" "\0" "ISO-8859-5" "\0"
+ "ISO8859-7" "\0" "ISO-8859-7" "\0"
+ "ISO8859-8" "\0" "ISO-8859-8" "\0"
+ "ISO8859-9" "\0" "ISO-8859-9" "\0"
+ /* Japanese */
+ "eucJP" "\0" "EUC-JP" "\0"
+ "SJIS" "\0" "SHIFT_JIS" "\0"
+ "DECKANJI" "\0" "DEC-KANJI" "\0"
+ "SDECKANJI" "\0" "EUC-JP" "\0"
+ /* Chinese */
+ "eucTW" "\0" "EUC-TW" "\0"
+ "DECHANYU" "\0" "DEC-HANYU" "\0"
+ "DECHANZI" "\0" "GB2312" "\0"
+ /* Korean */
+ "DECKOREAN" "\0" "EUC-KR" "\0";
+# endif
+
+# if defined WIN32
+ /* To avoid the troubles of installing a separate file in the same
+ directory as the DLL and of retrieving the DLL's directory at
+ runtime, simply inline the aliases here. */
+
+ cp = "CP936" "\0" "GBK" "\0"
+ "CP1361" "\0" "JOHAB" "\0"
+ "CP20127" "\0" "ASCII" "\0"
+ "CP20866" "\0" "KOI8-R" "\0"
+ "CP21866" "\0" "KOI8-RU" "\0"
+ "CP28591" "\0" "ISO-8859-1" "\0"
+ "CP28592" "\0" "ISO-8859-2" "\0"
+ "CP28593" "\0" "ISO-8859-3" "\0"
+ "CP28594" "\0" "ISO-8859-4" "\0"
+ "CP28595" "\0" "ISO-8859-5" "\0"
+ "CP28596" "\0" "ISO-8859-6" "\0"
+ "CP28597" "\0" "ISO-8859-7" "\0"
+ "CP28598" "\0" "ISO-8859-8" "\0"
+ "CP28599" "\0" "ISO-8859-9" "\0"
+ "CP28605" "\0" "ISO-8859-15" "\0";
+# endif
+#endif
+
+ charset_aliases = cp;
+ }
+
+ return cp;
+}
+
+/* Determine the current locale's character encoding, and canonicalize it
+ into one of the canonical names listed in config.charset.
+ The result must not be freed; it is statically allocated.
+ If the canonical name cannot be determined, the result is a non-canonical
+ name. */
+
+#ifdef STATIC
+STATIC
+#endif
+const char *
+locale_charset ()
+{
+ const char *codeset;
+ const char *aliases;
+
+#if !(defined WIN32 || defined OS2)
+
+# if HAVE_LANGINFO_CODESET
+
+ /* Most systems support nl_langinfo (CODESET) nowadays. */
+ codeset = nl_langinfo (CODESET);
+
+# else
+
+ /* On old systems which lack it, use setlocale or getenv. */
+ const char *locale = NULL;
+
+ /* But most old systems don't have a complete set of locales. Some
+ (like SunOS 4 or DJGPP) have only the C locale. Therefore we don't
+ use setlocale here; it would return "C" when it doesn't support the
+ locale name the user has set. */
+# if HAVE_SETLOCALE && 0
+ locale = setlocale (LC_CTYPE, NULL);
+# endif
+ if (locale == NULL || locale[0] == '\0')
+ {
+ locale = getenv ("LC_ALL");
+ if (locale == NULL || locale[0] == '\0')
+ {
+ locale = getenv ("LC_CTYPE");
+ if (locale == NULL || locale[0] == '\0')
+ locale = getenv ("LANG");
+ }
+ }
+
+ /* On some old systems, one used to set locale = "iso8859_1". On others,
+ you set it to "language_COUNTRY.charset". In any case, we resolve it
+ through the charset.alias file. */
+ codeset = locale;
+
+# endif
+
+#elif defined WIN32
+
+ static char buf[2 + 10 + 1];
+
+ /* Woe32 has a function returning the locale's codepage as a number. */
+ sprintf (buf, "CP%u", GetACP ());
+ codeset = buf;
+
+#elif defined OS2
+
+ const char *locale;
+ static char buf[2 + 10 + 1];
+ ULONG cp[3];
+ ULONG cplen;
+
+ /* Allow user to override the codeset, as set in the operating system,
+ with standard language environment variables. */
+ locale = getenv ("LC_ALL");
+ if (locale == NULL || locale[0] == '\0')
+ {
+ locale = getenv ("LC_CTYPE");
+ if (locale == NULL || locale[0] == '\0')
+ locale = getenv ("LANG");
+ }
+ if (locale != NULL && locale[0] != '\0')
+ {
+ /* If the locale name contains an encoding after the dot, return it. */
+ const char *dot = strchr (locale, '.');
+
+ if (dot != NULL)
+ {
+ const char *modifier;
+
+ dot++;
+ /* Look for the possible @... trailer and remove it, if any. */
+ modifier = strchr (dot, '@');
+ if (modifier == NULL)
+ return dot;
+ if (modifier - dot < sizeof (buf))
+ {
+ memcpy (buf, dot, modifier - dot);
+ buf [modifier - dot] = '\0';
+ return buf;
+ }
+ }
+
+ /* Resolve through the charset.alias file. */
+ codeset = locale;
+ }
+ else
+ {
+ /* OS/2 has a function returning the locale's codepage as a number. */
+ if (DosQueryCp (sizeof (cp), cp, &cplen))
+ codeset = "";
+ else
+ {
+ sprintf (buf, "CP%u", cp[0]);
+ codeset = buf;
+ }
+ }
+
+#endif
+
+ if (codeset == NULL)
+ /* The canonical name cannot be determined. */
+ codeset = "";
+
+ /* Resolve alias. */
+ for (aliases = get_charset_aliases ();
+ *aliases != '\0';
+ aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
+ if (strcmp (codeset, aliases) == 0
+ || (aliases[0] == '*' && aliases[1] == '\0'))
+ {
+ codeset = aliases + strlen (aliases) + 1;
+ break;
+ }
+
+ /* Don't return an empty string. GNU libc and GNU libiconv interpret
+ the empty string as denoting "the locale's character encoding",
+ thus GNU libiconv would call this function a second time. */
+ if (codeset[0] == '\0')
+ codeset = "ASCII";
+
+ return codeset;
+}
--- /dev/null
+/* Determine a canonical name for the current locale's character encoding.
+ Copyright (C) 2000-2003 Free Software Foundation, Inc.
+ This file is part of the GNU CHARSET Library.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _LOCALCHARSET_H
+#define _LOCALCHARSET_H
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Determine the current locale's character encoding, and canonicalize it
+ into one of the canonical names listed in config.charset.
+ The result must not be freed; it is statically allocated.
+ If the canonical name cannot be determined, the result is a non-canonical
+ name. */
+extern const char * locale_charset (void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _LOCALCHARSET_H */
--- /dev/null
+# Locale name alias data base.
+# Copyright (C) 1996-2001,2003 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Library General Public License as published
+# by the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library 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 format of this file is the same as for the corresponding file of
+# the X Window System, which normally can be found in
+# /usr/lib/X11/locale/locale.alias
+# A single line contains two fields: an alias and a substitution value.
+# All entries are case independent.
+
+# Note: This file is far from being complete. If you have a value for
+# your own site which you think might be useful for others too, share
+# it with the rest of us. Send it using the `glibcbug' script to
+# bugs@gnu.org.
+
+# Packages using this file:
+
+bokmal nb_NO.ISO-8859-1
+bokmål nb_NO.ISO-8859-1
+catalan ca_ES.ISO-8859-1
+croatian hr_HR.ISO-8859-2
+czech cs_CZ.ISO-8859-2
+danish da_DK.ISO-8859-1
+dansk da_DK.ISO-8859-1
+deutsch de_DE.ISO-8859-1
+dutch nl_NL.ISO-8859-1
+eesti et_EE.ISO-8859-1
+estonian et_EE.ISO-8859-1
+finnish fi_FI.ISO-8859-1
+français fr_FR.ISO-8859-1
+french fr_FR.ISO-8859-1
+galego gl_ES.ISO-8859-1
+galician gl_ES.ISO-8859-1
+german de_DE.ISO-8859-1
+greek el_GR.ISO-8859-7
+hebrew he_IL.ISO-8859-8
+hrvatski hr_HR.ISO-8859-2
+hungarian hu_HU.ISO-8859-2
+icelandic is_IS.ISO-8859-1
+italian it_IT.ISO-8859-1
+japanese ja_JP.eucJP
+japanese.euc ja_JP.eucJP
+ja_JP ja_JP.eucJP
+ja_JP.ujis ja_JP.eucJP
+japanese.sjis ja_JP.SJIS
+korean ko_KR.eucKR
+korean.euc ko_KR.eucKR
+ko_KR ko_KR.eucKR
+lithuanian lt_LT.ISO-8859-13
+no_NO nb_NO.ISO-8859-1
+no_NO.ISO-8859-1 nb_NO.ISO-8859-1
+norwegian nb_NO.ISO-8859-1
+nynorsk nn_NO.ISO-8859-1
+polish pl_PL.ISO-8859-2
+portuguese pt_PT.ISO-8859-1
+romanian ro_RO.ISO-8859-2
+russian ru_RU.ISO-8859-5
+slovak sk_SK.ISO-8859-2
+slovene sl_SI.ISO-8859-2
+slovenian sl_SI.ISO-8859-2
+spanish es_ES.ISO-8859-1
+swedish sv_SE.ISO-8859-1
+thai th_TH.TIS-620
+turkish tr_TR.ISO-8859-9
--- /dev/null
+/* Handle aliases for locale names.
+ Copyright (C) 1995-1999, 2000-2001, 2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+/* Tell glibc's <string.h> to provide a prototype for mempcpy().
+ This must come before <config.h> because <config.h> may include
+ <features.h>, and once <features.h> has been included, it's too late. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <ctype.h>
+#include <stdio.h>
+#if defined _LIBC || defined HAVE___FSETLOCKING
+# include <stdio_ext.h>
+#endif
+#include <sys/types.h>
+
+#ifdef __GNUC__
+# undef alloca
+# define alloca __builtin_alloca
+# define HAVE_ALLOCA 1
+#else
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# if defined HAVE_ALLOCA_H || defined _LIBC
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca
+char *alloca ();
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "gettextP.h"
+
+#if ENABLE_RELOCATABLE
+# include "relocatable.h"
+#else
+# define relocate(pathname) (pathname)
+#endif
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ANSI C functions. This is required by the standard
+ because some ANSI C functions will require linking with this object
+ file and the name space must not be polluted. */
+# define strcasecmp __strcasecmp
+
+# ifndef mempcpy
+# define mempcpy __mempcpy
+# endif
+# define HAVE_MEMPCPY 1
+# define HAVE___FSETLOCKING 1
+
+/* We need locking here since we can be called from different places. */
+# include <bits/libc-lock.h>
+
+__libc_lock_define_initialized (static, lock);
+#endif
+
+#ifndef internal_function
+# define internal_function
+#endif
+
+/* Some optimizations for glibc. */
+#ifdef _LIBC
+# define FEOF(fp) feof_unlocked (fp)
+# define FGETS(buf, n, fp) fgets_unlocked (buf, n, fp)
+#else
+# define FEOF(fp) feof (fp)
+# define FGETS(buf, n, fp) fgets (buf, n, fp)
+#endif
+
+/* For those losing systems which don't have `alloca' we have to add
+ some additional code emulating it. */
+#ifdef HAVE_ALLOCA
+# define freea(p) /* nothing */
+#else
+# define alloca(n) malloc (n)
+# define freea(p) free (p)
+#endif
+
+#if defined _LIBC_REENTRANT || HAVE_DECL_FGETS_UNLOCKED
+# undef fgets
+# define fgets(buf, len, s) fgets_unlocked (buf, len, s)
+#endif
+#if defined _LIBC_REENTRANT || HAVE_DECL_FEOF_UNLOCKED
+# undef feof
+# define feof(s) feof_unlocked (s)
+#endif
+
+
+struct alias_map
+{
+ const char *alias;
+ const char *value;
+};
+
+
+#ifndef _LIBC
+# define libc_freeres_ptr(decl) decl
+#endif
+
+libc_freeres_ptr (static char *string_space);
+static size_t string_space_act;
+static size_t string_space_max;
+libc_freeres_ptr (static struct alias_map *map);
+static size_t nmap;
+static size_t maxmap;
+
+
+/* Prototypes for local functions. */
+static size_t read_alias_file (const char *fname, int fname_len)
+ internal_function;
+static int extend_alias_table (void);
+static int alias_compare (const struct alias_map *map1,
+ const struct alias_map *map2);
+
+
+const char *
+_nl_expand_alias (const char *name)
+{
+ static const char *locale_alias_path;
+ struct alias_map *retval;
+ const char *result = NULL;
+ size_t added;
+
+#ifdef _LIBC
+ __libc_lock_lock (lock);
+#endif
+
+ if (locale_alias_path == NULL)
+ locale_alias_path = LOCALE_ALIAS_PATH;
+
+ do
+ {
+ struct alias_map item;
+
+ item.alias = name;
+
+ if (nmap > 0)
+ retval = (struct alias_map *) bsearch (&item, map, nmap,
+ sizeof (struct alias_map),
+ (int (*) (const void *,
+ const void *)
+ ) alias_compare);
+ else
+ retval = NULL;
+
+ /* We really found an alias. Return the value. */
+ if (retval != NULL)
+ {
+ result = retval->value;
+ break;
+ }
+
+ /* Perhaps we can find another alias file. */
+ added = 0;
+ while (added == 0 && locale_alias_path[0] != '\0')
+ {
+ const char *start;
+
+ while (locale_alias_path[0] == PATH_SEPARATOR)
+ ++locale_alias_path;
+ start = locale_alias_path;
+
+ while (locale_alias_path[0] != '\0'
+ && locale_alias_path[0] != PATH_SEPARATOR)
+ ++locale_alias_path;
+
+ if (start < locale_alias_path)
+ added = read_alias_file (start, locale_alias_path - start);
+ }
+ }
+ while (added != 0);
+
+#ifdef _LIBC
+ __libc_lock_unlock (lock);
+#endif
+
+ return result;
+}
+
+
+static size_t
+internal_function
+read_alias_file (const char *fname, int fname_len)
+{
+ FILE *fp;
+ char *full_fname;
+ size_t added;
+ static const char aliasfile[] = "/locale.alias";
+
+ full_fname = (char *) alloca (fname_len + sizeof aliasfile);
+#ifdef HAVE_MEMPCPY
+ mempcpy (mempcpy (full_fname, fname, fname_len),
+ aliasfile, sizeof aliasfile);
+#else
+ memcpy (full_fname, fname, fname_len);
+ memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile);
+#endif
+
+ fp = fopen (relocate (full_fname), "r");
+ freea (full_fname);
+ if (fp == NULL)
+ return 0;
+
+#ifdef HAVE___FSETLOCKING
+ /* No threads present. */
+ __fsetlocking (fp, FSETLOCKING_BYCALLER);
+#endif
+
+ added = 0;
+ while (!FEOF (fp))
+ {
+ /* It is a reasonable approach to use a fix buffer here because
+ a) we are only interested in the first two fields
+ b) these fields must be usable as file names and so must not
+ be that long
+ We avoid a multi-kilobyte buffer here since this would use up
+ stack space which we might not have if the program ran out of
+ memory. */
+ char buf[400];
+ char *alias;
+ char *value;
+ char *cp;
+
+ if (FGETS (buf, sizeof buf, fp) == NULL)
+ /* EOF reached. */
+ break;
+
+ cp = buf;
+ /* Ignore leading white space. */
+ while (isspace ((unsigned char) cp[0]))
+ ++cp;
+
+ /* A leading '#' signals a comment line. */
+ if (cp[0] != '\0' && cp[0] != '#')
+ {
+ alias = cp++;
+ while (cp[0] != '\0' && !isspace ((unsigned char) cp[0]))
+ ++cp;
+ /* Terminate alias name. */
+ if (cp[0] != '\0')
+ *cp++ = '\0';
+
+ /* Now look for the beginning of the value. */
+ while (isspace ((unsigned char) cp[0]))
+ ++cp;
+
+ if (cp[0] != '\0')
+ {
+ size_t alias_len;
+ size_t value_len;
+
+ value = cp++;
+ while (cp[0] != '\0' && !isspace ((unsigned char) cp[0]))
+ ++cp;
+ /* Terminate value. */
+ if (cp[0] == '\n')
+ {
+ /* This has to be done to make the following test
+ for the end of line possible. We are looking for
+ the terminating '\n' which do not overwrite here. */
+ *cp++ = '\0';
+ *cp = '\n';
+ }
+ else if (cp[0] != '\0')
+ *cp++ = '\0';
+
+ if (nmap >= maxmap)
+ if (__builtin_expect (extend_alias_table (), 0))
+ return added;
+
+ alias_len = strlen (alias) + 1;
+ value_len = strlen (value) + 1;
+
+ if (string_space_act + alias_len + value_len > string_space_max)
+ {
+ /* Increase size of memory pool. */
+ size_t new_size = (string_space_max
+ + (alias_len + value_len > 1024
+ ? alias_len + value_len : 1024));
+ char *new_pool = (char *) realloc (string_space, new_size);
+ if (new_pool == NULL)
+ return added;
+
+ if (__builtin_expect (string_space != new_pool, 0))
+ {
+ size_t i;
+
+ for (i = 0; i < nmap; i++)
+ {
+ map[i].alias += new_pool - string_space;
+ map[i].value += new_pool - string_space;
+ }
+ }
+
+ string_space = new_pool;
+ string_space_max = new_size;
+ }
+
+ map[nmap].alias = memcpy (&string_space[string_space_act],
+ alias, alias_len);
+ string_space_act += alias_len;
+
+ map[nmap].value = memcpy (&string_space[string_space_act],
+ value, value_len);
+ string_space_act += value_len;
+
+ ++nmap;
+ ++added;
+ }
+ }
+
+ /* Possibly not the whole line fits into the buffer. Ignore
+ the rest of the line. */
+ while (strchr (buf, '\n') == NULL)
+ if (FGETS (buf, sizeof buf, fp) == NULL)
+ /* Make sure the inner loop will be left. The outer loop
+ will exit at the `feof' test. */
+ break;
+ }
+
+ /* Should we test for ferror()? I think we have to silently ignore
+ errors. --drepper */
+ fclose (fp);
+
+ if (added > 0)
+ qsort (map, nmap, sizeof (struct alias_map),
+ (int (*) (const void *, const void *)) alias_compare);
+
+ return added;
+}
+
+
+static int
+extend_alias_table ()
+{
+ size_t new_size;
+ struct alias_map *new_map;
+
+ new_size = maxmap == 0 ? 100 : 2 * maxmap;
+ new_map = (struct alias_map *) realloc (map, (new_size
+ * sizeof (struct alias_map)));
+ if (new_map == NULL)
+ /* Simply don't extend: we don't have any more core. */
+ return -1;
+
+ map = new_map;
+ maxmap = new_size;
+ return 0;
+}
+
+
+static int
+alias_compare (const struct alias_map *map1, const struct alias_map *map2)
+{
+#if defined _LIBC || defined HAVE_STRCASECMP
+ return strcasecmp (map1->alias, map2->alias);
+#else
+ const unsigned char *p1 = (const unsigned char *) map1->alias;
+ const unsigned char *p2 = (const unsigned char *) map2->alias;
+ unsigned char c1, c2;
+
+ if (p1 == p2)
+ return 0;
+
+ do
+ {
+ /* I know this seems to be odd but the tolower() function in
+ some systems libc cannot handle nonalpha characters. */
+ c1 = isupper (*p1) ? tolower (*p1) : *p1;
+ c2 = isupper (*p2) ? tolower (*p2) : *p2;
+ if (c1 == '\0')
+ break;
+ ++p1;
+ ++p2;
+ }
+ while (c1 == c2);
+
+ return c1 - c2;
+#endif
+}
--- /dev/null
+/* Determine the current selected locale.
+ Copyright (C) 1995-1999, 2000-2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+/* Written by Ulrich Drepper <drepper@gnu.org>, 1995. */
+/* Win32 code written by Tor Lillqvist <tml@iki.fi>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <locale.h>
+
+#if defined _WIN32 || defined __WIN32__
+# undef WIN32 /* avoid warning on mingw32 */
+# define WIN32
+#endif
+
+#ifdef WIN32
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+/* List of language codes, sorted by value:
+ 0x01 LANG_ARABIC
+ 0x02 LANG_BULGARIAN
+ 0x03 LANG_CATALAN
+ 0x04 LANG_CHINESE
+ 0x05 LANG_CZECH
+ 0x06 LANG_DANISH
+ 0x07 LANG_GERMAN
+ 0x08 LANG_GREEK
+ 0x09 LANG_ENGLISH
+ 0x0a LANG_SPANISH
+ 0x0b LANG_FINNISH
+ 0x0c LANG_FRENCH
+ 0x0d LANG_HEBREW
+ 0x0e LANG_HUNGARIAN
+ 0x0f LANG_ICELANDIC
+ 0x10 LANG_ITALIAN
+ 0x11 LANG_JAPANESE
+ 0x12 LANG_KOREAN
+ 0x13 LANG_DUTCH
+ 0x14 LANG_NORWEGIAN
+ 0x15 LANG_POLISH
+ 0x16 LANG_PORTUGUESE
+ 0x17 LANG_RHAETO_ROMANCE
+ 0x18 LANG_ROMANIAN
+ 0x19 LANG_RUSSIAN
+ 0x1a LANG_CROATIAN == LANG_SERBIAN
+ 0x1b LANG_SLOVAK
+ 0x1c LANG_ALBANIAN
+ 0x1d LANG_SWEDISH
+ 0x1e LANG_THAI
+ 0x1f LANG_TURKISH
+ 0x20 LANG_URDU
+ 0x21 LANG_INDONESIAN
+ 0x22 LANG_UKRAINIAN
+ 0x23 LANG_BELARUSIAN
+ 0x24 LANG_SLOVENIAN
+ 0x25 LANG_ESTONIAN
+ 0x26 LANG_LATVIAN
+ 0x27 LANG_LITHUANIAN
+ 0x28 LANG_TAJIK
+ 0x29 LANG_FARSI
+ 0x2a LANG_VIETNAMESE
+ 0x2b LANG_ARMENIAN
+ 0x2c LANG_AZERI
+ 0x2d LANG_BASQUE
+ 0x2e LANG_SORBIAN
+ 0x2f LANG_MACEDONIAN
+ 0x30 LANG_SUTU
+ 0x31 LANG_TSONGA
+ 0x32 LANG_TSWANA
+ 0x33 LANG_VENDA
+ 0x34 LANG_XHOSA
+ 0x35 LANG_ZULU
+ 0x36 LANG_AFRIKAANS
+ 0x37 LANG_GEORGIAN
+ 0x38 LANG_FAEROESE
+ 0x39 LANG_HINDI
+ 0x3a LANG_MALTESE
+ 0x3b LANG_SAAMI
+ 0x3c LANG_GAELIC
+ 0x3d LANG_YIDDISH
+ 0x3e LANG_MALAY
+ 0x3f LANG_KAZAK
+ 0x40 LANG_KYRGYZ
+ 0x41 LANG_SWAHILI
+ 0x42 LANG_TURKMEN
+ 0x43 LANG_UZBEK
+ 0x44 LANG_TATAR
+ 0x45 LANG_BENGALI
+ 0x46 LANG_PUNJABI
+ 0x47 LANG_GUJARATI
+ 0x48 LANG_ORIYA
+ 0x49 LANG_TAMIL
+ 0x4a LANG_TELUGU
+ 0x4b LANG_KANNADA
+ 0x4c LANG_MALAYALAM
+ 0x4d LANG_ASSAMESE
+ 0x4e LANG_MARATHI
+ 0x4f LANG_SANSKRIT
+ 0x50 LANG_MONGOLIAN
+ 0x51 LANG_TIBETAN
+ 0x52 LANG_WELSH
+ 0x53 LANG_CAMBODIAN
+ 0x54 LANG_LAO
+ 0x55 LANG_BURMESE
+ 0x56 LANG_GALICIAN
+ 0x57 LANG_KONKANI
+ 0x58 LANG_MANIPURI
+ 0x59 LANG_SINDHI
+ 0x5a LANG_SYRIAC
+ 0x5b LANG_SINHALESE
+ 0x5c LANG_CHEROKEE
+ 0x5d LANG_INUKTITUT
+ 0x5e LANG_AMHARIC
+ 0x5f LANG_TAMAZIGHT
+ 0x60 LANG_KASHMIRI
+ 0x61 LANG_NEPALI
+ 0x62 LANG_FRISIAN
+ 0x63 LANG_PASHTO
+ 0x64 LANG_TAGALOG
+ 0x65 LANG_DIVEHI
+ 0x66 LANG_EDO
+ 0x67 LANG_FULFULDE
+ 0x68 LANG_HAUSA
+ 0x69 LANG_IBIBIO
+ 0x6a LANG_YORUBA
+ 0x70 LANG_IGBO
+ 0x71 LANG_KANURI
+ 0x72 LANG_OROMO
+ 0x73 LANG_TIGRINYA
+ 0x74 LANG_GUARANI
+ 0x75 LANG_HAWAIIAN
+ 0x76 LANG_LATIN
+ 0x77 LANG_SOMALI
+ 0x78 LANG_YI
+ 0x79 LANG_PAPIAMENTU
+*/
+/* Mingw headers don't have latest language and sublanguage codes. */
+# ifndef LANG_AFRIKAANS
+# define LANG_AFRIKAANS 0x36
+# endif
+# ifndef LANG_ALBANIAN
+# define LANG_ALBANIAN 0x1c
+# endif
+# ifndef LANG_AMHARIC
+# define LANG_AMHARIC 0x5e
+# endif
+# ifndef LANG_ARABIC
+# define LANG_ARABIC 0x01
+# endif
+# ifndef LANG_ARMENIAN
+# define LANG_ARMENIAN 0x2b
+# endif
+# ifndef LANG_ASSAMESE
+# define LANG_ASSAMESE 0x4d
+# endif
+# ifndef LANG_AZERI
+# define LANG_AZERI 0x2c
+# endif
+# ifndef LANG_BASQUE
+# define LANG_BASQUE 0x2d
+# endif
+# ifndef LANG_BELARUSIAN
+# define LANG_BELARUSIAN 0x23
+# endif
+# ifndef LANG_BENGALI
+# define LANG_BENGALI 0x45
+# endif
+# ifndef LANG_BURMESE
+# define LANG_BURMESE 0x55
+# endif
+# ifndef LANG_CAMBODIAN
+# define LANG_CAMBODIAN 0x53
+# endif
+# ifndef LANG_CATALAN
+# define LANG_CATALAN 0x03
+# endif
+# ifndef LANG_CHEROKEE
+# define LANG_CHEROKEE 0x5c
+# endif
+# ifndef LANG_DIVEHI
+# define LANG_DIVEHI 0x65
+# endif
+# ifndef LANG_EDO
+# define LANG_EDO 0x66
+# endif
+# ifndef LANG_ESTONIAN
+# define LANG_ESTONIAN 0x25
+# endif
+# ifndef LANG_FAEROESE
+# define LANG_FAEROESE 0x38
+# endif
+# ifndef LANG_FARSI
+# define LANG_FARSI 0x29
+# endif
+# ifndef LANG_FRISIAN
+# define LANG_FRISIAN 0x62
+# endif
+# ifndef LANG_FULFULDE
+# define LANG_FULFULDE 0x67
+# endif
+# ifndef LANG_GAELIC
+# define LANG_GAELIC 0x3c
+# endif
+# ifndef LANG_GALICIAN
+# define LANG_GALICIAN 0x56
+# endif
+# ifndef LANG_GEORGIAN
+# define LANG_GEORGIAN 0x37
+# endif
+# ifndef LANG_GUARANI
+# define LANG_GUARANI 0x74
+# endif
+# ifndef LANG_GUJARATI
+# define LANG_GUJARATI 0x47
+# endif
+# ifndef LANG_HAUSA
+# define LANG_HAUSA 0x68
+# endif
+# ifndef LANG_HAWAIIAN
+# define LANG_HAWAIIAN 0x75
+# endif
+# ifndef LANG_HEBREW
+# define LANG_HEBREW 0x0d
+# endif
+# ifndef LANG_HINDI
+# define LANG_HINDI 0x39
+# endif
+# ifndef LANG_IBIBIO
+# define LANG_IBIBIO 0x69
+# endif
+# ifndef LANG_IGBO
+# define LANG_IGBO 0x70
+# endif
+# ifndef LANG_INDONESIAN
+# define LANG_INDONESIAN 0x21
+# endif
+# ifndef LANG_INUKTITUT
+# define LANG_INUKTITUT 0x5d
+# endif
+# ifndef LANG_KANNADA
+# define LANG_KANNADA 0x4b
+# endif
+# ifndef LANG_KANURI
+# define LANG_KANURI 0x71
+# endif
+# ifndef LANG_KASHMIRI
+# define LANG_KASHMIRI 0x60
+# endif
+# ifndef LANG_KAZAK
+# define LANG_KAZAK 0x3f
+# endif
+# ifndef LANG_KONKANI
+# define LANG_KONKANI 0x57
+# endif
+# ifndef LANG_KYRGYZ
+# define LANG_KYRGYZ 0x40
+# endif
+# ifndef LANG_LAO
+# define LANG_LAO 0x54
+# endif
+# ifndef LANG_LATIN
+# define LANG_LATIN 0x76
+# endif
+# ifndef LANG_LATVIAN
+# define LANG_LATVIAN 0x26
+# endif
+# ifndef LANG_LITHUANIAN
+# define LANG_LITHUANIAN 0x27
+# endif
+# ifndef LANG_MACEDONIAN
+# define LANG_MACEDONIAN 0x2f
+# endif
+# ifndef LANG_MALAY
+# define LANG_MALAY 0x3e
+# endif
+# ifndef LANG_MALAYALAM
+# define LANG_MALAYALAM 0x4c
+# endif
+# ifndef LANG_MALTESE
+# define LANG_MALTESE 0x3a
+# endif
+# ifndef LANG_MANIPURI
+# define LANG_MANIPURI 0x58
+# endif
+# ifndef LANG_MARATHI
+# define LANG_MARATHI 0x4e
+# endif
+# ifndef LANG_MONGOLIAN
+# define LANG_MONGOLIAN 0x50
+# endif
+# ifndef LANG_NEPALI
+# define LANG_NEPALI 0x61
+# endif
+# ifndef LANG_ORIYA
+# define LANG_ORIYA 0x48
+# endif
+# ifndef LANG_OROMO
+# define LANG_OROMO 0x72
+# endif
+# ifndef LANG_PAPIAMENTU
+# define LANG_PAPIAMENTU 0x79
+# endif
+# ifndef LANG_PASHTO
+# define LANG_PASHTO 0x63
+# endif
+# ifndef LANG_PUNJABI
+# define LANG_PUNJABI 0x46
+# endif
+# ifndef LANG_RHAETO_ROMANCE
+# define LANG_RHAETO_ROMANCE 0x17
+# endif
+# ifndef LANG_SAAMI
+# define LANG_SAAMI 0x3b
+# endif
+# ifndef LANG_SANSKRIT
+# define LANG_SANSKRIT 0x4f
+# endif
+# ifndef LANG_SERBIAN
+# define LANG_SERBIAN 0x1a
+# endif
+# ifndef LANG_SINDHI
+# define LANG_SINDHI 0x59
+# endif
+# ifndef LANG_SINHALESE
+# define LANG_SINHALESE 0x5b
+# endif
+# ifndef LANG_SLOVAK
+# define LANG_SLOVAK 0x1b
+# endif
+# ifndef LANG_SOMALI
+# define LANG_SOMALI 0x77
+# endif
+# ifndef LANG_SORBIAN
+# define LANG_SORBIAN 0x2e
+# endif
+# ifndef LANG_SUTU
+# define LANG_SUTU 0x30
+# endif
+# ifndef LANG_SWAHILI
+# define LANG_SWAHILI 0x41
+# endif
+# ifndef LANG_SYRIAC
+# define LANG_SYRIAC 0x5a
+# endif
+# ifndef LANG_TAGALOG
+# define LANG_TAGALOG 0x64
+# endif
+# ifndef LANG_TAJIK
+# define LANG_TAJIK 0x28
+# endif
+# ifndef LANG_TAMAZIGHT
+# define LANG_TAMAZIGHT 0x5f
+# endif
+# ifndef LANG_TAMIL
+# define LANG_TAMIL 0x49
+# endif
+# ifndef LANG_TATAR
+# define LANG_TATAR 0x44
+# endif
+# ifndef LANG_TELUGU
+# define LANG_TELUGU 0x4a
+# endif
+# ifndef LANG_THAI
+# define LANG_THAI 0x1e
+# endif
+# ifndef LANG_TIBETAN
+# define LANG_TIBETAN 0x51
+# endif
+# ifndef LANG_TIGRINYA
+# define LANG_TIGRINYA 0x73
+# endif
+# ifndef LANG_TSONGA
+# define LANG_TSONGA 0x31
+# endif
+# ifndef LANG_TSWANA
+# define LANG_TSWANA 0x32
+# endif
+# ifndef LANG_TURKMEN
+# define LANG_TURKMEN 0x42
+# endif
+# ifndef LANG_UKRAINIAN
+# define LANG_UKRAINIAN 0x22
+# endif
+# ifndef LANG_URDU
+# define LANG_URDU 0x20
+# endif
+# ifndef LANG_UZBEK
+# define LANG_UZBEK 0x43
+# endif
+# ifndef LANG_VENDA
+# define LANG_VENDA 0x33
+# endif
+# ifndef LANG_VIETNAMESE
+# define LANG_VIETNAMESE 0x2a
+# endif
+# ifndef LANG_WELSH
+# define LANG_WELSH 0x52
+# endif
+# ifndef LANG_XHOSA
+# define LANG_XHOSA 0x34
+# endif
+# ifndef LANG_YI
+# define LANG_YI 0x78
+# endif
+# ifndef LANG_YIDDISH
+# define LANG_YIDDISH 0x3d
+# endif
+# ifndef LANG_YORUBA
+# define LANG_YORUBA 0x6a
+# endif
+# ifndef LANG_ZULU
+# define LANG_ZULU 0x35
+# endif
+# ifndef SUBLANG_ARABIC_SAUDI_ARABIA
+# define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
+# endif
+# ifndef SUBLANG_ARABIC_IRAQ
+# define SUBLANG_ARABIC_IRAQ 0x02
+# endif
+# ifndef SUBLANG_ARABIC_EGYPT
+# define SUBLANG_ARABIC_EGYPT 0x03
+# endif
+# ifndef SUBLANG_ARABIC_LIBYA
+# define SUBLANG_ARABIC_LIBYA 0x04
+# endif
+# ifndef SUBLANG_ARABIC_ALGERIA
+# define SUBLANG_ARABIC_ALGERIA 0x05
+# endif
+# ifndef SUBLANG_ARABIC_MOROCCO
+# define SUBLANG_ARABIC_MOROCCO 0x06
+# endif
+# ifndef SUBLANG_ARABIC_TUNISIA
+# define SUBLANG_ARABIC_TUNISIA 0x07
+# endif
+# ifndef SUBLANG_ARABIC_OMAN
+# define SUBLANG_ARABIC_OMAN 0x08
+# endif
+# ifndef SUBLANG_ARABIC_YEMEN
+# define SUBLANG_ARABIC_YEMEN 0x09
+# endif
+# ifndef SUBLANG_ARABIC_SYRIA
+# define SUBLANG_ARABIC_SYRIA 0x0a
+# endif
+# ifndef SUBLANG_ARABIC_JORDAN
+# define SUBLANG_ARABIC_JORDAN 0x0b
+# endif
+# ifndef SUBLANG_ARABIC_LEBANON
+# define SUBLANG_ARABIC_LEBANON 0x0c
+# endif
+# ifndef SUBLANG_ARABIC_KUWAIT
+# define SUBLANG_ARABIC_KUWAIT 0x0d
+# endif
+# ifndef SUBLANG_ARABIC_UAE
+# define SUBLANG_ARABIC_UAE 0x0e
+# endif
+# ifndef SUBLANG_ARABIC_BAHRAIN
+# define SUBLANG_ARABIC_BAHRAIN 0x0f
+# endif
+# ifndef SUBLANG_ARABIC_QATAR
+# define SUBLANG_ARABIC_QATAR 0x10
+# endif
+# ifndef SUBLANG_AZERI_LATIN
+# define SUBLANG_AZERI_LATIN 0x01
+# endif
+# ifndef SUBLANG_AZERI_CYRILLIC
+# define SUBLANG_AZERI_CYRILLIC 0x02
+# endif
+# ifndef SUBLANG_BENGALI_INDIA
+# define SUBLANG_BENGALI_INDIA 0x00
+# endif
+# ifndef SUBLANG_BENGALI_BANGLADESH
+# define SUBLANG_BENGALI_BANGLADESH 0x01
+# endif
+# ifndef SUBLANG_CHINESE_MACAU
+# define SUBLANG_CHINESE_MACAU 0x05
+# endif
+# ifndef SUBLANG_ENGLISH_SOUTH_AFRICA
+# define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07
+# endif
+# ifndef SUBLANG_ENGLISH_JAMAICA
+# define SUBLANG_ENGLISH_JAMAICA 0x08
+# endif
+# ifndef SUBLANG_ENGLISH_CARIBBEAN
+# define SUBLANG_ENGLISH_CARIBBEAN 0x09
+# endif
+# ifndef SUBLANG_ENGLISH_BELIZE
+# define SUBLANG_ENGLISH_BELIZE 0x0a
+# endif
+# ifndef SUBLANG_ENGLISH_TRINIDAD
+# define SUBLANG_ENGLISH_TRINIDAD 0x0b
+# endif
+# ifndef SUBLANG_ENGLISH_ZIMBABWE
+# define SUBLANG_ENGLISH_ZIMBABWE 0x0c
+# endif
+# ifndef SUBLANG_ENGLISH_PHILIPPINES
+# define SUBLANG_ENGLISH_PHILIPPINES 0x0d
+# endif
+# ifndef SUBLANG_ENGLISH_INDONESIA
+# define SUBLANG_ENGLISH_INDONESIA 0x0e
+# endif
+# ifndef SUBLANG_ENGLISH_HONGKONG
+# define SUBLANG_ENGLISH_HONGKONG 0x0f
+# endif
+# ifndef SUBLANG_ENGLISH_INDIA
+# define SUBLANG_ENGLISH_INDIA 0x10
+# endif
+# ifndef SUBLANG_ENGLISH_MALAYSIA
+# define SUBLANG_ENGLISH_MALAYSIA 0x11
+# endif
+# ifndef SUBLANG_ENGLISH_SINGAPORE
+# define SUBLANG_ENGLISH_SINGAPORE 0x12
+# endif
+# ifndef SUBLANG_FRENCH_LUXEMBOURG
+# define SUBLANG_FRENCH_LUXEMBOURG 0x05
+# endif
+# ifndef SUBLANG_FRENCH_MONACO
+# define SUBLANG_FRENCH_MONACO 0x06
+# endif
+# ifndef SUBLANG_FRENCH_WESTINDIES
+# define SUBLANG_FRENCH_WESTINDIES 0x07
+# endif
+# ifndef SUBLANG_FRENCH_REUNION
+# define SUBLANG_FRENCH_REUNION 0x08
+# endif
+# ifndef SUBLANG_FRENCH_CONGO
+# define SUBLANG_FRENCH_CONGO 0x09
+# endif
+# ifndef SUBLANG_FRENCH_SENEGAL
+# define SUBLANG_FRENCH_SENEGAL 0x0a
+# endif
+# ifndef SUBLANG_FRENCH_CAMEROON
+# define SUBLANG_FRENCH_CAMEROON 0x0b
+# endif
+# ifndef SUBLANG_FRENCH_COTEDIVOIRE
+# define SUBLANG_FRENCH_COTEDIVOIRE 0x0c
+# endif
+# ifndef SUBLANG_FRENCH_MALI
+# define SUBLANG_FRENCH_MALI 0x0d
+# endif
+# ifndef SUBLANG_FRENCH_MOROCCO
+# define SUBLANG_FRENCH_MOROCCO 0x0e
+# endif
+# ifndef SUBLANG_FRENCH_HAITI
+# define SUBLANG_FRENCH_HAITI 0x0f
+# endif
+# ifndef SUBLANG_GERMAN_LUXEMBOURG
+# define SUBLANG_GERMAN_LUXEMBOURG 0x04
+# endif
+# ifndef SUBLANG_GERMAN_LIECHTENSTEIN
+# define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
+# endif
+# ifndef SUBLANG_KASHMIRI_INDIA
+# define SUBLANG_KASHMIRI_INDIA 0x02
+# endif
+# ifndef SUBLANG_MALAY_MALAYSIA
+# define SUBLANG_MALAY_MALAYSIA 0x01
+# endif
+# ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM
+# define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02
+# endif
+# ifndef SUBLANG_NEPALI_INDIA
+# define SUBLANG_NEPALI_INDIA 0x02
+# endif
+# ifndef SUBLANG_PUNJABI_INDIA
+# define SUBLANG_PUNJABI_INDIA 0x00
+# endif
+# ifndef SUBLANG_PUNJABI_PAKISTAN
+# define SUBLANG_PUNJABI_PAKISTAN 0x01
+# endif
+# ifndef SUBLANG_ROMANIAN_ROMANIA
+# define SUBLANG_ROMANIAN_ROMANIA 0x00
+# endif
+# ifndef SUBLANG_ROMANIAN_MOLDOVA
+# define SUBLANG_ROMANIAN_MOLDOVA 0x01
+# endif
+# ifndef SUBLANG_SERBIAN_LATIN
+# define SUBLANG_SERBIAN_LATIN 0x02
+# endif
+# ifndef SUBLANG_SERBIAN_CYRILLIC
+# define SUBLANG_SERBIAN_CYRILLIC 0x03
+# endif
+# ifndef SUBLANG_SINDHI_INDIA
+# define SUBLANG_SINDHI_INDIA 0x00
+# endif
+# ifndef SUBLANG_SINDHI_PAKISTAN
+# define SUBLANG_SINDHI_PAKISTAN 0x01
+# endif
+# ifndef SUBLANG_SPANISH_GUATEMALA
+# define SUBLANG_SPANISH_GUATEMALA 0x04
+# endif
+# ifndef SUBLANG_SPANISH_COSTA_RICA
+# define SUBLANG_SPANISH_COSTA_RICA 0x05
+# endif
+# ifndef SUBLANG_SPANISH_PANAMA
+# define SUBLANG_SPANISH_PANAMA 0x06
+# endif
+# ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC
+# define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07
+# endif
+# ifndef SUBLANG_SPANISH_VENEZUELA
+# define SUBLANG_SPANISH_VENEZUELA 0x08
+# endif
+# ifndef SUBLANG_SPANISH_COLOMBIA
+# define SUBLANG_SPANISH_COLOMBIA 0x09
+# endif
+# ifndef SUBLANG_SPANISH_PERU
+# define SUBLANG_SPANISH_PERU 0x0a
+# endif
+# ifndef SUBLANG_SPANISH_ARGENTINA
+# define SUBLANG_SPANISH_ARGENTINA 0x0b
+# endif
+# ifndef SUBLANG_SPANISH_ECUADOR
+# define SUBLANG_SPANISH_ECUADOR 0x0c
+# endif
+# ifndef SUBLANG_SPANISH_CHILE
+# define SUBLANG_SPANISH_CHILE 0x0d
+# endif
+# ifndef SUBLANG_SPANISH_URUGUAY
+# define SUBLANG_SPANISH_URUGUAY 0x0e
+# endif
+# ifndef SUBLANG_SPANISH_PARAGUAY
+# define SUBLANG_SPANISH_PARAGUAY 0x0f
+# endif
+# ifndef SUBLANG_SPANISH_BOLIVIA
+# define SUBLANG_SPANISH_BOLIVIA 0x10
+# endif
+# ifndef SUBLANG_SPANISH_EL_SALVADOR
+# define SUBLANG_SPANISH_EL_SALVADOR 0x11
+# endif
+# ifndef SUBLANG_SPANISH_HONDURAS
+# define SUBLANG_SPANISH_HONDURAS 0x12
+# endif
+# ifndef SUBLANG_SPANISH_NICARAGUA
+# define SUBLANG_SPANISH_NICARAGUA 0x13
+# endif
+# ifndef SUBLANG_SPANISH_PUERTO_RICO
+# define SUBLANG_SPANISH_PUERTO_RICO 0x14
+# endif
+# ifndef SUBLANG_SWEDISH_FINLAND
+# define SUBLANG_SWEDISH_FINLAND 0x02
+# endif
+# ifndef SUBLANG_TAMAZIGHT_ARABIC
+# define SUBLANG_TAMAZIGHT_ARABIC 0x01
+# endif
+# ifndef SUBLANG_TAMAZIGHT_LATIN
+# define SUBLANG_TAMAZIGHT_LATIN 0x02
+# endif
+# ifndef SUBLANG_TIGRINYA_ETHIOPIA
+# define SUBLANG_TIGRINYA_ETHIOPIA 0x00
+# endif
+# ifndef SUBLANG_TIGRINYA_ERITREA
+# define SUBLANG_TIGRINYA_ERITREA 0x01
+# endif
+# ifndef SUBLANG_URDU_PAKISTAN
+# define SUBLANG_URDU_PAKISTAN 0x01
+# endif
+# ifndef SUBLANG_URDU_INDIA
+# define SUBLANG_URDU_INDIA 0x02
+# endif
+# ifndef SUBLANG_UZBEK_LATIN
+# define SUBLANG_UZBEK_LATIN 0x01
+# endif
+# ifndef SUBLANG_UZBEK_CYRILLIC
+# define SUBLANG_UZBEK_CYRILLIC 0x02
+# endif
+#endif
+
+/* XPG3 defines the result of 'setlocale (category, NULL)' as:
+ "Directs 'setlocale()' to query 'category' and return the current
+ setting of 'local'."
+ However it does not specify the exact format. Neither do SUSV2 and
+ ISO C 99. So we can use this feature only on selected systems (e.g.
+ those using GNU C Library). */
+#if defined _LIBC || (defined __GNU_LIBRARY__ && __GNU_LIBRARY__ >= 2)
+# define HAVE_LOCALE_NULL
+#endif
+
+/* Determine the current locale's name, and canonicalize it into XPG syntax
+ language[_territory[.codeset]][@modifier]
+ The codeset part in the result is not reliable; the locale_charset()
+ should be used for codeset information instead.
+ The result must not be freed; it is statically allocated. */
+
+const char *
+_nl_locale_name (int category, const char *categoryname)
+{
+ const char *retval;
+
+#ifndef WIN32
+
+ /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'.
+ On some systems this can be done by the 'setlocale' function itself. */
+# if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
+ retval = setlocale (category, NULL);
+# else
+ /* Setting of LC_ALL overwrites all other. */
+ retval = getenv ("LC_ALL");
+ if (retval == NULL || retval[0] == '\0')
+ {
+ /* Next comes the name of the desired category. */
+ retval = getenv (categoryname);
+ if (retval == NULL || retval[0] == '\0')
+ {
+ /* Last possibility is the LANG environment variable. */
+ retval = getenv ("LANG");
+ if (retval == NULL || retval[0] == '\0')
+ /* We use C as the default domain. POSIX says this is
+ implementation defined. */
+ retval = "C";
+ }
+ }
+# endif
+
+ return retval;
+
+#else /* WIN32 */
+
+ /* Return an XPG style locale name language[_territory][@modifier].
+ Don't even bother determining the codeset; it's not useful in this
+ context, because message catalogs are not specific to a single
+ codeset. */
+
+ LCID lcid;
+ LANGID langid;
+ int primary, sub;
+
+ /* Let the user override the system settings through environment
+ variables, as on POSIX systems. */
+ retval = getenv ("LC_ALL");
+ if (retval != NULL && retval[0] != '\0')
+ return retval;
+ retval = getenv (categoryname);
+ if (retval != NULL && retval[0] != '\0')
+ return retval;
+ retval = getenv ("LANG");
+ if (retval != NULL && retval[0] != '\0')
+ return retval;
+
+ /* Use native Win32 API locale ID. */
+ lcid = GetThreadLocale ();
+
+ /* Strip off the sorting rules, keep only the language part. */
+ langid = LANGIDFROMLCID (lcid);
+
+ /* Split into language and territory part. */
+ primary = PRIMARYLANGID (langid);
+ sub = SUBLANGID (langid);
+
+ /* Dispatch on language.
+ See also http://www.unicode.org/unicode/onlinedat/languages.html .
+ For details about languages, see http://www.ethnologue.com/ . */
+ switch (primary)
+ {
+ case LANG_AFRIKAANS: return "af_ZA";
+ case LANG_ALBANIAN: return "sq_AL";
+ case LANG_AMHARIC: return "am_ET";
+ case LANG_ARABIC:
+ switch (sub)
+ {
+ case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA";
+ case SUBLANG_ARABIC_IRAQ: return "ar_IQ";
+ case SUBLANG_ARABIC_EGYPT: return "ar_EG";
+ case SUBLANG_ARABIC_LIBYA: return "ar_LY";
+ case SUBLANG_ARABIC_ALGERIA: return "ar_DZ";
+ case SUBLANG_ARABIC_MOROCCO: return "ar_MA";
+ case SUBLANG_ARABIC_TUNISIA: return "ar_TN";
+ case SUBLANG_ARABIC_OMAN: return "ar_OM";
+ case SUBLANG_ARABIC_YEMEN: return "ar_YE";
+ case SUBLANG_ARABIC_SYRIA: return "ar_SY";
+ case SUBLANG_ARABIC_JORDAN: return "ar_JO";
+ case SUBLANG_ARABIC_LEBANON: return "ar_LB";
+ case SUBLANG_ARABIC_KUWAIT: return "ar_KW";
+ case SUBLANG_ARABIC_UAE: return "ar_AE";
+ case SUBLANG_ARABIC_BAHRAIN: return "ar_BH";
+ case SUBLANG_ARABIC_QATAR: return "ar_QA";
+ }
+ return "ar";
+ case LANG_ARMENIAN: return "hy_AM";
+ case LANG_ASSAMESE: return "as_IN";
+ case LANG_AZERI:
+ switch (sub)
+ {
+ /* FIXME: Adjust this when Azerbaijani locales appear on Unix. */
+ case SUBLANG_AZERI_LATIN: return "az_AZ@latin";
+ case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic";
+ }
+ return "az";
+ case LANG_BASQUE:
+ return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR". */
+ case LANG_BELARUSIAN: return "be_BY";
+ case LANG_BENGALI:
+ switch (sub)
+ {
+ case SUBLANG_BENGALI_INDIA: return "bn_IN";
+ case SUBLANG_BENGALI_BANGLADESH: return "bn_BD";
+ }
+ return "bn";
+ case LANG_BULGARIAN: return "bg_BG";
+ case LANG_BURMESE: return "my_MM";
+ case LANG_CAMBODIAN: return "km_KH";
+ case LANG_CATALAN: return "ca_ES";
+ case LANG_CHEROKEE: return "chr_US";
+ case LANG_CHINESE:
+ switch (sub)
+ {
+ case SUBLANG_CHINESE_TRADITIONAL: return "zh_TW";
+ case SUBLANG_CHINESE_SIMPLIFIED: return "zh_CN";
+ case SUBLANG_CHINESE_HONGKONG: return "zh_HK";
+ case SUBLANG_CHINESE_SINGAPORE: return "zh_SG";
+ case SUBLANG_CHINESE_MACAU: return "zh_MO";
+ }
+ return "zh";
+ case LANG_CROATIAN: /* LANG_CROATIAN == LANG_SERBIAN
+ * What used to be called Serbo-Croatian
+ * should really now be two separate
+ * languages because of political reasons.
+ * (Says tml, who knows nothing about Serbian
+ * or Croatian.)
+ * (I can feel those flames coming already.)
+ */
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "hr_HR";
+ case SUBLANG_SERBIAN_LATIN: return "sr_CS";
+ case SUBLANG_SERBIAN_CYRILLIC: return "sr_CS@cyrillic";
+ }
+ return "hr";
+ case LANG_CZECH: return "cs_CZ";
+ case LANG_DANISH: return "da_DK";
+ case LANG_DIVEHI: return "dv_MV";
+ case LANG_DUTCH:
+ switch (sub)
+ {
+ case SUBLANG_DUTCH: return "nl_NL";
+ case SUBLANG_DUTCH_BELGIAN: /* FLEMISH, VLAAMS */ return "nl_BE";
+ }
+ return "nl";
+ case LANG_EDO: return "bin_NG";
+ case LANG_ENGLISH:
+ switch (sub)
+ {
+ /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought
+ * English was the language spoken in England.
+ * Oh well.
+ */
+ case SUBLANG_ENGLISH_US: return "en_US";
+ case SUBLANG_ENGLISH_UK: return "en_GB";
+ case SUBLANG_ENGLISH_AUS: return "en_AU";
+ case SUBLANG_ENGLISH_CAN: return "en_CA";
+ case SUBLANG_ENGLISH_NZ: return "en_NZ";
+ case SUBLANG_ENGLISH_EIRE: return "en_IE";
+ case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA";
+ case SUBLANG_ENGLISH_JAMAICA: return "en_JM";
+ case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */
+ case SUBLANG_ENGLISH_BELIZE: return "en_BZ";
+ case SUBLANG_ENGLISH_TRINIDAD: return "en_TT";
+ case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW";
+ case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH";
+ case SUBLANG_ENGLISH_INDONESIA: return "en_ID";
+ case SUBLANG_ENGLISH_HONGKONG: return "en_HK";
+ case SUBLANG_ENGLISH_INDIA: return "en_IN";
+ case SUBLANG_ENGLISH_MALAYSIA: return "en_MY";
+ case SUBLANG_ENGLISH_SINGAPORE: return "en_SG";
+ }
+ return "en";
+ case LANG_ESTONIAN: return "et_EE";
+ case LANG_FAEROESE: return "fo_FO";
+ case LANG_FARSI: return "fa_IR";
+ case LANG_FINNISH: return "fi_FI";
+ case LANG_FRENCH:
+ switch (sub)
+ {
+ case SUBLANG_FRENCH: return "fr_FR";
+ case SUBLANG_FRENCH_BELGIAN: /* WALLOON */ return "fr_BE";
+ case SUBLANG_FRENCH_CANADIAN: return "fr_CA";
+ case SUBLANG_FRENCH_SWISS: return "fr_CH";
+ case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU";
+ case SUBLANG_FRENCH_MONACO: return "fr_MC";
+ case SUBLANG_FRENCH_WESTINDIES: return "fr"; /* Caribbean? */
+ case SUBLANG_FRENCH_REUNION: return "fr_RE";
+ case SUBLANG_FRENCH_CONGO: return "fr_CG";
+ case SUBLANG_FRENCH_SENEGAL: return "fr_SN";
+ case SUBLANG_FRENCH_CAMEROON: return "fr_CM";
+ case SUBLANG_FRENCH_COTEDIVOIRE: return "fr_CI";
+ case SUBLANG_FRENCH_MALI: return "fr_ML";
+ case SUBLANG_FRENCH_MOROCCO: return "fr_MA";
+ case SUBLANG_FRENCH_HAITI: return "fr_HT";
+ }
+ return "fr";
+ case LANG_FRISIAN: return "fy_NL";
+ case LANG_FULFULDE:
+ /* Spoken in Nigeria, Guinea, Senegal, Mali, Niger, Cameroon, Benin. */
+ return "ff_NG";
+ case LANG_GAELIC:
+ switch (sub)
+ {
+ case 0x01: /* SCOTTISH */ return "gd_GB";
+ case 0x02: /* IRISH */ return "ga_IE";
+ }
+ return "C";
+ case LANG_GALICIAN: return "gl_ES";
+ case LANG_GEORGIAN: return "ka_GE";
+ case LANG_GERMAN:
+ switch (sub)
+ {
+ case SUBLANG_GERMAN: return "de_DE";
+ case SUBLANG_GERMAN_SWISS: return "de_CH";
+ case SUBLANG_GERMAN_AUSTRIAN: return "de_AT";
+ case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU";
+ case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI";
+ }
+ return "de";
+ case LANG_GREEK: return "el_GR";
+ case LANG_GUARANI: return "gn_PY";
+ case LANG_GUJARATI: return "gu_IN";
+ case LANG_HAUSA: return "ha_NG";
+ case LANG_HAWAIIAN:
+ /* FIXME: Do they mean Hawaiian ("haw_US", 1000 speakers)
+ or Hawaii Creole English ("cpe_US", 600000 speakers)? */
+ return "cpe_US";
+ case LANG_HEBREW: return "he_IL";
+ case LANG_HINDI: return "hi_IN";
+ case LANG_HUNGARIAN: return "hu_HU";
+ case LANG_IBIBIO: return "nic_NG";
+ case LANG_ICELANDIC: return "is_IS";
+ case LANG_IGBO: return "ig_NG";
+ case LANG_INDONESIAN: return "id_ID";
+ case LANG_INUKTITUT: return "iu_CA";
+ case LANG_ITALIAN:
+ switch (sub)
+ {
+ case SUBLANG_ITALIAN: return "it_IT";
+ case SUBLANG_ITALIAN_SWISS: return "it_CH";
+ }
+ return "it";
+ case LANG_JAPANESE: return "ja_JP";
+ case LANG_KANNADA: return "kn_IN";
+ case LANG_KANURI: return "kr_NG";
+ case LANG_KASHMIRI:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "ks_PK";
+ case SUBLANG_KASHMIRI_INDIA: return "ks_IN";
+ }
+ return "ks";
+ case LANG_KAZAK: return "kk_KZ";
+ case LANG_KONKANI:
+ /* FIXME: Adjust this when such locales appear on Unix. */
+ return "kok_IN";
+ case LANG_KOREAN: return "ko_KR";
+ case LANG_KYRGYZ: return "ky_KG";
+ case LANG_LAO: return "lo_LA";
+ case LANG_LATIN: return "la_VA";
+ case LANG_LATVIAN: return "lv_LV";
+ case LANG_LITHUANIAN: return "lt_LT";
+ case LANG_MACEDONIAN: return "mk_MK";
+ case LANG_MALAY:
+ switch (sub)
+ {
+ case SUBLANG_MALAY_MALAYSIA: return "ms_MY";
+ case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN";
+ }
+ return "ms";
+ case LANG_MALAYALAM: return "ml_IN";
+ case LANG_MALTESE: return "mt_MT";
+ case LANG_MANIPURI:
+ /* FIXME: Adjust this when such locales appear on Unix. */
+ return "mni_IN";
+ case LANG_MARATHI: return "mr_IN";
+ case LANG_MONGOLIAN:
+ return "mn"; /* Ambiguous: could be "mn_CN" or "mn_MN". */
+ case LANG_NEPALI:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "ne_NP";
+ case SUBLANG_NEPALI_INDIA: return "ne_IN";
+ }
+ return "ne";
+ case LANG_NORWEGIAN:
+ switch (sub)
+ {
+ case SUBLANG_NORWEGIAN_BOKMAL: return "no_NO";
+ case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO";
+ }
+ return "no";
+ case LANG_ORIYA: return "or_IN";
+ case LANG_OROMO: return "om_ET";
+ case LANG_PAPIAMENTU: return "pap_AN";
+ case LANG_PASHTO:
+ return "ps"; /* Ambiguous: could be "ps_PK" or "ps_AF". */
+ case LANG_POLISH: return "pl_PL";
+ case LANG_PORTUGUESE:
+ switch (sub)
+ {
+ case SUBLANG_PORTUGUESE: return "pt_PT";
+ /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT.
+ Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */
+ case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR";
+ }
+ return "pt";
+ case LANG_PUNJABI:
+ switch (sub)
+ {
+ case SUBLANG_PUNJABI_INDIA: return "pa_IN"; /* Gurmukhi script */
+ case SUBLANG_PUNJABI_PAKISTAN: return "pa_PK"; /* Arabic script */
+ }
+ return "pa";
+ case LANG_RHAETO_ROMANCE: return "rm_CH";
+ case LANG_ROMANIAN:
+ switch (sub)
+ {
+ case SUBLANG_ROMANIAN_ROMANIA: return "ro_RO";
+ case SUBLANG_ROMANIAN_MOLDOVA: return "ro_MD";
+ }
+ return "ro";
+ case LANG_RUSSIAN:
+ return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA" or "ru_MD". */
+ case LANG_SAAMI: /* actually Northern Sami */ return "se_NO";
+ case LANG_SANSKRIT: return "sa_IN";
+ case LANG_SINDHI:
+ switch (sub)
+ {
+ case SUBLANG_SINDHI_INDIA: return "sd_IN";
+ case SUBLANG_SINDHI_PAKISTAN: return "sd_PK";
+ }
+ return "sd";
+ case LANG_SINHALESE: return "si_LK";
+ case LANG_SLOVAK: return "sk_SK";
+ case LANG_SLOVENIAN: return "sl_SI";
+ case LANG_SOMALI: return "so_SO";
+ case LANG_SORBIAN:
+ /* FIXME: Adjust this when such locales appear on Unix. */
+ return "wen_DE";
+ case LANG_SPANISH:
+ switch (sub)
+ {
+ case SUBLANG_SPANISH: return "es_ES";
+ case SUBLANG_SPANISH_MEXICAN: return "es_MX";
+ case SUBLANG_SPANISH_MODERN:
+ return "es_ES@modern"; /* not seen on Unix */
+ case SUBLANG_SPANISH_GUATEMALA: return "es_GT";
+ case SUBLANG_SPANISH_COSTA_RICA: return "es_CR";
+ case SUBLANG_SPANISH_PANAMA: return "es_PA";
+ case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO";
+ case SUBLANG_SPANISH_VENEZUELA: return "es_VE";
+ case SUBLANG_SPANISH_COLOMBIA: return "es_CO";
+ case SUBLANG_SPANISH_PERU: return "es_PE";
+ case SUBLANG_SPANISH_ARGENTINA: return "es_AR";
+ case SUBLANG_SPANISH_ECUADOR: return "es_EC";
+ case SUBLANG_SPANISH_CHILE: return "es_CL";
+ case SUBLANG_SPANISH_URUGUAY: return "es_UY";
+ case SUBLANG_SPANISH_PARAGUAY: return "es_PY";
+ case SUBLANG_SPANISH_BOLIVIA: return "es_BO";
+ case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV";
+ case SUBLANG_SPANISH_HONDURAS: return "es_HN";
+ case SUBLANG_SPANISH_NICARAGUA: return "es_NI";
+ case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR";
+ }
+ return "es";
+ case LANG_SUTU: return "bnt_TZ"; /* or "st_LS" or "nso_ZA"? */
+ case LANG_SWAHILI: return "sw_KE";
+ case LANG_SWEDISH:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "sv_SE";
+ case SUBLANG_SWEDISH_FINLAND: return "sv_FI";
+ }
+ return "sv";
+ case LANG_SYRIAC: return "syr_TR"; /* An extinct language. */
+ case LANG_TAGALOG: return "tl_PH";
+ case LANG_TAJIK: return "tg_TJ";
+ case LANG_TAMAZIGHT:
+ switch (sub)
+ {
+ /* FIXME: Adjust this when Tamazight locales appear on Unix. */
+ case SUBLANG_TAMAZIGHT_ARABIC: return "ber_MA@arabic";
+ case SUBLANG_TAMAZIGHT_LATIN: return "ber_MA@latin";
+ }
+ return "ber_MA";
+ case LANG_TAMIL:
+ return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG". */
+ case LANG_TATAR: return "tt_RU";
+ case LANG_TELUGU: return "te_IN";
+ case LANG_THAI: return "th_TH";
+ case LANG_TIBETAN: return "bo_CN";
+ case LANG_TIGRINYA:
+ switch (sub)
+ {
+ case SUBLANG_TIGRINYA_ETHIOPIA: return "ti_ET";
+ case SUBLANG_TIGRINYA_ERITREA: return "ti_ER";
+ }
+ return "ti";
+ case LANG_TSONGA: return "ts_ZA";
+ case LANG_TSWANA: return "tn_BW";
+ case LANG_TURKISH: return "tr_TR";
+ case LANG_TURKMEN: return "tk_TM";
+ case LANG_UKRAINIAN: return "uk_UA";
+ case LANG_URDU:
+ switch (sub)
+ {
+ case SUBLANG_URDU_PAKISTAN: return "ur_PK";
+ case SUBLANG_URDU_INDIA: return "ur_IN";
+ }
+ return "ur";
+ case LANG_UZBEK:
+ switch (sub)
+ {
+ case SUBLANG_UZBEK_LATIN: return "uz_UZ";
+ case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic";
+ }
+ return "uz";
+ case LANG_VENDA: return "ve_ZA";
+ case LANG_VIETNAMESE: return "vi_VN";
+ case LANG_WELSH: return "cy_GB";
+ case LANG_XHOSA: return "xh_ZA";
+ case LANG_YI: return "sit_CN";
+ case LANG_YIDDISH: return "yi_IL";
+ case LANG_YORUBA: return "yo_NG";
+ case LANG_ZULU: return "zu_ZA";
+ default: return "C";
+ }
+
+#endif
+}
--- /dev/null
+/* Log file output.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+/* Written by Bruno Haible <bruno@clisp.org>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* Print an ASCII string with quotes and escape sequences where needed. */
+static void
+print_escaped (FILE *stream, const char *str)
+{
+ putc ('"', stream);
+ for (; *str != '\0'; str++)
+ if (*str == '\n')
+ {
+ fputs ("\\n\"", stream);
+ if (str[1] == '\0')
+ return;
+ fputs ("\n\"", stream);
+ }
+ else
+ {
+ if (*str == '"' || *str == '\\')
+ putc ('\\', stream);
+ putc (*str, stream);
+ }
+ putc ('"', stream);
+}
+
+/* Add to the log file an entry denoting a failed translation. */
+void
+_nl_log_untranslated (const char *logfilename, const char *domainname,
+ const char *msgid1, const char *msgid2, int plural)
+{
+ static char *last_logfilename = NULL;
+ static FILE *last_logfile = NULL;
+ FILE *logfile;
+
+ /* Can we reuse the last opened logfile? */
+ if (last_logfilename == NULL || strcmp (logfilename, last_logfilename) != 0)
+ {
+ /* Close the last used logfile. */
+ if (last_logfilename != NULL)
+ {
+ if (last_logfile != NULL)
+ {
+ fclose (last_logfile);
+ last_logfile = NULL;
+ }
+ free (last_logfilename);
+ last_logfilename = NULL;
+ }
+ /* Open the logfile. */
+ last_logfilename = (char *) malloc (strlen (logfilename) + 1);
+ if (last_logfilename == NULL)
+ return;
+ strcpy (last_logfilename, logfilename);
+ last_logfile = fopen (logfilename, "a");
+ if (last_logfile == NULL)
+ return;
+ }
+ logfile = last_logfile;
+
+ fprintf (logfile, "domain ");
+ print_escaped (logfile, domainname);
+ fprintf (logfile, "\nmsgid ");
+ print_escaped (logfile, msgid1);
+ if (plural)
+ {
+ fprintf (logfile, "\nmsgid_plural ");
+ print_escaped (logfile, msgid2);
+ fprintf (logfile, "\nmsgstr[0] \"\"\n");
+ }
+ else
+ fprintf (logfile, "\nmsgstr \"\"\n");
+ putc ('\n', logfile);
+}
--- /dev/null
+/* Implementation of ngettext(3) function.
+ Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef _LIBC
+# define __need_NULL
+# include <stddef.h>
+#else
+# include <stdlib.h> /* Just for NULL. */
+#endif
+
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+
+#include <locale.h>
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define NGETTEXT __ngettext
+# define DCNGETTEXT __dcngettext
+#else
+# define NGETTEXT libintl_ngettext
+# define DCNGETTEXT libintl_dcngettext
+#endif
+
+/* Look up MSGID in the current default message catalog for the current
+ LC_MESSAGES locale. If not found, returns MSGID itself (the default
+ text). */
+char *
+NGETTEXT (const char *msgid1, const char *msgid2, unsigned long int n)
+{
+ return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__ngettext, ngettext);
+#endif
--- /dev/null
+/* OS/2 compatibility functions.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+#define OS2_AWARE
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/param.h>
+
+/* A version of getenv() that works from DLLs */
+extern unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue);
+
+char *
+_nl_getenv (const char *name)
+{
+ unsigned char *value;
+ if (DosScanEnv (name, &value))
+ return NULL;
+ else
+ return value;
+}
+
+/* A fixed size buffer. */
+char libintl_nl_default_dirname[MAXPATHLEN+1];
+
+char *_nlos2_libdir = NULL;
+char *_nlos2_localealiaspath = NULL;
+char *_nlos2_localedir = NULL;
+
+static __attribute__((constructor)) void
+nlos2_initialize ()
+{
+ char *root = getenv ("UNIXROOT");
+ char *gnulocaledir = getenv ("GNULOCALEDIR");
+
+ _nlos2_libdir = gnulocaledir;
+ if (!_nlos2_libdir)
+ {
+ if (root)
+ {
+ size_t sl = strlen (root);
+ _nlos2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1);
+ memcpy (_nlos2_libdir, root, sl);
+ memcpy (_nlos2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1);
+ }
+ else
+ _nlos2_libdir = LIBDIR;
+ }
+
+ _nlos2_localealiaspath = gnulocaledir;
+ if (!_nlos2_localealiaspath)
+ {
+ if (root)
+ {
+ size_t sl = strlen (root);
+ _nlos2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1);
+ memcpy (_nlos2_localealiaspath, root, sl);
+ memcpy (_nlos2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1);
+ }
+ else
+ _nlos2_localealiaspath = LOCALE_ALIAS_PATH;
+ }
+
+ _nlos2_localedir = gnulocaledir;
+ if (!_nlos2_localedir)
+ {
+ if (root)
+ {
+ size_t sl = strlen (root);
+ _nlos2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1);
+ memcpy (_nlos2_localedir, root, sl);
+ memcpy (_nlos2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1);
+ }
+ else
+ _nlos2_localedir = LOCALEDIR;
+ }
+
+ if (strlen (_nlos2_localedir) <= MAXPATHLEN)
+ strcpy (libintl_nl_default_dirname, _nlos2_localedir);
+}
--- /dev/null
+/* OS/2 compatibility defines.
+ This file is intended to be included from config.h
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+/* When included from os2compat.h we need all the original definitions */
+#ifndef OS2_AWARE
+
+#undef LIBDIR
+#define LIBDIR _nlos2_libdir
+extern char *_nlos2_libdir;
+
+#undef LOCALEDIR
+#define LOCALEDIR _nlos2_localedir
+extern char *_nlos2_localedir;
+
+#undef LOCALE_ALIAS_PATH
+#define LOCALE_ALIAS_PATH _nlos2_localealiaspath
+extern char *_nlos2_localealiaspath;
+
+#endif
+
+#undef HAVE_STRCASECMP
+#define HAVE_STRCASECMP 1
+#define strcasecmp stricmp
+#define strncasecmp strnicmp
+
+/* We have our own getenv() which works even if library is compiled as DLL */
+#define getenv _nl_getenv
+
+/* Older versions of gettext used -1 as the value of LC_MESSAGES */
+#define LC_MESSAGES_COMPAT (-1)
--- /dev/null
+/* OS dependent parts of libintl.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+#if defined __EMX__
+# include "os2compat.c"
+#else
+/* Avoid AIX compiler warning. */
+typedef int dummy;
+#endif
--- /dev/null
+/* Expression parsing for plural form selection.
+ Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "plural-exp.h"
+
+#if (defined __GNUC__ && !defined __APPLE_CC__) \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
+
+/* These structs are the constant expression for the germanic plural
+ form determination. It represents the expression "n != 1". */
+static const struct expression plvar =
+{
+ .nargs = 0,
+ .operation = var,
+};
+static const struct expression plone =
+{
+ .nargs = 0,
+ .operation = num,
+ .val =
+ {
+ .num = 1
+ }
+};
+struct expression GERMANIC_PLURAL =
+{
+ .nargs = 2,
+ .operation = not_equal,
+ .val =
+ {
+ .args =
+ {
+ [0] = (struct expression *) &plvar,
+ [1] = (struct expression *) &plone
+ }
+ }
+};
+
+# define INIT_GERMANIC_PLURAL()
+
+#else
+
+/* For compilers without support for ISO C 99 struct/union initializers:
+ Initialization at run-time. */
+
+static struct expression plvar;
+static struct expression plone;
+struct expression GERMANIC_PLURAL;
+
+static void
+init_germanic_plural ()
+{
+ if (plone.val.num == 0)
+ {
+ plvar.nargs = 0;
+ plvar.operation = var;
+
+ plone.nargs = 0;
+ plone.operation = num;
+ plone.val.num = 1;
+
+ GERMANIC_PLURAL.nargs = 2;
+ GERMANIC_PLURAL.operation = not_equal;
+ GERMANIC_PLURAL.val.args[0] = &plvar;
+ GERMANIC_PLURAL.val.args[1] = &plone;
+ }
+}
+
+# define INIT_GERMANIC_PLURAL() init_germanic_plural ()
+
+#endif
+
+void
+internal_function
+EXTRACT_PLURAL_EXPRESSION (const char *nullentry, struct expression **pluralp,
+ unsigned long int *npluralsp)
+{
+ if (nullentry != NULL)
+ {
+ const char *plural;
+ const char *nplurals;
+
+ plural = strstr (nullentry, "plural=");
+ nplurals = strstr (nullentry, "nplurals=");
+ if (plural == NULL || nplurals == NULL)
+ goto no_plural;
+ else
+ {
+ char *endp;
+ unsigned long int n;
+ struct parse_args args;
+
+ /* First get the number. */
+ nplurals += 9;
+ while (*nplurals != '\0' && isspace ((unsigned char) *nplurals))
+ ++nplurals;
+ if (!(*nplurals >= '0' && *nplurals <= '9'))
+ goto no_plural;
+#if defined HAVE_STRTOUL || defined _LIBC
+ n = strtoul (nplurals, &endp, 10);
+#else
+ for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++)
+ n = n * 10 + (*endp - '0');
+#endif
+ if (nplurals == endp)
+ goto no_plural;
+ *npluralsp = n;
+
+ /* Due to the restrictions bison imposes onto the interface of the
+ scanner function we have to put the input string and the result
+ passed up from the parser into the same structure which address
+ is passed down to the parser. */
+ plural += 7;
+ args.cp = plural;
+ if (PLURAL_PARSE (&args) != 0)
+ goto no_plural;
+ *pluralp = args.res;
+ }
+ }
+ else
+ {
+ /* By default we are using the Germanic form: singular form only
+ for `one', the plural form otherwise. Yes, this is also what
+ English is using since English is a Germanic language. */
+ no_plural:
+ INIT_GERMANIC_PLURAL ();
+ *pluralp = &GERMANIC_PLURAL;
+ *npluralsp = 2;
+ }
+}
--- /dev/null
+/* Expression parsing and evaluation for plural form selection.
+ Copyright (C) 2000-2003 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _PLURAL_EXP_H
+#define _PLURAL_EXP_H
+
+#ifndef internal_function
+# define internal_function
+#endif
+
+#ifndef attribute_hidden
+# define attribute_hidden
+#endif
+
+
+/* This is the representation of the expressions to determine the
+ plural form. */
+struct expression
+{
+ int nargs; /* Number of arguments. */
+ enum operator
+ {
+ /* Without arguments: */
+ var, /* The variable "n". */
+ num, /* Decimal number. */
+ /* Unary operators: */
+ lnot, /* Logical NOT. */
+ /* Binary operators: */
+ mult, /* Multiplication. */
+ divide, /* Division. */
+ module, /* Modulo operation. */
+ plus, /* Addition. */
+ minus, /* Subtraction. */
+ less_than, /* Comparison. */
+ greater_than, /* Comparison. */
+ less_or_equal, /* Comparison. */
+ greater_or_equal, /* Comparison. */
+ equal, /* Comparison for equality. */
+ not_equal, /* Comparison for inequality. */
+ land, /* Logical AND. */
+ lor, /* Logical OR. */
+ /* Ternary operators: */
+ qmop /* Question mark operator. */
+ } operation;
+ union
+ {
+ unsigned long int num; /* Number value for `num'. */
+ struct expression *args[3]; /* Up to three arguments. */
+ } val;
+};
+
+/* This is the data structure to pass information to the parser and get
+ the result in a thread-safe way. */
+struct parse_args
+{
+ const char *cp;
+ struct expression *res;
+};
+
+
+/* Names for the libintl functions are a problem. This source code is used
+ 1. in the GNU C Library library,
+ 2. in the GNU libintl library,
+ 3. in the GNU gettext tools.
+ The function names in each situation must be different, to allow for
+ binary incompatible changes in 'struct expression'. Furthermore,
+ 1. in the GNU C Library library, the names have a __ prefix,
+ 2.+3. in the GNU libintl library and in the GNU gettext tools, the names
+ must follow ANSI C and not start with __.
+ So we have to distinguish the three cases. */
+#ifdef _LIBC
+# define FREE_EXPRESSION __gettext_free_exp
+# define PLURAL_PARSE __gettextparse
+# define GERMANIC_PLURAL __gettext_germanic_plural
+# define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural
+#elif defined (IN_LIBINTL)
+# define FREE_EXPRESSION libintl_gettext_free_exp
+# define PLURAL_PARSE libintl_gettextparse
+# define GERMANIC_PLURAL libintl_gettext_germanic_plural
+# define EXTRACT_PLURAL_EXPRESSION libintl_gettext_extract_plural
+#else
+# define FREE_EXPRESSION free_plural_expression
+# define PLURAL_PARSE parse_plural_expression
+# define GERMANIC_PLURAL germanic_plural
+# define EXTRACT_PLURAL_EXPRESSION extract_plural_expression
+#endif
+
+extern void FREE_EXPRESSION (struct expression *exp)
+ internal_function;
+extern int PLURAL_PARSE (void *arg);
+extern struct expression GERMANIC_PLURAL attribute_hidden;
+extern void EXTRACT_PLURAL_EXPRESSION (const char *nullentry,
+ struct expression **pluralp,
+ unsigned long int *npluralsp)
+ internal_function;
+
+#if !defined (_LIBC) && !defined (IN_LIBINTL)
+extern unsigned long int plural_eval (struct expression *pexp,
+ unsigned long int n);
+#endif
+
+#endif /* _PLURAL_EXP_H */
--- /dev/null
+/* A Bison parser, made from plural.y
+ by GNU bison 1.35. */
+
+#define YYBISON 1 /* Identify Bison output. */
+
+#define yyparse __gettextparse
+#define yylex __gettextlex
+#define yyerror __gettexterror
+#define yylval __gettextlval
+#define yychar __gettextchar
+#define yydebug __gettextdebug
+#define yynerrs __gettextnerrs
+# define EQUOP2 257
+# define CMPOP2 258
+# define ADDOP2 259
+# define MULOP2 260
+# define NUMBER 261
+
+#line 1 "plural.y"
+
+/* Expression parsing for plural form selection.
+ Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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 bison generated parser uses alloca. AIX 3 forces us to put this
+ declaration at the beginning of the file. The declaration in bison's
+ skeleton file comes too late. This must come before <config.h>
+ because <config.h> may include arbitrary system headers. */
+#if defined _AIX && !defined __GNUC__
+ #pragma alloca
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+#include "plural-exp.h"
+
+/* The main function generated by the parser is called __gettextparse,
+ but we want it to be called PLURAL_PARSE. */
+#ifndef _LIBC
+# define __gettextparse PLURAL_PARSE
+#endif
+
+#define YYLEX_PARAM &((struct parse_args *) arg)->cp
+#define YYPARSE_PARAM arg
+
+#line 49 "plural.y"
+#ifndef YYSTYPE
+typedef union {
+ unsigned long int num;
+ enum operator op;
+ struct expression *exp;
+} yystype;
+# define YYSTYPE yystype
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+#line 55 "plural.y"
+
+/* Prototypes for local functions. */
+static int yylex (YYSTYPE *lval, const char **pexp);
+static void yyerror (const char *str);
+
+/* Allocation of expressions. */
+
+static struct expression *
+new_exp (int nargs, enum operator op, struct expression * const *args)
+{
+ int i;
+ struct expression *newp;
+
+ /* If any of the argument could not be malloc'ed, just return NULL. */
+ for (i = nargs - 1; i >= 0; i--)
+ if (args[i] == NULL)
+ goto fail;
+
+ /* Allocate a new expression. */
+ newp = (struct expression *) malloc (sizeof (*newp));
+ if (newp != NULL)
+ {
+ newp->nargs = nargs;
+ newp->operation = op;
+ for (i = nargs - 1; i >= 0; i--)
+ newp->val.args[i] = args[i];
+ return newp;
+ }
+
+ fail:
+ for (i = nargs - 1; i >= 0; i--)
+ FREE_EXPRESSION (args[i]);
+
+ return NULL;
+}
+
+static inline struct expression *
+new_exp_0 (enum operator op)
+{
+ return new_exp (0, op, NULL);
+}
+
+static inline struct expression *
+new_exp_1 (enum operator op, struct expression *right)
+{
+ struct expression *args[1];
+
+ args[0] = right;
+ return new_exp (1, op, args);
+}
+
+static struct expression *
+new_exp_2 (enum operator op, struct expression *left, struct expression *right)
+{
+ struct expression *args[2];
+
+ args[0] = left;
+ args[1] = right;
+ return new_exp (2, op, args);
+}
+
+static inline struct expression *
+new_exp_3 (enum operator op, struct expression *bexp,
+ struct expression *tbranch, struct expression *fbranch)
+{
+ struct expression *args[3];
+
+ args[0] = bexp;
+ args[1] = tbranch;
+ args[2] = fbranch;
+ return new_exp (3, op, args);
+}
+
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+
+
+
+#define YYFINAL 27
+#define YYFLAG -32768
+#define YYNTBASE 16
+
+/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
+#define YYTRANSLATE(x) ((unsigned)(x) <= 261 ? yytranslate[x] : 18)
+
+/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
+static const char yytranslate[] =
+{
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 10, 2, 2, 2, 2, 5, 2,
+ 14, 15, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 12, 2,
+ 2, 2, 2, 3, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 13, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 4, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 6, 7, 8,
+ 9, 11
+};
+
+#if YYDEBUG
+static const short yyprhs[] =
+{
+ 0, 0, 2, 8, 12, 16, 20, 24, 28, 32,
+ 35, 37, 39
+};
+static const short yyrhs[] =
+{
+ 17, 0, 17, 3, 17, 12, 17, 0, 17, 4,
+ 17, 0, 17, 5, 17, 0, 17, 6, 17, 0,
+ 17, 7, 17, 0, 17, 8, 17, 0, 17, 9,
+ 17, 0, 10, 17, 0, 13, 0, 11, 0, 14,
+ 17, 15, 0
+};
+
+#endif
+
+#if YYDEBUG
+/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
+static const short yyrline[] =
+{
+ 0, 150, 158, 162, 166, 170, 174, 178, 182, 186,
+ 190, 194, 199
+};
+#endif
+
+
+#if (YYDEBUG) || defined YYERROR_VERBOSE
+
+/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
+static const char *const yytname[] =
+{
+ "$", "error", "$undefined.", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2",
+ "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'",
+ "start", "exp", 0
+};
+#endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const short yyr1[] =
+{
+ 0, 16, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
+static const short yyr2[] =
+{
+ 0, 1, 5, 3, 3, 3, 3, 3, 3, 2,
+ 1, 1, 3
+};
+
+/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
+ doesn't specify something else to do. Zero means the default is an
+ error. */
+static const short yydefact[] =
+{
+ 0, 0, 11, 10, 0, 1, 9, 0, 0, 0,
+ 0, 0, 0, 0, 0, 12, 0, 3, 4, 5,
+ 6, 7, 8, 0, 2, 0, 0, 0
+};
+
+static const short yydefgoto[] =
+{
+ 25, 5
+};
+
+static const short yypact[] =
+{
+ -9, -9,-32768,-32768, -9, 34,-32768, 11, -9, -9,
+ -9, -9, -9, -9, -9,-32768, 24, 39, 43, 16,
+ 26, -3,-32768, -9, 34, 21, 53,-32768
+};
+
+static const short yypgoto[] =
+{
+ -32768, -1
+};
+
+
+#define YYLAST 53
+
+
+static const short yytable[] =
+{
+ 6, 1, 2, 7, 3, 4, 14, 16, 17, 18,
+ 19, 20, 21, 22, 8, 9, 10, 11, 12, 13,
+ 14, 26, 24, 12, 13, 14, 15, 8, 9, 10,
+ 11, 12, 13, 14, 13, 14, 23, 8, 9, 10,
+ 11, 12, 13, 14, 10, 11, 12, 13, 14, 11,
+ 12, 13, 14, 27
+};
+
+static const short yycheck[] =
+{
+ 1, 10, 11, 4, 13, 14, 9, 8, 9, 10,
+ 11, 12, 13, 14, 3, 4, 5, 6, 7, 8,
+ 9, 0, 23, 7, 8, 9, 15, 3, 4, 5,
+ 6, 7, 8, 9, 8, 9, 12, 3, 4, 5,
+ 6, 7, 8, 9, 5, 6, 7, 8, 9, 6,
+ 7, 8, 9, 0
+};
+#define YYPURE 1
+
+/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
+#line 3 "/usr/local/share/bison/bison.simple"
+
+/* Skeleton output parser for bison,
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* As a special exception, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison. */
+
+/* This is the parser code that is written into each bison parser when
+ the %semantic_parser declaration is not specified in the grammar.
+ It was written by Richard Stallman by simplifying the hairy parser
+ used when %semantic_parser is specified. */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+ infringing on user name space. This should be done even for local
+ variables, as they might otherwise be expanded by user macros.
+ There are some unavoidable exceptions within include files to
+ define necessary library symbols; they are noted "INFRINGES ON
+ USER NAME SPACE" below. */
+
+#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
+
+/* The parser invokes alloca or malloc; define the necessary symbols. */
+
+# if YYSTACK_USE_ALLOCA
+# define YYSTACK_ALLOC alloca
+# else
+# ifndef YYSTACK_USE_ALLOCA
+# if defined (alloca) || defined (_ALLOCA_H)
+# define YYSTACK_ALLOC alloca
+# else
+# ifdef __GNUC__
+# define YYSTACK_ALLOC __builtin_alloca
+# endif
+# endif
+# endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+ /* Pacify GCC's `empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+# else
+# if defined (__STDC__) || defined (__cplusplus)
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# endif
+# define YYSTACK_ALLOC malloc
+# define YYSTACK_FREE free
+# endif
+#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
+
+
+#if (! defined (yyoverflow) \
+ && (! defined (__cplusplus) \
+ || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member. */
+union yyalloc
+{
+ short yyss;
+ YYSTYPE yyvs;
+# if YYLSP_NEEDED
+ YYLTYPE yyls;
+# endif
+};
+
+/* The size of the maximum gap between one aligned stack and the next. */
+# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+ N elements. */
+# if YYLSP_NEEDED
+# define YYSTACK_BYTES(N) \
+ ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+ + 2 * YYSTACK_GAP_MAX)
+# else
+# define YYSTACK_BYTES(N) \
+ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
+ + YYSTACK_GAP_MAX)
+# endif
+
+/* Copy COUNT objects from FROM to TO. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if 1 < __GNUC__
+# define YYCOPY(To, From, Count) \
+ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+# else
+# define YYCOPY(To, From, Count) \
+ do \
+ { \
+ register YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (To)[yyi] = (From)[yyi]; \
+ } \
+ while (0)
+# endif
+# endif
+
+/* Relocate STACK from its old location to the new one. The
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
+ elements in the stack, and YYPTR gives the new location of the
+ stack. Advance YYPTR to a properly aligned location for the next
+ stack. */
+# define YYSTACK_RELOCATE(Stack) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack, Stack, yysize); \
+ Stack = &yyptr->Stack; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
+ while (0)
+
+#endif
+
+
+#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
+# define YYSIZE_T __SIZE_TYPE__
+#endif
+#if ! defined (YYSIZE_T) && defined (size_t)
+# define YYSIZE_T size_t
+#endif
+#if ! defined (YYSIZE_T)
+# if defined (__STDC__) || defined (__cplusplus)
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# endif
+#endif
+#if ! defined (YYSIZE_T)
+# define YYSIZE_T unsigned int
+#endif
+
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY -2
+#define YYEOF 0
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrlab1
+/* Like YYERROR except do call yyerror. This remains here temporarily
+ to ease the transition to the new meaning of YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. */
+#define YYFAIL goto yyerrlab
+#define YYRECOVERING() (!!yyerrstatus)
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY && yylen == 1) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ yychar1 = YYTRANSLATE (yychar); \
+ YYPOPSTACK; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror ("syntax error: cannot back up"); \
+ YYERROR; \
+ } \
+while (0)
+
+#define YYTERROR 1
+#define YYERRCODE 256
+
+
+/* YYLLOC_DEFAULT -- Compute the default location (before the actions
+ are run).
+
+ When YYLLOC_DEFAULT is run, CURRENT is set the location of the
+ first token. By default, to implement support for ranges, extend
+ its range to the last symbol. */
+
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ Current.last_line = Rhs[N].last_line; \
+ Current.last_column = Rhs[N].last_column;
+#endif
+
+
+/* YYLEX -- calling `yylex' with the right arguments. */
+
+#if YYPURE
+# if YYLSP_NEEDED
+# ifdef YYLEX_PARAM
+# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
+# else
+# define YYLEX yylex (&yylval, &yylloc)
+# endif
+# else /* !YYLSP_NEEDED */
+# ifdef YYLEX_PARAM
+# define YYLEX yylex (&yylval, YYLEX_PARAM)
+# else
+# define YYLEX yylex (&yylval)
+# endif
+# endif /* !YYLSP_NEEDED */
+#else /* !YYPURE */
+# define YYLEX yylex ()
+#endif /* !YYPURE */
+
+
+/* Enable debugging if requested. */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+# define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
+} while (0)
+/* Nonzero means print parse trace. It is left uninitialized so that
+ multiple parsers can coexist. */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+#endif /* !YYDEBUG */
+
+/* YYINITDEPTH -- initial size of the parser's stacks. */
+#ifndef YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+ if the built-in stack extension method is used).
+
+ Do not make this value too large; the results are undefined if
+ SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+ evaluated with infinite-precision integer arithmetic. */
+
+#if YYMAXDEPTH == 0
+# undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+\f
+#ifdef YYERROR_VERBOSE
+
+# ifndef yystrlen
+# if defined (__GLIBC__) && defined (_STRING_H)
+# define yystrlen strlen
+# else
+/* Return the length of YYSTR. */
+static YYSIZE_T
+# if defined (__STDC__) || defined (__cplusplus)
+yystrlen (const char *yystr)
+# else
+yystrlen (yystr)
+ const char *yystr;
+# endif
+{
+ register const char *yys = yystr;
+
+ while (*yys++ != '\0')
+ continue;
+
+ return yys - yystr - 1;
+}
+# endif
+# endif
+
+# ifndef yystpcpy
+# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+# define yystpcpy stpcpy
+# else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+ YYDEST. */
+static char *
+# if defined (__STDC__) || defined (__cplusplus)
+yystpcpy (char *yydest, const char *yysrc)
+# else
+yystpcpy (yydest, yysrc)
+ char *yydest;
+ const char *yysrc;
+# endif
+{
+ register char *yyd = yydest;
+ register const char *yys = yysrc;
+
+ while ((*yyd++ = *yys++) != '\0')
+ continue;
+
+ return yyd - 1;
+}
+# endif
+# endif
+#endif
+\f
+#line 315 "/usr/local/share/bison/bison.simple"
+
+
+/* The user can define YYPARSE_PARAM as the name of an argument to be passed
+ into yyparse. The argument should have type void *.
+ It should actually point to an object.
+ Grammar actions can access the variable by casting it
+ to the proper pointer type. */
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
+# define YYPARSE_PARAM_DECL
+# else
+# define YYPARSE_PARAM_ARG YYPARSE_PARAM
+# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
+# endif
+#else /* !YYPARSE_PARAM */
+# define YYPARSE_PARAM_ARG
+# define YYPARSE_PARAM_DECL
+#endif /* !YYPARSE_PARAM */
+
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
+# ifdef YYPARSE_PARAM
+int yyparse (void *);
+# else
+int yyparse (void);
+# endif
+#endif
+
+/* YY_DECL_VARIABLES -- depending whether we use a pure parser,
+ variables are global, or local to YYPARSE. */
+
+#define YY_DECL_NON_LSP_VARIABLES \
+/* The lookahead symbol. */ \
+int yychar; \
+ \
+/* The semantic value of the lookahead symbol. */ \
+YYSTYPE yylval; \
+ \
+/* Number of parse errors so far. */ \
+int yynerrs;
+
+#if YYLSP_NEEDED
+# define YY_DECL_VARIABLES \
+YY_DECL_NON_LSP_VARIABLES \
+ \
+/* Location data for the lookahead symbol. */ \
+YYLTYPE yylloc;
+#else
+# define YY_DECL_VARIABLES \
+YY_DECL_NON_LSP_VARIABLES
+#endif
+
+
+/* If nonreentrant, generate the variables here. */
+
+#if !YYPURE
+YY_DECL_VARIABLES
+#endif /* !YYPURE */
+
+int
+yyparse (YYPARSE_PARAM_ARG)
+ YYPARSE_PARAM_DECL
+{
+ /* If reentrant, generate the variables here. */
+#if YYPURE
+ YY_DECL_VARIABLES
+#endif /* !YYPURE */
+
+ register int yystate;
+ register int yyn;
+ int yyresult;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
+ /* Lookahead token as an internal (translated) token number. */
+ int yychar1 = 0;
+
+ /* Three stacks and their tools:
+ `yyss': related to states,
+ `yyvs': related to semantic values,
+ `yyls': related to locations.
+
+ Refer to the stacks thru separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
+
+ /* The state stack. */
+ short yyssa[YYINITDEPTH];
+ short *yyss = yyssa;
+ register short *yyssp;
+
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs = yyvsa;
+ register YYSTYPE *yyvsp;
+
+#if YYLSP_NEEDED
+ /* The location stack. */
+ YYLTYPE yylsa[YYINITDEPTH];
+ YYLTYPE *yyls = yylsa;
+ YYLTYPE *yylsp;
+#endif
+
+#if YYLSP_NEEDED
+# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
+#else
+# define YYPOPSTACK (yyvsp--, yyssp--)
+#endif
+
+ YYSIZE_T yystacksize = YYINITDEPTH;
+
+
+ /* The variables used to return semantic value and location from the
+ action routines. */
+ YYSTYPE yyval;
+#if YYLSP_NEEDED
+ YYLTYPE yyloc;
+#endif
+
+ /* When reducing, the number of symbols on the RHS of the reduced
+ rule. */
+ int yylen;
+
+ YYDPRINTF ((stderr, "Starting parse\n"));
+
+ yystate = 0;
+ yyerrstatus = 0;
+ yynerrs = 0;
+ yychar = YYEMPTY; /* Cause a token to be read. */
+
+ /* Initialize stack pointers.
+ Waste one element of value and location stack
+ so that they stay on the same level as the state stack.
+ The wasted elements are never initialized. */
+
+ yyssp = yyss;
+ yyvsp = yyvs;
+#if YYLSP_NEEDED
+ yylsp = yyls;
+#endif
+ goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate. |
+`------------------------------------------------------------*/
+ yynewstate:
+ /* In all cases, when you get here, the value and location stacks
+ have just been pushed. so pushing a state here evens the stacks.
+ */
+ yyssp++;
+
+ yysetstate:
+ *yyssp = yystate;
+
+ if (yyssp >= yyss + yystacksize - 1)
+ {
+ /* Get the current used size of the three stacks, in elements. */
+ YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+ {
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ short *yyss1 = yyss;
+
+ /* Each stack pointer address is followed by the size of the
+ data in use in that stack, in bytes. */
+# if YYLSP_NEEDED
+ YYLTYPE *yyls1 = yyls;
+ /* This used to be a conditional around just the two extra args,
+ but that might be undefined if yyoverflow is a macro. */
+ yyoverflow ("parser stack overflow",
+ &yyss1, yysize * sizeof (*yyssp),
+ &yyvs1, yysize * sizeof (*yyvsp),
+ &yyls1, yysize * sizeof (*yylsp),
+ &yystacksize);
+ yyls = yyls1;
+# else
+ yyoverflow ("parser stack overflow",
+ &yyss1, yysize * sizeof (*yyssp),
+ &yyvs1, yysize * sizeof (*yyvsp),
+ &yystacksize);
+# endif
+ yyss = yyss1;
+ yyvs = yyvs1;
+ }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+ goto yyoverflowlab;
+# else
+ /* Extend the stack our own way. */
+ if (yystacksize >= YYMAXDEPTH)
+ goto yyoverflowlab;
+ yystacksize *= 2;
+ if (yystacksize > YYMAXDEPTH)
+ yystacksize = YYMAXDEPTH;
+
+ {
+ short *yyss1 = yyss;
+ union yyalloc *yyptr =
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ if (! yyptr)
+ goto yyoverflowlab;
+ YYSTACK_RELOCATE (yyss);
+ YYSTACK_RELOCATE (yyvs);
+# if YYLSP_NEEDED
+ YYSTACK_RELOCATE (yyls);
+# endif
+# undef YYSTACK_RELOCATE
+ if (yyss1 != yyssa)
+ YYSTACK_FREE (yyss1);
+ }
+# endif
+#endif /* no yyoverflow */
+
+ yyssp = yyss + yysize - 1;
+ yyvsp = yyvs + yysize - 1;
+#if YYLSP_NEEDED
+ yylsp = yyls + yysize - 1;
+#endif
+
+ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+ (unsigned long int) yystacksize));
+
+ if (yyssp >= yyss + yystacksize - 1)
+ YYABORT;
+ }
+
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+ goto yybackup;
+
+
+/*-----------.
+| yybackup. |
+`-----------*/
+yybackup:
+
+/* Do appropriate processing given the current state. */
+/* Read a lookahead token if we need one and don't already have one. */
+/* yyresume: */
+
+ /* First try to decide what to do without reference to lookahead token. */
+
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* yychar is either YYEMPTY or YYEOF
+ or a valid token in external form. */
+
+ if (yychar == YYEMPTY)
+ {
+ YYDPRINTF ((stderr, "Reading a token: "));
+ yychar = YYLEX;
+ }
+
+ /* Convert token to internal form (in yychar1) for indexing tables with */
+
+ if (yychar <= 0) /* This means end of input. */
+ {
+ yychar1 = 0;
+ yychar = YYEOF; /* Don't call YYLEX any more */
+
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
+ }
+ else
+ {
+ yychar1 = YYTRANSLATE (yychar);
+
+#if YYDEBUG
+ /* We have to keep this `#if YYDEBUG', since we use variables
+ which are defined only if `YYDEBUG' is set. */
+ if (yydebug)
+ {
+ YYFPRINTF (stderr, "Next token is %d (%s",
+ yychar, yytname[yychar1]);
+ /* Give the individual parser a way to print the precise
+ meaning of a token, for further debugging info. */
+# ifdef YYPRINT
+ YYPRINT (stderr, yychar, yylval);
+# endif
+ YYFPRINTF (stderr, ")\n");
+ }
+#endif
+ }
+
+ yyn += yychar1;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
+ goto yydefault;
+
+ yyn = yytable[yyn];
+
+ /* yyn is what to do for this token type in this state.
+ Negative => reduce, -yyn is rule number.
+ Positive => shift, yyn is new state.
+ New state is final state => don't bother to shift,
+ just return success.
+ 0, or most negative number => error. */
+
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+ else if (yyn == 0)
+ goto yyerrlab;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ /* Shift the lookahead token. */
+ YYDPRINTF ((stderr, "Shifting token %d (%s), ",
+ yychar, yytname[yychar1]));
+
+ /* Discard the token being shifted unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
+ *++yyvsp = yylval;
+#if YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
+
+ /* Count tokens shifted since error; after three, turn off error
+ status. */
+ if (yyerrstatus)
+ yyerrstatus--;
+
+ yystate = yyn;
+ goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state. |
+`-----------------------------------------------------------*/
+yydefault:
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+ goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction. |
+`-----------------------------*/
+yyreduce:
+ /* yyn is the number of a rule to reduce with. */
+ yylen = yyr2[yyn];
+
+ /* If YYLEN is nonzero, implement the default value of the action:
+ `$$ = $1'.
+
+ Otherwise, the following line sets YYVAL to the semantic value of
+ the lookahead token. This behavior is undocumented and Bison
+ users should not rely upon it. Assigning to YYVAL
+ unconditionally makes the parser a bit smaller, and it avoids a
+ GCC warning that YYVAL may be used uninitialized. */
+ yyval = yyvsp[1-yylen];
+
+#if YYLSP_NEEDED
+ /* Similarly for the default location. Let the user run additional
+ commands if for instance locations are ranges. */
+ yyloc = yylsp[1-yylen];
+ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
+#endif
+
+#if YYDEBUG
+ /* We have to keep this `#if YYDEBUG', since we use variables which
+ are defined only if `YYDEBUG' is set. */
+ if (yydebug)
+ {
+ int yyi;
+
+ YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
+ yyn, yyrline[yyn]);
+
+ /* Print the symbols being reduced, and their result. */
+ for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
+ YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
+ YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
+ }
+#endif
+
+ switch (yyn) {
+
+case 1:
+#line 151 "plural.y"
+{
+ if (yyvsp[0].exp == NULL)
+ YYABORT;
+ ((struct parse_args *) arg)->res = yyvsp[0].exp;
+ }
+ break;
+case 2:
+#line 159 "plural.y"
+{
+ yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp);
+ }
+ break;
+case 3:
+#line 163 "plural.y"
+{
+ yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp);
+ }
+ break;
+case 4:
+#line 167 "plural.y"
+{
+ yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp);
+ }
+ break;
+case 5:
+#line 171 "plural.y"
+{
+ yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
+ }
+ break;
+case 6:
+#line 175 "plural.y"
+{
+ yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
+ }
+ break;
+case 7:
+#line 179 "plural.y"
+{
+ yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
+ }
+ break;
+case 8:
+#line 183 "plural.y"
+{
+ yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
+ }
+ break;
+case 9:
+#line 187 "plural.y"
+{
+ yyval.exp = new_exp_1 (lnot, yyvsp[0].exp);
+ }
+ break;
+case 10:
+#line 191 "plural.y"
+{
+ yyval.exp = new_exp_0 (var);
+ }
+ break;
+case 11:
+#line 195 "plural.y"
+{
+ if ((yyval.exp = new_exp_0 (num)) != NULL)
+ yyval.exp->val.num = yyvsp[0].num;
+ }
+ break;
+case 12:
+#line 200 "plural.y"
+{
+ yyval.exp = yyvsp[-1].exp;
+ }
+ break;
+}
+
+#line 705 "/usr/local/share/bison/bison.simple"
+
+\f
+ yyvsp -= yylen;
+ yyssp -= yylen;
+#if YYLSP_NEEDED
+ yylsp -= yylen;
+#endif
+
+#if YYDEBUG
+ if (yydebug)
+ {
+ short *yyssp1 = yyss - 1;
+ YYFPRINTF (stderr, "state stack now");
+ while (yyssp1 != yyssp)
+ YYFPRINTF (stderr, " %d", *++yyssp1);
+ YYFPRINTF (stderr, "\n");
+ }
+#endif
+
+ *++yyvsp = yyval;
+#if YYLSP_NEEDED
+ *++yylsp = yyloc;
+#endif
+
+ /* Now `shift' the result of the reduction. Determine what state
+ that goes to, based on the state we popped back to and the rule
+ number reduced by. */
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
+ if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTBASE];
+
+ goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+ /* If not already recovering from an error, report this error. */
+ if (!yyerrstatus)
+ {
+ ++yynerrs;
+
+#ifdef YYERROR_VERBOSE
+ yyn = yypact[yystate];
+
+ if (yyn > YYFLAG && yyn < YYLAST)
+ {
+ YYSIZE_T yysize = 0;
+ char *yymsg;
+ int yyx, yycount;
+
+ yycount = 0;
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ for (yyx = yyn < 0 ? -yyn : 0;
+ yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
+ if (yycheck[yyx + yyn] == yyx)
+ yysize += yystrlen (yytname[yyx]) + 15, yycount++;
+ yysize += yystrlen ("parse error, unexpected ") + 1;
+ yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
+ yymsg = (char *) YYSTACK_ALLOC (yysize);
+ if (yymsg != 0)
+ {
+ char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
+ yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
+
+ if (yycount < 5)
+ {
+ yycount = 0;
+ for (yyx = yyn < 0 ? -yyn : 0;
+ yyx < (int) (sizeof (yytname) / sizeof (char *));
+ yyx++)
+ if (yycheck[yyx + yyn] == yyx)
+ {
+ const char *yyq = ! yycount ? ", expecting " : " or ";
+ yyp = yystpcpy (yyp, yyq);
+ yyp = yystpcpy (yyp, yytname[yyx]);
+ yycount++;
+ }
+ }
+ yyerror (yymsg);
+ YYSTACK_FREE (yymsg);
+ }
+ else
+ yyerror ("parse error; also virtual memory exhausted");
+ }
+ else
+#endif /* defined (YYERROR_VERBOSE) */
+ yyerror ("parse error");
+ }
+ goto yyerrlab1;
+
+
+/*--------------------------------------------------.
+| yyerrlab1 -- error raised explicitly by an action |
+`--------------------------------------------------*/
+yyerrlab1:
+ if (yyerrstatus == 3)
+ {
+ /* If just tried and failed to reuse lookahead token after an
+ error, discard it. */
+
+ /* return failure if at end of input */
+ if (yychar == YYEOF)
+ YYABORT;
+ YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
+ yychar, yytname[yychar1]));
+ yychar = YYEMPTY;
+ }
+
+ /* Else will try to reuse lookahead token after shifting the error
+ token. */
+
+ yyerrstatus = 3; /* Each real token shifted decrements this */
+
+ goto yyerrhandle;
+
+
+/*-------------------------------------------------------------------.
+| yyerrdefault -- current state does not do anything special for the |
+| error token. |
+`-------------------------------------------------------------------*/
+yyerrdefault:
+#if 0
+ /* This is wrong; only states that explicitly want error tokens
+ should shift them. */
+
+ /* If its default is to accept any token, ok. Otherwise pop it. */
+ yyn = yydefact[yystate];
+ if (yyn)
+ goto yydefault;
+#endif
+
+
+/*---------------------------------------------------------------.
+| yyerrpop -- pop the current state because it cannot handle the |
+| error token |
+`---------------------------------------------------------------*/
+yyerrpop:
+ if (yyssp == yyss)
+ YYABORT;
+ yyvsp--;
+ yystate = *--yyssp;
+#if YYLSP_NEEDED
+ yylsp--;
+#endif
+
+#if YYDEBUG
+ if (yydebug)
+ {
+ short *yyssp1 = yyss - 1;
+ YYFPRINTF (stderr, "Error: state stack now");
+ while (yyssp1 != yyssp)
+ YYFPRINTF (stderr, " %d", *++yyssp1);
+ YYFPRINTF (stderr, "\n");
+ }
+#endif
+
+/*--------------.
+| yyerrhandle. |
+`--------------*/
+yyerrhandle:
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yyerrdefault;
+
+ yyn += YYTERROR;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
+ goto yyerrdefault;
+
+ yyn = yytable[yyn];
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrpop;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+ else if (yyn == 0)
+ goto yyerrpop;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ YYDPRINTF ((stderr, "Shifting error token, "));
+
+ *++yyvsp = yylval;
+#if YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
+
+ yystate = yyn;
+ goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here. |
+`-------------------------------------*/
+yyacceptlab:
+ yyresult = 0;
+ goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here. |
+`-----------------------------------*/
+yyabortlab:
+ yyresult = 1;
+ goto yyreturn;
+
+/*---------------------------------------------.
+| yyoverflowab -- parser overflow comes here. |
+`---------------------------------------------*/
+yyoverflowlab:
+ yyerror ("parser stack overflow");
+ yyresult = 2;
+ /* Fall through. */
+
+yyreturn:
+#ifndef yyoverflow
+ if (yyss != yyssa)
+ YYSTACK_FREE (yyss);
+#endif
+ return yyresult;
+}
+#line 205 "plural.y"
+
+
+void
+internal_function
+FREE_EXPRESSION (struct expression *exp)
+{
+ if (exp == NULL)
+ return;
+
+ /* Handle the recursive case. */
+ switch (exp->nargs)
+ {
+ case 3:
+ FREE_EXPRESSION (exp->val.args[2]);
+ /* FALLTHROUGH */
+ case 2:
+ FREE_EXPRESSION (exp->val.args[1]);
+ /* FALLTHROUGH */
+ case 1:
+ FREE_EXPRESSION (exp->val.args[0]);
+ /* FALLTHROUGH */
+ default:
+ break;
+ }
+
+ free (exp);
+}
+
+
+static int
+yylex (YYSTYPE *lval, const char **pexp)
+{
+ const char *exp = *pexp;
+ int result;
+
+ while (1)
+ {
+ if (exp[0] == '\0')
+ {
+ *pexp = exp;
+ return YYEOF;
+ }
+
+ if (exp[0] != ' ' && exp[0] != '\t')
+ break;
+
+ ++exp;
+ }
+
+ result = *exp++;
+ switch (result)
+ {
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ {
+ unsigned long int n = result - '0';
+ while (exp[0] >= '0' && exp[0] <= '9')
+ {
+ n *= 10;
+ n += exp[0] - '0';
+ ++exp;
+ }
+ lval->num = n;
+ result = NUMBER;
+ }
+ break;
+
+ case '=':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = equal;
+ result = EQUOP2;
+ }
+ else
+ result = YYERRCODE;
+ break;
+
+ case '!':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = not_equal;
+ result = EQUOP2;
+ }
+ break;
+
+ case '&':
+ case '|':
+ if (exp[0] == result)
+ ++exp;
+ else
+ result = YYERRCODE;
+ break;
+
+ case '<':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = less_or_equal;
+ }
+ else
+ lval->op = less_than;
+ result = CMPOP2;
+ break;
+
+ case '>':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = greater_or_equal;
+ }
+ else
+ lval->op = greater_than;
+ result = CMPOP2;
+ break;
+
+ case '*':
+ lval->op = mult;
+ result = MULOP2;
+ break;
+
+ case '/':
+ lval->op = divide;
+ result = MULOP2;
+ break;
+
+ case '%':
+ lval->op = module;
+ result = MULOP2;
+ break;
+
+ case '+':
+ lval->op = plus;
+ result = ADDOP2;
+ break;
+
+ case '-':
+ lval->op = minus;
+ result = ADDOP2;
+ break;
+
+ case 'n':
+ case '?':
+ case ':':
+ case '(':
+ case ')':
+ /* Nothing, just return the character. */
+ break;
+
+ case ';':
+ case '\n':
+ case '\0':
+ /* Be safe and let the user call this function again. */
+ --exp;
+ result = YYEOF;
+ break;
+
+ default:
+ result = YYERRCODE;
+#if YYDEBUG != 0
+ --exp;
+#endif
+ break;
+ }
+
+ *pexp = exp;
+
+ return result;
+}
+
+
+static void
+yyerror (const char *str)
+{
+ /* Do nothing. We don't print error messages here. */
+}
--- /dev/null
+%{
+/* Expression parsing for plural form selection.
+ Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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 bison generated parser uses alloca. AIX 3 forces us to put this
+ declaration at the beginning of the file. The declaration in bison's
+ skeleton file comes too late. This must come before <config.h>
+ because <config.h> may include arbitrary system headers. */
+#if defined _AIX && !defined __GNUC__
+ #pragma alloca
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+#include "plural-exp.h"
+
+/* The main function generated by the parser is called __gettextparse,
+ but we want it to be called PLURAL_PARSE. */
+#ifndef _LIBC
+# define __gettextparse PLURAL_PARSE
+#endif
+
+#define YYLEX_PARAM &((struct parse_args *) arg)->cp
+#define YYPARSE_PARAM arg
+%}
+%pure_parser
+%expect 7
+
+%union {
+ unsigned long int num;
+ enum operator op;
+ struct expression *exp;
+}
+
+%{
+/* Prototypes for local functions. */
+static int yylex (YYSTYPE *lval, const char **pexp);
+static void yyerror (const char *str);
+
+/* Allocation of expressions. */
+
+static struct expression *
+new_exp (int nargs, enum operator op, struct expression * const *args)
+{
+ int i;
+ struct expression *newp;
+
+ /* If any of the argument could not be malloc'ed, just return NULL. */
+ for (i = nargs - 1; i >= 0; i--)
+ if (args[i] == NULL)
+ goto fail;
+
+ /* Allocate a new expression. */
+ newp = (struct expression *) malloc (sizeof (*newp));
+ if (newp != NULL)
+ {
+ newp->nargs = nargs;
+ newp->operation = op;
+ for (i = nargs - 1; i >= 0; i--)
+ newp->val.args[i] = args[i];
+ return newp;
+ }
+
+ fail:
+ for (i = nargs - 1; i >= 0; i--)
+ FREE_EXPRESSION (args[i]);
+
+ return NULL;
+}
+
+static inline struct expression *
+new_exp_0 (enum operator op)
+{
+ return new_exp (0, op, NULL);
+}
+
+static inline struct expression *
+new_exp_1 (enum operator op, struct expression *right)
+{
+ struct expression *args[1];
+
+ args[0] = right;
+ return new_exp (1, op, args);
+}
+
+static struct expression *
+new_exp_2 (enum operator op, struct expression *left, struct expression *right)
+{
+ struct expression *args[2];
+
+ args[0] = left;
+ args[1] = right;
+ return new_exp (2, op, args);
+}
+
+static inline struct expression *
+new_exp_3 (enum operator op, struct expression *bexp,
+ struct expression *tbranch, struct expression *fbranch)
+{
+ struct expression *args[3];
+
+ args[0] = bexp;
+ args[1] = tbranch;
+ args[2] = fbranch;
+ return new_exp (3, op, args);
+}
+
+%}
+
+/* This declares that all operators have the same associativity and the
+ precedence order as in C. See [Harbison, Steele: C, A Reference Manual].
+ There is no unary minus and no bitwise operators.
+ Operators with the same syntactic behaviour have been merged into a single
+ token, to save space in the array generated by bison. */
+%right '?' /* ? */
+%left '|' /* || */
+%left '&' /* && */
+%left EQUOP2 /* == != */
+%left CMPOP2 /* < > <= >= */
+%left ADDOP2 /* + - */
+%left MULOP2 /* * / % */
+%right '!' /* ! */
+
+%token <op> EQUOP2 CMPOP2 ADDOP2 MULOP2
+%token <num> NUMBER
+%type <exp> exp
+
+%%
+
+start: exp
+ {
+ if ($1 == NULL)
+ YYABORT;
+ ((struct parse_args *) arg)->res = $1;
+ }
+ ;
+
+exp: exp '?' exp ':' exp
+ {
+ $$ = new_exp_3 (qmop, $1, $3, $5);
+ }
+ | exp '|' exp
+ {
+ $$ = new_exp_2 (lor, $1, $3);
+ }
+ | exp '&' exp
+ {
+ $$ = new_exp_2 (land, $1, $3);
+ }
+ | exp EQUOP2 exp
+ {
+ $$ = new_exp_2 ($2, $1, $3);
+ }
+ | exp CMPOP2 exp
+ {
+ $$ = new_exp_2 ($2, $1, $3);
+ }
+ | exp ADDOP2 exp
+ {
+ $$ = new_exp_2 ($2, $1, $3);
+ }
+ | exp MULOP2 exp
+ {
+ $$ = new_exp_2 ($2, $1, $3);
+ }
+ | '!' exp
+ {
+ $$ = new_exp_1 (lnot, $2);
+ }
+ | 'n'
+ {
+ $$ = new_exp_0 (var);
+ }
+ | NUMBER
+ {
+ if (($$ = new_exp_0 (num)) != NULL)
+ $$->val.num = $1;
+ }
+ | '(' exp ')'
+ {
+ $$ = $2;
+ }
+ ;
+
+%%
+
+void
+internal_function
+FREE_EXPRESSION (struct expression *exp)
+{
+ if (exp == NULL)
+ return;
+
+ /* Handle the recursive case. */
+ switch (exp->nargs)
+ {
+ case 3:
+ FREE_EXPRESSION (exp->val.args[2]);
+ /* FALLTHROUGH */
+ case 2:
+ FREE_EXPRESSION (exp->val.args[1]);
+ /* FALLTHROUGH */
+ case 1:
+ FREE_EXPRESSION (exp->val.args[0]);
+ /* FALLTHROUGH */
+ default:
+ break;
+ }
+
+ free (exp);
+}
+
+
+static int
+yylex (YYSTYPE *lval, const char **pexp)
+{
+ const char *exp = *pexp;
+ int result;
+
+ while (1)
+ {
+ if (exp[0] == '\0')
+ {
+ *pexp = exp;
+ return YYEOF;
+ }
+
+ if (exp[0] != ' ' && exp[0] != '\t')
+ break;
+
+ ++exp;
+ }
+
+ result = *exp++;
+ switch (result)
+ {
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ {
+ unsigned long int n = result - '0';
+ while (exp[0] >= '0' && exp[0] <= '9')
+ {
+ n *= 10;
+ n += exp[0] - '0';
+ ++exp;
+ }
+ lval->num = n;
+ result = NUMBER;
+ }
+ break;
+
+ case '=':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = equal;
+ result = EQUOP2;
+ }
+ else
+ result = YYERRCODE;
+ break;
+
+ case '!':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = not_equal;
+ result = EQUOP2;
+ }
+ break;
+
+ case '&':
+ case '|':
+ if (exp[0] == result)
+ ++exp;
+ else
+ result = YYERRCODE;
+ break;
+
+ case '<':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = less_or_equal;
+ }
+ else
+ lval->op = less_than;
+ result = CMPOP2;
+ break;
+
+ case '>':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = greater_or_equal;
+ }
+ else
+ lval->op = greater_than;
+ result = CMPOP2;
+ break;
+
+ case '*':
+ lval->op = mult;
+ result = MULOP2;
+ break;
+
+ case '/':
+ lval->op = divide;
+ result = MULOP2;
+ break;
+
+ case '%':
+ lval->op = module;
+ result = MULOP2;
+ break;
+
+ case '+':
+ lval->op = plus;
+ result = ADDOP2;
+ break;
+
+ case '-':
+ lval->op = minus;
+ result = ADDOP2;
+ break;
+
+ case 'n':
+ case '?':
+ case ':':
+ case '(':
+ case ')':
+ /* Nothing, just return the character. */
+ break;
+
+ case ';':
+ case '\n':
+ case '\0':
+ /* Be safe and let the user call this function again. */
+ --exp;
+ result = YYEOF;
+ break;
+
+ default:
+ result = YYERRCODE;
+#if YYDEBUG != 0
+ --exp;
+#endif
+ break;
+ }
+
+ *pexp = exp;
+
+ return result;
+}
+
+
+static void
+yyerror (const char *str)
+{
+ /* Do nothing. We don't print error messages here. */
+}
--- /dev/null
+/* Decomposed printf argument list.
+ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification. */
+#include "printf-args.h"
+
+#ifdef STATIC
+STATIC
+#endif
+int
+printf_fetchargs (va_list args, arguments *a)
+{
+ size_t i;
+ argument *ap;
+
+ for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
+ switch (ap->type)
+ {
+ case TYPE_SCHAR:
+ ap->a.a_schar = va_arg (args, /*signed char*/ int);
+ break;
+ case TYPE_UCHAR:
+ ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
+ break;
+ case TYPE_SHORT:
+ ap->a.a_short = va_arg (args, /*short*/ int);
+ break;
+ case TYPE_USHORT:
+ ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
+ break;
+ case TYPE_INT:
+ ap->a.a_int = va_arg (args, int);
+ break;
+ case TYPE_UINT:
+ ap->a.a_uint = va_arg (args, unsigned int);
+ break;
+ case TYPE_LONGINT:
+ ap->a.a_longint = va_arg (args, long int);
+ break;
+ case TYPE_ULONGINT:
+ ap->a.a_ulongint = va_arg (args, unsigned long int);
+ break;
+#ifdef HAVE_LONG_LONG
+ case TYPE_LONGLONGINT:
+ ap->a.a_longlongint = va_arg (args, long long int);
+ break;
+ case TYPE_ULONGLONGINT:
+ ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
+ break;
+#endif
+ case TYPE_DOUBLE:
+ ap->a.a_double = va_arg (args, double);
+ break;
+#ifdef HAVE_LONG_DOUBLE
+ case TYPE_LONGDOUBLE:
+ ap->a.a_longdouble = va_arg (args, long double);
+ break;
+#endif
+ case TYPE_CHAR:
+ ap->a.a_char = va_arg (args, int);
+ break;
+#ifdef HAVE_WINT_T
+ case TYPE_WIDE_CHAR:
+ ap->a.a_wide_char = va_arg (args, wint_t);
+ break;
+#endif
+ case TYPE_STRING:
+ ap->a.a_string = va_arg (args, const char *);
+ break;
+#ifdef HAVE_WCHAR_T
+ case TYPE_WIDE_STRING:
+ ap->a.a_wide_string = va_arg (args, const wchar_t *);
+ break;
+#endif
+ case TYPE_POINTER:
+ ap->a.a_pointer = va_arg (args, void *);
+ break;
+ case TYPE_COUNT_SCHAR_POINTER:
+ ap->a.a_count_schar_pointer = va_arg (args, signed char *);
+ break;
+ case TYPE_COUNT_SHORT_POINTER:
+ ap->a.a_count_short_pointer = va_arg (args, short *);
+ break;
+ case TYPE_COUNT_INT_POINTER:
+ ap->a.a_count_int_pointer = va_arg (args, int *);
+ break;
+ case TYPE_COUNT_LONGINT_POINTER:
+ ap->a.a_count_longint_pointer = va_arg (args, long int *);
+ break;
+#ifdef HAVE_LONG_LONG
+ case TYPE_COUNT_LONGLONGINT_POINTER:
+ ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
+ break;
+#endif
+ default:
+ /* Unknown type. */
+ return -1;
+ }
+ return 0;
+}
--- /dev/null
+/* Decomposed printf argument list.
+ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _PRINTF_ARGS_H
+#define _PRINTF_ARGS_H
+
+/* Get size_t. */
+#include <stddef.h>
+
+/* Get wchar_t. */
+#ifdef HAVE_WCHAR_T
+# include <stddef.h>
+#endif
+
+/* Get wint_t. */
+#ifdef HAVE_WINT_T
+# include <wchar.h>
+#endif
+
+/* Get va_list. */
+#include <stdarg.h>
+
+
+/* Argument types */
+typedef enum
+{
+ TYPE_NONE,
+ TYPE_SCHAR,
+ TYPE_UCHAR,
+ TYPE_SHORT,
+ TYPE_USHORT,
+ TYPE_INT,
+ TYPE_UINT,
+ TYPE_LONGINT,
+ TYPE_ULONGINT,
+#ifdef HAVE_LONG_LONG
+ TYPE_LONGLONGINT,
+ TYPE_ULONGLONGINT,
+#endif
+ TYPE_DOUBLE,
+#ifdef HAVE_LONG_DOUBLE
+ TYPE_LONGDOUBLE,
+#endif
+ TYPE_CHAR,
+#ifdef HAVE_WINT_T
+ TYPE_WIDE_CHAR,
+#endif
+ TYPE_STRING,
+#ifdef HAVE_WCHAR_T
+ TYPE_WIDE_STRING,
+#endif
+ TYPE_POINTER,
+ TYPE_COUNT_SCHAR_POINTER,
+ TYPE_COUNT_SHORT_POINTER,
+ TYPE_COUNT_INT_POINTER,
+ TYPE_COUNT_LONGINT_POINTER
+#ifdef HAVE_LONG_LONG
+, TYPE_COUNT_LONGLONGINT_POINTER
+#endif
+} arg_type;
+
+/* Polymorphic argument */
+typedef struct
+{
+ arg_type type;
+ union
+ {
+ signed char a_schar;
+ unsigned char a_uchar;
+ short a_short;
+ unsigned short a_ushort;
+ int a_int;
+ unsigned int a_uint;
+ long int a_longint;
+ unsigned long int a_ulongint;
+#ifdef HAVE_LONG_LONG
+ long long int a_longlongint;
+ unsigned long long int a_ulonglongint;
+#endif
+ float a_float;
+ double a_double;
+#ifdef HAVE_LONG_DOUBLE
+ long double a_longdouble;
+#endif
+ int a_char;
+#ifdef HAVE_WINT_T
+ wint_t a_wide_char;
+#endif
+ const char* a_string;
+#ifdef HAVE_WCHAR_T
+ const wchar_t* a_wide_string;
+#endif
+ void* a_pointer;
+ signed char * a_count_schar_pointer;
+ short * a_count_short_pointer;
+ int * a_count_int_pointer;
+ long int * a_count_longint_pointer;
+#ifdef HAVE_LONG_LONG
+ long long int * a_count_longlongint_pointer;
+#endif
+ }
+ a;
+}
+argument;
+
+typedef struct
+{
+ size_t count;
+ argument *arg;
+}
+arguments;
+
+
+/* Fetch the arguments, putting them into a. */
+#ifdef STATIC
+STATIC
+#else
+extern
+#endif
+int printf_fetchargs (va_list args, arguments *a);
+
+#endif /* _PRINTF_ARGS_H */
--- /dev/null
+/* Formatted output to strings.
+ Copyright (C) 1999-2000, 2002-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification. */
+#if WIDE_CHAR_VERSION
+# include "wprintf-parse.h"
+#else
+# include "printf-parse.h"
+#endif
+
+/* Get size_t, NULL. */
+#include <stddef.h>
+
+/* Get intmax_t. */
+#if HAVE_STDINT_H_WITH_UINTMAX
+# include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H_WITH_UINTMAX
+# include <inttypes.h>
+#endif
+
+/* malloc(), realloc(), free(). */
+#include <stdlib.h>
+
+/* Checked size_t computations. */
+#include "xsize.h"
+
+#if WIDE_CHAR_VERSION
+# define PRINTF_PARSE wprintf_parse
+# define CHAR_T wchar_t
+# define DIRECTIVE wchar_t_directive
+# define DIRECTIVES wchar_t_directives
+#else
+# define PRINTF_PARSE printf_parse
+# define CHAR_T char
+# define DIRECTIVE char_directive
+# define DIRECTIVES char_directives
+#endif
+
+#ifdef STATIC
+STATIC
+#endif
+int
+PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
+{
+ const CHAR_T *cp = format; /* pointer into format */
+ size_t arg_posn = 0; /* number of regular arguments consumed */
+ size_t d_allocated; /* allocated elements of d->dir */
+ size_t a_allocated; /* allocated elements of a->arg */
+ size_t max_width_length = 0;
+ size_t max_precision_length = 0;
+
+ d->count = 0;
+ d_allocated = 1;
+ d->dir = malloc (d_allocated * sizeof (DIRECTIVE));
+ if (d->dir == NULL)
+ /* Out of memory. */
+ return -1;
+
+ a->count = 0;
+ a_allocated = 0;
+ a->arg = NULL;
+
+#define REGISTER_ARG(_index_,_type_) \
+ { \
+ size_t n = (_index_); \
+ if (n >= a_allocated) \
+ { \
+ size_t memory_size; \
+ argument *memory; \
+ \
+ a_allocated = xtimes (a_allocated, 2); \
+ if (a_allocated <= n) \
+ a_allocated = xsum (n, 1); \
+ memory_size = xtimes (a_allocated, sizeof (argument)); \
+ if (size_overflow_p (memory_size)) \
+ /* Overflow, would lead to out of memory. */ \
+ goto error; \
+ memory = (a->arg \
+ ? realloc (a->arg, memory_size) \
+ : malloc (memory_size)); \
+ if (memory == NULL) \
+ /* Out of memory. */ \
+ goto error; \
+ a->arg = memory; \
+ } \
+ while (a->count <= n) \
+ a->arg[a->count++].type = TYPE_NONE; \
+ if (a->arg[n].type == TYPE_NONE) \
+ a->arg[n].type = (_type_); \
+ else if (a->arg[n].type != (_type_)) \
+ /* Ambiguous type for positional argument. */ \
+ goto error; \
+ }
+
+ while (*cp != '\0')
+ {
+ CHAR_T c = *cp++;
+ if (c == '%')
+ {
+ size_t arg_index = ARG_NONE;
+ DIRECTIVE *dp = &d->dir[d->count];/* pointer to next directive */
+
+ /* Initialize the next directive. */
+ dp->dir_start = cp - 1;
+ dp->flags = 0;
+ dp->width_start = NULL;
+ dp->width_end = NULL;
+ dp->width_arg_index = ARG_NONE;
+ dp->precision_start = NULL;
+ dp->precision_end = NULL;
+ dp->precision_arg_index = ARG_NONE;
+ dp->arg_index = ARG_NONE;
+
+ /* Test for positional argument. */
+ if (*cp >= '0' && *cp <= '9')
+ {
+ const CHAR_T *np;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ ;
+ if (*np == '$')
+ {
+ size_t n = 0;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ n = xsum (xtimes (n, 10), *np - '0');
+ if (n == 0)
+ /* Positional argument 0. */
+ goto error;
+ if (size_overflow_p (n))
+ /* n too large, would lead to out of memory later. */
+ goto error;
+ arg_index = n - 1;
+ cp = np + 1;
+ }
+ }
+
+ /* Read the flags. */
+ for (;;)
+ {
+ if (*cp == '\'')
+ {
+ dp->flags |= FLAG_GROUP;
+ cp++;
+ }
+ else if (*cp == '-')
+ {
+ dp->flags |= FLAG_LEFT;
+ cp++;
+ }
+ else if (*cp == '+')
+ {
+ dp->flags |= FLAG_SHOWSIGN;
+ cp++;
+ }
+ else if (*cp == ' ')
+ {
+ dp->flags |= FLAG_SPACE;
+ cp++;
+ }
+ else if (*cp == '#')
+ {
+ dp->flags |= FLAG_ALT;
+ cp++;
+ }
+ else if (*cp == '0')
+ {
+ dp->flags |= FLAG_ZERO;
+ cp++;
+ }
+ else
+ break;
+ }
+
+ /* Parse the field width. */
+ if (*cp == '*')
+ {
+ dp->width_start = cp;
+ cp++;
+ dp->width_end = cp;
+ if (max_width_length < 1)
+ max_width_length = 1;
+
+ /* Test for positional argument. */
+ if (*cp >= '0' && *cp <= '9')
+ {
+ const CHAR_T *np;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ ;
+ if (*np == '$')
+ {
+ size_t n = 0;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ n = xsum (xtimes (n, 10), *np - '0');
+ if (n == 0)
+ /* Positional argument 0. */
+ goto error;
+ if (size_overflow_p (n))
+ /* n too large, would lead to out of memory later. */
+ goto error;
+ dp->width_arg_index = n - 1;
+ cp = np + 1;
+ }
+ }
+ if (dp->width_arg_index == ARG_NONE)
+ {
+ dp->width_arg_index = arg_posn++;
+ if (dp->width_arg_index == ARG_NONE)
+ /* arg_posn wrapped around. */
+ goto error;
+ }
+ REGISTER_ARG (dp->width_arg_index, TYPE_INT);
+ }
+ else if (*cp >= '0' && *cp <= '9')
+ {
+ size_t width_length;
+
+ dp->width_start = cp;
+ for (; *cp >= '0' && *cp <= '9'; cp++)
+ ;
+ dp->width_end = cp;
+ width_length = dp->width_end - dp->width_start;
+ if (max_width_length < width_length)
+ max_width_length = width_length;
+ }
+
+ /* Parse the precision. */
+ if (*cp == '.')
+ {
+ cp++;
+ if (*cp == '*')
+ {
+ dp->precision_start = cp - 1;
+ cp++;
+ dp->precision_end = cp;
+ if (max_precision_length < 2)
+ max_precision_length = 2;
+
+ /* Test for positional argument. */
+ if (*cp >= '0' && *cp <= '9')
+ {
+ const CHAR_T *np;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ ;
+ if (*np == '$')
+ {
+ size_t n = 0;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ n = xsum (xtimes (n, 10), *np - '0');
+ if (n == 0)
+ /* Positional argument 0. */
+ goto error;
+ if (size_overflow_p (n))
+ /* n too large, would lead to out of memory
+ later. */
+ goto error;
+ dp->precision_arg_index = n - 1;
+ cp = np + 1;
+ }
+ }
+ if (dp->precision_arg_index == ARG_NONE)
+ {
+ dp->precision_arg_index = arg_posn++;
+ if (dp->precision_arg_index == ARG_NONE)
+ /* arg_posn wrapped around. */
+ goto error;
+ }
+ REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
+ }
+ else
+ {
+ size_t precision_length;
+
+ dp->precision_start = cp - 1;
+ for (; *cp >= '0' && *cp <= '9'; cp++)
+ ;
+ dp->precision_end = cp;
+ precision_length = dp->precision_end - dp->precision_start;
+ if (max_precision_length < precision_length)
+ max_precision_length = precision_length;
+ }
+ }
+
+ {
+ arg_type type;
+
+ /* Parse argument type/size specifiers. */
+ {
+ int flags = 0;
+
+ for (;;)
+ {
+ if (*cp == 'h')
+ {
+ flags |= (1 << (flags & 1));
+ cp++;
+ }
+ else if (*cp == 'L')
+ {
+ flags |= 4;
+ cp++;
+ }
+ else if (*cp == 'l')
+ {
+ flags += 8;
+ cp++;
+ }
+#ifdef HAVE_INTMAX_T
+ else if (*cp == 'j')
+ {
+ if (sizeof (intmax_t) > sizeof (long))
+ {
+ /* intmax_t = long long */
+ flags += 16;
+ }
+ else if (sizeof (intmax_t) > sizeof (int))
+ {
+ /* intmax_t = long */
+ flags += 8;
+ }
+ cp++;
+ }
+#endif
+ else if (*cp == 'z' || *cp == 'Z')
+ {
+ /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
+ because the warning facility in gcc-2.95.2 understands
+ only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */
+ if (sizeof (size_t) > sizeof (long))
+ {
+ /* size_t = long long */
+ flags += 16;
+ }
+ else if (sizeof (size_t) > sizeof (int))
+ {
+ /* size_t = long */
+ flags += 8;
+ }
+ cp++;
+ }
+ else if (*cp == 't')
+ {
+ if (sizeof (ptrdiff_t) > sizeof (long))
+ {
+ /* ptrdiff_t = long long */
+ flags += 16;
+ }
+ else if (sizeof (ptrdiff_t) > sizeof (int))
+ {
+ /* ptrdiff_t = long */
+ flags += 8;
+ }
+ cp++;
+ }
+ else
+ break;
+ }
+
+ /* Read the conversion character. */
+ c = *cp++;
+ switch (c)
+ {
+ case 'd': case 'i':
+#ifdef HAVE_LONG_LONG
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_LONGLONGINT;
+ else
+#endif
+ if (flags >= 8)
+ type = TYPE_LONGINT;
+ else if (flags & 2)
+ type = TYPE_SCHAR;
+ else if (flags & 1)
+ type = TYPE_SHORT;
+ else
+ type = TYPE_INT;
+ break;
+ case 'o': case 'u': case 'x': case 'X':
+#ifdef HAVE_LONG_LONG
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_ULONGLONGINT;
+ else
+#endif
+ if (flags >= 8)
+ type = TYPE_ULONGINT;
+ else if (flags & 2)
+ type = TYPE_UCHAR;
+ else if (flags & 1)
+ type = TYPE_USHORT;
+ else
+ type = TYPE_UINT;
+ break;
+ case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
+ case 'a': case 'A':
+#ifdef HAVE_LONG_DOUBLE
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_LONGDOUBLE;
+ else
+#endif
+ type = TYPE_DOUBLE;
+ break;
+ case 'c':
+ if (flags >= 8)
+#ifdef HAVE_WINT_T
+ type = TYPE_WIDE_CHAR;
+#else
+ goto error;
+#endif
+ else
+ type = TYPE_CHAR;
+ break;
+#ifdef HAVE_WINT_T
+ case 'C':
+ type = TYPE_WIDE_CHAR;
+ c = 'c';
+ break;
+#endif
+ case 's':
+ if (flags >= 8)
+#ifdef HAVE_WCHAR_T
+ type = TYPE_WIDE_STRING;
+#else
+ goto error;
+#endif
+ else
+ type = TYPE_STRING;
+ break;
+#ifdef HAVE_WCHAR_T
+ case 'S':
+ type = TYPE_WIDE_STRING;
+ c = 's';
+ break;
+#endif
+ case 'p':
+ type = TYPE_POINTER;
+ break;
+ case 'n':
+#ifdef HAVE_LONG_LONG
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_COUNT_LONGLONGINT_POINTER;
+ else
+#endif
+ if (flags >= 8)
+ type = TYPE_COUNT_LONGINT_POINTER;
+ else if (flags & 2)
+ type = TYPE_COUNT_SCHAR_POINTER;
+ else if (flags & 1)
+ type = TYPE_COUNT_SHORT_POINTER;
+ else
+ type = TYPE_COUNT_INT_POINTER;
+ break;
+ case '%':
+ type = TYPE_NONE;
+ break;
+ default:
+ /* Unknown conversion character. */
+ goto error;
+ }
+ }
+
+ if (type != TYPE_NONE)
+ {
+ dp->arg_index = arg_index;
+ if (dp->arg_index == ARG_NONE)
+ {
+ dp->arg_index = arg_posn++;
+ if (dp->arg_index == ARG_NONE)
+ /* arg_posn wrapped around. */
+ goto error;
+ }
+ REGISTER_ARG (dp->arg_index, type);
+ }
+ dp->conversion = c;
+ dp->dir_end = cp;
+ }
+
+ d->count++;
+ if (d->count >= d_allocated)
+ {
+ size_t memory_size;
+ DIRECTIVE *memory;
+
+ d_allocated = xtimes (d_allocated, 2);
+ memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
+ if (size_overflow_p (memory_size))
+ /* Overflow, would lead to out of memory. */
+ goto error;
+ memory = realloc (d->dir, memory_size);
+ if (memory == NULL)
+ /* Out of memory. */
+ goto error;
+ d->dir = memory;
+ }
+ }
+ }
+ d->dir[d->count].dir_start = cp;
+
+ d->max_width_length = max_width_length;
+ d->max_precision_length = max_precision_length;
+ return 0;
+
+error:
+ if (a->arg)
+ free (a->arg);
+ if (d->dir)
+ free (d->dir);
+ return -1;
+}
+
+#undef DIRECTIVES
+#undef DIRECTIVE
+#undef CHAR_T
+#undef PRINTF_PARSE
--- /dev/null
+/* Parse printf format string.
+ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _PRINTF_PARSE_H
+#define _PRINTF_PARSE_H
+
+#include "printf-args.h"
+
+
+/* Flags */
+#define FLAG_GROUP 1 /* ' flag */
+#define FLAG_LEFT 2 /* - flag */
+#define FLAG_SHOWSIGN 4 /* + flag */
+#define FLAG_SPACE 8 /* space flag */
+#define FLAG_ALT 16 /* # flag */
+#define FLAG_ZERO 32
+
+/* arg_index value indicating that no argument is consumed. */
+#define ARG_NONE (~(size_t)0)
+
+/* A parsed directive. */
+typedef struct
+{
+ const char* dir_start;
+ const char* dir_end;
+ int flags;
+ const char* width_start;
+ const char* width_end;
+ size_t width_arg_index;
+ const char* precision_start;
+ const char* precision_end;
+ size_t precision_arg_index;
+ char conversion; /* d i o u x X f e E g G c s p n U % but not C S */
+ size_t arg_index;
+}
+char_directive;
+
+/* A parsed format string. */
+typedef struct
+{
+ size_t count;
+ char_directive *dir;
+ size_t max_width_length;
+ size_t max_precision_length;
+}
+char_directives;
+
+
+/* Parses the format string. Fills in the number N of directives, and fills
+ in directives[0], ..., directives[N-1], and sets directives[N].dir_start
+ to the end of the format string. Also fills in the arg_type fields of the
+ arguments and the needed count of arguments. */
+#ifdef STATIC
+STATIC
+#else
+extern
+#endif
+int printf_parse (const char *format, char_directives *d, arguments *a);
+
+#endif /* _PRINTF_PARSE_H */
--- /dev/null
+/* Formatted output to strings, using POSIX/XSI format strings with positions.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2003.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+# define HAVE_ALLOCA 1
+#else
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# if defined HAVE_ALLOCA_H || defined _LIBC
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca
+char *alloca ();
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#include <stdio.h>
+
+#if !HAVE_POSIX_PRINTF
+
+#include <stdlib.h>
+#include <string.h>
+
+/* When building a DLL, we must export some functions. Note that because
+ the functions are only defined for binary backward compatibility, we
+ don't need to use __declspec(dllimport) in any case. */
+#if defined _MSC_VER && BUILDING_DLL
+# define DLL_EXPORTED __declspec(dllexport)
+#else
+# define DLL_EXPORTED
+#endif
+
+#define STATIC static
+
+/* Define auxiliary functions declared in "printf-args.h". */
+#include "printf-args.c"
+
+/* Define auxiliary functions declared in "printf-parse.h". */
+#include "printf-parse.c"
+
+/* Define functions declared in "vasnprintf.h". */
+#define vasnprintf libintl_vasnprintf
+#include "vasnprintf.c"
+#if 0 /* not needed */
+#define asnprintf libintl_asnprintf
+#include "asnprintf.c"
+#endif
+
+DLL_EXPORTED
+int
+libintl_vfprintf (FILE *stream, const char *format, va_list args)
+{
+ if (strchr (format, '$') == NULL)
+ return vfprintf (stream, format, args);
+ else
+ {
+ size_t length;
+ char *result = libintl_vasnprintf (NULL, &length, format, args);
+ int retval = -1;
+ if (result != NULL)
+ {
+ if (fwrite (result, 1, length, stream) == length)
+ retval = length;
+ free (result);
+ }
+ return retval;
+ }
+}
+
+DLL_EXPORTED
+int
+libintl_fprintf (FILE *stream, const char *format, ...)
+{
+ va_list args;
+ int retval;
+
+ va_start (args, format);
+ retval = libintl_vfprintf (stream, format, args);
+ va_end (args);
+ return retval;
+}
+
+DLL_EXPORTED
+int
+libintl_vprintf (const char *format, va_list args)
+{
+ return libintl_vfprintf (stdout, format, args);
+}
+
+DLL_EXPORTED
+int
+libintl_printf (const char *format, ...)
+{
+ va_list args;
+ int retval;
+
+ va_start (args, format);
+ retval = libintl_vprintf (format, args);
+ va_end (args);
+ return retval;
+}
+
+DLL_EXPORTED
+int
+libintl_vsprintf (char *resultbuf, const char *format, va_list args)
+{
+ if (strchr (format, '$') == NULL)
+ return vsprintf (resultbuf, format, args);
+ else
+ {
+ size_t length = (size_t) ~0 / (4 * sizeof (char));
+ char *result = libintl_vasnprintf (resultbuf, &length, format, args);
+ if (result != resultbuf)
+ {
+ free (result);
+ return -1;
+ }
+ else
+ return length;
+ }
+}
+
+DLL_EXPORTED
+int
+libintl_sprintf (char *resultbuf, const char *format, ...)
+{
+ va_list args;
+ int retval;
+
+ va_start (args, format);
+ retval = libintl_vsprintf (resultbuf, format, args);
+ va_end (args);
+ return retval;
+}
+
+#if HAVE_SNPRINTF
+
+# if HAVE_DECL__SNPRINTF
+ /* Windows. */
+# define system_vsnprintf _vsnprintf
+# else
+ /* Unix. */
+# define system_vsnprintf vsnprintf
+# endif
+
+DLL_EXPORTED
+int
+libintl_vsnprintf (char *resultbuf, size_t length, const char *format, va_list args)
+{
+ if (strchr (format, '$') == NULL)
+ return system_vsnprintf (resultbuf, length, format, args);
+ else
+ {
+ size_t maxlength = length;
+ char *result = libintl_vasnprintf (resultbuf, &length, format, args);
+ if (result != resultbuf)
+ {
+ if (maxlength > 0)
+ {
+ if (length < maxlength)
+ abort ();
+ memcpy (resultbuf, result, maxlength - 1);
+ resultbuf[maxlength - 1] = '\0';
+ }
+ free (result);
+ return -1;
+ }
+ else
+ return length;
+ }
+}
+
+DLL_EXPORTED
+int
+libintl_snprintf (char *resultbuf, size_t length, const char *format, ...)
+{
+ va_list args;
+ int retval;
+
+ va_start (args, format);
+ retval = libintl_vsnprintf (resultbuf, length, format, args);
+ va_end (args);
+ return retval;
+}
+
+#endif
+
+#if HAVE_ASPRINTF
+
+DLL_EXPORTED
+int
+libintl_vasprintf (char **resultp, const char *format, va_list args)
+{
+ size_t length;
+ char *result = libintl_vasnprintf (NULL, &length, format, args);
+ if (result == NULL)
+ return -1;
+ *resultp = result;
+ return length;
+}
+
+DLL_EXPORTED
+int
+libintl_asprintf (char **resultp, const char *format, ...)
+{
+ va_list args;
+ int retval;
+
+ va_start (args, format);
+ retval = libintl_vasprintf (resultp, format, args);
+ va_end (args);
+ return retval;
+}
+
+#endif
+
+#if HAVE_FWPRINTF
+
+#include <wchar.h>
+
+#define WIDE_CHAR_VERSION 1
+
+/* Define auxiliary functions declared in "wprintf-parse.h". */
+#include "printf-parse.c"
+
+/* Define functions declared in "vasnprintf.h". */
+#define vasnwprintf libintl_vasnwprintf
+#include "vasnprintf.c"
+#if 0 /* not needed */
+#define asnwprintf libintl_asnwprintf
+#include "asnprintf.c"
+#endif
+
+# if HAVE_DECL__SNWPRINTF
+ /* Windows. */
+# define system_vswprintf _vsnwprintf
+# else
+ /* Unix. */
+# define system_vswprintf vswprintf
+# endif
+
+DLL_EXPORTED
+int
+libintl_vfwprintf (FILE *stream, const wchar_t *format, va_list args)
+{
+ if (wcschr (format, '$') == NULL)
+ return vfwprintf (stream, format, args);
+ else
+ {
+ size_t length;
+ wchar_t *result = libintl_vasnwprintf (NULL, &length, format, args);
+ int retval = -1;
+ if (result != NULL)
+ {
+ size_t i;
+ for (i = 0; i < length; i++)
+ if (fputwc (result[i], stream) == WEOF)
+ break;
+ if (i == length)
+ retval = length;
+ free (result);
+ }
+ return retval;
+ }
+}
+
+DLL_EXPORTED
+int
+libintl_fwprintf (FILE *stream, const wchar_t *format, ...)
+{
+ va_list args;
+ int retval;
+
+ va_start (args, format);
+ retval = libintl_vfwprintf (stream, format, args);
+ va_end (args);
+ return retval;
+}
+
+DLL_EXPORTED
+int
+libintl_vwprintf (const wchar_t *format, va_list args)
+{
+ return libintl_vfwprintf (stdout, format, args);
+}
+
+DLL_EXPORTED
+int
+libintl_wprintf (const wchar_t *format, ...)
+{
+ va_list args;
+ int retval;
+
+ va_start (args, format);
+ retval = libintl_vwprintf (format, args);
+ va_end (args);
+ return retval;
+}
+
+DLL_EXPORTED
+int
+libintl_vswprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, va_list args)
+{
+ if (wcschr (format, '$') == NULL)
+ return system_vswprintf (resultbuf, length, format, args);
+ else
+ {
+ size_t maxlength = length;
+ wchar_t *result = libintl_vasnwprintf (resultbuf, &length, format, args);
+ if (result != resultbuf)
+ {
+ if (maxlength > 0)
+ {
+ if (length < maxlength)
+ abort ();
+ memcpy (resultbuf, result, (maxlength - 1) * sizeof (wchar_t));
+ resultbuf[maxlength - 1] = 0;
+ }
+ free (result);
+ return -1;
+ }
+ else
+ return length;
+ }
+}
+
+DLL_EXPORTED
+int
+libintl_swprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, ...)
+{
+ va_list args;
+ int retval;
+
+ va_start (args, format);
+ retval = libintl_vswprintf (resultbuf, length, format, args);
+ va_end (args);
+ return retval;
+}
+
+#endif
+
+#endif
--- /dev/null
+# Add this package to a list of references stored in a text file.
+#
+# Copyright (C) 2000 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Library General Public License as published
+# by the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library 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.
+#
+# Written by Bruno Haible <haible@clisp.cons.org>.
+#
+/^# Packages using this file: / {
+ s/# Packages using this file://
+ ta
+ :a
+ s/ @PACKAGE@ / @PACKAGE@ /
+ tb
+ s/ $/ @PACKAGE@ /
+ :b
+ s/^/# Packages using this file:/
+}
--- /dev/null
+# Remove this package from a list of references stored in a text file.
+#
+# Copyright (C) 2000 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Library General Public License as published
+# by the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library 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.
+#
+# Written by Bruno Haible <haible@clisp.cons.org>.
+#
+/^# Packages using this file: / {
+ s/# Packages using this file://
+ s/ @PACKAGE@ / /
+ s/^/# Packages using this file:/
+}
--- /dev/null
+/* Provide relocatable packages.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2003.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+
+/* Tell glibc's <stdio.h> to provide a prototype for getline().
+ This must come before <config.h> because <config.h> may include
+ <features.h>, and once <features.h> has been included, it's too late. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+/* Specification. */
+#include "relocatable.h"
+
+#if ENABLE_RELOCATABLE
+
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef NO_XMALLOC
+# define xmalloc malloc
+#else
+# include "xalloc.h"
+#endif
+
+#if defined _WIN32 || defined __WIN32__
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
+#if DEPENDS_ON_LIBCHARSET
+# include <libcharset.h>
+#endif
+#if DEPENDS_ON_LIBICONV && HAVE_ICONV
+# include <iconv.h>
+#endif
+#if DEPENDS_ON_LIBINTL && ENABLE_NLS
+# include <libintl.h>
+#endif
+
+/* Faked cheap 'bool'. */
+#undef bool
+#undef false
+#undef true
+#define bool int
+#define false 0
+#define true 1
+
+/* Pathname support.
+ ISSLASH(C) tests whether C is a directory separator character.
+ IS_PATH_WITH_DIR(P) tests whether P contains a directory specification.
+ */
+#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
+ /* Win32, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+# define HAS_DEVICE(P) \
+ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
+ && (P)[1] == ':')
+# define IS_PATH_WITH_DIR(P) \
+ (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
+# define FILESYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0)
+#else
+ /* Unix */
+# define ISSLASH(C) ((C) == '/')
+# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
+# define FILESYSTEM_PREFIX_LEN(P) 0
+#endif
+
+/* Original installation prefix. */
+static char *orig_prefix;
+static size_t orig_prefix_len;
+/* Current installation prefix. */
+static char *curr_prefix;
+static size_t curr_prefix_len;
+/* These prefixes do not end in a slash. Anything that will be concatenated
+ to them must start with a slash. */
+
+/* Sets the original and the current installation prefix of this module.
+ Relocation simply replaces a pathname starting with the original prefix
+ by the corresponding pathname with the current prefix instead. Both
+ prefixes should be directory names without trailing slash (i.e. use ""
+ instead of "/"). */
+static void
+set_this_relocation_prefix (const char *orig_prefix_arg,
+ const char *curr_prefix_arg)
+{
+ if (orig_prefix_arg != NULL && curr_prefix_arg != NULL
+ /* Optimization: if orig_prefix and curr_prefix are equal, the
+ relocation is a nop. */
+ && strcmp (orig_prefix_arg, curr_prefix_arg) != 0)
+ {
+ /* Duplicate the argument strings. */
+ char *memory;
+
+ orig_prefix_len = strlen (orig_prefix_arg);
+ curr_prefix_len = strlen (curr_prefix_arg);
+ memory = (char *) xmalloc (orig_prefix_len + 1 + curr_prefix_len + 1);
+#ifdef NO_XMALLOC
+ if (memory != NULL)
+#endif
+ {
+ memcpy (memory, orig_prefix_arg, orig_prefix_len + 1);
+ orig_prefix = memory;
+ memory += orig_prefix_len + 1;
+ memcpy (memory, curr_prefix_arg, curr_prefix_len + 1);
+ curr_prefix = memory;
+ return;
+ }
+ }
+ orig_prefix = NULL;
+ curr_prefix = NULL;
+ /* Don't worry about wasted memory here - this function is usually only
+ called once. */
+}
+
+/* Sets the original and the current installation prefix of the package.
+ Relocation simply replaces a pathname starting with the original prefix
+ by the corresponding pathname with the current prefix instead. Both
+ prefixes should be directory names without trailing slash (i.e. use ""
+ instead of "/"). */
+void
+set_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg)
+{
+ set_this_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
+
+ /* Now notify all dependent libraries. */
+#if DEPENDS_ON_LIBCHARSET
+ libcharset_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
+#endif
+#if DEPENDS_ON_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109
+ libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
+#endif
+#if DEPENDS_ON_LIBINTL && ENABLE_NLS && defined libintl_set_relocation_prefix
+ libintl_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
+#endif
+}
+
+#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR)
+
+/* Convenience function:
+ Computes the current installation prefix, based on the original
+ installation prefix, the original installation directory of a particular
+ file, and the current pathname of this file. Returns NULL upon failure. */
+#ifdef IN_LIBRARY
+#define compute_curr_prefix local_compute_curr_prefix
+static
+#endif
+const char *
+compute_curr_prefix (const char *orig_installprefix,
+ const char *orig_installdir,
+ const char *curr_pathname)
+{
+ const char *curr_installdir;
+ const char *rel_installdir;
+
+ if (curr_pathname == NULL)
+ return NULL;
+
+ /* Determine the relative installation directory, relative to the prefix.
+ This is simply the difference between orig_installprefix and
+ orig_installdir. */
+ if (strncmp (orig_installprefix, orig_installdir, strlen (orig_installprefix))
+ != 0)
+ /* Shouldn't happen - nothing should be installed outside $(prefix). */
+ return NULL;
+ rel_installdir = orig_installdir + strlen (orig_installprefix);
+
+ /* Determine the current installation directory. */
+ {
+ const char *p_base = curr_pathname + FILESYSTEM_PREFIX_LEN (curr_pathname);
+ const char *p = curr_pathname + strlen (curr_pathname);
+ char *q;
+
+ while (p > p_base)
+ {
+ p--;
+ if (ISSLASH (*p))
+ break;
+ }
+
+ q = (char *) xmalloc (p - curr_pathname + 1);
+#ifdef NO_XMALLOC
+ if (q == NULL)
+ return NULL;
+#endif
+ memcpy (q, curr_pathname, p - curr_pathname);
+ q[p - curr_pathname] = '\0';
+ curr_installdir = q;
+ }
+
+ /* Compute the current installation prefix by removing the trailing
+ rel_installdir from it. */
+ {
+ const char *rp = rel_installdir + strlen (rel_installdir);
+ const char *cp = curr_installdir + strlen (curr_installdir);
+ const char *cp_base =
+ curr_installdir + FILESYSTEM_PREFIX_LEN (curr_installdir);
+
+ while (rp > rel_installdir && cp > cp_base)
+ {
+ bool same = false;
+ const char *rpi = rp;
+ const char *cpi = cp;
+
+ while (rpi > rel_installdir && cpi > cp_base)
+ {
+ rpi--;
+ cpi--;
+ if (ISSLASH (*rpi) || ISSLASH (*cpi))
+ {
+ if (ISSLASH (*rpi) && ISSLASH (*cpi))
+ same = true;
+ break;
+ }
+#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
+ /* Win32, OS/2, DOS - case insignificant filesystem */
+ if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi)
+ != (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi))
+ break;
+#else
+ if (*rpi != *cpi)
+ break;
+#endif
+ }
+ if (!same)
+ break;
+ /* The last pathname component was the same. opi and cpi now point
+ to the slash before it. */
+ rp = rpi;
+ cp = cpi;
+ }
+
+ if (rp > rel_installdir)
+ /* Unexpected: The curr_installdir does not end with rel_installdir. */
+ return NULL;
+
+ {
+ size_t curr_prefix_len = cp - curr_installdir;
+ char *curr_prefix;
+
+ curr_prefix = (char *) xmalloc (curr_prefix_len + 1);
+#ifdef NO_XMALLOC
+ if (curr_prefix == NULL)
+ return NULL;
+#endif
+ memcpy (curr_prefix, curr_installdir, curr_prefix_len);
+ curr_prefix[curr_prefix_len] = '\0';
+
+ return curr_prefix;
+ }
+ }
+}
+
+#endif /* !IN_LIBRARY || PIC */
+
+#if defined PIC && defined INSTALLDIR
+
+/* Full pathname of shared library, or NULL. */
+static char *shared_library_fullname;
+
+#if defined _WIN32 || defined __WIN32__
+
+/* Determine the full pathname of the shared library when it is loaded. */
+
+BOOL WINAPI
+DllMain (HINSTANCE module_handle, DWORD event, LPVOID reserved)
+{
+ (void) reserved;
+
+ if (event == DLL_PROCESS_ATTACH)
+ {
+ /* The DLL is being loaded into an application's address range. */
+ static char location[MAX_PATH];
+
+ if (!GetModuleFileName (module_handle, location, sizeof (location)))
+ /* Shouldn't happen. */
+ return FALSE;
+
+ if (!IS_PATH_WITH_DIR (location))
+ /* Shouldn't happen. */
+ return FALSE;
+
+ shared_library_fullname = strdup (location);
+ }
+
+ return TRUE;
+}
+
+#else /* Unix */
+
+static void
+find_shared_library_fullname ()
+{
+#if defined __linux__ && __GLIBC__ >= 2
+ /* Linux has /proc/self/maps. glibc 2 has the getline() function. */
+ FILE *fp;
+
+ /* Open the current process' maps file. It describes one VMA per line. */
+ fp = fopen ("/proc/self/maps", "r");
+ if (fp)
+ {
+ unsigned long address = (unsigned long) &find_shared_library_fullname;
+ for (;;)
+ {
+ unsigned long start, end;
+ int c;
+
+ if (fscanf (fp, "%lx-%lx", &start, &end) != 2)
+ break;
+ if (address >= start && address <= end - 1)
+ {
+ /* Found it. Now see if this line contains a filename. */
+ while (c = getc (fp), c != EOF && c != '\n' && c != '/')
+ continue;
+ if (c == '/')
+ {
+ size_t size;
+ int len;
+
+ ungetc (c, fp);
+ shared_library_fullname = NULL; size = 0;
+ len = getline (&shared_library_fullname, &size, fp);
+ if (len >= 0)
+ {
+ /* Success: filled shared_library_fullname. */
+ if (len > 0 && shared_library_fullname[len - 1] == '\n')
+ shared_library_fullname[len - 1] = '\0';
+ }
+ }
+ break;
+ }
+ while (c = getc (fp), c != EOF && c != '\n')
+ continue;
+ }
+ fclose (fp);
+ }
+#endif
+}
+
+#endif /* WIN32 / Unix */
+
+/* Return the full pathname of the current shared library.
+ Return NULL if unknown.
+ Guaranteed to work only on Linux and Woe32. */
+static char *
+get_shared_library_fullname ()
+{
+#if !(defined _WIN32 || defined __WIN32__)
+ static bool tried_find_shared_library_fullname;
+ if (!tried_find_shared_library_fullname)
+ {
+ find_shared_library_fullname ();
+ tried_find_shared_library_fullname = true;
+ }
+#endif
+ return shared_library_fullname;
+}
+
+#endif /* PIC */
+
+/* Returns the pathname, relocated according to the current installation
+ directory. */
+const char *
+relocate (const char *pathname)
+{
+#if defined PIC && defined INSTALLDIR
+ static int initialized;
+
+ /* Initialization code for a shared library. */
+ if (!initialized)
+ {
+ /* At this point, orig_prefix and curr_prefix likely have already been
+ set through the main program's set_program_name_and_installdir
+ function. This is sufficient in the case that the library has
+ initially been installed in the same orig_prefix. But we can do
+ better, to also cover the cases that 1. it has been installed
+ in a different prefix before being moved to orig_prefix and (later)
+ to curr_prefix, 2. unlike the program, it has not moved away from
+ orig_prefix. */
+ const char *orig_installprefix = INSTALLPREFIX;
+ const char *orig_installdir = INSTALLDIR;
+ const char *curr_prefix_better;
+
+ curr_prefix_better =
+ compute_curr_prefix (orig_installprefix, orig_installdir,
+ get_shared_library_fullname ());
+ if (curr_prefix_better == NULL)
+ curr_prefix_better = curr_prefix;
+
+ set_relocation_prefix (orig_installprefix, curr_prefix_better);
+
+ initialized = 1;
+ }
+#endif
+
+ /* Note: It is not necessary to perform case insensitive comparison here,
+ even for DOS-like filesystems, because the pathname argument was
+ typically created from the same Makefile variable as orig_prefix came
+ from. */
+ if (orig_prefix != NULL && curr_prefix != NULL
+ && strncmp (pathname, orig_prefix, orig_prefix_len) == 0)
+ {
+ if (pathname[orig_prefix_len] == '\0')
+ /* pathname equals orig_prefix. */
+ return curr_prefix;
+ if (ISSLASH (pathname[orig_prefix_len]))
+ {
+ /* pathname starts with orig_prefix. */
+ const char *pathname_tail = &pathname[orig_prefix_len];
+ char *result =
+ (char *) xmalloc (curr_prefix_len + strlen (pathname_tail) + 1);
+
+#ifdef NO_XMALLOC
+ if (result != NULL)
+#endif
+ {
+ memcpy (result, curr_prefix, curr_prefix_len);
+ strcpy (result + curr_prefix_len, pathname_tail);
+ return result;
+ }
+ }
+ }
+ /* Nothing to relocate. */
+ return pathname;
+}
+
+#endif
--- /dev/null
+/* Provide relocatable packages.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2003.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _RELOCATABLE_H
+#define _RELOCATABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* This can be enabled through the configure --enable-relocatable option. */
+#if ENABLE_RELOCATABLE
+
+/* When building a DLL, we must export some functions. Note that because
+ this is a private .h file, we don't need to use __declspec(dllimport)
+ in any case. */
+#if defined _MSC_VER && BUILDING_DLL
+# define RELOCATABLE_DLL_EXPORTED __declspec(dllexport)
+#else
+# define RELOCATABLE_DLL_EXPORTED
+#endif
+
+/* Sets the original and the current installation prefix of the package.
+ Relocation simply replaces a pathname starting with the original prefix
+ by the corresponding pathname with the current prefix instead. Both
+ prefixes should be directory names without trailing slash (i.e. use ""
+ instead of "/"). */
+extern RELOCATABLE_DLL_EXPORTED void
+ set_relocation_prefix (const char *orig_prefix,
+ const char *curr_prefix);
+
+/* Returns the pathname, relocated according to the current installation
+ directory. */
+extern const char * relocate (const char *pathname);
+
+/* Memory management: relocate() leaks memory, because it has to construct
+ a fresh pathname. If this is a problem because your program calls
+ relocate() frequently, think about caching the result. */
+
+/* Convenience function:
+ Computes the current installation prefix, based on the original
+ installation prefix, the original installation directory of a particular
+ file, and the current pathname of this file. Returns NULL upon failure. */
+extern const char * compute_curr_prefix (const char *orig_installprefix,
+ const char *orig_installdir,
+ const char *curr_pathname);
+
+#else
+
+/* By default, we use the hardwired pathnames. */
+#define relocate(pathname) (pathname)
+
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RELOCATABLE_H */
--- /dev/null
+/* Implementation of the textdomain(3) function.
+ Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+#include "gettextP.h"
+
+#ifdef _LIBC
+/* We have to handle multi-threaded applications. */
+# include <bits/libc-lock.h>
+#else
+/* Provide dummy implementation if this is outside glibc. */
+# define __libc_rwlock_define(CLASS, NAME)
+# define __libc_rwlock_wrlock(NAME)
+# define __libc_rwlock_unlock(NAME)
+#endif
+
+/* The internal variables in the standalone libintl.a must have different
+ names than the internal variables in GNU libc, otherwise programs
+ using libintl.a cannot be linked statically. */
+#if !defined _LIBC
+# define _nl_default_default_domain libintl_nl_default_default_domain
+# define _nl_current_default_domain libintl_nl_current_default_domain
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Name of the default text domain. */
+extern const char _nl_default_default_domain[] attribute_hidden;
+
+/* Default text domain in which entries for gettext(3) are to be found. */
+extern const char *_nl_current_default_domain attribute_hidden;
+
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define TEXTDOMAIN __textdomain
+# ifndef strdup
+# define strdup(str) __strdup (str)
+# endif
+#else
+# define TEXTDOMAIN libintl_textdomain
+#endif
+
+/* Lock variable to protect the global data in the gettext implementation. */
+__libc_rwlock_define (extern, _nl_state_lock attribute_hidden)
+
+/* Set the current default message catalog to DOMAINNAME.
+ If DOMAINNAME is null, return the current default.
+ If DOMAINNAME is "", reset to the default of "messages". */
+char *
+TEXTDOMAIN (const char *domainname)
+{
+ char *new_domain;
+ char *old_domain;
+
+ /* A NULL pointer requests the current setting. */
+ if (domainname == NULL)
+ return (char *) _nl_current_default_domain;
+
+ __libc_rwlock_wrlock (_nl_state_lock);
+
+ old_domain = (char *) _nl_current_default_domain;
+
+ /* If domain name is the null string set to default domain "messages". */
+ if (domainname[0] == '\0'
+ || strcmp (domainname, _nl_default_default_domain) == 0)
+ {
+ _nl_current_default_domain = _nl_default_default_domain;
+ new_domain = (char *) _nl_current_default_domain;
+ }
+ else if (strcmp (domainname, old_domain) == 0)
+ /* This can happen and people will use it to signal that some
+ environment variable changed. */
+ new_domain = old_domain;
+ else
+ {
+ /* If the following malloc fails `_nl_current_default_domain'
+ will be NULL. This value will be returned and so signals we
+ are out of core. */
+#if defined _LIBC || defined HAVE_STRDUP
+ new_domain = strdup (domainname);
+#else
+ size_t len = strlen (domainname) + 1;
+ new_domain = (char *) malloc (len);
+ if (new_domain != NULL)
+ memcpy (new_domain, domainname, len);
+#endif
+
+ if (new_domain != NULL)
+ _nl_current_default_domain = new_domain;
+ }
+
+ /* We use this possibility to signal a change of the loaded catalogs
+ since this is most likely the case and there is no other easy we
+ to do it. Do it only when the call was successful. */
+ if (new_domain != NULL)
+ {
+ ++_nl_msg_cat_cntr;
+
+ if (old_domain != new_domain && old_domain != _nl_default_default_domain)
+ free (old_domain);
+ }
+
+ __libc_rwlock_unlock (_nl_state_lock);
+
+ return new_domain;
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__textdomain, textdomain);
+#endif
--- /dev/null
+/* vsprintf with automatic memory allocation.
+ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
+ This must come before <config.h> because <config.h> may include
+ <features.h>, and once <features.h> has been included, it's too late. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+#ifndef IN_LIBINTL
+# include <alloca.h>
+#endif
+
+/* Specification. */
+#if WIDE_CHAR_VERSION
+# include "vasnwprintf.h"
+#else
+# include "vasnprintf.h"
+#endif
+
+#include <stdio.h> /* snprintf(), sprintf() */
+#include <stdlib.h> /* abort(), malloc(), realloc(), free() */
+#include <string.h> /* memcpy(), strlen() */
+#include <errno.h> /* errno */
+#include <limits.h> /* CHAR_BIT */
+#include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP */
+#if WIDE_CHAR_VERSION
+# include "wprintf-parse.h"
+#else
+# include "printf-parse.h"
+#endif
+
+/* Checked size_t computations. */
+#include "xsize.h"
+
+#ifdef HAVE_WCHAR_T
+# ifdef HAVE_WCSLEN
+# define local_wcslen wcslen
+# else
+ /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid
+ a dependency towards this library, here is a local substitute.
+ Define this substitute only once, even if this file is included
+ twice in the same compilation unit. */
+# ifndef local_wcslen_defined
+# define local_wcslen_defined 1
+static size_t
+local_wcslen (const wchar_t *s)
+{
+ const wchar_t *ptr;
+
+ for (ptr = s; *ptr != (wchar_t) 0; ptr++)
+ ;
+ return ptr - s;
+}
+# endif
+# endif
+#endif
+
+#if WIDE_CHAR_VERSION
+# define VASNPRINTF vasnwprintf
+# define CHAR_T wchar_t
+# define DIRECTIVE wchar_t_directive
+# define DIRECTIVES wchar_t_directives
+# define PRINTF_PARSE wprintf_parse
+# define USE_SNPRINTF 1
+# if HAVE_DECL__SNWPRINTF
+ /* On Windows, the function swprintf() has a different signature than
+ on Unix; we use the _snwprintf() function instead. */
+# define SNPRINTF _snwprintf
+# else
+ /* Unix. */
+# define SNPRINTF swprintf
+# endif
+#else
+# define VASNPRINTF vasnprintf
+# define CHAR_T char
+# define DIRECTIVE char_directive
+# define DIRECTIVES char_directives
+# define PRINTF_PARSE printf_parse
+# define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF)
+# if HAVE_DECL__SNPRINTF
+ /* Windows. */
+# define SNPRINTF _snprintf
+# else
+ /* Unix. */
+# define SNPRINTF snprintf
+# endif
+#endif
+
+CHAR_T *
+VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list args)
+{
+ DIRECTIVES d;
+ arguments a;
+
+ if (PRINTF_PARSE (format, &d, &a) < 0)
+ {
+ errno = EINVAL;
+ return NULL;
+ }
+
+#define CLEANUP() \
+ free (d.dir); \
+ if (a.arg) \
+ free (a.arg);
+
+ if (printf_fetchargs (args, &a) < 0)
+ {
+ CLEANUP ();
+ errno = EINVAL;
+ return NULL;
+ }
+
+ {
+ size_t buf_neededlength;
+ CHAR_T *buf;
+ CHAR_T *buf_malloced;
+ const CHAR_T *cp;
+ size_t i;
+ DIRECTIVE *dp;
+ /* Output string accumulator. */
+ CHAR_T *result;
+ size_t allocated;
+ size_t length;
+
+ /* Allocate a small buffer that will hold a directive passed to
+ sprintf or snprintf. */
+ buf_neededlength =
+ xsum4 (7, d.max_width_length, d.max_precision_length, 6);
+#if HAVE_ALLOCA
+ if (buf_neededlength < 4000 / sizeof (CHAR_T))
+ {
+ buf = (CHAR_T *) alloca (buf_neededlength * sizeof (CHAR_T));
+ buf_malloced = NULL;
+ }
+ else
+#endif
+ {
+ size_t buf_memsize = xtimes (buf_neededlength, sizeof (CHAR_T));
+ if (size_overflow_p (buf_memsize))
+ goto out_of_memory_1;
+ buf = (CHAR_T *) malloc (buf_memsize);
+ if (buf == NULL)
+ goto out_of_memory_1;
+ buf_malloced = buf;
+ }
+
+ if (resultbuf != NULL)
+ {
+ result = resultbuf;
+ allocated = *lengthp;
+ }
+ else
+ {
+ result = NULL;
+ allocated = 0;
+ }
+ length = 0;
+ /* Invariants:
+ result is either == resultbuf or == NULL or malloc-allocated.
+ If length > 0, then result != NULL. */
+
+ /* Ensures that allocated >= needed. Aborts through a jump to
+ out_of_memory if needed is SIZE_MAX or otherwise too big. */
+#define ENSURE_ALLOCATION(needed) \
+ if ((needed) > allocated) \
+ { \
+ size_t memory_size; \
+ CHAR_T *memory; \
+ \
+ allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \
+ if ((needed) > allocated) \
+ allocated = (needed); \
+ memory_size = xtimes (allocated, sizeof (CHAR_T)); \
+ if (size_overflow_p (memory_size)) \
+ goto out_of_memory; \
+ if (result == resultbuf || result == NULL) \
+ memory = (CHAR_T *) malloc (memory_size); \
+ else \
+ memory = (CHAR_T *) realloc (result, memory_size); \
+ if (memory == NULL) \
+ goto out_of_memory; \
+ if (result == resultbuf && length > 0) \
+ memcpy (memory, result, length * sizeof (CHAR_T)); \
+ result = memory; \
+ }
+
+ for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++)
+ {
+ if (cp != dp->dir_start)
+ {
+ size_t n = dp->dir_start - cp;
+ size_t augmented_length = xsum (length, n);
+
+ ENSURE_ALLOCATION (augmented_length);
+ memcpy (result + length, cp, n * sizeof (CHAR_T));
+ length = augmented_length;
+ }
+ if (i == d.count)
+ break;
+
+ /* Execute a single directive. */
+ if (dp->conversion == '%')
+ {
+ size_t augmented_length;
+
+ if (!(dp->arg_index == ARG_NONE))
+ abort ();
+ augmented_length = xsum (length, 1);
+ ENSURE_ALLOCATION (augmented_length);
+ result[length] = '%';
+ length = augmented_length;
+ }
+ else
+ {
+ if (!(dp->arg_index != ARG_NONE))
+ abort ();
+
+ if (dp->conversion == 'n')
+ {
+ switch (a.arg[dp->arg_index].type)
+ {
+ case TYPE_COUNT_SCHAR_POINTER:
+ *a.arg[dp->arg_index].a.a_count_schar_pointer = length;
+ break;
+ case TYPE_COUNT_SHORT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_short_pointer = length;
+ break;
+ case TYPE_COUNT_INT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_int_pointer = length;
+ break;
+ case TYPE_COUNT_LONGINT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
+ break;
+#ifdef HAVE_LONG_LONG
+ case TYPE_COUNT_LONGLONGINT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
+ break;
+#endif
+ default:
+ abort ();
+ }
+ }
+ else
+ {
+ arg_type type = a.arg[dp->arg_index].type;
+ CHAR_T *p;
+ unsigned int prefix_count;
+ int prefixes[2];
+#if !USE_SNPRINTF
+ size_t tmp_length;
+ CHAR_T tmpbuf[700];
+ CHAR_T *tmp;
+
+ /* Allocate a temporary buffer of sufficient size for calling
+ sprintf. */
+ {
+ size_t width;
+ size_t precision;
+
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = (arg < 0 ? (unsigned int) (-arg) : arg);
+ }
+ else
+ {
+ const CHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ }
+
+ precision = 6;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ precision = (arg < 0 ? 0 : arg);
+ }
+ else
+ {
+ const CHAR_T *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ do
+ precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+ while (digitp != dp->precision_end);
+ }
+ }
+
+ switch (dp->conversion)
+ {
+
+ case 'd': case 'i': case 'u':
+# ifdef HAVE_LONG_LONG
+ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ * 2 /* estimate for FLAG_GROUP */
+ )
+ + 1 /* turn floor into ceil */
+ + 1; /* account for leading sign */
+ else
+# endif
+ if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ * 2 /* estimate for FLAG_GROUP */
+ )
+ + 1 /* turn floor into ceil */
+ + 1; /* account for leading sign */
+ else
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ * 2 /* estimate for FLAG_GROUP */
+ )
+ + 1 /* turn floor into ceil */
+ + 1; /* account for leading sign */
+ break;
+
+ case 'o':
+# ifdef HAVE_LONG_LONG
+ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1 /* turn floor into ceil */
+ + 1; /* account for leading sign */
+ else
+# endif
+ if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1 /* turn floor into ceil */
+ + 1; /* account for leading sign */
+ else
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1 /* turn floor into ceil */
+ + 1; /* account for leading sign */
+ break;
+
+ case 'x': case 'X':
+# ifdef HAVE_LONG_LONG
+ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1 /* turn floor into ceil */
+ + 2; /* account for leading sign or alternate form */
+ else
+# endif
+ if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1 /* turn floor into ceil */
+ + 2; /* account for leading sign or alternate form */
+ else
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1 /* turn floor into ceil */
+ + 2; /* account for leading sign or alternate form */
+ break;
+
+ case 'f': case 'F':
+# ifdef HAVE_LONG_DOUBLE
+ if (type == TYPE_LONGDOUBLE)
+ tmp_length =
+ (unsigned int) (LDBL_MAX_EXP
+ * 0.30103 /* binary -> decimal */
+ * 2 /* estimate for FLAG_GROUP */
+ )
+ + 1 /* turn floor into ceil */
+ + 10; /* sign, decimal point etc. */
+ else
+# endif
+ tmp_length =
+ (unsigned int) (DBL_MAX_EXP
+ * 0.30103 /* binary -> decimal */
+ * 2 /* estimate for FLAG_GROUP */
+ )
+ + 1 /* turn floor into ceil */
+ + 10; /* sign, decimal point etc. */
+ tmp_length = xsum (tmp_length, precision);
+ break;
+
+ case 'e': case 'E': case 'g': case 'G':
+ case 'a': case 'A':
+ tmp_length =
+ 12; /* sign, decimal point, exponent etc. */
+ tmp_length = xsum (tmp_length, precision);
+ break;
+
+ case 'c':
+# if defined HAVE_WINT_T && !WIDE_CHAR_VERSION
+ if (type == TYPE_WIDE_CHAR)
+ tmp_length = MB_CUR_MAX;
+ else
+# endif
+ tmp_length = 1;
+ break;
+
+ case 's':
+# ifdef HAVE_WCHAR_T
+ if (type == TYPE_WIDE_STRING)
+ {
+ tmp_length =
+ local_wcslen (a.arg[dp->arg_index].a.a_wide_string);
+
+# if !WIDE_CHAR_VERSION
+ tmp_length = xtimes (tmp_length, MB_CUR_MAX);
+# endif
+ }
+ else
+# endif
+ tmp_length = strlen (a.arg[dp->arg_index].a.a_string);
+ break;
+
+ case 'p':
+ tmp_length =
+ (unsigned int) (sizeof (void *) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1 /* turn floor into ceil */
+ + 2; /* account for leading 0x */
+ break;
+
+ default:
+ abort ();
+ }
+
+ if (tmp_length < width)
+ tmp_length = width;
+
+ tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
+ }
+
+ if (tmp_length <= sizeof (tmpbuf) / sizeof (CHAR_T))
+ tmp = tmpbuf;
+ else
+ {
+ size_t tmp_memsize = xtimes (tmp_length, sizeof (CHAR_T));
+
+ if (size_overflow_p (tmp_memsize))
+ /* Overflow, would lead to out of memory. */
+ goto out_of_memory;
+ tmp = (CHAR_T *) malloc (tmp_memsize);
+ if (tmp == NULL)
+ /* Out of memory. */
+ goto out_of_memory;
+ }
+#endif
+
+ /* Construct the format string for calling snprintf or
+ sprintf. */
+ p = buf;
+ *p++ = '%';
+ if (dp->flags & FLAG_GROUP)
+ *p++ = '\'';
+ if (dp->flags & FLAG_LEFT)
+ *p++ = '-';
+ if (dp->flags & FLAG_SHOWSIGN)
+ *p++ = '+';
+ if (dp->flags & FLAG_SPACE)
+ *p++ = ' ';
+ if (dp->flags & FLAG_ALT)
+ *p++ = '#';
+ if (dp->flags & FLAG_ZERO)
+ *p++ = '0';
+ if (dp->width_start != dp->width_end)
+ {
+ size_t n = dp->width_end - dp->width_start;
+ memcpy (p, dp->width_start, n * sizeof (CHAR_T));
+ p += n;
+ }
+ if (dp->precision_start != dp->precision_end)
+ {
+ size_t n = dp->precision_end - dp->precision_start;
+ memcpy (p, dp->precision_start, n * sizeof (CHAR_T));
+ p += n;
+ }
+
+ switch (type)
+ {
+#ifdef HAVE_LONG_LONG
+ case TYPE_LONGLONGINT:
+ case TYPE_ULONGLONGINT:
+ *p++ = 'l';
+ /*FALLTHROUGH*/
+#endif
+ case TYPE_LONGINT:
+ case TYPE_ULONGINT:
+#ifdef HAVE_WINT_T
+ case TYPE_WIDE_CHAR:
+#endif
+#ifdef HAVE_WCHAR_T
+ case TYPE_WIDE_STRING:
+#endif
+ *p++ = 'l';
+ break;
+#ifdef HAVE_LONG_DOUBLE
+ case TYPE_LONGDOUBLE:
+ *p++ = 'L';
+ break;
+#endif
+ default:
+ break;
+ }
+ *p = dp->conversion;
+#if USE_SNPRINTF
+ p[1] = '%';
+ p[2] = 'n';
+ p[3] = '\0';
+#else
+ p[1] = '\0';
+#endif
+
+ /* Construct the arguments for calling snprintf or sprintf. */
+ prefix_count = 0;
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int;
+ }
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int;
+ }
+
+#if USE_SNPRINTF
+ /* Prepare checking whether snprintf returns the count
+ via %n. */
+ ENSURE_ALLOCATION (xsum (length, 1));
+ result[length] = '\0';
+#endif
+
+ for (;;)
+ {
+ size_t maxlen;
+ int count;
+ int retcount;
+
+ maxlen = allocated - length;
+ count = -1;
+ retcount = 0;
+
+#if USE_SNPRINTF
+# define SNPRINTF_BUF(arg) \
+ switch (prefix_count) \
+ { \
+ case 0: \
+ retcount = SNPRINTF (result + length, maxlen, buf, \
+ arg, &count); \
+ break; \
+ case 1: \
+ retcount = SNPRINTF (result + length, maxlen, buf, \
+ prefixes[0], arg, &count); \
+ break; \
+ case 2: \
+ retcount = SNPRINTF (result + length, maxlen, buf, \
+ prefixes[0], prefixes[1], arg, \
+ &count); \
+ break; \
+ default: \
+ abort (); \
+ }
+#else
+# define SNPRINTF_BUF(arg) \
+ switch (prefix_count) \
+ { \
+ case 0: \
+ count = sprintf (tmp, buf, arg); \
+ break; \
+ case 1: \
+ count = sprintf (tmp, buf, prefixes[0], arg); \
+ break; \
+ case 2: \
+ count = sprintf (tmp, buf, prefixes[0], prefixes[1],\
+ arg); \
+ break; \
+ default: \
+ abort (); \
+ }
+#endif
+
+ switch (type)
+ {
+ case TYPE_SCHAR:
+ {
+ int arg = a.arg[dp->arg_index].a.a_schar;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UCHAR:
+ {
+ unsigned int arg = a.arg[dp->arg_index].a.a_uchar;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_SHORT:
+ {
+ int arg = a.arg[dp->arg_index].a.a_short;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_USHORT:
+ {
+ unsigned int arg = a.arg[dp->arg_index].a.a_ushort;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_INT:
+ {
+ int arg = a.arg[dp->arg_index].a.a_int;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UINT:
+ {
+ unsigned int arg = a.arg[dp->arg_index].a.a_uint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_LONGINT:
+ {
+ long int arg = a.arg[dp->arg_index].a.a_longint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_ULONGINT:
+ {
+ unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#ifdef HAVE_LONG_LONG
+ case TYPE_LONGLONGINT:
+ {
+ long long int arg = a.arg[dp->arg_index].a.a_longlongint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_ULONGLONGINT:
+ {
+ unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#endif
+ case TYPE_DOUBLE:
+ {
+ double arg = a.arg[dp->arg_index].a.a_double;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#ifdef HAVE_LONG_DOUBLE
+ case TYPE_LONGDOUBLE:
+ {
+ long double arg = a.arg[dp->arg_index].a.a_longdouble;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#endif
+ case TYPE_CHAR:
+ {
+ int arg = a.arg[dp->arg_index].a.a_char;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#ifdef HAVE_WINT_T
+ case TYPE_WIDE_CHAR:
+ {
+ wint_t arg = a.arg[dp->arg_index].a.a_wide_char;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#endif
+ case TYPE_STRING:
+ {
+ const char *arg = a.arg[dp->arg_index].a.a_string;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#ifdef HAVE_WCHAR_T
+ case TYPE_WIDE_STRING:
+ {
+ const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#endif
+ case TYPE_POINTER:
+ {
+ void *arg = a.arg[dp->arg_index].a.a_pointer;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ default:
+ abort ();
+ }
+
+#if USE_SNPRINTF
+ /* Portability: Not all implementations of snprintf()
+ are ISO C 99 compliant. Determine the number of
+ bytes that snprintf() has produced or would have
+ produced. */
+ if (count >= 0)
+ {
+ /* Verify that snprintf() has NUL-terminated its
+ result. */
+ if (count < maxlen && result[length + count] != '\0')
+ abort ();
+ /* Portability hack. */
+ if (retcount > count)
+ count = retcount;
+ }
+ else
+ {
+ /* snprintf() doesn't understand the '%n'
+ directive. */
+ if (p[1] != '\0')
+ {
+ /* Don't use the '%n' directive; instead, look
+ at the snprintf() return value. */
+ p[1] = '\0';
+ continue;
+ }
+ else
+ {
+ /* Look at the snprintf() return value. */
+ if (retcount < 0)
+ {
+ /* HP-UX 10.20 snprintf() is doubly deficient:
+ It doesn't understand the '%n' directive,
+ *and* it returns -1 (rather than the length
+ that would have been required) when the
+ buffer is too small. */
+ size_t bigger_need =
+ xsum (xtimes (allocated, 2), 12);
+ ENSURE_ALLOCATION (bigger_need);
+ continue;
+ }
+ else
+ count = retcount;
+ }
+ }
+#endif
+
+ /* Attempt to handle failure. */
+ if (count < 0)
+ {
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EINVAL;
+ return NULL;
+ }
+
+#if !USE_SNPRINTF
+ if (count >= tmp_length)
+ /* tmp_length was incorrectly calculated - fix the
+ code above! */
+ abort ();
+#endif
+
+ /* Make room for the result. */
+ if (count >= maxlen)
+ {
+ /* Need at least count bytes. But allocate
+ proportionally, to avoid looping eternally if
+ snprintf() reports a too small count. */
+ size_t n =
+ xmax (xsum (length, count), xtimes (allocated, 2));
+
+ ENSURE_ALLOCATION (n);
+#if USE_SNPRINTF
+ continue;
+#endif
+ }
+
+#if USE_SNPRINTF
+ /* The snprintf() result did fit. */
+#else
+ /* Append the sprintf() result. */
+ memcpy (result + length, tmp, count * sizeof (CHAR_T));
+ if (tmp != tmpbuf)
+ free (tmp);
+#endif
+
+ length += count;
+ break;
+ }
+ }
+ }
+ }
+
+ /* Add the final NUL. */
+ ENSURE_ALLOCATION (xsum (length, 1));
+ result[length] = '\0';
+
+ if (result != resultbuf && length + 1 < allocated)
+ {
+ /* Shrink the allocated memory if possible. */
+ CHAR_T *memory;
+
+ memory = (CHAR_T *) realloc (result, (length + 1) * sizeof (CHAR_T));
+ if (memory != NULL)
+ result = memory;
+ }
+
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ *lengthp = length;
+ return result;
+
+ out_of_memory:
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ out_of_memory_1:
+ CLEANUP ();
+ errno = ENOMEM;
+ return NULL;
+ }
+}
+
+#undef SNPRINTF
+#undef USE_SNPRINTF
+#undef PRINTF_PARSE
+#undef DIRECTIVES
+#undef DIRECTIVE
+#undef CHAR_T
+#undef VASNPRINTF
--- /dev/null
+/* vsprintf with automatic memory allocation.
+ Copyright (C) 2002-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _VASNPRINTF_H
+#define _VASNPRINTF_H
+
+/* Get va_list. */
+#include <stdarg.h>
+
+/* Get size_t. */
+#include <stddef.h>
+
+#ifndef __attribute__
+/* This feature is available in gcc versions 2.5 and later. */
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
+# define __attribute__(Spec) /* empty */
+# endif
+/* The __-protected variants of `format' and `printf' attributes
+ are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+# define __format__ format
+# define __printf__ printf
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Write formatted output to a string dynamically allocated with malloc().
+ You can pass a preallocated buffer for the result in RESULTBUF and its
+ size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
+ If successful, return the address of the string (this may be = RESULTBUF
+ if no dynamic memory allocation was necessary) and set *LENGTHP to the
+ number of resulting bytes, excluding the trailing NUL. Upon error, set
+ errno and return NULL. */
+extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
+ __attribute__ ((__format__ (__printf__, 3, 4)));
+extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
+ __attribute__ ((__format__ (__printf__, 3, 0)));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _VASNPRINTF_H */
--- /dev/null
+/* vswprintf with automatic memory allocation.
+ Copyright (C) 2002-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _VASNWPRINTF_H
+#define _VASNWPRINTF_H
+
+/* Get va_list. */
+#include <stdarg.h>
+
+/* Get wchar_t, size_t. */
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Write formatted output to a string dynamically allocated with malloc().
+ You can pass a preallocated buffer for the result in RESULTBUF and its
+ size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
+ If successful, return the address of the string (this may be = RESULTBUF
+ if no dynamic memory allocation was necessary) and set *LENGTHP to the
+ number of resulting bytes, excluding the trailing NUL. Upon error, set
+ errno and return NULL. */
+extern wchar_t * asnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, ...);
+extern wchar_t * vasnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, va_list args);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _VASNWPRINTF_H */
--- /dev/null
+/* Parse printf format string.
+ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _WPRINTF_PARSE_H
+#define _WPRINTF_PARSE_H
+
+#include "printf-args.h"
+
+
+/* Flags */
+#define FLAG_GROUP 1 /* ' flag */
+#define FLAG_LEFT 2 /* - flag */
+#define FLAG_SHOWSIGN 4 /* + flag */
+#define FLAG_SPACE 8 /* space flag */
+#define FLAG_ALT 16 /* # flag */
+#define FLAG_ZERO 32
+
+/* arg_index value indicating that no argument is consumed. */
+#define ARG_NONE (~(size_t)0)
+
+/* A parsed directive. */
+typedef struct
+{
+ const wchar_t* dir_start;
+ const wchar_t* dir_end;
+ int flags;
+ const wchar_t* width_start;
+ const wchar_t* width_end;
+ size_t width_arg_index;
+ const wchar_t* precision_start;
+ const wchar_t* precision_end;
+ size_t precision_arg_index;
+ wchar_t conversion; /* d i o u x X f e E g G c s p n U % but not C S */
+ size_t arg_index;
+}
+wchar_t_directive;
+
+/* A parsed format string. */
+typedef struct
+{
+ size_t count;
+ wchar_t_directive *dir;
+ size_t max_width_length;
+ size_t max_precision_length;
+}
+wchar_t_directives;
+
+
+/* Parses the format string. Fills in the number N of directives, and fills
+ in directives[0], ..., directives[N-1], and sets directives[N].dir_start
+ to the end of the format string. Also fills in the arg_type fields of the
+ arguments and the needed count of arguments. */
+#ifdef STATIC
+STATIC
+#else
+extern
+#endif
+int wprintf_parse (const wchar_t *format, wchar_t_directives *d, arguments *a);
+
+#endif /* _WPRINTF_PARSE_H */
--- /dev/null
+/* xsize.h -- Checked size_t computations.
+
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _XSIZE_H
+#define _XSIZE_H
+
+/* Get size_t. */
+#include <stddef.h>
+
+/* Get SIZE_MAX. */
+#include <limits.h>
+#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+
+/* The size of memory objects is often computed through expressions of
+ type size_t. Example:
+ void* p = malloc (header_size + n * element_size).
+ These computations can lead to overflow. When this happens, malloc()
+ returns a piece of memory that is way too small, and the program then
+ crashes while attempting to fill the memory.
+ To avoid this, the functions and macros in this file check for overflow.
+ The convention is that SIZE_MAX represents overflow.
+ malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc
+ implementation that uses mmap --, it's recommended to use size_overflow_p()
+ or size_in_bounds_p() before invoking malloc().
+ The example thus becomes:
+ size_t size = xsum (header_size, xtimes (n, element_size));
+ void *p = (size_in_bounds_p (size) ? malloc (size) : NULL);
+*/
+
+/* Convert an arbitrary value >= 0 to type size_t. */
+#define xcast_size_t(N) \
+ ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
+
+/* Sum of two sizes, with overflow check. */
+static inline size_t
+#if __GNUC__ >= 3
+__attribute__ ((__pure__))
+#endif
+xsum (size_t size1, size_t size2)
+{
+ size_t sum = size1 + size2;
+ return (sum >= size1 ? sum : SIZE_MAX);
+}
+
+/* Sum of three sizes, with overflow check. */
+static inline size_t
+#if __GNUC__ >= 3
+__attribute__ ((__pure__))
+#endif
+xsum3 (size_t size1, size_t size2, size_t size3)
+{
+ return xsum (xsum (size1, size2), size3);
+}
+
+/* Sum of four sizes, with overflow check. */
+static inline size_t
+#if __GNUC__ >= 3
+__attribute__ ((__pure__))
+#endif
+xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
+{
+ return xsum (xsum (xsum (size1, size2), size3), size4);
+}
+
+/* Maximum of two sizes, with overflow check. */
+static inline size_t
+#if __GNUC__ >= 3
+__attribute__ ((__pure__))
+#endif
+xmax (size_t size1, size_t size2)
+{
+ /* No explicit check is needed here, because for any n:
+ max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */
+ return (size1 >= size2 ? size1 : size2);
+}
+
+/* Multiplication of a count with an element size, with overflow check.
+ The count must be >= 0 and the element size must be > 0.
+ This is a macro, not an inline function, so that it works correctly even
+ when N is of a wider tupe and N > SIZE_MAX. */
+#define xtimes(N, ELSIZE) \
+ ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
+
+/* Check for overflow. */
+#define size_overflow_p(SIZE) \
+ ((SIZE) == SIZE_MAX)
+/* Check against overflow. */
+#define size_in_bounds_p(SIZE) \
+ ((SIZE) != SIZE_MAX)
+
+#endif /* _XSIZE_H */
--- /dev/null
+2004-11-19 gettextize <bug-gnu-gettext@gnu.org>
+
+ * codeset.m4: New file, from gettext-0.14.1.
+ * gettext.m4: New file, from gettext-0.14.1.
+ * glibc21.m4: New file, from gettext-0.14.1.
+ * iconv.m4: New file, from gettext-0.14.1.
+ * intdiv0.m4: New file, from gettext-0.14.1.
+ * intmax.m4: New file, from gettext-0.14.1.
+ * inttypes.m4: New file, from gettext-0.14.1.
+ * inttypes_h.m4: New file, from gettext-0.14.1.
+ * inttypes-pri.m4: New file, from gettext-0.14.1.
+ * isc-posix.m4: New file, from gettext-0.14.1.
+ * lcmessage.m4: New file, from gettext-0.14.1.
+ * lib-ld.m4: New file, from gettext-0.14.1.
+ * lib-link.m4: New file, from gettext-0.14.1.
+ * lib-prefix.m4: New file, from gettext-0.14.1.
+ * longdouble.m4: New file, from gettext-0.14.1.
+ * longlong.m4: New file, from gettext-0.14.1.
+ * nls.m4: New file, from gettext-0.14.1.
+ * po.m4: New file, from gettext-0.14.1.
+ * printf-posix.m4: New file, from gettext-0.14.1.
+ * progtest.m4: New file, from gettext-0.14.1.
+ * signed.m4: New file, from gettext-0.14.1.
+ * size_max.m4: New file, from gettext-0.14.1.
+ * stdint_h.m4: New file, from gettext-0.14.1.
+ * uintmax_t.m4: New file, from gettext-0.14.1.
+ * ulonglong.m4: New file, from gettext-0.14.1.
+ * wchar_t.m4: New file, from gettext-0.14.1.
+ * wint_t.m4: New file, from gettext-0.14.1.
+ * xsize.m4: New file, from gettext-0.14.1.
+ * Makefile.am: New file.
+
--- /dev/null
+EXTRA_DIST = codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 intmax.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 longdouble.m4 longlong.m4 nls.m4 po.m4 printf-posix.m4 progtest.m4 signed.m4 size_max.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 wchar_t.m4 wint_t.m4 xsize.m4
--- /dev/null
+# codeset.m4 serial AM1 (gettext-0.10.40)
+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_LANGINFO_CODESET],
+[
+ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
+ [AC_TRY_LINK([#include <langinfo.h>],
+ [char* cs = nl_langinfo(CODESET);],
+ am_cv_langinfo_codeset=yes,
+ am_cv_langinfo_codeset=no)
+ ])
+ if test $am_cv_langinfo_codeset = yes; then
+ AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
+ [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
+ fi
+])
--- /dev/null
+# gettext.m4 serial 28 (gettext-0.13)
+dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+dnl Macro to add for using GNU gettext.
+
+dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
+dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
+dnl default (if it is not specified or empty) is 'no-libtool'.
+dnl INTLSYMBOL should be 'external' for packages with no intl directory,
+dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
+dnl If INTLSYMBOL is 'use-libtool', then a libtool library
+dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
+dnl depending on --{enable,disable}-{shared,static} and on the presence of
+dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
+dnl $(top_builddir)/intl/libintl.a will be created.
+dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
+dnl implementations (in libc or libintl) without the ngettext() function
+dnl will be ignored. If NEEDSYMBOL is specified and is
+dnl 'need-formatstring-macros', then GNU gettext implementations that don't
+dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
+dnl INTLDIR is used to find the intl libraries. If empty,
+dnl the value `$(top_builddir)/intl/' is used.
+dnl
+dnl The result of the configuration is one of three cases:
+dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
+dnl and used.
+dnl Catalog format: GNU --> install in $(datadir)
+dnl Catalog extension: .mo after installation, .gmo in source tree
+dnl 2) GNU gettext has been found in the system's C library.
+dnl Catalog format: GNU --> install in $(datadir)
+dnl Catalog extension: .mo after installation, .gmo in source tree
+dnl 3) No internationalization, always use English msgid.
+dnl Catalog format: none
+dnl Catalog extension: none
+dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
+dnl The use of .gmo is historical (it was needed to avoid overwriting the
+dnl GNU format catalogs when building on a platform with an X/Open gettext),
+dnl but we keep it in order not to force irrelevant filename changes on the
+dnl maintainers.
+dnl
+AC_DEFUN([AM_GNU_GETTEXT],
+[
+ dnl Argument checking.
+ ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
+ [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
+])])])])])
+ ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
+ [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
+])])])])
+ define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
+ define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
+
+ AC_REQUIRE([AM_PO_SUBDIRS])dnl
+ ifelse(gt_included_intl, yes, [
+ AC_REQUIRE([AM_INTL_SUBDIR])dnl
+ ])
+
+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+
+ dnl Sometimes libintl requires libiconv, so first search for libiconv.
+ dnl Ideally we would do this search only after the
+ dnl if test "$USE_NLS" = "yes"; then
+ dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
+ dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
+ dnl the configure script would need to contain the same shell code
+ dnl again, outside any 'if'. There are two solutions:
+ dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
+ dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
+ dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
+ dnl documented, we avoid it.
+ ifelse(gt_included_intl, yes, , [
+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+ ])
+
+ dnl Set USE_NLS.
+ AM_NLS
+
+ ifelse(gt_included_intl, yes, [
+ BUILD_INCLUDED_LIBINTL=no
+ USE_INCLUDED_LIBINTL=no
+ ])
+ LIBINTL=
+ LTLIBINTL=
+ POSUB=
+
+ dnl If we use NLS figure out what method
+ if test "$USE_NLS" = "yes"; then
+ gt_use_preinstalled_gnugettext=no
+ ifelse(gt_included_intl, yes, [
+ AC_MSG_CHECKING([whether included gettext is requested])
+ AC_ARG_WITH(included-gettext,
+ [ --with-included-gettext use the GNU gettext library included here],
+ nls_cv_force_use_gnu_gettext=$withval,
+ nls_cv_force_use_gnu_gettext=no)
+ AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
+
+ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+ ])
+ dnl User does not insist on using GNU NLS library. Figure out what
+ dnl to use. If GNU gettext is available we use this. Else we have
+ dnl to fall back to GNU NLS library.
+
+ dnl Add a version number to the cache macros.
+ define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
+ define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
+ define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
+
+ AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
+ [AC_TRY_LINK([#include <libintl.h>
+]ifelse([$2], [need-formatstring-macros],
+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+], [])[extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;],
+ [bindtextdomain ("", "");
+return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
+ gt_cv_func_gnugettext_libc=yes,
+ gt_cv_func_gnugettext_libc=no)])
+
+ if test "$gt_cv_func_gnugettext_libc" != "yes"; then
+ dnl Sometimes libintl requires libiconv, so first search for libiconv.
+ ifelse(gt_included_intl, yes, , [
+ AM_ICONV_LINK
+ ])
+ dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
+ dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
+ dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
+ dnl even if libiconv doesn't exist.
+ AC_LIB_LINKFLAGS_BODY([intl])
+ AC_CACHE_CHECK([for GNU gettext in libintl],
+ gt_cv_func_gnugettext_libintl,
+ [gt_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $INCINTL"
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBINTL"
+ dnl Now see whether libintl exists and does not depend on libiconv.
+ AC_TRY_LINK([#include <libintl.h>
+]ifelse([$2], [need-formatstring-macros],
+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+], [])[extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias ();],
+ [bindtextdomain ("", "");
+return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
+ gt_cv_func_gnugettext_libintl=yes,
+ gt_cv_func_gnugettext_libintl=no)
+ dnl Now see whether libintl exists and depends on libiconv.
+ if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
+ LIBS="$LIBS $LIBICONV"
+ AC_TRY_LINK([#include <libintl.h>
+]ifelse([$2], [need-formatstring-macros],
+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+], [])[extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias ();],
+ [bindtextdomain ("", "");
+return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
+ [LIBINTL="$LIBINTL $LIBICONV"
+ LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+ gt_cv_func_gnugettext_libintl=yes
+ ])
+ fi
+ CPPFLAGS="$gt_save_CPPFLAGS"
+ LIBS="$gt_save_LIBS"])
+ fi
+
+ dnl If an already present or preinstalled GNU gettext() is found,
+ dnl use it. But if this macro is used in GNU gettext, and GNU
+ dnl gettext is already preinstalled in libintl, we update this
+ dnl libintl. (Cf. the install rule in intl/Makefile.in.)
+ if test "$gt_cv_func_gnugettext_libc" = "yes" \
+ || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
+ && test "$PACKAGE" != gettext-runtime \
+ && test "$PACKAGE" != gettext-tools; }; then
+ gt_use_preinstalled_gnugettext=yes
+ else
+ dnl Reset the values set by searching for libintl.
+ LIBINTL=
+ LTLIBINTL=
+ INCINTL=
+ fi
+
+ ifelse(gt_included_intl, yes, [
+ if test "$gt_use_preinstalled_gnugettext" != "yes"; then
+ dnl GNU gettext is not found in the C library.
+ dnl Fall back on included GNU gettext library.
+ nls_cv_use_gnu_gettext=yes
+ fi
+ fi
+
+ if test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Mark actions used to generate GNU NLS library.
+ BUILD_INCLUDED_LIBINTL=yes
+ USE_INCLUDED_LIBINTL=yes
+ LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
+ LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
+ LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
+ fi
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Mark actions to use GNU gettext tools.
+ CATOBJEXT=.gmo
+ fi
+ ])
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ AC_DEFINE(ENABLE_NLS, 1,
+ [Define to 1 if translation of program messages to the user's native language
+ is requested.])
+ else
+ USE_NLS=no
+ fi
+ fi
+
+ AC_MSG_CHECKING([whether to use NLS])
+ AC_MSG_RESULT([$USE_NLS])
+ if test "$USE_NLS" = "yes"; then
+ AC_MSG_CHECKING([where the gettext function comes from])
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
+ gt_source="external libintl"
+ else
+ gt_source="libc"
+ fi
+ else
+ gt_source="included intl directory"
+ fi
+ AC_MSG_RESULT([$gt_source])
+ fi
+
+ if test "$USE_NLS" = "yes"; then
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
+ AC_MSG_CHECKING([how to link with libintl])
+ AC_MSG_RESULT([$LIBINTL])
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
+ fi
+
+ dnl For backward compatibility. Some packages may be using this.
+ AC_DEFINE(HAVE_GETTEXT, 1,
+ [Define if the GNU gettext() function is already present or preinstalled.])
+ AC_DEFINE(HAVE_DCGETTEXT, 1,
+ [Define if the GNU dcgettext() function is already present or preinstalled.])
+ fi
+
+ dnl We need to process the po/ directory.
+ POSUB=po
+ fi
+
+ ifelse(gt_included_intl, yes, [
+ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
+ dnl to 'yes' because some of the testsuite requires it.
+ if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
+ BUILD_INCLUDED_LIBINTL=yes
+ fi
+
+ dnl Make all variables we use known to autoconf.
+ AC_SUBST(BUILD_INCLUDED_LIBINTL)
+ AC_SUBST(USE_INCLUDED_LIBINTL)
+ AC_SUBST(CATOBJEXT)
+
+ dnl For backward compatibility. Some configure.ins may be using this.
+ nls_cv_header_intl=
+ nls_cv_header_libgt=
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ DATADIRNAME=share
+ AC_SUBST(DATADIRNAME)
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ INSTOBJEXT=.mo
+ AC_SUBST(INSTOBJEXT)
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ GENCAT=gencat
+ AC_SUBST(GENCAT)
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ if test "$USE_INCLUDED_LIBINTL" = yes; then
+ INTLOBJS="\$(GETTOBJS)"
+ fi
+ AC_SUBST(INTLOBJS)
+
+ dnl Enable libtool support if the surrounding package wishes it.
+ INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
+ AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
+ ])
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ INTLLIBS="$LIBINTL"
+ AC_SUBST(INTLLIBS)
+
+ dnl Make all documented variables known to autoconf.
+ AC_SUBST(LIBINTL)
+ AC_SUBST(LTLIBINTL)
+ AC_SUBST(POSUB)
+])
+
+
+dnl Checks for all prerequisites of the intl subdirectory,
+dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
+dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
+AC_DEFUN([AM_INTL_SUBDIR],
+[
+ AC_REQUIRE([AC_PROG_INSTALL])dnl
+ AC_REQUIRE([AM_MKINSTALLDIRS])dnl
+ AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
+ AC_REQUIRE([AC_PROG_RANLIB])dnl
+ AC_REQUIRE([AC_ISC_POSIX])dnl
+ AC_REQUIRE([AC_HEADER_STDC])dnl
+ AC_REQUIRE([AC_C_CONST])dnl
+ AC_REQUIRE([bh_C_SIGNED])dnl
+ AC_REQUIRE([AC_C_INLINE])dnl
+ AC_REQUIRE([AC_TYPE_OFF_T])dnl
+ AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+ AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl
+ AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
+ AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
+ AC_REQUIRE([gt_TYPE_WINT_T])dnl
+ AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([jm_AC_HEADER_STDINT_H])
+ AC_REQUIRE([gt_TYPE_INTMAX_T])
+ AC_REQUIRE([gt_PRINTF_POSIX])
+ AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+ AC_REQUIRE([AC_FUNC_MMAP])dnl
+ AC_REQUIRE([jm_GLIBC21])dnl
+ AC_REQUIRE([gt_INTDIV0])dnl
+ AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
+ AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
+ AC_REQUIRE([gt_INTTYPES_PRI])dnl
+ AC_REQUIRE([gl_XSIZE])dnl
+
+ AC_CHECK_TYPE([ptrdiff_t], ,
+ [AC_DEFINE([ptrdiff_t], [long],
+ [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
+ ])
+ AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
+stdlib.h string.h unistd.h sys/param.h])
+ AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
+mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
+strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
+__fsetlocking])
+
+ dnl Use the _snprintf function only if it is declared (because on NetBSD it
+ dnl is defined as a weak alias of snprintf; we prefer to use the latter).
+ gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
+ gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
+
+ dnl Use the *_unlocked functions only if they are declared.
+ dnl (because some of them were defined without being declared in Solaris
+ dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
+ dnl on Solaris 2.5.1 to run on Solaris 2.6).
+ dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
+ gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
+ gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
+ gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
+
+ case $gt_cv_func_printf_posix in
+ *yes) HAVE_POSIX_PRINTF=1 ;;
+ *) HAVE_POSIX_PRINTF=0 ;;
+ esac
+ AC_SUBST([HAVE_POSIX_PRINTF])
+ if test "$ac_cv_func_asprintf" = yes; then
+ HAVE_ASPRINTF=1
+ else
+ HAVE_ASPRINTF=0
+ fi
+ AC_SUBST([HAVE_ASPRINTF])
+ if test "$ac_cv_func_snprintf" = yes; then
+ HAVE_SNPRINTF=1
+ else
+ HAVE_SNPRINTF=0
+ fi
+ AC_SUBST([HAVE_SNPRINTF])
+ if test "$ac_cv_func_wprintf" = yes; then
+ HAVE_WPRINTF=1
+ else
+ HAVE_WPRINTF=0
+ fi
+ AC_SUBST([HAVE_WPRINTF])
+
+ AM_ICONV
+ AM_LANGINFO_CODESET
+ if test $ac_cv_header_locale_h = yes; then
+ AM_LC_MESSAGES
+ fi
+
+ dnl intl/plural.c is generated from intl/plural.y. It requires bison,
+ dnl because plural.y uses bison specific features. It requires at least
+ dnl bison-1.26 because earlier versions generate a plural.c that doesn't
+ dnl compile.
+ dnl bison is only needed for the maintainer (who touches plural.y). But in
+ dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
+ dnl the rule in general Makefile. Now, some people carelessly touch the
+ dnl files or have a broken "make" program, hence the plural.c rule will
+ dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
+ dnl present or too old.
+ AC_CHECK_PROGS([INTLBISON], [bison])
+ if test -z "$INTLBISON"; then
+ ac_verc_fail=yes
+ else
+ dnl Found it, now check the version.
+ AC_MSG_CHECKING([version of bison])
+changequote(<<,>>)dnl
+ ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
+ case $ac_prog_version in
+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+ 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
+changequote([,])dnl
+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+ esac
+ AC_MSG_RESULT([$ac_prog_version])
+ fi
+ if test $ac_verc_fail = yes; then
+ INTLBISON=:
+ fi
+])
+
+
+dnl gt_CHECK_DECL(FUNC, INCLUDES)
+dnl Check whether a function is declared.
+AC_DEFUN([gt_CHECK_DECL],
+[
+ AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
+ [AC_TRY_COMPILE([$2], [
+#ifndef $1
+ char *p = (char *) $1;
+#endif
+], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
+ if test $ac_cv_have_decl_$1 = yes; then
+ gt_value=1
+ else
+ gt_value=0
+ fi
+ AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
+ [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
+])
+
+
+dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
+AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
--- /dev/null
+# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+# Test for the GNU C Library, version 2.1 or newer.
+# From Bruno Haible.
+
+AC_DEFUN([jm_GLIBC21],
+ [
+ AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
+ ac_cv_gnu_library_2_1,
+ [AC_EGREP_CPP([Lucky GNU user],
+ [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
+ Lucky GNU user
+ #endif
+#endif
+ ],
+ ac_cv_gnu_library_2_1=yes,
+ ac_cv_gnu_library_2_1=no)
+ ]
+ )
+ AC_SUBST(GLIBC21)
+ GLIBC21="$ac_cv_gnu_library_2_1"
+ ]
+)
--- /dev/null
+# iconv.m4 serial AM4 (gettext-0.11.3)
+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
+[
+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+
+ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+ dnl accordingly.
+ AC_LIB_LINKFLAGS_BODY([iconv])
+])
+
+AC_DEFUN([AM_ICONV_LINK],
+[
+ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
+ dnl those with the standalone portable GNU libiconv installed).
+
+ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+ dnl accordingly.
+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+
+ dnl Add $INCICONV to CPPFLAGS before performing the following checks,
+ dnl because if the user has installed libiconv and not disabled its use
+ dnl via --without-libiconv-prefix, he wants to use it. The first
+ dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
+ am_save_CPPFLAGS="$CPPFLAGS"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
+
+ AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ am_cv_func_iconv=yes)
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBICONV"
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ am_cv_lib_iconv=yes
+ am_cv_func_iconv=yes)
+ LIBS="$am_save_LIBS"
+ fi
+ ])
+ if test "$am_cv_func_iconv" = yes; then
+ AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
+ fi
+ if test "$am_cv_lib_iconv" = yes; then
+ AC_MSG_CHECKING([how to link with libiconv])
+ AC_MSG_RESULT([$LIBICONV])
+ else
+ dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
+ dnl either.
+ CPPFLAGS="$am_save_CPPFLAGS"
+ LIBICONV=
+ LTLIBICONV=
+ fi
+ AC_SUBST(LIBICONV)
+ AC_SUBST(LTLIBICONV)
+])
+
+AC_DEFUN([AM_ICONV],
+[
+ AM_ICONV_LINK
+ if test "$am_cv_func_iconv" = yes; then
+ AC_MSG_CHECKING([for iconv declaration])
+ AC_CACHE_VAL(am_cv_proto_iconv, [
+ AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+#else
+size_t iconv();
+#endif
+], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
+ am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
+ am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+ AC_MSG_RESULT([$]{ac_t:-
+ }[$]am_cv_proto_iconv)
+ AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
+ [Define as const if the declaration of iconv() needs const.])
+ fi
+])
--- /dev/null
+# intdiv0.m4 serial 1 (gettext-0.11.3)
+dnl Copyright (C) 2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gt_INTDIV0],
+[
+ AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
+
+ AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
+ gt_cv_int_divbyzero_sigfpe,
+ [
+ AC_TRY_RUN([
+#include <stdlib.h>
+#include <signal.h>
+
+static void
+#ifdef __cplusplus
+sigfpe_handler (int sig)
+#else
+sigfpe_handler (sig) int sig;
+#endif
+{
+ /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
+ exit (sig != SIGFPE);
+}
+
+int x = 1;
+int y = 0;
+int z;
+int nan;
+
+int main ()
+{
+ signal (SIGFPE, sigfpe_handler);
+/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
+#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
+ signal (SIGTRAP, sigfpe_handler);
+#endif
+/* Linux/SPARC yields signal SIGILL. */
+#if defined (__sparc__) && defined (__linux__)
+ signal (SIGILL, sigfpe_handler);
+#endif
+
+ z = x / y;
+ nan = y / y;
+ exit (1);
+}
+], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
+ [
+ # Guess based on the CPU.
+ case "$host_cpu" in
+ alpha* | i[34567]86 | m68k | s390*)
+ gt_cv_int_divbyzero_sigfpe="guessing yes";;
+ *)
+ gt_cv_int_divbyzero_sigfpe="guessing no";;
+ esac
+ ])
+ ])
+ case "$gt_cv_int_divbyzero_sigfpe" in
+ *yes) value=1;;
+ *) value=0;;
+ esac
+ AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
+ [Define if integer division by zero raises signal SIGFPE.])
+])
--- /dev/null
+# intmax.m4 serial 1 (gettext-0.12)
+dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+dnl Test whether the system has the 'intmax_t' type, but don't attempt to
+dnl find a replacement if it is lacking.
+
+AC_DEFUN([gt_TYPE_INTMAX_T],
+[
+ AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([jm_AC_HEADER_STDINT_H])
+ AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
+ [AC_TRY_COMPILE([
+#include <stddef.h>
+#include <stdlib.h>
+#if HAVE_STDINT_H_WITH_UINTMAX
+#include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H_WITH_UINTMAX
+#include <inttypes.h>
+#endif
+], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
+ if test $gt_cv_c_intmax_t = yes; then
+ AC_DEFINE(HAVE_INTMAX_T, 1,
+ [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
+ fi
+])
--- /dev/null
+# inttypes-pri.m4 serial 1 (gettext-0.11.4)
+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
+# macros to non-string values. This is the case on AIX 4.3.3.
+
+AC_DEFUN([gt_INTTYPES_PRI],
+[
+ AC_REQUIRE([gt_HEADER_INTTYPES_H])
+ if test $gt_cv_header_inttypes_h = yes; then
+ AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
+ gt_cv_inttypes_pri_broken,
+ [
+ AC_TRY_COMPILE([#include <inttypes.h>
+#ifdef PRId32
+char *p = PRId32;
+#endif
+], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
+ ])
+ fi
+ if test "$gt_cv_inttypes_pri_broken" = yes; then
+ AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
+ [Define if <inttypes.h> exists and defines unusable PRI* macros.])
+ fi
+])
--- /dev/null
+# inttypes.m4 serial 1 (gettext-0.11.4)
+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
+# <sys/types.h>.
+
+AC_DEFUN([gt_HEADER_INTTYPES_H],
+[
+ AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
+ [
+ AC_TRY_COMPILE(
+ [#include <sys/types.h>
+#include <inttypes.h>],
+ [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
+ ])
+ if test $gt_cv_header_inttypes_h = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
+ [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
+ fi
+])
--- /dev/null
+# inttypes_h.m4 serial 5 (gettext-0.12)
+dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
+[
+ AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
+ [AC_TRY_COMPILE(
+ [#include <sys/types.h>
+#include <inttypes.h>],
+ [uintmax_t i = (uintmax_t) -1;],
+ jm_ac_cv_header_inttypes_h=yes,
+ jm_ac_cv_header_inttypes_h=no)])
+ if test $jm_ac_cv_header_inttypes_h = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
+ [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
+ and declares uintmax_t. ])
+ fi
+])
--- /dev/null
+# isc-posix.m4 serial 2 (gettext-0.11.2)
+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+# This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
+
+# This test replaces the one in autoconf.
+# Currently this macro should have the same name as the autoconf macro
+# because gettext's gettext.m4 (distributed in the automake package)
+# still uses it. Otherwise, the use in gettext.m4 makes autoheader
+# give these diagnostics:
+# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
+# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
+
+undefine([AC_ISC_POSIX])
+
+AC_DEFUN([AC_ISC_POSIX],
+ [
+ dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
+ AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
+ ]
+)
--- /dev/null
+# lcmessage.m4 serial 3 (gettext-0.11.3)
+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+
+AC_DEFUN([AM_LC_MESSAGES],
+[
+ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+ am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+ if test $am_cv_val_LC_MESSAGES = yes; then
+ AC_DEFINE(HAVE_LC_MESSAGES, 1,
+ [Define if your <locale.h> file defines LC_MESSAGES.])
+ fi
+])
--- /dev/null
+# lib-ld.m4 serial 3 (gettext-0.13)
+dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl Subroutines of libtool.m4,
+dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
+dnl with libtool.m4.
+
+dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
+AC_DEFUN([AC_LIB_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ acl_cv_prog_gnu_ld=yes ;;
+*)
+ acl_cv_prog_gnu_ld=no ;;
+esac])
+with_gnu_ld=$acl_cv_prog_gnu_ld
+])
+
+dnl From libtool-1.4. Sets the variable LD.
+AC_DEFUN([AC_LIB_PROG_LD],
+[AC_ARG_WITH(gnu-ld,
+[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by GCC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]* | [A-Za-z]:[\\/]*)]
+ [re_direlt='/[^/][^/]*/\.\./']
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(acl_cv_path_LD,
+[if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ acl_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break ;;
+ *)
+ test "$with_gnu_ld" != yes && break ;;
+ esac
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$acl_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_LIB_PROG_LD_GNU
+])
--- /dev/null
+# lib-link.m4 serial 4 (gettext-0.12)
+dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
+dnl augments the CPPFLAGS variable.
+AC_DEFUN([AC_LIB_LINKFLAGS],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+ define([Name],[translit([$1],[./-], [___])])
+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
+ AC_LIB_LINKFLAGS_BODY([$1], [$2])
+ ac_cv_lib[]Name[]_libs="$LIB[]NAME"
+ ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
+ ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
+ ])
+ LIB[]NAME="$ac_cv_lib[]Name[]_libs"
+ LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
+ INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+ AC_SUBST([LIB]NAME)
+ AC_SUBST([LTLIB]NAME)
+ dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
+ dnl results of this search when this library appears as a dependency.
+ HAVE_LIB[]NAME=yes
+ undefine([Name])
+ undefine([NAME])
+])
+
+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
+dnl searches for libname and the libraries corresponding to explicit and
+dnl implicit dependencies, together with the specified include files and
+dnl the ability to compile and link the specified testcode. If found, it
+dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
+dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
+dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
+dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
+AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+ define([Name],[translit([$1],[./-], [___])])
+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+
+ dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
+ dnl accordingly.
+ AC_LIB_LINKFLAGS_BODY([$1], [$2])
+
+ dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
+ dnl because if the user has installed lib[]Name and not disabled its use
+ dnl via --without-lib[]Name-prefix, he wants to use it.
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+
+ AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIB[]NAME"
+ AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
+ LIBS="$ac_save_LIBS"
+ ])
+ if test "$ac_cv_lib[]Name" = yes; then
+ HAVE_LIB[]NAME=yes
+ AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
+ AC_MSG_CHECKING([how to link with lib[]$1])
+ AC_MSG_RESULT([$LIB[]NAME])
+ else
+ HAVE_LIB[]NAME=no
+ dnl If $LIB[]NAME didn't lead to a usable library, we don't need
+ dnl $INC[]NAME either.
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LIB[]NAME=
+ LTLIB[]NAME=
+ fi
+ AC_SUBST([HAVE_LIB]NAME)
+ AC_SUBST([LIB]NAME)
+ AC_SUBST([LTLIB]NAME)
+ undefine([Name])
+ undefine([NAME])
+])
+
+dnl Determine the platform dependent parameters needed to use rpath:
+dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
+dnl hardcode_direct, hardcode_minus_L.
+AC_DEFUN([AC_LIB_RPATH],
+[
+ AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
+ AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
+ AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
+ AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
+ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+ . ./conftest.sh
+ rm -f ./conftest.sh
+ acl_cv_rpath=done
+ ])
+ wl="$acl_cv_wl"
+ libext="$acl_cv_libext"
+ shlibext="$acl_cv_shlibext"
+ hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+ hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+ hardcode_direct="$acl_cv_hardcode_direct"
+ hardcode_minus_L="$acl_cv_hardcode_minus_L"
+ dnl Determine whether the user wants rpath handling at all.
+ AC_ARG_ENABLE(rpath,
+ [ --disable-rpath do not hardcode runtime library paths],
+ :, enable_rpath=yes)
+])
+
+dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
+AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
+[
+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ dnl By default, look in $includedir and $libdir.
+ use_additional=yes
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ AC_LIB_ARG_WITH([lib$1-prefix],
+[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
+ --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
+[
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/lib"
+ fi
+ fi
+])
+ dnl Search the library and its dependencies in $additional_libdir and
+ dnl $LDFLAGS. Using breadth-first-seach.
+ LIB[]NAME=
+ LTLIB[]NAME=
+ INC[]NAME=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='$1 $2'
+ while test -n "$names_next_round"; do
+ names_this_round="$names_next_round"
+ names_next_round=
+ for name in $names_this_round; do
+ already_handled=
+ for n in $names_already_handled; do
+ if test "$n" = "$name"; then
+ already_handled=yes
+ break
+ fi
+ done
+ if test -z "$already_handled"; then
+ names_already_handled="$names_already_handled $name"
+ dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
+ dnl or AC_LIB_HAVE_LINKFLAGS call.
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+ eval value=\"\$HAVE_LIB$uppername\"
+ if test -n "$value"; then
+ if test "$value" = yes; then
+ eval value=\"\$LIB$uppername\"
+ test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
+ else
+ dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
+ dnl that this library doesn't exist. So just drop it.
+ :
+ fi
+ else
+ dnl Search the library lib$name in $additional_libdir and $LDFLAGS
+ dnl and the already constructed $LIBNAME/$LTLIBNAME.
+ found_dir=
+ found_la=
+ found_so=
+ found_a=
+ if test $use_additional = yes; then
+ if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
+ found_dir="$additional_libdir"
+ found_so="$additional_libdir/lib$name.$shlibext"
+ if test -f "$additional_libdir/lib$name.la"; then
+ found_la="$additional_libdir/lib$name.la"
+ fi
+ else
+ if test -f "$additional_libdir/lib$name.$libext"; then
+ found_dir="$additional_libdir"
+ found_a="$additional_libdir/lib$name.$libext"
+ if test -f "$additional_libdir/lib$name.la"; then
+ found_la="$additional_libdir/lib$name.la"
+ fi
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
+ found_dir="$dir"
+ found_so="$dir/lib$name.$shlibext"
+ if test -f "$dir/lib$name.la"; then
+ found_la="$dir/lib$name.la"
+ fi
+ else
+ if test -f "$dir/lib$name.$libext"; then
+ found_dir="$dir"
+ found_a="$dir/lib$name.$libext"
+ if test -f "$dir/lib$name.la"; then
+ found_la="$dir/lib$name.la"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ if test "X$found_dir" != "X"; then
+ break
+ fi
+ done
+ fi
+ if test "X$found_dir" != "X"; then
+ dnl Found the library.
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ dnl Linking with a shared library. We attempt to hardcode its
+ dnl directory into the executable's runpath, unless it's the
+ dnl standard /usr/lib.
+ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
+ dnl No hardcoding is needed.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ dnl Use an explicit option to hardcode DIR into the resulting
+ dnl binary.
+ dnl Potentially add DIR to ltrpathdirs.
+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $found_dir"
+ fi
+ dnl The hardcoding into $LIBNAME is system dependent.
+ if test "$hardcode_direct" = yes; then
+ dnl Using DIR/libNAME.so during linking hardcodes DIR into the
+ dnl resulting binary.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+ dnl Use an explicit option to hardcode DIR into the resulting
+ dnl binary.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ dnl Potentially add DIR to rpathdirs.
+ dnl The rpathdirs will be appended to $LIBNAME at the end.
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $found_dir"
+ fi
+ else
+ dnl Rely on "-L$found_dir".
+ dnl But don't add it if it's already contained in the LDFLAGS
+ dnl or the already constructed $LIBNAME
+ haveit=
+ for x in $LDFLAGS $LIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
+ fi
+ if test "$hardcode_minus_L" != no; then
+ dnl FIXME: Not sure whether we should use
+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+ dnl here.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
+ dnl here, because this doesn't fit in flags passed to the
+ dnl compiler. So give up. No hardcoding. This affects only
+ dnl very old systems.
+ dnl FIXME: Not sure whether we should use
+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+ dnl here.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+ fi
+ fi
+ fi
+ fi
+ else
+ if test "X$found_a" != "X"; then
+ dnl Linking with a static library.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
+ else
+ dnl We shouldn't come here, but anyway it's good to have a
+ dnl fallback.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
+ fi
+ fi
+ dnl Assume the include files are nearby.
+ additional_includedir=
+ case "$found_dir" in
+ */lib | */lib/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
+ additional_includedir="$basedir/include"
+ ;;
+ esac
+ if test "X$additional_includedir" != "X"; then
+ dnl Potentially add $additional_includedir to $INCNAME.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/include,
+ dnl 2. if it's /usr/local/include and we are using GCC on Linux,
+ dnl 3. if it's already present in $CPPFLAGS or the already
+ dnl constructed $INCNAME,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux*) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ for x in $CPPFLAGS $INC[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ dnl Really add $additional_includedir to $INCNAME.
+ INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ fi
+ dnl Look for dependencies.
+ if test -n "$found_la"; then
+ dnl Read the .la file. It defines the variables
+ dnl dlname, library_names, old_library, dependency_libs, current,
+ dnl age, revision, installed, dlopen, dlpreopen, libdir.
+ save_libdir="$libdir"
+ case "$found_la" in
+ */* | *\\*) . "$found_la" ;;
+ *) . "./$found_la" ;;
+ esac
+ libdir="$save_libdir"
+ dnl We use only dependency_libs.
+ for dep in $dependency_libs; do
+ case "$dep" in
+ -L*)
+ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/lib,
+ dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
+ dnl 3. if it's already present in $LDFLAGS or the already
+ dnl constructed $LIBNAME,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_libdir" != "X/usr/lib"; then
+ haveit=
+ if test "X$additional_libdir" = "X/usr/local/lib"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux*) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ haveit=
+ for x in $LDFLAGS $LIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LIBNAME.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
+ fi
+ fi
+ haveit=
+ for x in $LDFLAGS $LTLIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LTLIBNAME.
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ ;;
+ -R*)
+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
+ if test "$enable_rpath" != no; then
+ dnl Potentially add DIR to rpathdirs.
+ dnl The rpathdirs will be appended to $LIBNAME at the end.
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ dnl Potentially add DIR to ltrpathdirs.
+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $dir"
+ fi
+ fi
+ ;;
+ -l*)
+ dnl Handle this in the next round.
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ dnl Handle this in the next round. Throw away the .la's
+ dnl directory; it is already contained in a preceding -L
+ dnl option.
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ dnl Most likely an immediate library name.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ dnl Didn't find the library; assume it is in the system directories
+ dnl known to the linker and runtime loader. (All the system
+ dnl directories known to the linker should also be known to the
+ dnl runtime loader, otherwise the system is severely misconfigured.)
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$hardcode_libdir_separator"; then
+ dnl Weird platform: only the last -rpath option counts, the user must
+ dnl pass all path elements in one option. We can arrange that for a
+ dnl single library, but not when more than one $LIBNAMEs are used.
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
+ done
+ dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+ else
+ dnl The -rpath options are cumulative.
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ dnl When using libtool, the option that works for both libraries and
+ dnl executables is -R. The -R options are cumulative.
+ for found_dir in $ltrpathdirs; do
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
+ done
+ fi
+])
+
+dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
+dnl unless already present in VAR.
+dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
+dnl contains two or three consecutive elements that belong together.
+AC_DEFUN([AC_LIB_APPENDTOVAR],
+[
+ for element in [$2]; do
+ haveit=
+ for x in $[$1]; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ [$1]="${[$1]}${[$1]:+ }$element"
+ fi
+ done
+])
--- /dev/null
+# lib-prefix.m4 serial 3 (gettext-0.13)
+dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
+dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
+dnl require excessive bracketing.
+ifdef([AC_HELP_STRING],
+[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
+[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
+
+dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
+dnl to access previously installed libraries. The basic assumption is that
+dnl a user will want packages to use other packages he previously installed
+dnl with the same --prefix option.
+dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
+dnl libraries, but is otherwise very convenient.
+AC_DEFUN([AC_LIB_PREFIX],
+[
+ AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ dnl By default, look in $includedir and $libdir.
+ use_additional=yes
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ AC_LIB_ARG_WITH([lib-prefix],
+[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+ --without-lib-prefix don't search for libraries in includedir and libdir],
+[
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/lib"
+ fi
+ fi
+])
+ if test $use_additional = yes; then
+ dnl Potentially add $additional_includedir to $CPPFLAGS.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/include,
+ dnl 2. if it's already present in $CPPFLAGS,
+ dnl 3. if it's /usr/local/include and we are using GCC on Linux,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ for x in $CPPFLAGS; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux*) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ dnl Really add $additional_includedir to $CPPFLAGS.
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ dnl Potentially add $additional_libdir to $LDFLAGS.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/lib,
+ dnl 2. if it's already present in $LDFLAGS,
+ dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_libdir" != "X/usr/lib"; then
+ haveit=
+ for x in $LDFLAGS; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test "X$additional_libdir" = "X/usr/local/lib"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux*) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LDFLAGS.
+ LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ fi
+])
+
+dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
+dnl acl_final_exec_prefix, containing the values to which $prefix and
+dnl $exec_prefix will expand at the end of the configure script.
+AC_DEFUN([AC_LIB_PREPARE_PREFIX],
+[
+ dnl Unfortunately, prefix and exec_prefix get only finally determined
+ dnl at the end of configure.
+ if test "X$prefix" = "XNONE"; then
+ acl_final_prefix="$ac_default_prefix"
+ else
+ acl_final_prefix="$prefix"
+ fi
+ if test "X$exec_prefix" = "XNONE"; then
+ acl_final_exec_prefix='${prefix}'
+ else
+ acl_final_exec_prefix="$exec_prefix"
+ fi
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+ prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
+dnl variables prefix and exec_prefix bound to the values they will have
+dnl at the end of the configure script.
+AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
+[
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ $1
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+])
--- /dev/null
+# longdouble.m4 serial 1 (gettext-0.12)
+dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+dnl Test whether the compiler supports the 'long double' type.
+dnl Prerequisite: AC_PROG_CC
+
+AC_DEFUN([gt_TYPE_LONGDOUBLE],
+[
+ AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
+ [if test "$GCC" = yes; then
+ gt_cv_c_long_double=yes
+ else
+ AC_TRY_COMPILE([
+ /* The Stardent Vistra knows sizeof(long double), but does not support it. */
+ long double foo = 0.0;
+ /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
+ int array [2*(sizeof(long double) >= sizeof(double)) - 1];
+ ], ,
+ gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
+ fi])
+ if test $gt_cv_c_long_double = yes; then
+ AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
+ fi
+])
--- /dev/null
+# longlong.m4 serial 4
+dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_LONG_LONG if 'long long' works.
+
+AC_DEFUN([jm_AC_TYPE_LONG_LONG],
+[
+ AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
+ [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
+ [long long llmax = (long long) -1;
+ return ll << i | ll >> i | llmax / ll | llmax % ll;],
+ ac_cv_type_long_long=yes,
+ ac_cv_type_long_long=no)])
+ if test $ac_cv_type_long_long = yes; then
+ AC_DEFINE(HAVE_LONG_LONG, 1,
+ [Define if you have the 'long long' type.])
+ fi
+])
--- /dev/null
+# nls.m4 serial 1 (gettext-0.12)
+dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+AC_DEFUN([AM_NLS],
+[
+ AC_MSG_CHECKING([whether NLS is requested])
+ dnl Default is enabled NLS
+ AC_ARG_ENABLE(nls,
+ [ --disable-nls do not use Native Language Support],
+ USE_NLS=$enableval, USE_NLS=yes)
+ AC_MSG_RESULT($USE_NLS)
+ AC_SUBST(USE_NLS)
+])
+
+AC_DEFUN([AM_MKINSTALLDIRS],
+[
+ dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
+ dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
+ dnl Try to locate it.
+ MKINSTALLDIRS=
+ if test -n "$ac_aux_dir"; then
+ case "$ac_aux_dir" in
+ /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
+ *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
+ esac
+ fi
+ if test -z "$MKINSTALLDIRS"; then
+ MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
+ fi
+ AC_SUBST(MKINSTALLDIRS)
+])
--- /dev/null
+# po.m4 serial 3 (gettext-0.14)
+dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+dnl Checks for all prerequisites of the po subdirectory.
+AC_DEFUN([AM_PO_SUBDIRS],
+[
+ AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+ AC_REQUIRE([AC_PROG_INSTALL])dnl
+ AC_REQUIRE([AM_MKINSTALLDIRS])dnl
+ AC_REQUIRE([AM_NLS])dnl
+
+ dnl Perform the following tests also if --disable-nls has been given,
+ dnl because they are needed for "make dist" to work.
+
+ dnl Search for GNU msgfmt in the PATH.
+ dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
+ dnl The second test excludes FreeBSD msgfmt.
+ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
+ (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+ :)
+ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+
+ dnl Search for GNU xgettext 0.12 or newer in the PATH.
+ dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
+ dnl The second test excludes FreeBSD xgettext.
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
+ (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+ :)
+ dnl Remove leftover from FreeBSD xgettext call.
+ rm -f messages.po
+
+ dnl Search for GNU msgmerge 0.11 or newer in the PATH.
+ AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
+ [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
+
+ dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
+ dnl Test whether we really found GNU msgfmt.
+ if test "$GMSGFMT" != ":"; then
+ dnl If it is no GNU msgfmt we define it as : so that the
+ dnl Makefiles still can work.
+ if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
+ (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+ : ;
+ else
+ GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
+ AC_MSG_RESULT(
+ [found $GMSGFMT program is not GNU msgfmt; ignore it])
+ GMSGFMT=":"
+ fi
+ fi
+
+ dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
+ dnl Test whether we really found GNU xgettext.
+ if test "$XGETTEXT" != ":"; then
+ dnl If it is no GNU xgettext we define it as : so that the
+ dnl Makefiles still can work.
+ if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
+ (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+ : ;
+ else
+ AC_MSG_RESULT(
+ [found xgettext program is not GNU xgettext; ignore it])
+ XGETTEXT=":"
+ fi
+ dnl Remove leftover from FreeBSD xgettext call.
+ rm -f messages.po
+ fi
+
+ AC_OUTPUT_COMMANDS([
+ for ac_file in $CONFIG_FILES; do
+ # Support "outfile[:infile[:infile...]]"
+ case "$ac_file" in
+ *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ esac
+ # PO directories have a Makefile.in generated from Makefile.in.in.
+ case "$ac_file" in */Makefile.in)
+ # Adjust a relative srcdir.
+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+ ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+ case "$ac_given_srcdir" in
+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+ /*) top_srcdir="$ac_given_srcdir" ;;
+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+ rm -f "$ac_dir/POTFILES"
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+ cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+ POMAKEFILEDEPS="POTFILES.in"
+ # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
+ # on $ac_dir but don't depend on user-specified configuration
+ # parameters.
+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+ # The LINGUAS file contains the set of available languages.
+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+ fi
+ ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ # Hide the ALL_LINGUAS assigment from automake.
+ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # The set of available languages was given in configure.in.
+ eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
+ fi
+ # Compute POFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+ # Compute UPDATEPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+ # Compute DUMMYPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+ # Compute GMOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+ case "$ac_given_srcdir" in
+ .) srcdirpre= ;;
+ *) srcdirpre='$(srcdir)/' ;;
+ esac
+ POFILES=
+ UPDATEPOFILES=
+ DUMMYPOFILES=
+ GMOFILES=
+ for lang in $ALL_LINGUAS; do
+ POFILES="$POFILES $srcdirpre$lang.po"
+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+ done
+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
+ # environment variable.
+ INST_LINGUAS=
+ if test -n "$ALL_LINGUAS"; then
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "$LINGUAS"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ INST_LINGUAS="$INST_LINGUAS $presentlang"
+ fi
+ done
+ fi
+ CATALOGS=
+ if test -n "$INST_LINGUAS"; then
+ for lang in $INST_LINGUAS; do
+ CATALOGS="$CATALOGS $lang.gmo"
+ done
+ fi
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
+ sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+ for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
+ if test -f "$f"; then
+ case "$f" in
+ *.orig | *.bak | *~) ;;
+ *) cat "$f" >> "$ac_dir/Makefile" ;;
+ esac
+ fi
+ done
+ fi
+ ;;
+ esac
+ done],
+ [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
+ # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
+ # from automake.
+ eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+ # Capture the value of LINGUAS because we need it to compute CATALOGS.
+ LINGUAS="${LINGUAS-%UNSET%}"
+ ])
+])
+
+dnl Postprocesses a Makefile in a directory containing PO files.
+AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
+[
+ # When this code is run, in config.status, two variables have already been
+ # set:
+ # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
+ # - LINGUAS is the value of the environment variable LINGUAS at configure
+ # time.
+
+changequote(,)dnl
+ # Adjust a relative srcdir.
+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+ ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+ case "$ac_given_srcdir" in
+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+ /*) top_srcdir="$ac_given_srcdir" ;;
+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+ # Find a way to echo strings without interpreting backslash.
+ if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
+ gt_echo='echo'
+ else
+ if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
+ gt_echo='printf %s\n'
+ else
+ echo_func () {
+ cat <<EOT
+$*
+EOT
+ }
+ gt_echo='echo_func'
+ fi
+ fi
+
+ # A sed script that extracts the value of VARIABLE from a Makefile.
+ sed_x_variable='
+# Test if the hold space is empty.
+x
+s/P/P/
+x
+ta
+# Yes it was empty. Look if we have the expected variable definition.
+/^[ ]*VARIABLE[ ]*=/{
+ # Seen the first line of the variable definition.
+ s/^[ ]*VARIABLE[ ]*=//
+ ba
+}
+bd
+:a
+# Here we are processing a line from the variable definition.
+# Remove comment, more precisely replace it with a space.
+s/#.*$/ /
+# See if the line ends in a backslash.
+tb
+:b
+s/\\$//
+# Print the line, without the trailing backslash.
+p
+tc
+# There was no trailing backslash. The end of the variable definition is
+# reached. Clear the hold space.
+s/^.*$//
+x
+bd
+:c
+# A trailing backslash means that the variable definition continues in the
+# next line. Put a nonempty string into the hold space to indicate this.
+s/^.*$/P/
+x
+:d
+'
+changequote([,])dnl
+
+ # Set POTFILES to the value of the Makefile variable POTFILES.
+ sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
+ POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
+ # Compute POTFILES_DEPS as
+ # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
+ POTFILES_DEPS=
+ for file in $POTFILES; do
+ POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
+ done
+ POMAKEFILEDEPS=""
+
+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+ fi
+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+ # The LINGUAS file contains the set of available languages.
+ ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
+ sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
+ ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
+ fi
+ # Hide the ALL_LINGUAS assigment from automake.
+ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+ # Compute POFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+ # Compute UPDATEPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+ # Compute DUMMYPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+ # Compute GMOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+ # Compute PROPERTIESFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
+ # Compute CLASSFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
+ # Compute QMFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
+ # Compute MSGFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
+ # Compute RESOURCESDLLFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
+ case "$ac_given_srcdir" in
+ .) srcdirpre= ;;
+ *) srcdirpre='$(srcdir)/' ;;
+ esac
+ POFILES=
+ UPDATEPOFILES=
+ DUMMYPOFILES=
+ GMOFILES=
+ PROPERTIESFILES=
+ CLASSFILES=
+ QMFILES=
+ MSGFILES=
+ RESOURCESDLLFILES=
+ for lang in $ALL_LINGUAS; do
+ POFILES="$POFILES $srcdirpre$lang.po"
+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+ PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
+ CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
+ QMFILES="$QMFILES $srcdirpre$lang.qm"
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
+ frobbedlang=`echo $lang | sed -e 's/_/-/g'`
+ RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
+ done
+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
+ # environment variable.
+ INST_LINGUAS=
+ if test -n "$ALL_LINGUAS"; then
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "$LINGUAS"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ INST_LINGUAS="$INST_LINGUAS $presentlang"
+ fi
+ done
+ fi
+ CATALOGS=
+ JAVACATALOGS=
+ QTCATALOGS=
+ TCLCATALOGS=
+ CSHARPCATALOGS=
+ if test -n "$INST_LINGUAS"; then
+ for lang in $INST_LINGUAS; do
+ CATALOGS="$CATALOGS $lang.gmo"
+ JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
+ QTCATALOGS="$QTCATALOGS $lang.qm"
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
+ frobbedlang=`echo $lang | sed -e 's/_/-/g'`
+ CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
+ done
+ fi
+
+ sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
+ if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
+ # Add dependencies that cannot be formulated as a simple suffix rule.
+ for lang in $ALL_LINGUAS; do
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ cat >> "$ac_file.tmp" <<EOF
+$frobbedlang.msg: $lang.po
+ @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
+ \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+ done
+ fi
+ if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
+ # Add dependencies that cannot be formulated as a simple suffix rule.
+ for lang in $ALL_LINGUAS; do
+ frobbedlang=`echo $lang | sed -e 's/_/-/g'`
+ cat >> "$ac_file.tmp" <<EOF
+$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
+ @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
+ \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+ done
+ fi
+ if test -n "$POMAKEFILEDEPS"; then
+ cat >> "$ac_file.tmp" <<EOF
+Makefile: $POMAKEFILEDEPS
+EOF
+ fi
+ mv "$ac_file.tmp" "$ac_file"
+])
--- /dev/null
+# printf-posix.m4 serial 2 (gettext-0.13.1)
+dnl Copyright (C) 2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+dnl Test whether the printf() function supports POSIX/XSI format strings with
+dnl positions.
+
+AC_DEFUN([gt_PRINTF_POSIX],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
+ gt_cv_func_printf_posix,
+ [
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <string.h>
+/* The string "%2$d %1$d", with dollar characters protected from the shell's
+ dollar expansion (possibly an autoconf bug). */
+static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
+static char buf[100];
+int main ()
+{
+ sprintf (buf, format, 33, 55);
+ return (strcmp (buf, "55 33") != 0);
+}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
+ [
+ AC_EGREP_CPP(notposix, [
+#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
+ notposix
+#endif
+ ], gt_cv_func_printf_posix="guessing no",
+ gt_cv_func_printf_posix="guessing yes")
+ ])
+ ])
+ case $gt_cv_func_printf_posix in
+ *yes)
+ AC_DEFINE(HAVE_POSIX_PRINTF, 1,
+ [Define if your printf() function supports format strings with positions.])
+ ;;
+ esac
+])
--- /dev/null
+# progtest.m4 serial 3 (gettext-0.12)
+dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+# Search path for a program which passes the given test.
+
+dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
+dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN([AM_PATH_PROG_WITH_TEST],
+[
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+ [[\\/]]* | ?:[[\\/]]*)
+ ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in ifelse([$5], , $PATH, [$5]); do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ if [$3]; then
+ ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+ ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
+ AC_MSG_RESULT([$]$1)
+else
+ AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
--- /dev/null
+# signed.m4 serial 1 (gettext-0.10.40)
+dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([bh_C_SIGNED],
+[
+ AC_CACHE_CHECK([for signed], bh_cv_c_signed,
+ [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
+ if test $bh_cv_c_signed = no; then
+ AC_DEFINE(signed, ,
+ [Define to empty if the C compiler doesn't support this keyword.])
+ fi
+])
--- /dev/null
+# size_max.m4 serial 2
+dnl Copyright (C) 2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_SIZE_MAX],
+[
+ AC_CHECK_HEADERS(stdint.h)
+ dnl First test whether the system already has SIZE_MAX.
+ AC_MSG_CHECKING([for SIZE_MAX])
+ result=
+ AC_EGREP_CPP([Found it], [
+#include <limits.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#ifdef SIZE_MAX
+Found it
+#endif
+], result=yes)
+ if test -z "$result"; then
+ dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
+ dnl than the type 'unsigned long'.
+ dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
+ dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
+ _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
+ [#include <stddef.h>], result=?)
+ _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
+ [#include <stddef.h>], result=?)
+ _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
+ [#include <stddef.h>], result=?)
+ if test "$fits_in_uint" = 1; then
+ dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
+ dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
+ AC_TRY_COMPILE([#include <stddef.h>
+ extern size_t foo;
+ extern unsigned long foo;
+ ], [], fits_in_uint=0)
+ fi
+ if test -z "$result"; then
+ if test "$fits_in_uint" = 1; then
+ result="$res_hi$res_lo"U
+ else
+ result="$res_hi$res_lo"UL
+ fi
+ else
+ dnl Shouldn't happen, but who knows...
+ result='~(size_t)0'
+ fi
+ fi
+ AC_MSG_RESULT([$result])
+ if test "$result" != yes; then
+ AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
+ [Define as the maximum value of type 'size_t', if the system doesn't define it.])
+ fi
+])
--- /dev/null
+# stdint_h.m4 serial 3 (gettext-0.12)
+dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([jm_AC_HEADER_STDINT_H],
+[
+ AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
+ [AC_TRY_COMPILE(
+ [#include <sys/types.h>
+#include <stdint.h>],
+ [uintmax_t i = (uintmax_t) -1;],
+ jm_ac_cv_header_stdint_h=yes,
+ jm_ac_cv_header_stdint_h=no)])
+ if test $jm_ac_cv_header_stdint_h = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
+ [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
+ and declares uintmax_t. ])
+ fi
+])
--- /dev/null
+# uintmax_t.m4 serial 7 (gettext-0.12)
+dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+AC_PREREQ(2.13)
+
+# Define uintmax_t to 'unsigned long' or 'unsigned long long'
+# if it is not already defined in <stdint.h> or <inttypes.h>.
+
+AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
+[
+ AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([jm_AC_HEADER_STDINT_H])
+ if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
+ AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
+ test $ac_cv_type_unsigned_long_long = yes \
+ && ac_type='unsigned long long' \
+ || ac_type='unsigned long'
+ AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
+ [Define to unsigned long or unsigned long long
+ if <stdint.h> and <inttypes.h> don't define.])
+ else
+ AC_DEFINE(HAVE_UINTMAX_T, 1,
+ [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
+ fi
+])
--- /dev/null
+# ulonglong.m4 serial 3
+dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
+
+AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
+[
+ AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
+ [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
+ [unsigned long long ullmax = (unsigned long long) -1;
+ return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
+ ac_cv_type_unsigned_long_long=yes,
+ ac_cv_type_unsigned_long_long=no)])
+ if test $ac_cv_type_unsigned_long_long = yes; then
+ AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
+ [Define if you have the 'unsigned long long' type.])
+ fi
+])
--- /dev/null
+# wchar_t.m4 serial 1 (gettext-0.12)
+dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+dnl Test whether <stddef.h> has the 'wchar_t' type.
+dnl Prerequisite: AC_PROG_CC
+
+AC_DEFUN([gt_TYPE_WCHAR_T],
+[
+ AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
+ [AC_TRY_COMPILE([#include <stddef.h>
+ wchar_t foo = (wchar_t)'\0';], ,
+ gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
+ if test $gt_cv_c_wchar_t = yes; then
+ AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
+ fi
+])
--- /dev/null
+# wint_t.m4 serial 1 (gettext-0.12)
+dnl Copyright (C) 2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+dnl Test whether <wchar.h> has the 'wint_t' type.
+dnl Prerequisite: AC_PROG_CC
+
+AC_DEFUN([gt_TYPE_WINT_T],
+[
+ AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
+ [AC_TRY_COMPILE([#include <wchar.h>
+ wint_t foo = (wchar_t)'\0';], ,
+ gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
+ if test $gt_cv_c_wint_t = yes; then
+ AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
+ fi
+])
--- /dev/null
+# xsize.m4 serial 2
+dnl Copyright (C) 2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+AC_DEFUN([gl_XSIZE],
+[
+ dnl Prerequisites of lib/xsize.h.
+ AC_REQUIRE([gl_SIZE_MAX])
+ AC_CHECK_HEADERS(stdint.h)
+])
--- /dev/null
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2006-05-10.23
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 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, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# 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.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case $1 in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case $1 in
+ lex|yacc)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ tar)
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ exit 1
+ fi
+ ;;
+
+ *)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
+ fi
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $1 in
+ aclocal*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`${configure_ac}'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case $f in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ autom4te)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
+ bison|yacc)
+ echo 1>&2 "\
+WARNING: \`$1' $msg. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+ case $LASTARG in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f y.tab.h; then
+ echo >y.tab.h
+ fi
+ if test ! -f y.tab.c; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex|flex)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+ case $LASTARG in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f lex.yy.c; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit 1
+ fi
+ ;;
+
+ makeinfo)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -z "$file"; then
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
+ touch $file
+ ;;
+
+ tar)
+ shift
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar "$@" && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar "$@" && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case $firstarg in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ case $firstarg in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequisites for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
--- /dev/null
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $
+
+errstatus=0
+
+for file
+do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ fi
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# mkinstalldirs ends here
--- /dev/null
+* Tue Aug 27 2013 Jihoon Kim <jihoon48.kim@samsung.com> submit/tizen_2.2/20130703.071152@72d18f1
+- key event isn't processed in some layouts
+
--- /dev/null
+Name: ise-engine-anthy
+Summary: Anthy (Japanese) Input Method Engine for ISF
+Version: 0.0.0125
+Release: 3
+Group: Graphics & UI Framework/Input
+License: GPL-2.0+
+URL: http://sourceforge.jp/projects/scim-imengine/
+Source0: %{name}-%{version}.tar.gz
+BuildRequires: prelink
+BuildRequires: gettext-tools
+BuildRequires: pkgconfig(isf)
+BuildRequires: pkgconfig(anthy)
+BuildRequires: pkgconfig(ecore)
+
+%description
+ISF is an input service framework for TIZEN.
+ise-engine-anthy is ISF IMEngine module for Japanese input method base.It converts Hiragana text to Kana Kanji mixed text.
+
+
+
+%prep
+%setup -q
+
+%build
+./bootstrap
+%configure --prefix=%{_prefix} --disable-static
+
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{_datadir}/license
+cp COPYING %{buildroot}%{_datadir}/license/%{name}
+%make_install
+
+
+%files
+%defattr(-,root,root,-)
+%{_datadir}/license/%{name}
+%{_datadir}/scim/icons/*
+%{_datadir}/locale/*
+%{_datadir}/scim/Anthy/*
+%{_libdir}/scim-1.0/1.4.0/IMEngine/*
--- /dev/null
+2004-11-19 gettextize <bug-gnu-gettext@gnu.org>
+
+ * Makefile.in.in: New file, from gettext-0.14.1.
+ * Rules-quot: New file, from gettext-0.14.1.
+ * boldquot.sed: New file, from gettext-0.14.1.
+ * en@boldquot.header: New file, from gettext-0.14.1.
+ * en@quot.header: New file, from gettext-0.14.1.
+ * insert-header.sin: New file, from gettext-0.14.1.
+ * quot.sed: New file, from gettext-0.14.1.
+ * remove-potcdate.sin: New file, from gettext-0.14.1.
+
--- /dev/null
+# Makefile for PO directory in any package using GNU gettext.
+# Copyright (C) 1995-1997, 2000-2004 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+#
+# This file can be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU General Public
+# License but which still want to provide support for the GNU gettext
+# functionality.
+# Please note that the actual code of GNU gettext is covered by the GNU
+# General Public License and is *not* in the public domain.
+#
+# Origin: gettext-0.14
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+SHELL = /bin/sh
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datadir = @datadir@
+localedir = $(datadir)/locale
+gettextsrcdir = $(datadir)/gettext/po
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
+
+GMSGFMT = @GMSGFMT@
+MSGFMT = @MSGFMT@
+XGETTEXT = @XGETTEXT@
+MSGMERGE = msgmerge
+MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGINIT = msginit
+MSGCONV = msgconv
+MSGFILTER = msgfilter
+
+POFILES = @POFILES@
+GMOFILES = @GMOFILES@
+UPDATEPOFILES = @UPDATEPOFILES@
+DUMMYPOFILES = @DUMMYPOFILES@
+DISTFILES.common = Makefile.in.in remove-potcdate.sin \
+$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
+DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \
+$(POFILES) $(GMOFILES) \
+$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
+
+POTFILES = \
+
+CATALOGS = @CATALOGS@
+
+# Makevars gets inserted here. (Don't remove this line!)
+
+.SUFFIXES:
+.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
+
+.po.mo:
+ @echo "$(MSGFMT) -c -o $@ $<"; \
+ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
+
+.po.gmo:
+ @lang=`echo $* | sed -e 's,.*/,,'`; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
+ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+
+.sin.sed:
+ sed -e '/^#/d' $< > t-$@
+ mv t-$@ $@
+
+
+all: all-@USE_NLS@
+
+all-yes: stamp-po
+all-no:
+
+# stamp-po is a timestamp denoting the last time at which the CATALOGS have
+# been loosely updated. Its purpose is that when a developer or translator
+# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
+# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
+# invocations of "make" will do nothing. This timestamp would not be necessary
+# if updating the $(CATALOGS) would always touch them; however, the rule for
+# $(POFILES) has been designed to not touch files that don't need to be
+# changed.
+stamp-po: $(srcdir)/$(DOMAIN).pot
+ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
+ @echo "touch stamp-po"
+ @echo timestamp > stamp-poT
+ @mv stamp-poT stamp-po
+
+# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
+# otherwise packages like GCC can not be built if only parts of the source
+# have been downloaded.
+
+# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
+# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
+$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
+ --files-from=$(srcdir)/POTFILES.in \
+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
+ --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)'
+ test ! -f $(DOMAIN).po || { \
+ if test -f $(srcdir)/$(DOMAIN).pot; then \
+ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
+ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
+ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
+ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
+ else \
+ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
+ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+ fi; \
+ else \
+ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+ fi; \
+ }
+
+# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
+# every "make" invocation, only create it when it is missing.
+# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
+$(srcdir)/$(DOMAIN).pot:
+ $(MAKE) $(DOMAIN).pot-update
+
+# This target rebuilds a PO file if $(DOMAIN).pot has changed.
+# Note that a PO file is not touched if it doesn't need to be changed.
+$(POFILES): $(srcdir)/$(DOMAIN).pot
+ @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
+ if test -f "$(srcdir)/$${lang}.po"; then \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
+ cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
+ else \
+ $(MAKE) $${lang}.po-create; \
+ fi
+
+
+install: install-exec install-data
+install-exec:
+install-data: install-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
+ for file in $(DISTFILES.common) Makevars.template; do \
+ $(INSTALL_DATA) $(srcdir)/$$file \
+ $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ for file in Makevars; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+install-data-no: all
+install-data-yes: all
+ $(mkinstalldirs) $(DESTDIR)$(datadir)
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkinstalldirs) $(DESTDIR)$$dir; \
+ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
+ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
+ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+ if test -n "$$lc"; then \
+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+ for file in *; do \
+ if test -f $$file; then \
+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+ fi; \
+ done); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ else \
+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ fi; \
+ fi; \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
+ fi; \
+ done; \
+ done
+
+install-strip: install
+
+installdirs: installdirs-exec installdirs-data
+installdirs-exec:
+installdirs-data: installdirs-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
+ else \
+ : ; \
+ fi
+installdirs-data-no:
+installdirs-data-yes:
+ $(mkinstalldirs) $(DESTDIR)$(datadir)
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkinstalldirs) $(DESTDIR)$$dir; \
+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+ if test -n "$$lc"; then \
+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+ for file in *; do \
+ if test -f $$file; then \
+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+ fi; \
+ done); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ else \
+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ fi; \
+ fi; \
+ fi; \
+ done; \
+ done
+
+# Define this as empty until I found a useful application.
+installcheck:
+
+uninstall: uninstall-exec uninstall-data
+uninstall-exec:
+uninstall-data: uninstall-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ for file in $(DISTFILES.common) Makevars.template; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+uninstall-data-no:
+uninstall-data-yes:
+ catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ done; \
+ done
+
+check: all
+
+info dvi ps pdf html tags TAGS ctags CTAGS ID:
+
+mostlyclean:
+ rm -f remove-potcdate.sed
+ rm -f stamp-poT
+ rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
+ rm -fr *.o
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile Makefile.in POTFILES *.mo
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f stamp-po $(GMOFILES)
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir:
+ $(MAKE) update-po
+ @$(MAKE) dist2
+# This is a separate target because 'update-po' must be executed before.
+dist2: $(DISTFILES)
+ dists="$(DISTFILES)"; \
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ dists="$$dists Makevars.template"; \
+ fi; \
+ if test -f $(srcdir)/ChangeLog; then \
+ dists="$$dists ChangeLog"; \
+ fi; \
+ for i in 0 1 2 3 4 5 6 7 8 9; do \
+ if test -f $(srcdir)/ChangeLog.$$i; then \
+ dists="$$dists ChangeLog.$$i"; \
+ fi; \
+ done; \
+ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
+ for file in $$dists; do \
+ if test -f $$file; then \
+ cp -p $$file $(distdir); \
+ else \
+ cp -p $(srcdir)/$$file $(distdir); \
+ fi; \
+ done
+
+update-po: Makefile
+ $(MAKE) $(DOMAIN).pot-update
+ test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
+ $(MAKE) update-gmo
+
+# General rule for creating PO files.
+
+.nop.po-create:
+ @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
+ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
+ exit 1
+
+# General rule for updating PO files.
+
+.nop.po-update:
+ @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
+ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
+ tmpdir=`pwd`; \
+ echo "$$lang:"; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
+ cd $(srcdir); \
+ if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
+ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$$lang.new.po; \
+ else \
+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+ :; \
+ else \
+ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "msgmerge for $$lang.po failed!" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi
+
+$(DUMMYPOFILES):
+
+update-gmo: Makefile $(GMOFILES)
+ @:
+
+Makefile: Makefile.in.in $(top_builddir)/config.status @POMAKEFILEDEPS@
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
+ $(SHELL) ./config.status
+
+force:
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = ise-engine-anthy
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
+# package. (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.) Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright. The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Takuro Ashie <ashie@homa.ne.jp>
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+# in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+# understood.
+# - Strings which make invalid assumptions about notation of date, time or
+# money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = ashie@homa.ne.jp
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used. It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
--- /dev/null
+src/scim_anthy_imengine.cpp
+src/scim_anthy_factory.cpp
+src/scim_anthy_setup.cpp
+src/scim_anthy_setup_romaji.cpp
+src/scim_anthy_setup_kana.cpp
+src/scim_anthy_table_editor.cpp
+src/scim_anthy_prefs.cpp
+src/scim_anthy_color_button.cpp
--- /dev/null
+# Special Makefile rules for English message catalogs with quotation marks.
+
+DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
+
+.SUFFIXES: .insert-header .po-update-en
+
+en@quot.po-create:
+ $(MAKE) en@quot.po-update
+en@boldquot.po-create:
+ $(MAKE) en@boldquot.po-update
+
+en@quot.po-update: en@quot.po-update-en
+en@boldquot.po-update: en@boldquot.po-update-en
+
+.insert-header.po-update-en:
+ @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
+ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
+ tmpdir=`pwd`; \
+ echo "$$lang:"; \
+ ll=`echo $$lang | sed -e 's/@.*//'`; \
+ LC_ALL=C; export LC_ALL; \
+ cd $(srcdir); \
+ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
+ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$$lang.new.po; \
+ else \
+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+ :; \
+ else \
+ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "creation of $$lang.po failed!" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi
+
+en@quot.insert-header: insert-header.sin
+ sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
+
+en@boldquot.insert-header: insert-header.sin
+ sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
+
+mostlyclean: mostlyclean-quot
+mostlyclean-quot:
+ rm -f *.insert-header
--- /dev/null
+s/"\([^"]*\)"/“\1”/g
+s/`\([^`']*\)'/‘\1’/g
+s/ '\([^`']*\)' / ‘\1’ /g
+s/ '\([^`']*\)'$/ ‘\1’/g
+s/^'\([^`']*\)' /‘\1’ /g
+s/“”/""/g
+s/“/“\e[1m/g
+s/”/\e[0m”/g
+s/‘/‘\e[1m/g
+s/’/\e[0m’/g
--- /dev/null
+# translation of de.po to German
+# German translations for PACKAGE package.
+# Copyright (C) 2007 Takuro Ashie <ashie@homa.ne.jp>
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Gerrit Sangel <z0idberg@gmx.de>, 2007.
+msgid ""
+msgstr ""
+"Project-Id-Version: de\n"
+"Report-Msgid-Bugs-To: ashie@homa.ne.jp\n"
+"POT-Creation-Date: 2009-01-15 12:04+0900\n"
+"PO-Revision-Date: 2007-07-03 20:23+0200\n"
+"Last-Translator: Gerrit Sangel <z0idberg@gmx.de>\n"
+"Language-Team: German <de@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#: src/scim_anthy_imengine.cpp:488
+#, c-format
+msgid "Candidates (%d/%d)"
+msgstr "Kandidaten (%d/%d)"
+
+#: src/scim_anthy_imengine.cpp:565
+msgid "Input mode"
+msgstr "Eingabemodus"
+
+#: src/scim_anthy_imengine.cpp:569 src/scim_anthy_setup.cpp:203
+msgid "Hiragana"
+msgstr "Hiragana"
+
+#: src/scim_anthy_imengine.cpp:573 src/scim_anthy_setup.cpp:204
+msgid "Katakana"
+msgstr "Katakana"
+
+#: src/scim_anthy_imengine.cpp:577 src/scim_anthy_imengine.cpp:578
+#: src/scim_anthy_setup.cpp:205
+msgid "Half width katakana"
+msgstr "Halbbreite Katakana"
+
+#: src/scim_anthy_imengine.cpp:582 src/scim_anthy_setup.cpp:206
+msgid "Latin"
+msgstr "Latein"
+
+#: src/scim_anthy_imengine.cpp:582
+msgid "Direct input"
+msgstr "Direkteingabe"
+
+#: src/scim_anthy_imengine.cpp:586 src/scim_anthy_setup.cpp:207
+msgid "Wide latin"
+msgstr "Breites Latein"
+
+#: src/scim_anthy_imengine.cpp:592
+msgid "Typing method"
+msgstr "Schreibmethode"
+
+#: src/scim_anthy_imengine.cpp:596
+msgid "Romaji"
+msgstr "Romaji"
+
+#: src/scim_anthy_imengine.cpp:600
+msgid "Kana"
+msgstr "Kana"
+
+#: src/scim_anthy_imengine.cpp:604
+msgid "Thumb shift"
+msgstr "Umschalt"
+
+#: src/scim_anthy_imengine.cpp:611
+#, fuzzy
+msgid "Conversion mode"
+msgstr "Konvertierungsmethode"
+
+#: src/scim_anthy_imengine.cpp:615 src/scim_anthy_imengine.cpp:616
+#: src/scim_anthy_setup.cpp:221
+msgid "Multi segment"
+msgstr "Mehrfachsegment"
+
+#: src/scim_anthy_imengine.cpp:620 src/scim_anthy_imengine.cpp:621
+#: src/scim_anthy_setup.cpp:222
+msgid "Single segment"
+msgstr "Einzelsegment"
+
+#: src/scim_anthy_imengine.cpp:625 src/scim_anthy_imengine.cpp:627
+#: src/scim_anthy_setup.cpp:223
+msgid "Convert as you type (Multi segment)"
+msgstr "Beim Tippen konvertieren (Mehrfachsegment)"
+
+#: src/scim_anthy_imengine.cpp:631 src/scim_anthy_imengine.cpp:633
+#: src/scim_anthy_setup.cpp:224
+msgid "Convert as you type (Single segment)"
+msgstr "Beim Tippen konvertieren (Einzelsegment)"
+
+#: src/scim_anthy_imengine.cpp:640
+#, fuzzy
+msgid "Period style"
+msgstr "Punkttyp"
+
+#: src/scim_anthy_imengine.cpp:669
+msgid "Symbol style"
+msgstr "Symboltyp"
+
+#: src/scim_anthy_imengine.cpp:717
+msgid "Dictionary menu"
+msgstr "Wörterbuchmenü"
+
+#: src/scim_anthy_imengine.cpp:722
+msgid "Edit the dictionary"
+msgstr "Wörterbuch bearbeiten"
+
+#: src/scim_anthy_imengine.cpp:724
+msgid "Launch the dictionary administration tool."
+msgstr "Die Wörterbuchverwaltung starten."
+
+#: src/scim_anthy_imengine.cpp:730 src/scim_anthy_prefs.cpp:1205
+msgid "Add a word"
+msgstr "Wort hinzufügen"
+
+#: src/scim_anthy_imengine.cpp:732
+#, fuzzy
+msgid "Add a word to the dictionary."
+msgstr "Ein Wort dem Wörterbuch hinzufügen."
+
+#: src/scim_anthy_factory.cpp:195
+#, fuzzy
+msgid ""
+"Authors of scim-anthy:\n"
+" Copyright (C) 2004,2005 Takuro Ashie <ashie@homa.ne.jp>\n"
+" Copyright (C) 2004,2005 Hiroyuki Ikezoe <poincare@ikezoe.net>\n"
+" \n"
+"Authors of Anthy:\n"
+" Copyright (C) 2000-2005 Yusuke TABATA <yusuke@w5.dion.ne.jp>\n"
+" Copyright (C) 2004-2005 Yuichi YOSHIDA <oxy@kmc.gr.jp>\n"
+" You can find out all credits of Anthy from AUTHORS file in Anthy package.\n"
+msgstr ""
+"Autoren von Scim-Anthy:\n"
+" Copyright © 2004, 2005 Takuro Ashie <ashie@homa.ne.jp>\n"
+" Copyright © 2004, 2005 Hiroyuki Ikezoe <poincare@ikezoe.net>\n"
+" Copyright © 2006, 2007 Takashi Nakamoto <bluedwarf@bpost.plala.or.jp>\n"
+" \n"
+"Autoren von Anthy:\n"
+" Copyright © 2000–2005 Yusuke TABATA <yusuke@w5.dion.ne.jp>\n"
+" Copyright © 2004–2005 Yuichi YOSHIDA <oxy@kmc.gr.jp>\n"
+" Sie können alle Mitwirkenden von Anthy in der AUTHORS-Datei im Anthy-Paket "
+"finden.\n"
+
+#: src/scim_anthy_factory.cpp:211
+#, fuzzy
+msgid ""
+"Art work:\n"
+" SHIMODA Hiroshi <piro@p.club.ne.jp>\n"
+"\n"
+"Translation:\n"
+" Gerrit Sangel <z0idberg@gmx.de>\n"
+"Special thanks:\n"
+" UTUMI Hirosi <utuhiro78@yahoo.co.jp>\n"
+" Yukiko Bando <ybando@k6.dion.ne.jp>\n"
+" Mike Fabian <mfabian@suse.de>\n"
+" David Oftedal <david@start.no>\n"
+" Ryo Dairiki <ryo-dairiki@users.sourceforge.net>\n"
+" Seiichi SATO\n"
+" AWASHIRO Ikuya <ikuya@oooug.jp>\n"
+" Hatuka*nezumi <nezumi@jca.apc.org>\n"
+" Teppei Tamra <tam-t@par.odn.ne.jp>\n"
+" Akira TAGOH <at@gclab.org>\n"
+" Tatsuki Sugiura <sugi@nemui.org>\n"
+" Takashi Nakamoto <bluedwarf@bpost.plala.or.jp>"
+msgstr ""
+"Art work:\n"
+" SHIMODA Hiroshi <piro@p.club.ne.jp>\n"
+"Besonderen Dank an:\n"
+" UTUMI Hirosi <utuhiro78@yahoo.co.jp>\n"
+" Yukiko Bando <ybando@k6.dion.ne.jp>\n"
+" Mike Fabian <mfabian@suse.de>\n"
+" David Oftedal <david@start.no>\n"
+" Ryo Dairiki <ryo-dairiki@users.sourceforge.net>\n"
+" Seiichi SATO\n"
+" AWASHIRO Ikuya <ikuya@oooug.jp>\n"
+" Hatuka*nezumi <nezumi@jca.apc.org>\n"
+" Teppei Tamra <tam-t@par.odn.ne.jp>\n"
+" Akira TAGOH <at@gclab.org>\n"
+" Tatsuki Sugiura <sugi@nemui.org>\n"
+" Takashi Nakamoto <bluedwarf@bpost.plala.or.jp>"
+
+#: src/scim_anthy_factory.cpp:236
+msgid ""
+"Basic operation:\n"
+" \n"
+msgstr ""
+"Grundoperation:\n"
+" \n"
+
+#: src/scim_anthy_factory.cpp:240
+msgid ""
+"1. Switch input mode:\n"
+" You can switch on/off Japanese input mode by pressing Zenkaku_Hankaku key\n"
+" or Control+J. Or you can rotate all input modes by pressing Control+,\n"
+" (comma).\n"
+" \n"
+msgstr ""
+"1. Eingabemodus wechseln:\n"
+" Sie können den japanischen Eingabemodus durch Drücken der Zenkaku_Hankaku-"
+"Taste\n"
+" oder Strg+J ein-/ausschalten. Oder sie können alle Eingabemodus durch "
+"Drücken von Strg+,\n"
+" (Komma) rotieren.\n"
+" \n"
+
+#: src/scim_anthy_factory.cpp:247
+#, fuzzy
+msgid ""
+"2. Input Japanese hiragana and katakana:\n"
+" You can input Japanese hiragana and katakana by inputting romaji.\n"
+" The Romaji table can be found out from the \"Anthy\" section of the setup\n"
+" window in SCIM or SKIM.\n"
+" If you want to hiragana and katakana directly by using Japanese keyboard,\n"
+" please press Alt + Romaji key or Conrol+\\ key to switch typing method.\n"
+" \n"
+msgstr ""
+"2. Hiragana und Katakana eingeben:\n"
+" Sie können Hiragana und Katakana durch Eingabe von Romaji eingeben.\n"
+" Die Romaji-Tabelle wird aus der „Anthy“-Sektion im Einrichtungsfenster von "
+"SCIM\n"
+" oder SKIM gefunden.\n"
+" Wenn Sie Hiragana und Katakana direkt mit der japanischen Tastatur "
+"eingeben\n"
+" möchten, drücken Sie Alt + Romaji-Taste oder Strg+\\-Taste um die "
+"Schreibmethode zu\n"
+" wechseln.\n"
+" \n"
+
+#: src/scim_anthy_factory.cpp:256
+#, fuzzy
+msgid ""
+"3. Convert hiragana or katakana to Japanese kanji\n"
+" After inputting hiragana or katakana, you can convert it to Japanese\n"
+" kanji by pressing Space key. Then it will show some candidates. You can\n"
+" select the next candidate by pressing Space key, and can commit it by\n"
+" pressing Enter key.\n"
+" If you input a sentense, Anthy will split it to some segments. You can\n"
+" select the next or previous segment by pressing left or right cursor key,\n"
+" and can extend or shrink the selected segment by pressing Shift + left or\n"
+" right cursor key.\n"
+" \n"
+msgstr ""
+"3. Hiragana oder Katakana in Kanji konvertieren\n"
+" Nach der Eingabe von Hiragana oder Katakana können Sie sie in Kanji durch\n"
+" Drücken der Leertaste konvertieren. Dann werden einige Kandidaten "
+"gezeigt.\n"
+" Sie können den nächsten Kandidaten durch Drücken der Leertaste auswählen\n"
+" und ihn dann durch Drücken der Eingabetaste festlegen.\n"
+" Wenn sie einen Satz eingeben, wird Anthy ihn in einige Segmente "
+"aufteilen.\n"
+" Sie können das nächste oder vorherige Segmente durch Drücken der linken\n"
+" oder rechten Pfeiltaste auswählen und das ausgewählte Segment durch "
+"Drücken\n"
+" von Shift + linker oder rechter Pfeiltaste vergrößern bzw. verkleinern.\n"
+" \n"
+
+#: src/scim_anthy_factory.cpp:268
+msgid ""
+"4. Other key bindings:\n"
+" You can find out all key bindings definition of scim-anthy from \"Anthy\"\n"
+" section on setup window of SCIM or SKIM.\n"
+msgstr ""
+"4, Andere Tastatenkürzel:\n"
+" Sie können alle Tastenkürzel von Scim-Anthy auf der „Anthy“-\n"
+" Sektion im Einrichtungsbildschirm von SCIM oder SKIM finden.\n"
+
+#: src/scim_anthy_setup.cpp:119
+msgid "Anthy"
+msgstr "Anthy"
+
+#: src/scim_anthy_setup.cpp:124
+msgid "An Anthy IMEngine Module."
+msgstr "Ein Anthy-IMEngine-Modul"
+
+#: src/scim_anthy_setup.cpp:184
+msgid "Mode keys"
+msgstr "Modustasten"
+
+#: src/scim_anthy_setup.cpp:185
+#, fuzzy
+msgid "Edit keys"
+msgstr "Bearbeitungstasten"
+
+#: src/scim_anthy_setup.cpp:186
+msgid "Caret keys"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:187
+#, fuzzy
+msgid "Segments keys"
+msgstr "Segmenttasten"
+
+#: src/scim_anthy_setup.cpp:188
+msgid "Candidates keys"
+msgstr "Kandidatentasten"
+
+#: src/scim_anthy_setup.cpp:189
+msgid "Direct select keys"
+msgstr "Direktauswahltasten"
+
+#: src/scim_anthy_setup.cpp:190
+msgid "Convert keys"
+msgstr "Konvertierungsteasten"
+
+#: src/scim_anthy_setup.cpp:191
+msgid "Dictionary keys"
+msgstr "Wörterbuchtasten"
+
+#: src/scim_anthy_setup.cpp:213
+msgid "Romaji typing method"
+msgstr "Romaji-Schreibmethode"
+
+#: src/scim_anthy_setup.cpp:214
+msgid "Kana typing method"
+msgstr "Kana-Schreibmethode"
+
+#: src/scim_anthy_setup.cpp:215
+msgid "Thumb shift typing method"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:248 src/scim_anthy_setup.cpp:256
+#, fuzzy
+msgid "Follow input mode"
+msgstr "Eingabemodus folgen"
+
+#: src/scim_anthy_setup.cpp:249 src/scim_anthy_setup.cpp:257
+msgid "Wide"
+msgstr "Breit"
+
+#: src/scim_anthy_setup.cpp:250 src/scim_anthy_setup.cpp:258
+msgid "Half"
+msgstr "Halb"
+
+#: src/scim_anthy_setup.cpp:264 src/scim_anthy_prefs.cpp:740
+msgid "Do nothing"
+msgstr "Nichts tun"
+
+#: src/scim_anthy_setup.cpp:265
+msgid "Start conversion"
+msgstr "Konvertierung starten"
+
+#: src/scim_anthy_setup.cpp:266 src/scim_anthy_setup.cpp:272
+#: src/scim_anthy_prefs.cpp:680
+msgid "Commit"
+msgstr "Übergabe"
+
+#: src/scim_anthy_setup.cpp:273
+#, fuzzy
+msgid "Clear"
+msgstr "Löschen"
+
+#: src/scim_anthy_setup.cpp:279
+msgid "UTF-8"
+msgstr "UTF-8"
+
+#: src/scim_anthy_setup.cpp:280
+msgid "EUC-JP"
+msgstr "EUC-JP"
+
+#: src/scim_anthy_setup.cpp:281
+msgid "EUC-JP-MS"
+msgstr "EUC-JP-MS"
+
+#: src/scim_anthy_setup.cpp:287
+#, fuzzy
+msgid "No decoration"
+msgstr "Keine Hervorhebung"
+
+#: src/scim_anthy_setup.cpp:288
+msgid "Underline"
+msgstr "Unterstreichen"
+
+#: src/scim_anthy_setup.cpp:289
+#, fuzzy
+msgid "Reverse"
+msgstr "Umkehren"
+
+#: src/scim_anthy_setup.cpp:290
+msgid "Highlight"
+msgstr "Hervorheben"
+
+#: src/scim_anthy_setup.cpp:291
+msgid "String color"
+msgstr "Farbe der Zeichenkette"
+
+#: src/scim_anthy_setup.cpp:292
+msgid "BG color"
+msgstr "Hintergrundfarbe"
+
+#: src/scim_anthy_setup.cpp:293
+msgid "Both color"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:805
+msgid "_Group:"
+msgstr "_Gruppe:"
+
+#: src/scim_anthy_setup.cpp:826
+msgid "Search by key"
+msgstr "Nach Taste suchen"
+
+#: src/scim_anthy_setup.cpp:830
+#, fuzzy
+msgid "all"
+msgstr "Alles"
+
+#: src/scim_anthy_setup.cpp:873
+msgid "Feature"
+msgstr "Funktion"
+
+#: src/scim_anthy_setup.cpp:882 src/scim_anthy_setup.cpp:1289
+#, fuzzy
+msgid "Key bindings"
+msgstr "_Tastenkürzel:"
+
+#: src/scim_anthy_setup.cpp:890
+msgid "Description"
+msgstr "Beschreibung"
+
+#: src/scim_anthy_setup.cpp:914
+msgid "Key bindings _theme:"
+msgstr "Tastenkürzel-_Vorlage"
+
+#: src/scim_anthy_setup.cpp:928
+msgid "_Choose keys..."
+msgstr "Tasten _auswählen..."
+
+#: src/scim_anthy_setup.cpp:955
+#, fuzzy
+msgid "<b>Enable/Disable learning</b>"
+msgstr "<b>Lernen an-/ausschalten</b>"
+
+#: src/scim_anthy_setup.cpp:982
+#, fuzzy
+msgid "<b>Key preferences to commit with reversing learning preference</b>"
+msgstr "<b>Tastenpräferenzen zur Übergabe bei umgekehrten Lernpräferenzen</b>"
+
+#: src/scim_anthy_setup.cpp:1056 src/scim_anthy_setup.cpp:1070
+msgid "_Launch"
+msgstr "_Starten"
+
+#: src/scim_anthy_setup.cpp:1241
+#, c-format
+msgid ""
+"<span size=\"20000\">%s-%s</span>\n"
+"\n"
+"<span size=\"16000\" style=\"italic\">A Japanese input method module\n"
+"for SCIM using Anthy</span>\n"
+"\n"
+"\n"
+"\n"
+"<span size=\"12000\">Copyright 2005-2006, Takuro Ashie <ashie@homa.ne."
+"jp></span>"
+msgstr ""
+"<span size=\"20000\">%s-%s</span>\n"
+"\n"
+"<span size=\"16000\" style=\"italic\">Eine japanische Eingabemethode\n"
+"für SCIM, benutzt Anthy</span>\n"
+"\n"
+"\n"
+"\n"
+"<span size=\"12000\">Copyright 2005-2006, Takuro Ashie <ashie@homa.ne."
+"jp></span>"
+
+#: src/scim_anthy_setup.cpp:1277
+msgid "Common"
+msgstr "Gemeinsam"
+
+#: src/scim_anthy_setup.cpp:1283
+msgid "Symbols"
+msgstr "Symbole"
+
+#: src/scim_anthy_setup.cpp:1295
+#, fuzzy
+msgid "Romaji typing"
+msgstr "Romaji tippen"
+
+#: src/scim_anthy_setup.cpp:1301
+#, fuzzy
+msgid "Kana typing"
+msgstr "Kana tippen"
+
+#: src/scim_anthy_setup.cpp:1307
+#, fuzzy
+msgid "Prediction"
+msgstr "Vorhersagen"
+
+#: src/scim_anthy_setup.cpp:1313
+#, fuzzy
+msgid "Learning"
+msgstr "Lernen"
+
+#: src/scim_anthy_setup.cpp:1319
+msgid "Dictionary"
+msgstr "Wörterbuch"
+
+#: src/scim_anthy_setup.cpp:1325
+#, fuzzy
+msgid "Candidates window"
+msgstr "Kandidatenfenster"
+
+#: src/scim_anthy_setup.cpp:1331
+msgid "Toolbar"
+msgstr "Werkzeugleiste"
+
+#: src/scim_anthy_setup.cpp:1337
+msgid "Appearance"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:1343
+msgid "About"
+msgstr "Über"
+
+#: src/scim_anthy_setup.cpp:1405 src/scim_anthy_setup_romaji.cpp:255
+#: src/scim_anthy_setup_kana.cpp:413 src/scim_anthy_setup_kana.cpp:480
+msgid "User defined"
+msgstr "Benutzerdefiniert"
+
+#: src/scim_anthy_setup.cpp:1408 src/scim_anthy_setup_romaji.cpp:258
+#: src/scim_anthy_setup_kana.cpp:416 src/scim_anthy_setup_kana.cpp:483
+#, fuzzy
+msgid "Default"
+msgstr "Standard"
+
+#: src/scim_anthy_setup.cpp:2006
+msgid "Set key filter"
+msgstr "Tastenfilter setzen"
+
+#: src/scim_anthy_setup_romaji.cpp:124 src/scim_anthy_setup_romaji.cpp:195
+msgid "Romaji _table:"
+msgstr "Romaji-_Tabelle"
+
+#: src/scim_anthy_setup_romaji.cpp:137 src/scim_anthy_setup_kana.cpp:143
+#: src/scim_anthy_setup_kana.cpp:188
+msgid "_Customize..."
+msgstr "_Bearbeiten..."
+
+#: src/scim_anthy_setup_romaji.cpp:177
+msgid "Sequence"
+msgstr "Sequenz"
+
+#: src/scim_anthy_setup_romaji.cpp:178 src/scim_anthy_setup_kana.cpp:263
+msgid "Result"
+msgstr "Ergebnis"
+
+#: src/scim_anthy_setup_romaji.cpp:185
+#, fuzzy
+msgid "Customize romaji table"
+msgstr "Romaji-Tabelle bearbeiten"
+
+#: src/scim_anthy_setup_kana.cpp:114
+msgid "<b>JIS Kana Layout</b>"
+msgstr "<b>JIS Kana-Anordnung</b>"
+
+#: src/scim_anthy_setup_kana.cpp:130 src/scim_anthy_setup_kana.cpp:175
+msgid "La_yout:"
+msgstr "_Anordnung:"
+
+#: src/scim_anthy_setup_kana.cpp:155
+msgid "<b>Thumb Shift Layout</b>"
+msgstr ""
+
+#: src/scim_anthy_setup_kana.cpp:262 src/scim_anthy_setup_kana.cpp:332
+msgid "Key"
+msgstr "Taste"
+
+#: src/scim_anthy_setup_kana.cpp:270
+#, fuzzy
+msgid "Customize kana layout table"
+msgstr "Kana-Anordnungstabelle bearbeiten"
+
+#: src/scim_anthy_setup_kana.cpp:280 src/scim_anthy_setup_kana.cpp:352
+msgid "Layout _table:"
+msgstr "Anordnungs_tabelle"
+
+#: src/scim_anthy_setup_kana.cpp:333
+#, fuzzy
+msgid "Single press"
+msgstr "Einzelklick"
+
+#: src/scim_anthy_setup_kana.cpp:334
+msgid "Left thumb shift"
+msgstr ""
+
+#: src/scim_anthy_setup_kana.cpp:335
+msgid "Right thumb shift"
+msgstr ""
+
+#: src/scim_anthy_setup_kana.cpp:342
+#, fuzzy
+msgid "Customize thumb shift layout table"
+msgstr "Kana-Anordnungstabelle bearbeiten"
+
+#: src/scim_anthy_prefs.cpp:35
+#, fuzzy
+msgid "Show \"_Candidates\" label"
+msgstr "„Kandidaten“-Beschriftung anzeigen"
+
+#: src/scim_anthy_prefs.cpp:45
+msgid "Close candidate window when select a candidate _directly"
+msgstr ""
+"Kandidatenfenster schließen, wenn ein Kandidat _direkt ausgewählt wurde"
+
+#: src/scim_anthy_prefs.cpp:55
+#, fuzzy
+msgid "Learn on _manual committing"
+msgstr "Bei _manueller Übergabe lernen"
+
+#: src/scim_anthy_prefs.cpp:65
+msgid "Learn on a_uto committing"
+msgstr "Bei a_utomatischer Übergabe lernen"
+
+#: src/scim_anthy_prefs.cpp:75
+msgid "Use half-width characters for _symbols"
+msgstr "Benutze halbbreite Zeichen für _Symbole"
+
+#: src/scim_anthy_prefs.cpp:85
+msgid "Use half-width characters for _numbers"
+msgstr "Benutze halbbreite Zeichen für _Nummern"
+
+#: src/scim_anthy_prefs.cpp:95
+msgid "A_llow spliting romaji on editing preedit string"
+msgstr "Teilen der Romaji bei unbearbeiteter Zeichenkette _erlauben"
+
+#: src/scim_anthy_prefs.cpp:97
+#, fuzzy
+msgid "If this check is enabled, you can delete each letter."
+msgstr "Wenn diese Box angeklickt ist, können Sie jeden Buchstaben löschen"
+
+#: src/scim_anthy_prefs.cpp:104
+#, fuzzy
+msgid "_Entering the pseudo ASCII input mode with capital letters."
+msgstr "Pseudo-ASCII-Eingabemodus mit Großbuchstaben _eingeben"
+
+#: src/scim_anthy_prefs.cpp:106
+msgid ""
+"If this check is enabled, capital letters will becomes a trigger to enter "
+"the pseudo ASCII input mode."
+msgstr ""
+"Wenn diese Box angeklickt ist, werden Großbuchstaben Auslöser um zum Pseudo-"
+"ASCII-Eingabemodus zu gelangen"
+
+#: src/scim_anthy_prefs.cpp:113
+msgid "Insert a _blank with a blank key."
+msgstr "Eine _Lücke mit einer Leertaste einfügen"
+
+#: src/scim_anthy_prefs.cpp:115
+msgid ""
+"If this check is enabled, a blank key will works to insert a blank when "
+"entering the pseudo ASCII input mode."
+msgstr ""
+"Wenn diese Box angeklickt ist, wird bei der Eingabe mit dem Pseudo-ASCII-"
+"Modus eine Leertaste eine Lücke einfügen "
+
+#: src/scim_anthy_prefs.cpp:122
+msgid "_Show predicted candidates while inputting letters"
+msgstr "_Zeige vorhergesagte Kandidaten bei der Eingabe der Buchstaben"
+
+#: src/scim_anthy_prefs.cpp:131
+msgid "Use _direct select keys while predicting"
+msgstr "Nutze Direktauswahltasten bei der Vorhersage"
+
+#: src/scim_anthy_prefs.cpp:140
+msgid "Show _input mode label"
+msgstr "_Eingabemodus-Beschriftung zeigen"
+
+#: src/scim_anthy_prefs.cpp:150
+#, fuzzy
+msgid "Show _conversion mode label"
+msgstr "_Konvertierungsmethoden-Beschriftung zeigen"
+
+#: src/scim_anthy_prefs.cpp:160
+msgid "Show _typing method label"
+msgstr "_Schreibmethoden-Beschriftung zeigen"
+
+#: src/scim_anthy_prefs.cpp:170
+msgid "Show _period style label"
+msgstr "Zeige Punkt-Stilbezeichnung"
+
+#: src/scim_anthy_prefs.cpp:180
+#, fuzzy
+msgid "Show _symbol style label"
+msgstr "Zeige Symbol-Stilbezeichnung"
+
+#: src/scim_anthy_prefs.cpp:190
+msgid "Show _dictionary menu label"
+msgstr "_Wörterbuchmenü-Beschriftung zeigen"
+
+#: src/scim_anthy_prefs.cpp:200
+msgid "Show _edit dictionary label"
+msgstr "Wörterbuch-_bearbeiten-Beschriftung zeigen"
+
+#: src/scim_anthy_prefs.cpp:210
+msgid "Show _add word label"
+msgstr "Wort-_hinzufügen-Beschriftung zeigen"
+
+#: src/scim_anthy_prefs.cpp:235
+msgid "Number of candidates to show in a _page:"
+msgstr "Anzahl der auf einer _Seite anzuzeigenden Kandidaten"
+
+#: src/scim_anthy_prefs.cpp:238
+msgid ""
+"Specify the number of candidates to show in a page of the candidates window."
+msgstr ""
+"Die Anzahl der Kandidaten, die af einer Seite in dem Kandidatenfenster "
+"angezeigt werden, angeben"
+
+#: src/scim_anthy_prefs.cpp:247
+msgid "Number of _triggers until show:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:248
+msgid "[times]"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:250
+msgid ""
+"The number of times to press a conversion key until show the candidates "
+"window.Specify 0 to never show it."
+msgstr ""
+"Die Anzahl der Zeiten, die eine Konvertierungstaste gedrückt werden muss, "
+"bis das Kandidatenfenster gezeigt wird. 0 eingeben, um es nie zu zeigen."
+
+#: src/scim_anthy_prefs.cpp:260
+#, fuzzy
+msgid "_Simultaneous pressing time:"
+msgstr "_Gleichzeitige Drückzeit"
+
+#: src/scim_anthy_prefs.cpp:261
+msgid "[msec]"
+msgstr "[msec]"
+
+#: src/scim_anthy_prefs.cpp:263
+msgid "Time to regard as simultaneous key pressing."
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:286
+msgid "_Input mode: "
+msgstr "_Eingabemodus:"
+
+#: src/scim_anthy_prefs.cpp:296
+msgid "Typing _method: "
+msgstr "Schreibmethode:"
+
+#: src/scim_anthy_prefs.cpp:306
+#, fuzzy
+msgid "_Conversion mode: "
+msgstr "_Konvertierungsmethode:"
+
+#: src/scim_anthy_prefs.cpp:316
+msgid "St_yle of comma and period: "
+msgstr "Stil von Komma und Punkt"
+
+#: src/scim_anthy_prefs.cpp:326
+msgid "Symb_ol input style: "
+msgstr "Symbol-Eingabestil"
+
+#: src/scim_anthy_prefs.cpp:336
+msgid "_Space type: "
+msgstr "_Leertastentyp:"
+
+#: src/scim_anthy_prefs.cpp:346
+#, fuzzy
+msgid "Input from _ten key: "
+msgstr "Eingabe von _Ziffernblock"
+
+#: src/scim_anthy_prefs.cpp:356
+msgid "_Behavior on a comma or a period:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:366
+msgid "_Behavior on focus out:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:376
+msgid "_Left thumb shift keys:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:386
+msgid "_Right thumb shift keys:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:396
+msgid "_Commit:"
+msgstr "_Übergabe:"
+
+#: src/scim_anthy_prefs.cpp:397 src/scim_anthy_prefs.cpp:681
+msgid "Select commit keys"
+msgstr "Übergabe-Tasten auswählen"
+
+#: src/scim_anthy_prefs.cpp:398
+msgid ""
+"The key events to commit the preedit string with reversing the preference of "
+"learning. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:407
+msgid "Commit the _first segment:"
+msgstr "Das _erste Segment übergeben:"
+
+#: src/scim_anthy_prefs.cpp:408 src/scim_anthy_prefs.cpp:880
+msgid "Select keys to commit the first segment"
+msgstr " Tasten wählen, um das erste Segment zu übergeben"
+
+#: src/scim_anthy_prefs.cpp:409
+msgid ""
+"The key events to commit the first segment with reversing the preference of "
+"learning. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:418
+msgid "Commit the _selected segment:"
+msgstr "Das _ausgewählte Segment übergeben:"
+
+#: src/scim_anthy_prefs.cpp:419 src/scim_anthy_prefs.cpp:890
+msgid "Select keys to commit the selected segment"
+msgstr " Tasten wählen, um das ausgewählte Segment zu übergeben"
+
+#: src/scim_anthy_prefs.cpp:420
+msgid ""
+"The key events to commit the selected segment with reversing the preference "
+"of learning. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:429
+msgid "En_coding of dictionary:"
+msgstr "_Kodierung des Wörterbuchs:"
+
+#: src/scim_anthy_prefs.cpp:431
+msgid ""
+"If you choose \"EUC-JP-MS\", interoperatability of documents created on this "
+"system with Microsoft Windows may improve, but it depends on the "
+"implementation of your operating system and actual encoding of your "
+"dictionary."
+msgstr ""
+"Wenn Sie „EUC-JP-MS“ auswählen, kann sich die Interoperabilität mit "
+"Microsoft Windows bei Dokumenten, die auf diesem System erstellt werden, "
+"verbessern, allerdings hängt es von der Implementierung Ihres Betriebssystem "
+"und der tatsächlichen Kodierung Ihres Wörterbuchs ab."
+
+#: src/scim_anthy_prefs.cpp:442
+msgid "\"_Edit dictionary\" command:"
+msgstr "„Wörterbuch b_earbeiten“-Befehl"
+
+#: src/scim_anthy_prefs.cpp:452
+msgid "\"_Add word\" command:"
+msgstr "„Wort hinzufügen“-Befehl:"
+
+#: src/scim_anthy_prefs.cpp:462
+msgid "_Preedit string:"
+msgstr "_Unbearbeitete Zeichenkette:"
+
+#: src/scim_anthy_prefs.cpp:472
+msgid "_Conversion string:"
+msgstr "_Konvertierungszeichenkette"
+
+#: src/scim_anthy_prefs.cpp:482
+msgid "_Selected segment:"
+msgstr "_Ausgewähltes Segment"
+
+#: src/scim_anthy_prefs.cpp:506
+msgid "Toggle on/off"
+msgstr "an/aus umschalten"
+
+#: src/scim_anthy_prefs.cpp:507
+msgid "Select toggle on/off keys"
+msgstr "Tasten um an/aus umzuschalten auswählen"
+
+#: src/scim_anthy_prefs.cpp:508
+msgid "The key events to toggle on/off Japanese mode. "
+msgstr "Die Tastatureignisse, die an/aus umschalten"
+
+#: src/scim_anthy_prefs.cpp:516
+msgid "Circle input mode"
+msgstr "Eingabemodus durchschalten"
+
+#: src/scim_anthy_prefs.cpp:517
+msgid "Select circle input mode keys"
+msgstr "Tasten um Eingabemodus durchzuschalten, auswählen"
+
+#: src/scim_anthy_prefs.cpp:518
+msgid "The key events to circle input mode. "
+msgstr "Die Tastatureignisse, die den Eingabemodus durchschalten"
+
+#: src/scim_anthy_prefs.cpp:526
+msgid "Circle kana mode"
+msgstr "Kana-Modus durchschalten"
+
+#: src/scim_anthy_prefs.cpp:527
+msgid "Select circle kana mode keys"
+msgstr "Tasten um Kana-Modus durchzuschalten, auswählen"
+
+#: src/scim_anthy_prefs.cpp:528
+msgid "The key events to circle kana mode. "
+msgstr "Die Tastatureignisse, die den Kana-Modus durchschalten"
+
+#: src/scim_anthy_prefs.cpp:536
+msgid "Latin mode"
+msgstr "Latein-Modus"
+
+#: src/scim_anthy_prefs.cpp:537
+msgid "Select Latin mode keys"
+msgstr "Latein-Modus-Tasten auswählen"
+
+#: src/scim_anthy_prefs.cpp:538
+msgid "The key events to switch input mode to Latin. "
+msgstr "Die Tastatureignisse, die den Eingabemodus zu Latein umschalten."
+
+#: src/scim_anthy_prefs.cpp:546
+msgid "Wide Latin mode"
+msgstr "Breites-Latein-Modus"
+
+#: src/scim_anthy_prefs.cpp:547
+msgid "Select wide Latin mode keys"
+msgstr "Breites-Latein-Modus-Tasten auswählen"
+
+#: src/scim_anthy_prefs.cpp:548
+msgid "The key events to switch input mode to wide Latin. "
+msgstr ""
+"Die Tastatureignisse, die den Eingabemodus zu breitem Latein umschalten."
+
+#: src/scim_anthy_prefs.cpp:556
+msgid "Hiragana mode"
+msgstr "Hiragana-Modus"
+
+#: src/scim_anthy_prefs.cpp:557
+msgid "Select hiragana mode keys"
+msgstr "Hiragana-Modus-Tasten auswählen"
+
+#: src/scim_anthy_prefs.cpp:558
+msgid "The key events to switch input mode to hiragana. "
+msgstr "Die Tastatureignisse, die den Eingabemodus zu Hiragana umschalten."
+
+#: src/scim_anthy_prefs.cpp:566
+msgid "Katakana mode"
+msgstr "Katakana-Modus"
+
+#: src/scim_anthy_prefs.cpp:567
+msgid "Select katakana mode keys"
+msgstr "Katakana-Modus-Tasten auswählen"
+
+#: src/scim_anthy_prefs.cpp:568
+msgid "The key events to switch input mode to katakana. "
+msgstr "Die Tastatureignisse, die den Eingabemodus zu Katakana umschalten."
+
+#: src/scim_anthy_prefs.cpp:576
+msgid "Half katakana mode"
+msgstr "Halb-Katakana-Modus"
+
+#: src/scim_anthy_prefs.cpp:577
+msgid "Select half katakana mode keys"
+msgstr "Halb-Katakana-Modus-Tasten auswählen"
+
+#: src/scim_anthy_prefs.cpp:578
+msgid "The key events to switch input mode to half katakana. "
+msgstr ""
+"Die Tastatureignisse, die den Eingabemodus zu Halb-Katakana umschalten."
+
+#: src/scim_anthy_prefs.cpp:586
+msgid "Pseudo ASCII mode cancel"
+msgstr "Pseudo-ASCII-Modus abbrechen"
+
+#: src/scim_anthy_prefs.cpp:587
+msgid "Select pseudo ASCII mode cancel key"
+msgstr "Tasten, um den Pseudo-ASCII-Modus abzubrechen, auswählen"
+
+#: src/scim_anthy_prefs.cpp:588
+msgid "The key events to cancel the pseudo ASCII mode."
+msgstr "Die Tastaturereignisse, die den Pseudo-ASCII-Modus abbrechen"
+
+#: src/scim_anthy_prefs.cpp:596
+msgid "Circle typing method"
+msgstr "Schreibmethode durchschalten"
+
+#: src/scim_anthy_prefs.cpp:597
+msgid "Select circle typing method keys"
+msgstr "Tasten um Schreibmethode durchzuschalten, auswählen"
+
+#: src/scim_anthy_prefs.cpp:598
+msgid "The key events to circle typing method. "
+msgstr "Die Tastatureignisse, die die Schreibmethode durchschalten"
+
+#: src/scim_anthy_prefs.cpp:620
+msgid "Insert space"
+msgstr "Leerzeichen hinzufügen"
+
+#: src/scim_anthy_prefs.cpp:621
+msgid "Select inserting space keys"
+msgstr "Tasten um ein Leerzeichen hinzuzufügen, auswählen"
+
+#: src/scim_anthy_prefs.cpp:622
+msgid "The key events to insert a space. "
+msgstr "Die Tastatureignisse, die ein Leerzeichen hinzufügen."
+
+#: src/scim_anthy_prefs.cpp:630
+msgid "Insert alternative space"
+msgstr "Alternatives Leerzeichen hinzuf+gen"
+
+#: src/scim_anthy_prefs.cpp:631
+msgid "Select inserting alternative space keys"
+msgstr "Tasten um ein alternatives Leerzeichen hinzuzufügen, auswählen"
+
+#: src/scim_anthy_prefs.cpp:632
+msgid "The key events to insert a alternative space. "
+msgstr "Die Tastatureignisse, die ein alternatives Leerzeichen hinzufügen."
+
+#: src/scim_anthy_prefs.cpp:640
+msgid "Insert half space"
+msgstr "Halbes Leerzeicehn hinzufügen"
+
+#: src/scim_anthy_prefs.cpp:641
+msgid "Select inserting half width space keys"
+msgstr "Tasten um ein halbbreites Leerzeichen hinzuzufügen, auswählen"
+
+#: src/scim_anthy_prefs.cpp:642
+msgid "The key events to insert a half width space. "
+msgstr "Die Tastatureignisse, die ein halbbreites Leerzeichen hinzufügen."
+
+#: src/scim_anthy_prefs.cpp:650
+msgid "Insert wide space"
+msgstr "Breites Leerzeichen hinzufügen"
+
+#: src/scim_anthy_prefs.cpp:651
+msgid "Select inserting wide space keys"
+msgstr "Tasten um ein breites Leerzeichen hinzuzufügen, auswählen"
+
+#: src/scim_anthy_prefs.cpp:652
+msgid "The key events to insert a wide space. "
+msgstr "Die Tastatureignisse, die ein breites Leerzeichen hinzufügen."
+
+#: src/scim_anthy_prefs.cpp:660
+msgid "Backspace"
+msgstr "Backspace"
+
+#: src/scim_anthy_prefs.cpp:661
+msgid "Select backspace keys"
+msgstr "Backspace-Tasten auswählen"
+
+#: src/scim_anthy_prefs.cpp:662
+msgid "The key events to delete a character before caret. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:670
+msgid "Delete"
+msgstr "Entfernen"
+
+#: src/scim_anthy_prefs.cpp:671
+msgid "Select delete keys"
+msgstr "Entfernen-Tasten auswählen"
+
+#: src/scim_anthy_prefs.cpp:672
+msgid "The key events to delete a character after caret. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:682
+msgid "The key events to commit the preedit string. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:690
+msgid "Convert"
+msgstr "Konvertieren"
+
+#: src/scim_anthy_prefs.cpp:691
+msgid "Select convert keys"
+msgstr "Konvertierungstasten auswählen"
+
+#: src/scim_anthy_prefs.cpp:692
+msgid "The key events to convert the preedit string to kanji. "
+msgstr ""
+"Die Tastatureignisse, die eine unbearbeitete Zeichenkette in Kanji "
+"konvertieren."
+
+#: src/scim_anthy_prefs.cpp:700
+msgid "Predict"
+msgstr "Vorhersagen"
+
+#: src/scim_anthy_prefs.cpp:701
+msgid "Select predict keys"
+msgstr "Wähle Vorhersagetasten"
+
+#: src/scim_anthy_prefs.cpp:702
+msgid ""
+"The key events to predict a word or sentence from already inserted text. "
+msgstr ""
+"Die Tastatureignisse, die ein Wort oder einen Satz aus einem bereits "
+"eingegebenen Text vorhersagen"
+
+#: src/scim_anthy_prefs.cpp:710
+msgid "Cancel"
+msgstr "Abbrechen"
+
+#: src/scim_anthy_prefs.cpp:711
+msgid "Select cancel keys"
+msgstr "Abbrechen-Tasten auswählen"
+
+#: src/scim_anthy_prefs.cpp:712
+msgid "The key events to cancel preediting or converting. "
+msgstr ""
+"Die Tastatureignisse, die die Vorbearbeitung oder das Konvertieren abbrechen."
+
+#: src/scim_anthy_prefs.cpp:720
+msgid "Cancel all"
+msgstr "Alles abbrechen."
+
+#: src/scim_anthy_prefs.cpp:721
+msgid "Select cancel all keys"
+msgstr "Tasten um alles abzubrechen, auswählen."
+
+#: src/scim_anthy_prefs.cpp:722
+msgid "The key events to return to initial state. "
+msgstr "Die Tastaturereignisse, die wieder zum Anfangszustand zurückkehren"
+
+#: src/scim_anthy_prefs.cpp:730
+msgid "Reconvert"
+msgstr "Zurückkonvertieren"
+
+#: src/scim_anthy_prefs.cpp:731
+msgid "Select reconvert keys"
+msgstr "Tasten zum zurückkonvertieren wählen"
+
+#: src/scim_anthy_prefs.cpp:732
+msgid "The key events to reconvert the commited string in selection. "
+msgstr ""
+"Die Tastatureignisse, die die übergebene Zeichenkette wieder in eine Auswahl "
+"zurückkonvertieren"
+
+#: src/scim_anthy_prefs.cpp:741
+msgid "Select do nothing keys"
+msgstr "Tasten um nichts zu tun, auswählen"
+
+#: src/scim_anthy_prefs.cpp:742
+msgid ""
+"The key events to eat and do nothing anymore. For example, it can be used to "
+"disable space key completely."
+msgstr ""
+"Die Tastatureignisse, um Essen zu gehen und nichts mehr zu tun. Das kann zum "
+"Beispiel benutzt werden, um die Leertaste komplett zu deaktivieren."
+
+#: src/scim_anthy_prefs.cpp:765
+msgid "Move to first"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:766
+msgid "Select move caret to first keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:767
+msgid "The key events to move the caret to the first of preedit string. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:775
+msgid "Move to last"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:776
+msgid "Select move caret to last keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:777
+msgid "The key events to move the caret to the last of the preedit string. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:785
+msgid "Move forward"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:786
+#, fuzzy
+msgid "Select move caret forward keys"
+msgstr "Konvertierungstasten auswählen"
+
+#: src/scim_anthy_prefs.cpp:787
+#, fuzzy
+msgid "The key events to move the caret forward. "
+msgstr "Die Tastatureignisse, die den nöchsten Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:795
+msgid "Move backward"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:796
+#, fuzzy
+msgid "Select move caret backward keys"
+msgstr "Konvertierungstasten auswählen"
+
+#: src/scim_anthy_prefs.cpp:797
+#, fuzzy
+msgid "The key events to move the caret backward. "
+msgstr "Die Tastatureignisse, die den nöchsten Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:819
+msgid "Select the first segment"
+msgstr "Das erste Segment auswählen"
+
+#: src/scim_anthy_prefs.cpp:820
+msgid "Select keys to select the first segment"
+msgstr "Tasten auswählen, um das erste Segment auszuwählen"
+
+#: src/scim_anthy_prefs.cpp:821
+msgid "The key events to select the first segment. "
+msgstr "Die Tastatureignisse, die das erste Segment auswählen"
+
+#: src/scim_anthy_prefs.cpp:829
+msgid "Select the last segment"
+msgstr "Das letzte Segment auswählen"
+
+#: src/scim_anthy_prefs.cpp:830
+msgid "Select keys to select the last segment"
+msgstr "Tasten auswählen, um das letzte Segment auszuwählen"
+
+#: src/scim_anthy_prefs.cpp:831
+msgid "The key events to select the the last segment. "
+msgstr "Die Tastatureignisse, die das letzte Segment auswählen"
+
+#: src/scim_anthy_prefs.cpp:839
+msgid "Select the next segment"
+msgstr "Das nächste Segment auswählen"
+
+#: src/scim_anthy_prefs.cpp:840
+msgid "Select keys to select the next segment"
+msgstr "Tasten auswählen, um das nächste Segment auszuwählen"
+
+#: src/scim_anthy_prefs.cpp:841
+msgid "The key events to select the next segment. "
+msgstr "Die Tastatureignisse, die das nächste Segment auswählen"
+
+#: src/scim_anthy_prefs.cpp:849
+msgid "Select the previous segment"
+msgstr "Das vorherige Segment auswählen"
+
+#: src/scim_anthy_prefs.cpp:850
+msgid "Select keys to select the previous segment"
+msgstr "Tasten auswählen, um das vorherige Segment auszuwählen"
+
+#: src/scim_anthy_prefs.cpp:851
+msgid "The key events to select the previous segment. "
+msgstr "Die Tastatureignisse, die das vorherige Segment auswählen"
+
+#: src/scim_anthy_prefs.cpp:859
+msgid "Shrink the segment"
+msgstr "Das Segment verkleinern"
+
+#: src/scim_anthy_prefs.cpp:860
+msgid "Select keys to shrink the segment"
+msgstr "Tasten auswählen, um das Segment zu verkleinern"
+
+#: src/scim_anthy_prefs.cpp:861
+msgid "The key events to shrink the selected segment. "
+msgstr "Die Tastatureignisse, die das ausgewählte Segment verkleinern"
+
+#: src/scim_anthy_prefs.cpp:869
+msgid "Expand the segment"
+msgstr "Das Segment vergrößern"
+
+#: src/scim_anthy_prefs.cpp:870
+msgid "Select keys to expand the segment"
+msgstr "Tasten auswählen, um das Segment zu vergrößern"
+
+#: src/scim_anthy_prefs.cpp:871
+msgid "The key events to expand the selected segment. "
+msgstr "Die Tastatureignisse, die das ausgewählte Segment vergrößern"
+
+#: src/scim_anthy_prefs.cpp:879
+msgid "Commit the first segment"
+msgstr "Das erste Segment übergeben"
+
+#: src/scim_anthy_prefs.cpp:881
+msgid "The key events to commit the first segment. "
+msgstr "Die Tastatureignisse, die das erste Segment übergeben"
+
+#: src/scim_anthy_prefs.cpp:889
+msgid "Commit the selected segment"
+msgstr "Das ausgewählte Segment übergeben"
+
+#: src/scim_anthy_prefs.cpp:891
+msgid "The key events to commit the selected segment. "
+msgstr "Die Tastatureignisse, die das ausgewählte Segment übergeben"
+
+#: src/scim_anthy_prefs.cpp:913
+msgid "First candidate"
+msgstr "Erster Kandidat"
+
+#: src/scim_anthy_prefs.cpp:914
+msgid "Select the first candidate keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:915
+msgid "The key events to select the first candidate. "
+msgstr "Die Tastatureignisse, die den ersten Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:923
+msgid "Last candidate"
+msgstr "Letzter Kandidat"
+
+#: src/scim_anthy_prefs.cpp:924
+msgid "Select the last candidate keys"
+msgstr "Tasten für den letzten Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:925
+msgid "The key events to the select last candidate. "
+msgstr "Die Tastatureignisse, die den letzten Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:933
+msgid "Next candidate"
+msgstr "Nächster Kandidat"
+
+#: src/scim_anthy_prefs.cpp:934
+msgid "Select the next candidate keys"
+msgstr "Tasten für den nächsten Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:935
+msgid "The key events to select the next candidate. "
+msgstr "Die Tastatureignisse, die den nöchsten Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:943
+msgid "Previous candidate"
+msgstr "Vorheriger Kandidat"
+
+#: src/scim_anthy_prefs.cpp:944
+msgid "Select the previous candidate keys"
+msgstr "Tasten für den vorherigen Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:945
+msgid "The key events to select the previous candidate. "
+msgstr "Die Tastatureignisse, die den vorherigen Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:953
+msgid "Page up"
+msgstr "Seite hoch"
+
+#: src/scim_anthy_prefs.cpp:954
+msgid "Select page up candidates keys"
+msgstr "Tasten auswählen, um eine Kandidatenseite hochzugehen"
+
+#: src/scim_anthy_prefs.cpp:955
+msgid "The key events to switch candidates page up. "
+msgstr "Die Tastatureignisse, die eine Kandidatenseite hochgehen"
+
+#: src/scim_anthy_prefs.cpp:963
+msgid "Page down"
+msgstr "Seite runter"
+
+#: src/scim_anthy_prefs.cpp:964
+msgid "Select page down candidates keys"
+msgstr "Tasten auswählen, um eine Kandidatenseite herunterzugehen"
+
+#: src/scim_anthy_prefs.cpp:965
+msgid "The key events to switch candidates page down. "
+msgstr "Die Tastatureignisse, die eine Kandidatenseite heruntergehen"
+
+#: src/scim_anthy_prefs.cpp:987
+msgid "1st candidate"
+msgstr "1. Kandidat"
+
+#: src/scim_anthy_prefs.cpp:988
+msgid "Select keys to select 1st candidate"
+msgstr " Tasten wählen, um 1. Kandidaten auszuwählen"
+
+#: src/scim_anthy_prefs.cpp:989
+msgid "The key events to select the 1st candidate. "
+msgstr "Die Tastatureignisse, die den 1. Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:997
+msgid "2nd candidate"
+msgstr "2. Kandidat"
+
+#: src/scim_anthy_prefs.cpp:998
+msgid "Select keys to select 2nd candidate"
+msgstr " Tasten wählen, um 2. Kandidaten auszuwählen"
+
+#: src/scim_anthy_prefs.cpp:999
+msgid "The key events to select the 2nd candidate. "
+msgstr "Die Tastatureignisse, die den 2. Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:1007
+msgid "3rd candidate"
+msgstr "3. Kandidat"
+
+#: src/scim_anthy_prefs.cpp:1008
+msgid "Select keys to select 3rd candidate"
+msgstr " Tasten wählen, um 3. Kandidaten auszuwählen"
+
+#: src/scim_anthy_prefs.cpp:1009
+msgid "The key events to select the 3rd candidate. "
+msgstr "Die Tastatureignisse, die den 3. Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:1017
+msgid "4th candidate"
+msgstr "4. Kandidat"
+
+#: src/scim_anthy_prefs.cpp:1018
+msgid "Select keys to select 4th candidate"
+msgstr " Tasten wählen, um 4. Kandidaten auszuwählen"
+
+#: src/scim_anthy_prefs.cpp:1019
+msgid "The key events to select the 4th candidate. "
+msgstr "Die Tastatureignisse, die den 4. Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:1027
+msgid "5th candidate"
+msgstr "5. Kandidat"
+
+#: src/scim_anthy_prefs.cpp:1028
+msgid "Select keys to select 5th candidate"
+msgstr " Tasten wählen, um 5. Kandidaten auszuwählen"
+
+#: src/scim_anthy_prefs.cpp:1029
+msgid "The key events to select the 5th candidate. "
+msgstr "Die Tastatureignisse, die den 5. Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:1037
+msgid "6th candidate"
+msgstr "6. Kandidat"
+
+#: src/scim_anthy_prefs.cpp:1038
+msgid "Select keys to select 6th candidate"
+msgstr " Tasten wählen, um 6. Kandidaten auszuwählen"
+
+#: src/scim_anthy_prefs.cpp:1039
+msgid "The key events to select the 6th candidate. "
+msgstr "Die Tastatureignisse, die den 6. Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:1047
+msgid "7th candidate"
+msgstr "7. Kandidat"
+
+#: src/scim_anthy_prefs.cpp:1048
+msgid "Select keys to select 7th candidate"
+msgstr " Tasten wählen, um 7. Kandidaten auszuwählen"
+
+#: src/scim_anthy_prefs.cpp:1049
+msgid "The key events to select the 7th candidate. "
+msgstr "Die Tastatureignisse, die den 7. Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:1057
+msgid "8th candidate"
+msgstr "8. Kandidat"
+
+#: src/scim_anthy_prefs.cpp:1058
+msgid "Select keys to select 8th candidate"
+msgstr " Tasten wählen, um 8. Kandidaten auszuwählen"
+
+#: src/scim_anthy_prefs.cpp:1059
+msgid "The key events to select the 8th candidate. "
+msgstr "Die Tastatureignisse, die den 8. Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:1067
+msgid "9th candidate"
+msgstr "9. Kandidat"
+
+#: src/scim_anthy_prefs.cpp:1068
+msgid "Select keys to select 9th candidate"
+msgstr "Die Tastatureignisse, die den 9. Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:1069
+msgid "The key events to select the 9th candidate. "
+msgstr "Die Tastatureignisse, um den 9. Kandidaten auszuwählen"
+
+#: src/scim_anthy_prefs.cpp:1077
+msgid "10th candidate"
+msgstr "10. Kandidat"
+
+#: src/scim_anthy_prefs.cpp:1078
+msgid "Select keys to select 10th candidate"
+msgstr "Die Tastatureignisse, die den 10. Kandidaten auswählen"
+
+#: src/scim_anthy_prefs.cpp:1079
+msgid "The key events to select the 10th candidate. "
+msgstr "Die Tastatureignisse, um den 10. Kandidaten auszuwählen"
+
+#: src/scim_anthy_prefs.cpp:1101
+#, fuzzy
+msgid "Convert character type forward"
+msgstr "Zeichentyp vorwärts rotieren"
+
+#: src/scim_anthy_prefs.cpp:1102
+#, fuzzy
+msgid "Select keys to convert character type forward"
+msgstr "Zeichentyp vorwärts rotieren"
+
+#: src/scim_anthy_prefs.cpp:1103
+#, fuzzy
+msgid "Rotate character type forward."
+msgstr "Zeichentyp vorwärts rotieren"
+
+#: src/scim_anthy_prefs.cpp:1111
+#, fuzzy
+msgid "Convert character type backward"
+msgstr "Zeichentyp rückwärts rotieren"
+
+#: src/scim_anthy_prefs.cpp:1112
+#, fuzzy
+msgid "Select keys to convert character type backward"
+msgstr "Tasten auswählen, um in Katakana zu konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1113
+#, fuzzy
+msgid "Rotate character type backward."
+msgstr "Zeichentyp rückwärts rotieren"
+
+#: src/scim_anthy_prefs.cpp:1121
+msgid "Convert to hiragana"
+msgstr "In Hiragana konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1122
+msgid "Select keys to convert to hiragana"
+msgstr "Tasten auswählen, um in Hiragan zu konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1123
+msgid "The key events to convert the preedit string to hiragana. "
+msgstr ""
+"Die Tastaturereignisse, die die unbearbeitete Zeichenkette in Hiragana "
+"konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1131
+msgid "Convert to katakana"
+msgstr "In Katakana konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1132
+msgid "Select keys to convert to katakana"
+msgstr "Tasten auswählen, um in Katakana zu konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1133
+msgid "The key events to convert the preedit string to katakana. "
+msgstr ""
+"Die Tastaturereignisse, die die unbearbeitete Zeichenkette in Katakana "
+"konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1141
+msgid "Convert to half width"
+msgstr "in Halbbreit konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1142
+msgid "Select keys to convert to half width"
+msgstr "Tasten auswählen, um in Halbbreit zu konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1143
+msgid "The key events to convert the preedit string to half width. "
+msgstr ""
+"Die Tastaturereignisse, die die unbearbeitete Zeichenkette in Halbbreit "
+"konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1151
+msgid "Convert to half katakana"
+msgstr "In halbbreite Katakana konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1152
+msgid "Select keys to convert to half width katakana"
+msgstr "Tasten auswählen, um in halbbreite Katakana zu konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1153
+msgid "The key events to convert the preedit string to half width katakana. "
+msgstr ""
+"Die Tastaturereignisse, die die unbearbeitete Zeichenkette in halbbreite "
+"Katakana konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1161
+msgid "Convert to wide latin"
+msgstr "In breites Latein konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1162
+msgid "Select keys to convert to wide latin"
+msgstr "Tasten auswählen, um in breites Latein zu konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1163
+msgid "The key events to convert the preedit string to wide latin. "
+msgstr ""
+"Die Tastaturereignisse, die die unbearbeitete Zeichenkette in breites Latein "
+"konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1171
+msgid "Convert to latin"
+msgstr "In Latein konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1172
+msgid "Select keys to convert to latin"
+msgstr "Tasten auswählen, um in Latein zu konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1173
+msgid "The key events to convert the preedit string to latin. "
+msgstr ""
+"Die Tastaturereignisse, die die unbearbeitete Zeichenkette in Latein "
+"konvertieren"
+
+#: src/scim_anthy_prefs.cpp:1195
+msgid "Edit dictionary"
+msgstr "Wörterbuch bearbeiten"
+
+#: src/scim_anthy_prefs.cpp:1196
+msgid "Select edit dictionary keys"
+msgstr "Tasten auswählen, um Wörterbuch zu bearbeiten"
+
+#: src/scim_anthy_prefs.cpp:1197
+msgid "The key events to launch dictionary administration tool. "
+msgstr "Die Tastaturereignisse, die das Wörterbuchverwaltungsprogramm öffnen"
+
+#: src/scim_anthy_prefs.cpp:1206
+msgid "Select add a word keys"
+msgstr "Tasten auswählen, um ein Wort hinzuzufügen"
+
+#: src/scim_anthy_prefs.cpp:1207
+msgid "The key events to launch the tool to add a word. "
+msgstr ""
+"Die Tastatureignisse, die das Programm zum Hinzufügen eines Wortes öffnen"
+
+#: src/scim_anthy_prefs.cpp:1232 src/scim_anthy_prefs.cpp:1245
+#: src/scim_anthy_prefs.cpp:1258
+msgid "Color:"
+msgstr "Farbe:"
+
+#: src/scim_anthy_prefs.cpp:1233 src/scim_anthy_prefs.cpp:1234
+msgid "The color of preediting text"
+msgstr "Farbe des unbearbeiteten Textes"
+
+#: src/scim_anthy_prefs.cpp:1246 src/scim_anthy_prefs.cpp:1247
+msgid "The color of conversion text"
+msgstr "Farbe des konvertierten Textes"
+
+#: src/scim_anthy_prefs.cpp:1259
+msgid "The color of selected segment text"
+msgstr "Die Farbe des ausgewählten Segments"
+
+#: src/scim_anthy_prefs.cpp:1260
+#, fuzzy
+msgid "The color of selected segment text in the conversion text"
+msgstr "Die Farbe des ausgewählten Segments im konvertierten Text"
+
+#: src/scim_anthy_color_button.cpp:320
+msgid "Foreground color"
+msgstr "Vordergrundfarbe"
+
+#: src/scim_anthy_color_button.cpp:320
+msgid "Background color"
+msgstr "Hintergrundfarbe"
+
+#~ msgid "<b>Default Modes</b>"
+#~ msgstr "<b>Standardmodi</b>"
+
+#~ msgid "<b>Input Prediction</b>"
+#~ msgstr "<b>Eingabevorhersage</b>"
+
+#~ msgid "Key Bindings"
+#~ msgstr "Tastenkürzel"
+
+#~ msgid "Colors"
+#~ msgstr "Farben"
+
+#~ msgid "Table _entries:"
+#~ msgstr "Tabellen_einträge"
+
+#~ msgid "Use the scim-anthy's custom lookup _window instead of SCIM's one"
+#~ msgstr ""
+#~ "Das benutzerdefinierte Nachschlage_fenster von Scim-Anthy anstelle des "
+#~ "von SCIM benutzen."
+
+#, fuzzy
+#~ msgid "Show _diction of candidates"
+#~ msgstr "Zeige Schreibweise der Kandidaten"
+
+#~ msgid "Show _tray icon"
+#~ msgstr "_Tray-Icon anzeigen"
+
+#~ msgid "\"_Yomi\" option for \"Add word\" command:"
+#~ msgstr "„Yomi“-Option für „Wort hinzufügen“-Befehl:"
--- /dev/null
+# All this catalog "translates" are quotation characters.
+# The msgids must be ASCII and therefore cannot contain real quotation
+# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
+# and double quote (0x22). These substitutes look strange; see
+# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
+#
+# This catalog translates grave accent (0x60) and apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019).
+# It also translates pairs of apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019)
+# and pairs of quotation mark (0x22) to
+# left double quotation mark (U+201C) and right double quotation mark (U+201D).
+#
+# When output to an UTF-8 terminal, the quotation characters appear perfectly.
+# When output to an ISO-8859-1 terminal, the single quotation marks are
+# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
+# grave/acute accent (by libiconv), and the double quotation marks are
+# transliterated to 0x22.
+# When output to an ASCII terminal, the single quotation marks are
+# transliterated to apostrophes, and the double quotation marks are
+# transliterated to 0x22.
+#
+# This catalog furthermore displays the text between the quotation marks in
+# bold face, assuming the VT100/XTerm escape sequences.
+#
--- /dev/null
+# All this catalog "translates" are quotation characters.
+# The msgids must be ASCII and therefore cannot contain real quotation
+# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
+# and double quote (0x22). These substitutes look strange; see
+# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
+#
+# This catalog translates grave accent (0x60) and apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019).
+# It also translates pairs of apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019)
+# and pairs of quotation mark (0x22) to
+# left double quotation mark (U+201C) and right double quotation mark (U+201D).
+#
+# When output to an UTF-8 terminal, the quotation characters appear perfectly.
+# When output to an ISO-8859-1 terminal, the single quotation marks are
+# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
+# grave/acute accent (by libiconv), and the double quotation marks are
+# transliterated to 0x22.
+# When output to an ASCII terminal, the single quotation marks are
+# transliterated to apostrophes, and the double quotation marks are
+# transliterated to 0x22.
+#
--- /dev/null
+# Sed script that inserts the file called HEADER before the header entry.
+#
+# At each occurrence of a line starting with "msgid ", we execute the following
+# commands. At the first occurrence, insert the file. At the following
+# occurrences, do nothing. The distinction between the first and the following
+# occurrences is achieved by looking at the hold space.
+/^msgid /{
+x
+# Test if the hold space is empty.
+s/m/m/
+ta
+# Yes it was empty. First occurrence. Read the file.
+r HEADER
+# Output the file's contents by reading the next line. But don't lose the
+# current line while doing this.
+g
+N
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
--- /dev/null
+# translation of scim-anthy to Japanese
+# This file is distributed under the same license as the PACKAGE package.
+# Copyright (C) 2004 Takuro Ashie <ashie@homa.ne.jp>.
+msgid ""
+msgstr ""
+"Project-Id-Version: anthy\n"
+"Report-Msgid-Bugs-To: ashie@homa.ne.jp\n"
+"POT-Creation-Date: 2009-01-15 12:04+0900\n"
+"PO-Revision-Date: 2006-02-14 10:50+0900\n"
+"Last-Translator: Takuro Ashie <ashie@homa.ne.jp>\n"
+"Language-Team: Japanese <ja@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/scim_anthy_imengine.cpp:488
+#, c-format
+msgid "Candidates (%d/%d)"
+msgstr "候補一覧 (%d/%d)"
+
+#: src/scim_anthy_imengine.cpp:565
+msgid "Input mode"
+msgstr "入力モード"
+
+#: src/scim_anthy_imengine.cpp:569 src/scim_anthy_setup.cpp:203
+msgid "Hiragana"
+msgstr "ひらがな"
+
+#: src/scim_anthy_imengine.cpp:573 src/scim_anthy_setup.cpp:204
+msgid "Katakana"
+msgstr "カタカナ"
+
+#: src/scim_anthy_imengine.cpp:577 src/scim_anthy_imengine.cpp:578
+#: src/scim_anthy_setup.cpp:205
+msgid "Half width katakana"
+msgstr "半角カタカナ"
+
+#: src/scim_anthy_imengine.cpp:582 src/scim_anthy_setup.cpp:206
+msgid "Latin"
+msgstr "英数"
+
+#: src/scim_anthy_imengine.cpp:582
+msgid "Direct input"
+msgstr "直接入力"
+
+#: src/scim_anthy_imengine.cpp:586 src/scim_anthy_setup.cpp:207
+msgid "Wide latin"
+msgstr "全角英数"
+
+#: src/scim_anthy_imengine.cpp:592
+msgid "Typing method"
+msgstr "入力方式"
+
+#: src/scim_anthy_imengine.cpp:596
+msgid "Romaji"
+msgstr "ローマ字"
+
+#: src/scim_anthy_imengine.cpp:600
+msgid "Kana"
+msgstr "かな"
+
+#: src/scim_anthy_imengine.cpp:604
+msgid "Thumb shift"
+msgstr "親指シフト"
+
+#: src/scim_anthy_imengine.cpp:611
+msgid "Conversion mode"
+msgstr "変換モード"
+
+#: src/scim_anthy_imengine.cpp:615 src/scim_anthy_imengine.cpp:616
+#: src/scim_anthy_setup.cpp:221
+msgid "Multi segment"
+msgstr "連文節"
+
+#: src/scim_anthy_imengine.cpp:620 src/scim_anthy_imengine.cpp:621
+#: src/scim_anthy_setup.cpp:222
+msgid "Single segment"
+msgstr "単文節"
+
+#: src/scim_anthy_imengine.cpp:625 src/scim_anthy_imengine.cpp:627
+#: src/scim_anthy_setup.cpp:223
+msgid "Convert as you type (Multi segment)"
+msgstr "逐次変換(連文節)"
+
+#: src/scim_anthy_imengine.cpp:631 src/scim_anthy_imengine.cpp:633
+#: src/scim_anthy_setup.cpp:224
+msgid "Convert as you type (Single segment)"
+msgstr "逐次変換(単文節)"
+
+#: src/scim_anthy_imengine.cpp:640
+msgid "Period style"
+msgstr "句読点のスタイル"
+
+#: src/scim_anthy_imengine.cpp:669
+msgid "Symbol style"
+msgstr "記号のスタイル"
+
+#: src/scim_anthy_imengine.cpp:717
+msgid "Dictionary menu"
+msgstr "辞書メニュー"
+
+#: src/scim_anthy_imengine.cpp:722
+msgid "Edit the dictionary"
+msgstr "辞書を編集"
+
+#: src/scim_anthy_imengine.cpp:724
+msgid "Launch the dictionary administration tool."
+msgstr "辞書管理ツールを起動"
+
+#: src/scim_anthy_imengine.cpp:730 src/scim_anthy_prefs.cpp:1205
+msgid "Add a word"
+msgstr "単語を追加"
+
+#: src/scim_anthy_imengine.cpp:732
+msgid "Add a word to the dictionary."
+msgstr "単語を辞書に追加"
+
+#: src/scim_anthy_factory.cpp:195
+msgid ""
+"Authors of scim-anthy:\n"
+" Copyright (C) 2004,2005 Takuro Ashie <ashie@homa.ne.jp>\n"
+" Copyright (C) 2004,2005 Hiroyuki Ikezoe <poincare@ikezoe.net>\n"
+" \n"
+"Authors of Anthy:\n"
+" Copyright (C) 2000-2005 Yusuke TABATA <yusuke@w5.dion.ne.jp>\n"
+" Copyright (C) 2004-2005 Yuichi YOSHIDA <oxy@kmc.gr.jp>\n"
+" You can find out all credits of Anthy from AUTHORS file in Anthy package.\n"
+msgstr ""
+"scim-anthyの作者:\n"
+" Copyright (C) 2004,2005 Takuro Ashie <ashie@homa.ne.jp>\n"
+" Copyright (C) 2004,2005 Hiroyuki Ikezoe <poincare@ikezoe.net>\n"
+" \n"
+"Anthyの作者:\n"
+" Copyright (C) 2000-2005 Yusuke TABATA <yusuke@w5.dion.ne.jp>\n"
+" Copyright (C) 2004-2005 Yuichi YOSHIDA <oxy@kmc.gr.jp>\n"
+" Anthyの全てのクレジットはAnthyパッケージのAUTHORSファイルを参照して下さ"
+"い。\n"
+
+#: src/scim_anthy_factory.cpp:211
+msgid ""
+"Art work:\n"
+" SHIMODA Hiroshi <piro@p.club.ne.jp>\n"
+"\n"
+"Translation:\n"
+" Gerrit Sangel <z0idberg@gmx.de>\n"
+"Special thanks:\n"
+" UTUMI Hirosi <utuhiro78@yahoo.co.jp>\n"
+" Yukiko Bando <ybando@k6.dion.ne.jp>\n"
+" Mike Fabian <mfabian@suse.de>\n"
+" David Oftedal <david@start.no>\n"
+" Ryo Dairiki <ryo-dairiki@users.sourceforge.net>\n"
+" Seiichi SATO\n"
+" AWASHIRO Ikuya <ikuya@oooug.jp>\n"
+" Hatuka*nezumi <nezumi@jca.apc.org>\n"
+" Teppei Tamra <tam-t@par.odn.ne.jp>\n"
+" Akira TAGOH <at@gclab.org>\n"
+" Tatsuki Sugiura <sugi@nemui.org>\n"
+" Takashi Nakamoto <bluedwarf@bpost.plala.or.jp>"
+msgstr ""
+"Art work:\n"
+" SHIMODA Hiroshi <piro@p.club.ne.jp>\n"
+"Translation:\n"
+" Gerrit Sangel <z0idberg@gmx.de>\n"
+"Special thanks:\n"
+" UTUMI Hirosi <utuhiro78@yahoo.co.jp>\n"
+" Yukiko Bando <ybando@k6.dion.ne.jp>\n"
+" Mike Fabian <mfabian@suse.de>\n"
+" David Oftedal <david@start.no>\n"
+" Ryo Dairiki <ryo-dairiki@users.sourceforge.net>\n"
+" Seiichi SATO\n"
+" AWASHIRO Ikuya <ikuya@oooug.jp>\n"
+" Hatuka*nezumi <nezumi@jca.apc.org>\n"
+" Teppei Tamra <tam-t@par.odn.ne.jp>\n"
+" Akira TAGOH <at@gclab.org>\n"
+" Tatsuki Sugiura <sugi@nemui.org>\n"
+" Takashi Nakamoto <bluedwarf@bpost.plala.or.jp>"
+
+#: src/scim_anthy_factory.cpp:236
+msgid ""
+"Basic operation:\n"
+" \n"
+msgstr ""
+"基本操作:\n"
+" \n"
+
+#: src/scim_anthy_factory.cpp:240
+msgid ""
+"1. Switch input mode:\n"
+" You can switch on/off Japanese input mode by pressing Zenkaku_Hankaku key\n"
+" or Control+J. Or you can rotate all input modes by pressing Control+,\n"
+" (comma).\n"
+" \n"
+msgstr ""
+"1. 入力モードの切り替え:\n"
+" 全角/半角キーあるいはControl+Jキーを押すことで、日本語モードをON/OFFする\n"
+" ことができます。あるいは、Conrol+,(コンマ)を押すことで、全ての入力モード"
+"に\n"
+" 順次切り替えることができます。\n"
+" \n"
+
+#: src/scim_anthy_factory.cpp:247
+msgid ""
+"2. Input Japanese hiragana and katakana:\n"
+" You can input Japanese hiragana and katakana by inputting romaji.\n"
+" The Romaji table can be found out from the \"Anthy\" section of the setup\n"
+" window in SCIM or SKIM.\n"
+" If you want to hiragana and katakana directly by using Japanese keyboard,\n"
+" please press Alt + Romaji key or Conrol+\\ key to switch typing method.\n"
+" \n"
+msgstr ""
+"2. ひらがな及びカタカナの入力:\n"
+" ローマ字を入力することで、ひらがな及びカタカナを入力することができます。\n"
+" ローマ字表は、SCIMあるいはSKIM設定ウィンドウの「Anthy」セクションで見るこ\n"
+" とができます。日本語キーボードを使ってひらがなやカタカナを直接入力したい\n"
+" 場合は、Alt+ローマ字キーあるいはConrol+\\キーを押して、入力方式を切り替え"
+"て\n"
+" 下さい。\n"
+" \n"
+
+#: src/scim_anthy_factory.cpp:256
+msgid ""
+"3. Convert hiragana or katakana to Japanese kanji\n"
+" After inputting hiragana or katakana, you can convert it to Japanese\n"
+" kanji by pressing Space key. Then it will show some candidates. You can\n"
+" select the next candidate by pressing Space key, and can commit it by\n"
+" pressing Enter key.\n"
+" If you input a sentense, Anthy will split it to some segments. You can\n"
+" select the next or previous segment by pressing left or right cursor key,\n"
+" and can extend or shrink the selected segment by pressing Shift + left or\n"
+" right cursor key.\n"
+" \n"
+msgstr ""
+"3. ひらがなやカタカナを漢字に変換する\n"
+" ひらがなやカタカナを入力後、スペースキーを押すことで漢字に変換することが\n"
+" できます。この際、複数の候補が表示されるでしょう。更にスペースキーを押す\n"
+" ことで、次の候補を選択することができます。Enterキーを押すと確定します。\n"
+" 文章を入力した場合、Anthyはそれを複数の文節に分けます。この際、左あるいは\n"
+" 右カーソルキーを押すことで、前後の文節を選択することができます。また、\n"
+" Shift+左あるいは右カーソルキーを押すことで、文節を伸ばしたり縮めたりする\n"
+" ことができます。\n"
+" \n"
+
+#: src/scim_anthy_factory.cpp:268
+msgid ""
+"4. Other key bindings:\n"
+" You can find out all key bindings definition of scim-anthy from \"Anthy\"\n"
+" section on setup window of SCIM or SKIM.\n"
+msgstr ""
+"4. その他のキーバインド:\n"
+" その他の全てのscim-anthyのキー定義は、SCIMあるいはSKIM設定ウィンドウの\n"
+" 「Anthy」セクションで見ることができます。\n"
+
+#: src/scim_anthy_setup.cpp:119
+msgid "Anthy"
+msgstr "Anthy"
+
+#: src/scim_anthy_setup.cpp:124
+msgid "An Anthy IMEngine Module."
+msgstr "Anthy IMEngineモジュール"
+
+#: src/scim_anthy_setup.cpp:184
+msgid "Mode keys"
+msgstr "モードキー"
+
+#: src/scim_anthy_setup.cpp:185
+msgid "Edit keys"
+msgstr "編集キー"
+
+#: src/scim_anthy_setup.cpp:186
+msgid "Caret keys"
+msgstr "キャレットキー"
+
+#: src/scim_anthy_setup.cpp:187
+msgid "Segments keys"
+msgstr "文節キー"
+
+#: src/scim_anthy_setup.cpp:188
+msgid "Candidates keys"
+msgstr "候補選択キー"
+
+#: src/scim_anthy_setup.cpp:189
+msgid "Direct select keys"
+msgstr "直接選択キー"
+
+#: src/scim_anthy_setup.cpp:190
+msgid "Convert keys"
+msgstr "変換キー"
+
+#: src/scim_anthy_setup.cpp:191
+msgid "Dictionary keys"
+msgstr "辞書関連キー"
+
+#: src/scim_anthy_setup.cpp:213
+msgid "Romaji typing method"
+msgstr "ローマ字入力方式"
+
+#: src/scim_anthy_setup.cpp:214
+msgid "Kana typing method"
+msgstr "かな入力方式"
+
+#: src/scim_anthy_setup.cpp:215
+msgid "Thumb shift typing method"
+msgstr "親指シフト入力方式"
+
+#: src/scim_anthy_setup.cpp:248 src/scim_anthy_setup.cpp:256
+msgid "Follow input mode"
+msgstr "入力モードに従う"
+
+#: src/scim_anthy_setup.cpp:249 src/scim_anthy_setup.cpp:257
+msgid "Wide"
+msgstr "全角"
+
+#: src/scim_anthy_setup.cpp:250 src/scim_anthy_setup.cpp:258
+msgid "Half"
+msgstr "半角"
+
+#: src/scim_anthy_setup.cpp:264 src/scim_anthy_prefs.cpp:740
+msgid "Do nothing"
+msgstr "なにもしない"
+
+#: src/scim_anthy_setup.cpp:265
+msgid "Start conversion"
+msgstr "変換を開始する"
+
+#: src/scim_anthy_setup.cpp:266 src/scim_anthy_setup.cpp:272
+#: src/scim_anthy_prefs.cpp:680
+msgid "Commit"
+msgstr "確定"
+
+#: src/scim_anthy_setup.cpp:273
+msgid "Clear"
+msgstr "クリア"
+
+#: src/scim_anthy_setup.cpp:279
+msgid "UTF-8"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:280
+msgid "EUC-JP"
+msgstr "EUC-JP"
+
+#: src/scim_anthy_setup.cpp:281
+msgid "EUC-JP-MS"
+msgstr "EUC-JP-MS"
+
+#: src/scim_anthy_setup.cpp:287
+msgid "No decoration"
+msgstr "装飾無し"
+
+#: src/scim_anthy_setup.cpp:288
+msgid "Underline"
+msgstr "下線"
+
+#: src/scim_anthy_setup.cpp:289
+msgid "Reverse"
+msgstr "反転"
+
+#: src/scim_anthy_setup.cpp:290
+msgid "Highlight"
+msgstr "強調"
+
+#: src/scim_anthy_setup.cpp:291
+msgid "String color"
+msgstr "文字色"
+
+#: src/scim_anthy_setup.cpp:292
+msgid "BG color"
+msgstr "背景色"
+
+#: src/scim_anthy_setup.cpp:293
+msgid "Both color"
+msgstr "文字色/背景色"
+
+#: src/scim_anthy_setup.cpp:805
+msgid "_Group:"
+msgstr "グループ(_G):"
+
+#: src/scim_anthy_setup.cpp:826
+msgid "Search by key"
+msgstr "キーで検索"
+
+#: src/scim_anthy_setup.cpp:830
+msgid "all"
+msgstr "全て"
+
+#: src/scim_anthy_setup.cpp:873
+msgid "Feature"
+msgstr "機能"
+
+#: src/scim_anthy_setup.cpp:882 src/scim_anthy_setup.cpp:1289
+msgid "Key bindings"
+msgstr "キーバインド"
+
+#: src/scim_anthy_setup.cpp:890
+msgid "Description"
+msgstr "説明"
+
+#: src/scim_anthy_setup.cpp:914
+msgid "Key bindings _theme:"
+msgstr "キーバインドテーマ:"
+
+#: src/scim_anthy_setup.cpp:928
+msgid "_Choose keys..."
+msgstr "キーを設定...(_C)"
+
+#: src/scim_anthy_setup.cpp:955
+msgid "<b>Enable/Disable learning</b>"
+msgstr "<b>学習の有効/無効</b>"
+
+#: src/scim_anthy_setup.cpp:982
+msgid "<b>Key preferences to commit with reversing learning preference</b>"
+msgstr "<b>学習設定とは逆の方法で確定するキーの設定</b>"
+
+#: src/scim_anthy_setup.cpp:1056 src/scim_anthy_setup.cpp:1070
+msgid "_Launch"
+msgstr "起動(_L)"
+
+#: src/scim_anthy_setup.cpp:1241
+#, c-format
+msgid ""
+"<span size=\"20000\">%s-%s</span>\n"
+"\n"
+"<span size=\"16000\" style=\"italic\">A Japanese input method module\n"
+"for SCIM using Anthy</span>\n"
+"\n"
+"\n"
+"\n"
+"<span size=\"12000\">Copyright 2005-2006, Takuro Ashie <ashie@homa.ne."
+"jp></span>"
+msgstr ""
+"<span size=\"20000\">%s-%s</span>\n"
+"\n"
+"<span size=\"16000\" style=\"italic\">Anthyを利用した\n"
+"SCIM用日本語入力モジュール</span>\n"
+"\n"
+"\n"
+"\n"
+"<span size=\"12000\">Copyright 2005-2006, Takuro Ashie <ashie@homa.ne."
+"jp></span>"
+
+#: src/scim_anthy_setup.cpp:1277
+msgid "Common"
+msgstr "一般"
+
+#: src/scim_anthy_setup.cpp:1283
+msgid "Symbols"
+msgstr "記号等"
+
+#: src/scim_anthy_setup.cpp:1295
+msgid "Romaji typing"
+msgstr "ローマ字入力"
+
+#: src/scim_anthy_setup.cpp:1301
+msgid "Kana typing"
+msgstr "かな入力"
+
+#: src/scim_anthy_setup.cpp:1307
+msgid "Prediction"
+msgstr "予測"
+
+#: src/scim_anthy_setup.cpp:1313
+msgid "Learning"
+msgstr "学習"
+
+#: src/scim_anthy_setup.cpp:1319
+msgid "Dictionary"
+msgstr "辞書"
+
+#: src/scim_anthy_setup.cpp:1325
+msgid "Candidates window"
+msgstr "候補ウィンドウ"
+
+#: src/scim_anthy_setup.cpp:1331
+msgid "Toolbar"
+msgstr "ツールバー"
+
+#: src/scim_anthy_setup.cpp:1337
+msgid "Appearance"
+msgstr "外観"
+
+#: src/scim_anthy_setup.cpp:1343
+msgid "About"
+msgstr "情報"
+
+#: src/scim_anthy_setup.cpp:1405 src/scim_anthy_setup_romaji.cpp:255
+#: src/scim_anthy_setup_kana.cpp:413 src/scim_anthy_setup_kana.cpp:480
+msgid "User defined"
+msgstr "ユーザー定義"
+
+#: src/scim_anthy_setup.cpp:1408 src/scim_anthy_setup_romaji.cpp:258
+#: src/scim_anthy_setup_kana.cpp:416 src/scim_anthy_setup_kana.cpp:483
+msgid "Default"
+msgstr "標準設定"
+
+#: src/scim_anthy_setup.cpp:2006
+msgid "Set key filter"
+msgstr "キ-フィルタ-をセット"
+
+#: src/scim_anthy_setup_romaji.cpp:124 src/scim_anthy_setup_romaji.cpp:195
+msgid "Romaji _table:"
+msgstr "ローマ字テーブル(_T):"
+
+#: src/scim_anthy_setup_romaji.cpp:137 src/scim_anthy_setup_kana.cpp:143
+#: src/scim_anthy_setup_kana.cpp:188
+msgid "_Customize..."
+msgstr "カスタマイズ...(_C)"
+
+#: src/scim_anthy_setup_romaji.cpp:177
+msgid "Sequence"
+msgstr "入力文字列"
+
+#: src/scim_anthy_setup_romaji.cpp:178 src/scim_anthy_setup_kana.cpp:263
+msgid "Result"
+msgstr "出力文字列"
+
+#: src/scim_anthy_setup_romaji.cpp:185
+msgid "Customize romaji table"
+msgstr "ローマ字テーブルのカスタマイズ"
+
+#: src/scim_anthy_setup_kana.cpp:114
+msgid "<b>JIS Kana Layout</b>"
+msgstr "<b>JISかな配列</b>"
+
+#: src/scim_anthy_setup_kana.cpp:130 src/scim_anthy_setup_kana.cpp:175
+msgid "La_yout:"
+msgstr "レイアウト(_Y):"
+
+#: src/scim_anthy_setup_kana.cpp:155
+msgid "<b>Thumb Shift Layout</b>"
+msgstr "<b>親指シフト配列</b>"
+
+#: src/scim_anthy_setup_kana.cpp:262 src/scim_anthy_setup_kana.cpp:332
+msgid "Key"
+msgstr "キー"
+
+#: src/scim_anthy_setup_kana.cpp:270
+msgid "Customize kana layout table"
+msgstr "かなレイアウトテーブルのカスタマイズ"
+
+#: src/scim_anthy_setup_kana.cpp:280 src/scim_anthy_setup_kana.cpp:352
+msgid "Layout _table:"
+msgstr "レイアウトテーブル(_T):"
+
+#: src/scim_anthy_setup_kana.cpp:333
+msgid "Single press"
+msgstr "単独打鍵"
+
+#: src/scim_anthy_setup_kana.cpp:334
+msgid "Left thumb shift"
+msgstr "左親指シフト"
+
+#: src/scim_anthy_setup_kana.cpp:335
+msgid "Right thumb shift"
+msgstr "右親指シフト"
+
+#: src/scim_anthy_setup_kana.cpp:342
+msgid "Customize thumb shift layout table"
+msgstr "親指シフトレイアウトテーブルのカスタマイズ"
+
+#: src/scim_anthy_prefs.cpp:35
+msgid "Show \"_Candidates\" label"
+msgstr "「候補一覧」ラベルを表示(_C)"
+
+#: src/scim_anthy_prefs.cpp:45
+msgid "Close candidate window when select a candidate _directly"
+msgstr "候補を直接選択した時に候補ウィンドウを閉じる(_D)"
+
+#: src/scim_anthy_prefs.cpp:55
+msgid "Learn on _manual committing"
+msgstr "手動確定時に学習する(_M)"
+
+#: src/scim_anthy_prefs.cpp:65
+msgid "Learn on a_uto committing"
+msgstr "自動確定時に学習する(_U)"
+
+#: src/scim_anthy_prefs.cpp:75
+msgid "Use half-width characters for _symbols"
+msgstr "記号は半角で入力する(_S)"
+
+#: src/scim_anthy_prefs.cpp:85
+msgid "Use half-width characters for _numbers"
+msgstr "数字は半角で入力する(_N)"
+
+#: src/scim_anthy_prefs.cpp:95
+msgid "A_llow spliting romaji on editing preedit string"
+msgstr "文字列編集時にローマ字を分割できるようにする(_L)"
+
+#: src/scim_anthy_prefs.cpp:97
+msgid "If this check is enabled, you can delete each letter."
+msgstr ""
+"このチェックが入っている場合,各文字単位で文字を削除することができます。"
+
+#: src/scim_anthy_prefs.cpp:104
+msgid "_Entering the pseudo ASCII input mode with capital letters."
+msgstr "大文字入力時に一時ASCIIモードに切り替える(_E)"
+
+#: src/scim_anthy_prefs.cpp:106
+msgid ""
+"If this check is enabled, capital letters will becomes a trigger to enter "
+"the pseudo ASCII input mode."
+msgstr ""
+"このチェックが入っている場合、大文字の入力は一時ASCIIモードへの切り替えのトリ"
+"ガーになります。"
+
+#: src/scim_anthy_prefs.cpp:113
+msgid "Insert a _blank with a blank key."
+msgstr "空白キーで空白を挿入する(_B)"
+
+#: src/scim_anthy_prefs.cpp:115
+msgid ""
+"If this check is enabled, a blank key will works to insert a blank when "
+"entering the pseudo ASCII input mode."
+msgstr ""
+"このチェックが入っている場合、一時ASCIIモード時に空白キーで空白を入力できるよ"
+"うになります。"
+
+#: src/scim_anthy_prefs.cpp:122
+msgid "_Show predicted candidates while inputting letters"
+msgstr "文字入力中に予測候補を表示する(_S)"
+
+#: src/scim_anthy_prefs.cpp:131
+msgid "Use _direct select keys while predicting"
+msgstr "予測中に直接選択キーを使用する(_D)"
+
+#: src/scim_anthy_prefs.cpp:140
+msgid "Show _input mode label"
+msgstr "入力モードラベルを表示(_I)"
+
+#: src/scim_anthy_prefs.cpp:150
+msgid "Show _conversion mode label"
+msgstr "変換モードラベルを表示(_C)"
+
+#: src/scim_anthy_prefs.cpp:160
+msgid "Show _typing method label"
+msgstr "入力方式ラベルを表示(_T)"
+
+#: src/scim_anthy_prefs.cpp:170
+msgid "Show _period style label"
+msgstr "句読点スタイルラベルを表示(_P)"
+
+#: src/scim_anthy_prefs.cpp:180
+msgid "Show _symbol style label"
+msgstr "記号スタイルラベルを表示(_S)"
+
+#: src/scim_anthy_prefs.cpp:190
+msgid "Show _dictionary menu label"
+msgstr "辞書メニューラベルを表示(_D)"
+
+#: src/scim_anthy_prefs.cpp:200
+msgid "Show _edit dictionary label"
+msgstr "辞書編集ラベルを表示(_E)"
+
+#: src/scim_anthy_prefs.cpp:210
+msgid "Show _add word label"
+msgstr "単語追加ラベルを表示(_A)"
+
+#: src/scim_anthy_prefs.cpp:235
+msgid "Number of candidates to show in a _page:"
+msgstr "1ページに表示する候補数(_P):"
+
+#: src/scim_anthy_prefs.cpp:238
+msgid ""
+"Specify the number of candidates to show in a page of the candidates window."
+msgstr "1ページに表示する候補数を指定します"
+
+#: src/scim_anthy_prefs.cpp:247
+msgid "Number of _triggers until show:"
+msgstr "表示開始までの変換キー押下数(_T):"
+
+#: src/scim_anthy_prefs.cpp:248
+msgid "[times]"
+msgstr "[回]"
+
+#: src/scim_anthy_prefs.cpp:250
+msgid ""
+"The number of times to press a conversion key until show the candidates "
+"window.Specify 0 to never show it."
+msgstr ""
+"候補ウィンドウを表示するまでに必要な変換キーの押下数です。0を指定すると候補"
+"ウィンドウを一切表示しません。"
+
+#: src/scim_anthy_prefs.cpp:260
+msgid "_Simultaneous pressing time:"
+msgstr "同時打鍵時間(_S):"
+
+#: src/scim_anthy_prefs.cpp:261
+msgid "[msec]"
+msgstr "[ミリ秒]"
+
+#: src/scim_anthy_prefs.cpp:263
+msgid "Time to regard as simultaneous key pressing."
+msgstr "同時打鍵とみなす時間"
+
+#: src/scim_anthy_prefs.cpp:286
+msgid "_Input mode: "
+msgstr "入力モード(_I):"
+
+#: src/scim_anthy_prefs.cpp:296
+msgid "Typing _method: "
+msgstr "入力方式(_M): "
+
+#: src/scim_anthy_prefs.cpp:306
+msgid "_Conversion mode: "
+msgstr "変換モード(_C):"
+
+#: src/scim_anthy_prefs.cpp:316
+msgid "St_yle of comma and period: "
+msgstr "句読点のスタイル(_Y): "
+
+#: src/scim_anthy_prefs.cpp:326
+msgid "Symb_ol input style: "
+msgstr "記号のスタイル(_O):"
+
+#: src/scim_anthy_prefs.cpp:336
+msgid "_Space type: "
+msgstr "空白のタイプ(_S): "
+
+#: src/scim_anthy_prefs.cpp:346
+msgid "Input from _ten key: "
+msgstr "テンキーからの入力(_T):"
+
+#: src/scim_anthy_prefs.cpp:356
+msgid "_Behavior on a comma or a period:"
+msgstr "句読点入力時の挙動(_B):"
+
+#: src/scim_anthy_prefs.cpp:366
+msgid "_Behavior on focus out:"
+msgstr "フォーカスアウト時の挙動(_B):"
+
+#: src/scim_anthy_prefs.cpp:376
+msgid "_Left thumb shift keys:"
+msgstr "左親指シフトキー(_L):"
+
+#: src/scim_anthy_prefs.cpp:386
+msgid "_Right thumb shift keys:"
+msgstr "右親指シフトキー(_R):"
+
+#: src/scim_anthy_prefs.cpp:396
+msgid "_Commit:"
+msgstr "確定(_C):"
+
+#: src/scim_anthy_prefs.cpp:397 src/scim_anthy_prefs.cpp:681
+msgid "Select commit keys"
+msgstr "確定キーの設定"
+
+#: src/scim_anthy_prefs.cpp:398
+msgid ""
+"The key events to commit the preedit string with reversing the preference of "
+"learning. "
+msgstr "学習設定とは逆の方法で文字列を確定するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:407
+msgid "Commit the _first segment:"
+msgstr "最初の文節を確定(_F):"
+
+#: src/scim_anthy_prefs.cpp:408 src/scim_anthy_prefs.cpp:880
+msgid "Select keys to commit the first segment"
+msgstr "最初の文節を確定するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:409
+msgid ""
+"The key events to commit the first segment with reversing the preference of "
+"learning. "
+msgstr "学習設定とは逆の方法で最初の文節を確定するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:418
+msgid "Commit the _selected segment:"
+msgstr "選択文節を確定(_S):"
+
+#: src/scim_anthy_prefs.cpp:419 src/scim_anthy_prefs.cpp:890
+msgid "Select keys to commit the selected segment"
+msgstr "選択文節を確定するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:420
+msgid ""
+"The key events to commit the selected segment with reversing the preference "
+"of learning. "
+msgstr "学習設定とは逆の方法で選択文節を確定するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:429
+msgid "En_coding of dictionary:"
+msgstr "辞書のエンコーディング(_C):"
+
+#: src/scim_anthy_prefs.cpp:431
+msgid ""
+"If you choose \"EUC-JP-MS\", interoperatability of documents created on this "
+"system with Microsoft Windows may improve, but it depends on the "
+"implementation of your operating system and actual encoding of your "
+"dictionary."
+msgstr ""
+"\"EUC-JP-MS\"を選択すると、このシステムで作成されたドキュメントのMicrosoft "
+"Windowsとの相互運用性が向上するかもしれません。しかし、これはオペレーティング"
+"システムの実装と、辞書の実際のエンコーディングに依存します。"
+
+#: src/scim_anthy_prefs.cpp:442
+msgid "\"_Edit dictionary\" command:"
+msgstr "辞書編集コマンド(_E):"
+
+#: src/scim_anthy_prefs.cpp:452
+msgid "\"_Add word\" command:"
+msgstr "単語追加コマンド(_A):"
+
+#: src/scim_anthy_prefs.cpp:462
+msgid "_Preedit string:"
+msgstr "編集文字列(_P):"
+
+#: src/scim_anthy_prefs.cpp:472
+msgid "_Conversion string:"
+msgstr "変換文字列(_C):"
+
+#: src/scim_anthy_prefs.cpp:482
+msgid "_Selected segment:"
+msgstr "選択文節(_S):"
+
+#: src/scim_anthy_prefs.cpp:506
+msgid "Toggle on/off"
+msgstr "ON/OFF切り替え"
+
+#: src/scim_anthy_prefs.cpp:507
+msgid "Select toggle on/off keys"
+msgstr "ON/OFFキーの設定"
+
+#: src/scim_anthy_prefs.cpp:508
+msgid "The key events to toggle on/off Japanese mode. "
+msgstr "日本語モードをオン/オフするキーイベント"
+
+#: src/scim_anthy_prefs.cpp:516
+msgid "Circle input mode"
+msgstr "入力モード循環"
+
+#: src/scim_anthy_prefs.cpp:517
+msgid "Select circle input mode keys"
+msgstr "入力モード循環キーの設定"
+
+#: src/scim_anthy_prefs.cpp:518
+msgid "The key events to circle input mode. "
+msgstr "次の入力モードを選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:526
+msgid "Circle kana mode"
+msgstr "かなモード循環"
+
+#: src/scim_anthy_prefs.cpp:527
+msgid "Select circle kana mode keys"
+msgstr "かなモード循環キーの設定"
+
+#: src/scim_anthy_prefs.cpp:528
+msgid "The key events to circle kana mode. "
+msgstr "次のかなモードを選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:536
+msgid "Latin mode"
+msgstr "英数モード"
+
+#: src/scim_anthy_prefs.cpp:537
+msgid "Select Latin mode keys"
+msgstr "英数モードキーの設定"
+
+#: src/scim_anthy_prefs.cpp:538
+msgid "The key events to switch input mode to Latin. "
+msgstr "英数モードへ切り替えるキーイベント"
+
+#: src/scim_anthy_prefs.cpp:546
+msgid "Wide Latin mode"
+msgstr "全角英数モード"
+
+#: src/scim_anthy_prefs.cpp:547
+msgid "Select wide Latin mode keys"
+msgstr "全角英数モードキーの設定"
+
+#: src/scim_anthy_prefs.cpp:548
+msgid "The key events to switch input mode to wide Latin. "
+msgstr "全角英数モードへ切り替えるキーイベント"
+
+#: src/scim_anthy_prefs.cpp:556
+msgid "Hiragana mode"
+msgstr "ひらがなモード"
+
+#: src/scim_anthy_prefs.cpp:557
+msgid "Select hiragana mode keys"
+msgstr "ひらがなモードキーの設定"
+
+#: src/scim_anthy_prefs.cpp:558
+msgid "The key events to switch input mode to hiragana. "
+msgstr "ひらがなモードへ切り替えるキーイベント"
+
+#: src/scim_anthy_prefs.cpp:566
+msgid "Katakana mode"
+msgstr "カタカナモード"
+
+#: src/scim_anthy_prefs.cpp:567
+msgid "Select katakana mode keys"
+msgstr "カタカナモードキーの設定"
+
+#: src/scim_anthy_prefs.cpp:568
+msgid "The key events to switch input mode to katakana. "
+msgstr "カタカナモードキーへ切り替えるキーイベント"
+
+#: src/scim_anthy_prefs.cpp:576
+msgid "Half katakana mode"
+msgstr "半角カタカナモード"
+
+#: src/scim_anthy_prefs.cpp:577
+msgid "Select half katakana mode keys"
+msgstr "半角カタカナモードキーの設定"
+
+#: src/scim_anthy_prefs.cpp:578
+msgid "The key events to switch input mode to half katakana. "
+msgstr "半角カタカナモードキーへ切り替えるキーイベント"
+
+#: src/scim_anthy_prefs.cpp:586
+msgid "Pseudo ASCII mode cancel"
+msgstr "一時ASCIIモードキャンセル"
+
+#: src/scim_anthy_prefs.cpp:587
+msgid "Select pseudo ASCII mode cancel key"
+msgstr "一時ASCIIモードキャンセルキーの設定"
+
+#: src/scim_anthy_prefs.cpp:588
+msgid "The key events to cancel the pseudo ASCII mode."
+msgstr "一時ASCIIモードをキャンセルするキーイベント"
+
+#: src/scim_anthy_prefs.cpp:596
+msgid "Circle typing method"
+msgstr "入力方式切り替え"
+
+#: src/scim_anthy_prefs.cpp:597
+msgid "Select circle typing method keys"
+msgstr "入力方式切り替えキーの設定"
+
+#: src/scim_anthy_prefs.cpp:598
+msgid "The key events to circle typing method. "
+msgstr "入力方式を切り替えるキーイベント"
+
+#: src/scim_anthy_prefs.cpp:620
+msgid "Insert space"
+msgstr "空白を挿入"
+
+#: src/scim_anthy_prefs.cpp:621
+msgid "Select inserting space keys"
+msgstr "空白を挿入するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:622
+msgid "The key events to insert a space. "
+msgstr "空白を挿入するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:630
+msgid "Insert alternative space"
+msgstr "別幅空白を挿入"
+
+#: src/scim_anthy_prefs.cpp:631
+msgid "Select inserting alternative space keys"
+msgstr "別幅空白を挿入するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:632
+msgid "The key events to insert a alternative space. "
+msgstr "別幅空白を挿入するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:640
+msgid "Insert half space"
+msgstr "半角空白を挿入"
+
+#: src/scim_anthy_prefs.cpp:641
+msgid "Select inserting half width space keys"
+msgstr "半角空白を挿入するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:642
+msgid "The key events to insert a half width space. "
+msgstr "半角空白を挿入するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:650
+msgid "Insert wide space"
+msgstr "全角空白を挿入"
+
+#: src/scim_anthy_prefs.cpp:651
+msgid "Select inserting wide space keys"
+msgstr "全角空白を挿入するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:652
+msgid "The key events to insert a wide space. "
+msgstr "全角空白を挿入するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:660
+msgid "Backspace"
+msgstr "バックスペース"
+
+#: src/scim_anthy_prefs.cpp:661
+msgid "Select backspace keys"
+msgstr "バックスペースキーの設定"
+
+#: src/scim_anthy_prefs.cpp:662
+msgid "The key events to delete a character before caret. "
+msgstr "キャレットの前の文字を削除するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:670
+msgid "Delete"
+msgstr "削除"
+
+#: src/scim_anthy_prefs.cpp:671
+msgid "Select delete keys"
+msgstr "削除キーの設定"
+
+#: src/scim_anthy_prefs.cpp:672
+msgid "The key events to delete a character after caret. "
+msgstr "キャレットの後の文字を削除するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:682
+msgid "The key events to commit the preedit string. "
+msgstr "文字列を確定するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:690
+msgid "Convert"
+msgstr "変換"
+
+#: src/scim_anthy_prefs.cpp:691
+msgid "Select convert keys"
+msgstr "変換キーの設定"
+
+#: src/scim_anthy_prefs.cpp:692
+msgid "The key events to convert the preedit string to kanji. "
+msgstr "文字列を漢字に変換するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:700
+msgid "Predict"
+msgstr "予測"
+
+#: src/scim_anthy_prefs.cpp:701
+msgid "Select predict keys"
+msgstr "予測キーの設定"
+
+#: src/scim_anthy_prefs.cpp:702
+msgid ""
+"The key events to predict a word or sentence from already inserted text. "
+msgstr "入力された文字列から単語や文を予測するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:710
+msgid "Cancel"
+msgstr "キャンセル"
+
+#: src/scim_anthy_prefs.cpp:711
+msgid "Select cancel keys"
+msgstr "キャンセルキーの設定"
+
+#: src/scim_anthy_prefs.cpp:712
+msgid "The key events to cancel preediting or converting. "
+msgstr "文字変換や文字入力をキャンセルするキーイベント"
+
+#: src/scim_anthy_prefs.cpp:720
+msgid "Cancel all"
+msgstr "全てキャンセル"
+
+#: src/scim_anthy_prefs.cpp:721
+msgid "Select cancel all keys"
+msgstr "全てをキャンセルするキーの設定"
+
+#: src/scim_anthy_prefs.cpp:722
+msgid "The key events to return to initial state. "
+msgstr "初期状態へ戻るキーイベント"
+
+#: src/scim_anthy_prefs.cpp:730
+msgid "Reconvert"
+msgstr "再変換"
+
+#: src/scim_anthy_prefs.cpp:731
+msgid "Select reconvert keys"
+msgstr "再変換キーの設定"
+
+#: src/scim_anthy_prefs.cpp:732
+msgid "The key events to reconvert the commited string in selection. "
+msgstr "セレクション内の確定済み文字列を再変換するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:741
+msgid "Select do nothing keys"
+msgstr "なにもしないキーの設定"
+
+#: src/scim_anthy_prefs.cpp:742
+msgid ""
+"The key events to eat and do nothing anymore. For example, it can be used to "
+"disable space key completely."
+msgstr ""
+"アプリケーションに渡さず、それ以上何もしないキーイベント。例えば、スペース"
+"キーを完全に無効にしたいときに指定します。"
+
+#: src/scim_anthy_prefs.cpp:765
+msgid "Move to first"
+msgstr "最初へ移動"
+
+#: src/scim_anthy_prefs.cpp:766
+msgid "Select move caret to first keys"
+msgstr "最初へ移動するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:767
+msgid "The key events to move the caret to the first of preedit string. "
+msgstr "キャレットを文字列の先頭に移動するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:775
+msgid "Move to last"
+msgstr "最後へ移動"
+
+#: src/scim_anthy_prefs.cpp:776
+msgid "Select move caret to last keys"
+msgstr "最後へ移動するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:777
+msgid "The key events to move the caret to the last of the preedit string. "
+msgstr "キャレットを文字列の最後に移動するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:785
+msgid "Move forward"
+msgstr "前方へ移動"
+
+#: src/scim_anthy_prefs.cpp:786
+msgid "Select move caret forward keys"
+msgstr "前方へ移動するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:787
+msgid "The key events to move the caret forward. "
+msgstr "キャレットを前方に移動するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:795
+msgid "Move backward"
+msgstr "後方へ移動"
+
+#: src/scim_anthy_prefs.cpp:796
+msgid "Select move caret backward keys"
+msgstr "後方へ移動するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:797
+msgid "The key events to move the caret backward. "
+msgstr "キャレットを後方へ移動するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:819
+msgid "Select the first segment"
+msgstr "最初の文節を選択"
+
+#: src/scim_anthy_prefs.cpp:820
+msgid "Select keys to select the first segment"
+msgstr "最初の文節を選択するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:821
+msgid "The key events to select the first segment. "
+msgstr "最初の文節を選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:829
+msgid "Select the last segment"
+msgstr "最後の文節を選択"
+
+#: src/scim_anthy_prefs.cpp:830
+msgid "Select keys to select the last segment"
+msgstr "最後の文節を選択するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:831
+msgid "The key events to select the the last segment. "
+msgstr "最後の文節を選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:839
+msgid "Select the next segment"
+msgstr "次の文節を選択"
+
+#: src/scim_anthy_prefs.cpp:840
+msgid "Select keys to select the next segment"
+msgstr "次の文節を選択するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:841
+msgid "The key events to select the next segment. "
+msgstr "次の文節を選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:849
+msgid "Select the previous segment"
+msgstr "前の文節を選択"
+
+#: src/scim_anthy_prefs.cpp:850
+msgid "Select keys to select the previous segment"
+msgstr "前の文節を選択するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:851
+msgid "The key events to select the previous segment. "
+msgstr "前の文節を選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:859
+msgid "Shrink the segment"
+msgstr "文節を縮める"
+
+#: src/scim_anthy_prefs.cpp:860
+msgid "Select keys to shrink the segment"
+msgstr "文節を縮めるキーの設定"
+
+#: src/scim_anthy_prefs.cpp:861
+msgid "The key events to shrink the selected segment. "
+msgstr "文節を縮めるキーイベント"
+
+#: src/scim_anthy_prefs.cpp:869
+msgid "Expand the segment"
+msgstr "文節を広げる"
+
+#: src/scim_anthy_prefs.cpp:870
+msgid "Select keys to expand the segment"
+msgstr "文節を広げるキーの設定"
+
+#: src/scim_anthy_prefs.cpp:871
+msgid "The key events to expand the selected segment. "
+msgstr "文節を広げるキーイベント"
+
+#: src/scim_anthy_prefs.cpp:879
+msgid "Commit the first segment"
+msgstr "最初の文節を確定"
+
+#: src/scim_anthy_prefs.cpp:881
+msgid "The key events to commit the first segment. "
+msgstr "最初の文節を確定するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:889
+msgid "Commit the selected segment"
+msgstr "選択文節を確定"
+
+#: src/scim_anthy_prefs.cpp:891
+msgid "The key events to commit the selected segment. "
+msgstr "選択文節を確定するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:913
+msgid "First candidate"
+msgstr "最初の候補"
+
+#: src/scim_anthy_prefs.cpp:914
+msgid "Select the first candidate keys"
+msgstr "最初の候補へ移動するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:915
+msgid "The key events to select the first candidate. "
+msgstr "最初の候補を選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:923
+msgid "Last candidate"
+msgstr "最後の候補"
+
+#: src/scim_anthy_prefs.cpp:924
+msgid "Select the last candidate keys"
+msgstr "最後の候補へ移動するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:925
+msgid "The key events to the select last candidate. "
+msgstr "最後の候補を選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:933
+msgid "Next candidate"
+msgstr "次の候補"
+
+#: src/scim_anthy_prefs.cpp:934
+msgid "Select the next candidate keys"
+msgstr "次の候補へ移動するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:935
+msgid "The key events to select the next candidate. "
+msgstr "次の候補を選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:943
+msgid "Previous candidate"
+msgstr "前の候補"
+
+#: src/scim_anthy_prefs.cpp:944
+msgid "Select the previous candidate keys"
+msgstr "前の候補へ移動するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:945
+msgid "The key events to select the previous candidate. "
+msgstr "前の候補を選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:953
+msgid "Page up"
+msgstr "前のページへ移動"
+
+#: src/scim_anthy_prefs.cpp:954
+msgid "Select page up candidates keys"
+msgstr "前の候補ページへ移動するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:955
+msgid "The key events to switch candidates page up. "
+msgstr "前の候補ページへ移動するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:963
+msgid "Page down"
+msgstr "次のページへ移動"
+
+#: src/scim_anthy_prefs.cpp:964
+msgid "Select page down candidates keys"
+msgstr "次の候補ページへ移動するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:965
+msgid "The key events to switch candidates page down. "
+msgstr "次の候補ページへ移動するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:987
+msgid "1st candidate"
+msgstr "1番目の候補"
+
+#: src/scim_anthy_prefs.cpp:988
+msgid "Select keys to select 1st candidate"
+msgstr "1番目の候補を選択するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:989
+msgid "The key events to select the 1st candidate. "
+msgstr "1番目の候補を選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:997
+msgid "2nd candidate"
+msgstr "2番目の候補"
+
+#: src/scim_anthy_prefs.cpp:998
+msgid "Select keys to select 2nd candidate"
+msgstr "2番目の候補を選択するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:999
+msgid "The key events to select the 2nd candidate. "
+msgstr "2番得目の候補を選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:1007
+msgid "3rd candidate"
+msgstr "3番目の候補"
+
+#: src/scim_anthy_prefs.cpp:1008
+msgid "Select keys to select 3rd candidate"
+msgstr "3番目の候補を選択するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:1009
+msgid "The key events to select the 3rd candidate. "
+msgstr "3番得目の候補を選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:1017
+msgid "4th candidate"
+msgstr "4番目の候補"
+
+#: src/scim_anthy_prefs.cpp:1018
+msgid "Select keys to select 4th candidate"
+msgstr "4番目の候補を選択するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:1019
+msgid "The key events to select the 4th candidate. "
+msgstr "4番目の候補を選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:1027
+msgid "5th candidate"
+msgstr "5番目の候補"
+
+#: src/scim_anthy_prefs.cpp:1028
+msgid "Select keys to select 5th candidate"
+msgstr "5番目の候補を選択するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:1029
+msgid "The key events to select the 5th candidate. "
+msgstr "5番目の候補を選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:1037
+msgid "6th candidate"
+msgstr "6番目の候補"
+
+#: src/scim_anthy_prefs.cpp:1038
+msgid "Select keys to select 6th candidate"
+msgstr "6番目の候補を選択するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:1039
+msgid "The key events to select the 6th candidate. "
+msgstr "6番目の候補を選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:1047
+msgid "7th candidate"
+msgstr "7番目の候補"
+
+#: src/scim_anthy_prefs.cpp:1048
+msgid "Select keys to select 7th candidate"
+msgstr "7番目の候補を選択するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:1049
+msgid "The key events to select the 7th candidate. "
+msgstr "7番目の候補を選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:1057
+msgid "8th candidate"
+msgstr "8番目の候補"
+
+#: src/scim_anthy_prefs.cpp:1058
+msgid "Select keys to select 8th candidate"
+msgstr "8番目の候補を選択するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:1059
+msgid "The key events to select the 8th candidate. "
+msgstr "8番目の候補を選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:1067
+msgid "9th candidate"
+msgstr "9番目の候補"
+
+#: src/scim_anthy_prefs.cpp:1068
+msgid "Select keys to select 9th candidate"
+msgstr "9番目の候補を選択するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:1069
+msgid "The key events to select the 9th candidate. "
+msgstr "9番目の候補を選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:1077
+msgid "10th candidate"
+msgstr "10番目の候補"
+
+#: src/scim_anthy_prefs.cpp:1078
+msgid "Select keys to select 10th candidate"
+msgstr "10番目の候補を選択するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:1079
+msgid "The key events to select the 10th candidate. "
+msgstr "10番目の候補を選択するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:1101
+msgid "Convert character type forward"
+msgstr "次の文字種に変換"
+
+#: src/scim_anthy_prefs.cpp:1102
+msgid "Select keys to convert character type forward"
+msgstr "次の文字種に変換するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:1103
+msgid "Rotate character type forward."
+msgstr "文字種を次に変換"
+
+#: src/scim_anthy_prefs.cpp:1111
+msgid "Convert character type backward"
+msgstr "前の文字種に変換"
+
+#: src/scim_anthy_prefs.cpp:1112
+msgid "Select keys to convert character type backward"
+msgstr "前の文字種に変換するキーの設定"
+
+#: src/scim_anthy_prefs.cpp:1113
+msgid "Rotate character type backward."
+msgstr "前の文字種に変換"
+
+#: src/scim_anthy_prefs.cpp:1121
+msgid "Convert to hiragana"
+msgstr "ひらがな変換"
+
+#: src/scim_anthy_prefs.cpp:1122
+msgid "Select keys to convert to hiragana"
+msgstr "ひらがな変換キーの設定"
+
+#: src/scim_anthy_prefs.cpp:1123
+msgid "The key events to convert the preedit string to hiragana. "
+msgstr "文字列をひらがなへ変換するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:1131
+msgid "Convert to katakana"
+msgstr "カタカナ変換"
+
+#: src/scim_anthy_prefs.cpp:1132
+msgid "Select keys to convert to katakana"
+msgstr "カタカナ変換キーの設定"
+
+#: src/scim_anthy_prefs.cpp:1133
+msgid "The key events to convert the preedit string to katakana. "
+msgstr "文字列をカタカナへ変換するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:1141
+msgid "Convert to half width"
+msgstr "半角変換"
+
+#: src/scim_anthy_prefs.cpp:1142
+msgid "Select keys to convert to half width"
+msgstr "半角変換キーの設定"
+
+#: src/scim_anthy_prefs.cpp:1143
+msgid "The key events to convert the preedit string to half width. "
+msgstr "文字列を半角へ変換するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:1151
+msgid "Convert to half katakana"
+msgstr "半角カタカナ変換"
+
+#: src/scim_anthy_prefs.cpp:1152
+msgid "Select keys to convert to half width katakana"
+msgstr "半角カタカナ変換キーの設定"
+
+#: src/scim_anthy_prefs.cpp:1153
+msgid "The key events to convert the preedit string to half width katakana. "
+msgstr "文字列を半角カタカナへ変換するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:1161
+msgid "Convert to wide latin"
+msgstr "全角英数変換"
+
+#: src/scim_anthy_prefs.cpp:1162
+msgid "Select keys to convert to wide latin"
+msgstr "全角英数変換キーの設定"
+
+#: src/scim_anthy_prefs.cpp:1163
+msgid "The key events to convert the preedit string to wide latin. "
+msgstr "文字列を全角英数へ変換するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:1171
+msgid "Convert to latin"
+msgstr "英数変換"
+
+#: src/scim_anthy_prefs.cpp:1172
+msgid "Select keys to convert to latin"
+msgstr "英数変換キーの設定"
+
+#: src/scim_anthy_prefs.cpp:1173
+msgid "The key events to convert the preedit string to latin. "
+msgstr "文字列を英数へ変換するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:1195
+msgid "Edit dictionary"
+msgstr "辞書を編集"
+
+#: src/scim_anthy_prefs.cpp:1196
+msgid "Select edit dictionary keys"
+msgstr "辞書編集キーの設定"
+
+#: src/scim_anthy_prefs.cpp:1197
+msgid "The key events to launch dictionary administration tool. "
+msgstr "辞書管理ツールを起動するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:1206
+msgid "Select add a word keys"
+msgstr "単語追加キーの設定"
+
+#: src/scim_anthy_prefs.cpp:1207
+msgid "The key events to launch the tool to add a word. "
+msgstr "単語追加ツールを起動するキーイベント"
+
+#: src/scim_anthy_prefs.cpp:1232 src/scim_anthy_prefs.cpp:1245
+#: src/scim_anthy_prefs.cpp:1258
+msgid "Color:"
+msgstr "色:"
+
+#: src/scim_anthy_prefs.cpp:1233 src/scim_anthy_prefs.cpp:1234
+msgid "The color of preediting text"
+msgstr "編集文字列の色"
+
+#: src/scim_anthy_prefs.cpp:1246 src/scim_anthy_prefs.cpp:1247
+msgid "The color of conversion text"
+msgstr "変換文字列の色"
+
+#: src/scim_anthy_prefs.cpp:1259
+msgid "The color of selected segment text"
+msgstr "選択文節の色"
+
+#: src/scim_anthy_prefs.cpp:1260
+msgid "The color of selected segment text in the conversion text"
+msgstr "変換文字列内の選択文節の色"
+
+#: src/scim_anthy_color_button.cpp:320
+msgid "Foreground color"
+msgstr "前景色"
+
+#: src/scim_anthy_color_button.cpp:320
+msgid "Background color"
+msgstr "背景色"
+
+#~ msgid "<b>NICOLA Layout</b>"
+#~ msgstr "<b>NICOLA配列</b>"
+
+#~ msgid "Customize NICOLA table"
+#~ msgstr "NICOLAテーブルのカスタマイズ"
+
+#~ msgid "NICOLA _table:"
+#~ msgstr "NICOLAテーブル(_T):"
+
+#~ msgid "NICOLA time:"
+#~ msgstr "NICOLAタイム:"
+
+#~ msgid "NICOLA time"
+#~ msgstr "NICOLAタイム"
+
+#~ msgid ""
+#~ "Copyright (C) 2004,2005 Takuro Ashie <ashie@homa.ne.jp>\n"
+#~ "Copyright (C) 2004,2005 Hiroyuki Ikezoe <poincare@ikezoe.net>"
+#~ msgstr ""
+#~ "Copyright (C) 2004,2005 Takuro Ashie <ashie@homa.ne.jp>\n"
+#~ "Copyright (C) 2004,2005 Hiroyuki Ikezoe <poincare@ikezoe.net>"
+
+#~ msgid "The key events to toggle wide latin mode. "
+#~ msgstr "全角英数モードをオン/オフするキーイベント"
+
+#~ msgid "La_yout (Not implemented yet):"
+#~ msgstr "レイアウト(未実装)(_Y):"
+
+#~ msgid "Pending"
+#~ msgstr "保留文字列"
+
+#~ msgid "_Sequence:"
+#~ msgstr "入力文字列(_S):"
+
+#~ msgid "_Result:"
+#~ msgstr "出力文字列(_R):"
+
+#~ msgid "None"
+#~ msgstr "なし"
+
+#~ msgid "Style of selected segment:"
+#~ msgstr "選択文節のスタイル:"
+
+#~ msgid "Style of preedit:"
+#~ msgstr "編集文字列のスタイル:"
+
+#~ msgid "The color of preediting text in the preedition"
+#~ msgstr "編集文字列の色"
+
+#~ msgid "Options"
+#~ msgstr "オプション"
+
+#~ msgid "The key events to select page up candidates. "
+#~ msgstr "前の候補ページへ移動するキーイベント"
+
+#~ msgid "The key events to select page down candidates. "
+#~ msgstr "次の候補ページへ移動するキーイベント"
+
+#~ msgid "Convert keys:"
+#~ msgstr "変換:"
+
+#~ msgid "First segment keys:"
+#~ msgstr "最初の文節:"
+
+#~ msgid "Last segment keys:"
+#~ msgstr "最後の文節:"
+
+#~ msgid "Next segment keys:"
+#~ msgstr "次の文節:"
+
+#~ msgid "Previous segment keys:"
+#~ msgstr "前の文節:"
+
+#~ msgid "Select commiting the first segment keys"
+#~ msgstr "最初の文節を確定するキーの設定"
+
+#~ msgid "Next keys:"
+#~ msgstr "次へ移動:"
+
+#~ msgid "Previous keys:"
+#~ msgstr "前へ移動:"
+
+#~ msgid "Hiragana keys:"
+#~ msgstr "ひらがな変換:"
+
+#~ msgid "Katakana keys:"
+#~ msgstr "カタカナ変換:"
+
+#~ msgid "Half width keys:"
+#~ msgstr "半角カタカナ変換:"
+
+#~ msgid "Latin keys:"
+#~ msgstr "英数変換:"
+
+#~ msgid "Wide latin keys:"
+#~ msgstr "全角英数変換:"
+
+#~ msgid "Edit dictionary keys:"
+#~ msgstr "辞書編集:"
+
+#~ msgid "Add a word keys:"
+#~ msgstr "単語追加:"
+
+#~ msgid "Candidates keys (Direct select)"
+#~ msgstr "候補選択キー (直接選択)"
--- /dev/null
+s/"\([^"]*\)"/“\1”/g
+s/`\([^`']*\)'/‘\1’/g
+s/ '\([^`']*\)' / ‘\1’ /g
+s/ '\([^`']*\)'$/ ‘\1’/g
+s/^'\([^`']*\)' /‘\1’ /g
+s/“”/""/g
--- /dev/null
+# Sed script that remove the POT-Creation-Date line in the header entry
+# from a POT file.
+#
+# The distinction between the first and the following occurrences of the
+# pattern is achieved by looking at the hold space.
+/^"POT-Creation-Date: .*"$/{
+x
+# Test if the hold space is empty.
+s/P/P/
+ta
+# Yes it was empty. First occurrence. Remove the line.
+g
+d
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Takuro Ashie <ashie@homa.ne.jp>
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: ashie@homa.ne.jp\n"
+"POT-Creation-Date: 2009-01-15 12:04+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/scim_anthy_imengine.cpp:488
+#, c-format
+msgid "Candidates (%d/%d)"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:565
+msgid "Input mode"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:569 src/scim_anthy_setup.cpp:203
+msgid "Hiragana"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:573 src/scim_anthy_setup.cpp:204
+msgid "Katakana"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:577 src/scim_anthy_imengine.cpp:578
+#: src/scim_anthy_setup.cpp:205
+msgid "Half width katakana"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:582 src/scim_anthy_setup.cpp:206
+msgid "Latin"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:582
+msgid "Direct input"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:586 src/scim_anthy_setup.cpp:207
+msgid "Wide latin"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:592
+msgid "Typing method"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:596
+msgid "Romaji"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:600
+msgid "Kana"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:604
+msgid "Thumb shift"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:611
+msgid "Conversion mode"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:615 src/scim_anthy_imengine.cpp:616
+#: src/scim_anthy_setup.cpp:221
+msgid "Multi segment"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:620 src/scim_anthy_imengine.cpp:621
+#: src/scim_anthy_setup.cpp:222
+msgid "Single segment"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:625 src/scim_anthy_imengine.cpp:627
+#: src/scim_anthy_setup.cpp:223
+msgid "Convert as you type (Multi segment)"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:631 src/scim_anthy_imengine.cpp:633
+#: src/scim_anthy_setup.cpp:224
+msgid "Convert as you type (Single segment)"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:640
+msgid "Period style"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:669
+msgid "Symbol style"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:717
+msgid "Dictionary menu"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:722
+msgid "Edit the dictionary"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:724
+msgid "Launch the dictionary administration tool."
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:730 src/scim_anthy_prefs.cpp:1205
+msgid "Add a word"
+msgstr ""
+
+#: src/scim_anthy_imengine.cpp:732
+msgid "Add a word to the dictionary."
+msgstr ""
+
+#: src/scim_anthy_factory.cpp:195
+msgid ""
+"Authors of scim-anthy:\n"
+" Copyright (C) 2004,2005 Takuro Ashie <ashie@homa.ne.jp>\n"
+" Copyright (C) 2004,2005 Hiroyuki Ikezoe <poincare@ikezoe.net>\n"
+" \n"
+"Authors of Anthy:\n"
+" Copyright (C) 2000-2005 Yusuke TABATA <yusuke@w5.dion.ne.jp>\n"
+" Copyright (C) 2004-2005 Yuichi YOSHIDA <oxy@kmc.gr.jp>\n"
+" You can find out all credits of Anthy from AUTHORS file in Anthy package.\n"
+msgstr ""
+
+#: src/scim_anthy_factory.cpp:211
+msgid ""
+"Art work:\n"
+" SHIMODA Hiroshi <piro@p.club.ne.jp>\n"
+"\n"
+"Translation:\n"
+" Gerrit Sangel <z0idberg@gmx.de>\n"
+"Special thanks:\n"
+" UTUMI Hirosi <utuhiro78@yahoo.co.jp>\n"
+" Yukiko Bando <ybando@k6.dion.ne.jp>\n"
+" Mike Fabian <mfabian@suse.de>\n"
+" David Oftedal <david@start.no>\n"
+" Ryo Dairiki <ryo-dairiki@users.sourceforge.net>\n"
+" Seiichi SATO\n"
+" AWASHIRO Ikuya <ikuya@oooug.jp>\n"
+" Hatuka*nezumi <nezumi@jca.apc.org>\n"
+" Teppei Tamra <tam-t@par.odn.ne.jp>\n"
+" Akira TAGOH <at@gclab.org>\n"
+" Tatsuki Sugiura <sugi@nemui.org>\n"
+" Takashi Nakamoto <bluedwarf@bpost.plala.or.jp>"
+msgstr ""
+
+#: src/scim_anthy_factory.cpp:236
+msgid ""
+"Basic operation:\n"
+" \n"
+msgstr ""
+
+#: src/scim_anthy_factory.cpp:240
+msgid ""
+"1. Switch input mode:\n"
+" You can switch on/off Japanese input mode by pressing Zenkaku_Hankaku key\n"
+" or Control+J. Or you can rotate all input modes by pressing Control+,\n"
+" (comma).\n"
+" \n"
+msgstr ""
+
+#: src/scim_anthy_factory.cpp:247
+msgid ""
+"2. Input Japanese hiragana and katakana:\n"
+" You can input Japanese hiragana and katakana by inputting romaji.\n"
+" The Romaji table can be found out from the \"Anthy\" section of the setup\n"
+" window in SCIM or SKIM.\n"
+" If you want to hiragana and katakana directly by using Japanese keyboard,\n"
+" please press Alt + Romaji key or Conrol+\\ key to switch typing method.\n"
+" \n"
+msgstr ""
+
+#: src/scim_anthy_factory.cpp:256
+msgid ""
+"3. Convert hiragana or katakana to Japanese kanji\n"
+" After inputting hiragana or katakana, you can convert it to Japanese\n"
+" kanji by pressing Space key. Then it will show some candidates. You can\n"
+" select the next candidate by pressing Space key, and can commit it by\n"
+" pressing Enter key.\n"
+" If you input a sentense, Anthy will split it to some segments. You can\n"
+" select the next or previous segment by pressing left or right cursor key,\n"
+" and can extend or shrink the selected segment by pressing Shift + left or\n"
+" right cursor key.\n"
+" \n"
+msgstr ""
+
+#: src/scim_anthy_factory.cpp:268
+msgid ""
+"4. Other key bindings:\n"
+" You can find out all key bindings definition of scim-anthy from \"Anthy\"\n"
+" section on setup window of SCIM or SKIM.\n"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:119
+msgid "Anthy"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:124
+msgid "An Anthy IMEngine Module."
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:184
+msgid "Mode keys"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:185
+msgid "Edit keys"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:186
+msgid "Caret keys"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:187
+msgid "Segments keys"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:188
+msgid "Candidates keys"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:189
+msgid "Direct select keys"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:190
+msgid "Convert keys"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:191
+msgid "Dictionary keys"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:213
+msgid "Romaji typing method"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:214
+msgid "Kana typing method"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:215
+msgid "Thumb shift typing method"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:248 src/scim_anthy_setup.cpp:256
+msgid "Follow input mode"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:249 src/scim_anthy_setup.cpp:257
+msgid "Wide"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:250 src/scim_anthy_setup.cpp:258
+msgid "Half"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:264 src/scim_anthy_prefs.cpp:740
+msgid "Do nothing"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:265
+msgid "Start conversion"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:266 src/scim_anthy_setup.cpp:272
+#: src/scim_anthy_prefs.cpp:680
+msgid "Commit"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:273
+msgid "Clear"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:279
+msgid "UTF-8"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:280
+msgid "EUC-JP"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:281
+msgid "EUC-JP-MS"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:287
+msgid "No decoration"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:288
+msgid "Underline"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:289
+msgid "Reverse"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:290
+msgid "Highlight"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:291
+msgid "String color"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:292
+msgid "BG color"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:293
+msgid "Both color"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:805
+msgid "_Group:"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:826
+msgid "Search by key"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:830
+msgid "all"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:873
+msgid "Feature"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:882 src/scim_anthy_setup.cpp:1289
+msgid "Key bindings"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:890
+msgid "Description"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:914
+msgid "Key bindings _theme:"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:928
+msgid "_Choose keys..."
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:955
+msgid "<b>Enable/Disable learning</b>"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:982
+msgid "<b>Key preferences to commit with reversing learning preference</b>"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:1056 src/scim_anthy_setup.cpp:1070
+msgid "_Launch"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:1241
+#, c-format
+msgid ""
+"<span size=\"20000\">%s-%s</span>\n"
+"\n"
+"<span size=\"16000\" style=\"italic\">A Japanese input method module\n"
+"for SCIM using Anthy</span>\n"
+"\n"
+"\n"
+"\n"
+"<span size=\"12000\">Copyright 2005-2006, Takuro Ashie <ashie@homa.ne."
+"jp></span>"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:1277
+msgid "Common"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:1283
+msgid "Symbols"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:1295
+msgid "Romaji typing"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:1301
+msgid "Kana typing"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:1307
+msgid "Prediction"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:1313
+msgid "Learning"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:1319
+msgid "Dictionary"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:1325
+msgid "Candidates window"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:1331
+msgid "Toolbar"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:1337
+msgid "Appearance"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:1343
+msgid "About"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:1405 src/scim_anthy_setup_romaji.cpp:255
+#: src/scim_anthy_setup_kana.cpp:413 src/scim_anthy_setup_kana.cpp:480
+msgid "User defined"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:1408 src/scim_anthy_setup_romaji.cpp:258
+#: src/scim_anthy_setup_kana.cpp:416 src/scim_anthy_setup_kana.cpp:483
+msgid "Default"
+msgstr ""
+
+#: src/scim_anthy_setup.cpp:2006
+msgid "Set key filter"
+msgstr ""
+
+#: src/scim_anthy_setup_romaji.cpp:124 src/scim_anthy_setup_romaji.cpp:195
+msgid "Romaji _table:"
+msgstr ""
+
+#: src/scim_anthy_setup_romaji.cpp:137 src/scim_anthy_setup_kana.cpp:143
+#: src/scim_anthy_setup_kana.cpp:188
+msgid "_Customize..."
+msgstr ""
+
+#: src/scim_anthy_setup_romaji.cpp:177
+msgid "Sequence"
+msgstr ""
+
+#: src/scim_anthy_setup_romaji.cpp:178 src/scim_anthy_setup_kana.cpp:263
+msgid "Result"
+msgstr ""
+
+#: src/scim_anthy_setup_romaji.cpp:185
+msgid "Customize romaji table"
+msgstr ""
+
+#: src/scim_anthy_setup_kana.cpp:114
+msgid "<b>JIS Kana Layout</b>"
+msgstr ""
+
+#: src/scim_anthy_setup_kana.cpp:130 src/scim_anthy_setup_kana.cpp:175
+msgid "La_yout:"
+msgstr ""
+
+#: src/scim_anthy_setup_kana.cpp:155
+msgid "<b>Thumb Shift Layout</b>"
+msgstr ""
+
+#: src/scim_anthy_setup_kana.cpp:262 src/scim_anthy_setup_kana.cpp:332
+msgid "Key"
+msgstr ""
+
+#: src/scim_anthy_setup_kana.cpp:270
+msgid "Customize kana layout table"
+msgstr ""
+
+#: src/scim_anthy_setup_kana.cpp:280 src/scim_anthy_setup_kana.cpp:352
+msgid "Layout _table:"
+msgstr ""
+
+#: src/scim_anthy_setup_kana.cpp:333
+msgid "Single press"
+msgstr ""
+
+#: src/scim_anthy_setup_kana.cpp:334
+msgid "Left thumb shift"
+msgstr ""
+
+#: src/scim_anthy_setup_kana.cpp:335
+msgid "Right thumb shift"
+msgstr ""
+
+#: src/scim_anthy_setup_kana.cpp:342
+msgid "Customize thumb shift layout table"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:35
+msgid "Show \"_Candidates\" label"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:45
+msgid "Close candidate window when select a candidate _directly"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:55
+msgid "Learn on _manual committing"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:65
+msgid "Learn on a_uto committing"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:75
+msgid "Use half-width characters for _symbols"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:85
+msgid "Use half-width characters for _numbers"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:95
+msgid "A_llow spliting romaji on editing preedit string"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:97
+msgid "If this check is enabled, you can delete each letter."
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:104
+msgid "_Entering the pseudo ASCII input mode with capital letters."
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:106
+msgid ""
+"If this check is enabled, capital letters will becomes a trigger to enter "
+"the pseudo ASCII input mode."
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:113
+msgid "Insert a _blank with a blank key."
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:115
+msgid ""
+"If this check is enabled, a blank key will works to insert a blank when "
+"entering the pseudo ASCII input mode."
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:122
+msgid "_Show predicted candidates while inputting letters"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:131
+msgid "Use _direct select keys while predicting"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:140
+msgid "Show _input mode label"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:150
+msgid "Show _conversion mode label"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:160
+msgid "Show _typing method label"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:170
+msgid "Show _period style label"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:180
+msgid "Show _symbol style label"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:190
+msgid "Show _dictionary menu label"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:200
+msgid "Show _edit dictionary label"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:210
+msgid "Show _add word label"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:235
+msgid "Number of candidates to show in a _page:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:238
+msgid ""
+"Specify the number of candidates to show in a page of the candidates window."
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:247
+msgid "Number of _triggers until show:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:248
+msgid "[times]"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:250
+msgid ""
+"The number of times to press a conversion key until show the candidates "
+"window.Specify 0 to never show it."
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:260
+msgid "_Simultaneous pressing time:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:261
+msgid "[msec]"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:263
+msgid "Time to regard as simultaneous key pressing."
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:286
+msgid "_Input mode: "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:296
+msgid "Typing _method: "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:306
+msgid "_Conversion mode: "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:316
+msgid "St_yle of comma and period: "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:326
+msgid "Symb_ol input style: "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:336
+msgid "_Space type: "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:346
+msgid "Input from _ten key: "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:356
+msgid "_Behavior on a comma or a period:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:366
+msgid "_Behavior on focus out:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:376
+msgid "_Left thumb shift keys:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:386
+msgid "_Right thumb shift keys:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:396
+msgid "_Commit:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:397 src/scim_anthy_prefs.cpp:681
+msgid "Select commit keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:398
+msgid ""
+"The key events to commit the preedit string with reversing the preference of "
+"learning. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:407
+msgid "Commit the _first segment:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:408 src/scim_anthy_prefs.cpp:880
+msgid "Select keys to commit the first segment"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:409
+msgid ""
+"The key events to commit the first segment with reversing the preference of "
+"learning. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:418
+msgid "Commit the _selected segment:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:419 src/scim_anthy_prefs.cpp:890
+msgid "Select keys to commit the selected segment"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:420
+msgid ""
+"The key events to commit the selected segment with reversing the preference "
+"of learning. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:429
+msgid "En_coding of dictionary:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:431
+msgid ""
+"If you choose \"EUC-JP-MS\", interoperatability of documents created on this "
+"system with Microsoft Windows may improve, but it depends on the "
+"implementation of your operating system and actual encoding of your "
+"dictionary."
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:442
+msgid "\"_Edit dictionary\" command:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:452
+msgid "\"_Add word\" command:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:462
+msgid "_Preedit string:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:472
+msgid "_Conversion string:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:482
+msgid "_Selected segment:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:506
+msgid "Toggle on/off"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:507
+msgid "Select toggle on/off keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:508
+msgid "The key events to toggle on/off Japanese mode. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:516
+msgid "Circle input mode"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:517
+msgid "Select circle input mode keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:518
+msgid "The key events to circle input mode. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:526
+msgid "Circle kana mode"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:527
+msgid "Select circle kana mode keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:528
+msgid "The key events to circle kana mode. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:536
+msgid "Latin mode"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:537
+msgid "Select Latin mode keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:538
+msgid "The key events to switch input mode to Latin. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:546
+msgid "Wide Latin mode"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:547
+msgid "Select wide Latin mode keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:548
+msgid "The key events to switch input mode to wide Latin. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:556
+msgid "Hiragana mode"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:557
+msgid "Select hiragana mode keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:558
+msgid "The key events to switch input mode to hiragana. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:566
+msgid "Katakana mode"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:567
+msgid "Select katakana mode keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:568
+msgid "The key events to switch input mode to katakana. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:576
+msgid "Half katakana mode"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:577
+msgid "Select half katakana mode keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:578
+msgid "The key events to switch input mode to half katakana. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:586
+msgid "Pseudo ASCII mode cancel"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:587
+msgid "Select pseudo ASCII mode cancel key"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:588
+msgid "The key events to cancel the pseudo ASCII mode."
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:596
+msgid "Circle typing method"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:597
+msgid "Select circle typing method keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:598
+msgid "The key events to circle typing method. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:620
+msgid "Insert space"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:621
+msgid "Select inserting space keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:622
+msgid "The key events to insert a space. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:630
+msgid "Insert alternative space"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:631
+msgid "Select inserting alternative space keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:632
+msgid "The key events to insert a alternative space. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:640
+msgid "Insert half space"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:641
+msgid "Select inserting half width space keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:642
+msgid "The key events to insert a half width space. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:650
+msgid "Insert wide space"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:651
+msgid "Select inserting wide space keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:652
+msgid "The key events to insert a wide space. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:660
+msgid "Backspace"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:661
+msgid "Select backspace keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:662
+msgid "The key events to delete a character before caret. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:670
+msgid "Delete"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:671
+msgid "Select delete keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:672
+msgid "The key events to delete a character after caret. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:682
+msgid "The key events to commit the preedit string. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:690
+msgid "Convert"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:691
+msgid "Select convert keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:692
+msgid "The key events to convert the preedit string to kanji. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:700
+msgid "Predict"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:701
+msgid "Select predict keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:702
+msgid ""
+"The key events to predict a word or sentence from already inserted text. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:710
+msgid "Cancel"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:711
+msgid "Select cancel keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:712
+msgid "The key events to cancel preediting or converting. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:720
+msgid "Cancel all"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:721
+msgid "Select cancel all keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:722
+msgid "The key events to return to initial state. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:730
+msgid "Reconvert"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:731
+msgid "Select reconvert keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:732
+msgid "The key events to reconvert the commited string in selection. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:741
+msgid "Select do nothing keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:742
+msgid ""
+"The key events to eat and do nothing anymore. For example, it can be used to "
+"disable space key completely."
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:765
+msgid "Move to first"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:766
+msgid "Select move caret to first keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:767
+msgid "The key events to move the caret to the first of preedit string. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:775
+msgid "Move to last"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:776
+msgid "Select move caret to last keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:777
+msgid "The key events to move the caret to the last of the preedit string. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:785
+msgid "Move forward"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:786
+msgid "Select move caret forward keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:787
+msgid "The key events to move the caret forward. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:795
+msgid "Move backward"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:796
+msgid "Select move caret backward keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:797
+msgid "The key events to move the caret backward. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:819
+msgid "Select the first segment"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:820
+msgid "Select keys to select the first segment"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:821
+msgid "The key events to select the first segment. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:829
+msgid "Select the last segment"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:830
+msgid "Select keys to select the last segment"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:831
+msgid "The key events to select the the last segment. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:839
+msgid "Select the next segment"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:840
+msgid "Select keys to select the next segment"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:841
+msgid "The key events to select the next segment. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:849
+msgid "Select the previous segment"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:850
+msgid "Select keys to select the previous segment"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:851
+msgid "The key events to select the previous segment. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:859
+msgid "Shrink the segment"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:860
+msgid "Select keys to shrink the segment"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:861
+msgid "The key events to shrink the selected segment. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:869
+msgid "Expand the segment"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:870
+msgid "Select keys to expand the segment"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:871
+msgid "The key events to expand the selected segment. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:879
+msgid "Commit the first segment"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:881
+msgid "The key events to commit the first segment. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:889
+msgid "Commit the selected segment"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:891
+msgid "The key events to commit the selected segment. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:913
+msgid "First candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:914
+msgid "Select the first candidate keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:915
+msgid "The key events to select the first candidate. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:923
+msgid "Last candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:924
+msgid "Select the last candidate keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:925
+msgid "The key events to the select last candidate. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:933
+msgid "Next candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:934
+msgid "Select the next candidate keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:935
+msgid "The key events to select the next candidate. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:943
+msgid "Previous candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:944
+msgid "Select the previous candidate keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:945
+msgid "The key events to select the previous candidate. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:953
+msgid "Page up"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:954
+msgid "Select page up candidates keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:955
+msgid "The key events to switch candidates page up. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:963
+msgid "Page down"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:964
+msgid "Select page down candidates keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:965
+msgid "The key events to switch candidates page down. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:987
+msgid "1st candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:988
+msgid "Select keys to select 1st candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:989
+msgid "The key events to select the 1st candidate. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:997
+msgid "2nd candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:998
+msgid "Select keys to select 2nd candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:999
+msgid "The key events to select the 2nd candidate. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1007
+msgid "3rd candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1008
+msgid "Select keys to select 3rd candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1009
+msgid "The key events to select the 3rd candidate. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1017
+msgid "4th candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1018
+msgid "Select keys to select 4th candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1019
+msgid "The key events to select the 4th candidate. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1027
+msgid "5th candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1028
+msgid "Select keys to select 5th candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1029
+msgid "The key events to select the 5th candidate. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1037
+msgid "6th candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1038
+msgid "Select keys to select 6th candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1039
+msgid "The key events to select the 6th candidate. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1047
+msgid "7th candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1048
+msgid "Select keys to select 7th candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1049
+msgid "The key events to select the 7th candidate. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1057
+msgid "8th candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1058
+msgid "Select keys to select 8th candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1059
+msgid "The key events to select the 8th candidate. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1067
+msgid "9th candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1068
+msgid "Select keys to select 9th candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1069
+msgid "The key events to select the 9th candidate. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1077
+msgid "10th candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1078
+msgid "Select keys to select 10th candidate"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1079
+msgid "The key events to select the 10th candidate. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1101
+msgid "Convert character type forward"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1102
+msgid "Select keys to convert character type forward"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1103
+msgid "Rotate character type forward."
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1111
+msgid "Convert character type backward"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1112
+msgid "Select keys to convert character type backward"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1113
+msgid "Rotate character type backward."
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1121
+msgid "Convert to hiragana"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1122
+msgid "Select keys to convert to hiragana"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1123
+msgid "The key events to convert the preedit string to hiragana. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1131
+msgid "Convert to katakana"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1132
+msgid "Select keys to convert to katakana"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1133
+msgid "The key events to convert the preedit string to katakana. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1141
+msgid "Convert to half width"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1142
+msgid "Select keys to convert to half width"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1143
+msgid "The key events to convert the preedit string to half width. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1151
+msgid "Convert to half katakana"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1152
+msgid "Select keys to convert to half width katakana"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1153
+msgid "The key events to convert the preedit string to half width katakana. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1161
+msgid "Convert to wide latin"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1162
+msgid "Select keys to convert to wide latin"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1163
+msgid "The key events to convert the preedit string to wide latin. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1171
+msgid "Convert to latin"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1172
+msgid "Select keys to convert to latin"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1173
+msgid "The key events to convert the preedit string to latin. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1195
+msgid "Edit dictionary"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1196
+msgid "Select edit dictionary keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1197
+msgid "The key events to launch dictionary administration tool. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1206
+msgid "Select add a word keys"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1207
+msgid "The key events to launch the tool to add a word. "
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1232 src/scim_anthy_prefs.cpp:1245
+#: src/scim_anthy_prefs.cpp:1258
+msgid "Color:"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1233 src/scim_anthy_prefs.cpp:1234
+msgid "The color of preediting text"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1246 src/scim_anthy_prefs.cpp:1247
+msgid "The color of conversion text"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1259
+msgid "The color of selected segment text"
+msgstr ""
+
+#: src/scim_anthy_prefs.cpp:1260
+msgid "The color of selected segment text in the conversion text"
+msgstr ""
+
+#: src/scim_anthy_color_button.cpp:320
+msgid "Foreground color"
+msgstr ""
+
+#: src/scim_anthy_color_button.cpp:320
+msgid "Background color"
+msgstr ""
--- /dev/null
+## Copyright (C) 2004 Hiroyuki Ikezoe
+## Copyright (C) 2004-2005 Takuro Ashie
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+AM_CPPFLAGS = \
+ -DSCIM_ANTHY_LOCALEDIR=\"$(datadir)/locale\" \
+ -DSCIM_ICONDIR=\"@SCIM_ICONDIR@\" \
+ -DSCIM_ANTHY_DATADIR=\"@SCIM_ANTHY_DATADIR@\" \
+ -DSCIM_ANTHY_STYLEDIR=\"@SCIM_ANTHY_DATADIR@/style\"
+INCLUDE = \
+ -I$(top_builddir) \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/src
+
+noinst_HEADERS = \
+ scim_anthy_intl.h \
+ scim_anthy_prefs.h \
+ scim_anthy_factory.h \
+ scim_anthy_imengine.h \
+ scim_anthy_action.h \
+ scim_anthy_preedit.h \
+ scim_anthy_reading.h \
+ scim_anthy_conversion.h \
+ scim_anthy_key2kana_table.h \
+ scim_anthy_key2kana_base.h \
+ scim_anthy_key2kana.h \
+ scim_anthy_kana.h \
+ scim_anthy_nicola.h \
+ scim_anthy_default_tables.h \
+ scim_anthy_style_file.h \
+ scim_anthy_setup.h \
+ scim_anthy_setup_romaji.h \
+ scim_anthy_setup_kana.h \
+ scim_anthy_table_editor.h \
+ scim_anthy_utils.h \
+ scim_anthy_color_button.h \
+ scim_anthy_helper.h
+
+
+#
+# IMEngine Module
+#
+moduledir = @SCIM_MODULEDIR@/IMEngine
+module_LTLIBRARIES = ise-engine-anthy.la
+
+ise_engine_anthy_la_SOURCES = \
+ scim_anthy_factory.cpp \
+ scim_anthy_imengine.cpp \
+ scim_anthy_action.cpp \
+ scim_anthy_preedit.cpp \
+ scim_anthy_reading.cpp \
+ scim_anthy_conversion.cpp \
+ scim_anthy_key2kana.cpp \
+ scim_anthy_key2kana_table.cpp \
+ scim_anthy_kana.cpp \
+ scim_anthy_nicola.cpp \
+ scim_anthy_default_tables.cpp \
+ scim_anthy_style_file.cpp \
+ scim_anthy_utils.cpp
+
+ise_engine_anthy_la_CFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ @ANTHY_CFLAGS@ @ECORE_CFLAGS@
+ise_engine_anthy_la_CXXFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ @ANTHY_CFLAGS@ @ECORE_CFLAGS@
+
+ise_engine_anthy_la_LDFLAGS = \
+ -avoid-version \
+ -rpath $(moduledir) \
+ -module \
+ @LIBTOOL_EXPORT_OPTIONS@ \
+ @SCIM_LIBS@ \
+ @ANTHY_LIBS@ \
+ @ECORE_LIBS@
+
+
+#
+# Setup Module
+#
+if SCIM_BUILD_SETUP
+SETUP_MODULE = anthy-imengine-setup.la
+endif
+
+setupmoduledir = @SCIM_MODULEDIR@/SetupUI
+setupmodule_LTLIBRARIES = $(SETUP_MODULE)
+
+anthy_imengine_setup_la_SOURCES = \
+ scim_anthy_setup.cpp \
+ scim_anthy_setup_romaji.cpp \
+ scim_anthy_setup_kana.cpp \
+ scim_anthy_style_file.cpp \
+ scim_anthy_default_tables.cpp \
+ scim_anthy_prefs.cpp \
+ scim_anthy_utils.cpp \
+ scim_anthy_table_editor.cpp \
+ scim_anthy_color_button.cpp
+
+anthy_imengine_setup_la_CFLAGS = @SCIM_GTKUTILS_CFLAGS@ \
+ @SCIM_CFLAGS@ \
+ @SCIM_DEBUG_FLAGS@
+anthy_imengine_setup_la_CXXFLAGS= @SCIM_GTKUTILS_CFLAGS@ \
+ @SCIM_CFLAGS@ \
+ @SCIM_DEBUG_FLAGS@
+anthy_imengine_setup_la_LDFLAGS = -avoid-version \
+ -rpath $(setupmoduledir) \
+ -module \
+ @LIBTOOL_EXPORT_OPTIONS@ \
+ @SCIM_GTKUTILS_LIBS@ \
+ @INTLLIBS@ \
+ @SCIM_LIBS@
+
+
+#
+# Helper Program
+#
+if SCIM_BUILD_HELPER
+HELPER_MODULE = anthy-imengine-helper.la
+endif
+helpermoduledir = @SCIM_MODULEDIR@/Helper
+helpermodule_LTLIBRARIES = $(HELPER_MODULE)
+
+anthy_imengine_helper_la_SOURCES = scim_anthy_helper.cpp
+anthy_imengine_helper_la_CFLAGS = @GTK2_CFLAGS@ \
+ @SCIM_CFLAGS@ \
+ @SCIM_DEBUG_FLAGS@
+anthy_imengine_helper_la_CXXFLAGS = @GTK2_CFLAGS@ \
+ @SCIM_CFLAGS@ \
+ @SCIM_DEBUG_FLAGS@
+anthy_imengine_helper_la_LDFLAGS = -avoid-version \
+ -rpath $(setupmoduledir) \
+ -module \
+ @LIBTOOL_EXPORT_OPTIONS@ \
+ @GTK2_LIBS@ \
+ @INTLLIBS@ \
+ @SCIM_LIBS@
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#endif
+
+#include "scim_anthy_action.h"
+#include "scim_anthy_utils.h"
+
+using namespace scim_anthy;
+
+Action::Action (const String &name, const String &key_bindings, PMF pmf)
+ : m_name (name),
+ m_pmf (pmf),
+ m_func (NULL)
+{
+ scim_string_to_key_list (m_key_bindings, key_bindings);
+}
+
+Action::Action (const String &name, const String &key_bindings, Func func)
+ : m_name (name),
+ m_pmf (NULL),
+ m_func (func)
+{
+ scim_string_to_key_list (m_key_bindings, key_bindings);
+}
+
+Action::~Action (void)
+{
+}
+
+bool
+Action::perform (AnthyInstance *performer)
+{
+ if (m_pmf)
+ return (performer->*m_pmf) ();
+ else if (m_func)
+ return m_func (performer);
+
+ return false;
+}
+
+bool
+Action::perform (AnthyInstance *performer, const KeyEvent &key)
+{
+ if (!m_pmf && !m_func)
+ return false;
+
+ if (match_key_event (key)) {
+ if (m_pmf)
+ return (performer->*m_pmf) ();
+ else if (m_func)
+ return m_func (performer);
+ }
+
+ return false;
+}
+
+bool
+Action::match_key_event (const KeyEvent &key)
+{
+ return util_match_key_event (m_key_bindings, key, SCIM_KEY_CapsLockMask);
+}
+
+bool
+Action::match_action_name (const char *name)
+{
+ return (m_name.compare (name) == 0);
+}
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SCIM_ANTHY_ACTION_H__
+#define __SCIM_ANTHY_ACTION_H__
+
+#include <scim.h>
+#include <scim_event.h>
+
+using namespace scim;
+
+class AnthyInstance;
+
+namespace scim_anthy {
+
+class Action
+{
+ typedef bool (AnthyInstance::*PMF) (void);
+ typedef bool (*Func) (AnthyInstance *anthy);
+
+public:
+ Action (const String &name, const String &key_bindings, PMF pmf);
+ Action (const String &name, const String &key_bindings, Func func);
+ ~Action ();
+
+public:
+ bool perform (AnthyInstance *performer);
+ bool perform (AnthyInstance *performer,
+ const KeyEvent &key);
+
+ bool match_action_name (const char *name);
+
+private:
+ bool match_key_event (const KeyEvent &key);
+
+private:
+ String m_name;
+ String m_desc;
+ PMF m_pmf;
+ Func m_func;
+ KeyEventList m_key_bindings;
+};
+
+}
+
+#endif /* __SCIM_ANTHY_ACTION_H__ */
--- /dev/null
+/*
+ * Copyright (C) 2005 Hiroyuki Ikezoe <poincare@ikezoe.net>
+ *
+ * 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 <mitch@gimp.org>
+ */
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#endif
+
+#include <string.h>
+
+#include "scim_anthy_color_button.h"
+#include "scim_anthy_intl.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_anthy_color_button_class_init (ScimAnthyColorButtonClass *klass);
+static void scim_anthy_color_button_init (ScimAnthyColorButton *object);
+
+static void scim_anthy_color_button_destroy (GtkObject *object);
+static gboolean scim_anthy_color_button_expose (GtkWidget *widget,
+ GdkEventExpose *eevent);
+static gboolean scim_anthy_color_button_button_press (GtkWidget *widget,
+ GdkEventButton *bevent);
+static gboolean scim_anthy_color_button_button_release (GtkWidget *widget,
+ GdkEventButton *bevent);
+
+
+static guint button_signals[LAST_SIGNAL] = { 0 };
+
+static GtkDrawingAreaClass *parent_class = NULL;
+
+GType
+scim_anthy_color_button_get_type (void)
+{
+ static GType type = 0;
+
+ if (!type) {
+ static const GTypeInfo info = {
+ sizeof (ScimAnthyColorButtonClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) scim_anthy_color_button_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (ScimAnthyColorButton),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) scim_anthy_color_button_init,
+ };
+
+ type = g_type_register_static (GTK_TYPE_DRAWING_AREA,
+ "ScimAnthyColorButton",
+ &info, (GTypeFlags) 0);
+ }
+
+ return type;
+}
+
+static void
+scim_anthy_color_button_class_init (ScimAnthyColorButtonClass *klass)
+{
+ GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (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 (ScimAnthyColorButtonClass, color_changed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ gtk_object_class->destroy = scim_anthy_color_button_destroy;
+
+ widget_class->expose_event = scim_anthy_color_button_expose;
+ widget_class->button_press_event = scim_anthy_color_button_button_press;
+ widget_class->button_release_event = scim_anthy_color_button_button_release;
+}
+
+static void
+scim_anthy_color_button_init (ScimAnthyColorButton *object)
+{
+ /*set default color */
+ gdk_color_parse ("#000000", &object->fg_color);
+ gdk_color_parse ("#ffffff", &object->bg_color);
+
+ gtk_widget_add_events (GTK_WIDGET (object),
+ GDK_BUTTON_PRESS_MASK |
+ GDK_BUTTON_RELEASE_MASK);
+}
+
+
+static void
+scim_anthy_color_button_destroy (GtkObject *object)
+{
+ ScimAnthyColorButton *button = SCIM_ANTHY_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;
+ }
+
+ GTK_OBJECT_CLASS (parent_class)->destroy (object);
+}
+
+static void
+scim_anthy_color_button_draw_rect (ScimAnthyColorButton *button,
+ GdkDrawable *drawable,
+ GdkGC *gc,
+ gint x,
+ gint y,
+ gint width,
+ gint height,
+ GdkColor *color)
+{
+ 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);
+}
+
+static gboolean
+scim_anthy_color_button_expose (GtkWidget *widget,
+ GdkEventExpose *eevent)
+{
+ ScimAnthyColorButton *button = SCIM_ANTHY_COLOR_BUTTON (widget);
+ gint width, height;
+ gint swap_w = 0, swap_h = 0;
+ gint rect_w, rect_h;
+
+ if (!GTK_WIDGET_DRAWABLE (widget))
+ return FALSE;
+
+ width = widget->allocation.width;
+ height = widget->allocation.height;
+
+ /* draw the swap colors pixbuf */
+ if (!button->swap_icon) {
+ button->swap_icon
+ = gdk_pixbuf_new_from_file (SCIM_ICONDIR"/scim-anthy-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) {
+ 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);
+ } 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_anthy_color_button_draw_rect (button,
+ widget->window,
+ widget->style->fg_gc[0],
+ (width - rect_w),
+ (height - rect_h),
+ rect_w, rect_h,
+ &button->bg_color);
+
+ gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL,
+ GTK_SHADOW_IN,
+ NULL, widget, NULL,
+ (width - rect_w),
+ (height - rect_h),
+ rect_w, rect_h);
+
+
+ /* draw the foreground area */
+ scim_anthy_color_button_draw_rect (button,
+ widget->window,
+ widget->style->fg_gc[0],
+ 0, 0,
+ rect_w, rect_h,
+ &button->fg_color);
+
+ gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL,
+ GTK_SHADOW_IN,
+ NULL, widget, NULL,
+ 0, 0,
+ rect_w, rect_h);
+
+ return TRUE;
+}
+
+static FgBgTarget
+scim_anthy_color_button_target (ScimAnthyColorButton *button,
+ gint x,
+ gint y)
+{
+ gint width = GTK_WIDGET (button)->allocation.width;
+ gint height = GTK_WIDGET (button)->allocation.height;
+ 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_anthy_color_button_open_color_dialog (ScimAnthyColorButton *button, gboolean fg)
+{
+ GtkWidget *dialog;
+ const gchar *title;
+ GdkColor *color;
+ gint result;
+
+ title = fg ? _("Foreground color") : _("Background color");
+ color = fg ? &button->fg_color : &button->bg_color;
+
+ dialog = gtk_color_selection_dialog_new (title);
+
+ gtk_color_selection_set_current_color (GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dialog)->colorsel),
+ color);
+ gtk_widget_show (dialog);
+
+ result = gtk_dialog_run (GTK_DIALOG (dialog));
+
+ switch (result) {
+ case GTK_RESPONSE_OK:
+ gtk_color_selection_get_current_color (GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dialog)->colorsel),
+ color);
+ 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_anthy_color_button_swap_color (ScimAnthyColorButton *button)
+{
+ 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;
+ g_signal_emit (button, button_signals[COLOR_CHANGED], 0);
+}
+
+static gboolean
+scim_anthy_color_button_button_press (GtkWidget *widget,
+ GdkEventButton *bevent)
+{
+ ScimAnthyColorButton *button = SCIM_ANTHY_COLOR_BUTTON (widget);
+ if (bevent->button == 1 && bevent->type == GDK_BUTTON_PRESS) {
+ FgBgTarget target = scim_anthy_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_anthy_color_button_open_color_dialog (button, TRUE);
+ break;
+
+ case BACKGROUND_AREA:
+ button->click_target = BACKGROUND_AREA;
+ scim_anthy_color_button_open_color_dialog (button, FALSE);
+ break;
+
+ case SWAP_AREA:
+ scim_anthy_color_button_swap_color (button);
+ gtk_widget_queue_draw (GTK_WIDGET (button));
+ break;
+
+ case DEFAULT_AREA:
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ return FALSE;
+}
+
+static gboolean
+scim_anthy_color_button_button_release (GtkWidget *widget,
+ GdkEventButton *bevent)
+{
+ ScimAnthyColorButton *button = SCIM_ANTHY_COLOR_BUTTON (widget);
+
+ if (bevent->button == 1) {
+ FgBgTarget target = scim_anthy_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_anthy_color_button_new (void)
+{
+ return GTK_WIDGET(g_object_new (SCIM_ANTHY_TYPE_COLOR_BUTTON,
+ NULL));
+}
+
+gboolean
+scim_anthy_color_button_get_colors (ScimAnthyColorButton *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",
+ ((button->fg_color.red)>>8),
+ ((button->fg_color.green)>>8),
+ ((button->fg_color.blue)>>8));
+ g_snprintf (bg_color_str, G_N_ELEMENTS (bg_color_str),
+ "#%02X%02X%02X",
+ ((button->bg_color.red)>>8),
+ ((button->bg_color.green)>>8),
+ ((button->bg_color.blue)>>8));
+ *fg_value = String (fg_color_str);
+ *bg_value = String (bg_color_str);
+
+ return TRUE;
+}
+
+gboolean
+scim_anthy_color_button_set_colors (ScimAnthyColorButton *button,
+ const String &fg_value,
+ const String &bg_value)
+{
+ 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;
+
+ return TRUE;
+}
+
+/*
+vi:ts=4:nowrap:ai:expandtab
+*/
--- /dev/null
+/*
+ * Copyright (C) 2005 Hiroyuki Ikezoe <poincare@ikezoe.net>
+ *
+ * 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 <mitch@gimp.org>
+ */
+
+#ifndef __SCIM_ANTHY_COLOR_BUTTON_H__
+#define __SCIM_ANTHY_COLOR_BUTTON_H__
+
+
+#include <gtk/gtk.h>
+#include <scim.h>
+
+using namespace scim;
+
+#define SCIM_ANTHY_TYPE_COLOR_BUTTON (scim_anthy_color_button_get_type ())
+#define SCIM_ANTHY_COLOR_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCIM_ANTHY_TYPE_COLOR_BUTTON, ScimAnthyColorButton))
+#define SCIM_ANTHY_COLOR_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCIM_ANTHY_TYPE_COLOR_BUTTON, ScimAnthyColorButtonClass))
+#define SCIM_ANTHY_IS_COLOR_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCIM_ANTHY_TYPE_COLOR_BUTTON))
+#define SCIM_ANTHY_IS_COLOR_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCIM_ANTHY_TYPE_COLOR_BUTTON))
+#define SCIM_ANTHY_COLOR_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCIM_ANTHY_TYPE_COLOR_BUTTON, ScimAnthyColorButtonClass))
+
+
+typedef struct _ScimAnthyColorButtonClass ScimAnthyColorButtonClass;
+typedef struct _ScimAnthyColorButton ScimAnthyColorButton;
+
+struct _ScimAnthyColorButton
+{
+ GtkDrawingArea parent_instance;
+
+ guchar *render_buf;
+ gint render_buf_size;
+
+ GdkPixbuf *swap_icon;
+
+ gint rect_width;
+ gint rect_height;
+ gint click_target;
+
+ GdkColor fg_color;
+ GdkColor bg_color;
+};
+
+struct _ScimAnthyColorButtonClass
+{
+ GtkDrawingAreaClass parent_class;
+
+ /* signals */
+
+ void (* color_changed) (ScimAnthyColorButton *button);
+};
+
+
+GType scim_anthy_color_button_get_type (void) G_GNUC_CONST;
+
+GtkWidget * scim_anthy_color_button_new (void);
+
+gboolean scim_anthy_color_button_get_colors (ScimAnthyColorButton *button,
+ String *fg_value,
+ String *bg_value);
+gboolean scim_anthy_color_button_set_colors (ScimAnthyColorButton *button,
+ const String &fg_value,
+ const String &bg_value);
+
+#endif /* __SCIM_ANTHY_COLOR_BUTTON_H__ */
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <string.h>
+
+#include "scim_anthy_factory.h"
+#include "scim_anthy_imengine.h"
+#include "scim_anthy_conversion.h"
+#include "scim_anthy_utils.h"
+#include "scim_anthy_prefs.h"
+
+using namespace scim_anthy;
+
+static void rotate_case (String &str);
+
+
+//
+// ConversionSegment Class
+//
+ConversionSegment::ConversionSegment (WideString str, int cand_id,
+ unsigned int reading_len)
+ : m_string (str),
+ m_cand_id (cand_id),
+ m_reading_len (reading_len)
+{
+}
+
+ConversionSegment::~ConversionSegment ()
+{
+}
+
+WideString &
+ConversionSegment::get_string (void)
+{
+ return m_string;
+}
+
+
+int
+ConversionSegment::get_candidate_id (void)
+{
+ return m_cand_id;
+}
+
+unsigned int
+ConversionSegment::get_reading_length (void)
+{
+ return m_reading_len;
+}
+
+void
+ConversionSegment::set (WideString str, int cand_id)
+{
+ m_string = str;
+ m_cand_id = cand_id;
+}
+
+void
+ConversionSegment::set_reading_length (unsigned int len)
+{
+ m_reading_len = len;
+}
+
+
+
+//
+// Conversion Class
+//
+Conversion::Conversion (AnthyInstance &anthy, Reading &reading)
+ : m_anthy (anthy),
+ m_reading (reading),
+ m_anthy_context (anthy_create_context()),
+ m_start_id (0),
+ m_cur_segment (-1),
+ m_predicting (false)
+{
+ set_dict_encoding (String (SCIM_ANTHY_CONFIG_DICT_ENCODING_DEFAULT));
+}
+
+Conversion::~Conversion ()
+{
+ anthy_release_context (m_anthy_context);
+}
+
+
+
+//
+// starting and finishing
+//
+void
+Conversion::convert (WideString source, CandidateType ctype,
+ bool single_segment)
+{
+ if (is_converting ())
+ return;
+
+ clear ();
+
+ String dest;
+
+ // convert
+ struct anthy_conv_stat conv_stat;
+ anthy_get_stat (m_anthy_context, &conv_stat);
+ if (conv_stat.nr_segment <= 0) {
+ m_iconv.convert (dest, source);
+ anthy_set_string (m_anthy_context, dest.c_str ());
+ }
+
+ if (single_segment)
+ join_all_segments ();
+
+ // get information about conversion string
+ anthy_get_stat (m_anthy_context, &conv_stat);
+ if (conv_stat.nr_segment <= 0)
+ return;
+
+ // select first segment
+ m_cur_segment = 0;
+
+ // create segments
+ m_segments.clear();
+ for (int i = m_start_id; i < conv_stat.nr_segment; i++) {
+ struct anthy_segment_stat seg_stat;
+ anthy_get_segment_stat (m_anthy_context, i, &seg_stat);
+ m_segments.push_back (
+ ConversionSegment (get_segment_string (i, ctype), ctype,
+ seg_stat.seg_len));
+ }
+}
+
+void
+Conversion::convert (CandidateType ctype, bool single_segment)
+{
+ convert (m_reading.get (), ctype, single_segment);
+}
+
+void
+Conversion::convert (const WideString &source, bool single_segment)
+{
+ convert (source, SCIM_ANTHY_CANDIDATE_DEFAULT, single_segment);
+}
+
+void
+Conversion::predict (void)
+{
+ clear ();
+
+#ifdef HAS_ANTHY_PREDICTION
+ String str;
+
+ m_iconv.convert (str, m_reading.get ());
+ anthy_set_prediction_string (m_anthy_context, str.c_str ());
+
+ struct anthy_prediction_stat ps;
+ anthy_get_prediction_stat (m_anthy_context, &ps);
+ if (ps.nr_prediction > 0)
+ m_predicting = true;
+ else
+ anthy_reset_context (m_anthy_context);
+#endif /* HAS_ANTHY_PREDICTION */
+}
+
+void
+Conversion::clear (int segment_id)
+{
+ if (segment_id < 0 || m_segments.size () <= 0 ||
+ segment_id >= (int) m_segments.size () - 1)
+ {
+ // complete clear
+
+ anthy_reset_context (m_anthy_context);
+
+ m_segments.clear ();
+
+ m_start_id = 0;
+ m_cur_segment = -1;
+ m_predicting = false;
+
+ } else {
+ // partial clear
+
+ // remove stored segments
+ ConversionSegments::iterator it = m_segments.begin ();
+ m_segments.erase (it, it + segment_id + 1);
+
+ // adjust selected segment
+ int new_start_segment_id = m_start_id + segment_id + 1;
+ if (m_cur_segment >= 0) {
+ m_cur_segment -= new_start_segment_id - m_start_id;
+ if (m_cur_segment < 0)
+ m_cur_segment = 0;
+ }
+
+ // adjust offset
+ unsigned int clear_len = 0;
+ for (int i = m_start_id; i < new_start_segment_id; i++) {
+ struct anthy_segment_stat seg_stat;
+ anthy_get_segment_stat (m_anthy_context, i, &seg_stat);
+ clear_len += seg_stat.seg_len;
+ }
+ m_reading.erase (0, clear_len, true);
+ m_start_id = new_start_segment_id;
+ }
+}
+
+void
+Conversion::commit (int segment_id, bool learn)
+{
+ if (!is_converting ()) return;
+
+ // learn
+ for (unsigned int i = m_start_id;
+ learn &&
+ i < m_segments.size () &&
+ (segment_id < 0 || (int) i <= segment_id);
+ i++)
+ {
+ if (m_segments[i].get_candidate_id () >= 0)
+ anthy_commit_segment (m_anthy_context, i,
+ m_segments[i].get_candidate_id ());
+ }
+
+ clear (segment_id);
+}
+
+
+
+//
+// getting status
+//
+bool
+Conversion::is_converting (void)
+{
+ if (m_segments.size () > 0)
+ return true;
+ else
+ return false;
+}
+
+bool
+Conversion::is_predicting (void)
+{
+ return m_predicting;
+}
+
+WideString
+Conversion::get (void)
+{
+ WideString str;
+ ConversionSegments::iterator it;
+ for (it = m_segments.begin (); it != m_segments.end (); it++)
+ str += it->get_string ();
+ return str;
+}
+
+unsigned int
+Conversion::get_length (void)
+{
+ unsigned int len = 0;
+ ConversionSegments::iterator it;
+ for (it = m_segments.begin (); it != m_segments.end (); it++)
+ len += it->get_string().length ();
+ return len;
+}
+
+AttributeList
+Conversion::get_attribute_list (void)
+{
+ AttributeList attrs;
+ unsigned int pos = 0, seg_id;
+ ConversionSegments::iterator it;
+ for (it = m_segments.begin (), seg_id = 0;
+ it != m_segments.end ();
+ it++, seg_id++)
+ {
+ // create attribute for this segment
+ if (it->get_string().length () <= 0) {
+ pos += it->get_string().length ();
+ continue;
+ }
+
+ if ((int) seg_id == m_cur_segment) {
+ util_create_attributes (
+ attrs, pos, it->get_string().length(),
+ m_anthy.get_factory()->m_selected_segment_style,
+ m_anthy.get_factory()->m_selected_segment_fg_color,
+ m_anthy.get_factory()->m_selected_segment_bg_color);
+ } else {
+ util_create_attributes (
+ attrs, pos, it->get_string().length(),
+ m_anthy.get_factory()->m_conversion_style,
+ m_anthy.get_factory()->m_conversion_fg_color,
+ m_anthy.get_factory()->m_conversion_bg_color);
+ }
+
+ pos += it->get_string().length ();
+ }
+
+ return attrs;
+}
+
+
+
+//
+// segments of the converted sentence
+//
+int
+Conversion::get_nr_segments (void)
+{
+ if (!is_converting ()) return 0;
+
+ struct anthy_conv_stat conv_stat;
+ anthy_get_stat (m_anthy_context, &conv_stat);
+
+ return conv_stat.nr_segment - m_start_id;
+}
+
+WideString
+Conversion::get_segment_string (int segment_id, int candidate_id)
+{
+ if (segment_id < 0) {
+ if (m_cur_segment < 0)
+ return WideString ();
+ else
+ segment_id = m_cur_segment;
+ }
+
+ struct anthy_conv_stat conv_stat;
+ anthy_get_stat (m_anthy_context, &conv_stat);
+
+ if (conv_stat.nr_segment <= 0)
+ return WideString ();
+
+ if (m_start_id < 0 ||
+ m_start_id >= conv_stat.nr_segment)
+ {
+ return WideString (); // error
+ }
+
+ if (segment_id < 0 ||
+ segment_id + m_start_id >= conv_stat.nr_segment)
+ {
+ return WideString (); //error
+ }
+
+ // character position of the head of segment.
+ unsigned int real_seg_start = 0;
+ for (int i = m_start_id; i < m_start_id + segment_id; i++) {
+ struct anthy_segment_stat seg_stat;
+ anthy_get_segment_stat (m_anthy_context, i, &seg_stat);
+ real_seg_start += seg_stat.seg_len;
+ }
+
+ int real_seg = segment_id + m_start_id;
+ int cand;
+ if (candidate_id <= SCIM_ANTHY_LAST_SPECIAL_CANDIDATE)
+ cand = m_segments[segment_id].get_candidate_id ();
+ else
+ cand = candidate_id;
+
+ // get information of this segment
+ struct anthy_segment_stat seg_stat;
+ anthy_get_segment_stat (m_anthy_context, real_seg, &seg_stat);
+
+ // get string of this segment
+ WideString segment_str;
+ if (cand < 0) {
+ get_reading_substr (segment_str, segment_id, cand,
+ real_seg_start, seg_stat.seg_len);
+ } else {
+ int len = anthy_get_segment (m_anthy_context, real_seg, cand, NULL, 0);
+ if (len > 0) {
+ char buf[len + 1];
+ anthy_get_segment (m_anthy_context, real_seg, cand, buf, len + 1);
+ buf[len] = '\0';
+ m_iconv.convert (segment_str, buf, len);
+ }
+ }
+
+ return segment_str;
+}
+
+int
+Conversion::get_selected_segment (void)
+{
+ return m_cur_segment;
+}
+
+void
+Conversion::select_segment (int segment_id)
+{
+ if (!is_converting ()) return;
+
+ if (segment_id < 0) {
+ m_cur_segment = -1;
+ return;
+ }
+
+ struct anthy_conv_stat conv_stat;
+ anthy_get_stat (m_anthy_context, &conv_stat);
+
+ int real_segment_id = segment_id + m_start_id;
+
+ if (segment_id >= 0 && real_segment_id < conv_stat.nr_segment)
+ m_cur_segment = segment_id;
+}
+
+int
+Conversion::get_segment_size (int segment_id)
+{
+ if (!is_converting ()) return -1;
+
+ struct anthy_conv_stat conv_stat;
+ anthy_get_stat (m_anthy_context, &conv_stat);
+
+ if (segment_id < 0) {
+ if (m_cur_segment < 0)
+ return -1;
+ else
+ segment_id = m_cur_segment;
+ }
+ int real_segment_id = segment_id + m_start_id;
+
+ if (real_segment_id >= conv_stat.nr_segment)
+ return -1;
+
+ struct anthy_segment_stat seg_stat;
+ anthy_get_segment_stat (m_anthy_context, real_segment_id, &seg_stat);
+
+ return seg_stat.seg_len;
+}
+
+void
+Conversion::resize_segment (int relative_size, int segment_id)
+{
+ if (is_predicting ()) return;
+ if (!is_converting ()) return;
+
+ struct anthy_conv_stat conv_stat;
+ anthy_get_stat (m_anthy_context, &conv_stat);
+
+ int real_segment_id;
+
+ if (segment_id < 0) {
+ if (m_cur_segment < 0)
+ return;
+ else
+ segment_id = m_cur_segment;
+ real_segment_id = segment_id + m_start_id;
+ } else {
+ real_segment_id = segment_id + m_start_id;
+ if (m_cur_segment > segment_id)
+ m_cur_segment = segment_id;
+ }
+
+ if (real_segment_id >= conv_stat.nr_segment)
+ return;
+
+ // do resize
+ anthy_resize_segment (m_anthy_context, real_segment_id, relative_size);
+
+ // reset candidates of trailing segments
+ anthy_get_stat (m_anthy_context, &conv_stat);
+ ConversionSegments::iterator start_iter = m_segments.begin();
+ ConversionSegments::iterator end_iter = m_segments.end();
+ m_segments.erase (start_iter + segment_id, end_iter);
+ for (int i = real_segment_id; i < conv_stat.nr_segment; i++) {
+ struct anthy_segment_stat seg_stat;
+ anthy_get_segment_stat (m_anthy_context, i, &seg_stat);
+ m_segments.push_back (
+ ConversionSegment (get_segment_string (i - m_start_id, 0), 0,
+ seg_stat.seg_len));
+ }
+}
+
+unsigned int
+Conversion::get_segment_position (int segment_id)
+{
+ if (segment_id < 0) {
+ if (m_cur_segment < 0)
+ return get_length ();
+ else
+ segment_id = m_cur_segment;
+ }
+
+ unsigned int pos = 0;
+
+ for (unsigned int i = 0;
+ (int) i < m_cur_segment && i < m_segments.size ();
+ i++)
+ {
+ pos += m_segments[i].get_string().length ();
+ }
+
+ return pos;
+}
+
+
+
+//
+// candidates for a segment or prediction
+//
+void
+Conversion::get_candidates (CommonLookupTable &table, int segment_id)
+{
+ table.clear ();
+
+ if (is_predicting ()) {
+#ifdef HAS_ANTHY_PREDICTION
+ String str;
+ struct anthy_prediction_stat ps;
+
+ anthy_get_prediction_stat (m_anthy_context, &ps);
+
+ for (int i = 0; i < ps.nr_prediction; i++) {
+ int len = anthy_get_prediction (m_anthy_context, i, NULL, 0);
+ if (len <= 0)
+ continue;
+
+ char buf[len + 1];
+ anthy_get_prediction (m_anthy_context, i, buf, len + 1);
+ buf[len] = '\0';
+
+ WideString cand;
+ m_iconv.convert (cand, buf);
+
+ table.append_candidate (cand);
+ }
+#endif /* HAS_ANTHY_PREDICTION */
+ } else if (is_converting ()) {
+ struct anthy_conv_stat conv_stat;
+ anthy_get_stat (m_anthy_context, &conv_stat);
+
+ if (conv_stat.nr_segment <= 0)
+ return;
+
+ if (segment_id < 0) {
+ if (m_cur_segment < 0)
+ return;
+ else
+ segment_id = m_cur_segment;
+ }
+ int real_segment_id = segment_id + m_start_id;
+
+ if (real_segment_id >= conv_stat.nr_segment)
+ return;
+
+ struct anthy_segment_stat seg_stat;
+ anthy_get_segment_stat (m_anthy_context, real_segment_id, &seg_stat);
+
+ for (int i = 0; i < seg_stat.nr_candidate; i++) {
+ int len = anthy_get_segment (m_anthy_context, real_segment_id, i,
+ NULL, 0);
+ if (len <= 0)
+ continue;
+
+ char buf[len + 1];
+ anthy_get_segment (m_anthy_context, real_segment_id,
+ i, buf, len + 1);
+
+ WideString cand_wide;
+ m_iconv.convert (cand_wide, buf, len);
+
+ table.append_candidate (cand_wide);
+ }
+
+ table.set_cursor_pos (get_selected_candidate ());
+ }
+}
+
+int
+Conversion::get_selected_candidate (int segment_id)
+{
+ if (is_predicting ()) {
+#ifdef HAS_ANTHY_PREDICTION
+ struct anthy_prediction_stat ps;
+
+ anthy_get_prediction_stat (m_anthy_context, &ps);
+
+ if (ps.nr_prediction <= 0)
+ return -1;
+
+ if (segment_id < 0) {
+ if (m_cur_segment < 0)
+ return -1;
+ else
+ segment_id = m_cur_segment;
+ } else if (segment_id >= ps.nr_prediction) {
+ return -1;
+ }
+
+ return m_segments[segment_id].get_candidate_id ();
+#endif /* HAS_ANTHY_PREDICTION */
+
+ } else if (is_converting ()) {
+ struct anthy_conv_stat cs;
+
+ anthy_get_stat (m_anthy_context, &cs);
+
+ if (cs.nr_segment <= 0)
+ return -1;
+
+ if (segment_id < 0) {
+ if (m_cur_segment < 0)
+ return -1;
+ else
+ segment_id = m_cur_segment;
+ } else if (segment_id >= cs.nr_segment) {
+ return -1;
+ }
+
+ return m_segments[segment_id].get_candidate_id ();
+ }
+
+ return -1;
+}
+
+void
+Conversion::select_candidate (int candidate_id, int segment_id)
+{
+ if (is_predicting ()) {
+#ifdef HAS_ANTHY_PREDICTION
+ if (candidate_id < SCIM_ANTHY_CANDIDATE_DEFAULT)
+ return;
+
+ struct anthy_prediction_stat ps;
+ anthy_get_prediction_stat (m_anthy_context, &ps);
+
+ if (ps.nr_prediction <= 0)
+ return;
+
+ if (!is_converting ()) {
+ m_cur_segment = 0;
+ m_segments.push_back (ConversionSegment (
+ get_prediction_string (0), 0,
+ m_reading.get_length ()));
+ }
+
+ if (candidate_id < ps.nr_prediction) {
+ m_segments[0].set (get_prediction_string (candidate_id),
+ candidate_id);
+ }
+#endif /* HAS_ANTHY_PREDICTION */
+
+ } else if (is_converting ()) {
+ if (candidate_id <= SCIM_ANTHY_LAST_SPECIAL_CANDIDATE)
+ return;
+
+ struct anthy_conv_stat conv_stat;
+ anthy_get_stat (m_anthy_context, &conv_stat);
+
+ if (conv_stat.nr_segment <= 0)
+ return;
+
+ if (segment_id < 0) {
+ if (m_cur_segment < 0)
+ return;
+ else
+ segment_id = m_cur_segment;
+ }
+ int real_segment_id = segment_id + m_start_id;
+
+ if (segment_id >= conv_stat.nr_segment)
+ return;
+
+ struct anthy_segment_stat seg_stat;
+ anthy_get_segment_stat (m_anthy_context, real_segment_id, &seg_stat);
+
+ if (candidate_id == SCIM_ANTHY_CANDIDATE_HALF) {
+ switch (m_segments[segment_id].get_candidate_id ()) {
+ case SCIM_ANTHY_CANDIDATE_LATIN:
+ case SCIM_ANTHY_CANDIDATE_WIDE_LATIN:
+ candidate_id = SCIM_ANTHY_CANDIDATE_LATIN;
+ break;
+ default:
+ candidate_id = SCIM_ANTHY_CANDIDATE_HALF_KATAKANA;
+ break;
+ }
+ }
+
+ if (candidate_id < seg_stat.nr_candidate) {
+ m_segments[segment_id].set (get_segment_string (segment_id,
+ candidate_id),
+ candidate_id);
+ }
+ }
+}
+
+
+
+//
+// preferences
+//
+bool
+Conversion::set_dict_encoding (String type)
+{
+#ifdef HAS_ANTHY_CONTEXT_SET_ENCODING
+ if (!strcasecmp (type.c_str (), "UTF-8") ||
+ !strcasecmp (type.c_str (), "UTF8"))
+ {
+ anthy_context_set_encoding (m_anthy_context, ANTHY_UTF8_ENCODING);
+ } else {
+ anthy_context_set_encoding (m_anthy_context, ANTHY_EUC_JP_ENCODING);
+ }
+#endif /* HAS_ANTHY_CONTEXT_SET_ENCODING */
+
+ if (m_iconv.set_encoding (type.c_str ())) {
+ return true;
+ } else {
+ return m_iconv.set_encoding ("EUC-JP");
+ }
+}
+
+
+
+//
+// Utilities
+//
+void
+Conversion::get_reading_substr (WideString &string,
+ int segment_id,
+ int candidate_id,
+ int seg_start,
+ int seg_len)
+{
+ int prev_cand = 0;
+
+ if (segment_id < (int) m_segments.size ())
+ prev_cand = m_segments[segment_id].get_candidate_id ();
+
+ switch ((CandidateType) candidate_id) {
+ case SCIM_ANTHY_CANDIDATE_LATIN:
+ if (prev_cand == SCIM_ANTHY_CANDIDATE_LATIN) {
+ String str = utf8_wcstombs (m_segments[segment_id].get_string ());
+ rotate_case (str);
+ string = utf8_mbstowcs (str);
+ } else {
+ string = m_reading.get (seg_start, seg_len,
+ SCIM_ANTHY_STRING_LATIN);
+ }
+ break;
+
+ case SCIM_ANTHY_CANDIDATE_WIDE_LATIN:
+ if (prev_cand == SCIM_ANTHY_CANDIDATE_WIDE_LATIN) {
+ String str;
+ util_convert_to_half (str, m_segments[segment_id].get_string ());
+ rotate_case (str);
+ util_convert_to_wide (string, str);
+ } else {
+ string = m_reading.get (seg_start, seg_len,
+ SCIM_ANTHY_STRING_WIDE_LATIN);
+ }
+ break;
+
+ case SCIM_ANTHY_CANDIDATE_KATAKANA:
+ string = m_reading.get (seg_start, seg_len,
+ SCIM_ANTHY_STRING_KATAKANA);
+ break;
+
+ case SCIM_ANTHY_CANDIDATE_HALF_KATAKANA:
+ string = m_reading.get (seg_start, seg_len,
+ SCIM_ANTHY_STRING_HALF_KATAKANA);
+ break;
+
+ case SCIM_ANTHY_CANDIDATE_HALF:
+ // shouldn't reach to this entry
+ string = m_reading.get (seg_start, seg_len,
+ SCIM_ANTHY_STRING_HALF_KATAKANA);
+ break;
+
+ case SCIM_ANTHY_CANDIDATE_HIRAGANA:
+ default:
+ string = m_reading.get (seg_start, seg_len,
+ SCIM_ANTHY_STRING_HIRAGANA);
+ break;
+ }
+}
+
+WideString
+Conversion::get_prediction_string (int candidate_id)
+{
+#ifdef HAS_ANTHY_PREDICTION
+ if (!is_predicting ())
+ return WideString ();
+
+ struct anthy_prediction_stat ps;
+ anthy_get_prediction_stat (m_anthy_context, &ps);
+
+ if (ps.nr_prediction <= 0)
+ return WideString ();
+
+ int len = anthy_get_prediction (m_anthy_context, candidate_id, NULL, 0);
+ if (len <= 0)
+ return WideString ();
+
+ char buf[len + 1];
+ anthy_get_prediction (m_anthy_context, candidate_id, buf, len + 1);
+ buf[len] = '\0';
+
+ WideString cand;
+ m_iconv.convert (cand, buf);
+
+ return cand;
+#else /* HAS_ANTHY_PREDICTION */
+ return WideString ();
+#endif /* HAS_ANTHY_PREDICTION */
+}
+
+void
+Conversion::join_all_segments (void)
+{
+ do {
+ struct anthy_conv_stat conv_stat;
+ anthy_get_stat (m_anthy_context, &conv_stat);
+ int nr_seg = conv_stat.nr_segment - m_start_id;
+
+ if (nr_seg > 1)
+ anthy_resize_segment (m_anthy_context, m_start_id, 1);
+ else
+ break;
+ } while (true);
+}
+
+static void
+rotate_case (String &str)
+{
+ bool is_mixed = false;
+ for (unsigned int i = 1; i < str.length (); i++) {
+ if ((isupper (str[0]) && islower (str[i])) ||
+ (islower (str[0]) && isupper (str[i])))
+ {
+ is_mixed = true;
+ break;
+ }
+ }
+
+ if (is_mixed) {
+ // Anthy -> anthy, anThy -> anthy
+ for (unsigned int i = 0; i < str.length (); i++)
+ str[i] = tolower (str[i]);
+ } else if (isupper (str[0])) {
+ // ANTHY -> Anthy
+ for (unsigned int i = 1; i < str.length (); i++)
+ str[i] = tolower (str[i]);
+ } else {
+ // anthy -> ANTHY
+ for (unsigned int i = 0; i < str.length (); i++)
+ str[i] = toupper (str[i]);
+ }
+}
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SCIM_ANTHY_CONVERSION_H__
+#define __SCIM_ANTHY_CONVERSION_H__
+
+#define Uses_SCIM_ICONV
+#define Uses_SCIM_ATTRIBUTE
+#define Uses_SCIM_LOOKUP_TABLE
+#include <scim.h>
+#include <anthy/anthy.h>
+
+#include "scim_anthy_reading.h"
+
+using namespace scim;
+
+class AnthyInstance;
+
+namespace scim_anthy {
+
+typedef enum {
+ SCIM_ANTHY_CANDIDATE_DEFAULT = 0,
+ SCIM_ANTHY_CANDIDATE_LATIN = -1,
+ SCIM_ANTHY_CANDIDATE_WIDE_LATIN = -2,
+ SCIM_ANTHY_CANDIDATE_HIRAGANA = -3,
+ SCIM_ANTHY_CANDIDATE_KATAKANA = -4,
+ SCIM_ANTHY_CANDIDATE_HALF_KATAKANA = -5,
+ SCIM_ANTHY_CANDIDATE_HALF = -6,
+ SCIM_ANTHY_LAST_SPECIAL_CANDIDATE = -7,
+} CandidateType;
+
+class ConversionSegment
+{
+public:
+ ConversionSegment (WideString str,
+ int cand_id,
+ unsigned int reading_len);
+ virtual ~ConversionSegment ();
+
+ WideString & get_string (void);
+ int get_candidate_id (void);
+ unsigned int get_reading_length (void);
+
+ void set (WideString str,
+ int cand_id);
+ void set_reading_length (unsigned int len);
+
+private:
+ WideString m_string;
+ int m_cand_id;
+ unsigned int m_reading_len;
+};
+typedef std::vector<ConversionSegment> ConversionSegments;
+
+class Conversion
+{
+public:
+ Conversion (AnthyInstance &anthy, Reading &reading);
+ virtual ~Conversion ();
+
+ // starting and finishing
+ void convert (WideString source,
+ CandidateType ctype,
+ bool single_segment);
+ void convert (CandidateType type
+ = SCIM_ANTHY_CANDIDATE_DEFAULT,
+ bool single_segment = false);
+ void convert (const WideString &source,
+ bool single_segment = false);
+ void predict (void);
+ void clear (int segment_id = -1);
+ void commit (int segment_id = -1,
+ bool learn = true);
+
+ // getting status
+ bool is_converting (void);
+ bool is_predicting (void);
+
+ WideString get (void);
+ unsigned int get_length (void);
+ AttributeList get_attribute_list (void);
+
+ // segments of the converted sentence
+ int get_nr_segments (void);
+ WideString get_segment_string (int segment_id = -1,
+ int candidate_id
+ = SCIM_ANTHY_LAST_SPECIAL_CANDIDATE);
+ int get_selected_segment (void);
+ void select_segment (int segment_id);
+ int get_segment_size (int segment_id = -1);
+ void resize_segment (int relative_size,
+ int segment_id = -1);
+ unsigned int get_segment_position (int segment_id = -1);
+
+ // candidates for a segment or prediction
+ void get_candidates (CommonLookupTable &table,
+ int segment_id = -1);
+ int get_selected_candidate (int segment_id = -1);
+ void select_candidate (int candidate_id,
+ int segment_id = -1);
+
+ // prefereneces
+ bool set_dict_encoding (String type);
+
+private:
+ void get_reading_substr (WideString &string,
+ int segment_id,
+ int candidate_id,
+ int seg_start,
+ int seg_len);
+ WideString get_prediction_string (int candidate_id);
+ void join_all_segments (void);
+
+private:
+ AnthyInstance &m_anthy;
+
+ // convertors
+ IConvert m_iconv;
+ Reading &m_reading;
+ anthy_context_t m_anthy_context;
+
+ // status variables
+ ConversionSegments m_segments;
+ int m_start_id; // number of commited segments
+ int m_cur_segment; // relative position from m_start_id
+ bool m_predicting;
+};
+
+}
+
+#endif /* __SCIM_ANTHY_READING_H__ */
+/*
+vi:ts=4:nowrap:ai:expandtab
+*/
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004-2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#define Uses_SCIM_EVENT
+#include <scim.h>
+#include "scim_anthy_default_tables.h"
+
+using namespace scim;
+
+/* from Suikyo */
+ConvRule scim_anthy_romaji_typing_rule[] = {
+{"-", "ー", ""},
+#if 0
+{"[", "「", ""},
+{"]", "」", ""},
+#endif
+{"a", "あ", ""},
+{"i", "い", ""},
+{"u", "う", ""},
+{"e", "え", ""},
+{"o", "お", ""},
+{"xa", "ぁ", ""},
+{"xi", "ぃ", ""},
+{"xu", "ぅ", ""},
+{"xe", "ぇ", ""},
+{"xo", "ぉ", ""},
+{"la", "ぁ", ""},
+{"li", "ぃ", ""},
+{"lu", "ぅ", ""},
+{"le", "ぇ", ""},
+{"lo", "ぉ", ""},
+{"wi", "うぃ", ""},
+{"we", "うぇ", ""},
+{"wha", "うぁ", ""},
+{"whi", "うぃ", ""},
+{"whe", "うぇ", ""},
+{"who", "うぉ", ""},
+#if 0
+{"va", "う゛ぁ", ""},
+{"vi", "う゛ぃ", ""},
+{"vu", "う゛", ""},
+{"ve", "う゛ぇ", ""},
+{"vo", "う゛ぉ", ""},
+#else
+{"va", "ヴぁ", ""},
+{"vi", "ヴぃ", ""},
+{"vu", "ヴ", ""},
+{"ve", "ヴぇ", ""},
+{"vo", "ヴぉ", ""},
+#endif
+{"ka", "か", ""},
+{"ki", "き", ""},
+{"ku", "く", ""},
+{"ke", "け", ""},
+{"ko", "こ", ""},
+{"ga", "が", ""},
+{"gi", "ぎ", ""},
+{"gu", "ぐ", ""},
+{"ge", "げ", ""},
+{"go", "ご", ""},
+{"kya", "きゃ", ""},
+{"kyi", "きぃ", ""},
+{"kyu", "きゅ", ""},
+{"kye", "きぇ", ""},
+{"kyo", "きょ", ""},
+{"gya", "ぎゃ", ""},
+{"gyi", "ぎぃ", ""},
+{"gyu", "ぎゅ", ""},
+{"gye", "ぎぇ", ""},
+{"gyo", "ぎょ", ""},
+{"sa", "さ", ""},
+{"si", "し", ""},
+{"su", "す", ""},
+{"se", "せ", ""},
+{"so", "そ", ""},
+{"za", "ざ", ""},
+{"zi", "じ", ""},
+{"zu", "ず", ""},
+{"ze", "ぜ", ""},
+{"zo", "ぞ", ""},
+{"sya", "しゃ", ""},
+{"syi", "しぃ", ""},
+{"syu", "しゅ", ""},
+{"sye", "しぇ", ""},
+{"syo", "しょ", ""},
+{"sha", "しゃ", ""},
+{"shi", "し", ""},
+{"shu", "しゅ", ""},
+{"she", "しぇ", ""},
+{"sho", "しょ", ""},
+{"zya", "じゃ", ""},
+{"zyi", "じぃ", ""},
+{"zyu", "じゅ", ""},
+{"zye", "じぇ", ""},
+{"zyo", "じょ", ""},
+{"ja", "じゃ", ""},
+{"jya", "じゃ", ""},
+{"ji", "じ", ""},
+{"jyi", "じぃ", ""},
+{"ju", "じゅ", ""},
+{"jyu", "じゅ", ""},
+{"je", "じぇ", ""},
+{"jye", "じぇ", ""},
+{"jo", "じょ", ""},
+{"jyo", "じょ", ""},
+{"ta", "た", ""},
+{"ti", "ち", ""},
+{"tu", "つ", ""},
+{"tsu", "つ", ""},
+{"te", "て", ""},
+{"to", "と", ""},
+{"da", "だ", ""},
+{"di", "ぢ", ""},
+{"du", "づ", ""},
+{"de", "で", ""},
+{"do", "ど", ""},
+{"xtu", "っ", ""},
+{"xtsu","っ" ""},
+{"ltu", "っ", ""},
+{"ltsu","っ" ""},
+{"tya", "ちゃ", ""},
+{"tyi", "ちぃ", ""},
+{"tyu", "ちゅ", ""},
+{"tye", "ちぇ", ""},
+{"tyo", "ちょ", ""},
+{"cha", "ちゃ", ""},
+{"chi", "ち", ""},
+{"chu", "ちゅ", ""},
+{"che", "ちぇ", ""},
+{"cho", "ちょ", ""},
+{"dya", "ぢゃ", ""},
+{"dyi", "ぢぃ", ""},
+{"dyu", "ぢゅ", ""},
+{"dye", "ぢぇ", ""},
+{"dyo", "ぢょ", ""},
+{"tha", "てゃ", ""},
+{"thi", "てぃ", ""},
+{"thu", "てゅ", ""},
+{"the", "てぇ", ""},
+{"tho", "てょ", ""},
+{"dha", "でゃ", ""},
+{"dhi", "でぃ", ""},
+{"dhu", "でゅ", ""},
+{"dhe", "でぇ", ""},
+{"dho", "でょ", ""},
+{"na", "な", ""},
+{"ni", "に", ""},
+{"nu", "ぬ", ""},
+{"ne", "ね", ""},
+{"no", "の", ""},
+{"nya", "にゃ", ""},
+{"nyi", "にぃ", ""},
+{"nyu", "にゅ", ""},
+{"nye", "にぇ", ""},
+{"nyo", "にょ", ""},
+{"ha", "は", ""},
+{"hi", "ひ", ""},
+{"hu", "ふ", ""},
+{"fu", "ふ", ""},
+{"he", "へ", ""},
+{"ho", "ほ", ""},
+{"ba", "ば", ""},
+{"bi", "び", ""},
+{"bu", "ぶ", ""},
+{"be", "べ", ""},
+{"bo", "ぼ", ""},
+{"pa", "ぱ", ""},
+{"pi", "ぴ", ""},
+{"pu", "ぷ", ""},
+{"pe", "ぺ", ""},
+{"po", "ぽ", ""},
+{"hya", "ひゃ", ""},
+{"hyi", "ひぃ", ""},
+{"hyu", "ひゅ", ""},
+{"hye", "ひぇ", ""},
+{"hyo", "ひょ", ""},
+{"bya", "びゃ", ""},
+{"byi", "びぃ", ""},
+{"byu", "びゅ", ""},
+{"bye", "びぇ", ""},
+{"byo", "びょ", ""},
+{"pya", "ぴゃ", ""},
+{"pyi", "ぴぃ", ""},
+{"pyu", "ぴゅ", ""},
+{"pye", "ぴぇ", ""},
+{"pyo", "ぴょ", ""},
+{"fa", "ふぁ", ""},
+{"fi", "ふぃ", ""},
+{"fu", "ふ", ""},
+{"fe", "ふぇ", ""},
+{"fo", "ふぉ", ""},
+{"ma", "ま", ""},
+{"mi", "み", ""},
+{"mu", "む", ""},
+{"me", "め", ""},
+{"mo", "も", ""},
+{"mya", "みゃ", ""},
+{"myi", "みぃ", ""},
+{"myu", "みゅ", ""},
+{"mye", "みぇ", ""},
+{"myo", "みょ", ""},
+{"lya", "ゃ", ""},
+{"xya", "ゃ", ""},
+{"ya", "や", ""},
+{"lyu", "ゅ", ""},
+{"xyu", "ゅ", ""},
+{"yu", "ゆ", ""},
+{"lyo", "ょ", ""},
+{"xyo", "ょ", ""},
+{"yo", "よ", ""},
+{"ra", "ら", ""},
+{"ri", "り", ""},
+{"ru", "る", ""},
+{"re", "れ", ""},
+{"ro", "ろ", ""},
+{"rya", "りゃ", ""},
+{"ryi", "りぃ", ""},
+{"ryu", "りゅ", ""},
+{"rye", "りぇ", ""},
+{"ryo", "りょ", ""},
+{"xwa", "ゎ", ""},
+{"wa", "わ", ""},
+{"wo", "を", ""},
+{"n'", "ん", ""},
+{"nn", "ん", ""},
+{"n", "ん", ""},
+{"wyi", "ゐ", ""},
+{"wye", "ゑ", ""},
+#if 0 /* emulate dead key */
+{"\\.", "・", ""},
+{";r", "→", ""},
+{";l", "←", ""},
+{";u","↑", ""},
+{";d", "↓", ""},
+{";p", "〒", ""},
+{";e", "€", ""},
+{";t", "™", ""},
+{";s", "®", ""},
+{";c", "©", ""},
+#endif
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_romaji_double_consonant_rule[] = {
+{"vv", "っ", "v"},
+{"xx", "っ", "x"},
+{"kk", "っ", "k"},
+{"gg", "っ", "g"},
+{"ss", "っ", "s"},
+{"zz", "っ", "z"},
+{"jj", "っ", "j"},
+{"tt", "っ", "t"},
+{"dd", "っ", "d"},
+{"hh", "っ", "h"},
+{"ff", "っ", "f"},
+{"bb", "っ", "b"},
+{"pp", "っ", "p"},
+{"mm", "っ", "m"},
+{"yy", "っ", "y"},
+{"rr", "っ", "r"},
+{"ww", "っ", "w"},
+{"cc", "っ", "c"},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_half_symbol_rule[] = {
+{",", ",", ""},
+{".", ".", ""},
+{"!", "!", ""},
+{"\"", "\"", ""},
+{"#", "#", ""},
+{"$", "$", ""},
+{"%", "%", ""},
+{"&", "&", ""},
+{"'", "'", ""},
+{"(", "(", ""},
+{")", ")", ""},
+{"~", "~", ""},
+{"-", "-", ""},
+{"=", "=", ""},
+{"^", "^", ""},
+{"\\", "\\", ""},
+{"|", "|", ""},
+{"`", "`", ""},
+{"@", "@", ""},
+{"{", "{", ""},
+{"[", "[", ""},
+{"+", "+", ""},
+{";", ";", ""},
+{"*", "*", ""},
+{":", ":", ""},
+{"}", "}", ""},
+{"]", "]", ""},
+{"<", "<", ""},
+{">", ">", ""},
+{"?", "?", ""},
+{"/", "/", ""},
+{"_", "_", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_wide_symbol_rule[] = {
+{",", "、", ""},
+{".", "。", ""},
+{"!", "!", ""},
+{"\"", "”", ""},
+{"#", "#", ""},
+{"$", "$", ""},
+{"%", "%", ""},
+{"&", "&", ""},
+{"'", "’", ""},
+{"(", "(", ""},
+{")", ")", ""},
+{"~", "〜", ""},
+{"-", "ー", ""},
+{"=", "=", ""},
+{"^", "^", ""},
+{"\\", "\", ""},
+{"|", "|", ""},
+{"`", "‘", ""},
+{"@", "@", ""},
+{"{", "{", ""},
+{"[", "「", ""},
+{"+", "+", ""},
+{";", ";", ""},
+{"*", "*", ""},
+{":", ":", ""},
+{"}", "}", ""},
+{"]", "」", ""},
+{"<", "<", ""},
+{">", ">", ""},
+{"?", "?", ""},
+{"/", "/", ""},
+{"_", "_", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_half_number_rule[] = {
+{"1", "1", ""},
+{"2", "2", ""},
+{"3", "3", ""},
+{"4", "4", ""},
+{"5", "5", ""},
+{"6", "6", ""},
+{"7", "7", ""},
+{"8", "8", ""},
+{"9", "9", ""},
+{"0", "0", ""},
+{NULL, NULL, NULL},
+};
+
+
+ConvRule scim_anthy_wide_number_rule[] = {
+{"1", "1", ""},
+{"2", "2", ""},
+{"3", "3", ""},
+{"4", "4", ""},
+{"5", "5", ""},
+{"6", "6", ""},
+{"7", "7", ""},
+{"8", "8", ""},
+{"9", "9", ""},
+{"0", "0", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_kana_typing_rule[] = {
+// no modifiers keys
+{"1", "ぬ", ""},
+{"2", "", "ふ"},
+{"3", "あ", ""},
+{"4", "う", ""},
+{"5", "え", ""},
+{"6", "お", ""},
+{"7", "や", ""},
+{"8", "ゆ", ""},
+{"9", "よ", ""},
+{"0", "わ", ""},
+{"-", "", "ほ"},
+{"^", "", "へ"},
+
+{"q", "", "た"},
+{"w", "", "て"},
+{"e", "い", ""},
+{"r", "", "す"},
+{"t", "", "か"},
+{"y", "ん", ""},
+{"u", "な", ""},
+{"i", "に", ""},
+{"o", "ら", ""},
+{"p", "", "せ"},
+{"@", "゛", ""},
+{"[", "゜", ""},
+
+{"a", "", "ち"},
+{"s", "", "と"},
+{"d", "", "し"},
+{"f", "", "は"},
+{"g", "", "き"},
+{"h", "", "く"},
+{"j", "ま", ""},
+{"k", "の", ""},
+{"l", "り", ""},
+{";", "れ", ""},
+{":", "", "け"},
+{"]", "む", ""},
+
+{"z", "", "つ"},
+{"x", "", "さ"},
+{"c", "", "そ"},
+{"v", "", "ひ"},
+{"b", "", "こ"},
+{"n", "み", ""},
+{"m", "も", ""},
+{",", "ね", ""},
+{".", "る", ""},
+{"/", "め", ""},
+{"\\", "ー", ""},
+
+// shift modifiered keys
+{"!", "ぬ", ""},
+{"\"", "", "ふ"},
+{"#", "ぁ", ""},
+{"$", "ぅ", ""},
+{"%", "ぇ", ""},
+{"&", "ぉ", ""},
+{"'", "ゃ", ""},
+{"(", "ゅ", ""},
+{")", "ょ", ""},
+{"~", "を", ""},
+{"=", "", "ほ"},
+{"|", "ー", ""},
+
+{"Q", "", "た"},
+{"W", "", "て"},
+{"E", "ぃ", ""},
+{"R", "", "す"},
+{"T", "ヵ", ""},
+{"Y", "ん", ""},
+{"U", "な", ""},
+{"I", "に", ""},
+{"O", "ら", ""},
+{"P", "", "せ"},
+{"`", "゛", ""},
+#if 0
+{"{", "「", ""},
+#endif
+
+{"A", "", "ち"},
+{"S", "", "と"},
+{"D", "", "し"},
+{"F", "ゎ", ""},
+{"G", "", "き"},
+{"H", "", "く"},
+{"J", "ま", ""},
+{"K", "の", ""},
+{"L", "り", ""},
+{"+", "れ", ""},
+{"*", "ヶ", ""},
+#if 0
+{"}", "」", ""},
+#endif
+
+{"Z", "っ", ""},
+{"X", "", "さ"},
+{"C", "", "そ"},
+{"V", "", "ゐ"},
+{"B", "", "こ"},
+{"M", "も", ""},
+{"N", "み", ""},
+#if 0
+{"?", "・", ""},
+#endif
+{"_", "ろ", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_kana_voiced_consonant_rule[] = {
+{"か@", "が", ""},
+{"き@", "ぎ", ""},
+{"く@", "ぐ", ""},
+{"け@", "げ", ""},
+{"こ@", "ご", ""},
+{"さ@", "ざ", ""},
+{"し@", "じ", ""},
+{"す@", "ず", ""},
+{"せ@", "ぜ", ""},
+{"そ@", "ぞ", ""},
+{"た@", "だ", ""},
+{"ち@", "ぢ", ""},
+{"つ@", "づ", ""},
+{"て@", "で", ""},
+{"と@", "ど", ""},
+{"は@", "ば", ""},
+{"ひ@", "び", ""},
+{"ふ@", "ぶ", ""},
+{"へ@", "べ", ""},
+{"ほ@", "ぼ", ""},
+{"か`", "が", ""},
+{"き`", "ぎ", ""},
+{"く`", "ぐ", ""},
+{"け`", "げ", ""},
+{"こ`", "ご", ""},
+{"さ`", "ざ", ""},
+{"し`", "じ", ""},
+{"す`", "ず", ""},
+{"せ`", "ぜ", ""},
+{"そ`", "ぞ", ""},
+{"た`", "だ", ""},
+{"ち`", "ぢ", ""},
+{"つ`", "づ", ""},
+{"て`", "で", ""},
+{"と`", "ど", ""},
+{"は`", "ば", ""},
+{"ひ`", "び", ""},
+{"ふ`", "ぶ", ""},
+{"へ`", "べ", ""},
+{"ほ`", "ぼ", ""},
+{"は[", "ぱ", ""},
+{"ひ[", "ぴ", ""},
+{"ふ[", "ぷ", ""},
+{"へ[", "ぺ", ""},
+{"ほ[", "ぽ", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_romaji_ja_period_rule[] = {
+{".", "。", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_romaji_ja_comma_rule[] = {
+{",", "、", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_romaji_wide_period_rule[] = {
+{".", ".", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_romaji_wide_comma_rule[] = {
+{",", ",", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_romaji_half_period_rule[] = {
+{".", ".", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_romaji_half_comma_rule[] = {
+{",", ",", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_kana_ja_period_rule[] = {
+{">", "。", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_kana_ja_comma_rule[] = {
+{"<", "、", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_kana_wide_period_rule[] = {
+{">", ".", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_kana_wide_comma_rule[] = {
+{"<", ",", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_kana_half_period_rule[] = {
+{">", ".", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_kana_half_comma_rule[] = {
+{"<", ",", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_romaji_ja_bracket_rule[] = {
+{"[", "「", ""},
+{"]", "」", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_romaji_wide_bracket_rule[] = {
+{"[", "[", ""},
+{"]", "]", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_kana_ja_bracket_rule[] = {
+{"{", "「", ""},
+{"}", "」", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_kana_wide_bracket_rule[] = {
+{"{", "[", ""},
+{"}", "]", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_romaji_ja_slash_rule[] = {
+{"/", "・", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_romaji_wide_slash_rule[] = {
+{"/", "/", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_kana_ja_slash_rule[] = {
+{"?", "・", ""},
+{NULL, NULL, NULL},
+};
+
+ConvRule scim_anthy_kana_wide_slash_rule[] = {
+{"?", "/", ""},
+{NULL, NULL, NULL},
+};
+
+HiraganaKatakanaRule scim_anthy_hiragana_katakana_table[] = {
+{"あ", "ア", "ア"},
+{"い", "イ", "イ"},
+{"う", "ウ", "ウ"},
+{"え", "エ", "エ"},
+{"お", "オ", "オ"},
+{"か", "カ", "カ"},
+{"き", "キ", "キ"},
+{"く", "ク", "ク"},
+{"け", "ケ", "ケ"},
+{"こ", "コ", "コ"},
+{"が", "ガ", "ガ"},
+{"ぎ", "ギ", "ギ"},
+{"ぐ", "グ", "グ"},
+{"げ", "ゲ", "ゲ"},
+{"ご", "ゴ", "ゴ"},
+{"さ", "サ", "サ"},
+{"し", "シ", "シ"},
+{"す", "ス", "ス"},
+{"せ", "セ", "セ"},
+{"そ", "ソ", "ソ"},
+{"ざ", "ザ", "ザ"},
+{"じ", "ジ", "ジ"},
+{"ず", "ズ", "ズ"},
+{"ぜ", "ゼ", "ゼ"},
+{"ぞ", "ゾ", "ゾ"},
+{"た", "タ", "タ"},
+{"ち", "チ", "チ"},
+{"つ", "ツ", "ツ"},
+{"て", "テ", "テ"},
+{"と", "ト", "ト"},
+{"だ", "ダ", "ダ"},
+{"ぢ", "ヂ", "ヂ"},
+{"づ", "ヅ", "ヅ"},
+{"で", "デ", "デ"},
+{"ど", "ド", "ド"},
+{"な", "ナ", "ナ"},
+{"に", "ニ", "ニ"},
+{"ぬ", "ヌ", "ヌ"},
+{"ね", "ネ", "ネ"},
+{"の", "ノ", "ノ"},
+{"は", "ハ", "ハ"},
+{"ひ", "ヒ", "ヒ"},
+{"ふ", "フ", "フ"},
+{"へ", "ヘ", "ヘ"},
+{"ほ", "ホ", "ホ"},
+{"ば", "バ", "バ"},
+{"び", "ビ", "ビ"},
+{"ぶ", "ブ", "ブ"},
+{"べ", "ベ", "ベ"},
+{"ぼ", "ボ", "ボ"},
+{"ぱ", "パ", "パ"},
+{"ぴ", "ピ", "ピ"},
+{"ぷ", "プ", "プ"},
+{"ぺ", "ペ", "ペ"},
+{"ぽ", "ポ", "ポ"},
+{"ま", "マ", "マ"},
+{"み", "ミ", "ミ"},
+{"む", "ム", "ム"},
+{"め", "メ", "メ"},
+{"も", "モ", "モ"},
+{"や", "ヤ", "ヤ"},
+{"ゆ", "ユ", "ユ"},
+{"よ", "ヨ", "ヨ"},
+{"ら", "ラ", "ラ"},
+{"り", "リ", "リ"},
+{"る", "ル", "ル"},
+{"れ", "レ", "レ"},
+{"ろ", "ロ", "ロ"},
+
+{"わ", "ワ", "ワ"},
+{"を", "ヲ", "ヲ"},
+{"ん", "ン", "ン"},
+
+{"ぁ", "ァ", "ァ"},
+{"ぃ", "ィ", "ィ"},
+{"ぅ", "ゥ", "ゥ"},
+{"ぇ", "ェ", "ェ"},
+{"ぉ", "ォ", "ォ"},
+
+{"っ", "ッ", "ッ"},
+
+{"ゃ", "ャ", "ャ"},
+{"ゅ", "ュ", "ュ"},
+{"ょ", "ョ", "ョ"},
+
+{"ヵ", "ヵ", "カ"},
+{"ヶ", "ヶ", "ケ"},
+
+{"ゎ", "ヮ", "ワ"},
+{"ゐ", "ヰ", "ィ"},
+{"ゑ", "ヱ", "ェ"},
+
+#if 1
+//{"う゛" "ヴ" "ヴ"},
+{"ヴ" "ヴ" "ヴ"},
+#endif
+
+#if 1
+{"ー", "ー", "ー"},
+{"、", "、", "、"},
+{"。", "。", "。"},
+{"!", "!", "!"},
+{"”", "”", "\""},
+{"#", "#", "#"},
+{"$", "$", "$"},
+{"%", "%", "%"},
+{"&", "&", "&"},
+{"’", "’", "'"},
+{"(", "(", "("},
+{")", ")", ")"},
+{"〜", "〜", "~"},
+{"=", "=", "="},
+{"^", "^", "^"},
+{"\", "\", "\\"},
+{"|", "|", "|"},
+{"‘", "‘", "`"},
+{"@", "@", "@"},
+{"{", "{", "{"},
+{"「", "「", "「"},
+{"+", "+", "+"},
+{";", ";", ";"},
+{"*", "*", "*"},
+{":", ":", ":"},
+{"}", "}", "}"},
+{"」", "」", "」"},
+{"<", "<", "<"},
+{">", ">", ">"},
+{"?", "?", "?"},
+{"/", "/", "/"},
+{"_", "_", "_"},
+#endif
+{NULL, NULL, NULL},
+};
+
+WideRule scim_anthy_wide_table[] = {
+{"a", "a"},
+{"b", "b"},
+{"c", "c"},
+{"d", "d"},
+{"e", "e"},
+{"f", "f"},
+{"g", "g"},
+{"h", "h"},
+{"i", "i"},
+{"j", "j"},
+{"k", "k"},
+{"l", "l"},
+{"m", "m"},
+{"n", "n"},
+{"o", "o"},
+{"p", "p"},
+{"q", "q"},
+{"r", "r"},
+{"s", "s"},
+{"t", "t"},
+{"u", "u"},
+{"v", "v"},
+{"w", "w"},
+{"x", "x"},
+{"y", "y"},
+{"z", "z"},
+{"A", "A"},
+{"B", "B"},
+{"C", "C"},
+{"D", "D"},
+{"E", "E"},
+{"F", "F"},
+{"G", "G"},
+{"H", "H"},
+{"I", "I"},
+{"J", "J"},
+{"K", "K"},
+{"L", "L"},
+{"M", "M"},
+{"N", "N"},
+{"O", "O"},
+{"P", "P"},
+{"Q", "Q"},
+{"R", "R"},
+{"S", "S"},
+{"T", "T"},
+{"U", "U"},
+{"V", "V"},
+{"W", "W"},
+{"X", "X"},
+{"Y", "Y"},
+{"Z", "Z"},
+{"1", "1"},
+{"2", "2"},
+{"3", "3"},
+{"4", "4"},
+{"5", "5"},
+{"6", "6"},
+{"7", "7"},
+{"8", "8"},
+{"9", "9"},
+{"0", "0"},
+{"-", "−"},
+{",", ","},
+{".", "."},
+{"!", "!"},
+{"\"", "”"},
+{"#", "#"},
+{"$", "$"},
+{"%", "%"},
+{"&", "&"},
+{"'", "’"},
+{"(", "("},
+{")", ")"},
+{"~", "〜"},
+{"=", "="},
+{"^", "^"},
+{"\\", "\"},
+{"|", "|"},
+{"`", "‘"},
+{"@", "@"},
+{"{", "{"},
+{"[", "["},
+{"+", "+"},
+{";", ";"},
+{":", ":"},
+{"}", "}"},
+{"]", "]"},
+{"<", "<"},
+{">", ">"},
+{"?", "?"},
+{"/", "/"},
+{"_", "_"},
+{"*", "*"},
+{NULL, NULL},
+};
+
+VoicedConsonantRule scim_anthy_voiced_consonant_table[] = {
+{"か", "が", ""},
+{"き", "ぎ", ""},
+{"く", "ぐ", ""},
+{"け", "げ", ""},
+{"こ", "ご", ""},
+{"さ", "ざ", ""},
+{"し", "じ", ""},
+{"す", "ず", ""},
+{"せ", "ぜ", ""},
+{"そ", "ぞ", ""},
+{"た", "だ", ""},
+{"ち", "ぢ", ""},
+{"つ", "づ", ""},
+{"て", "で", ""},
+{"と", "ど", ""},
+{"は", "ば", "ぱ"},
+{"ひ", "び", "ぴ"},
+{"ふ", "ぶ", "ぷ"},
+{"へ", "べ", "ぺ"},
+{"ほ", "ぼ", "ぽ"},
+{NULL, NULL, NULL},
+};
+
+KeyCodeToCharRule scim_anthy_keypad_table[] = {
+{SCIM_KEY_KP_Equal, "="},
+{SCIM_KEY_KP_Multiply, "*"},
+{SCIM_KEY_KP_Add, "+"},
+{SCIM_KEY_KP_Separator, ","},
+{SCIM_KEY_KP_Subtract, "-"},
+{SCIM_KEY_KP_Decimal, "."},
+{SCIM_KEY_KP_Divide, "/"},
+{SCIM_KEY_KP_0, "0"},
+{SCIM_KEY_KP_1, "1"},
+{SCIM_KEY_KP_2, "2"},
+{SCIM_KEY_KP_3, "3"},
+{SCIM_KEY_KP_4, "4"},
+{SCIM_KEY_KP_5, "5"},
+{SCIM_KEY_KP_6, "6"},
+{SCIM_KEY_KP_7, "7"},
+{SCIM_KEY_KP_8, "8"},
+{SCIM_KEY_KP_9, "9"},
+{0, NULL}
+};
+
+KeyCodeToCharRule scim_anthy_kana_table[] = {
+{SCIM_KEY_kana_fullstop, "。"},
+{SCIM_KEY_kana_openingbracket, "「"},
+{SCIM_KEY_kana_closingbracket, "」"},
+{SCIM_KEY_kana_comma, "、"},
+{SCIM_KEY_kana_conjunctive, "・"},
+{SCIM_KEY_kana_middledot, "・"},
+{SCIM_KEY_kana_WO, "を"},
+{SCIM_KEY_kana_a, "ぁ"},
+{SCIM_KEY_kana_i, "ぃ"},
+{SCIM_KEY_kana_u, "ぅ"},
+{SCIM_KEY_kana_e, "ぇ"},
+{SCIM_KEY_kana_o, "ぉ"},
+{SCIM_KEY_kana_ya, "ゃ"},
+{SCIM_KEY_kana_yu, "ゅ"},
+{SCIM_KEY_kana_yo, "ょ"},
+{SCIM_KEY_kana_tsu, "っ"},
+{SCIM_KEY_kana_tu, "っ"},
+{SCIM_KEY_prolongedsound, "ー"},
+{SCIM_KEY_kana_A, "あ"},
+{SCIM_KEY_kana_I, "い"},
+{SCIM_KEY_kana_U, "う"},
+{SCIM_KEY_kana_E, "え"},
+{SCIM_KEY_kana_O, "お"},
+{SCIM_KEY_kana_O, "お"},
+{SCIM_KEY_kana_KA, "か"},
+{SCIM_KEY_kana_KI, "き"},
+{SCIM_KEY_kana_KU, "く"},
+{SCIM_KEY_kana_KE, "け"},
+{SCIM_KEY_kana_KO, "こ"},
+{SCIM_KEY_kana_SA, "さ"},
+{SCIM_KEY_kana_SHI, "し"},
+{SCIM_KEY_kana_SU, "す"},
+{SCIM_KEY_kana_SE, "せ"},
+{SCIM_KEY_kana_SO, "そ"},
+{SCIM_KEY_kana_TA, "た"},
+{SCIM_KEY_kana_CHI, "ち"},
+{SCIM_KEY_kana_TI, "ち"},
+{SCIM_KEY_kana_TSU, "つ"},
+{SCIM_KEY_kana_TU, "つ"},
+{SCIM_KEY_kana_TE, "て"},
+{SCIM_KEY_kana_TO, "と"},
+{SCIM_KEY_kana_NA, "な"},
+{SCIM_KEY_kana_NI, "に"},
+{SCIM_KEY_kana_NU, "ぬ"},
+{SCIM_KEY_kana_NE, "ね"},
+{SCIM_KEY_kana_NO, "の"},
+{SCIM_KEY_kana_HA, "は"},
+{SCIM_KEY_kana_HI, "ひ"},
+{SCIM_KEY_kana_FU, "ふ"},
+{SCIM_KEY_kana_HU, "ふ"},
+{SCIM_KEY_kana_HE, "へ"},
+{SCIM_KEY_kana_HO, "ほ"},
+{SCIM_KEY_kana_MA, "ま"},
+{SCIM_KEY_kana_MI, "み"},
+{SCIM_KEY_kana_MU, "む"},
+{SCIM_KEY_kana_ME, "め"},
+{SCIM_KEY_kana_MO, "も"},
+{SCIM_KEY_kana_YA, "や"},
+{SCIM_KEY_kana_YU, "ゆ"},
+{SCIM_KEY_kana_YO, "よ"},
+{SCIM_KEY_kana_RA, "ら"},
+{SCIM_KEY_kana_RI, "り"},
+{SCIM_KEY_kana_RU, "る"},
+{SCIM_KEY_kana_RE, "れ"},
+{SCIM_KEY_kana_RO, "ろ"},
+{SCIM_KEY_kana_WA, "わ"},
+{SCIM_KEY_kana_N, "ん"},
+{SCIM_KEY_voicedsound, "゛"},
+{SCIM_KEY_semivoicedsound, "゜"},
+{0, NULL}
+};
+
+NicolaRule scim_anthy_nicola_table[] = {
+// no modifiered keys
+{"1", "1", "?", "!"},
+{"2", "2", "/", "゛"},
+{"3", "3", "〜", "#"},
+{"4", "4", "「", "$"},
+{"5", "5", "」", "%"},
+{"6", "6", "&", "["},
+{"7", "7", "’", "]"},
+{"8", "8", "(", "("},
+{"9", "9", ")", ")"},
+{"0", "0", "〜", "『"},
+{"-", "−", "=", "』"},
+{"^", "^", "", ""},
+{"\\", "¥", "", ""},
+
+{"q", "。", "ぁ", "ゐ"},
+{"w", "か", "え", "が"},
+{"e", "た", "り", "だ"},
+{"r", "こ", "ゃ", "ご"},
+{"t", "さ", "れ", "ざ"},
+{"y", "ら", "ぱ", "よ"},
+{"u", "ち", "ぢ", "に"},
+{"i", "く", "ぐ", "る"},
+{"o", "つ", "づ", "ま"},
+{"p", ",", "ぴ", "ぇ"},
+{"@", "、", "", ""},
+{"[", "゛", "゜", "゜"},
+
+{"a", "う", "を", "ヴ"},
+{"s", "し", "あ", "じ"},
+{"d", "て", "な", "で"},
+{"f", "け", "ゅ", "げ"},
+{"g", "せ", "も", "ぜ"},
+{"h", "は", "ば", "み"},
+{"j", "と", "ど", "お"},
+{"k", "き", "ぎ", "の"},
+{"l", "い", "ぽ", "ょ"},
+{";", "ん", "", "っ"},
+{":", "", "", ""},
+{"]", "", "", ""},
+
+{"z", ".", "ぅ", "ゑ"},
+{"x", "ひ", "ー", "び"},
+{"c", "す", "ろ", "ず"},
+{"v", "ふ", "や", "ぶ"},
+{"b", "へ", "ぃ", "べ"},
+{"n", "め", "ぷ", "ぬ"},
+{"m", "そ", "ぞ", "ゆ"},
+{",", "ね", "ぺ", "む"},
+{".", "ほ", "ぼ", "わ"},
+{"/", "・", "ゎ", "ぉ"},
+
+// normal shift modifiered keys
+{"!", "!", "", ""},
+{"\"", "”", "", ""},
+{"#", "#", "", ""},
+{"$", "$", "", ""},
+{"%", "%", "", ""},
+{"&", "&", "", ""},
+{"'", "’", "", ""},
+{"(", "(", "", ""},
+{")", ")", "", ""},
+{"~", "〜", "", ""},
+{"=", "=", "", ""},
+{"|", "|", "", ""},
+
+{"`", "‘", "", ""},
+{"{", "{", "", ""},
+
+{"+", "+", "", ""},
+{"*", "*", "", ""},
+{"}", "}", "", ""},
+
+{"<", "<", "", ""},
+{">", ">", "", ""},
+{"?", "?", "", ""},
+{"_", "_", "", ""},
+
+{"Q", "。", "ぁ", "ゐ"},
+{"W", "が", "え", "が"},
+{"E", "だ", "り", "だ"},
+{"R", "ご", "ゃ", "ご"},
+{"T", "ざ", "れ", "ざ"},
+{"Y", "ぱ", "ぱ", "よ"},
+{"U", "ぢ", "ぢ", "に"},
+{"I", "ぐ", "ぐ", "る"},
+{"O", "づ", "づ", "ま"},
+{"P", "ぴ", "ぴ", "ぇ"},
+{"`", "、", "", ""},
+{"{", "゛", "゜", "゜"},
+
+{"A", "ヴ", "を", "ヴ"},
+{"S", "じ", "あ", "じ"},
+{"D", "で", "な", "で"},
+{"F", "げ", "ゅ", "げ"},
+{"G", "ぜ", "も", "ぜ"},
+{"H", "ば", "ば", "み"},
+{"J", "ど", "ど", "お"},
+{"K", "ぎ", "ぎ", "の"},
+{"L", "ぽ", "ぽ", "ょ"},
+{"+", "ん", "", "っ"},
+{"*", "", "", ""},
+{"}", "", "", ""},
+
+{"Z", ".", "ぅ", "ゑ"},
+{"X", "び", "ー", "び"},
+{"C", "ず", "ろ", "ず"},
+{"V", "ぶ", "や", "ぶ"},
+{"B", "べ", "ぃ", "べ"},
+{"N", "ぷ", "ぷ", "ぬ"},
+{"M", "ぞ", "ぞ", "ゆ"},
+{"<", "ぺ", "ぺ", "む"},
+{">", "ぽ", "ぼ", "わ"},
+{"?", "・", "ゎ", "ぉ"},
+
+{NULL, NULL, NULL, NULL},
+};
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004-2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SCIM_ANTHY_DEFAULT_TABLES_H__
+#define __SCIM_ANTHY_DEFAULT_TABLES_H__
+
+typedef struct _ConvRule
+{
+ const char *string;
+ const char *result;
+ const char *cont;
+} ConvRule;
+
+typedef struct _HiraganaKatakanaRule
+{
+ const char *hiragana;
+ const char *katakana;
+ const char *half_katakana;
+} HiraganaKatakanaRule;
+
+typedef struct _WideRule
+{
+ const char *code;
+ const char *wide;
+} WideRule;
+
+typedef struct _KeyCodeToCharRule
+{
+ unsigned int code;
+ const char *kana;
+} KeyCodeToCharRule;
+
+typedef struct _VoicedConsonantRule
+{
+ const char *string;
+ const char *voiced;
+ const char *half_voiced;
+} VoicedConsonantRule;
+
+typedef struct _NicolaRule
+{
+ const char *key;
+ const char *single;
+ const char *left_shift;
+ const char *right_shift;
+} NicolaRule;
+
+// fundamental table
+extern ConvRule scim_anthy_romaji_typing_rule[];
+extern ConvRule scim_anthy_romaji_double_consonant_rule[];
+extern ConvRule scim_anthy_kana_typing_rule[];
+extern ConvRule scim_anthy_kana_voiced_consonant_rule[];
+
+// symbol & number
+extern ConvRule scim_anthy_half_symbol_rule[];
+extern ConvRule scim_anthy_wide_symbol_rule[];
+extern ConvRule scim_anthy_half_number_rule[];
+extern ConvRule scim_anthy_wide_number_rule[];
+
+// period table
+extern ConvRule scim_anthy_romaji_ja_period_rule[];
+extern ConvRule scim_anthy_romaji_wide_period_rule[];
+extern ConvRule scim_anthy_romaji_half_period_rule[];
+
+extern ConvRule scim_anthy_kana_ja_period_rule[];
+extern ConvRule scim_anthy_kana_wide_period_rule[];
+extern ConvRule scim_anthy_kana_half_period_rule[];
+
+// comma table
+extern ConvRule scim_anthy_romaji_ja_comma_rule[];
+extern ConvRule scim_anthy_romaji_wide_comma_rule[];
+extern ConvRule scim_anthy_romaji_half_comma_rule[];
+
+extern ConvRule scim_anthy_kana_ja_comma_rule[];
+extern ConvRule scim_anthy_kana_wide_comma_rule[];
+extern ConvRule scim_anthy_kana_half_comma_rule[];
+
+// bracket table
+extern ConvRule scim_anthy_romaji_ja_bracket_rule[];
+extern ConvRule scim_anthy_romaji_wide_bracket_rule[];
+
+extern ConvRule scim_anthy_kana_ja_bracket_rule[];
+extern ConvRule scim_anthy_kana_wide_bracket_rule[];
+
+// slash table
+extern ConvRule scim_anthy_romaji_ja_slash_rule[];
+extern ConvRule scim_anthy_romaji_wide_slash_rule[];
+
+extern ConvRule scim_anthy_kana_ja_slash_rule[];
+extern ConvRule scim_anthy_kana_wide_slash_rule[];
+
+// misc
+extern HiraganaKatakanaRule scim_anthy_hiragana_katakana_table[];
+extern WideRule scim_anthy_wide_table[];
+extern VoicedConsonantRule scim_anthy_voiced_consonant_table[];
+
+// key code
+extern KeyCodeToCharRule scim_anthy_keypad_table[];
+extern KeyCodeToCharRule scim_anthy_kana_table[];
+
+// nicola
+extern NicolaRule scim_anthy_nicola_table[];
+
+#endif /* __SCIM_ANTHY_DEFAULT_TABLES_H__ */
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) Hiroyuki Ikezoe <poincare@ikezoe.net>
+ * Copyright (C) 2004 Takuro Ashie <ashie@homa.ne.jp>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * The original code is scim_uim_imengine.cpp in scim-uim-0.1.3.
+ * Copyright (C) 2004 James Su <suzhe@tsinghua.org.cn>
+ */
+
+#define Uses_SCIM_UTILITY
+#define Uses_SCIM_IMENGINE
+#define Uses_SCIM_CONFIG_BASE
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#endif
+
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <scim.h>
+#include "scim_anthy_factory.h"
+#include "scim_anthy_imengine.h"
+#include "scim_anthy_prefs.h"
+#include "scim_anthy_intl.h"
+
+#define scim_module_init ise_engine_anthy_LTX_scim_module_init
+#define scim_module_exit ise_engine_anthy_LTX_scim_module_exit
+#define scim_imengine_module_init ise_engine_anthy_LTX_scim_imengine_module_init
+#define scim_imengine_module_create_factory ise_engine_anthy_LTX_scim_imengine_module_create_factory
+
+#define SCIM_CONFIG_IMENGINE_ANTHY_UUID "/IMEngine/Anthy/UUID-"
+
+#ifndef SCIM_ANTHY_ICON_FILE
+ #define SCIM_ANTHY_ICON_FILE (SCIM_ICONDIR"/scim-anthy.png")
+#endif
+
+static ConfigPointer _scim_config (0);
+
+extern "C" {
+ void scim_module_init (void)
+ {
+ bindtextdomain (GETTEXT_PACKAGE, SCIM_ANTHY_LOCALEDIR);
+ bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
+ }
+
+ void scim_module_exit (void)
+ {
+ anthy_quit ();
+ _scim_config.reset ();
+ }
+
+ uint32 scim_imengine_module_init (const ConfigPointer &config)
+ {
+ SCIM_DEBUG_IMENGINE(1) << "Initialize Anthy Engine.\n";
+
+ _scim_config = config;
+
+ if (anthy_init ()) {
+ SCIM_DEBUG_IMENGINE(1) << "Failed to initialize Anthy Library!\n";
+ return 0;
+ }
+
+ return 1;
+ }
+
+ IMEngineFactoryPointer scim_imengine_module_create_factory (uint32 engine)
+ {
+ AnthyFactory *factory = 0;
+
+ try {
+ factory = new AnthyFactory (
+ String ("ja_JP"),
+ String ("065d7b20-dda2-47fb-8f94-3306d9a25e56"),
+ _scim_config);
+ } catch (...) {
+ delete factory;
+ factory = 0;
+ }
+
+ return factory;
+ }
+}
+
+AnthyFactory::AnthyFactory (const String &lang,
+ const String &uuid,
+ const ConfigPointer &config)
+ : m_uuid (uuid),
+ m_config (config),
+ m_input_mode (SCIM_ANTHY_CONFIG_INPUT_MODE_DEFAULT),
+ m_typing_method (SCIM_ANTHY_CONFIG_TYPING_METHOD_DEFAULT),
+ m_conversion_mode (SCIM_ANTHY_CONFIG_CONVERSION_MODE_DEFAULT),
+ m_period_style (SCIM_ANTHY_CONFIG_PERIOD_STYLE_DEFAULT),
+ m_symbol_style (SCIM_ANTHY_CONFIG_SYMBOL_STYLE_DEFAULT),
+ m_space_type (SCIM_ANTHY_CONFIG_SPACE_TYPE_DEFAULT),
+ m_ten_key_type (SCIM_ANTHY_CONFIG_TEN_KEY_TYPE_DEFAULT),
+ m_behavior_on_period (SCIM_ANTHY_CONFIG_BEHAVIOR_ON_PERIOD_DEFAULT),
+ m_behavior_on_focus_out (SCIM_ANTHY_CONFIG_BEHAVIOR_ON_FOCUS_OUT_DEFAULT),
+ m_show_candidates_label (SCIM_ANTHY_CONFIG_SHOW_CANDIDATES_LABEL_DEFAULT),
+ m_close_cand_win_on_select (SCIM_ANTHY_CONFIG_CLOSE_CAND_WIN_ON_SELECT_DEFAULT),
+ m_cand_win_page_size (SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE_DEFAULT),
+ m_n_triggers_to_show_cand_win (SCIM_ANTHY_CONFIG_N_TRIGGERS_TO_SHOW_CAND_WIN_DEFAULT),
+ m_learn_on_manual_commit (SCIM_ANTHY_CONFIG_LEARN_ON_MANUAL_COMMIT_DEFAULT),
+ m_learn_on_auto_commit (SCIM_ANTHY_CONFIG_LEARN_ON_AUTO_COMMIT_DEFAULT),
+ m_romaji_half_symbol (SCIM_ANTHY_CONFIG_ROMAJI_HALF_SYMBOL_DEFAULT),
+ m_romaji_half_number (SCIM_ANTHY_CONFIG_ROMAJI_HALF_NUMBER_DEFAULT),
+ m_romaji_allow_split (SCIM_ANTHY_CONFIG_ROMAJI_ALLOW_SPLIT_DEFAULT),
+ m_romaji_pseudo_ascii_mode (SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_MODE_DEFAULT),
+ m_romaji_pseudo_ascii_blank_behavior (SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR),
+ m_nicola_time (SCIM_ANTHY_CONFIG_NICOLA_TIME_DEFAULT),
+ m_dict_encoding (SCIM_ANTHY_CONFIG_DICT_ENCODING),
+ m_dict_admin_command (SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND_DEFAULT),
+ m_add_word_command (SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND_DEFAULT),
+ m_predict_on_input (SCIM_ANTHY_CONFIG_PREDICT_ON_INPUT_DEFAULT),
+ m_use_direct_key_on_predict (SCIM_ANTHY_CONFIG_USE_DIRECT_KEY_ON_PREDICT_DEFAULT),
+ m_show_input_mode_label (SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL_DEFAULT),
+ m_show_conv_mode_label (SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL_DEFAULT),
+ m_show_typing_method_label (SCIM_ANTHY_CONFIG_SHOW_TYPING_METHOD_LABEL_DEFAULT),
+ m_show_period_style_label (SCIM_ANTHY_CONFIG_SHOW_PERIOD_STYLE_LABEL_DEFAULT),
+ m_show_symbol_style_label (SCIM_ANTHY_CONFIG_SHOW_SYMBOL_STYLE_LABEL_DEFAULT),
+ m_show_dict_label (SCIM_ANTHY_CONFIG_SHOW_DICT_LABEL_DEFAULT),
+ m_show_dict_admin_label (SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL_DEFAULT),
+ m_show_add_word_label (SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL_DEFAULT),
+ m_preedit_style (SCIM_ANTHY_CONFIG_PREEDIT_STYLE_DEFAULT),
+ m_conversion_style (SCIM_ANTHY_CONFIG_CONVERSION_STYLE_DEFAULT),
+ m_selected_segment_style (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE_DEFAULT),
+ m_custom_romaji_table (NULL),
+ m_custom_kana_table (NULL),
+ m_custom_nicola_table (NULL),
+ m_kana_layout_ro_key (SCIM_ANTHY_CONFIG_KANA_LAYOUT_RO_KEY)
+{
+ SCIM_DEBUG_IMENGINE(1) << "Create Anthy Factory :\n";
+ SCIM_DEBUG_IMENGINE(1) << " Lang : " << lang << "\n";
+ SCIM_DEBUG_IMENGINE(1) << " UUID : " << uuid << "\n";
+
+ if (lang.length () >= 2)
+ set_languages (lang);
+
+ /* config */
+ reload_config (m_config);
+ m_reload_signal_connection = m_config->signal_connect_reload (slot (this, &AnthyFactory::reload_config));
+}
+
+AnthyFactory::~AnthyFactory ()
+{
+ m_reload_signal_connection.disconnect ();
+
+ if (m_custom_romaji_table) {
+ delete m_custom_romaji_table;
+ m_custom_romaji_table = NULL;
+ }
+
+ if (m_custom_kana_table) {
+ delete m_custom_kana_table;
+ m_custom_kana_table = NULL;
+ }
+
+ if (m_custom_nicola_table) {
+ delete m_custom_nicola_table;
+ m_custom_nicola_table = NULL;
+ }
+}
+
+WideString
+AnthyFactory::get_name () const
+{
+ return utf8_mbstowcs (String ("Anthy"));
+}
+
+WideString
+AnthyFactory::get_authors () const
+{
+ const char *package =
+ PACKAGE "-" PACKAGE_VERSION "\n"
+ "\n";
+ const char *authors =
+ _("Authors of scim-anthy:\n"
+ " Copyright (C) 2004,2005 Takuro Ashie <ashie@homa.ne.jp>\n"
+ " Copyright (C) 2004,2005 Hiroyuki Ikezoe <poincare@ikezoe.net>\n"
+ " \n"
+ "Authors of Anthy:\n"
+ " Copyright (C) 2000-2005 Yusuke TABATA <yusuke@w5.dion.ne.jp>\n"
+ " Copyright (C) 2004-2005 Yuichi YOSHIDA <oxy@kmc.gr.jp>\n"
+ " You can find out all credits of Anthy from AUTHORS file in Anthy package.\n");
+
+ return utf8_mbstowcs (package) + utf8_mbstowcs (authors);
+}
+
+WideString
+AnthyFactory::get_credits () const
+{
+ return utf8_mbstowcs (
+ _("Art work:\n"
+ " SHIMODA Hiroshi <piro@p.club.ne.jp>\n"
+ "\n"
+ "Translation:\n"
+ " Gerrit Sangel <z0idberg@gmx.de>"
+ "\n"
+ "Special thanks:\n"
+ " UTUMI Hirosi <utuhiro78@yahoo.co.jp>\n"
+ " Yukiko Bando <ybando@k6.dion.ne.jp>\n"
+ " Mike Fabian <mfabian@suse.de>\n"
+ " David Oftedal <david@start.no>\n"
+ " Ryo Dairiki <ryo-dairiki@users.sourceforge.net>\n"
+ " Seiichi SATO\n"
+ " AWASHIRO Ikuya <ikuya@oooug.jp>\n"
+ " Hatuka*nezumi <nezumi@jca.apc.org>\n"
+ " Teppei Tamra <tam-t@par.odn.ne.jp>\n"
+ " Akira TAGOH <at@gclab.org>\n"
+ " Tatsuki Sugiura <sugi@nemui.org>\n"
+ " Takashi Nakamoto <bluedwarf@bpost.plala.or.jp>"));
+}
+
+WideString
+AnthyFactory::get_help () const
+{
+ const char *title =
+ _("Basic operation:\n"
+ " \n");
+
+ const char *text1 =
+ _("1. Switch input mode:\n"
+ " You can switch on/off Japanese input mode by pressing Zenkaku_Hankaku key\n"
+ " or Control+J. Or you can rotate all input modes by pressing Control+,\n"
+ " (comma).\n"
+ " \n");
+
+ const char *text2 =
+ _("2. Input Japanese hiragana and katakana:\n"
+ " You can input Japanese hiragana and katakana by inputting romaji.\n"
+ " The Romaji table can be found out from the \"Anthy\" section of the setup\n"
+ " window in SCIM or SKIM.\n"
+ " If you want to hiragana and katakana directly by using Japanese keyboard,\n"
+ " please press Alt + Romaji key or Conrol+\\ key to switch typing method.\n"
+ " \n");
+
+ const char *text3 =
+ _("3. Convert hiragana or katakana to Japanese kanji\n"
+ " After inputting hiragana or katakana, you can convert it to Japanese\n"
+ " kanji by pressing Space key. Then it will show some candidates. You can\n"
+ " select the next candidate by pressing Space key, and can commit it by\n"
+ " pressing Enter key.\n"
+ " If you input a sentense, Anthy will split it to some segments. You can\n"
+ " select the next or previous segment by pressing left or right cursor key,\n"
+ " and can extend or shrink the selected segment by pressing Shift + left or\n"
+ " right cursor key.\n"
+ " \n");
+
+ const char *text4 =
+ _("4. Other key bindings:\n"
+ " You can find out all key bindings definition of scim-anthy from \"Anthy\"\n"
+ " section on setup window of SCIM or SKIM.\n");
+
+ return utf8_mbstowcs (title)
+ + utf8_mbstowcs (text1)
+ + utf8_mbstowcs (text2)
+ + utf8_mbstowcs (text3)
+ + utf8_mbstowcs (text4);
+}
+
+String
+AnthyFactory::get_uuid () const
+{
+ return m_uuid;
+}
+
+String
+AnthyFactory::get_icon_file () const
+{
+ return String (SCIM_ANTHY_ICON_FILE);
+}
+
+IMEngineInstancePointer
+AnthyFactory::create_instance (const String &encoding, int id)
+{
+ return new AnthyInstance (this, encoding, id);
+}
+
+void
+AnthyFactory::append_config_listener (AnthyInstance *listener)
+{
+ bool found = false;
+ std::vector<AnthyInstance*>::iterator it;
+ for (it = m_config_listeners.begin();
+ it != m_config_listeners.end();
+ it++)
+ {
+ if (*it == listener) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found)
+ m_config_listeners.push_back (listener);
+}
+
+void
+AnthyFactory::remove_config_listener (AnthyInstance *listener)
+{
+ std::vector<AnthyInstance*>::iterator it;
+ for (it = m_config_listeners.begin();
+ it != m_config_listeners.end();
+ it++)
+ {
+ if (*it == listener) {
+ m_config_listeners.erase (it);
+ break;
+ }
+ }
+}
+
+
+#if 0
+#define APPEND_ACTION(key, func) \
+{ \
+ String name = "func", str; \
+ str = config->read (String (SCIM_ANTHY_CONFIG_##key##_KEY), \
+ String (SCIM_ANTHY_CONFIG_##key##_KEY_DEFAULT)); \
+ m_actions.push_back (Action (name, str, &AnthyInstance::func)); \
+}
+#else
+#define APPEND_ACTION(key, func) \
+{ \
+ String name = #key, str; \
+ if (loaded) { \
+ String str2, str3; \
+ str2 = String (SCIM_ANTHY_CONFIG_##key##_KEY); \
+ str3 = String ("/IMEngine/Anthy/"); \
+ if (str2.length () > str3.length ()) { \
+ str2 = str2.substr (str3.length (), \
+ str2.length () - str3.length ()); \
+ style.get_string (str, section_key, str2); \
+ } \
+ } else if (config) { \
+ str = config->read (String (SCIM_ANTHY_CONFIG_##key##_KEY), \
+ String (SCIM_ANTHY_CONFIG_##key##_KEY_DEFAULT)); \
+ } \
+ m_actions.push_back (Action (name, str, func)); \
+}
+#endif
+
+// FIXME
+#define ANTHY_DEFINE_ACTION(func) \
+static bool \
+func (AnthyInstance *anthy) \
+{ \
+ return anthy->func (); \
+}
+
+ANTHY_DEFINE_ACTION (action_do_nothing);
+ANTHY_DEFINE_ACTION (action_commit_follow_preference);
+ANTHY_DEFINE_ACTION (action_commit_reverse_preference);
+ANTHY_DEFINE_ACTION (action_convert);
+ANTHY_DEFINE_ACTION (action_predict);
+ANTHY_DEFINE_ACTION (action_revert);
+ANTHY_DEFINE_ACTION (action_cancel_all);
+ANTHY_DEFINE_ACTION (action_back);
+ANTHY_DEFINE_ACTION (action_delete);
+ANTHY_DEFINE_ACTION (action_insert_space);
+ANTHY_DEFINE_ACTION (action_insert_alternative_space);
+ANTHY_DEFINE_ACTION (action_insert_half_space);
+ANTHY_DEFINE_ACTION (action_insert_wide_space);
+ANTHY_DEFINE_ACTION (action_move_caret_first);
+ANTHY_DEFINE_ACTION (action_move_caret_last);
+ANTHY_DEFINE_ACTION (action_move_caret_forward);
+ANTHY_DEFINE_ACTION (action_move_caret_backward);
+ANTHY_DEFINE_ACTION (action_select_first_segment);
+ANTHY_DEFINE_ACTION (action_select_last_segment);
+ANTHY_DEFINE_ACTION (action_select_next_segment);
+ANTHY_DEFINE_ACTION (action_select_prev_segment);
+ANTHY_DEFINE_ACTION (action_shrink_segment);
+ANTHY_DEFINE_ACTION (action_expand_segment);
+ANTHY_DEFINE_ACTION (action_commit_first_segment);
+ANTHY_DEFINE_ACTION (action_commit_selected_segment);
+ANTHY_DEFINE_ACTION (action_commit_first_segment_reverse_preference);
+ANTHY_DEFINE_ACTION (action_commit_selected_segment_reverse_preference);
+ANTHY_DEFINE_ACTION (action_select_first_candidate);
+ANTHY_DEFINE_ACTION (action_select_last_candidate);
+ANTHY_DEFINE_ACTION (action_select_next_candidate);
+ANTHY_DEFINE_ACTION (action_select_prev_candidate);
+ANTHY_DEFINE_ACTION (action_candidates_page_up);
+ANTHY_DEFINE_ACTION (action_candidates_page_down);
+ANTHY_DEFINE_ACTION (action_select_candidate_1);
+ANTHY_DEFINE_ACTION (action_select_candidate_2);
+ANTHY_DEFINE_ACTION (action_select_candidate_3);
+ANTHY_DEFINE_ACTION (action_select_candidate_4);
+ANTHY_DEFINE_ACTION (action_select_candidate_5);
+ANTHY_DEFINE_ACTION (action_select_candidate_6);
+ANTHY_DEFINE_ACTION (action_select_candidate_7);
+ANTHY_DEFINE_ACTION (action_select_candidate_8);
+ANTHY_DEFINE_ACTION (action_select_candidate_9);
+ANTHY_DEFINE_ACTION (action_select_candidate_10);
+ANTHY_DEFINE_ACTION (action_convert_char_type_forward);
+ANTHY_DEFINE_ACTION (action_convert_char_type_backward);
+ANTHY_DEFINE_ACTION (action_convert_to_hiragana);
+ANTHY_DEFINE_ACTION (action_convert_to_katakana);
+ANTHY_DEFINE_ACTION (action_convert_to_half);
+ANTHY_DEFINE_ACTION (action_convert_to_half_katakana);
+ANTHY_DEFINE_ACTION (action_convert_to_latin);
+ANTHY_DEFINE_ACTION (action_convert_to_wide_latin);
+ANTHY_DEFINE_ACTION (action_reconvert);
+ANTHY_DEFINE_ACTION (action_on_off);
+ANTHY_DEFINE_ACTION (action_circle_input_mode);
+ANTHY_DEFINE_ACTION (action_circle_kana_mode);
+ANTHY_DEFINE_ACTION (action_circle_typing_method);
+ANTHY_DEFINE_ACTION (action_latin_mode);
+ANTHY_DEFINE_ACTION (action_wide_latin_mode);
+ANTHY_DEFINE_ACTION (action_hiragana_mode);
+ANTHY_DEFINE_ACTION (action_katakana_mode);
+ANTHY_DEFINE_ACTION (action_half_katakana_mode);
+ANTHY_DEFINE_ACTION (action_cancel_pseudo_ascii_mode);
+ANTHY_DEFINE_ACTION (action_launch_dict_admin_tool);
+ANTHY_DEFINE_ACTION (action_add_word);
+
+void
+AnthyFactory::reload_config (const ConfigPointer &config)
+{
+ if (config) {
+ String str;
+
+ m_input_mode
+ = config->read (String (SCIM_ANTHY_CONFIG_INPUT_MODE),
+ String (SCIM_ANTHY_CONFIG_INPUT_MODE_DEFAULT));
+
+ m_typing_method
+ = config->read (String (SCIM_ANTHY_CONFIG_TYPING_METHOD),
+ String (SCIM_ANTHY_CONFIG_TYPING_METHOD_DEFAULT));
+
+ m_conversion_mode
+ = config->read (String (SCIM_ANTHY_CONFIG_CONVERSION_MODE),
+ String (SCIM_ANTHY_CONFIG_CONVERSION_MODE_DEFAULT));
+
+ m_period_style
+ = config->read (String (SCIM_ANTHY_CONFIG_PERIOD_STYLE),
+ String (SCIM_ANTHY_CONFIG_PERIOD_STYLE_DEFAULT));
+
+ m_symbol_style
+ = config->read (String (SCIM_ANTHY_CONFIG_SYMBOL_STYLE),
+ String (SCIM_ANTHY_CONFIG_SYMBOL_STYLE_DEFAULT));
+
+ m_space_type
+ = config->read (String (SCIM_ANTHY_CONFIG_SPACE_TYPE),
+ String (SCIM_ANTHY_CONFIG_SPACE_TYPE_DEFAULT));
+
+ m_ten_key_type
+ = config->read (String (SCIM_ANTHY_CONFIG_TEN_KEY_TYPE),
+ String (SCIM_ANTHY_CONFIG_TEN_KEY_TYPE_DEFAULT));
+
+ m_behavior_on_period
+ = config->read (String (SCIM_ANTHY_CONFIG_BEHAVIOR_ON_PERIOD),
+ String (SCIM_ANTHY_CONFIG_BEHAVIOR_ON_PERIOD_DEFAULT));
+
+ m_behavior_on_focus_out
+ = config->read (String (SCIM_ANTHY_CONFIG_BEHAVIOR_ON_FOCUS_OUT),
+ String (SCIM_ANTHY_CONFIG_BEHAVIOR_ON_FOCUS_OUT_DEFAULT));
+
+ m_cand_win_page_size
+ = config->read (String (SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE),
+ SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE_DEFAULT);
+
+ m_show_candidates_label
+ = config->read (String (SCIM_ANTHY_CONFIG_SHOW_CANDIDATES_LABEL),
+ SCIM_ANTHY_CONFIG_SHOW_CANDIDATES_LABEL_DEFAULT);
+
+ m_close_cand_win_on_select
+ = config->read (String (SCIM_ANTHY_CONFIG_CLOSE_CAND_WIN_ON_SELECT),
+ SCIM_ANTHY_CONFIG_CLOSE_CAND_WIN_ON_SELECT_DEFAULT);
+
+ m_n_triggers_to_show_cand_win
+ = config->read (String (SCIM_ANTHY_CONFIG_N_TRIGGERS_TO_SHOW_CAND_WIN),
+ SCIM_ANTHY_CONFIG_N_TRIGGERS_TO_SHOW_CAND_WIN_DEFAULT);
+
+ m_learn_on_manual_commit
+ = config->read (String (SCIM_ANTHY_CONFIG_LEARN_ON_MANUAL_COMMIT),
+ SCIM_ANTHY_CONFIG_LEARN_ON_MANUAL_COMMIT_DEFAULT);
+
+ m_learn_on_auto_commit
+ = config->read (String (SCIM_ANTHY_CONFIG_LEARN_ON_AUTO_COMMIT),
+ SCIM_ANTHY_CONFIG_LEARN_ON_AUTO_COMMIT_DEFAULT);
+
+ m_romaji_half_symbol
+ = config->read (String (SCIM_ANTHY_CONFIG_ROMAJI_HALF_SYMBOL),
+ SCIM_ANTHY_CONFIG_ROMAJI_HALF_SYMBOL_DEFAULT);
+
+ m_romaji_half_number
+ = config->read (String (SCIM_ANTHY_CONFIG_ROMAJI_HALF_NUMBER),
+ SCIM_ANTHY_CONFIG_ROMAJI_HALF_NUMBER_DEFAULT);
+
+ m_romaji_allow_split
+ = config->read (String (SCIM_ANTHY_CONFIG_ROMAJI_ALLOW_SPLIT),
+ SCIM_ANTHY_CONFIG_ROMAJI_ALLOW_SPLIT_DEFAULT);
+
+ m_romaji_pseudo_ascii_mode
+ = config->read (String (SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_MODE),
+ SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_MODE_DEFAULT);
+
+ m_romaji_pseudo_ascii_blank_behavior
+ = config->read (String (SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR),
+ SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR_DEFAULT);
+
+ m_nicola_time
+ = config->read (String (SCIM_ANTHY_CONFIG_NICOLA_TIME),
+ SCIM_ANTHY_CONFIG_NICOLA_TIME_DEFAULT);
+
+ str = config->read (String (SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY),
+ String (SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY_DEFAULT));
+ scim_string_to_key_list (m_left_thumb_keys, str);
+
+ str = config->read (String (SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY),
+ String (SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY_DEFAULT));
+ scim_string_to_key_list (m_right_thumb_keys, str);
+
+
+ m_dict_encoding
+ = config->read (String (SCIM_ANTHY_CONFIG_DICT_ENCODING),
+ String (SCIM_ANTHY_CONFIG_DICT_ENCODING_DEFAULT));
+
+ m_dict_admin_command
+ = config->read (String (SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND),
+ String (SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND_DEFAULT));
+
+ m_add_word_command
+ = config->read (String (SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND),
+ String (SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND_DEFAULT));
+
+ m_predict_on_input
+ = config->read (String (SCIM_ANTHY_CONFIG_PREDICT_ON_INPUT),
+ SCIM_ANTHY_CONFIG_PREDICT_ON_INPUT_DEFAULT);
+
+ m_use_direct_key_on_predict
+ = config->read (String (SCIM_ANTHY_CONFIG_USE_DIRECT_KEY_ON_PREDICT),
+ SCIM_ANTHY_CONFIG_USE_DIRECT_KEY_ON_PREDICT_DEFAULT);
+
+ m_show_input_mode_label
+ = config->read (String (SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL),
+ SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL_DEFAULT);
+
+ m_show_conv_mode_label
+ = config->read (String (SCIM_ANTHY_CONFIG_SHOW_CONVERSION_MODE_LABEL),
+ SCIM_ANTHY_CONFIG_SHOW_CONVERSION_MODE_LABEL_DEFAULT);
+
+ m_show_typing_method_label
+ = config->read (String (SCIM_ANTHY_CONFIG_SHOW_TYPING_METHOD_LABEL),
+ SCIM_ANTHY_CONFIG_SHOW_TYPING_METHOD_LABEL_DEFAULT);
+
+ m_show_period_style_label
+ = config->read (String (SCIM_ANTHY_CONFIG_SHOW_PERIOD_STYLE_LABEL),
+ SCIM_ANTHY_CONFIG_SHOW_PERIOD_STYLE_LABEL_DEFAULT);
+
+ m_show_symbol_style_label
+ = config->read (String (SCIM_ANTHY_CONFIG_SHOW_SYMBOL_STYLE_LABEL),
+ SCIM_ANTHY_CONFIG_SHOW_SYMBOL_STYLE_LABEL_DEFAULT);
+
+ m_show_dict_label
+ = config->read (String (SCIM_ANTHY_CONFIG_SHOW_DICT_LABEL),
+ SCIM_ANTHY_CONFIG_SHOW_DICT_LABEL_DEFAULT);
+
+ m_show_dict_admin_label
+ = config->read (String (SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL),
+ SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL_DEFAULT);
+
+ m_show_add_word_label
+ = config->read (String (SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL),
+ SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL_DEFAULT);
+
+ // color settings
+ int red, green, blue;
+
+ // preedit string color
+ m_preedit_style
+ = config->read (String (SCIM_ANTHY_CONFIG_PREEDIT_STYLE),
+ String (SCIM_ANTHY_CONFIG_PREEDIT_STYLE_DEFAULT));
+ str = config->read (String (SCIM_ANTHY_CONFIG_PREEDIT_FG_COLOR),
+ String (SCIM_ANTHY_CONFIG_PREEDIT_FG_COLOR_DEFAULT));
+ sscanf (str.c_str (), "#%02X%02X%02X", &red, &green, &blue);
+ m_preedit_fg_color = SCIM_RGB_COLOR (red, green, blue);
+
+ str = config->read (String (SCIM_ANTHY_CONFIG_PREEDIT_BG_COLOR),
+ String (SCIM_ANTHY_CONFIG_PREEDIT_BG_COLOR_DEFAULT));
+ sscanf (str.c_str (), "#%02X%02X%02X", &red, &green, &blue);
+ m_preedit_bg_color = SCIM_RGB_COLOR (red, green, blue);
+
+ // conversion string color
+ m_conversion_style
+ = config->read (String (SCIM_ANTHY_CONFIG_CONVERSION_STYLE),
+ String (SCIM_ANTHY_CONFIG_CONVERSION_STYLE_DEFAULT));
+ str = config->read (String (SCIM_ANTHY_CONFIG_CONVERSION_FG_COLOR),
+ String (SCIM_ANTHY_CONFIG_CONVERSION_FG_COLOR_DEFAULT));
+ sscanf (str.c_str (), "#%02X%02X%02X", &red, &green, &blue);
+ m_conversion_fg_color = SCIM_RGB_COLOR (red, green, blue);
+
+ str = config->read (String (SCIM_ANTHY_CONFIG_CONVERSION_BG_COLOR),
+ String (SCIM_ANTHY_CONFIG_CONVERSION_BG_COLOR_DEFAULT));
+ sscanf (str.c_str (), "#%02X%02X%02X", &red, &green, &blue);
+ m_conversion_bg_color = SCIM_RGB_COLOR (red, green, blue);
+
+ // selected segment color
+ m_selected_segment_style
+ = config->read (String (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE),
+ String (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE_DEFAULT));
+ str = config->read (String (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_FG_COLOR),
+ String (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_FG_COLOR_DEFAULT));
+ sscanf (str.c_str (), "#%02X%02X%02X", &red, &green, &blue);
+ m_selected_segment_fg_color = SCIM_RGB_COLOR (red, green, blue);
+
+ str = config->read (String (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_BG_COLOR),
+ String (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_BG_COLOR_DEFAULT));
+ sscanf (str.c_str (), "#%02X%02X%02X", &red, &green, &blue);
+ m_selected_segment_bg_color = SCIM_RGB_COLOR (red, green, blue);
+ }
+
+ StyleFile style;
+ String file;
+ bool loaded = false;
+
+ // load key bindings
+ const char *section_key = "KeyBindings";
+ file = config->read (String (SCIM_ANTHY_CONFIG_KEY_THEME_FILE),
+ String (SCIM_ANTHY_CONFIG_KEY_THEME_FILE_DEFAULT));
+ loaded = style.load (file.c_str ());
+
+ // clear old actions
+ m_actions.clear ();
+
+ // convert key
+ APPEND_ACTION (CONVERT, action_convert);
+ APPEND_ACTION (PREDICT, action_predict);
+
+ // candidates keys
+ APPEND_ACTION (CANDIDATES_PAGE_UP, action_candidates_page_up);
+ APPEND_ACTION (CANDIDATES_PAGE_DOWN, action_candidates_page_down);
+ APPEND_ACTION (SELECT_CANDIDATE_1, action_select_candidate_1);
+ APPEND_ACTION (SELECT_CANDIDATE_2, action_select_candidate_2);
+ APPEND_ACTION (SELECT_CANDIDATE_3, action_select_candidate_3);
+ APPEND_ACTION (SELECT_CANDIDATE_4, action_select_candidate_4);
+ APPEND_ACTION (SELECT_CANDIDATE_5, action_select_candidate_5);
+ APPEND_ACTION (SELECT_CANDIDATE_6, action_select_candidate_6);
+ APPEND_ACTION (SELECT_CANDIDATE_7, action_select_candidate_7);
+ APPEND_ACTION (SELECT_CANDIDATE_8, action_select_candidate_8);
+ APPEND_ACTION (SELECT_CANDIDATE_9, action_select_candidate_9);
+ APPEND_ACTION (SELECT_CANDIDATE_10, action_select_candidate_10);
+ APPEND_ACTION (SELECT_FIRST_CANDIDATE, action_select_first_candidate);
+ APPEND_ACTION (SELECT_LAST_CANDIDATE, action_select_last_candidate);
+ APPEND_ACTION (SELECT_NEXT_CANDIDATE, action_select_next_candidate);
+ APPEND_ACTION (SELECT_PREV_CANDIDATE, action_select_prev_candidate);
+
+ // segment keys
+ APPEND_ACTION (SELECT_FIRST_SEGMENT, action_select_first_segment);
+ APPEND_ACTION (SELECT_LAST_SEGMENT, action_select_last_segment);
+ APPEND_ACTION (SELECT_NEXT_SEGMENT, action_select_next_segment);
+ APPEND_ACTION (SELECT_PREV_SEGMENT, action_select_prev_segment);
+ APPEND_ACTION (SHRINK_SEGMENT, action_shrink_segment);
+ APPEND_ACTION (EXPAND_SEGMENT, action_expand_segment);
+ APPEND_ACTION (COMMIT_FIRST_SEGMENT, action_commit_first_segment);
+ APPEND_ACTION (COMMIT_SELECTED_SEGMENT, action_commit_selected_segment);
+ APPEND_ACTION (COMMIT_FIRST_SEGMENT_REVERSE_LEARN,
+ action_commit_first_segment_reverse_preference);
+ APPEND_ACTION (COMMIT_SELECTED_SEGMENT_REVERSE_LEARN,
+ action_commit_selected_segment_reverse_preference);
+
+ // direct convert keys
+ APPEND_ACTION (CONV_CHAR_TYPE_FORWARD, action_convert_char_type_forward);
+ APPEND_ACTION (CONV_CHAR_TYPE_BACKWARD, action_convert_char_type_backward);
+ APPEND_ACTION (CONV_TO_HIRAGANA, action_convert_to_hiragana);
+ APPEND_ACTION (CONV_TO_KATAKANA, action_convert_to_katakana);
+ APPEND_ACTION (CONV_TO_HALF, action_convert_to_half);
+ APPEND_ACTION (CONV_TO_HALF_KATAKANA, action_convert_to_half_katakana);
+ APPEND_ACTION (CONV_TO_LATIN, action_convert_to_latin);
+ APPEND_ACTION (CONV_TO_WIDE_LATIN, action_convert_to_wide_latin);
+
+ // pseudo ascii mode
+ APPEND_ACTION (CANCEL_PSEUDO_ASCII_MODE,action_cancel_pseudo_ascii_mode);
+
+ // caret keys
+ APPEND_ACTION (MOVE_CARET_FIRST, action_move_caret_first);
+ APPEND_ACTION (MOVE_CARET_LAST, action_move_caret_last);
+ APPEND_ACTION (MOVE_CARET_FORWARD, action_move_caret_forward);
+ APPEND_ACTION (MOVE_CARET_BACKWARD, action_move_caret_backward);
+
+ // edit keys
+ APPEND_ACTION (BACKSPACE, action_back);
+ APPEND_ACTION (DELETE, action_delete);
+ APPEND_ACTION (COMMIT, action_commit_follow_preference);
+ APPEND_ACTION (COMMIT_REVERSE_LEARN, action_commit_reverse_preference);
+ APPEND_ACTION (CANCEL, action_revert);
+ APPEND_ACTION (CANCEL_ALL, action_cancel_all);
+ APPEND_ACTION (INSERT_SPACE, action_insert_space);
+ APPEND_ACTION (INSERT_ALT_SPACE, action_insert_alternative_space);
+ APPEND_ACTION (INSERT_HALF_SPACE, action_insert_half_space);
+ APPEND_ACTION (INSERT_WIDE_SPACE, action_insert_wide_space);
+
+ // mode keys
+ APPEND_ACTION (ON_OFF, action_on_off);
+ APPEND_ACTION (CIRCLE_INPUT_MODE, action_circle_input_mode);
+ APPEND_ACTION (CIRCLE_KANA_MODE, action_circle_kana_mode);
+ APPEND_ACTION (CIRCLE_TYPING_METHOD, action_circle_typing_method);
+ APPEND_ACTION (LATIN_MODE, action_latin_mode);
+ APPEND_ACTION (WIDE_LATIN_MODE, action_wide_latin_mode);
+ APPEND_ACTION (HIRAGANA_MODE, action_hiragana_mode);
+ APPEND_ACTION (KATAKANA_MODE, action_katakana_mode);
+ APPEND_ACTION (HALF_KATAKANA_MODE, action_half_katakana_mode);
+
+ // dict keys
+ APPEND_ACTION (DICT_ADMIN, action_launch_dict_admin_tool);
+ APPEND_ACTION (ADD_WORD, action_add_word);
+
+ // reconvert
+ APPEND_ACTION (RECONVERT, action_reconvert);
+
+ // disabled key
+ APPEND_ACTION (DO_NOTHING, action_do_nothing);
+
+ // load custom romaji table
+ const char *section_romaji = "RomajiTable/FundamentalTable";
+ file = config->read (String (SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE),
+ String (SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE_DEFAULT));
+ if (m_custom_romaji_table) {
+ delete m_custom_romaji_table;
+ m_custom_romaji_table = NULL;
+ }
+ if (!file.empty() && style.load (file.c_str ())) {
+ m_custom_romaji_table = style.get_key2kana_table (section_romaji);
+ }
+
+ // load custom kana table
+ const char *section_kana = "KanaTable/FundamentalTable";
+ file = config->read (String (SCIM_ANTHY_CONFIG_KANA_LAYOUT_FILE),
+ String (SCIM_ANTHY_CONFIG_KANA_LAYOUT_FILE_DEFAULT));
+ if (m_custom_kana_table) {
+ delete m_custom_kana_table;
+ m_custom_kana_table = NULL;
+ }
+ if (!file.empty () && style.load (file.c_str ())) {
+ m_custom_kana_table = style.get_key2kana_table (section_kana);
+ }
+
+ // load custom NICOLA table
+ const char *section_nicola = "NICOLATable/FundamentalTable";
+ file = config->read (String (SCIM_ANTHY_CONFIG_NICOLA_LAYOUT_FILE),
+ String (SCIM_ANTHY_CONFIG_NICOLA_LAYOUT_FILE_DEFAULT));
+ if (m_custom_nicola_table) {
+ delete m_custom_nicola_table;
+ m_custom_nicola_table = NULL;
+ }
+ if (!file.empty () && style.load (file.c_str ())) {
+ m_custom_nicola_table = style.get_key2kana_table (section_nicola);
+ }
+
+ // special kana keys
+ m_kana_layout_ro_key
+ = config->read (String (SCIM_ANTHY_CONFIG_KANA_LAYOUT_RO_KEY),
+ String (SCIM_ANTHY_CONFIG_KANA_LAYOUT_RO_KEY_DEFAULT));
+
+
+ // reload config for all instance
+ std::vector<AnthyInstance*>::iterator it;
+ for (it = m_config_listeners.begin();
+ it != m_config_listeners.end();
+ it++)
+ {
+ (*it)->reload_config (config);
+ }
+}
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004 Hiroyuki Ikezoe
+ * Copyright (C) 2004 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * The original code is scim_uim_imengine.cpp in scim-uim-0.1.3.
+ * Copyright (C) 2004 James Su <suzhe@tsinghua.org.cn>
+ */
+
+#ifndef __SCIM_ANTHY_FACTORY_H__
+#define __SCIM_ANTHY_FACTORY_H__
+
+#define Uses_SCIM_IMENGINE
+#define Uses_SCIM_CONFIG_BASE
+#include <anthy/anthy.h>
+#include <scim.h>
+#include "scim_anthy_action.h"
+#include "scim_anthy_style_file.h"
+#include "scim_anthy_key2kana_table.h"
+
+using namespace scim;
+using namespace scim_anthy;
+
+class AnthyFactory : public IMEngineFactoryBase
+{
+public:
+ AnthyFactory (const String &lang,
+ const String &uuid,
+ const ConfigPointer &config);
+ virtual ~AnthyFactory ();
+
+ virtual WideString get_name () const;
+ virtual WideString get_authors () const;
+ virtual WideString get_credits () const;
+ virtual WideString get_help () const;
+ virtual String get_uuid () const;
+ virtual String get_icon_file () const;
+
+ virtual IMEngineInstancePointer create_instance (const String& encoding,
+ int id = -1);
+
+ virtual void append_config_listener (AnthyInstance *listener);
+ virtual void remove_config_listener (AnthyInstance *listener);
+
+private:
+ void reload_config (const ConfigPointer &config);
+
+private:
+ String m_uuid;
+ Connection m_reload_signal_connection;
+ std::vector<AnthyInstance*> m_config_listeners;
+
+public:
+ /* config */
+ ConfigPointer m_config;
+
+ /* for preferece */
+ String m_input_mode;
+ String m_typing_method;
+ String m_conversion_mode;
+ String m_period_style;
+ String m_symbol_style;
+ String m_space_type;
+ String m_ten_key_type;
+ String m_behavior_on_period;
+ String m_behavior_on_focus_out;
+
+ bool m_show_candidates_label;
+ bool m_close_cand_win_on_select;
+ int m_cand_win_page_size;
+ int m_n_triggers_to_show_cand_win;
+
+ bool m_learn_on_manual_commit;
+ bool m_learn_on_auto_commit;
+
+ bool m_romaji_half_symbol;
+ bool m_romaji_half_number;
+ bool m_romaji_allow_split;
+
+ bool m_romaji_pseudo_ascii_mode;
+ bool m_romaji_pseudo_ascii_blank_behavior;
+
+ int m_nicola_time;
+ KeyEventList m_left_thumb_keys;
+ KeyEventList m_right_thumb_keys;
+
+ String m_dict_encoding;
+ String m_dict_admin_command;
+ String m_add_word_command;
+
+ bool m_predict_on_input;
+ bool m_use_direct_key_on_predict;
+
+ bool m_show_input_mode_label;
+ bool m_show_conv_mode_label;
+ bool m_show_typing_method_label;
+ bool m_show_period_style_label;
+ bool m_show_symbol_style_label;
+ bool m_show_dict_label;
+ bool m_show_dict_admin_label;
+ bool m_show_add_word_label;
+
+ String m_preedit_style;
+ unsigned int m_preedit_fg_color;
+ unsigned int m_preedit_bg_color;
+ String m_conversion_style;
+ unsigned int m_conversion_fg_color;
+ unsigned int m_conversion_bg_color;
+ String m_selected_segment_style;
+ unsigned int m_selected_segment_fg_color;
+ unsigned int m_selected_segment_bg_color;
+
+ Key2KanaTable *m_custom_romaji_table;
+ Key2KanaTable *m_custom_kana_table;
+ Key2KanaTable *m_custom_nicola_table;
+
+ String m_kana_layout_ro_key;
+
+ /* for key bindings */
+ std::vector<Action> m_actions;
+};
+
+#endif /* __SCIM_ANTHY_FACTORY_H__ */
+/*
+vi:ts=4:nowrap:ai:expandtab
+*/
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#define Uses_SCIM_HELPER
+#define Uses_SCIM_CONFIG_BASE
+#include <map>
+#include <scim.h>
+#include <gtk/gtk.h>
+#include "scim_anthy_intl.h"
+#include "scim_anthy_helper.h"
+
+using namespace scim;
+
+#define scim_module_init anthy_imengine_helper_LTX_scim_module_init
+#define scim_module_exit anthy_imengine_helper_LTX_scim_module_exit
+#define scim_helper_module_number_of_helpers anthy_imengine_helper_LTX_scim_helper_module_number_of_helpers
+#define scim_helper_module_get_helper_info anthy_imengine_helper_LTX_scim_helper_module_get_helper_info
+#define scim_helper_module_run_helper anthy_imengine_helper_LTX_scim_helper_module_run_helper
+
+static gboolean helper_agent_input_handler (GIOChannel *source,
+ GIOCondition condition,
+ gpointer user_data);
+static void slot_imengine_event (const HelperAgent *agent,
+ int ic,
+ const String &uuid,
+ const Transaction &trans);
+static gint timeout_func (gpointer data);
+static void timeout_ctx_destroy_func (gpointer data);
+
+static void run (const String &display,
+ const ConfigPointer &config);
+
+HelperAgent helper_agent;
+
+HelperInfo helper_info (SCIM_ANTHY_HELPER_UUID, // uuid
+ "", // name
+ "", // icon
+ "",
+ SCIM_HELPER_NEED_SCREEN_INFO);
+
+class TimeoutContext {
+public:
+ TimeoutContext (int ic, const String &uuid, uint32 id)
+ : m_ic (ic),
+ m_uuid (uuid),
+ m_id (id)
+ {}
+ virtual ~TimeoutContext () {}
+public:
+ int m_ic;
+ String m_uuid;
+ uint32 m_id;
+};
+typedef std::map <uint32, guint> TimeoutIDList;
+std::map <int, TimeoutIDList> timeout_ids;
+
+
+//Module Interface
+extern "C" {
+ void scim_module_init (void)
+ {
+ bindtextdomain (GETTEXT_PACKAGE, SCIM_ANTHY_LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+
+ helper_info.name = String (_("Anthy helper"));
+ helper_info.description = String (
+ _("A helper module for Anthy IMEngine."));
+ }
+
+ void scim_module_exit (void)
+ {
+ }
+
+ unsigned int scim_helper_module_number_of_helpers (void)
+ {
+ return 1;
+ }
+
+ bool scim_helper_module_get_helper_info (unsigned int idx, HelperInfo &info)
+ {
+ if (idx == 0) {
+ info = helper_info;
+ return true;
+ }
+ return false;
+ }
+
+ void scim_helper_module_run_helper (const String &uuid,
+ const ConfigPointer &config,
+ const String &display)
+ {
+ SCIM_DEBUG_MAIN(1) << "anthy_imengine_helper_LTX_scim_helper_module_run_helper ()\n";
+
+ if (uuid == String (SCIM_ANTHY_HELPER_UUID)) {
+ run (display, config);
+ }
+
+ SCIM_DEBUG_MAIN(1) << "exit anthy_imengine_helper_LTX_scim_helper_module_run_helper ()\n";
+ }
+}
+
+
+static gboolean
+helper_agent_input_handler (GIOChannel *source,
+ GIOCondition condition,
+ gpointer user_data)
+{
+ if (condition == G_IO_IN) {
+ HelperAgent *agent = static_cast<HelperAgent*> (user_data);
+ if (agent && agent->has_pending_event ())
+ agent->filter_event ();
+ } else if (condition == G_IO_ERR || condition == G_IO_HUP) {
+ gtk_main_quit ();
+ }
+ return TRUE;
+}
+
+static void
+slot_exit (const HelperAgent *agent, int ic, const String &uuid)
+{
+ gtk_main_quit ();
+}
+
+static void
+slot_imengine_event (const HelperAgent *agent, int ic,
+ const String &uuid, const Transaction &recv)
+{
+ TransactionReader reader (recv);
+ int cmd;
+
+ if (!reader.get_command (cmd))
+ return;
+
+ switch (cmd) {
+ case SCIM_ANTHY_TRANS_CMD_GET_SELECTION:
+ {
+ GtkClipboard *primary_selection;
+ WideString selection;
+
+ primary_selection = gtk_clipboard_get (GDK_SELECTION_PRIMARY);
+ if (primary_selection) {
+ gchar *text = gtk_clipboard_wait_for_text (primary_selection);
+ if (text) {
+ selection = utf8_mbstowcs (text);
+ g_free (text);
+ }
+ }
+
+ Transaction send;
+ send.put_command (SCIM_ANTHY_TRANS_CMD_GET_SELECTION);
+ send.put_data (selection);
+ helper_agent.send_imengine_event (ic, uuid, send);
+
+ break;
+ }
+ case SCIM_ANTHY_TRANS_CMD_TIMEOUT_ADD:
+ {
+ uint32 id, time_msec;
+ if (!reader.get_data (id) || !reader.get_data (time_msec))
+ break;
+ TimeoutContext *ctx = new TimeoutContext (ic, uuid, id);
+ guint timeout_id = gtk_timeout_add_full (time_msec,
+ timeout_func,
+ NULL,
+ (gpointer) ctx,
+ timeout_ctx_destroy_func);
+ timeout_ids[ic][id] = timeout_id;
+ break;
+ }
+ case SCIM_ANTHY_TRANS_CMD_TIMEOUT_REMOVE:
+ {
+ uint32 id;
+ if (reader.get_data (id) &&
+ timeout_ids.find (ic) != timeout_ids.end () &&
+ timeout_ids[ic].find (id) != timeout_ids[ic].end ())
+ {
+ guint tid = timeout_ids[ic][id];
+ gtk_timeout_remove (tid);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+static gint
+timeout_func (gpointer data)
+{
+ TimeoutContext *ctx = static_cast<TimeoutContext*> (data);
+
+ Transaction send;
+ send.put_command (SCIM_ANTHY_TRANS_CMD_TIMEOUT_NOTIFY);
+ send.put_data (ctx->m_id);
+ helper_agent.send_imengine_event (ctx->m_ic, ctx->m_uuid, send);
+
+ return FALSE;
+}
+
+static void
+timeout_ctx_destroy_func (gpointer data)
+{
+ TimeoutContext *ctx = static_cast<TimeoutContext*> (data);
+ int ic = ctx->m_ic;
+ uint32 id = ctx->m_id;
+
+ if (timeout_ids.find (ic) != timeout_ids.end () &&
+ timeout_ids[ic].find (id) != timeout_ids[ic].end ())
+ {
+ timeout_ids[ic].erase (id);
+ }
+ delete ctx;
+}
+
+static void
+run (const String &display, const ConfigPointer &config)
+{
+ char **argv = new char * [4];
+ int argc = 3;
+
+ argv [0] = "anthy-imengine-helper";
+ argv [1] = "--display";
+ argv [2] = const_cast<char *> (display.c_str ());
+ argv [3] = 0;
+
+ setenv ("DISPLAY", display.c_str (), 1);
+
+ gtk_init (&argc, &argv);
+
+ helper_agent.signal_connect_exit (slot (slot_exit));
+ helper_agent.signal_connect_process_imengine_event (slot (slot_imengine_event));
+
+ // open connection
+ int fd = helper_agent.open_connection (helper_info, display);
+ GIOChannel *ch = g_io_channel_unix_new (fd);
+
+ if (fd >= 0 && ch) {
+ g_io_add_watch (ch, G_IO_IN,
+ helper_agent_input_handler,
+ (gpointer) &helper_agent);
+ g_io_add_watch (ch, G_IO_ERR,
+ helper_agent_input_handler,
+ (gpointer) &helper_agent);
+ g_io_add_watch (ch, G_IO_HUP,
+ helper_agent_input_handler,
+ (gpointer) &helper_agent);
+ }
+
+ gtk_main ();
+
+ // close connection
+ helper_agent.close_connection ();
+ fd = -1;
+}
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2005 Takuro Ashie <ashie@homa.ne.jp>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SCIM_ANTHY_HELPER_H__
+#define __SCIM_ANTHY_HELPER_H__
+
+#include <scim_trans_commands.h>
+
+#define SCIM_ANTHY_HELPER_UUID "24a65e2b-10a8-4d4c-adc9-266678cb1a38"
+
+#define SCIM_ANTHY_TRANS_CMD_NEW_IC SCIM_TRANS_CMD_USER_DEFINED + 1
+#define SCIM_ANTHY_TRANS_CMD_DELETE_IC SCIM_TRANS_CMD_USER_DEFINED + 2
+#define SCIM_ANTHY_TRANS_CMD_GET_SELECTION SCIM_TRANS_CMD_USER_DEFINED + 3
+#define SCIM_ANTHY_TRANS_CMD_TIMEOUT_ADD SCIM_TRANS_CMD_USER_DEFINED + 4
+#define SCIM_ANTHY_TRANS_CMD_TIMEOUT_REMOVE SCIM_TRANS_CMD_USER_DEFINED + 5
+#define SCIM_ANTHY_TRANS_CMD_TIMEOUT_NOTIFY SCIM_TRANS_CMD_USER_DEFINED + 6
+
+#endif /* __SCIM_ANTHY_HELPER_H__ */
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004 - 2005 Hiroyuki Ikezoe <poincare@ikezoe.net>
+ * Copyright (C) 2004 - 2005 Takuro Ashie <ashie@homa.ne.jp>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * The original code is scim_uim_imengine.cpp in scim-uim-0.1.3.
+ * Copyright (C) 2004 James Su <suzhe@tsinghua.org.cn>
+ */
+
+#define Uses_SCIM_UTILITY
+#define Uses_SCIM_IMENGINE
+#define Uses_SCIM_LOOKUP_TABLE
+#define Uses_SCIM_CONFIG_BASE
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#endif
+
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+#include <scim.h>
+#include <Ecore_IMF.h>
+#include "scim_anthy_factory.h"
+#include "scim_anthy_imengine.h"
+#include "scim_anthy_prefs.h"
+#include "scim_anthy_intl.h"
+#include "scim_anthy_utils.h"
+#include "scim_anthy_helper.h"
+
+#define SCIM_PROP_PREFIX "/IMEngine/Anthy"
+#define SCIM_PROP_INPUT_MODE "/IMEngine/Anthy/InputMode"
+#define SCIM_PROP_INPUT_MODE_HIRAGANA "/IMEngine/Anthy/InputMode/Hiragana"
+#define SCIM_PROP_INPUT_MODE_KATAKANA "/IMEngine/Anthy/InputMode/Katakana"
+#define SCIM_PROP_INPUT_MODE_HALF_KATAKANA "/IMEngine/Anthy/InputMode/HalfKatakana"
+#define SCIM_PROP_INPUT_MODE_LATIN "/IMEngine/Anthy/InputMode/Latin"
+#define SCIM_PROP_INPUT_MODE_WIDE_LATIN "/IMEngine/Anthy/InputMode/WideLatin"
+
+#define SCIM_PROP_CONV_MODE "/IMEngine/Anthy/ConvMode"
+#define SCIM_PROP_CONV_MODE_MULTI_SEG "/IMEngine/Anthy/ConvMode/MultiSegment"
+#define SCIM_PROP_CONV_MODE_SINGLE_SEG "/IMEngine/Anthy/ConvMode/SingleSegment"
+#define SCIM_PROP_CONV_MODE_MULTI_REAL_TIME "/IMEngine/Anthy/ConvMode/MultiRealTime"
+#define SCIM_PROP_CONV_MODE_SINGLE_REAL_TIME "/IMEngine/Anthy/ConvMode/SingleRealTime"
+
+#define SCIM_PROP_TYPING_METHOD "/IMEngine/Anthy/TypingMethod"
+#define SCIM_PROP_TYPING_METHOD_ROMAJI "/IMEngine/Anthy/TypingMethod/RomaKana"
+#define SCIM_PROP_TYPING_METHOD_KANA "/IMEngine/Anthy/TypingMethod/Kana"
+#define SCIM_PROP_TYPING_METHOD_NICOLA "/IMEngine/Anthy/TypingMethod/NICOLA"
+
+#define SCIM_PROP_PERIOD_STYLE "/IMEngine/Anthy/PeriodType"
+#define SCIM_PROP_PERIOD_STYLE_JAPANESE "/IMEngine/Anthy/PeriodType/Japanese"
+#define SCIM_PROP_PERIOD_STYLE_WIDE_LATIN "/IMEngine/Anthy/PeriodType/WideRatin"
+#define SCIM_PROP_PERIOD_STYLE_LATIN "/IMEngine/Anthy/PeriodType/Ratin"
+#define SCIM_PROP_PERIOD_STYLE_WIDE_LATIN_JAPANESE \
+ "/IMEngine/Anthy/PeriodType/WideRatin_Japanese"
+
+#define SCIM_PROP_SYMBOL_STYLE "/IMEngine/Anthy/SymbolType"
+#define SCIM_PROP_SYMBOL_STYLE_JAPANESE "/IMEngine/Anthy/SymbolType/Japanese"
+#define SCIM_PROP_SYMBOL_STYLE_BRACKET_SLASH "/IMEngine/Anthy/SymbolType/WideBracket_WideSlash"
+#define SCIM_PROP_SYMBOL_STYLE_CORNER_BRACKET_SLASH \
+ "/IMEngine/Anthy/SymbolType/CornerBracket_WideSlash"
+#define SCIM_PROP_SYMBOL_STYLE_BRACKET_MIDDLE_DOT \
+ "/IMEngine/Anthy/SymbolType/WideBracket_MiddleDot"
+
+#define SCIM_PROP_DICT "/IMEngine/Anthy/Dictionary"
+#define SCIM_PROP_DICT_ADD_WORD "/IMEngine/Anthy/Dictionary/AddWord"
+#define SCIM_PROP_DICT_LAUNCH_ADMIN_TOOL "/IMEngine/Anthy/Dictionary/LaunchAdminTool"
+
+#define UTF8_BRACKET_CORNER_BEGIN "\xE3\x80\x8C"
+#define UTF8_BRACKET_CORNER_END "\xE3\x80\x8D"
+#define UTF8_BRACKET_WIDE_BEGIN "\xEF\xBC\xBB"
+#define UTF8_BRACKET_WIDE_END "\xEF\xBC\xBD"
+#define UTF8_MIDDLE_DOT "\xE3\x83\xBB"
+#define UTF8_SLASH_WIDE "\xEF\xBC\x8F"
+
+AnthyInstance::AnthyInstance (AnthyFactory *factory,
+ const String &encoding,
+ int id)
+ : IMEngineInstanceBase (factory, encoding, id),
+ m_factory (factory),
+ m_on_init (true),
+ m_preedit (*this),
+ m_preedit_string_visible (false),
+ m_lookup_table_visible (false),
+ m_n_conv_key_pressed (0),
+ m_prev_input_mode (SCIM_ANTHY_MODE_HIRAGANA),
+ m_conv_mode (SCIM_ANTHY_CONVERSION_MULTI_SEGMENT),
+ m_helper_started (false),
+ m_timeout_id_seq (0),
+ m_layout (ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL)
+{
+ SCIM_DEBUG_IMENGINE(1) << "Create Anthy Instance : ";
+
+ reload_config (m_factory->m_config);
+ m_factory->append_config_listener (this);
+ m_on_init = false;
+}
+
+AnthyInstance::~AnthyInstance ()
+{
+ if (m_helper_started)
+ stop_helper (String (SCIM_ANTHY_HELPER_UUID));
+
+ m_factory->remove_config_listener (this);
+}
+
+// FIXME!
+bool
+AnthyInstance::is_nicola_thumb_shift_key (const KeyEvent &key)
+{
+ if (get_typing_method () != SCIM_ANTHY_TYPING_METHOD_NICOLA)
+ return false;
+
+ if (util_match_key_event (m_factory->m_left_thumb_keys, key, 0xFFFF) ||
+ util_match_key_event (m_factory->m_right_thumb_keys, key, 0xFFFF))
+ {
+ return true;
+ }
+
+ return false;
+}
+
+bool
+AnthyInstance::process_key_event_input (const KeyEvent &key)
+{
+ // prediction while typing
+ if (m_factory->m_predict_on_input && key.is_key_release () &&
+ m_preedit.is_preediting () && !m_preedit.is_converting ())
+ {
+ CommonLookupTable table;
+ m_preedit.predict ();
+ m_preedit.get_candidates (table);
+ if (table.number_of_candidates () > 0) {
+ table.show_cursor (false);
+ update_lookup_table (table);
+ show_lookup_table ();
+ } else {
+ hide_lookup_table ();
+ }
+ }
+
+ if (!m_preedit.can_process_key_event (key)) {
+ return false;
+ }
+
+ if (m_preedit.is_converting ()) {
+ if (is_realtime_conversion ()) {
+ action_revert ();
+ } else if (!is_nicola_thumb_shift_key (key)) {
+ action_commit (m_factory->m_learn_on_auto_commit);
+ }
+ }
+
+ bool need_commit = m_preedit.process_key_event (key);
+
+ if (need_commit) {
+ if (is_realtime_conversion () &&
+ get_input_mode () != SCIM_ANTHY_MODE_LATIN &&
+ get_input_mode () != SCIM_ANTHY_MODE_WIDE_LATIN)
+ {
+ m_preedit.convert (SCIM_ANTHY_CANDIDATE_DEFAULT,
+ is_single_segment ());
+ }
+ action_commit (m_factory->m_learn_on_auto_commit);
+ } else {
+ if (is_realtime_conversion ()) {
+ m_preedit.convert (SCIM_ANTHY_CANDIDATE_DEFAULT,
+ is_single_segment ());
+ m_preedit.select_segment (-1);
+ }
+ show_preedit_string ();
+ m_preedit_string_visible = true;
+ set_preedition ();
+ }
+
+ return true;
+}
+
+bool
+AnthyInstance::process_key_event_lookup_keybind (const KeyEvent& key)
+{
+ std::vector<Action>::iterator it;
+
+ m_last_key = key;
+
+ /* try to find a "insert a blank" action to be not stolen a blank key
+ * when entering the pseudo ascii mode.
+ */
+ if (get_pseudo_ascii_mode () != 0 &&
+ m_factory->m_romaji_pseudo_ascii_blank_behavior &&
+ m_preedit.is_pseudo_ascii_mode ()) {
+ for (it = m_factory->m_actions.begin();
+ it != m_factory->m_actions.end();
+ it++) {
+ if (it->match_action_name ("INSERT_SPACE") &&
+ it->perform (this, key)) {
+ return true;
+ }
+ }
+ }
+ for (it = m_factory->m_actions.begin();
+ it != m_factory->m_actions.end();
+ it++)
+ {
+ if (it->perform (this, key)) {
+ m_last_key = KeyEvent ();
+ return true;
+ }
+ }
+
+ m_last_key = KeyEvent ();
+
+ return false;
+}
+
+bool
+AnthyInstance::process_key_event_latin_mode (const KeyEvent &key)
+{
+ if (key.is_key_release ())
+ return false;
+
+ if (util_key_is_keypad (key)) {
+ String str;
+ WideString wide;
+ util_keypad_to_string (str, key);
+ if (m_factory->m_ten_key_type == "Wide")
+ util_convert_to_wide (wide, str);
+ else
+ wide = utf8_mbstowcs (str);
+ if (wide.length () > 0) {
+ commit_string (wide);
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ // for Multi/Dead key
+ return false;
+ }
+}
+
+bool
+AnthyInstance::process_key_event_wide_latin_mode (const KeyEvent &key)
+{
+ if (key.is_key_release ())
+ return false;
+
+ String str;
+ WideString wide;
+ util_keypad_to_string (str, key);
+ if (util_key_is_keypad (key) && m_factory->m_ten_key_type == "Half")
+ wide = utf8_mbstowcs (str);
+ else
+ util_convert_to_wide (wide, str);
+ if (wide.length () > 0) {
+ commit_string (wide);
+ return true;
+ }
+
+ return false;
+}
+
+bool
+AnthyInstance::process_key_event (const KeyEvent& key)
+{
+ SCIM_DEBUG_IMENGINE(2) << "process_key_event.\n";
+
+ switch (m_layout) {
+ case ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER:
+ case ECORE_IMF_INPUT_PANEL_LAYOUT_IP:
+ case ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH:
+ case ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY:
+ case ECORE_IMF_INPUT_PANEL_LAYOUT_DATETIME:
+ return false;
+ default:
+ break;
+ }
+
+ // FIXME!
+ // for NICOLA thumb shift key
+ if (get_typing_method () == SCIM_ANTHY_TYPING_METHOD_NICOLA &&
+ is_nicola_thumb_shift_key (key))
+ {
+ if (process_key_event_input (key))
+ return true;
+ }
+
+ // lookup user defined key bindings
+ if (process_key_event_lookup_keybind (key))
+ return true;
+
+ // for Latin mode
+ if (m_preedit.get_input_mode () == SCIM_ANTHY_MODE_LATIN)
+ return process_key_event_latin_mode (key);
+
+ // for wide Latin mode
+ if (m_preedit.get_input_mode () == SCIM_ANTHY_MODE_WIDE_LATIN)
+ return process_key_event_wide_latin_mode (key);
+
+ // for other mode
+ if (get_typing_method () != SCIM_ANTHY_TYPING_METHOD_NICOLA ||
+ !is_nicola_thumb_shift_key (key))
+ {
+ if (process_key_event_input (key))
+ return true;
+ }
+
+ if (m_preedit.is_preediting ())
+ return true;
+ else
+ return false;
+}
+
+void
+AnthyInstance::move_preedit_caret (unsigned int pos)
+{
+ m_preedit.set_caret_pos (pos);
+ update_preedit_caret (m_preedit.get_caret_pos());
+}
+
+void
+AnthyInstance::select_candidate_no_direct (unsigned int item)
+{
+ SCIM_DEBUG_IMENGINE(2) << "select_candidate_no_direct.\n";
+
+ if (m_preedit.is_predicting () && !m_preedit.is_converting ())
+ action_predict ();
+
+ if (!is_selecting_candidates ())
+ return;
+
+ // update lookup table
+ m_lookup_table.set_cursor_pos_in_current_page (item);
+ update_lookup_table (m_lookup_table);
+
+ // update preedit
+ m_preedit.select_candidate (m_lookup_table.get_cursor_pos ());
+ set_preedition ();
+
+ // update aux string
+ if (m_factory->m_show_candidates_label)
+ set_aux_string ();
+}
+
+void
+AnthyInstance::select_candidate (unsigned int item)
+{
+ SCIM_DEBUG_IMENGINE(2) << "select_candidate.\n";
+
+ select_candidate_no_direct (item);
+
+ if (m_factory->m_close_cand_win_on_select) {
+ unset_lookup_table ();
+ action_select_next_segment();
+ }
+}
+
+void
+AnthyInstance::update_lookup_table_page_size (unsigned int page_size)
+{
+ SCIM_DEBUG_IMENGINE(2) << "update_lookup_table_page_size.\n";
+
+ m_lookup_table.set_page_size (page_size);
+}
+
+void
+AnthyInstance::lookup_table_page_up ()
+{
+ if (!is_selecting_candidates () ||
+ !m_lookup_table.get_current_page_start ())
+ {
+ return;
+ }
+
+ SCIM_DEBUG_IMENGINE(2) << "lookup_table_page_up.\n";
+
+ m_lookup_table.page_up ();
+
+ update_lookup_table (m_lookup_table);
+}
+
+void
+AnthyInstance::lookup_table_page_down ()
+{
+ int page_start = m_lookup_table.get_current_page_start ();
+ int page_size = m_lookup_table.get_current_page_size ();
+ int num = m_lookup_table.number_of_candidates ();
+
+ if (!is_selecting_candidates () || page_start + page_size >= num)
+ return;
+
+ SCIM_DEBUG_IMENGINE(2) << "lookup_table_page_down.\n";
+
+ m_lookup_table.page_down ();
+
+ update_lookup_table (m_lookup_table);
+}
+
+void
+AnthyInstance::reset ()
+{
+ SCIM_DEBUG_IMENGINE(2) <<m_factory->m_behavior_on_focus_out<< "reset..\n";
+
+ if (m_preedit.is_preediting ()) {
+ if (m_factory->m_behavior_on_focus_out == "Clear")
+ flush ();
+ else if (m_factory->m_behavior_on_focus_out == "Commit")
+ action_commit (m_factory->m_learn_on_auto_commit);
+ else
+ action_commit (m_factory->m_learn_on_auto_commit);
+ }
+}
+
+void
+AnthyInstance::flush ()
+{
+ SCIM_DEBUG_IMENGINE(3) << "flush ()\n";
+ m_preedit.clear ();
+ m_lookup_table.clear ();
+ unset_lookup_table ();
+
+ hide_preedit_string ();
+ m_preedit_string_visible = false;
+ set_preedition ();
+}
+
+void
+AnthyInstance::focus_in ()
+{
+ SCIM_DEBUG_IMENGINE(2) << "focus_in.\n";
+
+ if (m_preedit_string_visible) {
+ set_preedition ();
+ show_preedit_string ();
+ } else {
+ hide_preedit_string ();
+ }
+
+ if (m_lookup_table_visible && is_selecting_candidates ()) {
+ if (m_factory->m_show_candidates_label &&
+ m_lookup_table.number_of_candidates() > 0)
+ {
+ set_aux_string ();
+ show_aux_string ();
+ } else {
+ hide_aux_string ();
+ }
+ update_lookup_table (m_lookup_table);
+ show_lookup_table ();
+ } else {
+ hide_aux_string ();
+ hide_lookup_table ();
+ }
+
+ install_properties ();
+
+ if (!m_helper_started)
+ start_helper (String (SCIM_ANTHY_HELPER_UUID));
+
+ Transaction send;
+ send.put_command (SCIM_TRANS_CMD_REQUEST);
+ send.put_command (SCIM_TRANS_CMD_FOCUS_IN);
+ send_helper_event (String (SCIM_ANTHY_HELPER_UUID), send);
+}
+
+void
+AnthyInstance::focus_out ()
+{
+ SCIM_DEBUG_IMENGINE(2) << "focus_out.\n";
+
+
+
+ Transaction send;
+ send.put_command (SCIM_TRANS_CMD_REQUEST);
+ send.put_command (SCIM_TRANS_CMD_FOCUS_OUT);
+ send_helper_event (String (SCIM_ANTHY_HELPER_UUID), send);
+}
+
+void
+AnthyInstance::set_layout (unsigned int layout)
+{
+ m_layout = layout;
+}
+
+void
+AnthyInstance::set_preedition (void)
+{
+ update_preedit_string (m_preedit.get_string (),
+ m_preedit.get_attribute_list ());
+ update_preedit_caret (m_preedit.get_caret_pos());
+}
+
+void
+AnthyInstance::set_aux_string (void)
+{
+ char buf[256];
+ sprintf (buf, _("Candidates (%d/%d)"),
+ m_lookup_table.get_cursor_pos () + 1,
+ m_lookup_table.number_of_candidates ());
+ update_aux_string (utf8_mbstowcs (buf));
+}
+
+void
+AnthyInstance::set_lookup_table (void)
+{
+ m_n_conv_key_pressed++;
+
+ if (!is_selecting_candidates ()) {
+ if (is_realtime_conversion () &&
+ m_preedit.get_selected_segment () < 0)
+ {
+ // select latest segment
+ int n = m_preedit.get_nr_segments ();
+ if (n < 1)
+ return;
+ m_preedit.select_segment (n - 1);
+ }
+
+ // prepare candidates
+ m_preedit.get_candidates (m_lookup_table);
+
+ if (m_lookup_table.number_of_candidates () == 0)
+ return;
+
+ // set position
+ update_lookup_table (m_lookup_table);
+
+ // update preedit
+ m_preedit.select_candidate (m_lookup_table.get_cursor_pos ());
+ set_preedition ();
+
+ }
+
+ bool beyond_threshold =
+ m_factory->m_n_triggers_to_show_cand_win > 0 &&
+ (int) m_n_conv_key_pressed >= m_factory->m_n_triggers_to_show_cand_win;
+
+ if (!m_lookup_table_visible &&
+ (m_preedit.is_predicting () || beyond_threshold))
+ {
+ show_lookup_table ();
+ m_lookup_table_visible = true;
+ m_n_conv_key_pressed = 0;
+
+ if (m_factory->m_show_candidates_label) {
+ set_aux_string ();
+ show_aux_string ();
+ }
+ } else if (!m_lookup_table_visible) {
+ hide_lookup_table ();
+ }
+}
+
+void
+AnthyInstance::unset_lookup_table (void)
+{
+ m_lookup_table.clear ();
+ hide_lookup_table ();
+ m_lookup_table_visible = false;
+ m_n_conv_key_pressed = 0;
+
+ update_aux_string (utf8_mbstowcs (""));
+ hide_aux_string ();
+}
+
+void
+AnthyInstance::install_properties (void)
+{
+ if (m_properties.size () <= 0) {
+ Property prop;
+
+ if (m_factory->m_show_input_mode_label) {
+ prop = Property (SCIM_PROP_INPUT_MODE,
+ "\xE3\x81\x82", String (""), _("Input mode"));
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_INPUT_MODE_HIRAGANA,
+ _("Hiragana"), String (""), _("Hiragana"));
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_INPUT_MODE_KATAKANA,
+ _("Katakana"), String (""), _("Katakana"));
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_INPUT_MODE_HALF_KATAKANA,
+ _("Half width katakana"), String (""),
+ _("Half width katakana"));
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_INPUT_MODE_LATIN,
+ _("Latin"), String (""), _("Direct input"));
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_INPUT_MODE_WIDE_LATIN,
+ _("Wide latin"), String (""), _("Wide latin"));
+ m_properties.push_back (prop);
+ }
+
+ if (m_factory->m_show_typing_method_label) {
+ prop = Property (SCIM_PROP_TYPING_METHOD,
+ "\xEF\xBC\xB2", String (""), _("Typing method"));
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_TYPING_METHOD_ROMAJI,
+ _("Romaji"), String (""), _("Romaji"));
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_TYPING_METHOD_KANA,
+ _("Kana"), String (""), _("Kana"));
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_TYPING_METHOD_NICOLA,
+ _("Thumb shift"), String (""), _("Thumb shift"));
+ m_properties.push_back (prop);
+ }
+
+ if (m_factory->m_show_conv_mode_label) {
+ prop = Property (SCIM_PROP_CONV_MODE,
+ "\xE9\x80\xA3", String (""),
+ _("Conversion mode"));
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_CONV_MODE_MULTI_SEG,
+ _("Multi segment"), String (""),
+ _("Multi segment"));
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_CONV_MODE_SINGLE_SEG,
+ _("Single segment"), String (""),
+ _("Single segment"));
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_CONV_MODE_MULTI_REAL_TIME,
+ _("Convert as you type (Multi segment)"),
+ String (""),
+ _("Convert as you type (Multi segment)"));
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_CONV_MODE_SINGLE_REAL_TIME,
+ _("Convert as you type (Single segment)"),
+ String (""),
+ _("Convert as you type (Single segment)"));
+ m_properties.push_back (prop);
+ }
+
+ if (m_factory->m_show_period_style_label) {
+ prop = Property (SCIM_PROP_PERIOD_STYLE,
+ "\xE3\x80\x81\xE3\x80\x82", String (""),
+ _("Period style"));
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_PERIOD_STYLE_JAPANESE,
+ "\xE3\x80\x81\xE3\x80\x82", String (""),
+ "\xE3\x80\x81\xE3\x80\x82");
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_PERIOD_STYLE_WIDE_LATIN_JAPANESE,
+ "\xEF\xBC\x8C\xE3\x80\x82", String (""),
+ "\xEF\xBC\x8C\xE3\x80\x82");
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_PERIOD_STYLE_WIDE_LATIN,
+ "\xEF\xBC\x8C\xEF\xBC\x8E", String (""),
+ "\xEF\xBC\x8C\xEF\xBC\x8E");
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_PERIOD_STYLE_LATIN,
+ ",.", String (""), ",.");
+ m_properties.push_back (prop);
+ }
+
+ if (m_factory->m_show_symbol_style_label) {
+ prop = Property (SCIM_PROP_SYMBOL_STYLE,
+ UTF8_BRACKET_CORNER_BEGIN
+ UTF8_BRACKET_CORNER_END
+ UTF8_MIDDLE_DOT,
+ String (""),
+ _("Symbol style"));
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_SYMBOL_STYLE_JAPANESE,
+ UTF8_BRACKET_CORNER_BEGIN
+ UTF8_BRACKET_CORNER_END
+ UTF8_MIDDLE_DOT,
+ String (""),
+ UTF8_BRACKET_CORNER_BEGIN
+ UTF8_BRACKET_CORNER_END
+ UTF8_MIDDLE_DOT);
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_SYMBOL_STYLE_CORNER_BRACKET_SLASH,
+ UTF8_BRACKET_CORNER_BEGIN
+ UTF8_BRACKET_CORNER_END
+ UTF8_SLASH_WIDE,
+ String (""),
+ UTF8_BRACKET_CORNER_BEGIN
+ UTF8_BRACKET_CORNER_END
+ UTF8_SLASH_WIDE);
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_SYMBOL_STYLE_BRACKET_MIDDLE_DOT,
+ UTF8_BRACKET_WIDE_BEGIN
+ UTF8_BRACKET_WIDE_END
+ UTF8_MIDDLE_DOT,
+ String (""),
+ UTF8_BRACKET_WIDE_BEGIN
+ UTF8_BRACKET_WIDE_END
+ UTF8_MIDDLE_DOT);
+ m_properties.push_back (prop);
+
+ prop = Property (SCIM_PROP_SYMBOL_STYLE_BRACKET_SLASH,
+ UTF8_BRACKET_WIDE_BEGIN
+ UTF8_BRACKET_WIDE_END
+ UTF8_SLASH_WIDE,
+ String (""),
+ UTF8_BRACKET_WIDE_BEGIN
+ UTF8_BRACKET_WIDE_END
+ UTF8_SLASH_WIDE);
+ m_properties.push_back (prop);
+ }
+
+ if (m_factory->m_show_dict_label) {
+ prop = Property (SCIM_PROP_DICT,
+ String(""), //_("Dictionary"),
+ String (SCIM_ICONDIR "/" "scim-anthy-dict.png"),
+ _("Dictionary menu"));
+ m_properties.push_back (prop);
+
+ if (m_factory->m_show_dict_admin_label) {
+ prop = Property (SCIM_PROP_DICT_LAUNCH_ADMIN_TOOL,
+ _("Edit the dictionary"),
+ String (SCIM_ICONDIR "/" "scim-anthy-dict.png"),
+ _("Launch the dictionary administration tool."));
+ m_properties.push_back (prop);
+ }
+
+ if (m_factory->m_show_add_word_label) {
+ prop = Property (SCIM_PROP_DICT_ADD_WORD,
+ _("Add a word"),
+ String (SCIM_ICONDIR "/" "scim-anthy-dict.png"),
+ _("Add a word to the dictionary."));
+ m_properties.push_back (prop);
+ }
+ }
+ }
+
+ set_input_mode(get_input_mode ());
+ set_conversion_mode (m_conv_mode);
+ set_typing_method (get_typing_method ());
+ set_period_style (m_preedit.get_period_style (),
+ m_preedit.get_comma_style ());
+ set_symbol_style (m_preedit.get_bracket_style (),
+ m_preedit.get_slash_style ());
+
+ register_properties (m_properties);
+}
+
+void
+AnthyInstance::set_input_mode (InputMode mode)
+{
+ const char *label = "";
+
+ switch (mode) {
+ case SCIM_ANTHY_MODE_HIRAGANA:
+ label = "\xE3\x81\x82";
+ break;
+ case SCIM_ANTHY_MODE_KATAKANA:
+ label = "\xE3\x82\xA2";
+ break;
+ case SCIM_ANTHY_MODE_HALF_KATAKANA:
+ label = "_\xEF\xBD\xB1";
+ break;
+ case SCIM_ANTHY_MODE_LATIN:
+ label = "_A";
+ break;
+ case SCIM_ANTHY_MODE_WIDE_LATIN:
+ label = "\xEF\xBC\xA1";
+ break;
+ default:
+ break;
+ }
+
+ if (label && *label && m_factory->m_show_input_mode_label) {
+ PropertyList::iterator it = std::find (m_properties.begin (),
+ m_properties.end (),
+ SCIM_PROP_INPUT_MODE);
+ if (it != m_properties.end ()) {
+ it->set_label (label);
+ update_property (*it);
+ }
+ }
+
+ if (mode != get_input_mode ()) {
+ m_preedit.set_input_mode (mode);
+ set_preedition ();
+ }
+}
+
+void
+AnthyInstance::set_conversion_mode (ConversionMode mode)
+{
+ const char *label = "";
+
+ switch (mode) {
+ case SCIM_ANTHY_CONVERSION_MULTI_SEGMENT:
+ label = "\xE9\x80\xA3";
+ break;
+ case SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT:
+ label = "\xE5\x8D\x98";
+ break;
+ case SCIM_ANTHY_CONVERSION_MULTI_SEGMENT_IMMEDIATE:
+ label = "\xE9\x80\x90 \xE9\x80\xA3";
+ break;
+ case SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT_IMMEDIATE:
+ label = "\xE9\x80\x90 \xE5\x8D\x98";
+ break;
+ default:
+ break;
+ }
+
+ if (label && *label /*&& m_factory->m_show_input_mode_label*/) {
+ PropertyList::iterator it = std::find (m_properties.begin (),
+ m_properties.end (),
+ SCIM_PROP_CONV_MODE);
+ if (it != m_properties.end ()) {
+ it->set_label (label);
+ update_property (*it);
+ }
+ }
+
+ m_conv_mode = mode;
+}
+
+void
+AnthyInstance::set_typing_method (TypingMethod method)
+{
+ const char *label = "";
+
+ switch (method) {
+ case SCIM_ANTHY_TYPING_METHOD_ROMAJI:
+ label = "\xEF\xBC\xB2";
+ break;
+ case SCIM_ANTHY_TYPING_METHOD_KANA:
+ label = "\xE3\x81\x8B";
+ break;
+ case SCIM_ANTHY_TYPING_METHOD_NICOLA:
+ label = "\xE8\xA6\xAA";
+ break;
+ default:
+ break;
+ }
+
+ if (label && *label && m_factory->m_show_typing_method_label) {
+ PropertyList::iterator it = std::find (m_properties.begin (),
+ m_properties.end (),
+ SCIM_PROP_TYPING_METHOD);
+ if (it != m_properties.end ()) {
+ it->set_label (label);
+ update_property (*it);
+ }
+ }
+
+ if (method != get_typing_method ()) {
+ Key2KanaTable *fundamental_table = NULL;
+
+ if (method == SCIM_ANTHY_TYPING_METHOD_ROMAJI) {
+ fundamental_table = m_factory->m_custom_romaji_table;
+ } else if (method == SCIM_ANTHY_TYPING_METHOD_KANA) {
+ fundamental_table = m_factory->m_custom_kana_table;
+ }
+ m_preedit.set_typing_method (method);
+ m_preedit.set_pseudo_ascii_mode (get_pseudo_ascii_mode ());
+ }
+}
+
+void
+AnthyInstance::set_period_style (PeriodStyle period,
+ CommaStyle comma)
+{
+ String label;
+
+ switch (comma) {
+ case SCIM_ANTHY_COMMA_JAPANESE:
+ label = "\xE3\x80\x81";
+ break;
+ case SCIM_ANTHY_COMMA_WIDE:
+ label = "\xEF\xBC\x8C";
+ break;
+ case SCIM_ANTHY_COMMA_HALF:
+ label = ",";
+ break;
+ default:
+ break;
+ }
+
+ switch (period) {
+ case SCIM_ANTHY_PERIOD_JAPANESE:
+ label += "\xE3\x80\x82";
+ break;
+ case SCIM_ANTHY_PERIOD_WIDE:
+ label += "\xEF\xBC\x8E";
+ break;
+ case SCIM_ANTHY_PERIOD_HALF:
+ label += ".";
+ break;
+ default:
+ break;
+ }
+
+ if (label.length () > 0) {
+ PropertyList::iterator it = std::find (m_properties.begin (),
+ m_properties.end (),
+ SCIM_PROP_PERIOD_STYLE);
+ if (it != m_properties.end ()) {
+ it->set_label (label.c_str ());
+ update_property (*it);
+ }
+ }
+
+ if (period != m_preedit.get_period_style ())
+ m_preedit.set_period_style (period);
+ if (comma != m_preedit.get_comma_style ())
+ m_preedit.set_comma_style (comma);
+}
+
+void
+AnthyInstance::set_symbol_style (BracketStyle bracket,
+ SlashStyle slash)
+{
+ String label;
+
+ switch (bracket) {
+ case SCIM_ANTHY_BRACKET_JAPANESE:
+ label = UTF8_BRACKET_CORNER_BEGIN UTF8_BRACKET_CORNER_END;
+ break;
+ case SCIM_ANTHY_BRACKET_WIDE:
+ label = UTF8_BRACKET_WIDE_BEGIN UTF8_BRACKET_WIDE_END;
+ break;
+ default:
+ break;
+ }
+
+ switch (slash) {
+ case SCIM_ANTHY_SLASH_JAPANESE:
+ label += UTF8_MIDDLE_DOT;
+ break;
+ case SCIM_ANTHY_SLASH_WIDE:
+ label += UTF8_SLASH_WIDE;
+ break;
+ default:
+ break;
+ }
+
+ if (label.length () > 0) {
+ PropertyList::iterator it = std::find (m_properties.begin (),
+ m_properties.end (),
+ SCIM_PROP_SYMBOL_STYLE);
+ if (it != m_properties.end ()) {
+ it->set_label (label.c_str ());
+ update_property (*it);
+ }
+ }
+
+ if (bracket != m_preedit.get_bracket_style ())
+ m_preedit.set_bracket_style (bracket);
+ if (slash != m_preedit.get_slash_style ())
+ m_preedit.set_slash_style (slash);
+}
+
+bool
+AnthyInstance::is_selecting_candidates (void)
+{
+ if (m_lookup_table.number_of_candidates ())
+ return true;
+ else
+ return false;
+}
+
+bool
+AnthyInstance::action_do_nothing (void)
+{
+ return true;
+}
+
+bool
+AnthyInstance::action_convert (void)
+{
+ if (!m_preedit.is_preediting ())
+ return false;
+
+ if (!m_preedit.is_converting ()) {
+ // show conversion string
+ m_preedit.finish ();
+ m_preedit.convert (SCIM_ANTHY_CANDIDATE_DEFAULT,
+ is_single_segment ());
+ set_preedition ();
+ set_lookup_table ();
+ return true;
+ }
+
+ return false;
+}
+
+bool
+AnthyInstance::action_predict (void)
+{
+ if (!m_preedit.is_preediting ())
+ return false;
+
+ if (m_preedit.is_converting ())
+ return false;
+
+ if (!m_preedit.is_predicting ())
+ m_preedit.predict ();
+
+ m_preedit.select_candidate (0);
+ set_preedition ();
+ set_lookup_table ();
+ select_candidate_no_direct (0);
+
+ return true;
+}
+
+
+bool
+AnthyInstance::action_revert (void)
+{
+ if (m_preedit.is_reconverting ()) {
+ m_preedit.revert ();
+ commit_string (m_preedit.get_string ());
+ flush ();
+ return true;
+ }
+
+ if (!m_preedit.is_preediting ())
+ return false;
+
+ if (!m_preedit.is_converting ()) {
+ flush ();
+ return true;
+ }
+
+ if (is_selecting_candidates ()) {
+ m_lookup_table.clear ();
+ if (m_lookup_table_visible) {
+ unset_lookup_table ();
+ return true;
+ }
+ }
+
+ unset_lookup_table ();
+ m_preedit.revert ();
+ set_preedition ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_cancel_all (void)
+{
+ if (!m_preedit.is_preediting ())
+ return false;
+
+ flush ();
+ return true;
+}
+
+bool
+AnthyInstance::action_commit (bool learn)
+{
+ if (!m_preedit.is_preediting ())
+ return false;
+
+ if (m_preedit.is_converting ()) {
+ commit_string (m_preedit.get_string ());
+ if (learn)
+ m_preedit.commit ();
+ } else {
+ m_preedit.finish ();
+ commit_string (m_preedit.get_string ());
+ }
+
+ flush ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_commit_follow_preference (void)
+{
+ return action_commit (m_factory->m_learn_on_manual_commit);
+}
+
+bool
+AnthyInstance::action_commit_reverse_preference (void)
+{
+ return action_commit (!m_factory->m_learn_on_manual_commit);
+}
+
+bool
+AnthyInstance::action_back (void)
+{
+ if (!m_preedit.is_preediting ())
+ return false;
+
+ if (m_preedit.is_converting ()) {
+ action_revert ();
+ if (!is_realtime_conversion ())
+ return true;
+ }
+
+ m_preedit.erase ();
+
+ if (m_preedit.get_length () > 0) {
+ if (is_realtime_conversion ()) {
+ m_preedit.convert (SCIM_ANTHY_CANDIDATE_DEFAULT,
+ is_single_segment ());
+ m_preedit.select_segment (-1);
+ }
+ set_preedition ();
+ } else {
+ flush ();
+ }
+
+ return true;
+}
+
+bool
+AnthyInstance::action_delete (void)
+{
+ if (!m_preedit.is_preediting ())
+ return false;
+
+ if (m_preedit.is_converting ()) {
+ action_revert ();
+ if (!is_realtime_conversion ())
+ return true;
+ }
+
+ m_preedit.erase (false);
+
+ if (m_preedit.get_length () > 0) {
+ if (is_realtime_conversion ()) {
+ m_preedit.convert (SCIM_ANTHY_CANDIDATE_DEFAULT,
+ is_single_segment ());
+ m_preedit.select_segment (-1);
+ }
+ set_preedition ();
+ } else {
+ flush ();
+ }
+
+ return true;
+}
+
+bool
+AnthyInstance::action_insert_space (void)
+{
+ String str;
+ bool is_wide = false, retval = false;
+
+ if (m_preedit.is_preediting () && !m_factory->m_romaji_pseudo_ascii_blank_behavior)
+ return false;
+
+ if (m_factory->m_space_type == "FollowMode") {
+ InputMode mode = get_input_mode ();
+ if (mode == SCIM_ANTHY_MODE_LATIN ||
+ mode == SCIM_ANTHY_MODE_HALF_KATAKANA ||
+ m_preedit.is_pseudo_ascii_mode ())
+ {
+ is_wide = false;
+ } else {
+ is_wide = true;
+ }
+ } else if (m_factory->m_space_type == "Wide") {
+ is_wide = true;
+ }
+
+ if (is_wide) {
+ str = "\xE3\x80\x80";
+ retval = true;
+ } else if (get_typing_method () == SCIM_ANTHY_TYPING_METHOD_NICOLA || // FIXME! it's a ad-hoc solution.
+ m_preedit.is_pseudo_ascii_mode () ||
+ (m_last_key.code != SCIM_KEY_space &&
+ m_last_key.code != SCIM_KEY_KP_Space))
+ {
+ str = " ";
+ retval = true;
+ }
+
+ if (retval) {
+ if (m_preedit.is_pseudo_ascii_mode ()) {
+ m_preedit.append (m_last_key, str);
+ show_preedit_string ();
+ m_preedit_string_visible = true;
+ set_preedition ();
+ } else {
+ commit_string (utf8_mbstowcs (str));
+ }
+ }
+
+ return retval;
+}
+
+bool
+AnthyInstance::action_insert_alternative_space (void)
+{
+ bool is_wide = false;
+
+ if (m_preedit.is_preediting ())
+ return false;
+
+ if (m_factory->m_space_type == "FollowMode") {
+ InputMode mode = get_input_mode ();
+ if (mode == SCIM_ANTHY_MODE_LATIN ||
+ mode == SCIM_ANTHY_MODE_HALF_KATAKANA)
+ {
+ is_wide = true;
+ } else {
+ is_wide = false;
+ }
+ } else if (m_factory->m_space_type != "Wide") {
+ is_wide = true;
+ }
+
+ if (is_wide) {
+ commit_string (utf8_mbstowcs ("\xE3\x80\x80"));
+ return true;
+ } else if (get_typing_method () == SCIM_ANTHY_TYPING_METHOD_NICOLA || // FIXME! it's a ad-hoc solution.
+ (m_last_key.code != SCIM_KEY_space &&
+ m_last_key.code != SCIM_KEY_KP_Space))
+ {
+ commit_string (utf8_mbstowcs (" "));
+ return true;
+ }
+
+ return false;
+}
+
+bool
+AnthyInstance::action_insert_half_space (void)
+{
+ if (m_preedit.is_preediting ())
+ return false;
+
+ if (m_last_key.code != SCIM_KEY_space &&
+ m_last_key.code != SCIM_KEY_KP_Space)
+ {
+ commit_string (utf8_mbstowcs (" "));
+ return true;
+ }
+
+ return false;
+}
+
+bool
+AnthyInstance::action_insert_wide_space (void)
+{
+ if (m_preedit.is_preediting ())
+ return false;
+
+ commit_string (utf8_mbstowcs ("\xE3\x80\x80"));
+
+ return true;
+}
+
+bool
+AnthyInstance::action_move_caret_backward (void)
+{
+ if (!m_preedit.is_preediting ())
+ return false;
+ if (m_preedit.is_converting ())
+ return false;
+
+ m_preedit.move_caret(-1);
+ set_preedition ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_move_caret_forward (void)
+{
+ if (!m_preedit.is_preediting ())
+ return false;
+ if (m_preedit.is_converting ())
+ return false;
+
+ m_preedit.move_caret(1);
+ set_preedition ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_move_caret_first (void)
+{
+ if (!m_preedit.is_preediting ())
+ return false;
+ if (m_preedit.is_converting ())
+ return false;
+
+ m_preedit.set_caret_pos (0);
+ set_preedition ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_move_caret_last (void)
+{
+ if (!m_preedit.is_preediting ())
+ return false;
+ if (m_preedit.is_converting ())
+ return false;
+
+ m_preedit.set_caret_pos (m_preedit.get_length ());
+ set_preedition ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_select_prev_segment (void)
+{
+ if (!m_preedit.is_converting ())
+ return false;
+
+ unset_lookup_table ();
+
+ int idx = m_preedit.get_selected_segment ();
+ if (idx - 1 < 0) {
+ int n = m_preedit.get_nr_segments ();
+ if (n <= 0) return false;
+ m_preedit.select_segment (n - 1);
+ } else {
+ m_preedit.select_segment (idx - 1);
+ }
+ set_preedition ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_select_next_segment (void)
+{
+ if (!m_preedit.is_converting ())
+ return false;
+
+ unset_lookup_table ();
+
+ int idx = m_preedit.get_selected_segment ();
+ if (idx < 0) {
+ m_preedit.select_segment(0);
+ } else {
+ int n = m_preedit.get_nr_segments ();
+ if (n <= 0)
+ return false;
+ if (idx + 1 >= n)
+ m_preedit.select_segment(0);
+ else
+ m_preedit.select_segment(idx + 1);
+ }
+ set_preedition ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_select_first_segment (void)
+{
+ if (!m_preedit.is_converting ())
+ return false;
+
+ unset_lookup_table ();
+
+ m_preedit.select_segment(0);
+ set_preedition ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_select_last_segment (void)
+{
+ if (!m_preedit.is_converting ())
+ return false;
+
+ int n = m_preedit.get_nr_segments ();
+ if (n <= 0) return false;
+
+ unset_lookup_table ();
+
+ m_preedit.select_segment(n - 1);
+ set_preedition ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_shrink_segment (void)
+{
+ if (!m_preedit.is_converting ())
+ return false;
+
+ unset_lookup_table ();
+
+ m_preedit.resize_segment (-1);
+ set_preedition ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_expand_segment (void)
+{
+ if (!m_preedit.is_converting ())
+ return false;
+
+ unset_lookup_table ();
+
+ m_preedit.resize_segment (1);
+ set_preedition ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_commit_first_segment (void)
+{
+ if (!m_preedit.is_converting ()) {
+ if (m_preedit.is_preediting ()) {
+ return action_commit (m_factory->m_learn_on_manual_commit);
+ } else {
+ return false;
+ }
+ }
+
+ unset_lookup_table ();
+
+ commit_string (m_preedit.get_segment_string (0));
+ if (m_factory->m_learn_on_manual_commit)
+ m_preedit.commit (0);
+ else
+ m_preedit.clear (0);
+
+ set_preedition ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_commit_selected_segment (void)
+{
+ if (!m_preedit.is_converting ()) {
+ if (m_preedit.is_preediting ()) {
+ return action_commit (m_factory->m_learn_on_manual_commit);
+ } else {
+ return false;
+ }
+ }
+
+ unset_lookup_table ();
+
+ for (int i = 0; i <= m_preedit.get_selected_segment (); i++)
+ commit_string (m_preedit.get_segment_string (i));
+ if (m_factory->m_learn_on_manual_commit)
+ m_preedit.commit (m_preedit.get_selected_segment ());
+ else
+ m_preedit.clear (m_preedit.get_selected_segment ());
+
+ set_preedition ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_commit_first_segment_reverse_preference (void)
+{
+ if (!m_preedit.is_converting ()) {
+ if (m_preedit.is_preediting ()) {
+ return action_commit (!m_factory->m_learn_on_manual_commit);
+ } else {
+ return false;
+ }
+ }
+
+ unset_lookup_table ();
+
+ commit_string (m_preedit.get_segment_string (0));
+ if (!m_factory->m_learn_on_manual_commit)
+ m_preedit.commit (0);
+ else
+ m_preedit.clear (0);
+
+ set_preedition ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_commit_selected_segment_reverse_preference (void)
+{
+ if (!m_preedit.is_converting ()) {
+ if (m_preedit.is_preediting ()) {
+ return action_commit (!m_factory->m_learn_on_manual_commit);
+ } else {
+ return false;
+ }
+ }
+
+ unset_lookup_table ();
+
+ for (int i = 0; i <= m_preedit.get_selected_segment (); i++)
+ commit_string (m_preedit.get_segment_string (i));
+ if (!m_factory->m_learn_on_manual_commit)
+ m_preedit.commit (m_preedit.get_selected_segment ());
+ else
+ m_preedit.clear (m_preedit.get_selected_segment ());
+
+ set_preedition ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_select_next_candidate (void)
+{
+ if (!m_preedit.is_converting ())
+ return false;
+
+ //if (!is_selecting_candidates ())
+ set_lookup_table ();
+
+ int end = m_lookup_table.number_of_candidates () - 1;
+ if (m_lookup_table.get_cursor_pos () == end) {
+ m_lookup_table.set_cursor_pos (0);
+ } else {
+ m_lookup_table.cursor_down ();
+ }
+
+ int pos_in_page = m_lookup_table.get_cursor_pos_in_current_page ();
+ select_candidate_no_direct (pos_in_page);
+
+ return true;
+}
+
+bool
+AnthyInstance::action_select_prev_candidate (void)
+{
+ if (!m_preedit.is_converting ()) return false;
+
+ //if (!is_selecting_candidates ())
+ set_lookup_table ();
+
+ int end = m_lookup_table.number_of_candidates () - 1;
+ if (m_lookup_table.get_cursor_pos () == 0)
+ m_lookup_table.set_cursor_pos (end);
+ else
+ m_lookup_table.cursor_up ();
+
+ int pos_in_page = m_lookup_table.get_cursor_pos_in_current_page ();
+ select_candidate_no_direct (pos_in_page);
+
+ return true;
+}
+
+bool
+AnthyInstance::action_select_first_candidate (void)
+{
+ if (!m_preedit.is_converting ()) return false;
+ if (!is_selecting_candidates ()) return false;
+
+ m_lookup_table.set_cursor_pos (0);
+
+ int pos_in_page = m_lookup_table.get_cursor_pos_in_current_page ();
+ select_candidate_no_direct (pos_in_page);
+
+ return true;
+}
+
+bool
+AnthyInstance::action_select_last_candidate (void)
+{
+ if (!m_preedit.is_converting ()) return false;
+ if (!is_selecting_candidates ()) return false;
+
+ int end = m_lookup_table.number_of_candidates () - 1;
+ m_lookup_table.set_cursor_pos (end);
+
+ int pos_in_page = m_lookup_table.get_cursor_pos_in_current_page ();
+ select_candidate_no_direct (pos_in_page);
+
+ return true;
+}
+
+bool
+AnthyInstance::action_candidates_page_up(void)
+{
+ if (!m_preedit.is_converting ()) return false;
+ if (!is_selecting_candidates ()) return false;
+ if (!m_lookup_table_visible) return false;
+
+ m_lookup_table.page_up ();
+
+ int pos_in_page = m_lookup_table.get_cursor_pos_in_current_page ();
+ select_candidate_no_direct (pos_in_page);
+
+ return true;
+}
+
+bool
+AnthyInstance::action_candidates_page_down (void)
+{
+ if (!m_preedit.is_converting ()) return false;
+ if (!is_selecting_candidates ()) return false;
+ if (!m_lookup_table_visible) return false;
+
+ m_lookup_table.page_down ();
+
+ int pos_in_page = m_lookup_table.get_cursor_pos_in_current_page ();
+ select_candidate_no_direct (pos_in_page);
+
+ return true;
+}
+
+bool
+AnthyInstance::action_select_candidate (unsigned int i)
+{
+ // FIXME! m_lookup_table_visible should be set as true also on predicting
+ if (!m_lookup_table_visible && !m_preedit.is_predicting ())
+ return false;
+
+ if (m_preedit.is_predicting () && !m_preedit.is_converting () &&
+ m_factory->m_use_direct_key_on_predict)
+ {
+ CommonLookupTable table;
+ m_preedit.get_candidates (table);
+ if (i < table.number_of_candidates ()) {
+ select_candidate (i);
+ return true;
+ }
+ } else if (m_preedit.is_converting () && is_selecting_candidates ()) {
+ select_candidate (i);
+ return true;
+ }
+
+ return false;
+}
+
+bool
+AnthyInstance::action_select_candidate_1 (void)
+{
+ return action_select_candidate (0);
+}
+
+bool
+AnthyInstance::action_select_candidate_2 (void)
+{
+ return action_select_candidate (1);
+}
+
+bool
+AnthyInstance::action_select_candidate_3 (void)
+{
+ return action_select_candidate (2);
+}
+
+bool
+AnthyInstance::action_select_candidate_4 (void)
+{
+ return action_select_candidate (3);
+}
+
+bool
+AnthyInstance::action_select_candidate_5 (void)
+{
+ return action_select_candidate (4);
+}
+
+bool
+AnthyInstance::action_select_candidate_6 (void)
+{
+ return action_select_candidate (5);
+}
+
+bool
+AnthyInstance::action_select_candidate_7 (void)
+{
+ return action_select_candidate (6);
+}
+
+
+bool
+AnthyInstance::action_select_candidate_8 (void)
+{
+ return action_select_candidate (7);
+}
+
+bool
+AnthyInstance::action_select_candidate_9 (void)
+{
+ return action_select_candidate (8);
+}
+
+bool
+AnthyInstance::action_select_candidate_10 (void)
+{
+ return action_select_candidate (9);
+}
+
+bool
+AnthyInstance::action_circle_input_mode (void)
+{
+ InputMode mode = get_input_mode ();
+
+ switch (mode) {
+ case SCIM_ANTHY_MODE_HIRAGANA:
+ mode = SCIM_ANTHY_MODE_KATAKANA;
+ break;
+ case SCIM_ANTHY_MODE_KATAKANA:
+ mode = SCIM_ANTHY_MODE_HALF_KATAKANA;
+ break;
+ case SCIM_ANTHY_MODE_HALF_KATAKANA:
+ mode = SCIM_ANTHY_MODE_LATIN;
+ break;
+ case SCIM_ANTHY_MODE_LATIN:
+ mode = SCIM_ANTHY_MODE_WIDE_LATIN;
+ break;
+ case SCIM_ANTHY_MODE_WIDE_LATIN:
+ mode = SCIM_ANTHY_MODE_HIRAGANA;
+ break;
+ default:
+ mode = SCIM_ANTHY_MODE_HIRAGANA;
+ break;
+ }
+
+ set_input_mode (mode);
+
+ return true;
+}
+
+bool
+AnthyInstance::action_circle_typing_method (void)
+{
+ TypingMethod method;
+
+ method = get_typing_method ();
+ if (method == SCIM_ANTHY_TYPING_METHOD_NICOLA)
+ method = SCIM_ANTHY_TYPING_METHOD_ROMAJI;
+ else if (method == SCIM_ANTHY_TYPING_METHOD_KANA)
+ method = SCIM_ANTHY_TYPING_METHOD_NICOLA;
+ else
+ method = SCIM_ANTHY_TYPING_METHOD_KANA;
+
+ set_typing_method (method);
+
+ return true;
+}
+
+bool
+AnthyInstance::action_circle_kana_mode (void)
+{
+ InputMode mode;
+
+ if (get_input_mode () == SCIM_ANTHY_MODE_LATIN ||
+ get_input_mode () == SCIM_ANTHY_MODE_WIDE_LATIN)
+ {
+ mode = SCIM_ANTHY_MODE_HIRAGANA;
+ } else {
+ switch (get_input_mode ()) {
+ case SCIM_ANTHY_MODE_HIRAGANA:
+ mode = SCIM_ANTHY_MODE_KATAKANA;
+ break;
+ case SCIM_ANTHY_MODE_KATAKANA:
+ mode = SCIM_ANTHY_MODE_HALF_KATAKANA;
+ break;
+ case SCIM_ANTHY_MODE_HALF_KATAKANA:
+ default:
+ mode = SCIM_ANTHY_MODE_HIRAGANA;
+ break;
+ }
+ }
+
+ set_input_mode (mode);
+
+ return true;
+}
+
+bool
+AnthyInstance::action_on_off (void)
+{
+ if (get_input_mode () == SCIM_ANTHY_MODE_LATIN ||
+ get_input_mode () == SCIM_ANTHY_MODE_WIDE_LATIN)
+ {
+ set_input_mode (m_prev_input_mode);
+ m_preedit.set_input_mode (m_prev_input_mode);
+ } else {
+ m_prev_input_mode = get_input_mode ();
+ set_input_mode (SCIM_ANTHY_MODE_LATIN);
+ m_preedit.set_input_mode (SCIM_ANTHY_MODE_LATIN);
+ }
+
+ return true;
+}
+
+bool
+AnthyInstance::action_latin_mode (void)
+{
+ set_input_mode (SCIM_ANTHY_MODE_LATIN);
+ return true;
+}
+
+bool
+AnthyInstance::action_wide_latin_mode (void)
+{
+ set_input_mode (SCIM_ANTHY_MODE_WIDE_LATIN);
+ return true;
+}
+
+bool
+AnthyInstance::action_hiragana_mode (void)
+{
+ set_input_mode (SCIM_ANTHY_MODE_HIRAGANA);
+ return true;
+}
+
+bool
+AnthyInstance::action_katakana_mode (void)
+{
+ set_input_mode (SCIM_ANTHY_MODE_KATAKANA);
+ return true;
+}
+
+bool
+AnthyInstance::action_half_katakana_mode (void)
+{
+ set_input_mode (SCIM_ANTHY_MODE_HALF_KATAKANA);
+ return true;
+}
+
+bool
+AnthyInstance::action_cancel_pseudo_ascii_mode (void)
+{
+ if (!m_preedit.is_preediting ())
+ return false;
+ if (!m_preedit.is_pseudo_ascii_mode ())
+ return false;
+
+ m_preedit.reset_pseudo_ascii_mode ();
+
+ return true;
+}
+
+bool
+AnthyInstance::convert_kana (CandidateType type)
+{
+ if (!m_preedit.is_preediting ())
+ return false;
+
+ if (m_preedit.is_reconverting ())
+ return false;
+
+ unset_lookup_table ();
+
+ if (m_preedit.is_converting ()) {
+ int idx = m_preedit.get_selected_segment ();
+ if (idx < 0) {
+ action_revert ();
+ m_preedit.finish ();
+ m_preedit.convert (type, true);
+ } else {
+ m_preedit.select_candidate (type);
+ }
+ } else {
+ m_preedit.finish ();
+ m_preedit.convert (type, true);
+ }
+
+ set_preedition ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_convert_to_hiragana (void)
+{
+ return convert_kana (SCIM_ANTHY_CANDIDATE_HIRAGANA);
+}
+
+bool
+AnthyInstance::action_convert_to_katakana (void)
+{
+ return convert_kana (SCIM_ANTHY_CANDIDATE_KATAKANA);
+}
+
+bool
+AnthyInstance::action_convert_to_half (void)
+{
+ return convert_kana (SCIM_ANTHY_CANDIDATE_HALF);
+}
+
+bool
+AnthyInstance::action_convert_to_half_katakana (void)
+{
+ return convert_kana (SCIM_ANTHY_CANDIDATE_HALF_KATAKANA);
+}
+
+bool
+AnthyInstance::action_convert_to_latin (void)
+{
+ return convert_kana (SCIM_ANTHY_CANDIDATE_LATIN);
+}
+
+bool
+AnthyInstance::action_convert_to_wide_latin (void)
+{
+ return convert_kana (SCIM_ANTHY_CANDIDATE_WIDE_LATIN);
+}
+
+bool
+AnthyInstance::action_convert_char_type_forward (void)
+{
+ if (!m_preedit.is_preediting ())
+ return false;
+
+ unset_lookup_table ();
+
+ if (m_preedit.is_converting ()) {
+ int idx = m_preedit.get_selected_segment ();
+ if (idx < 0) {
+ action_revert ();
+ m_preedit.finish ();
+ m_preedit.convert (SCIM_ANTHY_CANDIDATE_HIRAGANA, true);
+ } else {
+ int cand = m_preedit.get_selected_candidate ();
+ switch (cand)
+ {
+ case SCIM_ANTHY_CANDIDATE_HIRAGANA:
+ m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_KATAKANA);
+ break;
+ case SCIM_ANTHY_CANDIDATE_KATAKANA:
+ m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_HALF_KATAKANA);
+ break;
+ case SCIM_ANTHY_CANDIDATE_HALF_KATAKANA:
+ m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_WIDE_LATIN);
+ break;
+ case SCIM_ANTHY_CANDIDATE_WIDE_LATIN:
+ m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_LATIN);
+ break;
+ case SCIM_ANTHY_CANDIDATE_LATIN:
+ m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_HIRAGANA);
+ break;
+ default:
+ m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_HIRAGANA);
+ break;
+ }
+ }
+ } else {
+ m_preedit.finish ();
+ m_preedit.convert (SCIM_ANTHY_CANDIDATE_HIRAGANA, true);
+ }
+
+ set_preedition ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_convert_char_type_backward (void)
+{
+ if (!m_preedit.is_preediting ())
+ return false;
+
+ unset_lookup_table ();
+
+ if (m_preedit.is_converting ()) {
+ int idx = m_preedit.get_selected_segment ();
+ if (idx < 0) {
+ action_revert ();
+ m_preedit.finish ();
+ m_preedit.convert (SCIM_ANTHY_CANDIDATE_HIRAGANA, true);
+ } else {
+ int cand = m_preedit.get_selected_candidate ();
+ switch (cand)
+ {
+ case SCIM_ANTHY_CANDIDATE_HIRAGANA:
+ m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_LATIN);
+ break;
+ case SCIM_ANTHY_CANDIDATE_KATAKANA:
+ m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_HIRAGANA);
+ break;
+ case SCIM_ANTHY_CANDIDATE_HALF_KATAKANA:
+ m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_KATAKANA);
+ break;
+ case SCIM_ANTHY_CANDIDATE_WIDE_LATIN:
+ m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_HALF_KATAKANA);
+ break;
+ case SCIM_ANTHY_CANDIDATE_LATIN:
+ m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_WIDE_LATIN);
+ break;
+ default:
+ m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_HIRAGANA);
+ break;
+ }
+ }
+ } else {
+ m_preedit.finish ();
+ m_preedit.convert (SCIM_ANTHY_CANDIDATE_HIRAGANA, true);
+ }
+
+ set_preedition ();
+
+ return true;
+}
+
+bool
+AnthyInstance::action_reconvert (void)
+{
+ if (m_preedit.is_preediting ())
+ return false;
+
+ Transaction send;
+ send.put_command (SCIM_ANTHY_TRANS_CMD_GET_SELECTION);
+ send_helper_event (String (SCIM_ANTHY_HELPER_UUID), send);
+
+ return true;
+}
+
+bool
+AnthyInstance::action_add_word (void)
+{
+ util_launch_program (m_factory->m_add_word_command.c_str ());
+
+ return true;
+}
+
+bool
+AnthyInstance::action_launch_dict_admin_tool (void)
+{
+ util_launch_program (m_factory->m_dict_admin_command.c_str ());
+
+ return true;
+}
+
+#if 0
+void
+AnthyInstance::action_regist_word (void)
+{
+}
+#endif
+
+AnthyFactory *
+AnthyInstance::get_factory (void)
+{
+ return m_factory;
+}
+
+TypingMethod
+AnthyInstance::get_typing_method (void)
+{
+ return m_preedit.get_typing_method ();
+}
+
+InputMode
+AnthyInstance::get_input_mode (void)
+{
+ return m_preedit.get_input_mode ();
+}
+
+int
+AnthyInstance::timeout_add (uint32 time_msec, timeout_func timeout_fn,
+ void *data, delete_func delete_fn)
+{
+ uint32 id = ++m_timeout_id_seq;
+ m_closures[id] = TimeoutClosure (time_msec, timeout_fn, data, delete_fn);
+ /*
+ * FIXME! Obsoleted closures should be removed at somewhere.
+ * Currenly only NICOLA related timer uses this feature and it will be
+ * removed each time on key press event so memory leaks doesn't exist.
+ */
+
+ Transaction send;
+ send.put_command (SCIM_ANTHY_TRANS_CMD_TIMEOUT_ADD);
+ send.put_data (id);
+ send.put_data (time_msec);
+ send_helper_event (String (SCIM_ANTHY_HELPER_UUID), send);
+
+ return id;
+}
+
+void
+AnthyInstance::timeout_remove (uint32 id)
+{
+ if (m_closures.find (id) == m_closures.end ())
+ return;
+
+ m_closures.erase (id);
+
+ Transaction send;
+ send.put_command (SCIM_ANTHY_TRANS_CMD_TIMEOUT_REMOVE);
+ send.put_data (id);
+ send_helper_event (String (SCIM_ANTHY_HELPER_UUID), send);
+}
+
+void
+AnthyInstance::trigger_property (const String &property)
+{
+ String anthy_prop = property.substr (property.find_last_of ('/') + 1);
+
+ SCIM_DEBUG_IMENGINE(2)
+ << "trigger_property : " << property << " - " << anthy_prop << "\n";
+
+ // input mode
+ if (property == SCIM_PROP_INPUT_MODE_HIRAGANA) {
+ set_input_mode (SCIM_ANTHY_MODE_HIRAGANA);
+ } else if (property == SCIM_PROP_INPUT_MODE_KATAKANA) {
+ set_input_mode (SCIM_ANTHY_MODE_KATAKANA);
+ } else if (property == SCIM_PROP_INPUT_MODE_HALF_KATAKANA) {
+ set_input_mode (SCIM_ANTHY_MODE_HALF_KATAKANA);
+ } else if (property == SCIM_PROP_INPUT_MODE_LATIN) {
+ set_input_mode (SCIM_ANTHY_MODE_LATIN);
+ } else if (property == SCIM_PROP_INPUT_MODE_WIDE_LATIN) {
+ set_input_mode (SCIM_ANTHY_MODE_WIDE_LATIN);
+
+ // conversion mode
+ } else if (property == SCIM_PROP_CONV_MODE_MULTI_SEG) {
+ set_conversion_mode (SCIM_ANTHY_CONVERSION_MULTI_SEGMENT);
+ } else if (property == SCIM_PROP_CONV_MODE_SINGLE_SEG) {
+ set_conversion_mode (SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT);
+ } else if (property == SCIM_PROP_CONV_MODE_MULTI_REAL_TIME) {
+ set_conversion_mode (SCIM_ANTHY_CONVERSION_MULTI_SEGMENT_IMMEDIATE);
+ } else if (property == SCIM_PROP_CONV_MODE_SINGLE_REAL_TIME) {
+ set_conversion_mode (SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT_IMMEDIATE);
+
+ // typing method
+ } else if (property == SCIM_PROP_TYPING_METHOD_ROMAJI) {
+ set_typing_method (SCIM_ANTHY_TYPING_METHOD_ROMAJI);
+ } else if (property == SCIM_PROP_TYPING_METHOD_KANA) {
+ set_typing_method (SCIM_ANTHY_TYPING_METHOD_KANA);
+ } else if (property == SCIM_PROP_TYPING_METHOD_NICOLA) {
+ set_typing_method (SCIM_ANTHY_TYPING_METHOD_NICOLA);
+
+ // period type
+ } else if (property == SCIM_PROP_PERIOD_STYLE_JAPANESE) {
+ set_period_style (SCIM_ANTHY_PERIOD_JAPANESE,
+ SCIM_ANTHY_COMMA_JAPANESE);
+ } else if (property == SCIM_PROP_PERIOD_STYLE_WIDE_LATIN_JAPANESE) {
+ set_period_style (SCIM_ANTHY_PERIOD_JAPANESE,
+ SCIM_ANTHY_COMMA_WIDE);
+ } else if (property == SCIM_PROP_PERIOD_STYLE_WIDE_LATIN) {
+ set_period_style (SCIM_ANTHY_PERIOD_WIDE,
+ SCIM_ANTHY_COMMA_WIDE);
+ } else if (property == SCIM_PROP_PERIOD_STYLE_LATIN) {
+ set_period_style (SCIM_ANTHY_PERIOD_HALF,
+ SCIM_ANTHY_COMMA_HALF);
+
+ // symbol type
+ } else if (property == SCIM_PROP_SYMBOL_STYLE_JAPANESE) {
+ set_symbol_style (SCIM_ANTHY_BRACKET_JAPANESE,
+ SCIM_ANTHY_SLASH_JAPANESE);
+ } else if (property == SCIM_PROP_SYMBOL_STYLE_CORNER_BRACKET_SLASH) {
+ set_symbol_style (SCIM_ANTHY_BRACKET_JAPANESE,
+ SCIM_ANTHY_SLASH_WIDE);
+ } else if (property == SCIM_PROP_SYMBOL_STYLE_BRACKET_MIDDLE_DOT) {
+ set_symbol_style (SCIM_ANTHY_BRACKET_WIDE,
+ SCIM_ANTHY_SLASH_JAPANESE);
+ } else if (property == SCIM_PROP_SYMBOL_STYLE_BRACKET_SLASH) {
+ set_symbol_style (SCIM_ANTHY_BRACKET_WIDE,
+ SCIM_ANTHY_SLASH_WIDE);
+
+ // dictionary
+ } else if (property == SCIM_PROP_DICT_ADD_WORD) {
+ action_add_word ();
+ } else if (property == SCIM_PROP_DICT_LAUNCH_ADMIN_TOOL) {
+ action_launch_dict_admin_tool ();
+ }
+}
+
+void
+AnthyInstance::process_helper_event (const String &helper_uuid,
+ const Transaction &recv)
+{
+ TransactionReader reader (recv);
+ int cmd;
+
+ if (helper_uuid != SCIM_ANTHY_HELPER_UUID)
+ return;
+
+ if (!reader.get_command (cmd))
+ return;
+
+ switch (cmd) {
+ case SCIM_ANTHY_TRANS_CMD_GET_SELECTION:
+ {
+ // For reconversion feature, but this code is ad-hoc solution.
+
+ WideString selection, surround;
+ if (!reader.get_data (selection) || selection.empty ())
+ break;
+
+ int cursor;
+ unsigned int len = selection.length ();
+ if (!get_surrounding_text (surround, cursor, len, len))
+ {
+ // We expect application to delete selection text.
+ m_preedit.convert(selection);
+ set_preedition();
+ set_lookup_table();
+ }
+ else
+ {
+ // This code will conflict if same string exists at both before and
+ // after the caret.
+ if (surround.length () - cursor >= len &&
+ surround.substr (cursor, len) == selection)
+ {
+ delete_surrounding_text (0, len);
+ m_preedit.convert (selection);
+ set_preedition ();
+ set_lookup_table ();
+ } else if (cursor >= (int) len &&
+ surround.substr (cursor - len, len) == selection)
+ {
+ delete_surrounding_text (0 - len, len);
+ m_preedit.convert (selection);
+ set_preedition ();
+ set_lookup_table ();
+ }
+ }
+ break;
+ }
+ case SCIM_ANTHY_TRANS_CMD_TIMEOUT_NOTIFY:
+ {
+ uint32 id;
+ if (reader.get_data (id) &&
+ m_closures.find (id) != m_closures.end ())
+ {
+ m_closures[id].close ();
+ m_closures.erase (id);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+void
+AnthyInstance::reload_config (const ConfigPointer &config)
+{
+ // set romaji settings
+ m_preedit.set_symbol_width (m_factory->m_romaji_half_symbol);
+ m_preedit.set_number_width (m_factory->m_romaji_half_number);
+
+ // set input mode
+ if (m_on_init || !m_factory->m_show_input_mode_label) {
+ if (m_factory->m_input_mode == "Hiragana")
+ m_preedit.set_input_mode (SCIM_ANTHY_MODE_HIRAGANA);
+ else if (m_factory->m_input_mode == "Katakana")
+ m_preedit.set_input_mode (SCIM_ANTHY_MODE_KATAKANA);
+ else if (m_factory->m_input_mode == "HalfKatakana")
+ m_preedit.set_input_mode (SCIM_ANTHY_MODE_HALF_KATAKANA);
+ else if (m_factory->m_input_mode == "Latin")
+ m_preedit.set_input_mode (SCIM_ANTHY_MODE_LATIN);
+ else if (m_factory->m_input_mode == "WideLatin")
+ m_preedit.set_input_mode (SCIM_ANTHY_MODE_WIDE_LATIN);
+ }
+
+ // set typing method and pseudo ASCII mode
+ if (m_on_init || !m_factory->m_show_typing_method_label) {
+ if (m_factory->m_typing_method == "NICOLA") {
+ m_preedit.set_typing_method (SCIM_ANTHY_TYPING_METHOD_NICOLA);
+ } else if (m_factory->m_typing_method == "Kana") {
+ m_preedit.set_typing_method (SCIM_ANTHY_TYPING_METHOD_KANA);
+ } else {
+ m_preedit.set_typing_method (SCIM_ANTHY_TYPING_METHOD_ROMAJI);
+ }
+ m_preedit.set_pseudo_ascii_mode (get_pseudo_ascii_mode ());
+ } else {
+ m_preedit.set_typing_method (get_typing_method ());
+ m_preedit.set_pseudo_ascii_mode (get_pseudo_ascii_mode ());
+ }
+
+ // set conversion mode
+ if (m_on_init || !m_factory->m_show_conv_mode_label) {
+ if (m_factory->m_conversion_mode == "MultiSeg")
+ m_conv_mode = SCIM_ANTHY_CONVERSION_MULTI_SEGMENT;
+ else if (m_factory->m_conversion_mode == "SingleSeg")
+ m_conv_mode = SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT;
+ else if (m_factory->m_conversion_mode == "CAYT_MultiSeg")
+ m_conv_mode = SCIM_ANTHY_CONVERSION_MULTI_SEGMENT_IMMEDIATE;
+ else if (m_factory->m_conversion_mode == "CAYT_SingleSeg")
+ m_conv_mode = SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT_IMMEDIATE;
+ }
+
+ // set period style
+ if (m_on_init || !m_factory->m_show_period_style_label) {
+ if (m_factory->m_period_style == "WideLatin") {
+ m_preedit.set_comma_style (SCIM_ANTHY_COMMA_WIDE);
+ m_preedit.set_period_style (SCIM_ANTHY_PERIOD_WIDE);
+ } else if (m_factory->m_period_style == "Latin") {
+ m_preedit.set_comma_style (SCIM_ANTHY_COMMA_HALF);
+ m_preedit.set_period_style (SCIM_ANTHY_PERIOD_HALF);
+ } else if (m_factory->m_period_style == "Japanese") {
+ m_preedit.set_comma_style (SCIM_ANTHY_COMMA_JAPANESE);
+ m_preedit.set_period_style (SCIM_ANTHY_PERIOD_JAPANESE);
+ } else if (m_factory->m_period_style == "WideLatin_Japanese") {
+ m_preedit.set_comma_style (SCIM_ANTHY_COMMA_WIDE);
+ m_preedit.set_period_style (SCIM_ANTHY_PERIOD_JAPANESE);
+ } else {
+ m_preedit.set_comma_style (SCIM_ANTHY_COMMA_JAPANESE);
+ m_preedit.set_period_style (SCIM_ANTHY_PERIOD_JAPANESE);
+ }
+ }
+
+ // set symbol style
+ if (m_on_init || !m_factory->m_show_symbol_style_label) {
+ if (m_factory->m_symbol_style == "Japanese") {
+ m_preedit.set_bracket_style (SCIM_ANTHY_BRACKET_JAPANESE);
+ m_preedit.set_slash_style (SCIM_ANTHY_SLASH_JAPANESE);
+ } else if (m_factory->m_symbol_style == "WideBracket_WideSlash") {
+ m_preedit.set_bracket_style (SCIM_ANTHY_BRACKET_WIDE);
+ m_preedit.set_slash_style (SCIM_ANTHY_SLASH_WIDE);
+ } else if (m_factory->m_symbol_style == "CornerBracket_WideSlash") {
+ m_preedit.set_bracket_style (SCIM_ANTHY_BRACKET_JAPANESE);
+ m_preedit.set_slash_style (SCIM_ANTHY_SLASH_WIDE);
+ } else if (m_factory->m_symbol_style == "WideBracket_MiddleDot") {
+ m_preedit.set_bracket_style (SCIM_ANTHY_BRACKET_WIDE);
+ m_preedit.set_slash_style (SCIM_ANTHY_SLASH_JAPANESE);
+ } else {
+ m_preedit.set_bracket_style (SCIM_ANTHY_BRACKET_JAPANESE);
+ m_preedit.set_slash_style (SCIM_ANTHY_SLASH_JAPANESE);
+ }
+ }
+
+ // set lookup table
+ if (m_factory->m_cand_win_page_size > 0)
+ m_lookup_table.set_page_size (m_factory->m_cand_win_page_size);
+ else
+ m_lookup_table.set_page_size (SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE_DEFAULT);
+
+ // setup toolbar
+ m_properties.clear ();
+ install_properties ();
+
+ // set encoding
+ m_preedit.set_dict_encoding (m_factory->m_dict_encoding);
+}
+
+bool
+AnthyInstance::is_single_segment (void)
+{
+ if (m_conv_mode == SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT ||
+ m_conv_mode == SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT_IMMEDIATE)
+ return true;
+ else
+ return false;
+}
+
+bool
+AnthyInstance::is_realtime_conversion (void)
+{
+ if (m_conv_mode == SCIM_ANTHY_CONVERSION_MULTI_SEGMENT_IMMEDIATE ||
+ m_conv_mode == SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT_IMMEDIATE)
+ return true;
+ else
+ return false;
+}
+
+int
+AnthyInstance::get_pseudo_ascii_mode (void)
+{
+ int retval = 0;
+ TypingMethod m = get_typing_method ();
+
+ if (m == SCIM_ANTHY_TYPING_METHOD_ROMAJI) {
+ if (m_factory->m_romaji_pseudo_ascii_mode)
+ retval |= SCIM_ANTHY_PSEUDO_ASCII_TRIGGERED_CAPITALIZED;
+ }
+
+ return retval;
+}
+
+/*
+vi:ts=4:nowrap:ai:expandtab
+*/
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004 Hiroyuki Ikezoe
+ * Copyright (C) 2004 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * The original code is scim_uim_imengine.cpp in scim-uim-0.1.3.
+ * Copyright (C) 2004 James Su <suzhe@tsinghua.org.cn>
+ */
+
+#ifndef __SCIM_ANTHY_IMENGINE_H__
+#define __SCIM_ANTHY_IMENGINE_H__
+
+#define Uses_SCIM_IMENGINE
+#define Uses_SCIM_CONFIG_BASE
+#include <map>
+#include <anthy/anthy.h>
+#include <scim.h>
+#include "scim_anthy_preedit.h"
+#include "scim_anthy_key2kana_table.h"
+
+using namespace scim;
+using namespace scim_anthy;
+
+class AnthyFactory;
+
+namespace scim_anthy {
+
+typedef enum {
+ SCIM_ANTHY_CONVERSION_MULTI_SEGMENT,
+ SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT,
+ SCIM_ANTHY_CONVERSION_MULTI_SEGMENT_IMMEDIATE,
+ SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT_IMMEDIATE,
+} ConversionMode;
+
+typedef void (*timeout_func) (void *data);
+typedef void (*delete_func) (void *data);
+
+class TimeoutClosure
+{
+public:
+ TimeoutClosure ()
+ : m_time_msec (0),
+ m_timeout_fn (NULL),
+ m_data (NULL),
+ m_delete_fn (NULL)
+ {}
+ TimeoutClosure (uint32 time_msec,
+ timeout_func timeout_fn,
+ void *data,
+ delete_func delete_fn)
+ : m_time_msec (time_msec),
+ m_timeout_fn (timeout_fn),
+ m_data (data),
+ m_delete_fn (delete_fn)
+ {}
+ virtual ~TimeoutClosure ()
+ {
+ if (m_delete_fn && m_data)
+ m_delete_fn (m_data);
+ }
+
+ void close (void) { m_timeout_fn (m_data); }
+private:
+ uint32 m_time_msec;
+ timeout_func m_timeout_fn;
+ void *m_data;
+ delete_func m_delete_fn;
+};
+
+typedef std::map<int, TimeoutClosure> TimeoutClosures;
+
+}
+
+class AnthyInstance : public IMEngineInstanceBase
+{
+public:
+ AnthyInstance (AnthyFactory *factory,
+ const String &encoding,
+ int id = -1);
+ virtual ~AnthyInstance ();
+
+ virtual bool process_key_event (const KeyEvent& key);
+ virtual void move_preedit_caret (unsigned int pos);
+ virtual void select_candidate (unsigned int item);
+ virtual void update_lookup_table_page_size(unsigned int page_size);
+ virtual void lookup_table_page_up (void);
+ virtual void lookup_table_page_down (void);
+ virtual void reset (void);
+ virtual void focus_in (void);
+ virtual void focus_out (void);
+ virtual void trigger_property (const String &property);
+ virtual void process_helper_event (const String &helper_uuid,
+ const Transaction &trans);
+
+ virtual void reload_config (const ConfigPointer &config);
+ virtual void flush ();
+ virtual void set_layout (unsigned int layout);
+
+public:
+ /* actions */
+ bool action_do_nothing (void);
+
+ bool action_convert (void);
+ bool action_predict (void);
+ bool action_revert (void);
+ bool action_cancel_all (void);
+ bool action_commit_follow_preference (void);
+ bool action_commit_reverse_preference (void);
+ bool action_commit_first_segment (void);
+ bool action_commit_selected_segment (void);
+ bool action_commit_first_segment_reverse_preference
+ (void);
+ bool action_commit_selected_segment_reverse_preference
+ (void);
+ bool action_back (void);
+ bool action_delete (void);
+ bool action_insert_space (void);
+ bool action_insert_alternative_space (void);
+ bool action_insert_half_space (void);
+ bool action_insert_wide_space (void);
+
+ bool action_move_caret_backward (void);
+ bool action_move_caret_forward (void);
+ bool action_move_caret_first (void);
+ bool action_move_caret_last (void);
+
+ bool action_select_prev_segment (void);
+ bool action_select_next_segment (void);
+ bool action_select_first_segment (void);
+ bool action_select_last_segment (void);
+ bool action_shrink_segment (void);
+ bool action_expand_segment (void);
+
+ bool action_select_first_candidate (void);
+ bool action_select_last_candidate (void);
+ bool action_select_next_candidate (void);
+ bool action_select_prev_candidate (void);
+ bool action_candidates_page_up (void);
+ bool action_candidates_page_down (void);
+
+ bool action_select_candidate_1 (void);
+ bool action_select_candidate_2 (void);
+ bool action_select_candidate_3 (void);
+ bool action_select_candidate_4 (void);
+ bool action_select_candidate_5 (void);
+ bool action_select_candidate_6 (void);
+ bool action_select_candidate_7 (void);
+ bool action_select_candidate_8 (void);
+ bool action_select_candidate_9 (void);
+ bool action_select_candidate_10 (void);
+
+ bool action_convert_to_hiragana (void);
+ bool action_convert_to_katakana (void);
+ bool action_convert_to_half (void);
+ bool action_convert_to_half_katakana (void);
+ bool action_convert_to_latin (void);
+ bool action_convert_to_wide_latin (void);
+ bool action_convert_char_type_forward (void);
+ bool action_convert_char_type_backward (void);
+ bool action_reconvert (void);
+
+ bool action_on_off (void);
+
+ bool action_circle_input_mode (void);
+ bool action_circle_kana_mode (void);
+ bool action_circle_typing_method (void);
+
+ bool action_latin_mode (void);
+ bool action_wide_latin_mode (void);
+ bool action_hiragana_mode (void);
+ bool action_katakana_mode (void);
+ bool action_half_katakana_mode (void);
+ bool action_cancel_pseudo_ascii_mode (void);
+
+ bool action_add_word (void);
+ bool action_launch_dict_admin_tool (void);
+ /*
+ void actoin_register_word (void);
+ */
+
+public:
+ AnthyFactory *
+ get_factory (void);
+ TypingMethod
+ get_typing_method (void);
+ InputMode
+ get_input_mode (void);
+ int timeout_add (uint32 time_msec,
+ timeout_func timeout_fn,
+ void *data = NULL,
+ delete_func delete_fn = NULL);
+ void timeout_remove (uint32 id);
+ int get_pseudo_ascii_mode (void);
+
+private:
+ /* processing key event */
+ bool process_key_event_input (const KeyEvent &key);
+ bool process_key_event_lookup_keybind (const KeyEvent &key);
+ bool process_key_event_latin_mode (const KeyEvent &key);
+ bool process_key_event_wide_latin_mode (const KeyEvent &key);
+
+ /* utility */
+ void set_preedition (void);
+ void set_aux_string (void);
+ void set_lookup_table (void);
+ void unset_lookup_table (void);
+ void install_properties (void);
+ void set_input_mode (InputMode mode);
+ void set_conversion_mode (ConversionMode mode);
+ void set_typing_method (TypingMethod method);
+ void set_period_style (PeriodStyle period,
+ CommaStyle comma);
+ void set_symbol_style (BracketStyle bracket,
+ SlashStyle slash);
+ bool is_selecting_candidates (void);
+ void select_candidate_no_direct (unsigned int item);
+ bool convert_kana (CandidateType type);
+
+ bool action_commit (bool learn);
+ bool action_select_candidate (unsigned int i);
+
+ bool is_single_segment (void);
+ bool is_realtime_conversion (void);
+
+private: // FIXME!
+ bool is_nicola_thumb_shift_key (const KeyEvent &key);
+
+private:
+ AnthyFactory *m_factory;
+
+ bool m_on_init;
+
+ /* for preedit */
+ Preedit m_preedit;
+ bool m_preedit_string_visible;
+
+ /* for candidates window */
+ CommonLookupTable m_lookup_table;
+ bool m_lookup_table_visible;
+ unsigned int m_n_conv_key_pressed;
+
+ /* for toggling latin and wide latin */
+ InputMode m_prev_input_mode;
+
+ /* for toolbar */
+ PropertyList m_properties;
+
+ /* */
+ ConversionMode m_conv_mode;
+
+ /* for action */
+ KeyEvent m_last_key;
+
+ /* Helper */
+ bool m_helper_started;
+
+ /* timeout */
+ uint32 m_timeout_id_seq;
+ TimeoutClosures m_closures;
+
+ unsigned int m_layout;
+};
+#endif /* __SCIM_ANTHY_IMENGINE_H__ */
+/*
+vi:ts=4:nowrap:ai:expandtab
+*/
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) Hiroyuki Ikezoe <poincare@ikezoe.net>
+ * Copyright (C) 2004 - 2005 Takuro Ashie <ashie@homa.ne.jp>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __INTL_H__
+#define __INTL_H__
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#endif
+
+#ifdef HAVE_GETTEXT
+ #include <libintl.h>
+ #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
+
+#endif /* __INTL_H__ */
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <string.h>
+
+#include "scim_anthy_kana.h"
+#include "scim_anthy_factory.h"
+#include "scim_anthy_imengine.h"
+#include "scim_anthy_default_tables.h"
+#include "scim_anthy_utils.h"
+
+using namespace scim_anthy;
+
+static bool
+has_voiced_consonant (String str)
+{
+ VoicedConsonantRule *table = scim_anthy_voiced_consonant_table;
+
+ for (unsigned int i = 0; table[i].string; i++) {
+ if (!strcmp (str.c_str (), table[i].string) &&
+ table[i].voiced && *table[i].voiced)
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+static bool
+has_half_voiced_consonant (String str)
+{
+ VoicedConsonantRule *table = scim_anthy_voiced_consonant_table;
+
+ for (unsigned int i = 0; table[i].string; i++) {
+ if (!strcmp (str.c_str (), table[i].string) &&
+ table[i].half_voiced && *table[i].half_voiced)
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+String
+to_voiced_consonant (String str)
+{
+ VoicedConsonantRule *table = scim_anthy_voiced_consonant_table;
+
+ for (unsigned int i = 0; table[i].string; i++) {
+ if (!strcmp (str.c_str (), table[i].string))
+ return String (table[i].voiced);
+ }
+
+ return str;
+}
+
+String
+to_half_voiced_consonant (String str)
+{
+ VoicedConsonantRule *table = scim_anthy_voiced_consonant_table;
+
+ for (unsigned int i = 0; table[i].string; i++) {
+ if (!strcmp (str.c_str (), table[i].string))
+ return String (table[i].half_voiced);
+ }
+
+ return str;
+}
+
+KanaConvertor::KanaConvertor (AnthyInstance &anthy)
+ : m_anthy (anthy)
+{
+}
+
+KanaConvertor::~KanaConvertor ()
+{
+}
+
+bool
+KanaConvertor::can_append (const KeyEvent & key,
+ bool ignore_space)
+{
+ // ignore key release.
+ if (key.is_key_release ())
+ return false;
+
+ // ignore short cut keys of apllication.
+ if (key.mask & SCIM_KEY_ControlMask ||
+ key.mask & SCIM_KEY_AltMask)
+ {
+ return false;
+ }
+
+ if (key.code == SCIM_KEY_overline ||
+ (key.code >= SCIM_KEY_kana_fullstop &&
+ key.code <= SCIM_KEY_semivoicedsound))
+ {
+ return true;
+ }
+
+#if 0
+ if (key.code == SCIM_KEY_KP_Equal ||
+ (key.code >= SCIM_KEY_KP_Multiply &&
+ key.code <= SCIM_KEY_KP_9))
+ {
+ return true;
+ }
+#endif
+
+ return false;
+}
+
+bool
+KanaConvertor::append (const KeyEvent & key,
+ WideString & result,
+ WideString & pending,
+ String &raw)
+{
+ KeyCodeToCharRule *table = scim_anthy_keypad_table;
+
+ // handle keypad code
+ if (key.code == SCIM_KEY_KP_Equal ||
+ (key.code >= SCIM_KEY_KP_Multiply &&
+ key.code <= SCIM_KEY_KP_9))
+ {
+ String ten_key_type = m_anthy.get_factory()->m_ten_key_type;
+
+ for (unsigned int i = 0; table[i].code; i++) {
+ if (table[i].code == key.code) {
+ if (ten_key_type == "Wide")
+ util_convert_to_wide (result, table[i].kana);
+ else
+ result = utf8_mbstowcs (table[i].kana);
+ raw = table[i].kana;
+
+ return false;
+ }
+ }
+ }
+
+ table = scim_anthy_kana_table;
+
+ // handle voiced sound
+ if (key.code == SCIM_KEY_voicedsound &&
+ !m_pending.empty () && has_voiced_consonant (m_pending))
+ {
+ result = utf8_mbstowcs (to_voiced_consonant (m_pending));
+ raw = key.get_ascii_code ();
+ m_pending = String ();
+ return false;
+ }
+
+ // handle semi voiced sound
+ if (key.code == SCIM_KEY_semivoicedsound &&
+ !m_pending.empty () && has_half_voiced_consonant (m_pending))
+ {
+ result = utf8_mbstowcs (to_half_voiced_consonant (m_pending));
+ raw = key.get_ascii_code ();
+ m_pending = String ();
+ return false;
+ }
+
+ // kana key code
+ for (unsigned int i = 0; table[i].code; i++) {
+ if (table[i].code == key.code) {
+ bool retval = m_pending.empty () ? false : true;
+
+ if (has_voiced_consonant (table[i].kana)) {
+ result = WideString ();
+ pending = utf8_mbstowcs (table[i].kana);
+ m_pending = table[i].kana;
+ } else {
+ result = utf8_mbstowcs (table[i].kana);
+ m_pending = String ();
+ }
+ raw = key.get_ascii_code ();
+
+ return retval;
+ }
+ }
+
+ String s;
+ s += key.get_ascii_code ();
+ raw = s;
+
+ return append (raw, result, pending);
+}
+
+bool
+KanaConvertor::append (const String & str,
+ WideString & result,
+ WideString & pending)
+{
+ result = utf8_mbstowcs (str);
+ m_pending = String ();
+
+ return false;
+}
+
+void
+KanaConvertor::clear (void)
+{
+ m_pending = String ();
+}
+
+bool
+KanaConvertor::is_pending (void)
+{
+ return !m_pending.empty ();
+}
+
+WideString
+KanaConvertor::get_pending (void)
+{
+ return WideString (utf8_mbstowcs (m_pending));
+}
+
+WideString
+KanaConvertor::flush_pending (void)
+{
+ return WideString ();
+}
+
+void
+KanaConvertor::reset_pending (const WideString &result, const String &raw)
+{
+ m_pending = String ();
+ if (has_voiced_consonant (utf8_wcstombs (result)))
+ m_pending = utf8_wcstombs (result);
+}
+/*
+vi:ts=4:nowrap:ai:expandtab
+*/
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SCIM_ANTHY_KANA_H__
+#define __SCIM_ANTHY_KANA_H__
+
+#define Uses_SCIM_ICONV
+#define Uses_SCIM_EVENT
+#include <scim.h>
+
+#include "scim_anthy_key2kana_base.h"
+#include "scim_anthy_default_tables.h"
+#include "scim_anthy_key2kana_table.h"
+
+using namespace scim;
+
+class AnthyInstance;
+
+namespace scim_anthy {
+
+class KanaConvertor : public Key2KanaConvertorBase
+{
+public:
+ KanaConvertor (AnthyInstance & anthy);
+ virtual ~KanaConvertor ();
+
+ bool can_append (const KeyEvent & key,
+ bool ignore_space = false);
+ bool append (const KeyEvent & key,
+ WideString & result,
+ WideString & pending,
+ String & raw);
+ bool append (const String & raw,
+ WideString & result,
+ WideString & pending);
+ void clear (void);
+
+ bool is_pending (void);
+ WideString get_pending (void);
+ WideString flush_pending (void);
+ void reset_pending (const WideString & result,
+ const String & raw);
+
+private:
+ AnthyInstance &m_anthy;
+
+ // state
+ String m_pending;
+};
+
+}
+#endif /* __SCIM_ANTHY_KANA_H__ */
+/*
+vi:ts=4:nowrap:ai:expandtab
+*/
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004 Hiroyuki Ikezoe
+ * Copyright (C) 2004 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "scim_anthy_key2kana.h"
+#include "scim_anthy_factory.h"
+#include "scim_anthy_imengine.h"
+#include "scim_anthy_utils.h"
+
+using namespace scim_anthy;
+
+Key2KanaConvertor::Key2KanaConvertor (AnthyInstance & anthy,
+ Key2KanaTableSet & tables)
+ : m_anthy (anthy),
+ m_tables (tables),
+ m_is_in_pseudo_ascii_mode (false)
+{
+ set_case_sensitive (false);
+ set_pseudo_ascii_mode (0);
+}
+
+Key2KanaConvertor::~Key2KanaConvertor ()
+{
+}
+
+bool
+Key2KanaConvertor::can_append (const KeyEvent & key,
+ bool ignore_space)
+{
+ // ignore key release.
+ if (key.is_key_release ())
+ return false;
+
+ // ignore short cut keys of apllication.
+ if (key.mask & SCIM_KEY_ControlMask ||
+ key.mask & SCIM_KEY_AltMask)
+ {
+ return false;
+ }
+
+ if (isprint(key.get_ascii_code ()) &&
+ (ignore_space || !isspace(key.get_ascii_code ())))
+ return true;
+
+ if (util_key_is_keypad (key))
+ return true;
+
+ return false;
+}
+
+bool
+Key2KanaConvertor::append (const KeyEvent & key,
+ WideString & result,
+ WideString & pending,
+ String &raw)
+{
+ if (!can_append (key))
+ return false;
+
+ m_last_key = key;
+
+ util_keypad_to_string (raw, key);
+
+ if (util_key_is_keypad (key)) {
+ bool retval = false;
+ WideString wide;
+ String ten_key_type = m_anthy.get_factory()->m_ten_key_type;
+
+ // convert key pad string to wide
+ if ((ten_key_type == "FollowMode" &&
+ (m_anthy.get_input_mode () == SCIM_ANTHY_MODE_LATIN ||
+ m_anthy.get_input_mode () == SCIM_ANTHY_MODE_HALF_KATAKANA)) ||
+ ten_key_type == "Half")
+ {
+ wide = utf8_mbstowcs (raw);
+ } else {
+ util_convert_to_wide (wide, raw);
+ }
+
+ // join to previous string
+ if (!m_exact_match.is_empty()) {
+ if (!m_exact_match.get_result(0).empty() &&
+ m_exact_match.get_result(1).empty())
+ {
+ result = utf8_mbstowcs (m_exact_match.get_result(0));
+ } else {
+ retval = true; /* commit prev pending */
+ }
+ result += wide;
+ } else {
+ if (m_pending.length () > 0)
+ retval = true; /* commit prev pending */
+ result = wide;
+ }
+
+ m_pending.clear ();
+ m_exact_match.clear ();
+
+ return retval;
+
+ } else {
+ // the key isn't keypad
+ return append (raw, result, pending);
+ }
+}
+
+bool
+Key2KanaConvertor::append (const String & str,
+ WideString & result, WideString & pending)
+{
+ WideString widestr = utf8_mbstowcs (str);
+ WideString matching_str = m_pending + widestr;
+ Key2KanaRule exact_match;
+ bool has_partial_match = false;
+ bool retval = false;
+
+ if (m_pseudo_ascii_mode != 0 && process_pseudo_ascii_mode (widestr)) {
+ m_pending += widestr;
+ pending = m_pending;
+ return false;
+ }
+ if (!m_case_sensitive) {
+ String half = utf8_wcstombs (matching_str);
+ for (unsigned int i = 0; i < half.length (); i++)
+ half[i] = tolower (half[i]);
+ matching_str = utf8_mbstowcs (half);
+ }
+
+ /* find matched table */
+ if ((m_anthy.get_typing_method () == SCIM_ANTHY_TYPING_METHOD_KANA) &&
+ (m_last_key.mask & /*SCIM_KEY_QuirkKanaRoMask*/ (1<<14)) &&
+ (m_anthy.get_factory()->m_kana_layout_ro_key.length () > 0))
+ {
+ // Special treatment for Kana "Ro" key.
+ // This code is a temporary solution. It doesn't care some minor cases.
+ std::vector<String> kana_ro_result;
+ scim_split_string_list (kana_ro_result,
+ m_anthy.get_factory()->m_kana_layout_ro_key);
+ Key2KanaRule kana_ro_rule("\\", kana_ro_result);
+ result = utf8_mbstowcs (kana_ro_rule.get_result (0));
+ m_pending.clear ();
+ m_exact_match.clear ();
+ if (matching_str == utf8_mbstowcs ("\\")) {
+ return false;
+ } else {
+ return true;
+ }
+
+ } else {
+ std::vector<Key2KanaTable*> &tables = m_tables.get_tables();
+ for (unsigned int j = 0; j < tables.size(); j++) {
+ if (!tables[j])
+ continue;
+
+ Key2KanaRules &rules = tables[j]->get_table ();
+
+ for (unsigned int i = 0; i < rules.size(); i++) {
+ /* matching */
+ String seq = rules[i].get_sequence ();
+ if (!m_case_sensitive) {
+ for (unsigned int j = 0; j < seq.length (); j++)
+ seq[j] = tolower (seq[j]);
+ }
+ WideString romaji = utf8_mbstowcs(seq);
+ if (romaji.find (matching_str) == 0) {
+ if (romaji.length () == matching_str.length ()) {
+ /* exact match */
+ exact_match = rules[i];
+ } else {
+ /* partial match */
+ has_partial_match = true;
+ }
+ }
+ }
+ }
+ }
+
+ /* return result */
+ if (has_partial_match) {
+ m_exact_match = exact_match;
+ result.clear ();
+ m_pending += widestr;
+ pending = m_pending;
+
+ } else if (!exact_match.is_empty()) {
+ if (!exact_match.get_result(1).empty())
+ m_exact_match = exact_match;
+ else
+ m_exact_match.clear ();
+ m_pending = utf8_mbstowcs (exact_match.get_result (1));
+ result = utf8_mbstowcs (exact_match.get_result (0));
+ pending = m_pending;
+
+ } else {
+ if (!m_exact_match.is_empty()) {
+ if (!m_exact_match.get_result(0).empty() &&
+ m_exact_match.get_result(1).empty())
+ {
+ result = utf8_mbstowcs (m_exact_match.get_result(0));
+ } else {
+ retval = true; /* commit prev pending */
+ }
+ m_pending.clear ();
+ m_exact_match.clear ();
+
+ WideString tmp_result;
+ append(str, tmp_result, pending);
+ result += tmp_result;
+
+ } else {
+ if (m_pending.length () > 0) {
+ retval = true; /* commit prev pending */
+ m_pending = widestr;
+ pending = m_pending;
+
+ } else {
+ result = widestr;
+ pending.clear();
+ m_pending.clear ();
+ }
+ }
+ }
+
+ return retval;
+}
+
+void
+Key2KanaConvertor::clear (void)
+{
+ m_pending.clear ();
+ m_exact_match.clear ();
+ m_last_key = KeyEvent ();
+ reset_pseudo_ascii_mode();
+}
+
+bool
+Key2KanaConvertor::is_pending (void)
+{
+ if (m_pending.length () > 0)
+ return true;
+ else
+ return false;
+}
+
+WideString
+Key2KanaConvertor::get_pending (void)
+{
+ return m_pending;
+}
+
+WideString
+Key2KanaConvertor::flush_pending (void)
+{
+ WideString result;
+ if (!m_exact_match.is_empty ()) {
+ if (!m_exact_match.get_result(0).empty() &&
+ m_exact_match.get_result(1).empty())
+ {
+ result = utf8_mbstowcs (m_exact_match.get_result(0));
+ } else if (!m_exact_match.get_result(1).empty()) {
+ result += utf8_mbstowcs (m_exact_match.get_result(1));
+ } else if (m_pending.length () > 0) {
+ result += m_pending;
+ }
+ }
+ clear ();
+ return result;
+}
+
+void
+Key2KanaConvertor::reset_pending (const WideString &result, const String &raw)
+{
+ m_last_key = KeyEvent ();
+
+ for (unsigned int i = 0; i < raw.length (); i++) {
+ WideString res, pend;
+ append (raw.substr(i, 1), res, pend);
+ }
+}
+
+bool
+Key2KanaConvertor::process_pseudo_ascii_mode (const WideString & wstr)
+{
+ for (unsigned int i = 0; i < wstr.length (); i++) {
+ if ((wstr[i] >= 'A' && wstr[i] <= 'Z') ||
+ iswspace(wstr[i]))
+ {
+ m_is_in_pseudo_ascii_mode = true;
+ } else if (wstr[i] >= 0x80) {
+ m_is_in_pseudo_ascii_mode = false;
+ }
+ }
+
+ return m_is_in_pseudo_ascii_mode;
+}
+
+void
+Key2KanaConvertor::reset_pseudo_ascii_mode (void)
+{
+ if (m_is_in_pseudo_ascii_mode)
+ m_pending.clear();
+ m_is_in_pseudo_ascii_mode = false;
+}
+
+/*
+vi:ts=4:nowrap:ai:expandtab
+*/
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004 Hiroyuki Ikezoe
+ * Copyright (C) 2004 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SCIM_ANTHY_KEY2KANA_H__
+#define __SCIM_ANTHY_KEY2KANA_H__
+
+#define Uses_SCIM_EVENT
+#include <scim.h>
+
+#include "scim_anthy_key2kana_base.h"
+#include "scim_anthy_default_tables.h"
+#include "scim_anthy_key2kana_table.h"
+
+using namespace scim;
+
+class AnthyInstance;
+
+namespace scim_anthy {
+
+class Key2KanaConvertor : public Key2KanaConvertorBase
+{
+public:
+ Key2KanaConvertor (AnthyInstance & anthy,
+ Key2KanaTableSet & tables);
+ virtual ~Key2KanaConvertor ();
+
+ bool can_append (const KeyEvent & key,
+ bool ignore_space = false);
+ bool append (const KeyEvent & key,
+ WideString & result,
+ WideString & pending,
+ String & raw);
+ void clear (void);
+
+ bool is_pending (void);
+ WideString get_pending (void);
+ WideString flush_pending (void);
+ void reset_pending (const WideString & result,
+ const String & raw);
+ void set_pseudo_ascii_mode (int mode)
+ { m_pseudo_ascii_mode = mode; }
+ bool is_pseudo_ascii_mode (void)
+ { return m_is_in_pseudo_ascii_mode; }
+ bool process_pseudo_ascii_mode (const WideString & wstr);
+ void reset_pseudo_ascii_mode (void);
+
+private:
+ bool append (const String & str,
+ WideString & result,
+ WideString & pending);
+
+private:
+ AnthyInstance &m_anthy;
+ Key2KanaTableSet &m_tables;
+
+ // state
+ KeyEvent m_last_key;
+ WideString m_pending;
+ Key2KanaRule m_exact_match;
+ int m_pseudo_ascii_mode;
+ bool m_is_in_pseudo_ascii_mode;
+ bool m_reset_pseudo_ascii_mode;
+};
+
+}
+#endif /* __SCIM_ANTHY_KEY2KANA_H__ */
+/*
+vi:ts=4:nowrap:ai:expandtab
+*/
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004 Hiroyuki Ikezoe
+ * Copyright (C) 2004 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SCIM_ANTHY_KEY2KANA_BASE_H__
+#define __SCIM_ANTHY_KEY2KANA_BASE_H__
+
+#define Uses_SCIM_EVENT
+#include <scim.h>
+
+using namespace scim;
+
+namespace scim_anthy {
+
+class Key2KanaConvertorBase
+{
+public:
+ Key2KanaConvertorBase ()
+ : m_case_sensitive (true)
+ {};
+ virtual ~Key2KanaConvertorBase () {};
+
+ virtual bool can_append (const KeyEvent & key,
+ bool ignore_space = false) = 0;
+ virtual bool append (const KeyEvent & key,
+ WideString & result,
+ WideString & pending,
+ String & raw) = 0;
+ virtual bool append (const String & raw,
+ WideString & result,
+ WideString & pending) = 0;
+ virtual void clear (void) = 0;
+
+ virtual bool is_pending (void) = 0;
+ virtual WideString get_pending (void) = 0;
+ virtual WideString flush_pending (void) = 0;
+ virtual void reset_pending (const WideString & result,
+ const String & raw) = 0;
+
+ virtual void reset_pseudo_ascii_mode (void)
+ {}
+ virtual bool process_pseudo_ascii_mode (const WideString & wstr)
+ { return false; }
+
+ virtual void set_case_sensitive (bool sensitive)
+ { m_case_sensitive = sensitive; }
+ virtual bool get_case_sensitive (void)
+ { return m_case_sensitive; }
+
+protected:
+ bool m_case_sensitive;
+};
+
+}
+#endif /* __SCIM_ANTHY_KEY2KANA_BASE_H__ */
+/*
+vi:ts=4:nowrap:ai:expandtab
+*/
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "scim_anthy_key2kana_table.h"
+
+using namespace scim_anthy;
+
+// fundamental table
+static Key2KanaTable romaji_table (
+ utf8_mbstowcs ("DefaultRomajiTable"),
+ scim_anthy_romaji_typing_rule);
+static Key2KanaTable romaji_double_consonant_table (
+ utf8_mbstowcs ("DefaultRomajiDoubleConsonantTable"),
+ scim_anthy_romaji_double_consonant_rule);
+static Key2KanaTable kana_table (
+ utf8_mbstowcs ("DefaultKanaTable"),
+ scim_anthy_kana_typing_rule);
+static Key2KanaTable kana_voiced_consonant_table (
+ utf8_mbstowcs ("DefaultKanaVoicedConsonantTable"),
+ scim_anthy_kana_voiced_consonant_rule);
+static Key2KanaTable nicola_table (
+ utf8_mbstowcs ("DefaultNICOLATable"),
+ scim_anthy_nicola_table);
+
+// symbols
+static Key2KanaTable half_symbol_table (
+ utf8_mbstowcs ("DefaultRomajiHalfSymbolTable"),
+ scim_anthy_half_symbol_rule);
+static Key2KanaTable wide_symbol_table (
+ utf8_mbstowcs ("DefaultRomajiWideSymbolTable"),
+ scim_anthy_wide_symbol_rule);
+
+// numbers
+static Key2KanaTable half_number_table (
+ utf8_mbstowcs ("DefaultRomajiHalfNumberTable"),
+ scim_anthy_half_number_rule);
+static Key2KanaTable wide_number_table (
+ utf8_mbstowcs ("DefaultRomajiWideNumberTable"),
+ scim_anthy_wide_number_rule);
+
+// period
+static Key2KanaTable romaji_ja_period_table (
+ utf8_mbstowcs ("DefaultRomajiJaPeriodTable"),
+ scim_anthy_romaji_ja_period_rule);
+static Key2KanaTable romaji_wide_period_table (
+ utf8_mbstowcs ("DefaultRomajiWidePeriodTable"),
+ scim_anthy_romaji_wide_period_rule);
+static Key2KanaTable romaji_half_period_table (
+ utf8_mbstowcs ("DefaultRomajiHalfPeriodTable"),
+ scim_anthy_romaji_half_period_rule);
+
+static Key2KanaTable kana_ja_period_table (
+ utf8_mbstowcs ("DefaultKanaJaPeriodTable"),
+ scim_anthy_kana_ja_period_rule);
+static Key2KanaTable kana_wide_period_table (
+ utf8_mbstowcs ("DefaultKanaWidePeriodTable"),
+ scim_anthy_kana_wide_period_rule);
+static Key2KanaTable kana_half_period_table (
+ utf8_mbstowcs ("DefaultKanaHalfPeriodTable"),
+ scim_anthy_kana_half_period_rule);
+
+// comma
+static Key2KanaTable romaji_ja_comma_table (
+ utf8_mbstowcs ("DefaultRomajiJaCommaTable"),
+ scim_anthy_romaji_ja_comma_rule);
+static Key2KanaTable romaji_wide_comma_table (
+ utf8_mbstowcs ("DefaultRomajiWideCommaTable"),
+ scim_anthy_romaji_wide_comma_rule);
+static Key2KanaTable romaji_half_comma_table (
+ utf8_mbstowcs ("DefaultRomajiHalfCommaTable"),
+ scim_anthy_romaji_half_comma_rule);
+
+static Key2KanaTable kana_ja_comma_table (
+ utf8_mbstowcs ("DefaultKanaJaCommaTable"),
+ scim_anthy_kana_ja_comma_rule);
+static Key2KanaTable kana_wide_comma_table (
+ utf8_mbstowcs ("DefaultKanaWideCommaTable"),
+ scim_anthy_kana_wide_comma_rule);
+static Key2KanaTable kana_half_comma_table (
+ utf8_mbstowcs ("DefaultKanaHalfCommaTable"),
+ scim_anthy_kana_half_comma_rule);
+
+// bracket
+static Key2KanaTable romaji_ja_bracket_table (
+ utf8_mbstowcs ("DefaultRomajiJaBracketTable"),
+ scim_anthy_romaji_ja_bracket_rule);
+static Key2KanaTable romaji_wide_bracket_table (
+ utf8_mbstowcs ("DefaultRomajiWideBracketTable"),
+ scim_anthy_romaji_wide_bracket_rule);
+
+static Key2KanaTable kana_ja_bracket_table (
+ utf8_mbstowcs ("DefaultKanaJaBracketTable"),
+ scim_anthy_kana_ja_bracket_rule);
+static Key2KanaTable kana_wide_bracket_table (
+ utf8_mbstowcs ("DefaultRomajiWideBracketTable"),
+ scim_anthy_kana_wide_bracket_rule);
+
+// slash
+static Key2KanaTable romaji_ja_slash_table (
+ utf8_mbstowcs ("DefaultRomajiJaSlashTable"),
+ scim_anthy_romaji_ja_slash_rule);
+static Key2KanaTable romaji_wide_slash_table (
+ utf8_mbstowcs ("DefaultRomajiWideSlashTable"),
+ scim_anthy_romaji_wide_slash_rule);
+
+static Key2KanaTable kana_ja_slash_table (
+ utf8_mbstowcs ("DefaultKanaJaSlashTable"),
+ scim_anthy_kana_ja_slash_rule);
+static Key2KanaTable kana_wide_slash_table (
+ utf8_mbstowcs ("DefaultRomajiWideSlashTable"),
+ scim_anthy_kana_wide_slash_rule);
+
+
+Key2KanaRule::Key2KanaRule ()
+{
+}
+
+Key2KanaRule::Key2KanaRule (String sequence,
+ const std::vector<String> &result)
+ : m_sequence (sequence),
+ m_result (result)
+{
+}
+
+
+Key2KanaRule::~Key2KanaRule ()
+{
+}
+
+String
+Key2KanaRule::get_sequence (void)
+{
+ return m_sequence;
+}
+
+String
+Key2KanaRule::get_result (unsigned int idx)
+{
+ if (idx < m_result.size ())
+ return m_result[idx];
+
+ return String ();
+}
+
+void
+Key2KanaRule::clear (void)
+{
+ m_sequence = String ();
+ m_result.clear ();
+}
+
+bool
+Key2KanaRule::is_empty (void)
+{
+ if (!m_sequence.empty ())
+ return false;
+
+ if (m_result.empty ())
+ return true;
+
+ for (unsigned int i = 0; i < m_result.size (); i++) {
+ if (!m_result[i].empty ())
+ return false;
+ }
+
+ return true;
+}
+
+
+Key2KanaTable::Key2KanaTable (WideString name)
+ : m_name (name)
+{
+}
+
+Key2KanaTable::Key2KanaTable (WideString name, ConvRule *table)
+ : m_name (name)
+{
+ for (unsigned int i = 0; table[i].string; i++) {
+ append_rule (table[i].string ? table[i].string : "",
+ table[i].result ? table[i].result : "",
+ table[i].cont ? table[i].cont : "");
+ }
+}
+
+Key2KanaTable::Key2KanaTable (WideString name, NicolaRule *table)
+ : m_name (name)
+{
+ for (unsigned int i = 0; table[i].key; i++) {
+ append_rule (table[i].key ? table[i].key : "",
+ table[i].single ? table[i].single : "",
+ table[i].left_shift ? table[i].left_shift : "",
+ table[i].right_shift ? table[i].right_shift : "");
+ }
+}
+
+Key2KanaTable::~Key2KanaTable ()
+{
+}
+
+void
+Key2KanaTable::append_rule (String sequence,
+ const std::vector<String> &result)
+{
+ m_rules.push_back (Key2KanaRule (sequence, result));
+}
+
+void
+Key2KanaTable::append_rule (String sequence,
+ String result,
+ String cont)
+{
+ std::vector<String> list;
+ list.push_back (result);
+ list.push_back (cont);
+ m_rules.push_back (Key2KanaRule (sequence, list));
+}
+
+void
+Key2KanaTable::append_rule (String sequence,
+ String normal,
+ String left_shift,
+ String right_shift)
+{
+ std::vector<String> list;
+ list.push_back (normal);
+ list.push_back (left_shift);
+ list.push_back (right_shift);
+ m_rules.push_back (Key2KanaRule (sequence, list));
+}
+
+void
+Key2KanaTable::clear (void)
+{
+ m_rules.clear ();
+
+}
+
+Key2KanaTableSet::Key2KanaTableSet ()
+ : m_name (utf8_mbstowcs ("")),
+ m_fundamental_table (NULL),
+ m_voiced_consonant_table (Key2KanaTable (utf8_mbstowcs ("voiced consonant table"))),
+ m_additional_table (NULL),
+ m_typing_method (SCIM_ANTHY_TYPING_METHOD_ROMAJI),
+ m_period_style (SCIM_ANTHY_PERIOD_JAPANESE),
+ m_comma_style (SCIM_ANTHY_COMMA_JAPANESE),
+ m_bracket_style (SCIM_ANTHY_BRACKET_JAPANESE),
+ m_slash_style (SCIM_ANTHY_SLASH_JAPANESE),
+ m_use_half_symbol (false),
+ m_use_half_number (false)
+{
+ set_typing_method (m_typing_method);
+}
+
+Key2KanaTableSet::~Key2KanaTableSet ()
+{
+}
+
+void
+Key2KanaTableSet::set_typing_method (TypingMethod method,
+ Key2KanaTable *fundamental_table)
+{
+ m_typing_method = method;
+ m_fundamental_table = fundamental_table;
+ reset_tables ();
+}
+
+void
+Key2KanaTableSet::set_symbol_width (bool half)
+{
+ m_use_half_symbol = half;
+ reset_tables ();
+}
+
+void
+Key2KanaTableSet::set_number_width (bool half)
+{
+ m_use_half_number = half;
+ reset_tables ();
+}
+
+void
+Key2KanaTableSet::set_period_style (PeriodStyle style)
+{
+ m_period_style = style;
+ reset_tables ();
+}
+
+void
+Key2KanaTableSet::set_comma_style (CommaStyle style)
+{
+ m_comma_style = style;
+ reset_tables ();
+}
+
+void
+Key2KanaTableSet::set_bracket_style (BracketStyle style)
+{
+ m_bracket_style = style;
+ reset_tables ();
+}
+
+void
+Key2KanaTableSet::set_slash_style (SlashStyle style)
+{
+ m_slash_style = style;
+ reset_tables ();
+}
+
+static void
+create_voiced_consonant_table (Key2KanaTable &table, Key2KanaTable &fund_table)
+{
+ table.clear ();
+
+ const String sonant_mark = String ("\xE3\x82\x9B");
+ const String half_sonant_mark = String ("\xE3\x82\x9C");
+ std::vector<String> sonant_mark_list;
+ std::vector<String> half_sonant_mark_list;
+
+ Key2KanaRules::iterator it;
+ Key2KanaRules &rules = fund_table.get_table ();
+ for (it = rules.begin (); it != rules.end (); it++) {
+ String result = it->get_result (0);
+ if (result == sonant_mark)
+ sonant_mark_list.push_back (it->get_sequence ());
+ else if (result == half_sonant_mark)
+ half_sonant_mark_list.push_back (it->get_sequence ());
+ }
+
+ VoicedConsonantRule *templ = scim_anthy_voiced_consonant_table;
+
+ for (unsigned int i = 0; templ[i].string; i++) {
+ if (templ[i].voiced && *templ[i].voiced) {
+ std::vector<String>::iterator it;
+ for (it = sonant_mark_list.begin ();
+ it != sonant_mark_list.end ();
+ it++)
+ {
+ table.append_rule (String (templ[i].string) + *it,
+ String (templ[i].voiced),
+ String ());
+ }
+ }
+ if (templ[i].half_voiced && *templ[i].half_voiced) {
+ std::vector<String>::iterator it;
+ for (it = half_sonant_mark_list.begin ();
+ it != half_sonant_mark_list.end ();
+ it++)
+ {
+ table.append_rule (String (templ[i].string) + *it,
+ String (templ[i].half_voiced),
+ String ());
+ }
+ }
+ }
+}
+
+void
+Key2KanaTableSet::reset_tables (void)
+{
+ m_all_tables.clear ();
+
+ bool is_romaji = m_typing_method == SCIM_ANTHY_TYPING_METHOD_ROMAJI;
+ bool is_kana = m_typing_method == SCIM_ANTHY_TYPING_METHOD_KANA;
+ bool is_nicola = m_typing_method == SCIM_ANTHY_TYPING_METHOD_NICOLA;
+
+ // symbols table
+ if (m_use_half_symbol)
+ m_all_tables.push_back (&half_symbol_table);
+ else
+ m_all_tables.push_back (&wide_symbol_table);
+
+ // numbers table
+ if (m_use_half_number)
+ m_all_tables.push_back (&half_number_table);
+ else
+ m_all_tables.push_back (&wide_number_table);
+
+ if (is_romaji || is_kana)
+ {
+ switch (m_period_style) {
+ case SCIM_ANTHY_PERIOD_JAPANESE:
+ if (is_romaji)
+ m_all_tables.push_back (&romaji_ja_period_table);
+ else
+ m_all_tables.push_back (&kana_ja_period_table);
+ break;
+ case SCIM_ANTHY_PERIOD_WIDE:
+ if (is_romaji)
+ m_all_tables.push_back (&romaji_wide_period_table);
+ else
+ m_all_tables.push_back (&kana_wide_period_table);
+ break;
+ case SCIM_ANTHY_PERIOD_HALF:
+ if (is_romaji)
+ m_all_tables.push_back (&romaji_half_period_table);
+ else
+ m_all_tables.push_back (&kana_half_period_table);
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (is_romaji || is_kana)
+ {
+ switch (m_comma_style) {
+ case SCIM_ANTHY_COMMA_JAPANESE:
+ if (is_romaji)
+ m_all_tables.push_back (&romaji_ja_comma_table);
+ else
+ m_all_tables.push_back (&kana_ja_comma_table);
+ break;
+ case SCIM_ANTHY_COMMA_WIDE:
+ if (is_romaji)
+ m_all_tables.push_back (&romaji_wide_comma_table);
+ else
+ m_all_tables.push_back (&kana_wide_comma_table);
+ break;
+ case SCIM_ANTHY_COMMA_HALF:
+ if (is_romaji)
+ m_all_tables.push_back (&romaji_half_comma_table);
+ else
+ m_all_tables.push_back (&kana_half_comma_table);
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (is_romaji || is_kana)
+ {
+ switch (m_bracket_style) {
+ case SCIM_ANTHY_BRACKET_JAPANESE:
+ if (is_romaji)
+ m_all_tables.push_back (&romaji_ja_bracket_table);
+ else
+ m_all_tables.push_back (&kana_ja_bracket_table);
+ break;
+ case SCIM_ANTHY_BRACKET_WIDE:
+ if (is_romaji)
+ m_all_tables.push_back (&romaji_wide_bracket_table);
+ else
+ m_all_tables.push_back (&kana_wide_bracket_table);
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (is_romaji || is_kana)
+ {
+ switch (m_slash_style) {
+ case SCIM_ANTHY_SLASH_JAPANESE:
+ if (is_romaji)
+ m_all_tables.push_back (&romaji_ja_slash_table);
+ else
+ m_all_tables.push_back (&kana_ja_slash_table);
+ break;
+ case SCIM_ANTHY_SLASH_WIDE:
+ if (is_romaji)
+ m_all_tables.push_back (&romaji_wide_slash_table);
+ else
+ m_all_tables.push_back (&kana_wide_slash_table);
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (!m_fundamental_table) {
+ if (is_romaji) {
+ m_all_tables.push_back (&romaji_double_consonant_table);
+ m_all_tables.push_back (&romaji_table);
+ } else if (is_kana) {
+ create_voiced_consonant_table (m_voiced_consonant_table,
+ kana_table);
+ m_all_tables.push_back (&m_voiced_consonant_table);
+ m_all_tables.push_back (&kana_table);
+ } else if (is_nicola) {
+ m_all_tables.push_back (&nicola_table);
+ }
+ } else {
+ if (is_romaji) {
+ m_all_tables.push_back (&romaji_double_consonant_table);
+ m_all_tables.push_back (m_fundamental_table);
+ } else if (is_kana) {
+ create_voiced_consonant_table (m_voiced_consonant_table,
+ *m_fundamental_table);
+ m_all_tables.push_back (&m_voiced_consonant_table);
+ m_all_tables.push_back (m_fundamental_table);
+ } else if (is_nicola) {
+ m_all_tables.push_back (m_fundamental_table);
+ }
+ }
+}
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SCIM_ANTHY_KEY2KANA_TABLE_H__
+#define __SCIM_ANTHY_KEY2KANA_TABLE_H__
+
+#define Uses_SCIM_TYPES
+#include <scim.h>
+#include "scim_anthy_default_tables.h"
+
+using namespace scim;
+
+namespace scim_anthy {
+
+typedef enum {
+ SCIM_ANTHY_PERIOD_JAPANESE,
+ SCIM_ANTHY_PERIOD_WIDE,
+ SCIM_ANTHY_PERIOD_HALF,
+} PeriodStyle;
+
+typedef enum {
+ SCIM_ANTHY_COMMA_JAPANESE,
+ SCIM_ANTHY_COMMA_WIDE,
+ SCIM_ANTHY_COMMA_HALF,
+} CommaStyle;
+
+typedef enum {
+ SCIM_ANTHY_BRACKET_JAPANESE,
+ SCIM_ANTHY_BRACKET_WIDE,
+} BracketStyle;
+
+typedef enum {
+ SCIM_ANTHY_SLASH_JAPANESE,
+ SCIM_ANTHY_SLASH_WIDE,
+} SlashStyle;
+
+typedef enum {
+ SCIM_ANTHY_TYPING_METHOD_ROMAJI,
+ SCIM_ANTHY_TYPING_METHOD_KANA,
+ SCIM_ANTHY_TYPING_METHOD_NICOLA,
+ SCIM_ANTHY_TYPING_METHOD_CUSTOM,
+} TypingMethod;
+
+
+class Key2KanaRule;
+class Key2KanaTable;
+class Key2KanaTableSet;
+
+typedef std::vector<Key2KanaRule> Key2KanaRules;
+
+
+class Key2KanaRule
+{
+public:
+ Key2KanaRule ();
+ Key2KanaRule (String sequence,
+ const std::vector<String> &result);
+ virtual ~Key2KanaRule ();
+
+ String get_sequence (void);
+ String get_result (unsigned int idx);
+
+ void clear (void);
+
+ bool is_empty (void);
+
+private:
+ String m_sequence;
+ std::vector<String> m_result;
+};
+
+
+class Key2KanaTable
+{
+public:
+ Key2KanaTable (WideString name);
+ Key2KanaTable (WideString name,
+ ConvRule *table);
+ Key2KanaTable (WideString name,
+ NicolaRule *table);
+ virtual ~Key2KanaTable ();
+
+ Key2KanaRules & get_table (void) { return m_rules; }
+
+ void append_rule (String sequence,
+ const std::vector<String> &result);
+ void append_rule (String sequence,
+ String result,
+ String cont);
+ void append_rule (String sequence,
+ String normal,
+ String left_shift,
+ String right_shift);
+ void clear (void);
+
+private:
+ WideString m_name;
+ Key2KanaRules m_rules;
+};
+
+
+class Key2KanaTableSet
+{
+public:
+ Key2KanaTableSet ();
+ virtual ~Key2KanaTableSet ();
+
+ std::vector<Key2KanaTable*> &
+ get_tables (void) { return m_all_tables; };
+
+ void set_typing_method (TypingMethod method,
+ Key2KanaTable *fundamental_table = NULL);
+ void set_symbol_width (bool half);
+ void set_number_width (bool half);
+ void set_period_style (PeriodStyle style);
+ void set_comma_style (CommaStyle style);
+ void set_bracket_style (BracketStyle style);
+ void set_slash_style (SlashStyle style);
+
+ TypingMethod
+ get_typing_method (void) { return m_typing_method; }
+ bool symbol_is_half (void) { return m_use_half_symbol; }
+ bool number_is_half (void) { return m_use_half_number;}
+ PeriodStyle
+ get_period_style (void) { return m_period_style; }
+ CommaStyle
+ get_comma_style (void) { return m_comma_style; }
+ BracketStyle
+ get_bracket_style (void) { return m_bracket_style; }
+ SlashStyle
+ get_slash_style (void) { return m_slash_style; }
+
+#if 0
+ void set_use_consonant_table (bool use);
+ void set_use_symbol_table (bool use);
+ void set_use_number_table (bool use);
+ void set_use_period_table (bool use);
+ void set_use_comma_table (bool use);
+
+ bool get_use_consonant_table (void);
+ bool get_use_symbol_table (void);
+ bool get_use_number_table (void);
+ bool get_use_period_table (void);
+ bool get_use_comma_table (void);
+#endif
+
+private:
+ void reset_tables (void);
+
+private:
+ WideString m_name;
+
+ // tables
+ Key2KanaTable *m_fundamental_table;
+ Key2KanaTable m_voiced_consonant_table;
+ std::vector<Key2KanaTable*> *m_additional_table;
+ std::vector<Key2KanaTable*> m_all_tables;
+
+ // flags
+ TypingMethod m_typing_method;
+ PeriodStyle m_period_style;
+ CommaStyle m_comma_style;
+ BracketStyle m_bracket_style;
+ SlashStyle m_slash_style;
+ bool m_use_half_symbol;
+ bool m_use_half_number;
+};
+
+}
+
+#endif /* __SCIM_ANTHY_KEY2KANA_TABLE_H__ */
+/*
+vi:ts=4:nowrap:ai:expandtab
+*/
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004 Hiroyuki Ikezoe
+ * Copyright (C) 2004 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#define Uses_SCIM_IMENGINE
+#define Uses_SCIM_CONFIG_BASE
+#include "scim_anthy_nicola.h"
+#include "scim_anthy_factory.h"
+#include "scim_anthy_imengine.h"
+#include "scim_anthy_utils.h"
+
+using namespace scim_anthy;
+
+NicolaConvertor::NicolaConvertor (AnthyInstance &anthy,
+ Key2KanaTableSet &tables)
+ : m_tables (tables),
+ m_anthy (anthy),
+ m_timer_id (0),
+ m_processing_timeout(false)
+{
+}
+
+NicolaConvertor::~NicolaConvertor ()
+{
+ if (m_timer_id > 0)
+ m_anthy.timeout_remove (m_timer_id);
+}
+
+bool
+NicolaConvertor::can_append (const KeyEvent & key,
+ bool ignore_space)
+{
+ if (key == m_through_key_event) {
+ m_through_key_event = KeyEvent ();
+ return false;
+ }
+
+ if (m_processing_timeout &&
+ m_prev_char_key.empty () && !m_prev_thumb_key.empty())
+ {
+ emit_key_event (m_prev_thumb_key);
+ m_prev_thumb_key = KeyEvent ();
+ return false;
+ }
+
+ if (key.is_key_release () &&
+ (key.code != m_prev_char_key.code &&
+ key.code != m_prev_thumb_key.code &&
+ key.code != m_repeat_char_key.code &&
+ key.code != m_repeat_thumb_key.code))
+ {
+ return false;
+ }
+
+ if (is_repeating ()) {
+ if (key.is_key_press () &&
+ (key == m_repeat_char_key || key == m_repeat_thumb_key) &&
+ m_repeat_char_key.empty ())
+ {
+ return false;
+ }
+ }
+
+ // ignore short cut keys of apllication.
+ if (key.mask & SCIM_KEY_ControlMask ||
+ key.mask & SCIM_KEY_AltMask)
+ {
+ return false;
+ }
+
+ if (isprint (key.get_ascii_code ()) &&
+ (ignore_space || !isspace (key.get_ascii_code ())))
+ {
+ return true;
+ }
+
+ if (is_thumb_key (key))
+ return true;
+
+ return false;
+}
+
+void
+NicolaConvertor::search (const KeyEvent key,
+ NicolaShiftType shift_type,
+ WideString &result,
+ String &raw)
+{
+ raw = key.get_ascii_code ();
+
+ String str1;
+ if (get_case_sensitive ())
+ str1 = raw;
+ else
+ str1 = tolower (key.get_ascii_code ());
+
+ std::vector<Key2KanaTable*> &tables = m_tables.get_tables();
+ for (unsigned int j = 0; j < tables.size (); j++) {
+ if (!tables[j])
+ continue;
+
+ Key2KanaRules &rules = tables[j]->get_table ();
+
+ for (unsigned int i = 0; i < rules.size (); i++) {
+ String str2 = rules[i].get_sequence ();
+
+ for (unsigned int k = 0;
+ !get_case_sensitive () && k < str2.length ();
+ k++)
+ {
+ str2[k] = tolower (str2[k]);
+ }
+
+ if (str1 == str2) {
+ switch (shift_type) {
+ case SCIM_ANTHY_NICOLA_SHIFT_RIGHT:
+ result = utf8_mbstowcs (rules[i].get_result (2));
+ break;
+ case SCIM_ANTHY_NICOLA_SHIFT_LEFT:
+ result = utf8_mbstowcs (rules[i].get_result (1));
+ break;
+ default:
+ result = utf8_mbstowcs (rules[i].get_result (0));
+ break;
+ }
+ break;
+ }
+ }
+ }
+
+ if (result.empty ()) {
+ result = utf8_mbstowcs (raw);
+ }
+}
+
+bool
+NicolaConvertor::handle_voiced_consonant (WideString & result,
+ WideString & pending)
+{
+ VoicedConsonantRule *table = scim_anthy_voiced_consonant_table;
+
+ if (result.empty ())
+ return false;
+
+ if (m_pending.empty ()) {
+ for (unsigned int i = 0; table[i].string; i++) {
+ if (result == utf8_mbstowcs (table[i].string)) {
+ pending = m_pending = result;
+ result = WideString ();
+ return false;
+ }
+ }
+
+ } else if (result == utf8_mbstowcs ("\xE3\x82\x9B")) {
+ // voiced consonant
+ for (unsigned int i = 0; table[i].string; i++) {
+ if (m_pending == utf8_mbstowcs (table[i].string)) {
+ result = utf8_mbstowcs (table[i].voiced);
+ m_pending = WideString ();
+ return false;
+ }
+ }
+ return true;
+
+ } else if (result == utf8_mbstowcs ("\xE3\x82\x9C")) {
+ // half voiced consonant
+ for (unsigned int i = 0; table[i].string; i++) {
+ if (m_pending == utf8_mbstowcs (table[i].string)) {
+ result = utf8_mbstowcs (table[i].half_voiced);
+ m_pending = WideString ();
+ return false;
+ }
+ }
+ return true;
+
+ } else {
+ m_pending = WideString ();
+ for (unsigned int i = 0; table[i].string; i++) {
+ if (result == utf8_mbstowcs (table[i].string)) {
+ pending = m_pending = result;
+ result = WideString ();
+ return true;
+ }
+ }
+ return true;
+ }
+
+ return false;
+}
+
+bool
+NicolaConvertor::is_char_key (const KeyEvent key)
+{
+ if (!is_thumb_key (key) && isprint (key.get_ascii_code ()))
+ return true;
+ else
+ return false;
+}
+
+bool
+NicolaConvertor::is_thumb_key (const KeyEvent key)
+{
+ if (is_left_thumb_key (key) || is_right_thumb_key (key))
+ return true;
+
+ return false;
+}
+
+bool
+NicolaConvertor::is_left_thumb_key (const KeyEvent key)
+{
+ return util_match_key_event (m_anthy.get_factory()->m_left_thumb_keys,
+ key,
+ 0xFFFF);
+}
+
+bool
+NicolaConvertor::is_right_thumb_key (const KeyEvent key)
+{
+ return util_match_key_event (m_anthy.get_factory()->m_right_thumb_keys,
+ key,
+ 0xFFFF);
+}
+
+NicolaShiftType
+NicolaConvertor::get_thumb_key_type (const KeyEvent key)
+{
+ if (is_left_thumb_key (key))
+ return SCIM_ANTHY_NICOLA_SHIFT_LEFT;
+ else if (is_right_thumb_key (key))
+ return SCIM_ANTHY_NICOLA_SHIFT_RIGHT;
+ else
+ return SCIM_ANTHY_NICOLA_SHIFT_NONE;
+}
+
+void
+NicolaConvertor::on_key_repeat (const KeyEvent key,
+ WideString &result,
+ String &raw)
+{
+ if (key.is_key_release ()) {
+ if (!m_repeat_char_key.empty ())
+ emit_key_event (key);
+ m_repeat_char_key = KeyEvent ();
+ m_repeat_thumb_key = KeyEvent ();
+ m_prev_char_key = KeyEvent ();
+#if 1
+ m_prev_thumb_key = KeyEvent ();
+#endif
+
+ } else if (key == m_repeat_char_key || key == m_repeat_thumb_key) {
+ if (!m_repeat_char_key.empty ()) {
+ search (m_repeat_char_key, get_thumb_key_type (m_repeat_thumb_key),
+ result, raw);
+ } else {
+ // handle by can_append ();
+ }
+
+
+ } else if (!is_thumb_key (key) && !(key == m_repeat_char_key)) {
+ m_repeat_char_key = KeyEvent ();
+ m_repeat_thumb_key = KeyEvent ();
+ m_prev_char_key = key;
+ m_prev_thumb_key = KeyEvent ();
+ set_alarm (m_anthy.get_factory()->m_nicola_time);
+
+ } else if (key == m_prev_thumb_key) {
+ m_repeat_char_key = KeyEvent ();
+ m_repeat_thumb_key = KeyEvent ();
+ m_prev_char_key = KeyEvent ();
+ m_prev_thumb_key = key;
+ set_alarm (m_anthy.get_factory()->m_nicola_time);
+
+ } else {
+ m_repeat_char_key = KeyEvent ();
+ m_repeat_thumb_key = KeyEvent ();
+ m_prev_char_key = KeyEvent ();
+ m_prev_thumb_key = KeyEvent ();
+ }
+}
+
+void
+NicolaConvertor::on_both_key_pressed (const KeyEvent key,
+ WideString & result,
+ String &raw)
+{
+ struct timeval cur_time;
+ long diff1, diff2;
+ gettimeofday (&cur_time, NULL);
+
+ diff1 = m_time_thumb.tv_usec - m_time_char.tv_usec;
+ diff2 = cur_time.tv_usec - m_time_thumb.tv_usec;
+
+ if (key.is_key_press () && key == m_prev_thumb_key) {
+ search (m_prev_char_key, get_thumb_key_type (m_prev_thumb_key),
+ result, raw);
+ m_repeat_char_key = m_prev_char_key;
+ m_repeat_thumb_key = m_prev_thumb_key;
+
+ } else if (is_char_key (key)) {
+ if (key.is_key_press ()) {
+ if (diff2 < diff1) {
+ WideString result1, result2;
+ String raw1, raw2;
+ search (m_prev_char_key, SCIM_ANTHY_NICOLA_SHIFT_NONE,
+ result1, raw1);
+ search (key, get_thumb_key_type (m_prev_thumb_key),
+ result2, raw2);
+ result = result1 + result2;
+ raw = raw1 + raw2;
+
+ // repeat
+ m_repeat_char_key = key;
+ m_repeat_thumb_key = m_prev_thumb_key;
+
+ } else {
+ search (m_prev_char_key, get_thumb_key_type (m_prev_thumb_key),
+ result, raw);
+ m_prev_char_key = key;
+#if 1
+ m_prev_thumb_key = KeyEvent ();
+#endif
+ set_alarm (m_anthy.get_factory()->m_nicola_time);
+ }
+
+ } else {
+ if (diff2 < m_anthy.get_factory()->m_nicola_time * 1000 &&
+ diff1 > diff2)
+ {
+ search (m_prev_char_key, SCIM_ANTHY_NICOLA_SHIFT_NONE,
+ result, raw);
+ m_prev_char_key = KeyEvent ();
+
+ } else {
+ search (m_prev_char_key, get_thumb_key_type (m_prev_thumb_key),
+ result, raw);
+ m_prev_char_key = KeyEvent ();
+#if 1
+ m_prev_thumb_key = KeyEvent ();
+#endif
+ }
+ }
+
+ } else if (is_thumb_key (key)) {
+ if (key.is_key_press ()) {
+ search (m_prev_char_key, get_thumb_key_type (m_prev_thumb_key),
+ result, raw);
+ m_prev_char_key = KeyEvent ();
+ m_prev_thumb_key = key;
+ gettimeofday (&m_time_thumb, NULL);
+ set_alarm (m_anthy.get_factory()->m_nicola_time);
+
+ } else {
+ search (m_prev_char_key, get_thumb_key_type (m_prev_thumb_key),
+ result, raw);
+ m_prev_char_key = KeyEvent ();
+ m_prev_thumb_key = KeyEvent ();
+ }
+
+ } else {
+ search (m_prev_char_key, get_thumb_key_type (m_prev_thumb_key),
+ result, raw);
+ m_prev_char_key = KeyEvent ();
+ m_prev_thumb_key = KeyEvent ();
+ }
+}
+
+void
+NicolaConvertor::on_thumb_key_pressed (const KeyEvent key,
+ WideString & result,
+ String &raw)
+{
+ if (key.is_key_press () && key == m_prev_thumb_key) {
+#if 1
+ m_repeat_thumb_key = key;
+#endif
+
+ } else if (is_thumb_key (key) && key.is_key_release ()) {
+ emit_key_event (m_prev_thumb_key); // key press event
+ emit_key_event (key); // key release event
+ m_prev_thumb_key = KeyEvent ();
+
+ } else if (is_thumb_key (key) & key.is_key_press ()) {
+ emit_key_event (m_prev_thumb_key);
+ m_prev_thumb_key = key;
+ gettimeofday (&m_time_thumb, NULL);
+
+ } else if (is_char_key (key) && key.is_key_press ()) {
+ m_prev_char_key = key;
+ gettimeofday (&m_time_char, NULL);
+
+ search (m_prev_char_key, get_thumb_key_type (m_prev_thumb_key),
+ result, raw);
+
+ // repeat
+ m_repeat_char_key = m_prev_char_key;
+ m_repeat_thumb_key = m_prev_thumb_key;
+
+ } else {
+ m_prev_thumb_key = KeyEvent ();
+ }
+}
+
+void
+NicolaConvertor::on_char_key_pressed (const KeyEvent key,
+ WideString & result,
+ String &raw)
+{
+ if (key.is_key_press () && key == m_prev_char_key) {
+ search (m_prev_char_key, SCIM_ANTHY_NICOLA_SHIFT_NONE,
+ result, raw);
+ m_repeat_char_key = m_prev_char_key;
+
+ } else if (is_char_key (key) && key.is_key_press ()) {
+ search (m_prev_char_key, SCIM_ANTHY_NICOLA_SHIFT_NONE,
+ result, raw);
+ m_prev_char_key = key;
+ gettimeofday (&m_time_char, NULL);
+ set_alarm (m_anthy.get_factory()->m_nicola_time);
+
+ } else if (is_thumb_key (key) && key.is_key_press ()) {
+ m_prev_thumb_key = key;
+ gettimeofday (&m_time_thumb, NULL);
+ set_alarm (m_anthy.get_factory()->m_nicola_time);
+
+ } else if (key.is_key_release () && key == m_prev_char_key) {
+ search (m_prev_char_key, SCIM_ANTHY_NICOLA_SHIFT_NONE,
+ result, raw);
+ m_prev_char_key = KeyEvent ();
+
+ } else {
+ search (m_prev_char_key, SCIM_ANTHY_NICOLA_SHIFT_NONE,
+ result, raw);
+ m_prev_char_key = KeyEvent ();
+ }
+}
+
+void
+NicolaConvertor::on_no_key_pressed (const KeyEvent key)
+{
+ if (key.is_key_release ())
+ return;
+
+ if (is_char_key (key)) {
+ m_prev_char_key = key;
+ gettimeofday (&m_time_char, NULL);
+ set_alarm (m_anthy.get_factory()->m_nicola_time);
+ } else if (is_thumb_key (key)) {
+ m_prev_thumb_key = key;
+ gettimeofday (&m_time_thumb, NULL);
+ set_alarm (m_anthy.get_factory()->m_nicola_time);
+ }
+}
+
+bool
+NicolaConvertor::is_repeating (void)
+{
+ return !m_repeat_char_key.empty () || !m_repeat_thumb_key.empty ();
+}
+
+void
+NicolaConvertor::emit_key_event (const KeyEvent & key)
+{
+ m_through_key_event = key;
+
+ //m_anthy.forward_key_event (key);
+ m_anthy.process_key_event (key);
+}
+
+static void
+timeout_emit_key_event (void *data)
+{
+ NicolaConvertor *nicola = static_cast<NicolaConvertor*> (data);
+ nicola->process_timeout ();
+}
+
+void
+NicolaConvertor::process_timeout (void)
+{
+ m_processing_timeout = true;
+ if (!m_prev_char_key.empty ())
+ m_anthy.process_key_event (m_prev_char_key);
+ else if (!m_prev_thumb_key.empty ())
+ m_anthy.process_key_event (m_prev_thumb_key);
+ m_processing_timeout = false;
+}
+
+void
+NicolaConvertor::set_alarm (int time_msec)
+{
+ if (time_msec < 5)
+ time_msec = 5;
+ if (time_msec > 1000)
+ time_msec = 1000;
+
+ m_timer_id = m_anthy.timeout_add (time_msec,
+ timeout_emit_key_event,
+ (void *) this);
+}
+
+bool
+NicolaConvertor::append (const KeyEvent & key,
+ WideString & result,
+ WideString & pending,
+ String &raw)
+{
+ if (m_timer_id > 0) {
+ m_anthy.timeout_remove (m_timer_id);
+ m_timer_id = 0;
+ }
+
+ if (m_processing_timeout) {
+ search (m_prev_char_key,
+ get_thumb_key_type (m_prev_thumb_key),
+ result, raw);
+ if (m_prev_thumb_key.empty ()) {
+ m_prev_char_key = KeyEvent ();
+ m_prev_thumb_key = KeyEvent ();
+ } else {
+ m_repeat_char_key = m_prev_char_key;
+ m_repeat_thumb_key = m_prev_thumb_key;
+ }
+ return handle_voiced_consonant (result, pending);
+ }
+
+ if (key.is_key_press () && util_key_is_keypad (key)) {
+ util_keypad_to_string (raw, key);
+
+ // convert key pad string to wide
+ WideString wide;
+ String ten_key_type = m_anthy.get_factory()->m_ten_key_type;
+ if ((ten_key_type == "FollowMode" &&
+ (m_anthy.get_input_mode () == SCIM_ANTHY_MODE_LATIN ||
+ m_anthy.get_input_mode () == SCIM_ANTHY_MODE_HALF_KATAKANA)) ||
+ ten_key_type == "Half")
+ {
+ wide = utf8_mbstowcs (raw);
+ } else {
+ util_convert_to_wide (wide, raw);
+ }
+
+ result = wide;
+
+ m_repeat_char_key = KeyEvent ();
+ m_repeat_thumb_key = KeyEvent ();
+ m_prev_char_key = KeyEvent ();
+ m_prev_thumb_key = KeyEvent ();
+
+ return handle_voiced_consonant (result, pending);
+ }
+
+ if (is_repeating ()) {
+ on_key_repeat (key, result, raw);
+
+ } else if (!m_prev_thumb_key.empty () && !m_prev_char_key.empty ()) {
+ on_both_key_pressed (key, result, raw);
+
+ } else if (!m_prev_thumb_key.empty ()) {
+ on_thumb_key_pressed (key, result, raw);
+
+ } else if (!m_prev_char_key.empty ()) {
+ on_char_key_pressed (key, result, raw);
+
+ } else {
+ on_no_key_pressed (key);
+ }
+
+ return handle_voiced_consonant (result, pending);
+}
+
+bool
+NicolaConvertor::append (const String & str,
+ WideString & result,
+ WideString & pending)
+{
+ result = utf8_mbstowcs (str);
+ m_pending = WideString ();
+
+ return false;
+}
+
+void
+NicolaConvertor::clear (void)
+{
+ m_pending = WideString ();
+}
+
+bool
+NicolaConvertor::is_pending (void)
+{
+ return !m_pending.empty ();
+}
+
+WideString
+NicolaConvertor::get_pending (void)
+{
+ return m_pending;
+}
+
+WideString
+NicolaConvertor::flush_pending (void)
+{
+ return WideString ();
+}
+
+void
+NicolaConvertor::reset_pending (const WideString & result, const String & raw)
+{
+ VoicedConsonantRule *table = scim_anthy_voiced_consonant_table;
+
+ m_pending = WideString ();
+
+ for (unsigned int i = 0; table[i].string; i++) {
+ if (result == utf8_mbstowcs (table[i].string)) {
+ m_pending = result;
+ return;
+ }
+ }
+}
+/*
+vi:ts=4:nowrap:ai:expandtab
+*/
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004 Hiroyuki Ikezoe
+ * Copyright (C) 2004 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SCIM_ANTHY_NICOLA_H__
+#define __SCIM_ANTHY_NICOLA_H__
+
+#define Uses_SCIM_ICONV
+#define Uses_SCIM_EVENT
+#include <scim.h>
+#include <sys/time.h>
+
+#include "scim_anthy_key2kana_base.h"
+#include "scim_anthy_key2kana_table.h"
+
+using namespace scim;
+
+class AnthyInstance;
+
+namespace scim_anthy {
+
+typedef enum {
+ SCIM_ANTHY_NICOLA_SHIFT_NONE,
+ SCIM_ANTHY_NICOLA_SHIFT_LEFT,
+ SCIM_ANTHY_NICOLA_SHIFT_RIGHT,
+} NicolaShiftType;
+
+class NicolaConvertor : public Key2KanaConvertorBase
+{
+public:
+ NicolaConvertor (AnthyInstance & anthy,
+ Key2KanaTableSet & tables);
+ virtual ~NicolaConvertor ();
+
+ bool can_append (const KeyEvent & key,
+ bool ignore_space = false);
+ bool append (const KeyEvent & key,
+ WideString & result,
+ WideString & pending,
+ String & raw);
+ bool append (const String & raw,
+ WideString & result,
+ WideString & pending);
+ void clear (void);
+
+ bool is_pending (void);
+ WideString get_pending (void);
+ WideString flush_pending (void);
+ void reset_pending (const WideString & result,
+ const String & raw);
+
+public:
+ void process_timeout (void);
+
+private:
+ void search (const KeyEvent key,
+ NicolaShiftType shift_type,
+ WideString & result,
+ String & raw);
+ bool handle_voiced_consonant (WideString & result,
+ WideString & pending);
+ bool is_char_key (const KeyEvent key);
+ bool is_thumb_key (const KeyEvent key);
+ bool is_left_thumb_key (const KeyEvent key);
+ bool is_right_thumb_key (const KeyEvent key);
+ NicolaShiftType
+ get_thumb_key_type (const KeyEvent key);
+
+ void on_key_repeat (const KeyEvent key,
+ WideString & result,
+ String & raw);
+ void on_both_key_pressed (const KeyEvent key,
+ WideString & result,
+ String & raw);
+ void on_thumb_key_pressed (const KeyEvent key,
+ WideString & result,
+ String & raw);
+ void on_char_key_pressed (const KeyEvent key,
+ WideString & result,
+ String & raw);
+ void on_no_key_pressed (const KeyEvent key);
+
+ bool is_repeating (void);
+ void emit_key_event (const KeyEvent & key);
+ void set_alarm (int time_msec);
+
+private:
+ Key2KanaTableSet &m_tables;
+
+ AnthyInstance &m_anthy;
+
+ // state
+ KeyEvent m_prev_char_key;
+ KeyEvent m_prev_thumb_key;
+
+ KeyEvent m_repeat_char_key;
+ KeyEvent m_repeat_thumb_key;
+ bool m_is_repeating;
+
+ struct timeval m_time_char;
+ struct timeval m_time_thumb;
+
+ KeyEvent m_through_key_event;
+
+ uint32 m_timer_id;
+ bool m_processing_timeout;
+
+ WideString m_pending;
+};
+
+}
+#endif /* __SCIM_ANTHY_NICOLA_H__ */
+/*
+vi:ts=4:nowrap:ai:expandtab
+*/
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004-2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#endif
+
+#include <string.h>
+
+#include "scim_anthy_factory.h"
+#include "scim_anthy_imengine.h"
+#include "scim_anthy_preedit.h"
+#include "scim_anthy_utils.h"
+
+using namespace scim_anthy;
+
+static ConvRule *get_period_rule (TypingMethod method,
+ PeriodStyle period);
+static ConvRule *get_comma_rule (TypingMethod method,
+ CommaStyle period);
+
+Preedit::Preedit (AnthyInstance &anthy)
+ : m_anthy (anthy),
+ //m_key2kana_tables (tables),
+ m_reading (anthy),
+ m_conversion (m_anthy, m_reading),
+ m_input_mode (SCIM_ANTHY_MODE_HIRAGANA)
+{
+}
+
+Preedit::~Preedit ()
+{
+}
+
+
+/*
+ * getting status
+ */
+unsigned int
+Preedit::get_length (void)
+{
+ if (is_converting ())
+ return m_conversion.get_length ();
+ else
+ return m_reading.get_length ();
+
+ return 0;
+}
+
+WideString
+Preedit::get_string (void)
+{
+ if (is_converting ()) {
+ return m_conversion.get ();
+ } else if (!m_source.empty ()) {
+ return m_source;
+ } else {
+ WideString widestr;
+ switch (m_input_mode) {
+ case SCIM_ANTHY_MODE_KATAKANA:
+ util_convert_to_katakana (widestr, m_reading.get ());
+ return widestr;
+
+ case SCIM_ANTHY_MODE_HALF_KATAKANA:
+ util_convert_to_katakana (widestr, m_reading.get (), true);
+ return widestr;
+
+ case SCIM_ANTHY_MODE_LATIN:
+ return utf8_mbstowcs (m_reading.get_raw ());
+
+ case SCIM_ANTHY_MODE_WIDE_LATIN:
+ util_convert_to_wide (widestr, m_reading.get_raw ());
+ return widestr;
+
+ case SCIM_ANTHY_MODE_HIRAGANA:
+ default:
+ return m_reading.get ();
+ }
+ }
+
+ return WideString ();
+}
+
+AttributeList
+Preedit::get_attribute_list (void)
+{
+ if (is_converting ())
+ {
+ return m_conversion.get_attribute_list ();
+ } else {
+ AttributeList attrs;
+ util_create_attributes (attrs, 0, get_length (),
+ m_anthy.get_factory()->m_preedit_style,
+ m_anthy.get_factory()->m_preedit_fg_color,
+ m_anthy.get_factory()->m_preedit_bg_color);
+ return attrs;
+ }
+}
+
+Reading &
+Preedit::get_reading (void)
+{
+ return m_reading;
+}
+
+bool
+Preedit::is_preediting (void)
+{
+ if (m_reading.get_length () > 0 ||
+ m_conversion.is_converting () ||
+ !m_source.empty ())
+ {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool
+Preedit::is_converting (void)
+{
+ return m_conversion.is_converting ();
+}
+
+bool
+Preedit::is_predicting (void)
+{
+ return m_conversion.is_predicting ();
+}
+
+bool
+Preedit::is_reconverting (void)
+{
+ return !m_source.empty ();
+}
+
+
+/*
+ * manipulating the preedit string
+ */
+bool
+Preedit::can_process_key_event (const KeyEvent & key)
+{
+ return m_reading.can_process_key_event (key);
+}
+
+bool
+Preedit::process_key_event (const KeyEvent & key)
+{
+ if (!m_reading.can_process_key_event (key))
+ return false;
+
+ bool retval = m_reading.process_key_event (key);
+
+ if (m_input_mode == SCIM_ANTHY_MODE_LATIN ||
+ m_input_mode == SCIM_ANTHY_MODE_WIDE_LATIN)
+ {
+ return true;
+ }
+
+ // auto convert
+ unsigned int len = m_reading.get_length ();
+ if (len > 0) {
+ String str;
+ str = m_reading.get_raw (len - 1, 1);
+ if (is_comma_or_period (str)) {
+ if (m_anthy.get_factory()->m_behavior_on_period == "Convert" &&
+ get_length () > 1)
+ {
+ convert ();
+ } else if (m_anthy.get_factory()->m_behavior_on_period == "Commit") {
+ return true;
+ }
+ }
+ }
+
+ return retval;
+}
+
+bool
+Preedit::append (const KeyEvent & key,
+ const String & string)
+{
+ return m_reading.append (key, string);
+}
+
+void
+Preedit::erase (bool backward)
+{
+ if (m_reading.get_length () <= 0)
+ return;
+
+ // cancel conversion
+ revert ();
+
+ // erase
+ TypingMethod method = get_typing_method ();
+ bool allow_split
+ = method == SCIM_ANTHY_TYPING_METHOD_ROMAJI &&
+ m_anthy.get_factory()->m_romaji_allow_split;
+ if (backward && m_reading.get_caret_pos () == 0)
+ return;
+ if (!backward && m_reading.get_caret_pos () >= m_reading.get_length ())
+ return;
+ if (backward)
+ m_reading.move_caret (-1, allow_split);
+ m_reading.erase (m_reading.get_caret_pos (), 1, allow_split);
+}
+
+void
+Preedit::finish (void)
+{
+ m_reading.finish ();
+}
+
+
+/*
+ * manipulating conversion string
+ */
+void
+Preedit::convert (CandidateType type, bool single_segment)
+{
+ if (m_source.empty ())
+ m_conversion.convert (type, single_segment);
+ else
+ m_conversion.convert (m_source, single_segment);
+}
+
+void
+Preedit::convert (const WideString &source, bool single_segment)
+{
+ m_conversion.convert (source, single_segment);
+ m_source = source;
+}
+
+void
+Preedit::revert (void)
+{
+ m_conversion.clear ();
+}
+
+void
+Preedit::commit (int segment_id, bool learn)
+{
+ if (m_conversion.is_converting ())
+ m_conversion.commit (segment_id, learn);
+ if (!m_conversion.is_converting ())
+ clear ();
+}
+
+int
+Preedit::get_nr_segments (void)
+{
+ return m_conversion.get_nr_segments ();
+}
+
+WideString
+Preedit::get_segment_string (int segment_id)
+{
+ return m_conversion.get_segment_string (segment_id);
+}
+
+int
+Preedit::get_selected_segment (void)
+{
+ return m_conversion.get_selected_segment ();
+}
+
+void
+Preedit::select_segment (int segment_id)
+{
+ m_conversion.select_segment (segment_id);
+}
+
+int
+Preedit::get_segment_size (int segment_id)
+{
+ return m_conversion.get_segment_size (segment_id);
+}
+
+void
+Preedit::resize_segment (int relative_size, int segment_id)
+{
+ m_conversion.resize_segment (relative_size, segment_id);
+}
+
+
+/*
+ * candidates for a segment
+ */
+void
+Preedit::get_candidates (CommonLookupTable &table, int segment_id)
+{
+ m_conversion.get_candidates (table, segment_id);
+}
+
+int
+Preedit::get_selected_candidate (int segment_id)
+{
+ return m_conversion.get_selected_candidate (segment_id);
+}
+
+void
+Preedit::select_candidate (int candidate_id, int segment_id)
+{
+ m_conversion.select_candidate (candidate_id, segment_id);
+}
+
+
+/*
+ * manipulating the caret
+ */
+unsigned int
+Preedit::get_caret_pos (void)
+{
+ if (is_converting ()) {
+ return m_conversion.get_segment_position ();
+ } else {
+ if (get_input_mode () == SCIM_ANTHY_MODE_HALF_KATAKANA) {
+ // FIXME! It's ad-hoc
+ WideString substr;
+ substr = m_reading.get (0, m_reading.get_caret_pos (),
+ SCIM_ANTHY_STRING_HALF_KATAKANA);
+ return substr.length ();
+ } else {
+ return m_reading.get_caret_pos ();
+ }
+ }
+}
+
+void
+Preedit::set_caret_pos (unsigned int pos)
+{
+ if (is_converting ())
+ return;
+
+ m_reading.set_caret_pos (pos);
+}
+
+void
+Preedit::move_caret (int step)
+{
+ if (is_converting ())
+ return;
+
+ TypingMethod method = get_typing_method ();
+ bool allow_split
+ = method == SCIM_ANTHY_TYPING_METHOD_ROMAJI &&
+ m_anthy.get_factory()->m_romaji_allow_split;
+
+ m_reading.move_caret (step, allow_split);
+}
+
+void
+Preedit::predict (void)
+{
+ m_conversion.predict ();
+}
+
+
+/*
+ * clear all string
+ */
+void
+Preedit::clear (int segment_id)
+{
+ // FIXME! We should add implementation not only for conversion string but
+ // also for reading string.
+
+ if (!is_converting ()) {
+ m_reading.clear ();
+ m_conversion.clear ();
+ m_source = WideString ();
+ return;
+ }
+
+ m_conversion.clear (segment_id);
+ if (m_conversion.get_nr_segments () <= 0) {
+ m_reading.clear ();
+ m_source = WideString ();
+ }
+}
+
+
+/*
+ * preference
+ */
+void
+Preedit::set_input_mode (InputMode mode)
+{
+ m_input_mode = mode;
+}
+
+InputMode
+Preedit::get_input_mode (void)
+{
+ return m_input_mode;
+}
+
+void
+Preedit::set_typing_method (TypingMethod method)
+{
+ m_reading.set_typing_method (method);
+}
+
+TypingMethod
+Preedit::get_typing_method (void)
+{
+ return m_reading.get_typing_method ();
+}
+
+void
+Preedit::set_period_style (PeriodStyle style)
+{
+ m_reading.set_period_style (style);
+}
+
+PeriodStyle
+Preedit::get_period_style (void)
+{
+ return m_reading.get_period_style ();
+}
+
+void
+Preedit::set_comma_style (CommaStyle style)
+{
+ m_reading.set_comma_style (style);
+}
+
+CommaStyle
+Preedit::get_comma_style (void)
+{
+ return m_reading.get_comma_style ();
+}
+
+void
+Preedit::set_bracket_style (BracketStyle style)
+{
+ m_reading.set_bracket_style (style);
+}
+
+BracketStyle
+Preedit::get_bracket_style (void)
+{
+ return m_reading.get_bracket_style ();
+}
+
+void
+Preedit::set_slash_style (SlashStyle style)
+{
+ m_reading.set_slash_style (style);
+}
+
+SlashStyle
+Preedit::get_slash_style (void)
+{
+ return m_reading.get_slash_style ();
+}
+
+void
+Preedit::set_symbol_width (bool half)
+{
+ m_reading.set_symbol_width (half);
+}
+
+bool
+Preedit::get_symbol_width (void)
+{
+ return m_reading.get_symbol_width ();
+}
+
+void
+Preedit::set_number_width (bool half)
+{
+ m_reading.set_number_width (half);
+}
+
+bool
+Preedit::get_number_width (void)
+{
+ return m_reading.get_number_width ();
+}
+
+void
+Preedit::set_pseudo_ascii_mode (int mode)
+{
+ m_reading.set_pseudo_ascii_mode (mode);
+}
+
+bool
+Preedit::is_pseudo_ascii_mode (void)
+{
+ return m_reading.is_pseudo_ascii_mode ();
+}
+
+void
+Preedit::reset_pseudo_ascii_mode (void)
+{
+ m_reading.reset_pseudo_ascii_mode ();
+}
+
+void
+Preedit::set_dict_encoding (String type)
+{
+ m_conversion.set_dict_encoding (type);
+}
+
+bool
+Preedit::is_comma_or_period (const String & str)
+{
+ TypingMethod typing = get_typing_method ();
+ PeriodStyle period = get_period_style ();
+ CommaStyle comma = get_comma_style ();
+
+ ConvRule *period_rule = get_period_rule (typing, period);
+ ConvRule *comma_rule = get_comma_rule (typing, comma);
+
+ for (unsigned int i = 0; period_rule && period_rule[i].string; i++) {
+ if (period_rule[i].string &&
+ !strcmp (period_rule[i].string, str.c_str ()))
+ {
+ return true;
+ }
+ }
+ for (unsigned int i = 0; comma_rule && comma_rule[i].string; i++) {
+ if (comma_rule[i].string &&
+ !strcmp (comma_rule[i].string, str.c_str ()))
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
+/*
+ * utilities
+ */
+static ConvRule *
+get_period_rule (TypingMethod method, PeriodStyle period)
+{
+ switch (method) {
+ case SCIM_ANTHY_TYPING_METHOD_KANA:
+ switch (period) {
+ case SCIM_ANTHY_PERIOD_WIDE:
+ return scim_anthy_kana_wide_period_rule;
+ case SCIM_ANTHY_PERIOD_HALF:
+ return scim_anthy_kana_half_period_rule;
+ case SCIM_ANTHY_PERIOD_JAPANESE:
+ default:
+ return scim_anthy_kana_ja_period_rule;
+ };
+ break;
+
+ case SCIM_ANTHY_TYPING_METHOD_ROMAJI:
+ default:
+ switch (period) {
+ case SCIM_ANTHY_PERIOD_WIDE:
+ return scim_anthy_romaji_wide_period_rule;
+ case SCIM_ANTHY_PERIOD_HALF:
+ return scim_anthy_romaji_half_period_rule;
+ case SCIM_ANTHY_PERIOD_JAPANESE:
+ default:
+ return scim_anthy_romaji_ja_period_rule;
+ };
+ break;
+ };
+
+ return NULL;
+}
+
+static ConvRule *
+get_comma_rule (TypingMethod method, CommaStyle period)
+{
+ switch (method) {
+ case SCIM_ANTHY_TYPING_METHOD_KANA:
+ switch (period) {
+ case SCIM_ANTHY_PERIOD_WIDE:
+ return scim_anthy_kana_wide_comma_rule;
+ case SCIM_ANTHY_PERIOD_HALF:
+ return scim_anthy_kana_half_comma_rule;
+ case SCIM_ANTHY_PERIOD_JAPANESE:
+ default:
+ return scim_anthy_kana_ja_comma_rule;
+ };
+ break;
+
+ case SCIM_ANTHY_TYPING_METHOD_ROMAJI:
+ default:
+ switch (period) {
+ case SCIM_ANTHY_PERIOD_WIDE:
+ return scim_anthy_romaji_wide_comma_rule;
+ case SCIM_ANTHY_PERIOD_HALF:
+ return scim_anthy_romaji_half_comma_rule;
+ case SCIM_ANTHY_PERIOD_JAPANESE:
+ default:
+ return scim_anthy_romaji_ja_comma_rule;
+ };
+ break;
+ };
+
+ return NULL;
+}
+/*
+vi:ts=4:nowrap:ai:expandtab
+*/
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SCIM_ANTHY_PREEDIT_H__
+#define __SCIM_ANTHY_PREEDIT_H__
+
+#define Uses_SCIM_ICONV
+#define Uses_SCIM_EVENT
+#define Uses_SCIM_ATTRIBUTE
+#define Uses_SCIM_LOOKUP_TABLE
+#include <anthy/anthy.h>
+#include <scim.h>
+#include "scim_anthy_reading.h"
+#include "scim_anthy_conversion.h"
+
+#define SCIM_ANTHY_PSEUDO_ASCII_TRIGGERED_CAPITALIZED (1 << 0)
+#define SCIM_ANTHY_PSEUDO_ASCII_TRIGGERED_COUPLE_OF_CAPITAL (1 << 1)
+
+using namespace scim;
+
+class AnthyInstance;
+
+namespace scim_anthy {
+
+typedef enum {
+ SCIM_ANTHY_MODE_HIRAGANA,
+ SCIM_ANTHY_MODE_KATAKANA,
+ SCIM_ANTHY_MODE_HALF_KATAKANA,
+ SCIM_ANTHY_MODE_LATIN,
+ SCIM_ANTHY_MODE_WIDE_LATIN,
+} InputMode;
+
+class Preedit
+{
+public:
+ Preedit (AnthyInstance &anthy);
+ virtual ~Preedit ();
+
+ // getting status
+ virtual unsigned int get_length (void);
+ virtual WideString get_string (void);
+ virtual AttributeList get_attribute_list (void);
+ virtual Reading &get_reading (void);
+
+ virtual bool is_preediting (void);
+ virtual bool is_converting (void);
+ virtual bool is_predicting (void);
+ virtual bool is_reconverting (void);
+
+ // for handling the preedit string
+ virtual bool can_process_key_event (const KeyEvent & key);
+ // return true if commiting is needed.
+ virtual bool process_key_event (const KeyEvent & key);
+ virtual bool append (const KeyEvent & key,
+ const String & string);
+ virtual void erase (bool backward = true);
+ virtual void finish (void);
+
+ // for handling the conversion string
+ virtual void convert (CandidateType type
+ = SCIM_ANTHY_CANDIDATE_DEFAULT,
+ bool single_segment = false);
+ virtual void convert (const WideString &source,
+ bool single_segment = false);
+ virtual void revert (void);
+ virtual void commit (int segment_id = -1,
+ bool lean = true);
+
+ // for prediction
+ virtual void predict (void);
+
+ // segments of the converted sentence
+ virtual int get_nr_segments (void);
+ virtual WideString get_segment_string (int segment_id = -1);
+ virtual int get_selected_segment (void);
+ virtual void select_segment (int segment_id);
+ virtual int get_segment_size (int segment_id = -1);
+ virtual void resize_segment (int relative_size,
+ int segment_id = -1);
+
+ // candidates for a segment
+ virtual void get_candidates (CommonLookupTable &table,
+ int segment_id = -1);
+ virtual int get_selected_candidate (int segment_id = -1);
+ virtual void select_candidate (int candidate_id,
+ int segment_id = -1);
+
+ // for handling the caret
+ virtual unsigned int get_caret_pos (void);
+ virtual void set_caret_pos (unsigned int pos);
+ virtual void move_caret (int len);
+
+ // clear all or part of the string.
+ virtual void clear (int segment_id = -1);
+
+ // preferences
+ virtual void set_input_mode (InputMode mode);
+ virtual InputMode get_input_mode (void);
+ virtual void set_typing_method (TypingMethod method);
+ virtual TypingMethod get_typing_method (void);
+ virtual void set_period_style (PeriodStyle style);
+ virtual PeriodStyle get_period_style (void);
+ virtual void set_comma_style (CommaStyle style);
+ virtual CommaStyle get_comma_style (void);
+ virtual void set_bracket_style (BracketStyle style);
+ virtual BracketStyle get_bracket_style (void);
+ virtual void set_slash_style (SlashStyle style);
+ virtual SlashStyle get_slash_style (void);
+ virtual void set_symbol_width (bool half);
+ virtual bool get_symbol_width (void);
+ virtual void set_number_width (bool half);
+ virtual bool get_number_width (void);
+ virtual void set_pseudo_ascii_mode (int mode);
+ virtual bool is_pseudo_ascii_mode (void);
+ virtual void reset_pseudo_ascii_mode(void);
+ virtual void set_dict_encoding (String type);
+
+private:
+ void get_reading_substr (WideString & substr,
+ unsigned int start,
+ unsigned int len,
+ CandidateType type);
+ bool is_comma_or_period (const String & str);
+
+private:
+ AnthyInstance &m_anthy;
+
+ // converter objects
+ Reading m_reading;
+ Conversion m_conversion;
+
+ // mode flags
+ InputMode m_input_mode;
+
+ // source string for reconversion
+ WideString m_source;
+};
+
+}
+
+#endif /* __SCIM_ANTHY_PREEDIT_H__ */
+/*
+vi:ts=4:nowrap:ai:expandtab
+*/
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004 Hiroyuki Ikezoe
+ * Copyright (C) 2004-2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICUoLAR 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.
+ */
+
+#define SCIM_ANTHY_USE_GTK
+#include <string.h>
+#include <scim.h>
+#include "scim_anthy_prefs.h"
+#include "scim_anthy_intl.h"
+
+namespace scim_anthy {
+
+BoolConfigData config_bool_common [] =
+{
+ {
+ SCIM_ANTHY_CONFIG_SHOW_CANDIDATES_LABEL,
+ SCIM_ANTHY_CONFIG_SHOW_CANDIDATES_LABEL_DEFAULT,
+ SCIM_ANTHY_CONFIG_SHOW_CANDIDATES_LABEL_DEFAULT,
+ N_("Show \"_Candidates\" label"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CLOSE_CAND_WIN_ON_SELECT,
+ SCIM_ANTHY_CONFIG_CLOSE_CAND_WIN_ON_SELECT_DEFAULT,
+ SCIM_ANTHY_CONFIG_CLOSE_CAND_WIN_ON_SELECT_DEFAULT,
+ N_("Close candidate window when select a candidate _directly"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_LEARN_ON_MANUAL_COMMIT,
+ SCIM_ANTHY_CONFIG_LEARN_ON_MANUAL_COMMIT_DEFAULT,
+ SCIM_ANTHY_CONFIG_LEARN_ON_MANUAL_COMMIT_DEFAULT,
+ N_("Learn on _manual committing"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_LEARN_ON_AUTO_COMMIT,
+ SCIM_ANTHY_CONFIG_LEARN_ON_AUTO_COMMIT_DEFAULT,
+ SCIM_ANTHY_CONFIG_LEARN_ON_AUTO_COMMIT_DEFAULT,
+ N_("Learn on a_uto committing"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_ROMAJI_HALF_SYMBOL,
+ SCIM_ANTHY_CONFIG_ROMAJI_HALF_SYMBOL_DEFAULT,
+ SCIM_ANTHY_CONFIG_ROMAJI_HALF_SYMBOL_DEFAULT,
+ N_("Use half-width characters for _symbols"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_ROMAJI_HALF_NUMBER,
+ SCIM_ANTHY_CONFIG_ROMAJI_HALF_NUMBER_DEFAULT,
+ SCIM_ANTHY_CONFIG_ROMAJI_HALF_NUMBER_DEFAULT,
+ N_("Use half-width characters for _numbers"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_ROMAJI_ALLOW_SPLIT,
+ SCIM_ANTHY_CONFIG_ROMAJI_ALLOW_SPLIT_DEFAULT,
+ SCIM_ANTHY_CONFIG_ROMAJI_ALLOW_SPLIT_DEFAULT,
+ N_("A_llow spliting romaji on editing preedit string"),
+ NULL,
+ N_("If this check is enabled, you can delete each letter."),
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_MODE,
+ SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_MODE_DEFAULT,
+ SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_MODE_DEFAULT,
+ N_("_Entering the pseudo ASCII input mode with capital letters."),
+ NULL,
+ N_("If this check is enabled, capital letters will becomes a trigger to enter the pseudo ASCII input mode."),
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR,
+ SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR_DEFAULT,
+ SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR_DEFAULT,
+ N_("Insert a _blank with a blank key."),
+ NULL,
+ N_("If this check is enabled, a blank key will works to insert a blank when entering the pseudo ASCII input mode."),
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_PREDICT_ON_INPUT,
+ SCIM_ANTHY_CONFIG_PREDICT_ON_INPUT_DEFAULT,
+ SCIM_ANTHY_CONFIG_PREDICT_ON_INPUT_DEFAULT,
+ N_("_Show predicted candidates while inputting letters"),
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_USE_DIRECT_KEY_ON_PREDICT,
+ SCIM_ANTHY_CONFIG_USE_DIRECT_KEY_ON_PREDICT_DEFAULT,
+ SCIM_ANTHY_CONFIG_USE_DIRECT_KEY_ON_PREDICT_DEFAULT,
+ N_("Use _direct select keys while predicting"),
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL,
+ SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL_DEFAULT,
+ SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL_DEFAULT,
+ N_("Show _input mode label"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SHOW_CONVERSION_MODE_LABEL,
+ SCIM_ANTHY_CONFIG_SHOW_CONVERSION_MODE_LABEL_DEFAULT,
+ SCIM_ANTHY_CONFIG_SHOW_CONVERSION_MODE_LABEL_DEFAULT,
+ N_("Show _conversion mode label"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SHOW_TYPING_METHOD_LABEL,
+ SCIM_ANTHY_CONFIG_SHOW_TYPING_METHOD_LABEL_DEFAULT,
+ SCIM_ANTHY_CONFIG_SHOW_TYPING_METHOD_LABEL_DEFAULT,
+ N_("Show _typing method label"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SHOW_PERIOD_STYLE_LABEL,
+ SCIM_ANTHY_CONFIG_SHOW_PERIOD_STYLE_LABEL_DEFAULT,
+ SCIM_ANTHY_CONFIG_SHOW_PERIOD_STYLE_LABEL_DEFAULT,
+ N_("Show _period style label"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SHOW_SYMBOL_STYLE_LABEL,
+ SCIM_ANTHY_CONFIG_SHOW_SYMBOL_STYLE_LABEL_DEFAULT,
+ SCIM_ANTHY_CONFIG_SHOW_SYMBOL_STYLE_LABEL_DEFAULT,
+ N_("Show _symbol style label"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SHOW_DICT_LABEL,
+ SCIM_ANTHY_CONFIG_SHOW_DICT_LABEL_DEFAULT,
+ SCIM_ANTHY_CONFIG_SHOW_DICT_LABEL_DEFAULT,
+ N_("Show _dictionary menu label"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL,
+ SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL_DEFAULT,
+ SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL_DEFAULT,
+ N_("Show _edit dictionary label"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL,
+ SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL_DEFAULT,
+ SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL_DEFAULT,
+ N_("Show _add word label"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ NULL,
+ "",
+ "",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+};
+
+IntConfigData config_int_common [] =
+{
+ {
+ SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE,
+ SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE_DEFAULT,
+ SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE_DEFAULT,
+ 1, 100, 1,
+ N_("Number of candidates to show in a _page:"),
+ NULL,
+ NULL,
+ N_("Specify the number of candidates to show in a page of the candidates window."),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_N_TRIGGERS_TO_SHOW_CAND_WIN,
+ SCIM_ANTHY_CONFIG_N_TRIGGERS_TO_SHOW_CAND_WIN_DEFAULT,
+ SCIM_ANTHY_CONFIG_N_TRIGGERS_TO_SHOW_CAND_WIN_DEFAULT,
+ 0, 100, 1,
+ N_("Number of _triggers until show:"),
+ N_("[times]"),
+ NULL,
+ N_("The number of times to press a conversion key until show the candidates window."
+ "Specify 0 to never show it."),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_NICOLA_TIME,
+ SCIM_ANTHY_CONFIG_NICOLA_TIME_DEFAULT,
+ SCIM_ANTHY_CONFIG_NICOLA_TIME_DEFAULT,
+ 5, 1000, 1,
+ N_("_Simultaneous pressing time:"),
+ N_("[msec]"),
+ NULL,
+ N_("Time to regard as simultaneous key pressing."),
+ NULL,
+ false,
+ },
+ {
+ NULL,
+ 0,
+ 0,
+ 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+};
+
+StringConfigData config_string_common [] =
+{
+ {
+ SCIM_ANTHY_CONFIG_INPUT_MODE,
+ SCIM_ANTHY_CONFIG_INPUT_MODE_DEFAULT,
+ SCIM_ANTHY_CONFIG_INPUT_MODE_DEFAULT,
+ N_("_Input mode: "),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_TYPING_METHOD,
+ SCIM_ANTHY_CONFIG_TYPING_METHOD_DEFAULT,
+ SCIM_ANTHY_CONFIG_TYPING_METHOD_DEFAULT,
+ N_("Typing _method: "),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CONVERSION_MODE,
+ SCIM_ANTHY_CONFIG_CONVERSION_MODE_DEFAULT,
+ SCIM_ANTHY_CONFIG_CONVERSION_MODE_DEFAULT,
+ N_("_Conversion mode: "),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_PERIOD_STYLE,
+ SCIM_ANTHY_CONFIG_PERIOD_STYLE_DEFAULT,
+ SCIM_ANTHY_CONFIG_PERIOD_STYLE_DEFAULT,
+ N_("St_yle of comma and period: "),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SYMBOL_STYLE,
+ SCIM_ANTHY_CONFIG_SYMBOL_STYLE_DEFAULT,
+ SCIM_ANTHY_CONFIG_SYMBOL_STYLE_DEFAULT,
+ N_("Symb_ol input style: "),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SPACE_TYPE,
+ SCIM_ANTHY_CONFIG_SPACE_TYPE_DEFAULT,
+ SCIM_ANTHY_CONFIG_SPACE_TYPE_DEFAULT,
+ N_("_Space type: "),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_TEN_KEY_TYPE,
+ SCIM_ANTHY_CONFIG_TEN_KEY_TYPE_DEFAULT,
+ SCIM_ANTHY_CONFIG_TEN_KEY_TYPE_DEFAULT,
+ N_("Input from _ten key: "),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_BEHAVIOR_ON_PERIOD,
+ SCIM_ANTHY_CONFIG_BEHAVIOR_ON_PERIOD_DEFAULT,
+ SCIM_ANTHY_CONFIG_BEHAVIOR_ON_PERIOD_DEFAULT,
+ N_("_Behavior on a comma or a period:"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_BEHAVIOR_ON_FOCUS_OUT,
+ SCIM_ANTHY_CONFIG_BEHAVIOR_ON_FOCUS_OUT_DEFAULT,
+ SCIM_ANTHY_CONFIG_BEHAVIOR_ON_FOCUS_OUT_DEFAULT,
+ N_("_Behavior on focus out:"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY,
+ SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY_DEFAULT,
+ N_("_Left thumb shift keys:"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY,
+ SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY_DEFAULT,
+ N_("_Right thumb shift keys:"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_COMMIT_REVERSE_LEARN_KEY,
+ SCIM_ANTHY_CONFIG_COMMIT_REVERSE_LEARN_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_COMMIT_REVERSE_LEARN_KEY_DEFAULT,
+ N_("_Commit:"),
+ N_("Select commit keys"),
+ N_("The key events to commit the preedit string "
+ "with reversing the preference of learning. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_REVERSE_LEARN_KEY,
+ SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_REVERSE_LEARN_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_REVERSE_LEARN_KEY_DEFAULT,
+ N_("Commit the _first segment:"),
+ N_("Select keys to commit the first segment"),
+ N_("The key events to commit the first segment "
+ "with reversing the preference of learning. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_REVERSE_LEARN_KEY,
+ SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_REVERSE_LEARN_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_REVERSE_LEARN_KEY_DEFAULT,
+ N_("Commit the _selected segment:"),
+ N_("Select keys to commit the selected segment"),
+ N_("The key events to commit the selected segment "
+ "with reversing the preference of learning. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_DICT_ENCODING,
+ SCIM_ANTHY_CONFIG_DICT_ENCODING_DEFAULT,
+ SCIM_ANTHY_CONFIG_DICT_ENCODING_DEFAULT,
+ N_("En_coding of dictionary:"),
+ NULL,
+ N_("If you choose \"EUC-JP-MS\", interoperatability of documents "
+ "created on this system with Microsoft Windows may improve, "
+ "but it depends on the implementation of your operating system "
+ "and actual encoding of your dictionary."),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND,
+ SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND_DEFAULT,
+ SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND_DEFAULT,
+ N_("\"_Edit dictionary\" command:"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND,
+ SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND_DEFAULT,
+ SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND_DEFAULT,
+ N_("\"_Add word\" command:"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_PREEDIT_STYLE,
+ SCIM_ANTHY_CONFIG_PREEDIT_STYLE_DEFAULT,
+ SCIM_ANTHY_CONFIG_PREEDIT_STYLE_DEFAULT,
+ N_("_Preedit string:"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CONVERSION_STYLE,
+ SCIM_ANTHY_CONFIG_CONVERSION_STYLE_DEFAULT,
+ SCIM_ANTHY_CONFIG_CONVERSION_STYLE_DEFAULT,
+ N_("_Conversion string:"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE,
+ SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE_DEFAULT,
+ N_("_Selected segment:"),
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+ {
+ NULL,
+ "",
+ "",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+};
+
+StringConfigData config_keyboards_mode [] =
+{
+ {
+ SCIM_ANTHY_CONFIG_ON_OFF_KEY,
+ SCIM_ANTHY_CONFIG_ON_OFF_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_ON_OFF_KEY_DEFAULT,
+ N_("Toggle on/off"),
+ N_("Select toggle on/off keys"),
+ N_("The key events to toggle on/off Japanese mode. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CIRCLE_INPUT_MODE_KEY,
+ SCIM_ANTHY_CONFIG_CIRCLE_INPUT_MODE_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_CIRCLE_INPUT_MODE_KEY_DEFAULT,
+ N_("Circle input mode"),
+ N_("Select circle input mode keys"),
+ N_("The key events to circle input mode. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CIRCLE_KANA_MODE_KEY,
+ SCIM_ANTHY_CONFIG_CIRCLE_KANA_MODE_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_CIRCLE_KANA_MODE_KEY_DEFAULT,
+ N_("Circle kana mode"),
+ N_("Select circle kana mode keys"),
+ N_("The key events to circle kana mode. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_LATIN_MODE_KEY,
+ SCIM_ANTHY_CONFIG_LATIN_MODE_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_LATIN_MODE_KEY_DEFAULT,
+ N_("Latin mode"),
+ N_("Select Latin mode keys"),
+ N_("The key events to switch input mode to Latin. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_WIDE_LATIN_MODE_KEY,
+ SCIM_ANTHY_CONFIG_WIDE_LATIN_MODE_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_WIDE_LATIN_MODE_KEY_DEFAULT,
+ N_("Wide Latin mode"),
+ N_("Select wide Latin mode keys"),
+ N_("The key events to switch input mode to wide Latin. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_HIRAGANA_MODE_KEY,
+ SCIM_ANTHY_CONFIG_HIRAGANA_MODE_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_HIRAGANA_MODE_KEY_DEFAULT,
+ N_("Hiragana mode"),
+ N_("Select hiragana mode keys"),
+ N_("The key events to switch input mode to hiragana. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_KATAKANA_MODE_KEY,
+ SCIM_ANTHY_CONFIG_KATAKANA_MODE_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_KATAKANA_MODE_KEY_DEFAULT,
+ N_("Katakana mode"),
+ N_("Select katakana mode keys"),
+ N_("The key events to switch input mode to katakana. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_HALF_KATAKANA_MODE_KEY,
+ SCIM_ANTHY_CONFIG_HALF_KATAKANA_MODE_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_HALF_KATAKANA_MODE_KEY_DEFAULT,
+ N_("Half katakana mode"),
+ N_("Select half katakana mode keys"),
+ N_("The key events to switch input mode to half katakana. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CANCEL_PSEUDO_ASCII_MODE_KEY,
+ SCIM_ANTHY_CONFIG_CANCEL_PSEUDO_ASCII_MODE_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_CANCEL_PSEUDO_ASCII_MODE_KEY_DEFAULT,
+ N_("Pseudo ASCII mode cancel"),
+ N_("Select pseudo ASCII mode cancel key"),
+ N_("The key events to cancel the pseudo ASCII mode."),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CIRCLE_TYPING_METHOD_KEY,
+ SCIM_ANTHY_CONFIG_CIRCLE_TYPING_METHOD_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_CIRCLE_TYPING_METHOD_KEY_DEFAULT,
+ N_("Circle typing method"),
+ N_("Select circle typing method keys"),
+ N_("The key events to circle typing method. "),
+ NULL,
+ false,
+ },
+ {
+ NULL,
+ "",
+ "",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+};
+
+StringConfigData config_keyboards_edit [] =
+{
+ {
+ SCIM_ANTHY_CONFIG_INSERT_SPACE_KEY,
+ SCIM_ANTHY_CONFIG_INSERT_SPACE_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_INSERT_SPACE_KEY_DEFAULT,
+ N_("Insert space"),
+ N_("Select inserting space keys"),
+ N_("The key events to insert a space. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_INSERT_ALT_SPACE_KEY,
+ SCIM_ANTHY_CONFIG_INSERT_ALT_SPACE_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_INSERT_ALT_SPACE_KEY_DEFAULT,
+ N_("Insert alternative space"),
+ N_("Select inserting alternative space keys"),
+ N_("The key events to insert a alternative space. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_INSERT_HALF_SPACE_KEY,
+ SCIM_ANTHY_CONFIG_INSERT_HALF_SPACE_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_INSERT_HALF_SPACE_KEY_DEFAULT,
+ N_("Insert half space"),
+ N_("Select inserting half width space keys"),
+ N_("The key events to insert a half width space. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_INSERT_WIDE_SPACE_KEY,
+ SCIM_ANTHY_CONFIG_INSERT_WIDE_SPACE_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_INSERT_WIDE_SPACE_KEY_DEFAULT,
+ N_("Insert wide space"),
+ N_("Select inserting wide space keys"),
+ N_("The key events to insert a wide space. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_BACKSPACE_KEY,
+ SCIM_ANTHY_CONFIG_BACKSPACE_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_BACKSPACE_KEY_DEFAULT,
+ N_("Backspace"),
+ N_("Select backspace keys"),
+ N_("The key events to delete a character before caret. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_DELETE_KEY,
+ SCIM_ANTHY_CONFIG_DELETE_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_DELETE_KEY_DEFAULT,
+ N_("Delete"),
+ N_("Select delete keys"),
+ N_("The key events to delete a character after caret. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_COMMIT_KEY,
+ SCIM_ANTHY_CONFIG_COMMIT_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_COMMIT_KEY_DEFAULT,
+ N_("Commit"),
+ N_("Select commit keys"),
+ N_("The key events to commit the preedit string. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CONVERT_KEY,
+ SCIM_ANTHY_CONFIG_CONVERT_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_CONVERT_KEY_DEFAULT,
+ N_("Convert"),
+ N_("Select convert keys"),
+ N_("The key events to convert the preedit string to kanji. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_PREDICT_KEY,
+ SCIM_ANTHY_CONFIG_PREDICT_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_PREDICT_KEY_DEFAULT,
+ N_("Predict"),
+ N_("Select predict keys"),
+ N_("The key events to predict a word or sentence from already inserted text. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CANCEL_KEY,
+ SCIM_ANTHY_CONFIG_CANCEL_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_CANCEL_KEY_DEFAULT,
+ N_("Cancel"),
+ N_("Select cancel keys"),
+ N_("The key events to cancel preediting or converting. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CANCEL_ALL_KEY,
+ SCIM_ANTHY_CONFIG_CANCEL_ALL_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_CANCEL_ALL_KEY_DEFAULT,
+ N_("Cancel all"),
+ N_("Select cancel all keys"),
+ N_("The key events to return to initial state. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_RECONVERT_KEY,
+ SCIM_ANTHY_CONFIG_RECONVERT_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_RECONVERT_KEY_DEFAULT,
+ N_("Reconvert"),
+ N_("Select reconvert keys"),
+ N_("The key events to reconvert the commited string in selection. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_DO_NOTHING_KEY,
+ SCIM_ANTHY_CONFIG_DO_NOTHING_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_DO_NOTHING_KEY_DEFAULT,
+ N_("Do nothing"),
+ N_("Select do nothing keys"),
+ N_("The key events to eat and do nothing anymore. "
+ "For example, it can be used to disable space key completely."),
+ NULL,
+ false,
+ },
+ {
+ NULL,
+ "",
+ "",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+};
+
+StringConfigData config_keyboards_caret [] =
+{
+ {
+ SCIM_ANTHY_CONFIG_MOVE_CARET_FIRST_KEY,
+ SCIM_ANTHY_CONFIG_MOVE_CARET_FIRST_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_MOVE_CARET_FIRST_KEY_DEFAULT,
+ N_("Move to first"),
+ N_("Select move caret to first keys"),
+ N_("The key events to move the caret to the first of preedit string. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_MOVE_CARET_LAST_KEY,
+ SCIM_ANTHY_CONFIG_MOVE_CARET_LAST_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_MOVE_CARET_LAST_KEY_DEFAULT,
+ N_("Move to last"),
+ N_("Select move caret to last keys"),
+ N_("The key events to move the caret to the last of the preedit string. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_MOVE_CARET_FORWARD_KEY,
+ SCIM_ANTHY_CONFIG_MOVE_CARET_FORWARD_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_MOVE_CARET_FORWARD_KEY_DEFAULT,
+ N_("Move forward"),
+ N_("Select move caret forward keys"),
+ N_("The key events to move the caret forward. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_MOVE_CARET_BACKWARD_KEY,
+ SCIM_ANTHY_CONFIG_MOVE_CARET_BACKWARD_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_MOVE_CARET_BACKWARD_KEY_DEFAULT,
+ N_("Move backward"),
+ N_("Select move caret backward keys"),
+ N_("The key events to move the caret backward. "),
+ NULL,
+ false,
+ },
+ {
+ NULL,
+ "",
+ "",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+};
+
+StringConfigData config_keyboards_segments [] =
+{
+ {
+ SCIM_ANTHY_CONFIG_SELECT_FIRST_SEGMENT_KEY,
+ SCIM_ANTHY_CONFIG_SELECT_FIRST_SEGMENT_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECT_FIRST_SEGMENT_KEY_DEFAULT,
+ N_("Select the first segment"),
+ N_("Select keys to select the first segment"),
+ N_("The key events to select the first segment. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SELECT_LAST_SEGMENT_KEY,
+ SCIM_ANTHY_CONFIG_SELECT_LAST_SEGMENT_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECT_LAST_SEGMENT_KEY_DEFAULT,
+ N_("Select the last segment"),
+ N_("Select keys to select the last segment"),
+ N_("The key events to select the the last segment. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SELECT_NEXT_SEGMENT_KEY,
+ SCIM_ANTHY_CONFIG_SELECT_NEXT_SEGMENT_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECT_NEXT_SEGMENT_KEY_DEFAULT,
+ N_("Select the next segment"),
+ N_("Select keys to select the next segment"),
+ N_("The key events to select the next segment. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SELECT_PREV_SEGMENT_KEY,
+ SCIM_ANTHY_CONFIG_SELECT_PREV_SEGMENT_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECT_PREV_SEGMENT_KEY_DEFAULT,
+ N_("Select the previous segment"),
+ N_("Select keys to select the previous segment"),
+ N_("The key events to select the previous segment. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SHRINK_SEGMENT_KEY,
+ SCIM_ANTHY_CONFIG_SHRINK_SEGMENT_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SHRINK_SEGMENT_KEY_DEFAULT,
+ N_("Shrink the segment"),
+ N_("Select keys to shrink the segment"),
+ N_("The key events to shrink the selected segment. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_EXPAND_SEGMENT_KEY,
+ SCIM_ANTHY_CONFIG_EXPAND_SEGMENT_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_EXPAND_SEGMENT_KEY_DEFAULT,
+ N_("Expand the segment"),
+ N_("Select keys to expand the segment"),
+ N_("The key events to expand the selected segment. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_KEY,
+ SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_KEY_DEFAULT,
+ N_("Commit the first segment"),
+ N_("Select keys to commit the first segment"),
+ N_("The key events to commit the first segment. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_KEY,
+ SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_KEY_DEFAULT,
+ N_("Commit the selected segment"),
+ N_("Select keys to commit the selected segment"),
+ N_("The key events to commit the selected segment. "),
+ NULL,
+ false,
+ },
+ {
+ NULL,
+ "",
+ "",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+};
+
+StringConfigData config_keyboards_candidates [] =
+{
+ {
+ SCIM_ANTHY_CONFIG_SELECT_FIRST_CANDIDATE_KEY,
+ SCIM_ANTHY_CONFIG_SELECT_FIRST_CANDIDATE_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECT_FIRST_CANDIDATE_KEY_DEFAULT,
+ N_("First candidate"),
+ N_("Select the first candidate keys"),
+ N_("The key events to select the first candidate. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SELECT_LAST_CANDIDATE_KEY,
+ SCIM_ANTHY_CONFIG_SELECT_LAST_CANDIDATE_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECT_LAST_CANDIDATE_KEY_DEFAULT,
+ N_("Last candidate"),
+ N_("Select the last candidate keys"),
+ N_("The key events to the select last candidate. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SELECT_NEXT_CANDIDATE_KEY,
+ SCIM_ANTHY_CONFIG_SELECT_NEXT_CANDIDATE_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECT_NEXT_CANDIDATE_KEY_DEFAULT,
+ N_("Next candidate"),
+ N_("Select the next candidate keys"),
+ N_("The key events to select the next candidate. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SELECT_PREV_CANDIDATE_KEY,
+ SCIM_ANTHY_CONFIG_SELECT_PREV_CANDIDATE_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECT_PREV_CANDIDATE_KEY_DEFAULT,
+ N_("Previous candidate"),
+ N_("Select the previous candidate keys"),
+ N_("The key events to select the previous candidate. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_UP_KEY,
+ SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_UP_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_UP_KEY_DEFAULT,
+ N_("Page up"),
+ N_("Select page up candidates keys"),
+ N_("The key events to switch candidates page up. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_DOWN_KEY,
+ SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_DOWN_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_DOWN_KEY_DEFAULT,
+ N_("Page down"),
+ N_("Select page down candidates keys"),
+ N_("The key events to switch candidates page down. "),
+ NULL,
+ false,
+ },
+ {
+ NULL,
+ "",
+ "",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+};
+
+StringConfigData config_keyboards_direct_select [] =
+{
+ {
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_1_KEY,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_1_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_1_KEY_DEFAULT,
+ N_("1st candidate"),
+ N_("Select keys to select 1st candidate"),
+ N_("The key events to select the 1st candidate. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_2_KEY,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_2_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_2_KEY_DEFAULT,
+ N_("2nd candidate"),
+ N_("Select keys to select 2nd candidate"),
+ N_("The key events to select the 2nd candidate. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_3_KEY,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_3_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_3_KEY_DEFAULT,
+ N_("3rd candidate"),
+ N_("Select keys to select 3rd candidate"),
+ N_("The key events to select the 3rd candidate. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_4_KEY,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_4_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_4_KEY_DEFAULT,
+ N_("4th candidate"),
+ N_("Select keys to select 4th candidate"),
+ N_("The key events to select the 4th candidate. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_5_KEY,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_5_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_5_KEY_DEFAULT,
+ N_("5th candidate"),
+ N_("Select keys to select 5th candidate"),
+ N_("The key events to select the 5th candidate. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_6_KEY,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_6_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_6_KEY_DEFAULT,
+ N_("6th candidate"),
+ N_("Select keys to select 6th candidate"),
+ N_("The key events to select the 6th candidate. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_7_KEY,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_7_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_7_KEY_DEFAULT,
+ N_("7th candidate"),
+ N_("Select keys to select 7th candidate"),
+ N_("The key events to select the 7th candidate. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_8_KEY,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_8_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_8_KEY_DEFAULT,
+ N_("8th candidate"),
+ N_("Select keys to select 8th candidate"),
+ N_("The key events to select the 8th candidate. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_9_KEY,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_9_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_9_KEY_DEFAULT,
+ N_("9th candidate"),
+ N_("Select keys to select 9th candidate"),
+ N_("The key events to select the 9th candidate. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_10_KEY,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_10_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_10_KEY_DEFAULT,
+ N_("10th candidate"),
+ N_("Select keys to select 10th candidate"),
+ N_("The key events to select the 10th candidate. "),
+ NULL,
+ false,
+ },
+ {
+ NULL,
+ "",
+ "",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+};
+
+StringConfigData config_keyboards_converting [] =
+{
+ {
+ SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_FORWARD_KEY,
+ SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_FORWARD_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_FORWARD_KEY_DEFAULT,
+ N_("Convert character type forward"),
+ N_("Select keys to convert character type forward"),
+ N_("Rotate character type forward."),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_BACKWARD_KEY,
+ SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_BACKWARD_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_BACKWARD_KEY_DEFAULT,
+ N_("Convert character type backward"),
+ N_("Select keys to convert character type backward"),
+ N_("Rotate character type backward."),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CONV_TO_HIRAGANA_KEY,
+ SCIM_ANTHY_CONFIG_CONV_TO_HIRAGANA_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_CONV_TO_HIRAGANA_KEY_DEFAULT,
+ N_("Convert to hiragana"),
+ N_("Select keys to convert to hiragana"),
+ N_("The key events to convert the preedit string to hiragana. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CONV_TO_KATAKANA_KEY,
+ SCIM_ANTHY_CONFIG_CONV_TO_KATAKANA_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_CONV_TO_KATAKANA_KEY_DEFAULT,
+ N_("Convert to katakana"),
+ N_("Select keys to convert to katakana"),
+ N_("The key events to convert the preedit string to katakana. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CONV_TO_HALF_KEY,
+ SCIM_ANTHY_CONFIG_CONV_TO_HALF_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_CONV_TO_HALF_KEY_DEFAULT,
+ N_("Convert to half width"),
+ N_("Select keys to convert to half width"),
+ N_("The key events to convert the preedit string to half width. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CONV_TO_HALF_KATAKANA_KEY,
+ SCIM_ANTHY_CONFIG_CONV_TO_HALF_KATAKANA_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_CONV_TO_HALF_KATAKANA_KEY_DEFAULT,
+ N_("Convert to half katakana"),
+ N_("Select keys to convert to half width katakana"),
+ N_("The key events to convert the preedit string to half width katakana. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CONV_TO_WIDE_LATIN_KEY,
+ SCIM_ANTHY_CONFIG_CONV_TO_WIDE_LATIN_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_CONV_TO_WIDE_LATIN_KEY_DEFAULT,
+ N_("Convert to wide latin"),
+ N_("Select keys to convert to wide latin"),
+ N_("The key events to convert the preedit string to wide latin. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CONV_TO_LATIN_KEY,
+ SCIM_ANTHY_CONFIG_CONV_TO_LATIN_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_CONV_TO_LATIN_KEY_DEFAULT,
+ N_("Convert to latin"),
+ N_("Select keys to convert to latin"),
+ N_("The key events to convert the preedit string to latin. "),
+ NULL,
+ false,
+ },
+ {
+ NULL,
+ "",
+ "",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+};
+
+StringConfigData config_keyboards_dict [] =
+{
+ {
+ SCIM_ANTHY_CONFIG_DICT_ADMIN_KEY,
+ SCIM_ANTHY_CONFIG_DICT_ADMIN_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_DICT_ADMIN_KEY_DEFAULT,
+ N_("Edit dictionary"),
+ N_("Select edit dictionary keys"),
+ N_("The key events to launch dictionary administration tool. "),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_ADD_WORD_KEY,
+ SCIM_ANTHY_CONFIG_ADD_WORD_KEY_DEFAULT,
+ SCIM_ANTHY_CONFIG_ADD_WORD_KEY_DEFAULT,
+ N_("Add a word"),
+ N_("Select add a word keys"),
+ N_("The key events to launch the tool to add a word. "),
+ NULL,
+ false,
+ },
+ {
+ NULL,
+ "",
+ "",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+};
+
+ColorConfigData config_color_common [] =
+{
+ {
+ SCIM_ANTHY_CONFIG_PREEDIT_FG_COLOR,
+ SCIM_ANTHY_CONFIG_PREEDIT_FG_COLOR_DEFAULT,
+ SCIM_ANTHY_CONFIG_PREEDIT_FG_COLOR_DEFAULT,
+ SCIM_ANTHY_CONFIG_PREEDIT_BG_COLOR,
+ SCIM_ANTHY_CONFIG_PREEDIT_BG_COLOR_DEFAULT,
+ SCIM_ANTHY_CONFIG_PREEDIT_BG_COLOR_DEFAULT,
+ N_("Color:"),
+ N_("The color of preediting text"),
+ N_("The color of preediting text"),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_CONVERSION_FG_COLOR,
+ SCIM_ANTHY_CONFIG_CONVERSION_FG_COLOR_DEFAULT,
+ SCIM_ANTHY_CONFIG_CONVERSION_FG_COLOR_DEFAULT,
+ SCIM_ANTHY_CONFIG_CONVERSION_BG_COLOR,
+ SCIM_ANTHY_CONFIG_CONVERSION_BG_COLOR_DEFAULT,
+ SCIM_ANTHY_CONFIG_CONVERSION_BG_COLOR_DEFAULT,
+ N_("Color:"),
+ N_("The color of conversion text"),
+ N_("The color of conversion text"),
+ NULL,
+ false,
+ },
+ {
+ SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_FG_COLOR,
+ SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_FG_COLOR_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_FG_COLOR_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_BG_COLOR,
+ SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_BG_COLOR_DEFAULT,
+ SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_BG_COLOR_DEFAULT,
+ N_("Color:"),
+ N_("The color of selected segment text"),
+ N_("The color of selected segment text in the conversion text"),
+ NULL,
+ false,
+ },
+ {
+ NULL,
+ "",
+ "",
+ NULL,
+ "",
+ "",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ false,
+ },
+};
+
+BoolConfigData *
+find_bool_config_entry (const char *config_key)
+{
+ if (!config_key)
+ return NULL;
+
+ for (unsigned int i = 0; config_bool_common[i].key; i++) {
+ BoolConfigData *entry = &config_bool_common[i];
+ if (entry->key && !strcmp (entry->key, config_key))
+ return entry;
+ }
+
+ return NULL;
+}
+
+IntConfigData *
+find_int_config_entry (const char *config_key)
+{
+ if (!config_key)
+ return NULL;
+
+ for (unsigned int i = 0; config_int_common[i].key; i++) {
+ IntConfigData *entry = &config_int_common[i];
+ if (entry->key && !strcmp (entry->key, config_key))
+ return entry;
+ }
+
+ return NULL;
+}
+
+StringConfigData *
+find_string_config_entry (const char *config_key)
+{
+ if (!config_key)
+ return NULL;
+
+ for (unsigned int i = 0; config_string_common[i].key; i++) {
+ StringConfigData *entry = &config_string_common[i];
+ if (entry->key && !strcmp (entry->key, config_key))
+ return entry;
+ }
+
+ return NULL;
+}
+
+ColorConfigData *
+find_color_config_entry (const char *config_key)
+{
+ if (!config_key)
+ return NULL;
+
+ for (unsigned int i = 0; config_color_common[i].fg_key; i++) {
+ ColorConfigData *entry = &config_color_common[i];
+ if (entry->fg_key && !strcmp (entry->fg_key, config_key))
+ return entry;
+ }
+
+ return NULL;
+}
+
+}
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004 Hiroyuki Ikezoe
+ * Copyright (C) 2004 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SCIM_ANTHY_PREFS_H__
+#define __SCIM_ANTHY_PREFS_H__
+
+/* config keys */
+#define SCIM_ANTHY_CONFIG_INPUT_MODE "/IMEngine/Anthy/InputMode"
+#define SCIM_ANTHY_CONFIG_TYPING_METHOD "/IMEngine/Anthy/TypingMethod"
+#define SCIM_ANTHY_CONFIG_CONVERSION_MODE "/IMEngine/Anthy/ConversionMode"
+#define SCIM_ANTHY_CONFIG_PERIOD_STYLE "/IMEngine/Anthy/PeriodStyle"
+#define SCIM_ANTHY_CONFIG_SYMBOL_STYLE "/IMEngine/Anthy/SymbolStyle"
+#define SCIM_ANTHY_CONFIG_SPACE_TYPE "/IMEngine/Anthy/SpaceType"
+#define SCIM_ANTHY_CONFIG_TEN_KEY_TYPE "/IMEngine/Anthy/TenKeyType"
+#define SCIM_ANTHY_CONFIG_BEHAVIOR_ON_PERIOD "/IMEngine/Anthy/BehaviorOnPeriod"
+#define SCIM_ANTHY_CONFIG_BEHAVIOR_ON_FOCUS_OUT "/IMEngine/Anthy/BehaviorOnFocusOut"
+
+#define SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE "/IMEngine/Anthy/RomajiThemeFile"
+#define SCIM_ANTHY_CONFIG_ROMAJI_HALF_SYMBOL "/IMEngine/Anthy/RomajiHalfSymbol"
+#define SCIM_ANTHY_CONFIG_ROMAJI_HALF_NUMBER "/IMEngine/Anthy/RomajiHalfNumber"
+#define SCIM_ANTHY_CONFIG_ROMAJI_ALLOW_SPLIT "/IMEngine/Anthy/RomajiAllowSplit"
+#define SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_MODE "/IMEngine/Anthy/RomajiPseudoAsciiMode"
+#define SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR "/IMEngine/Anthy/RomajiPseudoAsciiBlankBehavior"
+
+#define SCIM_ANTHY_CONFIG_KANA_LAYOUT_FILE "/IMEngine/Anthy/KanaLayoutFile"
+#define SCIM_ANTHY_CONFIG_KANA_LAYOUT_RO_KEY "/IMEngine/ANthy/KanaLayoutRoKey"
+
+#define SCIM_ANTHY_CONFIG_NICOLA_LAYOUT_FILE "/IMEngine/Anthy/NICOLALayoutFile"
+#define SCIM_ANTHY_CONFIG_NICOLA_TIME "/IMEngine/Anthy/NICOLATime"
+#define SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY "/IMEngine/Anthy/LeftThumbShiftKey"
+#define SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY "/IMEngine/Anthy/RightThumbShiftKey"
+
+#define SCIM_ANTHY_CONFIG_LEARN_ON_MANUAL_COMMIT "/IMEngine/Anthy/LearnOnManualCommit"
+#define SCIM_ANTHY_CONFIG_LEARN_ON_AUTO_COMMIT "/IMEngine/Anthy/LearnOnAutoCommit"
+
+#define SCIM_ANTHY_CONFIG_DICT_ENCODING "/IMEngine/Anthy/DictEncoding"
+#define SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND "/IMEngine/Anthy/DictAdminCommand"
+#define SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND "/IMEngine/Anthy/AddWordCommand"
+
+#define SCIM_ANTHY_CONFIG_PREDICT_ON_INPUT "/IMEngine/Anthy/PredictOnInput"
+#define SCIM_ANTHY_CONFIG_USE_DIRECT_KEY_ON_PREDICT "/IMEngine/Anthy/UseDirectKeyOnPredict"
+
+#define SCIM_ANTHY_CONFIG_COLOR_THEME_FILE "/IMEngine/Anthy/ColorThemeFile"
+
+#define SCIM_ANTHY_CONFIG_SHOW_CANDIDATES_LABEL "/IMEngine/Anthy/ShowCandidatesLabel"
+#define SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE "/IMEngine/Anthy/CandWinPageSize"
+#define SCIM_ANTHY_CONFIG_CLOSE_CAND_WIN_ON_SELECT "/IMEngine/Anthy/CloseCandWinOnSelect"
+#define SCIM_ANTHY_CONFIG_N_TRIGGERS_TO_SHOW_CAND_WIN "/IMEngine/Anthy/NTriggersToShowCandWin"
+
+#define SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL "/IMEngine/Anthy/ShowInputModeLabel"
+#define SCIM_ANTHY_CONFIG_SHOW_TYPING_METHOD_LABEL "/IMEngine/Anthy/ShowTypingMethodLabel"
+#define SCIM_ANTHY_CONFIG_SHOW_CONVERSION_MODE_LABEL "/IMEngine/Anthy/ShowConversionModeLabel"
+#define SCIM_ANTHY_CONFIG_SHOW_PERIOD_STYLE_LABEL "/IMEngine/Anthy/ShowPeriodStyleLabel"
+#define SCIM_ANTHY_CONFIG_SHOW_SYMBOL_STYLE_LABEL "/IMEngine/Anthy/ShowSymbolStyleLabel"
+#define SCIM_ANTHY_CONFIG_SHOW_DICT_LABEL "/IMEngine/Anthy/ShowDictLabel"
+#define SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL "/IMEngine/Anthy/ShowDictAdminLabel"
+#define SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL "/IMEngine/Anthy/ShowAddWordLabel"
+
+#define SCIM_ANTHY_CONFIG_KEY_THEME "/IMEngine/Anthy/KeyTheme"
+#define SCIM_ANTHY_CONFIG_KEY_THEME_FILE "/IMEngine/Anthy/KeyThemeFile"
+
+#define SCIM_ANTHY_CONFIG_ON_OFF_KEY "/IMEngine/Anthy/OnOffKey"
+#define SCIM_ANTHY_CONFIG_CIRCLE_INPUT_MODE_KEY "/IMEngine/Anthy/CircleInputModeKey"
+#define SCIM_ANTHY_CONFIG_CIRCLE_KANA_MODE_KEY "/IMEngine/Anthy/CircleKanaModeKey"
+#define SCIM_ANTHY_CONFIG_CIRCLE_TYPING_METHOD_KEY "/IMEngine/Anthy/CircleTypingMethodKey"
+#define SCIM_ANTHY_CONFIG_LATIN_MODE_KEY "/IMEngine/Anthy/LatinModeKey"
+#define SCIM_ANTHY_CONFIG_WIDE_LATIN_MODE_KEY "/IMEngine/Anthy/WideLatinModeKey"
+#define SCIM_ANTHY_CONFIG_HIRAGANA_MODE_KEY "/IMEngine/Anthy/HiraganaModeKey"
+#define SCIM_ANTHY_CONFIG_KATAKANA_MODE_KEY "/IMEngine/Anthy/KatakanaModeKey"
+#define SCIM_ANTHY_CONFIG_HALF_KATAKANA_MODE_KEY "/IMEngine/Anthy/HalfKatakanaModeKey"
+#define SCIM_ANTHY_CONFIG_CANCEL_PSEUDO_ASCII_MODE_KEY "/IMEngine/Anthy/CancelPseudoAsciiModeKey"
+
+#define SCIM_ANTHY_CONFIG_INSERT_SPACE_KEY "/IMEngine/Anthy/InsertSpaceKey"
+#define SCIM_ANTHY_CONFIG_INSERT_ALT_SPACE_KEY "/IMEngine/Anthy/InsertAltSpaceKey"
+#define SCIM_ANTHY_CONFIG_INSERT_HALF_SPACE_KEY "/IMEngine/Anthy/InsertHalfSpaceKey"
+#define SCIM_ANTHY_CONFIG_INSERT_WIDE_SPACE_KEY "/IMEngine/Anthy/InsertWideSpaceKey"
+#define SCIM_ANTHY_CONFIG_BACKSPACE_KEY "/IMEngine/Anthy/BackSpaceKey"
+#define SCIM_ANTHY_CONFIG_DELETE_KEY "/IMEngine/Anthy/DeleteKey"
+#define SCIM_ANTHY_CONFIG_COMMIT_KEY "/IMEngine/Anthy/CommitKey"
+#define SCIM_ANTHY_CONFIG_COMMIT_REVERSE_LEARN_KEY "/IMEngine/Anthy/CommitReverseLearnKey"
+#define SCIM_ANTHY_CONFIG_CONVERT_KEY "/IMEngine/Anthy/ConvertKey"
+#define SCIM_ANTHY_CONFIG_PREDICT_KEY "/IMEngine/Anthy/PredictKey"
+#define SCIM_ANTHY_CONFIG_CANCEL_KEY "/IMEngine/Anthy/CancelKey"
+#define SCIM_ANTHY_CONFIG_CANCEL_ALL_KEY "/IMEngine/Anthy/CancelAllKey"
+#define SCIM_ANTHY_CONFIG_DO_NOTHING_KEY "/IMEngine/Anthy/DoNothingKey"
+
+#define SCIM_ANTHY_CONFIG_MOVE_CARET_FIRST_KEY "/IMEngine/Anthy/MoveCaretFirstKey"
+#define SCIM_ANTHY_CONFIG_MOVE_CARET_LAST_KEY "/IMEngine/Anthy/MoveCaretLastKey"
+#define SCIM_ANTHY_CONFIG_MOVE_CARET_FORWARD_KEY "/IMEngine/Anthy/MoveCaretForwardKey"
+#define SCIM_ANTHY_CONFIG_MOVE_CARET_BACKWARD_KEY "/IMEngine/Anthy/MoveCaretBackwardKey"
+
+#define SCIM_ANTHY_CONFIG_SELECT_FIRST_SEGMENT_KEY "/IMEngine/Anthy/SelectFirstSegmentKey"
+#define SCIM_ANTHY_CONFIG_SELECT_LAST_SEGMENT_KEY "/IMEngine/Anthy/SelectLastSegmentKey"
+#define SCIM_ANTHY_CONFIG_SELECT_NEXT_SEGMENT_KEY "/IMEngine/Anthy/SelectNextSegmentKey"
+#define SCIM_ANTHY_CONFIG_SELECT_PREV_SEGMENT_KEY "/IMEngine/Anthy/SelectPrevSegmentKey"
+#define SCIM_ANTHY_CONFIG_SHRINK_SEGMENT_KEY "/IMEngine/Anthy/ShrinkSegmentKey"
+#define SCIM_ANTHY_CONFIG_EXPAND_SEGMENT_KEY "/IMEngine/Anthy/ExpandSegmentKey"
+#define SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_KEY "/IMEngine/Anthy/CommitFirstSegmentKey"
+#define SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_KEY "/IMEngine/Anthy/CommitSelectedSegmentKey"
+#define SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_REVERSE_LEARN_KEY "/IMEngine/Anthy/CommitFirstSegmentReverseLearnKey"
+#define SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_REVERSE_LEARN_KEY "/IMEngine/Anthy/CommitSelectedSegmentReverseLearnKey"
+
+#define SCIM_ANTHY_CONFIG_SELECT_FIRST_CANDIDATE_KEY "/IMEngine/Anthy/SelectFirstCandidateKey"
+#define SCIM_ANTHY_CONFIG_SELECT_LAST_CANDIDATE_KEY "/IMEngine/Anthy/SelectLastCandidateKey"
+#define SCIM_ANTHY_CONFIG_SELECT_NEXT_CANDIDATE_KEY "/IMEngine/Anthy/SelectNextCandidateKey"
+#define SCIM_ANTHY_CONFIG_SELECT_PREV_CANDIDATE_KEY "/IMEngine/Anthy/SelectPrevCandidateKey"
+#define SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_UP_KEY "/IMEngine/Anthy/CandidatesPageUpKey"
+#define SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_DOWN_KEY "/IMEngine/Anthy/CandidatesPageDownKey"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_1_KEY "/IMEngine/Anthy/SelectCandidates1Key"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_2_KEY "/IMEngine/Anthy/SelectCandidates2Key"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_3_KEY "/IMEngine/Anthy/SelectCandidates3Key"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_4_KEY "/IMEngine/Anthy/SelectCandidates4Key"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_5_KEY "/IMEngine/Anthy/SelectCandidates5Key"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_6_KEY "/IMEngine/Anthy/SelectCandidates6Key"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_7_KEY "/IMEngine/Anthy/SelectCandidates7Key"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_8_KEY "/IMEngine/Anthy/SelectCandidates8Key"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_9_KEY "/IMEngine/Anthy/SelectCandidates9Key"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_10_KEY "/IMEngine/Anthy/SelectCandidates10Key"
+
+#define SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_FORWARD_KEY "/IMEngine/Anthy/ConvertCharTypeForwardKey"
+#define SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_BACKWARD_KEY "/IMEngine/Anthy/ConvertCharTypeBackwardKey"
+#define SCIM_ANTHY_CONFIG_CONV_TO_HIRAGANA_KEY "/IMEngine/Anthy/ConvertToHiraganaKey"
+#define SCIM_ANTHY_CONFIG_CONV_TO_KATAKANA_KEY "/IMEngine/Anthy/ConvertToKatakanaKey"
+#define SCIM_ANTHY_CONFIG_CONV_TO_HALF_KEY "/IMEngine/Anthy/ConvertToHalfKey"
+#define SCIM_ANTHY_CONFIG_CONV_TO_HALF_KATAKANA_KEY "/IMEngine/Anthy/ConvertToHalfKatakanaKey"
+#define SCIM_ANTHY_CONFIG_CONV_TO_WIDE_LATIN_KEY "/IMEngine/Anthy/ConvertToWideLatinKey"
+#define SCIM_ANTHY_CONFIG_CONV_TO_LATIN_KEY "/IMEngine/Anthy/ConvertToLatinKey"
+
+#define SCIM_ANTHY_CONFIG_RECONVERT_KEY "/IMEngine/Anthy/ReconvertKey"
+
+#define SCIM_ANTHY_CONFIG_DICT_ADMIN_KEY "/IMEngine/Anthy/DictAdminKey"
+#define SCIM_ANTHY_CONFIG_ADD_WORD_KEY "/IMEngine/Anthy/AddWordKey"
+
+#define SCIM_ANTHY_CONFIG_PREEDIT_STYLE "/IMEngine/Anthy/PreeditStyle"
+#define SCIM_ANTHY_CONFIG_PREEDIT_FG_COLOR "/IMEngine/Anthy/PreeditFGColor"
+#define SCIM_ANTHY_CONFIG_PREEDIT_BG_COLOR "/IMEngine/Anthy/PreeditBGColor"
+#define SCIM_ANTHY_CONFIG_CONVERSION_STYLE "/IMEngine/Anthy/ConversionStyle"
+#define SCIM_ANTHY_CONFIG_CONVERSION_FG_COLOR "/IMEngine/Anthy/ConversionFGColor"
+#define SCIM_ANTHY_CONFIG_CONVERSION_BG_COLOR "/IMEngine/Anthy/ConversionBGColor"
+#define SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE "/IMEngine/Anthy/SelectedSegmentStyle"
+#define SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_FG_COLOR "/IMEngine/Anthy/SelectedSegmentFGColor"
+#define SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_BG_COLOR "/IMEngine/Anthy/SelectedSegmentBGColor"
+
+
+/* default config values */
+#define SCIM_ANTHY_CONFIG_INPUT_MODE_DEFAULT "Hiragana"
+#define SCIM_ANTHY_CONFIG_TYPING_METHOD_DEFAULT "Romaji"
+#define SCIM_ANTHY_CONFIG_CONVERSION_MODE_DEFAULT "MultiSeg"
+#define SCIM_ANTHY_CONFIG_PERIOD_STYLE_DEFAULT "Japanese"
+#define SCIM_ANTHY_CONFIG_SYMBOL_STYLE_DEFAULT "Japanese"
+#define SCIM_ANTHY_CONFIG_SPACE_TYPE_DEFAULT "FollowMode"
+#define SCIM_ANTHY_CONFIG_TEN_KEY_TYPE_DEFAULT "FollowMode"
+#define SCIM_ANTHY_CONFIG_BEHAVIOR_ON_PERIOD_DEFAULT "None"
+#define SCIM_ANTHY_CONFIG_BEHAVIOR_ON_FOCUS_OUT_DEFAULT "Commit"
+
+#define SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE_DEFAULT ""
+#define SCIM_ANTHY_CONFIG_ROMAJI_HALF_SYMBOL_DEFAULT false
+#define SCIM_ANTHY_CONFIG_ROMAJI_HALF_NUMBER_DEFAULT false
+#define SCIM_ANTHY_CONFIG_ROMAJI_ALLOW_SPLIT_DEFAULT true
+#define SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_MODE_DEFAULT true
+#define SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR_DEFAULT true
+
+#define SCIM_ANTHY_CONFIG_KANA_LAYOUT_FILE_DEFAULT ""
+#define SCIM_ANTHY_CONFIG_KANA_LAYOUT_RO_KEY_DEFAULT "\xE3\x82\x8D"
+
+#define SCIM_ANTHY_CONFIG_NICOLA_LAYOUT_FILE_DEFAULT ""
+#define SCIM_ANTHY_CONFIG_NICOLA_TIME_DEFAULT 200
+#define SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY_DEFAULT "Muhenkan"
+#define SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY_DEFAULT "Henkan,space"
+
+#define SCIM_ANTHY_CONFIG_LEARN_ON_MANUAL_COMMIT_DEFAULT true
+#define SCIM_ANTHY_CONFIG_LEARN_ON_AUTO_COMMIT_DEFAULT true
+
+#define SCIM_ANTHY_CONFIG_DICT_ENCODING_DEFAULT "UTF-8"
+#define SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND_DEFAULT "kasumi"
+#define SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND_DEFAULT "kasumi --add"
+
+#define SCIM_ANTHY_CONFIG_PREDICT_ON_INPUT_DEFAULT false
+#define SCIM_ANTHY_CONFIG_USE_DIRECT_KEY_ON_PREDICT_DEFAULT true
+
+#define SCIM_ANTHY_CONFIG_COLOR_THEME_FILE_DEFAULT ""
+
+#define SCIM_ANTHY_CONFIG_SHOW_CANDIDATES_LABEL_DEFAULT true
+#define SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE_DEFAULT 10
+#define SCIM_ANTHY_CONFIG_CLOSE_CAND_WIN_ON_SELECT_DEFAULT true
+#define SCIM_ANTHY_CONFIG_N_TRIGGERS_TO_SHOW_CAND_WIN_DEFAULT 2
+
+#define SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL_DEFAULT true
+#define SCIM_ANTHY_CONFIG_SHOW_TYPING_METHOD_LABEL_DEFAULT false
+#define SCIM_ANTHY_CONFIG_SHOW_CONVERSION_MODE_LABEL_DEFAULT true
+#define SCIM_ANTHY_CONFIG_SHOW_PERIOD_STYLE_LABEL_DEFAULT false
+#define SCIM_ANTHY_CONFIG_SHOW_SYMBOL_STYLE_LABEL_DEFAULT false
+#define SCIM_ANTHY_CONFIG_SHOW_DICT_LABEL_DEFAULT true
+#define SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL_DEFAULT true
+#define SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL_DEFAULT true
+
+#define SCIM_ANTHY_CONFIG_KEY_THEME_DEFAULT "Default"
+#define SCIM_ANTHY_CONFIG_KEY_THEME_FILE_DEFAULT ""
+
+#define SCIM_ANTHY_CONFIG_ON_OFF_KEY_DEFAULT "Zenkaku_Hankaku,Control+j,Control+J"
+#define SCIM_ANTHY_CONFIG_CIRCLE_INPUT_MODE_KEY_DEFAULT "Control+comma,Control+less"
+#define SCIM_ANTHY_CONFIG_CIRCLE_KANA_MODE_KEY_DEFAULT "Control+period,Control+greater,Hiragana_Katakana"
+#define SCIM_ANTHY_CONFIG_CIRCLE_TYPING_METHOD_KEY_DEFAULT "Alt+Romaji,Control+slash"
+#define SCIM_ANTHY_CONFIG_LATIN_MODE_KEY_DEFAULT ""
+#define SCIM_ANTHY_CONFIG_WIDE_LATIN_MODE_KEY_DEFAULT ""
+#define SCIM_ANTHY_CONFIG_HIRAGANA_MODE_KEY_DEFAULT ""
+#define SCIM_ANTHY_CONFIG_KATAKANA_MODE_KEY_DEFAULT ""
+#define SCIM_ANTHY_CONFIG_HALF_KATAKANA_MODE_KEY_DEFAULT ""
+#define SCIM_ANTHY_CONFIG_CANCEL_PSEUDO_ASCII_MODE_KEY_DEFAULT "Escape"
+
+#define SCIM_ANTHY_CONFIG_INSERT_SPACE_KEY_DEFAULT "space"
+#define SCIM_ANTHY_CONFIG_INSERT_ALT_SPACE_KEY_DEFAULT "Shift+space"
+#define SCIM_ANTHY_CONFIG_INSERT_HALF_SPACE_KEY_DEFAULT ""
+#define SCIM_ANTHY_CONFIG_INSERT_WIDE_SPACE_KEY_DEFAULT ""
+#define SCIM_ANTHY_CONFIG_BACKSPACE_KEY_DEFAULT "BackSpace,Control+h,Control+H"
+#define SCIM_ANTHY_CONFIG_DELETE_KEY_DEFAULT "Delete,Control+d,Control+D"
+#define SCIM_ANTHY_CONFIG_COMMIT_KEY_DEFAULT "Return,KP_Enter,Control+j,Control+J,Control+m,Control+M"
+#define SCIM_ANTHY_CONFIG_COMMIT_REVERSE_LEARN_KEY_DEFAULT "Shift+Return"
+#define SCIM_ANTHY_CONFIG_CONVERT_KEY_DEFAULT "space,KP_Space,Henkan"
+#define SCIM_ANTHY_CONFIG_PREDICT_KEY_DEFAULT "Tab,ISO_Left_Tab"
+#define SCIM_ANTHY_CONFIG_CANCEL_KEY_DEFAULT "Escape,Control+g,Control+G"
+#define SCIM_ANTHY_CONFIG_CANCEL_ALL_KEY_DEFAULT ""
+#define SCIM_ANTHY_CONFIG_DO_NOTHING_KEY_DEFAULT ""
+
+#define SCIM_ANTHY_CONFIG_MOVE_CARET_FIRST_KEY_DEFAULT "Control+a,Control+A,Home"
+#define SCIM_ANTHY_CONFIG_MOVE_CARET_LAST_KEY_DEFAULT "Control+e,Control+E,End"
+#define SCIM_ANTHY_CONFIG_MOVE_CARET_FORWARD_KEY_DEFAULT "Right,Control+f,Control+F"
+#define SCIM_ANTHY_CONFIG_MOVE_CARET_BACKWARD_KEY_DEFAULT "Left,Control+b,Control+B"
+
+#define SCIM_ANTHY_CONFIG_SELECT_FIRST_SEGMENT_KEY_DEFAULT "Control+a,Control+A,Home"
+#define SCIM_ANTHY_CONFIG_SELECT_LAST_SEGMENT_KEY_DEFAULT "Control+e,Control+E,End"
+#define SCIM_ANTHY_CONFIG_SELECT_NEXT_SEGMENT_KEY_DEFAULT "Right,Control+f,Control+F"
+#define SCIM_ANTHY_CONFIG_SELECT_PREV_SEGMENT_KEY_DEFAULT "Left,Control+b,Control+B"
+#define SCIM_ANTHY_CONFIG_SHRINK_SEGMENT_KEY_DEFAULT "Shift+Left,Control+i,Control+I"
+#define SCIM_ANTHY_CONFIG_EXPAND_SEGMENT_KEY_DEFAULT "Shift+Right,Control+o,Control+O"
+#define SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_KEY_DEFAULT "Shift+Down"
+#define SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_KEY_DEFAULT "Control+Down"
+#define SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_REVERSE_LEARN_KEY_DEFAULT ""
+#define SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_REVERSE_LEARN_KEY_DEFAULT ""
+
+#define SCIM_ANTHY_CONFIG_SELECT_FIRST_CANDIDATE_KEY_DEFAULT "Home"
+#define SCIM_ANTHY_CONFIG_SELECT_LAST_CANDIDATE_KEY_DEFAULT "End"
+#define SCIM_ANTHY_CONFIG_SELECT_NEXT_CANDIDATE_KEY_DEFAULT "space,KP_Space,Tab,ISO_Left_Tab,Henkan,Down,KP_Add,Control+n,Control+N"
+#define SCIM_ANTHY_CONFIG_SELECT_PREV_CANDIDATE_KEY_DEFAULT "Shift+Tab,Shift+ISO_Left_Tab,Up,KP_Subtract,Control+p,Control+P"
+#define SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_UP_KEY_DEFAULT "Page_Up"
+#define SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_DOWN_KEY_DEFAULT "Page_Down,KP_Tab"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_1_KEY_DEFAULT "1"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_2_KEY_DEFAULT "2"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_3_KEY_DEFAULT "3"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_4_KEY_DEFAULT "4"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_5_KEY_DEFAULT "5"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_6_KEY_DEFAULT "6"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_7_KEY_DEFAULT "7"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_8_KEY_DEFAULT "8"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_9_KEY_DEFAULT "9"
+#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_10_KEY_DEFAULT "0"
+
+#define SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_FORWARD_KEY_DEFAULT "Muhenkan"
+#define SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_BACKWARD_KEY_DEFAULT ""
+#define SCIM_ANTHY_CONFIG_CONV_TO_HIRAGANA_KEY_DEFAULT "F6"
+#define SCIM_ANTHY_CONFIG_CONV_TO_KATAKANA_KEY_DEFAULT "F7"
+#define SCIM_ANTHY_CONFIG_CONV_TO_HALF_KEY_DEFAULT "F8"
+#define SCIM_ANTHY_CONFIG_CONV_TO_HALF_KATAKANA_KEY_DEFAULT "Shift+F8"
+#define SCIM_ANTHY_CONFIG_CONV_TO_WIDE_LATIN_KEY_DEFAULT "F9"
+#define SCIM_ANTHY_CONFIG_CONV_TO_LATIN_KEY_DEFAULT "F10"
+
+#define SCIM_ANTHY_CONFIG_RECONVERT_KEY_DEFAULT "Shift+Henkan"
+
+#define SCIM_ANTHY_CONFIG_DICT_ADMIN_KEY_DEFAULT "F11"
+#define SCIM_ANTHY_CONFIG_ADD_WORD_KEY_DEFAULT "F12"
+
+#define SCIM_ANTHY_CONFIG_PREEDIT_STYLE_DEFAULT "Underline"
+#define SCIM_ANTHY_CONFIG_PREEDIT_FG_COLOR_DEFAULT "#006010"
+#define SCIM_ANTHY_CONFIG_PREEDIT_BG_COLOR_DEFAULT "#FFFFFF"
+#define SCIM_ANTHY_CONFIG_CONVERSION_STYLE_DEFAULT "Underline"
+#define SCIM_ANTHY_CONFIG_CONVERSION_FG_COLOR_DEFAULT "#006010"
+#define SCIM_ANTHY_CONFIG_CONVERSION_BG_COLOR_DEFAULT "#FFFFFF"
+#define SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE_DEFAULT "Reverse"
+#define SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_FG_COLOR_DEFAULT "#FFFFFF"
+#define SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_BG_COLOR_DEFAULT "#0900A5"
+
+
+#ifdef SCIM_ANTHY_USE_GTK
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#endif /* HAVE_CONFIG_H */
+
+#include <scim.h>
+
+using namespace scim;
+
+namespace scim_anthy {
+struct BoolConfigData
+{
+ const char *key;
+ bool value;
+ bool default_value;
+ const char *label;
+ const char *title;
+ const char *tooltip;
+ void *widget;
+ bool changed;
+};
+
+struct IntConfigData
+{
+ const char *key;
+ int value;
+ int default_value;
+ int min, max, step;
+ const char *label;
+ const char *unit;
+ const char *title;
+ const char *tooltip;
+ void *widget;
+ bool changed;
+};
+
+struct StringConfigData
+{
+ const char *key;
+ String value;
+ String default_value;
+ const char *label;
+ const char *title;
+ const char *tooltip;
+ void *widget;
+ bool changed;
+};
+
+struct ColorConfigData
+{
+ const char *fg_key;
+ String fg_value;
+ String fg_default_value;
+ const char *bg_key;
+ String bg_value;
+ String bg_default_value;
+ const char *label;
+ const char *title;
+ const char *tooltip;
+ void *widget;
+ bool changed;
+};
+
+extern BoolConfigData config_bool_common [];
+extern IntConfigData config_int_common [];
+extern StringConfigData config_string_common [];
+extern StringConfigData config_keyboards_mode [];
+extern StringConfigData config_keyboards_edit [];
+extern StringConfigData config_keyboards_caret [];
+extern StringConfigData config_keyboards_segments [];
+extern StringConfigData config_keyboards_candidates [];
+extern StringConfigData config_keyboards_direct_select [];
+extern StringConfigData config_keyboards_converting [];
+extern StringConfigData config_keyboards_dict [];
+extern ColorConfigData config_color_common [];
+
+BoolConfigData *find_bool_config_entry (const char *config_key);
+IntConfigData *find_int_config_entry (const char *config_key);
+StringConfigData *find_string_config_entry (const char *config_key);
+ColorConfigData *find_color_config_entry (const char *config_key);
+
+}
+
+#endif /* SCIM_ANTHY_USE_GTK */
+
+
+#endif /* __SCIM_ANTHY_PREFS_H__ */
+/*
+vi:ts=4:nowrap:ai:expandtab
+*/
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "scim_anthy_reading.h"
+#include "scim_anthy_factory.h"
+#include "scim_anthy_imengine.h"
+#include "scim_anthy_utils.h"
+
+using namespace scim_anthy;
+
+ReadingSegment::ReadingSegment ()
+{
+}
+
+ReadingSegment::~ReadingSegment ()
+{
+}
+
+static const char *
+find_romaji (WideString c)
+{
+ ConvRule *table = scim_anthy_romaji_typing_rule;
+
+ for (unsigned int i = 0; table[i].string; i++) {
+ WideString kana = utf8_mbstowcs (table[i].result);
+ if (c == kana)
+ return table[i].string;
+ }
+
+ return "";
+}
+
+static void
+to_half (String &dest, WideString &src)
+{
+ WideRule *table = scim_anthy_wide_table;
+
+ for (unsigned int i = 0; i < src.size (); i++) {
+ bool found = false;
+ WideString kana1 = src.substr (i, 1);
+ for (unsigned int i = 0; table[i].code; i++) {
+ WideString kana2 = utf8_mbstowcs (table[i].wide);
+ if (kana1 == kana2) {
+ dest += table[i].code;
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ dest += utf8_wcstombs (kana1);
+ }
+}
+
+// Only a romaji string can be splited with raw key string.
+// Other typing method aren't supported splitting raw key string.
+void
+ReadingSegment::split (ReadingSegments &segments)
+{
+ if (kana.length () <= 1)
+ segments.push_back (*this);
+
+ String half;
+ to_half (half, kana);
+ bool same_with_raw = half == raw;
+
+ WideString::iterator it;
+ for (unsigned int i = 0; i < kana.size (); i++) {
+ WideString c = kana.substr (i, 1);
+ ReadingSegment seg;
+ seg.kana = c;
+ if (same_with_raw)
+ to_half (seg.raw, c);
+ else
+ seg.raw = find_romaji (c);
+ segments.push_back (seg);
+ }
+}
+
+
+
+Reading::Reading (AnthyInstance &anthy)
+ : m_anthy (anthy),
+ //m_key2kana_tables (tables),
+ m_key2kana_normal (anthy, m_key2kana_tables),
+ m_kana (anthy),
+ m_nicola (anthy, m_nicola_tables),
+ m_key2kana (&m_key2kana_normal),
+ m_segment_pos (0),
+ m_caret_offset (0)
+{
+ m_nicola_tables.set_typing_method (SCIM_ANTHY_TYPING_METHOD_NICOLA);
+}
+
+Reading::~Reading ()
+{
+}
+
+bool
+Reading::can_process_key_event (const KeyEvent & key)
+{
+ if (m_kana.can_append (key))
+ return true;
+
+ return m_key2kana->can_append (key);
+}
+
+bool
+Reading::process_key_event (const KeyEvent & key)
+{
+ if (!can_process_key_event (key))
+ return false;
+
+ if (m_caret_offset != 0) {
+ split_segment (m_segment_pos);
+ reset_pending ();
+ }
+
+ bool was_pending;
+ if (m_kana.can_append (key))
+ was_pending = m_kana.is_pending ();
+ else
+ was_pending = m_key2kana->is_pending ();
+
+ String raw;
+ WideString result, pending;
+ bool need_commiting;
+ if (m_kana.can_append (key))
+ need_commiting = m_kana.append (key, result, pending, raw);
+ else
+ need_commiting = m_key2kana->append (key, result, pending, raw);
+
+ ReadingSegments::iterator begin = m_segments.begin ();
+
+ // fix previous segment and prepare next segment if needed
+ if (!result.empty () || !pending.empty ()) {
+ if (!was_pending || // previous segment was already fixed
+ need_commiting) // previous segment has been fixed
+ {
+ ReadingSegment c;
+ m_segments.insert (begin + m_segment_pos, c);
+ m_segment_pos++;
+ }
+ }
+
+ // fill segment
+ if (result.length() > 0 && pending.length () > 0) {
+ m_segments[m_segment_pos - 1].kana = result;
+
+ ReadingSegment c;
+ c.raw += raw;
+ c.kana = pending;
+ m_segments.insert (begin + m_segment_pos, c);
+ m_segment_pos++;
+
+ } else if (result.length () > 0) {
+ m_segments[m_segment_pos - 1].raw += raw;
+ m_segments[m_segment_pos - 1].kana = result;
+
+ } else if (pending.length () > 0) {
+ m_segments[m_segment_pos - 1].raw += raw;
+ m_segments[m_segment_pos - 1].kana = pending;
+
+ } else {
+
+ }
+
+ return false;
+}
+
+void
+Reading::finish (void)
+{
+ if (!m_key2kana->is_pending ()) return;
+
+ WideString result;
+ result = m_key2kana->flush_pending ();
+ if (result.length () > 0)
+ m_segments[m_segment_pos - 1].kana = result;
+}
+
+void
+Reading::clear (void)
+{
+ m_key2kana_normal.clear ();
+ m_kana.clear ();
+ m_nicola.clear ();
+ m_segments.clear ();
+ m_segment_pos = 0;
+ m_caret_offset = 0;
+}
+
+WideString
+Reading::get (unsigned int start, int len, StringType type)
+{
+ WideString str;
+ unsigned int pos = 0, end = len > 0 ? start + len : get_length () - start;
+ WideString kana;
+ String raw;
+
+ if (start >= end)
+ return str;
+ if (start >= get_length ())
+ return str;
+
+ switch (type) {
+ case SCIM_ANTHY_STRING_LATIN:
+ raw = get_raw (start, len);
+ str = utf8_mbstowcs (raw);
+ return str;
+
+ case SCIM_ANTHY_STRING_WIDE_LATIN:
+ raw = get_raw (start, len);
+ util_convert_to_wide (str, raw);
+ return str;
+
+ default:
+ break;
+ }
+
+ for (unsigned int i = 0; i < m_segments.size (); i++) {
+ if (pos >= start || pos + m_segments[i].kana.length () > start) {
+ unsigned int startstart = 0, len;
+
+ if (pos >= start)
+ startstart = 0;
+ else
+ startstart = pos - start;
+
+ if (pos + m_segments[i].kana.length () > end)
+ len = end - start;
+ else
+ len = m_segments[i].kana.length ();
+
+ kana += m_segments[i].kana.substr (startstart, len);
+ }
+
+ pos += m_segments[i].kana.length ();
+ if (pos >= end)
+ break;
+ }
+
+ switch (type) {
+ case SCIM_ANTHY_STRING_HIRAGANA:
+ str = kana;
+ break;
+
+ case SCIM_ANTHY_STRING_KATAKANA:
+ util_convert_to_katakana (str, kana);
+ break;
+
+ case SCIM_ANTHY_STRING_HALF_KATAKANA:
+ util_convert_to_katakana (str, kana, true);
+ break;
+
+ default:
+ break;
+ }
+
+ return str;
+}
+
+String
+Reading::get_raw (unsigned int start, int len)
+{
+ String str;
+ unsigned int pos = 0, end = len > 0 ? start + len : get_length () - start;
+
+ if (start >= end)
+ return str;
+
+ for (unsigned int i = 0; i < m_segments.size (); i++) {
+ if (pos >= start || pos + m_segments[i].kana.length () > start) {
+ // FIXME!
+ str += m_segments[i].raw;
+ }
+
+ pos += m_segments[i].kana.length ();
+
+ if (pos >= end)
+ break;
+ }
+
+ return str;
+}
+
+void
+Reading::split_segment (unsigned int seg_id)
+{
+ if (seg_id >= m_segments.size ())
+ return;
+
+ unsigned int pos = 0;
+ for (unsigned int i = 0; i < seg_id && i < m_segments.size (); i++)
+ pos += m_segments[i].kana.length ();
+
+ unsigned int caret = get_caret_pos ();
+ unsigned int seg_len = m_segments[seg_id].kana.length ();
+ bool caret_was_in_the_segment = false;
+ if (caret > pos && caret < pos + seg_len)
+ caret_was_in_the_segment = true;
+
+ ReadingSegments segments;
+ m_segments[seg_id].split (segments);
+ m_segments.erase (m_segments.begin () + seg_id);
+ for (int j = segments.size () - 1; j >= 0; j--) {
+ m_segments.insert (m_segments.begin () + seg_id, segments[j]);
+ if (m_segment_pos > seg_id)
+ m_segment_pos++;
+ }
+
+ if (caret_was_in_the_segment) {
+ m_segment_pos += m_caret_offset;
+ m_caret_offset = 0;
+ }
+}
+
+bool
+Reading::append (const KeyEvent & key,
+ const String & string)
+{
+ bool was_pending;
+ WideString result, pending;
+ bool need_commiting;
+
+ if (!m_kana.can_append (key, true) &&
+ !m_key2kana->can_append (key, true))
+ return false;
+
+ if (m_caret_offset != 0) {
+ split_segment (m_segment_pos);
+ reset_pending ();
+ }
+
+ if (m_kana.can_append (key))
+ was_pending = m_kana.is_pending ();
+ else
+ was_pending = m_key2kana->is_pending ();
+
+ if (m_kana.can_append (key))
+ need_commiting = m_kana.append (string, result, pending);
+ else
+ need_commiting = m_key2kana->append (string, result, pending);
+
+ ReadingSegments::iterator begin = m_segments.begin ();
+
+ // fix previous segment and prepare next segment if needed
+ if (!result.empty () || !pending.empty ()) {
+ if (!was_pending || // previous segment was already fixed
+ need_commiting) // previous segment has been fixed
+ {
+ ReadingSegment c;
+ m_segments.insert (begin + m_segment_pos, c);
+ m_segment_pos++;
+ }
+ }
+
+ // fill segment
+ if (result.length() > 0 && pending.length () > 0) {
+ m_segments[m_segment_pos - 1].kana = result;
+
+ ReadingSegment c;
+ c.raw += string;
+ c.kana = pending;
+ m_segments.insert (begin + m_segment_pos, c);
+ m_segment_pos++;
+
+ } else if (result.length () > 0) {
+ m_segments[m_segment_pos - 1].raw += string;
+ m_segments[m_segment_pos - 1].kana = result;
+
+ } else if (pending.length () > 0) {
+ m_segments[m_segment_pos - 1].raw += string;
+ m_segments[m_segment_pos - 1].kana = pending;
+
+ } else {
+
+ }
+
+ return false;
+}
+
+void
+Reading::erase (unsigned int start, int len, bool allow_split)
+{
+ if (m_segments.size () <= 0)
+ return;
+
+ if (get_length () < start)
+ return;
+
+ if (len < 0)
+ len = get_length () - start;
+
+ // erase
+ unsigned int pos = 0;
+ for (int i = 0; i <= (int) m_segments.size (); i++) {
+ if (pos < start) {
+ // we have not yet reached start position.
+
+ if (i == (int) m_segments.size ())
+ break;
+
+ pos += m_segments[i].kana.length ();
+
+ } else if (pos == start) {
+ // we have reached start position.
+
+ if (i == (int) m_segments.size ())
+ break;
+
+ if (allow_split &&
+ pos + m_segments[i].kana.length () > start + len)
+ {
+ // we have overshooted the end position!
+ // we have to split this segment
+ split_segment (i);
+
+ } else {
+ // This segment is completely in the rage, erase it!
+ len -= m_segments[i].kana.length ();
+ m_segments.erase (m_segments.begin () + i);
+ if ((int) m_segment_pos > i)
+ m_segment_pos--;
+ }
+
+ // retry from the same position
+ i--;
+
+ } else {
+ // we have overshooted the start position!
+
+ if (allow_split) {
+ pos -= m_segments[i - 1].kana.length ();
+ split_segment (i - 1);
+
+ // retry from the previous position
+ i -= 2;
+
+ } else {
+ // we have overshooted the start position, but have not been
+ // allowed to split the segment.
+ // So remove all string of previous segment.
+ len -= pos - start;
+ pos -= m_segments[i - 1].kana.length ();
+ m_segments.erase (m_segments.begin () + i - 1);
+ if ((int) m_segment_pos > i - 1)
+ m_segment_pos--;
+
+ // retry from the previous position
+ i -= 2;
+ }
+ }
+
+ // Now all letters in the range are removed.
+ // Exit the loop.
+ if (len <= 0)
+ break;
+ }
+
+ // reset values
+ if (m_segments.size () <= 0) {
+ clear ();
+ } else {
+ reset_pending ();
+ }
+}
+
+void
+Reading::reset_pending (void)
+{
+ if (m_key2kana->is_pending ())
+ m_key2kana->clear ();
+ if (m_kana.is_pending ())
+ m_kana.clear ();
+
+ if (m_segment_pos <= 0)
+ return;
+
+ m_key2kana->reset_pending (m_segments[m_segment_pos - 1].kana,
+ m_segments[m_segment_pos - 1].raw);
+ m_kana.reset_pending (m_segments[m_segment_pos - 1].kana,
+ m_segments[m_segment_pos - 1].raw);
+
+ // FIXME! this code breaks pending state on normal input mode.
+ m_key2kana->reset_pseudo_ascii_mode();
+ for (unsigned int i = 0; i < m_segment_pos; i++)
+ m_key2kana->process_pseudo_ascii_mode(m_segments[i].kana);
+}
+
+unsigned int
+Reading::get_length (void)
+{
+ unsigned int len = 0;
+ for (unsigned int i = 0; i < m_segments.size (); i++)
+ len += m_segments[i].kana.length();
+ return len;
+}
+
+unsigned int
+Reading::get_caret_pos (void)
+{
+ unsigned int pos = 0;
+
+ for (unsigned int i = 0;
+ i < m_segment_pos && i < m_segments.size ();
+ i++)
+ {
+ pos += m_segments[i].kana.length();
+ }
+
+ pos += m_caret_offset;
+
+ return pos;
+}
+
+// FIXME! add "allow_split" argument.
+void
+Reading::set_caret_pos (unsigned int pos)
+{
+ if (pos == get_caret_pos ())
+ return;
+
+ m_key2kana->clear ();
+ m_kana.clear ();
+
+ if (pos >= get_length ()) {
+ m_segment_pos = m_segments.size ();
+
+ } else if (pos == 0 || m_segments.size () <= 0) {
+ m_segment_pos = 0;
+
+ } else {
+ unsigned int i, tmp_pos = 0;
+
+ for (i = 0; tmp_pos <= pos; i++)
+ tmp_pos += m_segments[i].kana.length();
+
+ if (tmp_pos == pos) {
+ m_segment_pos = i + 1;
+ } else if (tmp_pos < get_caret_pos ()) {
+ m_segment_pos = i;
+ } else if (tmp_pos > get_caret_pos ()) {
+ m_segment_pos = i + 1;
+ }
+ }
+
+ reset_pending ();
+}
+
+void
+Reading::move_caret (int step, bool allow_split)
+{
+ if (step == 0)
+ return;
+
+ m_key2kana->clear ();
+ m_kana.clear ();
+
+ if (allow_split) {
+ unsigned int pos = get_caret_pos ();
+ if (step < 0 && pos < (int) abs (step)) {
+ // lower limit
+ m_segment_pos = 0;
+
+ } else if (step > 0 && pos + step > get_length ()) {
+ // upper limit
+ m_segment_pos = m_segments.size ();
+
+ } else {
+ unsigned int new_pos = pos + step;
+ ReadingSegments::iterator it;
+ pos = 0;
+ m_segment_pos = 0;
+ m_caret_offset = 0;
+ for (it = m_segments.begin (); pos < new_pos; it++) {
+ if (pos + it->kana.length () > new_pos) {
+ m_caret_offset = new_pos - pos;
+ break;
+ } else {
+ m_segment_pos++;
+ pos += it->kana.length ();
+ }
+ }
+ }
+
+ } else {
+ if (step < 0 && m_segment_pos < (int) abs (step)) {
+ // lower limit
+ m_segment_pos = 0;
+
+ } else if (step > 0 && m_segment_pos + step > m_segments.size ()) {
+ // upper limit
+ m_segment_pos = m_segments.size ();
+
+ } else {
+ // other
+ m_segment_pos += step;
+ }
+ }
+
+ reset_pending ();
+}
+
+void
+Reading::set_typing_method (TypingMethod method)
+{
+ Key2KanaTable *fundamental_table = NULL;
+
+ if (method == SCIM_ANTHY_TYPING_METHOD_NICOLA) {
+ fundamental_table = m_anthy.get_factory()->m_custom_nicola_table;
+ m_key2kana = &m_nicola;
+ m_nicola_tables.set_typing_method (method, fundamental_table);
+ m_nicola.set_case_sensitive (true);
+ } else if (method == SCIM_ANTHY_TYPING_METHOD_KANA) {
+ fundamental_table = m_anthy.get_factory()->m_custom_kana_table;
+ m_key2kana = &m_key2kana_normal;
+ m_key2kana_tables.set_typing_method (method, fundamental_table);
+ m_key2kana_normal.set_case_sensitive (true);
+ } else {
+ fundamental_table = m_anthy.get_factory()->m_custom_romaji_table;
+ m_key2kana = &m_key2kana_normal;
+ m_key2kana_tables.set_typing_method (method, fundamental_table);
+ m_key2kana_normal.set_case_sensitive (false);
+ }
+}
+
+TypingMethod
+Reading::get_typing_method (void)
+{
+ if (m_key2kana == &m_nicola)
+ return SCIM_ANTHY_TYPING_METHOD_NICOLA;
+ else
+ return m_key2kana_tables.get_typing_method ();
+}
+
+void
+Reading::set_period_style (PeriodStyle style)
+{
+ m_key2kana_tables.set_period_style (style);
+}
+
+PeriodStyle
+Reading::get_period_style (void)
+{
+ return m_key2kana_tables.get_period_style ();
+}
+
+void
+Reading::set_comma_style (CommaStyle style)
+{
+ m_key2kana_tables.set_comma_style (style);
+}
+
+CommaStyle
+Reading::get_comma_style (void)
+{
+ return m_key2kana_tables.get_comma_style ();
+}
+
+void
+Reading::set_bracket_style (BracketStyle style)
+{
+ m_key2kana_tables.set_bracket_style (style);
+}
+
+BracketStyle
+Reading::get_bracket_style (void)
+{
+ return m_key2kana_tables.get_bracket_style ();
+}
+
+void
+Reading::set_slash_style (SlashStyle style)
+{
+ m_key2kana_tables.set_slash_style (style);
+}
+
+SlashStyle
+Reading::get_slash_style (void)
+{
+ return m_key2kana_tables.get_slash_style ();
+}
+
+void
+Reading::set_symbol_width (bool half)
+{
+ m_key2kana_tables.set_symbol_width (half);
+}
+
+bool
+Reading::get_symbol_width (void)
+{
+ return m_key2kana_tables.symbol_is_half ();
+}
+
+void
+Reading::set_number_width (bool half)
+{
+ m_key2kana_tables.set_number_width (half);
+}
+
+bool
+Reading::get_number_width (void)
+{
+ return m_key2kana_tables.number_is_half ();
+}
+
+void
+Reading::set_pseudo_ascii_mode (int mode)
+{
+ m_key2kana_normal.set_pseudo_ascii_mode (mode);
+}
+
+bool
+Reading::is_pseudo_ascii_mode (void)
+{
+ return m_key2kana_normal.is_pseudo_ascii_mode ();
+}
+
+void
+Reading::reset_pseudo_ascii_mode (void)
+{
+ if (m_key2kana_normal.is_pseudo_ascii_mode () &&
+ m_key2kana_normal.is_pending ())
+ {
+ ReadingSegment c;
+ ReadingSegments::iterator it = m_segments.begin ();
+
+ /* separate to another segment */
+ m_key2kana_normal.reset_pseudo_ascii_mode ();
+ m_segments.insert (it + m_segment_pos, c);
+ m_segment_pos++;
+ }
+}
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SCIM_ANTHY_READING_H__
+#define __SCIM_ANTHY_READING_H__
+
+#define Uses_SCIM_ICONV
+#define Uses_SCIM_EVENT
+#include <scim.h>
+#include "scim_anthy_key2kana.h"
+#include "scim_anthy_kana.h"
+#include "scim_anthy_nicola.h"
+
+using namespace scim;
+
+class AnthyInstance;
+
+namespace scim_anthy {
+
+typedef enum {
+ SCIM_ANTHY_STRING_LATIN,
+ SCIM_ANTHY_STRING_WIDE_LATIN,
+ SCIM_ANTHY_STRING_HIRAGANA,
+ SCIM_ANTHY_STRING_KATAKANA,
+ SCIM_ANTHY_STRING_HALF_KATAKANA,
+} StringType;
+
+class Reading;
+class ReadingSegment;
+typedef std::vector<ReadingSegment> ReadingSegments;
+
+class ReadingSegment
+{
+ friend class Reading;
+
+public:
+ ReadingSegment (void);
+ virtual ~ReadingSegment ();
+
+ const WideString & get (void) { return kana; }
+ const String & get_raw (void) { return raw; }
+
+ void split (ReadingSegments &segments);
+
+private:
+ String raw;
+ WideString kana;
+};
+
+class Reading
+{
+public:
+ Reading (AnthyInstance &anthy);
+ virtual ~Reading ();
+
+ bool can_process_key_event (const KeyEvent & key);
+ bool process_key_event (const KeyEvent & key);
+ void finish (void);
+ void clear (void);
+
+ WideString get (unsigned int start = 0,
+ int length = -1,
+ StringType type
+ = SCIM_ANTHY_STRING_HIRAGANA);
+ String get_raw (unsigned int start = 0,
+ int length = -1);
+ bool append (const KeyEvent & key,
+ const String & string);
+ void erase (unsigned int start = 0,
+ int length = -1,
+ bool allow_split = false);
+
+ unsigned int get_length (void);
+ unsigned int get_caret_pos (void);
+ void set_caret_pos (unsigned int pos);
+ void move_caret (int step,
+ bool allow_split = false);
+
+ void set_typing_method (TypingMethod method);
+ TypingMethod get_typing_method (void);
+ void set_period_style (PeriodStyle style);
+ PeriodStyle get_period_style (void);
+ void set_comma_style (CommaStyle style);
+ CommaStyle get_comma_style (void);
+ void set_bracket_style (BracketStyle style);
+ BracketStyle get_bracket_style (void);
+ void set_slash_style (SlashStyle style);
+ SlashStyle get_slash_style (void);
+ void set_symbol_width (bool half);
+ bool get_symbol_width (void);
+ void set_number_width (bool half);
+ bool get_number_width (void);
+ void set_pseudo_ascii_mode (int mode);
+ bool is_pseudo_ascii_mode (void);
+ void reset_pseudo_ascii_mode (void);
+
+private:
+ void reset_pending (void);
+ void split_segment (unsigned int seg_id);
+
+private:
+ AnthyInstance &m_anthy;
+
+ // tables
+ Key2KanaTableSet m_key2kana_tables;
+ Key2KanaTableSet m_nicola_tables;
+
+ // convertors
+ Key2KanaConvertor m_key2kana_normal;
+ KanaConvertor m_kana;
+ NicolaConvertor m_nicola;
+ Key2KanaConvertorBase *m_key2kana;
+
+ // state
+ ReadingSegments m_segments;
+ unsigned int m_segment_pos;
+ unsigned int m_caret_offset;
+};
+
+}
+
+#endif /* __SCIM_ANTHY_READING_H__ */
+/*
+vi:ts=4:nowrap:ai:expandtab
+*/
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004 Hiroyuki Ikezoe
+ * Copyright (C) 2004-2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * Based on scim-hangul.
+ * Copyright (c) 2004 James Su <suzhe@turbolinux.com.cn>
+ */
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#endif
+
+#include <string.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+
+#define Uses_SCIM_CONFIG_BASE
+#define Uses_SCIM_EVENT
+#define SCIM_ANTHY_USE_GTK
+#include <scim.h>
+#include <gtk/scimkeyselection.h>
+#include "scim_anthy_intl.h"
+#include "scim_anthy_style_file.h"
+#include "scim_anthy_prefs.h"
+#include "scim_anthy_default_tables.h"
+#include "scim_anthy_setup.h"
+#include "scim_anthy_setup_romaji.h"
+#include "scim_anthy_setup_kana.h"
+#include "scim_anthy_utils.h"
+#include "scim_anthy_color_button.h"
+
+using namespace scim;
+using namespace scim_anthy;
+
+#define scim_module_init anthy_imengine_setup_LTX_scim_module_init
+#define scim_module_exit anthy_imengine_setup_LTX_scim_module_exit
+
+#define scim_setup_module_create_ui anthy_imengine_setup_LTX_scim_setup_module_create_ui
+#define scim_setup_module_get_category anthy_imengine_setup_LTX_scim_setup_module_get_category
+#define scim_setup_module_get_name anthy_imengine_setup_LTX_scim_setup_module_get_name
+#define scim_setup_module_get_description anthy_imengine_setup_LTX_scim_setup_module_get_description
+#define scim_setup_module_load_config anthy_imengine_setup_LTX_scim_setup_module_load_config
+#define scim_setup_module_save_config anthy_imengine_setup_LTX_scim_setup_module_save_config
+#define scim_setup_module_query_changed anthy_imengine_setup_LTX_scim_setup_module_query_changed
+
+#define DATA_POINTER_KEY "scim-anthy::ConfigPointer"
+#define INDEX_KEY "scim-anthy::Index"
+
+namespace scim_anthy {
+
+static GtkWidget * create_setup_window (void);
+static void load_style_files (const char *dirname);
+static void load_config (const ConfigPointer &config);
+static void save_config (const ConfigPointer &config);
+static bool query_changed (void);
+
+//static StyleFiles __style_list;
+//static StyleFile __user_style_file;
+StyleFiles __style_list;
+StyleFile __user_style_file;
+const String __user_config_dir_name =
+ scim_get_home_dir () +
+ String (SCIM_PATH_DELIM_STRING
+ ".scim"
+ SCIM_PATH_DELIM_STRING
+ "Anthy");
+const String __user_style_dir_name =
+ __user_config_dir_name +
+ String (SCIM_PATH_DELIM_STRING
+ "style");
+const String __user_style_file_name =
+ __user_config_dir_name +
+ String (SCIM_PATH_DELIM_STRING
+ "config.sty");
+
+}
+
+// Module Interface.
+extern "C" {
+ void scim_module_init (void)
+ {
+ bindtextdomain (GETTEXT_PACKAGE, SCIM_ANTHY_LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ }
+
+ void scim_module_exit (void)
+ {
+ }
+
+ GtkWidget * scim_setup_module_create_ui (void)
+ {
+ return create_setup_window ();
+ }
+
+ String scim_setup_module_get_category (void)
+ {
+ return String ("IMEngine");
+ }
+
+ String scim_setup_module_get_name (void)
+ {
+ return String (_("Anthy"));
+ }
+
+ String scim_setup_module_get_description (void)
+ {
+ return String (_("An Anthy 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"
+
+
+
+namespace scim_anthy {
+
+// Internal data structure
+struct KeyboardConfigPage
+{
+ const char *label;
+ StringConfigData *data;
+};
+
+struct ComboConfigCandidate
+{
+ const char *label;
+ const char *data;
+};
+
+enum {
+ COLUMN_LABEL = 0,
+ COLUMN_VALUE = 1,
+ COLUMN_DESC = 2,
+ COLUMN_DATA = 3,
+ N_COLUMNS = 4,
+};
+
+// Internal data declaration.
+bool __config_changed = false;
+bool __style_changed = false;
+static GtkWidget * __widget_key_categories_menu = NULL;
+static GtkWidget * __widget_key_filter = NULL;
+static GtkWidget * __widget_key_filter_button = NULL;
+static GtkWidget * __widget_key_theme_menu = NULL;
+static GtkWidget * __widget_key_list_view = NULL;
+static GtkWidget * __widget_choose_keys_button = NULL;
+static GtkTooltips * __widget_tooltips = NULL;
+
+static String __config_key_theme = SCIM_ANTHY_CONFIG_KEY_THEME_DEFAULT;
+static String __config_key_theme_file = SCIM_ANTHY_CONFIG_KEY_THEME_FILE_DEFAULT;
+
+static struct KeyboardConfigPage __key_conf_pages[] =
+{
+ {N_("Mode keys"), config_keyboards_mode},
+ {N_("Edit keys"), config_keyboards_edit},
+ {N_("Caret keys"), config_keyboards_caret},
+ {N_("Segments keys"), config_keyboards_segments},
+ {N_("Candidates keys"), config_keyboards_candidates},
+ {N_("Direct select keys"), config_keyboards_direct_select},
+ {N_("Convert keys"), config_keyboards_converting},
+ {N_("Dictionary keys"), config_keyboards_dict},
+};
+static unsigned int __key_conf_pages_num = sizeof (__key_conf_pages) / sizeof (KeyboardConfigPage);
+
+const int KEY_CATEGORY_INDEX_SEARCH_BY_KEY = __key_conf_pages_num;
+const int KEY_CATEGORY_INDEX_ALL = __key_conf_pages_num + 1;
+
+const int KEY_THEME_INDEX_USER_DEFINED = 0;
+const int KEY_THEME_INDEX_DEFAULT = 1;
+
+static ComboConfigCandidate input_modes[] =
+{
+ {N_("Hiragana"), "Hiragana"},
+ {N_("Katakana"), "Katakana"},
+ {N_("Half width katakana"), "HalfKatakana"},
+ {N_("Latin"), "Latin"},
+ {N_("Wide latin"), "WideLatin"},
+ {NULL, NULL},
+};
+
+static ComboConfigCandidate typing_methods[] =
+{
+ {N_("Romaji typing method"), "Romaji"},
+ {N_("Kana typing method"), "Kana"},
+ {N_("Thumb shift typing method"), "NICOLA"},
+ {NULL, NULL},
+};
+
+static ComboConfigCandidate conversion_modes[] =
+{
+ {N_("Multi segment"), "MultiSeg"},
+ {N_("Single segment"), "SingleSeg"},
+ {N_("Convert as you type (Multi segment)"), "CAYT_MultiSeg"},
+ {N_("Convert as you type (Single segment)"), "CAYT_SingleSeg"},
+ {NULL, NULL},
+};
+
+static ComboConfigCandidate period_styles[] =
+{
+ {"\xE3\x80\x81\xE3\x80\x82", "Japanese"},
+ {"\xEF\xBC\x8C\xE3\x80\x82", "WideLatin_Japanese"},
+ {"\xEF\xBC\x8C\xEF\xBC\x8E", "WideLatin"},
+ {",.", "Latin"},
+ {NULL, NULL},
+};
+
+static ComboConfigCandidate symbol_styles[] =
+{
+ {"\xE3\x80\x8C\xE3\x80\x8D\xE3\x83\xBB", "Japanese"},
+ {"\xE3\x80\x8C\xE3\x80\x8D\xEF\xBC\x8F", "CornerBracket_WideSlash"},
+ {"\xEF\xBC\xBB\xEF\xBC\xBD\xE3\x83\xBB", "WideBracket_MiddleDot"},
+ {"\xEF\xBC\xBB\xEF\xBC\xBD\xEF\xBC\x8F", "WideBracket_WideSlash"},
+ {NULL, NULL},
+};
+
+static ComboConfigCandidate space_types[] =
+{
+ {N_("Follow input mode"), "FollowMode"},
+ {N_("Wide"), "Wide"},
+ {N_("Half"), "Half"},
+ {NULL, NULL},
+};
+
+static ComboConfigCandidate ten_key_types[] =
+{
+ {N_("Follow input mode"), "FollowMode"},
+ {N_("Wide"), "Wide"},
+ {N_("Half"), "Half"},
+ {NULL, NULL},
+};
+
+static ComboConfigCandidate behavior_on_period[] =
+{
+ {N_("Do nothing"), "None"},
+ {N_("Start conversion"), "Convert"},
+ {N_("Commit"), "Commit"},
+ {NULL, NULL},
+};
+
+static ComboConfigCandidate behavior_on_focus_out[] =
+{
+ {N_("Commit"), "Commit"},
+ {N_("Clear"), "Clear"},
+ {NULL, NULL},
+};
+
+static ComboConfigCandidate dict_encoding[] =
+{
+ {N_("UTF-8"), "UTF-8"},
+ {N_("EUC-JP"), "EUC-JP"},
+ {N_("EUC-JP-MS"), "EUC-JP-MS"},
+ {NULL, NULL},
+};
+
+static ComboConfigCandidate preedit_style[] =
+{
+ {N_("No decoration"), "None"},
+ {N_("Underline"), "Underline"},
+ {N_("Reverse"), "Reverse"},
+ {N_("Highlight"), "Highlight"},
+ {N_("String color"), "FGColor"},
+ {N_("BG color"), "BGColor"},
+ {N_("Both color"), "Color"},
+ {NULL, NULL},
+};
+
+
+static void setup_key_theme_menu (GtkOptionMenu *omenu);
+static void setup_widget_value (void);
+
+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_spin_button_changed (GtkSpinButton *spinbutton,
+ gpointer user_data);
+static void on_default_key_selection_clicked (GtkButton *button,
+ gpointer user_data);
+static void on_default_combo_changed (GtkEditable *editable,
+ gpointer user_data);
+static void on_default_option_menu_changed (GtkOptionMenu *omenu,
+ gpointer user_data);
+static void on_preedit_style_menu_changed (GtkOptionMenu *omenu,
+ gpointer user_data);
+static void on_key_filter_selection_clicked (GtkButton *button,
+ gpointer user_data);
+static void on_dict_menu_label_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data);
+static void on_key_category_menu_changed (GtkOptionMenu *omenu,
+ gpointer user_data);
+static gboolean on_key_list_view_key_press (GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer user_data);
+static gboolean on_key_list_view_button_press (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data);
+static void on_key_theme_menu_changed (GtkOptionMenu *omenu,
+ gpointer user_data);
+static void on_key_list_selection_changed (GtkTreeSelection *selection,
+ gpointer data);
+static void on_choose_keys_button_clicked (GtkWidget *button,
+ gpointer data);
+static void on_dict_launch_button_clicked (GtkButton *button,
+ gpointer user_data);
+static void on_color_button_changed (ScimAnthyColorButton *button,
+ gpointer user_data);
+
+
+static StringConfigData *
+find_key_config_entry (const char *config_key)
+{
+ for (unsigned int j = 0; j < __key_conf_pages_num; j++) {
+ for (unsigned int i = 0; __key_conf_pages[j].data[i].key; i++) {
+ StringConfigData *entry = &__key_conf_pages[j].data[i];
+ if (entry->key && !strcmp (entry->key, config_key))
+ return entry;
+ }
+ }
+
+ return NULL;
+}
+
+GtkWidget *
+create_check_button (const char *config_key)
+{
+ BoolConfigData *entry = find_bool_config_entry (config_key);
+ if (!entry)
+ return NULL;
+
+ entry->widget = gtk_check_button_new_with_mnemonic (_(entry->label));
+ gtk_container_set_border_width (GTK_CONTAINER (entry->widget), 4);
+ g_signal_connect (G_OBJECT (entry->widget), "toggled",
+ G_CALLBACK (on_default_toggle_button_toggled),
+ entry);
+ gtk_widget_show (GTK_WIDGET (entry->widget));
+
+ if (!__widget_tooltips)
+ __widget_tooltips = gtk_tooltips_new();
+ if (entry->tooltip)
+ gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget),
+ _(entry->tooltip), NULL);
+
+ return GTK_WIDGET (entry->widget);
+}
+
+GtkWidget *
+create_spin_button (const char *config_key, GtkTable *table, int idx)
+{
+ IntConfigData *entry = find_int_config_entry (config_key);
+ if (!entry)
+ return NULL;
+
+ GtkWidget *label = gtk_label_new_with_mnemonic (_(entry->label));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_misc_set_padding (GTK_MISC (label), 4, 0);
+ gtk_table_attach (GTK_TABLE (table), label, 0, 1, idx, idx + 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (GTK_FILL),
+ 4, 4);
+ gtk_widget_show (GTK_WIDGET (label));
+
+ GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
+ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (hbox),
+ 1, 2, idx, idx + 1,
+ (GtkAttachOptions) GTK_FILL,
+ (GtkAttachOptions) GTK_FILL,
+ 4, 4);
+ gtk_widget_show (hbox);
+
+ entry->widget = gtk_spin_button_new_with_range (entry->min, entry->max,
+ entry->step);
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label),
+ GTK_WIDGET (entry->widget));
+ gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (entry->widget),
+ FALSE, FALSE, 0);
+ g_signal_connect (G_OBJECT (entry->widget), "value-changed",
+ G_CALLBACK (on_default_spin_button_changed),
+ entry);
+ gtk_widget_show (GTK_WIDGET (entry->widget));
+
+ if (entry->unit) {
+ label = gtk_label_new_with_mnemonic (_(entry->unit));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_misc_set_padding (GTK_MISC (label), 4, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (label),
+ FALSE, FALSE, 0);
+ gtk_widget_show (GTK_WIDGET (label));
+ }
+
+ if (!__widget_tooltips)
+ __widget_tooltips = gtk_tooltips_new();
+ if (entry->tooltip)
+ gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget),
+ _(entry->tooltip), NULL);
+
+ return GTK_WIDGET (entry->widget);
+}
+
+GtkWidget *
+create_entry (const char *config_key, GtkTable *table, int idx)
+{
+ StringConfigData *entry = find_string_config_entry (config_key);
+ if (!entry)
+ return NULL;
+
+ GtkWidget *label = gtk_label_new (NULL);
+ gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _(entry->label));
+ gtk_widget_show (label);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_misc_set_padding (GTK_MISC (label), 4, 0);
+ gtk_table_attach (GTK_TABLE (table), label, 0, 1, idx, idx + 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (GTK_FILL), 4, 4);
+ (entry)->widget = gtk_entry_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label),
+ GTK_WIDGET (entry->widget));
+ g_signal_connect ((gpointer) (entry)->widget, "changed",
+ G_CALLBACK (on_default_editable_changed),
+ entry);
+ gtk_widget_show (GTK_WIDGET (entry->widget));
+ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (entry->widget),
+ 1, 2, idx, idx + 1,
+ (GtkAttachOptions) (GTK_FILL|GTK_EXPAND),
+ (GtkAttachOptions) (GTK_FILL), 4, 4);
+
+ if (!__widget_tooltips)
+ __widget_tooltips = gtk_tooltips_new();
+ if (entry->tooltip)
+ gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget),
+ _(entry->tooltip), NULL);
+
+ return GTK_WIDGET (entry->widget);
+}
+
+GtkWidget *
+create_combo (const char *config_key, gpointer candidates_p,
+ GtkTable *table, gint idx)
+{
+ StringConfigData *entry = find_string_config_entry (config_key);
+ if (!entry)
+ return NULL;
+
+ GtkWidget *label;
+
+ label = gtk_label_new_with_mnemonic (_(entry->label));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_misc_set_padding (GTK_MISC (label), 4, 0);
+ gtk_table_attach (GTK_TABLE (table), label, 0, 1, idx, idx + 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (GTK_FILL), 4, 4);
+ gtk_widget_show (label);
+
+ entry->widget = gtk_combo_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label),
+ GTK_COMBO (entry->widget)->entry);
+ gtk_combo_set_value_in_list (GTK_COMBO (entry->widget), TRUE, FALSE);
+ gtk_combo_set_case_sensitive (GTK_COMBO (entry->widget), TRUE);
+ gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (entry->widget)->entry),
+ FALSE);
+ gtk_widget_show (GTK_WIDGET (entry->widget));
+ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (entry->widget),
+ 1, 2, idx, idx + 1,
+ (GtkAttachOptions) (GTK_FILL|GTK_EXPAND),
+ (GtkAttachOptions) (GTK_FILL), 4, 4);
+ g_object_set_data (G_OBJECT (GTK_COMBO (entry->widget)->entry),
+ DATA_POINTER_KEY,
+ (gpointer) candidates_p);
+
+ g_signal_connect ((gpointer) GTK_COMBO (entry->widget)->entry, "changed",
+ G_CALLBACK (on_default_combo_changed),
+ entry);
+
+ if (!__widget_tooltips)
+ __widget_tooltips = gtk_tooltips_new();
+ if (entry->tooltip)
+ gtk_tooltips_set_tip (__widget_tooltips,
+ GTK_WIDGET (GTK_COMBO (entry->widget)->entry),
+ _(entry->tooltip), NULL);
+
+ return GTK_WIDGET (entry->widget);
+}
+
+GtkWidget *
+create_option_menu (const char *config_key, gpointer candidates_p,
+ GtkTable *table, gint idx)
+{
+ StringConfigData *entry = find_string_config_entry (config_key);
+ ComboConfigCandidate *data = static_cast<ComboConfigCandidate*> (candidates_p);
+ if (!entry)
+ return NULL;
+
+ GtkWidget *label;
+ label = gtk_label_new_with_mnemonic (_(entry->label));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_misc_set_padding (GTK_MISC (label), 4, 0);
+ gtk_table_attach (GTK_TABLE (table), label, 0, 1, idx, idx + 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (GTK_FILL), 4, 4);
+ gtk_widget_show (label);
+
+ entry->widget = gtk_option_menu_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label),
+ GTK_WIDGET (entry->widget));
+ gtk_widget_show (GTK_WIDGET (entry->widget));
+ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (entry->widget),
+ 1, 2, idx, idx + 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (GTK_FILL), 4, 4);
+ g_object_set_data (G_OBJECT (entry->widget),
+ DATA_POINTER_KEY,
+ (gpointer) candidates_p);
+
+ GtkWidget *menu = gtk_menu_new ();
+ gtk_option_menu_set_menu (GTK_OPTION_MENU (entry->widget), menu);
+ gtk_widget_show (menu);
+
+ for (unsigned int i = 0; data[i].label; i++) {
+ GtkWidget *menuitem = gtk_menu_item_new_with_label (_(data[i].label));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ gtk_widget_show (menuitem);
+ }
+
+ gtk_option_menu_set_history (GTK_OPTION_MENU (entry->widget), 0);
+
+ g_signal_connect ((gpointer) GTK_OPTION_MENU (entry->widget), "changed",
+ G_CALLBACK (on_default_option_menu_changed),
+ entry);
+
+ if (!__widget_tooltips)
+ __widget_tooltips = gtk_tooltips_new();
+ if (entry->tooltip)
+ gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget),
+ _(entry->tooltip), NULL);
+
+ return GTK_WIDGET (entry->widget);
+}
+
+GtkWidget *
+create_key_select_button (const char *config_key, GtkTable *table, int idx)
+{
+ StringConfigData *entry = find_string_config_entry (config_key);
+ if (!entry)
+ return NULL;
+
+ GtkWidget *button = gtk_button_new_with_label ("...");
+ gtk_widget_show (button);
+ gtk_table_attach (GTK_TABLE (table), button, 2, 3, idx, idx + 1,
+ GTK_FILL, GTK_FILL, 4, 4);
+ g_signal_connect ((gpointer) button, "clicked",
+ G_CALLBACK (on_default_key_selection_clicked),
+ entry);
+
+ return button;
+}
+
+GtkWidget *
+create_color_button (const char *config_key)
+{
+ ColorConfigData *entry = find_color_config_entry (config_key);
+ if (!entry)
+ return NULL;
+
+ GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
+ 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_anthy_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 (!__widget_tooltips)
+ __widget_tooltips = gtk_tooltips_new();
+ if (entry->tooltip)
+ gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget),
+ _(entry->tooltip), NULL);
+
+ return hbox;
+}
+
+static void
+append_key_bindings (GtkTreeView *treeview, gint idx, const gchar *filter)
+{
+ GtkListStore *store = GTK_LIST_STORE (gtk_tree_view_get_model (treeview));
+ KeyEventList keys1, keys2;
+
+ if (filter && *filter)
+ scim_string_to_key_list (keys1, filter);
+
+ if (idx < 0 || idx >= (gint) __key_conf_pages_num)
+ return;
+
+ for (unsigned int i = 0; __key_conf_pages[idx].data[i].key; i++) {
+ if (filter && *filter) {
+ scim_string_to_key_list (
+ keys2,
+ __key_conf_pages[idx].data[i].value.c_str());
+ KeyEventList::const_iterator kit;
+ bool found = true;
+ for (kit = keys1.begin (); kit != keys1.end (); kit++) {
+ if (!util_match_key_event (keys2, *kit)) {
+ found = false;
+ break;
+ }
+ }
+ if (!found)
+ continue;
+ }
+
+ GtkTreeIter iter;
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (
+ store, &iter,
+ COLUMN_LABEL, _(__key_conf_pages[idx].data[i].label),
+ COLUMN_VALUE, __key_conf_pages[idx].data[i].value.c_str (),
+ COLUMN_DESC, _(__key_conf_pages[idx].data[i].tooltip),
+ COLUMN_DATA, &__key_conf_pages[idx].data[i],
+ -1);
+ }
+}
+
+static void
+key_list_view_popup_key_selection (GtkTreeView *treeview)
+{
+ GtkTreeModel *model = gtk_tree_view_get_model (treeview);
+ GtkTreePath *treepath = NULL;
+ GtkTreeIter iter;
+
+ gtk_tree_view_get_cursor (treeview, &treepath, NULL);
+ if (!treepath) return;
+ gtk_tree_model_get_iter (model, &iter, treepath);
+ gtk_tree_path_free (treepath);
+
+ StringConfigData *data;
+ gtk_tree_model_get (model, &iter,
+ COLUMN_DATA, &data,
+ -1);
+ if (data) {
+ GtkWidget *dialog = scim_key_selection_dialog_new (_(data->title));
+ gint result;
+
+ scim_key_selection_dialog_set_keys
+ (SCIM_KEY_SELECTION_DIALOG (dialog),
+ data->value.c_str());
+
+ 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, data->value.c_str())) {
+ data->value = keys;
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+ COLUMN_VALUE, data->value.c_str(),
+ -1);
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_key_theme_menu),
+ KEY_THEME_INDEX_USER_DEFINED);
+ data->changed = true;
+ __config_changed = true;
+ }
+ }
+
+ gtk_widget_destroy (dialog);
+ }
+}
+
+static GtkWidget *
+create_common_page (void)
+{
+ GtkWidget *vbox, *table, *widget;
+
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox);
+
+ table = gtk_table_new (7, 2, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
+ gtk_widget_show (table);
+
+ /* input mode */
+ widget = create_combo (SCIM_ANTHY_CONFIG_INPUT_MODE,
+ (gpointer) &input_modes,
+ GTK_TABLE (table), 0);
+
+ /* typing method */
+ widget = create_combo (SCIM_ANTHY_CONFIG_TYPING_METHOD,
+ (gpointer) &typing_methods,
+ GTK_TABLE (table), 1);
+
+ /* conversion mode */
+ widget = create_combo (SCIM_ANTHY_CONFIG_CONVERSION_MODE,
+ (gpointer) &conversion_modes,
+ GTK_TABLE (table), 2);
+
+ /* behavior on focus out */
+ widget = create_combo (SCIM_ANTHY_CONFIG_BEHAVIOR_ON_FOCUS_OUT,
+ (gpointer) &behavior_on_focus_out,
+ GTK_TABLE (table), 3);
+
+ return vbox;
+}
+
+static GtkWidget *
+create_symbols_page (void)
+{
+ GtkWidget *vbox, *table, *widget;
+
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox);
+
+ table = gtk_table_new (7, 2, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
+ gtk_widget_show (table);
+
+ /* period style */
+ widget = create_combo (SCIM_ANTHY_CONFIG_PERIOD_STYLE,
+ (gpointer) &period_styles,
+ GTK_TABLE (table), 3);
+
+ /* symbol style */
+ widget = create_combo (SCIM_ANTHY_CONFIG_SYMBOL_STYLE,
+ (gpointer) &symbol_styles,
+ GTK_TABLE (table), 4);
+
+ /* space_style */
+ widget = create_combo (SCIM_ANTHY_CONFIG_SPACE_TYPE,
+ (gpointer) &space_types,
+ GTK_TABLE (table), 5);
+
+ /* ten key_style */
+ widget = create_combo (SCIM_ANTHY_CONFIG_TEN_KEY_TYPE,
+ (gpointer) &ten_key_types,
+ GTK_TABLE (table), 6);
+
+ /* behavior on period */
+ widget = create_combo (SCIM_ANTHY_CONFIG_BEHAVIOR_ON_PERIOD,
+ (gpointer) &behavior_on_period,
+ GTK_TABLE (table), 7);
+
+ return vbox;
+}
+
+static GtkWidget *
+create_keyboard_page (void)
+{
+ GtkWidget *vbox, *hbox;
+
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox);
+
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show(hbox);
+
+ // category menu
+ GtkWidget *label = gtk_label_new_with_mnemonic (_("_Group:"));
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show (label);
+
+ GtkWidget *omenu = gtk_option_menu_new ();
+ __widget_key_categories_menu = omenu;
+ gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2);
+ gtk_widget_show (omenu);
+
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), omenu);
+
+ GtkWidget *menu = gtk_menu_new ();
+
+ GtkWidget *menuitem;
+
+ for (unsigned int i = 0; i < __key_conf_pages_num; i++) {
+ menuitem = gtk_menu_item_new_with_label (_(__key_conf_pages[i].label));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ gtk_widget_show (menuitem);
+ }
+
+ menuitem = gtk_menu_item_new_with_label (_("Search by key"));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_menu_item_new_with_label (_("all"));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ gtk_widget_show (menuitem);
+
+ gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu);
+ gtk_widget_show (menu);
+
+ GtkWidget *entry = gtk_entry_new ();
+ __widget_key_filter = entry;
+ gtk_entry_set_editable (GTK_ENTRY (entry), FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 2);
+ gtk_widget_show(entry);
+
+ GtkWidget *button = gtk_button_new_with_label ("...");
+ __widget_key_filter_button = button;
+ g_signal_connect (G_OBJECT (button), "clicked",
+ G_CALLBACK (on_key_filter_selection_clicked), entry);
+ gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 2);
+ gtk_widget_show (button);
+
+ // key bindings view
+ GtkWidget *scrwin = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrwin),
+ GTK_SHADOW_IN);
+ gtk_container_set_border_width (GTK_CONTAINER (scrwin), 4);
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrwin),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_box_pack_start (GTK_BOX (vbox), scrwin, TRUE, TRUE, 2);
+ gtk_widget_show (scrwin);
+
+ GtkListStore *store = gtk_list_store_new (N_COLUMNS,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_POINTER);
+ GtkWidget *treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
+ __widget_key_list_view = treeview;
+ gtk_container_add (GTK_CONTAINER (scrwin), treeview);
+ gtk_widget_show (treeview);
+
+ GtkCellRenderer *cell;
+ GtkTreeViewColumn *column;
+ cell = gtk_cell_renderer_text_new ();
+ column = gtk_tree_view_column_new_with_attributes (_("Feature"), cell,
+ "text", COLUMN_LABEL,
+ NULL);
+ gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
+ gtk_tree_view_column_set_fixed_width (column, 120);
+ gtk_tree_view_column_set_resizable(column, TRUE);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
+
+ cell = gtk_cell_renderer_text_new ();
+ column = gtk_tree_view_column_new_with_attributes (_("Key bindings"), cell,
+ "text", COLUMN_VALUE,
+ NULL);
+ gtk_tree_view_column_set_fixed_width (column, 200);
+ gtk_tree_view_column_set_resizable(column, TRUE);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
+
+ cell = gtk_cell_renderer_text_new ();
+ column = gtk_tree_view_column_new_with_attributes (_("Description"), cell,
+ "text", COLUMN_DESC,
+ NULL);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
+
+ GtkTreeSelection *selection;
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
+
+ // connect signals
+ g_signal_connect (G_OBJECT (omenu), "changed",
+ G_CALLBACK (on_key_category_menu_changed), treeview);
+ g_signal_connect (G_OBJECT (treeview), "key-press-event",
+ G_CALLBACK (on_key_list_view_key_press), treeview);
+ g_signal_connect (G_OBJECT (treeview), "button-press-event",
+ G_CALLBACK (on_key_list_view_button_press), treeview);
+ g_signal_connect (G_OBJECT (selection), "changed",
+ G_CALLBACK (on_key_list_selection_changed), treeview);
+
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show(hbox);
+
+ // for key bind theme
+ label = gtk_label_new_with_mnemonic (_("Key bindings _theme:"));
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show (label);
+
+ omenu = gtk_option_menu_new ();
+ __widget_key_theme_menu = omenu;
+ g_signal_connect (G_OBJECT (omenu), "changed",
+ G_CALLBACK (on_key_theme_menu_changed), NULL);
+ gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2);
+ gtk_widget_show (omenu);
+
+ gtk_label_set_mnemonic_widget (GTK_LABEL(label), omenu);
+
+ // edit button
+ button = gtk_button_new_with_mnemonic (_("_Choose keys..."));
+ __widget_choose_keys_button = button;
+ g_signal_connect (G_OBJECT (button), "clicked",
+ G_CALLBACK (on_choose_keys_button_clicked), treeview);
+ gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 2);
+ gtk_widget_set_sensitive (button, false);
+ gtk_widget_show (button);
+
+ // clean
+ g_object_unref (G_OBJECT (store));
+
+ return vbox;
+}
+
+static GtkWidget *
+create_learning_page ()
+{
+ GtkWidget *vbox, *vbox2, *hbox, *alignment, *table;
+ GtkWidget *widget, *label;
+
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox);
+
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
+ gtk_widget_show (hbox);
+
+ label = gtk_label_new (_("<b>Enable/Disable learning</b>"));
+ gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 4);
+ gtk_widget_show (label);
+
+ alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 24, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
+ gtk_widget_show (alignment);
+
+ vbox2 = gtk_vbox_new (FALSE, 0);
+ gtk_container_add (GTK_CONTAINER (alignment), vbox2);
+ gtk_widget_show (vbox2);
+
+ /* maual commit */
+ widget = create_check_button (SCIM_ANTHY_CONFIG_LEARN_ON_MANUAL_COMMIT);
+ gtk_box_pack_start (GTK_BOX (vbox2), widget, FALSE, FALSE, 4);
+
+ /* auto commit */
+ widget = create_check_button (SCIM_ANTHY_CONFIG_LEARN_ON_AUTO_COMMIT);
+ gtk_box_pack_start (GTK_BOX (vbox2), widget, FALSE, FALSE, 4);
+
+ /* key preference */
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
+ gtk_widget_show (hbox);
+
+ label = gtk_label_new (_("<b>Key preferences to commit "
+ "with reversing learning preference</b>"));
+ gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 4);
+ gtk_widget_show (label);
+
+ alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 24, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
+ gtk_widget_show (alignment);
+
+ table = gtk_table_new (3, 3, FALSE);
+ gtk_container_add (GTK_CONTAINER (alignment), table);
+ gtk_widget_show (table);
+
+ StringConfigData *entries[3];
+ entries [0] = find_string_config_entry (
+ SCIM_ANTHY_CONFIG_COMMIT_REVERSE_LEARN_KEY);
+ entries [1] = find_string_config_entry (
+ SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_REVERSE_LEARN_KEY);
+ entries [2] = find_string_config_entry (
+ SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_REVERSE_LEARN_KEY);
+
+ for (unsigned int i = 0;
+ i < sizeof (entries) / sizeof (StringConfigData*);
+ i++)
+ {
+ StringConfigData *entry = entries[i];
+ widget = create_entry (entry->key, GTK_TABLE (table), i);
+ gtk_entry_set_editable (GTK_ENTRY (widget), FALSE);
+ create_key_select_button (entry->key, GTK_TABLE (table), i);
+ }
+
+ return vbox;
+}
+
+static GtkWidget *
+create_prediction_page ()
+{
+ GtkWidget *vbox, *widget;
+
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox);
+
+ /* predict while inputting */
+ widget = create_check_button (SCIM_ANTHY_CONFIG_PREDICT_ON_INPUT);
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 4);
+
+ /* use direct select keys */
+ widget = create_check_button (SCIM_ANTHY_CONFIG_USE_DIRECT_KEY_ON_PREDICT);
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 4);
+
+ return vbox;
+}
+
+static GtkWidget *
+create_dict_page (void)
+{
+ GtkWidget *table, *button;
+ StringConfigData *entry;
+
+ table = gtk_table_new (3, 3, FALSE);
+ gtk_widget_show (table);
+
+ // encoding of dictionary
+ create_combo (SCIM_ANTHY_CONFIG_DICT_ENCODING,
+ (gpointer) &dict_encoding,
+ GTK_TABLE (table), 0);
+
+ // dict admin command
+ create_entry (SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND,
+ GTK_TABLE (table), 1);
+ entry = find_string_config_entry (SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND);
+
+ button = gtk_button_new_with_mnemonic (_("_Launch"));
+ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (button),
+ 2, 3, 1, 2,
+ (GtkAttachOptions) 0,
+ (GtkAttachOptions) 0, 4, 4);
+ g_signal_connect (G_OBJECT (button), "clicked",
+ G_CALLBACK (on_dict_launch_button_clicked), entry);
+ gtk_widget_show (button);
+
+ // add word command
+ create_entry (SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND,
+ GTK_TABLE (table), 2);
+ entry = find_string_config_entry (SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND);
+
+ button = gtk_button_new_with_mnemonic (_("_Launch"));
+ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (button),
+ 2, 3, 2, 3,
+ (GtkAttachOptions) 0,
+ (GtkAttachOptions) 0, 4, 4);
+ g_signal_connect (G_OBJECT (button), "clicked",
+ G_CALLBACK (on_dict_launch_button_clicked), entry);
+ gtk_widget_show (button);
+
+ return table;
+}
+
+static GtkWidget *
+create_candidates_window_page (void)
+{
+ GtkWidget *vbox, *widget, *table;
+
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox);
+
+ /* show candidates label */
+ widget = create_check_button (SCIM_ANTHY_CONFIG_SHOW_CANDIDATES_LABEL);
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 2);
+
+ /* close candidate window on select */
+ widget = create_check_button (SCIM_ANTHY_CONFIG_CLOSE_CAND_WIN_ON_SELECT);
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 2);
+
+ table = gtk_table_new (2, 2, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
+ gtk_widget_show (table);
+
+ /* number of triggers until show candidates window */
+ create_spin_button (SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE,
+ GTK_TABLE (table), 0);
+
+ /* number of triggers until show candidates window */
+ create_spin_button (SCIM_ANTHY_CONFIG_N_TRIGGERS_TO_SHOW_CAND_WIN,
+ GTK_TABLE (table), 1);
+
+ return vbox;
+}
+
+static GtkWidget *
+create_toolbar_page (void)
+{
+ GtkWidget *vbox, *hbox, *label, *widget;
+
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox);
+
+ /* show/hide toolbar label */
+ widget = create_check_button (SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL);
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 2);
+
+ widget = create_check_button (SCIM_ANTHY_CONFIG_SHOW_TYPING_METHOD_LABEL);
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 2);
+
+ widget = create_check_button (SCIM_ANTHY_CONFIG_SHOW_CONVERSION_MODE_LABEL);
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 2);
+
+ widget = create_check_button (SCIM_ANTHY_CONFIG_SHOW_PERIOD_STYLE_LABEL);
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 2);
+
+ widget = create_check_button (SCIM_ANTHY_CONFIG_SHOW_SYMBOL_STYLE_LABEL);
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 2);
+
+ /* dictionary menu */
+ widget = create_check_button (SCIM_ANTHY_CONFIG_SHOW_DICT_LABEL);
+ g_signal_connect ((gpointer) widget, "toggled",
+ G_CALLBACK (on_dict_menu_label_toggled),
+ NULL);
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 2);
+
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 2);
+ gtk_widget_show (hbox);
+ label = gtk_label_new (" ");
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+
+ gtk_widget_show (label);
+ widget = create_check_button (SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL);
+ gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
+
+ gtk_widget_show (label);
+ widget = create_check_button (SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL);
+ gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
+
+ // set initial state
+ on_dict_menu_label_toggled (GTK_TOGGLE_BUTTON (widget), NULL);
+
+ return vbox;
+}
+
+static GtkWidget *
+create_appearance_page (void)
+{
+ GtkWidget *vbox, *table, *omenu, *widget, *hbox;
+
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox);
+
+ table = gtk_table_new (2, 3, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
+ gtk_widget_show (table);
+
+ /* preedit style */
+ omenu = create_option_menu (SCIM_ANTHY_CONFIG_PREEDIT_STYLE,
+ &preedit_style, GTK_TABLE (table), 0);
+
+ /* preedit color */
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (hbox);
+ widget = create_color_button (SCIM_ANTHY_CONFIG_PREEDIT_FG_COLOR);
+ gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
+ gtk_table_attach (GTK_TABLE (table), hbox, 2, 3, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (GTK_FILL), 4, 4);
+ gtk_widget_set_sensitive (hbox, FALSE);
+
+ g_signal_connect ((gpointer) GTK_OPTION_MENU (omenu), "changed",
+ G_CALLBACK (on_preedit_style_menu_changed), hbox);
+
+ /* conversion style */
+ omenu = create_option_menu (SCIM_ANTHY_CONFIG_CONVERSION_STYLE,
+ &preedit_style, GTK_TABLE (table), 1);
+
+ /* conversion color */
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (hbox);
+ widget = create_color_button (SCIM_ANTHY_CONFIG_CONVERSION_FG_COLOR);
+ gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
+ gtk_table_attach (GTK_TABLE (table), hbox, 2, 3, 1, 2,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (GTK_FILL), 4, 4);
+ gtk_widget_set_sensitive (hbox, FALSE);
+
+ g_signal_connect ((gpointer) GTK_OPTION_MENU (omenu), "changed",
+ G_CALLBACK (on_preedit_style_menu_changed), hbox);
+
+ /* selected segment style */
+ omenu = create_option_menu (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE,
+ &preedit_style, GTK_TABLE (table), 2);
+
+ /* selected segment color */
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (hbox);
+ widget = create_color_button (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_FG_COLOR);
+ gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
+ gtk_table_attach (GTK_TABLE (table), hbox, 2, 3, 2, 3,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (GTK_FILL), 4, 4);
+ gtk_widget_set_sensitive (hbox, FALSE);
+
+ g_signal_connect ((gpointer) GTK_OPTION_MENU (omenu), "changed",
+ G_CALLBACK (on_preedit_style_menu_changed), hbox);
+
+ return vbox;
+}
+
+static GtkWidget *
+create_about_page ()
+{
+ GtkWidget *vbox, *label;
+ gchar str[256];
+
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox);
+
+ g_snprintf (
+ str, 256,
+ _("<span size=\"20000\">"
+ "%s-%s"
+ "</span>\n\n"
+
+ "<span size=\"16000\" style=\"italic\">"
+ "A Japanese input method module\nfor SCIM using Anthy"
+ "</span>\n\n\n\n"
+
+ "<span size=\"12000\">"
+ "Copyright 2005-2006, Takuro Ashie <ashie@homa.ne.jp>"
+ "</span>"),
+ PACKAGE, PACKAGE_VERSION);
+
+ label = gtk_label_new (NULL);
+ gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_CENTER);
+ gtk_label_set_markup (GTK_LABEL (label), str);
+ gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
+ gtk_widget_show (label);
+
+ return vbox;
+}
+
+static GtkWidget *
+create_setup_window (void)
+{
+ static GtkWidget *window = NULL;
+
+ if (!window) {
+ GtkWidget *notebook = gtk_notebook_new();
+ gtk_notebook_popup_enable(GTK_NOTEBOOK(notebook));
+ gtk_widget_show (notebook);
+ window = notebook;
+ gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE);
+
+ // Create the common page.
+ GtkWidget *page = create_common_page ();
+ GtkWidget *label = gtk_label_new (_("Common"));
+ gtk_widget_show (label);
+ gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
+
+ // Create the symbols page.
+ page = create_symbols_page ();
+ label = gtk_label_new (_("Symbols"));
+ gtk_widget_show (label);
+ gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
+
+ // Create the key bind page.
+ page = create_keyboard_page ();
+ label = gtk_label_new (_("Key bindings"));
+ gtk_widget_show (label);
+ gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
+
+ // Create the romaji page.
+ page = romaji_page_create_ui ();
+ label = gtk_label_new (_("Romaji typing"));
+ gtk_widget_show (label);
+ gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
+
+ // Create the kana page.
+ page = kana_page_create_ui ();
+ label = gtk_label_new (_("Kana typing"));
+ gtk_widget_show (label);
+ gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
+
+ // Create the learning page.
+ page = create_prediction_page ();
+ label = gtk_label_new (_("Prediction"));
+ gtk_widget_show (label);
+ gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
+
+ // Create the learning page.
+ page = create_learning_page ();
+ label = gtk_label_new (_("Learning"));
+ gtk_widget_show (label);
+ gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
+
+ // Create the dictionary page.
+ page = create_dict_page ();
+ label = gtk_label_new (_("Dictionary"));
+ gtk_widget_show (label);
+ gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
+
+ // Create the candidates widnow page.
+ page = create_candidates_window_page ();
+ label = gtk_label_new (_("Candidates window"));
+ gtk_widget_show (label);
+ gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
+
+ // Create the toolbar page.
+ page = create_toolbar_page ();
+ label = gtk_label_new (_("Toolbar"));
+ gtk_widget_show (label);
+ gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
+
+ // Create the appearance page.
+ page = create_appearance_page ();
+ label = gtk_label_new (_("Appearance"));
+ gtk_widget_show (label);
+ gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
+
+ // Create the appearance page.
+ page = create_about_page ();
+ label = gtk_label_new (_("About"));
+ gtk_widget_show (label);
+ gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
+
+ // for preventing enabling left arrow.
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 1);
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 0);
+
+ setup_widget_value ();
+ }
+
+ return window;
+}
+
+static void
+setup_combo_value (GtkCombo *combo, const String & str)
+{
+ GList *list = NULL;
+ const char *defval = NULL;
+
+ ComboConfigCandidate *data
+ = static_cast<ComboConfigCandidate*>
+ (g_object_get_data (G_OBJECT (GTK_COMBO(combo)->entry),
+ DATA_POINTER_KEY));
+
+ for (unsigned int i = 0; data[i].label; i++) {
+ list = g_list_append (list, (gpointer) _(data[i].label));
+ if (!strcmp (data[i].data, str.c_str ()))
+ defval = _(data[i].label);
+ }
+
+ gtk_combo_set_popdown_strings (combo, list);
+ g_list_free (list);
+
+ if (defval)
+ gtk_entry_set_text (GTK_ENTRY (combo->entry), defval);
+}
+
+static void
+setup_option_menu_value (GtkOptionMenu *omenu, const String & str)
+{
+ ComboConfigCandidate *data
+ = static_cast<ComboConfigCandidate*>
+ (g_object_get_data (G_OBJECT (omenu), DATA_POINTER_KEY));
+
+ for (unsigned int i = 0; data[i].label; i++) {
+ if (!strcmp (data[i].data, str.c_str ())) {
+ gtk_option_menu_set_history (omenu, i);
+ return;
+ }
+ }
+}
+
+static void
+setup_key_theme_menu (GtkOptionMenu *omenu)
+{
+ GtkWidget *menu = gtk_menu_new ();
+ gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu),
+ menu);
+ gtk_widget_show (menu);
+
+ // create menu items
+ GtkWidget *menuitem = gtk_menu_item_new_with_label (_("User defined"));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+
+ menuitem = gtk_menu_item_new_with_label (_("Default"));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ gtk_widget_show (menuitem);
+
+ StyleFiles::iterator it;
+ unsigned int i;
+ for (i = 0, it = __style_list.begin ();
+ it != __style_list.end ();
+ i++, it++)
+ {
+ const char *section_name = "KeyBindings";
+ StyleLines section;
+ if (!it->get_entry_list (section, section_name))
+ continue;
+
+ menuitem = gtk_menu_item_new_with_label (_(it->get_title().c_str()));
+ g_object_set_data (G_OBJECT (menuitem),
+ INDEX_KEY, GINT_TO_POINTER (i));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ gtk_widget_show (menuitem);
+ }
+
+ // set default value
+ g_signal_handlers_block_by_func (G_OBJECT (omenu),
+ (gpointer) (on_key_theme_menu_changed),
+ NULL);
+
+ gtk_option_menu_set_history (GTK_OPTION_MENU (omenu),
+ KEY_THEME_INDEX_DEFAULT);
+
+ if (__config_key_theme_file == __user_style_file.get_file_name () ||
+ __config_key_theme == __user_style_file.get_title ())
+ {
+ gtk_option_menu_set_history (GTK_OPTION_MENU (omenu),
+ KEY_THEME_INDEX_USER_DEFINED);
+
+ } else {
+ GList *node, *list = gtk_container_get_children (GTK_CONTAINER (menu));
+ for (i = 2, node = g_list_next (g_list_next (list));
+ node;
+ i++, node = g_list_next (node))
+ {
+ gint idx = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (node->data),
+ INDEX_KEY));
+ if (__style_list[idx].get_file_name () == __config_key_theme_file) {
+ gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), i);
+ break;
+ }
+ }
+ }
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (omenu),
+ (gpointer) (on_key_theme_menu_changed),
+ NULL);
+}
+
+static void
+setup_widget_value (void)
+{
+ for (unsigned int i = 0; config_bool_common[i].key; i++) {
+ BoolConfigData &entry = config_bool_common[i];
+ if (entry.widget)
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (entry.widget),
+ entry.value);
+ }
+
+ for (unsigned int i = 0; config_int_common[i].key; i++) {
+ IntConfigData &entry = config_int_common[i];
+ if (entry.widget)
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (entry.widget),
+ entry.value);
+ }
+
+ for (unsigned int i = 0; config_string_common[i].key; i++) {
+ StringConfigData &entry = config_string_common[i];
+ if (entry.widget && GTK_IS_OPTION_MENU (entry.widget)) {
+ setup_option_menu_value (GTK_OPTION_MENU (entry.widget),
+ entry.value);
+ } else if (entry.widget && GTK_IS_COMBO (entry.widget)) {
+ setup_combo_value (GTK_COMBO (entry.widget), entry.value);
+ } else if (entry.widget && GTK_IS_ENTRY (entry.widget)) {
+ gtk_entry_set_text (GTK_ENTRY (entry.widget),
+ entry.value.c_str ());
+ }
+ }
+
+ for (unsigned int j = 0; j < __key_conf_pages_num; j++) {
+ for (unsigned int i = 0; __key_conf_pages[j].data[i].key; i++) {
+ if (__key_conf_pages[j].data[i].widget) {
+ gtk_entry_set_text (
+ GTK_ENTRY (__key_conf_pages[j].data[i].widget),
+ __key_conf_pages[j].data[i].value.c_str ());
+ }
+ }
+ }
+
+ for (unsigned int i = 0; config_color_common[i].fg_key; i++) {
+ ColorConfigData &entry = config_color_common[i];
+ if (entry.widget) {
+ scim_anthy_color_button_set_colors (SCIM_ANTHY_COLOR_BUTTON (entry.widget),
+ entry.fg_value, entry.bg_value);
+ }
+ }
+
+ gtk_option_menu_set_history
+ (GTK_OPTION_MENU (__widget_key_categories_menu),
+ KEY_CATEGORY_INDEX_ALL);
+ GtkTreeView *treeview = GTK_TREE_VIEW (__widget_key_list_view);
+ GtkListStore *store = GTK_LIST_STORE (gtk_tree_view_get_model (treeview));
+ gtk_list_store_clear (store);
+ for (unsigned int i = 0; i < __key_conf_pages_num; i++)
+ append_key_bindings (treeview, i, NULL);
+ gtk_widget_set_sensitive (__widget_key_filter, FALSE);
+ gtk_widget_set_sensitive (__widget_key_filter_button, FALSE);
+
+ // setup option menu
+ setup_key_theme_menu (GTK_OPTION_MENU (__widget_key_theme_menu));
+}
+
+bool operator < (const StyleFile &left, const StyleFile &right)
+{
+ if (const_cast<StyleFile&>(left).get_title() <
+ const_cast<StyleFile&>(right).get_title())
+ {
+ return true;
+ }
+ return false;
+}
+
+bool operator > (const StyleFile &left, const StyleFile &right)
+{
+ if (const_cast<StyleFile&>(left).get_title() >
+ const_cast<StyleFile&>(right).get_title())
+ {
+ return true;
+ }
+ return false;
+}
+
+static void
+load_style_files (const char *dirname)
+{
+ GDir *dir;
+ GError *error = NULL;
+ const gchar *entry;
+
+ // load system wide style files
+ dir = g_dir_open (dirname, 0, &error);
+ if (error)
+ {
+ //g_warning ("%s", error->message);
+ g_error_free (error);
+ }
+
+ if (dir) {
+ while ((entry = g_dir_read_name (dir)))
+ {
+ String file = dirname;
+ file += SCIM_PATH_DELIM_STRING;
+ file += entry;
+
+ // FIXME! check duplicates
+ __style_list.push_back (StyleFile ());
+ StyleFile &style = __style_list.back ();
+ bool success = style.load (file.c_str ());
+ if (!success)
+ __style_list.pop_back ();
+ }
+ g_dir_close (dir);
+ }
+ std::sort(__style_list.begin(), __style_list.end());
+}
+
+static void
+load_config (const ConfigPointer &config)
+{
+ if (config.null ())
+ return;
+
+ __style_list.clear ();
+
+ load_style_files (SCIM_ANTHY_STYLEDIR);
+ load_style_files (__user_style_dir_name.c_str ());
+
+ __user_style_file.load (__user_style_file_name.c_str ());
+
+ __config_key_theme
+ = config->read (String (SCIM_ANTHY_CONFIG_KEY_THEME),
+ String (SCIM_ANTHY_CONFIG_KEY_THEME_DEFAULT));
+ __config_key_theme_file
+ = config->read (String (SCIM_ANTHY_CONFIG_KEY_THEME_FILE),
+ String (SCIM_ANTHY_CONFIG_KEY_THEME_FILE_DEFAULT));
+
+ for (unsigned int i = 0; config_bool_common[i].key; i++) {
+ BoolConfigData &entry = config_bool_common[i];
+ entry.value = config->read (String (entry.key), entry.value);
+ }
+
+ for (unsigned int i = 0; config_int_common[i].key; i++) {
+ IntConfigData &entry = config_int_common[i];
+ entry.value = config->read (String (entry.key), entry.value);
+ }
+
+ for (unsigned int i = 0; config_string_common[i].key; i++) {
+ StringConfigData &entry = config_string_common[i];
+ entry.value = config->read (String (entry.key), entry.value);
+ }
+
+ for (unsigned int j = 0; j < __key_conf_pages_num; j++) {
+ for (unsigned int i = 0; __key_conf_pages[j].data[i].key; i++) {
+ __key_conf_pages[j].data[i].value =
+ config->read (String (__key_conf_pages[j].data[i].key),
+ __key_conf_pages[j].data[i].value);
+ }
+ }
+
+ for (unsigned int i = 0; config_color_common[i].fg_key; i++) {
+ ColorConfigData &entry = config_color_common[i];
+ entry.fg_value = config->read (String (entry.fg_key), entry.fg_value);
+ entry.bg_value = config->read (String (entry.bg_key), entry.bg_value);
+ }
+
+ romaji_page_load_config (config);
+ kana_page_load_config (config);
+
+ setup_widget_value ();
+
+ for (unsigned int i = 0; config_bool_common[i].key; i++)
+ config_bool_common[i].changed = false;
+
+ for (unsigned int i = 0; config_int_common[i].key; i++)
+ config_int_common[i].changed = false;
+
+ for (unsigned int i = 0; config_string_common[i].key; i++)
+ config_string_common[i].changed = false;
+
+ for (unsigned int j = 0; j < __key_conf_pages_num; j++) {
+ for (unsigned int i = 0; __key_conf_pages[j].data[i].key; i++)
+ __key_conf_pages[j].data[i].changed = false;
+ }
+
+ for (unsigned int i = 0; config_color_common[i].fg_key; i++)
+ config_color_common[i].changed = false;
+
+ __config_changed = false;
+}
+
+static void
+save_config (const ConfigPointer &config)
+{
+ if (config.null ())
+ return;
+
+ __config_key_theme
+ = config->write (String (SCIM_ANTHY_CONFIG_KEY_THEME),
+ String (__config_key_theme));
+ __config_key_theme_file
+ = config->write (String (SCIM_ANTHY_CONFIG_KEY_THEME_FILE),
+ String (__config_key_theme_file));
+
+ for (unsigned int i = 0; config_bool_common[i].key; i++) {
+ BoolConfigData &entry = config_bool_common[i];
+ if (entry.changed)
+ entry.value = config->write (String (entry.key), entry.value);
+ entry.changed = false;
+ }
+
+ for (unsigned int i = 0; config_int_common[i].key; i++) {
+ IntConfigData &entry = config_int_common[i];
+ if (entry.changed)
+ entry.value = config->write (String (entry.key), entry.value);
+ entry.changed = false;
+ }
+
+ for (unsigned int i = 0; config_string_common[i].key; i++) {
+ StringConfigData &entry = config_string_common[i];
+ if (entry.changed)
+ entry.value = config->write (String (entry.key), entry.value);
+ entry.changed = false;
+ }
+
+ for (unsigned int j = 0; j < __key_conf_pages_num; j++) {
+ for (unsigned int i = 0; __key_conf_pages[j].data[i].key; i++) {
+ if (__key_conf_pages[j].data[i].changed)
+ config->write (String (__key_conf_pages[j].data[i].key),
+ String (__key_conf_pages[j].data[i].value));
+ __key_conf_pages[j].data[i].changed = false;
+ }
+ }
+
+ for (unsigned int i = 0; config_color_common[i].fg_key; i++) {
+ ColorConfigData &entry = config_color_common[i];
+ if (entry.changed) {
+ entry.fg_value = config->write (String (entry.fg_key),
+ entry.fg_value);
+ entry.bg_value = config->write (String (entry.bg_key),
+ entry.bg_value);
+ }
+ entry.changed = false;
+ }
+
+ __config_changed = false;
+
+ if (__style_changed) {
+ scim_make_dir (__user_config_dir_name);
+ __user_style_file.save (__user_style_file_name.c_str ());
+ __style_changed = false;
+ }
+
+ romaji_page_save_config (config);
+ kana_page_save_config (config);
+}
+
+static bool
+query_changed (void)
+{
+ return
+ __config_changed ||
+ __style_changed ||
+ romaji_page_query_changed () ||
+ kana_page_query_changed ();
+}
+
+
+static void
+on_default_toggle_button_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data)
+{
+ BoolConfigData *entry = static_cast<BoolConfigData*> (user_data);
+
+ if (entry) {
+ entry->value = gtk_toggle_button_get_active (togglebutton);
+ entry->changed = true;
+ __config_changed = true;
+ }
+}
+
+static void
+on_default_spin_button_changed (GtkSpinButton *spinbutton, gpointer user_data)
+{
+ IntConfigData *entry = static_cast<IntConfigData*> (user_data);
+
+ if (entry) {
+ entry->value = static_cast<int> (gtk_spin_button_get_value (spinbutton));
+ entry->changed = true;
+ __config_changed = true;
+ }
+}
+
+static void
+on_default_editable_changed (GtkEditable *editable,
+ gpointer user_data)
+{
+ StringConfigData *entry = static_cast <StringConfigData*> (user_data);
+
+ if (entry) {
+ entry->value = String (gtk_entry_get_text (GTK_ENTRY (editable)));
+ entry->changed = true;
+ __config_changed = true;
+ }
+}
+
+static void
+on_default_key_selection_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ StringConfigData *data = static_cast <StringConfigData*> (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->widget)));
+
+ 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->widget))))
+ gtk_entry_set_text (GTK_ENTRY (data->widget), keys);
+ }
+
+ gtk_widget_destroy (dialog);
+ }
+}
+
+static void
+on_default_combo_changed (GtkEditable *editable,
+ gpointer user_data)
+{
+ StringConfigData *entry = static_cast<StringConfigData*> (user_data);
+ ComboConfigCandidate *data = static_cast<ComboConfigCandidate*>
+ (g_object_get_data (G_OBJECT (editable),
+ DATA_POINTER_KEY));
+
+ if (!entry) return;
+ if (!data) return;
+
+ const char *label = gtk_entry_get_text (GTK_ENTRY (editable));
+
+ for (unsigned int i = 0; data[i].label; i++) {
+ if (label && !strcmp (_(data[i].label), label)) {
+ entry->value = data[i].data;
+ entry->changed = true;
+ __config_changed = true;
+ break;
+ }
+ }
+}
+
+static void
+on_default_option_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
+{
+ StringConfigData *entry = static_cast<StringConfigData*> (user_data);
+ ComboConfigCandidate *data = static_cast<ComboConfigCandidate*>
+ (g_object_get_data (G_OBJECT (omenu),
+ DATA_POINTER_KEY));
+
+ if (!entry) return;
+ if (!data) return;
+
+ for (int i = 0; data[i].label; i++) {
+ if (i == gtk_option_menu_get_history (omenu)) {
+ entry->value = data[i].data;
+ entry->changed = true;
+ __config_changed = true;
+ break;
+ }
+ }
+}
+
+static void
+on_preedit_style_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
+{
+ GtkWidget *widget = GTK_WIDGET (user_data);
+
+ gint idx = gtk_option_menu_get_history (omenu);
+
+ for (int i = 0; preedit_style[i].data && i <= idx; i++) {
+ if (i == idx &&
+ (!strcmp (preedit_style[i].data, "Color") ||
+ !strcmp (preedit_style[i].data, "FGColor") ||
+ !strcmp (preedit_style[i].data, "BGColor")))
+ {
+ gtk_widget_set_sensitive (widget, TRUE);
+ return;
+ }
+ }
+
+ gtk_widget_set_sensitive (widget, FALSE);
+}
+
+static void
+on_dict_menu_label_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data)
+{
+ bool active = gtk_toggle_button_get_active (togglebutton);
+
+ BoolConfigData *entry;
+ entry = find_bool_config_entry (SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL);
+ if (entry->widget)
+ gtk_widget_set_sensitive (GTK_WIDGET (entry->widget), active);
+ entry = find_bool_config_entry (SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL);
+ if (entry->widget)
+ gtk_widget_set_sensitive (GTK_WIDGET (entry->widget), active);
+}
+
+static void
+on_key_category_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
+{
+ GtkTreeView *treeview = GTK_TREE_VIEW (user_data);
+ GtkListStore *store = GTK_LIST_STORE (gtk_tree_view_get_model (treeview));
+
+ gtk_list_store_clear (store);
+
+ gint idx = gtk_option_menu_get_history (omenu);
+
+ bool use_filter = false;
+
+ if (idx >= 0 && idx < (gint) __key_conf_pages_num) {
+ append_key_bindings (treeview, idx, NULL);
+
+ } else if (idx == KEY_CATEGORY_INDEX_SEARCH_BY_KEY) {
+ // search by key
+ use_filter = true;
+ const char *str = gtk_entry_get_text (GTK_ENTRY (__widget_key_filter));
+ for (unsigned int i = 0; i < __key_conf_pages_num; i++)
+ append_key_bindings (treeview, i, str);
+
+ } else if (idx == KEY_CATEGORY_INDEX_ALL) {
+ // all
+ for (unsigned int i = 0; i < __key_conf_pages_num; i++)
+ append_key_bindings (treeview, i, NULL);
+ }
+
+ gtk_widget_set_sensitive (__widget_key_filter, use_filter);
+ gtk_widget_set_sensitive (__widget_key_filter_button, use_filter);
+}
+
+static void
+on_key_theme_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
+{
+ gint idx = gtk_option_menu_get_history (omenu);
+ GtkWidget *menu = gtk_option_menu_get_menu (omenu);
+ GList *list = gtk_container_get_children (GTK_CONTAINER (menu));
+ GtkWidget *menuitem = GTK_WIDGET (g_list_nth_data (list, idx));
+
+ if (!menuitem)
+ return;
+
+ gint theme_idx = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menuitem),
+ INDEX_KEY));
+
+ // clear all key bindings
+ if (idx != 0) {
+ for (unsigned int j = 0; j < __key_conf_pages_num; j++) {
+ for (unsigned int i = 0; __key_conf_pages[j].data[i].key; i++) {
+ __key_conf_pages[j].data[i].value = "";
+ __key_conf_pages[j].data[i].changed = true;
+ }
+ }
+ }
+
+ // set new key bindings
+ if (idx == KEY_THEME_INDEX_USER_DEFINED) {
+ __config_key_theme = String ("User defined");
+ __config_key_theme_file = String (""); //__user_style_file.get_file_name ();
+
+ } else if (idx == KEY_THEME_INDEX_DEFAULT) {
+ for (unsigned int j = 0; j < __key_conf_pages_num; j++) {
+ for (unsigned int i = 0; __key_conf_pages[j].data[i].key; i++) {
+ __key_conf_pages[j].data[i].value
+ = __key_conf_pages[j].data[i].default_value;
+ }
+ }
+ __config_key_theme = String ("Default");
+ __config_key_theme_file = String ("");
+
+ } else if (theme_idx >= 0) {
+ // reset key bindings
+ StyleLines lines;
+ StyleLines::iterator it;
+ __style_list[theme_idx].get_entry_list (lines, "KeyBindings");
+ for (it = lines.begin (); it != lines.end (); it++) {
+ if (it->get_type () != SCIM_ANTHY_STYLE_LINE_KEY)
+ continue;
+ String key, fullkey;
+ it->get_key (key);
+ fullkey = String ("/IMEngine/Anthy/") + key;
+ StringConfigData *entry = find_key_config_entry (fullkey.c_str ());
+ if (entry) {
+ it->get_value (entry->value);
+ entry->changed = true;
+ } else {
+ std::cerr << "No entry for : " << key << std::endl;
+ }
+ }
+ __config_key_theme = __style_list[theme_idx].get_title ();
+ __config_key_theme_file = __style_list[theme_idx].get_file_name ();
+ }
+
+ // sync widgets
+ if (idx != KEY_THEME_INDEX_USER_DEFINED) {
+ gtk_option_menu_set_history
+ (GTK_OPTION_MENU (__widget_key_categories_menu),
+ KEY_CATEGORY_INDEX_ALL);
+ gtk_widget_set_sensitive (__widget_key_filter, FALSE);
+ gtk_widget_set_sensitive (__widget_key_filter_button, FALSE);
+ GtkTreeModel *model;
+ model = gtk_tree_view_get_model (
+ GTK_TREE_VIEW (__widget_key_list_view));
+ gtk_list_store_clear (GTK_LIST_STORE (model));
+#if 0
+ append_key_bindings (GTK_TREE_VIEW (__widget_key_list_view),
+ KEY_CATEGORY_INDEX_ALL, NULL);
+#else
+ for (unsigned int i = 0; i < __key_conf_pages_num; i++)
+ append_key_bindings (GTK_TREE_VIEW (__widget_key_list_view),
+ i, NULL);
+#endif
+ }
+
+ __config_changed = true;
+}
+
+static void
+on_key_filter_selection_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ GtkEntry *entry = static_cast <GtkEntry*> (user_data);
+
+ if (entry) {
+ GtkWidget *dialog = scim_key_selection_dialog_new (_("Set key filter"));
+ gint result;
+
+ scim_key_selection_dialog_set_keys (
+ SCIM_KEY_SELECTION_DIALOG (dialog),
+ gtk_entry_get_text (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 (entry)))
+ gtk_entry_set_text (entry, keys);
+
+ GtkTreeModel *model;
+ model = gtk_tree_view_get_model (
+ GTK_TREE_VIEW (__widget_key_list_view));
+ gtk_list_store_clear (GTK_LIST_STORE (model));
+ for (unsigned int i = 0; i < __key_conf_pages_num; i++)
+ append_key_bindings (GTK_TREE_VIEW (__widget_key_list_view),
+ i, keys);
+ }
+
+ gtk_widget_destroy (dialog);
+ }
+}
+
+static gboolean
+on_key_list_view_key_press (GtkWidget *widget, GdkEventKey *event,
+ gpointer user_data)
+{
+ GtkTreeView *treeview = GTK_TREE_VIEW (widget);
+
+ switch (event->keyval) {
+ case GDK_Return:
+ case GDK_KP_Enter:
+ key_list_view_popup_key_selection (treeview);
+ break;
+ }
+
+ return FALSE;
+}
+
+static gboolean
+on_key_list_view_button_press (GtkWidget *widget, GdkEventButton *event,
+ gpointer user_data)
+{
+ GtkTreeView *treeview = GTK_TREE_VIEW (widget);
+
+ if (event->type == GDK_2BUTTON_PRESS) {
+ key_list_view_popup_key_selection (treeview);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static void
+on_key_list_selection_changed (GtkTreeSelection *selection, gpointer data)
+{
+ GtkTreeModel *model = NULL;
+ GtkTreeIter iter;
+
+ gboolean selected;
+
+ selected = gtk_tree_selection_get_selected (selection, &model, &iter);
+
+ if (__widget_choose_keys_button) {
+ if (selected) {
+ gtk_widget_set_sensitive (__widget_choose_keys_button, true);
+ } else {
+ gtk_widget_set_sensitive (__widget_choose_keys_button, false);
+ }
+ }
+}
+
+static void
+on_choose_keys_button_clicked (GtkWidget *button, gpointer data)
+{
+ GtkTreeView *treeview = GTK_TREE_VIEW (data);
+ key_list_view_popup_key_selection (treeview);
+}
+
+static void
+on_dict_launch_button_clicked (GtkButton *button, gpointer user_data)
+{
+ StringConfigData *entry = static_cast <StringConfigData*> (user_data);
+
+ if (entry->widget) {
+ const char *command = gtk_entry_get_text (GTK_ENTRY (entry->widget));
+ if (command && *command)
+ util_launch_program (command);
+ }
+}
+
+static void
+on_color_button_changed (ScimAnthyColorButton *button,
+ gpointer user_data)
+{
+ ColorConfigData *entry = static_cast <ColorConfigData*> (user_data);
+
+ if (entry->widget) {
+ scim_anthy_color_button_get_colors (button, &entry->fg_value, &entry->bg_value);
+ entry->changed = true;
+ __config_changed = true;
+ }
+}
+
+}
+/*
+vi:ts=4:nowrap:ai:expandtab
+*/
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004 Hiroyuki Ikezoe
+ * Copyright (C) 2004-2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SCIM_ANTHY_SETUP_H__
+#define __SCIM_ANTHY_SETUP_H__
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+
+#define SCIM_ANTHY_USE_GTK
+#include <scim.h>
+#include "scim_anthy_style_file.h"
+
+namespace scim_anthy {
+
+GtkWidget *create_check_button (const char *config_key);
+GtkWidget *create_spin_button (const char *config_key,
+ GtkTable *table,
+ int idx);
+GtkWidget *create_entry (const char *config_key,
+ GtkTable *table,
+ int idx);
+GtkWidget *create_combo (const char *config_key,
+ gpointer candidates_p,
+ GtkTable *table,
+ gint idx);
+GtkWidget *create_option_menu (const char *config_key,
+ gpointer candidates_p,
+ GtkTable *table,
+ gint idx);
+GtkWidget *create_color_button (const char *config_key);
+GtkWidget *create_key_select_button (const char *config_key,
+ GtkTable *table,
+ int idx);
+
+extern StyleFiles __style_list;
+extern StyleFile __user_style_file;
+extern bool __config_changed;
+extern bool __style_changed;
+
+};
+
+#endif /* __SCIM_ANTHY_SETUP_H__ */
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004 Hiroyuki Ikezoe
+ * Copyright (C) 2004-2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+
+#define Uses_SCIM_CONFIG_BASE
+#define Uses_SCIM_EVENT
+#define SCIM_ANTHY_USE_GTK
+#include <scim.h>
+//#include "scim_anthy_setup_kana.h"
+#include "scim_anthy_intl.h"
+#include "scim_anthy_style_file.h"
+#include "scim_anthy_prefs.h"
+#include "scim_anthy_default_tables.h"
+#include "scim_anthy_setup.h"
+#include "scim_anthy_table_editor.h"
+
+using namespace scim;
+
+namespace scim_anthy {
+
+#define INDEX_KEY "scim-anthy::Index"
+static const char * const __kana_fund_table = "KanaTable/FundamentalTable";
+static const char * const __nicola_fund_table = "NICOLATable/FundamentalTable";
+
+static const int KANA_LAYOUT_INDEX_USER_DEFINED = 0;
+static const int KANA_LAYOUT_INDEX_DEFAULT = 1;
+
+static const int NICOLA_LAYOUT_INDEX_USER_DEFINED = 0;
+static const int NICOLA_LAYOUT_INDEX_DEFAULT = 1;
+
+// Internal data declaration.
+static GtkWidget * __widget_kana_layout_menu = NULL;
+static GtkWidget * __widget_kana_layout_menu2 = NULL;
+static GtkWidget * __widget_nicola_layout_menu = NULL;
+static GtkWidget * __widget_nicola_layout_menu2 = NULL;
+
+static String __config_kana_layout_file = SCIM_ANTHY_CONFIG_KANA_LAYOUT_FILE_DEFAULT;
+static String __config_nicola_layout_file = SCIM_ANTHY_CONFIG_NICOLA_LAYOUT_FILE_DEFAULT;
+
+
+static GtkWidget *create_kana_window (GtkWindow *parent);
+static GtkWidget *create_nicola_window (GtkWindow *parent);
+
+static void setup_kana_page (void);
+static void setup_kana_layout_menu (GtkOptionMenu *omenu);
+static void setup_nicola_layout_menu (GtkOptionMenu *omenu);
+static void setup_kana_window_value (ScimAnthyTableEditor *editor);
+static void setup_nicola_window_value (ScimAnthyTableEditor *editor);
+
+static bool load_kana_layout (void);
+static bool load_nicola_layout (void);
+
+static void on_kana_layout_menu_changed (GtkOptionMenu *omenu,
+ gpointer user_data);
+static void on_kana_customize_button_clicked (GtkWidget *button,
+ gpointer data);
+static void on_kana_table_editor_add_entry (ScimAnthyTableEditor *editor,
+ gpointer data);
+static void on_kana_table_editor_added_entry (ScimAnthyTableEditor *editor,
+ gpointer data);
+static void on_kana_table_editor_remove_entry (ScimAnthyTableEditor *editor,
+ gpointer data);
+static void on_kana_table_editor_removed_entry (ScimAnthyTableEditor *editor,
+ gpointer data);
+static void on_nicola_layout_menu_changed (GtkOptionMenu *omenu,
+ gpointer user_data);
+static void on_nicola_customize_button_clicked (GtkWidget *button,
+ gpointer data);
+static void on_nicola_table_editor_add_entry (ScimAnthyTableEditor *editor,
+ gpointer data);
+static void on_nicola_table_editor_added_entry (ScimAnthyTableEditor *editor,
+ gpointer data);
+static void on_nicola_table_editor_remove_entry (ScimAnthyTableEditor *editor,
+ gpointer data);
+static void on_nicola_table_editor_removed_entry (ScimAnthyTableEditor *editor,
+ gpointer data);
+
+GtkWidget *
+kana_page_create_ui (void)
+{
+ GtkWidget *vbox;
+
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox);
+
+ // JIS Kana Layout
+ GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
+ gtk_widget_show (hbox);
+
+ GtkWidget *label = gtk_label_new (_("<b>JIS Kana Layout</b>"));
+ gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 4);
+ gtk_widget_show (label);
+
+ GtkWidget *alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 8, 24, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
+ gtk_widget_show (alignment);
+
+ /* kana table */
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
+ gtk_container_add (GTK_CONTAINER (alignment), hbox);
+ gtk_widget_show(hbox);
+
+ label = gtk_label_new_with_mnemonic (_("La_yout:"));
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show (label);
+
+ GtkWidget *omenu = gtk_option_menu_new ();
+ __widget_kana_layout_menu = omenu;
+ g_signal_connect (G_OBJECT (omenu), "changed",
+ G_CALLBACK (on_kana_layout_menu_changed), NULL);
+ gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2);
+ gtk_widget_show (omenu);
+
+ gtk_label_set_mnemonic_widget (GTK_LABEL(label), omenu);
+
+ GtkWidget *button = gtk_button_new_with_mnemonic (_("_Customize..."));
+ g_signal_connect (G_OBJECT (button), "clicked",
+ G_CALLBACK (on_kana_customize_button_clicked), NULL);
+ gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 2);
+ gtk_widget_show (button);
+
+
+ // Thumb Shift Layout
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
+ gtk_widget_show (hbox);
+
+ label = gtk_label_new (_("<b>Thumb Shift Layout</b>"));
+ gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 4);
+ gtk_widget_show (label);
+
+ alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 24, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
+ gtk_widget_show (alignment);
+
+ GtkWidget *vbox2 = gtk_vbox_new (FALSE, 0);
+ gtk_container_add (GTK_CONTAINER (alignment), vbox2);
+ gtk_widget_show (vbox2);
+
+ /* nicola table */
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
+ gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
+ gtk_widget_show(hbox);
+
+ label = gtk_label_new_with_mnemonic (_("La_yout:"));
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show (label);
+
+ omenu = gtk_option_menu_new ();
+ __widget_nicola_layout_menu = omenu;
+ g_signal_connect (G_OBJECT (omenu), "changed",
+ G_CALLBACK (on_nicola_layout_menu_changed), NULL);
+ gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2);
+ gtk_widget_show (omenu);
+
+ gtk_label_set_mnemonic_widget (GTK_LABEL(label), omenu);
+
+ button = gtk_button_new_with_mnemonic (_("_Customize..."));
+ g_signal_connect (G_OBJECT (button), "clicked",
+ G_CALLBACK (on_nicola_customize_button_clicked), NULL);
+ gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 2);
+ gtk_widget_show (button);
+
+ /* thumb shift keys */
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
+ gtk_widget_show (hbox);
+
+ GtkWidget *table = gtk_table_new (2, 2, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 4);
+ gtk_widget_show (table);
+
+ // left
+ GtkWidget *widget = create_entry (SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY,
+ GTK_TABLE (table), 0);
+ gtk_entry_set_editable (GTK_ENTRY (widget), FALSE);
+ widget = create_key_select_button (SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY,
+ GTK_TABLE (table), 0);
+
+ // right
+ widget = create_entry (SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY,
+ GTK_TABLE (table), 1);
+ gtk_entry_set_editable (GTK_ENTRY (widget), FALSE);
+ widget = create_key_select_button (SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY,
+ GTK_TABLE (table), 1);
+
+ /* NICOLA time */
+ create_spin_button (SCIM_ANTHY_CONFIG_NICOLA_TIME,
+ GTK_TABLE (table), 3);
+
+ // prepare
+ setup_kana_page ();
+
+ return vbox;
+}
+
+void
+kana_page_load_config (const ConfigPointer &config)
+{
+ __config_kana_layout_file
+ = config->read (String (SCIM_ANTHY_CONFIG_KANA_LAYOUT_FILE),
+ String (SCIM_ANTHY_CONFIG_KANA_LAYOUT_FILE_DEFAULT));
+ __config_nicola_layout_file
+ = config->read (String (SCIM_ANTHY_CONFIG_NICOLA_LAYOUT_FILE),
+ String (SCIM_ANTHY_CONFIG_NICOLA_LAYOUT_FILE_DEFAULT));
+ setup_kana_page ();
+}
+
+void
+kana_page_save_config (const ConfigPointer &config)
+{
+ __config_kana_layout_file
+ = config->write (String (SCIM_ANTHY_CONFIG_KANA_LAYOUT_FILE),
+ String (__config_kana_layout_file));
+ __config_nicola_layout_file
+ = config->write (String (SCIM_ANTHY_CONFIG_NICOLA_LAYOUT_FILE),
+ String (__config_nicola_layout_file));
+}
+
+bool
+kana_page_query_changed (void)
+{
+ return __config_changed || __style_changed;
+}
+
+
+static GtkWidget *
+create_kana_window (GtkWindow *parent)
+{
+ GtkWidget *dialog = scim_anthy_table_editor_new ();
+ const char *titles[3];
+ titles[0] = _("Key");
+ titles[1] = _("Result");
+ titles[2] = NULL;
+ scim_anthy_table_editor_set_columns (SCIM_ANTHY_TABLE_EDITOR (dialog),
+ titles);
+ gtk_window_set_transient_for (GTK_WINDOW (dialog),
+ GTK_WINDOW (parent));
+ gtk_window_set_title (GTK_WINDOW (dialog),
+ _("Customize kana layout table"));
+
+ // option menu area
+ GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
+ FALSE, FALSE, 0);
+ gtk_box_reorder_child (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, 0);
+ gtk_widget_show(hbox);
+
+ GtkWidget *label = gtk_label_new_with_mnemonic (_("Layout _table:"));
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show (label);
+
+ GtkWidget *omenu = gtk_option_menu_new ();
+ __widget_kana_layout_menu2 = omenu;
+ g_object_add_weak_pointer (G_OBJECT (omenu),
+ (gpointer*) &__widget_kana_layout_menu2);
+ gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2);
+ setup_kana_layout_menu (GTK_OPTION_MENU (omenu));
+ gtk_option_menu_set_history
+ (GTK_OPTION_MENU (omenu),
+ gtk_option_menu_get_history (
+ GTK_OPTION_MENU (__widget_kana_layout_menu)));
+ gtk_widget_show (omenu);
+
+ gtk_label_set_mnemonic_widget (GTK_LABEL(label), omenu);
+
+#if 0
+ GtkWidget *button = gtk_button_new_with_mnemonic ("Save _as...");
+ gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 2);
+ gtk_widget_show (button);
+#endif
+
+ // set data and connect signals
+ setup_kana_window_value (SCIM_ANTHY_TABLE_EDITOR (dialog));
+ g_signal_connect (G_OBJECT (omenu), "changed",
+ G_CALLBACK (on_kana_layout_menu_changed),
+ dialog);
+ g_signal_connect (G_OBJECT (dialog), "add-entry",
+ G_CALLBACK (on_kana_table_editor_add_entry),
+ NULL);
+ g_signal_connect (G_OBJECT (dialog), "remove-entry",
+ G_CALLBACK (on_kana_table_editor_remove_entry),
+ NULL);
+ g_signal_connect_after (G_OBJECT (dialog), "add-entry",
+ G_CALLBACK (on_kana_table_editor_added_entry),
+ NULL);
+ g_signal_connect_after (G_OBJECT (dialog), "remove-entry",
+ G_CALLBACK (on_kana_table_editor_removed_entry),
+ NULL);
+
+ return dialog;
+}
+
+
+static GtkWidget *
+create_nicola_window (GtkWindow *parent)
+{
+ GtkWidget *dialog = scim_anthy_table_editor_new ();
+ gtk_window_set_default_size (GTK_WINDOW (dialog), 450, 350);
+ const char *titles[5];
+ titles[0] = _("Key");
+ titles[1] = _("Single press");
+ titles[2] = _("Left thumb shift");
+ titles[3] = _("Right thumb shift");
+ titles[4] = NULL;
+ scim_anthy_table_editor_set_columns (SCIM_ANTHY_TABLE_EDITOR (dialog),
+ titles);
+ gtk_window_set_transient_for (GTK_WINDOW (dialog),
+ GTK_WINDOW (parent));
+ gtk_window_set_title (GTK_WINDOW (dialog),
+ _("Customize thumb shift layout table"));
+
+ // option menu area
+ GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
+ FALSE, FALSE, 0);
+ gtk_box_reorder_child (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, 0);
+ gtk_widget_show(hbox);
+
+ GtkWidget *label = gtk_label_new_with_mnemonic (_("Layout _table:"));
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show (label);
+
+ GtkWidget *omenu = gtk_option_menu_new ();
+ __widget_nicola_layout_menu2 = omenu;
+ g_object_add_weak_pointer (G_OBJECT (omenu),
+ (gpointer*) &__widget_nicola_layout_menu2);
+ gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2);
+ setup_nicola_layout_menu (GTK_OPTION_MENU (omenu));
+ gtk_option_menu_set_history
+ (GTK_OPTION_MENU (omenu),
+ gtk_option_menu_get_history (
+ GTK_OPTION_MENU (__widget_nicola_layout_menu)));
+ gtk_widget_show (omenu);
+
+ gtk_label_set_mnemonic_widget (GTK_LABEL(label), omenu);
+
+#if 0
+ GtkWidget *button = gtk_button_new_with_mnemonic ("Save _as...");
+ gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 2);
+ gtk_widget_show (button);
+#endif
+
+ // set data and connect signals
+ setup_nicola_window_value (SCIM_ANTHY_TABLE_EDITOR (dialog));
+ g_signal_connect (G_OBJECT (omenu), "changed",
+ G_CALLBACK (on_nicola_layout_menu_changed),
+ dialog);
+ g_signal_connect (G_OBJECT (dialog), "add-entry",
+ G_CALLBACK (on_nicola_table_editor_add_entry),
+ NULL);
+ g_signal_connect (G_OBJECT (dialog), "remove-entry",
+ G_CALLBACK (on_nicola_table_editor_remove_entry),
+ NULL);
+ g_signal_connect_after (G_OBJECT (dialog), "add-entry",
+ G_CALLBACK (on_nicola_table_editor_added_entry),
+ NULL);
+ g_signal_connect_after (G_OBJECT (dialog), "remove-entry",
+ G_CALLBACK (on_nicola_table_editor_removed_entry),
+ NULL);
+
+ return dialog;
+}
+
+static void
+setup_kana_page (void)
+{
+ setup_kana_layout_menu (GTK_OPTION_MENU (__widget_kana_layout_menu));
+ setup_nicola_layout_menu (GTK_OPTION_MENU (__widget_nicola_layout_menu));
+}
+
+static void
+setup_kana_layout_menu (GtkOptionMenu *omenu)
+{
+ GtkWidget *menu = gtk_menu_new ();
+ gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu),
+ menu);
+ gtk_widget_show (menu);
+
+ // create menu items
+ GtkWidget *menuitem = gtk_menu_item_new_with_label (_("User defined"));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+
+ menuitem = gtk_menu_item_new_with_label (_("Default"));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ gtk_widget_show (menuitem);
+
+ StyleFiles::iterator it;
+ unsigned int i;
+ for (i = 0, it = __style_list.begin ();
+ it != __style_list.end ();
+ i++, it++)
+ {
+ StyleLines section;
+ if (!it->get_entry_list (section, __kana_fund_table))
+ continue;
+
+ menuitem = gtk_menu_item_new_with_label (_(it->get_title().c_str()));
+ g_object_set_data (G_OBJECT (menuitem),
+ INDEX_KEY, GINT_TO_POINTER (i));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ gtk_widget_show (menuitem);
+ }
+
+ // set default value
+ g_signal_handlers_block_by_func (
+ G_OBJECT (omenu),
+ (gpointer) (on_kana_layout_menu_changed),
+ NULL);
+
+ gtk_option_menu_set_history (GTK_OPTION_MENU (omenu),
+ KANA_LAYOUT_INDEX_DEFAULT);
+
+ if (__config_kana_layout_file == __user_style_file.get_file_name ()) {
+ gtk_option_menu_set_history (GTK_OPTION_MENU (omenu),
+ KANA_LAYOUT_INDEX_USER_DEFINED);
+
+ } else {
+ GList *node, *list = gtk_container_get_children (GTK_CONTAINER (menu));
+ for (i = 2, node = g_list_next (g_list_next (list));
+ node;
+ i++, node = g_list_next (node))
+ {
+ gint idx = GPOINTER_TO_INT (
+ g_object_get_data (G_OBJECT (node->data), INDEX_KEY));
+ if (__style_list[idx].get_file_name () == __config_kana_layout_file) {
+ gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), i);
+ break;
+ }
+ }
+ }
+
+ g_signal_handlers_unblock_by_func (
+ G_OBJECT (omenu),
+ (gpointer) (on_kana_layout_menu_changed),
+ NULL);
+}
+
+static void
+setup_nicola_layout_menu (GtkOptionMenu *omenu)
+{
+ GtkWidget *menu = gtk_menu_new ();
+ gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu),
+ menu);
+ gtk_widget_show (menu);
+
+ // create menu items
+ GtkWidget *menuitem = gtk_menu_item_new_with_label (_("User defined"));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+
+ menuitem = gtk_menu_item_new_with_label (_("Default"));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ gtk_widget_show (menuitem);
+
+ StyleFiles::iterator it;
+ unsigned int i;
+ for (i = 0, it = __style_list.begin ();
+ it != __style_list.end ();
+ i++, it++)
+ {
+ StyleLines section;
+ if (!it->get_entry_list (section, __nicola_fund_table))
+ continue;
+
+ menuitem = gtk_menu_item_new_with_label (_(it->get_title().c_str()));
+ g_object_set_data (G_OBJECT (menuitem),
+ INDEX_KEY, GINT_TO_POINTER (i));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ gtk_widget_show (menuitem);
+ }
+
+ // set default value
+ g_signal_handlers_block_by_func (
+ G_OBJECT (omenu),
+ (gpointer) (on_nicola_layout_menu_changed),
+ NULL);
+
+ gtk_option_menu_set_history (GTK_OPTION_MENU (omenu),
+ NICOLA_LAYOUT_INDEX_DEFAULT);
+
+ if (__config_nicola_layout_file == __user_style_file.get_file_name ()) {
+ gtk_option_menu_set_history (GTK_OPTION_MENU (omenu),
+ NICOLA_LAYOUT_INDEX_USER_DEFINED);
+
+ } else {
+ GList *node, *list = gtk_container_get_children (GTK_CONTAINER (menu));
+ for (i = 2, node = g_list_next (g_list_next (list));
+ node;
+ i++, node = g_list_next (node))
+ {
+ gint idx = GPOINTER_TO_INT (
+ g_object_get_data (G_OBJECT (node->data), INDEX_KEY));
+ if (__style_list[idx].get_file_name () == __config_nicola_layout_file) {
+ gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), i);
+ break;
+ }
+ }
+ }
+
+ g_signal_handlers_unblock_by_func (
+ G_OBJECT (omenu),
+ (gpointer) (on_nicola_layout_menu_changed),
+ NULL);
+}
+
+static void
+setup_kana_window_value (ScimAnthyTableEditor *editor)
+{
+ GtkTreeView *treeview = GTK_TREE_VIEW (editor->treeview);
+ GtkTreeModel *model = gtk_tree_view_get_model (treeview);
+ GtkListStore *store = GTK_LIST_STORE (model);
+
+ gtk_list_store_clear (store);
+
+ std::vector<String> keys;
+ __user_style_file.get_key_list (keys, __kana_fund_table);
+ if (keys.empty ()) {
+ load_kana_layout ();
+ __user_style_file.get_key_list (keys, __kana_fund_table);
+ }
+
+ std::vector<String>::iterator it;
+ for (it = keys.begin (); it != keys.end (); it++) {
+ std::vector<WideString> value;
+ __user_style_file.get_string_array (value, __kana_fund_table, *it);
+ String result, cont;
+ if (value.size () > 0) result = utf8_wcstombs(value[0]);
+ if (value.size () > 1) result = utf8_wcstombs(value[1]);
+ GtkTreeIter iter;
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ 0, it->c_str (),
+ 1, result.c_str (),
+ -1);
+ }
+}
+
+static void
+setup_nicola_window_value (ScimAnthyTableEditor *editor)
+{
+ GtkTreeView *treeview = GTK_TREE_VIEW (editor->treeview);
+ GtkTreeModel *model = gtk_tree_view_get_model (treeview);
+ GtkListStore *store = GTK_LIST_STORE (model);
+
+ gtk_list_store_clear (store);
+
+ std::vector<String> keys;
+ __user_style_file.get_key_list (keys, __nicola_fund_table);
+ if (keys.empty ()) {
+ load_nicola_layout ();
+ __user_style_file.get_key_list (keys, __nicola_fund_table);
+ }
+
+ std::vector<String>::iterator it;
+ for (it = keys.begin (); it != keys.end (); it++) {
+ std::vector<WideString> value;
+ __user_style_file.get_string_array (value, __nicola_fund_table, *it);
+ String single, left, right;
+ if (value.size () > 0) single = utf8_wcstombs(value[0]);
+ if (value.size () > 1) left = utf8_wcstombs(value[1]);
+ if (value.size () > 2) right = utf8_wcstombs(value[2]);
+ GtkTreeIter iter;
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ 0, it->c_str (),
+ 1, single.c_str (),
+ 2, left.c_str (),
+ 3, right.c_str (),
+ -1);
+ }
+}
+
+static void
+setup_default_kana_table (void)
+{
+ __user_style_file.delete_section (__kana_fund_table);
+ ConvRule *table = scim_anthy_kana_typing_rule;
+ for (unsigned int i = 0; table[i].string; i++) {
+ std::vector<String> value;
+ if ((table[i].result && *(table[i].result)) ||
+ (table[i].cont && *(table[i].cont)))
+ {
+ const char *result = table[i].result ? table[i].result : "";
+ value.push_back (result);
+ }
+ if (table[i].cont && *(table[i].cont)) {
+ value.push_back (table[i].cont);
+ }
+ __user_style_file.set_string_array (__kana_fund_table,
+ table[i].string,
+ value);
+ }
+}
+
+static void
+setup_default_nicola_table (void)
+{
+ __user_style_file.delete_section (__nicola_fund_table);
+ NicolaRule *table = scim_anthy_nicola_table;
+ for (unsigned int i = 0; table[i].key; i++) {
+ std::vector<String> value;
+ const char *str;
+ str = table[i].single ? table[i].single : "";
+ value.push_back (str);
+ str = table[i].left_shift ? table[i].left_shift : "";
+ value.push_back (str);
+ str = table[i].right_shift ? table[i].right_shift : "";
+ value.push_back (str);
+ __user_style_file.set_string_array (__nicola_fund_table,
+ table[i].key,
+ value);
+ }
+}
+
+static bool
+load_kana_layout (void)
+{
+ GtkOptionMenu *omenu = GTK_OPTION_MENU (__widget_kana_layout_menu);
+ gint idx = gtk_option_menu_get_history (omenu);
+ GtkWidget *menu = gtk_option_menu_get_menu (omenu);
+ GList *list = gtk_container_get_children (GTK_CONTAINER (menu));
+ GtkWidget *menuitem = GTK_WIDGET (g_list_nth_data (list, idx));
+
+ if (!menuitem)
+ return false;
+
+ gint theme_idx = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menuitem),
+ INDEX_KEY));
+
+ // set new kana table
+ if (idx == KANA_LAYOUT_INDEX_USER_DEFINED) {
+ // User defined table
+ __config_kana_layout_file = __user_style_file.get_file_name ();
+ StyleLines lines;
+ bool success = __user_style_file.get_entry_list
+ (lines, __kana_fund_table);
+ if (!success || lines.empty ())
+ setup_default_kana_table ();
+
+ return true;
+
+ } else if (idx == KANA_LAYOUT_INDEX_DEFAULT) {
+ // Default table
+ __config_kana_layout_file = "";
+ setup_default_kana_table ();
+
+ return true;
+
+ } else if (theme_idx >= 0 && theme_idx < (int) __style_list.size ()) {
+ // Tables defined in system theme files
+ __config_kana_layout_file = __style_list[theme_idx].get_file_name ();
+ __user_style_file.delete_section (__kana_fund_table);
+
+ std::vector<String> keys;
+ bool success = __style_list[theme_idx].get_key_list
+ (keys, __kana_fund_table);
+ if (success) {
+ std::vector<String>::iterator it;
+ for (it = keys.begin (); it != keys.end (); it++) {
+ std::vector<WideString> value;
+ __style_list[theme_idx].get_string_array
+ (value, __kana_fund_table, *it);
+ __user_style_file.set_string_array (__kana_fund_table,
+ *it, value);
+ }
+ }
+ return true;
+
+ } else {
+ // error
+ return false;
+ }
+}
+
+static bool
+load_nicola_layout (void)
+{
+ GtkOptionMenu *omenu = GTK_OPTION_MENU (__widget_nicola_layout_menu);
+ gint idx = gtk_option_menu_get_history (omenu);
+ GtkWidget *menu = gtk_option_menu_get_menu (omenu);
+ GList *list = gtk_container_get_children (GTK_CONTAINER (menu));
+ GtkWidget *menuitem = GTK_WIDGET (g_list_nth_data (list, idx));
+
+ if (!menuitem)
+ return false;
+
+ gint theme_idx = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menuitem),
+ INDEX_KEY));
+
+ // set new NICOLA table
+ if (idx == NICOLA_LAYOUT_INDEX_USER_DEFINED) {
+ // User defined table
+ __config_nicola_layout_file = __user_style_file.get_file_name ();
+ StyleLines lines;
+ bool success = __user_style_file.get_entry_list
+ (lines, __nicola_fund_table);
+ if (!success || lines.empty ())
+ setup_default_nicola_table ();
+
+ return true;
+
+ } else if (idx == NICOLA_LAYOUT_INDEX_DEFAULT) {
+ // Default table
+ __config_nicola_layout_file = "";
+ setup_default_nicola_table ();
+
+ return true;
+
+ } else if (theme_idx >= 0 && theme_idx < (int) __style_list.size ()) {
+ // Tables defined in system theme files
+ __config_nicola_layout_file = __style_list[theme_idx].get_file_name ();
+ __user_style_file.delete_section (__nicola_fund_table);
+
+ std::vector<String> keys;
+ bool success = __style_list[theme_idx].get_key_list
+ (keys, __nicola_fund_table);
+ if (success) {
+ std::vector<String>::iterator it;
+ for (it = keys.begin (); it != keys.end (); it++) {
+ std::vector<WideString> value;
+ __style_list[theme_idx].get_string_array
+ (value, __nicola_fund_table, *it);
+ __user_style_file.set_string_array (__nicola_fund_table,
+ *it, value);
+ }
+ }
+ return true;
+
+ } else {
+ // error
+ return false;
+ }
+}
+
+static bool
+has_voiced_consonant (String str)
+{
+ ConvRule *table = scim_anthy_kana_voiced_consonant_rule;
+
+ WideString str1_wide = utf8_mbstowcs (str);
+ if (str1_wide.length () <= 0)
+ return false;
+
+ for (unsigned int i = 0; table[i].string; i++) {
+ WideString str2_wide = utf8_mbstowcs (table[i].string);
+ if (str2_wide.length () <= 0)
+ continue;
+ if (str1_wide[0] == str2_wide[0])
+ return true;
+ }
+
+ return false;
+}
+
+static void
+on_kana_layout_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
+{
+ bool success;
+
+ if (__widget_kana_layout_menu != GTK_WIDGET (omenu)) {
+ g_signal_handlers_block_by_func (
+ G_OBJECT (__widget_kana_layout_menu),
+ (gpointer) (on_kana_layout_menu_changed),
+ NULL);
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_kana_layout_menu),
+ gtk_option_menu_get_history (omenu));
+ g_signal_handlers_unblock_by_func (
+ G_OBJECT (__widget_kana_layout_menu),
+ (gpointer) (on_kana_layout_menu_changed),
+ NULL);
+
+ success = load_kana_layout ();
+
+ setup_kana_window_value (SCIM_ANTHY_TABLE_EDITOR (user_data));
+ } else {
+ success = load_kana_layout ();
+ }
+
+ if (success) {
+ // sync widgets
+ __style_changed = true;
+ __config_changed = true;
+ }
+}
+
+static void
+on_kana_customize_button_clicked (GtkWidget *button, gpointer data)
+{
+ GtkWidget *widget = create_kana_window (
+ GTK_WINDOW (gtk_widget_get_toplevel (button)));
+ gtk_dialog_run (GTK_DIALOG (widget));
+ gtk_widget_destroy (widget);
+}
+
+static void
+on_kana_table_editor_add_entry (ScimAnthyTableEditor *editor, gpointer data)
+{
+ const gchar *sequence, *result;
+ sequence = scim_anthy_table_editor_get_nth_text (editor, 0);
+ result = scim_anthy_table_editor_get_nth_text (editor, 1);
+
+ // real add
+ std::vector<String> value;
+ if (has_voiced_consonant (result))
+ value.push_back ("");
+ value.push_back (result);
+ __user_style_file.set_string_array (__kana_fund_table, sequence, value);
+}
+
+static void
+on_kana_table_editor_added_entry (ScimAnthyTableEditor *editor, gpointer data)
+{
+ // change menu item to "User defined"
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_kana_layout_menu2),
+ KANA_LAYOUT_INDEX_USER_DEFINED);
+
+ __style_changed = true;
+}
+
+static void
+on_kana_table_editor_remove_entry (ScimAnthyTableEditor *editor, gpointer data)
+{
+ const gchar *sequence;
+ sequence = scim_anthy_table_editor_get_nth_text (editor, 0);
+
+ // real remove
+ __user_style_file.delete_key (__kana_fund_table, sequence);
+}
+
+static void
+on_kana_table_editor_removed_entry (ScimAnthyTableEditor *editor, gpointer data)
+{
+ // change menu item to "User deined"
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_kana_layout_menu2),
+ KANA_LAYOUT_INDEX_USER_DEFINED);
+
+ __style_changed = true;
+}
+
+static void
+on_nicola_layout_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
+{
+ bool success;
+
+ if (__widget_nicola_layout_menu != GTK_WIDGET (omenu)) {
+ g_signal_handlers_block_by_func (
+ G_OBJECT (__widget_nicola_layout_menu),
+ (gpointer) (on_nicola_layout_menu_changed),
+ NULL);
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_nicola_layout_menu),
+ gtk_option_menu_get_history (omenu));
+ g_signal_handlers_unblock_by_func (
+ G_OBJECT (__widget_nicola_layout_menu),
+ (gpointer) (on_nicola_layout_menu_changed),
+ NULL);
+
+ success = load_nicola_layout ();
+
+ setup_nicola_window_value (SCIM_ANTHY_TABLE_EDITOR (user_data));
+ } else {
+ success = load_nicola_layout ();
+ }
+
+ if (success) {
+ // sync widgets
+ __style_changed = true;
+ __config_changed = true;
+ }
+}
+
+static void
+on_nicola_customize_button_clicked (GtkWidget *button, gpointer data)
+{
+ GtkWidget *widget = create_nicola_window (
+ GTK_WINDOW (gtk_widget_get_toplevel (button)));
+ gtk_dialog_run (GTK_DIALOG (widget));
+ gtk_widget_destroy (widget);
+}
+
+static void
+on_nicola_table_editor_add_entry (ScimAnthyTableEditor *editor, gpointer data)
+{
+ const gchar *key = scim_anthy_table_editor_get_nth_text (editor, 0);
+ std::vector<String> value;
+ value.push_back (scim_anthy_table_editor_get_nth_text (editor, 1));
+ value.push_back (scim_anthy_table_editor_get_nth_text (editor, 2));
+ value.push_back (scim_anthy_table_editor_get_nth_text (editor, 3));
+ __user_style_file.set_string_array (__nicola_fund_table, key, value);
+}
+
+static void
+on_nicola_table_editor_added_entry (ScimAnthyTableEditor *editor, gpointer data)
+{
+ // change menu item to "User defined"
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_nicola_layout_menu2),
+ NICOLA_LAYOUT_INDEX_USER_DEFINED);
+
+ __style_changed = true;
+}
+
+static void
+on_nicola_table_editor_remove_entry (ScimAnthyTableEditor *editor, gpointer data)
+{
+ const gchar *sequence;
+ sequence = scim_anthy_table_editor_get_nth_text (editor, 0);
+
+ // real remove
+ __user_style_file.delete_key (__nicola_fund_table, sequence);
+}
+
+static void
+on_nicola_table_editor_removed_entry (ScimAnthyTableEditor *editor, gpointer data)
+{
+ // change menu item to "User deined"
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_nicola_layout_menu2),
+ NICOLA_LAYOUT_INDEX_USER_DEFINED);
+
+ __style_changed = true;
+}
+
+}
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004 Hiroyuki Ikezoe
+ * Copyright (C) 2004-2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SCIM_ANTHY_SETUP_KANA_H__
+#define __SCIM_ANTHY_SETUP_KANA_H__
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+
+#define Uses_SCIM_CONFIG_BASE
+#include <scim.h>
+
+
+namespace scim_anthy {
+
+GtkWidget *kana_page_create_ui (void);
+void kana_page_load_config (const ConfigPointer &config);
+void kana_page_save_config (const ConfigPointer &config);
+bool kana_page_query_changed (void);
+
+};
+
+#endif /* __SCIM_ANTHY_SETUP_KANA_H__ */
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004 Hiroyuki Ikezoe
+ * Copyright (C) 2004-2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+
+#define Uses_SCIM_CONFIG_BASE
+#define Uses_SCIM_EVENT
+#define SCIM_ANTHY_USE_GTK
+#include <scim.h>
+#include "scim_anthy_intl.h"
+#include "scim_anthy_style_file.h"
+#include "scim_anthy_prefs.h"
+#include "scim_anthy_default_tables.h"
+#include "scim_anthy_setup.h"
+#include "scim_anthy_table_editor.h"
+
+using namespace scim;
+
+namespace scim_anthy {
+
+#define INDEX_KEY "scim-anthy::Index"
+static const char * const __romaji_fund_table = "RomajiTable/FundamentalTable";
+
+static const int ROMAJI_THEME_INDEX_USER_DEFINED = 0;
+static const int ROMAJI_THEME_INDEX_DEFAULT = 1;
+
+// Internal data declaration.
+static GtkWidget * __widget_romaji_theme_menu = NULL;
+static GtkWidget * __widget_romaji_theme_menu2 = NULL;
+
+static String __config_romaji_theme_file = SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE_DEFAULT;
+
+static GtkWidget *create_romaji_window (GtkWindow *parent);
+
+static void setup_romaji_page (void);
+static void setup_romaji_theme_menu (GtkOptionMenu *omenu);
+static void setup_romaji_window_value (ScimAnthyTableEditor *editor);
+
+static bool load_romaji_theme (void);
+
+static void on_romaji_pseudo_ascii_mode_toggled(GtkToggleButton *togglebutton,
+ gpointer user_data);
+static void on_romaji_theme_menu_changed (GtkOptionMenu *omenu,
+ gpointer user_data);
+static void on_romaji_customize_button_clicked (GtkWidget *button,
+ gpointer data);
+static void on_table_editor_add_entry (ScimAnthyTableEditor *editor,
+ gpointer data);
+static void on_table_editor_added_entry (ScimAnthyTableEditor *editor,
+ gpointer data);
+static void on_table_editor_remove_entry (ScimAnthyTableEditor *editor,
+ gpointer data);
+static void on_table_editor_removed_entry (ScimAnthyTableEditor *editor,
+ gpointer data);
+
+GtkWidget *
+romaji_page_create_ui (void)
+{
+ GtkWidget *vbox, *widget, *hbox, *label;
+
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox);
+
+ /* romaji splitting */
+ widget = create_check_button (SCIM_ANTHY_CONFIG_ROMAJI_ALLOW_SPLIT);
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 4);
+
+ /* symbol */
+ widget = create_check_button (SCIM_ANTHY_CONFIG_ROMAJI_HALF_SYMBOL);
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 4);
+
+ /* number */
+ widget = create_check_button (SCIM_ANTHY_CONFIG_ROMAJI_HALF_NUMBER);
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 4);
+
+ /* pseudo ascii mode */
+ widget = create_check_button (SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_MODE);
+ g_signal_connect ((gpointer) widget, "toggled",
+ G_CALLBACK (on_romaji_pseudo_ascii_mode_toggled),
+ NULL);
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 4);
+
+ /* pseudo ascii: blank behavior */
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
+ gtk_widget_show (hbox);
+ label = gtk_label_new (" ");
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+ gtk_widget_show (label);
+
+ widget = create_check_button (SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR);
+ gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
+ // set initial state
+ on_romaji_pseudo_ascii_mode_toggled (GTK_TOGGLE_BUTTON (widget), NULL);
+
+ /* romaji table */
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show(hbox);
+
+ label = gtk_label_new_with_mnemonic (_("Romaji _table:"));
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show (label);
+
+ GtkWidget *omenu = gtk_option_menu_new ();
+ __widget_romaji_theme_menu = omenu;
+ g_signal_connect (G_OBJECT (omenu), "changed",
+ G_CALLBACK (on_romaji_theme_menu_changed), NULL);
+ gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2);
+ gtk_widget_show (omenu);
+
+ gtk_label_set_mnemonic_widget (GTK_LABEL(label), omenu);
+
+ GtkWidget *button = gtk_button_new_with_mnemonic (_("_Customize..."));
+ g_signal_connect (G_OBJECT (button), "clicked",
+ G_CALLBACK (on_romaji_customize_button_clicked), NULL);
+ gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 2);
+ gtk_widget_show (button);
+
+ setup_romaji_page ();
+
+ return vbox;
+}
+
+void
+romaji_page_load_config (const ConfigPointer &config)
+{
+ __config_romaji_theme_file
+ = config->read (String (SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE),
+ String (SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE_DEFAULT));
+ setup_romaji_page ();
+}
+
+void
+romaji_page_save_config (const ConfigPointer &config)
+{
+ __config_romaji_theme_file
+ = config->write (String (SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE),
+ String (__config_romaji_theme_file));
+}
+
+bool
+romaji_page_query_changed (void)
+{
+ return __config_changed || __style_changed;
+}
+
+
+static GtkWidget *
+create_romaji_window (GtkWindow *parent)
+{
+ GtkWidget *dialog = scim_anthy_table_editor_new ();
+ const char *titles[3];
+ titles[0] = _("Sequence");
+ titles[1] = _("Result");
+ titles[2] = NULL;
+ scim_anthy_table_editor_set_columns (SCIM_ANTHY_TABLE_EDITOR (dialog),
+ titles);
+ gtk_window_set_transient_for (GTK_WINDOW (dialog),
+ GTK_WINDOW (parent));
+ gtk_window_set_title (GTK_WINDOW (dialog),
+ _("Customize romaji table"));
+
+ // option menu area
+ GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
+ FALSE, FALSE, 0);
+ gtk_box_reorder_child (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, 0);
+ gtk_widget_show(hbox);
+
+ GtkWidget *label = gtk_label_new_with_mnemonic (_("Romaji _table:"));
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show (label);
+
+ GtkWidget *omenu = gtk_option_menu_new ();
+ __widget_romaji_theme_menu2 = omenu;
+ g_object_add_weak_pointer (G_OBJECT (omenu),
+ (gpointer*) &__widget_romaji_theme_menu2);
+ gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2);
+ setup_romaji_theme_menu (GTK_OPTION_MENU (omenu));
+ gtk_option_menu_set_history
+ (GTK_OPTION_MENU (omenu),
+ gtk_option_menu_get_history (
+ GTK_OPTION_MENU (__widget_romaji_theme_menu)));
+ gtk_widget_show (omenu);
+
+ gtk_label_set_mnemonic_widget (GTK_LABEL(label), omenu);
+
+#if 0
+ GtkWidget *button = gtk_button_new_with_mnemonic ("Save _as...");
+ gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 2);
+ gtk_widget_show (button);
+#endif
+
+ // set data and connect signals
+ setup_romaji_window_value (SCIM_ANTHY_TABLE_EDITOR (dialog));
+ g_signal_connect (G_OBJECT (omenu), "changed",
+ G_CALLBACK (on_romaji_theme_menu_changed),
+ dialog);
+ g_signal_connect (G_OBJECT (dialog), "add-entry",
+ G_CALLBACK (on_table_editor_add_entry),
+ NULL);
+ g_signal_connect (G_OBJECT (dialog), "remove-entry",
+ G_CALLBACK (on_table_editor_remove_entry),
+ NULL);
+ g_signal_connect_after (G_OBJECT (dialog), "add-entry",
+ G_CALLBACK (on_table_editor_added_entry),
+ NULL);
+ g_signal_connect_after (G_OBJECT (dialog), "remove-entry",
+ G_CALLBACK (on_table_editor_removed_entry),
+ NULL);
+
+ return dialog;
+}
+
+static void
+setup_romaji_page (void)
+{
+ setup_romaji_theme_menu (GTK_OPTION_MENU (__widget_romaji_theme_menu));
+}
+
+static void
+setup_romaji_theme_menu (GtkOptionMenu *omenu)
+{
+ GtkWidget *menu = gtk_menu_new ();
+ gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu),
+ menu);
+ gtk_widget_show (menu);
+
+ // create menu items
+ GtkWidget *menuitem = gtk_menu_item_new_with_label (_("User defined"));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+
+ menuitem = gtk_menu_item_new_with_label (_("Default"));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ gtk_widget_show (menuitem);
+
+ StyleFiles::iterator it;
+ unsigned int i;
+ for (i = 0, it = __style_list.begin ();
+ it != __style_list.end ();
+ i++, it++)
+ {
+ StyleLines section;
+ if (!it->get_entry_list (section, __romaji_fund_table))
+ continue;
+
+ menuitem = gtk_menu_item_new_with_label (_(it->get_title().c_str()));
+ g_object_set_data (G_OBJECT (menuitem),
+ INDEX_KEY, GINT_TO_POINTER (i));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ gtk_widget_show (menuitem);
+ }
+
+ // set default value
+ g_signal_handlers_block_by_func (
+ G_OBJECT (omenu),
+ (gpointer) (on_romaji_theme_menu_changed),
+ NULL);
+
+ gtk_option_menu_set_history (GTK_OPTION_MENU (omenu),
+ ROMAJI_THEME_INDEX_DEFAULT);
+
+ if (__config_romaji_theme_file == __user_style_file.get_file_name ()) {
+ gtk_option_menu_set_history (GTK_OPTION_MENU (omenu),
+ ROMAJI_THEME_INDEX_USER_DEFINED);
+
+ } else {
+ GList *node, *list = gtk_container_get_children (GTK_CONTAINER (menu));
+ for (i = 2, node = g_list_next (g_list_next (list));
+ node;
+ i++, node = g_list_next (node))
+ {
+ gint idx = GPOINTER_TO_INT (
+ g_object_get_data (G_OBJECT (node->data), INDEX_KEY));
+ if (__style_list[idx].get_file_name () == __config_romaji_theme_file) {
+ gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), i);
+ break;
+ }
+ }
+ }
+
+ g_signal_handlers_unblock_by_func (
+ G_OBJECT (omenu),
+ (gpointer) (on_romaji_theme_menu_changed),
+ NULL);
+}
+
+static void
+setup_romaji_window_value (ScimAnthyTableEditor *editor)
+{
+ GtkTreeView *treeview = GTK_TREE_VIEW (editor->treeview);
+ GtkTreeModel *model = gtk_tree_view_get_model (treeview);
+ GtkListStore *store = GTK_LIST_STORE (model);
+
+ gtk_list_store_clear (store);
+
+ std::vector<String> keys;
+ __user_style_file.get_key_list (keys, __romaji_fund_table);
+ if (keys.empty ()) {
+ load_romaji_theme ();
+ __user_style_file.get_key_list (keys, __romaji_fund_table);
+ }
+
+ std::vector<String>::iterator it;
+ for (it = keys.begin (); it != keys.end (); it++) {
+ std::vector<WideString> value;
+ __user_style_file.get_string_array (value, __romaji_fund_table, *it);
+ String result, cont;
+ if (value.size () > 0) result = utf8_wcstombs(value[0]);
+ if (value.size () > 1) cont = utf8_wcstombs(value[1]);
+ GtkTreeIter iter;
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ 0, it->c_str (),
+ 1, result.c_str (),
+ -1);
+ }
+}
+
+static void
+setup_default_romaji_table (void)
+{
+ __user_style_file.delete_section (__romaji_fund_table);
+ ConvRule *table = scim_anthy_romaji_typing_rule;
+ for (unsigned int i = 0; table[i].string; i++) {
+ std::vector<String> value;
+ if ((table[i].result && *(table[i].result)) ||
+ (table[i].cont && *(table[i].cont)))
+ {
+ const char *result = table[i].result ? table[i].result : "";
+ value.push_back (result);
+ }
+ if (table[i].cont && *(table[i].cont)) {
+ value.push_back (table[i].cont);
+ }
+ __user_style_file.set_string_array (__romaji_fund_table,
+ table[i].string,
+ value);
+ }
+}
+
+static bool
+load_romaji_theme (void)
+{
+ GtkOptionMenu *omenu = GTK_OPTION_MENU (__widget_romaji_theme_menu);
+ gint idx = gtk_option_menu_get_history (omenu);
+ GtkWidget *menu = gtk_option_menu_get_menu (omenu);
+ GList *list = gtk_container_get_children (GTK_CONTAINER (menu));
+ GtkWidget *menuitem = GTK_WIDGET (g_list_nth_data (list, idx));
+
+ if (!menuitem)
+ return false;
+
+ gint theme_idx = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menuitem),
+ INDEX_KEY));
+
+ // set new romaji table
+ if (idx == ROMAJI_THEME_INDEX_USER_DEFINED) {
+ // User defined table
+ __config_romaji_theme_file = __user_style_file.get_file_name ();
+ StyleLines lines;
+ bool success = __user_style_file.get_entry_list
+ (lines, __romaji_fund_table);
+ if (!success || lines.empty ())
+ setup_default_romaji_table ();
+
+ return true;
+
+ } else if (idx == ROMAJI_THEME_INDEX_DEFAULT) {
+ // Default table
+ __config_romaji_theme_file = "";
+ setup_default_romaji_table ();
+
+ return true;
+
+ } else if (theme_idx >= 0 && theme_idx < (int) __style_list.size ()) {
+ // Tables defined in system theme files
+ __config_romaji_theme_file = __style_list[theme_idx].get_file_name ();
+ __user_style_file.delete_section (__romaji_fund_table);
+
+ std::vector<String> keys;
+ bool success = __style_list[theme_idx].get_key_list
+ (keys, __romaji_fund_table);
+ if (success) {
+ std::vector<String>::iterator it;
+ for (it = keys.begin (); it != keys.end (); it++) {
+ std::vector<WideString> value;
+ __style_list[theme_idx].get_string_array
+ (value, __romaji_fund_table, *it);
+ __user_style_file.set_string_array (__romaji_fund_table,
+ *it, value);
+ }
+ }
+ return true;
+
+ } else {
+ // error
+ return false;
+ }
+}
+
+static void
+on_romaji_pseudo_ascii_mode_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data)
+{
+ gboolean active = gtk_toggle_button_get_active (togglebutton);
+ BoolConfigData *entry;
+
+ entry = find_bool_config_entry (SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR);
+ if (entry->widget)
+ gtk_widget_set_sensitive (GTK_WIDGET (entry->widget), active);
+}
+
+static void
+on_romaji_theme_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
+{
+ bool success;
+
+ if (__widget_romaji_theme_menu != GTK_WIDGET (omenu)) {
+ g_signal_handlers_block_by_func (
+ G_OBJECT (__widget_romaji_theme_menu),
+ (gpointer) (on_romaji_theme_menu_changed),
+ NULL);
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_romaji_theme_menu),
+ gtk_option_menu_get_history (omenu));
+ g_signal_handlers_unblock_by_func (
+ G_OBJECT (__widget_romaji_theme_menu),
+ (gpointer) (on_romaji_theme_menu_changed),
+ NULL);
+
+ success = load_romaji_theme ();
+
+ setup_romaji_window_value (SCIM_ANTHY_TABLE_EDITOR (user_data));
+ } else {
+ success = load_romaji_theme ();
+ }
+
+ if (success) {
+ // sync widgets
+ __style_changed = true;
+ __config_changed = true;
+ }
+}
+
+static void
+on_romaji_customize_button_clicked (GtkWidget *button, gpointer data)
+{
+ GtkWidget *widget = create_romaji_window (
+ GTK_WINDOW (gtk_widget_get_toplevel (button)));
+ gtk_dialog_run (GTK_DIALOG (widget));
+ gtk_widget_destroy (widget);
+}
+
+static void
+on_table_editor_add_entry (ScimAnthyTableEditor *editor, gpointer data)
+{
+ const gchar *sequence, *result;
+ sequence = scim_anthy_table_editor_get_nth_text (editor, 0);
+ result = scim_anthy_table_editor_get_nth_text (editor, 1);
+
+ // real add
+ __user_style_file.set_string (__romaji_fund_table, sequence, result);
+}
+
+static void
+on_table_editor_added_entry (ScimAnthyTableEditor *editor, gpointer data)
+{
+ // change menu item to "User defined"
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_romaji_theme_menu2),
+ ROMAJI_THEME_INDEX_USER_DEFINED);
+
+ __style_changed = true;
+}
+
+static void
+on_table_editor_remove_entry (ScimAnthyTableEditor *editor, gpointer data)
+{
+ const gchar *sequence;
+ sequence = scim_anthy_table_editor_get_nth_text (editor, 0);
+
+ // real remove
+ __user_style_file.delete_key (__romaji_fund_table, sequence);
+
+ __style_changed = true;
+}
+
+static void
+on_table_editor_removed_entry (ScimAnthyTableEditor *editor, gpointer data)
+{
+ // change menu item to "User deined"
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_romaji_theme_menu2),
+ ROMAJI_THEME_INDEX_USER_DEFINED);
+
+ __style_changed = true;
+}
+
+}
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004 Hiroyuki Ikezoe
+ * Copyright (C) 2004-2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SCIM_ANTHY_SETUP_ROMAJI_H__
+#define __SCIM_ANTHY_SETUP_ROMAJI_H__
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+
+#define Uses_SCIM_CONFIG_BASE
+#include <scim.h>
+
+namespace scim_anthy {
+
+GtkWidget *romaji_page_create_ui (void);
+void romaji_page_load_config (const ConfigPointer &config);
+void romaji_page_save_config (const ConfigPointer &config);
+bool romaji_page_query_changed (void);
+
+};
+
+#endif /* __SCIM_ANTHY_SETUP_ROMAJI_H__ */
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "scim_anthy_style_file.h"
+
+using namespace scim_anthy;
+
+const int MAX_LINE_LENGTH = 4096;
+
+static String
+escape (const String &str)
+{
+ String dest = str;
+
+ for (unsigned int i = 0; i < dest.size (); i++) {
+ if (dest[i] == '#' || // for comment
+ dest[i] == '\\' || // for backslash itself
+ dest[i] == '=' || // for separatort
+ dest[i] == '[' || dest[i] == ']' || // for section
+ dest[i] == ',' || // for array
+ dest[i] == ' ' || dest[i] == '\t') // for space
+ {
+ dest.insert (i, "\\");
+ i++;
+ }
+ }
+
+ return dest;
+}
+
+static String
+unescape (const String &str)
+{
+ String dest = str;
+
+ for (unsigned int i = 0; i < dest.size (); i++) {
+ if (dest[i] == '\\') {
+ dest.erase (i, 1);
+ if (i < dest.size () && dest[i] == '\\')
+ i++;
+ }
+ }
+
+ return dest;
+}
+
+StyleLine::StyleLine (StyleFile *style_file, String line)
+ : m_style_file (style_file),
+ m_line (line),
+ m_type (SCIM_ANTHY_STYLE_LINE_UNKNOWN)
+{
+}
+
+StyleLine::StyleLine (StyleFile *style_file, String key, String value)
+ : m_style_file (style_file),
+ m_line (escape (key) + String ("=")),
+ m_type (SCIM_ANTHY_STYLE_LINE_KEY)
+{
+ set_value (value);
+}
+
+StyleLine::StyleLine (StyleFile *style_file, String key,
+ std::vector<String> &value)
+ : m_style_file (style_file),
+ m_line (escape (key) + String("=")),
+ m_type (SCIM_ANTHY_STYLE_LINE_KEY)
+{
+ set_value_array (value);
+}
+
+StyleLine::~StyleLine ()
+{
+}
+
+StyleLineType
+StyleLine::get_type (void)
+{
+ if (m_type != SCIM_ANTHY_STYLE_LINE_UNKNOWN)
+ return m_type;
+
+ unsigned int spos, epos;
+ for (spos = 0;
+ spos < m_line.length () && isspace (m_line[spos]);
+ spos++);
+ if (m_line.length() > 0) {
+ for (epos = m_line.length () - 1;
+ epos >= 0 && isspace (m_line[epos]);
+ epos--);
+ } else {
+ epos = 0;
+ }
+
+ if (m_line.length() == 0 || spos >= m_line.length()) {
+ m_type = SCIM_ANTHY_STYLE_LINE_SPACE;
+ return m_type;
+
+ } else if (m_line[spos] == '#') {
+ m_type = SCIM_ANTHY_STYLE_LINE_COMMENT;
+ return m_type;
+
+ } else if (m_line[spos] == '[' && m_line[epos] == ']') {
+ m_type = SCIM_ANTHY_STYLE_LINE_SECTION;
+ return m_type;
+ }
+
+ m_type = SCIM_ANTHY_STYLE_LINE_KEY;
+ return m_type;
+}
+
+bool
+StyleLine::get_section (String §ion)
+{
+ if (get_type () != SCIM_ANTHY_STYLE_LINE_SECTION)
+ return false;
+
+ unsigned int spos, epos;
+ for (spos = 0;
+ spos < m_line.length () && isspace (m_line[spos]);
+ spos++);
+ for (epos = m_line.length () - 1;
+ epos >= 0 && isspace (m_line[epos]);
+ epos--);
+ spos++;
+
+ if (spos < epos)
+ section = m_line.substr (spos, epos - spos);
+ else
+ section = String ();
+
+ return true;
+}
+
+bool
+StyleLine::get_key (String &key)
+{
+ if (get_type () != SCIM_ANTHY_STYLE_LINE_KEY)
+ return false;
+
+ unsigned int spos, epos;
+ for (spos = 0;
+ spos < m_line.length () && isspace (m_line[spos]);
+ spos++);
+ bool found = false;
+ for (epos = spos;
+ epos < m_line.length ();
+ epos++)
+ {
+ if (m_line[epos] == '\\') {
+ epos++;
+ continue;
+ }
+ if (m_line[epos] == '=') {
+ found = true;
+ break;
+ }
+ }
+ for (--epos;
+ epos >= spos && isspace (m_line[epos]);
+ epos--);
+ if (!isspace(m_line[epos]))
+ epos++;
+
+ if (spos >= 0 && spos < epos && epos <= m_line.length ()) {
+ key = unescape (m_line.substr (spos, epos - spos));
+ } else
+ key = String ();
+
+ return true;
+}
+
+static int
+get_value_position (String &str)
+{
+ unsigned int spos;
+ for (spos = 0;
+ spos < str.length ();
+ spos++)
+ {
+ if (str[spos] == '\\') {
+ spos++;
+ continue;
+ }
+ if (str[spos] == '=') {
+ break;
+ }
+ }
+ if (spos >= str.length ())
+ return true;
+ else
+ spos++;
+ for (;
+ spos < str.length () && isspace(str[spos]);
+ spos++);
+
+ return spos;
+}
+
+bool
+StyleLine::get_value (String &value)
+{
+ if (get_type () != SCIM_ANTHY_STYLE_LINE_KEY)
+ return false;
+
+ unsigned int spos = get_value_position (m_line);
+ unsigned int epos = m_line.length ();
+
+ value = unescape (m_line.substr (spos, epos - spos));
+
+ return true;
+}
+
+void
+StyleLine::set_value (String value)
+{
+ String key;
+ get_key (key);
+ m_line = escape (key) + String ("=") + escape (value);
+}
+
+bool
+StyleLine::get_value_array (std::vector<String> &value)
+{
+ if (get_type () != SCIM_ANTHY_STYLE_LINE_KEY)
+ return false;
+
+ unsigned int spos = get_value_position (m_line);
+ unsigned int epos = m_line.length ();
+
+ unsigned int head_of_element = spos;
+ for (unsigned int i = spos; i <= epos; i++) {
+ if (i < epos && m_line[i] == '\\') {
+ i++;
+ continue;
+ }
+
+ if (i == epos || m_line[i] == ',') {
+ String str;
+ if (head_of_element == epos)
+ str = String ();
+ else
+ str = unescape (m_line.substr (head_of_element,
+ i - head_of_element));
+ value.push_back (str);
+ head_of_element = i + 1;
+ }
+ }
+
+ return true;
+}
+
+void
+StyleLine::set_value_array (std::vector<String> &value)
+{
+ String key;
+ get_key (key);
+
+ m_line = escape (key) + String ("=");
+ for (unsigned int i = 0; i < value.size (); i++) {
+ if (i != 0)
+ m_line += ",";
+ m_line += escape (value[i]);
+ }
+}
+
+
+StyleFile::StyleFile ()
+{
+ setup_default_entries ();
+}
+
+StyleFile::~StyleFile ()
+{
+}
+
+bool
+StyleFile::load (const char *filename)
+{
+ clear ();
+ setup_default_entries ();
+ m_filename = filename;
+
+ std::ifstream in_file (filename);
+ if (!in_file)
+ return false;
+
+ clear ();
+
+ m_sections.push_back (StyleLines ());
+ StyleLines *section = &m_sections[0];
+ unsigned int section_id = 0;
+
+ char buf[MAX_LINE_LENGTH];
+ do {
+ in_file.getline (buf, MAX_LINE_LENGTH);
+ if (in_file.eof ())
+ break;
+
+ WideString dest;
+ m_iconv.convert (dest, buf);
+ StyleLine line (this, utf8_wcstombs (dest));
+ StyleLineType type = line.get_type ();
+
+ if (type == SCIM_ANTHY_STYLE_LINE_SECTION) {
+ m_sections.push_back (StyleLines ());
+ section = &m_sections.back();
+ section_id++;
+ }
+
+ section->push_back (line);
+
+ if (section_id == 0) {
+ String key;
+ line.get_key (key);
+ if (key == "FormatVersion") {
+ line.get_value (m_format_version);
+
+ } else if (key == "Encoding") {
+ line.get_value (m_encoding);
+ bool success = m_iconv.set_encoding (m_encoding);
+ if (!success)
+ m_iconv.set_encoding ("UTF-8");
+
+ } else if (key == "Title") {
+ line.get_value (m_title);
+
+ } else if (key == "Version") {
+ line.get_value (m_version);
+ }
+ }
+ } while (!in_file.eof ());
+
+ in_file.close ();
+
+ m_filename = filename;
+
+ return true;
+}
+
+bool
+StyleFile::save (const char *filename)
+{
+ std::ofstream out_file (filename);
+ if (!out_file)
+ return false;
+
+ StyleSections::iterator it;
+ for (it = m_sections.begin (); it != m_sections.end (); it++) {
+ StyleLines::iterator lit;
+ for (lit = it->begin (); lit != it->end (); lit++) {
+ String line, dest;
+ lit->get_line (line);
+ m_iconv.convert (dest, utf8_mbstowcs (line));
+ out_file << dest.c_str () << std::endl;
+ }
+ }
+
+ out_file.close ();
+
+ m_filename = filename;
+
+ return true;
+}
+
+void
+StyleFile::clear (void)
+{
+ m_filename = String ();
+ m_format_version = String ();
+ m_encoding = String ();
+ m_title = String ();
+ m_version = String ();
+ m_sections.clear ();
+}
+
+String
+StyleFile::get_encoding (void)
+{
+ return m_encoding;
+}
+
+String
+StyleFile::get_title (void)
+{
+ return m_title;
+}
+
+String
+StyleFile::get_file_name (void)
+{
+ return m_filename;
+}
+
+bool
+StyleFile::get_string (String &value, String section, String key)
+{
+ StyleSections::iterator it;
+ for (it = m_sections.begin (); it != m_sections.end (); it++) {
+ if (it->size () <= 0)
+ continue;
+
+ String s, k;
+ (*it)[0].get_section (s);
+
+ if (s != section)
+ continue;
+
+ StyleLines::iterator lit;
+ for (lit = it->begin (); lit != it->end (); lit++) {
+ lit->get_key (k);
+ if (k == key) {
+ lit->get_value (value);
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+bool
+StyleFile::get_string (WideString &value, String section, String key)
+{
+ String str;
+ bool success = get_string (str, section, key);
+ if (!success)
+ return false;
+ value = utf8_mbstowcs (str);
+ return true;
+}
+
+bool
+StyleFile::get_string_array (std::vector<String> &value,
+ String section, String key)
+{
+ StyleLines *lines = find_section (section);
+ if (!lines)
+ return false;
+
+ // find entry
+ StyleLines::iterator lit;
+ for (lit = lines->begin (); lit != lines->end (); lit++) {
+ String k;
+ lit->get_key (k);
+ if (k == key) {
+ lit->get_value_array (value);
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool
+StyleFile::get_string_array (std::vector<WideString> &value,
+ String section, String key)
+{
+ std::vector<String> array;
+ bool success = get_string_array (array, section, key);
+ if (!success)
+ return false;
+
+ std::vector<String>::iterator it;
+ for (it = array.begin (); it != array.end (); it++)
+ value.push_back (utf8_mbstowcs (*it));
+ return true;
+}
+
+void
+StyleFile::set_string (String section, String key, String value)
+{
+ StyleLines *lines = find_section (section);
+ if (lines) {
+ // find entry
+ StyleLines::iterator lit, last = lines->begin () + 1;
+ for (lit = last; lit != lines->end (); lit++) {
+ StyleLineType type = lit->get_type ();
+ if (type != SCIM_ANTHY_STYLE_LINE_SPACE)
+ last = lit + 1;
+
+ String k;
+ lit->get_key (k);
+
+ // replace existing entry
+ if (k.length () > 0 && k == key) {
+ lit->set_value (value);
+ return;
+ }
+ }
+
+ // append new entry if no mathced entry exists.
+ lines->insert (last, StyleLine (this, key, value));
+
+ } else {
+ StyleLines &newsec = append_new_section (section);
+
+ // append new entry
+ newsec.push_back (StyleLine (this, key, value));
+ }
+}
+
+void
+StyleFile::set_string (String section, String key, WideString value)
+{
+ set_string (section, key, utf8_wcstombs (value));
+}
+
+void
+StyleFile::set_string_array (String section, String key,
+ std::vector<String> &value)
+{
+ StyleLines *lines = find_section (section);
+ if (lines) {
+ // find entry
+ StyleLines::iterator lit, last = lines->begin () + 1;
+ for (lit = last; lit != lines->end (); lit++) {
+ StyleLineType type = lit->get_type ();
+ if (type != SCIM_ANTHY_STYLE_LINE_SPACE)
+ last = lit;
+
+ String k;
+ lit->get_key (k);
+
+ // replace existing entry
+ if (k.length () > 0 && k == key) {
+ lit->set_value_array (value);
+ return;
+ }
+ }
+
+ // append new entry if no mathced entry exists.
+ lines->insert (last + 1, StyleLine (this, key, value));
+
+ } else {
+ StyleLines &newsec = append_new_section (section);
+
+ // append new entry
+ newsec.push_back (StyleLine (this, key, value));
+ }
+}
+
+void
+StyleFile::set_string_array (String section, String key,
+ std::vector<WideString> &value)
+{
+ std::vector<String> array;
+ std::vector<WideString>::iterator it;
+ for (it = value.begin (); it != value.end (); it++)
+ array.push_back (utf8_wcstombs (*it));
+ set_string_array (section, key, array);
+}
+
+bool
+StyleFile::get_section_list (StyleSections §ions)
+{
+ sections = m_sections;
+ return true;
+}
+
+bool
+StyleFile::get_entry_list (StyleLines &lines, String section)
+{
+ StyleSections::iterator it;
+ for (it = m_sections.begin (); it != m_sections.end (); it++) {
+ if (it->size () <= 0)
+ continue;
+
+ String s;
+ (*it)[0].get_section (s);
+ if (s == section) {
+ lines = (*it);
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool
+StyleFile::get_key_list (std::vector<String> &keys, String section)
+{
+ StyleLines *lines = find_section (section);
+ if (!lines)
+ return false;
+
+ StyleLines::iterator lit;
+ for (lit = lines->begin (); lit != lines->end (); lit++) {
+ if (lit->get_type () != SCIM_ANTHY_STYLE_LINE_KEY)
+ continue;
+
+ String key;
+ lit->get_key (key);
+ keys.push_back (key);
+ }
+ return true;
+}
+
+void
+StyleFile::delete_key (String section, String key)
+{
+ StyleLines *lines = find_section (section);
+ if (!lines)
+ return;
+
+ // find entry
+ StyleLines::iterator lit;
+ for (lit = lines->begin (); lit != lines->end (); lit++) {
+ String k;
+ lit->get_key (k);
+ if (k == key) {
+ lines->erase (lit);
+ return;
+ }
+ }
+}
+
+void
+StyleFile::delete_section (String section)
+{
+ StyleSections::iterator it;
+ for (it = m_sections.begin (); it != m_sections.end (); it++) {
+ if (it->size () <= 0)
+ continue;
+
+ StyleLines::iterator lit;
+ String s;
+ (*it)[0].get_section (s);
+ if (s == section) {
+ m_sections.erase (it);
+ return;
+ }
+ }
+}
+
+Key2KanaTable *
+StyleFile::get_key2kana_table (String section)
+{
+ Key2KanaTable *table = NULL;
+
+ std::vector<String> keys;
+ bool success = get_key_list (keys, section);
+ if (success) {
+ table = new Key2KanaTable (utf8_mbstowcs (get_title ()));
+ std::vector<String>::iterator it;
+ for (it = keys.begin (); it != keys.end (); it++) {
+ std::vector<String> array;
+ get_string_array (array, section, *it);
+ table->append_rule (*it, array);
+ }
+ }
+
+ return table;
+}
+
+void
+StyleFile::setup_default_entries (void)
+{
+ m_encoding = "UTF-8";
+ m_title = "User defined";
+ m_iconv.set_encoding (m_encoding);
+ m_sections.push_back (StyleLines ());
+
+ m_sections.push_back (StyleLines ());
+ StyleLines &newsec = m_sections.back ();
+ String str = String ("Encoding") + String ("=") + escape (m_encoding);
+ newsec.push_back (StyleLine (this, str.c_str ()));
+ str = String ("Title") + String ("=") + escape (m_title);
+ newsec.push_back (StyleLine (this, str.c_str ()));
+}
+
+StyleLines *
+StyleFile::find_section (const String §ion)
+{
+ // find section
+ StyleSections::iterator it;
+ for (it = m_sections.begin (); it != m_sections.end (); it++) {
+ if (it->size () <= 0)
+ continue;
+
+ String s;
+ (*it)[0].get_section (s);
+
+ if (s == section)
+ return &(*it);
+ }
+
+ return NULL;
+}
+
+StyleLines &
+StyleFile::append_new_section (const String §ion)
+{
+ // append space before new section
+ if (!m_sections.empty()) {
+ StyleLines &sec = m_sections.back ();
+ if (sec.empty() ||
+ sec.back().get_type() != SCIM_ANTHY_STYLE_LINE_SPACE)
+ {
+ sec.push_back (StyleLine (this, ""));
+ }
+ }
+
+ //
+ // append new section
+ //
+ m_sections.push_back (StyleLines ());
+ StyleLines &newsec = m_sections.back ();
+
+ // new section entry
+ String str = String ("[") + String (section) + String ("]");
+ newsec.push_back (StyleLine (this, str.c_str ()));
+
+ return newsec;
+}
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SCIM_ANTHY_STYLE_FILE_H__
+#define __SCIM_ANTHY_STYLE_FILE_H__
+
+#define Uses_SCIM_ICONV
+#include <scim.h>
+
+#include "scim_anthy_key2kana_table.h"
+
+using namespace scim;
+
+namespace scim_anthy {
+
+class StyleLine;
+class StyleSection;
+class StyleFile;
+
+typedef std::vector<StyleLine> StyleLines;
+typedef std::vector<StyleLines> StyleSections;
+typedef std::vector<StyleFile> StyleFiles;
+
+typedef enum {
+ SCIM_ANTHY_STYLE_LINE_UNKNOWN,
+ SCIM_ANTHY_STYLE_LINE_SPACE,
+ SCIM_ANTHY_STYLE_LINE_COMMENT,
+ SCIM_ANTHY_STYLE_LINE_SECTION,
+ SCIM_ANTHY_STYLE_LINE_KEY,
+} StyleLineType;
+
+class StyleLine
+{
+public:
+ StyleLine (StyleFile *style_file,
+ String line);
+ StyleLine (StyleFile *style_file,
+ String key,
+ String value);
+ StyleLine (StyleFile *style_file,
+ String key,
+ std::vector<String> &value);
+ ~StyleLine ();
+
+public:
+ StyleLineType get_type (void);
+ void get_line (String &line) { line = m_line; }
+ bool get_section (String §ion);
+ bool get_key (String &key);
+ bool get_value (String &value);
+ void set_value (String value);
+ bool get_value_array (std::vector<String> &value);
+ void set_value_array (std::vector<String> &value);
+
+private:
+ StyleFile *m_style_file;
+ String m_line;
+ StyleLineType m_type;
+};
+
+class StyleFile
+{
+public:
+ StyleFile ();
+ ~StyleFile ();
+
+public:
+ bool load (const char *filename);
+ bool save (const char *filename);
+
+ String get_encoding (void);
+ String get_title (void);
+ String get_file_name (void);
+
+ bool get_section_list (StyleSections §ions);
+ bool get_entry_list (StyleLines &lines,
+ String section);
+ bool get_key_list (std::vector<String> &keys,
+ String section);
+ bool get_string (String &value,
+ String section,
+ String key);
+ bool get_string (WideString &value,
+ String section,
+ String key);
+ bool get_string_array (std::vector<String> &value,
+ String section,
+ String key);
+ bool get_string_array (std::vector<WideString> &value,
+ String section,
+ String key);
+
+ void set_string (String section,
+ String key,
+ String value);
+ void set_string (String section,
+ String key,
+ WideString value);
+ void set_string_array (String section,
+ String key,
+ std::vector<String> &value);
+ void set_string_array (String section,
+ String key,
+ std::vector<WideString> &value);
+
+ void delete_key (String section,
+ String key);
+ void delete_section (String section);
+
+public: // for getting specific data
+ Key2KanaTable *
+ get_key2kana_table (String section);
+
+private:
+ void clear (void);
+ void setup_default_entries (void);
+ StyleLines *
+ find_section (const String §ion);
+ StyleLines &
+ append_new_section (const String §ion);
+
+private:
+ IConvert m_iconv;
+
+ String m_filename;
+ String m_format_version;
+ String m_encoding;
+ String m_title;
+ String m_version;
+
+ StyleSections m_sections;
+};
+
+}
+
+#endif /* __SCIM_ANTHY_STYLE_FILE_H__ */
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004-2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#endif
+
+#include "scim_anthy_table_editor.h"
+
+#include <string.h>
+#include <ctype.h>
+#include "scim_anthy_intl.h"
+
+enum {
+ ADD_ENTRY_SIGNAL,
+ REMOVE_ENTRY_SIGNAL,
+ LAST_SIGNAL,
+};
+
+static void scim_anthy_table_editor_class_init (ScimAnthyTableEditorClass *klass);
+static void scim_anthy_table_editor_init (ScimAnthyTableEditor *object);
+static void scim_anthy_table_editor_dispose (GObject *object);
+
+static void scim_anthy_table_editor_add_entry (ScimAnthyTableEditor *editor);
+static void scim_anthy_table_editor_remove_entry (ScimAnthyTableEditor *editor);
+
+static gint compare_string (GtkTreeModel *model,
+ GtkTreeIter *a,
+ GtkTreeIter *b,
+ gpointer user_data);
+
+static void on_table_view_selection_changed (GtkTreeSelection *selection,
+ gpointer data);
+static void on_add_button_clicked (GtkButton *button,
+ gpointer data);
+static void on_remove_button_clicked (GtkButton *button,
+ gpointer data);
+static void on_entry_activate (GtkEntry *entry,
+ gpointer data);
+static void on_entry_changed (GtkEditable *editable,
+ gpointer data);
+static void on_sequence_entry_insert_text (GtkEditable *editable,
+ const gchar *text,
+ gint length,
+ gint *position,
+ gpointer data);
+
+static guint editor_signals[LAST_SIGNAL] = { 0 };
+static GtkDialogClass *parent_class = NULL;
+
+GType
+scim_anthy_table_editor_get_type (void)
+{
+ static GType type = 0;
+
+ if (!type) {
+ static const GTypeInfo info = {
+ sizeof (ScimAnthyTableEditorClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) scim_anthy_table_editor_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (ScimAnthyTableEditor),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) scim_anthy_table_editor_init,
+ };
+
+ type = g_type_register_static (GTK_TYPE_DIALOG,
+ "ScimAnthyTableEditor",
+ &info, (GTypeFlags) 0);
+ }
+
+ return type;
+}
+
+static void
+scim_anthy_table_editor_class_init (ScimAnthyTableEditorClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ //GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+ parent_class = (GtkDialogClass *) g_type_class_peek_parent (klass);
+
+ editor_signals[ADD_ENTRY_SIGNAL] =
+ g_signal_new ("add-entry",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ScimAnthyTableEditorClass, add_entry),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+ editor_signals[REMOVE_ENTRY_SIGNAL] =
+ g_signal_new ("remove-entry",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ScimAnthyTableEditorClass, remove_entry),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ gobject_class->dispose = scim_anthy_table_editor_dispose;
+ klass->add_entry = scim_anthy_table_editor_add_entry;
+ klass->remove_entry = scim_anthy_table_editor_remove_entry;
+}
+
+static void
+scim_anthy_table_editor_init (ScimAnthyTableEditor *editor)
+{
+ gtk_dialog_add_buttons (GTK_DIALOG (editor),
+ GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
+ NULL);
+
+ gtk_window_set_default_size (GTK_WINDOW (editor), 350, 250);
+ gtk_window_set_position (GTK_WINDOW (editor),
+ GTK_WIN_POS_CENTER_ON_PARENT);
+
+ // edit area
+ GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (editor)->vbox), hbox,
+ TRUE, TRUE, 0);
+ gtk_widget_show (hbox);
+
+ // tree view area
+ GtkWidget *scrwin = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrwin),
+ GTK_SHADOW_IN);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrwin),
+ GTK_POLICY_AUTOMATIC,
+ GTK_POLICY_AUTOMATIC);
+ gtk_box_pack_start (GTK_BOX (hbox), scrwin, TRUE, TRUE, 0);
+ gtk_widget_show (scrwin);
+
+ GtkWidget *treeview = gtk_tree_view_new ();
+ editor->treeview = treeview;
+ gtk_container_add (GTK_CONTAINER (scrwin), treeview);
+ gtk_widget_show (treeview);
+
+ GtkTreeSelection *selection;
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
+ g_signal_connect (G_OBJECT (selection), "changed",
+ G_CALLBACK (on_table_view_selection_changed), editor);
+
+ gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview), TRUE);
+ gtk_tree_view_set_headers_clickable (GTK_TREE_VIEW (treeview), TRUE);
+
+ // button area
+ GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
+ editor->button_area = vbox;
+ gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 5);
+ gtk_widget_show (vbox);
+
+ editor->entries = NULL;
+}
+
+static void
+scim_anthy_table_editor_dispose (GObject *object)
+{
+ ScimAnthyTableEditor *editor = SCIM_ANTHY_TABLE_EDITOR (object);
+
+ if (editor->entries) {
+ g_list_free (editor->entries);
+ editor->entries = NULL;
+ }
+
+ if (G_OBJECT_CLASS(parent_class)->dispose)
+ G_OBJECT_CLASS(parent_class)->dispose(object);
+}
+
+GtkWidget *
+scim_anthy_table_editor_new (void)
+{
+ return GTK_WIDGET(g_object_new (SCIM_ANTHY_TYPE_TABLE_EDITOR,
+ NULL));
+}
+
+void
+scim_anthy_table_editor_set_columns (ScimAnthyTableEditor *editor,
+ const char **titles)
+{
+ g_return_if_fail (SCIM_ANTHY_IS_TABLE_EDITOR (editor));
+
+ if (!titles)
+ return;
+
+ gint n_cols;
+ for (n_cols = 0; titles[n_cols]; n_cols++);
+ if (n_cols <= 0)
+ return;
+
+ GType types[n_cols];
+ for (gint i = 0; i < n_cols; i++)
+ types[i] = G_TYPE_STRING;
+
+ GtkListStore *store = gtk_list_store_newv (n_cols, types);
+ gtk_tree_view_set_model (GTK_TREE_VIEW (editor->treeview),
+ GTK_TREE_MODEL (store));
+
+ // columns
+ for (int i = 0; i < n_cols; i++) {
+ GtkCellRenderer *cell;
+ GtkTreeViewColumn *column;
+ cell = gtk_cell_renderer_text_new ();
+ column = gtk_tree_view_column_new_with_attributes (titles[i], cell,
+ "text", i,
+ NULL);
+ gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
+ gtk_tree_view_column_set_fixed_width (column, 80);
+ gtk_tree_view_column_set_resizable(column, TRUE);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(editor->treeview), column);
+
+ gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (store), i,
+ compare_string,
+ GINT_TO_POINTER (i), NULL);
+ gtk_tree_view_column_set_sort_column_id (column, i);
+ }
+
+ // entries
+ for (int i = 0; i < n_cols; i++) {
+ GtkWidget *label = gtk_label_new_with_mnemonic (titles[i]);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (editor->button_area), label, FALSE, FALSE, 2);
+ gtk_widget_show (label);
+
+ GtkWidget *entry = gtk_entry_new ();
+ gtk_box_pack_start (GTK_BOX (editor->button_area), entry,
+ FALSE, FALSE, 2);
+ gtk_widget_set_size_request (entry, 80, -1);
+ g_signal_connect (G_OBJECT (entry), "activate",
+ G_CALLBACK (on_entry_activate), editor);
+ g_signal_connect (G_OBJECT (entry), "changed",
+ G_CALLBACK (on_entry_changed), editor);
+ if (i == 0)
+ g_signal_connect (G_OBJECT (entry), "insert-text",
+ G_CALLBACK (on_sequence_entry_insert_text),
+ editor);
+ gtk_widget_show (entry);
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
+
+ editor->entries = g_list_append (editor->entries, entry);
+ }
+
+ // buttons
+ GtkWidget *button = gtk_button_new_from_stock (GTK_STOCK_ADD);
+ editor->add_button = button;
+ gtk_box_pack_start (GTK_BOX (editor->button_area), button, FALSE, FALSE, 5);
+ g_signal_connect (G_OBJECT (button), "clicked",
+ G_CALLBACK (on_add_button_clicked), editor);
+ gtk_widget_set_sensitive (button, FALSE);
+ gtk_widget_show (button);
+
+ button = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
+ editor->remove_button = button;
+ gtk_box_pack_start (GTK_BOX (editor->button_area), button, FALSE, FALSE, 5);
+ g_signal_connect (G_OBJECT (button), "clicked",
+ G_CALLBACK (on_remove_button_clicked), editor);
+ gtk_widget_set_sensitive (button, FALSE);
+ gtk_widget_show (button);
+
+ // clean
+ g_object_unref (store);
+}
+
+const char *
+scim_anthy_table_editor_get_nth_text (ScimAnthyTableEditor *editor, guint nth)
+{
+ g_return_val_if_fail (SCIM_ANTHY_IS_TABLE_EDITOR (editor), "");
+
+ GtkEntry *entry = GTK_ENTRY (g_list_nth_data (editor->entries, nth));
+ if (!entry)
+ return "";
+
+ return gtk_entry_get_text (entry);
+}
+
+static void
+scim_anthy_table_editor_add_entry (ScimAnthyTableEditor *editor)
+{
+ GtkTreeView *treeview = GTK_TREE_VIEW (editor->treeview);
+ GtkTreeModel *model = gtk_tree_view_get_model (treeview);
+ GtkTreeIter iter;
+
+ gboolean go_next;
+ bool found = false;
+
+ const gchar *sequence;
+ sequence = scim_anthy_table_editor_get_nth_text (editor, 0);
+
+ if (!sequence)
+ return;
+
+ for (go_next = gtk_tree_model_get_iter_first (model, &iter);
+ go_next;
+ go_next = gtk_tree_model_iter_next (model, &iter))
+ {
+ gchar *seq = NULL;
+ gtk_tree_model_get (model, &iter,
+ 0, &seq,
+ -1);
+ if (seq && !strcmp (sequence, seq)) {
+ found = true;
+ g_free (seq);
+ break;
+ }
+ g_free (seq);
+ }
+
+ if (!found)
+ gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+
+ GList *node;
+ gint i;
+ for (i = 0, node = editor->entries;
+ node;
+ i++, node = g_list_next (node))
+ {
+ const char *text = gtk_entry_get_text (GTK_ENTRY (node->data));
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+ i, text,
+ -1);
+ }
+
+ GtkTreePath *path = gtk_tree_model_get_path (model, &iter);
+ gtk_tree_view_set_cursor (treeview, path, NULL, FALSE);
+ gtk_tree_path_free (path);
+}
+
+static void
+scim_anthy_table_editor_remove_entry (ScimAnthyTableEditor *editor)
+{
+ GtkTreeView *treeview = GTK_TREE_VIEW (editor->treeview);
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (treeview);
+ GtkTreeModel *model = NULL;
+ GtkTreeIter iter, next;
+ gboolean selected, success;
+
+ selected = gtk_tree_selection_get_selected (selection, &model, &iter);
+ if (!selected)
+ return;
+
+ gchar *sequence = NULL;
+ gtk_tree_model_get (model, &iter,
+ 0, &sequence,
+ -1);
+
+ next = iter;
+ success = gtk_tree_model_iter_next (model, &next);
+ GtkTreePath *path = NULL;
+ if (success) {
+ path = gtk_tree_model_get_path (model, &next);
+ } else {
+ path = gtk_tree_model_get_path (model, &iter);
+ if (path)
+ success = gtk_tree_path_prev (path);
+ }
+
+ if (success && path)
+ gtk_tree_view_set_cursor (GTK_TREE_VIEW (treeview), path, NULL, FALSE);
+ if (path)
+ gtk_tree_path_free (path);
+
+ gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
+
+ g_free (sequence);
+}
+
+static gint
+compare_string (GtkTreeModel *model,
+ GtkTreeIter *a,
+ GtkTreeIter *b,
+ gpointer user_data)
+{
+ gint n_cols, column, cur_column = GPOINTER_TO_INT (user_data);
+ gint ret = 0;
+
+ n_cols = gtk_tree_model_get_n_columns (model);
+
+ if (cur_column < n_cols) {
+ gchar *seq1 = NULL, *seq2 = NULL;
+ gtk_tree_model_get (model, a,
+ cur_column, &seq1,
+ -1);
+ gtk_tree_model_get (model, b,
+ cur_column, &seq2,
+ -1);
+ if (!seq1 && seq2) {
+ ret = -1;
+ } else if (seq1 && !seq2) {
+ ret = 1;
+ } else if (seq1 && seq2) {
+ ret = strcmp (seq1, seq2);
+ } else {
+ ret = 0;
+ }
+ g_free (seq1);
+ g_free (seq2);
+ }
+
+ for (column = 0; ret == 0 && column < n_cols; column++) {
+ gchar *seq1 = NULL, *seq2 = NULL;
+
+ if (cur_column == column)
+ continue;
+
+ gtk_tree_model_get (model, a,
+ column, &seq1,
+ -1);
+ gtk_tree_model_get (model, b,
+ column, &seq2,
+ -1);
+ if (!seq1 && seq2) {
+ ret = -1;
+ } else if (seq1 && !seq2) {
+ ret = 1;
+ } else if (!seq1 && !seq2) {
+ ret = strcmp (seq1, seq2);
+ } else {
+ ret = 0;
+ }
+ g_free (seq1);
+ g_free (seq2);
+ }
+
+ return ret;
+}
+
+static void
+on_table_view_selection_changed (GtkTreeSelection *selection, gpointer data)
+{
+ ScimAnthyTableEditor *editor = SCIM_ANTHY_TABLE_EDITOR (data);
+ GtkTreeModel *model = NULL;
+ GtkTreeIter iter;
+
+ gboolean selected;
+
+ selected = gtk_tree_selection_get_selected (selection, &model, &iter);
+
+ if (editor->remove_button) {
+ if (selected) {
+ gtk_widget_set_sensitive (editor->remove_button, true);
+ } else {
+ gtk_widget_set_sensitive (editor->remove_button, false);
+ }
+ }
+
+ GList *node;
+
+ if (selected) {
+ gint i;
+ for (i = 0, node = editor->entries;
+ node;
+ i++, node = g_list_next (node))
+ {
+ gchar *str = NULL;
+ gtk_tree_model_get (model, &iter,
+ i, &str,
+ -1);
+ gtk_entry_set_text (GTK_ENTRY (node->data), str);
+ g_free (str);
+ }
+ } else {
+ for (node = editor->entries; node; node = g_list_next (node))
+ gtk_entry_set_text (GTK_ENTRY (node->data), "");
+ }
+}
+
+static void
+on_add_button_clicked (GtkButton *button, gpointer data)
+{
+ ScimAnthyTableEditor *editor = SCIM_ANTHY_TABLE_EDITOR (data);
+ g_signal_emit (editor, editor_signals[ADD_ENTRY_SIGNAL], 0);
+}
+
+static void
+on_remove_button_clicked (GtkButton *button, gpointer data)
+{
+ ScimAnthyTableEditor *editor = SCIM_ANTHY_TABLE_EDITOR (data);
+ g_signal_emit (editor, editor_signals[REMOVE_ENTRY_SIGNAL], 0);
+}
+
+static void
+on_entry_activate (GtkEntry *entry, gpointer data)
+{
+ ScimAnthyTableEditor *editor = SCIM_ANTHY_TABLE_EDITOR (data);
+ g_signal_emit (editor, editor_signals[ADD_ENTRY_SIGNAL], 0);
+}
+
+static void
+on_entry_changed (GtkEditable *editable, gpointer data)
+{
+ ScimAnthyTableEditor *editor = SCIM_ANTHY_TABLE_EDITOR (data);
+ const char *seq;
+
+ if (!editor->entries || !editor->entries->data)
+ return;
+
+ seq = gtk_entry_get_text (GTK_ENTRY (editor->entries->data));
+ gtk_widget_set_sensitive (editor->add_button,
+ seq && *seq);
+}
+
+static void
+on_sequence_entry_insert_text (GtkEditable *editable,
+ const gchar *text,
+ gint length,
+ gint *position,
+ gpointer data)
+{
+ for (int i = 0; i < length; i++) {
+ if (!isascii (text[i]) || isspace (text[i])) {
+ g_signal_stop_emission_by_name (editable, "insert_text");
+ return;
+ }
+ }
+}
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2004-2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SCIM_ANTHY_TABLE_EDITOR_H__
+#define __SCIM_ANTHY_TABLE_EDITOR_H__
+
+#include <gtk/gtk.h>
+
+#define SCIM_ANTHY_TYPE_TABLE_EDITOR (scim_anthy_table_editor_get_type ())
+#define SCIM_ANTHY_TABLE_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCIM_ANTHY_TYPE_TABLE_EDITOR, ScimAnthyTableEditor))
+#define SCIM_ANTHY_TABLE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCIM_ANTHY_TYPE_TABLE_EDITOR, ScimAnthyTableEditorClass))
+#define SCIM_ANTHY_IS_TABLE_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCIM_ANTHY_TYPE_TABLE_EDITOR))
+#define SCIM_ANTHY_IS_TABLE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCIM_ANTHY_TYPE_TABLE_EDITOR))
+#define SCIM_ANTHY_TABLE_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCIM_ANTHY_TYPE_TABLE_EDITOR, ScimAnthyTableEditorClass))
+
+
+typedef struct _ScimAnthyTableEditorClass ScimAnthyTableEditorClass;
+typedef struct _ScimAnthyTableEditor ScimAnthyTableEditor;
+
+struct _ScimAnthyTableEditor
+{
+ GtkDialog parent_instance;
+
+ GtkWidget *treeview;
+
+ GtkWidget *button_area;
+
+ GtkWidget *add_button;
+ GtkWidget *remove_button;
+
+ GList *entries;
+};
+
+struct _ScimAnthyTableEditorClass
+{
+ GtkDialogClass parent_class;
+
+ /* -- signals -- */
+ void (*add_entry) (ScimAnthyTableEditor *editor);
+ void (*remove_entry) (ScimAnthyTableEditor *editor);
+};
+
+
+GType scim_anthy_table_editor_get_type (void) G_GNUC_CONST;
+GtkWidget *scim_anthy_table_editor_new (void);
+const char *scim_anthy_table_editor_get_nth_text (ScimAnthyTableEditor *editor,
+ guint nth);
+void scim_anthy_table_editor_set_columns (ScimAnthyTableEditor *editor,
+ const char **titles);
+
+#endif /* __SCIM_ANTHY_TABLE_EDITOR_H__ */
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <string.h>
+#include <sys/wait.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "scim_anthy_utils.h"
+#include "scim_anthy_default_tables.h"
+
+namespace scim_anthy {
+
+bool
+util_match_key_event (const KeyEventList &list, const KeyEvent &key,
+ uint16 ignore_mask)
+{
+ KeyEventList::const_iterator kit;
+
+ for (kit = list.begin (); kit != list.end (); kit++) {
+ uint16 mod1, mod2;
+
+ mod1 = kit->mask;
+ mod2 = key.mask;
+ mod1 &= ~ignore_mask;
+ mod2 &= ~ignore_mask;
+
+ if (key.code == kit->code && mod1 == mod2)
+ return true;
+ }
+ return false;
+}
+
+void
+util_split_string (String &str, std::vector<String> &str_list,
+ char *delim, int num)
+{
+ String::size_type start = 0, end;
+
+ for (int i = 0; (num > 0 && i < num) || start < str.length (); i++) {
+ end = str.find (delim, start);
+ if ((num > 0 && i == num - 1) || (end == String::npos))
+ end = str.length ();
+
+ if (start < str.length ()) {
+ str_list.push_back (str.substr (start, end - start));
+ start = end + strlen (delim);
+ } else {
+ str_list.push_back (String ());
+ }
+ }
+}
+
+void
+util_convert_to_wide (WideString & wide, const String & str)
+{
+ if (str.length () < 0)
+ return;
+
+ for (unsigned int i = 0; i < str.length (); i++) {
+ int c = str[i];
+ char cc[2]; cc[0] = c; cc[1] = '\0';
+ bool found = false;
+
+ for (unsigned int j = 0; scim_anthy_wide_table[j].code; j++) {
+ if ( scim_anthy_wide_table[j].code &&
+ *scim_anthy_wide_table[j].code == c)
+ {
+ wide += utf8_mbstowcs (scim_anthy_wide_table[j].wide);
+ found = true;
+ break;
+ }
+ }
+
+ if (!found)
+ wide += utf8_mbstowcs (cc);
+ }
+}
+
+void
+util_convert_to_half (String & half, const WideString & str)
+{
+ if (str.length () < 0)
+ return;
+
+ for (unsigned int i = 0; i < str.length (); i++) {
+ WideString wide = str.substr (i, 1);
+ bool found = false;
+
+ for (unsigned int j = 0; scim_anthy_wide_table[j].code; j++) {
+ if (scim_anthy_wide_table[j].wide &&
+ wide == utf8_mbstowcs (scim_anthy_wide_table[j].wide))
+ {
+ half += scim_anthy_wide_table[j].code;
+ found = true;
+ break;
+ }
+ }
+
+ if (!found)
+ half += utf8_wcstombs (wide);
+ }
+}
+
+void
+util_convert_to_katakana (WideString & kata,
+ const WideString & hira,
+ bool half)
+{
+ if (hira.length () < 0)
+ return;
+
+ for (unsigned int i = 0; i < hira.length (); i++) {
+ WideString tmpwide;
+ bool found = false;
+
+ HiraganaKatakanaRule *table = scim_anthy_hiragana_katakana_table;
+
+ for (unsigned int j = 0; table[j].hiragana; j++) {
+ tmpwide = utf8_mbstowcs (table[j].hiragana);
+ if (hira.substr(i, 1) == tmpwide) {
+ if (half)
+ kata += utf8_mbstowcs (table[j].half_katakana);
+ else
+ kata += utf8_mbstowcs (table[j].katakana);
+ found = true;
+ break;
+ }
+ }
+
+ if (!found)
+ kata += hira.substr(i, 1);
+ }
+}
+
+void
+util_create_attributes (AttributeList &attrs,
+ unsigned int start,
+ unsigned int length,
+ String type,
+ unsigned int fg_color,
+ unsigned int bg_color)
+{
+ if (type == "None") {
+ return;
+ } else if (type == "Underline") {
+ attrs.push_back (Attribute (start, length,
+ SCIM_ATTR_DECORATE,
+ SCIM_ATTR_DECORATE_UNDERLINE));
+ } else if (type == "Reverse") {
+ attrs.push_back (Attribute (start, length,
+ SCIM_ATTR_DECORATE,
+ SCIM_ATTR_DECORATE_REVERSE));
+ } else if (type == "Highlight") {
+ attrs.push_back (Attribute (start, length,
+ SCIM_ATTR_DECORATE,
+ SCIM_ATTR_DECORATE_HIGHLIGHT));
+ } else {
+ if (type == "Color" || type == "FGColor")
+ attrs.push_back (Attribute (start, length,
+ SCIM_ATTR_FOREGROUND,
+ fg_color));
+ if (type == "Color" || type == "BGColor")
+ attrs.push_back (Attribute (start, length,
+ SCIM_ATTR_BACKGROUND,
+ bg_color));
+ }
+}
+
+bool
+util_key_is_keypad (const KeyEvent &key)
+{
+ switch (key.code) {
+ case SCIM_KEY_KP_Equal:
+ case SCIM_KEY_KP_Multiply:
+ case SCIM_KEY_KP_Add:
+ case SCIM_KEY_KP_Separator:
+ case SCIM_KEY_KP_Subtract:
+ case SCIM_KEY_KP_Decimal:
+ case SCIM_KEY_KP_Divide:
+ 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:
+ return true;
+ default:
+ return false;
+ }
+}
+
+void
+util_keypad_to_string (String &str, const KeyEvent &key)
+{
+ char raw[2];
+
+ switch (key.code) {
+ case SCIM_KEY_KP_Equal:
+ raw[0] = '=';
+ break;
+
+ case SCIM_KEY_KP_Multiply:
+ raw[0] = '*';
+ break;
+
+ case SCIM_KEY_KP_Add:
+ raw[0] = '+';
+ break;
+
+ case SCIM_KEY_KP_Separator:
+ raw[0] = ',';
+ break;
+
+ case SCIM_KEY_KP_Subtract:
+ raw[0] = '-';
+ break;
+
+ case SCIM_KEY_KP_Decimal:
+ raw[0] = '.';
+ break;
+
+ case SCIM_KEY_KP_Divide:
+ raw[0] = '/';
+ break;
+
+ 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:
+ raw[0] = '0' + key.code - SCIM_KEY_KP_0;
+ break;
+
+ default:
+ if (isprint (key.get_ascii_code()))
+ raw[0] = key.get_ascii_code();
+ else
+ raw[0] = '\0';
+ break;
+ }
+
+ raw[1] = '\0';
+ str = raw;
+}
+
+void
+util_launch_program (const char *command)
+{
+ if (!command) return;
+
+ /* split string */
+ unsigned int len = strlen (command);
+ char tmp[len + 1];
+ strncpy (tmp, command, len);
+ tmp[len] = '\0';
+
+ char *str = tmp;
+ std::vector<char *> array;
+
+ for (unsigned int i = 0; i < len + 1; i++) {
+ if (!tmp[i] || isspace (tmp[i])) {
+ if (*str) {
+ tmp[i] = '\0';
+ array.push_back (str);
+ }
+ str = tmp + i + 1;
+ }
+ }
+
+ if (array.size () <= 0) return;
+ array.push_back (NULL);
+
+ char *args[array.size()];
+ for (unsigned int i = 0; i < array.size (); i++)
+ args[i] = array[i];
+
+
+ /* exec command */
+ pid_t child_pid;
+
+ child_pid = fork();
+ if (child_pid < 0) {
+ perror("fork");
+ } else if (child_pid == 0) { /* child process */
+ pid_t grandchild_pid;
+
+ grandchild_pid = fork();
+ if (grandchild_pid < 0) {
+ perror("fork");
+ _exit(1);
+ } else if (grandchild_pid == 0) { /* grandchild process */
+ execvp(args[0], args);
+ perror("execvp");
+ _exit(1);
+ } else {
+ _exit(0);
+ }
+ } else { /* parent process */
+ int status;
+ waitpid(child_pid, &status, 0);
+ }
+}
+
+}
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2005 Takuro Ashie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SCIM_ANTHY_UTILS_H__
+#define __SCIM_ANTHY_UTILS_H__
+
+#define Uses_SCIM_ICONV
+#define Uses_SCIM_EVENT
+#define Uses_SCIM_ATTRIBUTE
+#include <scim.h>
+
+using namespace scim;
+
+namespace scim_anthy {
+
+bool util_match_key_event (const KeyEventList &list,
+ const KeyEvent &key,
+ uint16 ignore_mask = 0);
+void util_split_string (String &str,
+ std::vector<String> &str_list,
+ char *delim,
+ int num);
+void util_convert_to_wide (WideString &wide,
+ const String &str);
+void util_convert_to_half (String &half,
+ const WideString &str);
+void util_convert_to_katakana (WideString &kata,
+ const WideString &hira,
+ bool half = false);
+void util_create_attributes (AttributeList &attrs,
+ unsigned int start,
+ unsigned int length,
+ String type,
+ unsigned int fg_color,
+ unsigned int bg_color);
+bool util_key_is_keypad (const KeyEvent &key);
+void util_keypad_to_string (String &str,
+ const KeyEvent &key);
+void util_launch_program (const char *command);
+
+}
+
+#endif /* __SCIM_ANTHY_UTILS_H__ */