[uim-commit] r1160 - in trunk: doc uim

tkng at freedesktop.org tkng at freedesktop.org
Tue Aug 9 05:48:53 EST 2005


Author: tkng
Date: 2005-08-08 12:48:47 -0700 (Mon, 08 Aug 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	2005-08-07 20:42:12 UTC (rev 1159)
+++ trunk/doc/HELPER-PROTOCOL	2005-08-08 19:48:47 UTC (rev 1160)
@@ -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"
@@ -328,6 +329,14 @@
     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
 
     This message commits a string to currently focused context. See also

Modified: trunk/uim/uim-custom.c
===================================================================
--- trunk/uim/uim-custom.c	2005-08-07 20:42:12 UTC (rev 1159)
+++ trunk/uim/uim-custom.c	2005-08-08 19:48:47 UTC (rev 1160)
@@ -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	2005-08-07 20:42:12 UTC (rev 1159)
+++ trunk/uim/uim.c	2005-08-08 19:48:47 UTC (rev 1160)
@@ -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	2005-08-07 20:42:12 UTC (rev 1159)
+++ trunk/uim/uim.h	2005-08-08 19:48:47 UTC (rev 1160)
@@ -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



More information about the uim-commit mailing list