[uim-commit] r3151 - in trunk: doc scm uim

yamaken at freedesktop.org yamaken at freedesktop.org
Wed Mar 1 20:23:45 PST 2006


Author: yamaken
Date: 2006-03-01 20:23:41 -0800 (Wed, 01 Mar 2006)
New Revision: 3151

Modified:
   trunk/doc/COMPATIBILITY
   trunk/scm/im-switcher.scm
   trunk/scm/im.scm
   trunk/uim/uim-func.c
Log:
* uim/uim-func.c
  - (switch_im, switch_app_global_im, switch_system_global_im): Make
    the argument raw-context acceptable with retrieve_uim_context()
  - (uim_init_im_subrs): Rename uim-switch-im to im-switch-im
* scm/im-switcher.scm
  - (imsw-actions):
    * Follow the renaming
    * Pass raw context instead of its ID
    * Remove some comments that explained in uim.h
* scm/im.scm
  - (switch-im, toggle-im): Follow the renaming
* doc/COMPATIBILITY
  - Add new section "Rename uim-switch-im to im-switch-im"
  - Update "Context-originated IM switching of other contexts"


Modified: trunk/doc/COMPATIBILITY
===================================================================
--- trunk/doc/COMPATIBILITY	2006-03-01 18:11:44 UTC (rev 3150)
+++ trunk/doc/COMPATIBILITY	2006-03-02 04:23:41 UTC (rev 3151)
@@ -57,13 +57,30 @@
 
 The changes are described below in most recently updated order.
 ------------------------------------------------------------------------------
+Summary: Rename uim-switch-im to im-switch-im
+Affects: uim developers
+Updates: Scheme API
+Version: 1.1.0
+Revision: ac3151
+Date: 2006-03-02
+Modifier: YamaKen
+Related:
+URL:
+Changes:
+  (removed) uim-switch-im
+      (new) im-switch-im
+Description:
+  Rename the inappropriate procedure name. And make the argument
+  raw-context acceptable with retrieve_uim_context(), likewise other
+  im-* procedures.
+------------------------------------------------------------------------------
 Summary: Context-originated IM switching of other contexts
 Affects: Bridge developers
-Updates: C API
+Updates: C API, Scheme API
 Version: 1.1.0
-Revision: ac3147, ac3148
+Revision: ac3147, ac3148, ac3150, ac3151
 Date: 2006-02-24
-Modifier: YamaKen
+Modifier: YamaKen, Etsushi
 Related: action-based IM switcher
 URL:
 Changes:

Modified: trunk/scm/im-switcher.scm
===================================================================
--- trunk/scm/im-switcher.scm	2006-03-01 18:11:44 UTC (rev 3150)
+++ trunk/scm/im-switcher.scm	2006-03-02 04:23:41 UTC (rev 3151)
@@ -68,7 +68,7 @@
     (or (assq-cdr idname imsw-iconic-label-alist)
 	imsw-default-iconic-label)))
 
-;; FIXME: the helper protocol must to be revised as codeset included
+;; FIXME: the helper protocol must be revised as codeset included
 ;; in each branches, to make the switcher widget context-encoding
 ;; independent.
 (define imsw-actions
@@ -90,28 +90,16 @@
 				      idname))
 
 			       (lambda (ctx) ;; action handler
-				 (let ((cid (context-id ctx)))
-				   (uim-switch-im cid idname)
-				   (case imsw-propagation
-				     ((focused-context)
-				      #t)
+				 (im-switch-im ctx idname)
+				 (case imsw-propagation
+				   ((focused-context)
+				    #t)
 
-				     ((app-global)
-				      ;; Performed by each bridges via the
-				      ;; callback, since the concept
-				      ;; "application global" is differently
-				      ;; mapped to a set of input context for
-				      ;; each IM environment. (i.e. an
-				      ;; application may not have dedicated
-				      ;; process)
-				      (im-switch-app-global-im cid idname))
+				   ((app-global)
+				    (im-switch-app-global-im ctx idname))
 
-				     ((system-global)
-				      ;; Performed by each bridges via the
-				      ;; callback, since some IM environments
-				      ;; do not have the concept "all context"
-				      ;; (i.e. single-context system).
-				      (im-switch-system-global-im cid idname))))))
+				   ((system-global)
+				    (im-switch-system-global-im ctx idname)))))
 	      act-name))
 	  im-list))))
 

Modified: trunk/scm/im.scm
===================================================================
--- trunk/scm/im.scm	2006-03-01 18:11:44 UTC (rev 3150)
+++ trunk/scm/im.scm	2006-03-02 04:23:41 UTC (rev 3151)
@@ -195,7 +195,7 @@
 
 (define switch-im
   (lambda (id name)
-    (uim-switch-im id (next-im name))))
+    (im-switch-im id (next-im name))))
 
 ;; im-toggle
 (define toggle-im-preserved-im #f)
@@ -210,14 +210,14 @@
 	    (set! toggle-im-alt-preserved-widget-states widget-states)
 	    (if toggle-im-preserved-im
 		(begin
-		  (uim-switch-im id toggle-im-preserved-im)
+		  (im-switch-im id toggle-im-preserved-im)
 		  (context-update-widget-states!
 		   (find-context id)
 		   toggle-im-preserved-widget-states))))
 	  (begin
 	    (set! toggle-im-preserved-im name)
 	    (set! toggle-im-preserved-widget-states widget-states)
-	    (uim-switch-im id toggle-im-alt-im)
+	    (im-switch-im id toggle-im-alt-im)
 	    (context-update-widget-states! (find-context id)
 	    			  toggle-im-alt-preserved-widget-states))))))
 

Modified: trunk/uim/uim-func.c
===================================================================
--- trunk/uim/uim-func.c	2006-03-01 18:11:44 UTC (rev 3150)
+++ trunk/uim/uim-func.c	2006-03-02 04:23:41 UTC (rev 3151)
@@ -337,6 +337,7 @@
 retrieve_uim_context(uim_lisp id)
 {
   uim_context uc;
+
   if (uim_scm_consp(id)) {  /* passed as Scheme-side input context */
     id = uim_scm_car(id);
   }
@@ -701,12 +702,15 @@
   return uim_scm_t();
 }
 
-
 static uim_lisp
 switch_im(uim_lisp id_, uim_lisp name_)
 {
-  const char *name= uim_scm_refer_c_str(name_);
-  uim_context uc = uim_find_context(uim_scm_c_int(id_));
+  uim_context uc;
+  const char *name;
+
+  uc = retrieve_uim_context(id_);
+  name= uim_scm_refer_c_str(name_);
+
   uim_switch_im(uc, name);
   if (uc->configuration_changed_cb)
     uc->configuration_changed_cb(uc->ptr);
@@ -718,10 +722,9 @@
 switch_app_global_im(uim_lisp id_, uim_lisp name_)
 {
   uim_context uc;
-  int id;
   const char *name;
 
-  uc = uim_find_context(uim_scm_c_int(id_));
+  uc = retrieve_uim_context(id_);
   name = uim_scm_refer_c_str(name_);
 
   if (uc->switch_app_global_im_cb)
@@ -736,7 +739,7 @@
   uim_context uc;
   const char *name;
 
-  uc = uim_find_context(uim_scm_c_int(id_));
+  uc = retrieve_uim_context(id_);
   name = uim_scm_refer_c_str(name_);
 
   if (uc->switch_system_global_im_cb)
@@ -779,8 +782,7 @@
   uim_scm_init_subr_1("im-request-surrounding", im_request_surrounding);
   uim_scm_init_subr_3("im-delete-surrounding", im_delete_surrounding);
   /**/
-  uim_scm_init_subr_2("uim-switch-im", switch_im); /* FIXME: This function name would not be appropriate. */
-  
+  uim_scm_init_subr_2("im-switch-im", switch_im);
   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);
 }



More information about the uim-commit mailing list