diff --git a/honoka/src/Makefile.am b/honoka/src/Makefile.am index 4d04a3e..4aa287f 100644 --- a/honoka/src/Makefile.am +++ b/honoka/src/Makefile.am @@ -27,8 +27,8 @@ -DHONOKA_PLUGINDIR=\"@SCIM_MODULEDIR@/honoka\" noinst_HEADERS = honoka_imengine.h wnnproto.h romkan.h romkan_table.h \ - wnnconversion.h honoka_def.h kanainput.h anthyconversion.h multiconvertor.h skkdic.h \ - skkdicconversion.h wnnplugin.h wnnprediction.h + wnnconversion.h honoka_def.h kanainput.h anthyconversion.h multiconvertor.h skkdic.h \ + skkdicconversion.h wnnplugin.h wnnprediction.h honoka_plugin_def.h moduledir = @SCIM_MODULEDIR@/IMEngine module_LTLIBRARIES = honoka.la diff --git a/honoka/src/honoka_def.h b/honoka/src/honoka_def.h index 6822979..f0f937b 100644 --- a/honoka/src/honoka_def.h +++ b/honoka/src/honoka_def.h @@ -89,10 +89,6 @@ #define HONOKA_CONFIG_ALP "/IMEngine/Honoka/AutoLookupPopup" #define HONOKA_DEFAULT_ALP 3 -#define HONOKA_CONFIG_SERVER "/IMEngine/Honoka/Server" -#define HONOKA_DEFAULT_SERVER "localhost" -#define HONOKA_CONFIG_RC "/IMEngine/Honoka/Rc" -#define HONOKA_DEFAULT_RC "/usr/lib/wnn7/ja_JP/wnnenvrc" #define HONOKA_CONFIG_AUTO_CONVERSION "/IMEngine/Honoka/AutoConversion" #define HONOKA_DEFAULT_AUTO_CONVERSION false #define HONOKA_CONFIG_NUMKEY_SELECT "/IMEngine/Honoka/NumkeySelection" @@ -103,24 +99,14 @@ #define HONOKA_DEFAULT_DEFAULT_CONVERTOR "Wnn" #define HONOKA_CONFIG_DEFAULT_PREDICTOR "/IMEngine/Honoka/DefaultPredictor" #define HONOKA_DEFAULT_DEFAULT_PREDICTOR "WnnPredictor" -#define HONOKA_CONFIG_SERVERTYPE "/IMEngine/Honoka/ServerType" -#ifdef HAVE_LIBWNN7 - #define HONOKA_DEFAULT_SERVERTYPE "Wnn7" -#else - #define HONOKA_DEFAULT_SERVERTYPE "Wnn4" -#endif #define HONOKA_CONFIG_PLUGINLOADER_PREFIX "/IMEngine/Honoka/PluginLoader" #define HONOKA_CONFIG_MINISTATUS "/IMEngine/Honoka/MiniStatus" #define HONOKA_DEFAULT_MINISTATUS false -#define HONOKA_CONFIG_YOSOKU "/IMEngine/Honoka/Yosoku" -#ifdef HAVE_LIBWNN7 - #define HONOKA_DEFAULT_YOSOKU true -#else - #define HONOKA_DEFAULT_YOSOKU false -#endif +#define HONOKA_CONFIG_PREDICTION "/IMEngine/Honoka/Prediction" +#define HONOKA_DEFAULT_PREDICTION true #define HONOKA_PROP_MODESTATUS "/IMEngine/Honoka/Property/ModeStatus" #define HONOKA_PROP_INPUTMODE "/IMEngine/Honoka/InputMode" @@ -129,13 +115,4 @@ #define HONOKA_PROP_PREDICTOR "/IMEngine/Honoka/Predictor" -// Romkan - -#define HONOKA_CONFIG_ROMKAN_TABLE_FILE "/IMEngine/Honoka/Romkan/TableFile" -#define HONOKA_DEFAULT_ROMKAN_TABLE_FILE "honoka-def.rkt" - -// KanaInput -#define HONOKA_CONFIG_KANAINPUT_FAKEKANA "/IMEngine/Honoka/KanaInput/FakeKanaKey" -#define HONOKA_DEFAULT_KANAINPUT_FAKEKANA true - #endif diff --git a/honoka/src/honoka_imengine.cpp b/honoka/src/honoka_imengine.cpp index b18e3e4..1c70f01 100644 --- a/honoka/src/honoka_imengine.cpp +++ b/honoka/src/honoka_imengine.cpp @@ -280,7 +280,7 @@ // ������� m_conversion = false; - m_yosoku = false; + m_prediction = false; m_lookup = false; while(preeditStack.size()) { @@ -292,9 +292,7 @@ alp = _scim_config->read(String(HONOKA_CONFIG_ALP),HONOKA_DEFAULT_ALP); mini_status = _scim_config->read(String(HONOKA_CONFIG_MINISTATUS),HONOKA_DEFAULT_MINISTATUS); numkeyselect = _scim_config->read(String(HONOKA_CONFIG_NUMKEY_SELECT),HONOKA_DEFAULT_NUMKEY_SELECT); - yosoku = _scim_config->read(String(HONOKA_CONFIG_YOSOKU),HONOKA_DEFAULT_YOSOKU); - sType = _scim_config->read(String(HONOKA_CONFIG_SERVERTYPE),String(HONOKA_DEFAULT_SERVERTYPE)); - + prediction = _scim_config->read(String(HONOKA_CONFIG_PREDICTION),HONOKA_DEFAULT_PREDICTION); defaultPreEditor = _scim_config->read(String(HONOKA_CONFIG_DEFAULT_PREEDITOR),String(HONOKA_DEFAULT_DEFAULT_PREEDITOR)); defaultConvertor = _scim_config->read(String(HONOKA_CONFIG_DEFAULT_CONVERTOR),String(HONOKA_DEFAULT_DEFAULT_CONVERTOR)); @@ -521,7 +519,7 @@ it = find(m_proplist.begin(),m_proplist.end(),HONOKA_PROP_MODESTATUS); if (it != m_proplist.end()) { if (m_conversion) it->set_label(_("Kanji")); - else if (m_yosoku) it->set_label(_("Yosoku")); + else if (m_prediction) it->set_label(_("Yosoku")); else it->set_label(m_preeditor->getModeName()); } update_property(*it); @@ -554,7 +552,7 @@ //if ((!m_conversion) && yosoku && m_convertor->isConnected() && (sType == "Wnn7") && // (!auto_conversion) && (m_convertor->getName() == "Wnn")) { // m_convList = m_convertor->getYosokuList(m_preeditor->getText()); - if ((!m_conversion) && yosoku && m_predictor->isConnected() && (!auto_conversion)) { + if ((!m_conversion) && prediction && m_predictor->isConnected() && (!auto_conversion)) { m_convList = m_predictor->getPredictionList(m_preeditor->getText()); if (m_convList.count()) { m_lookup_table.clear(); @@ -610,7 +608,7 @@ if (ke.mask & SCIM_KEY_NumLockMask) ke.mask -= SCIM_KEY_NumLockMask; // if (ke.mask & SCIM_KEY_ScrollLockMask) ke.mask -= SCIM_KEY_ScrollLockMask; if (m_conversion) return process_conversion_key_event(ke); - else if (m_yosoku) return process_yosoku_key_event(ke); + else if (m_prediction) return process_yosoku_key_event(ke); else return process_preedit_key_event(ke) ; } @@ -703,7 +701,7 @@ updatePreEditor(); return true; } else - if (k_select_yosoku.comp(key) && yosoku) { + if (k_select_yosoku.comp(key) && prediction) { if ((m_convList.kType == YOSOKU) && (m_convList.count())) { return process_yosoku_key_event(key); } @@ -872,7 +870,7 @@ alp_count = 1; return true; } else - if (k_conversion_rensou.comp(key) && ((sType == "Wnn7") || (sType == "Wnn8")) ) { + if (k_conversion_rensou.comp(key)) { m_convList = m_convertor->getResultList(m_convertor->getPos(),RENSOU); if (m_convList.count() == 0) return true; startLookup(); @@ -880,7 +878,7 @@ alp_count = 1; return true; } else - if (k_conversion_ikeiji.comp(key) && ((sType == "Wnn7") || (sType == "Wnn8")) ) { + if (k_conversion_ikeiji.comp(key)) { m_convList = m_convertor->getResultList(m_convertor->getPos(),IKEIJI); if (m_convList.count() == 0) return true; startLookup(); @@ -998,8 +996,8 @@ bool HonokaInstance::process_yosoku_key_event(const KeyEvent &key) { // ͽ¬������Υ������٥�Ƚ����� - if (!m_yosoku) { - m_yosoku = true; + if (!m_prediction) { + m_prediction = true; update_preedit_string(m_convList.kouho.at(m_convList.pos).kanji); update_preedit_caret(0); show_preedit_string(); @@ -1027,14 +1025,14 @@ return true; } else if (k_commit.comp(key)) { - m_yosoku = false; + m_prediction = false; commit_string(m_convList.kouho.at(m_convList.pos).kanji); m_preeditor->reset(); updatePreEditor(); return true; } else if (k_cancel.comp(key) || k_backspace.comp(key)) { - m_yosoku = false; + m_prediction = false; updatePreEditor(); return true; } @@ -1062,7 +1060,7 @@ } } */ - m_yosoku = false; + m_prediction = false; commit_string(m_convList.kouho.at(m_convList.pos).kanji); m_preeditor->reset(); updatePreEditor(); @@ -1090,9 +1088,9 @@ } else { update_preedit_string(m_convList.kouho.at(m_convList.pos).kanji); update_preedit_caret(0); - if (!m_yosoku) { + if (!m_prediction) { // �ޥ��������򤷤�����ͽ¬����⡼�ɤ������� - m_yosoku = true; + m_prediction = true; show_preedit_string(); updateProperty(); } diff --git a/honoka/src/honoka_imengine.h b/honoka/src/honoka_imengine.h index 0065ac6..41ce6ae 100644 --- a/honoka/src/honoka_imengine.h +++ b/honoka/src/honoka_imengine.h @@ -115,7 +115,7 @@ Convertor *m_def_convertor; Predictor *m_predictor; bool m_conversion; - bool m_yosoku; + bool m_prediction; bool m_lookup; ResultList m_convList; PropertyList m_proplist; @@ -123,7 +123,7 @@ int alp_count; bool numkeyselect; bool mini_status; - bool yosoku; + bool prediction; bool auto_conversion; String defaultPreEditor; String defaultConvertor; @@ -134,7 +134,6 @@ vector preeditors; vector convertors; vector predictors; - String sType; WideString yomi; stack preeditStack; Convertor *m_multi; diff --git a/honoka/src/honoka_imengine_setup.cpp b/honoka/src/honoka_imengine_setup.cpp index 194cfb8..8986678 100644 --- a/honoka/src/honoka_imengine_setup.cpp +++ b/honoka/src/honoka_imengine_setup.cpp @@ -35,6 +35,7 @@ #include #include #include "honoka_def.h" +#include "honoka_plugin_def.h" #ifdef HAVE_GETTEXT #include @@ -145,11 +146,11 @@ // Internal data declaration. //static bool __config_use_kana = false; -static String __config_server = HONOKA_DEFAULT_SERVER; -static String __config_wnn_rc = HONOKA_DEFAULT_RC; -static String __config_servertype = HONOKA_DEFAULT_SERVERTYPE; +static String __config_server = HONOKA_DEFAULT_JSERVER; +static String __config_wnn_rc = HONOKA_DEFAULT_WNNENVRC; +static String __config_servertype = HONOKA_DEFAULT_JSERVERTYPE; static String __config_preeditor = HONOKA_DEFAULT_DEFAULT_PREEDITOR; -static bool __config_yosoku = HONOKA_DEFAULT_YOSOKU; +static bool __config_yosoku = HONOKA_DEFAULT_WNNYOSOKU; static bool __config_numkeyselect = HONOKA_DEFAULT_NUMKEY_SELECT; static bool __config_autoconversion = HONOKA_DEFAULT_AUTO_CONVERSION; static int __config_alp = HONOKA_DEFAULT_ALP; @@ -936,13 +937,13 @@ // config->read (String (SCIM_CONFIG_IMENGINE_ANTHY_USE_KANA), // __config_use_kana); __config_server = - config->read (String (HONOKA_CONFIG_SERVER), + config->read (String (HONOKA_CONFIG_JSERVER), __config_server); __config_wnn_rc = - config->read (String (HONOKA_CONFIG_RC), + config->read (String (HONOKA_CONFIG_WNNENVRC), __config_wnn_rc); __config_servertype = - config->read (String (HONOKA_CONFIG_SERVERTYPE), + config->read (String (HONOKA_CONFIG_JSERVERTYPE), __config_servertype); __config_preeditor = config->read (String (HONOKA_CONFIG_DEFAULT_PREEDITOR), @@ -957,7 +958,7 @@ config->read (String (HONOKA_CONFIG_AUTO_CONVERSION), __config_autoconversion); __config_yosoku = - config->read (String (HONOKA_CONFIG_YOSOKU), + config->read (String (HONOKA_CONFIG_WNNYOSOKU), __config_yosoku); __config_romkan_table = config->read (String (HONOKA_CONFIG_ROMKAN_TABLE_FILE), @@ -983,11 +984,11 @@ if (!config.null ()) { // config->write (String (SCIM_CONFIG_IMENGINE_ANTHY_USE_KANA), // __config_use_kana); - config->write (String (HONOKA_CONFIG_SERVER), + config->write (String (HONOKA_CONFIG_JSERVER), __config_server); - config->write (String (HONOKA_CONFIG_RC), + config->write (String (HONOKA_CONFIG_WNNENVRC), __config_wnn_rc); - config->write (String (HONOKA_CONFIG_SERVERTYPE), + config->write (String (HONOKA_CONFIG_JSERVERTYPE), __config_servertype); config->write (String (HONOKA_CONFIG_DEFAULT_PREEDITOR), __config_preeditor); @@ -997,7 +998,7 @@ __config_numkeyselect); config->write (String (HONOKA_CONFIG_AUTO_CONVERSION), __config_autoconversion); - config->write (String (HONOKA_CONFIG_YOSOKU), + config->write (String (HONOKA_CONFIG_WNNYOSOKU), __config_yosoku); config->write (String (HONOKA_CONFIG_ROMKAN_TABLE_FILE), __config_romkan_table); diff --git a/honoka/src/honoka_plugin_def.h b/honoka/src/honoka_plugin_def.h new file mode 100644 index 0000000..f990ffa --- /dev/null +++ b/honoka/src/honoka_plugin_def.h @@ -0,0 +1,52 @@ +/*************************************************************************** + * 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 + +#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 + + +// Romkan + +#define HONOKA_CONFIG_ROMKAN_TABLE_FILE "/IMEngine/Honoka/Romkan/TableFile" +#define HONOKA_DEFAULT_ROMKAN_TABLE_FILE "honoka-def.rkt" + +// KanaInput +#define HONOKA_CONFIG_KANAINPUT_FAKEKANA "/IMEngine/Honoka/KanaInput/FakeKanaKey" +#define HONOKA_DEFAULT_KANAINPUT_FAKEKANA true + +#endif diff --git a/honoka/src/kanainput.cpp b/honoka/src/kanainput.cpp index 9c301fc..ee2e2b1 100644 --- a/honoka/src/kanainput.cpp +++ b/honoka/src/kanainput.cpp @@ -18,7 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "kanainput.h" -#include "honoka_def.h" +#include "honoka_plugin_def.h" #ifdef HAVE_CONFIG_H #include diff --git a/honoka/src/romkan.cpp b/honoka/src/romkan.cpp index 3ef3b18..138bb83 100644 --- a/honoka/src/romkan.cpp +++ b/honoka/src/romkan.cpp @@ -18,7 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "romkan.h" -#include "honoka_def.h" +#include "honoka_plugin_def.h" #ifdef HAVE_CONFIG_H #include diff --git a/honoka/src/skkdicconversion.cpp b/honoka/src/skkdicconversion.cpp index 120b85c..8d5409c 100644 --- a/honoka/src/skkdicconversion.cpp +++ b/honoka/src/skkdicconversion.cpp @@ -20,7 +20,7 @@ #include "skkdicconversion.h" -#include +#include #ifdef HAVE_CONFIG_H #include diff --git a/honoka/src/wnnconversion.cpp b/honoka/src/wnnconversion.cpp index bdac3ce..0b39667 100644 --- a/honoka/src/wnnconversion.cpp +++ b/honoka/src/wnnconversion.cpp @@ -20,7 +20,7 @@ #include "wnnconversion.h" -#include +#include #ifdef HAVE_CONFIG_H #include @@ -94,9 +94,9 @@ */ bool WnnConversion::connect() { - String host = config->read(String(HONOKA_CONFIG_SERVER),String(HONOKA_DEFAULT_SERVER)); - String rc = config->read(String(HONOKA_CONFIG_RC),String(HONOKA_DEFAULT_RC)); - String t = config->read(String(HONOKA_CONFIG_SERVERTYPE),String(HONOKA_DEFAULT_SERVERTYPE)); + 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; diff --git a/honoka/src/wnnplugin.cpp b/honoka/src/wnnplugin.cpp index 3583313..4accd15 100644 --- a/honoka/src/wnnplugin.cpp +++ b/honoka/src/wnnplugin.cpp @@ -27,8 +27,8 @@ predictor = 0; convertor = new WnnConversion(cfg); - bool yosoku = cfg->read(String(HONOKA_CONFIG_YOSOKU),HONOKA_DEFAULT_YOSOKU); - String sType = cfg->read(String(HONOKA_CONFIG_SERVERTYPE),String(HONOKA_DEFAULT_SERVERTYPE)); + 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); } diff --git a/honoka/src/wnnplugin.h b/honoka/src/wnnplugin.h index a357dde..c793f2f 100644 --- a/honoka/src/wnnplugin.h +++ b/honoka/src/wnnplugin.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include using namespace std; using namespace scim;