Author: jhyeon
Date: Fri Jan  4 02:33:42 2008
New Revision: 5103

Modified:
  trunk/scm/byeoru-custom.scm
  trunk/scm/byeoru.scm

Log:
* scm/byeoru-custom.scm
 - byeoru-layout-alist: changed the symbol 'byeoru-layout-hangul2windows
   to 'byeoru-layout-hangul2 for backward compatibility; closes #13920
   reported by Etsushi Kato and ChangBeom Yoon
 - changed the default value of byeoru-layout
   from 'byeoru-layout-hangul2windows back to 'byeoru-layout-hangul2

* scm/byeoru.scm
 - changed the variable name byeoru-layout-hangul2windows to
   byeoru-layout-hangul2 to fix #13920
 - (byeoru-displace-handler): added
 - (byeoru-focus-out-handler): now closes candidate-selector if open


Modified: trunk/scm/byeoru-custom.scm
==============================================================================
--- trunk/scm/byeoru-custom.scm (original)
+++ trunk/scm/byeoru-custom.scm Fri Jan  4 02:33:42 2008
@@ -39,14 +39,14 @@

(define byeoru-layout-alist
  (list
+   (list 'byeoru-layout-hangul2
+        #f                             ; 2-beol can not be orderless.
+        (N_ "Hangul 2-beol Windows")
+        (N_ "Hangul 2-beol keyboard that maps an undefined shifted key to a 
jamo"))
   (list 'byeoru-layout-hangul2hanterm
         #f                             ; 2-beol can not be orderless.
         (N_ "Hangul 2-beol Hanterm")
         (N_ "Hangul 2-beol keyboard that maps an undefined shifted key to an 
alphabet"))
-   (list 'byeoru-layout-hangul2windows
-        #f                             ; 2-beol can not be orderless.
-        (N_ "Hangul 2-beol Windows")
-        (N_ "Hangul 2-beol keyboard that maps an undefined shifted key to a 
jamo"))
   (list 'byeoru-layout-strict3final
         #f                             ; neither can strict 3-beol.
         (N_ "Hangul 3-beol final strict")
@@ -91,7 +91,7 @@
  (N_ "long description will be here."))

;; Changing keyboard layout should flush the automata.
-(define-custom 'byeoru-layout 'byeoru-layout-hangul2windows
+(define-custom 'byeoru-layout 'byeoru-layout-hangul2
  '(byeoru byeoru-keyboard)
  (cons 'choice
        (map (lambda (entry)

Modified: trunk/scm/byeoru.scm
==============================================================================
--- trunk/scm/byeoru.scm        (original)
+++ trunk/scm/byeoru.scm        Fri Jan  4 02:33:42 2008
@@ -240,7 +240,7 @@
     ("O" (jungseong-yae        . 1))
     ("P" (jungseong-ye         . 1)))))

-(define byeoru-layout-hangul2windows
+(define byeoru-layout-hangul2
  (byeoru-expand-layout
   ;; Unshifted keys
   '(("q" (choseong-bieub   . 1) (jongseong-bieub   . (3 4)))
@@ -1868,18 +1868,11 @@
          (context-update-preedit bc segments)))))

(define (byeoru-key-press-handler bc key key-state)
-
-;;    (if (ichar-control? key)     ; doesn't seem to work.
-;;     (im-commit-raw bc)
-
  (if (byeoru-context-on bc)
      (if (eq? (byeoru-context-mode bc) 'hangul)
          (byeoru-proc-input-state bc key key-state)
          (byeoru-proc-other-states bc key key-state))
      (byeoru-proc-raw-state bc key key-state))
-
-;;     )
-
  (byeoru-update-preedit bc))

(define (byeoru-key-release-handler bc key key-state)
@@ -1888,21 +1881,31 @@
      ;; don't discard key release event for apps
      (im-commit-raw bc)))

-;; Check mouse click while composing, converting, etc.
+(define (byeoru-deactivate-candidate-selector bc)
+  (if (not (eq? (byeoru-context-mode bc) 'hangul))
+      (im-deactivate-candidate-selector bc)))
+
(define (byeoru-reset-handler bc)
  (if (byeoru-context-on bc)
      (begin
+       (byeoru-deactivate-candidate-selector bc)
        (byeoru-flush-automata bc)
-       (byeoru-commit bc (byeoru-make-whole-string bc))
+       ;; reset-handler does not commit a string
        (byeoru-clear! bc)
        (byeoru-update-preedit bc))))

(define (byeoru-focus-out-handler bc)
  (if (byeoru-context-on bc)
      (begin
-       (byeoru-flush-automata bc)
-       (byeoru-commit bc (byeoru-make-whole-string bc))
-       (byeoru-clear! bc)
+       (byeoru-deactivate-candidate-selector bc)
+       (byeoru-flush bc)
+       (byeoru-update-preedit bc))))
+
+(define (byeoru-displace-handler bc)
+  (if (byeoru-context-on bc)
+      (begin
+       (byeoru-deactivate-candidate-selector bc)
+       (byeoru-flush bc)
        (byeoru-update-preedit bc))))

(define (byeoru-get-candidate-handler bc idx accel-enum-hint)
@@ -1951,7 +1954,7 @@
 #f
 byeoru-focus-out-handler
 #f
- #f
+ byeoru-displace-handler
)

;; Local Variables:

Reply via email to