diff --git a/honoka/Makefile.am b/honoka/Makefile.am index 6655ac6..32a09cb 100644 --- a/honoka/Makefile.am +++ b/honoka/Makefile.am @@ -28,7 +28,7 @@ ## @end 1 AUTOMAKE_OPTIONS = gnu -SUBDIRS = libhonoka src plugins intl po m4 data +SUBDIRS = libhonoka src intl po m4 data ## @start 1 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure config.h.in $(AUX_DIST) diff --git a/honoka/configure.ac b/honoka/configure.ac index 78c5dda..b427243 100644 --- a/honoka/configure.ac +++ b/honoka/configure.ac @@ -67,110 +67,6 @@ AC_SUBST(SCIM_BUILD_SETUP) -# 以下2行は不要だが。 -#AC_CHECK_HEADER([dlfcn.h],[],[AC_MSG_ERROR(dlfcn.h was not found.)]) -#AC_CHECK_LIB([dl],[dlopen],[],[AC_MSG_ERROR(libdl was not found.)]) - -AC_ARG_ENABLE(wnn, - [ --enable-wnn Turn on WnnConversion], - [case "${enableval}" in - yes) wnn=true ;; - no) wnn=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-wnn) ;; - esac],[wnn=true]) - -if test "x$wnn" = "xtrue"; then - BU_LIBS="$LIBS" - AC_CHECK_LIB(crypt, crypt) - AC_CHECK_LIB(wnn7, jl_yosoku_init,[ - WNN_LIBS="-lcrypt -lwnn7" - ], [AC_MSG_RESULT(libwnn7 not found.)]) - if echo $WNN_LIBS | grep -v "wnn7" > /dev/null; then - AC_CHECK_LIB(wnn, jl_yosoku_init,[ - WNN_LIBS="-lcrypt -lwnn" - ], [AC_MSG_RESULT(libwnn for Wnn7 not found.)]) - fi - - if echo $WNN_LIBS | grep "wnn" > /dev/null; then - AC_DEFINE([HAVE_LIBWNN7],[1],[Wnn7]) - else - AC_CHECK_LIB(wnn6, jl_optimize_fi,[ - WNN_LIBS="-lcrypt -lwnn6" - ], [AC_MSG_RESULT(libwnn6 not found.)]) - if echo $WNN_LIBS | grep -v "wnn6" > /dev/null; then - AC_CHECK_LIB(wnn, jl_optimize_fi,[ - WNN_LIBS="-lcrypt -lwnn" - ], [AC_MSG_RESULT(libwnn for Wnn6 not found.)]) - fi - - if echo $WNN_LIBS | grep "wnn" > /dev/null; then - AC_DEFINE([HAVE_LIBWNN6],[1],[Wnn6]) - else - AC_MSG_RESULT(Wnn6 or Wnn7 library not found.) - wnn=false - fi - fi - if echo $WNN_LIBS | grep "wnn" > /dev/null; then - AC_DEFINE([HAVE_LIBWNN],[1],[Wnn]) - fi - LIBS="$BU_LIBS" -fi -AC_SUBST(WNNCONVERSION) -AM_CONDITIONAL(WNNCONVERSION, [test "x$wnn" = "xtrue"]) - -AC_ARG_ENABLE(anthy, - [ --enable-anthy Turn on AnthyConversion], - [case "${enableval}" in - yes) anthy=true ;; - no) anthy=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-anthy) ;; - esac],[anthy=true]) - -if test "x$anthy" = "xtrue"; then - AC_CHECK_HEADER([anthy/anthy.h], [ - ANTHY_LIBS="-lanthy -lanthydic" - ],[]) - if echo $ANTHY_LIBS | grep "anthy" > /dev/null; then - AC_DEFINE([HAVE_LIBANTHY],[1],[Anthy]) - else - anthy=false - fi -fi -AM_CONDITIONAL(ANTHYCONVERSION, [test "x$anthy" = "xtrue"]) -AC_SUBST(ANTHYCONVERSION) - -AC_ARG_ENABLE(canna, - [ --enable-canna Turn on CannaConversion], - [case "${enableval}" in - yes) canna=true ;; - no) canna=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-canna) ;; - esac],[canna=true]) - -if test "x$canna" = "xtrue"; then - AC_CHECK_HEADER([canna/jrkanji.h], [ - CANNA_LIBS="-lcanna" - ],[]) - if echo $CANNA_LIBS | grep "canna" > /dev/null; then - AC_DEFINE([HAVE_LIBCANNA],[1],[Canna]) - else - canna=false - fi -fi -AM_CONDITIONAL(CANNACONVERSION, [test "x$canna" = "xtrue"]) -AC_SUBST(CANNACONVERSION) - - -AC_SUBST(WNN_LIBS) -AC_SUBST(ANTHY_LIBS) -AC_SUBST(CANNA_LIBS) - -#if echo $LIBS | grep -v "wnn" > /dev/null; then -# if echo $LIBS | grep -v "anthy" > /dev/null; then -# AC_MSG_ERROR(Wnn or Anthy library not found.) -# fi -#fi - # Checks for header files. AC_HEADER_STDC @@ -218,6 +114,6 @@ AC_SUBST(LIBTOOL_EXPORT_OPTIONS) AC_CONFIG_FILES([Makefile intl/Makefile po/Makefile.in m4/Makefile - libhonoka/Makefile src/Makefile plugins/Makefile data/Makefile + libhonoka/Makefile src/Makefile data/Makefile honoka.pc]) AC_OUTPUT diff --git a/honoka/data/Makefile.am b/honoka/data/Makefile.am index 1db1694..cdd2e1d 100644 --- a/honoka/data/Makefile.am +++ b/honoka/data/Makefile.am @@ -2,6 +2,4 @@ icondir = $(SCIM_ICONDIR) icon_DATA = honoka.png -tabledir = $(SCIM_DATADIR)/honoka -table_DATA = honoka-def.rkt like-msime.rkt kigou-def.rkt azik.rkt -EXTRA_DIST = $(icon_DATA) $(table_DATA) +EXTRA_DIST = $(icon_DATA) diff --git a/honoka/data/azik.rkt b/honoka/data/azik.rkt deleted file mode 100644 index 26127e5..0000000 --- a/honoka/data/azik.rkt +++ /dev/null @@ -1,551 +0,0 @@ -# utf8 -# AZIKテーブル、テスト版。 -$nProc false -$xtProc false -$RemoveRemainder true -# Ascii/WideAsciiモードでキャンセルキーによる離脱を有効にするか。 -$AsciiModeCancel false -# Ascii/WideAsciiモードへの移行キー。 -$Key/Ascii none -$Key/WideAscii none - -# 清音 -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 ふ -fu ふ -he へ -ho ほ -ma ま -mi み -mu む -me め -mo も -ya や -yu ゆ -yo よ -ra ら -ri り -ru る -re れ -ro ろ -wa わ -wo を - -# 撥音拡張 -zk かん -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 うぉん -mn もの - -# 二重母音拡張 -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 うぉー - -# 濁音、半濁音 撥音拡張、二重母音拡張 -ga が -gi ぎ -gu ぐ -ge げ -go ご -gz がん -gn がん -gk ぎん -gj ぐん -gd げん -gl ごん -gq がい -gh ぐう -gw げい -gp ごう -za ざ -zi じ -zu ず -ze ぜ -zo ぞ -zz ざん -zn ざん -zk じん -zj ずん -zd ぜん -zl ぞん -zq ざい -zh ずう -zw ぜい -zp ぞう -da だ -di じ -du づ -de で -do ど -dz だん -dn だん -dk ぢん -dj づん -dd でん -dl どん -dq だい -dh づう -dw でい -dp どう -ba ば -bi び -bu ぶ -be べ -bo ぼ -bz ばん -bn ばん -bk びん -bj ぶん -bd べん -bl ぼん -bq ばい -bh ぶう -bw べい -bp ぼう -pa ぱ -pi ぴ -pu ぷ -pe ぺ -po ぽ -pz ぱん -pn ぱん -pk ぴん -pj ぷん -pd ぺん -pl ぽん -pq ぱい -ph ぷう -pw ぺい -pp ぽう -zc ざ -zv ざい -zx ぜい - -# 拗音、拗音互換 -kya きゃ -kyu きゅ -kye きぇ -kyo きょ -kyz きゃん -kyn きゃん -kyj きゅん -kyd きぇん -kyl きょん -kyq きゃい -kyh きゅう -kyw きぇい -kyp きょう -kga きゃ -kgu きゅ -kge きぇ -kgo きょ -kgz きゃん -kgn きゃん -kgj きゅん -kgd きぇん -kgl きょん -kgq きゃい -kgh きゅう -kgw きぇい -kgp きょう -sya しゃ -syu しゅ -sye しぇ -syo しょ -syz しゃん -syn しゃん -syj しゅん -syd しぇん -syl しょん -syq しゃい -syh しゅう -syw しぇい -syp しょう -xa しゃ -xu しゅ -xe しぇ -xo しょ -xz しゃん -xn しゃん -xj しゅん -xd しぇん -xl しょん -xq しゃい -xh しゅう -xw しぇい -xp しょう -tya ちゃ -tyu ちゅ -tye ちぇ -tyo ちょ -tyz ちゃん -tyn ちゃん -tyj ちゅん -tyd ちぇん -tyl ちょん -tyq ちゃい -tyh ちゅう -tyw ちぇい -typ ちょう -ca ちゃ -cu ちゅ -ce ちぇ -co ちょ -cz ちゃん -cn ちゃん -cj ちゅん -cd ちぇん -cl ちょん -cq ちゃい -ch ちゅう -cw ちぇい -cp ちょう -nya にゃ -nyu にゅ -nye にぇ -nyo にょ -nyz にゃん -nyn にゃん -nyj にゅん -nyd にぇん -nyl にょん -nyq にゃい -nyh にゅう -nyw にぇい -nyp にょう -nga にゃ -ngu にゅ -nge にぇ -ngo にょ -ngz にゃん -ngn にゃん -ngj にゅん -ngd にぇん -ngl にょん -ngq にゃい -ngh にゅう -ngw にぇい -ngp にょう -hya ひゃ -hyu ひゅ -hye ひぇ -hyo ひょ -hyz ひゃん -hyn ひゃん -hyj ひゅん -hyd ひぇん -hyl ひょん -hyq ひゃい -hyh ひゅう -hyw ひぇい -hyp ひょう -hga ひゃ -hgu ひゅ -hge ひぇ -hgo ひょ -hgz ひゃん -hgn ひゃん -hgj ひゅん -hgd ひぇん -hgl ひょん -hgq ひゃい -hgh ひゅう -hgw ひぇい -hgp ひょう -mya みゃ -myu みゅ -mye みぇ -myo みょ -myz みゃん -myn みゃん -myj みゅん -myd みぇん -myl みょん -myq みゃい -myh みゅう -myw みぇい -myp みょう -mga みゃ -mgu みゅ -mge みぇ -mgo みょ -mgz みゃん -mgn みゃん -mgj みゅん -mgd みぇん -mgl みょん -mgq みゃい -mgh みゅう -mgw みぇい -mgp みょう -rya りゃ -ryu りゅ -rye りぇ -ryo りょ -ryz りゃん -ryn りゃん -ryj りゅん -ryd りぇん -ryl りょん -ryq りゃい -ryh りゅう -ryw りぇい -ryp りょう - -# 拗音 (濁音、半濁音) -gya ぎゃ -gyu ぎゅ -gye ぎぇ -gyo ぎょ -gyz ぎゃん -gyn ぎゃん -gyj ぎゅん -gyd ぎぇん -gyl ぎょん -gyq ぎゃい -gyh ぎゅう -gyw ぎぇい -gyp ぎょう -zya じゃ -zyu じゅ -zye じぇ -zyo じょ -zyz じゃん -zyn じゃん -zyj じゅん -zyd じぇん -zyl じょん -zyq じゃい -zyh じゅう -zyw じぇい -zyp じょう -ja じゃ -ju じゅ -je じぇ -jo じょ -jz じゃん -jn じゃん -jj じゅん -jd じぇん -jl じょん -jq じゃい -jh じゅう -jw じぇい -jp じょう -bya びゃ -byu びゅ -bye びぇ -byo びょ -byz びゃん -byn びゃん -byj びゅん -byd びぇん -byl びょん -byq びゃい -byh びゅう -byw びぇい -byp びょう -pya ぴゃ -pyu ぴゅ -pye ぴぇ -pyo ぴょ -pyz ぴゃん -pyn ぴゃん -pyj ぴゅん -pyd ぴぇん -pyl ぴょん -pyq ぴゃい -pyh ぴゅう -pyw ぴぇい -pyp ぴょう -pga ぴゃ -pgu ぴゅ -pge ぴぇ -pgo ぴょ -pgz ぴゃん -pgn ぴゃん -pgj ぴゅん -pgd ぴぇん -pgl ぴょん -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 ごと - diff --git a/honoka/data/honoka-def.rkt b/honoka/data/honoka-def.rkt deleted file mode 100644 index 2cd756f..0000000 --- a/honoka/data/honoka-def.rkt +++ /dev/null @@ -1,361 +0,0 @@ -# utf8 -# 「nn」を「ん」に変換するかどうか。 -$nnMode false -# ローマ字変換できなかった英字を捨てるかどうか。 -$RemoveRemainder false -# Ascii/WideAsciiモードでキャンセルキーによる離脱を有効にするか。 -$AsciiModeCancel true -# Ascii/WideAsciiモードへの移行キー。 -$Key/Ascii q -$Key/WideAscii Shift+Q -# フックを使う -$Hook Z -# 特殊キー -#!Control+Up ↑ -#!Control+Down ↓ -#!Control+Left ← -#!Control+Right → - -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 ろ -la ら -li り -lu る -le れ -lo ろ -wa わ -wi ゐ -wu う -we ゑ -wo を -nn ん -N ん -xa ぁ -xi ぃ -xu ぅ -xe ぇ -xo ぉ -xtu っ -xya ゃ -xyu ゅ -xyo ょ -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 きょ -sya しゃ -syi し -syu しゅ -sye しぇ -syo しょ -sha しゃ -shi し -shu しゅ -she しぇ -sho しょ -cha ちゃ -chi ち -chu ちゅ -che ちぇ -cho ちょ -tya ちゃ -tyi てぃ -tyu ちゅ -tye ちぇ -tyo ちょ -dya ぢゃ -dyi でぃ -dyu ぢゅ -dye ぢぇ -dyo ぢょ -va ヴぁ -vi ヴぃ -vu ヴ -ve ヴぇ -vo ヴぉ -zya じゃ -zyi じぃ -zyu じゅ -zye じぇ -zyo じょ -ja じゃ -ji じ -ju じゅ -je じぇ -jo じょ -fa ふぁ -fi ふぃ -fu ふ -fe ふぇ -fo ふぉ -hya ひゃ -hyi ひぃ -hyu ひゅ -hye ひぇ -hyo ひょ -rya りゃ -ryi りぃ -ryu りゅ -rye りぇ -ryo りょ -nya にゃ -nyi にぃ -nyu にゅ -nye にぇ -nyo にょ -gya ぎゃ -gyi ぎぃ -gyu ぎゅ -gye ぎぇ -gyo ぎょ -bya びゃ -byi びぃ -byu びゅ -bye びぇ -byo びょ -pya ぴゃ -pyi ぴぃ -pyu ぴゅ -pye ぴぇ -pyo ぴょ -mya みゃ -myi みぃ -myu みゅ -mye みぇ -myo みょ -Za a -Zb b -Zc c -Zd d -Ze e -Zf f -Zg g -Zh h -Zi i -Zj j -Zk k -Zl l -Zm m -Zn n -Zo o -Zp p -Zq q -Zr r -Zs s -Zt t -Zu u -Zv v -Zw w -Zx x -Zy y -Zz z -ZA A -ZB B -ZC C -ZD D -ZE E -ZF F -ZG G -ZH H -ZI I -ZJ J -ZK K -ZL L -ZM M -ZN N -ZO O -ZP P -ZQ Q -ZR R -ZS S -ZT T -ZU U -ZV V -ZW W -ZX X -ZY Y -ZZ Z -Z1 1 -Z2 2 -Z3 3 -Z4 4 -Z5 5 -Z6 6 -Z7 7 -Z8 8 -Z9 9 -Z0 0 - -Z^ ^ -z1 ○ -z2 ▽ -z3 △ -z4 □ -z5 ◇ -z6 ☆ -z7 ◎ -z8 ¢ -z9 ♂ -z0 ♀ -z- ~ -z^ ★ -z\\ \ -z, ‥ -z. … -z/ ・ - -- ー -[ 「 -] 」 -. 。 -, 、 -{ { -} } -@ @ -: : -; ; -? ? -< < -> > -* * -+ + -/ / -\\ ¥ - -z- ~ -z[ 『 -z] 』 -z. … -z, ‥ -z{ 〔 -z} 〕 -z@ ▼ -z: ゜ -z; ゛ -z? ∞ -z< ≦ -z> ≧ -z* × -z+ ± -z/ ・ - -Z- - -Z[ [ -Z] ] -Z. . -Z, , -Z{ { -Z} } -Z@ @ -Z: : -Z; ; -Z? ? -Z< < -Z> > -Z* * -Z+ + -Z/ / -Z\\ ¥ -Z,   - -zb ° -zc 〇 -zd ゝ -zf 〃 -zg ‐ -zh ← -zj ↓ -zk ↑ -zl → -zm ″ -zn ′ -zp 〒 -zq 《 -zr 々 -zs ヽ -zt 〆 -zv ※ -zw 》 -zx :- -Z\   # 全角スペース - -0 0 -1 1 -2 2 -3 3 -4 4 -5 5 -6 6 -7 7 -8 8 -9 9 -0 0 diff --git a/honoka/data/kigou-def.rkt b/honoka/data/kigou-def.rkt deleted file mode 100644 index 52e70e4..0000000 --- a/honoka/data/kigou-def.rkt +++ /dev/null @@ -1,43 +0,0 @@ -# utf8 -# 標準的な記号入力 - -1 1 -2 2 -3 3 -4 4 -5 5 -6 6 -7 7 -8 8 -9 9 -0 0 -- ー -[ 「 -] 」 -. 。 -, 、 -{ { -} } -@ @ -: : -; ; -? ? -< < -> > -* * -+ + -/ / -\\ ¥ - -! ! -" ” -# # -$ $ -% % -& & -' ’ -( ( -) ) -= = -~ ~ -| | \ No newline at end of file diff --git a/honoka/data/like-msime.rkt b/honoka/data/like-msime.rkt deleted file mode 100644 index 35839b5..0000000 --- a/honoka/data/like-msime.rkt +++ /dev/null @@ -1,297 +0,0 @@ -# utf8 -# 「nn」を「ん」に変換するかどうか。 -$nnMode true -# ローマ字変換できなかった英字を捨てるかどうか。 -$RemoveRemainder false -# Ascii/WideAsciiモードでキャンセルキーによる離脱を有効にするか。 -$AsciiModeCancel false -# Ascii/WideAsciiモードへの移行キー。 -$Key/Ascii null -$Key/WideAscii null -# 全角/半角トグルキー -$Key/ToggleHalfOrWide Zenkaku_Hankaku -# かなトグルキー -$Key/ToggleHiraOrKata Hiragana_Katakana - -!Shift+space  # 全角スペース - -/ ・ - -%kigou-def.rkt - -a あ -i い -yi い -u う -wu う -whu う -e え -o お -la ぁ -xa ぁ -li ぃ -xi ぃ -lyi ぃ -xyi ぃ -ye いぇ -lu ぅ -xu ぅ -le ぇ -xe ぇ -lye ぇ -xye ぇ -lo ぉ -xo ぉ -ka か -ca か -ki き -ku く -cu く -qu く -ke け -ko こ -co こ -kya きゃ -kyi きぃ -kyu きゅ -kye きぇ -kyo きょ -lka ヵ -xka ヵ -lke ヶ -xke ヶ -qya くゃ -qyu くゅ -qyo くょ -qwa くぁ -qa くぁ -kwa くぁ -qwi くぃ -qi くぃ -qyi くぃ -qwu くぅ -qwe くぇ -qe くぇ -qye くぇ -qwo くぉ -qo くぉ -ga が -gi ぎ -gu ぐ -ge げ -go ご -gya ぎゃ -gyi ぎぃ -gyu ぎゅ -gye ぎぇ -gyo ぎょ -gwa ぐぁ -gwi ぐぃ -gwu ぐぅ -gwe ぐぇ -gwo ぐぉ -sa さ -si し -ci し -shi し -su す -se せ -ce せ -so そ -sya しゃ -sha しゃ -syi しぃ -syu しゅ -shu しゅ -sye しぇ -she しぇ -syo しょ -sho しょ -swa すぁ -swi すぃ -swu すぅ -swe すぇ -swo すぉ -za ざ -zi じ -ji じ -zu ず -ze ぜ -zo ぞ -zya じゃ -ja じゃ -jya じゃ -zyi じぃ -jyi じぃ -zyu じゅ -ju じゅ -jyu じゅ -zye じぇ -je じぇ -jye じぇ -zyo じょ -jo じょ -jyo じょ -ta た -ti ち -chi ち -tu つ -tsu つ -te て -to と -tya ちゃ -cha ちゃ -cya ちゃ -tyi ちぃ -cyi ちぃ -tyu ちゅ -chu ちゅ -cyu ちゅ -tye ちぇ -che ちぇ -cye ちぇ -tyo ちょ -cho ちょ -cyo ちょ -ltu っ -xtu っ -ltsu っ -tsa つぁ -tsi つぃ -tse つぇ -tso つぉ -tha てゃ -thi てぃ -thu てゅ -the てぇ -tho てょ -twa とぁ -twi とぃ -twu とぅ -twe とぇ -two とぉ -da だ -di ぢ -du づ -de で -do ど -dya ぢゃ -dyi ぢぃ -dyu ぢゅ -dye ぢぇ -dyo ぢょ -dha でゃ -dhi でぃ -dhu でゅ -dhe でぇ -dho でょ -dwa どぁ -dwi どぃ -dwu どぅ -dwe どぇ -dwo どぉ -na な -ni に -nu ぬ -ne ね -no の -nya にゃ -nyi にぃ -nyu にゅ -nye にぇ -nyo にょ -ha は -hi ひ -hu ふ -fu ふ -he へ -ho ほ -hya ひゃ -hyi ひぃ -hyu ひゅ -hye ひぇ -hyo ひょ -fya ふゃ -fyu ふゅ -fyo ふょ -fwa ふぁ -fa ふぁ -fwi ふぃ -fi ふぃ -fyi ふぃ -fwu ふぅ -fwe ふぇ -fe ふぇ -fye ふぇ -fwo ふぉ -fo ふぉ -ba ば -bi び -bu ぶ -be べ -bo ぼ -bya びゃ -byi びぃ -byu びゅ -bye びぇ -byo びょ -va ヴぁ -vi ヴぃ -vu ヴ -ve ヴぇ -vo ヴぉ -vya ヴゃ -vyi ヴぃ -vyu ヴゅ -vye ヴぇ -vyo ヴょ -pa ぱ -pi ぴ -pu ぷ -pe ぺ -po ぽ -pya ぴゃ -pyi ぴぃ -pyu ぴゅ -pye ぴぇ -pyo ぴょ -ma ま -mi み -mu む -me め -mo も -mya みゃ -myi みぃ -myu みゅ -mye みぇ -myo みょ -ya や -yu ゆ -yo よ -lya ゃ -xya ゃ -lyu ゅ -xyu ゅ -lyo ょ -xyo ょ -ra ら -ri り -ru る -re れ -ro ろ -rya りゃ -ryi りぃ -ryu りゅ -rye りぇ -ryo りょ -wa わ -wo を -#n ん -nn ん -n' ん -xn ん -lwa ゎ -xwa ゎ -wi ゐ -we ゑ - diff --git a/honoka/m4/Makefile b/honoka/m4/Makefile index 9d0ba73..ae4edbb 100644 --- a/honoka/m4/Makefile +++ b/honoka/m4/Makefile @@ -66,20 +66,12 @@ AMDEP_FALSE = # AMDEP_TRUE = AMTAR = ${SHELL} /home/tamra/devel/honoka/missing --run tar -ANTHYCONVERSION = -ANTHYCONVERSION_FALSE = # -ANTHYCONVERSION_TRUE = -ANTHY_LIBS = -lanthy -lanthydic AR = ar AUTOCONF = ${SHELL} /home/tamra/devel/honoka/missing --run autoconf AUTOHEADER = ${SHELL} /home/tamra/devel/honoka/missing --run autoheader AUTOMAKE = ${SHELL} /home/tamra/devel/honoka/missing --run automake-1.9 AWK = gawk BUILD_INCLUDED_LIBINTL = no -CANNACONVERSION = -CANNACONVERSION_FALSE = # -CANNACONVERSION_TRUE = -CANNA_LIBS = -lcanna CATOBJEXT = .gmo CC = gcc CCDEPMODE = depmode=gcc3 @@ -173,10 +165,6 @@ USE_INCLUDED_LIBINTL = no USE_NLS = yes VERSION = 0.9.0 -WNNCONVERSION = -WNNCONVERSION_FALSE = # -WNNCONVERSION_TRUE = -WNN_LIBS = -lcrypt -lwnn7 XGETTEXT = /usr/bin/xgettext ac_aux_dir = . ac_ct_AR = ar diff --git a/honoka/m4/Makefile.in b/honoka/m4/Makefile.in index b0772c8..3d27327 100644 --- a/honoka/m4/Makefile.in +++ b/honoka/m4/Makefile.in @@ -66,20 +66,12 @@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ -ANTHYCONVERSION = @ANTHYCONVERSION@ -ANTHYCONVERSION_FALSE = @ANTHYCONVERSION_FALSE@ -ANTHYCONVERSION_TRUE = @ANTHYCONVERSION_TRUE@ -ANTHY_LIBS = @ANTHY_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ -CANNACONVERSION = @CANNACONVERSION@ -CANNACONVERSION_FALSE = @CANNACONVERSION_FALSE@ -CANNACONVERSION_TRUE = @CANNACONVERSION_TRUE@ -CANNA_LIBS = @CANNA_LIBS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ @@ -173,10 +165,6 @@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ -WNNCONVERSION = @WNNCONVERSION@ -WNNCONVERSION_FALSE = @WNNCONVERSION_FALSE@ -WNNCONVERSION_TRUE = @WNNCONVERSION_TRUE@ -WNN_LIBS = @WNN_LIBS@ XGETTEXT = @XGETTEXT@ ac_aux_dir = @ac_aux_dir@ ac_ct_AR = @ac_ct_AR@ diff --git a/honoka/plugins/Makefile.am b/honoka/plugins/Makefile.am deleted file mode 100644 index a0f486b..0000000 --- a/honoka/plugins/Makefile.am +++ /dev/null @@ -1,113 +0,0 @@ -## Makefile.am -- Process this file with automake to produce Makefile.in -## Copyright (C) 2002 James Su -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2, or (at your option) -## any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -MAINTAINERCLEANFILES = Makefile.in - -INCLUDES = -I$(top_builddir) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/libhonoka \ - -DSCIM_ICONDIR=\"@SCIM_ICONDIR@\" \ - -DHONOKA_LOCALEDIR=\"$(datadir)/locale\" \ - -DHONOKA_DATADIR=\"@SCIM_DATADIR@/honoka\" \ - -DHONOKA_ICON_FILE=\"@SCIM_ICONDIR@/honoka.png\" \ - -DHONOKA_PLUGINDIR=\"@SCIM_MODULEDIR@/honoka\" - -noinst_HEADERS = wnnproto.h romkan.h wnnconversion.h kanainput.h \ - nicolainput.h anthyplugin.h anthyconversion.h anthyprediction.h skkdic.h \ - skkdicconversion.h wnnplugin.h wnnprediction.h honoka_plugin_def.h simpleprediction.h \ - cannaconversion.h primeprediction.h asciiplugin.h wordsdic.h wordsprediction.h \ - asciiinput.h compose.h - -moduledir = @SCIM_MODULEDIR@/IMEngine - - -if WNNCONVERSION -WNN_PLUGIN = plugin-wnn.la -endif - -if ANTHYCONVERSION -ANTHY_PLUGIN = plugin-anthy.la -endif - -if CANNACONVERSION -CANNA_PLUGIN = plugin-canna.la -endif - -plugindir = @SCIM_MODULEDIR@/honoka -plugin_LTLIBRARIES = $(ANTHY_PLUGIN) $(WNN_PLUGIN) $(CANNA_PLUGIN) plugin-skkdic.la plugin-romkan.la plugin-kanainput.la plugin-simpleprediction.la plugin-prime.la plugin-nicola.la plugin-ascii.la - -plugin_anthy_la_SOURCES = anthyplugin.cpp anthyconversion.cpp anthyprediction.cpp -plugin_anthy_la_CFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_anthy_la_CXXFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_anthy_la_LDFLAGS = -avoid-version -module -rpath $(plugindir) @LIBTOOL_EXPORT_OPTIONS@ @INTLLIBS@ @SCIM_LIBS@ @ANTHY_LIBS@ -plugin_anthy_la_LIBADD = $(top_builddir)/libhonoka/libhonoka_plugin.la - -plugin_wnn_la_SOURCES = wnnconversion.cpp wnnplugin.cpp wnnprediction.cpp -plugin_wnn_la_CFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_wnn_la_CXXFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_wnn_la_LDFLAGS = -avoid-version -module -rpath $(plugindir) @LIBTOOL_EXPORT_OPTIONS@ @INTLLIBS@ @SCIM_LIBS@ @WNN_LIBS@ -plugin_wnn_la_LIBADD = $(top_builddir)/libhonoka/libhonoka_plugin.la - -plugin_skkdic_la_SOURCES = skkdic.cpp skkdicconversion.cpp -plugin_skkdic_la_CFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_skkdic_la_CXXFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_skkdic_la_LDFLAGS = -avoid-version -module -rpath $(plugindir) @LIBTOOL_EXPORT_OPTIONS@ @INTLLIBS@ @SCIM_LIBS@ -plugin_skkdic_la_LIBADD = $(top_builddir)/libhonoka/libhonoka_plugin.la - -plugin_romkan_la_SOURCES = romkan.cpp -plugin_romkan_la_CFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_romkan_la_CXXFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_romkan_la_LDFLAGS = -avoid-version -module -rpath $(plugindir) @LIBTOOL_EXPORT_OPTIONS@ @INTLLIBS@ @SCIM_LIBS@ -plugin_romkan_la_LIBADD = $(top_builddir)/libhonoka/libhonoka_plugin.la - -plugin_kanainput_la_SOURCES = kanainput.cpp -plugin_kanainput_la_CFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_kanainput_la_CXXFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_kanainput_la_LDFLAGS = -avoid-version -module -rpath $(plugindir) @LIBTOOL_EXPORT_OPTIONS@ @INTLLIBS@ @SCIM_LIBS@ -plugin_kanainput_la_LIBADD = $(top_builddir)/libhonoka/libhonoka_plugin.la - -plugin_nicola_la_SOURCES = nicolainput.cpp -plugin_nicola_la_CFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_nicola_la_CXXFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_nicola_la_LDFLAGS = -avoid-version -module -rpath $(plugindir) @LIBTOOL_EXPORT_OPTIONS@ @INTLLIBS@ @SCIM_LIBS@ -plugin_nicola_la_LIBADD = $(top_builddir)/libhonoka/libhonoka_plugin.la - -plugin_simpleprediction_la_SOURCES = simpleprediction.cpp -plugin_simpleprediction_la_CFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_simpleprediction_la_CXXFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_simpleprediction_la_LDFLAGS = -avoid-version -module -rpath $(plugindir) @LIBTOOL_EXPORT_OPTIONS@ @INTLLIBS@ @SCIM_LIBS@ -plugin_simpleprediction_la_LIBADD = $(top_builddir)/libhonoka/libhonoka_plugin.la - -plugin_prime_la_SOURCES = primeprediction.cpp -plugin_prime_la_CFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_prime_la_CXXFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_prime_la_LDFLAGS = -avoid-version -module -rpath $(plugindir) @LIBTOOL_EXPORT_OPTIONS@ @INTLLIBS@ @SCIM_LIBS@ -plugin_prime_la_LIBADD = $(top_builddir)/libhonoka/libhonoka_plugin.la - -plugin_canna_la_SOURCES = cannaconversion.cpp -plugin_canna_la_CFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_canna_la_CXXFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_canna_la_LDFLAGS = -avoid-version -module -rpath $(plugindir) @LIBTOOL_EXPORT_OPTIONS@ @INTLLIBS@ @SCIM_LIBS@ @CANNA_LIBS@ -plugin_canna_la_LIBADD = $(top_builddir)/libhonoka/libhonoka_plugin.la - -plugin_ascii_la_SOURCES = asciiplugin.cpp wordsdic.cpp wordsprediction.cpp \ - asciiinput.cpp -plugin_ascii_la_CFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_ascii_la_CXXFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ -plugin_ascii_la_LDFLAGS = -avoid-version -module -rpath $(plugindir) @LIBTOOL_EXPORT_OPTIONS@ @INTLLIBS@ @SCIM_LIBS@ -plugin_ascii_la_LIBADD = $(top_builddir)/libhonoka/libhonoka_plugin.la - diff --git a/honoka/plugins/anthyconversion.cpp b/honoka/plugins/anthyconversion.cpp deleted file mode 100644 index f5c7ad0..0000000 --- a/honoka/plugins/anthyconversion.cpp +++ /dev/null @@ -1,211 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include "anthyconversion.h" - -#ifdef HAVE_CONFIG_H - #include -#endif - -#ifdef HAVE_GETTEXT - #include - #define _(String) dgettext(GETTEXT_PACKAGE,String) - #define N_(String) (String) -#else - #define _(String) (String) - #define N_(String) (String) - #define bindtextdomain(Package,Directory) - #define textdomain(domain) - #define bind_textdomain_codeset(domain,codeset) -#endif - -// プライグイン化のおまじないです。 -//HonokaPluginRegister(AnthyConversion); - - -AnthyConversion::AnthyConversion(ConfigPointer cfg) : Convertor(cfg) -{ - m_iconv.set_encoding ("EUC-JP"); - pos = 0; - current = false; - anthy_init(); - context = anthy_create_context(); -} - - -AnthyConversion::~AnthyConversion() -{ -} - -bool AnthyConversion::isConnected() { - return current; -} - -void AnthyConversion::reset(){ - //anthy_release_context(context); - //anthy_init(); - //context = anthy_create_context(); - anthy_reset_context(context); - return; -} - -void AnthyConversion::setYomiText(WideString yomi) { - yomiText = yomi; -} - -int AnthyConversion::ren_conversion() { - if (!current) return 0; - /* - WideString yt; - for(int i = 0;i < yomiText.length();i ++) { - if (yomiText[i] == 0x30F4) { - yt.push_back(0x30A6); - yt.push_back(0x309B); - } - else yt.push_back(yomiText[i]); - } - yomiText = yt; - */ - String y; - anthy_reset_context(context); - m_iconv.convert(y,yomiText); - anthy_set_string(context,y.c_str()); - struct anthy_conv_stat stat; - anthy_get_stat(context,&stat); - pos = 0; - buildResult(); - - return stat.nr_segment; -} - -const vector AnthyConversion::getSegmentList() { - vector result; - for(unsigned int i = 0;i < convResult.size();i ++) result.push_back(Segment(convResult[i].kouho[convResult[i].pos].kanji,convResult[i].Yomi)); - return result; -}; - - -int AnthyConversion::setPos(int p){ - if ((p < convResult.size()) && (p >= 0)) pos = p; - return pos; -} - -int AnthyConversion::getPos() { - return pos; -} - -ResultList AnthyConversion::getResultList(int p,ResultType kt){ - if (p == -1) p = pos; - if (p >= convResult.size()) return ResultList(); - if ((kt != DEFAULT) || (p >= convResult.size())) return ResultList(); - setPos(p); - return convResult[p]; -} - -bool AnthyConversion::select(int p) { - if (p < convResult[pos].count()) { - convResult[pos].pos = p; - return true; - } - return false; -} - -bool AnthyConversion::resizeRegion(int w) { - //if ((convResult[pos].kouho[convResult[pos].pos].length() + w) < 1) return false; - if ((convResult[pos].Yomi.length() + w) < 1) return false; - if ((pos >= (convResult.size() - 1)) && (w > 0)) return false; - anthy_resize_segment(context,pos,w); - buildResult(); - return true; -} - -void AnthyConversion::updateFrequency() { - for(unsigned int i = 0;i < convResult.size();i ++) { - anthy_commit_segment(context,i,convResult[i].pos); - } - return; -} - -bool AnthyConversion::connect() { - return current; -} -void AnthyConversion::disconnect() { - return; -} - -void AnthyConversion::selected() { - current = true; -} - -void AnthyConversion::unSelected() { - current = false; -} - - -void AnthyConversion::buildResult() { - struct anthy_conv_stat stat; - anthy_get_stat(context,&stat); - int slen = 0; - convResult.clear(); - for(int i = 0;i < stat.nr_segment;i ++) { - ResultList l; - l.kType = DEFAULT; - l.Title = utf8_mbstowcs(String(_("lookup result"))); - struct anthy_segment_stat sstat; - anthy_get_segment_stat(context,i,&sstat); - //l.count = sstat.nr_candidate; - //l.Yomi = yomiText.substr(slen,sstat.seg_len); - //slen += sstat.seg_len; - l.pos = 0; - for(int j = 0;j < sstat.nr_candidate;j ++) { - char res[256]; - int c = anthy_get_segment(context,i,j,0,0); - if (c > 255) c = 255; - anthy_get_segment(context,i,j,res,c + 1); - WideString w; - m_iconv.convert(w,String(res)); - l.kouho.push_back(w); - //if ((w == yomiText.substr(slen,w.length())) && (l.Yomi.length() < w.length())) { - // l.Yomi = w; - // slen += w.length(); - //} - } - char res[256]; - int c = anthy_get_segment(context,i,NTH_UNCONVERTED_CANDIDATE,0,0); - if (c > 255) c = 255; - anthy_get_segment(context,i,NTH_UNCONVERTED_CANDIDATE,res,c + 1); - WideString w; - m_iconv.convert(w,String(res)); - l.Yomi = w; - - convResult.push_back(l); - } -} - -String AnthyConversion::getName() -{ - return String("Anthy"); -} - -String AnthyConversion::getPropertyName() -{ - return String(_("AnthyConversion")); -} - - diff --git a/honoka/plugins/anthyconversion.h b/honoka/plugins/anthyconversion.h deleted file mode 100644 index ae16ad3..0000000 --- a/honoka/plugins/anthyconversion.h +++ /dev/null @@ -1,80 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef ANTHYCONVERSION_H -#define ANTHYCONVERSION_H - -#define Uses_SCIM_CONFIG_BASE - -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace scim; - -/** -@author TAM (Teppei Tamra) -*/ -namespace Honoka { - -class AnthyPrediction; -class AnthyConversion : public Convertor { -public: - friend class AnthyPrediction; - AnthyConversion(ConfigPointer cfg); - - ~AnthyConversion(); - virtual bool isConnected(); - virtual void reset(); - virtual void setYomiText(WideString yomi); - virtual int ren_conversion(); - virtual int setPos(int p); - virtual int getPos(); - virtual ResultList getResultList(int p = -1 ,ResultType kt = DEFAULT); - virtual bool select(int p); - virtual bool resizeRegion(int w); - virtual void updateFrequency(); - virtual bool connect(); - virtual void disconnect(); - virtual String getName(); - virtual String getPropertyName(); - virtual const vector getSegmentList(); - virtual void selected(); - virtual void unSelected(); - -protected: - void buildResult(); -protected: - anthy_context_t context; - IConvert m_iconv; - WideString yomiText; - vector convResult; - int pos; - bool current; -}; - -} - -#endif diff --git a/honoka/plugins/anthyplugin.cpp b/honoka/plugins/anthyplugin.cpp deleted file mode 100644 index f5791c4..0000000 --- a/honoka/plugins/anthyplugin.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "anthyplugin.h" - -#ifdef HAVE_CONFIG_H - #include -#endif - - -#ifdef HAVE_GETTEXT - #include - #define _(String) dgettext(GETTEXT_PACKAGE,String) - #define N_(String) (String) -#else - #define _(String) (String) - #define N_(String) (String) - #define bindtextdomain(Package,Directory) - #define textdomain(domain) - #define bind_textdomain_codeset(domain,codeset) -#endif - -HonokaPluginRegister(AnthyPlugin); -HonokaPluginSetup(AnthyPlugin); - -HonokaSetupCorePage *AnthyPlugin::setup() -{ - HonokaSetupPage *page = new HonokaSetupPage(_("Anthy-plugin"),"",""); - HonokaSetupPage *sc = new HonokaSetupPage(_("shortcut keys: "),"",""); - sc->append(new HonokaSetupKeyItem( - _("Anthy Conversion: "), - String(HONOKA_CONFIG_KEY_CONVERTOR_PREFIX) + String("/Anthy"), - "", - "" - )); - sc->append(new HonokaSetupKeyItem( - _("Anthy Prediction: "), - String(HONOKA_CONFIG_KEY_PREDICTOR_PREFIX) + String("/AnthyPrediction"), - "", - "" - )); - page->append(sc); - return page; -}; - -AnthyPlugin::AnthyPlugin(ConfigPointer cfg) : HonokaMultiplePluginBase(cfg) -{ - convertor = new AnthyConversion(cfg); - #ifdef HAS_ANTHY_PREDICTION - predictor = new AnthyPrediction(cfg,convertor); - #else - predictor = 0; - #endif -} - - -AnthyPlugin::~AnthyPlugin() -{ - if (predictor) delete predictor; - delete convertor; -} - -/*! - \fn AnthyPlugin::getPluginInstanceAt(int p) - */ -HonokaPluginBase * AnthyPlugin::getPluginInstanceAt(int p) -{ - if (p == 0) return convertor; - if ((p == 1) && predictor) return predictor; - return 0; -} - - -/*! - \fn AnthyPlugin::getPluginCount() - */ -int AnthyPlugin::getPluginCount() -{ - if (predictor) return 2; - return 1; -} - -/*! - \fn AnthyPlugin::getName() - */ -String AnthyPlugin::getName() -{ - return String("AnthyPlugin"); -} - diff --git a/honoka/plugins/anthyplugin.h b/honoka/plugins/anthyplugin.h deleted file mode 100644 index b65368f..0000000 --- a/honoka/plugins/anthyplugin.h +++ /dev/null @@ -1,62 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef ANTHYPLUGIN_H -#define ANTHYPLUGIN_H - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -using namespace std; -using namespace scim; - - -/** -@author TAM (Teppei Tamra) -*/ -namespace Honoka { - -class AnthyPlugin; - -class AnthyPlugin : public HonokaMultiplePluginBase { -public: - AnthyPlugin(ConfigPointer cfg); - - ~AnthyPlugin(); - virtual HonokaPluginBase * getPluginInstanceAt(int p); - virtual int getPluginCount(); - virtual String getName(); - static HonokaSetupCorePage *setup(); - -protected: - AnthyConversion * convertor; - Predictor * predictor; -}; -} -#endif diff --git a/honoka/plugins/anthyprediction.cpp b/honoka/plugins/anthyprediction.cpp deleted file mode 100644 index bd8289a..0000000 --- a/honoka/plugins/anthyprediction.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "anthyprediction.h" - -#ifdef HAVE_CONFIG_H - #include -#endif - - -#ifdef HAVE_GETTEXT - #include - #define _(String) dgettext(GETTEXT_PACKAGE,String) - #define N_(String) (String) -#else - #define _(String) (String) - #define N_(String) (String) - #define bindtextdomain(Package,Directory) - #define textdomain(domain) - #define bind_textdomain_codeset(domain,codeset) -#endif - - -AnthyPrediction::AnthyPrediction(ConfigPointer cfg,AnthyConversion *anthy) : Predictor(cfg) -{ - convertor = anthy; -} - - -AnthyPrediction::~AnthyPrediction() -{ -} - - - -/*! - \fn AnthyPrediction::getPredictionList(const WideString &str) - */ -ResultList AnthyPrediction::getPredictionList(const WideString &str) -{ - ResultList list; - list.kType = PREDICTION; - list.Title = utf8_mbstowcs(String(_("lookup result"))); - - #ifdef HAS_ANTHY_PREDICTION - String s; - convertor->m_iconv.convert(s,str); - anthy_set_prediction_string(convertor->context,s.c_str()); - struct anthy_prediction_stat pstat; - anthy_get_prediction_stat(convertor->context,&pstat); - - - for(int i = 0;i < pstat.nr_prediction;i ++) { - char res[256]; - anthy_get_prediction(convertor->context,i,res,255); - WideString w; - convertor->m_iconv.convert(w,String(res)); - list.kouho.push_back(w); - } - #endif - return list; - -} - - -/*! - \fn AnthyPrediction::disconnect() - */ -void AnthyPrediction::disconnect() -{ - return; -} - - -/*! - \fn AnthyPrediction::connect() - */ -bool AnthyPrediction::connect() -{ - return convertor->connect(); -} - - -/*! - \fn AnthyPrediction::isConnected() - */ -bool AnthyPrediction::isConnected() -{ - return convertor->isConnected(); -} - - -/*! - \fn AnthyPrediction::getPropertyName() - */ -String AnthyPrediction::getPropertyName() -{ - return String(_("AnthyPrediction")); -} - -/*! - \fn AnthyPrediction::getName() - */ -String AnthyPrediction::getName() -{ - return String("AnthyPrediction"); -} - -/*! - \fn AnthyPrediction::update(const WideString str,const WideString yomi) - */ -void AnthyPrediction::update(const WideString str,const WideString yomi) -{ - return; -} - diff --git a/honoka/plugins/anthyprediction.h b/honoka/plugins/anthyprediction.h deleted file mode 100644 index 98d0522..0000000 --- a/honoka/plugins/anthyprediction.h +++ /dev/null @@ -1,61 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef ANTHYPREDICTION_H -#define ANTHYPREDICTION_H - -#define Uses_SCIM_CONFIG_BASE - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - - -/** -@author TAM (Teppei Tamra) -*/ -namespace Honoka { - -class AnthyPrediction : public Predictor { -public: - AnthyPrediction(ConfigPointer cfg,AnthyConversion *anthy); - - ~AnthyPrediction(); - virtual ResultList getPredictionList(const WideString &str); - virtual void disconnect(); - virtual bool connect(); - virtual bool isConnected(); - virtual String getPropertyName(); - virtual String getName(); - virtual void update(const WideString str,const WideString yomi); - -protected: - AnthyConversion *convertor; - -}; -} -#endif diff --git a/honoka/plugins/asciiinput.cpp b/honoka/plugins/asciiinput.cpp deleted file mode 100644 index 16cdf3b..0000000 --- a/honoka/plugins/asciiinput.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "asciiinput.h" - -#include - -#ifdef HAVE_CONFIG_H - #include -#endif - -#ifdef HAVE_GETTEXT - #include - #define _(String) dgettext(GETTEXT_PACKAGE,String) - #define N_(String) (String) -#else - #define _(String) (String) - #define N_(String) (String) - #define bindtextdomain(Package,Directory) - #define textdomain(domain) - #define bind_textdomain_codeset(domain,codeset) -#endif - -#include "compose.h" - -AsciiInput::AsciiInput(ConfigPointer cfg) : PreEditor(cfg) -{ - scim_string_to_key_list(lowProprotyKey,cfg->read(HONOKA_CONFIG_ASCIIINPUT_LOW_PRIORITY_KEY,String(HONOKA_DEFAULT_ASCIIINPUT_LOW_PRIORITY_KEY))); - scim_string_to_key_list(autoCommitKey,cfg->read(HONOKA_CONFIG_ASCIIINPUT_AUTO_COMMIT_KEY,String(HONOKA_DEFAULT_ASCIIINPUT_AUTO_COMMIT_KEY))); - autoCommit = cfg->read(HONOKA_CONFIG_ASCIIINPUT_AUTO_COMMIT,HONOKA_DEFAULT_ASCIIINPUT_AUTO_COMMIT); - - scim_string_to_key_list(compose_key,cfg->read(HONOKA_CONFIG_ASCIIINPUT_COMPOSE_KEY,String(HONOKA_DEFAULT_ASCIIINPUT_COMPOSE_KEY))); - scim_string_to_key_list(dead_abovering,cfg->read(HONOKA_CONFIG_ASCIIINPUT_ABOVERING_KEY,String(HONOKA_DEFAULT_ASCIIINPUT_ABOVERING_KEY))); - scim_string_to_key_list(dead_acute,cfg->read(HONOKA_CONFIG_ASCIIINPUT_ACUTE_KEY,String(HONOKA_DEFAULT_ASCIIINPUT_ACUTE_KEY))); - scim_string_to_key_list(dead_cedilla,cfg->read(HONOKA_CONFIG_ASCIIINPUT_CEDILLA_KEY,String(HONOKA_DEFAULT_ASCIIINPUT_CEDILLA_KEY))); - scim_string_to_key_list(dead_circumflex,cfg->read(HONOKA_CONFIG_ASCIIINPUT_CIRCUMFLEX_KEY,String(HONOKA_DEFAULT_ASCIIINPUT_CIRCUMFLEX_KEY))); - scim_string_to_key_list(dead_diaeresis,cfg->read(HONOKA_CONFIG_ASCIIINPUT_DIAERESIS_KEY,String(HONOKA_DEFAULT_ASCIIINPUT_DIAERESIS_KEY))); - scim_string_to_key_list(dead_doubleacute,cfg->read(HONOKA_CONFIG_ASCIIINPUT_DOUBLEACUTE_KEY,String(HONOKA_DEFAULT_ASCIIINPUT_DOUBLEACUTE_KEY))); - scim_string_to_key_list(dead_grave,cfg->read(HONOKA_CONFIG_ASCIIINPUT_GRAVE_KEY,String(HONOKA_DEFAULT_ASCIIINPUT_GRAVE_KEY))); - scim_string_to_key_list(dead_tilde,cfg->read(HONOKA_CONFIG_ASCIIINPUT_TILDE_KEY,String(HONOKA_DEFAULT_ASCIIINPUT_TILDE_KEY))); - - - compose = false; - composeKey1.code = 0; - composeKey2.code = 0; -} - - -AsciiInput::~AsciiInput() -{ -} - -/*! - \fn AsciiInput::getModeName() - */ -String AsciiInput::getModeName() -{ - if (compose) return String(_("Cc")); - return String(_("Aa")); -} - -/*! - \fn AsciiInput::getName() - */ -String AsciiInput::getName() -{ - return String("AsciiInput"); -} - -/*! - \fn AsciiInput::getPropertyName() - */ -String AsciiInput::getPropertyName() -{ - return String(_("AsciiInput")); -} - - -/*! - \fn AsciiInput::inputEvent(const KeyEvent &key) - */ -bool AsciiInput::inputEvent(const KeyEvent &key) -{ - return keyEvent(key); -} - - - -/*! - \fn AsciiInput::keyEventHook(const KeyEvent &key) - */ -bool AsciiInput::keyEventHook(const KeyEvent &key) -{ - if (key.is_key_release()) return false; - if ((key.code == SCIM_KEY_Multi_key) || (compose_key.comp(key))) { - composeKey1.code = 0; - composeKey2.code = 0; - if (compose) { - compose = false; - } else compose = true; - return true; - } else - if ((key.code == SCIM_KEY_dead_abovering) || - (key.code == SCIM_KEY_dead_acute) || - (key.code == SCIM_KEY_dead_cedilla) || - (key.code == SCIM_KEY_dead_circumflex) || - (key.code == SCIM_KEY_dead_diaeresis) || - (key.code == SCIM_KEY_dead_doubleacute) || - (key.code == SCIM_KEY_dead_grave) || - (key.code == SCIM_KEY_dead_tilde)) { - if ((!compose) || ((compose) && (composeKey1.code == 0))) { - compose = true; - composeKey1.code = key.code; - composeKey2.code = 0; - return true; - } else { - composeKey2.code = key.code; - } - } else - if (dead_abovering.comp(key)) { - if ((!compose) || ((compose) && (composeKey1.code == 0))) { - compose = true; - composeKey1.code = SCIM_KEY_dead_abovering; - composeKey2.code = 0; - return true; - } else { - composeKey2.code = SCIM_KEY_dead_abovering; - } - } else - if (dead_acute.comp(key)) { - if ((!compose) || ((compose) && (composeKey1.code == 0))) { - compose = true; - composeKey1.code = SCIM_KEY_dead_acute; - composeKey2.code = 0; - return true; - } else { - composeKey2.code = SCIM_KEY_dead_acute; - } - } else - if (dead_cedilla.comp(key)) { - if ((!compose) || ((compose) && (composeKey1.code == 0))) { - compose = true; - composeKey1.code = SCIM_KEY_dead_cedilla; - composeKey2.code = 0; - return true; - } else { - composeKey2.code = SCIM_KEY_dead_cedilla; - } - } else - if (dead_circumflex.comp(key)) { - if ((!compose) || ((compose) && (composeKey1.code == 0))) { - compose = true; - composeKey1.code = SCIM_KEY_dead_circumflex; - composeKey2.code = 0; - return true; - } else { - composeKey2.code = SCIM_KEY_dead_circumflex; - } - } else - if (dead_diaeresis.comp(key)) { - if ((!compose) || ((compose) && (composeKey1.code == 0))) { - compose = true; - composeKey1.code = SCIM_KEY_dead_diaeresis; - composeKey2.code = 0; - return true; - } else { - composeKey2.code = SCIM_KEY_dead_diaeresis; - } - } else - if (dead_doubleacute.comp(key)) { - if ((!compose) || ((compose) && (composeKey1.code == 0))) { - compose = true; - composeKey1.code = SCIM_KEY_dead_doubleacute; - composeKey2.code = 0; - return true; - } else { - composeKey2.code = SCIM_KEY_dead_doubleacute; - } - } else - if (dead_grave.comp(key)) { - if ((!compose) || ((compose) && (composeKey1.code == 0))) { - compose = true; - composeKey1.code = SCIM_KEY_dead_grave; - composeKey2.code = 0; - return true; - } else { - composeKey2.code = SCIM_KEY_dead_grave; - } - } else - if (dead_tilde.comp(key)) { - if ((!compose) || ((compose) && (composeKey1.code == 0))) { - compose = true; - composeKey1.code = SCIM_KEY_dead_tilde; - composeKey2.code = 0; - return true; - } else { - composeKey2.code = SCIM_KEY_dead_tilde; - } - } - - // composeKey2まで揃った場合はここでもう挿入してしまう。 - if ((compose) && (composeKey2.code != 0)) { - insertComposeKey(composeKey1,composeKey2); - return true; - } - - if (lowProprotyKey.comp(key)) return false; - else return keyEvent(key); -} - - - - -/*! - \fn AsciiInput::keyEvent(const KeyEvent &key) - */ -bool AsciiInput::keyEvent(const KeyEvent &key) -{ - if (PreEditor::isThrough(key)) return true; - - if ((compose)) { - if (composeKey1.code == 0) { - composeKey1 = key.code; - return true; - } else { - if (composeKey2.code == 0) composeKey2.code = key.code; - insertComposeKey(composeKey1,composeKey2); - return true; - } - } - - - if (autoCommit) { - if (autoCommitKey.comp(key)) { - if (isPrintable(key)) - setCommitString(text.substr(0,pos) + key.get_unicode_code()); - else setCommitString(text.substr(0,pos)); - reset(); - pos = 0; - if (((key.code == SCIM_KEY_Return) || - (key.code == SCIM_KEY_Linefeed) || - (key.code == SCIM_KEY_Tab)) && - ((!key.is_alt_down()) && - (!key.is_control_down()) && - (!key.is_shift_down()))) return false; - else return true; - } - } - - if (isPrintable(key)) { - text = text.substr(0,pos) + key.get_unicode_code() + text.substr(pos); - pos ++; - return true; - } - return false; -} - - -/*! - \fn AsciiInput::insertComposeKey(KeyEvent &k1,KeyEvent &k2) - */ -void AsciiInput::insertComposeKey(KeyEvent &k1,KeyEvent &k2) -{ - compose = false; - String k1s,k2s; - if (!scim_key_to_string(k1s,k1)) return; - if (!scim_key_to_string(k2s,k2)) return; - for(unsigned int i = 0;multikey_table[i].first != "";i ++) { - if ((k1s == multikey_table[i].first) && (k2s == multikey_table[i].second)) { - text = text.substr(0,pos) + multikey_table[i].character + text.substr(pos); - pos ++; - } else continue; - } - composeKey1.code = 0; - composeKey2.code = 0; -} diff --git a/honoka/plugins/asciiinput.h b/honoka/plugins/asciiinput.h deleted file mode 100644 index 5d84479..0000000 --- a/honoka/plugins/asciiinput.h +++ /dev/null @@ -1,69 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef ASCIIINPUT_H -#define ASCIIINPUT_H - -#define Uses_SCIM_ICONV -#define Uses_SCIM_CONFIG_BASE -#include -#include -#include -#include -#include "preeditor.h" - -using namespace std; -using namespace scim; - - -/** - @author TAM (Teppei Tamra) -*/ -namespace Honoka { -class AsciiInput : public PreEditor { -public: - AsciiInput(ConfigPointer cfg); - - ~AsciiInput(); - virtual bool inputEvent(const KeyEvent &key); - virtual String getName(); - virtual String getModeName(); - virtual String getPropertyName(); - virtual bool keyEventHook(const KeyEvent &key); -protected: - HonokaKeyEventList lowProprotyKey,autoCommitKey; - bool autoCommit; - bool compose; - KeyEvent composeKey1,composeKey2; - HonokaKeyEventList compose_key, - dead_abovering, - dead_acute, - dead_cedilla, - dead_circumflex, - dead_diaeresis, - dead_doubleacute, - dead_grave, - dead_tilde; -protected: - bool keyEvent(const KeyEvent &key); - void insertComposeKey(KeyEvent &k1,KeyEvent &k2); -}; -} -#endif diff --git a/honoka/plugins/asciiplugin.cpp b/honoka/plugins/asciiplugin.cpp deleted file mode 100644 index aa4f7ae..0000000 --- a/honoka/plugins/asciiplugin.cpp +++ /dev/null @@ -1,222 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "asciiplugin.h" - -#ifdef HAVE_CONFIG_H - #include -#endif - - -#ifdef HAVE_GETTEXT - #include - #define _(String) dgettext(GETTEXT_PACKAGE,String) - #define N_(String) (String) -#else - #define _(String) (String) - #define N_(String) (String) - #define bindtextdomain(Package,Directory) - #define textdomain(domain) - #define bind_textdomain_codeset(domain,codeset) -#endif - -HonokaPluginRegister(AsciiPlugin); -HonokaPluginSetup(AsciiPlugin); - -HonokaSetupCorePage *AsciiPlugin::setup() -{ - HonokaSetupPage *p = new HonokaSetupPage(_("Ascii-plugin"),"",""); - HonokaSetup *s = new HonokaSetup("setup","",""); - HonokaSetupPage *page = new HonokaSetupPage(_("general setting"),"",""); - page->append(new HonokaSetupFileItem( - _("Words _file: "), - HONOKA_CONFIG_WORDSPREDICTION_FILE, - _("input the path of Words file."), - HONOKA_DEFAULT_WORDSPREDICTION_FILE - )); - page->append(new HonokaSetupBoolItem( - _("_Add a space after word: "), - String(HONOKA_CONFIG_WORDSPREDICTION_ADDSAW), - _("At WordsPrediction, if you want to add a space after the committed word ,check it."), - HONOKA_DEFAULT_WORDSPREDICTION_ADDSAW - )); - page->append(new HonokaSetupIntItem( - _("_Limit of prediction results to display: "), - String(HONOKA_CONFIG_WORDSPREDICTION_LIMIT), - _("set the getting limit of prediction results. it doesn't display the results when the count of prediction results is more than this."), - HONOKA_DEFAULT_WORDSPREDICTION_LIMIT, - 1,1000 - )); - page->append(new HonokaSetupKeyItem( - _("Low priority key: "), - String(HONOKA_CONFIG_ASCIIINPUT_LOW_PRIORITY_KEY), - _("set the key that lowers priority."), - String(HONOKA_DEFAULT_ASCIIINPUT_LOW_PRIORITY_KEY) - )); - page->append(new HonokaSetupBoolItem( - _("Use automatic committing: "), - String(HONOKA_CONFIG_ASCIIINPUT_AUTO_COMMIT), - _("if you want to commit the string when you press the specific key,check it."), - HONOKA_DEFAULT_ASCIIINPUT_AUTO_COMMIT - )); - page->append(new HonokaSetupKeyItem( - _("Automatic committing key: "), - String(HONOKA_CONFIG_ASCIIINPUT_AUTO_COMMIT_KEY), - _("set the key that commit the string automatic."), - String(HONOKA_DEFAULT_ASCIIINPUT_AUTO_COMMIT_KEY) - )); - HonokaSetupPage *sc = new HonokaSetupPage(_("shortcut keys: "),"",""); - sc->append(new HonokaSetupKeyItem( - _("Ascii Input: "), - String(HONOKA_CONFIG_KEY_PREEDITOR_PREFIX) + String("/AsciiInput"), - "", - "" - )); - sc->append(new HonokaSetupKeyItem( - _("Words Prediction: "), - String(HONOKA_CONFIG_KEY_PREDICTOR_PREFIX) + String("/WordsPrediction"), - "", - "" - )); - page->append(sc); - s->append(page); - //p->append(s); - - //s = new HonokaSetup("setup","",""); - page = new HonokaSetupPage(_("key setting"),"",""); - page->append(new HonokaSetupKeyItem( - _("Compose key: "), - String(HONOKA_CONFIG_ASCIIINPUT_COMPOSE_KEY), - _("set the Compose emulation key."), - String(HONOKA_DEFAULT_ASCIIINPUT_COMPOSE_KEY) - )); - - page->append(new HonokaSetupKeyItem( - _("dead abovering key: "), - String(HONOKA_CONFIG_ASCIIINPUT_ABOVERING_KEY), - _("set the dead_abovering emulation key."), - String(HONOKA_DEFAULT_ASCIIINPUT_ABOVERING_KEY) - )); - - page->append(new HonokaSetupKeyItem( - _("dead acute key: "), - String(HONOKA_CONFIG_ASCIIINPUT_ACUTE_KEY), - _("set the dead_acute emulation key."), - String(HONOKA_DEFAULT_ASCIIINPUT_ACUTE_KEY) - )); - - page->append(new HonokaSetupKeyItem( - _("dead cedilla key: "), - String(HONOKA_CONFIG_ASCIIINPUT_CEDILLA_KEY), - _("set the dead_cedilla emulation key."), - String(HONOKA_DEFAULT_ASCIIINPUT_CEDILLA_KEY) - )); - - page->append(new HonokaSetupKeyItem( - _("dead circumflex key: "), - String(HONOKA_CONFIG_ASCIIINPUT_CIRCUMFLEX_KEY), - _("set the dead_circumflex emulation key."), - String(HONOKA_DEFAULT_ASCIIINPUT_CIRCUMFLEX_KEY) - )); - - page->append(new HonokaSetupKeyItem( - _("dead diaeresis key: "), - String(HONOKA_CONFIG_ASCIIINPUT_DIAERESIS_KEY), - _("set the dead_diaeresis emulation key."), - String(HONOKA_DEFAULT_ASCIIINPUT_DIAERESIS_KEY) - )); - - page->append(new HonokaSetupKeyItem( - _("dead doubleacute key: "), - String(HONOKA_CONFIG_ASCIIINPUT_DOUBLEACUTE_KEY), - _("set the dead_doubleacute emulation key."), - String(HONOKA_DEFAULT_ASCIIINPUT_DOUBLEACUTE_KEY) - )); - - page->append(new HonokaSetupKeyItem( - _("dead grave key: "), - String(HONOKA_CONFIG_ASCIIINPUT_GRAVE_KEY), - _("set the dead_grave emulation key."), - String(HONOKA_DEFAULT_ASCIIINPUT_GRAVE_KEY) - )); - - page->append(new HonokaSetupKeyItem( - _("dead tilde key: "), - String(HONOKA_CONFIG_ASCIIINPUT_TILDE_KEY), - _("set the dead_tilde emulation key."), - String(HONOKA_DEFAULT_ASCIIINPUT_TILDE_KEY) - )); - - s->append(page); - p->append(s); - return p; -}; - -AsciiPlugin::AsciiPlugin(ConfigPointer cfg) : HonokaMultiplePluginBase(cfg) -{ - predictor = new WordsPrediction(cfg); - preeditor = new AsciiInput(cfg); -} - - -AsciiPlugin::~AsciiPlugin() -{ - delete predictor; - delete preeditor; -} - -/*! - \fn AsciiPlugin::getPluginInstanceAt(int p) - */ -HonokaPluginBase * AsciiPlugin::getPluginInstanceAt(int p) -{ - switch(p) { - case 0 : { - return predictor; - break; - } - case 1: { - return preeditor; - break; - } - default: { - return 0; - } - } - return 0; -} - - -/*! - \fn AsciiPlugin::getPluginCount() - */ -int AsciiPlugin::getPluginCount() -{ - return 2; -} - -/*! - \fn AsciiPlugin::getName() - */ -String AsciiPlugin::getName() -{ - return String("AsciiPlugin"); -} - diff --git a/honoka/plugins/asciiplugin.h b/honoka/plugins/asciiplugin.h deleted file mode 100644 index b6fa347..0000000 --- a/honoka/plugins/asciiplugin.h +++ /dev/null @@ -1,93 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef ASCIIPLUGIN_H -#define ASCIIPLUGIN_H - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -#define HONOKA_CONFIG_WORDSPREDICTION_FILE "/IMEngine/Honoka/WordsPrediction/WordsFile" -#define HONOKA_DEFAULT_WORDSPREDICTION_FILE "/usr/share/dict/words" -#define HONOKA_CONFIG_WORDSPREDICTION_ADDSAW "/IMEngine/Honoka/WordsPrediction/AddSpaceAfterWord" -#define HONOKA_DEFAULT_WORDSPREDICTION_ADDSAW false -#define HONOKA_CONFIG_WORDSPREDICTION_LIMIT "/IMEngine/Honoka/WordsPrediction/LimitOfResults" -#define HONOKA_DEFAULT_WORDSPREDICTION_LIMIT 20 -#define HONOKA_CONFIG_ASCIIINPUT_LOW_PRIORITY_KEY "/IMEngine/Honoka/AsciiInput/LowPriorityKey" -#define HONOKA_DEFAULT_ASCIIINPUT_LOW_PRIORITY_KEY "" -#define HONOKA_CONFIG_ASCIIINPUT_AUTO_COMMIT_KEY "/IMEngine/Honoka/AsciiInput/AutoCommitKey" -#define HONOKA_DEFAULT_ASCIIINPUT_AUTO_COMMIT_KEY "space,comma,period" -#define HONOKA_CONFIG_ASCIIINPUT_AUTO_COMMIT "/IMEngine/Honoka/AsciiInput/AutoCommit" -#define HONOKA_DEFAULT_ASCIIINPUT_AUTO_COMMIT false -#define HONOKA_CONFIG_ASCIIINPUT_COMPOSE_KEY "/IMEngine/Honoka/AsciiInput/ComposeKey" -#define HONOKA_DEFAULT_ASCIIINPUT_COMPOSE_KEY "" -#define HONOKA_CONFIG_ASCIIINPUT_ABOVERING_KEY "/IMEngine/Honoka/AsciiInput/DeadAboveringKey" -#define HONOKA_DEFAULT_ASCIIINPUT_ABOVERING_KEY "" -#define HONOKA_CONFIG_ASCIIINPUT_ACUTE_KEY "/IMEngine/Honoka/AsciiInput/DeadAcuteKey" -#define HONOKA_DEFAULT_ASCIIINPUT_ACUTE_KEY "" -#define HONOKA_CONFIG_ASCIIINPUT_CEDILLA_KEY "/IMEngine/Honoka/AsciiInput/DeadCedillaKey" -#define HONOKA_DEFAULT_ASCIIINPUT_CEDILLA_KEY "" -#define HONOKA_CONFIG_ASCIIINPUT_CIRCUMFLEX_KEY "/IMEngine/Honoka/AsciiInput/DeadCircumflexKey" -#define HONOKA_DEFAULT_ASCIIINPUT_CIRCUMFLEX_KEY "" -#define HONOKA_CONFIG_ASCIIINPUT_DIAERESIS_KEY "/IMEngine/Honoka/AsciiInput/DeadDiaeresisKey" -#define HONOKA_DEFAULT_ASCIIINPUT_DIAERESIS_KEY "" -#define HONOKA_CONFIG_ASCIIINPUT_DOUBLEACUTE_KEY "/IMEngine/Honoka/AsciiInput/DeadDoubleacuteKey" -#define HONOKA_DEFAULT_ASCIIINPUT_DOUBLEACUTE_KEY "" -#define HONOKA_CONFIG_ASCIIINPUT_GRAVE_KEY "/IMEngine/Honoka/AsciiInput/DeadGraveKey" -#define HONOKA_DEFAULT_ASCIIINPUT_GRAVE_KEY "" -#define HONOKA_CONFIG_ASCIIINPUT_TILDE_KEY "/IMEngine/Honoka/AsciiInput/DeadTildeKey" -#define HONOKA_DEFAULT_ASCIIINPUT_TILDE_KEY "" - -using namespace std; -using namespace scim; - - -/** -@author TAM (Teppei Tamra) -*/ -namespace Honoka { - -class AsciiPlugin; - -class AsciiPlugin : public HonokaMultiplePluginBase { -public: - AsciiPlugin(ConfigPointer cfg); - - ~AsciiPlugin(); - virtual HonokaPluginBase * getPluginInstanceAt(int p); - virtual int getPluginCount(); - virtual String getName(); - static HonokaSetupCorePage *setup(); - -protected: - WordsPrediction *predictor; - AsciiInput *preeditor; -}; -} -#endif diff --git a/honoka/plugins/cannaconversion.cpp b/honoka/plugins/cannaconversion.cpp deleted file mode 100644 index c4994e6..0000000 --- a/honoka/plugins/cannaconversion.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include "cannaconversion.h" - -#ifdef HAVE_CONFIG_H - #include -#endif - -#ifdef HAVE_GETTEXT - #include - #define _(String) dgettext(GETTEXT_PACKAGE,String) - #define N_(String) (String) -#else - #define _(String) (String) - #define N_(String) (String) - #define bindtextdomain(Package,Directory) - #define textdomain(domain) - #define bind_textdomain_codeset(domain,codeset) -#endif - -// プライグイン化のおまじないです。 -HonokaPluginRegister(CannaConversion); -HonokaPluginSetup(CannaConversion); - -HonokaSetupCorePage *CannaConversion::setup() -{ - HonokaSetupPage *page = new HonokaSetupPage(_("Canna-plugin"),"",""); - page->append(new HonokaSetupEntryItem( - _("_Server: "), - HONOKA_CONFIG_CANNA_SERVER, - _("input the server name to connect."), - HONOKA_DEFAULT_CANNA_SERVER - )); - page->append(new HonokaSetupFileItem( - _("_DicHomeDir: "), - HONOKA_CONFIG_CANNA_DICHOMEDIRPATH, - _("set your DicHomeDir in this entry."), - HONOKA_DEFAULT_CANNA_DICHOMEDIRPATH - )); - HonokaSetupPage *sc = new HonokaSetupPage(_("shortcut keys: "),"",""); - sc->append(new HonokaSetupKeyItem( - _("Canna Conversion: "), - String(HONOKA_CONFIG_KEY_CONVERTOR_PREFIX) + String("/Canna"), - "", - "" - )); - page->append(sc); - - return page; -}; - -CannaConversion::CannaConversion(ConfigPointer cfg) : Convertor(cfg) -{ - m_iconv.set_encoding ("EUC-JP"); - pos = 0; - String dhdp = cfg->read(HONOKA_CONFIG_CANNA_DICHOMEDIRPATH,String(HONOKA_DEFAULT_CANNA_DICHOMEDIRPATH)); - - context = 0; - host = cfg->read(HONOKA_CONFIG_CANNA_SERVER,String(HONOKA_DEFAULT_CANNA_SERVER)); - if ((host == "localhost") || (!host.length())) - RkInitialize((char *)dhdp.c_str()); - ready = false; -} - - -CannaConversion::~CannaConversion() -{ -} - -bool CannaConversion::isConnected() { - return ready; -} - -void CannaConversion::reset(){ - RkEndBun(context,1); - return; -} - -void CannaConversion::setYomiText(WideString yomi) { - yomiText = yomi; -} - -int CannaConversion::ren_conversion() { - pos = 0; - String y; - m_iconv.convert(y,yomiText); - bun = RkBgnBun(context,(char *)y.c_str(),strlen(y.c_str()),RK_XFER); - if (bun > 0) { - buildResult(); - } - RkGoTo(context,0); - - return bun; -} - -const vector CannaConversion::getSegmentList() { - vector result; - for(unsigned int i = 0;i < convResult.size();i ++) result.push_back(Segment(convResult[i].kouho[convResult[i].pos].kanji,convResult[i].Yomi)); - return result; -} - -int CannaConversion::setPos(int p){ - if ((p < convResult.size()) && (p >= 0)) pos = p; - RkGoTo(context,pos); - return pos; -} - -int CannaConversion::getPos() { - return pos; -} - -ResultList CannaConversion::getResultList(int p,ResultType kt){ - if (p == -1) p = pos; - if (p >= convResult.size()) return ResultList(); - if ((kt != DEFAULT) || (p >= convResult.size())) return ResultList(); - setPos(p); - return convResult[p]; -} - -bool CannaConversion::select(int p) { - if (p < convResult[pos].count()) { - convResult[pos].pos = p; - RkXfer(context,convResult[pos].pos); - return true; - } - return false; -} - - -bool CannaConversion::resizeRegion(int w) { - if ((convResult[pos].Yomi.length() + w) < 1) return false; - if ((pos >= (convResult.size() - 1)) && (w > 0)) return false; - WideString nt; - for(unsigned int i = pos;i < convResult.size();i ++) nt += convResult[i].Yomi; - nt = nt.substr(0,convResult[pos].Yomi.length() + w); - String s; - m_iconv.convert(s,nt); - bun = RkResize(context,strlen(s.c_str())); - buildResult(); - return true; -} - -void CannaConversion::updateFrequency() { - return; -} - -bool CannaConversion::connect() { - if ((host != "localhost") && (host.length())) { - jrKanjiControl(0,KC_SETSERVERNAME,(char *)host.c_str()); - if (jrKanjiControl(0,KC_INITIALIZE,0) == -1) { - ready = false; - return false; - } - ready = true; - return true; - } - char dic[4096],*dicp; - int dc = RkGetDicList(context,dic,4095); - if (dc == -1) { - return false; - } - dicp = dic; - for(unsigned int i = 0;i < dc;i ++) { - RkMountDic(context,dicp,0); - dicp += strlen(dicp) + 1; - } - ready = true; - return true; -} - -void CannaConversion::disconnect() { - return; -} - -void CannaConversion::buildResult() { - convResult.clear(); - for(unsigned int i = 0;i < bun;i ++) { - RkGoTo(context,i); - unsigned char k[4096],*resp; - resp = k; - WideString t; - ResultList m_res; - m_res.kType = DEFAULT; - m_res.Title = utf8_mbstowcs(String(_("lookup result"))); - RkGetYomi(context,k,511); - m_iconv.convert(t,String((const char *)k)); - m_res.Yomi = t; - int c = RkGetKanjiList(context,k,4095); - m_res.pos = 0; - for(unsigned int j = 0;j < c;j ++) { - m_iconv.convert(t,String((const char *)resp)); - m_res.kouho.push_back(t); - resp += strlen((const char*)resp) + 1; - } - convResult.push_back(m_res); - } - RkGoTo(context,pos); -} - - - -String CannaConversion::getName() -{ - return String("Canna"); -} - -String CannaConversion::getPropertyName() -{ - return String(_("CannaConversion")); -} - - diff --git a/honoka/plugins/cannaconversion.h b/honoka/plugins/cannaconversion.h deleted file mode 100644 index 63e8475..0000000 --- a/honoka/plugins/cannaconversion.h +++ /dev/null @@ -1,89 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef CANNACONVERSION_H -#define CANNACONVERSION_H - -#define Uses_SCIM_CONFIG_BASE -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - - -#define HONOKA_CONFIG_CANNA_DICHOMEDIRPATH "/IMEngine/Honoka/Canna/DicHomeDirPath" -#define HONOKA_DEFAULT_CANNA_DICHOMEDIRPATH "" -#define HONOKA_CONFIG_CANNA_SERVER "/IMEngine/Honoka/Canna/Server" -#define HONOKA_DEFAULT_CANNA_SERVER "localhost" - - -using namespace std; -using namespace scim; - -/** -@author TAM (Teppei Tamra) -*/ -namespace Honoka { - -class CannaConversion : public Convertor { -public: - CannaConversion(ConfigPointer cfg); - - ~CannaConversion(); - virtual bool isConnected(); - virtual void reset(); - virtual void setYomiText(WideString yomi); - virtual int ren_conversion(); - virtual int setPos(int p); - virtual int getPos(); - virtual ResultList getResultList(int p = -1 ,ResultType kt = DEFAULT); - virtual bool select(int p); - virtual bool resizeRegion(int w); - virtual void updateFrequency(); - virtual bool connect(); - virtual void disconnect(); - virtual String getName(); - virtual String getPropertyName(); - virtual const vector getSegmentList(); - static HonokaSetupCorePage *setup(); - -protected: - void buildResult(); - -protected: - bool ready; - int bun; - int context; - IConvert m_iconv; - WideString yomiText; - vector convResult; - int pos; - String host; - -}; - -} -#endif diff --git a/honoka/plugins/compose.h b/honoka/plugins/compose.h deleted file mode 100644 index 0e47783..0000000 --- a/honoka/plugins/compose.h +++ /dev/null @@ -1,473 +0,0 @@ -// -// XorgのComposeデータをコード化したですよ。 -// - -namespace Honoka { -struct MultiKeySequence { - String first; - String second; - wchar_t character; -}; - -MultiKeySequence multikey_table[] = { - {"plus", "plus", '#'}, - {"apostrophe", "space", '\''}, - {"space", "apostrophe", '\''}, - {"A", "T", '@'}, - {"parenleft", "parenleft", '['}, - {"slash", "slash", '\\'}, - {"slash", "less", '\\'}, - {"less", "slash", '\\'}, - {"parenright", "parenright", ']'}, - {"asciicircum", "space", '^'}, - {"space", "asciicircum", '^'}, - {"greater", "space", '^'}, - {"space", "greater", '^'}, - {"grave", "space", '`'}, - {"space", "grave", '`'}, - {"parenleft", "minus", '{'}, - {"minus", "parenleft", '{'}, - {"slash", "asciicircum", '|'}, - {"asciicircum", "slash", '|'}, - {"V", "L", '|'}, - {"L", "V", '|'}, - {"v", "l", '|'}, - {"l", "v", '|'}, - {"parenright", "minus", '}'}, - {"minus", "parenright", '}'}, - {"asciitilde", "space", '~'}, - {"space", "asciitilde", '~'}, - {"minus", "space", '~'}, - {"space", "minus", '~'}, - {"exclam", "exclam", 0241}, - {"c", "slash", 0242}, - {"slash", "c", 0242}, - {"C", "slash", 0242}, - {"slash", "C", 0242}, - {"C", "bar", 0242}, - {"bar", "C", 0242}, - {"c", "bar", 0242}, - {"bar", "c", 0242}, - {"l", "minus", 0243}, - {"minus", "l", 0243}, - {"L", "minus", 0243}, - {"minus", "L", 0243}, - {"l", "equal", 0243}, - {"equal", "l", 0243}, - {"L", "equal", 0243}, - {"equal", "L", 0243}, - {"y", "minus", 0245}, - {"minus", "y", 0245}, - {"Y", "minus", 0245}, - {"minus", "Y", 0245}, - {"y", "equal", 0245}, - {"equal", "y", 0245}, - {"Y", "equal", 0245}, - {"equal", "Y", 0245}, - {"s", "o", 0247}, - {"o", "s", 0247}, - {"S", "O", 0247}, - {"O", "S", 0247}, - {"S", "exclam", 0247}, - {"exclam", "S", 0247}, - {"s", "exclam", 0247}, - {"exclam", "s", 0247}, - {"S", "0", 0247}, - {"0", "S", 0247}, - {"s", "0", 0247}, - {"0", "s", 0247}, - {"x", "o", 0244}, - {"o", "x", 0244}, - {"X", "O", 0244}, - {"O", "X", 0244}, - {"x", "O", 0244}, - {"O", "x", 0244}, - {"X", "o", 0244}, - {"o", "X", 0244}, - {"x", "0", 0244}, - {"0", "x", 0244}, - {"X", "0", 0244}, - {"0", "X", 0244}, - {"c", "o", 0251}, - {"o", "c", 0251}, - {"C", "O", 0251}, - {"O", "C", 0251}, - {"c", "O", 0251}, - {"O", "c", 0251}, - {"C", "o", 0251}, - {"o", "C", 0251}, - {"c", "0", 0251}, - {"0", "c", 0251}, - {"C", "0", 0251}, - {"0", "C", 0251}, - {"parenleft", "c", 0251}, - {"a", "underscore", 0252}, - {"underscore", "a", 0252}, - {"A", "underscore", 0252}, - {"underscore", "A", 0252}, - {"o", "underscore", 0272}, - {"underscore", "o", 0272}, - {"O", "underscore", 0272}, - {"underscore", "O", 0272}, - {"less", "less", 0253}, - {"greater", "greater", 0273}, - {"0", "asciicircum", 0260}, - {"asciicircum", "0", 0260}, - {"0", "asterisk", 0260}, - {"asterisk", "0", 0260}, - {"plus", "minus", 0261}, - {"minus", "plus", 0261}, - {"slash", "u", 0265}, - {"u", "slash", 0265}, - {"slash", "U", 0265}, - {"U", "slash", 0265}, - {"1", "asciicircum", 0271}, - {"asciicircum", "1", 0271}, - {"S", "1", 0271}, - {"1", "S", 0271}, - {"s", "1", 0271}, - {"1", "s", 0271}, - {"2", "asciicircum", 0262}, - {"asciicircum", "2", 0262}, - {"S", "2", 0262}, - {"2", "S", 0262}, - {"s", "2", 0262}, - {"2", "s", 0262}, - {"3", "asciicircum", 0263}, - {"asciicircum", "3", 0263}, - {"S", "3", 0263}, - {"3", "S", 0263}, - {"s", "3", 0263}, - {"3", "s", 0263}, - {"p", "exclam", 0266}, - {"exclam", "p", 0266}, - {"P", "exclam", 0266}, - {"exclam", "P", 0266}, - {"period", "asciicircum", 0267}, - {"asciicircum", "period", 0267}, - {"period", "period", 0267}, - {"1", "4", 0274}, - {"1", "2", 0275}, - {"3", "4", 0276}, - {"question", "question", 0277}, - {"space", "space", 0240}, - {"bar", "bar", 0246}, - {"exclam", "asciicircum", 0246}, - {"asciicircum", "exclam", 0246}, - {"V", "B", 0246}, - {"B", "V", 0246}, - {"v", "b", 0246}, - {"b", "v", 0246}, - {"minus", "comma", 0254}, - {"comma", "minus", 0254}, - {"minus", "minus", 0255}, - {"R", "O", 0256}, - {"O", "R", 0256}, - {"parenleft", "r", 0256}, - {"minus", "asciicircum", 0257}, - {"asciicircum", "minus", 0257}, - {"underscore", "asciicircum", 0257}, - {"asciicircum", "underscore", 0257}, - {"underscore", "underscore", 0257}, - {"minus", "colon", 0367}, - {"colon", "minus", 0367}, - {"x", "x", 0327}, - {"apostrophe", "apostrophe", 0264}, - {"comma", "comma", 0270}, - {"quotedbl", "quotedbl", 0250}, -// Accented Alphabet - {"A", "grave", 0300}, - {"grave", "A", 0300}, - {"A", "acute", 0301}, - {"acute", "A", 0301}, - {"A", "apostrophe", 0301}, - {"apostrophe", "A", 0301}, - {"A", "asciicircum", 0302}, - {"asciicircum", "A", 0302}, - {"A", "greater", 0302}, - {"greater", "A", 0302}, - {"A", "asciitilde", 0303}, - {"asciitilde", "A", 0303}, - {"A", "minus", 0303}, - {"minus", "A", 0303}, - {"A", "quotedbl", 0304}, - {"quotedbl", "A", 0304}, - {"A", "diaeresis", 0304}, - {"diaeresis", "A", 0304}, - {"A", "asterisk", 0305}, - {"asterisk", "A", 0305}, - {"A", "A", 0305}, - {"A", "O", 0305}, - {"A", "E", 0306}, - {"a", "grave", 0340}, - {"grave", "a", 0340}, - {"a", "acute", 0341}, - {"acute", "a", 0341}, - {"a", "apostrophe", 0341}, - {"apostrophe", "a", 0341}, - {"a", "asciicircum", 0342}, - {"asciicircum", "a", 0342}, - {"a", "greater", 0342}, - {"greater", "a", 0342}, - {"a", "asciitilde", 0343}, - {"asciitilde", "a", 0343}, - {"a", "minus", 0343}, - {"minus", "a", 0343}, - {"a", "quotedbl", 0344}, - {"quotedbl", "a", 0344}, - {"a", "diaeresis", 0344}, - {"diaeresis", "a", 0344}, - {"a", "asterisk", 0345}, - {"asterisk", "a", 0345}, - {"a", "a", 0345}, - {"a", "o", 0345}, - {"a", "e", 0346}, - {"acute", "C", 0307}, - {"acute", "c", 0347}, - {"C", "comma", 0307}, - {"comma", "C", 0307}, - {"c", "comma", 0347}, - {"comma", "c", 0347}, - {"minus", "D", 0320}, - {"D", "minus", 0320}, - {"minus", "d", 0360}, - {"d", "minus", 0360}, - {"E", "grave", 0310}, - {"grave", "E", 0310}, - {"E", "acute", 0311}, - {"acute", "E", 0311}, - {"E", "apostrophe", 0311}, - {"apostrophe", "E", 0311}, - {"E", "asciicircum", 0312}, - {"asciicircum", "E", 0312}, - {"E", "greater", 0312}, - {"greater", "E", 0312}, - {"E", "quotedbl", 0313}, - {"quotedbl", "E", 0313}, - {"E", "diaeresis", 0313}, - {"diaeresis", "E", 0313}, - {"e", "grave", 0350}, - {"grave", "e", 0350}, - {"e", "acute", 0351}, - {"acute", "e", 0351}, - {"e", "apostrophe", 0351}, - {"apostrophe", "e", 0351}, - {"e", "asciicircum", 0352}, - {"asciicircum", "e", 0352}, - {"e", "greater", 0352}, - {"greater", "e", 0352}, - {"e", "quotedbl", 0353}, - {"quotedbl", "e", 0353}, - {"e", "diaeresis", 0353}, - {"diaeresis", "e", 0353}, - {"I", "grave", 0314}, - {"grave", "I", 0314}, - {"I", "acute", 0315}, - {"acute", "I", 0315}, - {"I", "apostrophe", 0315}, - {"apostrophe", "I", 0315}, - {"I", "asciicircum", 0316}, - {"asciicircum", "I", 0316}, - {"I", "greater", 0316}, - {"greater", "I", 0316}, - {"I", "quotedbl", 0317}, - {"quotedbl", "I", 0317}, - {"I", "diaeresis", 0317}, - {"diaeresis", "I", 0317}, - {"i", "grave", 0354}, - {"grave", "i", 0354}, - {"i", "acute", 0355}, - {"acute", "i", 0355}, - {"i", "apostrophe", 0355}, - {"apostrophe", "i", 0355}, - {"i", "asciicircum", 0356}, - {"asciicircum", "i", 0356}, - {"i", "greater", 0356}, - {"greater", "i", 0356}, - {"i", "quotedbl", 0357}, - {"quotedbl", "i", 0357}, - {"i", "diaeresis", 0357}, - {"diaeresis", "i", 0357}, - {"N", "asciitilde", 0321}, - {"asciitilde", "N", 0321}, - {"N", "minus", 0321}, - {"minus", "N", 0321}, - {"n", "asciitilde", 0361}, - {"asciitilde", "n", 0361}, - {"n", "minus", 0361}, - {"minus", "n", 0361}, - {"O", "grave", 0322}, - {"grave", "O", 0322}, - {"O", "acute", 0323}, - {"acute", "O", 0323}, - {"O", "apostrophe", 0323}, - {"apostrophe", "O", 0323}, - {"O", "asciicircum", 0324}, - {"asciicircum", "O", 0324}, - {"O", "greater", 0324}, - {"greater", "O", 0324}, - {"O", "asciitilde", 0325}, - {"asciitilde", "O", 0325}, - {"O", "minus", 0325}, - {"minus", "O", 0325}, - {"O", "quotedbl", 0326}, - {"quotedbl", "O", 0326}, - {"O", "diaeresis", 0326}, - {"diaeresis", "O", 0326}, - {"O", "slash", 0330}, - {"slash", "O", 0330}, - {"o", "grave", 0362}, - {"grave", "o", 0362}, - {"o", "acute", 0363}, - {"acute", "o", 0363}, - {"o", "apostrophe", 0363}, - {"apostrophe", "o", 0363}, - {"o", "asciicircum", 0364}, - {"asciicircum", "o", 0364}, - {"o", "greater", 0364}, - {"greater", "o", 0364}, - {"o", "asciitilde", 0365}, - {"asciitilde", "o", 0365}, - {"o", "minus", 0365}, - {"minus", "o", 0365}, - {"o", "quotedbl", 0366}, - {"quotedbl", "o", 0366}, - {"o", "diaeresis", 0366}, - {"diaeresis", "o", 0366}, - {"o", "slash", 0370}, - {"slash", "o", 0370}, - {"U", "grave", 0331}, - {"grave", "U", 0331}, - {"U", "acute", 0332}, - {"acute", "U", 0332}, - {"U", "apostrophe", 0332}, - {"apostrophe", "U", 0332}, - {"U", "asciicircum", 0333}, - {"asciicircum", "U", 0333}, - {"U", "greater", 0333}, - {"greater", "U", 0333}, - {"U", "quotedbl", 0334}, - {"quotedbl", "U", 0334}, - {"U", "diaeresis", 0334}, - {"diaeresis", "U", 0334}, - {"u", "grave", 0371}, - {"grave", "u", 0371}, - {"u", "acute", 0372}, - {"acute", "u", 0372}, - {"u", "apostrophe", 0372}, - {"apostrophe", "u", 0372}, - {"u", "asciicircum", 0373}, - {"asciicircum", "u", 0373}, - {"u", "greater", 0373}, - {"greater", "u", 0373}, - {"u", "quotedbl", 0374}, - {"quotedbl", "u", 0374}, - {"u", "diaeresis", 0374}, - {"diaeresis", "u", 0374}, - {"s", "s", 0337}, - {"T", "H", 0336}, - {"t", "h", 0376}, - {"Y", "acute", 0335}, - {"acute", "Y", 0335}, - {"Y", "apostrophe", 0335}, - {"apostrophe", "Y", 0335}, - {"y", "acute", 0375}, - {"acute", "y", 0375}, - {"y", "apostrophe", 0375}, - {"apostrophe", "y", 0375}, - {"y", "quotedbl", 0377}, - {"quotedbl", "y", 0377}, - {"y", "diaeresis", 0377}, - {"diaeresis", "y", 0377}, -// dead key accent keysyms -// Special Character - {"dead_circumflex", "slash", '|'}, - {"dead_circumflex", "space", '^'}, - {"dead_circumflex", "dead_circumflex", '^'}, - {"dead_tilde", "space", '~'}, - {"dead_tilde", "dead_tilde", '~'}, - {"dead_grave", "space", '`'}, - {"dead_grave", "dead_grave", '`'}, -// These are for us_intl, that does not have diaeresis, etc - {"dead_acute", "space", '\''}, - {"dead_acute", "dead_acute", 0264}, - {"dead_diaeresis", "space", '\"'}, - {"dead_diaeresis", "dead_diaeresis", 0250}, - {"dead_doubleacute", "space", '\"'}, - {"dead_abovering", "space", 0260}, - {"dead_abovering", "dead_abovering", 0260}, - {"dead_circumflex", "0", 0260}, - {"dead_circumflex", "1", 0271}, - {"dead_circumflex", "2", 0262}, - {"dead_circumflex", "3", 0263}, - {"dead_circumflex", "period", 0267}, - {"dead_circumflex", "exclam", 0246}, - {"dead_cedilla", "minus", 0254}, - {"dead_circumflex", "minus", 0257}, - {"dead_circumflex", "underscore", 0257}, - {"dead_acute", "apostrophe", 0264}, - {"dead_cedilla", "comma", 0270}, - {"dead_diaeresis", "quotedbl", 0250}, -// Accented Alphabet - {"dead_abovering", "A", 0305}, - {"dead_grave", "A", 0300}, - {"dead_acute", "A", 0301}, - {"dead_circumflex", "A", 0302}, - {"dead_tilde", "A", 0303}, - {"dead_diaeresis", "A", 0304}, - {"dead_abovering", "a", 0345}, - {"dead_grave", "a", 0340}, - {"dead_acute", "a", 0341}, - {"dead_circumflex", "a", 0342}, - {"dead_tilde", "a", 0343}, - {"dead_diaeresis", "a", 0344}, - {"dead_cedilla", "C", 0307}, - {"dead_cedilla", "c", 0347}, - {"dead_grave", "E", 0310}, - {"dead_acute", "E", 0311}, - {"dead_circumflex", "E", 0312}, - {"dead_diaeresis", "E", 0313}, - {"dead_grave", "e", 0350}, - {"dead_acute", "e", 0351}, - {"dead_circumflex", "e", 0352}, - {"dead_diaeresis", "e", 0353}, - {"dead_grave", "I", 0314}, - {"dead_acute", "I", 0315}, - {"dead_circumflex", "I", 0316}, - {"dead_diaeresis", "I", 0317}, - {"dead_grave", "i", 0354}, - {"dead_acute", "i", 0355}, - {"dead_circumflex", "i", 0356}, - {"dead_diaeresis", "i", 0357}, - {"dead_tilde", "N", 0321}, - {"dead_tilde", "n", 0361}, - {"dead_grave", "O", 0322}, - {"dead_acute", "O", 0323}, - {"dead_circumflex", "O", 0324}, - {"dead_tilde", "O", 0325}, - {"dead_diaeresis", "O", 0326}, - {"dead_grave", "o", 0362}, - {"dead_acute", "o", 0363}, - {"dead_circumflex", "o", 0364}, - {"dead_tilde", "o", 0365}, - {"dead_diaeresis", "o", 0366}, - {"dead_grave", "U", 0331}, - {"dead_acute", "U", 0332}, - {"dead_circumflex", "U", 0333}, - {"dead_doubleacute", "U", 0334}, - {"dead_diaeresis", "U", 0334}, - {"dead_grave", "u", 0371}, - {"dead_acute", "u", 0372}, - {"dead_circumflex", "u", 0373}, - {"dead_doubleacute", "u", 0374}, - {"dead_diaeresis", "u", 0374}, - {"dead_acute", "Y", 0335}, - {"dead_acute", "y", 0375}, - {"dead_diaeresis", "y", 0377}, -// Useful for portuguese language - {"dead_acute", "C", 0307}, - {"dead_acute", "c", 0347}, - {"","",0000} -}; - -} diff --git a/honoka/plugins/honoka_plugin_def.h b/honoka/plugins/honoka_plugin_def.h deleted file mode 100644 index f70fba2..0000000 --- a/honoka/plugins/honoka_plugin_def.h +++ /dev/null @@ -1,27 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef HONOKA_PLUGIN_DEF_H -#define HONOKA_PLUGIN_DEF_H - -/* - ここにあったプラグイン設定は、全部プラグインのヘッダに移動しましたよ?。 -*/ - -#endif diff --git a/honoka/plugins/kanainput.cpp b/honoka/plugins/kanainput.cpp deleted file mode 100644 index ac5080f..0000000 --- a/honoka/plugins/kanainput.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include "kanainput.h" - -#ifdef HAVE_CONFIG_H - #include -#endif - -// 国際化のおまじない。 -#ifdef HAVE_GETTEXT - #include - #define _(String) dgettext(GETTEXT_PACKAGE,String) - #define N_(String) (String) -#else - #define _(String) (String) - #define N_(String) (String) - #define bindtextdomain(Package,Directory) - #define textdomain(domain) - #define bind_textdomain_codeset(domain,codeset) -#endif - -// プライグイン化のおまじないです。 -HonokaPluginRegister(KanaInput); -HonokaPluginSetup(KanaInput); - -HonokaSetupCorePage *KanaInput::setup() -{ - HonokaSetupPage *page = new HonokaSetupPage(_("KanaInput-plugin"),"",""); - page->append(new HonokaSetupBoolItem( - _("use _fake kana-input: "), - HONOKA_CONFIG_KANAINPUT_FAKEKANA, - _("if you use the table of ASCII-KANA key mapping,check this."), - HONOKA_DEFAULT_KANAINPUT_FAKEKANA - )); - HonokaSetupPage *sc = new HonokaSetupPage(_("shortcut keys: "),"",""); - sc->append(new HonokaSetupKeyItem( - _("Kana input: "), - String(HONOKA_CONFIG_KEY_PREEDITOR_PREFIX) + String("/KanaInput"), - "", - "" - )); - page->append(sc); - - return page; -}; - -namespace Honoka { - -struct HonokaKanaInputKey { - int code; - const char kana[6]; -}; - -const HonokaKanaInputKey HonokaKanaInputTable[] = { - {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_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, "ん"}, - - {0,""} -}; - -} - -KanaInput::KanaInput(ConfigPointer cfg) : PreEditor(cfg) -{ - fakeKanaInput = cfg->read(HONOKA_CONFIG_KANAINPUT_FAKEKANA,HONOKA_DEFAULT_KANAINPUT_FAKEKANA); - vs1 = utf8_mbstowcs(String("かきくけこさしすせそたちつてとはひふへほぱぴぷぺぽ")); - vs2 = utf8_mbstowcs(String("がぎぐげござじずぜぞだぢづでどばびぶべぼばびぶべぼ")); - svs1 = utf8_mbstowcs(String("はひふへほばびぶべぼ")); - svs2 = utf8_mbstowcs(String("ぱぴぷぺぽぱぴぷぺぽ")); - f1 = "1234567890-^qwertyuiopasdfghjkl;:]zxcvbnm,./\\!\"#$%&'()~=~|QWERTYUIOP`{ASDFGHJKL+*}ZXCVBNM<>?_"; - f2 = utf8_mbstowcs(String("ぬふあうえおやゆよわほへたていすかんなにらせちとしはきくまのりれけむつさそひこみもねるめろ!”ぁぅぇぉゃゅょを=〜ーたていすかんなにらせ`「ちとしはきくまのり+*」っさそひこみも、。・_")); -} - - -KanaInput::~KanaInput() -{ -} - -/*! - \fn KanaInput::getModeName() - */ -String KanaInput::getModeName() -{ - return String(_("KANA")); -} - -/*! - \fn KanaInput::getName() - */ -String KanaInput::getName() -{ - return String("KanaInput"); -} - -/*! - \fn KanaInput::getPropertyName() - */ -String KanaInput::getPropertyName() -{ - return String(_("Kana")); -} - - -/*! - \fn KanaInput::inputEvent(const KeyEvent &key) - */ -bool KanaInput::inputEvent(const KeyEvent &key) -{ - // 喰っておくべきもの。 - if (PreEditor::isThrough(key)) return true; - - - for(unsigned int i = 0;HonokaKanaInputTable[i].code != 0;++ i) { - if (key.code == HonokaKanaInputTable[i].code) { - text = text.substr(0,pos) + utf8_mbstowcs(String(HonokaKanaInputTable[i].kana)) + text.substr(pos); - pos ++; - return true; - } - } - if ((((key.get_ascii_code() == '@') && (fakeKanaInput)) || (key.code == SCIM_KEY_voicedsound )) && (pos > 0)) { - for(unsigned int i = 0;i < vs1.length();i ++) { - if (vs1[i] == text[pos - 1]) text = text.substr(0,pos - 1) + vs2[i] + text.substr(pos); - } - return true; - } - if ((((key.get_ascii_code() == '[') && (fakeKanaInput)) || (key.code == SCIM_KEY_semivoicedsound )) && (pos > 0)) { - for(unsigned int i = 0;i < svs1.length();i ++) { - if (svs1[i] == text[pos - 1]) text = text.substr(0,pos - 1) + svs2[i] + text.substr(pos); - } - return true; - } - if (fakeKanaInput) { - for(unsigned i = 0;i < f1.length();i ++) { - if (key.get_ascii_code() == f1[i]) { - text = text.substr(0,pos) + f2[i] + text.substr(pos); - pos ++; - return true; - } - } - } - if (isPrintable(key)) { - text = text.substr(0,pos) + key.get_unicode_code() + text.substr(pos); - pos ++; - return true; - } - return false; -} - diff --git a/honoka/plugins/kanainput.h b/honoka/plugins/kanainput.h deleted file mode 100644 index 4682f4a..0000000 --- a/honoka/plugins/kanainput.h +++ /dev/null @@ -1,66 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef KANAINPUT_H -#define KANAINPUT_H - -#define Uses_SCIM_ICONV -#define Uses_SCIM_CONFIG_BASE -#include -#include -#include -#include -#include "preeditor.h" -#include - -#define HONOKA_CONFIG_KANAINPUT_FAKEKANA "/IMEngine/Honoka/KanaInput/FakeKanaKey" -#define HONOKA_DEFAULT_KANAINPUT_FAKEKANA true - - -using namespace std; -using namespace scim; - -/** -@author TAM(Teppei Tamra) -*/ -namespace Honoka { - -class KanaInput : public PreEditor { -public: - KanaInput(ConfigPointer cfg); - - ~KanaInput(); - virtual bool inputEvent(const KeyEvent &key); - virtual String getName(); - virtual String getModeName(); - virtual String getPropertyName(); - static HonokaSetupCorePage *setup(); - -protected: - bool fakeKanaInput; - WideString vs1; - WideString vs2; - WideString svs1; - WideString svs2; - String f1; - WideString f2; -}; - -} -#endif diff --git a/honoka/plugins/nicolainput.cpp b/honoka/plugins/nicolainput.cpp deleted file mode 100644 index 2eb5da7..0000000 --- a/honoka/plugins/nicolainput.cpp +++ /dev/null @@ -1,338 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include "nicolainput.h" - -#include - -#ifdef HAVE_CONFIG_H - #include -#endif - -// 国際化のおまじない。 -#ifdef HAVE_GETTEXT - #include - #define _(String) dgettext(GETTEXT_PACKAGE,String) - #define N_(String) (String) -#else - #define _(String) (String) - #define N_(String) (String) - #define bindtextdomain(Package,Directory) - #define textdomain(domain) - #define bind_textdomain_codeset(domain,codeset) -#endif - -// プライグイン化のおまじないです。 -HonokaPluginRegister(NicolaInput); -HonokaPluginSetup(NicolaInput); - -HonokaSetupCorePage *NicolaInput::setup() -{ - HonokaSetupPage *page = new HonokaSetupPage(_("Nicola-plugin"),"",""); - page->append(new HonokaSetupKeyItem( - _("_Left KANA-Shift keys:"), - HONOKA_CONFIG_NICOLAINPUT_LSHIFT, - "", - HONOKA_DEFAULT_NICOLAINPUT_LSHIFT - )); - page->append(new HonokaSetupKeyItem( - _("_Right KANA-Shift keys:"), - HONOKA_CONFIG_NICOLAINPUT_RSHIFT, - "", - HONOKA_DEFAULT_NICOLAINPUT_RSHIFT - )); - page->append(new HonokaSetupIntItem( - _("_Simultaneously press timer:"), - HONOKA_CONFIG_NICOLAINPUT_SPTIMER, - "", - HONOKA_DEFAULT_NICOLAINPUT_SPTIMER, - 0,199 - )); - page->append(new HonokaSetupFileItem( - _("Nicola _table: "), - HONOKA_CONFIG_NICOLAINPUT_TABLE_FILE, - _("input the path of Nicola table file."), - HONOKA_DEFAULT_NICOLAINPUT_TABLE_FILE - )); - - HonokaSetupPage *sc = new HonokaSetupPage(_("shortcut keys: "),"",""); - sc->append(new HonokaSetupKeyItem( - _("Nicola input: "), - String(HONOKA_CONFIG_KEY_PREEDITOR_PREFIX) + String("/Nicola"), - "", - "" - )); - page->append(sc); - - return page; -}; - -namespace Honoka { -struct { - KeyCode key; - char noShift[6]; - char leftShift[6]; - char rightShift[6]; -} _nicolaTable[] = { - {SCIM_KEY_1,"1","?",""}, - {SCIM_KEY_2,"2","/",""}, - {SCIM_KEY_3,"3","~",""}, - {SCIM_KEY_4,"4","「",""}, - {SCIM_KEY_5,"5","」",""}, - - {SCIM_KEY_6,"6","","["}, - {SCIM_KEY_7,"7","","]"}, - {SCIM_KEY_8,"8","","("}, - {SCIM_KEY_9,"9","",")"}, - {SCIM_KEY_0,"0","","『"}, - {SCIM_KEY_minus,"-","","』"}, - {SCIM_KEY_backslash,"\\","",""}, - - {SCIM_KEY_q,"。","ぁ",""}, - {SCIM_KEY_w,"か","え","が"}, - {SCIM_KEY_e,"た","り","だ"}, - {SCIM_KEY_r,"こ","ゃ","ご"}, - {SCIM_KEY_t,"さ","れ","ざ"}, - - {SCIM_KEY_y,"ら","ぱ","よ"}, - {SCIM_KEY_u,"ち","ぢ","に"}, - {SCIM_KEY_i,"く","ぐ","る"}, - {SCIM_KEY_o,"つ","づ","ま"}, - {SCIM_KEY_p,",","ぴ","ぇ"}, - {SCIM_KEY_at,"、","",""}, - {SCIM_KEY_bracketleft,"゛","","゜"}, - - - {SCIM_KEY_a,"う","を",""}, - {SCIM_KEY_s,"し","あ","じ"}, - {SCIM_KEY_d,"て","な","で"}, - {SCIM_KEY_f,"け","ゅ","げ"}, - {SCIM_KEY_g,"せ","も","ぜ"}, - - {SCIM_KEY_h,"は","ば","み"}, - {SCIM_KEY_j,"と","ど","お"}, - {SCIM_KEY_k,"き","ぎ","の"}, - {SCIM_KEY_l,"い","ぽ","ょ"}, - {SCIM_KEY_semicolon,"ん","","っ"}, - - {SCIM_KEY_z,".","ぅ",""}, - {SCIM_KEY_x,"ひ","ー","び"}, - {SCIM_KEY_c,"す","ろ","ず"}, - {SCIM_KEY_v,"ふ","や","ぶ"}, - {SCIM_KEY_b,"へ","ぃ","べ"}, - - {SCIM_KEY_n,"め","ぷ","ぬ"}, - {SCIM_KEY_m,"そ","","ゆ"}, - {SCIM_KEY_comma,"ね","ぺ","む"}, - {SCIM_KEY_period,"ほ","ぼ","わ"}, - {SCIM_KEY_slash,"・","","ぉ"}, - - {SCIM_KEY_NullKey,"","",""} // terminator -}; -} - - -NicolaInput::NicolaInput(ConfigPointer cfg) : PreEditor(cfg) -{ - bkt = 0; - delay = cfg->read(HONOKA_CONFIG_NICOLAINPUT_SPTIMER,HONOKA_DEFAULT_NICOLAINPUT_SPTIMER); - scim_string_to_key_list(LShiftKey,cfg->read(HONOKA_CONFIG_NICOLAINPUT_LSHIFT,String(HONOKA_DEFAULT_NICOLAINPUT_LSHIFT))); - scim_string_to_key_list(RShiftKey,cfg->read(HONOKA_CONFIG_NICOLAINPUT_RSHIFT,String(HONOKA_DEFAULT_NICOLAINPUT_RSHIFT))); - String table = cfg->read(HONOKA_CONFIG_NICOLAINPUT_TABLE_FILE,String(HONOKA_DEFAULT_NICOLAINPUT_TABLE_FILE)); - LShift = false; - RShift = false; - - if (table.length()) loadTable(table); - if (!keymap.size()) { - for(unsigned int i = 0;_nicolaTable[i].key != SCIM_KEY_NullKey;i ++) { - NicolaKey k; - k.noShift = utf8_mbstowcs(_nicolaTable[i].noShift); - k.leftShift = utf8_mbstowcs(_nicolaTable[i].leftShift); - k.rightShift = utf8_mbstowcs(_nicolaTable[i].rightShift); - keymap.insert(pair(_nicolaTable[i].key,k)); - } - } - vsc = utf8_mbstowcs(String("゛")); - svsc = utf8_mbstowcs(String("゜")); - vs1 = utf8_mbstowcs(String("かきくけこさしすせそたちつてとはひふへほぱぴぷぺぽ")); - vs2 = utf8_mbstowcs(String("がぎぐげござじずぜぞだぢづでどばびぶべぼばびぶべぼ")); - svs1 = utf8_mbstowcs(String("はひふへほばびぶべぼ")); - svs2 = utf8_mbstowcs(String("ぱぴぷぺぽぱぴぷぺぽ")); -} - - -NicolaInput::~NicolaInput() -{ -} - - -/*! - \fn Honoka::NicolaInput::loadTable(const String &filename) - */ -bool Honoka::NicolaInput::loadTable(const String &filename) -{ - FILE *f = fopen(filename.c_str(),"r"); - if (!f) { - #ifdef HONOKA_DATADIR - String fn = HONOKA_DATADIR; - fn += "/" + filename; - f = fopen(fn.c_str(),"r"); - if (!f) return false; - #else - return false; - #endif - } - - while(-1) { - char s[256]; - if(fgets(s,256,f) == NULL) break; - String l = s; - unsigned int p = 0; - vector t; - for(unsigned int i = 0;i < l.length();i ++) { - if ((l[i] == '\t') || (l[i] == '\n')) { - t.push_back(l.substr(p,i - p)); - p = i + 1; - } - } - if (p < l.length()) t.push_back(l.substr(p)); - if (t.size() != 4) continue; - KeyEvent k; - NicolaKey n; - n.noShift = utf8_mbstowcs(t[1]); - n.leftShift = utf8_mbstowcs(t[2]); - n.rightShift = utf8_mbstowcs(t[3]); - scim_string_to_key(k,t[0]); - keymap.insert(pair(k,n)); - } - fclose(f); - if (keymap.size()) return true; - return false; -} - - -/*! - \fn NicolaInput::getModeName() - */ -String NicolaInput::getModeName() -{ - return String(_("KANA")); -} - -/*! - \fn NicolaInput::getName() - */ -String NicolaInput::getName() -{ - return String("Nicola"); -} - -/*! - \fn NicolaInput::getPropertyName() - */ -String NicolaInput::getPropertyName() -{ - return String(_("NICOLA")); -} - - -/*! - \fn NicolaInput::inputEvent(const KeyEvent &key) - */ -bool NicolaInput::inputEvent(const KeyEvent &key) -{ - if (PreEditor::isThrough(key)) return true; - - - map::iterator it = keymap.find(key); - if (it == keymap.end()) { - if (isPrintable(key)) { - text = text.substr(0,pos) + key.get_unicode_code() + text.substr(pos); - pos ++; - return true; - } else return false; - } - WideString w; - if (LShift) w = it->second.leftShift; - else if (RShift) w = it->second.rightShift; - else w = it->second.noShift; - bk = key; - if (w == vsc) { - for(unsigned int i = 0;i < vs1.length();i ++) { - if (vs1[i] == text[pos - 1]) text = text.substr(0,pos - 1) + vs2[i] + text.substr(pos); - } - } else - if (w == svsc) { - for(unsigned int i = 0;i < svs1.length();i ++) { - if (svs1[i] == text[pos - 1]) text = text.substr(0,pos - 1) + svs2[i] + text.substr(pos); - } - } else - if (w.length()) { - struct timeval tv; - gettimeofday(&tv, NULL); - bkt = (tv.tv_sec * 1000000) + tv.tv_usec; - text = text.substr(0,pos) + w + text.substr(pos); - pos ++; - } - return true; - //return false; -} - - - -/*! - \fn NicolaInput::keyEventHook(const KeyEvent &key) - */ -bool NicolaInput::keyEventHook(const KeyEvent &key) -{ - for(unsigned int i = 0;i < RShiftKey.size();i ++) { - if (key.code == RShiftKey[i].code) { - if (key.is_key_press()) { - RShift = true; - struct timeval tv; - gettimeofday(&tv, NULL); - long t = (tv.tv_sec * 1000000) + tv.tv_usec; - if ((t - bkt) < (delay * 1000)) { - backspace(); - return(inputEvent(bk)); - } - } - else if (key.is_key_release()) RShift = false; - return true; - } - } - for(unsigned int i = 0;i < LShiftKey.size();i ++) { - if (key.code == LShiftKey[i].code) { - if (key.is_key_press()) { - LShift = true; - struct timeval tv; - gettimeofday(&tv, NULL); - long t = (tv.tv_sec * 1000000) + tv.tv_usec; - if ((t - bkt) < (delay * 1000)) { - backspace(); - return(inputEvent(bk)); - } - } - else if (key.is_key_release()) LShift = false; - return true; - } - } - return false; -} - diff --git a/honoka/plugins/nicolainput.h b/honoka/plugins/nicolainput.h deleted file mode 100644 index d6a2cc4..0000000 --- a/honoka/plugins/nicolainput.h +++ /dev/null @@ -1,88 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef NICOLAINPUT_H -#define NICOLAINPUT_H - -#define Uses_SCIM_ICONV -#define Uses_SCIM_CONFIG_BASE -#include -#include -#include -#include -#include "preeditor.h" -#include - -#define HONOKA_CONFIG_NICOLAINPUT_LSHIFT "/IMEngine/Honoka/NicolaInput/LeftShift" -#define HONOKA_DEFAULT_NICOLAINPUT_LSHIFT "Muhenkan" -#define HONOKA_CONFIG_NICOLAINPUT_RSHIFT "/IMEngine/Honoka/NicolaInput/RightShift" -#define HONOKA_DEFAULT_NICOLAINPUT_RSHIFT "Henkan" -#define HONOKA_CONFIG_NICOLAINPUT_SPTIMER "/IMEngine/Honoka/NicolaInput/SimultaneouslyPressTimer" -#define HONOKA_DEFAULT_NICOLAINPUT_SPTIMER 100 -#define HONOKA_CONFIG_NICOLAINPUT_TABLE_FILE "/IMEngine/Honoka/NicolaInput/TableFile" -#define HONOKA_DEFAULT_NICOLAINPUT_TABLE_FILE "" - - -using namespace std; -using namespace scim; - -/** -@author TAM(Teppei Tamra) -*/ -namespace Honoka { - -class NicolaKey { -public: - WideString noShift; - WideString leftShift; - WideString rightShift; -}; - -class NicolaInput : public PreEditor { -public: - NicolaInput(ConfigPointer cfg); - - ~NicolaInput(); - virtual bool inputEvent(const KeyEvent &key); - virtual String getName(); - virtual String getModeName(); - virtual String getPropertyName(); - virtual bool keyEventHook(const KeyEvent &key); - static HonokaSetupCorePage *setup(); - -protected: - bool LShift; - bool RShift; - KeyEventList LShiftKey; - KeyEventList RShiftKey; - unsigned int delay; - map keymap; - WideString vsc; - WideString svsc; - WideString vs1; - WideString vs2; - WideString svs1; - WideString svs2; - long bkt; - KeyEvent bk; -protected: - bool loadTable(const String &filename); -}; -} -#endif diff --git a/honoka/plugins/primeprediction.cpp b/honoka/plugins/primeprediction.cpp deleted file mode 100644 index a4cd5f6..0000000 --- a/honoka/plugins/primeprediction.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "primeprediction.h" - -#ifdef HAVE_CONFIG_H - #include -#endif - -#ifdef HAVE_GETTEXT - #include - #define _(String) dgettext(GETTEXT_PACKAGE,String) - #define N_(String) (String) -#else - #define _(String) (String) - #define N_(String) (String) - #define bindtextdomain(Package,Directory) - #define textdomain(domain) - #define bind_textdomain_codeset(domain,codeset) -#endif - -#include -#include -#include -#include - - -// プライグイン化のおまじないです。 -HonokaPluginRegister(PrimePrediction); -HonokaPluginSetup(PrimePrediction); - -HonokaSetupCorePage *PrimePrediction::setup() -{ - vector l; - HonokaSetupPage *page = new HonokaSetupPage(_("PrimePrediction-plugin"),"",""); - l.clear(); - l.push_back(String("lookup")); - l.push_back(String("lookup_all")); - l.push_back(String("lookup_compact")); - l.push_back(String("lookup_compact_all")); - l.push_back(String("lookup_direct")); - l.push_back(String("lookup_direct_all")); - l.push_back(String("lookup_exact")); - l.push_back(String("lookup_expansion")); - l.push_back(String("lookup_hybrid")); - l.push_back(String("lookup_hybrid_all")); - l.push_back(String("lookup_mixed")); - page->append(new HonokaSetupSelectItem( - _("_Lookup method: "), - HONOKA_CONFIG_PRIME_PREDICTION_LM, - _("select the lookup method."), - HONOKA_DEFAULT_PRIME_PREDICTION_LM, - l - )); - HonokaSetupPage *sc = new HonokaSetupPage(_("shortcut keys: "),"",""); - sc->append(new HonokaSetupKeyItem( - _("Prime Prediction: "), - String(HONOKA_CONFIG_KEY_PREDICTOR_PREFIX) + String("/PrimePrediction"), - "", - "" - )); - page->append(sc); - - return page; -}; - - -PrimePrediction::PrimePrediction(ConfigPointer cfg) : Predictor(cfg) -{ - m_iconv.set_encoding ("EUC-JP"); - prime_pid = -1; - mid = shmget(IPC_PRIVATE,sizeof(bool),IPC_CREAT | 0666); - if (mid != -1) { - con = (bool *)shmat(mid,0,0); - con[0] = false; - // shmat失敗時のエラー処理は?。 - // 同一プロセスで確実に同じIDなら失敗しようがない気もするが。 - } - lookup_method = cfg->read(HONOKA_CONFIG_PRIME_PREDICTION_LM,String(HONOKA_DEFAULT_PRIME_PREDICTION_LM)); - if ((lookup_method != "lookup") && - (lookup_method != "lookup_all") && - (lookup_method != "lookup_compact") && - (lookup_method != "lookup_compact_all") && - (lookup_method != "lookup_direct") && - (lookup_method != "lookup_direct_all") && - (lookup_method != "lookup_exact") && - (lookup_method != "lookup_expansion") && - (lookup_method != "lookup_hybrid") && - (lookup_method != "lookup_hybrid_all") && - (lookup_method != "lookup_mixed")) lookup_method = String(HONOKA_DEFAULT_PRIME_PREDICTION_LM); -} - - -PrimePrediction::~PrimePrediction() -{ - disconnect(); - if (prime_pid != -1) { - kill(prime_pid,SIGKILL); - wait(NULL); - } - if (mid != -1) shmctl(mid,IPC_RMID,0); -} - - -/*! - \fn PrimePrediction::parser(const String &str) - */ -ResultEntry PrimePrediction::parser(const String &str) -{ - vector rl; - String r; - for(unsigned int i = 0;i < str.length();i ++) { - if ((str[i] == '\t') || (str[i] == ' ')) { - if (r.length()) { - rl.push_back(r); - r = ""; - } - } else r += str[i]; - } - if (r.length()) rl.push_back(r); - - if (rl.size() < 2) return ResultEntry(); - WideString w,a; - for(unsigned int i = 2;i < rl.size();i ++) { - if (rl[i].length() < 7) continue; - if (rl[i].substr(0,6) == "usage=") m_iconv.convert(a,rl[i].substr(6)); - } - m_iconv.convert(w,rl[1]); - if (!a.length()) a = w; - else a = w + utf8_mbstowcs(String(" (")) + a + utf8_mbstowcs(String(")")); - return ResultEntry(w,a); -} - -/*! - \fn PrimePrediction::getPredictionList(const WideString &str) - */ -ResultList PrimePrediction::getPredictionList(const WideString &str) -{ - ResultList l; - if (mid == -1) return l; - if (!con[0]) return l; - String s = lookup_method + "\t"; - String t; - m_iconv.convert(t,str); - s = s + t + String("\n"); - write(ifd,s.c_str(),s.length()); - char b[1024]; - vector sl; - s = ""; - while(-1) { - int c = read(ofd,b,1023); - s += String(b,c); - if (s.substr(s.length() - 2,2) == "\n\n") break; - } - t = ""; - for(unsigned int i = 0;i < s.length();i ++) { - if (s[i] == '\n') { - sl.push_back(t); - t = ""; - } else t += s[i]; - } - if (t.length()) sl.push_back(t); - l.Title = utf8_mbstowcs(String(_("lookup result"))); - l.kType = PREDICTION; - for(unsigned int i = 1;i < sl.size();i ++) { - ResultEntry e = parser(sl[i]); - if (e.kanji.length()) l.kouho.push_back(e); - } - return l; -} - - -/*! - \fn PrimePrediction::disconnect() - */ -void PrimePrediction::disconnect() -{ - if (mid == -1) return; - if (con[0]) return; - String s = "close\n"; - write(ifd,s.c_str(),s.length()); - close(ifd); - close(ofd); - con[0] = false; - prime_pid = -1; -} - - -/*! - \fn PrimePrediction::connect() - */ -bool PrimePrediction::connect() -{ - if (mid == -1) return false; - - // primeチェーック! - int ps; - if (fork() == 0) { - execlp("prime","--help",NULL); - _exit(0); - } - wait(&ps); - if (!WIFEXITED(ps)) return false; - if (WEXITSTATUS(ps) != 0) return false; - // primeは動いてるっぽい。以下。 - - int in_fd[2],out_fd[2],i; - if (con[0]) return true; - if (pipe(in_fd) == -1) return false; - if (pipe(out_fd) == -1) return false; - prime_pid = fork(); - switch(prime_pid) { - case -1: { - close(in_fd[0]); - close(in_fd[1]); - close(out_fd[0]); - close(out_fd[1]); - con[0] = false; - return false; - } - case 0: { - close(in_fd[1]); - close(out_fd[0]); - dup2(in_fd[0],0); - dup2(out_fd[1],1); - close(in_fd[0]); - close(out_fd[1]); - con[0] = true; - execlp("prime",NULL); - con[0] = false; - _exit(0); - } - } - close(in_fd[0]); - close(out_fd[1]); - ifd = in_fd[1]; - ofd = out_fd[0]; - return true; -} - - -/*! - \fn PrimePrediction::isConnected() - */ -bool PrimePrediction::isConnected() -{ - if (mid == -1) return false; - return con[0]; -} - - -/*! - \fn PrimePrediction::getPropertyName() - */ -String PrimePrediction::getPropertyName() -{ - return String(_("PrimePrediction")); -} - -/*! - \fn PrimePrediction::getName() - */ -String PrimePrediction::getName() -{ - return String("PrimePrediction"); -} - -/*! - \fn PrimePrediction::update(const WideString str,const WideString yomi) - */ -void PrimePrediction::update(const WideString str,const WideString yomi) -{ -} - - - diff --git a/honoka/plugins/primeprediction.h b/honoka/plugins/primeprediction.h deleted file mode 100644 index 9464fe6..0000000 --- a/honoka/plugins/primeprediction.h +++ /dev/null @@ -1,78 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef PRIMEPREDICTION_H -#define PRIMEPREDICTION_H - - -#define Uses_SCIM_CONFIG_BASE -#define Uses_SCIM_ICONV - - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define HONOKA_CONFIG_PRIME_PREDICTION_LM "/IMEngine/Honoka/Prime/LookupMethod" -#define HONOKA_DEFAULT_PRIME_PREDICTION_LM "lookup_hybrid" - - -/** -@author TAM (Teppei Tamra) -*/ -namespace Honoka { - -class PrimePrediction : public Predictor { -public: - PrimePrediction(ConfigPointer cfg); - - ~PrimePrediction(); - virtual ResultList getPredictionList(const WideString &str); - virtual void disconnect(); - virtual bool connect(); - virtual bool isConnected(); - virtual String getPropertyName(); - virtual String getName(); - virtual void update(const WideString str,const WideString yomi); - static HonokaSetupCorePage *setup(); - -protected: - String lookup_method; - int ifd; - int ofd; - bool *con; - IConvert m_iconv; - int mid; - pid_t prime_pid; -protected: - ResultEntry parser(const String &str); -}; -} -#endif diff --git a/honoka/plugins/romkan.cpp b/honoka/plugins/romkan.cpp deleted file mode 100644 index 5d2d3f6..0000000 --- a/honoka/plugins/romkan.cpp +++ /dev/null @@ -1,763 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include "romkan.h" - -#ifdef HAVE_CONFIG_H - #include -#endif - -// 国際化のおまじない。 -#ifdef HAVE_GETTEXT - #include - #define _(String) dgettext(GETTEXT_PACKAGE,String) - #define N_(String) (String) -#else - #define _(String) (String) - #define N_(String) (String) - #define bindtextdomain(Package,Directory) - #define textdomain(domain) - #define bind_textdomain_codeset(domain,codeset) -#endif - -// プライグイン化のおまじないです。 -HonokaPluginRegister(RomkanPlugin); -HonokaPluginSetup(RomkanPlugin); - -HonokaSetupCorePage *RomkanPlugin::setup() -{ - HonokaSetupPage *page = new HonokaSetupPage(_("Romkan-plugin"),"",""); - page->append(new HonokaSetupFileItem( - _("_Roma-Kana table: "), - HONOKA_CONFIG_ROMKAN_TABLE_FILE, - _("input the path of Roma-Kana convert table file."), - HONOKA_DEFAULT_ROMKAN_TABLE_FILE - )); - page->append(new HonokaSetupBoolItem( - _("Ascii to Kana convert: "), - HONOKA_CONFIG_ROMKAN_AUTO_A2K, - _("convert ascii to kana when be switched to ROMKAN ."), - HONOKA_DEFAULT_ROMKAN_AUTO_A2K - )); - page->append(new HonokaSetupKeyItem( - _("Ascii to Kana convert key: "), - HONOKA_CONFIG_ROMKAN_A2K_KEY, - _("The key events to convert the ascii string to kana."), - HONOKA_DEFAULT_ROMKAN_A2K_KEY - )); - HonokaSetupPage *sc = new HonokaSetupPage(_("shortcut keys: "),"",""); - sc->append(new HonokaSetupKeyItem( - _("Romkan input: "), - String(HONOKA_CONFIG_KEY_PREEDITOR_PREFIX) + String("/Romkan"), - "", - "" - )); - page->append(sc); - - return page; -}; - -RomkanPlugin::RomkanPlugin(ConfigPointer cfg) : HonokaMultiplePluginBase(cfg) -{ - String c = config->read(HONOKA_CONFIG_ROMKAN_TABLE_FILE,String(HONOKA_DEFAULT_ROMKAN_TABLE_FILE)); - if (c.length()) romkans.push_back(new Romkan(cfg,String(""))); - for(unsigned int i = 1;i < 10;i ++) { - char a[3]; - sprintf(a,"%d",i); - c = config->read(String(HONOKA_CONFIG_ROMKAN_TABLE_FILE) + String(a),String("")); - if (c.length()) romkans.push_back(new Romkan(cfg,String(a))); - } -} - -RomkanPlugin::~RomkanPlugin() -{ - for(unsigned int i = 0;i < romkans.size();i ++) delete romkans[i]; -} - -HonokaPluginBase * RomkanPlugin::getPluginInstanceAt(int p) -{ - if ((p < 0) || (p >= romkans.size())) return 0; - return romkans[p]; -} - -int RomkanPlugin::getPluginCount() -{ - return romkans.size(); -} - -String RomkanPlugin::getName() -{ - return String("RomkanPlugin"); -} - -Romkan::Romkan(ConfigPointer cfg,String _postfix) : PreEditor(cfg) -{ - reset(); - iconvert.set_encoding ("EUC-JP"); - mode = ROMA; - postfix = _postfix; - init(); -} - - -Romkan::~Romkan() -{ -} - - -/*! - \fn Romkan::loadTable(const String &filename, bool inc) - */ -void Romkan::loadTable(const String &filename, bool inc) -{ - FILE *f = fopen(filename.c_str(),"r"); - if (!f) { - #ifdef HONOKA_DATADIR - String fn = HONOKA_DATADIR; - fn += "/" + filename; - f = fopen(fn.c_str(),"r"); - if (!f) return; - #else - return; - #endif - } - - while(-1) { - char s[256]; - if(fgets(s,256,f) == NULL) break; - String k,r; - unsigned int i = 0; - bool ex = false; - for(;s[i];i ++) { - if (s[i] == ' ') { - if (k.size()) break; - else continue; - } - if (s[i] == '\n') break; - if ((s[i] == '!') || (s[i] == '$') ||(s[i] == '%')) { - if (!k.size()) ex = true; - } - if (s[i] == '#') break; - if ((s[i] == '\\') && (s[i + 1] != 0)) { - i ++; - } - k += s[i]; - } - if ((!k.size()) || (s[i] == '#')) continue; - if (s[i] != 0) { - i ++; - for(;s[i];i ++) { - if ((s[i] == '#') || (s[i] == '\n')) break; - if (s[i] == ' ') { - if (r.size()) break; - else continue; - } - if ((s[i] == '\\') && (s[i + 1] != 0)) { - i ++; - } - r += s[i]; - } - } - if (ex && (k[0] == '%')) { - loadTable(k.substr(1),true); - continue; - } - if ((k[0] == '$') && (!inc) && ex) { - tableConfig.insert(pair(k.substr(1),r)); - continue; - } - if ((k[0] == '!') && (!inc) && ex) { - RomkanKeyEventList kev; - scim_string_to_key_list(kev,k.substr(1)); - kev.p = utf8_mbstowcs(r); - hookKey.push_back(kev); - continue; - } - if (!r.size()) continue; - RomkanTable.insert(pair(k,utf8_mbstowcs(r))); - - for(unsigned int j = k.length();j > 1;j --) { - String keep = k.substr(0,j - 1); - if ((keepTable.find(keep) == keepTable.end()) && (RomkanTable.find(keep) == RomkanTable.end())) { - keepTable.insert(keep); - } - } - } - fclose(f); - -} - - -/*! - \fn Romkan::string2bool(const String &s) - */ -bool Romkan::string2bool(const String &s) -{ - if ((s == "FALSE") || (s == "false") || (s == "False") || (s == "0") || (!s.size())) return false; - else return true; -} - - -/*! - \fn Romkan::init() - */ -void Romkan::init() -{ - RomkanTable.clear(); - keepTable.clear(); - tableConfig.clear(); - - //String rk_table = config->read(HONOKA_CONFIG_ROMKAN_TABLE_FILE,String(HONOKA_DEFAULT_ROMKAN_TABLE_FILE)); - String rk_table = config->read(String(HONOKA_CONFIG_ROMKAN_TABLE_FILE) + postfix,String(HONOKA_DEFAULT_ROMKAN_TABLE_FILE)); - scim_string_to_key_list(key_a2k,config->read(HONOKA_CONFIG_ROMKAN_A2K_KEY,String(HONOKA_DEFAULT_ROMKAN_A2K_KEY))); - aa2k = config->read(HONOKA_CONFIG_ROMKAN_AUTO_A2K,HONOKA_DEFAULT_ROMKAN_AUTO_A2K); - if (rk_table.size()) { - loadTable(rk_table); - } - - if (tableConfig.find("nnMode") != tableConfig.end()) - nnMode = string2bool(tableConfig["nnMode"]); - else nnMode = false; - if (tableConfig.find("nProc") != tableConfig.end()) - nProc = string2bool(tableConfig["nProc"]); - else nProc = true; - if (tableConfig.find("xtProc") != tableConfig.end()) - xtProc = string2bool(tableConfig["xtProc"]); - else xtProc = true; - if (tableConfig.find("AsciiModeCancel") != tableConfig.end()) - asciiCancel = string2bool(tableConfig["AsciiModeCancel"]); - else asciiCancel = true; - if (tableConfig.find("RemoveRemainder") != tableConfig.end()) - removeRemainder = string2bool(tableConfig["RemoveRemainder"]); - else removeRemainder = false; - if (tableConfig.find("Key/Ascii") != tableConfig.end()) - scim_string_to_key_list(key_ascii_mode,tableConfig["Key/Ascii"]); - if (tableConfig.find("Key/WideAscii") != tableConfig.end()) - scim_string_to_key_list(key_wascii_mode,tableConfig["Key/WideAscii"]); - if (tableConfig.find("Key/ToggleHalfOrWide") != tableConfig.end()) - scim_string_to_key_list(key_toggle_hw,tableConfig["Key/ToggleHalfOrWide"]); - if (tableConfig.find("Key/ToggleHiraOrKata") != tableConfig.end()) - scim_string_to_key_list(key_toggle_hk,tableConfig["Key/ToggleHiraOrKata"]); - if (tableConfig.find("Hook") != tableConfig.end()) - hookp = tableConfig["Hook"]; - else hookp = ""; - -} - - - - -/*! - \fn Romkan::setPos(int p) - */ -void Romkan::setPos(int p) -{ - if (p < 0) p = 0; - else if (p > getTextLength()) p = getTextLength(); - pos = p; - buf.clear(); - rmChars.clear(); -} - - -/*! - \fn Romkan::clear() - */ -void Romkan::clear() -{ - text.clear(); - buf.clear(); - rmChars.clear(); -} - - -/*! - \fn Romkan::insert(char k) - */ -WideString Romkan::insert(char k) -{ - String s; - s = k; - if (k == 0) return text; - switch(mode) { - case ASCII: { - buf.clear(); - rmChars.clear(); - text = text.substr(0,pos) + utf8_mbstowcs(s) + text.substr(pos); - pos ++; - return text; - break; - } - case WASCII: { - buf.clear(); - rmChars.clear(); - WideString w = utf8_mbstowcs(s); - convHanZen(w,pos); - text = text.substr(0,pos) + w + text.substr(pos); - pos ++; - return text; - break; - } - case ROMA: { - buf += s; - text = text.substr(0,pos) + utf8_mbstowcs(s) + text.substr(pos); - pos ++; - return eval(); - break; - } - case KROMA: { - buf += s; - text = text.substr(0,pos) + utf8_mbstowcs(s) + text.substr(pos); - pos ++; - return eval(); - break; - } - case HROMA: { - buf += s; - text = text.substr(0,pos) + utf8_mbstowcs(s) + text.substr(pos); - pos ++; - return eval(); - break; - } - } - return text; -} - - -/*! - \fn Romkan::eval() - */ -WideString Romkan::eval() -{ - // エヴァる。 - - if (buf.length() == 2) { - - // n+母音以外は「ん」+子音である - // ただし、nyは除外である。 - if (nProc && (buf[0] == 'n')) { - String b = "aiueoy"; - if (nnMode) b += "n"; - bool boin = false; - for(unsigned int i = 0;i < b.length();i ++) { - if (buf[1] == b[i]) boin = true; - } - if (!boin) { - WideString r; - r += convChars[KANA_N]; - if (mode == HROMA) convZenHan(r,0); - else if (mode == KROMA) convHiraKata(r); - text = text.substr(0,pos - 2) + r + text.substr(pos - 1); - buf = buf.substr(buf.length() - 1,1); - rmChars.clear(); - } - } - - // 同じ文字が2文字続くとそれは「っ」+子音である。母音の連打がbufに残ってはいないはず。 - else if (xtProc && (buf[0] == buf[1])) { - WideString r; - r += convChars[KANA_XTU]; - if (mode == HROMA) convZenHan(r,0); - else if (mode == KROMA) convHiraKata(r); - text = text.substr(0,pos - 2) + r + text.substr(pos - 1); - buf = buf.substr(buf.length() - 1,1); - rmChars.clear(); - return text; - } - } - - // 保留テーブルを検索する。 - if (keepTable.find(buf) != keepTable.end()) return text; - // テーブルを検索して入力する。 - map::iterator it = RomkanTable.find(buf); - if (it != RomkanTable.end()) { - WideString r; - r += it->second; - if (mode == HROMA) convZenHan(r,0); - else if (mode == KROMA) convHiraKata(r); - text = text.substr(0,pos - buf.length()) + r + text.substr(pos); - pos = pos - buf.length() + r.length(); - buf.clear(); - rmChars.clear(); - return text; - } - if (buf.length()) { - if (removeRemainder) { - text = text.substr(0,pos - buf.length()) + text.substr(pos - buf.length() + 1); - pos --; - } - rmChars = rmChars + buf.substr(0,1); - buf = buf.substr(1); - return eval(); - } - - return text; -} - - - - -/*! - \fn Romkan::reset() - */ -void Romkan::reset() -{ - clear(); - pos = 0; - mode = ROMA; -} - -/*! - \fn PreEditor::setText(const WideString &t) - */ -void Romkan::setText(const WideString &t) -{ - text = t; - buf.clear(); - rmChars.clear(); -} - - -/*! - \fn Romkan::getText(bool hosei) - */ -WideString Romkan::getText(bool hosei) -{ - if (hosei) { - if (buf.length()) { - if (removeRemainder) { - text = text.substr(0,pos - buf.length()) + text.substr(pos); - pos -= buf.length(); - if (buf.substr(buf.length() - 1,1) == "n") { - WideString r; - r += convChars[KANA_N]; - if (mode == HROMA) convZenHan(r,0); - else if (mode ==KROMA) convHiraKata(r); - text = text.substr(0,pos) + r + text.substr(pos); - pos ++; - } - } else - if (buf.substr(buf.length() - 1,1) == "n") { - WideString r; - r += convChars[KANA_N]; - if (mode == HROMA) convZenHan(r,0); - else if (mode ==KROMA) convHiraKata(r); - text = text.substr(0,pos - 1) + r + text.substr(pos); - } - } - } - return text; -} - - -/*! - \fn Romkan::backspace() - */ -void Romkan::backspace() -{ - if (getPos() == 0) return; - text = text.substr(0,pos - 1) + text.substr(pos); - pos --; - // BSは小バッファもBSするゾ。 - if (buf.length()) buf = buf.substr(0,buf.length() - 1); - else if (rmChars.length()) rmChars = rmChars.substr(0,rmChars.length() - 1); - // BS時にバッファの頭1文字を復帰。 - // その一文字がシングルバイトでなかった場合は破棄。 - if (pos && (!removeRemainder) && rmChars.size()) { - /* - while((pos - buf.size()) > 0) { - String s = utf8_wcstombs(text.substr(pos - (buf.length() + 1),1)); - if (s.length() == 1) { - buf = s + buf; - } else break; - }*/ - buf = rmChars + buf; - rmChars.clear(); - eval(); - return; - - } -} - - - -/*! - \fn Romkan::del() - */ -void Romkan::del() -{ - if (getPos() == getTextLength()) return; - text = text.substr(0,pos) + text.substr(pos + 1); -} - - - -/*! - \fn Romkan::hiraKata() - */ -void Romkan::hiraKata() -{ - convHiraKata(text); -} - - -/*! - \fn Romkan::kataHira() - */ -void Romkan::kataHira() -{ - convKataHira(text); -} - -/*! - \fn Romkan::toHalf() - */ -void Romkan::toHalf() -{ - setPos(convZenHan(text,getPos())); - buf.clear(); - rmChars.clear(); -} - -/*! - \fn Romkan::toWide() - */ -void Romkan::toWide() -{ - setPos(convHanZen(text,getPos())); - buf.clear(); - rmChars.clear(); -} - - - -/*! - \fn Romkan::keyEventHook(const KeyEvent &key) - */ -bool Romkan::keyEventHook(const KeyEvent &key) -{ - if (key.is_key_release()) return false; - if (key_toggle_hw.comp(key)) { - switch (mode) { - case ASCII: { - mode = WASCII; - break; - } - case WASCII: { - mode = ASCII; - break; - } - case ROMA: { - mode = HROMA; - break; - } - case HROMA: { - mode = ROMA; - break; - } - } - return true; - } - if (key_toggle_hk.comp(key)) { - if (mode == ROMA) mode = KROMA; - else if (mode == KROMA) mode = ROMA; - return true; - } - - if ((isprint(key.code)) && ((mode == ASCII) || (mode == WASCII))) { - if ((!key.is_alt_down()) && (!key.is_control_down())) { - insert(key.get_ascii_code()); - return true; - } - } - - for(vector::iterator it = hookKey.begin();it != hookKey.end();it ++) { - if (it->comp(key)) { - text = text.substr(0,pos) + it->p + text.substr(pos); - pos += it->p.length(); - return true; - } - } - - if (!hookp.length()) return false; - if ((buf.length() < hookp.length()) || (!hookp.length())) return false; - else if (buf.substr(0,hookp.length()) == hookp) { - return inputEvent(key); - } - return false; -} - - -/*! - \fn Romkan::getModeName() - */ -String Romkan::getModeName() -{ - switch(mode) { - case ROMA: { - return String(_("Roma-Kana")); - break; - } - case KROMA: { - return String(_("Roma-Katakana")); - break; - } - case HROMA: { - return String(_("Half Roma-Kana")); - break; - } - case ASCII: { - return String(_("Ascii")); - break; - } - case WASCII: { - return String(_("Wide Ascii")); - break; - } - } -} - - -/*! - \fn Romkan::cancelEvent() - */ -bool Romkan::cancelEvent() -{ - if (((mode == ASCII) || (mode == WASCII)) && (asciiCancel)) { - mode = ROMA; - return true; - } - return false; -} - - -/*! - \fn Romkan::inputEvent(const KeyEvent &key) - */ -bool Romkan::inputEvent(const KeyEvent &key) -{ - if (PreEditor::isThrough(key)) return true; - - if (key_a2k.comp(key)) { - asciiToKana(); - return true; - } - if (key_ascii_mode.comp(key)) { - mode = ASCII; - return true; - } - if (key_wascii_mode.comp(key)) { - mode = WASCII; - return true; - } - - if (key.get_ascii_code() && (!key.is_alt_down()) && (!key.is_control_down())) { - if ((key.get_ascii_code() == ' ') && (!getTextLength())) return false; - // 素直に返すべきもの - if ((key.code == SCIM_KEY_Return) || - (key.code == SCIM_KEY_Linefeed) || - (key.code == SCIM_KEY_Tab)) return false; - if (!isprint(key.get_ascii_code())) return false; - insert(key.get_ascii_code()); - return true; - } - if (key.get_unicode_code() && (!key.is_alt_down()) && (!key.is_control_down())) { - buf.clear(); - rmChars.clear(); - text = getText(true) + key.get_unicode_code(); - pos ++; - return true; - } - return false; -} - - -/*! - \fn Romkan::getName() - */ -String Romkan::getName() -{ - return String("Romkan") + postfix; -} - -/*! - \fn Romkan::getPropertyName() - */ -String Romkan::getPropertyName() -{ - return String(_("Roma")) + postfix; -} - - - - -/*! - \fn Romkan::getAttributeList() - */ -AttributeList Romkan::getAttributeList() -{ - AttributeList l; - if (buf.length()) { - Attribute a(pos - buf.length(),buf.length(),SCIM_ATTR_FOREGROUND,SCIM_RGB_COLOR(255,0,0)); - l.push_back(a); - } - return l; -} - - -/*! - \fn Honoka::Romkan::asciiToKana() - */ -void Honoka::Romkan::asciiToKana() -{ - inputMode m = mode; - WideString t = text; - reset(); - mode = ROMA; - WideString b; - for(unsigned int i = 0;i < t.length();i ++) { - if (((t[i] >= 0x0041) && (t[i] <= 0x005A)) || ((t[i] >= 0x0061) && (t[i] <= 0x007A))) { - b += t[i]; - } else { - if (b.length()) { - String s = utf8_wcstombs(b).c_str(); - for(unsigned int j = 0;j < s.length();j ++) insert(s[j]); - b.clear(); - } - text += t[i]; - setPos(getPos() + 1); - } - } - if (b.length()) { - String s = utf8_wcstombs(b).c_str(); - for(unsigned int j = 0;j < s.length();j ++) insert(s[j]); - } - mode = m; - return; - -} - - -/*! - \fn Honoka::Romkan::selected() - */ -void Honoka::Romkan::selected() -{ - if (aa2k) asciiToKana(); -} diff --git a/honoka/plugins/romkan.h b/honoka/plugins/romkan.h deleted file mode 100644 index dd25fc8..0000000 --- a/honoka/plugins/romkan.h +++ /dev/null @@ -1,134 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef ROMKAN_H -#define ROMKAN_H - -#define Uses_SCIM_ICONV -#define Uses_SCIM_CONFIG_BASE -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#define HONOKA_CONFIG_ROMKAN_TABLE_FILE "/IMEngine/Honoka/Romkan/TableFile" -#define HONOKA_DEFAULT_ROMKAN_TABLE_FILE "honoka-def.rkt" -#define HONOKA_CONFIG_ROMKAN_A2K_KEY "/IMEngine/Honoka/Romkan/AsciiToKana" -#define HONOKA_DEFAULT_ROMKAN_A2K_KEY "Hiragana_Katakana" -#define HONOKA_CONFIG_ROMKAN_AUTO_A2K "/IMEngine/Honoka/Romkan/AutoA2K" -#define HONOKA_DEFAULT_ROMKAN_AUTO_A2K false - - -using namespace std; -using namespace scim; -/** -@author TAM(Teppei Tamra) -*/ -namespace Honoka { - -struct RomkanTableEntry { - String key; - WideString kana; -}; - -class RomkanKeyEventList : public HonokaKeyEventList -{ -public: - WideString p; -}; - -class Romkan; -class RomkanPlugin : public HonokaMultiplePluginBase { -public: - RomkanPlugin(ConfigPointer cfg); - - ~RomkanPlugin(); - virtual HonokaPluginBase * getPluginInstanceAt(int p); - virtual int getPluginCount(); - virtual String getName(); - static HonokaSetupCorePage *setup(); - -protected: - vector romkans; -}; - - -class Romkan : public PreEditor { -public: - Romkan(ConfigPointer cfg,String _postfix); - - ~Romkan(); - virtual void clear(); - virtual void setPos(int p); - virtual void reset(); - virtual WideString getText(bool hosei = false); - virtual void backspace(); - virtual void del(); - virtual void hiraKata(); - virtual void kataHira(); - virtual void toWide(); - virtual void toHalf(); - virtual bool keyEventHook(const KeyEvent &key); - virtual String getModeName(); - virtual bool cancelEvent(); - virtual bool inputEvent(const KeyEvent &key); - virtual String getName(); - virtual String getPropertyName(); - virtual void setText(const WideString &t); - virtual AttributeList getAttributeList(); - -protected: - WideString eval(); - WideString insert(char k); - void init(); - void loadTable(const String &filename, bool inc = false); - bool string2bool(const String &s); - void asciiToKana(); - virtual void selected(); - -protected: - String buf; - String rmChars; - String modeName; - enum inputMode {ROMA,HROMA,KROMA,ASCII,WASCII}; - inputMode mode; - bool nnMode; - bool nProc; - bool xtProc; - bool asciiCancel; - bool removeRemainder; - HonokaKeyEventList key_ascii_mode,key_wascii_mode,key_toggle_hw,key_toggle_hk,key_a2k; - map RomkanTable; - set keepTable; - map tableConfig; - String hookp; - vector hookKey; - String postfix; - bool aa2k; -}; - -} - -#endif diff --git a/honoka/plugins/simpleprediction.cpp b/honoka/plugins/simpleprediction.cpp deleted file mode 100644 index 29cb5dc..0000000 --- a/honoka/plugins/simpleprediction.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "simpleprediction.h" - -#ifdef HAVE_CONFIG_H - #include -#endif - -#ifdef HAVE_GETTEXT - #include - #define _(String) dgettext(GETTEXT_PACKAGE,String) - #define N_(String) (String) -#else - #define _(String) (String) - #define N_(String) (String) - #define bindtextdomain(Package,Directory) - #define textdomain(domain) - #define bind_textdomain_codeset(domain,codeset) -#endif - -// プライグイン化のおまじないです。 -HonokaPluginRegister(SimplePrediction); -HonokaPluginSetup(SimplePrediction); - -HonokaSetupCorePage *SimplePrediction::setup() -{ - HonokaSetupPage *page = new HonokaSetupPage(_("SimplePrediction-plugin"),"",""); - page->append(new HonokaSetupIntItem( - _("_max history count: "), - HONOKA_CONFIG_SIMPLEPREDICTION_SIZE, - _("set maximum size of history count."), - HONOKA_DEFAULT_SIMPLEPREDICTION_SIZE, - 1,500 - )); - HonokaSetupPage *sc = new HonokaSetupPage(_("shortcut keys: "),"",""); - sc->append(new HonokaSetupKeyItem( - _("Simple Prediction: "), - String(HONOKA_CONFIG_KEY_PREDICTOR_PREFIX) + String("/SimplePrediction"), - "", - "" - )); - page->append(sc); - - return page; -}; - -SimplePrediction::SimplePrediction(ConfigPointer cfg) : Predictor(cfg) -{ - size = cfg->read(HONOKA_CONFIG_SIMPLEPREDICTION_SIZE,HONOKA_DEFAULT_SIMPLEPREDICTION_SIZE); - if (size < 1) size = HONOKA_DEFAULT_SIMPLEPREDICTION_SIZE; -} - - -SimplePrediction::~SimplePrediction() -{ -} - - - -/*! - \fn SimplePrediction::getPredictionList(const WideString &str) - */ -ResultList SimplePrediction::getPredictionList(const WideString &str) -{ - multimap tmp; - for(multimap::iterator it = data.begin();it != data.end();it ++) { - if (it->first.length() >= str.length()) { - if (str == it->first.substr(0,str.length())) tmp.insert(*it); - } - } - if (!tmp.size()) return ResultList(); - ResultList l; - l.Title = utf8_mbstowcs(String(_("lookup result"))); - l.kType = PREDICTION; - for(multimap::iterator it = tmp.begin();it != tmp.end();it ++) { - l.kouho.push_back(ResultEntry(it->second)); - } - return l; -} - - -/*! - \fn SimplePrediction::disconnect() - */ -void SimplePrediction::disconnect() -{ - return; -} - - -/*! - \fn SimplePrediction::connect() - */ -bool SimplePrediction::connect() -{ - return true; -} - - -/*! - \fn SimplePrediction::isConnected() - */ -bool SimplePrediction::isConnected() -{ - return true; -} - - -/*! - \fn SimplePrediction::getPropertyName() - */ -String SimplePrediction::getPropertyName() -{ - return String(_("SimplePrediction")); -} - -/*! - \fn SimplePrediction::getName() - */ -String SimplePrediction::getName() -{ - return String("SimplePrediction"); -} - -/*! - \fn SimplePrediction::update(const WideString str,const WideString yomi) - */ -void SimplePrediction::update(const WideString str,const WideString yomi) -{ - if ((!yomi.length()) || (!str.length())) return; - for(multimap::iterator it = data.begin();it != data.end();it++) - if ((it->first == yomi) &&(it->second == str)) return; - data.insert(pair(yomi,str)); - if (data.size() > size) data.erase(data.begin()); - return; -} - diff --git a/honoka/plugins/simpleprediction.h b/honoka/plugins/simpleprediction.h deleted file mode 100644 index 01ee071..0000000 --- a/honoka/plugins/simpleprediction.h +++ /dev/null @@ -1,66 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef SIMPLEPREDICTION_H -#define SIMPLEPREDICTION_H - - -#define Uses_SCIM_CONFIG_BASE - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#define HONOKA_CONFIG_SIMPLEPREDICTION_SIZE "/IMEngine/Honoka/SimplePrediction/Size" -#define HONOKA_DEFAULT_SIMPLEPREDICTION_SIZE 200 - - -/** -@author TAM (Teppei Tamra) -*/ -namespace Honoka { -class SimplePrediction : public Predictor { -public: - SimplePrediction(ConfigPointer cfg); - - ~SimplePrediction(); - virtual ResultList getPredictionList(const WideString &str); - virtual void disconnect(); - virtual bool connect(); - virtual bool isConnected(); - virtual String getPropertyName(); - virtual String getName(); - virtual void update(const WideString str,const WideString yomi); - static HonokaSetupCorePage *setup(); - -protected: - multimap data; - int size; -}; -} -#endif diff --git a/honoka/plugins/skkdic.cpp b/honoka/plugins/skkdic.cpp deleted file mode 100644 index bc56a68..0000000 --- a/honoka/plugins/skkdic.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "skkdic.h" -#include - -using namespace Honoka; - - -SKKDic::SKKDic(String file) -{ - filename = file; - fd = -1; - iconv.set_encoding("EUC-JP"); - init(); -} - - -SKKDic::~SKKDic() -{ - if (fd != -1) { - munmap(mmapptr,mmapsize); - close(fd); - } -} - - - - -/*! - \fn SKKDic::init() - */ -void SKKDic::init() -{ - if (1) { - fd = open(filename.c_str(),O_RDONLY); - if (fd == -1) return; - mmapsize = lseek(fd,0,SEEK_END); - if (mmapsize == -1) { - close(fd); - fd = -1; - return; - } - void *ptr = mmap(0,mmapsize,PROT_READ,MAP_PRIVATE,fd,0); - if (ptr == MAP_FAILED) { - close(fd); - fd = -1; - return; - } - mmapptr = (char *)ptr; - return; - } - - bool okuri = true; - FILE *f = fopen(filename.c_str(),"r"); - if (!f) return; - while(-1) { - char s[1024]; - if(fgets(s,1024,f) == NULL) break; - if (String(s) == String(";; okuri-ari entries.")) { - okuri = true; - continue; - } else if (String(s) == String(";; okuri-nasi entries.")) { - okuri = false; - continue; - } - if (String(s).length() >= 2) - if (String(s).substr(0,2) == ";;") continue; - - WideString wstr,ent; - iconv.convert(wstr,String(s)); - if (!wstr.length()) continue; - for(unsigned int i = 0;i < wstr.length();i ++) { - if (wstr.substr(i,1) == utf8_mbstowcs(String(" "))) { - ent = wstr.substr(0,i); - break; - } - } - - SKKDicEntry dic; - vector sList = parser(wstr); - for(unsigned int i = 1;i < sList.size();i ++) { - SKKDicEntryData e = annotationParser(sList[i]); - dic.data.push_back(e); - } - dic.cache = true; - dic.okuri = okuri; - dic_data.insert(pair(ent,dic)); - } - fclose(f); -} - - -/*! - \fn SKKDic::parser(const WideString data) - */ -vector SKKDic::parser(const WideString data) -{ - uint pos = 0,count = 0; - vector sList; - // "/"でsplit。 - while(-1) { - if ((pos + count) >= data.length()) break; - if (data.at(pos + count) == utf8_mbstowcs(String("/"))[0]) { - if (count) sList.push_back(data.substr(pos,count)); - pos += (count + 1); - count = 0; - continue; - } - count ++; - } - return sList; -} - - -/*! - \fn SKKDic::find(WideString text) - */ -const vector SKKDic::find(WideString text) -{ - vector d; - map::iterator it = dic_data.find(text); - if (it != dic_data.end()) { - if (it->second.cache) return it->second.data; - } - - if (fd != -1) { - char *p = mmapptr; - bool okuri = true; - String t; - iconv.convert(t,text); - while(p < mmapptr + mmapsize) { - WideString w; - if (strncmp(p,";; okuri-ari entries.",21) == 0) okuri = true; - else if (strncmp(p,";; okuri-nasi entries.",22) == 0) okuri = false; - else - if ((strncmp(p,t.c_str(),t.length()) == 0) && - (p[t.length()] == ' ') && - (strncmp(p,";;",2) != 0)) { - String s; - for(unsigned int i = 0;p[i] != '\n';i ++) { - if (p[i] == 0) break; - s += p[i]; - } - iconv.convert(w,s); - vector l = parser(w.substr(text.length() + 1)); - SKKDicEntry dic; - for(unsigned int i = 0;i < l.size();i ++) { - SKKDicEntryData e = annotationParser(l[i]); - dic.data.push_back(e); - } - // キャッシュする? - // dic.cache = true; - // dic.okuri = okuri; - // dic_data.insert(pair(text,dic)); - return dic.data; - } - while(p[0] != '\n') { - p ++; - if (p[0] == 0) break; - } - p ++; - } - } - return d; -} - - -/*! - \fn SKKDic::annotationParser(WideString) - */ -SKKDicEntryData SKKDic::annotationParser(WideString l) -{ - SKKDicEntryData e; - if (l.length() <= 2) { - e.kouho = l; - return e; - } - for(unsigned int j = 1;j < (l.length() - 1);j ++) { - if (l.at(j) == utf8_mbstowcs(String(";"))[0]) { - e.annotation = l.substr(j + 1); - e.kouho = l.substr(0,j); - break; - } - } - if (!e.kouho.length()) e.kouho = l; - return e; - -} - diff --git a/honoka/plugins/skkdic.h b/honoka/plugins/skkdic.h deleted file mode 100644 index 56d561d..0000000 --- a/honoka/plugins/skkdic.h +++ /dev/null @@ -1,81 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef SKKDIC_H -#define SKKDIC_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define Uses_SCIM_UTILITY -#define Uses_SCIM_ICONV - -using namespace std; -using namespace scim; - - -/** -@author TAM (Teppei Tamra) -*/ -namespace Honoka { -class SKKDicEntryData { -public: - WideString annotation; - WideString kouho; -}; - -class SKKDicEntry { -public: - vector data; - bool cache; - bool okuri; -}; - -class SKKDic{ -public: - SKKDic(String file); - - ~SKKDic(); - const vector find(WideString text); - SKKDicEntryData annotationParser(WideString l); - -protected: - String filename; - IConvert iconv; - map dic_data; - int fd; - char *mmapptr; - off_t mmapsize; -protected: - void init(); - vector parser(const WideString data); -}; -} - -#endif diff --git a/honoka/plugins/skkdicconversion.cpp b/honoka/plugins/skkdicconversion.cpp deleted file mode 100644 index 9999206..0000000 --- a/honoka/plugins/skkdicconversion.cpp +++ /dev/null @@ -1,194 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "skkdicconversion.h" - - -#ifdef HAVE_CONFIG_H - #include -#endif - -#ifdef HAVE_GETTEXT - #include - #define _(String) dgettext(GETTEXT_PACKAGE,String) - #define N_(String) (String) -#else - #define _(String) (String) - #define N_(String) (String) - #define bindtextdomain(Package,Directory) - #define textdomain(domain) - #define bind_textdomain_codeset(domain,codeset) -#endif - -// プライグイン化のおまじないです。 -HonokaPluginRegister(SKKDicConversion); -HonokaPluginSetup(SKKDicConversion); - -HonokaSetupCorePage *SKKDicConversion::setup() -{ - HonokaSetupPage *page = new HonokaSetupPage(_("SKKDic-plugin"),"",""); - page->append(new HonokaSetupFileItem( - _("_SKKDic file: "), - HONOKA_CONFIG_SKKDIC_DICFILE, - _("set SKKDic file in this entry."), - HONOKA_DEFAULT_SKKDIC_DICFILE - )); - HonokaSetupPage *sc = new HonokaSetupPage(_("shortcut keys: "),"",""); - sc->append(new HonokaSetupKeyItem( - _("SKKDic: "), - String(HONOKA_CONFIG_KEY_CONVERTOR_PREFIX) + String("/SKKDic"), - "", - "" - )); - page->append(sc); - - return page; -}; - -SKKDicConversion::SKKDicConversion(ConfigPointer cfg) : Convertor(cfg) -{ - String file = cfg->read(String(HONOKA_CONFIG_SKKDIC_DICFILE), - String(HONOKA_DEFAULT_SKKDIC_DICFILE)); - dic = new SKKDic(file); - pos = 0; -} - - -SKKDicConversion::~SKKDicConversion() -{ - delete(dic); -} - -bool SKKDicConversion::isConnected() { - return true; -} - -void SKKDicConversion::reset(){ - buns.clear(); - texts.clear(); - pos = 0; - return; -} - -void SKKDicConversion::setYomiText(WideString yomi) { - buns.clear(); - texts.clear(); - pos = 0; - buns.push_back(yomi); - return; -} - -int SKKDicConversion::ren_conversion() { - texts.push_back(buns[0]); - pos = 0; - return 1; -} - -const vector SKKDicConversion::getSegmentList() { - vector result; - for(unsigned int i = 0;i < texts.size();i ++) result.push_back(Segment(texts[i],buns[i])); - return result; -} - -int SKKDicConversion::setPos(int p){ - if ((p >= 0) && (p < buns.size())) pos = p; - return pos; -} - -int SKKDicConversion::getPos() { - return pos; -} - -ResultList SKKDicConversion::getResultList(int p,ResultType kt){ - list.Yomi.clear(); - list.kouho.clear(); - list.Title = utf8_mbstowcs(String(_("lookup result"))); - //list.count = 0; - ResultEntry e; - if (kt != DEFAULT) return list; - if (p == -1) p = pos; - else if (setPos(p) != p) return list; - e.kanji = buns[pos]; - list.Yomi = buns[pos]; - list.kouho.push_back(e); - //list.count = 1; - vector es = dic->find(buns[p]); - for(unsigned int i = 0;i < es.size();i ++) { - e.label.clear(); - e.kanji = es[i].kouho; - if (es[i].annotation.length()) { - e.label = es[i].kouho + utf8_mbstowcs(" (") + es[i].annotation + utf8_mbstowcs(")"); - } - list.kouho.push_back(e); - } - //list.count = list.kouho.size(); - return list; -} - - -bool SKKDicConversion::select(int p) { - if ((p < list.kouho.size()) && (p >= 0)) { - texts[pos] = list.kouho[p].kanji; - return true; - } - return false; -} - -bool SKKDicConversion::resizeRegion(int w) { - if ((buns[pos].length() + w) < 1) return false; - if ((pos >= (buns.size() - 1)) && (w > 0)) return false; - - int s = buns[pos].length(); - WideString t; - vector ws; - for(unsigned int i = pos;i < buns.size();i ++) t = t + buns[i]; - for(unsigned int i = 0;i < pos;i ++) { - ws.push_back(buns[i]); - } - ws.push_back(t.substr(0,s + w)); - if ((s + w) < t.length()) ws.push_back(t.substr(s + w)); - buns.clear(); - texts.clear(); - buns = ws; - texts = ws; - return true; -} - -void SKKDicConversion::updateFrequency() { - return; -} - -bool SKKDicConversion::connect() { - return true; -} -void SKKDicConversion::disconnect() { - return; -} - - -String SKKDicConversion::getName() -{ - return String("SKKDic"); -} - -String SKKDicConversion::getPropertyName() -{ - return String(_("SKKDic")); -} diff --git a/honoka/plugins/skkdicconversion.h b/honoka/plugins/skkdicconversion.h deleted file mode 100644 index 1614bf8..0000000 --- a/honoka/plugins/skkdicconversion.h +++ /dev/null @@ -1,78 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef SKKDICCONVERSION_H -#define SKKDICCONVERSION_H - -#define Uses_SCIM_CONFIG_BASE - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define HONOKA_CONFIG_SKKDIC_DICFILE "/IMEngine/Honoka/SKKDic/File" -#define HONOKA_DEFAULT_SKKDIC_DICFILE "" - - -using namespace std; -using namespace scim; - -/** -@author TAM (Teppei Tamra) -*/ -namespace Honoka { -class SKKDicConversion : public Convertor { -public: - SKKDicConversion(ConfigPointer cfg); - - ~SKKDicConversion(); - virtual bool isConnected(); - virtual void reset(); - virtual void setYomiText(WideString yomi); - virtual int ren_conversion(); - virtual int setPos(int p); - virtual int getPos(); - virtual ResultList getResultList(int p = -1 ,ResultType kt = DEFAULT); - virtual bool select(int p); - virtual bool resizeRegion(int w); - virtual void updateFrequency(); - virtual bool connect(); - virtual void disconnect(); - virtual String getName(); - virtual String getPropertyName(); - virtual const vector getSegmentList(); - static HonokaSetupCorePage *setup(); - -protected: - SKKDic *dic; - vector buns; - vector texts; - ResultList list; - int pos; - -}; -} -#endif diff --git a/honoka/plugins/wnnconversion.cpp b/honoka/plugins/wnnconversion.cpp deleted file mode 100644 index ef68496..0000000 --- a/honoka/plugins/wnnconversion.cpp +++ /dev/null @@ -1,526 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include "wnnconversion.h" - -#ifdef HAVE_CONFIG_H - #include -#endif - -#ifdef HAVE_GETTEXT - #include - #define _(String) dgettext(GETTEXT_PACKAGE,String) - #define N_(String) (String) -#else - #define _(String) (String) - #define N_(String) (String) - #define bindtextdomain(Package,Directory) - #define textdomain(domain) - #define bind_textdomain_codeset(domain,codeset) -#endif - -// プライグイン化のおまじないです。 -//HonokaPluginRegister(WnnConversion); - -WnnConversion::WnnConversion(ConfigPointer cfg) : Convertor(cfg) -{ - // とりあえず決めうちでいきます。 - m_iconv.set_encoding ("EUC-JP"); - pos = 0; - bunsetu = 0; - wnn = 0; - sType = Wnn4; -} - - -WnnConversion::~WnnConversion() -{ - wnnDisconnect(); -} - - - /* w_charからEUCに変換するアレ */ -void WnnConversion::wstostr(unsigned char *e,w_char *u) { - w_char x; - for(;*u;) { - x = *u ++; - if (x & 0x8000) { - *e ++ = x >> 8; - *e ++ = x; - } else - if (x & 0x80) { - *e ++ = 0x8e; - *e ++ = x & 0xff; - } else - *e++ = x; - } - *e ++ = 0; -} - - /* EUCからw_charに変換するナニ */ -void WnnConversion::strtows(w_char *u,unsigned char *e) { - w_char x; - for(;*e;) { - x = *e ++; - // これいらない↓ - //if (x == 0x8e) x = 0x80 | *e ++; - if (x & 0x80) - x = ((x << 8) & 0xff00) | *e ++; - *u ++ = x; - } - *u = 0; -} - -/*! - \fn WnnConversion::connect() - */ -bool WnnConversion::connect() -{ - String host = config->read(String(HONOKA_CONFIG_JSERVER),String(HONOKA_DEFAULT_JSERVER)); - String rc = config->read(String(HONOKA_CONFIG_WNNENVRC),String(HONOKA_DEFAULT_WNNENVRC)); - String t = config->read(String(HONOKA_CONFIG_JSERVERTYPE),String(HONOKA_DEFAULT_JSERVERTYPE)); - - if (t == "Wnn6") { - sType = Wnn6; - } else if (t == "Wnn7") { - sType = Wnn7; - } else if (t == "Wnn8") { - sType = Wnn8; - } else { - sType = Wnn4; - } - - return wnnConnect(String("scim-wnn"),host,rc,sType,0); -} - -/*! - \fn WnnConversion::disconnect() - */ -void WnnConversion::disconnect() -{ - wnnDisconnect(); -} - - -/*! - \fn WnnConversion::wnnConnect(String name,String host,String rc,JServerType type,int timeout) - */ -bool WnnConversion::wnnConnect(String name,String host,String rc,JServerType type,int timeout) -{ - wnn = jl_open((char *)name.c_str(),(char *)host.c_str(),(char *)rc.c_str(),wnn_error,wnn_message,timeout); - //wnn = jl_open_lang("test","localhost","jp_JP","/usr/lib/wnn7/ja_JP/wnnenvrc",wnn_error,wnn_message,10); - if (wnn == NULL) return false; - #ifdef HAVE_LIBWNN7 - // 予測入力を初期化しておく。 - jl_yosoku_init(wnn); - #endif - sType = type; - return true; -} - -/*! - \fn WnnConversion::wnnDisconnect() - */ -void WnnConversion::wnnDisconnect() -{ - if (wnn != NULL) { - jl_dic_save_all(wnn); - #ifdef HAVE_LIBWNN7 - jl_yosoku_free(wnn); - #endif - jl_close(wnn); - wnn = NULL; - } -} - - - - -/*! - \fn WnnConversion::isConnected() - */ -bool WnnConversion::isConnected() -{ - if (wnn) return true; - else return false; -} - - - - -/*! - \fn WnnConversion::wnn_message (char *s) - */ -int WnnConversion::wnn_message (char *s) -{ - - SCIM_DEBUG_IMENGINE(1) << s << "\n"; -} - -/*! - \fn WnnConversion::wnn_error (char *s) - */ -int WnnConversion::wnn_error (char *s) -{ - - SCIM_DEBUG_IMENGINE(1) << s << "\n"; -} - - - - -/*! - \fn WnnConversion::reset() - */ -void WnnConversion::reset() -{ - yomiText.clear(); - bunList.clear(); - yomiList.clear(); - text.clear(); - attr.clear(); - pos = 0; - jl_kill(wnn,0,-1); -} - - -/*! - \fn WnnConversion::setYomiText(WideString yomi) - */ -void WnnConversion::setYomiText(WideString yomi) -{ - yomiText = yomi; -} - - - -/*! - \fn WnnConversion::ren_conversion() - */ -int WnnConversion::ren_conversion() -{ - if ((yomiText.length() > 500) || (!yomiText.length())) return -1; - convList.Yomi.clear(); - convList.kouho.clear(); - bunList.clear(); - yomiList.clear(); - pos = 0; - w_char ws[1024]; - char c[2048]; - String y; - m_iconv.convert(y,yomiText); - strtows(ws,(unsigned char*)y.c_str()); - bunsetu = jl_fi_ren_conv(wnn,ws,0,-1,WNN_USE_ZENGO); - if (bunsetu == -1) return -1; - for(unsigned int i = 0;i < bunsetu;i ++) { - WideString w; - jl_get_kanji(wnn,i,i + 1,ws); - wstostr((unsigned char*)c,ws); - m_iconv.convert(w,c,strlen(c)); - bunList.push_back(w); - jl_get_yomi(wnn,i,i + 1,ws); - wstostr((unsigned char*)c,ws); - m_iconv.convert(w,c,strlen(c)); - yomiList.push_back(w); - } - createText(); - return bunsetu; -} - - -/*! - \fn WnnConversion::resizeRegion(int w) - */ -bool WnnConversion::resizeRegion(int w) -{ - if (w == 0) return false; - if ((yomiList[pos].length() + w) <= 0) return false; - if (((pos + 1) >= yomiList.size()) && (w > 0)) return false; - - w_char ws[1024]; - char c[2048]; - int s; - int h = WNN_NO_USE; - if (pos > 0) h = WNN_USE_MAE; - else if (pos < bunsetu - 1) h = WNN_USE_ATO; - bunsetu = jl_fi_nobi_conv(wnn,pos,yomiList[pos].length() + w,-1,h,WNN_SHO); - convList.kouho.clear(); - bunList.clear(); - yomiList.clear(); - for(unsigned int i = 0;i < bunsetu;i ++) { - WideString w; - jl_get_kanji(wnn,i,i + 1,ws); - wstostr((unsigned char*)c,ws); - m_iconv.convert(w,c,strlen(c)); - bunList.push_back(w); - jl_get_yomi(wnn,i,i + 1,ws); - wstostr((unsigned char*)c,ws); - m_iconv.convert(w,c,strlen(c)); - yomiList.push_back(w); - } - createText(); - return true; -} - - -/*! - \fn WnnConversion::createText() - */ -void WnnConversion::createText() -{ - WideString w; - caretPos = 0; - for(unsigned int i = 0;i < bunsetu;i ++) { - if (pos == i) { - caretPos = w.length(); - attr.clear(); - Attribute a(w.length(),bunList[i].length(),SCIM_ATTR_DECORATE,SCIM_ATTR_DECORATE_REVERSE); - attr.push_back(a); - } - w = w + bunList[i]; - } - text = w; -} - - -/*! - \fn WnnConversion::getSegmentList() - */ -const vector WnnConversion::getSegmentList() -{ - // getTextにかわるもの。 - vector result; - for(unsigned int i = 0;i < bunsetu;i ++) result.push_back(Segment(bunList[i],yomiList[i])); - return result; -} - - -/*! - \fn WnnConversion::setPos(int p) - */ -int WnnConversion::setPos(int p) -{ - /*if (p >= bunsetu) p = (p % bunsetu); - else if (p < 0) p = bunsetu - (abs(p) % bunsetu);*/ - if ((p < bunsetu) && (p >= 0)) pos = p; - - //pos = p; - createText(); - return pos; -} - - -/*! - \fn WnnConversion::getPos() - */ -int WnnConversion::getPos() -{ - return pos; -} - - -/*! - \fn WnnConversion::getYosokuList(const WideString &str) - */ -ResultList WnnConversion::getYosokuList(const WideString &str) -{ - convList.Yomi = str; - convList.kouho.clear(); - //convList.count = 0; - convList.pos = 0; - convList.kType = PREDICTION; - convList.Title = utf8_mbstowcs(String(_("yosoku lookup result"))); - #ifdef HAVE_LIBWNN7 - String s; - m_iconv.convert(s,convList.Yomi); - // @todo ここもmbstowcsしたほうが良いんか? - char c[1024]; - strcpy(c,s.c_str()); - if (jl_yosoku_yosoku(wnn,c) != 0) return convList; - //convList.count = ykYosokuKouhoNum; - for(unsigned int i = 0;i < ykYosokuKouhoNum;i ++) { - WideString w; - m_iconv.convert(w,ykYosokuKouho[i],strlen(ykYosokuKouho[i])); - convList.kouho.push_back(ResultEntry(w)); - } - //jl_yosoku_free(wnn); - #endif - return convList; -} - - -/*! - \fn WnnConversion::getResultList(int p,ResultType kt) - */ -ResultList WnnConversion::getResultList(int p,ResultType kt) -{ - w_char k[1024]; - char buf[2048]; - WideString u; - convList.kouho.clear(); - convList.Yomi.clear(); - convList.pos = 0; - //convList.count = 0; - if ((sType != Wnn8) && (sType != Wnn7) && (kt != DEFAULT)) return convList; - - if (p == -1) p = pos; - //if ((p >= bunsetu) || (p < 0)) p = p % bunsetu; - if (p >= bunsetu) return convList; - pos = p; - jl_get_yomi(wnn,pos,pos + 1,k); - wstostr((unsigned char*)buf,k); - m_iconv.convert(u,buf,strlen(buf)); - convList.Yomi = u; - - // bunsetu connection control - int conn = WNN_USE_ZENGO; - if (bunsetu == 1) conn = WNN_NO_USE; - else if (pos == 0) conn = WNN_USE_ATO; - else if (pos == (bunsetu - 1)) conn = WNN_USE_MAE; - switch (kt) { - #ifdef HAVE_LIBWNN7 - case SPECIAL2: { - convList.pos = jl_zenikeiji_dai(wnn,pos,pos + 1,conn,WNN_UNIQ); - convList.kType = SPECIAL2; - convList.Title = utf8_mbstowcs(String(_("Ikeiji lookup result"))); - break; - } - case SPECIAL1: { - convList.pos = jl_zenassoc_dai(wnn,pos,pos + 1,conn,WNN_UNIQ); - convList.kType = SPECIAL1; - convList.Title = utf8_mbstowcs(String(_("association lookup result"))); - break; - } - #endif - default: { - convList.pos = jl_zenkouho_dai(wnn,pos,pos + 1,conn,WNN_UNIQ); - convList.kType = DEFAULT; - convList.Title = utf8_mbstowcs(String(_("lookup result"))); - break; - } - } - - // @todo be implement to ikeiji conversion using "jl_zenikeiji_dai()". - // @todo be implement to rensou conversion using "jl_zenassoc_dai()". - // @todo jl_zenkouho should change to jl_zenkouho_dai. - //convList.pos = jl_zenassoc_dai(wnn,pos,pos + 1,WNN_USE_ZENGO,WNN_UNIQ); - //convList.pos = jl_zenkouho(wnn,pos,conn,WNN_UNIQ); - if (convList.pos == -1) return convList; - int count = jl_zenkouho_suu(wnn); - - for (unsigned int i = 0;i < count; i ++) { - jl_get_zenkouho_kanji(wnn,i,k); - wstostr((unsigned char*)buf,k); - m_iconv.convert(u,buf,strlen(buf)); - convList.kouho.push_back(u); - } - select(convList.pos); - createText(); - return convList; - -} - - -/*! - \fn WnnConversion::select(int p) - */ -bool WnnConversion::select(int p) -{ - if (p > convList.count()) p = 0; - convList.pos = p; - switch(convList.kType) { - case DEFAULT: { - jl_set_jikouho_dai(wnn,p); - break; - } - case PREDICTION: { - #ifdef HAVE_LIBWNN7 - jl_yosoku_selected_cand(wnn,p); - #endif - return true; - } - default: { - break; - } - } - - bunList.at(pos) = convList.kouho.at(p).kanji; - createText(); - - return true; - -} - - - - - - -/*! - \fn WnnConversion::updateFrequency() - */ -void WnnConversion::updateFrequency() -{ - if (bunsetu) { - #ifdef HAVE_LIBWNN7 - w_char ws[1024]; - int c = jl_get_kanji(wnn,0,bunsetu,ws); - jl_yosoku_toroku(wnn,ws,c); - #endif - jl_optimize_fi(wnn,0,-1); - pretext = text; - } -} - - - - -String WnnConversion::getName() -{ - return String("Wnn"); -} - -String WnnConversion::getPropertyName() -{ - return String(_("WnnConversion")); -} - - - -/*! - \fn WnnConversion::updateYosoku(WideString text,const WideString yomi) - */ -void WnnConversion::updateYosoku(WideString text,const WideString yomi) -{ - #ifdef HAVE_LIBWNN7 - if (text == pretext) return; - reset(); - setYomiText(yomi); - ren_conversion(); - w_char ws[1024]; - char c[2048]; - String y; - m_iconv.convert(y,text); - strtows(ws,(unsigned char*)y.c_str()); - jl_yosoku_toroku(wnn,ws,text.length()); - reset(); - #endif - return; - -} diff --git a/honoka/plugins/wnnconversion.h b/honoka/plugins/wnnconversion.h deleted file mode 100644 index f1488f1..0000000 --- a/honoka/plugins/wnnconversion.h +++ /dev/null @@ -1,126 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef WNNCONVERSION_H -#define WNNCONVERSION_H - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#define Uses_SCIM_ICONV -#include -#include -#include -#include - - - -#define HONOKA_CONFIG_JSERVERTYPE "/IMEngine/Honoka/Wnn/JServerType" -#ifdef HAVE_LIBWNN7 - #define HONOKA_DEFAULT_JSERVERTYPE "Wnn7" -#else - #define HONOKA_DEFAULT_JSERVERTYPE "Wnn4" -#endif - -#define HONOKA_CONFIG_JSERVER "/IMEngine/Honoka/Wnn/JServer" -#define HONOKA_DEFAULT_JSERVER "localhost" -#define HONOKA_CONFIG_WNNENVRC "/IMEngine/Honoka/Wnn/Wnnenvrc" -#define HONOKA_DEFAULT_WNNENVRC "/usr/lib/wnn7/ja_JP/wnnenvrc" - -#define HONOKA_CONFIG_WNNYOSOKU "/IMEngine/Honoka/Wnn/Yosoku" -#ifdef HAVE_LIBWNN7 - #define HONOKA_DEFAULT_WNNYOSOKU true -#else - #define HONOKA_DEFAULT_WNNYOSOKU false -#endif - - - -using namespace scim; -using namespace std; - - -/** -@author TAM(Teppei Tamra) -*/ - -namespace Honoka { - - -class WnnConversion : public Convertor { -public: - enum JServerType { Wnn4, Wnn6, Wnn7, Wnn8 }; - WnnConversion(ConfigPointer cfg); - - ~WnnConversion(); - virtual bool isConnected(); - virtual void reset(); - virtual void setYomiText(WideString yomi); - virtual int ren_conversion(); - virtual int setPos(int p); - virtual int getPos(); - virtual ResultList getResultList(int p = -1 ,ResultType kt = DEFAULT); - ResultList getYosokuList(const WideString &str); - virtual bool select(int p); - virtual bool resizeRegion(int w); - virtual void updateFrequency(); - virtual bool connect(); - virtual void disconnect(); - virtual String getName(); - virtual String getPropertyName(); - virtual const vector getSegmentList(); - void updateYosoku(WideString text,const WideString yomi); - - -protected: - bool wnnConnect(String name,String host,String rc,JServerType type,int timeout); - void wnnDisconnect(); - void wstostr(unsigned char *e,w_char *u); - void strtows(w_char *u,unsigned char *e); - static int wnn_message (char *s); - static int wnn_error (char *s); - void createText(); - -protected: - struct wnn_buf *wnn; - String wnn_server; - String wnn_rc; - JServerType sType; - int wnn_timeout; - IConvert m_iconv; - WideString yomiText; - int pos; - int bunsetu; - int caretPos; - WideString text; - vector bunList; - vector yomiList; - AttributeList attr; - ResultList convList; - WideString pretext; - -}; - -} -#endif diff --git a/honoka/plugins/wnnplugin.cpp b/honoka/plugins/wnnplugin.cpp deleted file mode 100644 index 6c9d060..0000000 --- a/honoka/plugins/wnnplugin.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "wnnplugin.h" - -#ifdef HAVE_CONFIG_H - #include -#endif - - -#ifdef HAVE_GETTEXT - #include - #define _(String) dgettext(GETTEXT_PACKAGE,String) - #define N_(String) (String) -#else - #define _(String) (String) - #define N_(String) (String) - #define bindtextdomain(Package,Directory) - #define textdomain(domain) - #define bind_textdomain_codeset(domain,codeset) -#endif - - -HonokaPluginRegister(WnnPlugin); -HonokaPluginSetup(WnnPlugin); - -HonokaSetupCorePage *WnnPlugin::setup() -{ - HonokaSetupPage *page = new HonokaSetupPage(_("Wnn-plugin"),"",""); - vector l; - page->append(new HonokaSetupEntryItem( - _("_Server: "), - HONOKA_CONFIG_JSERVER, - _("input the server name to connect."), - HONOKA_DEFAULT_JSERVER - )); - page->append(new HonokaSetupFileItem( - _("_wnnenvrc: "), - HONOKA_CONFIG_WNNENVRC, - _("input the path of wnnenvrc."), - HONOKA_DEFAULT_WNNENVRC - )); - l.clear(); - l.push_back(String("Wnn4")); - l.push_back(String("Wnn6")); - l.push_back(String("Wnn7")); - l.push_back(String("Wnn8")); - page->append(new HonokaSetupSelectItem( - _("Server_type: "), - HONOKA_CONFIG_JSERVERTYPE, - _("select the server type from Wnn4 / Wnn6 / Wnn7."), - HONOKA_DEFAULT_JSERVERTYPE, - l - )); - page->append(new HonokaSetupBoolItem( - _("use Wnn7-_YOSOKU: "), - HONOKA_CONFIG_WNNYOSOKU, - _("if you use the prediction of Wnn7, check this."), - HONOKA_DEFAULT_WNNYOSOKU - )); - HonokaSetupPage *sc = new HonokaSetupPage(_("shortcut keys: "),"",""); - sc->append(new HonokaSetupKeyItem( - _("Wnn Conversion: "), - String(HONOKA_CONFIG_KEY_CONVERTOR_PREFIX) + String("/Wnn"), - "", - "" - )); - sc->append(new HonokaSetupKeyItem( - _("Wnn Prediction: "), - String(HONOKA_CONFIG_KEY_PREDICTOR_PREFIX) + String("/WnnPrediction"), - "", - "" - )); - page->append(sc); - - return page; -}; - -WnnPlugin::WnnPlugin(ConfigPointer cfg) : HonokaMultiplePluginBase(cfg) -{ - predictor = 0; - convertor = new WnnConversion(cfg); - - bool yosoku = cfg->read(String(HONOKA_CONFIG_WNNYOSOKU),HONOKA_DEFAULT_WNNYOSOKU); - String sType = cfg->read(String(HONOKA_CONFIG_JSERVERTYPE),String(HONOKA_DEFAULT_JSERVERTYPE)); - if (yosoku && (sType == String("Wnn7"))) { - predictor = new WnnPrediction(cfg,convertor); - } -} - - -WnnPlugin::~WnnPlugin() -{ - if (predictor) delete predictor; - delete convertor; -} - -/*! - \fn WnnPlugin::getPluginInstanceAt(int p) - */ -HonokaPluginBase * WnnPlugin::getPluginInstanceAt(int p) -{ - if (p == 0) return convertor; - if ((p == 1) && predictor) return predictor; - return 0; -} - - -/*! - \fn WnnPlugin::getPluginCount() - */ -int WnnPlugin::getPluginCount() -{ - if (predictor) return 2; - return 1; -} - -/*! - \fn WnnPlugin::getName() - */ -String WnnPlugin::getName() -{ - return String("WnnPlugin"); -} - diff --git a/honoka/plugins/wnnplugin.h b/honoka/plugins/wnnplugin.h deleted file mode 100644 index 25d2a3e..0000000 --- a/honoka/plugins/wnnplugin.h +++ /dev/null @@ -1,62 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef WNNPLUGIN_H -#define WNNPLUGIN_H - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - - -using namespace std; -using namespace scim; - - -/** -@author TAM (Teppei Tamra) -*/ -namespace Honoka { - -class WnnPlugin; - -class WnnPlugin : public HonokaMultiplePluginBase { -public: - WnnPlugin(ConfigPointer cfg); - - ~WnnPlugin(); - virtual HonokaPluginBase * getPluginInstanceAt(int p); - virtual int getPluginCount(); - virtual String getName(); - static HonokaSetupCorePage *setup(); - -protected: - WnnConversion * convertor; - WnnPrediction * predictor; -}; -} -#endif diff --git a/honoka/plugins/wnnprediction.cpp b/honoka/plugins/wnnprediction.cpp deleted file mode 100644 index 4f81437..0000000 --- a/honoka/plugins/wnnprediction.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "wnnprediction.h" - -#ifdef HAVE_GETTEXT - #include - #define _(String) dgettext(GETTEXT_PACKAGE,String) - #define N_(String) (String) -#else - #define _(String) (String) - #define N_(String) (String) - #define bindtextdomain(Package,Directory) - #define textdomain(domain) - #define bind_textdomain_codeset(domain,codeset) -#endif - - -WnnPrediction::WnnPrediction(ConfigPointer cfg,WnnConversion *wnn) : Predictor(cfg) -{ - convertor = wnn; -} - - -WnnPrediction::~WnnPrediction() -{ -} - - - -/*! - \fn WnnPrediction::getPredictionList(const WideString &str) - */ -ResultList WnnPrediction::getPredictionList(const WideString &str) -{ - return convertor->getYosokuList(str); -} - - -/*! - \fn WnnPrediction::disconnect() - */ -void WnnPrediction::disconnect() -{ - // disconnectはWnnConversion側に一任。 - return; -} - - -/*! - \fn WnnPrediction::connect() - */ -bool WnnPrediction::connect() -{ - return convertor->connect(); -} - - -/*! - \fn WnnPrediction::isConnected() - */ -bool WnnPrediction::isConnected() -{ - return convertor->isConnected(); -} - - -/*! - \fn WnnPrediction::getPropertyName() - */ -String WnnPrediction::getPropertyName() -{ - return String(_("WnnPrediction")); -} - -/*! - \fn WnnPrediction::getName() - */ -String WnnPrediction::getName() -{ - return String("WnnPrediction"); -} - -/*! - \fn WnnPrediction::update(const WideString str,const WideString yomi) - */ -void WnnPrediction::update(const WideString str,const WideString yomi) -{ - convertor->updateYosoku(str,yomi); - return; -} - diff --git a/honoka/plugins/wnnprediction.h b/honoka/plugins/wnnprediction.h deleted file mode 100644 index 0762cd8..0000000 --- a/honoka/plugins/wnnprediction.h +++ /dev/null @@ -1,59 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef WNNPREDICTION_H -#define WNNPREDICTION_H - -#define Uses_SCIM_CONFIG_BASE - -#include -#include - -#include -#include -#include -#include -#include -#include - - -/** -@author TAM (Teppei Tamra) -*/ -namespace Honoka { -class WnnPrediction : public Predictor { -public: - WnnPrediction(ConfigPointer cfg,WnnConversion *wnn); - - ~WnnPrediction(); - virtual ResultList getPredictionList(const WideString &str); - virtual void disconnect(); - virtual bool connect(); - virtual bool isConnected(); - virtual String getPropertyName(); - virtual String getName(); - virtual void update(const WideString str,const WideString yomi); - -protected: - WnnConversion *convertor; - -}; -} -#endif diff --git a/honoka/plugins/wnnproto.h b/honoka/plugins/wnnproto.h deleted file mode 100644 index ea4c566..0000000 --- a/honoka/plugins/wnnproto.h +++ /dev/null @@ -1,107 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -/* う ぜ ぇ */ -#ifndef WNNPROTO_H -#define WNNPROTO_H - -#ifdef HAVE_CONFIG_H -#include -#endif - -extern "C" { - - /* 基礎的なん */ - #define w_char unsigned short - struct wnn_buf *jl_open_lang(char *,char *,char *,char *,int (*)(char *),int(*)(char *),int); - #define jl_open(a,b,c,d,e,f) jl_open_lang(a,b,NULL,c,d,e,f) - void jl_close(struct wnn_buf*); - - - - - /* conversion */ - int jl_fi_ren_conv(struct wnn_buf*,w_char*,int,int,int); - int jl_optimize_fi(struct wnn_buf*,int,int); - int jl_fi_nobi_conv(struct wnn_buf*,int,int,int,int,int); - int jl_zenkouho_suu(struct wnn_buf*); - int jl_kill(struct wnn_buf*,int,int); - int jl_zenkouho(struct wnn_buf*,int,int,int); - int jl_zenkouho_dai(struct wnn_buf*,int,int,int,int); - - int jl_set_jikouho(struct wnn_buf*,int); - int jl_set_jikouho_dai(struct wnn_buf*,int); - int jl_dic_save_all(struct wnn_buf*); - - #ifdef HAVE_LIBWNN7 - /* wnn6sdk is not having it.*/ - int jl_zenikeiji_dai(struct wnn_buf*,int,int,int,int); - int jl_zenassoc_dai(struct wnn_buf*,int,int,int,int); - int wnn_get_area(struct wnn_buf*,int,int,w_char*,int,int); - void jl_get_zenkouho_kanji(struct wnn_buf*,int ,w_char *,int); - #define jl_get_zenkouho_kanji(a,b,c) jl_get_zenkouho_kanji(a,b,c,512) - #define jl_get_kanji(buf,bun1,bun2,area) wnn_get_area(buf,bun1,bun2,area,1,512) - #define jl_get_yomi(buf,bun1,bun2,area) wnn_get_area(buf,bun1,bun2,area,0,512) - - // input completion for Wnn7 - extern int ykYosokuKouhoNum; - extern char **ykYosokuKouho; - extern int jl_yosoku_init(struct wnn_buf*); - extern int jl_yosoku_set_param(struct wnn_buf*,int,int,int); - extern int jl_yosoku_free(struct wnn_buf*); - extern int jl_yosoku_yosoku(struct wnn_buf*,char *); - extern int jl_yosoku_toroku(struct wnn_buf*,w_char*,short); - extern int jl_yosoku_selected_cand(struct wnn_buf*,int); - extern int jl_yosoku_delete_cand(struct wnn_buf*,int); - extern int jl_yosoku_save_datalist(struct wnn_buf*); - extern int jl_yosoku_cancel_toroku(struct wnn_buf *); - extern int jl_yosoku_ikkatsu_toroku(struct wnn_buf *,char *,int); - extern int jl_yosoku_ikkatsu_toroku_init(struct wnn_buf *); - extern int jl_yosoku_ikkatsu_toroku_end(struct wnn_buf *); - extern int jl_yosoku_toroku(struct wnn_buf *,w_char *,short); - - #else - int wnn_get_area(struct wnn_buf*,int,int,w_char*,int); - void jl_get_zenkouho_kanji(struct wnn_buf*,int ,w_char *); - #define jl_get_kanji(buf,bun1,bun2,area) wnn_get_area(buf,bun1,bun2,area,1) - #define jl_get_yomi(buf,bun1,bun2,area) wnn_get_area(buf,bun1,bun2,area,0) - #endif - - - #define WNN_NO_USE 0 - #define WNN_USE_MAE 1 - #define WNN_USE_ATO 2 - #define WNN_USE_ZENGO (WNN_USE_MAE | WNN_USE_ATO) - - #define WNN_UNIQ_KNJ 2 - #define WNN_UNIQ 1 - #define WNN_NO_UNIQ 0 - - #define WNN_NO_CREATE 0 - #define WNN_CREATE (-1) - - #define WNN_SHO 0 - #define WNN_DAI 1 - - -} - -#endif - diff --git a/honoka/plugins/wordsdic.cpp b/honoka/plugins/wordsdic.cpp deleted file mode 100644 index ed2f4d8..0000000 --- a/honoka/plugins/wordsdic.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "wordsdic.h" -using namespace Honoka; - -WordsDic::WordsDic(const string &filename) -{ - fd = open(filename.c_str(),O_RDONLY); - if (fd == -1) return; - mmapsize = lseek(fd,0,SEEK_END); - if (mmapsize == -1) { - close(fd); - fd = -1; - return; - } - void *ptr = mmap(0,mmapsize,PROT_READ,MAP_PRIVATE,fd,0); - if (ptr == MAP_FAILED) { - close(fd); - fd = -1; - return; - } - mmapptr = (char *)ptr; - return; -} - - -WordsDic::~WordsDic() -{ - if (fd != -1) { - munmap(mmapptr,mmapsize); - close(fd); - } -} - - - - -/*! - \fn Honoka::WordsDic::find(const string &word) - */ -set Honoka::WordsDic::find(const string &word) -{ - set res,bres; - if (fd == -1) return res; - if (word.length() > 255) return res; - if (fd == -1) return res; - char w[256],ow[256]; - for(unsigned int i = 0;i < word.length();i ++) { - w[i] = (char)tolower(word[i]); - ow[i] = word[i]; - } - w[word.length()] = 0; - ow[word.length()] = 0; - char *p = mmapptr; - while(p < mmapptr + mmapsize) { - char b[256],ob[256]; - for(unsigned int i = 0;i < word.length();i ++) { - b[i] = (char)tolower(p[i]); - ob[i] = p[i]; - } - if (strncmp(w,b,word.length()) == 0) { - string s; - for(unsigned int i = 0;p[i] != '\n';i ++) { - if (p[i] == 0) break; - s += p[i]; - } - if (strncmp(ow,ob,word.length()) == 0) - res.insert(s); - else bres.insert(s); - } - while(*p != '\n') p ++; - p ++; - } - for(set::iterator it = bres.begin();it != bres.end();it ++) res.insert(*it); - return res; -} diff --git a/honoka/plugins/wordsdic.h b/honoka/plugins/wordsdic.h deleted file mode 100644 index a911ded..0000000 --- a/honoka/plugins/wordsdic.h +++ /dev/null @@ -1,53 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef WORDSDIC_H -#define WORDSDIC_H - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -using namespace std; -/** - @author TAM (Teppei Tamra) -*/ -namespace Honoka { -class WordsDic{ -public: - WordsDic(const string &filename); - - ~WordsDic(); - set find(const string &word); - -protected: - int fd; - char *mmapptr; - off_t mmapsize; -}; -} -#endif diff --git a/honoka/plugins/wordsprediction.cpp b/honoka/plugins/wordsprediction.cpp deleted file mode 100644 index 119baf8..0000000 --- a/honoka/plugins/wordsprediction.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "wordsprediction.h" - -#include - -#ifdef HAVE_CONFIG_H - #include -#endif - -#ifdef HAVE_GETTEXT - #include - #define _(String) dgettext(GETTEXT_PACKAGE,String) - #define N_(String) (String) -#else - #define _(String) (String) - #define N_(String) (String) - #define bindtextdomain(Package,Directory) - #define textdomain(domain) - #define bind_textdomain_codeset(domain,codeset) -#endif - -WordsPrediction::WordsPrediction(ConfigPointer cfg) : Predictor(cfg) -{ - String file = cfg->read(HONOKA_CONFIG_WORDSPREDICTION_FILE,String(HONOKA_DEFAULT_WORDSPREDICTION_FILE)); - dic = new WordsDic(file); - pos = 0; - addSpace = cfg->read(HONOKA_CONFIG_WORDSPREDICTION_ADDSAW,HONOKA_DEFAULT_WORDSPREDICTION_ADDSAW); - limit = cfg->read(HONOKA_CONFIG_WORDSPREDICTION_LIMIT,HONOKA_DEFAULT_WORDSPREDICTION_LIMIT); -} - - -WordsPrediction::~WordsPrediction() -{ - delete dic; -} - -/*! - \fn WordsPrediction::getPredictionList(const WideString &str) - */ -ResultList WordsPrediction::getPredictionList(const WideString &str) -{ - ResultList l; - WideString word,prewords; - for(unsigned int i = str.length();i > 0;i --) { - //if (isalnum(utf8_wcstombs(str).c_str()[i - 1])) - if (((str[i - 1] >= 0x0041) && (str[i - 1] <= 0x005A)) || // ��ʸ�� - ((str[i - 1] >= 0x0061) && (str[i - 1] <= 0x007A)) || // ��ʸ�� - ((str[i - 1] >= 0x0030) && (str[i - 1] <= 0x0039)) || // ���� - (str[i - 1] == 0x002D)) // �ϥ��ե� - word = str[i - 1] + word; - else break; - } - if (!word.length()) return l; - prewords = str.substr(0,str.length() - word.length()); - pos = prewords.length(); - set res = dic->find(utf8_wcstombs(word).c_str()); - if (res.size() > limit) { - l.Title = utf8_mbstowcs(String(_("too many prediction results!"))); - l.kType = PREDICTION; - l.kouho.push_back(ResultEntry(str,word)); - } else if (res.size() == 0) { - l.Title = utf8_mbstowcs(String(_("no prediction results!"))); - l.kType = PREDICTION; - l.kouho.push_back(ResultEntry(str,word)); - } else { - l.Title = utf8_mbstowcs(String(_("lookup result"))); - l.kType = PREDICTION; - for(set::iterator it = res.begin();it != res.end();it ++) { - if (addSpace) l.kouho.push_back(ResultEntry(prewords + utf8_mbstowcs(*it) + utf8_mbstowcs(" "),utf8_mbstowcs(*it))); - else l.kouho.push_back(ResultEntry(prewords + utf8_mbstowcs(*it),utf8_mbstowcs(*it))); - } - } - return l; -} - - -/*! - \fn WordsPrediction::disconnect() - */ -void WordsPrediction::disconnect() -{ - return; -} - - -/*! - \fn WordsPrediction::connect() - */ -bool WordsPrediction::connect() -{ - return true; -} - - -/*! - \fn WordsPrediction::isConnected() - */ -bool WordsPrediction::isConnected() -{ - return true; -} - - -/*! - \fn WordsPrediction::getPropertyName() - */ -String WordsPrediction::getPropertyName() -{ - return String(_("WordsPrediction")); -} - -/*! - \fn WordsPrediction::getName() - */ -String WordsPrediction::getName() -{ - return String("WordsPrediction"); -} - -/*! - \fn WordsPrediction::update(const WideString str,const WideString yomi) - */ -void WordsPrediction::update(const WideString str,const WideString yomi) -{ - return; -} - - - - -/*! - \fn Honoka::WordsPrediction::getPos() - */ -int Honoka::WordsPrediction::getPos() -{ - return pos; -} diff --git a/honoka/plugins/wordsprediction.h b/honoka/plugins/wordsprediction.h deleted file mode 100644 index ab411cb..0000000 --- a/honoka/plugins/wordsprediction.h +++ /dev/null @@ -1,57 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by TAM(Teppei Tamra) * - * tam-t@par.odn.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 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef WORDSPREDICTION_H -#define WORDSPREDICTION_H - -#define Uses_SCIM_CONFIG_BASE - -#include -#include -#include -#include -#include - -/** - @author TAM (Teppei Tamra) -*/ -namespace Honoka { -class WordsPrediction : public Predictor { -public: - WordsPrediction(ConfigPointer cfg); - - ~WordsPrediction(); - virtual ResultList getPredictionList(const WideString &str); - virtual void disconnect(); - virtual bool connect(); - virtual bool isConnected(); - virtual String getPropertyName(); - virtual String getName(); - virtual void update(const WideString str,const WideString yomi); - virtual int getPos(); - -protected: - WordsDic *dic; - int pos; - bool addSpace; - int limit; -}; -} -#endif diff --git a/honoka/po/POTFILES.in b/honoka/po/POTFILES.in index b6e25bc..1f73381 100644 --- a/honoka/po/POTFILES.in +++ b/honoka/po/POTFILES.in @@ -7,38 +7,6 @@ src/multiconvertor.cpp src/acpredictor.h src/acpredictor.cpp -plugins/romkan.h -plugins/romkan.cpp -plugins/kanainput.h -plugins/kanainput.cpp -plugins/nicolainput.h -plugins/nicolainput.cpp -plugins/wnnconversion.h -plugins/wnnconversion.cpp -plugins/wnnplugin.h -plugins/wnnplugin.cpp -plugins/wnnprediction.h -plugins/wnnprediction.cpp -plugins/anthyconversion.h -plugins/anthyconversion.cpp -plugins/anthyplugin.h -plugins/anthyplugin.cpp -plugins/anthyprediction.h -plugins/anthyprediction.cpp -plugins/simpleprediction.h -plugins/simpleprediction.cpp -plugins/primeprediction.h -plugins/primeprediction.cpp -plugins/skkdicconversion.h -plugins/skkdicconversion.cpp -plugins/cannaconversion.h -plugins/cannaconversion.cpp -plugins/asciiplugin.h -plugins/asciiplugin.cpp -plugins/asciiinput.h -plugins/asciiinput.cpp -plugins/wordsprediction.h -plugins/wordsprediction.cpp libhonoka/preeditor.h libhonoka/preeditor.cpp libhonoka/convertor.h diff --git a/honoka/po/honoka.pot b/honoka/po/honoka.pot index c32b7f5..7296c21 100644 --- a/honoka/po/honoka.pot +++ b/honoka/po/honoka.pot @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-05-13 14:54+0900\n" +"POT-Creation-Date: 2006-05-22 12:47+0900\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -83,7 +83,7 @@ msgid "A Honoka IMEngine Module." msgstr "" -#: src/honoka_imengine_setup.cpp:141 plugins/asciiplugin.cpp:47 +#: src/honoka_imengine_setup.cpp:141 msgid "general setting" msgstr "" @@ -177,7 +177,7 @@ msgid "select the default predictor." msgstr "" -#: src/honoka_imengine_setup.cpp:218 plugins/asciiplugin.cpp:103 +#: src/honoka_imengine_setup.cpp:218 msgid "key setting" msgstr "" @@ -431,458 +431,6 @@ msgid "AutoConversion" msgstr "" -#: plugins/romkan.cpp:45 -msgid "Romkan-plugin" -msgstr "" - -#: plugins/romkan.cpp:47 -msgid "_Roma-Kana table: " -msgstr "" - -#: plugins/romkan.cpp:49 -msgid "input the path of Roma-Kana convert table file." -msgstr "" - -#: plugins/romkan.cpp:53 -msgid "Ascii to Kana convert: " -msgstr "" - -#: plugins/romkan.cpp:55 -msgid "convert ascii to kana when be switched to ROMKAN ." -msgstr "" - -#: plugins/romkan.cpp:59 -msgid "Ascii to Kana convert key: " -msgstr "" - -#: plugins/romkan.cpp:61 -msgid "The key events to convert the ascii string to kana." -msgstr "" - -#: plugins/romkan.cpp:64 plugins/kanainput.cpp:52 plugins/nicolainput.cpp:74 -#: plugins/wnnplugin.cpp:78 plugins/anthyplugin.cpp:46 -#: plugins/simpleprediction.cpp:53 plugins/primeprediction.cpp:72 -#: plugins/skkdicconversion.cpp:53 plugins/cannaconversion.cpp:57 -#: plugins/asciiplugin.cpp:85 -msgid "shortcut keys: " -msgstr "" - -#: plugins/romkan.cpp:66 -msgid "Romkan input: " -msgstr "" - -#: plugins/romkan.cpp:614 -msgid "Roma-Kana" -msgstr "" - -#: plugins/romkan.cpp:618 -msgid "Roma-Katakana" -msgstr "" - -#: plugins/romkan.cpp:622 -msgid "Half Roma-Kana" -msgstr "" - -#: plugins/romkan.cpp:626 -msgid "Ascii" -msgstr "" - -#: plugins/romkan.cpp:630 -msgid "Wide Ascii" -msgstr "" - -#: plugins/romkan.cpp:704 -msgid "Roma" -msgstr "" - -#: plugins/kanainput.cpp:45 -msgid "KanaInput-plugin" -msgstr "" - -#: plugins/kanainput.cpp:47 -msgid "use _fake kana-input: " -msgstr "" - -#: plugins/kanainput.cpp:49 -msgid "if you use the table of ASCII-KANA key mapping,check this." -msgstr "" - -#: plugins/kanainput.cpp:54 -msgid "Kana input: " -msgstr "" - -#: plugins/kanainput.cpp:165 plugins/nicolainput.cpp:235 -msgid "KANA" -msgstr "" - -#: plugins/kanainput.cpp:181 -msgid "Kana" -msgstr "" - -#: plugins/nicolainput.cpp:47 -msgid "Nicola-plugin" -msgstr "" - -#: plugins/nicolainput.cpp:49 -msgid "_Left KANA-Shift keys:" -msgstr "" - -#: plugins/nicolainput.cpp:55 -msgid "_Right KANA-Shift keys:" -msgstr "" - -#: plugins/nicolainput.cpp:61 -msgid "_Simultaneously press timer:" -msgstr "" - -#: plugins/nicolainput.cpp:68 -msgid "Nicola _table: " -msgstr "" - -#: plugins/nicolainput.cpp:70 -msgid "input the path of Nicola table file." -msgstr "" - -#: plugins/nicolainput.cpp:76 -msgid "Nicola input: " -msgstr "" - -#: plugins/nicolainput.cpp:251 -msgid "NICOLA" -msgstr "" - -#: plugins/wnnconversion.cpp:348 -msgid "yosoku lookup result" -msgstr "" - -#: plugins/wnnconversion.cpp:401 -msgid "Ikeiji lookup result" -msgstr "" - -#: plugins/wnnconversion.cpp:407 -msgid "association lookup result" -msgstr "" - -#: plugins/wnnconversion.cpp:414 plugins/anthyconversion.cpp:169 -#: plugins/anthyprediction.cpp:60 plugins/simpleprediction.cpp:91 -#: plugins/primeprediction.cpp:180 plugins/skkdicconversion.cpp:122 -#: plugins/cannaconversion.cpp:201 plugins/wordsprediction.cpp:85 -msgid "lookup result" -msgstr "" - -#: plugins/wnnconversion.cpp:501 -msgid "WnnConversion" -msgstr "" - -#: plugins/wnnplugin.cpp:46 -msgid "Wnn-plugin" -msgstr "" - -#: plugins/wnnplugin.cpp:49 plugins/cannaconversion.cpp:46 -msgid "_Server: " -msgstr "" - -#: plugins/wnnplugin.cpp:51 plugins/cannaconversion.cpp:48 -msgid "input the server name to connect." -msgstr "" - -#: plugins/wnnplugin.cpp:55 -msgid "_wnnenvrc: " -msgstr "" - -#: plugins/wnnplugin.cpp:57 -msgid "input the path of wnnenvrc." -msgstr "" - -#: plugins/wnnplugin.cpp:66 -msgid "Server_type: " -msgstr "" - -#: plugins/wnnplugin.cpp:68 -msgid "select the server type from Wnn4 / Wnn6 / Wnn7." -msgstr "" - -#: plugins/wnnplugin.cpp:73 -msgid "use Wnn7-_YOSOKU: " -msgstr "" - -#: plugins/wnnplugin.cpp:75 -msgid "if you use the prediction of Wnn7, check this." -msgstr "" - -#: plugins/wnnplugin.cpp:80 -msgid "Wnn Conversion: " -msgstr "" - -#: plugins/wnnplugin.cpp:86 -msgid "Wnn Prediction: " -msgstr "" - -#: plugins/wnnprediction.cpp:90 -msgid "WnnPrediction" -msgstr "" - -#: plugins/anthyconversion.cpp:208 -msgid "AnthyConversion" -msgstr "" - -#: plugins/anthyplugin.cpp:45 -msgid "Anthy-plugin" -msgstr "" - -#: plugins/anthyplugin.cpp:48 -msgid "Anthy Conversion: " -msgstr "" - -#: plugins/anthyplugin.cpp:54 -msgid "Anthy Prediction: " -msgstr "" - -#: plugins/anthyprediction.cpp:115 -msgid "AnthyPrediction" -msgstr "" - -#: plugins/simpleprediction.cpp:45 -msgid "SimplePrediction-plugin" -msgstr "" - -#: plugins/simpleprediction.cpp:47 -msgid "_max history count: " -msgstr "" - -#: plugins/simpleprediction.cpp:49 -msgid "set maximum size of history count." -msgstr "" - -#: plugins/simpleprediction.cpp:55 -msgid "Simple Prediction: " -msgstr "" - -#: plugins/simpleprediction.cpp:132 -msgid "SimplePrediction" -msgstr "" - -#: plugins/primeprediction.cpp:52 -msgid "PrimePrediction-plugin" -msgstr "" - -#: plugins/primeprediction.cpp:66 -msgid "_Lookup method: " -msgstr "" - -#: plugins/primeprediction.cpp:68 -msgid "select the lookup method." -msgstr "" - -#: plugins/primeprediction.cpp:74 -msgid "Prime Prediction: " -msgstr "" - -#: plugins/primeprediction.cpp:262 -msgid "PrimePrediction" -msgstr "" - -#: plugins/skkdicconversion.cpp:46 -msgid "SKKDic-plugin" -msgstr "" - -#: plugins/skkdicconversion.cpp:48 -msgid "_SKKDic file: " -msgstr "" - -#: plugins/skkdicconversion.cpp:50 -msgid "set SKKDic file in this entry." -msgstr "" - -#: plugins/skkdicconversion.cpp:55 -msgid "SKKDic: " -msgstr "" - -#: plugins/skkdicconversion.cpp:193 -msgid "SKKDic" -msgstr "" - -#: plugins/cannaconversion.cpp:44 -msgid "Canna-plugin" -msgstr "" - -#: plugins/cannaconversion.cpp:52 -msgid "_DicHomeDir: " -msgstr "" - -#: plugins/cannaconversion.cpp:54 -msgid "set your DicHomeDir in this entry." -msgstr "" - -#: plugins/cannaconversion.cpp:59 -msgid "Canna Conversion: " -msgstr "" - -#: plugins/cannaconversion.cpp:226 -msgid "CannaConversion" -msgstr "" - -#: plugins/asciiplugin.cpp:45 -msgid "Ascii-plugin" -msgstr "" - -#: plugins/asciiplugin.cpp:49 -msgid "Words _file: " -msgstr "" - -#: plugins/asciiplugin.cpp:51 -msgid "input the path of Words file." -msgstr "" - -#: plugins/asciiplugin.cpp:55 -msgid "_Add a space after word: " -msgstr "" - -#: plugins/asciiplugin.cpp:57 -msgid "" -"At WordsPrediction, if you want to add a space after the committed word ," -"check it." -msgstr "" - -#: plugins/asciiplugin.cpp:61 -msgid "_Limit of prediction results to display: " -msgstr "" - -#: plugins/asciiplugin.cpp:63 -msgid "" -"set the getting limit of prediction results. it doesn't display the results " -"when the count of prediction results is more than this." -msgstr "" - -#: plugins/asciiplugin.cpp:68 -msgid "Low priority key: " -msgstr "" - -#: plugins/asciiplugin.cpp:70 -msgid "set the key that lowers priority." -msgstr "" - -#: plugins/asciiplugin.cpp:74 -msgid "Use automatic committing: " -msgstr "" - -#: plugins/asciiplugin.cpp:76 -msgid "" -"if you want to commit the string when you press the specific key,check it." -msgstr "" - -#: plugins/asciiplugin.cpp:80 -msgid "Automatic committing key: " -msgstr "" - -#: plugins/asciiplugin.cpp:82 -msgid "set the key that commit the string automatic." -msgstr "" - -#: plugins/asciiplugin.cpp:87 -msgid "Ascii Input: " -msgstr "" - -#: plugins/asciiplugin.cpp:93 -msgid "Words Prediction: " -msgstr "" - -#: plugins/asciiplugin.cpp:105 -msgid "Compose key: " -msgstr "" - -#: plugins/asciiplugin.cpp:107 -msgid "set the Compose emulation key." -msgstr "" - -#: plugins/asciiplugin.cpp:112 -msgid "dead abovering key: " -msgstr "" - -#: plugins/asciiplugin.cpp:114 -msgid "set the dead_abovering emulation key." -msgstr "" - -#: plugins/asciiplugin.cpp:119 -msgid "dead acute key: " -msgstr "" - -#: plugins/asciiplugin.cpp:121 -msgid "set the dead_acute emulation key." -msgstr "" - -#: plugins/asciiplugin.cpp:126 -msgid "dead cedilla key: " -msgstr "" - -#: plugins/asciiplugin.cpp:128 -msgid "set the dead_cedilla emulation key." -msgstr "" - -#: plugins/asciiplugin.cpp:133 -msgid "dead circumflex key: " -msgstr "" - -#: plugins/asciiplugin.cpp:135 -msgid "set the dead_circumflex emulation key." -msgstr "" - -#: plugins/asciiplugin.cpp:140 -msgid "dead diaeresis key: " -msgstr "" - -#: plugins/asciiplugin.cpp:142 -msgid "set the dead_diaeresis emulation key." -msgstr "" - -#: plugins/asciiplugin.cpp:147 -msgid "dead doubleacute key: " -msgstr "" - -#: plugins/asciiplugin.cpp:149 -msgid "set the dead_doubleacute emulation key." -msgstr "" - -#: plugins/asciiplugin.cpp:154 -msgid "dead grave key: " -msgstr "" - -#: plugins/asciiplugin.cpp:156 -msgid "set the dead_grave emulation key." -msgstr "" - -#: plugins/asciiplugin.cpp:161 -msgid "dead tilde key: " -msgstr "" - -#: plugins/asciiplugin.cpp:163 -msgid "set the dead_tilde emulation key." -msgstr "" - -#: plugins/asciiinput.cpp:75 -msgid "Cc" -msgstr "" - -#: plugins/asciiinput.cpp:76 -msgid "Aa" -msgstr "" - -#: plugins/asciiinput.cpp:92 -msgid "AsciiInput" -msgstr "" - -#: plugins/wordsprediction.cpp:77 -msgid "too many prediction results!" -msgstr "" - -#: plugins/wordsprediction.cpp:81 -msgid "no prediction results!" -msgstr "" - -#: plugins/wordsprediction.cpp:128 -msgid "WordsPrediction" -msgstr "" - #: libhonoka/predictor.cpp:92 msgid "Predicter" msgstr "" diff --git a/honoka/po/ja.po b/honoka/po/ja.po index 527d63a..9d3a902 100644 --- a/honoka/po/ja.po +++ b/honoka/po/ja.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: ja\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-05-13 14:54+0900\n" +"POT-Creation-Date: 2006-05-22 12:47+0900\n" "PO-Revision-Date: 2004-12-01 14:29+0900\n" "Last-Translator: TAM (Teppei Tamra) \n" "Language-Team: Japanese\n" @@ -87,7 +87,7 @@ msgid "A Honoka IMEngine Module." msgstr "ほのかたんIMエンジンモジュール" -#: src/honoka_imengine_setup.cpp:141 plugins/asciiplugin.cpp:47 +#: src/honoka_imengine_setup.cpp:141 msgid "general setting" msgstr "全般設定" @@ -183,7 +183,7 @@ msgid "select the default predictor." msgstr "標準で利用する予測エンジンを選びます。" -#: src/honoka_imengine_setup.cpp:218 plugins/asciiplugin.cpp:103 +#: src/honoka_imengine_setup.cpp:218 msgid "key setting" msgstr "キー設定" @@ -437,470 +437,353 @@ msgid "AutoConversion" msgstr "逐次変換" -#: plugins/romkan.cpp:45 -msgid "Romkan-plugin" -msgstr "ローマ字入力プラグイン" - -#: plugins/romkan.cpp:47 -msgid "_Roma-Kana table: " -msgstr "ローマ字変換テーブル(_R):" - -#: plugins/romkan.cpp:49 -msgid "input the path of Roma-Kana convert table file." -msgstr "ローマ字かな変換テーブルファイルを指定します" - -#: plugins/romkan.cpp:53 -msgid "Ascii to Kana convert: " -msgstr "英字かな変換:" - -#: plugins/romkan.cpp:55 -msgid "convert ascii to kana when be switched to ROMKAN ." -msgstr "ローマ字入力に切り替えた時に英字をかなに変換します。" - -#: plugins/romkan.cpp:59 -msgid "Ascii to Kana convert key: " -msgstr "英字かな変換キー:" - -#: plugins/romkan.cpp:61 -msgid "The key events to convert the ascii string to kana." -msgstr "英字文字列をかなへ変換するキーイベント" - -#: plugins/romkan.cpp:64 plugins/kanainput.cpp:52 plugins/nicolainput.cpp:74 -#: plugins/wnnplugin.cpp:78 plugins/anthyplugin.cpp:46 -#: plugins/simpleprediction.cpp:53 plugins/primeprediction.cpp:72 -#: plugins/skkdicconversion.cpp:53 plugins/cannaconversion.cpp:57 -#: plugins/asciiplugin.cpp:85 -msgid "shortcut keys: " -msgstr "ショートカットキー:" - -#: plugins/romkan.cpp:66 -msgid "Romkan input: " -msgstr "ローマ字入力:" - -#: plugins/romkan.cpp:614 -msgid "Roma-Kana" -msgstr "[あ]" - -#: plugins/romkan.cpp:618 -msgid "Roma-Katakana" -msgstr "[ア]" - -#: plugins/romkan.cpp:622 -msgid "Half Roma-Kana" -msgstr "[アr]" - -#: plugins/romkan.cpp:626 -msgid "Ascii" -msgstr "[aa]" - -#: plugins/romkan.cpp:630 -msgid "Wide Ascii" -msgstr "[a]" - -#: plugins/romkan.cpp:704 -msgid "Roma" -msgstr "ローマ字" - -#: plugins/kanainput.cpp:45 -msgid "KanaInput-plugin" -msgstr "かな入力プラグイン" - -#: plugins/kanainput.cpp:47 -msgid "use _fake kana-input: " -msgstr "なんちゃってかな入力(_F):" - -#: plugins/kanainput.cpp:49 -msgid "if you use the table of ASCII-KANA key mapping,check this." -msgstr "" -"アルファベットキーをかな文字キーとして利用するにはここをチェックします。(シス" -"テム側でかな文字キーが判別できない場合はonにすることをおすすめします)" - -#: plugins/kanainput.cpp:54 -msgid "Kana input: " -msgstr "かな字入力:" - -#: plugins/kanainput.cpp:165 plugins/nicolainput.cpp:235 -msgid "KANA" -msgstr "[あ]" - -#: plugins/kanainput.cpp:181 -msgid "Kana" -msgstr "かな入力" - -#: plugins/nicolainput.cpp:47 -msgid "Nicola-plugin" -msgstr "親指シフトプラグイン" - -#: plugins/nicolainput.cpp:49 -msgid "_Left KANA-Shift keys:" -msgstr "左かなシフトキー(_L):" - -#: plugins/nicolainput.cpp:55 -msgid "_Right KANA-Shift keys:" -msgstr "右かなシフトキー(_R):" - -#: plugins/nicolainput.cpp:61 -msgid "_Simultaneously press timer:" -msgstr "同時押し判定時間(_S):" - -#: plugins/nicolainput.cpp:68 -msgid "Nicola _table: " -msgstr "親指シフトテーブルファイル(_t):" - -#: plugins/nicolainput.cpp:70 -msgid "input the path of Nicola table file." -msgstr "親指シフトテーブルファイルを指定します" - -#: plugins/nicolainput.cpp:76 -msgid "Nicola input: " -msgstr "親指シフト入力:" - -#: plugins/nicolainput.cpp:251 -msgid "NICOLA" -msgstr "親指シフト" - -#: plugins/wnnconversion.cpp:348 -msgid "yosoku lookup result" -msgstr "予測候補" - -#: plugins/wnnconversion.cpp:401 -msgid "Ikeiji lookup result" -msgstr "異形字変換" - -#: plugins/wnnconversion.cpp:407 -msgid "association lookup result" -msgstr "連想変換" - -#: plugins/wnnconversion.cpp:414 plugins/anthyconversion.cpp:169 -#: plugins/anthyprediction.cpp:60 plugins/simpleprediction.cpp:91 -#: plugins/primeprediction.cpp:180 plugins/skkdicconversion.cpp:122 -#: plugins/cannaconversion.cpp:201 plugins/wordsprediction.cpp:85 -msgid "lookup result" -msgstr "候補一覧" - -#: plugins/wnnconversion.cpp:501 -msgid "WnnConversion" -msgstr "Wnn変換" - -#: plugins/wnnplugin.cpp:46 -msgid "Wnn-plugin" -msgstr "Wnnプラグイン" - -#: plugins/wnnplugin.cpp:49 plugins/cannaconversion.cpp:46 -msgid "_Server: " -msgstr "サーバ(_S):" - -#: plugins/wnnplugin.cpp:51 plugins/cannaconversion.cpp:48 -msgid "input the server name to connect." -msgstr "接続するサーバ名を指定します。" - -#: plugins/wnnplugin.cpp:55 -msgid "_wnnenvrc: " -msgstr "wnnenvrc(_W):" - -#: plugins/wnnplugin.cpp:57 -msgid "input the path of wnnenvrc." -msgstr "wnnenvrcファイルを指定します" - -#: plugins/wnnplugin.cpp:66 -msgid "Server_type: " -msgstr "サーバタイプ(_T):" - -#: plugins/wnnplugin.cpp:68 -msgid "select the server type from Wnn4 / Wnn6 / Wnn7." -msgstr "サーバの種類を Wnn4 / Wnn6 / Wnn7 から選択します。" - -#: plugins/wnnplugin.cpp:73 -msgid "use Wnn7-_YOSOKU: " -msgstr "Wnn7予測(_Y):" - -#: plugins/wnnplugin.cpp:75 -msgid "if you use the prediction of Wnn7, check this." -msgstr "Wnn7の予測を利用する場合にはここをチェックします。" - -#: plugins/wnnplugin.cpp:80 -msgid "Wnn Conversion: " -msgstr "Wnn変換:" - -#: plugins/wnnplugin.cpp:86 -msgid "Wnn Prediction: " -msgstr "Wnn予測:" - -#: plugins/wnnprediction.cpp:90 -msgid "WnnPrediction" -msgstr "Wnn予測" - -#: plugins/anthyconversion.cpp:208 -msgid "AnthyConversion" -msgstr "Anthy変換" - -#: plugins/anthyplugin.cpp:45 -msgid "Anthy-plugin" -msgstr "Anthyプラグイン" - -#: plugins/anthyplugin.cpp:48 -msgid "Anthy Conversion: " -msgstr "Anthy変換:" - -#: plugins/anthyplugin.cpp:54 -msgid "Anthy Prediction: " -msgstr "Anthy予測:" - -#: plugins/anthyprediction.cpp:115 -msgid "AnthyPrediction" -msgstr "Anthy予測" - -#: plugins/simpleprediction.cpp:45 -msgid "SimplePrediction-plugin" -msgstr "単純予測プラグイン" - -#: plugins/simpleprediction.cpp:47 -msgid "_max history count: " -msgstr "最大履歴数(_M):" - -#: plugins/simpleprediction.cpp:49 -msgid "set maximum size of history count." -msgstr "保持する履歴の最大値を指定して下さい。" - -#: plugins/simpleprediction.cpp:55 -msgid "Simple Prediction: " -msgstr "単純予測:" - -#: plugins/simpleprediction.cpp:132 -msgid "SimplePrediction" -msgstr "単純予測" - -#: plugins/primeprediction.cpp:52 -msgid "PrimePrediction-plugin" -msgstr "Prime予測プラグイン" - -#: plugins/primeprediction.cpp:66 -msgid "_Lookup method: " -msgstr "検索方法" - -#: plugins/primeprediction.cpp:68 -msgid "select the lookup method." -msgstr "検索方法を選んで下さい。" - -#: plugins/primeprediction.cpp:74 -msgid "Prime Prediction: " -msgstr "prime予測:" - -#: plugins/primeprediction.cpp:262 -msgid "PrimePrediction" -msgstr "prime予測" - -#: plugins/skkdicconversion.cpp:46 -msgid "SKKDic-plugin" -msgstr "SKKDicプラグイン" - -#: plugins/skkdicconversion.cpp:48 -msgid "_SKKDic file: " -msgstr "SKK辞書ファイル(_S):" - -#: plugins/skkdicconversion.cpp:50 -msgid "set SKKDic file in this entry." -msgstr "利用するSKK辞書ファイルを指定して下さい。" - -#: plugins/skkdicconversion.cpp:55 -msgid "SKKDic: " -msgstr "SKK辞書:" - -#: plugins/skkdicconversion.cpp:193 -msgid "SKKDic" -msgstr "SKK辞書" - -#: plugins/cannaconversion.cpp:44 -msgid "Canna-plugin" -msgstr "Cannaプラグイン" - -#: plugins/cannaconversion.cpp:52 -msgid "_DicHomeDir: " -msgstr "辞書ホームディレクトリ(_D):" - -#: plugins/cannaconversion.cpp:54 -msgid "set your DicHomeDir in this entry." -msgstr "辞書のホームディレクトリを指定して下さい。" - -#: plugins/cannaconversion.cpp:59 -msgid "Canna Conversion: " -msgstr "Canna変換:" - -#: plugins/cannaconversion.cpp:226 -msgid "CannaConversion" -msgstr "Canna変換" - -#: plugins/asciiplugin.cpp:45 -msgid "Ascii-plugin" -msgstr "英数字プラグイン" - -#: plugins/asciiplugin.cpp:49 -msgid "Words _file: " -msgstr "単語ファイル(_f):" - -#: plugins/asciiplugin.cpp:51 -msgid "input the path of Words file." -msgstr "単語ファイルを指定します" - -#: plugins/asciiplugin.cpp:55 -msgid "_Add a space after word: " -msgstr "単語末のスペース追加(_A):" - -#: plugins/asciiplugin.cpp:57 -msgid "" -"At WordsPrediction, if you want to add a space after the committed word ," -"check it." -msgstr "" -"英単語予測において確定単語の後にスペースを追加させたい場合はここをチェックし" -"てください。" - -#: plugins/asciiplugin.cpp:61 -msgid "_Limit of prediction results to display: " -msgstr "予測候補表示の限界" - -#: plugins/asciiplugin.cpp:63 -msgid "" -"set the getting limit of prediction results. it doesn't display the results " -"when the count of prediction results is more than this." -msgstr "" -"取得する予測結果の限度を設定してください。これを越える数の予測結果の場合は表" -"示しません。" - -#: plugins/asciiplugin.cpp:68 -msgid "Low priority key: " -msgstr "優先度を下げるキー:" - -#: plugins/asciiplugin.cpp:70 -msgid "set the key that lowers priority." -msgstr "優先度を下げるキーを指定します。" - -#: plugins/asciiplugin.cpp:74 -msgid "Use automatic committing: " -msgstr "自動確定を使う:" - -#: plugins/asciiplugin.cpp:76 -msgid "" -"if you want to commit the string when you press the specific key,check it." -msgstr "" -"指定したキーが押された場合に自動的に確定したい場合はここをチェックして下さ" -"い。" - -#: plugins/asciiplugin.cpp:80 -msgid "Automatic committing key: " -msgstr "自動確定キー:" - -#: plugins/asciiplugin.cpp:82 -msgid "set the key that commit the string automatic." -msgstr "自動確定を行うキーを指定します。" - -#: plugins/asciiplugin.cpp:87 -msgid "Ascii Input: " -msgstr "英数字入力:" - -#: plugins/asciiplugin.cpp:93 -msgid "Words Prediction: " -msgstr "英単語予測:" - -#: plugins/asciiplugin.cpp:105 -msgid "Compose key: " -msgstr "Compose キー:" - -#: plugins/asciiplugin.cpp:107 -msgid "set the Compose emulation key." -msgstr "Composeエミュレーションキーを指定します。" - -#: plugins/asciiplugin.cpp:112 -msgid "dead abovering key: " -msgstr "dead abovering キー:" - -#: plugins/asciiplugin.cpp:114 -msgid "set the dead_abovering emulation key." -msgstr "dead_aboveringエミュレーションキーを指定します。" - -#: plugins/asciiplugin.cpp:119 -msgid "dead acute key: " -msgstr "dead acute キー:" - -#: plugins/asciiplugin.cpp:121 -msgid "set the dead_acute emulation key." -msgstr "dead_acuteエミュレーションキーを指定します。" - -#: plugins/asciiplugin.cpp:126 -msgid "dead cedilla key: " -msgstr "dead cedilla キー:" - -#: plugins/asciiplugin.cpp:128 -msgid "set the dead_cedilla emulation key." -msgstr "dead_cedillaエミュレーションキーを指定します。" - -#: plugins/asciiplugin.cpp:133 -msgid "dead circumflex key: " -msgstr "dead circumflex キー:" - -#: plugins/asciiplugin.cpp:135 -msgid "set the dead_circumflex emulation key." -msgstr "dead_circumflexエミュレーションキーを指定します。" - -#: plugins/asciiplugin.cpp:140 -msgid "dead diaeresis key: " -msgstr "dead diaeresis キー:" - -#: plugins/asciiplugin.cpp:142 -msgid "set the dead_diaeresis emulation key." -msgstr "dead_diaeresisエミュレーションキーを指定します。" - -#: plugins/asciiplugin.cpp:147 -msgid "dead doubleacute key: " -msgstr "dead doubleacute キー:" - -#: plugins/asciiplugin.cpp:149 -msgid "set the dead_doubleacute emulation key." -msgstr "dead_doubleacuteエミュレーションキーを指定します。" - -#: plugins/asciiplugin.cpp:154 -msgid "dead grave key: " -msgstr "dead grave キー:" - -#: plugins/asciiplugin.cpp:156 -msgid "set the dead_grave emulation key." -msgstr "dead_graveエミュレーションキーを指定します。" - -#: plugins/asciiplugin.cpp:161 -msgid "dead tilde key: " -msgstr "dead tilde キー:" - -#: plugins/asciiplugin.cpp:163 -msgid "set the dead_tilde emulation key." -msgstr "dead_tildeエミュレーションキーを指定します。" - -#: plugins/asciiinput.cpp:75 -msgid "Cc" -msgstr "[Cc]" - -#: plugins/asciiinput.cpp:76 -msgid "Aa" -msgstr "[Aa]" - -#: plugins/asciiinput.cpp:92 -msgid "AsciiInput" -msgstr "英数字入力" - -#: plugins/wordsprediction.cpp:77 -msgid "too many prediction results!" -msgstr "予測候補多過ぎなので表示しません" - -#: plugins/wordsprediction.cpp:81 -msgid "no prediction results!" -msgstr "予測候補はありません" - -#: plugins/wordsprediction.cpp:128 -msgid "WordsPrediction" -msgstr "英単語予測" - #: libhonoka/predictor.cpp:92 msgid "Predicter" msgstr "予測なし" +#~ msgid "Romkan-plugin" +#~ msgstr "ローマ字入力プラグイン" + +#~ msgid "_Roma-Kana table: " +#~ msgstr "ローマ字変換テーブル(_R):" + +#~ msgid "input the path of Roma-Kana convert table file." +#~ msgstr "ローマ字かな変換テーブルファイルを指定します" + +#~ msgid "Ascii to Kana convert: " +#~ msgstr "英字かな変換:" + +#~ msgid "convert ascii to kana when be switched to ROMKAN ." +#~ msgstr "ローマ字入力に切り替えた時に英字をかなに変換します。" + +#~ msgid "Ascii to Kana convert key: " +#~ msgstr "英字かな変換キー:" + +#~ msgid "The key events to convert the ascii string to kana." +#~ msgstr "英字文字列をかなへ変換するキーイベント" + +#~ msgid "shortcut keys: " +#~ msgstr "ショートカットキー:" + +#~ msgid "Romkan input: " +#~ msgstr "ローマ字入力:" + +#~ msgid "Roma-Kana" +#~ msgstr "[あ]" + +#~ msgid "Roma-Katakana" +#~ msgstr "[ア]" + +#~ msgid "Half Roma-Kana" +#~ msgstr "[アr]" + +#~ msgid "Ascii" +#~ msgstr "[aa]" + +#~ msgid "Wide Ascii" +#~ msgstr "[a]" + +#~ msgid "Roma" +#~ msgstr "ローマ字" + +#~ msgid "KanaInput-plugin" +#~ msgstr "かな入力プラグイン" + +#~ msgid "use _fake kana-input: " +#~ msgstr "なんちゃってかな入力(_F):" + +#~ msgid "if you use the table of ASCII-KANA key mapping,check this." +#~ msgstr "" +#~ "アルファベットキーをかな文字キーとして利用するにはここをチェックします。" +#~ "(システム側でかな文字キーが判別できない場合はonにすることをおすすめします)" + +#~ msgid "Kana input: " +#~ msgstr "かな字入力:" + +#~ msgid "KANA" +#~ msgstr "[あ]" + +#~ msgid "Kana" +#~ msgstr "かな入力" + +#~ msgid "Nicola-plugin" +#~ msgstr "親指シフトプラグイン" + +#~ msgid "_Left KANA-Shift keys:" +#~ msgstr "左かなシフトキー(_L):" + +#~ msgid "_Right KANA-Shift keys:" +#~ msgstr "右かなシフトキー(_R):" + +#~ msgid "_Simultaneously press timer:" +#~ msgstr "同時押し判定時間(_S):" + +#~ msgid "Nicola _table: " +#~ msgstr "親指シフトテーブルファイル(_t):" + +#~ msgid "input the path of Nicola table file." +#~ msgstr "親指シフトテーブルファイルを指定します" + +#~ msgid "Nicola input: " +#~ msgstr "親指シフト入力:" + +#~ msgid "NICOLA" +#~ msgstr "親指シフト" + +#~ msgid "yosoku lookup result" +#~ msgstr "予測候補" + +#~ msgid "Ikeiji lookup result" +#~ msgstr "異形字変換" + +#~ msgid "association lookup result" +#~ msgstr "連想変換" + +#~ msgid "lookup result" +#~ msgstr "候補一覧" + +#~ msgid "WnnConversion" +#~ msgstr "Wnn変換" + +#~ msgid "Wnn-plugin" +#~ msgstr "Wnnプラグイン" + +#~ msgid "_Server: " +#~ msgstr "サーバ(_S):" + +#~ msgid "input the server name to connect." +#~ msgstr "接続するサーバ名を指定します。" + +#~ msgid "_wnnenvrc: " +#~ msgstr "wnnenvrc(_W):" + +#~ msgid "input the path of wnnenvrc." +#~ msgstr "wnnenvrcファイルを指定します" + +#~ msgid "Server_type: " +#~ msgstr "サーバタイプ(_T):" + +#~ msgid "select the server type from Wnn4 / Wnn6 / Wnn7." +#~ msgstr "サーバの種類を Wnn4 / Wnn6 / Wnn7 から選択します。" + +#~ msgid "use Wnn7-_YOSOKU: " +#~ msgstr "Wnn7予測(_Y):" + +#~ msgid "if you use the prediction of Wnn7, check this." +#~ msgstr "Wnn7の予測を利用する場合にはここをチェックします。" + +#~ msgid "Wnn Conversion: " +#~ msgstr "Wnn変換:" + +#~ msgid "Wnn Prediction: " +#~ msgstr "Wnn予測:" + +#~ msgid "WnnPrediction" +#~ msgstr "Wnn予測" + +#~ msgid "AnthyConversion" +#~ msgstr "Anthy変換" + +#~ msgid "Anthy-plugin" +#~ msgstr "Anthyプラグイン" + +#~ msgid "Anthy Conversion: " +#~ msgstr "Anthy変換:" + +#~ msgid "Anthy Prediction: " +#~ msgstr "Anthy予測:" + +#~ msgid "AnthyPrediction" +#~ msgstr "Anthy予測" + +#~ msgid "SimplePrediction-plugin" +#~ msgstr "単純予測プラグイン" + +#~ msgid "_max history count: " +#~ msgstr "最大履歴数(_M):" + +#~ msgid "set maximum size of history count." +#~ msgstr "保持する履歴の最大値を指定して下さい。" + +#~ msgid "Simple Prediction: " +#~ msgstr "単純予測:" + +#~ msgid "SimplePrediction" +#~ msgstr "単純予測" + +#~ msgid "PrimePrediction-plugin" +#~ msgstr "Prime予測プラグイン" + +#~ msgid "_Lookup method: " +#~ msgstr "検索方法" + +#~ msgid "select the lookup method." +#~ msgstr "検索方法を選んで下さい。" + +#~ msgid "Prime Prediction: " +#~ msgstr "prime予測:" + +#~ msgid "PrimePrediction" +#~ msgstr "prime予測" + +#~ msgid "SKKDic-plugin" +#~ msgstr "SKKDicプラグイン" + +#~ msgid "_SKKDic file: " +#~ msgstr "SKK辞書ファイル(_S):" + +#~ msgid "set SKKDic file in this entry." +#~ msgstr "利用するSKK辞書ファイルを指定して下さい。" + +#~ msgid "SKKDic: " +#~ msgstr "SKK辞書:" + +#~ msgid "SKKDic" +#~ msgstr "SKK辞書" + +#~ msgid "Canna-plugin" +#~ msgstr "Cannaプラグイン" + +#~ msgid "_DicHomeDir: " +#~ msgstr "辞書ホームディレクトリ(_D):" + +#~ msgid "set your DicHomeDir in this entry." +#~ msgstr "辞書のホームディレクトリを指定して下さい。" + +#~ msgid "Canna Conversion: " +#~ msgstr "Canna変換:" + +#~ msgid "CannaConversion" +#~ msgstr "Canna変換" + +#~ msgid "Ascii-plugin" +#~ msgstr "英数字プラグイン" + +#~ msgid "Words _file: " +#~ msgstr "単語ファイル(_f):" + +#~ msgid "input the path of Words file." +#~ msgstr "単語ファイルを指定します" + +#~ msgid "_Add a space after word: " +#~ msgstr "単語末のスペース追加(_A):" + +#~ msgid "" +#~ "At WordsPrediction, if you want to add a space after the committed word ," +#~ "check it." +#~ msgstr "" +#~ "英単語予測において確定単語の後にスペースを追加させたい場合はここをチェック" +#~ "してください。" + +#~ msgid "_Limit of prediction results to display: " +#~ msgstr "予測候補表示の限界" + +#~ msgid "" +#~ "set the getting limit of prediction results. it doesn't display the " +#~ "results when the count of prediction results is more than this." +#~ msgstr "" +#~ "取得する予測結果の限度を設定してください。これを越える数の予測結果の場合は" +#~ "表示しません。" + +#~ msgid "Low priority key: " +#~ msgstr "優先度を下げるキー:" + +#~ msgid "set the key that lowers priority." +#~ msgstr "優先度を下げるキーを指定します。" + +#~ msgid "Use automatic committing: " +#~ msgstr "自動確定を使う:" + +#~ msgid "" +#~ "if you want to commit the string when you press the specific key,check it." +#~ msgstr "" +#~ "指定したキーが押された場合に自動的に確定したい場合はここをチェックして下さ" +#~ "い。" + +#~ msgid "Automatic committing key: " +#~ msgstr "自動確定キー:" + +#~ msgid "set the key that commit the string automatic." +#~ msgstr "自動確定を行うキーを指定します。" + +#~ msgid "Ascii Input: " +#~ msgstr "英数字入力:" + +#~ msgid "Words Prediction: " +#~ msgstr "英単語予測:" + +#~ msgid "Compose key: " +#~ msgstr "Compose キー:" + +#~ msgid "set the Compose emulation key." +#~ msgstr "Composeエミュレーションキーを指定します。" + +#~ msgid "dead abovering key: " +#~ msgstr "dead abovering キー:" + +#~ msgid "set the dead_abovering emulation key." +#~ msgstr "dead_aboveringエミュレーションキーを指定します。" + +#~ msgid "dead acute key: " +#~ msgstr "dead acute キー:" + +#~ msgid "set the dead_acute emulation key." +#~ msgstr "dead_acuteエミュレーションキーを指定します。" + +#~ msgid "dead cedilla key: " +#~ msgstr "dead cedilla キー:" + +#~ msgid "set the dead_cedilla emulation key." +#~ msgstr "dead_cedillaエミュレーションキーを指定します。" + +#~ msgid "dead circumflex key: " +#~ msgstr "dead circumflex キー:" + +#~ msgid "set the dead_circumflex emulation key." +#~ msgstr "dead_circumflexエミュレーションキーを指定します。" + +#~ msgid "dead diaeresis key: " +#~ msgstr "dead diaeresis キー:" + +#~ msgid "set the dead_diaeresis emulation key." +#~ msgstr "dead_diaeresisエミュレーションキーを指定します。" + +#~ msgid "dead doubleacute key: " +#~ msgstr "dead doubleacute キー:" + +#~ msgid "set the dead_doubleacute emulation key." +#~ msgstr "dead_doubleacuteエミュレーションキーを指定します。" + +#~ msgid "dead grave key: " +#~ msgstr "dead grave キー:" + +#~ msgid "set the dead_grave emulation key." +#~ msgstr "dead_graveエミュレーションキーを指定します。" + +#~ msgid "dead tilde key: " +#~ msgstr "dead tilde キー:" + +#~ msgid "set the dead_tilde emulation key." +#~ msgstr "dead_tildeエミュレーションキーを指定します。" + +#~ msgid "Cc" +#~ msgstr "[Cc]" + +#~ msgid "Aa" +#~ msgstr "[Aa]" + +#~ msgid "AsciiInput" +#~ msgstr "英数字入力" + +#~ msgid "too many prediction results!" +#~ msgstr "予測候補多過ぎなので表示しません" + +#~ msgid "no prediction results!" +#~ msgstr "予測候補はありません" + +#~ msgid "WordsPrediction" +#~ msgstr "英単語予測" + #~ msgid "SCIM-WNN HELP" #~ msgstr "適当にそれっぽく操作して下さい。"