Author: tkng
Date: Mon Aug  8 12:48:47 2005
New Revision: 1160

Modified:
   trunk/doc/HELPER-PROTOCOL
   trunk/uim/uim-custom.c
   trunk/uim/uim.c
   trunk/uim/uim.h

Log:
* uim/uim.c, uim/uim.h
 -(uim_prop_reload_configs): New function to reload configrations.

* uim/uim-custom.c
 -(uim_custom_broadcast): Send custom_reload_notify instead of
  prop_update_custom. This would be faster than prop_update_custom.

* doc/HELPER=PROTOCOL
 - Added description for custom_reload_notify.


Modified: trunk/doc/HELPER-PROTOCOL
==============================================================================
--- trunk/doc/HELPER-PROTOCOL   (original)
+++ trunk/doc/HELPER-PROTOCOL   Mon Aug  8 12:48:47 2005
@@ -92,6 +92,7 @@
               im_change_whole_desktop         |
               im_change_this_application_only |
               prop_update_custom  |
+              custom_reload_notify |
               commit_string) "\n"
 
   charset_specifier = "charset=" charset "\n"
@@ -327,6 +328,14 @@
     prop_update_custom = "prop_update_custom\n" custom_sym "\n" custom_value 
"\n"
     custom_sym = /^[-\?a-zA-Z0-9]+$/
     custom_value = <valid S-expression>
+
+  - custom_reload_notify
+
+    This is a notification message to reload configrations. If a process 
receive
+    this message, the process should reload configrations somehow. This message
+    maybe needless in the future.
+
+    custom_reload_notify = "custom_release_notify\n"
 
   - commit_string
 

Modified: trunk/uim/uim-custom.c
==============================================================================
--- trunk/uim/uim-custom.c      (original)
+++ trunk/uim/uim-custom.c      Mon Aug  8 12:48:47 2005
@@ -916,24 +916,7 @@
     helper_fd = uim_helper_init_client_fd(helper_disconnect_cb);
   }
 
-  custom_syms = uim_custom_collect_by_group(NULL);
-  for (sym = custom_syms; *sym; sym++) {
-    value = uim_custom_value_as_literal(*sym);
-    if (value) {
-      msg_size = sizeof(custom_msg_tmpl) + strlen(*sym) + strlen(value);
-      msg = (char *)malloc(msg_size);
-      if (!msg) {
-       free(value);
-       uim_custom_symbol_list_free(custom_syms);
-       return UIM_FALSE;
-      }
-      sprintf(msg, custom_msg_tmpl, *sym, value);
-      uim_helper_send_message(helper_fd, msg);
-      free(msg);
-      free(value);
-    }
-  }
-  uim_custom_symbol_list_free(custom_syms);
+  uim_helper_send_message(helper_fd, "custom_reload_notify\n");
 
   if (helper_fd != -1) {
     uim_helper_close_client_fd(helper_fd);

Modified: trunk/uim/uim.c
==============================================================================
--- trunk/uim/uim.c     (original)
+++ trunk/uim/uim.c     Mon Aug  8 12:48:47 2005
@@ -338,6 +338,17 @@
                    uc->id, custom, val);
 }
 
+
+/* Tentative name. I followed above uim_prop_update_custom, but prop 
+would not be proper to this function. */
+uim_bool
+uim_prop_reload_configs(void)
+{
+  /* FIXME: proces return value properly. */
+  uim_scm_eval_c_string("(custom-reload-configs)");
+  return UIM_TRUE;
+}
+
 int
 uim_get_current_mode(uim_context uc)
 {

Modified: trunk/uim/uim.h
==============================================================================
--- trunk/uim/uim.h     (original)
+++ trunk/uim/uim.h     Mon Aug  8 12:48:47 2005
@@ -523,6 +523,8 @@
 uim_prop_activate(uim_context uc, const char *str);
 void
 uim_prop_update_custom(uim_context uc, const char *custom, const char *val);
+uim_bool
+uim_prop_reload_configs(void);
 
 /* mode is obsoleted by property, so please use property API instead of mode 
API */
 int

Reply via email to