1To separate GUI toolkit dependent part from independent part, uim-xim 2uses external helper program to show candidate selection window. This 3file describes communication protocol between uim-xim and its helper 4program . 5 6uim-candwin-[xaw|gtk|qt] is executed from uim-xim and receives/sends 7messages via pipe. 8 9 message 10 +-------+ ------------> +--------------+ 11 |uim-xim| (pipe) |HELPER-CANDWIN| 12 +-------+ <------------ +--------------+ 13 message 14 15Recieving Message format BNF 16 session = messages 17 messages = messages message | message 18 message = (activate | 19 select | 20 move | 21 show | 22 hide | 23 deactivate | 24 set_nr_candidates | 25 set_page_candidates | 26 show_page | 27 show_caret_state | 28 update_caret_state | 29 hide_caret_state) "\f" 30 charset_specifier = "charset=" charset "\f" 31 charset = "UTF-8" | "EUC-JP" | "GB18030" | 32 <or any name that can be specified as iconv_open(3) argument> 33 str = str <any characters except for '\0', '\a', or '\f'> | "" 34 num = /[0-9]+/ 35 36 1. activate 37 Activating the candidate window with display_limit value, 38 and add heading labels and candidates to it. The order of 39 candidates must be as is. 40 41 activate = "activate" "\f" label 42 label = charset_specifier display_limit_str "\f" candidate_strs 43 display_limit_str = display_limit_label num 44 display_limit_label = "display_limit=" 45 candidate_strs = candidate_str candidate_str candidate_str .... 46 candidate_str = cand_head "\a" cand_candidate "\a" cand_annotation "\f" 47 cand_head = str 48 cand_candidate = str 49 cand_annotation = str 50 51 2. select 52 Selecting the specified candidate in helper-candwin window. 53 54 select = "select" "\f" num "\f" 55 56 3. move 57 Moving the helper-candwin window. 58 59 move = "move" "\f" XPos "\f" YPos "\f" 60 XPos = num 61 YPos = num 62 63 4. show 64 Showing the candidate window 65 66 show = "show" "\f" 67 68 5. hide 69 Hide the candidate window 70 71 hide = "hide" "\f" 72 73 6. deactivate 74 Deactivating the candidate window 75 76 deactivate = "deactivate" "\f" 77 78 7. set_nr_candidates 79 Activating the candidate window with nr_cands and display_limit 80 value. This can be used as a replacement of 'activate' message in 81 combination with following 'set_page_candidates' and 'show_page' 82 message for the efficient candidate page handling. 83 84 activate = "set_nr_candidates" "\f" nr_cands "\f" display_limit "\f" 85 nr_cands = num 86 display_limit = num 87 88 8. set_page_candidates 89 Set heading labels and candidates to the selected page of the 90 candidate window. The order of candidates must be as is. 91 92 set_page_candidates = "set_page_candidates" "\f" label 93 label = charset_specifier page_str "\f" candidate_strs 94 page_str = page_label num 95 page_label = "page=" 96 candidate_strs = candidate_str candidate_str candidate_str .... 97 candidate_str = cand_head "\a" cand_candidate "\a" cand_annotation "\f" 98 cand_head = str 99 cand_candidate = str 100 cand_annotation = str 101 102 9. show_page 103 Selecting the specified page of the candidate window. 104 105 show_page = "show_page" "\f" num "\f" 106 107 10. show_caret_state 108 Show caret state of the input mode 109 110 show_caret_state = "show_caret_state" "\f" timeout "\f" caret_state "\f" 111 timeout = num 112 caret_state = str 113 114 11. update_caret_state 115 Update caret state of the input mode 116 117 update_caret_state = "update_caret_state" "\f" 118 119 12. hide_caret_state 120 Hide caret state of the input mode 121 122 hide_caret_state = "hide_caret_state" "\f" 123 124Sending Message format BNF 125 session = messages 126 messages = messages message | message 127 message = ( index ) "\n" 128 charset_specifier = "charset=" charset "\n" 129 charset = "UTF-8" | "EUC-JP" | "GB18030" | 130 <or any name that can be specified as iconv_open(3) argument> 131 str = str <any characters except for '\0', '\t' or '\n'> | "" 132 num = /[0-9]+/ 133 134 1. index 135 Sending index of selected candidate with mouse pointer to uim-xim. 136 137 index = "index" "\n" num "\n" 138