[uim-commit] r1078 - in branches/r5rs: . scm uim xim
tkng at freedesktop.org
tkng at freedesktop.org
Sun Jul 31 14:53:42 EST 2005
Author: tkng
Date: 2005-07-30 21:53:40 -0700 (Sat, 30 Jul 2005)
New Revision: 1078
Modified:
branches/r5rs/
branches/r5rs/scm/anthy.scm
branches/r5rs/scm/japanese-kana.scm
branches/r5rs/scm/m17nlib.scm
branches/r5rs/scm/romaja.scm
branches/r5rs/uim/m17nlib.c
branches/r5rs/xim/canddisp.cpp
branches/r5rs/xim/connection.cpp
branches/r5rs/xim/convdisp.cpp
branches/r5rs/xim/ximic.cpp
branches/r5rs/xim/ximtrans.cpp
Log:
r2697 at t42 (orig r1046): tkng | 2005-07-27 19:43:26 +0900
* scm/anthy.scm:
-(anthy-proc-input-state-with-preedit): Don't commit modifier key.
Thanks to Kouhei Sutou.
r2701 at t42 (orig r1050): ekato | 2005-07-28 05:19:06 +0900
* xim/ximtrans.cpp (Connection::xim_error) : Cope with
XIM_BadSomething for qt's insufficient XIM implementation.
* xim/canddisp.cpp : Cosmetic change.
* xim/convdisp.cpp : Ditto.
* xim/connection.cpp : Ditto.
r2705 at t42 (orig r1054): ekato | 2005-07-29 02:21:59 +0900
* xim/ximic.cpp : Cosmetic changes.
* xim/ximtrans.cpp : Ditto.
(Connection::xim_error) : Suppress error message upon receiving
XIM_BadSomething.
r2706 at t42 (orig r1055): tkng | 2005-07-29 12:53:37 +0900
* scm/japanese-kana.scm: Added some new rules for kana.
Thanks to Kenji Nishishiro.
r2707 at t42 (orig r1056): tkng | 2005-07-29 13:03:50 +0900
* scm/m17nlib.scm:
-(m17nlib-push-key): Modifier should be appended not only for symbol
key but also non-symbol key.
r2708 at t42 (orig r1057): tkng | 2005-07-29 13:14:22 +0900
* uim/m17nlib.c:
-(get_key_sym): Removed unused function.
-(push_key): Removed unused function.
r2728 at t42 (orig r1077): tkng | 2005-07-31 13:25:16 +0900
* scm/romaja.scm: Updated with latest version.
Property changes on: branches/r5rs
___________________________________________________________________
Name: svk:merge
- fb73e508-85ea-0310-95c3-a85c473e0941:/trunk:1039
+ fb73e508-85ea-0310-95c3-a85c473e0941:/trunk:1077
Modified: branches/r5rs/scm/anthy.scm
===================================================================
--- branches/r5rs/scm/anthy.scm 2005-07-31 04:25:16 UTC (rev 1077)
+++ branches/r5rs/scm/anthy.scm 2005-07-31 04:53:40 UTC (rev 1078)
@@ -610,7 +610,7 @@
;; modifiers (except shift) => ignore
((and (modifier-key-mask key-state)
(not (shift-key-mask key-state)))
- (anthy-commit-raw ac))
+ #f)
(else
(let* ((key-str (charcode->string
Modified: branches/r5rs/scm/japanese-kana.scm
===================================================================
--- branches/r5rs/scm/japanese-kana.scm 2005-07-31 04:25:16 UTC (rev 1077)
+++ branches/r5rs/scm/japanese-kana.scm 2005-07-31 04:53:40 UTC (rev 1078)
@@ -87,6 +87,36 @@
(((";"). ("¤ì"))())
((("0"). ("¤ï"))())
((("|"). ("¡¼"))())
+ ((("T"). ("¤«"))())
+ ((("G"). ("¤"))())
+ ((("H"). ("¤¯"))())
+ ((("*"). ("¤±"))())
+ ((("B"). ("¤³"))())
+ ((("X"). ("¤µ"))())
+ ((("D"). ("¤·"))())
+ ((("R"). ("¤¹"))())
+ ((("P"). ("¤»"))())
+ ((("C"). ("¤½"))())
+ ((("Q"). ("¤¿"))())
+ ((("A"). ("¤Á"))())
+ ((("W"). ("¤Æ"))())
+ ((("S"). ("¤È"))())
+ ((("U"). ("¤Ê"))())
+ ((("I"). ("¤Ë"))())
+ ((("!"). ("¤Ì"))())
+ ((("K"). ("¤Î"))())
+ ((("F"). ("¤Ï"))())
+ ((("V"). ("¤Ò"))())
+ ((("\""). ("¤Õ"))())
+ ((("="). ("¤Û"))())
+ ((("J"). ("¤Þ"))())
+ ((("N"). ("¤ß"))())
+ ((("M"). ("¤â"))())
+ ((("O"). ("¤é"))())
+ ((("L"). ("¤ê"))())
+ ((("+"). ("¤ì"))())
+ ((("_"). ("¤í"))())
+ ((("Y"). ("¤ó"))())
((("\\"). ("¤í"))())
((("¤«" "@"). ())("¤¬" ""))
((("¤" "@"). ())("¤®" ""))
@@ -113,6 +143,26 @@
((("¤Õ" "["). ())("¤×" ""))
((("¤Ø" "["). ())("¤Ú" ""))
((("¤Û" "["). ())("¤Ý" ""))
+ ((("¤«" "`"). ())("¤¬" ""))
+ ((("¤" "`"). ())("¤®" ""))
+ ((("¤¯" "`"). ())("¤°" ""))
+ ((("¤±" "`"). ())("¤²" ""))
+ ((("¤³" "`"). ())("¤´" ""))
+ ((("¤µ" "`"). ())("¤¶" ""))
+ ((("¤·" "`"). ())("¤¸" ""))
+ ((("¤¹" "`"). ())("¤º" ""))
+ ((("¤»" "`"). ())("¤¼" ""))
+ ((("¤½" "`"). ())("¤¾" ""))
+ ((("¤¿" "`"). ())("¤À" ""))
+ ((("¤Á" "`"). ())("¤Â" ""))
+ ((("¤Ä" "`"). ())("¤Å" ""))
+ ((("¤Æ" "`"). ())("¤Ç" ""))
+ ((("¤È" "`"). ())("¤É" ""))
+ ((("¤Ï" "`"). ())("¤Ð" ""))
+ ((("¤Ò" "`"). ())("¤Ó" ""))
+ ((("¤Õ" "`"). ())("¤Ö" ""))
+ ((("¤Ø" "`"). ())("¤Ù" ""))
+ ((("¤Û" "`"). ())("¤Ü" ""))
(((">"). ("¡£"))())
((("<"). ("¡¢"))())
((("?"). ("¡¦"))())
@@ -120,6 +170,7 @@
((("["). ("¡¬"))())
((("{"). ("¡Ö"))())
((("}"). ("¡×"))())
+ ((("`"). ("¡«"))())
((("¤¡"). ())("¤¡"))
((("¤£"). ())("¤£"))
@@ -244,6 +295,37 @@
(((";"). ("¥ì"))())
((("0"). ("¥ï"))())
((("|"). ("¡¼"))())
+ ((("T"). ("¥«"))())
+ ((("G"). ("¥"))())
+ ((("H"). ("¥¯"))())
+ ((("*"). ("¥±"))())
+ ((("B"). ("¥³"))())
+ ((("X"). ("¥µ"))())
+ ((("D"). ("¥·"))())
+ ((("R"). ("¥¹"))())
+ ((("P"). ("¥»"))())
+ ((("C"). ("¥½"))())
+ ((("Q"). ("¥¿"))())
+ ((("A"). ("¥Á"))())
+ ((("W"). ("¥Æ"))())
+ ((("S"). ("¥È"))())
+ ((("U"). ("¥Ê"))())
+ ((("I"). ("¥Ë"))())
+ ((("!"). ("¥Ì"))())
+ ((("K"). ("¥Î"))())
+ ((("F"). ("¥Ï"))())
+ ((("V"). ("¥Ò"))())
+ ((("\""). ("¥Õ"))())
+ ((("="). ("¥Û"))())
+ ((("J"). ("¥Þ"))())
+ ((("N"). ("¥ß"))())
+ ((("M"). ("¥â"))())
+ ((("O"). ("¥é"))())
+ ((("L"). ("¥ê"))())
+ ((("+"). ("¥ì"))())
+ ((("_"). ("¥í"))())
+ ((("Y"). ("¥ó"))())
+
((("\\"). ("¥í"))())
((("¥«" "@"). ())("¥¬"))
((("¥" "@"). ())("¥®"))
@@ -270,6 +352,26 @@
((("¥Õ" "["). ())("¥×"))
((("¥Ø" "["). ())("¥Ú"))
((("¥Û" "["). ())("¥Ý"))
+ ((("¥«" "`"). ())("¥¬"))
+ ((("¥" "`"). ())("¥®"))
+ ((("¥¯" "`"). ())("¥°"))
+ ((("¥±" "`"). ())("¥²"))
+ ((("¥³" "`"). ())("¥´"))
+ ((("¥µ" "`"). ())("¥¶"))
+ ((("¥·" "`"). ())("¥¸"))
+ ((("¥¹" "`"). ())("¥º"))
+ ((("¥»" "`"). ())("¥¼"))
+ ((("¥½" "`"). ())("¥¾"))
+ ((("¥¿" "`"). ())("¥À"))
+ ((("¥Á" "`"). ())("¥Â"))
+ ((("¥Ä" "`"). ())("¥Å"))
+ ((("¥Æ" "`"). ())("¥Ç"))
+ ((("¥È" "`"). ())("¥É"))
+ ((("¥Ï" "`"). ())("¥Ð"))
+ ((("¥Ò" "`"). ())("¥Ó"))
+ ((("¥Õ" "`"). ())("¥Ö"))
+ ((("¥Ø" "`"). ())("¥Ù"))
+ ((("¥Û" "`"). ())("¥Ü"))
(((">"). ("¡£"))())
((("<"). ("¡¢"))())
((("?"). ("¡¦"))())
@@ -277,6 +379,7 @@
((("["). ("¡¬"))())
((("{"). ("¡Ö"))())
((("}"). ("¡×"))())
+ ((("`"). ("¡«"))())
((("¥¡"). ())("¥¡"))
((("¥£"). ())("¥£"))
Modified: branches/r5rs/scm/m17nlib.scm
===================================================================
--- branches/r5rs/scm/m17nlib.scm 2005-07-31 04:25:16 UTC (rev 1077)
+++ branches/r5rs/scm/m17nlib.scm 2005-07-31 04:53:40 UTC (rev 1078)
@@ -257,11 +257,12 @@
((m17nlib-off-key? key key-state)
(m17nlib-context-set-on! mc #f)
#t) ;; #t means key event was consumed.
- ((symbol? key)
- (let ((mkey (m17nlib-translate-ukey-to-mkey key key-state)))
- (m17nlib-lib-push-symbol-key mid mkey)))
(else
- (m17nlib-lib-push-key mid key key-state))))))
+ (if (symbol? key)
+ (let ((mkey (m17nlib-translate-ukey-to-mkey key key-state)))
+ (m17nlib-lib-push-symbol-key mid mkey))
+ (let ((mkey (m17nlib-append-modifiers key key-state (charcode->string key))))
+ (m17nlib-lib-push-symbol-key mid mkey))))))))
(define m17nlib-press-key-handler
(lambda (mc key key-state)
Modified: branches/r5rs/scm/romaja.scm
===================================================================
--- branches/r5rs/scm/romaja.scm 2005-07-31 04:25:16 UTC (rev 1077)
+++ branches/r5rs/scm/romaja.scm 2005-07-31 04:53:40 UTC (rev 1078)
@@ -1,3 +1,4 @@
+(define romaja-rule
'(
((("~"))("~"))
((("<"))("<"))
@@ -26,7 +27,6 @@
((("#"))("#"))
((("%"))("%"))
((("+"))("+"))
-))
((("0"))("0"))
((("1"))("1"))
((("2"))("2"))
@@ -3595,7 +3595,6 @@
((("d" "e" "b" "s" ))("ë"))
((("d" "e" "c" "h" ))("ë"))
((("d" "e" "d" ))("ë·"))
-(define romaja-rule
((("d" "e" "g" ))("ë±"))
((("d" "e" "g" "g" ))("ë²"))
((("d" "e" "g" "s" ))("ë³"))
@@ -19612,3 +19611,4 @@
((("y" "u" "s" ))("ì³"))
((("y" "u" "s" "s" ))("ì´"))
((("y" "u" "t" ))("ì¹"))
+))
Modified: branches/r5rs/uim/m17nlib.c
===================================================================
--- branches/r5rs/uim/m17nlib.c 2005-07-31 04:25:16 UTC (rev 1077)
+++ branches/r5rs/uim/m17nlib.c 2005-07-31 04:53:40 UTC (rev 1078)
@@ -195,7 +195,7 @@
static void
candidates_done_cb(MInputContext *ic, MSymbol command)
{
- fprintf(stderr,"candidate done\n");
+ /* fprintf(stderr,"candidate done\n"); */
}
static void
@@ -529,54 +529,22 @@
return uim_scm_f();
}
-static MSymbol
-get_key_sym(int ch)
-{
- if (ch < 127) {
- char buf[2];
- buf[0] = ch;
- buf[1] = 0;
- return msymbol(buf);
- }
- return Mnil;
-}
-
static uim_lisp
push_symbol_key(uim_lisp id_, uim_lisp key_)
{
int id = uim_scm_c_int(id_);
MSymbol key;
MInputContext *ic = ic_array[id].mic;
- /* printf("%s\n",uim_scm_c_str(key_)); */
key = msymbol(uim_scm_c_str(key_));
if (key == Mnil) {
return uim_scm_t();
}
- if (minput_filter(ic, key, NULL) == 1) {
- return uim_scm_t();
- }
- return uim_scm_f();
-}
-
-static uim_lisp
-push_key(uim_lisp id_, uim_lisp key_, uim_lisp mod_)
-{
- int id = uim_scm_c_int(id_);
- int ch;
- MSymbol key;
- MInputContext *ic = ic_array[id].mic;
-
- ch = uim_scm_c_int(key_);
- key = get_key_sym(ch);
- if (key == Mnil) {
+ if(minput_filter(ic, key, NULL)== 1) {
return uim_scm_t();
+ } else {
+ return uim_scm_f();
}
- if (minput_filter(ic, key, NULL) == 1) {
- return uim_scm_t();
- }
-
- return uim_scm_f();
}
static uim_lisp
@@ -805,7 +773,6 @@
uim_scm_init_subr_1("m17nlib-lib-nth-input-method-name", get_input_method_name);
uim_scm_init_subr_1("m17nlib-lib-alloc-context", alloc_id);
uim_scm_init_subr_1("m17nlib-lib-free-context", free_id);
- uim_scm_init_subr_3("m17nlib-lib-push-key", push_key);
uim_scm_init_subr_2("m17nlib-lib-push-symbol-key", push_symbol_key);
uim_scm_init_subr_1("m17nlib-lib-compose-mode?", compose_modep);
uim_scm_init_subr_1("m17nlib-lib-preedit-changed?", preedit_changedp);
Modified: branches/r5rs/xim/canddisp.cpp
===================================================================
--- branches/r5rs/xim/canddisp.cpp 2005-07-31 04:25:16 UTC (rev 1077)
+++ branches/r5rs/xim/canddisp.cpp 2005-07-31 04:53:40 UTC (rev 1078)
@@ -52,8 +52,8 @@
#include "util.h"
-static FILE *candwin_r = NULL, *candwin_w = NULL;
-static int candwin_pid = 0;
+static FILE *candwin_r, *candwin_w;
+static int candwin_pid;
static Canddisp *disp;
static const char *command;
@@ -74,10 +74,10 @@
*/
candwin_prog = getenv("UIM_CANDWIN_PROG");
- if (candwin_prog == NULL) {
+ if (!candwin_prog) {
#ifdef UIM_COMPAT_SCM
candwin_prog = uim_scm_symbol_value_str("uim-candwin-prog");
- if(candwin_prog != NULL)
+ if (candwin_prog)
return candwin_prog;
#endif /* UIM_COMPAT_SCM */
#if defined(USE_QT_CANDWIN)
@@ -93,10 +93,10 @@
Canddisp *canddisp_singleton()
{
- if (command == NULL)
- command = candwin_command();
+ if (!command)
+ command = candwin_command();
- if (disp == NULL && command) {
+ if (!disp && command) {
candwin_pid = uim_ipc_open_command(candwin_pid, &candwin_r, &candwin_w, command);
disp = new Canddisp();
int fd = fileno(candwin_r);
@@ -117,14 +117,13 @@
{
std::vector<const char *>::iterator i;
- if (candwin_w == NULL)
+ if (!candwin_w)
return;
fprintf(candwin_w, "activate\ncharset=UTF-8\ndisplay_limit=%d\n",
display_limit);
- for (i = candidates.begin(); i != candidates.end(); i++) {
+ for (i = candidates.begin(); i != candidates.end(); i++)
fprintf(candwin_w, "%s\n", *i);
- }
fprintf(candwin_w, "\n");
fflush(candwin_w);
check_connection();
@@ -132,7 +131,7 @@
void Canddisp::select(int index)
{
- if (candwin_w == NULL)
+ if (!candwin_w)
return;
fprintf(candwin_w, "select\n");
fprintf(candwin_w, "%d\n\n", index);
@@ -142,7 +141,7 @@
void Canddisp::deactivate()
{
- if (candwin_w == NULL)
+ if (!candwin_w)
return;
fprintf(candwin_w, "deactivate\n\n");
fflush(candwin_w);
@@ -151,7 +150,7 @@
void Canddisp::show()
{
- if (candwin_w == NULL)
+ if (!candwin_w)
return;
fprintf(candwin_w, "show\n\n");
fflush(candwin_w);
@@ -160,7 +159,7 @@
void Canddisp::hide()
{
- if (candwin_w == NULL)
+ if (!candwin_w)
return;
fprintf(candwin_w, "hide\n\n");
fflush(candwin_w);
@@ -169,7 +168,7 @@
void Canddisp::move(int x, int y)
{
- if (candwin_w == NULL)
+ if (!candwin_w)
return;
fprintf(candwin_w, "move\n");
fprintf(candwin_w, "%d\n", x);
@@ -181,7 +180,7 @@
void Canddisp::show_caret_state(const char *str)
{
- if (candwin_w == NULL)
+ if (!candwin_w)
return;
fprintf(candwin_w, "show_caret_state\n");
fprintf(candwin_w, "%s", str);
@@ -266,6 +265,5 @@
}
disp = NULL;
-
return;
}
Modified: branches/r5rs/xim/connection.cpp
===================================================================
--- branches/r5rs/xim/connection.cpp 2005-07-31 04:25:16 UTC (rev 1077)
+++ branches/r5rs/xim/connection.cpp 2005-07-31 04:53:40 UTC (rev 1078)
@@ -101,7 +101,7 @@
void
procXClientMessage(XClientMessageEvent *ev)
{
- // check connection request
+ // check connection request
XimServer *xs = XimServer::findServer(ev->window);
if (xs && ev->message_type == xim_xconnect) {
xs->setupNewConnection(ev);
Modified: branches/r5rs/xim/convdisp.cpp
===================================================================
--- branches/r5rs/xim/convdisp.cpp 2005-07-31 04:25:16 UTC (rev 1077)
+++ branches/r5rs/xim/convdisp.cpp 2005-07-31 04:53:40 UTC (rev 1078)
@@ -114,7 +114,7 @@
NULL);
if (xftfont) {
if (gXftFont)
- XftFontClose(XimServer::gDpy, gXftFont);
+ XftFontClose(XimServer::gDpy, gXftFont);
free(gXftFontName);
free(gXftFontLocale);
gXftFont = xftfont;
Modified: branches/r5rs/xim/ximic.cpp
===================================================================
--- branches/r5rs/xim/ximic.cpp 2005-07-31 04:25:16 UTC (rev 1077)
+++ branches/r5rs/xim/ximic.cpp 2005-07-31 04:53:40 UTC (rev 1078)
@@ -254,7 +254,7 @@
void icxatr::unset_change_mask(int id)
{
- change_mask &=(~(1 << id));
+ change_mask &= (~(1 << id));
}
void icxatr::print()
@@ -506,7 +506,7 @@
void XimIC::setICAttrs(void *val, int len)
{
- unsigned char *p=(unsigned char *)val;
+ unsigned char *p = (unsigned char *)val;
int byte_order = mConn->byte_order();
int i;
for (i = 0; i < len;) {
Modified: branches/r5rs/xim/ximtrans.cpp
===================================================================
--- branches/r5rs/xim/ximtrans.cpp 2005-07-31 04:25:16 UTC (rev 1077)
+++ branches/r5rs/xim/ximtrans.cpp 2005-07-31 04:53:40 UTC (rev 1078)
@@ -46,6 +46,9 @@
# include <alloca.h>
#endif
+// XIM Error Code
+#define XIM_BadSomething 999
+
const char *xim_packet_name[] = {
// 0
0, "XIM_CONNECT", "XIM_CONNECT_REPLY",
@@ -87,13 +90,13 @@
"XIM_STATUS_DRAW", "XIM_STATUS_DONE", "XIM_PREEDITSTATE"
};
-static struct XIMATTRIBUTE{
+static struct XIMATTRIBUTE {
XIMATTRIBUTE(const char *n, int t);
static void write_imattr_to_packet(TxPacket *p);
const char *name;
int type;
-}xim_attributes[]={
+} xim_attributes[] = {
XIMATTRIBUTE(XNQueryInputStyle, TYPE_XIMSTYLE),
};
@@ -127,12 +130,12 @@
}
}
-static struct XICATTRIBUTE{
+static struct XICATTRIBUTE {
XICATTRIBUTE(const char *n, int t);
static void write_icattr_to_packet(TxPacket *p);
const char *name;
int type;
-}xic_attributes[]={
+} xic_attributes[] = {
// the sequence is required to be same as the order of
// ICATTTRIBUTE defined in ximpn.h
XICATTRIBUTE(XNInputStyle, TYPE_LONG),
@@ -310,7 +313,7 @@
xim_error(p);
break;
default:
- printf("Unknown(or not implemented.) packet from xim connection.\n");
+ printf("Unknown (or not implemented) packet from xim connection.\n");
(*i)->dump();
break;
}
@@ -757,14 +760,21 @@
buf[len] = 0;
p->getStr(buf);
- printf("XIM_ERROR received.\n");
- if (mask & 1)
- printf(" imid = %d\n", imid);
- if (mask & 2)
- printf(" icid = %d\n", icid);
-
- printf(" error_code = %d\n", ecode);
- printf(" message=(%s)\n", buf);
+ switch (ecode) {
+ case XIM_BadSomething:
+ unsetPreeditStartSyncFlag();
+ unsetPreeditCaretSyncFlag();
+ break;
+ default:
+ fprintf(stderr, "XIM_ERROR received.\n");
+ if (mask & 1)
+ fprintf(stderr, " imid = %d\n", imid);
+ if (mask & 2)
+ fprintf(stderr, " icid = %d\n", icid);
+ fprintf(stderr, " error_code = %d\n", ecode);
+ fprintf(stderr, " message = (%s)\n", buf);
+ break;
+ }
}
XimIC *Connection::get_ic(RxPacket *p)
More information about the uim-commit
mailing list