*** empty log message ***
[m17n/m17n-lib.git] / src / input-gui.c
index c3d24cf..f4433a7 100644 (file)
     The input driver @c minput_gui_driver is provided for internal
     input methods that is useful on window systems.  It displays
     preedit text and status text at the inputting spot.  See the
-    documentation of @c minput_gui_driver for more detail.
+    documentation of @c minput_gui_driver for more details.
 
     In the m17n-X library, the foreign input method of name @c Mxim is
     provided.  It uses XIM (X Input Method) as a background input
     engine.  The symbol @c Mxim has a property @c Minput_driver whose
     value is a pointer to the input driver @c minput_xim_driver.  See
-    the documentation of @c minput_xim_driver for more detail.  */
+    the documentation of @c minput_xim_driver for more details.  */
 
 /***ja
     @addtogroup m17nInputMethodWin
@@ -60,6 +60,7 @@
 #include <string.h>
 #include <ctype.h>
 
+#include "config.h"
 #include "m17n-gui.h"
 #include "m17n-misc.h"
 #include "internal.h"
@@ -483,6 +484,28 @@ win_callback (MInputContext *ic, MSymbol command)
          win_ic_info->candidates.mapped = 0;
        }
     }
+  else if (command == Minput_reset)
+    {
+      MInputCallbackFunc func;
+
+      if (minput_default_driver.callback_list
+         && (func = ((MInputCallbackFunc)
+                     mplist_get (minput_default_driver.callback_list,
+                                 Minput_reset))))
+       {
+         MInputContextInfo *ic_info
+           = (MInputContextInfo *) win_ic_info->ic_info;
+         ic->info = ic_info;
+         (func) (ic, Minput_reset);
+         ic->info = win_ic_info;
+       }
+      if (ic->preedit_changed)
+       minput__callback (ic, Minput_preedit_draw);
+      if (ic->status_changed)
+       minput__callback (ic, Minput_status_draw);
+      if (ic->candidates_changed)
+       minput__callback (ic, Minput_candidates_draw);
+    }
 }
 
 static int
@@ -524,6 +547,7 @@ minput__win_init ()
     plist = mplist_add (plist, Minput_candidates_done, (void *) win_callback);
     plist = mplist_add (plist, Minput_set_spot, (void *) win_callback);
     plist = mplist_add (plist, Minput_toggle, (void *) win_callback);
+    plist = mplist_add (plist, Minput_reset, (void *) win_callback);
   }
   minput_driver = &minput_gui_driver;
 
@@ -581,7 +605,7 @@ minput__win_fini ()
 
     The argument $ARG of the function minput_create_ic () must be a
     pointer to the structure @c MInputGUIArgIC.  See the documentation
-    of @c MInputGUIArgIC for more detail.
+    of @c MInputGUIArgIC for more details.
 
     If the argument $KEY is @c Mnil, the argument $ARG of the
     function minput_filter () must be a pointer to the object of type