diff --git a/honoka/src/Makefile.am b/honoka/src/Makefile.am index ec59255..b9724af 100644 --- a/honoka/src/Makefile.am +++ b/honoka/src/Makefile.am @@ -27,7 +27,7 @@ -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 + wnnconversion.h honoka_def.h kanainput.h anthyconversion.h honokakeyeventlist.h moduledir = @SCIM_MODULEDIR@/IMEngine module_LTLIBRARIES = honoka.la @@ -67,7 +67,8 @@ libhonokainclude_HEADERS = convertor.h preeditor.h honokapluginbase.h lib_LTLIBRARIES = libhonoka_plugin.la -libhonoka_plugin_la_SOURCES = convertor.cpp honokapluginbase.cpp preeditor.cpp +libhonoka_plugin_la_SOURCES = convertor.cpp honokapluginbase.cpp preeditor.cpp \ + honokakeyeventlist.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 cbc7db2..4a947ee 100644 --- a/honoka/src/honoka_imengine.cpp +++ b/honoka/src/honoka_imengine.cpp @@ -155,33 +155,6 @@ -// �������٥�ȥ����å� - -void HonokaKeyEventList::append(const KeyEvent &k) { - push_back(k); -} - -void HonokaKeyEventList::append(int code,int mask) { - KeyEvent k; - k.code = code; - k.mask = mask; - append(k); -} - -bool HonokaKeyEventList::comp(const KeyEvent &k) { - int kc = k.get_ascii_code(); - if ((kc > 0x60) && (kc < 0x7b)) kc -= 0x20; - else if ((kc > 0x40) && (kc < 0x5b)) kc += 0x20; - for (unsigned int i = 0;i < size();i ++) { - if ((at(i).code == k.code) && (at(i).mask == k.mask)) { - return true; - } - if (kc && (at(i).code == kc) && (at(i).mask == k.mask)) { - return true; - } - } - return false; -} // ��ʪ�� diff --git a/honoka/src/honoka_imengine.h b/honoka/src/honoka_imengine.h index c2cef79..c662025 100644 --- a/honoka/src/honoka_imengine.h +++ b/honoka/src/honoka_imengine.h @@ -33,6 +33,7 @@ #include #include #include +#include #define Uses_SCIM_ICONV #include #include @@ -64,15 +65,6 @@ }; -class HonokaKeyEventList : public KeyEventList -{ - // �ꥹ�Ȥ˥������٥�Ȥ��ɲä��ơ�comp(KeyEvent)��Ƚ�̡� -public: - void append(const KeyEvent &k); - void append(int code,int mask); - bool comp(const KeyEvent &k); -}; - class HonokaPluginEntry { public: diff --git a/honoka/src/honokakeyeventlist.cpp b/honoka/src/honokakeyeventlist.cpp new file mode 100644 index 0000000..0ebb334 --- /dev/null +++ b/honoka/src/honokakeyeventlist.cpp @@ -0,0 +1,50 @@ +/*************************************************************************** + * 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 "honokakeyeventlist.h" + + +void HonokaKeyEventList::append(const KeyEvent &k) { + push_back(k); +} + +void HonokaKeyEventList::append(int code,int mask) { + KeyEvent k; + k.code = code; + k.mask = mask; + append(k); +} + +bool HonokaKeyEventList::comp(const KeyEvent &k) { + int kc = k.get_ascii_code(); + if ((kc > 0x60) && (kc < 0x7b)) kc -= 0x20; + else if ((kc > 0x40) && (kc < 0x5b)) kc += 0x20; + for (unsigned int i = 0;i < size();i ++) { + if ((at(i).code == k.code) && (at(i).mask == k.mask)) { + return true; + } + if (kc && (at(i).code == kc) && (at(i).mask == k.mask)) { + return true; + } + } + return false; +} + + diff --git a/honoka/src/honokakeyeventlist.h b/honoka/src/honokakeyeventlist.h new file mode 100644 index 0000000..dcdb516 --- /dev/null +++ b/honoka/src/honokakeyeventlist.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * 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 HONOKAKEYEVENTLIST_H +#define HONOKAKEYEVENTLIST_H + +#include +#include +#include +#include +#include + +using namespace scim; +using namespace std; + + +/** +@author TAM (Teppei Tamra) +*/ +class HonokaKeyEventList : public KeyEventList +{ +public: + void append(const KeyEvent &k); + void append(int code,int mask); + bool comp(const KeyEvent &k); + +}; + +#endif diff --git a/honoka/src/preeditor.cpp b/honoka/src/preeditor.cpp index 9d63af8..04f0099 100644 --- a/honoka/src/preeditor.cpp +++ b/honoka/src/preeditor.cpp @@ -19,31 +19,6 @@ ***************************************************************************/ #include "preeditor.h" -void PreEditorKeyEventList::append(const KeyEvent &k) { - push_back(k); -} - -void PreEditorKeyEventList::append(int code,int mask) { - KeyEvent k; - k.code = code; - k.mask = mask; - append(k); -} - -bool PreEditorKeyEventList::comp(const KeyEvent &k) { - int kc = k.get_ascii_code(); - if ((kc > 0x60) && (kc < 0x7b)) kc -= 0x20; - else if ((kc > 0x40) && (kc < 0x5b)) kc += 0x20; - for (unsigned int i = 0;i < size();i ++) { - if ((at(i).code == k.code) && (at(i).mask == k.mask)) { - return true; - } - if (kc && (at(i).code == kc) && (at(i).mask == k.mask)) { - return true; - } - } - return false; -} PreEditor::PreEditor(ConfigPointer cfg) : HonokaPluginBase(String("PreEditor")) { diff --git a/honoka/src/preeditor.h b/honoka/src/preeditor.h index 23e5fab..0481b92 100644 --- a/honoka/src/preeditor.h +++ b/honoka/src/preeditor.h @@ -21,6 +21,7 @@ #define PREEDITOR_H #include +#include #define Uses_SCIM_ICONV #define Uses_SCIM_CONFIG_BASE @@ -53,14 +54,6 @@ /** @author TAM(Teppei Tamra) */ -class PreEditorKeyEventList : public KeyEventList -{ - // �ꥹ�Ȥ˥������٥�Ȥ��ɲä��ơ�comp(KeyEvent)��Ƚ�̡� -public: - void append(const KeyEvent &k); - void append(int code,int mask); - bool comp(const KeyEvent &k); -}; class PreEditor : public HonokaPluginBase { public: diff --git a/honoka/src/romkan.h b/honoka/src/romkan.h index 535b131..f107c56 100644 --- a/honoka/src/romkan.h +++ b/honoka/src/romkan.h @@ -41,7 +41,7 @@ WideString kana; }; -class RomkanKeyEventList : public PreEditorKeyEventList +class RomkanKeyEventList : public HonokaKeyEventList { public: WideString p; @@ -88,7 +88,7 @@ bool nnMode; bool asciiCancel; bool removeRemainder; - PreEditorKeyEventList key_ascii_mode,key_wascii_mode,key_toggle_hw,key_toggle_hk; + HonokaKeyEventList key_ascii_mode,key_wascii_mode,key_toggle_hw,key_toggle_hk; map RomkanTable; set keepTable; map tableConfig;