diff --git a/honoka/m4/Makefile b/honoka/m4/Makefile index f0dfcfa..3d8bcd3 100644 --- a/honoka/m4/Makefile +++ b/honoka/m4/Makefile @@ -132,7 +132,7 @@ LIBICONV = LIBINTL = LIBOBJS = -LIBS = -ldl +LIBS = LIBTOOL = $(SHELL) $(top_builddir)/libtool LIBTOOL_DEPS = ./ltmain.sh LN_S = ln -s diff --git a/honoka/plugins/cannaconversion.cpp b/honoka/plugins/cannaconversion.cpp index beb64ee..b011a6d 100644 --- a/honoka/plugins/cannaconversion.cpp +++ b/honoka/plugins/cannaconversion.cpp @@ -46,8 +46,10 @@ pos = 0; String dhdp = cfg->read(HONOKA_CONFIG_CANNA_DICHOMEDIRPATH,String(HONOKA_DEFAULT_CANNA_DICHOMEDIRPATH)); - RkInitialize((char *)dhdp.c_str()); 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; } @@ -148,6 +150,15 @@ } 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) { diff --git a/honoka/plugins/cannaconversion.h b/honoka/plugins/cannaconversion.h index 6795c5b..274e296 100644 --- a/honoka/plugins/cannaconversion.h +++ b/honoka/plugins/cannaconversion.h @@ -22,6 +22,7 @@ #define Uses_SCIM_CONFIG_BASE #include +#include #include #include @@ -71,6 +72,7 @@ WideString yomiText; vector convResult; int pos; + String host; }; diff --git a/honoka/plugins/honoka_plugin_def.h b/honoka/plugins/honoka_plugin_def.h index 0511e64..38a3715 100644 --- a/honoka/plugins/honoka_plugin_def.h +++ b/honoka/plugins/honoka_plugin_def.h @@ -58,6 +58,8 @@ #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" // SKKDic #define HONOKA_CONFIG_SKKDIC_DICFILE "/IMEngine/Honoka/SKKDic/File" diff --git a/honoka/src/honoka_imengine_setup.cpp b/honoka/src/honoka_imengine_setup.cpp index 75aa5b4..67f625a 100644 --- a/honoka/src/honoka_imengine_setup.cpp +++ b/honoka/src/honoka_imengine_setup.cpp @@ -465,6 +465,12 @@ _("if you use this plugin, check this."), true )); + 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,