[uim-commit] r437 - trunk/scm

yamaken at freedesktop.org yamaken at freedesktop.org
Mon Jan 31 11:36:12 PST 2005


Author: yamaken
Date: 2005-01-31 11:36:09 -0800 (Mon, 31 Jan 2005)
New Revision: 437

Modified:
   trunk/scm/skk-custom.scm
   trunk/scm/skk.scm
Log:
* This commit makes toolbar of SKK configurable via uim-pref

* scm/skk.scm
  - (skk-widgets, default-widget_skk_input_mode,
    skk-input-mode-actions): Move to skk-custom.scm as custom variable
* scm/skk-custom.scm
  - (skk-input-mode-indication-alist): New variable
  - (skk-widgets): Moved from skk.scm as ordinary variable
  - (custom default-widget_skk_input_mode, custom
    skk-input-mode-actions, ): New custom variable
  - Add several hooks to relate the new custom variables


Modified: trunk/scm/skk-custom.scm
===================================================================
--- trunk/scm/skk-custom.scm	2005-01-31 19:25:05 UTC (rev 436)
+++ trunk/scm/skk-custom.scm	2005-01-31 19:36:09 UTC (rev 437)
@@ -141,3 +141,80 @@
   '(pathname)
   (_ "Personal dictionary file (dedicated to uim)")
   (_ "long description will be here."))
+
+
+;;
+;; toolbar
+;;
+
+;; Can't be unified with action definitions in skk.scm until uim
+;; 0.4.6.
+(define skk-input-mode-indication-alist
+  (list
+   (list 'action_skk_latin
+	 'figure_ja_latin
+	 "s"
+	 (N_ "Direct input")
+	 (N_ "Direct input mode"))
+   (list 'action_skk_hiragana
+	 'figure_ja_hiragana
+	 "¤¨"
+	 (N_ "Hiragana")
+	 (N_ "Hiragana input mode"))
+   (list 'action_skk_katakana
+	 'figure_ja_katakana
+	 "¥¨"
+	 (N_ "Katakana")
+	 (N_ "Katakana input mode"))
+   (list 'action_skk_hankana
+	 'figure_ja_hankana
+	 "Ž´"
+	 (N_ "Halfwidth Katakana")
+	 (N_ "Halfwidth Katakana input mode"))
+   (list 'action_skk_wide_latin
+	 'figure_ja_wide_latin
+	 "£Ó"
+	 (N_ "Fullwidth Alphanumeric")
+	 (N_ "Fullwidth Alphanumeric input mode"))))
+
+(define skk-widgets '(widget_skk_input_mode))
+
+;;; Input mode
+
+(define-custom 'default-widget_skk_input_mode 'action_skk_latin
+  '(skk toolbar)
+  (cons 'choice
+	(map indication-alist-entry-extract-choice
+	     skk-input-mode-indication-alist))
+  (_ "Default input mode")
+  (_ "long description will be here."))
+
+(define-custom 'skk-input-mode-actions
+               (map car skk-input-mode-indication-alist)
+  '(skk toolbar)
+  (cons 'ordered-list
+	(map indication-alist-entry-extract-choice
+	     skk-input-mode-indication-alist))
+  (_ "Input mode menu items")
+  (_ "long description will be here."))
+
+;; value dependency
+(custom-add-hook 'skk-input-mode-actions
+		 'custom-set-hooks
+		 (lambda ()
+		   (custom-choice-range-reflect-olist-val
+		    'default-widget_skk_input_mode
+		    'skk-input-mode-actions
+		    skk-input-mode-indication-alist)))
+
+;; dynamic reconfiguration
+(custom-add-hook 'default-widget_skk_input_mode
+		 'custom-set-hooks
+		 (lambda ()
+		   skk-configure-widgets))
+
+(custom-add-hook 'skk-input-mode-actions
+		 'custom-set-hooks
+		 (lambda ()
+		   skk-configure-widgets))
+

Modified: trunk/scm/skk.scm
===================================================================
--- trunk/scm/skk.scm	2005-01-31 19:25:05 UTC (rev 436)
+++ trunk/scm/skk.scm	2005-01-31 19:36:09 UTC (rev 437)
@@ -131,25 +131,6 @@
     (skk-show-cursor-on-preedit?	   . #t)
     (skk-show-candidates-with-okuri?       . #f)))
 
-;; widgets and actions
-
-;; skk-widgets which controls:
-;; - what widgets will be shown for user
-;; - shown in what order
-(define skk-widgets '(widget_skk_input_mode))
-
-;; default activity for each widgets
-(define default-widget_skk_input_mode 'action_skk_latin)
-
-;; actions of widget_skk_input_mode
-(define skk-input-mode-actions
-  '(action_skk_latin
-    action_skk_hiragana
-    action_skk_katakana
-    action_skk_hankana
-    action_skk_wide_latin))
-
-
 ;;; implementations
 
 (define skk-type-hiragana 0)



More information about the Uim-commit mailing list