diff --git a/honoka/src/Makefile.am b/honoka/src/Makefile.am index dd379e0..839b584 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 + wnnconversion.h honoka_def.h kanainput.h anthyconversion.h multiconvertor.h skkdic.h \ + skkdicconversion.h honokamultiplepluginbase.h moduledir = @SCIM_MODULEDIR@/IMEngine module_LTLIBRARIES = honoka.la @@ -69,7 +69,7 @@ lib_LTLIBRARIES = libhonoka_plugin.la libhonoka_plugin_la_SOURCES = convertor.cpp honokapluginbase.cpp preeditor.cpp \ - honokakeyeventlist.cpp + honokakeyeventlist.cpp honokamultiplepluginbase.cpp libhonoka_plugin_la_CFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ libhonoka_plugin_la_CXXFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ libhonoka_plugin_la_LDFLAGS = @LIBTOOL_EXPORT_OPTIONS@ @INTLLIBS@ @SCIM_LIBS@ diff --git a/honoka/src/honoka_imengine.cpp b/honoka/src/honoka_imengine.cpp index 34546e8..ac2e972 100644 --- a/honoka/src/honoka_imengine.cpp +++ b/honoka/src/honoka_imengine.cpp @@ -202,22 +202,17 @@ if (pluginNameList.find(p->getName()) != pluginNameList.end()) { deleteInstance(p); dlclose(plugin); - } else - // Convertor�ξ�硣 - if (p->getPluginType() == "Convertor") { - convertors.push_back(static_cast(p)); - //plugins.insert(pair(p->getName(),pe)); + } else + if (p->getPluginType() == "Multiple") { plugins.push_back(pe); pluginNameList.insert(p->getName()); + for(unsigned int i = 0;i < static_cast(p)->getPluginCount();i++) + pluginCheck(static_cast(p)->getPluginInstanceAt(i)); } else - // PreEditor�ξ�硣 - if (p->getPluginType() == "PreEditor") { - preeditors.push_back(static_cast(p)); - //plugins.insert(pair(p->getName(),pe)); + if (pluginCheck(p)) { plugins.push_back(pe); pluginNameList.insert(p->getName()); } else { - // �ɤ���Ǥ�ʤ���Сġ� deleteInstance(p); dlclose(plugin); } @@ -240,6 +235,20 @@ // ������ء� init(); } +bool HonokaInstance::pluginCheck(HonokaPluginBase *p) { + + // Convertor�ξ�硣 + if (p->getPluginType() == "Convertor") { + convertors.push_back(static_cast(p)); + return true; + } else + // PreEditor�ξ�硣 + if (p->getPluginType() == "PreEditor") { + preeditors.push_back(static_cast(p)); + return true; + } + return false; +} HonokaInstance::~HonokaInstance() { diff --git a/honoka/src/honoka_imengine.h b/honoka/src/honoka_imengine.h index 9b7b62a..e956201 100644 --- a/honoka/src/honoka_imengine.h +++ b/honoka/src/honoka_imengine.h @@ -40,6 +40,7 @@ #include #include #include +#include #include #define Uses_SCIM_ICONV #include @@ -145,7 +146,7 @@ void changePreEditor(const String &name); void changeConvertor(const String &name); void autoConversion(); - + bool pluginCheck(HonokaPluginBase *p); private: HonokaKeyEventList k_conversion_start, // �Ѵ����� diff --git a/honoka/src/honokamultiplepluginbase.cpp b/honoka/src/honokamultiplepluginbase.cpp new file mode 100644 index 0000000..2d77fb3 --- /dev/null +++ b/honoka/src/honokamultiplepluginbase.cpp @@ -0,0 +1,51 @@ +/*************************************************************************** + * 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 "honokamultiplepluginbase.h" + +HonokaMultiplePluginBase::HonokaMultiplePluginBase(ConfigPointer cfg) : HonokaPluginBase(String("Multiple")) +{ + config = cfg; +} + + +HonokaMultiplePluginBase::~HonokaMultiplePluginBase() +{ +} + + + + +/*! + \fn HonokaMultiplePluginBase::getPluginInstanceAt(int p) + */ +HonokaPluginBase * HonokaMultiplePluginBase::getPluginInstanceAt(int p) +{ + return 0; +} + + +/*! + \fn HonokaMultiplePluginBase::getPluginCount() + */ +int HonokaMultiplePluginBase::getPluginCount() +{ + return 0; +} diff --git a/honoka/src/honokamultiplepluginbase.h b/honoka/src/honokamultiplepluginbase.h new file mode 100644 index 0000000..6c8c6d2 --- /dev/null +++ b/honoka/src/honokamultiplepluginbase.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 HONOKAMULTIPLEPLUGINBASE_H +#define HONOKAMULTIPLEPLUGINBASE_H + +#include + +#include +#include +#include +#include +#include + + +using namespace std; +using namespace scim; + + +/** +@author TAM (Teppei Tamra) +*/ +class HonokaMultiplePluginBase : public HonokaPluginBase { +public: + HonokaMultiplePluginBase(ConfigPointer cfg); + + ~HonokaMultiplePluginBase(); + virtual HonokaPluginBase * getPluginInstanceAt(int p); + virtual int getPluginCount(); + +protected: + ConfigPointer config; +}; + +#endif