[uim-commit] r444 - trunk/scm
yamaken at freedesktop.org
yamaken at freedesktop.org
Mon Jan 31 18:00:15 PST 2005
Author: yamaken
Date: 2005-01-31 18:00:12 -0800 (Mon, 31 Jan 2005)
New Revision: 444
Modified:
trunk/scm/action.scm
trunk/scm/anthy.scm
trunk/scm/canna.scm
trunk/scm/prime.scm
trunk/scm/skk.scm
Log:
* This commit enables replacing toolbar widgets configured in
preexisting context on the fly
* scm/action.scm
- (context-list-replace-widgets!): New procedure
* scm/prime.scm
- (prime-configure-widgets): Invoke context-list-replace-widgets! to
replace toolbar widgets configured in preexisting context
* scm/canna.scm
- (canna-configure-widgets): Ditto
* scm/anthy.scm
- (anthy-configure-widgets): Ditto
* scm/skk.scm
- (skk-configure-widgets): Ditto
Modified: trunk/scm/action.scm
===================================================================
--- trunk/scm/action.scm 2005-02-01 01:27:00 UTC (rev 443)
+++ trunk/scm/action.scm 2005-02-01 02:00:12 UTC (rev 444)
@@ -314,6 +314,17 @@
(context-set-widgets! context widgets)
(context-propagate-widget-configuration context))))
+;; TODO: write test
+(define context-list-replace-widgets!
+ (lambda (target-im-name widget-id-list)
+ (for-each (lambda (context)
+ (let* ((im (context-im context))
+ (name (im-name im)))
+ (and (eq? name
+ target-im-name)
+ (context-init-widgets! context widget-id-list))))
+ context-list)))
+
;; API for uim developers
(define context-update-widgets
(lambda (context)
Modified: trunk/scm/anthy.scm
===================================================================
--- trunk/scm/anthy.scm 2005-02-01 01:27:00 UTC (rev 443)
+++ trunk/scm/anthy.scm 2005-02-01 02:00:12 UTC (rev 444)
@@ -249,7 +249,8 @@
(register-widget 'widget_anthy_kana_input_method
(activity-indicator-new anthy-kana-input-method-actions)
- (actions-new anthy-kana-input-method-actions))))
+ (actions-new anthy-kana-input-method-actions))
+ (context-list-replace-widgets! 'anthy anthy-widgets)))
(define anthy-context-rec-spec
(append
Modified: trunk/scm/canna.scm
===================================================================
--- trunk/scm/canna.scm 2005-02-01 01:27:00 UTC (rev 443)
+++ trunk/scm/canna.scm 2005-02-01 02:00:12 UTC (rev 444)
@@ -214,7 +214,8 @@
(register-widget 'widget_canna_kana_input_method
(activity-indicator-new canna-kana-input-method-actions)
- (actions-new canna-kana-input-method-actions))))
+ (actions-new canna-kana-input-method-actions))
+ (context-list-replace-widgets! 'canna canna-widgets)))
(define canna-context-rec-spec
(append
Modified: trunk/scm/prime.scm
===================================================================
--- trunk/scm/prime.scm 2005-02-01 01:27:00 UTC (rev 443)
+++ trunk/scm/prime.scm 2005-02-01 02:00:12 UTC (rev 444)
@@ -358,7 +358,8 @@
(lambda ()
(register-widget 'widget_prime_input_mode
(activity-indicator-new prime-input-mode-actions)
- (actions-new prime-input-mode-actions))))
+ (actions-new prime-input-mode-actions))
+ (context-list-replace-widgets! 'prime prime-widgets)))
(define prime-context-rec-spec
(append
Modified: trunk/scm/skk.scm
===================================================================
--- trunk/scm/skk.scm 2005-02-01 01:27:00 UTC (rev 443)
+++ trunk/scm/skk.scm 2005-02-01 02:00:12 UTC (rev 444)
@@ -248,7 +248,8 @@
(lambda ()
(register-widget 'widget_skk_input_mode
(activity-indicator-new skk-input-mode-actions)
- (actions-new skk-input-mode-actions))))
+ (actions-new skk-input-mode-actions))
+ (context-list-replace-widgets! 'skk skk-widgets)))
(define skk-context-rec-spec
(append
More information about the Uim-commit
mailing list