[uim-commit] r1125 - in branches/r5rs: . fep gtk helper scm uim

tkng at freedesktop.org tkng at freedesktop.org
Sat Aug 6 05:44:04 EST 2005


Author: tkng
Date: 2005-08-05 12:44:01 -0700 (Fri, 05 Aug 2005)
New Revision: 1125

Modified:
   branches/r5rs/
   branches/r5rs/configure.ac
   branches/r5rs/fep/README.ja
   branches/r5rs/fep/README.key
   branches/r5rs/fep/callbacks.c
   branches/r5rs/fep/key.c
   branches/r5rs/fep/key.h
   branches/r5rs/fep/uim-fep.c
   branches/r5rs/gtk/caret-state-indicator.c
   branches/r5rs/gtk/caret-state-indicator.h
   branches/r5rs/gtk/gtk-im-uim.c
   branches/r5rs/helper/Makefile.am
   branches/r5rs/scm/im-custom.scm
   branches/r5rs/uim/canna.c
Log:
 r2768 at t42 (orig r1117):  tkng | 2005-08-04 00:59:56 +0900
 * helper/Makefile.am:
  - Changed temporary filename to GNOME_UimApplet.server.in.tmp
    to pass 'make releasetest'.
 
 
 r2769 at t42 (orig r1118):  tkng | 2005-08-04 01:08:56 +0900
 * configure.ac: Updated version to 0.4.8beta1!
 
 
 r2772 at t42 (orig r1121):  yamamoto | 2005-08-05 18:40:14 +0900
  * canna.c (create_context) :
    return valid context when RkGetDicList returns 0 to use imeproxy as cannaserver
 
 r2773 at t42 (orig r1122):  yamamoto | 2005-08-05 18:57:49 +0900
  * fep/callbacks.c (init_callbacks) : use uim_iconv instead of iconv
 
  * key.c (escape_sequence2key) :
    add length parameter, because input string may contains NUL character
 
 r2774 at t42 (orig r1123):  tkng | 2005-08-06 03:55:15 +0900
 * scm/im-custom.scm:
  -(bridge-show-input-state-time-length): New config item.
 
 r2775 at t42 (orig r1124):  tkng | 2005-08-06 04:02:33 +0900
 * gtk/caret-state-indicator.c:
  -(caret_state_indicator_set_timeout): New function to set timeout.
  -(caret_state_indicator_update): Added NULL check for str.
 
 * gtk/gtk-im-uim.c:
  -(im_uim_commit_string): Update caret-state-indicator position when commit event occured.
  -(update_prop_label_cb): Call caret_state_indicator_set_timeout to set timeout.
 



Property changes on: branches/r5rs
___________________________________________________________________
Name: svk:merge
   - fb73e508-85ea-0310-95c3-a85c473e0941:/trunk:1115
   + fb73e508-85ea-0310-95c3-a85c473e0941:/trunk:1124

Modified: branches/r5rs/configure.ac
===================================================================
--- branches/r5rs/configure.ac	2005-08-05 19:02:33 UTC (rev 1124)
+++ branches/r5rs/configure.ac	2005-08-05 19:44:01 UTC (rev 1125)
@@ -1,6 +1,6 @@
 AC_PREREQ(2.57)
 
-AC_INIT([uim], 0.4.8alpha1, [tkng at xem.jp])
+AC_INIT([uim], 0.4.8beta1, [tkng at xem.jp])
 AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION)
 
 AC_CONFIG_SRCDIR([COPYING])

Modified: branches/r5rs/fep/README.ja
===================================================================
--- branches/r5rs/fep/README.ja	2005-08-05 19:02:33 UTC (rev 1124)
+++ branches/r5rs/fep/README.ja	2005-08-05 19:44:01 UTC (rev 1125)
@@ -30,16 +30,23 @@
   ¤Î¤è¤¦¤Ë½ñ¤­¤Þ¤¹¡£
 
   Ãí°Õ
-  ¥Ç¥Õ¥©¥ë¥È¤Î¥­¡¼¥Ð¥¤¥ó¥É¤Ç¤Ï¡¢uim-fep¤Çanthy¤Î¥«¥¿¥«¥Ê¥â¡¼¥É¤Ê¤É¤Ø¤Î
-  ¥â¡¼¥ÉÊѹ¹¤¬¤Ç¤­¤Þ¤»¤ó¡£prime¤Ç¤ÏÁ´³Ñ±Ñ¿ô¥â¡¼¥É¤Ø¤Î¥â¡¼¥ÉÊѹ¹¤¬¤Ç¤­
-  ¤Þ¤»¤ó¡£¤³¤ì¤é¤Î¥â¡¼¥ÉÊѹ¹¤ò¹Ô¤¦¤¿¤á¤Ë¤Ï¼¡¤Î¤è¤¦¤Ë
-  ~/.uim¤Ë½ñ¤­¤Þ¤¹¡£
+  ¥Ç¥Õ¥©¥ë¥È¤Î¥­¡¼¥Ð¥¤¥ó¥É¤Ç¤Ï¡¢uim-fep¤Ç¤Ï°Ê²¼¤ÎÁàºî¤¬¹Ô¤¨¤Þ¤»¤ó¡£
+  anthy
+  ʸÀá¤ò½Ì¤á¤ë
+  prime
+  Á´³Ñ±Ñ¿ô¥â¡¼¥É¤Ë¥â¡¼¥ÉÊѹ¹
+  canna
+  ʸÀá¤ò½Ì¤á¤ë
 
+  ¤³¤ì¤é¤ÎÁàºî¤ò¹Ô¤¦¤¿¤á¤Ë¤Ïuim-pref¤Ç¥­¡¼¥Ð¥¤¥ó¥É¤òÀßÄꤹ¤ë¤«~/.uim¤Ë¼¡¤Î¤è¤¦¤Ë½ñ¤­¤Þ¤¹¡£
+
   Îã
-  (define-key anthy-wide-latin-key? "L")
-  (define-key anthy-hankaku-kana-key? "<Control>q")
-  (define-key anthy-kana-toggle-key? "q")
+  (require-module "anthy")
+  (define-key anthy-shrink-segment-key? '("tab" "<IgnoreCase><Control>i" "<Shift>left"))
+  (require-module "prime")
   (define-key prime-wide-latin-key? '("<Control><Alt>l" "<Control>L"))
+  (require-module "canna")
+  (define-key canna-shrink-segment-key? '("tab" "<IgnoreCase><Control>i" "<Shift>left"))
 
 
 * ´Ä¶­ÊÑ¿ô

Modified: branches/r5rs/fep/README.key
===================================================================
--- branches/r5rs/fep/README.key	2005-08-05 19:02:33 UTC (rev 1124)
+++ branches/r5rs/fep/README.key	2005-08-05 19:44:01 UTC (rev 1125)
@@ -8,7 +8,7 @@
 Ctrl + e              "<Control>e"
 Ctrl + f              "<Control>f"
 Ctrl + g              "<Control>g"
-Ctrl + h              "backspace"
+Ctrl + h              "<Control>h" or "backspace"
 Ctrl + i              "tab"
 Ctrl + j              "<Control>j"
 Ctrl + k              "<Control>k"
@@ -172,7 +172,7 @@
 Esc + Ctrl + e        "<Alt><Control>e"
 Esc + Ctrl + f        "<Alt><Control>f"
 Esc + Ctrl + g        "<Alt><Control>g"
-Esc + Ctrl + h        "<Alt>backspace"
+Esc + Ctrl + h        "<Alt><Control>h" or "<Alt>backspace"
 Esc + Ctrl + i        "<Alt>tab"
 Esc + Ctrl + j        "<Alt><Control>j"
 Esc + Ctrl + k        "<Alt><Control>k"
@@ -338,7 +338,7 @@
 133    0x85           "<Meta><Control>e"
 134    0x86           "<Meta><Control>f"
 135    0x87           "<Meta><Control>g"
-136    0x88           "<Meta>backspace"
+136    0x88           "<Meta><Control>h"
 137    0x89           "<Meta>tab"
 138    0x8a           "<Meta><Control>j"
 139    0x8b           "<Meta><Control>k"
@@ -473,7 +473,7 @@
 Esc + 133    0x85           "<Alt><Meta><Control>e"
 Esc + 134    0x86           "<Alt><Meta><Control>f"
 Esc + 135    0x87           "<Alt><Meta><Control>g"
-Esc + 136    0x88           "<Alt><Meta>backspace"
+Esc + 136    0x88           "<Alt><Meta><Control>h"
 Esc + 137    0x89           "<Alt><Meta>tab"
 Esc + 138    0x8a           "<Alt><Meta><Control>j"
 Esc + 139    0x8b           "<Alt><Meta><Control>k"

Modified: branches/r5rs/fep/callbacks.c
===================================================================
--- branches/r5rs/fep/callbacks.c	2005-08-05 19:02:33 UTC (rev 1124)
+++ branches/r5rs/fep/callbacks.c	2005-08-05 19:44:01 UTC (rev 1125)
@@ -49,7 +49,6 @@
 #ifdef HAVE_ASSERT_H
 #include <assert.h>
 #endif
-#include <iconv.h>
 #include <uim/uim-util.h>
 #include "uim-fep.h"
 #include "str.h"
@@ -141,29 +140,20 @@
   }
 
   if (g_opt.ddskk) {
-    iconv_t cd;
-    char *nokori_str = "»Ä¤ê";
-    size_t inbytesleft = strlen("»Ä¤ê");
-    size_t outbytesleft = 6;
+    void *cd;
+    const char *nokori_str = "»Ä¤ê";
     const char *enc;
 
-    s_nokori_str = malloc(outbytesleft + 1);
-    strcpy(s_nokori_str, "»Ä¤ê");
-    if (strcmp(enc = get_enc(), "EUC-JP") != 0) {
-      cd = (iconv_t)uim_iconv_open(enc, "EUC-JP");
-      if (cd == (iconv_t)-1) {
-        perror("error in iconv_open");
-        puts("-d option is not available");
-        done(EXIT_FAILURE);
+    if (uim_iconv->is_convertible(enc = get_enc(), "EUC-JP")) {
+      cd = uim_iconv->create(enc, "EUC-JP");
+      s_nokori_str = uim_iconv->convert(cd, nokori_str);
+      if (cd) {
+        uim_iconv->release(cd);
       }
-      if (iconv(cd, (ICONV_CONST char**)&nokori_str, &inbytesleft, &s_nokori_str, &outbytesleft) == (size_t)-1) {
-        perror("error in iconv");
-        puts("-d option is not available");
-        done(EXIT_FAILURE);
-      }
-      s_nokori_str[0] = '\0';
-      s_nokori_str -= (6 - outbytesleft);
-      iconv_close(cd);
+    } else {
+      perror("error in iconv_open");
+      puts("-d option is not available");
+      done(EXIT_FAILURE);
     }
   }
 }

Modified: branches/r5rs/fep/key.c
===================================================================
--- branches/r5rs/fep/key.c	2005-08-05 19:02:33 UTC (rev 1124)
+++ branches/r5rs/fep/key.c	2005-08-05 19:44:01 UTC (rev 1125)
@@ -65,7 +65,7 @@
 #define _KEY_RIGHT "\033[C"
 #define _KEY_LEFT  "\033[D"
 
-static int strcmp_prefix(const char *str, const char *prefix);
+static int strcmp_prefix(const char *str, int str_len, const char *prefix);
 
 int tty2key(char key)
 {
@@ -74,8 +74,6 @@
   /* c-space */
   case 0:
     return ' ';
-  case '\b':
-    return UKey_Backspace;
   case '\t':
     return UKey_Tab;
   case '\r':
@@ -102,8 +100,7 @@
 {
   int key_state = (key & 0x80) ? UMod_Meta : 0;
   key &= 0x7f;
-  if (key == '\b' ||
-      key == '\t' ||
+  if (key == '\t' ||
       key == '\r' ||
       key == ESCAPE_CODE ||
       key == 0x7f) {
@@ -123,40 +120,40 @@
  * ¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¤éUKey_Escape¤È¡¢ÅÓÃæ¤Þ¤Ç°ìÃפ·¤Æ¤¤¤ë¥¨¥¹¥±¡¼¥×¥·¡¼
  * ¥±¥ó¥¹¤¬¤¢¤ë¾ì¹ç¤ÏTRUE¤Ê¤¤¾ì¹ç¤ÏFALSE¤òÊÖ¤¹
  */
-int *escape_sequence2key(const char *str)
+int *escape_sequence2key(const char *str, int str_len)
 {
   static int rval[2];
   int len;
   int not_enough = 0;
-  if        (                         (not_enough += len = strcmp_prefix(str, _KEY_UP      )), len > 0) { rval[0] = UKey_Up;
-  } else if (                         (not_enough += len = strcmp_prefix(str, _KEY_DOWN    )), len > 0) { rval[0] = UKey_Down;
-  } else if (                         (not_enough += len = strcmp_prefix(str, _KEY_RIGHT   )), len > 0) { rval[0] = UKey_Right;
-  } else if (                         (not_enough += len = strcmp_prefix(str, _KEY_LEFT    )), len > 0) { rval[0] = UKey_Left;
-  } else if (key_backspace != NULL && (not_enough += len = strcmp_prefix(str, key_backspace)), len > 0) { rval[0] = UKey_Backspace;
-  } else if (key_dc        != NULL && (not_enough += len = strcmp_prefix(str, key_dc       )), len > 0) { rval[0] = UKey_Delete;    
-  } else if (key_left      != NULL && (not_enough += len = strcmp_prefix(str, key_left     )), len > 0) { rval[0] = UKey_Left;
-  } else if (key_up        != NULL && (not_enough += len = strcmp_prefix(str, key_up       )), len > 0) { rval[0] = UKey_Up;
-  } else if (key_right     != NULL && (not_enough += len = strcmp_prefix(str, key_right    )), len > 0) { rval[0] = UKey_Right;
-  } else if (key_down      != NULL && (not_enough += len = strcmp_prefix(str, key_down     )), len > 0) { rval[0] = UKey_Down;
-  } else if (key_ppage     != NULL && (not_enough += len = strcmp_prefix(str, key_ppage    )), len > 0) { rval[0] = UKey_Prior;
-  } else if (key_npage     != NULL && (not_enough += len = strcmp_prefix(str, key_npage    )), len > 0) { rval[0] = UKey_Next;
-  } else if (key_home      != NULL && (not_enough += len = strcmp_prefix(str, key_home     )), len > 0) { rval[0] = UKey_Home;
-  } else if (key_end       != NULL && (not_enough += len = strcmp_prefix(str, key_end      )), len > 0) { rval[0] = UKey_End;
-  } else if (key_ic        != NULL && (not_enough += len = strcmp_prefix(str, key_ic       )), len > 0) { rval[0] = UKey_Insert;    
-  } else if (key_f1        != NULL && (not_enough += len = strcmp_prefix(str, key_f1       )), len > 0) { rval[0] = UKey_F1;
-  } else if (key_f2        != NULL && (not_enough += len = strcmp_prefix(str, key_f2       )), len > 0) { rval[0] = UKey_F2;
-  } else if (key_f3        != NULL && (not_enough += len = strcmp_prefix(str, key_f3       )), len > 0) { rval[0] = UKey_F3;
-  } else if (key_f4        != NULL && (not_enough += len = strcmp_prefix(str, key_f4       )), len > 0) { rval[0] = UKey_F4;
-  } else if (key_f5        != NULL && (not_enough += len = strcmp_prefix(str, key_f5       )), len > 0) { rval[0] = UKey_F5;
-  } else if (key_f6        != NULL && (not_enough += len = strcmp_prefix(str, key_f6       )), len > 0) { rval[0] = UKey_F6;
-  } else if (key_f7        != NULL && (not_enough += len = strcmp_prefix(str, key_f7       )), len > 0) { rval[0] = UKey_F7;
-  } else if (key_f8        != NULL && (not_enough += len = strcmp_prefix(str, key_f8       )), len > 0) { rval[0] = UKey_F8;
-  } else if (key_f9        != NULL && (not_enough += len = strcmp_prefix(str, key_f9       )), len > 0) { rval[0] = UKey_F9;
-  } else if (key_f10       != NULL && (not_enough += len = strcmp_prefix(str, key_f10      )), len > 0) { rval[0] = UKey_F10;
-  } else if (key_f11       != NULL && (not_enough += len = strcmp_prefix(str, key_f11      )), len > 0) { rval[0] = UKey_F11;
-  } else if (key_f12       != NULL && (not_enough += len = strcmp_prefix(str, key_f12      )), len > 0) { rval[0] = UKey_F12;
+  if        (                         (not_enough += len = strcmp_prefix(str, str_len, _KEY_UP      )), len > 0) { rval[0] = UKey_Up;
+  } else if (                         (not_enough += len = strcmp_prefix(str, str_len, _KEY_DOWN    )), len > 0) { rval[0] = UKey_Down;
+  } else if (                         (not_enough += len = strcmp_prefix(str, str_len, _KEY_RIGHT   )), len > 0) { rval[0] = UKey_Right;
+  } else if (                         (not_enough += len = strcmp_prefix(str, str_len, _KEY_LEFT    )), len > 0) { rval[0] = UKey_Left;
+  } else if (key_backspace != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_backspace)), len > 0) { rval[0] = UKey_Backspace;
+  } else if (key_dc        != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_dc       )), len > 0) { rval[0] = UKey_Delete;    
+  } else if (key_left      != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_left     )), len > 0) { rval[0] = UKey_Left;
+  } else if (key_up        != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_up       )), len > 0) { rval[0] = UKey_Up;
+  } else if (key_right     != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_right    )), len > 0) { rval[0] = UKey_Right;
+  } else if (key_down      != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_down     )), len > 0) { rval[0] = UKey_Down;
+  } else if (key_ppage     != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_ppage    )), len > 0) { rval[0] = UKey_Prior;
+  } else if (key_npage     != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_npage    )), len > 0) { rval[0] = UKey_Next;
+  } else if (key_home      != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_home     )), len > 0) { rval[0] = UKey_Home;
+  } else if (key_end       != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_end      )), len > 0) { rval[0] = UKey_End;
+  } else if (key_ic        != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_ic       )), len > 0) { rval[0] = UKey_Insert;    
+  } else if (key_f1        != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_f1       )), len > 0) { rval[0] = UKey_F1;
+  } else if (key_f2        != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_f2       )), len > 0) { rval[0] = UKey_F2;
+  } else if (key_f3        != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_f3       )), len > 0) { rval[0] = UKey_F3;
+  } else if (key_f4        != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_f4       )), len > 0) { rval[0] = UKey_F4;
+  } else if (key_f5        != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_f5       )), len > 0) { rval[0] = UKey_F5;
+  } else if (key_f6        != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_f6       )), len > 0) { rval[0] = UKey_F6;
+  } else if (key_f7        != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_f7       )), len > 0) { rval[0] = UKey_F7;
+  } else if (key_f8        != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_f8       )), len > 0) { rval[0] = UKey_F8;
+  } else if (key_f9        != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_f9       )), len > 0) { rval[0] = UKey_F9;
+  } else if (key_f10       != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_f10      )), len > 0) { rval[0] = UKey_F10;
+  } else if (key_f11       != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_f11      )), len > 0) { rval[0] = UKey_F11;
+  } else if (key_f12       != NULL && (not_enough += len = strcmp_prefix(str, str_len, key_f12      )), len > 0) { rval[0] = UKey_F12;
   } else {
-    rval[0] = UKey_Escape;
+    rval[0] = UKey_Other;
     len = not_enough < 0 ? TRUE : FALSE;
   }
   rval[1] = len;
@@ -168,11 +165,11 @@
  * str¤¬prefix¤Î¸ìƬ¤Î¤È¤­-strlen(str)¤òÊÖ¤¹
  * ¤½¤ì°Ê³°¤Ï0¤òÊÖ¤¹
  */
-static int strcmp_prefix(const char *str, const char *prefix)
+static int strcmp_prefix(const char *str, int str_len, const char *prefix)
 {
   int i;
   assert(str != NULL && prefix != NULL);
-  for (i = 0; str[i] != '\0' && prefix[i] != '\0'; i++) {
+  for (i = 0; i < str_len && prefix[i] != '\0'; i++) {
     if (str[i] != prefix[i]) {
       break;
     }
@@ -180,7 +177,7 @@
   if (prefix[i] == '\0') {
     return i;
   }
-  if (str[i] == '\0') {
+  if (i == str_len) {
     return -i;
   }
   return 0;

Modified: branches/r5rs/fep/key.h
===================================================================
--- branches/r5rs/fep/key.h	2005-08-05 19:02:33 UTC (rev 1124)
+++ branches/r5rs/fep/key.h	2005-08-05 19:44:01 UTC (rev 1125)
@@ -35,7 +35,7 @@
 #define KEY_H
 int tty2key(char key);
 int tty2key_state(char key);
-int *escape_sequence2key(const char *str);
+int *escape_sequence2key(const char *str, int str_len);
 void print_key(int key, int key_state);
 
 #endif

Modified: branches/r5rs/fep/uim-fep.c
===================================================================
--- branches/r5rs/fep/uim-fep.c	2005-08-05 19:02:33 UTC (rev 1124)
+++ branches/r5rs/fep/uim-fep.c	2005-08-05 19:44:01 UTC (rev 1125)
@@ -721,10 +721,7 @@
 
     /* ¥­¡¼¥Ü¡¼¥É(stdin)¤«¤é¤ÎÆþÎÏ */
     if (FD_ISSET(g_win_in, &fds)) {
-      int i;
-      int key;
       int key_state = 0;
-      int key_len;
 
       if ((len = read_stdin(buf, sizeof(buf) - 1)) <= 0) {
         /* ¤³¤³¤Ë¤Ï¤³¤Ê¤¤¤È»×¤¦ */
@@ -740,41 +737,50 @@
         }
       } else {
 
+        int i;
         for (i = 0; i < len; i++) {
-          key = tty2key(buf[i]);
-          key_state |= tty2key_state(buf[i]);
-          if (key == UKey_Escape && (key_state & UMod_Meta) == 0) {
+          int key_len;
+          int *key_and_key_len = escape_sequence2key(buf + i, len - i);
+          int key = key_and_key_len[0];
 
-            int *key_and_key_len = escape_sequence2key(buf + i);
-            key = key_and_key_len[0];
+          if (key == UKey_Other) {
 
-            if (key == UKey_Escape) {
-              int not_enough = key_and_key_len[1];
-              if (not_enough && g_opt.timeout > 0) {
-                struct timeval t;
-                FD_ZERO(&fds);
-                FD_SET(g_win_in, &fds);
-                t.tv_sec = 0;
-                t.tv_usec = g_opt.timeout;
-                if (my_select(nfd, &fds, &t) > 0) {
-                  len += read_stdin(buf + len, sizeof(buf) - len - 1);
-                  buf[len] = '\0';
-                  debug(("read_again \"%s\"\n", buf));
-                  i--;
-                  continue;
-                }
-              }
-              if (i + 1 < len && key_state != UMod_Alt) {
-                key_state = UMod_Alt;
+            int not_enough;
+            key = tty2key(buf[i]);
+            key_state |= tty2key_state(buf[i]);
+            not_enough = key_and_key_len[1];
+
+            if (buf[i] == ESCAPE_CODE && i == len - 1) {
+              not_enough = TRUE;
+            }
+
+            if (not_enough && g_opt.timeout > 0) {
+              /* ÆþÎϤ¬Â­¤é¤Ê¤¤¤Î¤ÇºÆ¤ÓÆɤ߽Ф¹ */
+              struct timeval t;
+              fd_set fds;
+              FD_ZERO(&fds);
+              FD_SET(g_win_in, &fds);
+              t.tv_sec = 0;
+              t.tv_usec = g_opt.timeout;
+              if (my_select(g_win_in + 1, &fds, &t) > 0) {
+                len += read_stdin(buf + len, sizeof(buf) - len - 1);
+                buf[len] = '\0';
+                debug(("read_again \"%s\"\n", buf));
+                i--;
                 continue;
               }
-              key_len = 1;
-            } else {
-              key_len = key_and_key_len[1];
             }
-          } else {
+
+            if (buf[i] == ESCAPE_CODE && i < len - 1) {
+              key_state = UMod_Alt;
+              continue;
+            }
             key_len = 1;
+
+          } else { /* key != UKey_Other */
+            key_len = key_and_key_len[1];
           }
+
           if (g_opt.print_key) {
             print_key(key, key_state);
           } else {
@@ -788,6 +794,7 @@
               }
             }
           }
+
           key_state = 0;
           i += (key_len - 1);
         }

Modified: branches/r5rs/gtk/caret-state-indicator.c
===================================================================
--- branches/r5rs/gtk/caret-state-indicator.c	2005-08-05 19:02:33 UTC (rev 1124)
+++ branches/r5rs/gtk/caret-state-indicator.c	2005-08-05 19:44:01 UTC (rev 1125)
@@ -67,14 +67,16 @@
   GtkWidget *label = g_object_get_data(G_OBJECT(window), "label");
   gint cursor_x = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(window), "cursor_x"));
   gint cursor_y = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(window), "cursor_y"));
-  gchar **labels;
 
-  labels = g_strsplit(str, "\t", 2);
+  if(str) {
+    gchar **labels;
+    
+    labels = g_strsplit(str, "\t", 2);
+
+    gtk_label_set_text(GTK_LABEL(label), labels[0]);
+    g_strfreev(labels);
+  }
   gtk_window_move(GTK_WINDOW(window), topwin_x + cursor_x, topwin_y + cursor_y + 3);
-  gtk_label_set_text(GTK_LABEL(label), labels[0]);
-  g_strfreev(labels);
-  gtk_widget_show_all(window);
-  g_timeout_add(2000, caret_state_indicator_timeout, (gpointer)window);
 }
 
 void
@@ -86,6 +88,13 @@
 		    GINT_TO_POINTER(cursor_location->y+cursor_location->height));
 }
 
+
+void
+caret_state_indicator_set_timeout(GtkWidget *window, gint timeout)
+{
+  g_timeout_add(timeout, caret_state_indicator_timeout, (gpointer)window);
+}
+
 static gint
 caret_state_indicator_timeout(gpointer data)
 {

Modified: branches/r5rs/gtk/caret-state-indicator.h
===================================================================
--- branches/r5rs/gtk/caret-state-indicator.h	2005-08-05 19:02:33 UTC (rev 1124)
+++ branches/r5rs/gtk/caret-state-indicator.h	2005-08-05 19:44:01 UTC (rev 1125)
@@ -40,3 +40,6 @@
 
 void
 caret_state_indicator_set_cursor_location(GtkWidget *window, GdkRectangle *cursor_location);
+
+void
+caret_state_indicator_set_timeout(GtkWidget *window, gint timeout);

Modified: branches/r5rs/gtk/gtk-im-uim.c
===================================================================
--- branches/r5rs/gtk/gtk-im-uim.c	2005-08-05 19:02:33 UTC (rev 1124)
+++ branches/r5rs/gtk/gtk-im-uim.c	2005-08-05 19:44:01 UTC (rev 1125)
@@ -159,8 +159,17 @@
 im_uim_commit_string(void *ptr, const char *str)
 {
   IMUIMContext *uic = (IMUIMContext *)ptr;
+  uim_bool show_state;
+  gint x, y;
+
   g_return_if_fail(str);
   g_signal_emit_by_name(uic, "commit", str);
+
+  show_state = uim_scm_symbol_value_bool("bridge-show-input-state?");
+  if (show_state == UIM_TRUE) {
+    gdk_window_get_origin(uic->win, &x, &y);
+    caret_state_indicator_update(uic->caret_state_indicator, x, y, NULL);
+  }
 }
 
 static void
@@ -729,8 +738,13 @@
 
   show_state = uim_scm_symbol_value_bool("bridge-show-input-state?");
   if (show_state == UIM_TRUE) {
+    gint timeout;
     gdk_window_get_origin(uic->win, &x, &y);
     caret_state_indicator_update(uic->caret_state_indicator, x, y, str);
+    timeout = uim_scm_symbol_value_int("bridge-show-input-state-time-length");
+    if(timeout != 0)
+      caret_state_indicator_set_timeout(uic->caret_state_indicator, timeout * 1000);
+    gtk_widget_show_all(uic->caret_state_indicator);
   }
 }
 

Modified: branches/r5rs/helper/Makefile.am
===================================================================
--- branches/r5rs/helper/Makefile.am	2005-08-05 19:02:33 UTC (rev 1124)
+++ branches/r5rs/helper/Makefile.am	2005-08-05 19:44:01 UTC (rev 1125)
@@ -25,10 +25,10 @@
 	  $(LN_S) uim-toolbar-applet uim-helper-applet
 
 $(server_in_files): $(server_in_in_files) Makefile
-	sed s, at LIBEXECDIR@,$(libexecdir),g <$< >$<.tmp
-	sed s, at UIM_PIXMAPSDIR@,$(uim_pixmapsdir),g <$<.tmp >$@
+	sed s, at LIBEXECDIR@,$(libexecdir),g <$< >$@.tmp
+	sed s, at UIM_PIXMAPSDIR@,$(uim_pixmapsdir),g <$@.tmp >$@
 
-DISTCLEANFILES = GNOME_UimApplet.server.in GNOME_UimApplet.server GNOME_UimApplet.server.in.in.tmp
+DISTCLEANFILES = GNOME_UimApplet.server.in GNOME_UimApplet.server GNOME_UimApplet.server.in.tmp
 
 else
 install-exec-hook-applet:

Modified: branches/r5rs/scm/im-custom.scm
===================================================================
--- branches/r5rs/scm/im-custom.scm	2005-08-05 19:02:33 UTC (rev 1124)
+++ branches/r5rs/scm/im-custom.scm	2005-08-05 19:44:01 UTC (rev 1125)
@@ -344,6 +344,12 @@
   (_ "Show input mode nearby cursor")
   (_ "long description will be here."))
 
+(define-custom 'bridge-show-input-state-time-length 3
+  '(global visual-preference)
+  '(integer 0 100)
+  (_ "Time length for showing input mode nearby the cursor")
+  (_ "long description will be here."))
+
 ;; EB Library support
 ;; 2005-02-08 Takuro Ashie <ashie at homa.ne.jp>
 ;; FIXME! Here isn't suitable position for EB support preference

Modified: branches/r5rs/uim/canna.c
===================================================================
--- branches/r5rs/uim/canna.c	2005-08-05 19:02:33 UTC (rev 1124)
+++ branches/r5rs/uim/canna.c	2005-08-05 19:44:01 UTC (rev 1125)
@@ -156,7 +156,7 @@
 	dic_num = RkGetDicList(cc->rk_context_id,
 				   cc->diclist, BUFSIZE);
 	if (dic_num == 0) {
-	    return uim_scm_f();
+	    return uim_scm_make_int(i);
 	} else if (dic_num == -1) {
 	    /* invalid context number */
 	    return uim_scm_f();



More information about the uim-commit mailing list