Author: yamakenz
Date: Fri Jul 20 01:06:36 2007
New Revision: 4755
Modified:
trunk/scm/im.scm
trunk/uim/uim-func.c
Log:
* uim/uim-func.c
- (im_get_raw_key_str): Removed
- (uim_init_im_subrs): Remove im-get-raw-key-str initialization
* scm/im.scm
- (im-get-raw-key-str): New procedure
Modified: trunk/scm/im.scm
==============================================================================
--- trunk/scm/im.scm (original)
+++ trunk/scm/im.scm Fri Jul 20 01:06:36 2007
@@ -384,7 +384,17 @@
c
(im-retrieve-context c))
#t)))
-
+
+;; Deprecated
+(define im-get-raw-key-str
+ (lambda (key state)
+ (and (integer? key)
+ (<= key 255)
+ (integer? state)
+ (or (= state 0)
+ (= state (assq-cdr 'Shift_key key-state-alist)))
+ (charcode->string (ichar-upcase key)))))
+
;;
;; dispatchers
Modified: trunk/uim/uim-func.c
==============================================================================
--- trunk/uim/uim-func.c (original)
+++ trunk/uim/uim-func.c Fri Jul 20 01:06:36 2007
@@ -149,31 +149,6 @@
}
static uim_lisp
-im_get_raw_key_str(uim_lisp key_, uim_lisp key_state_)
-{
- int key;
- int key_state = uim_scm_c_int(key_state_);
- char buf[2];
-
- if (uim_scm_integerp(key_)) {
- key = uim_scm_c_int(key_);
- } else {
- return uim_scm_f();
- }
- if ((key_state != 0 && key_state != UMod_Shift) ||
- key > 255) {
- return uim_scm_f();
- }
-
- buf[0] = key;
- buf[1] = 0;
- if (key_state == UMod_Shift) {
- buf[0] = toupper((unsigned char)buf[0]);
- }
- return uim_scm_make_str(buf);
-}
-
-static uim_lisp
im_set_encoding(uim_lisp uc_, uim_lisp enc_)
{
uim_context uc;
@@ -490,7 +465,4 @@
uim_scm_init_subr_1("im-raise-configuration-change",
raise_configuration_change);
uim_scm_init_subr_2("im-switch-app-global-im", switch_app_global_im);
uim_scm_init_subr_2("im-switch-system-global-im", switch_system_global_im);
-
- /* should be replaced with generic Scheme code */
- uim_scm_init_subr_2("im-get-raw-key-str", im_get_raw_key_str);
}