[uim-commit] r3162 - in trunk: . fep

yamamoto at freedesktop.org yamamoto at freedesktop.org
Sun Mar 5 07:39:43 PST 2006


Author: yamamoto
Date: 2006-03-05 07:39:38 -0800 (Sun, 05 Mar 2006)
New Revision: 3162

Modified:
   trunk/configure.ac
   trunk/fep/callbacks.c
   trunk/fep/helper.c
   trunk/fep/uim-fep.h
Log:
* configure.ac : Add check for sys/termios.h.
* fep/callbacks.c
  (switch_app_global_im_cb) : New function.
  (switch_system_global_im_cb) : New function.
  (prop_label_update_cb) : Remove.
* fep/helper.c (helper_handler) : Remove handling of prop_label_get.


Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2006-03-05 14:48:19 UTC (rev 3161)
+++ trunk/configure.ac	2006-03-05 15:39:38 UTC (rev 3162)
@@ -212,7 +212,7 @@
 AC_FUNC_ALLOCA
 AC_HEADER_STDC
 AC_CHECK_HEADERS([fcntl.h locale.h stdlib.h unistd.h errno.h])
-AC_CHECK_HEADERS([string.h sys/ioctl.h sys/socket.h termios.h wchar.h])
+AC_CHECK_HEADERS([string.h sys/ioctl.h sys/socket.h termios.h sys/termios.h wchar.h])
 AC_CHECK_HEADERS([sys/time.h sys/stat.h sys/un.h getopt.h assert.h signal.h term.h ncurses/term.h ctype.h pwd.h stdarg.h])
 AC_CHECK_HEADERS([pty.h utmp.h util.h libutil.h])
 AC_CHECK_HEADERS([curses.h stropts.h])

Modified: trunk/fep/callbacks.c
===================================================================
--- trunk/fep/callbacks.c	2006-03-05 14:48:19 UTC (rev 3161)
+++ trunk/fep/callbacks.c	2006-03-05 15:39:38 UTC (rev 3162)
@@ -71,6 +71,8 @@
 static int s_start_callbacks = FALSE;
 
 static void configuration_changed_cb(void *ptr);
+static void switch_app_global_im_cb(void *ptr, const char *name);
+static void switch_system_global_im_cb(void *ptr, const char *name);
 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);
@@ -80,7 +82,6 @@
 static void update_cb(void *ptr);
 static void mode_update_cb(void *ptr, int mode);
 static void prop_list_update_cb(void *ptr, const char *str);
-static void prop_label_update_cb(void *ptr, const char *str);
 static struct preedit_tag *dup_preedit(struct preedit_tag *p);
 static void make_page_strs(void);
 static int numwidth(int n);
@@ -141,8 +142,8 @@
   uim_set_preedit_cb(g_context, clear_cb, pushback_cb, update_cb);
   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);
+  uim_set_im_switch_request_cb(g_context, switch_app_global_im_cb, switch_system_global_im_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);
@@ -345,6 +346,28 @@
   s_im_str = s_im_str != NULL ? s_im_str : "";
 }
 
+static void switch_app_global_im_cb(void *ptr, const char *name)
+{
+}
+
+static void switch_system_global_im_cb(void *ptr, const char *name)
+{
+  char *buf;
+  int len = 0;
+
+#define HEADER_FORMAT "im_change_whole_desktop\n%s\n"
+
+  len += strlen(HEADER_FORMAT);
+  len += name ? strlen(name) : 0;
+
+  buf = malloc(len);
+  snprintf(buf, len, HEADER_FORMAT, name ? name : "");
+  uim_helper_send_message(g_helper_fd, buf);
+  free(buf);
+
+#undef HEADER_FORMAT
+}
+
 /*
  * ¸õÊä°ìÍ÷¤òɽ¼¨¤¹¤ë¤È¤­¤Ë¸Æ¤Ð¤ì¤ë¡£
  * s_candidate.nr = nr(¸õÊäÁí¿ô)
@@ -642,26 +665,6 @@
   debug(("prop_list_update_cb send message\n"));
 }
 
-static void prop_label_update_cb(void *ptr, const char *str)
-{
-  const char *enc;
-  char *message_buf;
-
-  debug(("prop_label_update_cb\n"));
-  debug2(("str = %s", str));
-
-  if (!g_focus_in) {
-    return;
-  }
-
-  enc = get_enc();
-  message_buf = malloc(strlen("prop_label_update\ncharset=") + strlen(enc) + strlen("\n") + strlen(str) + 1);
-  sprintf(message_buf, "prop_label_update\ncharset=%s\n%s", enc, str);
-  uim_helper_send_message(g_helper_fd, message_buf);
-  free(message_buf);
-  debug(("prop_label_update_cb send message\n"));
-}
-
 /*
  * ¿·¤·¤¤¥×¥ê¥¨¥Ç¥£¥Ã¥È¤òºî¤ê¡¤¥Ý¥¤¥ó¥¿¤òÊÖ¤¹
  */

Modified: trunk/fep/helper.c
===================================================================
--- trunk/fep/helper.c	2006-03-05 14:48:19 UTC (rev 3161)
+++ trunk/fep/helper.c	2006-03-05 15:39:38 UTC (rev 3162)
@@ -111,10 +111,6 @@
         debug(("prop_list_get\n"));
         uim_prop_list_update(g_context);
 
-      } else if (str_has_prefix(message, "prop_label_get")) {
-        debug(("prop_label_get\n"));
-        uim_prop_label_update(g_context);
-
       } else if (str_has_prefix(message, "prop_activate")) {
         char *eol;
         debug(("prop_activate\n"));
@@ -227,5 +223,4 @@
   g_focus_in = TRUE;
   uim_helper_client_focus_in(g_context);
   uim_prop_list_update(g_context);
-  uim_prop_label_update(g_context);
 }

Modified: trunk/fep/uim-fep.h
===================================================================
--- trunk/fep/uim-fep.h	2006-03-05 14:48:19 UTC (rev 3161)
+++ trunk/fep/uim-fep.h	2006-03-05 15:39:38 UTC (rev 3162)
@@ -44,6 +44,11 @@
 #ifdef HAVE_CURSES_H
 #include <curses.h>
 #endif
+#ifdef __CYGWIN32__
+#ifdef HAVE_SYS_TERMIOS_H
+#include <sys/termios.h>
+#endif
+#endif
 #include <uim/uim.h>
 
 #define FALSE 0



More information about the uim-commit mailing list