[uim-commit] r2201 - trunk/fep

yamamoto at freedesktop.org yamamoto at freedesktop.org
Mon Nov 21 04:11:47 PST 2005


Author: yamamoto
Date: 2005-11-21 04:11:41 -0800 (Mon, 21 Nov 2005)
New Revision: 2201

Modified:
   trunk/fep/callbacks.c
   trunk/fep/uim-fep.c
Log:
* fep/callbacks.c
(configuration_changed_cb) : New function called when IM is switched.
(init_callbacks) : Call uim_set_configuration_changed_cb to regist
  configuration_changed_cb.



Modified: trunk/fep/callbacks.c
===================================================================
--- trunk/fep/callbacks.c	2005-11-21 11:18:56 UTC (rev 2200)
+++ trunk/fep/callbacks.c	2005-11-21 12:11:41 UTC (rev 2201)
@@ -66,9 +66,11 @@
 static struct preedit_tag *s_preedit;
 static int s_mode;
 static char *s_label_str;
+static const char *s_im_str;
 static char *s_nokori_str;
 static int s_start_callbacks = FALSE;
 
+static void configuration_changed_cb(void *ptr);
 static void activate_cb(void *ptr, int nr, int display_limit);
 static void select_cb(void *ptr, int index);
 static void shift_page_cb(void *ptr, int direction);
@@ -140,6 +142,8 @@
   uim_set_mode_cb(g_context, mode_update_cb);
   uim_set_prop_list_update_cb(g_context, prop_list_update_cb);
   uim_set_prop_label_update_cb(g_context, prop_label_update_cb);
+  uim_set_configuration_changed_cb(g_context, configuration_changed_cb);
+  configuration_changed_cb(NULL);
   if (g_opt.status_type != NONE) {
     uim_set_candidate_selector_cb(g_context, activate_cb, select_cb, shift_page_cb, deactivate_cb);
   }
@@ -325,18 +329,22 @@
 char *get_mode_str(void)
 {
   char *str;
-  char *im_str = (char *)uim_get_current_im_name(g_context);
 
   assert(!s_start_callbacks);
 
-  im_str = im_str != NULL ? im_str : "";
-  str = malloc(strlen(im_str) + strlen(s_label_str) + strlen("[]") + 1);
-  sprintf(str, "%s[%s]", im_str, s_label_str);
+  str = malloc(strlen(s_im_str) + strlen(s_label_str) + strlen("[]") + 1);
+  sprintf(str, "%s[%s]", s_im_str, s_label_str);
   strhead(str, s_max_width);
 
   return str;
 }
 
+static void configuration_changed_cb(void *ptr)
+{
+  s_im_str = uim_get_current_im_name(g_context);
+  s_im_str = s_im_str != NULL ? s_im_str : "";
+}
+
 /*
  * ¸õÊä°ìÍ÷¤òɽ¼¨¤¹¤ë¤È¤­¤Ë¸Æ¤Ð¤ì¤ë¡£
  * s_candidate.nr = nr(¸õÊäÁí¿ô)

Modified: trunk/fep/uim-fep.c
===================================================================
--- trunk/fep/uim-fep.c	2005-11-21 11:18:56 UTC (rev 2200)
+++ trunk/fep/uim-fep.c	2005-11-21 12:11:41 UTC (rev 2201)
@@ -257,7 +257,7 @@
   init_str();
   engine = get_default_im_name();
 
-  while ((op = getopt(argc, argv, "e:s:u:b:w:t:C:f:SciodKvh")) != -1) {
+  while ((op = getopt(argc, argv, "e:s:u:b:w:t:C:f:SXciodKvh")) != -1) {
     int i;
     switch (op) {
       case 'e':
@@ -291,6 +291,10 @@
         g_opt.no_report_cursor = TRUE;
         break;
 
+      case 'X':
+        gnu_screen = TRUE;
+        break;
+
       case 'd':
         g_opt.ddskk = TRUE;
         break;



More information about the uim-commit mailing list