[uim-commit] r131 - trunk/uim

yamaken@freedesktop.org yamaken@freedesktop.org
Wed Jan 5 11:29:09 PST 2005


Author: yamaken
Date: 2005-01-05 11:29:06 -0800 (Wed, 05 Jan 2005)
New Revision: 131

Modified:
   trunk/uim/uim-custom.c
   trunk/uim/uim-custom.h
Log:
* This commit adds new custom types 'key' and 'ordered list' to custom
  API. Let me know how do you think about the
  interfaces. Corresponding implementations will follow soon

* uim/uim-custom.h
  - (enum UCustomType): Add UCustom_OrderedList
  - (enum UCustomKeyType): New enum
  - (union uim_custom_value): Add new member as_olist and as_key
  - (struct uim_custom_key): New type
  - (union uim_custom_range): Add new member as_olist
  - (uim_custom_choice_new, uim_custom_choice_list_free,
     uim_custom_key_new, uim_custom_key_list_free): New function
* uim/uim-custom.c
  - (uim_custom_choice_list_free): Remove static specifier to be API
     function


Modified: trunk/uim/uim-custom.c
===================================================================
--- trunk/uim/uim-custom.c	2005-01-05 17:44:47 UTC (rev 130)
+++ trunk/uim/uim-custom.c	2005-01-05 19:29:06 UTC (rev 131)
@@ -66,7 +66,6 @@
 static struct uim_custom_choice *uim_custom_choice_get(const char *custom_sym, const char *choice_sym);
 static void uim_custom_choice_free(struct uim_custom_choice *custom_choice);
 static struct uim_custom_choice **uim_custom_choice_item_list(const char *custom_sym);
-static void uim_custom_choice_list_free(struct uim_custom_choice **list);
 static union uim_custom_value *uim_custom_value_internal(const char *custom_sym, const char *getter_proc);
 
 static union uim_custom_value *uim_custom_value(const char *custom_sym);
@@ -213,7 +212,7 @@
   return custom_choice_list;
 }
 
-static void
+void
 uim_custom_choice_list_free(struct uim_custom_choice **list)
 {
   uim_scm_c_list_free((void **)list,

Modified: trunk/uim/uim-custom.h
===================================================================
--- trunk/uim/uim-custom.h	2005-01-05 17:44:47 UTC (rev 130)
+++ trunk/uim/uim-custom.h	2005-01-05 19:29:06 UTC (rev 131)
@@ -48,16 +48,23 @@
   UCustom_Str,
   UCustom_Pathname,
   UCustom_Choice,
+  UCustom_OrderedList,
   UCustom_Key
 };
 
+enum UCustomKeyType {
+  UCustomKey_Regular,   /* "<Control>j" */
+  UCustomKey_Reference  /* "generic-cancel-key" */
+};
+
 union uim_custom_value {
   int as_bool;
   int as_int;
   char *as_str;
   char *as_pathname;
   struct uim_custom_choice *as_choice;
-  /* char *as_key; */
+  struct uim_custom_choice **as_olist;
+  struct uim_custom_key **as_key;
 };
 
 struct uim_custom_choice {
@@ -66,6 +73,13 @@
   char *desc;
 };
 
+struct uim_custom_key {
+  int type;  /* UCustomKeyType */
+  char *literal;
+  char *label;
+  char *desc;
+};
+
 union uim_custom_range {
   struct {
     int min, max;
@@ -78,6 +92,10 @@
   struct {
     struct uim_custom_choice **valid_items;
   } as_choice;
+
+  struct {
+    struct uim_custom_choice **valid_items;  /* contains all possible items */
+  } as_olist;
 };
 
 struct uim_custom {
@@ -134,6 +152,19 @@
 
 void uim_custom_symbol_list_free(char **symbol_list);
 
+/* custom choice (for ordered list) */
+struct uim_custom_choice *uim_custom_choice_new(const char *symbol,
+						const char *label,
+						const char *desc);
+void uim_custom_choice_list_free(struct uim_custom_choice **list);
+
+/* custom key */
+struct uim_custom_choice *uim_custom_key_new(int type,
+					     const char *literal,
+					     const char *label,
+					     const char *desc);
+void uim_custom_key_list_free(struct uim_custom_key **list);
+
 #ifdef __cplusplus
 }
 #endif



More information about the Uim-commit mailing list