diff --git a/honoka/plugins/Makefile.am b/honoka/plugins/Makefile.am index 5fe8b12..6896690 100644 --- a/honoka/plugins/Makefile.am +++ b/honoka/plugins/Makefile.am @@ -27,7 +27,7 @@ -DHONOKA_PLUGINDIR=\"@SCIM_MODULEDIR@/honoka\" noinst_HEADERS = wnnproto.h romkan.h wnnconversion.h kanainput.h \ - anthyconversion.h skkdic.h skkdicconversion.h wnnplugin.h wnnprediction.h \ + anthyplugin.h anthyconversion.h skkdic.h skkdicconversion.h wnnplugin.h wnnprediction.h \ honoka_plugin_def.h simpleprediction.h cannaconversion.h primeprediction.h moduledir = @SCIM_MODULEDIR@/IMEngine @@ -48,7 +48,7 @@ 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_anthy_la_SOURCES = anthyconversion.cpp +plugin_anthy_la_SOURCES = anthyplugin.cpp anthyconversion.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@ diff --git a/honoka/plugins/anthyconversion.cpp b/honoka/plugins/anthyconversion.cpp index 1426afb..a0a24ae 100644 --- a/honoka/plugins/anthyconversion.cpp +++ b/honoka/plugins/anthyconversion.cpp @@ -36,7 +36,7 @@ #endif // �ץ饤�����󲽤Τ��ޤ��ʤ��Ǥ��� -HonokaPluginRegister(AnthyConversion); +//HonokaPluginRegister(AnthyConversion); AnthyConversion::AnthyConversion(ConfigPointer cfg) : Convertor(cfg) @@ -57,9 +57,10 @@ } void AnthyConversion::reset(){ - anthy_release_context(context); - anthy_init(); - context = anthy_create_context(); + //anthy_release_context(context); + //anthy_init(); + //context = anthy_create_context(); + anthy_reset_context(context); return; } diff --git a/honoka/plugins/anthyplugin.cpp b/honoka/plugins/anthyplugin.cpp new file mode 100644 index 0000000..59a66ad --- /dev/null +++ b/honoka/plugins/anthyplugin.cpp @@ -0,0 +1,65 @@ +/*************************************************************************** + * 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" + +HonokaPluginRegister(AnthyPlugin); + +AnthyPlugin::AnthyPlugin(ConfigPointer cfg) : HonokaMultiplePluginBase(cfg) +{ + predictor = 0; + convertor = new AnthyConversion(cfg); +} + + +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 new file mode 100644 index 0000000..30ba6be --- /dev/null +++ b/honoka/plugins/anthyplugin.h @@ -0,0 +1,59 @@ +/*************************************************************************** + * 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) +*/ +class AnthyPlugin; + +class AnthyPlugin : public HonokaMultiplePluginBase { +public: + AnthyPlugin(ConfigPointer cfg); + + ~AnthyPlugin(); + virtual HonokaPluginBase * getPluginInstanceAt(int p); + virtual int getPluginCount(); + virtual String getName(); + +protected: + AnthyConversion * convertor; + Predictor * predictor; +}; + +#endif