Revision: 6339
Author: ek.kato
Date: Sun Apr 25 19:21:52 2010
Log: * doc/HELPER-CANDWIN : Change specification of the separator of
  sending message.
* xim/canddisp.cpp : Follow the change.
* helper/candwin-gtk.c : Ditto.
* qt/candwin-qt.cpp : Ditto.
* qt4/candwin/qt4.cpp : Ditto.

http://code.google.com/p/uim/source/detail?r=6339

Modified:
 /trunk/doc/HELPER-CANDWIN
 /trunk/helper/candwin-gtk.c
 /trunk/qt/candwin-qt.cpp
 /trunk/qt4/candwin/qt4.cpp
 /trunk/xim/canddisp.cpp

=======================================
--- /trunk/doc/HELPER-CANDWIN   Tue Apr 20 12:14:41 2010
+++ /trunk/doc/HELPER-CANDWIN   Sun Apr 25 19:21:52 2010
@@ -26,11 +26,11 @@
              show_page  |
              show_caret_state |
              update_caret_state |
-             hide_caret_state) "\n"
-  charset_specifier = "charset=" charset "\n"
+             hide_caret_state) "\f"
+  charset_specifier = "charset=" charset "\f"
   charset = "UTF-8" | "EUC-JP" | "GB18030" |
             <or any name that can be specified as iconv_open(3) argument>
-  str = str <any characters except for '\0', '\a', or '\n'> | ""
+  str = str <any characters except for '\0', '\a', or '\f'> | ""
   num = /[0-9]+/

   1. activate
@@ -38,12 +38,12 @@
    and add heading labels and candidates to it. The order of
    candidates must be as is.

-   activate = "activate" "\n" label
-   label = charset_specifier display_limit_str "\n" candidate_strs
+   activate = "activate" "\f" label
+   label = charset_specifier display_limit_str "\f" candidate_strs
    display_limit_str = display_limit_label num
    display_limit_label = "display_limit="
    candidate_strs = candidate_str candidate_str candidate_str ....
-   candidate_str = cand_head "\a" cand_candidate "\a" cand_annotation "\n"
+   candidate_str = cand_head "\a" cand_candidate "\a" cand_annotation "\f"
    cand_head = str
    cand_candidate = str
    cand_annotation = str
@@ -51,29 +51,29 @@
   2. select
     Selecting the specified candidate in helper-candwin window.

-    select = "select" "\n" num "\n"
+    select = "select" "\f" num "\f"

   3. move
     Moving the helper-candwin window.

-    move = "move" "\n" XPos "\n" YPos "\n"
+    move = "move" "\f" XPos "\f" YPos "\f"
     XPos = num
     YPos = num

   4. show
     Showing the candidate window

-    show = "show" "\n"
+    show = "show" "\f"

   5. hide
     Hide the candidate window

-    hide = "hide" "\n"
+    hide = "hide" "\f"

   6. deactivate
     Deactivating the candidate window

-    deactivate = "deactivate" "\n"
+    deactivate = "deactivate" "\f"

   7. set_nr_candidates
     Activating the candidate window with nr_cands and display_limit
@@ -81,7 +81,7 @@
     combination with following 'set_page_candidates' and 'show_page'
     message for the efficient candidate page handling.

-    activate = "set_nr_candidates" "\n" nr_cands "\n" display_limit "\n"
+    activate = "set_nr_candidates" "\f" nr_cands "\f" display_limit "\f"
     nr_cands = num
     display_limit = num

@@ -89,12 +89,12 @@
     Set heading labels and candidates to the selected page of the
     candidate window. The order of candidates must be as is.

-    set_page_candidates = "set_page_candidates" "\n" label
-    label = charset_specifier page_str "\n" candidate_strs
+    set_page_candidates = "set_page_candidates" "\f" label
+    label = charset_specifier page_str "\f" candidate_strs
     page_str = page_label num
     page_label = "page="
     candidate_strs = candidate_str candidate_str candidate_str ....
-    candidate_str = cand_head "\a" cand_candidate "\a" cand_annotation "\n"
+    candidate_str = cand_head "\a" cand_candidate "\a" cand_annotation "\f"
     cand_head = str
     cand_candidate = str
     cand_annotation = str
@@ -102,24 +102,24 @@
   9. show_page
     Selecting the specified page of the candidate window.

-    show_page = "show_page" "\n" num "\n"
+    show_page = "show_page" "\f" num "\f"

   10. show_caret_state
     Show caret state of the input mode

- show_caret_state = "show_caret_state" "\n" timeout "\n" caret_state "\n" + show_caret_state = "show_caret_state" "\f" timeout "\f" caret_state "\f"
     timeout = num
     caret_state = str

   11. update_caret_state
     Update caret state of the input mode

-    update_caret_state = "update_caret_state" "\n"
+    update_caret_state = "update_caret_state" "\f"

   12. hide_caret_state
     Hide caret state of the input mode

-    hide_caret_state = "hide_caret_state" "\n"
+    hide_caret_state = "hide_caret_state" "\f"

 Sending Message format BNF
   session  = messages
=======================================
--- /trunk/helper/candwin-gtk.c Thu Apr 22 08:24:36 2010
+++ /trunk/helper/candwin-gtk.c Sun Apr 25 19:21:52 2010
@@ -754,7 +754,7 @@
   gchar **tmp;
   gchar *command;

-  tmp = g_strsplit(str, "\n", 0);
+  tmp = g_strsplit(str, "\f", 0);
   command = tmp[0];

   if (command) {
@@ -813,7 +813,7 @@
     strcat(read_buf, buf);
   }

-  tmp = g_strsplit(read_buf, "\n\n", 0);
+  tmp = g_strsplit(read_buf, "\f\f", 0);

   while (tmp[i]) {
     str_parse(tmp[i]);
=======================================
--- /trunk/qt/candwin-qt.cpp    Tue Apr 20 12:14:41 2010
+++ /trunk/qt/candwin-qt.cpp    Sun Apr 25 19:21:52 2010
@@ -115,7 +115,7 @@
     qDebug( "uim-candwin-qt: activateCand()" );
 #endif
     /**
- * format: activate\ncharset=$charset\ndisplay_limit=$value\nhead1\acand1\aannot1\nhead2\acand2\aannot2\nhead3\acand3\aannot3\n + * format: activate\fcharset=$charset\fdisplay_limit=$value\fhead1\acand1\aannot1\fhead2\acand2\aannot2\fhead3\acand3\aannot3\f
      */

     // remove old data
@@ -279,7 +279,7 @@
     qDebug( "uim-candwin-qt: setPageCandidates()" );
 #endif
     /**
- * format: set_page_candidates\ncharset=$charset\npage=$value\nhead1\acand1\aannot1\nhead2\acand2\aannot2\nhead3\acand3\aannot3\n + * format: set_page_candidates\fcharset=$charset\fpage=$value\fhead1\acand1\aannot1\fhead2\acand2\aannot2\fhead3\acand3\aannot3\f
      */

     int page = 0;
@@ -361,7 +361,7 @@
        strcat( read_buf, buf );
     }

- QStringList msgList = QStringList::split( "\n\n", QString( read_buf ) ); + QStringList msgList = QStringList::split( "\f\f", QString( read_buf ) );

     QStringList::Iterator it = msgList.begin();
     const QStringList::Iterator end = msgList.end();
@@ -375,7 +375,7 @@
 #if defined(ENABLE_DEBUG)
     qDebug( "str = %s", ( const char* ) str.local8Bit() );
 #endif
-    QStringList list = QStringList::split( "\n", str );
+    QStringList list = QStringList::split( "\f", str );

     QStringList::Iterator it = list.begin();
     const QStringList::Iterator end = list.end();
=======================================
--- /trunk/qt4/candwin/qt4.cpp  Tue Apr 20 12:14:41 2010
+++ /trunk/qt4/candwin/qt4.cpp  Sun Apr 25 19:21:52 2010
@@ -126,7 +126,7 @@
     qDebug( "uim-candwin-qt4: activateCand()" );
 #endif
     /**
- * format: activate\ncharset=$charset\ndisplay_limit=$value\nhead1\acand1\aannot1\nhead2\acand2\aannot2\nhead3\acand3\aannot3\n + * format: activate\fcharset=$charset\fdisplay_limit=$value\fhead1\acand1\aannot1\fhead2\acand2\aannot2\fhead3\acand3\aannot3\f
      */

     // remove old data
@@ -294,7 +294,7 @@
     qDebug( "uim-candwin-qt: setPageCandidates()" );
 #endif
     /**
- * format: set_page_candidates\ncharset=$charset\npage=$value\nhead1\acand1\aannot1\nhead2\acand2\aannot2\nhead3\acand3\aannot3\n + * format: set_page_candidates\fcharset=$charset\fpage=$value\fhead1\acand1\aannot1\fhead2\acand2\aannot2\fhead3\acand3\aannot3\f
      */

     int page = 0;
@@ -380,7 +380,7 @@
     }

     QStringList msgList
-        = QString( read_buf ).split( "\n\n", QString::SkipEmptyParts );
+        = QString( read_buf ).split( "\f\f", QString::SkipEmptyParts );

     QStringList::Iterator it = msgList.begin();
     const QStringList::Iterator end = msgList.end();
@@ -394,7 +394,7 @@
 #if defined(ENABLE_DEBUG)
     qDebug( "str = %s", str.toLocal8Bit().constData() );
 #endif
-    QStringList list = str.split( '\n', QString::SkipEmptyParts );
+    QStringList list = str.split( '\f', QString::SkipEmptyParts );

     QStringList::Iterator it = list.begin();
     const QStringList::Iterator end = list.end();
=======================================
--- /trunk/xim/canddisp.cpp     Sun Apr  4 20:35:54 2010
+++ /trunk/xim/canddisp.cpp     Sun Apr 25 19:21:52 2010
@@ -131,11 +131,11 @@
     if (!candwin_w)
        return;

-    fprintf(candwin_w, "activate\ncharset=UTF-8\ndisplay_limit=%d\n",
+    fprintf(candwin_w, "activate\fcharset=UTF-8\fdisplay_limit=%d\f",
                    display_limit);
     for (i = candidates.begin(); i != candidates.end(); ++i)
-       fprintf(candwin_w, "%s\n", *i);
-    fprintf(candwin_w, "\n");
+       fprintf(candwin_w, "%s\f", *i);
+    fprintf(candwin_w, "\f");
     fflush(candwin_w);
     check_connection();
 }
@@ -146,10 +146,10 @@
     if (!candwin_w)
        return;

-    fprintf(candwin_w, "set_nr_candidates\n");
-    fprintf(candwin_w, "%d\n", nr);
-    fprintf(candwin_w, "%d\n", display_limit);
-    fprintf(candwin_w, "\n");
+    fprintf(candwin_w, "set_nr_candidates\f");
+    fprintf(candwin_w, "%d\f", nr);
+    fprintf(candwin_w, "%d\f", display_limit);
+    fprintf(candwin_w, "\f");
     fflush(candwin_w);
     check_connection();
 }
@@ -161,10 +161,10 @@
     if (!candwin_w)
        return;

- fprintf(candwin_w, "set_page_candidates\ncharset=UTF-8\npage=%d\n", page); + fprintf(candwin_w, "set_page_candidates\fcharset=UTF-8\fpage=%d\f", page);
     for (i = candidates.begin(); i != candidates.end(); ++i)
-       fprintf(candwin_w, "%s\n", *i);
-    fprintf(candwin_w, "\n");
+       fprintf(candwin_w, "%s\f", *i);
+    fprintf(candwin_w, "\f");
     fflush(candwin_w);
     check_connection();
 }
@@ -174,9 +174,9 @@
     if (!candwin_w)
        return;

-    fprintf(candwin_w, "show_page\n");
-    fprintf(candwin_w, "%d\n", page);
-    fprintf(candwin_w, "\n");
+    fprintf(candwin_w, "show_page\f");
+    fprintf(candwin_w, "%d\f", page);
+    fprintf(candwin_w, "\f");
     fflush(candwin_w);
     check_connection();
 }
@@ -186,9 +186,9 @@
 {
     if (!candwin_w)
        return;
-    fprintf(candwin_w, "select\n");
-    fprintf(candwin_w, "%d\n", index);
-    fprintf(candwin_w, "%d\n\n", need_hilite? 1 : 0);
+    fprintf(candwin_w, "select\f");
+    fprintf(candwin_w, "%d\f", index);
+    fprintf(candwin_w, "%d\f\f", need_hilite? 1 : 0);
     fflush(candwin_w);
     check_connection();
 }
@@ -197,7 +197,7 @@
 {
     if (!candwin_w)
        return;
-    fprintf(candwin_w, "deactivate\n\n");
+    fprintf(candwin_w, "deactivate\f\f");
     fflush(candwin_w);
     check_connection();
 }
@@ -206,7 +206,7 @@
 {
     if (!candwin_w)
        return;
-    fprintf(candwin_w, "show\n\n");
+    fprintf(candwin_w, "show\f\f");
     fflush(candwin_w);
     check_connection();
 }
@@ -215,7 +215,7 @@
 {
     if (!candwin_w)
        return;
-    fprintf(candwin_w, "hide\n\n");
+    fprintf(candwin_w, "hide\f\f");
     fflush(candwin_w);
     check_connection();
 }
@@ -224,10 +224,10 @@
 {
     if (!candwin_w)
        return;
-    fprintf(candwin_w, "move\n");
-    fprintf(candwin_w, "%d\n", x);
-    fprintf(candwin_w, "%d\n", y);
-    fprintf(candwin_w, "\n");
+    fprintf(candwin_w, "move\f");
+    fprintf(candwin_w, "%d\f", x);
+    fprintf(candwin_w, "%d\f", y);
+    fprintf(candwin_w, "\f");
     fflush(candwin_w);
     check_connection();
 }
@@ -236,10 +236,10 @@
 {
     if (!candwin_w)
        return;
-    fprintf(candwin_w, "show_caret_state\n");
-    fprintf(candwin_w, "%d\n", timeout);
-    fprintf(candwin_w, "%s\n", str);
-    fprintf(candwin_w, "\n");
+    fprintf(candwin_w, "show_caret_state\f");
+    fprintf(candwin_w, "%d\f", timeout);
+    fprintf(candwin_w, "%s\f", str);
+    fprintf(candwin_w, "\f");
     fflush(candwin_w);
     check_connection();
 }
@@ -248,7 +248,7 @@
 {
     if (!candwin_w)
        return;
-    fprintf(candwin_w, "update_caret_state\n\n");
+    fprintf(candwin_w, "update_caret_state\f\f");
     fflush(candwin_w);
     check_connection();
 }
@@ -257,7 +257,7 @@
 {
     if (!candwin_w)
        return;
-    fprintf(candwin_w, "hide_caret_state\n\n");
+    fprintf(candwin_w, "hide_caret_state\f\f");
     fflush(candwin_w);
     check_connection();
 }


--
Subscription settings: http://groups.google.com/group/uim-commit/subscribe?hl=en

Reply via email to