Index: gtkimcontextsimple.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkimcontextsimple.h,v
retrieving revision 1.7
diff -u -p -r1.7 gtkimcontextsimple.h
--- gtkimcontextsimple.h	10 Oct 2002 22:18:36 -0000	1.7
+++ gtkimcontextsimple.h	10 Jun 2003 19:41:23 -0000
@@ -50,6 +50,8 @@ struct _GtkIMContextSimple
   gunichar tentative_match;
   gint tentative_match_len;
 
+  GSList *records;
+
   guint in_hex_sequence : 1;
 };
 
@@ -65,6 +67,12 @@ void          gtk_im_context_simple_add_
 					       guint16            *data,
 					       gint                max_seq_len,
 					       gint                n_seqs);
+void          gtk_im_context_simple_add_records (GtkIMContextSimple *context_simple,
+						 void               *records,
+						 gint                n_records,
+						 gsize               record_size,
+						 gint                n_compose,
+						 gsize               str_offset);
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
Index: gtkimcontextsimple.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkimcontextsimple.c,v
retrieving revision 1.34.2.2
diff -u -p -r1.34.2.2 gtkimcontextsimple.c
--- gtkimcontextsimple.c	21 May 2003 21:10:31 -0000	1.34.2.2
+++ gtkimcontextsimple.c	10 Jun 2003 19:41:26 -0000
@@ -32,6 +32,17 @@ struct _GtkComposeTable 
   gint n_seqs;
 };
 
+typedef struct _GtkComposeRecord GtkComposeRecord;
+
+struct _GtkComposeRecord
+{
+  const guint16 *data;		/* record */
+  gint n_records;
+  gsize record_size;
+  gint max_seq_len;
+  gsize str_offset;
+};
+
 /* The following table was generated from the X compose tables include with
  * XFree86 4.0 using a set of Perl scripts. Contact Owen Taylor <otaylor@redhat.com>
  * to obtain the relevant perl scripts.
@@ -1499,3 +1510,56 @@ gtk_im_context_simple_add_table (GtkIMCo
   context_simple->tables = g_slist_prepend (context_simple->tables, table);
 }
 
+/**
+ * gtk_im_context_simple_add_records:
+ * @context_simple: A #GtkIMContextSimple
+ * @data: the records
+ * @n_records: number of record struct elements in the records
+ * @record_size: the size of the record struct
+ * @max_seq_len: Maximum length of a compose sequence in the record
+ *               (cannot be greater than #GTK_MAX_COMPOSE_LEN)
+ * @str_offset: offset to output_str member in the record struct
+ *	The 1st byte of the output_str in each record [n=0, 1, 
+ *	..., (n_records - 1) is got with:
+ *	 	guchar *output_str = record[n] + str_offset;
+ *
+ * Adds an additional record to search to the input context.
+ *
+ * The compose sequences in the records must be sorted in dictionary order
+ * on the numeric value of the key symbol fields. (Values beyond
+ * the length of the sequence should be zero.)
+ *
+ * The record struct should be defined by each input method backend
+ * like:
+ *
+ *  struct MyRecord {
+ *	guint16 compose_keys[MAX_COMPOSE];
+ *	guchar output_str[MAX_STR_LEN]; /* UTF-8 encoded;
+ *	};
+ *  Both compose_keys and output_str must be NULL-terminated if
+ *  they are shorter than MAX_COMPOSE
+ *
+ **/
+void
+gtk_im_context_simple_add_records (GtkIMContextSimple *context_simple,
+                                   void               *data,
+                                   gint                n_records,
+                                   gsize               record_size,
+                                   gint                max_seq_len,
+                                   gsize               str_offset)
+{
+  GtkComposeRecord *records;
+
+  g_return_if_fail (GTK_IS_IM_CONTEXT_SIMPLE (context_simple));
+  g_return_if_fail (records != NULL);
+  g_return_if_fail (max_seq_len <= GTK_MAX_COMPOSE_LEN);
+  
+  records = g_new (GtkComposeRecord, 1);
+  records->data = data;
+  records->n_records = n_records;
+  records->record_size = record_size;
+  records->max_seq_len = max_seq_len;
+  records->str_offset = str_offset;
+
+  context_simple->records  = g_slist_prepend (context_simple->records, records);
+}
