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

« back to all changes in this revision

Viewing changes to scm/m17nlib.scm

  • Committer: Bazaar Package Importer
  • Author(s): Masahito Omote
  • Date: 2007-04-21 03:46:09 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070421034609-gpcurkutp8vaysqj
Tags: 1:1.4.1-3
* Switch to dh_gtkmodules for the gtk 2.10 transition (Closes:
  #419318)
  - debian/control: Add ${misc:Depends} and remove libgtk2.0-bin on
    uim-gtk2.0.
  - debian/uim-gtk2.0.post{inst,rm}: Removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
;;;
2
 
;;; Copyright (c) 2003-2006 uim Project http://uim.freedesktop.org/
 
2
;;; Copyright (c) 2003-2007 uim Project http://uim.freedesktop.org/
3
3
;;;
4
4
;;; All rights reserved.
5
5
;;;
169
169
             mc (m17nlib-lib-get-candidate-index mid))
170
170
            (m17nlib-context-set-showing-candidate! mc #t)))
171
171
 
172
 
      (if (and showing-candidate?
 
172
      (if (and (m17nlib-context-showing-candidate mc)
173
173
               (m17nlib-lib-candidate-show? mid))
174
174
          (im-select-candidate mc (m17nlib-lib-get-candidate-index mid))))))
175
175
 
198
198
(define m17nlib-construct-key
199
199
  (lambda (key key-state)
200
200
    (if (symbol? key)
201
 
         (cdr (assq key m17nlib-key-translation-alist))
202
 
         (if (control-key-mask key-state)
203
 
             (charcode->string (char-upcase key))
204
 
             (charcode->string key)))))
 
201
        (let ((mkey (assq key m17nlib-key-translation-alist)))
 
202
          (if mkey
 
203
              (cdr mkey)
 
204
              ""))
 
205
        (if (control-key-mask key-state)
 
206
            (charcode->string (char-upcase key))
 
207
            (charcode->string key)))))
205
208
 
206
209
(define m17nlib-proc-direct-state
207
210
  (lambda (mc key key-state)
307
310
 
308
311
(define m17nlib-reset-handler
309
312
  (lambda (mc)
310
 
    #f))
 
313
    (let ((mid (m17nlib-context-mc-id mc)))
 
314
      (m17nlib-lib-push-symbol-key mid "input-reset"))))
 
315
 
 
316
(define m17nlib-focus-in-handler
 
317
  (lambda (mc)
 
318
    (let ((mid (m17nlib-context-mc-id mc)))
 
319
      (m17nlib-lib-push-symbol-key mid "input-focus-in")
 
320
      (m17nlib-update-preedit mc))))
 
321
 
 
322
(define m17nlib-focus-out-handler
 
323
  (lambda (mc)
 
324
    (let ((mid (m17nlib-context-mc-id mc)))
 
325
      (m17nlib-lib-push-symbol-key mid "input-focus-out")
 
326
      (m17nlib-update-preedit mc))))
 
327
 
 
328
(define m17nlib-displace-handler
 
329
  (lambda (mc)
 
330
    (let ((mid (m17nlib-context-mc-id mc)))
 
331
      (m17nlib-lib-push-symbol-key mid "input-focus-move")
 
332
      (m17nlib-update-preedit mc))))
311
333
 
312
334
(define m17nlib-get-candidate-handler
313
335
  (lambda (mc idx accel-enum-hint)
362
384
               m17nlib-get-candidate-handler
363
385
               m17nlib-set-candidate-index-handler
364
386
               context-prop-activate-handler
 
387
               #f
 
388
               m17nlib-focus-in-handler
 
389
               m17nlib-focus-out-handler
 
390
               #f
 
391
               m17nlib-displace-handler
365
392
               ))
366
393
              (m17nlib-register (+ i 1) nr-im))
367
394
        ())))