[uim-commit] r438 - trunk/scm

yamaken at freedesktop.org yamaken at freedesktop.org
Mon Jan 31 11:55:39 PST 2005


Author: yamaken
Date: 2005-01-31 11:55:37 -0800 (Mon, 31 Jan 2005)
New Revision: 438

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

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


Modified: trunk/scm/prime-custom.scm
===================================================================
--- trunk/scm/prime-custom.scm	2005-01-31 19:36:09 UTC (rev 437)
+++ trunk/scm/prime-custom.scm	2005-01-31 19:55:37 UTC (rev 438)
@@ -106,3 +106,70 @@
 ;  '(boolean)
 ;  "Use numeral key to select candidate directly"
 ;  "long description will be here.")
+
+
+;;
+;; toolbar
+;;
+
+;; Can't be unified with action definitions in prime.scm until uim
+;; 0.4.6.
+(define prime-input-mode-indication-alist
+  (list
+   (list 'action_prime_mode_latin
+	 'figure_prime_mode_latin
+	 "P"
+	 (N_ "Direct input")
+	 (N_ "PRIME off"))
+   (list 'action_prime_mode_hiragana
+	 'figure_prime_mode_hiragana
+	 "¤×"
+	 (N_ "Japanese")
+	 (N_ "PRIME on"))
+   (list 'action_prime_mode_wide_latin
+	 'figure_prime_mode_wide_latin
+	 "£Ð"
+	 (N_ "Fullwidth Alphanumeric")
+	 (N_ "Fullwidth Alphanumeric input mode"))))
+
+(define prime-widgets '(widget_prime_input_mode))
+
+;;; Input mode
+
+(define-custom 'default-widget_prime_input_mode 'action_prime_mode_latin
+  '(prime toolbar)
+  (cons 'choice
+	(map indication-alist-entry-extract-choice
+	     prime-input-mode-indication-alist))
+  (_ "Default input mode")
+  (_ "long description will be here."))
+
+(define-custom 'prime-input-mode-actions
+               (map car prime-input-mode-indication-alist)
+  '(prime toolbar)
+  (cons 'ordered-list
+	(map indication-alist-entry-extract-choice
+	     prime-input-mode-indication-alist))
+  (_ "Input mode menu items")
+  (_ "long description will be here."))
+
+;; value dependency
+(custom-add-hook 'prime-input-mode-actions
+		 'custom-set-hooks
+		 (lambda ()
+		   (custom-choice-range-reflect-olist-val
+		    'default-widget_prime_input_mode
+		    'prime-input-mode-actions
+		    prime-input-mode-indication-alist)))
+
+;; dynamic reconfiguration
+(custom-add-hook 'default-widget_prime_input_mode
+		 'custom-set-hooks
+		 (lambda ()
+		   prime-configure-widgets))
+
+(custom-add-hook 'prime-input-mode-actions
+		 'custom-set-hooks
+		 (lambda ()
+		   prime-configure-widgets))
+

Modified: trunk/scm/prime.scm
===================================================================
--- trunk/scm/prime.scm	2005-01-31 19:36:09 UTC (rev 437)
+++ trunk/scm/prime.scm	2005-01-31 19:55:37 UTC (rev 438)
@@ -309,23 +309,6 @@
 
 ;;;; ------------------------------------------------------------
 
-;; widgets and actions
-
-;; widgets
-(define prime-widgets '(widget_prime_input_mode))
-
-;; default activity for each widgets
-(define default-widget_prime_input_mode 'action_prime_mode_latin)
-
-;; actions of widget_prime_input_mode
-(define prime-input-mode-actions
-  '(action_prime_mode_latin
-    action_prime_mode_hiragana
-    action_prime_mode_wide_latin))
-
-
-;;;; ------------------------------------------------------------
-
 ;;; implementations
 
 (define prime-mode-latin      0)



More information about the Uim-commit mailing list