[uim-commit] r3131 - in trunk: doc scm test uim

yamaken at freedesktop.org yamaken at freedesktop.org
Mon Feb 20 03:35:21 PST 2006


Author: yamaken
Date: 2006-02-20 03:35:16 -0800 (Mon, 20 Feb 2006)
New Revision: 3131

Modified:
   trunk/doc/COMPATIBILITY
   trunk/doc/HELPER-PROTOCOL
   trunk/scm/action.scm
   trunk/test/test-action.scm
   trunk/uim/uim-func.c
   trunk/uim/uim-internal.h
   trunk/uim/uim.c
   trunk/uim/uim.h
Log:
* This commit obsolete prop_label messages

* uim/uim.h
  - (uim_set_prop_label_update_cb, uim_prop_label_update): Update
    the comment as 'obsoleted'
* uim/uim-internal.h
  - (struct uim_context_): Remove members 'proplabelstr' and
    'prop_label_update_cb'
* uim/uim-func.c
  - (im_update_prop_label): Removed
  - (uim_init_im_subrs): Remove registration of im-update-prop-label
* uim/uim.c
  - (uim_create_context, uim_set_prop_label_update_cb,
    uim_prop_label_update): Remove
* scm/action.scm
  - (context-propagate-prop-label-update): Removed
  - (context-propagate-widget-states): Remove
    context-propagate-prop-label-update invocation
* test/test-action.scm
  - (test context-propagate-prop-label-update): Removed
  - (test context-propagate-widget-states): Modify prop-label tests
* doc/COMPATIBILITY
  - Add new section "Obsolete prop_label handlings"
  - Remove description about 'prop_label_update' from section "Add
    icon support to helper protocol"
* doc/HELPER-PROTOCOL
  - Remove description about 'prop_label_get' and 'prop_label_update'


Modified: trunk/doc/COMPATIBILITY
===================================================================
--- trunk/doc/COMPATIBILITY	2006-02-20 10:26:12 UTC (rev 3130)
+++ trunk/doc/COMPATIBILITY	2006-02-20 11:35:16 UTC (rev 3131)
@@ -57,6 +57,30 @@
 
 The changes are described below in most recently updated order.
 ------------------------------------------------------------------------------
+Summary: Obsolete prop_label handlings
+Affects: Helper program developers, Bridge developers
+Updates: Helper protocol, Scheme API
+Version: 1.1.0
+Revision: ac3122, ac3123, ac3125, ac3131
+Date: 2006-02-20
+Modifier: Etsushi, YamaKen
+Related: "Add icon support to helper protocol"
+URL:
+Changes:
+    (removed) "prop_label_get"
+    (removed) "prop_label_update"
+    (removed) im-update-prop-label
+  (obsoleted) uim_set_prop_label_update_cb
+  (obsoleted) uim_prop_label_update
+Description:
+  The prop_label messages had already lost its original role by revised
+  prop_list message (particularly 'activity' field). Because format revision
+  of prop_list_update broke the protocol compatibility, it is good opportunity
+  to remove the unusable message.
+  
+  Although C API/ABI is kept to be backward compatible with uim 1.0, bridges
+  and helper programs should remove prop_label handlings.
+------------------------------------------------------------------------------
 Summary: Add icon support to helper protocol
 Affects: Helper program developers
 Updates: Helper protocol
@@ -68,14 +92,13 @@
 URL:
   http://lists.freedesktop.org/archives/uim/2006-February/001434.html
 Changes:
-  (update) "prop_label_update"
   (update) "prop_list_update"
 Description:
-  Add 'indication_id' attribute to the two messages to support icons on
+  Add 'indication_id' attribute to the message to support icons on
   toolbars. And a special indication_id "separator" is also defined.
   
-  The message formats have been incompatible with former ones. Helper program
-  developers, please read doc/HELPER-PROTOCOL and follow the changes.
+  The message format have been incompatible with former one. Helper program
+  developers, please read doc/HELPER-PROTOCOL and follow the change.
 ------------------------------------------------------------------------------
 Summary: Rename is-set-ugid? to follow the Scheme naming convention
 Affects: IM developers, uim developers

Modified: trunk/doc/HELPER-PROTOCOL
===================================================================
--- trunk/doc/HELPER-PROTOCOL	2006-02-20 10:26:12 UTC (rev 3130)
+++ trunk/doc/HELPER-PROTOCOL	2006-02-20 11:35:16 UTC (rev 3131)
@@ -82,8 +82,6 @@
   message  = (focus_in            |
               focus_out           |
               prop_activate       |
-              prop_label_get      |
-              prop_label_update   |
               prop_list_get       |
               prop_list_update    |
               im_list             |
@@ -151,44 +149,6 @@
 
     prop_activate = "prop_activate\n" action_id "\n"
 
-  - prop_label_get
-
-    This message requests a prop_label_update. The request sender will receive
-    prop_label_update in response to this message. This message is currently
-    not used by official uim suites.
-
-    See also prop_label_update
-
-    prop_label_get = "prop_label_get\n"
-
-  - prop_label_update
-
-    This message notifies a subset of prop_list_update. This message had been
-    designed to reduce message passing overhead by replacing prop_list_update
-    by this.
-
-    indication_id is an identifier that specifies visual appearance of the
-    item. The ID roughly considerable as "icon name", and so the message
-    receiver can use it to form filename for the corresponding icon
-    (e.g. "anthy" -> "/path/to/somewhere/32x32/anthy.png").
-
-    iconic_label is a very short string typically 1 character to be used as
-    icon. For example, "a" means 'direct input'.
-
-    label_string is a string usually used as tooltip of the button.
-
-    Invoke im-update-prop-label to send this message.
-
-    See also prop_list_update.
-
-    prop_label_update = "prop_label_update\n" charset_specifier labels
-    labels = labels label | label
-    label = indication_id "\t" iconic_label "\t" label_string "\n"
-
-    indication_id = identifier
-    iconic_label = str
-    label_string = str
-
   - prop_list_get
 
     This message requests a prop_list_update. The request sender will receive
@@ -214,11 +174,13 @@
     iconic_label is a very short string typically 1 character to be used as
     icon. For example, "a" means 'direct input'.
 
-    indication_id is an identifier. This element has same meaning as in
-    prop_label_update except for the special ID "separator". If the ID is
-    "separator", message receivers should display the leaf as toolkit-native
-    separator. But it is not necessary since the "separator" appears as dummy
-    item with no action if the receiver is not aware of it.
+    indication_id is an identifier that specifies visual appearance of the
+    item. The ID roughly considerable as "icon name", and so the message
+    receiver can use it to form filename for the corresponding icon
+    (e.g. "anthy" -> "/path/to/somewhere/32x32/anthy.png"). There is a special
+    ID. If the ID is "separator", message receivers should display the leaf as
+    toolkit-native separator. But it is not necessary since the "separator"
+    appears as dummy item with no action if the receiver is not aware of it.
 
     label_string is a short string to be shown in the menu, or used as tooltip
     of the button.

Modified: trunk/scm/action.scm
===================================================================
--- trunk/scm/action.scm	2006-02-20 10:26:12 UTC (rev 3130)
+++ trunk/scm/action.scm	2006-02-20 11:35:16 UTC (rev 3131)
@@ -353,18 +353,6 @@
       (if (not (null? (filter-map widget-update-state! widgets)))
           (context-propagate-widget-states context)))))
 
-(define context-propagate-prop-label-update
-  (lambda (context)
-    (let* ((widgets (context-widgets context))
-	   (active-label (lambda (widget)
-			   (let* ((indicator (widget-indicator widget))
-				  (indication (action-indicate indicator
-							       context)))
-			     (indication-compose-label indication))))
-	   (labels (map active-label widgets))
-	   (message (apply string-append labels)))
-      (im-update-prop-label context message))))
-
 (define context-propagate-prop-list-update
   (lambda (context)
     (let* ((widgets (context-widgets context))
@@ -376,7 +364,6 @@
 ;; API for uim developers
 (define context-propagate-widget-states
   (lambda (context)
-    (context-propagate-prop-label-update context)
     ;; Sending prop_list every time costs all uim participant
     ;; processes slightly heavy resource consumptions. Although it is
     ;; not a problem for the rich desktop environment today, we should

Modified: trunk/test/test-action.scm
===================================================================
--- trunk/test/test-action.scm	2006-02-20 10:26:12 UTC (rev 3130)
+++ trunk/test/test-action.scm	2006-02-20 11:35:16 UTC (rev 3131)
@@ -29,7 +29,7 @@
 ;;; SUCH DAMAGE.
 ;;;;
 
-;; This file is tested with revision 3130 of new repository
+;; This file is tested with revision 3131 of new repository
 
 (use test.unit)
 
@@ -1496,61 +1496,6 @@
    (assert-false (uim-bool '(map widget-id test-widget-conf)))
    (assert-false (uim-bool '(map widget-id test-widget-state))))
 
-  ("test context-propagate-prop-label-update"
-   ;; 2 widgets
-   (uim '(begin
-	   (context-init-widgets! tc '(widget_test_input_mode
-				       widget_test_kana_input_method))
-	   #t))
-   (uim '(context-propagate-prop-label-update tc))
-   (assert-equal (string-append "figure_ja_direct\ta\t直接入力\n"
-				"figure_ja_roma\tR\tローマ字\n")
-		 (uim 'test-prop-label))
-   ;; 2 widgets (updated state)
-   (assert-true (uim-bool '(widget-activate! (assq 'widget_test_input_mode
-						   (context-widgets tc))
-					     'action_test_katakana)))
-   (uim '(context-propagate-prop-label-update tc))
-   (assert-equal (string-append "figure_ja_katakana\tア\tカタカナ\n"
-				"figure_ja_roma\tR\tローマ字\n")
-		 (uim 'test-prop-label))
-   ;; 2 widgets (without latter activity-indicator)
-   (uim '(begin
-	   (context-init-widgets! tc '(widget_test_input_mode
-				       widget_test_kana_input_method_without_act_indicator))
-	   #t))
-   (assert-true (uim-bool '(widget-activate! (assq 'widget_test_input_mode
-						   (context-widgets tc))
-					     'action_test_katakana)))
-   (uim '(context-propagate-prop-label-update tc))
-   (assert-equal (string-append "figure_ja_katakana\tア\tカタカナ\n"
-				"unknown\t?\tunknown\n")
-		 (uim 'test-prop-label))
-   ;; 2 widgets with non-existent
-   (uim '(begin
-	   (context-init-widgets! tc '(widget_test_kana_input_method
-				       widget_test_nonexistent
-				       widget_test_input_mode))
-	   #t))
-   (uim '(context-propagate-prop-label-update tc))
-   (assert-equal (string-append "figure_ja_roma\tR\tローマ字\n"
-				"figure_ja_katakana\tア\tカタカナ\n")
-		 (uim 'test-prop-label))
-   ;; no widgets
-   (uim '(begin
-	   (context-init-widgets! tc ())
-	   #t))
-   (uim '(context-propagate-prop-label-update tc))
-   (assert-equal "unknown\t?\tunknown\n"
-		 (uim 'test-prop-label))
-   ;; widget_test_null
-   (uim '(begin
-	   (context-init-widgets! tc '(widget_test_null))
-	   #t))
-   (uim '(context-propagate-prop-label-update tc))
-   (assert-equal "unknown\t?\tunknown\n"
-		 (uim 'test-prop-label)))
-
   ("test context-propagate-prop-list-update"
    (uim '(begin
 	   (define test-prop-list #f)
@@ -1645,9 +1590,7 @@
 		  "leaf\tfigure_ja_roma\tR\tローマ字\tローマ字入力モード\taction_test_roma\t*\n"
 		  "leaf\tfigure_ja_kana\tか\tかな\tかな入力モード\taction_test_kana\t\n")
 		 (uim 'test-prop-list))
-   (assert-equal (string-append "figure_ja_direct\ta\t直接入力\n"
-				"figure_ja_roma\tR\tローマ字\n")
-		 (uim 'test-prop-label))
+   (assert-false (uim-bool 'test-prop-label))
    (assert-equal 3
 		 (uim 'test-updated-mode))
    ;; 2 widgets (updated state)
@@ -1668,9 +1611,7 @@
 		  "leaf\tfigure_ja_roma\tR\tローマ字\tローマ字入力モード\taction_test_roma\t*\n"
 		  "leaf\tfigure_ja_kana\tか\tかな\tかな入力モード\taction_test_kana\t\n")
 		 (uim 'test-prop-list))
-   (assert-equal (string-append "figure_ja_katakana\tア\tカタカナ\n"
-				"figure_ja_roma\tR\tローマ字\n")
-		 (uim 'test-prop-label))
+   (assert-false (uim-bool 'test-prop-label))
    (assert-equal 1
 		 (uim 'test-updated-mode))
    ;; 2 widgets with non-existent
@@ -1693,9 +1634,7 @@
 		  "leaf\tfigure_ja_direct\ta\t直接入力\t直接(無変換)入力モード\taction_test_direct\t\n"
 		  "leaf\tfigure_ja_zenkaku\tA\t全角英数\t全角英数入力モード\taction_test_zenkaku\t\n")
 		 (uim 'test-prop-list))
-   (assert-equal (string-append "figure_ja_roma\tR\tローマ字\n"
-				"figure_ja_katakana\tア\tカタカナ\n")
-		 (uim 'test-prop-label))
+   (assert-false (uim-bool 'test-prop-label))
    (assert-equal 1
 		 (uim 'test-updated-mode))
    ;; no widgets
@@ -1707,8 +1646,7 @@
 	   #t))
    (assert-equal "branch\tunknown\t?\tunknown\n"
 		 (uim 'test-prop-list))
-   (assert-equal "unknown\t?\tunknown\n"
-		 (uim 'test-prop-label))
+   (assert-false (uim-bool 'test-prop-label))
    (assert-equal 0
 		 (uim 'test-updated-mode))
    ;; widget_test_null
@@ -1720,8 +1658,7 @@
 	   #t))
    (assert-equal "branch\tunknown\t?\tunknown\n"
 		 (uim 'test-prop-list))
-   (assert-equal "unknown\t?\tunknown\n"
-		 (uim 'test-prop-label))
+   (assert-false (uim-bool 'test-prop-label))
    (assert-equal 0
 		 (uim 'test-updated-mode)))
 

Modified: trunk/uim/uim-func.c
===================================================================
--- trunk/uim/uim-func.c	2006-02-20 10:26:12 UTC (rev 3130)
+++ trunk/uim/uim-func.c	2006-02-20 11:35:16 UTC (rev 3131)
@@ -528,28 +528,7 @@
   return uim_scm_f();
 }
 
-
 static uim_lisp
-im_update_prop_label(uim_lisp id, uim_lisp prop_)
-{
-  uim_context uc = retrieve_uim_context(id);
-  const char *prop = uim_scm_refer_c_str(prop_);
-    
-  if (!uc)
-    return uim_scm_f();
-
-  if (uc && uc->proplabelstr)
-    free(uc->proplabelstr);
-  
-  uc->proplabelstr = uc->conv_if->convert(uc->conv, prop);
-
-  if (uc->prop_label_update_cb)
-    uc->prop_label_update_cb(uc->ptr, uc->proplabelstr);
-
-  return uim_scm_f();
-}
-
-static uim_lisp
 im_update_mode(uim_lisp id, uim_lisp mode_)
 {
   int mode = uim_scm_c_int(mode_);
@@ -757,7 +736,6 @@
   uim_scm_init_subr_2("im-pushback-mode-list", im_pushback_mode_list);
   uim_scm_init_subr_1("im-update-mode-list",   im_update_mode_list);
   /**/
-  uim_scm_init_subr_2("im-update-prop-label", im_update_prop_label);
   uim_scm_init_subr_2("im-update-prop-list",  im_update_prop_list);
   /**/
   uim_scm_init_subr_2("im-update-mode", im_update_mode);

Modified: trunk/uim/uim-internal.h
===================================================================
--- trunk/uim/uim-internal.h	2006-02-20 10:26:12 UTC (rev 3130)
+++ trunk/uim/uim-internal.h	2006-02-20 11:35:16 UTC (rev 3131)
@@ -87,7 +87,6 @@
   /**/
   int mode;
   /**/
-  char *proplabelstr;
   char *propstr;
   /**/
   int candidate_index;
@@ -104,8 +103,6 @@
   void (*mode_update_cb)(void *ptr, int);
   /* property list */
   void (*prop_list_update_cb)(void *ptr, const char *str);
-  /* property label */
-  void (*prop_label_update_cb)(void *ptr, const char *str);
   /* candidate window */
   void (*candidate_selector_activate_cb)(void *ptr, int nr, int index);
   void (*candidate_selector_select_cb)(void *ptr, int index);

Modified: trunk/uim/uim.c
===================================================================
--- trunk/uim/uim.c	2006-02-20 10:26:12 UTC (rev 3130)
+++ trunk/uim/uim.c	2006-02-20 11:35:16 UTC (rev 3131)
@@ -144,7 +144,6 @@
   uc->mode = 0;
   /**/
   uc->propstr = NULL;
-  uc->proplabelstr = NULL;
   /**/
   uc->preedit_clear_cb = NULL;
   uc->preedit_pushback_cb = NULL;
@@ -155,7 +154,6 @@
   uc->mode_update_cb = NULL;
   /**/
   uc->prop_list_update_cb  = NULL;
-  uc->prop_label_update_cb = NULL;
   /**/
   uc->candidate_selector_activate_cb = NULL;
   uc->candidate_selector_select_cb = NULL;
@@ -272,7 +270,6 @@
     uc->modes[i] = NULL;
   }
   free(uc->propstr);
-  free(uc->proplabelstr);
   free(uc->modes);
   free(uc->short_desc);
   free(uc->encoding);
@@ -310,7 +307,6 @@
   uc->mode_list_update_cb = update_cb;
 }
 
-
 void
 uim_set_prop_list_update_cb(uim_context uc,
 			    void (*update_cb)(void *ptr, const char *str))
@@ -318,15 +314,13 @@
   uc->prop_list_update_cb = update_cb;
 }
 
-
+/* Obsolete */
 void
 uim_set_prop_label_update_cb(uim_context uc,
 			     void (*update_cb)(void *ptr, const char *str))
 {
-  uc->prop_label_update_cb = update_cb;
 }
 
-
 void
 uim_prop_activate(uim_context uc, const char *str)
 {
@@ -398,11 +392,10 @@
     uc->prop_list_update_cb(uc->ptr, uc->propstr);
 }
 
+/* Obsolete */
 void
 uim_prop_label_update(uim_context uc)
 {
-  if (uc && uc->proplabelstr && uc->prop_label_update_cb)
-    uc->prop_label_update_cb(uc->ptr, uc->proplabelstr);
 }
 
 int

Modified: trunk/uim/uim.h
===================================================================
--- trunk/uim/uim.h	2006-02-20 10:26:12 UTC (rev 3130)
+++ trunk/uim/uim.h	2006-02-20 11:35:16 UTC (rev 3131)
@@ -485,20 +485,15 @@
 uim_prop_list_update(uim_context uc);
 
 /**
- * Set callback function to be called when property list is updated.
- *
- * @param uc input context
- * @param update_cb called when property list is updated.
- *        1st argument "ptr" corresponds to the 1st argument of uim_create_context.
- *        2nd argument is the message to be sent to the helper server with "prop_label_update" command and charset info.
+ * Obsolete. Only existing for Backward compatibility and should not
+ * be called.
  */
 void
 uim_set_prop_label_update_cb(uim_context uc,
 			     void (*update_cb)(void *ptr, const char *str));
 /**
- * Update property label
- *
- * @param uc input context
+ * Obsolete. Only existing for Backward compatibility and should not
+ * be called.
  */
 void
 uim_prop_label_update(uim_context uc);



More information about the uim-commit mailing list