diff --git a/scim-wnn/configure.ac b/scim-wnn/configure.ac index 4bef34c..595b6c8 100644 --- a/scim-wnn/configure.ac +++ b/scim-wnn/configure.ac @@ -22,7 +22,7 @@ AM_CONFIG_HEADER([config.h]) # Init gettext -ALL_LINGUAS="de ja ko zh_CN" +ALL_LINGUAS="ja" AM_GNU_GETTEXT GETTEXT_PACKAGE=scim-wnn diff --git a/scim-wnn/m4/Makefile.in b/scim-wnn/m4/Makefile.in index 5127fb3..350821e 100644 --- a/scim-wnn/m4/Makefile.in +++ b/scim-wnn/m4/Makefile.in @@ -65,11 +65,45 @@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ +AMTAR = @AMTAR@ +AS = @AS@ +AWK = @AWK@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATOBJEXT = @CATOBJEXT@ CC = @CC@ CXX = @CXX@ +DATADIRNAME = @DATADIRNAME@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +GENCAT = @GENCAT@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIBC21 = @GLIBC21@ +GMSGFMT = @GMSGFMT@ +HAVE_LIB = @HAVE_LIB@ +INCLTDL = @INCLTDL@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLBISON = @INTLBISON@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ +LIB = @LIB@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LN_S = @LN_S@ +LTLIB = @LTLIB@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +OBJDUMP = @OBJDUMP@ +PACKAGE = @PACKAGE@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ RANLIB = @RANLIB@ SCIM_BUILD_SETUP = @SCIM_BUILD_SETUP@ SCIM_DEBUG_FLAGS = @SCIM_DEBUG_FLAGS@ @@ -80,7 +114,14 @@ SCIM_WNN_MICRO_VERSION = @SCIM_WNN_MICRO_VERSION@ SCIM_WNN_MINOR_VERSION = @SCIM_WNN_MINOR_VERSION@ SCIM_WNN_VERSION = @SCIM_WNN_VERSION@ +STRIP = @STRIP@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ EXTRA_DIST = codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 subdir = m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/scim-wnn/po/ja.po b/scim-wnn/po/ja.po new file mode 100644 index 0000000..11c256c --- /dev/null +++ b/scim-wnn/po/ja.po @@ -0,0 +1,39 @@ +# translation of ja.po to Japanese +# Copyright (C) 2004 Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# TAM (Teppei Tamra) , 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: ja\n" +"POT-Creation-Date: 2004-11-13 03:31+0900\n" +"PO-Revision-Date: 2004-11-13 03:36+0900\n" +"Last-Translator: TAM (Teppei Tamra) \n" +"Language-Team: Japanese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.9.1\n" + +#: src/scim_wnn_imengine.cpp:89 +msgid "WNN" +msgstr "WNN" + +#: src/scim_wnn_imengine.cpp:96 +msgid "Wnn" +msgstr "" + +#: src/scim_wnn_imengine.cpp:111 +msgid "ja_JP" +msgstr "" + +#. AUTHER͡ +#: src/scim_wnn_imengine.cpp:125 +msgid "(C) 2004 TAM(Teppei Tamra) " +msgstr "" + +#. HELP�ʤȥ%�Τ͡ +#: src/scim_wnn_imengine.cpp:137 +msgid "SCIM-WNN HELP" +msgstr "" + diff --git a/scim-wnn/po/scim-wnn.pot b/scim-wnn/po/scim-wnn.pot new file mode 100644 index 0000000..8ebd35b --- /dev/null +++ b/scim-wnn/po/scim-wnn.pot @@ -0,0 +1,38 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2004-11-13 03:31+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/scim_wnn_imengine.cpp:89 +msgid "WNN" +msgstr "" + +#: src/scim_wnn_imengine.cpp:96 +msgid "Wnn" +msgstr "" + +#: src/scim_wnn_imengine.cpp:111 +msgid "ja_JP" +msgstr "" + +#. AUTHER�͡� +#: src/scim_wnn_imengine.cpp:125 +msgid "(C) 2004 TAM(Teppei Tamra) " +msgstr "" + +#. HELP��񤫤ʤ��ȥ���ʤΤ͡� +#: src/scim_wnn_imengine.cpp:137 +msgid "SCIM-WNN HELP" +msgstr "" diff --git a/scim-wnn/src/Makefile.am b/scim-wnn/src/Makefile.am index 453ab8b..d73f72c 100644 --- a/scim-wnn/src/Makefile.am +++ b/scim-wnn/src/Makefile.am @@ -24,12 +24,12 @@ -DSCIM_HANGUL_LOCALEDIR=\"$(datadir)/locale\" \ -DSCIM_HANGUL_ICON_FILE=\"@SCIM_ICONDIR@/scim-hangul.png\" -noinst_HEADERS = scim_wnn_imengine.h +noinst_HEADERS = scim_wnn_imengine.h moduledir = @SCIM_MODULEDIR@/IMEngine module_LTLIBRARIES = wnn.la -wnn_la_SOURCES = scim_wnn_imengine.cpp +wnn_la_SOURCES = scim_wnn_imengine.cpp wnn_la_CFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ wnn_la_CXXFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ diff --git a/scim-wnn/src/scim_wnn_imengine.cpp b/scim-wnn/src/scim_wnn_imengine.cpp index e69de29..207a418 100644 --- a/scim-wnn/src/scim_wnn_imengine.cpp +++ b/scim-wnn/src/scim_wnn_imengine.cpp @@ -0,0 +1,220 @@ +/*************************************************************************** + * 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. * + ***************************************************************************/ + +// �äƸ��������Wnn��C++������ͥ������߹�����Τ褦�ʥ饤�֥��㤷����˾�� +// ���������Ǥ��͡��֤��������פǤ���͡� + +#define Uses_SCIM_UTILITY +#define Uses_SCIM_IMENGINE +#define Uses_SCIM_LOOKUP_TABLE +#define Uses_SCIM_CONFIG_BASE + +#ifdef HAVE_CONFIG_H + #include +#endif + +// ��ݲ��Τ��ޤ��ʤ��� +// �ޤ����Ԥ���碌�Ƥ�館�С���������ɤ��ˤ����ʤ��㤤���ʤ��äġ��Τ� +// �ɤ��ʤ�Ǥ��礦�ʤ��ġ� +// KDE�ʤ����Ф�����ʬ�Ǥ����������� +#ifdef HAVE_GETTEXT + #include + #define _(String) dgettext(GETTEXT_PACKAGE,String) + #define N_(String) (String) +#else + #define _(String) (String) + #define N_(String) (String) + #define bindtextdomain(Package,Directory) + #define textdomain(domain) + #define bind_textdomain_codeset(domain,codeset) +#endif + +// scim�Τ��ޤ��ʤ��� +// ����Ǹ����С����ɤ�s +#include +#include "scim_wnn_imengine.h" + +#define scim_module_init wnn_LTX_scim_module_init +#define scim_module_exit wnn_LTX_scim_module_exit +#define scim_imengine_module_init wnn_LTX_scim_imengine_module_init +#define scim_imengine_module_create_factory wnn_LTX_scim_imengine_module_create_factory +#define SCIM_WNN_ICON_FILE (SCIM_ICONDIR "/scim-wnn.png") + +static Pointer _scim_wnn_factory; +static ConfigPointer _scim_config; + +extern "C" { + // ����Ǥ��礦�� + // KDE�ʤ󤫤Ǥ�Ȥ��Ƥ�ưŪ���ǥ��󥰤ξ����� + // C��󥱡����Ǵؿ�̾���ꤵ���ơ����ä��饤�󥹥��󥹺��äġ����졣 + // ���ݤ���ͤ����ޤ��̤��ɤ����ɤ��� + void scim_module_init (void) + { + } + + void scim_module_exit (void) + { + _scim_wnn_factory.reset (); + _scim_config.reset (); + } + + unsigned int scim_imengine_module_init (const ConfigPointer &config) + { + _scim_config = config; + return 1; + } + + IMEngineFactoryPointer scim_imengine_module_create_factory (unsigned int factory) + { + if (factory != 0) return NULL; + if (_scim_wnn_factory.null ()) { + _scim_wnn_factory = + new WnnFactory (utf8_mbstowcs (String (_("WNN"))),String("ja_JP")); + } + return _scim_wnn_factory; + } +} + +WnnFactory::WnnFactory() { + m_name = utf8_mbstowcs(_("Wnn")); + set_languages(String("ja_JP")); +} + +WnnFactory::~ WnnFactory() { +} + +WnnFactory::WnnFactory(const WideString & name, const String & languages) { + // ʸ�������¤��� + if (name.length () <= 8) + m_name = name; + else + m_name.assign (name.begin (), name.begin () + 8); + // �Ȥꤢ�������ܸ�Ķ��Ǹ��ꤷ�����ȥ����� + if (languages == String ("default")) + set_languages (String (_("ja_JP"))); + else + set_languages (languages); +} + +WideString WnnFactory::get_name () const +{ + // ̾�����֤��Τ͡�utf8_mbstowcs(_("Wnn"))�ǡ� + return m_name; +} + +WideString WnnFactory::get_authors () const +{ + // AUTHER�͡� + return utf8_mbstowcs (String (_("(C) 2004 TAM(Teppei Tamra) "))); +} + +WideString WnnFactory::get_credits () const +{ + // CREDIT�͡��Ȥꤢ�������ǡ� + return WideString (); +} + +WideString WnnFactory::get_help () const +{ + // HELP��񤫤ʤ��ȥ���ʤΤ͡� + return utf8_mbstowcs (String (_("SCIM-WNN HELP"))); +} + +String WnnFactory::get_uuid () const +{ + // uuidgená���Ƽ��̤ȡ���ˡ����ʤ�ʤ�Ǥ�褵�������ɤ⡣ + return String ("c069395a-d62f-4a77-8229-446e44a99976"); +} + +String WnnFactory::get_icon_file () const +{ + // �����������ꡣ���ʤ��Ȥ͡� + return String (SCIM_WNN_ICON_FILE); +} + +String WnnFactory::get_language () const +{ + // ͭ��locale?���Ȥꤢ�������ܸ�˸��ꤷ�Ȥ������� + return scim_validate_language ("ja_JP"); +} + +IMEngineInstancePointer WnnFactory::create_instance (const String& encoding, int id) +{ + // �ºݤ˥��󥹥��󥹤��롣 + return new WnnInstance (this, encoding, id); +} + + +// �� �� ý �� +// ��ʪ�� + + +WnnInstance::WnnInstance (WnnFactory *factory, const String& encoding, int id) + : IMEngineInstanceBase (factory, encoding, id) +{ +} + +WnnInstance::~ WnnInstance() +{ +} + +bool WnnInstance::process_key_event (const KeyEvent& key) +{ +} + +void WnnInstance::move_preedit_caret (unsigned int pos) +{ +} + +void WnnInstance::select_candidate (unsigned int item) +{ +} + +void WnnInstance::update_lookup_table_page_size (unsigned int page_size) +{ +} + +void WnnInstance::lookup_table_page_up () +{ +} + +void WnnInstance::lookup_table_page_down () +{ +} + +void WnnInstance::reset () +{ +} + +void WnnInstance::focus_in () +{ +} + +void WnnInstance::focus_out () +{ +} + +void WnnInstance::trigger_property (const String &property) +{ +} + + + + diff --git a/scim-wnn/src/scim_wnn_imengine.h b/scim-wnn/src/scim_wnn_imengine.h index e69de29..88223b7 100644 --- a/scim-wnn/src/scim_wnn_imengine.h +++ b/scim-wnn/src/scim_wnn_imengine.h @@ -0,0 +1,65 @@ +/*************************************************************************** + * 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 SCIMSCIM_WNN_IMENGINE_H +#define SCIMSCIM_WNN_IMENGINE_H + +using namespace scim; + +class WnnFactory : public IMEngineFactoryBase +{ +protected: + friend class WnnInstance; + WideString m_name; +public: + WnnFactory (); + WnnFactory (const WideString & name, const String & languages); + virtual ~WnnFactory (); + virtual WideString get_name () const; + virtual WideString get_authors () const; + virtual WideString get_credits () const; + virtual WideString get_help () const; + virtual String get_uuid () const; + virtual String get_icon_file () const; + virtual String get_language() const; + virtual IMEngineInstancePointer create_instance (const String& encoding, int id = -1); + +}; + + +class WnnInstance : public IMEngineInstanceBase +{ +public: + WnnInstance (WnnFactory *factory, const String &encoding, int id = -1); + virtual ~WnnInstance (); + virtual bool process_key_event (const KeyEvent& key); + virtual void move_preedit_caret (unsigned int pos); + virtual void select_candidate (unsigned int item); + virtual void update_lookup_table_page_size (unsigned int page_size); + virtual void lookup_table_page_up (); + virtual void lookup_table_page_down (); + virtual void reset (); + virtual void focus_in (); + virtual void focus_out (); + virtual void trigger_property (const String &property); + +}; + + +#endif \ No newline at end of file