[uim-commit] r567 - trunk/uim

ekato at freedesktop.org ekato at freedesktop.org
Sun Feb 6 07:48:40 PST 2005


Author: ekato
Date: 2005-02-06 07:48:36 -0800 (Sun, 06 Feb 2005)
New Revision: 567

Modified:
   trunk/uim/uim-custom.c
Log:
* uim/uim-custom.c (uim_custom_olist_get) : Fix to use
  custom-value or custom-default-value properly depending on
  the context.
(uim_custom_key_get) : Ditto.


Modified: trunk/uim/uim-custom.c
===================================================================
--- trunk/uim/uim-custom.c	2005-02-06 09:55:10 UTC (rev 566)
+++ trunk/uim/uim-custom.c	2005-02-06 15:48:36 UTC (rev 567)
@@ -81,10 +81,10 @@
 static struct uim_custom_choice **extract_choice_list(const char *list_repl, const char *custom_sym);
 static struct uim_custom_choice **uim_custom_choice_item_list(const char *custom_sym);
 
-static struct uim_custom_choice **uim_custom_olist_get(const char *custom_sym);
+static struct uim_custom_choice **uim_custom_olist_get(const char *custom_sym, const char *getter_proc);
 static struct uim_custom_choice **uim_custom_olist_item_list(const char *custom_sym);
 
-static struct uim_custom_key **uim_custom_key_get(const char *custom_sym);
+static struct uim_custom_key **uim_custom_key_get(const char *custom_sym, const char *getter_proc);
 static void uim_custom_key_free(struct uim_custom_key *custom_key);
 static char *extract_key_literal(const struct uim_custom_key *custom_key);
 static char *key_list_to_str(const struct uim_custom_key *const *list, const char *sep);
@@ -347,10 +347,10 @@
 
 /* ordered list */
 static struct uim_custom_choice **
-uim_custom_olist_get(const char *custom_sym)
+uim_custom_olist_get(const char *custom_sym, const char getter_proc)
 {
-  UIM_EVAL_FSTRING2(NULL, "(define %s (custom-value '%s))",
-		    str_list_arg, custom_sym);
+  UIM_EVAL_FSTRING3(NULL, "(define %s (%s '%s))",
+		    str_list_arg, getter_proc, custom_sym);
   return extract_choice_list(str_list_arg, custom_sym);
 }
 
@@ -362,14 +362,14 @@
 
 /* key */
 static struct uim_custom_key **
-uim_custom_key_get(const char *custom_sym)
+uim_custom_key_get(const char *custom_sym, const char *getter_proc)
 {
   char **key_literal_list, **key_label_list, **key_desc_list;
   int *key_type_list, editor_type, list_len, i;
   struct uim_custom_key *custom_key, **custom_key_list;
 
-  UIM_EVAL_FSTRING2(NULL, "(define %s ((if uim-custom-expand-key? custom-expand-key-references (lambda (l) l)) (custom-value '%s)))",
-		    str_list_arg, custom_sym);
+  UIM_EVAL_FSTRING3(NULL, "(define %s ((if uim-custom-expand-key? custom-expand-key-references (lambda (l) l)) (%s '%s)))",
+		    str_list_arg, getter_proc, custom_sym);
   key_literal_list =
     (char **)uim_scm_c_list(str_list_arg,
 			    "(lambda (key) (if (symbol? key) (symbol->string key) key))",
@@ -530,10 +530,10 @@
     free(custom_value_symbol);
     break;
   case UCustom_OrderedList:
-    value->as_olist = uim_custom_olist_get(custom_sym);
+    value->as_olist = uim_custom_olist_get(custom_sym, getter_proc);
     break;
   case UCustom_Key:
-    value->as_key = uim_custom_key_get(custom_sym);
+    value->as_key = uim_custom_key_get(custom_sym, getter_proc);
     break;
   default:
     value = NULL;



More information about the Uim-commit mailing list