~ubuntu-branches/ubuntu/hardy/uim/hardy

« back to all changes in this revision

Viewing changes to scm/anthy.scm

  • Committer: Bazaar Package Importer
  • Author(s): Masahito Omote
  • Date: 2005-12-04 13:10:42 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051204131042-ktzc8b17zi7a3cw8
Tags: 1:0.4.9.1-1
* New upstream release
* libuim0-nox, libuim-nox-dev, and libuim0-dbg-nox is now obsolete.
  Because libuim0 does not depends on X11. They now become dummy package,
  therefore you can safely remove them.
* Add --enable-debug in configure again.
* debian/patches/08_fix_privilage_escalation_CVE_2005_3149: disabled.
* Fix Error on purge because update-uim-config is not found.
  (closes: Bug#339345)
* uim-qt: New package for Qt utilities for uim. qt-immodule does not
  contained yet because of Debian's Qt3 does not support immodule and
  because uim does not recognize libqt4-dev's headers properly. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
;;; anthy.scm: Anthy for uim.
2
2
;;; charset: EUC-JP
3
3
;;;
4
 
;;; Copyright (c) 2003,2004 uim Project http://uim.freedesktop.org/
 
4
;;; Copyright (c) 2003-2005 uim Project http://uim.freedesktop.org/
5
5
;;;
6
6
;;; All rights reserved.
7
7
;;;
17
17
;;;    may be used to endorse or promote products derived from this software
18
18
;;;    without specific prior written permission.
19
19
;;;
20
 
;;; THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 
20
;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
21
21
;;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
22
;;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
 
;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 
23
;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
24
24
;;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
25
;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26
26
;;; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34
34
(require "ustr.scm")
35
35
(require "japanese.scm")
36
36
(require "japanese-kana.scm")
37
 
(require "generic-key.scm")
38
 
 
39
 
;; user configs
40
 
(define anthy-use-candidate-window? #t)
41
 
(define anthy-candidate-op-count 1)
42
 
(define anthy-nr-candidate-max 10)
43
 
(define anthy-show-segment-separator? #f)
44
 
(define anthy-segment-separator "|")
45
 
 
46
 
;; key defs
47
 
(define-key anthy-on-key? '("<Control>j" "<Control>J" generic-on-key?))
48
 
(define-key anthy-latin-key? '("<Control>j" "<Control>J" generic-off-key?))
49
 
(define-key anthy-wide-latin-key? '())
50
 
;(define-key anthy-hankaku-kana-key? '("<Control>q" "<Control>Q"))
51
 
(define-key anthy-hankaku-kana-key? '())
52
 
(define-key anthy-kana-toggle-key? '())
53
 
(define-key anthy-commit-key? 'generic-commit-key?)
54
 
(define-key anthy-commit-as-opposite-kana-key? '())
55
 
(define-key anthy-commit-as-katakana-key? "F7")
56
 
(define-key anthy-commit-as-hankana-key? "F8")
57
 
(define-key anthy-commit-as-wide-latin-key? "F9")
58
 
(define-key anthy-commit-as-latin-key? "F10")
59
 
(define-key anthy-begin-conv-key? 'generic-begin-conv-key?)
60
 
(define-key anthy-extend-segment-key? '("<Control>o" "<Control>O" "<Shift>right"))
61
 
(define-key anthy-shrink-segment-key? '("<Control>i" "<Control>I" "<Shift>left"))
62
 
(define-key anthy-next-candidate-key? 'generic-next-candidate-key?)
63
 
(define-key anthy-prev-candidate-key? 'generic-prev-candidate-key?)
64
 
(define-key anthy-next-page-key? 'generic-next-page-key?)
65
 
(define-key anthy-prev-page-key? 'generic-prev-page-key?)
66
 
(define-key anthy-cancel-key? 'generic-cancel-key?)
67
 
(define-key anthy-backspace-key? 'generic-backspace-key?)
68
 
(define-key anthy-delete-key? 'generic-delete-key?)
69
 
(define-key anthy-kill-key? 'generic-kill-key?)
70
 
(define-key anthy-kill-backward-key? 'generic-kill-backward-key?)
71
 
(define-key anthy-go-left-key? 'generic-go-left-key?)
72
 
(define-key anthy-go-right-key? 'generic-go-right-key?)
73
 
(define-key anthy-beginning-of-preedit-key? 'generic-beginning-of-preedit-key?)
74
 
(define-key anthy-end-of-preedit-key? 'generic-end-of-preedit-key?)
75
 
(define-key anthy-next-segment-key? 'generic-go-right-key?)
76
 
(define-key anthy-prev-segment-key? 'generic-go-left-key?)
77
 
 
78
 
;; implementations
 
37
(require "japanese-azik.scm")
 
38
(require-custom "generic-key-custom.scm")
 
39
(require-custom "anthy-custom.scm")
 
40
(require-custom "anthy-key-custom.scm")
 
41
 
 
42
 
 
43
;;; implementations
79
44
 
80
45
(define anthy-lib-initialized? #f)
81
46
 
82
 
(define anthy-type-hiragana 0)
83
 
(define anthy-type-katakana 1)
84
 
(define anthy-type-hankana 2)
85
 
 
86
 
(define anthy-mode-direct 0)
87
 
(define anthy-mode-hiragana 1)
88
 
(define anthy-mode-katakana 2)
89
 
(define anthy-mode-wide-latin 3)
90
 
(define anthy-mode-hankana 4)
 
47
(define anthy-type-hiragana   0)
 
48
(define anthy-type-katakana   1)
 
49
(define anthy-type-hankana    2)
 
50
(define anthy-type-latin      3)
 
51
(define anthy-type-wide-latin 4)
91
52
 
92
53
(define anthy-input-rule-roma 0)
93
54
(define anthy-input-rule-kana 1)
94
55
(define anthy-input-rule-azik 2)
95
56
 
 
57
(define anthy-prepare-activation
 
58
  (lambda (ac)
 
59
    (anthy-flush ac)
 
60
    (anthy-update-preedit ac)))
 
61
 
 
62
(register-action 'action_anthy_hiragana
 
63
;;               (indication-alist-indicator 'action_anthy_hiragana
 
64
;;                                           anthy-input-mode-indication-alist)
 
65
                 (lambda (ac) ;; indication handler
 
66
                   '(figure_ja_hiragana
 
67
                     "��"
 
68
                     "�Ҥ餬��"
 
69
                     "�Ҥ餬�����ϥ⡼��"))
 
70
 
 
71
                 (lambda (ac) ;; activity predicate
 
72
                   (and (anthy-context-on ac)
 
73
                        (= (anthy-context-kana-mode ac)
 
74
                           anthy-type-hiragana)))
 
75
 
 
76
                 (lambda (ac) ;; action handler
 
77
                   (anthy-prepare-activation ac)
 
78
                   (anthy-context-set-on! ac #t)
 
79
                   (anthy-context-set-kana-mode! ac anthy-type-hiragana)))
 
80
 
 
81
(register-action 'action_anthy_katakana
 
82
;;               (indication-alist-indicator 'action_anthy_katakana
 
83
;;                                           anthy-input-mode-indication-alist)
 
84
                 (lambda (ac)
 
85
                   '(figure_ja_katakana
 
86
                     "��"
 
87
                     "��������"
 
88
                     "�����������ϥ⡼��"))
 
89
                 (lambda (ac)
 
90
                   (and (anthy-context-on ac)
 
91
                        (= (anthy-context-kana-mode ac)
 
92
                           anthy-type-katakana)))
 
93
                 (lambda (ac)
 
94
                   (anthy-prepare-activation ac)
 
95
                   (anthy-context-set-on! ac #t)
 
96
 
 
97
                   (if (= anthy-input-rule-kana
 
98
                          (anthy-context-input-rule ac))
 
99
                       (rk-context-set-rule! (anthy-context-rkc ac)
 
100
                                             ja-kana-katakana-rule))
 
101
                   (anthy-context-set-kana-mode! ac anthy-type-katakana)))
 
102
 
 
103
(register-action 'action_anthy_hankana
 
104
;;               (indication-alist-indicator 'action_anthy_hankana
 
105
;;                                           anthy-input-mode-indication-alist)
 
106
                 (lambda (ac)
 
107
                   '(figure_ja_hankana
 
108
                     "��"
 
109
                     "Ⱦ�ѥ�������"
 
110
                     "Ⱦ�ѥ����������ϥ⡼��"))
 
111
                 (lambda (ac)
 
112
                   (and (anthy-context-on ac)
 
113
                        (= (anthy-context-kana-mode ac)
 
114
                           anthy-type-hankana)))
 
115
                 (lambda (ac)
 
116
                   (anthy-prepare-activation ac)
 
117
                   (anthy-context-set-on! ac #t)
 
118
                   (anthy-context-set-kana-mode! ac anthy-type-hankana)))
 
119
 
 
120
(register-action 'action_anthy_direct
 
121
;;               (indication-alist-indicator 'action_anthy_direct
 
122
;;                                           anthy-input-mode-indication-alist)
 
123
                 (lambda (ac)
 
124
                   '(figure_ja_direct
 
125
                     "a"
 
126
                     "ľ������"
 
127
                     "ľ��(̵�Ѵ�)���ϥ⡼��"))
 
128
                 (lambda (ac)
 
129
                   (and (not (anthy-context-on ac))
 
130
                        (not (anthy-context-wide-latin ac))))
 
131
                 (lambda (ac)
 
132
                   (anthy-prepare-activation ac)
 
133
                   (anthy-context-set-on! ac #f)
 
134
                   (anthy-context-set-wide-latin! ac #f)))
 
135
 
 
136
(register-action 'action_anthy_zenkaku
 
137
;;               (indication-alist-indicator 'action_anthy_zenkaku
 
138
;;                                           anthy-input-mode-indication-alist)
 
139
                 (lambda (ac)
 
140
                   '(figure_ja_zenkaku
 
141
                     "��"
 
142
                     "���ѱѿ�"
 
143
                     "���ѱѿ����ϥ⡼��"))
 
144
                 (lambda (ac)
 
145
                   (and (not (anthy-context-on ac))
 
146
                        (anthy-context-wide-latin ac)))
 
147
                 (lambda (ac)
 
148
                   (anthy-prepare-activation ac)
 
149
                   (anthy-context-set-on! ac #f)
 
150
                   (anthy-context-set-wide-latin! ac #t)))
 
151
 
 
152
(register-action 'action_anthy_roma
 
153
;;               (indication-alist-indicator 'action_anthy_roma
 
154
;;                                           anthy-kana-input-method-indication-alist)
 
155
                 (lambda (ac)
 
156
                   '(figure_ja_roma
 
157
                     "��"
 
158
                     "�����޻�"
 
159
                     "�����޻����ϥ⡼��"))
 
160
                 (lambda (ac)
 
161
                   (= (anthy-context-input-rule ac)
 
162
                      anthy-input-rule-roma))
 
163
                 (lambda (ac)
 
164
                   (anthy-prepare-activation ac)
 
165
                   (rk-context-set-rule! (anthy-context-rkc ac)
 
166
                                         ja-rk-rule)
 
167
                   (anthy-context-set-input-rule! ac anthy-input-rule-roma)))
 
168
 
 
169
(register-action 'action_anthy_kana
 
170
;;               (indication-alist-indicator 'action_anthy_kana
 
171
;;                                           anthy-kana-input-method-indication-alist)
 
172
                 (lambda (ac)
 
173
                   '(figure_ja_kana
 
174
                     "��"
 
175
                     "����"
 
176
                     "�������ϥ⡼��"))
 
177
                 (lambda (ac)
 
178
                   (= (anthy-context-input-rule ac)
 
179
                      anthy-input-rule-kana))
 
180
                 (lambda (ac)
 
181
                   (anthy-prepare-activation ac)
 
182
                   (rk-context-set-rule! (anthy-context-rkc ac)
 
183
                                         (if (= (anthy-context-kana-mode ac)
 
184
                                                anthy-type-katakana)
 
185
                                                ja-kana-katakana-rule
 
186
                                                ja-kana-hiragana-rule))
 
187
 
 
188
                   (anthy-context-set-input-rule! ac anthy-input-rule-kana)
 
189
                   ;;(define-key anthy-kana-toggle-key? "")
 
190
                   ;;(define-key anthy-latin-key? generic-on-key?)
 
191
                   ;;(define-key anthy-wide-latin-key? "")
 
192
                   ))
 
193
 
 
194
(register-action 'action_anthy_azik
 
195
;;               (indication-alist-indicator 'action_anthy_azik
 
196
;;                                           anthy-kana-input-method-indication-alist)
 
197
                 (lambda (ac)
 
198
                   '(figure_ja_azik
 
199
                     "��"
 
200
                     "AZIK"
 
201
                     "AZIK��ĥ�����޻����ϥ⡼��"))
 
202
                 (lambda (ac)
 
203
                   (= (anthy-context-input-rule ac)
 
204
                      anthy-input-rule-azik))
 
205
                 (lambda (ac)
 
206
                   (anthy-prepare-activation ac)
 
207
                   (rk-context-set-rule! (anthy-context-rkc ac)
 
208
                                         ja-azik-rule)
 
209
                   (anthy-context-set-input-rule! ac anthy-input-rule-azik)))
 
210
 
 
211
;; Update widget definitions based on action configurations. The
 
212
;; procedure is needed for on-the-fly reconfiguration involving the
 
213
;; custom API
 
214
(define anthy-configure-widgets
 
215
  (lambda ()
 
216
    (register-widget 'widget_anthy_input_mode
 
217
                     (activity-indicator-new anthy-input-mode-actions)
 
218
                     (actions-new anthy-input-mode-actions))
 
219
 
 
220
    (register-widget 'widget_anthy_kana_input_method
 
221
                     (activity-indicator-new anthy-kana-input-method-actions)
 
222
                     (actions-new anthy-kana-input-method-actions))
 
223
    (context-list-replace-widgets! 'anthy anthy-widgets)))
 
224
 
96
225
(define anthy-context-rec-spec
97
226
  (append
98
227
   context-rec-spec
99
228
   (list
100
229
    (list 'on                 #f)
101
230
    (list 'converting         #f)
 
231
    (list 'transposing        #f)
 
232
    (list 'transposing-type    0)
102
233
    (list 'ac-id              #f) ;; anthy-context-id
103
234
    (list 'preconv-ustr       #f) ;; preedit strings
104
235
    (list 'rkc                #f)
121
252
         (set! anthy-lib-initialized? (anthy-lib-init)))
122
253
     (if anthy-lib-initialized?
123
254
         (anthy-context-set-ac-id! ac (anthy-lib-alloc-context)))
 
255
     (anthy-context-set-widgets! ac anthy-widgets)
124
256
     (anthy-context-set-rkc! ac rkc)
125
257
     (anthy-context-set-preconv-ustr! ac (ustr-new))
126
258
     (anthy-context-set-raw-ustr! ac (ustr-new))
127
259
     (anthy-context-set-segments! ac (ustr-new))
128
 
     (anthy-flush ac)
129
 
     (anthy-context-set-on! ac #f)
130
260
 
131
261
     ;; 2004-08-26 Takuro Ashie <ashie@homa.ne.jp>
132
262
     ;;   * I think load-kana-table should be marked as depracated.
158
288
           (residual-kana (rk-peek-terminal-match rkc))
159
289
           (rule (anthy-context-input-rule ac))
160
290
           (preconv-str (anthy-context-preconv-ustr ac))
161
 
           (extract-kana (lambda (entry)
162
 
                           (nth kana entry))))
 
291
           (extract-kana
 
292
            (if (= rule anthy-input-rule-kana)
 
293
                (lambda (entry) (car entry))
 
294
                (lambda (entry) (list-ref entry kana)))))
 
295
 
163
296
      (string-append
164
297
       (string-append-map-ustr-former extract-kana preconv-str)
165
298
       (if convert-pending-into-kana?
195
328
       (ja-raw-string-list-to-valid-roma
196
329
        (append left-str
197
330
                (if (null? residual-kana)
198
 
                    right-str
 
331
                    (begin
 
332
                      (if (null? right-str)
 
333
                          (list pending)
 
334
                          (append right-str (list pending))))
199
335
                    (begin
200
336
                      (rk-flush rkc)
201
337
                      (if (null? right-str)
202
338
                          (list pending)
203
 
                          (append (list pending) right-str))))))
 
339
                          (append right-str (list pending)))))))
204
340
       wide?))))
205
341
 
206
342
(define anthy-init-handler
207
343
  (lambda (id im arg)
208
 
    (let ((ac (anthy-context-new id im)))
209
 
      (im-clear-mode-list ac)
210
 
      (im-pushback-mode-list ac "ľ������")
211
 
      (im-pushback-mode-list ac "�Ҥ餬��")
212
 
      (im-pushback-mode-list ac "��������")
213
 
      (im-pushback-mode-list ac "���ѱѿ�")
214
 
      (im-pushback-mode-list ac "Ⱦ�ѥ�������")
215
 
      (im-update-mode-list ac)
216
 
      (im-update-mode ac 0)
217
 
      (anthy-update-prop-list ac)
218
 
      ac)))
 
344
    (anthy-context-new id im)))
219
345
 
220
346
(define anthy-release-handler
221
347
  (lambda (ac)
222
348
    (let ((ac-id (anthy-context-ac-id ac)))
223
 
      (anthy-lib-free-context ac-id))))
224
 
 
225
 
(define anthy-mode-handler
226
 
  (lambda (ac mode)
227
 
    (anthy-flush ac)
228
 
    (cond
229
 
     ((= mode anthy-mode-direct)
230
 
      (anthy-context-set-on! ac #f)
231
 
      (anthy-context-set-wide-latin! ac #f))
232
 
     ((= mode anthy-mode-hiragana)
233
 
      (anthy-context-set-on! ac #t)
234
 
      (anthy-context-set-kana-mode! ac anthy-type-hiragana))
235
 
     ((= mode anthy-mode-katakana)
236
 
      (anthy-context-set-on! ac #t)
237
 
      (anthy-context-set-kana-mode! ac anthy-type-katakana))
238
 
     ((= mode anthy-mode-wide-latin)
239
 
      (anthy-context-set-on! ac #f)
240
 
      (anthy-context-set-wide-latin! ac #t))
241
 
     ((= mode anthy-mode-hankana)
242
 
      (anthy-context-set-on! ac #t)
243
 
      (anthy-context-set-kana-mode! ac anthy-type-hankana)))
244
 
    (anthy-update-preedit ac)
245
 
    (anthy-update-prop-label ac)
246
 
    (anthy-update-prop-list ac))
247
 
  ())
 
349
      (if (number? ac-id)
 
350
          (anthy-lib-free-context ac-id)))))
248
351
 
249
352
(define anthy-flush
250
353
  (lambda (ac)
252
355
    (ustr-clear! (anthy-context-preconv-ustr ac))
253
356
    (ustr-clear! (anthy-context-raw-ustr ac))
254
357
    (ustr-clear! (anthy-context-segments ac))
255
 
    (anthy-context-set-on! ac #t)
 
358
    (anthy-context-set-transposing! ac #f)
256
359
    (anthy-context-set-converting! ac #f)
 
360
    (if (anthy-context-candidate-window ac)
 
361
          (im-deactivate-candidate-selector ac))
257
362
    (anthy-context-set-candidate-window! ac #f)
258
363
    (anthy-context-set-candidate-op-count! ac 0)))
259
364
 
267
372
  (lambda (ac)
268
373
    (if (not (anthy-context-commit-raw ac))
269
374
        (let ((segments (if (anthy-context-on ac)
270
 
                            (if (anthy-context-converting ac)
271
 
                                (anthy-converting-state-preedit ac)
272
 
                                (anthy-input-state-preedit ac))
 
375
                            (if (anthy-context-transposing ac)
 
376
                                (anthy-context-transposing-state-preedit ac)
 
377
                                (if (anthy-context-converting ac)
 
378
                                    (anthy-converting-state-preedit ac)
 
379
                                    (anthy-input-state-preedit ac)))
273
380
                            ())))
274
381
          (context-update-preedit ac segments))
275
382
        (anthy-context-set-commit-raw! ac #f))))
277
384
(define anthy-proc-raw-state
278
385
  (lambda (ac key key-state)
279
386
    (if (anthy-on-key? key key-state)
280
 
        (begin
281
 
          (anthy-begin-input ac)
282
 
          (anthy-update-mode ac)
283
 
          (anthy-update-prop-label ac))
 
387
        (anthy-begin-input ac)
284
388
        (anthy-commit-raw ac))))
285
389
 
286
390
(define anthy-begin-conv
317
421
        (begin
318
422
          (anthy-flush ac)
319
423
          (anthy-context-set-on! ac #f)
320
 
          (anthy-context-set-wide-latin! ac #t)
321
 
          (anthy-update-mode ac)
322
 
          (anthy-update-prop-label ac)))
 
424
          (anthy-context-set-wide-latin! ac #t)))
323
425
          
324
426
       ((anthy-latin-key? key key-state)
325
427
           (begin
326
428
             (anthy-flush ac)
327
429
             (anthy-context-set-on! ac #f)
328
 
             (anthy-context-set-wide-latin! ac #f)
329
 
             (anthy-update-mode ac)
330
 
             (anthy-update-prop-label ac)))
 
430
             (anthy-context-set-wide-latin! ac #f)))
331
431
 
332
432
       ((anthy-backspace-key? key key-state)
333
433
        (anthy-commit-raw ac))
336
436
        (anthy-commit-raw ac))
337
437
       
338
438
       ((anthy-hankaku-kana-key? key key-state)
339
 
           (begin 
340
 
             (anthy-context-set-kana-mode! ac anthy-type-hankana)
341
 
             (anthy-update-mode ac)
342
 
             (anthy-update-prop-label ac)))
 
439
        (anthy-context-set-kana-mode! ac anthy-type-hankana))
343
440
 
344
441
       ((anthy-kana-toggle-key? key key-state)
345
 
        (begin 
346
 
          (anthy-context-kana-toggle ac)
347
 
          (anthy-update-mode ac)
348
 
          (anthy-update-prop-label ac)))
 
442
        (anthy-context-kana-toggle ac))
349
443
 
350
444
       ;; modifiers (except shift) => ignore
351
445
       ((and (modifier-key-mask key-state)
379
473
    (or (not (ustr-empty? (anthy-context-preconv-ustr ac)))
380
474
        (> (length (rk-pending (anthy-context-rkc ac))) 0))))
381
475
 
 
476
(define anthy-proc-transposing-state
 
477
  (lambda (ac key key-state)
 
478
    (cond
 
479
     ((anthy-transpose-as-katakana-key? key key-state)
 
480
      (anthy-context-set-transposing-type! ac anthy-type-katakana))
 
481
 
 
482
     ((anthy-transpose-as-hankana-key? key key-state)
 
483
      (anthy-context-set-transposing-type! ac anthy-type-hankana))
 
484
 
 
485
     ((anthy-transpose-as-latin-key? key key-state)
 
486
      (anthy-context-set-transposing-type! ac anthy-type-latin))
 
487
 
 
488
     ((anthy-transpose-as-wide-latin-key? key key-state)
 
489
      (anthy-context-set-transposing-type! ac anthy-type-wide-latin))
 
490
 
 
491
     (else
 
492
      (begin
 
493
        ; commit
 
494
        (im-commit ac (anthy-transposing-text ac))
 
495
        (anthy-flush ac)
 
496
        (if (not (anthy-commit-key? key key-state))
 
497
            (begin 
 
498
              (anthy-context-set-transposing! ac #f)
 
499
              (anthy-proc-input-state ac key key-state))))))))
 
500
 
382
501
(define anthy-proc-input-state-with-preedit
383
502
  (lambda (ac key key-state)
384
503
    (let ((preconv-str (anthy-context-preconv-ustr ac))
387
506
          (kana (anthy-context-kana-mode ac))
388
507
          (rule (anthy-context-input-rule ac)))
389
508
      (cond
390
 
       
 
509
 
391
510
       ;; begin conversion
392
511
       ((anthy-begin-conv-key? key key-state)
393
512
        (anthy-begin-conv ac))
394
513
       
395
514
       ;; backspace
396
 
       ;;
397
 
       ;; 2004-08-27 Takuro Ashie <ashie@homa.ne.jp>
398
 
       ;;   We should restore pending state of rk-context when the input-rule
399
 
       ;;   is kana mode.
400
515
       ((anthy-backspace-key? key key-state)
401
516
        (if (not (rk-backspace rkc))
402
517
            (begin
428
543
           (anthy-make-whole-string ac #t (multi-segment-opposite-kana kana)))
429
544
          (anthy-flush ac)))
430
545
 
431
 
       ;; �������ʥ⡼�ɤǤ��ʤ���ꤹ��
432
 
       ((anthy-commit-as-katakana-key? key key-state)
433
 
        (begin
434
 
          (im-commit
435
 
           ac
436
 
           (anthy-make-whole-string ac #t multi-segment-type-katakana))
437
 
          (anthy-flush ac)))
438
 
 
439
 
       ;; Ⱦ�ѥ������ʥ⡼�ɤǤ��ʤ���ꤹ��
440
 
       ((anthy-commit-as-hankana-key? key key-state)
441
 
        (begin
442
 
          (im-commit
443
 
           ac
444
 
           (anthy-make-whole-string ac #t multi-segment-type-hankana))
445
 
          (anthy-flush ac)))
446
 
 
447
 
       ;; ���ʤ�ѿ������ᤷ�Ƴ��ꤹ��
448
 
       ((anthy-commit-as-latin-key? key key-state)
449
 
        (begin
450
 
          (im-commit
451
 
           ac
452
 
           (anthy-make-whole-raw-string ac #f))
453
 
          (anthy-flush ac)))
454
 
 
455
 
       ;; ���ʤ����ѱѿ������ᤷ�Ƴ��ꤹ��
456
 
       ((anthy-commit-as-wide-latin-key? key key-state)
457
 
        (begin
458
 
          (im-commit
459
 
           ac
460
 
           (anthy-make-whole-raw-string ac #t))
461
 
          (anthy-flush ac)))
462
 
 
463
 
       ;; ���ߤΤ��ʤ����塢�Ҥ餬��/�������ʥ⡼�ɤ��ڤ괹����
 
546
       ;; Transposing���֤ذܹ�
 
547
       ((or (anthy-transpose-as-katakana-key?   key key-state)
 
548
            (anthy-transpose-as-hankana-key?    key key-state)
 
549
            (anthy-transpose-as-latin-key?      key key-state)
 
550
            (anthy-transpose-as-wide-latin-key? key key-state))
 
551
        (begin
 
552
          (anthy-context-set-transposing! ac #t)
 
553
          (anthy-proc-transposing-state ac key key-state)))
 
554
 
 
555
       ;; Commit current preedit string, then toggle hiragana/katakana mode.
464
556
       ((anthy-kana-toggle-key? key key-state)
465
557
        (begin
466
558
          (im-commit
467
559
           ac
468
560
           (anthy-make-whole-string ac #t kana))
469
561
          (anthy-flush ac)
470
 
          (anthy-context-kana-toggle ac)
471
 
          (anthy-update-mode ac)
472
 
          (anthy-update-prop-label ac)))
 
562
          (anthy-context-kana-toggle ac)))
473
563
 
474
564
       ;; cancel
475
565
       ((anthy-cancel-key? key key-state)
484
574
          (anthy-flush ac)))
485
575
 
486
576
       ;; left
487
 
       ;;
488
577
       ;; 2004-08-27 Takuro Ashie <ashie@homa.ne.jp>
489
578
       ;;   * We should restore pending state of rk-context when the input-rule
490
579
       ;;     is kana mode.
491
 
       ;;   * Behaviour of setting left and right string should be changed on
492
 
       ;;     kana mode.
493
580
       ((anthy-go-left-key? key key-state)
494
 
        (begin
495
 
          (ustr-cursor-move-backward! preconv-str)
496
 
          (ustr-cursor-move-backward! raw-str)))
 
581
        (anthy-context-confirm-kana! ac)
 
582
        (ustr-cursor-move-backward! preconv-str)
 
583
        (ustr-cursor-move-backward! raw-str))
 
584
 
497
585
       ;; right
498
 
       ;;
499
586
       ;; 2004-08-27 Takuro Ashie <ashie@homa.ne.jp>
500
587
       ;;   * We should restore pending state of rk-context when the input-rule
501
588
       ;;     is kana mode.
502
 
       ;;   * Behaviour of setting left and right string should be changed on
503
 
       ;;     kana mode.
504
589
       ((anthy-go-right-key? key key-state)
505
 
        (begin
506
 
          (ustr-cursor-move-forward! preconv-str)
507
 
          (ustr-cursor-move-forward! raw-str)))
 
590
        (anthy-context-confirm-kana! ac)
 
591
        (ustr-cursor-move-forward! preconv-str)
 
592
        (ustr-cursor-move-forward! raw-str))
508
593
 
509
594
       ;; beginning-of-preedit
510
 
       ;;
511
595
       ;; 2004-08-27 Takuro Ashie <ashie@homa.ne.jp>
512
 
       ;;   * Behaviour of setting left and right string should be changed on
513
 
       ;;     kana mode.
 
596
       ;;   * We should restore pending state of rk-context when the input-rule
 
597
       ;;     is kana mode.
514
598
       ((anthy-beginning-of-preedit-key? key key-state)
 
599
        (anthy-context-confirm-kana! ac)
515
600
        (ustr-cursor-move-beginning! preconv-str))
516
601
 
517
602
       ;; end-of-preedit
518
 
       ;;
519
603
       ;; 2004-08-27 Takuro Ashie <ashie@homa.ne.jp>
520
604
       ;;   * We should restore pending state of rk-context when the input-rule
521
605
       ;;     is kana mode.
522
 
       ;;   * Behaviour of setting left and right string should be changed on
523
 
       ;;     kana mode.
524
606
       ((anthy-end-of-preedit-key? key key-state)
525
 
        (ustr-cursor-move-end! preconv-str)
526
 
        ;;(rk-flush rkc)
527
 
        )
 
607
        (anthy-context-confirm-kana! ac)
 
608
        (ustr-cursor-move-end! preconv-str))
528
609
 
529
610
       ;; modifiers (except shift) => ignore
530
611
       ((and (modifier-key-mask key-state)
531
612
             (not (shift-key-mask key-state)))
532
 
        (anthy-commit-raw ac))
 
613
          #f)
533
614
 
534
615
       (else    
535
616
        (let* ((key-str (charcode->string 
542
623
          (if (and res
543
624
                   (or (list? (car res))
544
625
                       (not (string=? (car res) ""))))
545
 
              ;;
546
626
              (let ((next-pend (rk-pending rkc)))
547
 
                (ustr-insert-elem! preconv-str res)
 
627
                (if (list? (car res))
 
628
                    (ustr-insert-seq!  preconv-str res)
 
629
                    (ustr-insert-elem! preconv-str res))
548
630
                (if (and next-pend
549
631
                         (not (string=? next-pend "")))
550
632
                    (ustr-insert-elem! raw-str pend)
551
633
                    (ustr-insert-elem! raw-str (string-append pend key-str))))
552
 
              ;;
553
 
              (if (= rule anthy-input-rule-kana)
554
 
                  (ustr-insert-elem! preconv-str (list pend "" ""))))))))))
 
634
              )))))))
 
635
 
 
636
(define anthy-context-confirm-kana!
 
637
  (lambda (ac)
 
638
    (if (= (anthy-context-input-rule ac)
 
639
           anthy-input-rule-kana)
 
640
        (let* ((preconv-str (anthy-context-preconv-ustr ac))
 
641
               (rkc (anthy-context-rkc ac))
 
642
               (residual-kana (rk-peek-terminal-match rkc)))
 
643
            (if residual-kana
 
644
                (begin
 
645
                  (ustr-insert-elem! preconv-str residual-kana)
 
646
                  (rk-flush rkc)))))))
555
647
 
556
648
(define anthy-proc-input-state
557
649
  (lambda (ac key key-state)
567
659
          (cons attr anthy-segment-separator)
568
660
          #f))))
569
661
 
 
662
(define anthy-context-transposing-state-preedit
 
663
  (lambda (ac)
 
664
    (let* ((transposing-text (anthy-transposing-text ac)))
 
665
      (list (cons preedit-underline transposing-text)
 
666
            (cons preedit-cursor "")))))
 
667
 
 
668
(define anthy-transposing-text
 
669
  (lambda (ac)
 
670
    (let* ((transposing-type (anthy-context-transposing-type ac)))
 
671
      (cond
 
672
       ((= transposing-type anthy-type-katakana)
 
673
        (anthy-make-whole-string ac #t multi-segment-type-katakana))
 
674
 
 
675
       ((= transposing-type anthy-type-hankana)
 
676
        (anthy-make-whole-string ac #t multi-segment-type-hankana))
 
677
 
 
678
       ((= transposing-type anthy-type-latin)
 
679
        (anthy-make-whole-raw-string ac #f))
 
680
 
 
681
       ((= transposing-type anthy-type-wide-latin)
 
682
        (anthy-make-whole-raw-string ac #t))
 
683
       ))))
 
684
 
570
685
(define anthy-converting-state-preedit
571
686
  (lambda (ac)
572
687
    (let* ((ac-id (anthy-context-ac-id ac))
573
688
           (segments (anthy-context-segments ac))
574
689
           (cur-seg (ustr-cursor-pos segments))
575
690
           (separator (anthy-separator ac)))
576
 
      (apply
577
 
       append
578
 
       (map (lambda (seg-idx cand-idx)
579
 
              (let* ((attr (if (= seg-idx cur-seg)
580
 
                               (bit-or preedit-reverse
581
 
                                       preedit-cursor)
582
 
                               preedit-underline))
583
 
                     (cand (anthy-lib-get-nth-candidate ac-id
584
 
                                                        seg-idx cand-idx))
585
 
                     (seg (list (cons attr cand))))
586
 
                (if (and separator
587
 
                         (< 0 seg-idx))
588
 
                    (cons separator seg)
589
 
                    seg)))
590
 
            (iota (ustr-length segments))
591
 
            (ustr-whole-seq segments))))))
 
691
      (append-map
 
692
       (lambda (seg-idx cand-idx)
 
693
         (let* ((attr (if (= seg-idx cur-seg)
 
694
                          (bit-or preedit-reverse
 
695
                                  preedit-cursor)
 
696
                          preedit-underline))
 
697
                (cand (anthy-lib-get-nth-candidate ac-id seg-idx cand-idx))
 
698
                (seg (list (cons attr cand))))
 
699
           (if (and separator
 
700
                    (< 0 seg-idx))
 
701
               (cons separator seg)
 
702
               seg)))
 
703
       (iota (ustr-length segments))
 
704
       (ustr-whole-seq segments)))))
592
705
 
593
706
(define anthy-input-state-preedit
594
707
  (lambda (ac)
596
709
           (rkc (anthy-context-rkc ac))
597
710
           (pending (rk-pending rkc))
598
711
           (kana (anthy-context-kana-mode ac))
599
 
           (extract-kana (lambda (entry)
600
 
                           (nth kana entry))))
 
712
           (rule (anthy-context-input-rule ac))
 
713
           (extract-kana
 
714
            (if (= rule anthy-input-rule-kana)
 
715
                (lambda (entry) (car entry))
 
716
                (lambda (entry) (list-ref entry kana)))))
 
717
 
601
718
      (list
602
719
       (and (not (ustr-cursor-at-beginning? preconv-str))
603
720
            (cons preedit-underline
614
731
  (lambda (ac)
615
732
    (let ((ac-id (anthy-context-ac-id ac))
616
733
          (segments (anthy-context-segments ac)))
617
 
      (apply string-append
618
 
             (map (lambda (seg-idx cand-idx)
619
 
                    (anthy-lib-get-nth-candidate ac-id seg-idx cand-idx))
620
 
                  (iota (ustr-length segments))
621
 
                  (ustr-whole-seq segments))))))
 
734
      (string-append-map (lambda (seg-idx cand-idx)
 
735
                           (anthy-lib-get-nth-candidate ac-id seg-idx cand-idx))
 
736
                         (iota (ustr-length segments))
 
737
                         (ustr-whole-seq segments)))))
622
738
 
623
739
(define anthy-commit-string
624
740
  (lambda (ac)
631
747
 
632
748
(define anthy-do-commit
633
749
  (lambda (ac)
634
 
    (anthy-reset-candidate-window ac)
635
750
    (im-commit ac (anthy-get-commit-string ac))
636
751
    (anthy-commit-string ac)
 
752
    (anthy-reset-candidate-window ac)
637
753
    (anthy-flush ac)))
638
754
 
639
755
(define anthy-correct-segment-cursor
686
802
      (if (anthy-context-candidate-window ac)
687
803
          (im-select-candidate ac compensated-n)))))
688
804
 
 
805
(define anthy-move-candidate-in-page
 
806
  (lambda (ac numeralc)
 
807
    (let* ((ac-id (anthy-context-ac-id ac))
 
808
           (segments (anthy-context-segments ac))
 
809
           (cur-seg (ustr-cursor-pos segments))
 
810
           (max (anthy-lib-get-nr-candidates ac-id cur-seg))
 
811
           (n (ustr-cursor-frontside segments))
 
812
           (cur-page (if (= anthy-nr-candidate-max 0)
 
813
                         0
 
814
                         (quotient n anthy-nr-candidate-max)))
 
815
           (pageidx (- (numeral-char->number numeralc) 1))
 
816
           (compensated-pageidx (cond
 
817
                                 ((< pageidx 0) ; pressing key_0
 
818
                                  (+ pageidx 10))
 
819
                                 (else
 
820
                                  pageidx)))
 
821
           (idx (+ (* cur-page anthy-nr-candidate-max) compensated-pageidx))
 
822
           (compensated-idx (cond
 
823
                             ((>= idx max)
 
824
                              (- max 1))
 
825
                             (else
 
826
                              idx)))
 
827
           (new-op-count (+ 1 (anthy-context-candidate-op-count ac))))
 
828
      (ustr-cursor-set-frontside! segments compensated-idx)
 
829
      (anthy-context-set-candidate-op-count! ac new-op-count)
 
830
      (im-select-candidate ac compensated-idx))))
 
831
 
689
832
(define anthy-reset-candidate-window
690
833
  (lambda (ac)
691
834
    (if (anthy-context-candidate-window ac)
697
840
(define anthy-proc-converting-state
698
841
  (lambda (ac key key-state)
699
842
    (cond
 
843
     ((anthy-prev-page-key? key key-state)
 
844
      (if (anthy-context-candidate-window ac)
 
845
          (im-shift-page-candidate ac #f)))
 
846
 
 
847
     ((anthy-next-page-key? key key-state)
 
848
      (if (anthy-context-candidate-window ac)
 
849
          (im-shift-page-candidate ac #t)))
 
850
 
700
851
     ((anthy-commit-key? key key-state)
701
852
      (anthy-do-commit ac))
702
853
     
735
886
     ((anthy-cancel-key? key key-state)
736
887
      (anthy-cancel-conv ac))
737
888
 
738
 
     ((anthy-prev-page-key? key key-state)
739
 
      (if (anthy-context-candidate-window ac)
740
 
          (im-shift-page-candidate ac #f)))
741
 
 
742
 
     ((anthy-next-page-key? key key-state)
743
 
      (if (anthy-context-candidate-window ac)
744
 
          (im-shift-page-candidate ac #t)))
 
889
     ((and anthy-select-candidate-by-numeral-key?
 
890
           (numeral-char? key)
 
891
           (anthy-context-candidate-window ac))
 
892
      (anthy-move-candidate-in-page ac key))
745
893
 
746
894
     ;; don't discard shift-modified keys. Some of them ("?", "~",
747
895
     ;; etc) are used to implicit commit. Reported by [Anthy-dev 745]
766
914
      (cond
767
915
       ((anthy-on-key? key key-state)
768
916
        (anthy-flush ac)
769
 
        (anthy-update-mode ac)
770
 
        (anthy-update-prop-label ac))
 
917
        (anthy-context-set-on! ac #t))
771
918
       ((and (modifier-key-mask key-state)
772
919
             (not (shift-key-mask key-state)))
773
920
        (anthy-commit-raw ac))
782
929
    (if (control-char? key)
783
930
        (im-commit-raw ac)
784
931
        (if (anthy-context-on ac)
785
 
            (if (anthy-context-converting ac)
786
 
                (anthy-proc-converting-state ac key key-state)
787
 
                (anthy-proc-input-state ac key key-state))
 
932
            (if (anthy-context-transposing ac)
 
933
                (anthy-proc-transposing-state ac key key-state)
 
934
                (if (anthy-context-converting ac)
 
935
                    (anthy-proc-converting-state ac key key-state)
 
936
                    (anthy-proc-input-state ac key key-state)))
788
937
            (if (anthy-context-wide-latin ac)
789
938
                (anthy-proc-wide-latin ac key key-state)
790
939
                (anthy-proc-raw-state ac key key-state))))
791
940
    ;; preedit
792
 
    (anthy-update-preedit ac)))
 
941
    (anthy-update-preedit ac)
 
942
))
793
943
 
794
944
 
795
945
(define anthy-release-key-handler
813
963
    (let* ((ac-id (anthy-context-ac-id ac))
814
964
           (cur-seg (ustr-cursor-pos (anthy-context-segments ac)))
815
965
           (cand (anthy-lib-get-nth-candidate ac-id cur-seg idx)))
816
 
      (list cand (digit->string (+ idx 1))))))
 
966
      (list cand (digit->string (+ idx 1)) ""))))
817
967
 
818
968
(define anthy-set-candidate-index-handler
819
969
  (lambda (ac idx)
821
971
;    (anthy-move-segment ac 1)
822
972
    (anthy-update-preedit ac)))
823
973
 
824
 
(define anthy-prop-handler
825
 
  (lambda (ac message)
826
 
    (let* ((rkc (anthy-context-rkc ac)))
827
 
      (anthy-flush ac)
828
 
      (anthy-update-preedit ac)
829
 
      (cond
830
 
       ((string=? message
831
 
                       "prop_anthy_hiragana")
832
 
        (begin
833
 
          (anthy-context-set-on! ac #t)
834
 
          (anthy-context-set-kana-mode! ac anthy-type-hiragana)))
835
 
       ((string=? message
836
 
                       "prop_anthy_katakana")
837
 
        (begin
838
 
          (anthy-context-set-on! ac #t)
839
 
          (anthy-context-set-kana-mode! ac anthy-type-katakana)))
840
 
       ((string=? message
841
 
                       "prop_anthy_hankana")
842
 
        (begin
843
 
          (anthy-context-set-on! ac #t)
844
 
          (anthy-context-set-kana-mode! ac anthy-type-hankana)))
845
 
       ((string=? message
846
 
                       "prop_anthy_direct")
847
 
        (begin
848
 
          (anthy-context-set-on! ac #f)
849
 
          (anthy-context-set-wide-latin! ac #f)))
850
 
       ((string=? message
851
 
                       "prop_anthy_zenkaku")
852
 
        (begin
853
 
          (anthy-context-set-on! ac #f)
854
 
          (anthy-context-set-wide-latin! ac #t)))
855
 
       ((string=? message
856
 
                       "prop_anthy_roma")
857
 
        (begin
858
 
          (rk-context-set-rule! rkc ja-rk-rule)
859
 
          (anthy-context-set-input-rule! ac anthy-input-rule-roma)))
860
 
       ((string=? message
861
 
                       "prop_anthy_kana")
862
 
        (begin
863
 
          (rk-context-set-rule! rkc ja-kana-rule)
864
 
          (anthy-context-set-input-rule! ac anthy-input-rule-kana)
865
 
;         (define-key anthy-kana-toggle-key? "")
866
 
;         (define-key anthy-latin-key? generic-on-key?)
867
 
;         (define-key anthy-wide-latin-key? "")
868
 
          )))
869
 
      (anthy-update-mode ac)
870
 
      (anthy-update-prop-label ac))))
871
 
 
872
 
(define anthy-update-prop-label
873
 
  (lambda (ac)
874
 
    (let ((str "")
875
 
          (kana (anthy-context-kana-mode ac))
876
 
          (rule (anthy-context-input-rule ac)))
877
 
      (set! str
878
 
            (if (anthy-context-on ac)
879
 
                (cond
880
 
                 ((= kana anthy-type-hiragana)
881
 
                  "��\t�Ҥ餬��\n")
882
 
                 ((= kana anthy-type-katakana)
883
 
                  "��\t��������\n")
884
 
                  ((= kana anthy-type-hankana)
885
 
                   "��\tȾ�ѥ�������\n"))
886
 
                (if (anthy-context-wide-latin ac)
887
 
                    "��\t���ѱѿ�\n"
888
 
                    "a\tľ������\n")))
889
 
      (set! str
890
 
            (cond
891
 
             ((= rule anthy-input-rule-roma)
892
 
              (string-append str "��\t�����޻�\n"))
893
 
             ((= rule anthy-input-rule-kana)
894
 
              (string-append str "��\t����\n"))))
895
 
      (im-update-prop-label ac str))))
896
 
 
897
 
(define anthy-update-mode
898
 
  (lambda (ac)
899
 
    (if (anthy-context-on ac)
900
 
        (let ((kana (anthy-context-kana-mode ac)))
901
 
          (cond
902
 
           ((= kana anthy-type-hiragana)
903
 
            (im-update-mode ac anthy-mode-hiragana))
904
 
           ((= kana anthy-type-katakana)
905
 
            (im-update-mode ac anthy-mode-katakana))
906
 
           ((= kana anthy-type-hankana)
907
 
            (im-update-mode ac anthy-mode-hankana))))
908
 
        (if (anthy-context-wide-latin ac)
909
 
            (im-update-mode ac anthy-mode-wide-latin)
910
 
            (im-update-mode ac anthy-mode-direct)))
911
 
    (anthy-update-prop-label ac)
912
 
    (anthy-update-prop-list ac)))
913
 
 
914
 
(define anthy-update-prop-list
915
 
  (lambda (ac)
916
 
    (let* ((kana (anthy-context-kana-mode ac))
917
 
           (rule (anthy-context-input-rule ac))
918
 
           (str "branch\t"))
919
 
      (set! str (string-append str
920
 
                               (if (anthy-context-on ac)
921
 
                                   (cond
922
 
                                       ((= kana anthy-type-hiragana)  
923
 
                                           "��\t�Ҥ餬��\n")
924
 
                                       ((= kana anthy-type-katakana)
925
 
                                           "��\t��������\n")
926
 
                                       ((= kana anthy-type-hankana)
927
 
                                           "��\tȾ�ѥ�������\n"))
928
 
                                   (if (anthy-context-wide-latin ac)
929
 
                                       "��\t���ѱѿ�\n"
930
 
                                       "a\tľ������\n"))))
931
 
      (set! str (string-append
932
 
                 str
933
 
                 "leaf\t��\t�Ҥ餬��\t�Ҥ餬�ʤǤ�\tprop_anthy_hiragana\t"
934
 
                 (if (and (anthy-context-on ac)
935
 
                          (= kana anthy-type-hiragana))
936
 
                     "*\n"
937
 
                     "\n")
938
 
 
939
 
                 "leaf\t��\t��������\t�������ʤ����ϤǤ��ޤ�\tprop_anthy_katakana\t"
940
 
                 (if (and (anthy-context-on ac)
941
 
                          (= kana anthy-type-katakana))
942
 
                     "*\n"
943
 
                     "\n")
944
 
 
945
 
                 "leaf\t��\tȾ�ѥ�������\tȾ�ѥ������ʤ����ϤǤ��ޤ�\tprop_anthy_hankana\t"
946
 
                 (if (and (anthy-context-on ac)
947
 
                          (= kana anthy-type-hankana))
948
 
                     "*\n"
949
 
                     "\n")
950
 
 
951
 
                 "leaf\tA\tľ������\t�����쥯�ȤǤ�\tprop_anthy_direct\t"
952
 
                 (if (and (not (anthy-context-on ac))
953
 
                          (not (anthy-context-wide-latin ac)))
954
 
                     "*\n"
955
 
                     "\n")
956
 
 
957
 
                 "leaf\t��\t���ѱѿ�\t���ѱѿ��⡼��\tprop_anthy_zenkaku\t"
958
 
                 (if (and (not (anthy-context-on ac))
959
 
                          (anthy-context-wide-latin ac))
960
 
                     "*\n"
961
 
                     "\n")
962
 
 
963
 
                 "branch\t"
964
 
                 (if (= rule anthy-input-rule-roma)
965
 
                     "��\t�����޻�����\n"
966
 
                     "��\t��������\n")
967
 
 
968
 
                 "leaf\t��\t�����޻�\t�����޻�����\tprop_anthy_roma\t"
969
 
                 (if (= rule anthy-input-rule-roma)
970
 
                     "*\n"
971
 
                     "\n")
972
 
 
973
 
                 "leaf\t��\t����\t��������\tprop_anthy_kana\t"
974
 
                 (if (= rule anthy-input-rule-kana)
975
 
                     "*\n"
976
 
                     "\n")
977
 
                 ))
978
 
      (im-update-prop-list ac str)
979
 
      )))
 
974
(anthy-configure-widgets)
980
975
 
981
976
(register-im
982
977
 'anthy
983
978
 "ja"
984
979
 "EUC-JP"
985
 
 (N_ "Japanese Kana Kanji Conversion Engine, Anthy")
 
980
 anthy-im-name-label
 
981
 anthy-im-short-desc
986
982
 #f
987
983
 anthy-init-handler
988
984
 anthy-release-handler
989
 
 anthy-mode-handler
 
985
 context-mode-handler
990
986
 anthy-press-key-handler
991
987
 anthy-release-key-handler
992
988
 anthy-reset-handler
993
989
 anthy-get-candidate-handler
994
990
 anthy-set-candidate-index-handler
995
 
 anthy-prop-handler
 
991
 context-prop-activate-handler
996
992
)