[uim-commit] r769 - branches/composer/scm

yamaken at freedesktop.org yamaken at freedesktop.org
Mon Mar 7 09:29:31 PST 2005


Author: yamaken
Date: 2005-03-07 09:29:28 -0800 (Mon, 07 Mar 2005)
New Revision: 769

Modified:
   branches/composer/scm/anthy.scm
Log:
* This commit enables hiragana/katakana mixed text edition in single
  preedit

* scm/anthy.scm
  - (action action_anthy_commit_and_toggle_kana): New action
  - (action action_anthy_hiragana, action action_anthy_katakana,
    action action_anthy_hankana): Remove anthy-prepare-activation from
    activation handler to allow mode change while preedit lives. This
    enables hiragana/katakana mixed text in single preedit
  - (anthy-input-state-with-preedit-action-map-ruleset): Bind
    action_anthy_commit_and_toggle_kana to distinguish from
    action_anthy_toggle_kana
  - (anthy-input-state-with-preedit-action):
    * Rename the action that commits string action_anthy_toggle_kana
      to action_anthy_commit_and_toggle_kana
    * Add sideeffect-less kana toggle action as
      action_anthy_toggle_kana
  - (anthy-input-state-no-preedit-action):
    * Simplify action_anthy_zenkaku, action_anthy_direct and
      action_anthy_hankana handlings
    * Add all other input mode and kana-input method change handlings


Modified: branches/composer/scm/anthy.scm
===================================================================
--- branches/composer/scm/anthy.scm	2005-03-07 16:49:30 UTC (rev 768)
+++ branches/composer/scm/anthy.scm	2005-03-07 17:29:28 UTC (rev 769)
@@ -168,6 +168,10 @@
 				 "Toggle hiragana/katakana mode"
 				 "Toggle hiragana/katakana mode")
 
+(anthy-register-per-state-action 'action_anthy_commit_and_toggle_kana
+				 "Commit and toggle hiragana/katakana mode"
+				 "Commit current preedit string, then toggle hiragana/katakana mode")
+
 (anthy-register-per-state-action 'action_anthy_begin_conv
 				 "Begin conversion"
 				 "Begin conversion")
@@ -348,16 +352,13 @@
 (anthy-register-action 'action_anthy_hiragana
 ;;		 (indication-alist-indicator 'action_anthy_hiragana
 ;;					     anthy-input-mode-indication-alist)
-		       (lambda (ac) ;; indication handler
+		       (lambda (ac)
 			 '(figure_ja_hiragana
 			   "¤¢"
 			   "¤Ò¤é¤¬¤Ê"
 			   "¤Ò¤é¤¬¤ÊÆþÎϥ⡼¥É"))
-
-		       anthy-hiragana-mode? ;; activity predicate
-
-		       (lambda (ac) ;; action handler
-			 (anthy-prepare-activation ac)
+		       anthy-hiragana-mode?
+		       (lambda (ac)
 			 (anthy-context-set-on! ac #t)
 			 (anthy-switch-kana-mode! ac anthy-type-hiragana)))
 
@@ -369,7 +370,6 @@
 			   "¥«¥¿¥«¥ÊÆþÎϥ⡼¥É"))
 		       anthy-katakana-mode?
 		       (lambda (ac)
-			 (anthy-prepare-activation ac)
 			 (anthy-context-set-on! ac #t)
 			 (anthy-switch-kana-mode! ac anthy-type-katakana)))
 
@@ -381,7 +381,6 @@
 			   "Ⱦ³Ñ¥«¥¿¥«¥ÊÆþÎϥ⡼¥É"))
 		       anthy-hankana-mode?
 		       (lambda (ac)
-			 (anthy-prepare-activation ac)
 			 (anthy-context-set-on! ac #t)
 			 (anthy-switch-kana-mode! ac anthy-type-hankana)))
 
@@ -525,6 +524,8 @@
   '(
     ((lkey_q)                 (action_anthy_toggle_kana))
     ((lkey_Q)                 (action_anthy_toggle_kana))
+    (((mod_Control lkey_q))   (action_anthy_commit_and_toggle_kana))
+    (((mod_Control lkey_Q))   (action_anthy_commit_and_toggle_kana))
     ((lkey_space)             (action_anthy_begin_conv)) ;; generic
     (((mod_Control lkey_k))   (action_anthy_kill)) ;; generic
     (((mod_Control lkey_K))   (action_anthy_kill)) ;; generic
@@ -1061,21 +1062,17 @@
 (define anthy-input-state-no-preedit-action
   (lambda (ac act-id)
     (case act-id
-      ((action_anthy_zenkaku)
-       (anthy-flush ac)
-       (anthy-context-set-on! ac #f)
-       (anthy-context-set-wide-latin! ac #t)
-       (anthy-select-ruletree! ac))
+      ((action_anthy_hiragana
+	action_anthy_katakana
+	action_anthy_hankana
+	action_anthy_direct
+	action_anthy_zenkaku
+	action_anthy_roma
+	action_anthy_kana
+	action_anthy_azik
+	action_anthy_nicola)
+       (anthy-activate-action! ac act-id))
 
-      ((action_anthy_direct)
-       (anthy-flush ac)
-       (anthy-context-set-on! ac #f)
-       (anthy-context-set-wide-latin! ac #f)
-       (anthy-select-ruletree! ac))
-
-      ((action_anthy_hankana)
-       (anthy-switch-kana-mode! ac anthy-type-hankana))
-
       ((action_anthy_toggle_kana)
        (anthy-toggle-kana-mode! ac)))))
 
@@ -1124,10 +1121,13 @@
 	 (transpose ac anthy-direct-convert-wide-latin))
 
 	;; commit current preedit string, then toggle hiragana/katakana mode.
-	((action_anthy_toggle_kana)
+	((action_anthy_commit_and_toggle_kana)
 	 (anthy-commit-preconv! ac)
 	 (anthy-toggle-kana-mode! ac))
 
+	((action_anthy_toggle_kana)
+	 (anthy-toggle-kana-mode! ac))
+
 	((action_anthy_cancel_conv)
 	 (anthy-flush ac))
 



More information about the Uim-commit mailing list