fcitx / fcitx-handwriting Goto Github PK
View Code? Open in Web Editor NEWHandwriting Support for Fcitx, using Zinnia.
Home Page: http://code.google.com/p/fcitx-handwriting
License: GNU General Public License v3.0
Handwriting Support for Fcitx, using Zinnia.
Home Page: http://code.google.com/p/fcitx-handwriting
License: GNU General Public License v3.0
Fcitx 4 is under maintainence Mode now, so no new issue and PR should be created. Please give fcitx 5 a try if possible. If you're experiencing problem, you can reach out mail list (fcitx[at]googlegroups.com) or IRC (fcitx[at]freenode) for help. Please read http://fcitx-im.org for further help. See COPYING and COPYING.LIBS for License information.
我发现 手写输入 的版本很老了,与 fcitx 4.2.6.1 不兼容。
我用 RHEL 6.4 ,好像只能用到 4.2.6.1 版本,再高就会编译错误。
我对 handwriting 做了一个补丁,使之可以在 4.2.6.1 上手写输入。
但是依然有一个bug,手写输入窗口不能自动关闭,一旦关闭后,也不能自动打开。希望提供一个 solution
下面是我做的补丁
diff -urN fcitx-handwriting-20110908/im/CMakeLists.txt fcitx-handwriting-20110908.new/im/CMakeLists.txt
--- fcitx-handwriting-20110908/im/CMakeLists.txt 2013-08-28 13:48:26.714595086 +0800
+++ fcitx-handwriting-20110908.new/im/CMakeLists.txt 2013-08-28 13:47:25.700113492 +0800
@@ -23,3 +23,4 @@
${FCITX4_FCITX_UTILS_LIBRARIES}
)
fcitx_add_addon_conf_file(fcitx-handwriting.conf)
+fcitx_add_inputmethod_conf_file(handwriting.conf)
diff -urN fcitx-handwriting-20110908/im/fcitx-handwriting.conf.in fcitx-handwriting-20110908.new/im/fcitx-handwriting.conf.in
--- fcitx-handwriting-20110908/im/fcitx-handwriting.conf.in 2013-08-28 13:48:26.718595182 +0800
+++ fcitx-handwriting-20110908.new/im/fcitx-handwriting.conf.in 2013-08-28 13:43:05.855813046 +0800
@@ -8,3 +8,4 @@
Type=SharedLibrary
Dependency=fcitx-dbus
SubConfig=
+IMRegisterMethod=ConfigFile
diff -urN fcitx-handwriting-20110908/im/handwriting.c fcitx-handwriting-20110908.new/im/handwriting.c
--- fcitx-handwriting-20110908/im/handwriting.c 2013-08-28 13:48:26.721595256 +0800
+++ fcitx-handwriting-20110908.new/im/handwriting.c 2013-08-28 13:25:06.731827820 +0800
@@ -6,9 +6,12 @@
#include <fcitx/instance.h>
#include <fcitx/module.h>
#include <fcitx/candidate.h>
+#include <dbus/dbus.h>
#define _(x) gettext(x)
+FCITX_EXPORT_API int ABI_VERSION = FCITX_ABI_VERSION;
+
static void* HandWritingCreate ( FcitxInstance* instance );
static void HandWritingDestroy ( void *arg );
@@ -16,7 +19,7 @@
INPUT_RETURN_VALUE HandWritingDoInput ( void* arg, FcitxKeySym sym, unsigned int state );
INPUT_RETURN_VALUE HandWritingGetCandWords ( void *arg );
void HandWritingResetIM ( void *arg );
-INPUT_RETURN_VALUE HandWritingGetCandWord ( void *arg, CandidateWord* candWord );
+INPUT_RETURN_VALUE HandWritingGetCandWord ( void *arg, FcitxCandidateWord* candWord );
void HandWritingSave ( void *arg );
void HandWritingReloadConfig ( void *arg );
DBusHandlerResult HandWritingDBusFilter ( DBusConnection* connection, DBusMessage* msg, void* user_data );
@@ -37,7 +40,7 @@
void* HandWritingCreate ( FcitxInstance* instance )
{
- FcitxHandWriting* handwriting = fcitx_malloc0 ( sizeof ( FcitxHandWriting ) );
+ FcitxHandWriting* handwriting = fcitx_utils_malloc0 ( sizeof ( FcitxHandWriting ) );
FcitxModuleFunctionArg arg;
handwriting->owner = instance;
handwriting->conn = InvokeFunction ( instance, FCITX_DBUS, GETCONNECTION, arg );
@@ -80,9 +83,10 @@
return NULL;
}
- FcitxRegisterIM (
+ FcitxInstanceRegisterIM (
instance,
handwriting,
+ "handwriting",
_ ( "HandWriting" ),
"handwriting",
HandWritingInit,
@@ -93,7 +97,8 @@
HandWritingSave,
HandWritingReloadConfig,
NULL,
- 99
+ 99,
+ "zh_CN"
);
dbus_error_free ( &err );
@@ -115,7 +120,7 @@
return IRV_TO_PROCESS;
}
-INPUT_RETURN_VALUE HandWritingGetCandWord ( void* arg, CandidateWord* candWord )
+INPUT_RETURN_VALUE HandWritingGetCandWord ( void* arg, FcitxCandidateWord* candWord )
{
return IRV_TO_PROCESS;
}
@@ -150,7 +155,7 @@
{
if ( dbus_message_get_args ( msg, &error, DBUS_TYPE_STRING, &s0 ,DBUS_TYPE_INVALID ) )
{
- CommitString ( handwriting->owner, GetCurrentIC ( handwriting->owner ), s0 );
+ FcitxInstanceCommitString ( handwriting->owner, FcitxInstanceGetCurrentIC ( handwriting->owner ), s0 );
}
return DBUS_HANDLER_RESULT_HANDLED;
}
diff -urN fcitx-handwriting-20110908/im/handwriting.conf.in fcitx-handwriting-20110908.new/im/handwriting.conf.in
--- fcitx-handwriting-20110908/im/handwriting.conf.in 1970-01-01 08:00:00.000000000 +0800
+++ fcitx-handwriting-20110908.new/im/handwriting.conf.in 2013-08-28 13:46:08.436238489 +0800
@@ -0,0 +1,9 @@
+[InputMethod]
+UniqueName=handwriting
+Name=Hand Writing
+Name[zh_CN]=手写
+Name[zh_TW]=手写
+IconName=handwriting
+Priority=5
+LangCode=zh_CN
+Parent=fcitx-handwriting
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.