[uim-commit] r718 - trunk/uim

tkng at freedesktop.org tkng at freedesktop.org
Thu Feb 24 11:37:48 PST 2005


Author: tkng
Date: 2005-02-24 11:37:45 -0800 (Thu, 24 Feb 2005)
New Revision: 718

Modified:
   trunk/uim/m17nlib.c
Log:
* uim/m17nlib.c:
 -(register_callbacks): register to minput_default_driver.
 -(init_m17nlib): Call register_callbacks once.


Modified: trunk/uim/m17nlib.c
===================================================================
--- trunk/uim/m17nlib.c	2005-02-24 19:26:39 UTC (rev 717)
+++ trunk/uim/m17nlib.c	2005-02-24 19:37:45 UTC (rev 718)
@@ -199,23 +199,18 @@
   fprintf(stderr,"candidate done\n");
 }
 
-static MPlist *
-register_callbacks(MPlist *callback_list)
+static void
+register_callbacks(void)
 {
-  if(!callback_list)
-    callback_list = mplist();
-
-  mplist_add(callback_list, Minput_preedit_start, (void *)preedit_start_cb);
-  mplist_add(callback_list, Minput_preedit_draw,  (void *)preedit_draw_cb);
-  mplist_add(callback_list, Minput_preedit_done,  (void *)preedit_done_cb);
-  mplist_add(callback_list, Minput_status_start,  (void *)status_start_cb);
-  mplist_add(callback_list, Minput_status_draw,   (void *)status_draw_cb);
-  mplist_add(callback_list, Minput_status_done,   (void *)status_done_cb);
-  mplist_add(callback_list, Minput_candidates_start, (void *)candidates_start_cb);
-  mplist_add(callback_list, Minput_candidates_draw,  (void *)candidates_draw_cb);
-  mplist_add(callback_list, Minput_candidates_done,  (void *)candidates_done_cb);
-
-  return callback_list;
+  mplist_add(minput_default_driver.callback_list, Minput_preedit_start, (void *)preedit_start_cb);
+  mplist_add(minput_default_driver.callback_list, Minput_preedit_draw,  (void *)preedit_draw_cb);
+  mplist_add(minput_default_driver.callback_list, Minput_preedit_done,  (void *)preedit_done_cb);
+  mplist_add(minput_default_driver.callback_list, Minput_status_start,  (void *)status_start_cb);
+  mplist_add(minput_default_driver.callback_list, Minput_status_draw,   (void *)status_draw_cb);
+  mplist_add(minput_default_driver.callback_list, Minput_status_done,   (void *)status_done_cb);
+  mplist_add(minput_default_driver.callback_list, Minput_candidates_start, (void *)candidates_start_cb);
+  mplist_add(minput_default_driver.callback_list, Minput_candidates_draw,  (void *)candidates_draw_cb);
+  mplist_add(minput_default_driver.callback_list, Minput_candidates_done,  (void *)candidates_done_cb);
 }
 
 static uim_lisp
@@ -244,10 +239,10 @@
 	pushback_input_method(im, msymbol_name(lang),
 			      msymbol_name(im->name));
 	
-	im->driver.callback_list = register_callbacks(im->driver.callback_list);
       }
     }
   }
+  register_callbacks();
   m17n_object_unref(imlist);
   converter = mconv_buffer_converter(utf8, NULL, 0);
   if (!converter) {



More information about the Uim-commit mailing list