70
|
1 /* CANNA interface
|
|
2
|
|
3 Copyright (C) 1995 Free Software Foundation, Inc.
|
|
4 Copyright (C) 1995 Sun Microsystems, Inc.
|
|
5
|
|
6 This file is part of XEmacs.
|
|
7
|
|
8 XEmacs is free software; you can redistribute it and/or modify it
|
|
9 under the terms of the GNU General Public License as published by the
|
|
10 Free Software Foundation; either version 2, or (at your option) any
|
|
11 later version.
|
|
12
|
|
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
16 for more details.
|
|
17
|
|
18 You should have received a copy of the GNU General Public License
|
|
19 along with XEmacs; see the file COPYING. If not, write to
|
|
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
21 Boston, MA 02111-1307, USA. */
|
|
22
|
|
23 /* Synched up with: Mule 2.3. Not in FSF. */
|
|
24
|
|
25 /* #### The comments in this file are mostly in EUC-formatted Japanese.
|
|
26 It would be ***soooo*** much nicer if someone could translate
|
|
27 them ... */
|
|
28
|
|
29 /*
|
|
30
|
114
|
31 Authors: Akira Kon (kon@uxd.fc.nec.co.jp)
|
|
32 Ichiro Hirakura (hirakura@uxd.fc.nec.co.jp)
|
70
|
33
|
|
34 Functions defined in this file are
|
|
35
|
|
36 (canna-key-proc key)
|
|
37 key: single STRING
|
|
38 RETURNS:
|
|
39 Length of converted string if no error occurs.
|
|
40 Error string if error occurs.
|
|
41 DESCRIPTION:
|
|
42 Convert a key input to a set of strings. The
|
|
43 strings contain both well-formed string and a
|
|
44 intermediate result to show the translation
|
|
45 information to a user. converted strings are
|
|
46 stored in specific variables.
|
|
47
|
|
48 (canna-initialize)
|
|
49 RETURNS:
|
|
50 List of the following things:
|
|
51 - list of keys to toggle Japanese-mode
|
|
52 - error message
|
|
53 - list of warning messages
|
|
54 DESCRIPTION:
|
|
55 Initialize ``canna'', which is a kana-to-kanji
|
|
56 converter for GNU Emacs. The first arg
|
|
57 specifies if inserting space character between
|
|
58 BUNSETSU when candidates are displayed. The
|
|
59 second arg specifies server. The third arg
|
|
60 specifies a file which will be used as a
|
|
61 customization description. If nil is
|
|
62 specified for each arg, the default value will
|
|
63 be used.
|
|
64
|
|
65 (canna-finalize)
|
|
66 RETURNS:
|
|
67 list of warning messages
|
|
68 DESCRIPTION:
|
|
69 finalize ``canna'', which is a kana-to-kanji
|
|
70 converter for GNU Emacs. This cause to write
|
|
71 miscellaneous informations to kana-to-kanji
|
|
72 dictionary.
|
|
73
|
|
74 (canna-touroku-string string)
|
|
75 string:
|
|
76 String to register to a dictionary.
|
|
77 RETURNS:
|
|
78 The same thing returns as canna-key-proc does.
|
|
79 DESCRIPTION:
|
|
80 Register Kanji words into kana-to-kanji
|
|
81 conversion dictionary.
|
|
82
|
|
83 (canna-set-width width)
|
|
84 width:
|
|
85 Column width of the place where the candidates
|
|
86 of kana-to-kanji conversion will be shown.
|
|
87 RETURNS:
|
|
88 nil
|
|
89 DESCRIPTION:
|
|
90 Set status-line width information, which is
|
|
91 used to display kanji candidates.
|
|
92
|
|
93 (canna-change-mode num)
|
|
94 num:
|
|
95 The mode number of Canna.
|
|
96 RETURNS:
|
|
97 The same thing returns as canna-key-proc does.
|
|
98 DESCRIPTION:
|
|
99 Change Japanese pre-edit mode.
|
|
100
|
|
101 (canna-store-yomi yomi roma)
|
|
102 yomi:
|
|
103 ``Yomi'' to be stored.
|
|
104 roma:
|
|
105 ``Romaji'' which corresponds to the ``Yomi''.
|
|
106 RETURNS:
|
|
107 The same thing returns as canna-key-proc does.
|
|
108 DESCRIPTION:
|
|
109 Store yomi characters as a YOMI of
|
|
110 kana-to-kanji conversion.
|
|
111
|
|
112 (canna-do-function num ch)
|
|
113 num:
|
|
114 A function number to be called.
|
|
115 ch:
|
|
116 A character will be specified in order to feed
|
|
117 the character to the function if the function
|
|
118 needs a input character.
|
|
119 RETURNS:
|
|
120 The same thing returns as canna-key-proc does.
|
|
121 DESCRIPTION:
|
|
122 Do specified function at current mode.
|
|
123
|
|
124 (canna-parse string)
|
|
125 string:
|
|
126 To be parsed.
|
|
127 RETURNS:
|
|
128 List of warning messages.
|
|
129 DESCRIPTION:
|
|
130 Parse customize string.
|
|
131
|
|
132 (canna-query-mode)
|
|
133 RETURNS:
|
|
134 A string which indicate the current mode.
|
|
135 DESCRIPTION:
|
|
136 Get current mode string.
|
|
137
|
|
138 Functions below are used for KKCP compatible library. These
|
|
139 functions provides a base kana-to-kanji conversion system for EGG.
|
|
140 These functions may be used when users want to change the engine
|
|
141 from Wnn to Canna without changing user interface of Japanese input.
|
|
142
|
|
143 (canna-henkan-begin)
|
|
144 (canna-henkan-next)
|
|
145 (canna-bunsetu-henkou)
|
|
146 (canna-henkan-kakutei)
|
|
147 (canna-henkan-end)
|
|
148 (canna-henkan-quit)
|
|
149
|
|
150 */
|
|
151
|
|
152 #include <config.h>
|
|
153 #include "lisp.h"
|
|
154
|
|
155 #include "buffer.h"
|
259
|
156 #include "file-coding.h"
|
70
|
157
|
|
158 #ifdef CANNA2
|
|
159 #define IROHA_BC
|
|
160 #include "canna/jrkanji.h"
|
|
161 #include "canna/RK.h"
|
|
162 #else /* !CANNA2 */
|
|
163 #include "iroha/jrkanji.h"
|
|
164 #include "iroha/RK.h"
|
|
165 #endif /* !CANNA2 */
|
|
166 extern char *jrKanjiError;
|
|
167
|
|
168 #define KEYTOSTRSIZE 2048
|
|
169 static unsigned char buf[KEYTOSTRSIZE];
|
|
170 static char **warning;
|
|
171
|
373
|
172 static int canna_empty_info, canna_through_info;
|
|
173 static int canna_underline;
|
|
174 static int canna_inhibit_hankakukana;
|
70
|
175
|
|
176 static Lisp_Object Vcanna_kakutei_string;
|
|
177 static Lisp_Object Vcanna_kakutei_yomi;
|
|
178 static Lisp_Object Vcanna_kakutei_romaji;
|
|
179 static Lisp_Object Vcanna_henkan_string;
|
373
|
180 static int canna_henkan_length;
|
|
181 static int canna_henkan_revPos;
|
|
182 static int canna_henkan_revLen;
|
70
|
183 static Lisp_Object Vcanna_ichiran_string;
|
373
|
184 static int canna_ichiran_length;
|
|
185 static int canna_ichiran_revPos;
|
|
186 static int canna_ichiran_revLen;
|
70
|
187 static Lisp_Object Vcanna_mode_string;
|
|
188
|
|
189 static int IRCP_context;
|
|
190
|
|
191 static Lisp_Object storeResults (unsigned char *, int, jrKanjiStatus *);
|
|
192 static Lisp_Object kanjiYomiList (int, int);
|
|
193
|
|
194 #ifdef CANNA_MULE
|
|
195 static void m2c (unsigned char *, int, unsigned char *);
|
|
196 static Lisp_Object mule_make_string (unsigned char *, int);
|
213
|
197 static int mule_strlen (unsigned char *, int);
|
197
|
198 static void count_char (unsigned char *,int, int, int, int *, int *, int *);
|
70
|
199 #define make_string mule_make_string
|
|
200 #endif
|
|
201
|
|
202 /* Lisp functions definition */
|
|
203
|
|
204 DEFUN ("canna-key-proc", Fcanna_key_proc, 1, 1, 0, /*
|
|
205 Translate a key input to a set of strings. The strings contain both
|
|
206 well-formed string and intermediate result to show the translation
|
|
207 information to a user. Converted strings are stored in specific
|
|
208 variables.
|
|
209 */
|
|
210 (ch))
|
|
211 {
|
|
212 jrKanjiStatus ks;
|
|
213 int len;
|
|
214
|
98
|
215 CHECK_CHAR_COERCE_INT (ch);
|
70
|
216 len = jrKanjiString (0, XCHAR (ch), buf, KEYTOSTRSIZE, &ks);
|
|
217 return storeResults (buf, len, &ks);
|
|
218 }
|
|
219
|
|
220 static Lisp_Object
|
|
221 storeResults (unsigned char *buf, int len, jrKanjiStatus *ks)
|
|
222 {
|
|
223 Lisp_Object val = Qnil;
|
|
224
|
|
225 if (len < 0)
|
|
226 { /* Error detected */
|
|
227 val = make_string ((unsigned char*) jrKanjiError, strlen (jrKanjiError));
|
|
228 }
|
|
229 else
|
|
230 {
|
|
231 /* ³ÎÄꤷ¤¿Ê¸»úÎó */
|
|
232 Vcanna_kakutei_string = make_string (buf, len);
|
|
233 val = make_int (len);
|
|
234 /* ³ÎÄꤷ¤¿Ê¸»úÎó¤ÎÆɤߤξðÊó... */
|
|
235 Vcanna_kakutei_yomi = Vcanna_kakutei_romaji = Qnil;
|
|
236 if (ks->info & KanjiYomiInfo)
|
|
237 {
|
|
238 unsigned char *p = buf + len + 1;
|
|
239 int yomilen = strlen (p);
|
|
240
|
|
241 if (len + yomilen + 1 < KEYTOSTRSIZE)
|
|
242 {
|
|
243 int yomilen2;
|
|
244
|
|
245 Vcanna_kakutei_yomi = make_string (p, yomilen); /* ÆÉ¤ß */
|
|
246 p += yomilen + 1;
|
|
247 yomilen2 = strlen (p);
|
|
248 if (len + yomilen + yomilen2 + 2 < KEYTOSTRSIZE)
|
|
249 {
|
|
250 Vcanna_kakutei_romaji = make_string (p, yomilen2); /* ¥í¡¼¥Þ»ú */
|
|
251 }
|
|
252 }
|
|
253 }
|
|
254
|
|
255
|
|
256 /* ¸õÊäɽ¼¨¤Îʸ»úÎó¤Ç¤¹¡£*/
|
|
257 Vcanna_henkan_string = Qnil;
|
|
258 if (ks->length >= 0)
|
|
259 {
|
|
260 Vcanna_henkan_string = make_string (ks->echoStr, ks->length);
|
|
261 #ifndef CANNA_MULE
|
373
|
262 canna_henkan_length = ks->length;
|
|
263 canna_henkan_revPos = ks->revPos;
|
|
264 canna_henkan_revLen = ks->revLen;
|
70
|
265 #else /* CANNA_MULE */
|
373
|
266 if (canna_underline)
|
70
|
267 {
|
373
|
268 canna_henkan_length = mule_strlen (ks->echoStr,ks->length);
|
|
269 canna_henkan_revPos = mule_strlen (ks->echoStr,ks->revPos);
|
|
270 canna_henkan_revLen = mule_strlen (ks->echoStr+ks->revPos,ks->revLen);
|
70
|
271 }
|
|
272 else
|
|
273 {
|
|
274 count_char (ks->echoStr, ks->length, ks->revPos, ks->revLen,
|
373
|
275 &canna_henkan_length, &canna_henkan_revPos,
|
|
276 &canna_henkan_revLen);
|
70
|
277 }
|
|
278 #endif /* CANNA_MULE */
|
|
279 }
|
|
280
|
|
281 /* °ìÍ÷¤Î¾ðÊó */
|
|
282 Vcanna_ichiran_string = Qnil;
|
|
283 if (ks->info & KanjiGLineInfo && ks->gline.length >= 0)
|
|
284 {
|
|
285 Vcanna_ichiran_string = make_string (ks->gline.line, ks->gline.length);
|
|
286 #ifndef CANNA_MULE
|
373
|
287 canna_ichiran_length = ks->gline.length;
|
|
288 canna_ichiran_revPos = ks->gline.revPos;
|
|
289 canna_ichiran_revLen = ks->gline.revLen;
|
70
|
290 #else /* CANNA_MULE */
|
|
291 count_char (ks->gline.line, ks->gline.length,
|
373
|
292 ks->gline.revPos, ks->gline.revLen, &canna_ichiran_length,
|
|
293 &canna_ichiran_revPos, &canna_ichiran_revLen);
|
70
|
294 #endif /* CANNA_MULE */
|
|
295 }
|
|
296
|
|
297 /* ¥â¡¼¥É¤Î¾ðÊó */
|
|
298 Vcanna_mode_string = Qnil;
|
|
299 if (ks->info & KanjiModeInfo)
|
|
300 {
|
|
301 Vcanna_mode_string = make_string (ks->mode, strlen (ks->mode));
|
|
302 }
|
|
303
|
|
304 /* ¤½¤Î¾¤Î¾ðÊó */
|
373
|
305 canna_empty_info = (ks->info & KanjiEmptyInfo) ? 1 : 0;
|
|
306 canna_through_info = (ks->info & KanjiThroughInfo) ? 1 : 0;
|
70
|
307 }
|
|
308
|
|
309 return val;
|
|
310 }
|
|
311
|
|
312 DEFUN ("canna-set-bunsetsu-kugiri", Fcanna_set_bunsetsu, 0, 1, 0, /*
|
|
313 This function sets the clause separator.
|
|
314 If non-nil value is specified, the white space separator will be used.
|
|
315 No separator will be used otherwise.
|
|
316 */
|
|
317 (num))
|
|
318 {
|
|
319 int kugiri; /* ʸÀá¶èÀÚ¤ê¤ò¤¹¤ë¤«¡© */
|
|
320
|
|
321 kugiri = NILP (num) ? 0 : 1;
|
|
322
|
|
323 jrKanjiControl (0, KC_SETBUNSETSUKUGIRI, (char *) kugiri);
|
197
|
324
|
|
325 return Qnil;
|
70
|
326 }
|
|
327
|
98
|
328 /* For whatever reason, calling Fding directly from libCanna loses */
|
|
329 static void call_Fding()
|
|
330 {
|
|
331 extern Lisp_Object Fding();
|
|
332
|
183
|
333 Fding (Qnil, Qnil, Qnil);
|
98
|
334 }
|
|
335
|
70
|
336 DEFUN ("canna-initialize", Fcanna_initialize, 0, 3, 0, /*
|
|
337 Initialize ``canna'', which is a kana-to-kanji converter for GNU Emacs.
|
|
338 The first arg specifies if inserting space character between BUNSETSU when
|
|
339 candidates are displayed.
|
|
340 The second arg specifies server.
|
|
341 The third arg specifies a file which will be used as a customization
|
|
342 description.
|
|
343 If nil is specified for each arg, the default value will be used.
|
|
344 */
|
|
345 (num, server, rcfile))
|
|
346 {
|
|
347 Lisp_Object val;
|
|
348 int res;
|
|
349 unsigned char **p, **q;
|
|
350
|
|
351 int kugiri; /* ʸÀá¶èÀÚ¤ê¤ò¤¹¤ë¤«¡© */
|
|
352
|
|
353 IRCP_context = -1;
|
|
354
|
|
355 if (NILP (num))
|
|
356 {
|
|
357 kugiri = 1;
|
|
358 }
|
|
359 else
|
|
360 {
|
|
361 CHECK_INT (num);
|
|
362 kugiri = XINT (num);
|
|
363 kugiri = (kugiri == 1) ? 1 : 0;
|
|
364 }
|
|
365
|
|
366 if (NILP (server))
|
|
367 {
|
|
368 jrKanjiControl (0, KC_SETSERVERNAME, (char *) 0);
|
|
369 }
|
|
370 else
|
|
371 {
|
|
372 char servername[256];
|
|
373
|
|
374 CHECK_STRING (server);
|
380
|
375 strncpy (servername, XSTRING_DATA (server), XSTRING_LENGTH (server));
|
|
376 servername[XSTRING_LENGTH (server)] = '\0';
|
70
|
377 jrKanjiControl (0, KC_SETSERVERNAME, servername);
|
|
378 }
|
|
379
|
|
380 if (NILP (rcfile))
|
|
381 {
|
|
382 jrKanjiControl (0, KC_SETINITFILENAME, (char *) 0);
|
|
383 }
|
|
384 else
|
|
385 {
|
|
386 char rcname[256];
|
|
387
|
|
388 CHECK_STRING (rcfile);
|
380
|
389 strncpy (rcname, XSTRING_DATA (rcfile), XSTRING_LENGTH (rcfile));
|
|
390 rcname[XSTRING_LENGTH (rcfile)] = '\0';
|
70
|
391 jrKanjiControl (0, KC_SETINITFILENAME, rcname);
|
|
392 }
|
|
393
|
|
394 warning = (char **) 0;
|
|
395 #ifdef nec_ews_svr4
|
|
396 stop_polling ();
|
|
397 #endif /* nec_ews_svr4 */
|
|
398 res = jrKanjiControl (0, KC_INITIALIZE, (char *)&warning);
|
|
399 #ifdef nec_ews_svr4
|
|
400 start_polling ();
|
|
401 #endif /* nec_ews_svr4 */
|
|
402 val = Qnil;
|
|
403 if (warning)
|
|
404 {
|
|
405 for (p = q = (unsigned char **) warning ; *q ; q++)
|
|
406 ;
|
|
407 while (p < q)
|
|
408 {
|
|
409 q--;
|
|
410 val = Fcons (make_string (*q, strlen (*q)), val);
|
|
411 }
|
|
412 }
|
|
413 val = Fcons (val, Qnil);
|
|
414
|
|
415 if (res == -1)
|
|
416 {
|
380
|
417 val = Fcons (make_string ((unsigned char*) jrKanjiError,
|
70
|
418 strlen (jrKanjiError)), val);
|
|
419 /* ¥¤¥Ë¥·¥ã¥é¥¤¥º¤Ç¼ºÇÔ¤·¤¿¾ì¹ç¡£ */
|
|
420 return Fcons (Qnil, val);
|
|
421 }
|
|
422 else
|
|
423 {
|
98
|
424 extern void (*jrBeepFunc)();
|
|
425 Lisp_Object CANNA_mode_keys ();
|
70
|
426
|
98
|
427 jrBeepFunc = call_Fding;
|
70
|
428
|
|
429 #ifdef KC_SETAPPNAME
|
|
430 #ifndef CANNA_MULE
|
|
431 wcKanjiControl (0, KC_SETAPPNAME, "nemacs");
|
|
432 #else /* CANNA_MULE */
|
|
433 wcKanjiControl (0, KC_SETAPPNAME, "mule");
|
|
434 #endif /* CANNA_MULE */
|
|
435 #endif /* KC_SETAPPNAME */
|
|
436
|
|
437 jrKanjiControl (0, KC_SETBUNSETSUKUGIRI, (char *) kugiri);
|
|
438 jrKanjiControl (0, KC_SETWIDTH, (char *) 78);
|
|
439 #ifndef CANNA_MULE
|
|
440 jrKanjiControl (0, KC_INHIBITHANKAKUKANA, (char *) 1);
|
|
441 #else
|
|
442 /* mule ¤À¤Ã¤¿¤éȾ³Ñ¥«¥¿¥«¥Ê¤â»È¤¨¤ë */
|
373
|
443 if (canna_inhibit_hankakukana)
|
70
|
444 jrKanjiControl (0, KC_INHIBITHANKAKUKANA, (char *) 1);
|
|
445 #endif
|
|
446 jrKanjiControl (0, KC_YOMIINFO, (char *) 2); /* ¢¨£²: ¥í¡¼¥Þ»ú¤Þ¤ÇÊÖ¤¹ */
|
|
447 val = Fcons (Qnil, val);
|
|
448 return Fcons (CANNA_mode_keys (), val);
|
|
449 }
|
|
450 }
|
|
451
|
|
452 DEFUN ("canna-finalize", Fcanna_finalize, 0, 0, 0, /*
|
|
453 finalize ``canna'', which is a kana-to-kanji converter for GNU Emacs.
|
|
454 This cause to write miscellaneous informations to kana-to-kanji dictionary.
|
|
455 */
|
|
456 ())
|
|
457 {
|
|
458 Lisp_Object val;
|
|
459 unsigned char **p;
|
|
460
|
|
461 jrKanjiControl (0, KC_FINALIZE, (char *)&warning);
|
|
462
|
|
463 val = Qnil;
|
|
464 if (warning)
|
|
465 {
|
|
466 for (p = (unsigned char**) warning ; *p ; p++)
|
|
467 {
|
|
468 val = Fcons (make_string (*p, strlen (*p)), val);
|
|
469 }
|
|
470 }
|
|
471 val = Fcons (val, Qnil);
|
|
472 IRCP_context = -1;
|
|
473 return val;
|
|
474 }
|
|
475
|
|
476 DEFUN ("canna-touroku-string", Fcanna_touroku_string, 1, 1, 0, /*
|
|
477 Register Kanji words into kana-to-kanji conversion dictionary.
|
|
478 */
|
|
479 (str))
|
|
480 {
|
|
481 jrKanjiStatusWithValue ksv;
|
|
482 jrKanjiStatus ks;
|
|
483 int len;
|
|
484 Lisp_Object val;
|
|
485 #ifdef CANNA_MULE
|
|
486 unsigned char cbuf[4096];
|
|
487 #endif
|
|
488
|
|
489 CHECK_STRING (str);
|
|
490 ksv.buffer = (unsigned char *) buf;
|
|
491 ksv.bytes_buffer = KEYTOSTRSIZE;
|
|
492 #ifndef CANNA_MULE
|
380
|
493 ks.echoStr = XSTRING_DATA (str);
|
|
494 ks.length = XSTRING_LENGTH (str);
|
70
|
495 #else /* CANNA_MULE */
|
380
|
496 m2c (XSTRING_DATA (str), XSTRING_LENGTH (str), cbuf);
|
70
|
497 ks.echoStr = cbuf;
|
|
498 ks.length = strlen (cbuf);
|
|
499 #endif /* CANNA_MULE */
|
|
500 ksv.ks = &ks;
|
|
501 len = jrKanjiControl (0, KC_DEFINEKANJI, (char *)&ksv);
|
|
502 val = storeResults (buf, ksv.val, ksv.ks);
|
|
503 return val;
|
|
504 }
|
|
505
|
|
506 DEFUN ("canna-set-width", Fcanna_set_width, 1, 1, 0, /*
|
380
|
507 Set status-line width information, which is used to display
|
70
|
508 kanji candidates.
|
|
509 */
|
|
510 (num))
|
|
511 {
|
|
512 CHECK_INT (num);
|
|
513
|
|
514 jrKanjiControl (0, KC_SETWIDTH, (char *) XINT (num));
|
|
515 return Qnil;
|
|
516 }
|
|
517
|
|
518 DEFUN ("canna-change-mode", Fcanna_change_mode, 1, 1, 0, /*
|
|
519 Change Japanese pre-edit mode.
|
|
520 */
|
|
521 (num))
|
|
522 {
|
|
523 jrKanjiStatusWithValue ksv;
|
|
524 jrKanjiStatus ks;
|
|
525 Lisp_Object val;
|
|
526
|
|
527 CHECK_INT (num);
|
|
528
|
|
529 ksv.buffer = (unsigned char *) buf;
|
|
530 ksv.bytes_buffer = KEYTOSTRSIZE;
|
|
531 ksv.ks = &ks;
|
|
532 ksv.val = XINT (num);
|
|
533 jrKanjiControl (0, KC_CHANGEMODE, (char *)&ksv);
|
|
534 val = storeResults (buf, ksv.val, ksv.ks);
|
|
535 return val;
|
|
536 }
|
|
537
|
|
538 Lisp_Object
|
|
539 CANNA_mode_keys (void)
|
|
540 {
|
|
541 #define CANNAWORKBUFSIZE 32
|
|
542 char xxx[CANNAWORKBUFSIZE];
|
|
543 Lisp_Object val;
|
|
544 int i, n;
|
|
545
|
|
546 n = jrKanjiControl (0, KC_MODEKEYS, xxx);
|
|
547 val = Qnil;
|
|
548 for (i = n ; i > 0 ;)
|
|
549 {
|
|
550 --i;
|
|
551 /* !!#### something fucked here */
|
|
552 val = Fcons (make_char ((int)(0xFF & (unsigned char) xxx[i])), val);
|
|
553 }
|
|
554 return val;
|
|
555 }
|
|
556
|
|
557 DEFUN ("canna-store-yomi", Fcanna_store_yomi, 1, 2, 0, /*
|
|
558 Store yomi characters as a YOMI of kana-to-kanji conversion.
|
|
559 */
|
|
560 (yomi, roma))
|
|
561 {
|
|
562 jrKanjiStatusWithValue ksv;
|
|
563 jrKanjiStatus ks;
|
|
564
|
|
565 CHECK_STRING (yomi);
|
|
566 #ifndef CANNA_MULE
|
380
|
567 strncpy (buf, XSTRING_DATA (yomi), XSTRING_LENGTH (yomi));
|
|
568 ks.length = XSTRING_LENGTH (yomi);
|
70
|
569 buf[ks.length] = '\0';
|
|
570 #else /* CANNA_MULE */
|
380
|
571 m2c (XSTRING_DATA (yomi), XSTRING_LENGTH (yomi), buf);
|
70
|
572 ks.length = strlen (buf);
|
|
573 #endif /* CANNA_MULE */
|
|
574
|
|
575 if (NILP (roma))
|
|
576 {
|
|
577 ks.mode = 0;
|
|
578 }
|
|
579 else
|
|
580 {
|
|
581 CHECK_STRING (roma);
|
|
582
|
|
583 #ifndef CANNA_MULE
|
380
|
584 strncpy (buf + XSTRING_LENGTH (yomi) + 1, XSTRING_DATA (roma),
|
|
585 XSTRING_LENGTH (roma));
|
|
586 buf[XSTRING_LENGTH (yomi) + 1 + XSTRING_LENGTH (roma)] = '\0';
|
|
587 ks.mode = (unsigned char *)(buf + XSTRING_LENGTH (yomi) + 1);
|
70
|
588 #else /* CANNA_MULE */
|
|
589 ks.mode = (unsigned char *)(buf + ks.length + 1);
|
380
|
590 m2c (XSTRING_DATA (roma), XSTRING_LENGTH (roma), ks.mode);
|
70
|
591 #endif /* CANNA_MULE */
|
|
592 }
|
|
593
|
|
594 ks.echoStr = (unsigned char *) buf;
|
|
595 ksv.buffer = (unsigned char *) buf; /* ÊÖÃÍÍÑ */
|
|
596 ksv.bytes_buffer = KEYTOSTRSIZE;
|
|
597 ksv.ks = &ks;
|
|
598
|
|
599 jrKanjiControl (0, KC_STOREYOMI, (char *)&ksv);
|
|
600
|
|
601 return storeResults (buf, ksv.val, ksv.ks);
|
|
602 }
|
|
603
|
|
604 DEFUN ("canna-do-function", Fcanna_do_function, 1, 2, 0, /*
|
|
605 Do specified function at current mode.
|
|
606 */
|
|
607 (num, ch))
|
|
608 {
|
|
609 jrKanjiStatusWithValue ksv;
|
|
610 jrKanjiStatus ks;
|
|
611 Lisp_Object val;
|
|
612
|
|
613 CHECK_INT (num);
|
|
614
|
|
615 if (NILP (ch))
|
|
616 {
|
|
617 *buf = '@';
|
|
618 }
|
|
619 else
|
|
620 {
|
|
621 CHECK_CHAR (ch);
|
|
622 *buf = XCHAR (ch);
|
|
623 }
|
|
624
|
|
625 ksv.buffer = (unsigned char *) buf;
|
|
626 ksv.bytes_buffer = KEYTOSTRSIZE;
|
|
627 ksv.ks = &ks;
|
|
628 ksv.val = XINT (num);
|
|
629 jrKanjiControl (0, KC_DO, (char *) &ksv);
|
|
630 val = storeResults (buf, ksv.val, ksv.ks);
|
|
631 return val;
|
|
632 }
|
|
633
|
|
634 DEFUN ("canna-parse", Fcanna_parse, 1, 1, 0, /*
|
|
635 Parse customize string.
|
|
636 */
|
|
637 (str))
|
|
638 {
|
|
639 Lisp_Object val;
|
|
640 unsigned char **p;
|
|
641 int n;
|
|
642
|
|
643 CHECK_STRING (str);
|
|
644
|
|
645 #ifndef CANNA_MULE
|
380
|
646 strncpy (buf, XSTRING_DATA (str), XSTRING_LENGTH (str));
|
|
647 buf[XSTRING_LENGTH (str)] = '\0';
|
70
|
648 #else /* CANNA_MULE */
|
380
|
649 m2c (XSTRING_DATA (str), XSTRING_LENGTH (str), buf);
|
70
|
650 #endif /* CANNA_MULE */
|
|
651 p = (unsigned char**) buf;
|
|
652 n = jrKanjiControl (0, KC_PARSE, (char *) &p);
|
|
653 val = Qnil;
|
|
654 while (n > 0)
|
|
655 {
|
|
656 n--;
|
|
657 val = Fcons (make_string (p[n], strlen (p[n])), val);
|
|
658 }
|
|
659 return val;
|
|
660 }
|
|
661
|
|
662 DEFUN ("canna-query-mode", Fcanna_query_mode, 0, 0, 0, /*
|
|
663 Get current mode string.
|
|
664 */
|
|
665 ())
|
|
666 {
|
|
667 unsigned char buf[256];
|
|
668
|
|
669 jrKanjiControl (0, KC_QUERYMODE, buf);
|
|
670 return make_string (buf, strlen (buf));
|
|
671 }
|
|
672
|
|
673 /*
|
|
674 * Functions following this line are for KKCP interface compatible
|
|
675 * library. These functions may be used by MILK system.
|
|
676 */
|
|
677
|
|
678 #define RKBUFSIZE 1024
|
|
679
|
|
680 static unsigned char yomibuf[RKBUFSIZE];
|
|
681 static short kugiri[RKBUFSIZE / 2];
|
|
682
|
|
683 static int
|
|
684 confirmContext (void)
|
|
685 {
|
|
686 if (IRCP_context < 0)
|
|
687 {
|
|
688 int context;
|
|
689
|
|
690 if ((context = jrKanjiControl (0, KC_GETCONTEXT, (char *) 0)) == -1)
|
|
691 {
|
|
692 return 0;
|
|
693 }
|
|
694 IRCP_context = context;
|
|
695 }
|
|
696 return 1;
|
|
697 }
|
|
698
|
|
699 static int
|
|
700 byteLen (int bun, int len)
|
|
701 {
|
|
702 int i = 0, offset = 0, ch;
|
|
703
|
|
704 if (0 <= bun && bun < RKBUFSIZE)
|
|
705 {
|
|
706 offset = kugiri[bun];
|
|
707 }
|
|
708
|
|
709 while (len-- > 0 && (ch = (int) yomibuf[offset + i]))
|
|
710 {
|
|
711 i++;
|
|
712 if (ch & 0x80)
|
|
713 {
|
|
714 i++;
|
|
715 }
|
|
716 }
|
|
717 return i;
|
|
718 }
|
|
719
|
|
720 DEFUN ("canna-henkan-begin", Fcanna_henkan_begin, 1, 1, 0, /*
|
404
|
721 Return the result of kana-to-kanji conversion.
|
|
722 Clause separator is set.
|
70
|
723 */
|
|
724 (yomi))
|
|
725 {
|
|
726 int nbun;
|
|
727
|
|
728 CHECK_STRING (yomi);
|
|
729 if (confirmContext () == 0)
|
|
730 {
|
|
731 return Qnil;
|
|
732 }
|
|
733 #ifndef CANNA_MULE
|
380
|
734 strncpy (yomibuf, XSTRING_DATA (yomi), XSTRING_LENGTH (yomi));
|
|
735 yomibuf[XSTRING_LENGTH (yomi)] = '\0';
|
|
736 nbun = RkBgnBun (IRCP_context, XSTRING_DATA (yomi), XSTRING_LENGTH (yomi),
|
70
|
737 (RK_XFER << RK_XFERBITS) | RK_KFER);
|
|
738 #else /* CANNA_MULE */
|
380
|
739 m2c (XSTRING_DATA (yomi), XSTRING_LENGTH (yomi), yomibuf);
|
70
|
740 nbun = RkBgnBun (IRCP_context, (char *) yomibuf, strlen (yomibuf),
|
|
741 (RK_XFER << RK_XFERBITS) | RK_KFER);
|
|
742 #endif /* CANNA_MULE */
|
|
743
|
|
744 return kanjiYomiList (IRCP_context, nbun);
|
|
745 }
|
|
746
|
|
747 static Lisp_Object
|
|
748 kanjiYomiList (int context, int nbun)
|
|
749 {
|
|
750 Lisp_Object val, res = Qnil;
|
|
751 unsigned char RkBuf[RKBUFSIZE];
|
|
752 int len, i, total;
|
|
753
|
|
754 for (i = nbun ; i > 0 ; )
|
|
755 {
|
|
756 i--;
|
|
757 RkGoTo (context, i);
|
|
758 len = RkGetKanji (context, RkBuf, RKBUFSIZE);
|
|
759 val = make_string (RkBuf, len);
|
|
760 len = RkGetYomi (context, RkBuf, RKBUFSIZE);
|
|
761 res = Fcons (Fcons (val, make_string (RkBuf, len)), res);
|
|
762 if (i < RKBUFSIZE / 2)
|
|
763 {
|
|
764 kugiri[i] = len;
|
|
765 }
|
|
766 }
|
|
767 for (i = 0, total = 0 ; i < nbun ; i++)
|
|
768 {
|
|
769 int temp = kugiri[i];
|
|
770 kugiri[i] = total;
|
|
771 total += temp;
|
|
772 }
|
|
773 return res;
|
|
774 }
|
|
775
|
|
776 DEFUN ("canna-henkan-next", Fcanna_henkan_next, 1, 1, 0, /*
|
404
|
777 Return the list of candidates.
|
70
|
778 */
|
|
779 (bunsetsu))
|
|
780 {
|
197
|
781 int i, slen, len;
|
70
|
782 unsigned char *p, RkBuf[RKBUFSIZE];
|
|
783 Lisp_Object res = Qnil, endp;
|
|
784
|
|
785 CHECK_INT (bunsetsu);
|
|
786 if (confirmContext () == 0)
|
|
787 {
|
|
788 return Qnil;
|
|
789 }
|
|
790 RkGoTo (IRCP_context, XINT (bunsetsu));
|
|
791 len = RkGetKanjiList (IRCP_context, RkBuf, RKBUFSIZE);
|
|
792 p = RkBuf;
|
|
793 for (i = 0 ; i < len ; i++)
|
|
794 {
|
|
795 slen = strlen (p);
|
80
|
796 if (NILP(res))
|
70
|
797 {
|
|
798 endp = res = Fcons (make_string (p, slen), Qnil);
|
|
799 }
|
|
800 else
|
|
801 {
|
404
|
802 endp = XCDR (res) = Fcons (make_string (p, slen), Qnil);
|
70
|
803 }
|
|
804 p += slen + 1;
|
|
805 }
|
|
806 return res;
|
|
807 }
|
|
808
|
|
809 DEFUN ("canna-bunsetu-henkou", Fcanna_bunsetu_henkou, 2, 2, 0, /*
|
404
|
810 Specify the length of a clause.
|
70
|
811 */
|
|
812 (bunsetsu, bunlen))
|
|
813 {
|
|
814 int nbun, len;
|
|
815
|
|
816 CHECK_INT (bunsetsu);
|
|
817 CHECK_INT (bunlen);
|
380
|
818
|
70
|
819 nbun = XINT (bunsetsu);
|
|
820 if (confirmContext () == 0)
|
|
821 {
|
|
822 return Qnil;
|
|
823 }
|
|
824 RkGoTo (IRCP_context, nbun);
|
|
825 len = byteLen (nbun, XINT (bunlen));
|
|
826 return kanjiYomiList (IRCP_context, RkResize (IRCP_context, len));
|
|
827 }
|
|
828
|
|
829 DEFUN ("canna-henkan-kakutei", Fcanna_henkan_kakutei, 2, 2, 0, /*
|
404
|
830 Select a candidate.
|
70
|
831 */
|
|
832 (bun, kouho))
|
|
833 {
|
98
|
834 int nbun, nkouho;
|
|
835
|
70
|
836 if (confirmContext () == 0)
|
|
837 {
|
|
838 return Qnil;
|
|
839 }
|
98
|
840 nbun = XINT(bun);
|
|
841 RkGoTo (IRCP_context, nbun);
|
|
842
|
|
843 nkouho = XINT(kouho);
|
|
844 RkXfer (IRCP_context, nkouho);
|
70
|
845 return Qt;
|
|
846 }
|
|
847
|
|
848 DEFUN ("canna-henkan-end", Fcanna_henkan_end, 0, 0, 0, /*
|
404
|
849 End conversion.
|
70
|
850 */
|
|
851 ())
|
|
852 {
|
|
853 if (confirmContext () == 0)
|
|
854 {
|
|
855 return Qnil;
|
|
856 }
|
|
857 RkEndBun (IRCP_context, 1); /* ³Ø½¬¤Ï¤¤¤Ä¤Ç¤â¹Ô¤Ã¤ÆÎɤ¤¤â¤Î¤Ê¤Î¤«¡© */
|
|
858 return Qt;
|
|
859 }
|
|
860
|
|
861 DEFUN ("canna-henkan-quit", Fcanna_henkan_quit, 0, 0, 0, /*
|
404
|
862 Quit conversion.
|
70
|
863 */
|
|
864 ())
|
|
865 {
|
|
866 if (confirmContext () == 0)
|
|
867 {
|
|
868 return Qnil;
|
|
869 }
|
|
870 RkEndBun (IRCP_context, 0);
|
|
871 return Qt;
|
|
872 }
|
|
873
|
|
874 /* variables below this line is constants of Canna */
|
|
875
|
373
|
876 static int canna_mode_AlphaMode;
|
|
877 static int canna_mode_EmptyMode;
|
|
878 static int canna_mode_KigoMode;
|
|
879 static int canna_mode_YomiMode;
|
|
880 static int canna_mode_JishuMode;
|
|
881 static int canna_mode_TankouhoMode;
|
|
882 static int canna_mode_IchiranMode;
|
|
883 static int canna_mode_YesNoMode;
|
|
884 static int canna_mode_OnOffMode;
|
70
|
885 #ifdef CANNA_MODE_AdjustBunsetsuMode
|
373
|
886 static int canna_mode_AdjustBunsetsuMode;
|
70
|
887 #endif
|
|
888 #ifdef CANNA_MODE_ChikujiYomiMode
|
373
|
889 static int canna_mode_ChikujiYomiMode;
|
|
890 static int canna_mode_ChikujiTanMode;
|
70
|
891 #endif
|
|
892
|
373
|
893 static int canna_mode_HenkanMode;
|
70
|
894 #ifdef CANNA_MODE_HenkanNyuryokuMode
|
373
|
895 static int canna_mode_HenkanNyuryokuMode;
|
70
|
896 #endif
|
|
897 #ifdef CANNA_MODE_ZenHiraHenkanMode
|
373
|
898 static int canna_mode_ZenHiraHenkanMode;
|
70
|
899 #ifdef CANNA_MODE_HanHiraHenkanMode
|
373
|
900 static int canna_mode_HanHiraHenkanMode;
|
70
|
901 #endif
|
373
|
902 static int canna_mode_ZenKataHenkanMode;
|
|
903 static int canna_mode_HanKataHenkanMode;
|
|
904 static int canna_mode_ZenAlphaHenkanMode;
|
|
905 static int canna_mode_HanAlphaHenkanMode;
|
70
|
906 #endif
|
373
|
907 static int canna_mode_ZenHiraKakuteiMode;
|
70
|
908 #ifdef CANNA_MODE_HanHiraKakuteiMode
|
373
|
909 static int canna_mode_HanHiraKakuteiMode;
|
70
|
910 #endif
|
373
|
911 static int canna_mode_ZenKataKakuteiMode;
|
|
912 static int canna_mode_HanKataKakuteiMode;
|
|
913 static int canna_mode_ZenAlphaKakuteiMode;
|
|
914 static int canna_mode_HanAlphaKakuteiMode;
|
|
915 static int canna_mode_HexMode;
|
|
916 static int canna_mode_BushuMode;
|
|
917 static int canna_mode_ExtendMode;
|
|
918 static int canna_mode_RussianMode;
|
|
919 static int canna_mode_GreekMode;
|
|
920 static int canna_mode_LineMode;
|
|
921 static int canna_mode_ChangingServerMode;
|
|
922 static int canna_mode_HenkanMethodMode;
|
|
923 static int canna_mode_DeleteDicMode;
|
|
924 static int canna_mode_TourokuMode;
|
|
925 static int canna_mode_TourokuEmptyMode;
|
|
926 static int canna_mode_TourokuHinshiMode;
|
|
927 static int canna_mode_TourokuDicMode;
|
|
928 static int canna_mode_QuotedInsertMode;
|
|
929 static int canna_mode_BubunMuhenkanMode;
|
|
930 static int canna_mode_MountDicMode;
|
70
|
931
|
373
|
932 static int canna_fn_SelfInsert;
|
|
933 static int canna_fn_FunctionalInsert;
|
|
934 static int canna_fn_QuotedInsert;
|
|
935 static int canna_fn_JapaneseMode;
|
|
936 static int canna_fn_AlphaMode;
|
|
937 static int canna_fn_HenkanNyuryokuMode;
|
|
938 static int canna_fn_Forward;
|
|
939 static int canna_fn_Backward;
|
|
940 static int canna_fn_Next;
|
|
941 static int canna_fn_Prev;
|
|
942 static int canna_fn_BeginningOfLine;
|
|
943 static int canna_fn_EndOfLine;
|
|
944 static int canna_fn_DeleteNext;
|
|
945 static int canna_fn_DeletePrevious;
|
|
946 static int canna_fn_KillToEndOfLine;
|
|
947 static int canna_fn_Henkan;
|
|
948 static int canna_fn_Kakutei;
|
|
949 static int canna_fn_Extend;
|
|
950 static int canna_fn_Shrink;
|
70
|
951 #ifdef CANNA_FN_AdjustBunsetsu
|
373
|
952 static int canna_fn_AdjustBunsetsu;
|
70
|
953 #endif
|
373
|
954 static int canna_fn_Quit;
|
|
955 static int canna_fn_ConvertAsHex;
|
|
956 static int canna_fn_ConvertAsBushu;
|
|
957 static int canna_fn_KouhoIchiran;
|
|
958 static int canna_fn_BubunMuhenkan;
|
|
959 static int canna_fn_Zenkaku;
|
|
960 static int canna_fn_Hankaku;
|
|
961 static int canna_fn_ToUpper;
|
|
962 static int canna_fn_Capitalize;
|
|
963 static int canna_fn_ToLower;
|
|
964 static int canna_fn_Hiragana;
|
|
965 static int canna_fn_Katakana;
|
|
966 static int canna_fn_Romaji;
|
70
|
967 #ifdef CANNA_FN_BaseHiragana
|
373
|
968 static int canna_fn_BaseHiragana;
|
|
969 static int canna_fn_BaseKatakana;
|
|
970 static int canna_fn_BaseEisu;
|
|
971 static int canna_fn_BaseZenkaku;
|
|
972 static int canna_fn_BaseHankaku;
|
|
973 static int canna_fn_BaseKana;
|
|
974 static int canna_fn_BaseKakutei;
|
|
975 static int canna_fn_BaseHenkan;
|
|
976 static int canna_fn_BaseHiraKataToggle;
|
|
977 static int canna_fn_BaseZenHanToggle;
|
|
978 static int canna_fn_BaseKanaEisuToggle;
|
|
979 static int canna_fn_BaseKakuteiHenkanToggle;
|
|
980 static int canna_fn_BaseRotateForward;
|
|
981 static int canna_fn_BaseRotateBackward;
|
70
|
982 #endif
|
373
|
983 static int canna_fn_ExtendMode;
|
|
984 static int canna_fn_Touroku;
|
|
985 static int canna_fn_HexMode;
|
|
986 static int canna_fn_BushuMode;
|
|
987 static int canna_fn_KigouMode;
|
70
|
988 #ifdef CANNA_FN_Mark
|
373
|
989 static int canna_fn_Mark;
|
70
|
990 #endif
|
|
991 #ifdef CANNA_FN_TemporalMode
|
373
|
992 static int canna_fn_TemporalMode;
|
70
|
993 #endif
|
|
994
|
373
|
995 static int canna_key_Nfer;
|
|
996 static int canna_key_Xfer;
|
|
997 static int canna_key_Up;
|
|
998 static int canna_key_Left;
|
|
999 static int canna_key_Right;
|
|
1000 static int canna_key_Down;
|
|
1001 static int canna_key_Insert;
|
|
1002 static int canna_key_Rollup;
|
|
1003 static int canna_key_Rolldown;
|
|
1004 static int canna_key_Home;
|
|
1005 static int canna_key_Help;
|
|
1006 static int canna_key_KP_Key;
|
|
1007 static int canna_key_Shift_Nfer;
|
|
1008 static int canna_key_Shift_Xfer;
|
|
1009 static int canna_key_Shift_Up;
|
|
1010 static int canna_key_Shift_Left;
|
|
1011 static int canna_key_Shift_Right;
|
|
1012 static int canna_key_Shift_Down;
|
|
1013 static int canna_key_Cntrl_Nfer;
|
|
1014 static int canna_key_Cntrl_Xfer;
|
|
1015 static int canna_key_Cntrl_Up;
|
|
1016 static int canna_key_Cntrl_Left;
|
|
1017 static int canna_key_Cntrl_Right;
|
|
1018 static int canna_key_Cntrl_Down;
|
70
|
1019
|
|
1020 Lisp_Object VCANNA; /* by MORIOKA Tomohiko <morioka@jaist.ac.jp>
|
|
1021 1996/6/7 */
|
|
1022
|
|
1023 void
|
|
1024 syms_of_mule_canna (void)
|
|
1025 {
|
|
1026 DEFSUBR (Fcanna_key_proc);
|
|
1027 DEFSUBR (Fcanna_initialize);
|
|
1028 DEFSUBR (Fcanna_finalize);
|
|
1029 DEFSUBR (Fcanna_touroku_string);
|
|
1030 DEFSUBR (Fcanna_set_width);
|
|
1031 DEFSUBR (Fcanna_change_mode);
|
|
1032 DEFSUBR (Fcanna_store_yomi);
|
|
1033 DEFSUBR (Fcanna_do_function);
|
|
1034 DEFSUBR (Fcanna_parse);
|
|
1035 DEFSUBR (Fcanna_query_mode);
|
|
1036 DEFSUBR (Fcanna_set_bunsetsu);
|
|
1037
|
|
1038 DEFSUBR (Fcanna_henkan_begin);
|
|
1039 DEFSUBR (Fcanna_henkan_next);
|
|
1040 DEFSUBR (Fcanna_bunsetu_henkou);
|
|
1041 DEFSUBR (Fcanna_henkan_kakutei);
|
|
1042 DEFSUBR (Fcanna_henkan_end);
|
|
1043 DEFSUBR (Fcanna_henkan_quit);
|
|
1044 }
|
|
1045
|
|
1046 void
|
|
1047 vars_of_mule_canna (void)
|
|
1048 {
|
398
|
1049 DEFVAR_LISP ("CANNA", &VCANNA); /* hir@nec, 1992.5.21 */
|
|
1050 VCANNA = Qt; /* hir@nec, 1992.5.21 */
|
|
1051
|
70
|
1052 DEFVAR_LISP ("canna-kakutei-string", &Vcanna_kakutei_string /*
|
|
1053
|
|
1054 */ );
|
373
|
1055 Vcanna_kakutei_string = Qnil;
|
|
1056
|
70
|
1057 DEFVAR_LISP ("canna-kakutei-yomi", &Vcanna_kakutei_yomi /*
|
|
1058
|
|
1059 */ );
|
373
|
1060 Vcanna_kakutei_yomi = Qnil;
|
|
1061
|
70
|
1062 DEFVAR_LISP ("canna-kakutei-romaji", &Vcanna_kakutei_romaji /*
|
|
1063
|
|
1064 */ );
|
373
|
1065 Vcanna_kakutei_romaji = Qnil;
|
|
1066
|
70
|
1067 DEFVAR_LISP ("canna-henkan-string", &Vcanna_henkan_string /*
|
|
1068
|
|
1069 */ );
|
373
|
1070 Vcanna_henkan_string = Qnil;
|
|
1071
|
|
1072 DEFVAR_INT ("canna-henkan-length", &canna_henkan_length /*
|
70
|
1073
|
|
1074 */ );
|
373
|
1075 canna_henkan_length = 0;
|
|
1076
|
|
1077 DEFVAR_INT ("canna-henkan-revpos", &canna_henkan_revPos /*
|
70
|
1078
|
|
1079 */ );
|
373
|
1080 canna_henkan_revPos = 0;
|
|
1081
|
|
1082 DEFVAR_INT ("canna-henkan-revlen", &canna_henkan_revLen /*
|
70
|
1083
|
|
1084 */ );
|
373
|
1085 canna_henkan_revLen = 0;
|
|
1086
|
70
|
1087 DEFVAR_LISP ("canna-ichiran-string", &Vcanna_ichiran_string /*
|
|
1088
|
|
1089 */ );
|
373
|
1090 Vcanna_ichiran_string = Qnil;
|
|
1091
|
|
1092 DEFVAR_INT ("canna-ichiran-length", &canna_ichiran_length /*
|
70
|
1093
|
|
1094 */ );
|
373
|
1095 canna_ichiran_length = 0;
|
|
1096
|
|
1097 DEFVAR_INT ("canna-ichiran-revpos", &canna_ichiran_revPos /*
|
70
|
1098
|
|
1099 */ );
|
373
|
1100 canna_ichiran_revPos = 0;
|
|
1101
|
|
1102 DEFVAR_INT ("canna-ichiran-revlen", &canna_ichiran_revLen /*
|
70
|
1103
|
|
1104 */ );
|
373
|
1105 canna_ichiran_revLen = 0;
|
|
1106
|
70
|
1107 DEFVAR_LISP ("canna-mode-string", &Vcanna_mode_string /*
|
|
1108
|
|
1109 */ );
|
373
|
1110 Vcanna_mode_string = Qnil;
|
70
|
1111
|
373
|
1112 DEFVAR_BOOL ("canna-empty-info", &canna_empty_info /*
|
70
|
1113 For canna
|
|
1114 */ );
|
373
|
1115 canna_empty_info = 0;
|
|
1116
|
|
1117 DEFVAR_BOOL ("canna-through-info", &canna_through_info /*
|
70
|
1118 For canna
|
|
1119 */ );
|
373
|
1120 canna_through_info = 0;
|
|
1121
|
|
1122 DEFVAR_BOOL ("canna-underline", &canna_underline /*
|
70
|
1123 For canna
|
|
1124 */ );
|
373
|
1125 canna_underline = 0;
|
|
1126
|
|
1127 DEFVAR_BOOL ("canna-inhibit-hankakukana", &canna_inhibit_hankakukana /*
|
70
|
1128 For canna
|
|
1129 */ );
|
373
|
1130 canna_inhibit_hankakukana = 0;
|
70
|
1131
|
373
|
1132 DEFVAR_INT ("canna-mode-alpha-mode", &canna_mode_AlphaMode /*
|
70
|
1133
|
|
1134 */ );
|
373
|
1135 canna_mode_AlphaMode = IROHA_MODE_AlphaMode;
|
|
1136
|
|
1137 DEFVAR_INT ("canna-mode-empty-mode", &canna_mode_EmptyMode /*
|
70
|
1138
|
|
1139 */ );
|
373
|
1140 canna_mode_EmptyMode = IROHA_MODE_EmptyMode;
|
|
1141
|
|
1142 DEFVAR_INT ("canna-mode-kigo-mode", &canna_mode_KigoMode /*
|
70
|
1143
|
|
1144 */ );
|
373
|
1145 canna_mode_KigoMode = IROHA_MODE_KigoMode;
|
|
1146
|
|
1147 DEFVAR_INT ("canna-mode-yomi-mode", &canna_mode_YomiMode /*
|
70
|
1148
|
|
1149 */ );
|
373
|
1150 canna_mode_YomiMode = IROHA_MODE_YomiMode;
|
70
|
1151
|
373
|
1152 DEFVAR_INT ("canna-mode-jishu-mode", &canna_mode_JishuMode /*
|
70
|
1153
|
|
1154 */ );
|
373
|
1155 canna_mode_JishuMode = IROHA_MODE_JishuMode;
|
|
1156
|
|
1157 DEFVAR_INT ("canna-mode-tankouho-mode", &canna_mode_TankouhoMode /*
|
70
|
1158
|
|
1159 */ );
|
373
|
1160 canna_mode_TankouhoMode = IROHA_MODE_TankouhoMode;
|
|
1161
|
|
1162 DEFVAR_INT ("canna-mode-ichiran-mode", &canna_mode_IchiranMode /*
|
70
|
1163
|
|
1164 */ );
|
373
|
1165 canna_mode_IchiranMode = IROHA_MODE_IchiranMode;
|
|
1166
|
|
1167 DEFVAR_INT ("canna-mode-yes-no-mode", &canna_mode_YesNoMode /*
|
70
|
1168
|
|
1169 */ );
|
373
|
1170 canna_mode_YesNoMode = IROHA_MODE_YesNoMode;
|
|
1171
|
|
1172 DEFVAR_INT ("canna-mode-on-off-mode", &canna_mode_OnOffMode /*
|
|
1173
|
|
1174 */ );
|
|
1175 canna_mode_OnOffMode = IROHA_MODE_OnOffMode;
|
|
1176
|
70
|
1177 #ifdef CANNA_MODE_AdjustBunsetsuMode
|
|
1178 DEFVAR_INT ("canna-mode-adjust-bunsetsu-mode",
|
373
|
1179 &canna_mode_AdjustBunsetsuMode /*
|
70
|
1180
|
|
1181 */ );
|
373
|
1182 canna_mode_AdjustBunsetsuMode = CANNA_MODE_AdjustBunsetsuMode;
|
70
|
1183 #endif
|
|
1184 #ifdef CANNA_MODE_ChikujiYomiMode
|
373
|
1185 DEFVAR_INT ("canna-mode-chikuji-yomi-mode", &canna_mode_ChikujiYomiMode /*
|
70
|
1186
|
|
1187 */ );
|
373
|
1188 canna_mode_ChikujiYomiMode = CANNA_MODE_ChikujiYomiMode;
|
|
1189
|
70
|
1190 DEFVAR_INT ("canna-mode-chikuji-bunsetsu-mode",
|
373
|
1191 &canna_mode_ChikujiTanMode /*
|
70
|
1192
|
|
1193 */ );
|
373
|
1194 canna_mode_ChikujiTanMode = CANNA_MODE_ChikujiTanMode;
|
70
|
1195 #endif
|
|
1196
|
373
|
1197 DEFVAR_INT ("canna-mode-henkan-mode", &canna_mode_HenkanMode /*
|
70
|
1198
|
|
1199 */ );
|
373
|
1200 canna_mode_HenkanMode = IROHA_MODE_HenkanMode;
|
|
1201
|
70
|
1202 #ifdef CANNA_MODE_HenkanNyuryokuMode
|
|
1203 DEFVAR_INT ("canna-mode-henkan-nyuuryoku-mode",
|
373
|
1204 &canna_mode_HenkanNyuryokuMode /*
|
70
|
1205
|
|
1206 */ );
|
373
|
1207 canna_mode_HenkanNyuryokuMode = CANNA_MODE_HenkanNyuryokuMode;
|
70
|
1208 #endif
|
|
1209 #ifdef CANNA_MODE_ZenHiraHenkanMode
|
|
1210 DEFVAR_INT ("canna-mode-zen-hira-henkan-mode",
|
373
|
1211 &canna_mode_ZenHiraHenkanMode /*
|
70
|
1212
|
|
1213 */ );
|
373
|
1214 canna_mode_ZenHiraHenkanMode = CANNA_MODE_ZenHiraHenkanMode;
|
70
|
1215 #ifdef CANNA_MODE_HanHiraHenkanMode
|
|
1216 DEFVAR_INT ("canna-mode-han-hira-henkan-mode",
|
373
|
1217 &canna_mode_HanHiraHenkanMode /*
|
70
|
1218
|
|
1219 */ );
|
373
|
1220 canna_mode_HanHiraHenkanMode = CANNA_MODE_HanHiraHenkanMode;
|
70
|
1221 #endif
|
|
1222 DEFVAR_INT ("canna-mode-zen-kata-henkan-mode",
|
373
|
1223 &canna_mode_ZenKataHenkanMode /*
|
70
|
1224
|
|
1225 */ );
|
373
|
1226 canna_mode_ZenKataHenkanMode = CANNA_MODE_ZenKataHenkanMode;
|
|
1227
|
70
|
1228 DEFVAR_INT ("canna-mode-han-kata-henkan-mode",
|
373
|
1229 &canna_mode_HanKataHenkanMode /*
|
|
1230
|
|
1231 */ );
|
|
1232 canna_mode_HanKataHenkanMode = CANNA_MODE_HanKataHenkanMode;
|
|
1233
|
|
1234 DEFVAR_INT ("canna-mode-zen-alpha-henkan-mode",
|
|
1235 &canna_mode_ZenAlphaHenkanMode /*
|
70
|
1236
|
|
1237 */ );
|
373
|
1238 canna_mode_ZenAlphaHenkanMode = CANNA_MODE_ZenAlphaHenkanMode;
|
|
1239
|
|
1240 DEFVAR_INT ("canna-mode-han-alpha-henkan-mode",
|
|
1241 &canna_mode_HanAlphaHenkanMode /*
|
70
|
1242
|
|
1243 */ );
|
373
|
1244 canna_mode_HanAlphaHenkanMode = CANNA_MODE_HanAlphaHenkanMode;
|
70
|
1245 #endif
|
|
1246 DEFVAR_INT ("canna-mode-zen-hira-kakutei-mode",
|
373
|
1247 &canna_mode_ZenHiraKakuteiMode /*
|
70
|
1248
|
|
1249 */ );
|
373
|
1250 canna_mode_ZenHiraKakuteiMode = IROHA_MODE_ZenHiraKakuteiMode;
|
70
|
1251 #ifdef CANNA_MODE_HanHiraKakuteiMode
|
|
1252 DEFVAR_INT ("canna-mode-han-hira-kakutei-mode",
|
373
|
1253 &canna_mode_HanHiraKakuteiMode /*
|
|
1254
|
|
1255 */ );
|
|
1256 canna_mode_HanHiraKakuteiMode = CANNA_MODE_HanHiraKakuteiMode;
|
|
1257 #endif
|
|
1258 DEFVAR_INT ("canna-mode-zen-kata-kakutei-mode",
|
|
1259 &canna_mode_ZenKataKakuteiMode /*
|
70
|
1260
|
|
1261 */ );
|
373
|
1262 canna_mode_ZenKataKakuteiMode = IROHA_MODE_ZenKataKakuteiMode;
|
|
1263
|
|
1264 DEFVAR_INT ("canna-mode-han-kata-kakutei-mode",
|
|
1265 &canna_mode_HanKataKakuteiMode /*
|
|
1266
|
|
1267 */ );
|
|
1268 canna_mode_HanKataKakuteiMode = IROHA_MODE_HanKataKakuteiMode;
|
|
1269
|
|
1270 DEFVAR_INT ("canna-mode-zen-alpha-kakutei-mode",
|
|
1271 &canna_mode_ZenAlphaKakuteiMode /*
|
70
|
1272
|
|
1273 */ );
|
373
|
1274 canna_mode_ZenAlphaKakuteiMode = IROHA_MODE_ZenAlphaKakuteiMode;
|
|
1275
|
|
1276 DEFVAR_INT ("canna-mode-han-alpha-kakutei-mode",
|
|
1277 &canna_mode_HanAlphaKakuteiMode /*
|
70
|
1278
|
|
1279 */ );
|
373
|
1280 canna_mode_HanAlphaKakuteiMode = IROHA_MODE_HanAlphaKakuteiMode;
|
|
1281
|
|
1282 DEFVAR_INT ("canna-mode-hex-mode", &canna_mode_HexMode /*
|
|
1283
|
|
1284 */ );
|
|
1285 canna_mode_HexMode = IROHA_MODE_HexMode;
|
|
1286
|
|
1287 DEFVAR_INT ("canna-mode-bushu-mode", &canna_mode_BushuMode /*
|
70
|
1288
|
|
1289 */ );
|
373
|
1290 canna_mode_BushuMode = IROHA_MODE_BushuMode;
|
|
1291
|
|
1292 DEFVAR_INT ("canna-mode-extend-mode", &canna_mode_ExtendMode /*
|
70
|
1293
|
|
1294 */ );
|
373
|
1295 canna_mode_ExtendMode = IROHA_MODE_ExtendMode;
|
|
1296
|
|
1297 DEFVAR_INT ("canna-mode-russian-mode", &canna_mode_RussianMode /*
|
70
|
1298
|
|
1299 */ );
|
373
|
1300 canna_mode_RussianMode = IROHA_MODE_RussianMode;
|
|
1301
|
|
1302 DEFVAR_INT ("canna-mode-greek-mode", &canna_mode_GreekMode /*
|
70
|
1303
|
|
1304 */ );
|
373
|
1305 canna_mode_GreekMode = IROHA_MODE_GreekMode;
|
|
1306
|
|
1307 DEFVAR_INT ("canna-mode-line-mode", &canna_mode_LineMode /*
|
70
|
1308
|
|
1309 */ );
|
373
|
1310 canna_mode_LineMode = IROHA_MODE_LineMode;
|
70
|
1311
|
373
|
1312 DEFVAR_INT ("canna-mode-changing-server-mode",
|
|
1313 &canna_mode_ChangingServerMode /*
|
70
|
1314
|
|
1315 */ );
|
373
|
1316 canna_mode_ChangingServerMode = IROHA_MODE_ChangingServerMode;
|
|
1317
|
|
1318 DEFVAR_INT ("canna-mode-henkan-method-mode",
|
|
1319 &canna_mode_HenkanMethodMode /*
|
70
|
1320
|
|
1321 */ );
|
373
|
1322 canna_mode_HenkanMethodMode = IROHA_MODE_HenkanMethodMode;
|
|
1323
|
|
1324 DEFVAR_INT ("canna-mode-delete-dic-mode", &canna_mode_DeleteDicMode /*
|
70
|
1325
|
|
1326 */ );
|
373
|
1327 canna_mode_DeleteDicMode = IROHA_MODE_DeleteDicMode;
|
|
1328
|
|
1329 DEFVAR_INT ("canna-mode-touroku-mode", &canna_mode_TourokuMode /*
|
70
|
1330
|
|
1331 */ );
|
373
|
1332 canna_mode_TourokuMode = IROHA_MODE_TourokuMode;
|
|
1333
|
|
1334 DEFVAR_INT ("canna-mode-touroku-empty-mode",
|
|
1335 &canna_mode_TourokuEmptyMode /*
|
70
|
1336
|
|
1337 */ );
|
373
|
1338 canna_mode_TourokuEmptyMode = IROHA_MODE_TourokuEmptyMode;
|
|
1339
|
|
1340 DEFVAR_INT ("canna-mode-touroku-hinshi-mode",
|
|
1341 &canna_mode_TourokuHinshiMode /*
|
70
|
1342
|
|
1343 */ );
|
373
|
1344 canna_mode_TourokuHinshiMode = IROHA_MODE_TourokuHinshiMode;
|
|
1345
|
|
1346 DEFVAR_INT ("canna-mode-touroku-dic-mode", &canna_mode_TourokuDicMode /*
|
70
|
1347
|
|
1348 */ );
|
373
|
1349 canna_mode_TourokuDicMode = IROHA_MODE_TourokuDicMode;
|
|
1350
|
|
1351 DEFVAR_INT ("canna-mode-quoted-insert-mode",
|
|
1352 &canna_mode_QuotedInsertMode /*
|
70
|
1353
|
|
1354 */ );
|
373
|
1355 canna_mode_QuotedInsertMode = IROHA_MODE_QuotedInsertMode;
|
|
1356
|
|
1357 DEFVAR_INT ("canna-mode-bubun-muhenkan-mode",
|
|
1358 &canna_mode_BubunMuhenkanMode /*
|
70
|
1359
|
|
1360 */ );
|
373
|
1361 canna_mode_BubunMuhenkanMode = IROHA_MODE_BubunMuhenkanMode;
|
|
1362
|
|
1363 DEFVAR_INT ("canna-mode-mount-dic-mode", &canna_mode_MountDicMode /*
|
70
|
1364
|
|
1365 */ );
|
373
|
1366 canna_mode_MountDicMode = IROHA_MODE_MountDicMode;
|
|
1367
|
|
1368 DEFVAR_INT ("canna-func-self-insert", &canna_fn_SelfInsert /*
|
70
|
1369
|
|
1370 */ );
|
373
|
1371 canna_fn_SelfInsert = IROHA_FN_SelfInsert;
|
|
1372
|
|
1373 DEFVAR_INT ("canna-func-functional-insert", &canna_fn_FunctionalInsert /*
|
|
1374
|
|
1375 */ );
|
|
1376 canna_fn_FunctionalInsert = IROHA_FN_FunctionalInsert;
|
|
1377
|
|
1378 DEFVAR_INT ("canna-func-quoted-insert", &canna_fn_QuotedInsert /*
|
70
|
1379
|
|
1380 */ );
|
373
|
1381 canna_fn_QuotedInsert = IROHA_FN_QuotedInsert;
|
70
|
1382
|
373
|
1383 DEFVAR_INT ("canna-func-japanese-mode", &canna_fn_JapaneseMode /*
|
70
|
1384
|
|
1385 */ );
|
373
|
1386 canna_fn_JapaneseMode = IROHA_FN_JapaneseMode;
|
|
1387
|
|
1388 DEFVAR_INT ("canna-func-alpha-mode", &canna_fn_AlphaMode /*
|
70
|
1389
|
|
1390 */ );
|
373
|
1391 canna_fn_AlphaMode = IROHA_FN_AlphaMode;
|
|
1392
|
|
1393 DEFVAR_INT ("canna-func-henkan-nyuryoku-mode",
|
|
1394 &canna_fn_HenkanNyuryokuMode /*
|
70
|
1395
|
|
1396 */ );
|
373
|
1397 canna_fn_HenkanNyuryokuMode = IROHA_FN_HenkanNyuryokuMode;
|
70
|
1398
|
373
|
1399 DEFVAR_INT ("canna-func-forward", &canna_fn_Forward /*
|
70
|
1400
|
|
1401 */ );
|
373
|
1402 canna_fn_Forward = IROHA_FN_Forward;
|
|
1403
|
|
1404 DEFVAR_INT ("canna-func-backward", &canna_fn_Backward /*
|
70
|
1405
|
|
1406 */ );
|
373
|
1407 canna_fn_Backward = IROHA_FN_Backward;
|
|
1408
|
|
1409 DEFVAR_INT ("canna-func-next", &canna_fn_Next /*
|
70
|
1410
|
|
1411 */ );
|
373
|
1412 canna_fn_Next = IROHA_FN_Next;
|
|
1413
|
|
1414 DEFVAR_INT ("canna-func-previous", &canna_fn_Prev /*
|
70
|
1415
|
|
1416 */ );
|
373
|
1417 canna_fn_Prev = IROHA_FN_Prev;
|
|
1418
|
|
1419 DEFVAR_INT ("canna-func-beginning-of-line", &canna_fn_BeginningOfLine /*
|
70
|
1420
|
|
1421 */ );
|
373
|
1422 canna_fn_BeginningOfLine = IROHA_FN_BeginningOfLine;
|
|
1423
|
|
1424 DEFVAR_INT ("canna-func-end-of-line", &canna_fn_EndOfLine /*
|
70
|
1425
|
|
1426 */ );
|
373
|
1427 canna_fn_EndOfLine = IROHA_FN_EndOfLine;
|
|
1428
|
|
1429 DEFVAR_INT ("canna-func-delete-next", &canna_fn_DeleteNext /*
|
70
|
1430
|
|
1431 */ );
|
373
|
1432 canna_fn_DeleteNext = IROHA_FN_DeleteNext;
|
|
1433
|
|
1434 DEFVAR_INT ("canna-func-delete_previous", &canna_fn_DeletePrevious /*
|
70
|
1435
|
|
1436 */ );
|
373
|
1437 canna_fn_DeletePrevious = IROHA_FN_DeletePrevious;
|
|
1438
|
|
1439 DEFVAR_INT ("canna-func-kill-to-end-of-line", &canna_fn_KillToEndOfLine /*
|
70
|
1440
|
|
1441 */ );
|
373
|
1442 canna_fn_KillToEndOfLine = IROHA_FN_KillToEndOfLine;
|
|
1443
|
|
1444 DEFVAR_INT ("canna-func-henkan", &canna_fn_Henkan /*
|
70
|
1445
|
|
1446 */ );
|
373
|
1447 canna_fn_Henkan = IROHA_FN_Henkan;
|
|
1448
|
|
1449 DEFVAR_INT ("canna-func-kakutei", &canna_fn_Kakutei /*
|
70
|
1450
|
|
1451 */ );
|
373
|
1452 canna_fn_Kakutei = IROHA_FN_Kakutei;
|
|
1453
|
|
1454 DEFVAR_INT ("canna-func-extend", &canna_fn_Extend /*
|
70
|
1455
|
|
1456 */ );
|
373
|
1457 canna_fn_Extend = IROHA_FN_Extend;
|
|
1458
|
|
1459 DEFVAR_INT ("canna-func-shrink", &canna_fn_Shrink /*
|
70
|
1460
|
|
1461 */ );
|
373
|
1462 canna_fn_Shrink = IROHA_FN_Shrink;
|
70
|
1463
|
373
|
1464 #ifdef CANNA_FN_AdjustBunsetsu
|
|
1465 DEFVAR_INT ("canna-func-adjust-bunsetsu", &canna_fn_AdjustBunsetsu /*
|
70
|
1466
|
|
1467 */ );
|
373
|
1468 canna_fn_AdjustBunsetsu = CANNA_FN_AdjustBunsetsu;
|
|
1469 #endif
|
|
1470 DEFVAR_INT ("canna-func-quit", &canna_fn_Quit /*
|
70
|
1471
|
|
1472 */ );
|
373
|
1473 canna_fn_Quit = IROHA_FN_Quit;
|
|
1474
|
|
1475 DEFVAR_INT ("canna-func-convert-as-hex", &canna_fn_ConvertAsHex /*
|
70
|
1476
|
|
1477 */ );
|
373
|
1478 canna_fn_ConvertAsHex = IROHA_FN_ConvertAsHex;
|
|
1479
|
|
1480 DEFVAR_INT ("canna-func-convert-as-bushu", &canna_fn_ConvertAsBushu /*
|
70
|
1481
|
|
1482 */ );
|
373
|
1483 canna_fn_ConvertAsBushu = IROHA_FN_ConvertAsBushu;
|
|
1484
|
|
1485 DEFVAR_INT ("canna-func-kouho-ichiran", &canna_fn_KouhoIchiran /*
|
70
|
1486
|
|
1487 */ );
|
373
|
1488 canna_fn_KouhoIchiran = IROHA_FN_KouhoIchiran;
|
|
1489
|
|
1490 DEFVAR_INT ("canna-func-bubun-muhenkan", &canna_fn_BubunMuhenkan /*
|
70
|
1491
|
|
1492 */ );
|
373
|
1493 canna_fn_BubunMuhenkan = IROHA_FN_BubunMuhenkan;
|
70
|
1494
|
373
|
1495 DEFVAR_INT ("canna-func-zenkaku", &canna_fn_Zenkaku /*
|
70
|
1496
|
|
1497 */ );
|
373
|
1498 canna_fn_Zenkaku = IROHA_FN_Zenkaku;
|
|
1499
|
|
1500 DEFVAR_INT ("canna-func-hankaku", &canna_fn_Hankaku /*
|
70
|
1501
|
|
1502 */ );
|
373
|
1503 canna_fn_Hankaku = IROHA_FN_Hankaku;
|
|
1504
|
|
1505 DEFVAR_INT ("canna-func-to-upper", &canna_fn_ToUpper /*
|
70
|
1506
|
|
1507 */ );
|
373
|
1508 canna_fn_ToUpper = IROHA_FN_ToUpper;
|
|
1509
|
|
1510 DEFVAR_INT ("canna-func-capitalize", &canna_fn_Capitalize /*
|
70
|
1511
|
|
1512 */ );
|
373
|
1513 canna_fn_Capitalize = IROHA_FN_Capitalize;
|
|
1514
|
|
1515 DEFVAR_INT ("canna-func-to-lower", &canna_fn_ToLower /*
|
70
|
1516
|
|
1517 */ );
|
373
|
1518 canna_fn_ToLower = IROHA_FN_ToLower;
|
|
1519
|
|
1520 DEFVAR_INT ("canna-func-hiragana", &canna_fn_Hiragana /*
|
70
|
1521
|
|
1522 */ );
|
373
|
1523 canna_fn_Hiragana = IROHA_FN_Hiragana;
|
|
1524
|
|
1525 DEFVAR_INT ("canna-func-katakana", &canna_fn_Katakana /*
|
70
|
1526
|
|
1527 */ );
|
373
|
1528 canna_fn_Katakana = IROHA_FN_Katakana;
|
|
1529
|
|
1530 DEFVAR_INT ("canna-func-romaji", &canna_fn_Romaji /*
|
70
|
1531
|
|
1532 */ );
|
373
|
1533 canna_fn_Romaji = IROHA_FN_Romaji;
|
|
1534
|
70
|
1535 #ifdef CANNA_FN_BaseHiragana
|
373
|
1536 DEFVAR_INT ("canna-func-base-hiragana", &canna_fn_BaseHiragana /*
|
70
|
1537
|
|
1538 */ );
|
373
|
1539 canna_fn_BaseHiragana = CANNA_FN_BaseHiragana;
|
|
1540
|
|
1541 DEFVAR_INT ("canna-func-base-katakana", &canna_fn_BaseKatakana /*
|
70
|
1542
|
|
1543 */ );
|
373
|
1544 canna_fn_BaseKatakana = CANNA_FN_BaseKatakana;
|
|
1545
|
|
1546 DEFVAR_INT ("canna-func-base-eisu", &canna_fn_BaseEisu /*
|
70
|
1547
|
|
1548 */ );
|
373
|
1549 canna_fn_BaseEisu = CANNA_FN_BaseEisu;
|
|
1550
|
|
1551 DEFVAR_INT ("canna-func-base-zenkaku", &canna_fn_BaseZenkaku /*
|
70
|
1552
|
|
1553 */ );
|
373
|
1554 canna_fn_BaseZenkaku = CANNA_FN_BaseZenkaku;
|
|
1555
|
|
1556 DEFVAR_INT ("canna-func-base-hankaku", &canna_fn_BaseHankaku /*
|
70
|
1557
|
|
1558 */ );
|
373
|
1559 canna_fn_BaseHankaku = CANNA_FN_BaseHankaku;
|
|
1560
|
|
1561 DEFVAR_INT ("canna-func-base-kana", &canna_fn_BaseKana /*
|
70
|
1562
|
|
1563 */ );
|
373
|
1564 canna_fn_BaseKana = CANNA_FN_BaseKana;
|
|
1565
|
|
1566 DEFVAR_INT ("canna-func-base-kakutei", &canna_fn_BaseKakutei /*
|
70
|
1567
|
|
1568 */ );
|
373
|
1569 canna_fn_BaseKakutei = CANNA_FN_BaseKakutei;
|
|
1570
|
|
1571 DEFVAR_INT ("canna-func-base-henkan", &canna_fn_BaseHenkan /*
|
70
|
1572
|
|
1573 */ );
|
373
|
1574 canna_fn_BaseHenkan = CANNA_FN_BaseHenkan;
|
|
1575
|
70
|
1576 DEFVAR_INT ("canna-func-base-hiragana-katakana-toggle",
|
373
|
1577 &canna_fn_BaseHiraKataToggle /*
|
70
|
1578
|
|
1579 */ );
|
373
|
1580 canna_fn_BaseHiraKataToggle = CANNA_FN_BaseHiraKataToggle;
|
|
1581
|
70
|
1582 DEFVAR_INT ("canna-func-base-zenkaku-hankaku-toggle",
|
373
|
1583 &canna_fn_BaseZenHanToggle /*
|
70
|
1584
|
|
1585 */ );
|
373
|
1586 canna_fn_BaseZenHanToggle = CANNA_FN_BaseZenHanToggle;
|
|
1587
|
70
|
1588 DEFVAR_INT ("canna-func-base-kana-eisu-toggle",
|
373
|
1589 &canna_fn_BaseKanaEisuToggle /*
|
70
|
1590
|
|
1591 */ );
|
373
|
1592 canna_fn_BaseKanaEisuToggle = CANNA_FN_BaseKanaEisuToggle;
|
|
1593
|
70
|
1594 DEFVAR_INT ("canna-func-base-kakutei-henkan-toggle",
|
373
|
1595 &canna_fn_BaseKakuteiHenkanToggle /*
|
70
|
1596
|
|
1597 */ );
|
373
|
1598 canna_fn_BaseKakuteiHenkanToggle = CANNA_FN_BaseKakuteiHenkanToggle;
|
|
1599
|
70
|
1600 DEFVAR_INT ("canna-func-base-rotate-forward",
|
373
|
1601 &canna_fn_BaseRotateForward /*
|
70
|
1602
|
|
1603 */ );
|
373
|
1604 canna_fn_BaseRotateForward = CANNA_FN_BaseRotateForward;
|
|
1605
|
70
|
1606 DEFVAR_INT ("canna-func-base-rotate-backward",
|
373
|
1607 &canna_fn_BaseRotateBackward /*
|
70
|
1608
|
|
1609 */ );
|
373
|
1610 canna_fn_BaseRotateBackward = CANNA_FN_BaseRotateBackward;
|
|
1611
|
70
|
1612 #endif
|
373
|
1613 DEFVAR_INT ("canna-func-extend-mode", &canna_fn_ExtendMode /*
|
70
|
1614
|
|
1615 */ );
|
373
|
1616 canna_fn_ExtendMode = IROHA_FN_ExtendMode;
|
|
1617
|
|
1618 DEFVAR_INT ("canna-func-touroku", &canna_fn_Touroku /*
|
70
|
1619
|
|
1620 */ );
|
373
|
1621 canna_fn_Touroku = IROHA_FN_Touroku;
|
|
1622
|
|
1623 DEFVAR_INT ("canna-func-hex-mode", &canna_fn_HexMode /*
|
70
|
1624
|
|
1625 */ );
|
373
|
1626 canna_fn_HexMode = IROHA_FN_HexMode;
|
|
1627
|
|
1628 DEFVAR_INT ("canna-func-bushu-mode", &canna_fn_BushuMode /*
|
70
|
1629
|
|
1630 */ );
|
373
|
1631 canna_fn_BushuMode = IROHA_FN_BushuMode;
|
|
1632
|
|
1633 DEFVAR_INT ("canna-func-kigo-mode", &canna_fn_KigouMode /*
|
|
1634
|
|
1635 */ );
|
|
1636 canna_fn_KigouMode = IROHA_FN_KigouMode;
|
|
1637
|
|
1638 #ifdef CANNA_FN_Mark
|
|
1639 DEFVAR_INT ("canna-func-mark", &canna_fn_Mark /*
|
70
|
1640
|
|
1641 */ );
|
373
|
1642 canna_fn_Mark = CANNA_FN_Mark;
|
371
|
1643 #endif
|
|
1644 #ifdef CANNA_FN_TemporalMode
|
373
|
1645 DEFVAR_INT ("canna-func-temporal-mode", &canna_fn_TemporalMode /*
|
371
|
1646
|
|
1647 */ );
|
373
|
1648 canna_fn_TemporalMode = CANNA_FN_TemporalMode;
|
70
|
1649 #endif
|
|
1650
|
373
|
1651 DEFVAR_INT ("canna-key-nfer", &canna_key_Nfer /*
|
|
1652
|
|
1653 */ );
|
|
1654 canna_key_Nfer = IROHA_KEY_Nfer;
|
|
1655
|
|
1656 DEFVAR_INT ("canna-key-xfer", &canna_key_Xfer /*
|
70
|
1657
|
|
1658 */ );
|
373
|
1659 canna_key_Xfer = IROHA_KEY_Xfer;
|
|
1660
|
|
1661 DEFVAR_INT ("canna-key-up", &canna_key_Up /*
|
70
|
1662
|
|
1663 */ );
|
373
|
1664 canna_key_Up = IROHA_KEY_Up;
|
|
1665
|
|
1666 DEFVAR_INT ("canna-key-left", &canna_key_Left /*
|
70
|
1667
|
|
1668 */ );
|
373
|
1669 canna_key_Left = IROHA_KEY_Left;
|
|
1670
|
|
1671 DEFVAR_INT ("canna-key-right", &canna_key_Right /*
|
70
|
1672
|
|
1673 */ );
|
373
|
1674 canna_key_Right = IROHA_KEY_Right;
|
70
|
1675
|
373
|
1676 DEFVAR_INT ("canna-key-down", &canna_key_Down /*
|
70
|
1677
|
|
1678 */ );
|
373
|
1679 canna_key_Down = IROHA_KEY_Down;
|
|
1680
|
|
1681 DEFVAR_INT ("canna-key-insert", &canna_key_Insert /*
|
70
|
1682
|
|
1683 */ );
|
373
|
1684 canna_key_Insert = IROHA_KEY_Insert;
|
|
1685
|
|
1686 DEFVAR_INT ("canna-key-rollup", &canna_key_Rollup /*
|
70
|
1687
|
|
1688 */ );
|
373
|
1689 canna_key_Rollup = IROHA_KEY_Rollup;
|
|
1690
|
|
1691 DEFVAR_INT ("canna-key-rolldown", &canna_key_Rolldown /*
|
70
|
1692
|
|
1693 */ );
|
373
|
1694 canna_key_Rolldown = IROHA_KEY_Rolldown;
|
|
1695
|
|
1696 DEFVAR_INT ("canna-key-home", &canna_key_Home /*
|
70
|
1697
|
|
1698 */ );
|
373
|
1699 canna_key_Home = IROHA_KEY_Home;
|
|
1700
|
|
1701 DEFVAR_INT ("canna-key-help", &canna_key_Help /*
|
70
|
1702
|
|
1703 */ );
|
373
|
1704 canna_key_Help = IROHA_KEY_Help;
|
|
1705
|
|
1706 DEFVAR_INT ("canna-key-kp-key", &canna_key_KP_Key /*
|
70
|
1707
|
|
1708 */ );
|
373
|
1709 canna_key_KP_Key = IROHA_KEY_KP_Key;
|
|
1710
|
|
1711 DEFVAR_INT ("canna-key-shift-nfer", &canna_key_Shift_Nfer /*
|
70
|
1712
|
|
1713 */ );
|
373
|
1714 canna_key_Shift_Nfer = IROHA_KEY_Shift_Nfer;
|
|
1715
|
|
1716 DEFVAR_INT ("canna-key-shift-xfer", &canna_key_Shift_Xfer /*
|
70
|
1717
|
|
1718 */ );
|
373
|
1719 canna_key_Shift_Xfer = IROHA_KEY_Shift_Xfer;
|
|
1720
|
|
1721 DEFVAR_INT ("canna-key-shift-up", &canna_key_Shift_Up /*
|
70
|
1722
|
|
1723 */ );
|
373
|
1724 canna_key_Shift_Up = IROHA_KEY_Shift_Up;
|
|
1725
|
|
1726 DEFVAR_INT ("canna-key-shift-left", &canna_key_Shift_Left /*
|
70
|
1727
|
|
1728 */ );
|
373
|
1729 canna_key_Shift_Left = IROHA_KEY_Shift_Left;
|
|
1730
|
|
1731 DEFVAR_INT ("canna-key-shift-right", &canna_key_Shift_Right /*
|
70
|
1732
|
|
1733 */ );
|
373
|
1734 canna_key_Shift_Right = IROHA_KEY_Shift_Right;
|
|
1735
|
|
1736 DEFVAR_INT ("canna-key-shift-down", &canna_key_Shift_Down /*
|
70
|
1737
|
|
1738 */ );
|
373
|
1739 canna_key_Shift_Down = IROHA_KEY_Shift_Down;
|
|
1740
|
|
1741 DEFVAR_INT ("canna-key-control-nfer", &canna_key_Cntrl_Nfer /*
|
70
|
1742
|
|
1743 */ );
|
373
|
1744 canna_key_Cntrl_Nfer = IROHA_KEY_Cntrl_Nfer;
|
|
1745
|
|
1746 DEFVAR_INT ("canna-key-control-xfer", &canna_key_Cntrl_Xfer /*
|
70
|
1747
|
|
1748 */ );
|
373
|
1749 canna_key_Cntrl_Xfer = IROHA_KEY_Cntrl_Xfer;
|
|
1750
|
|
1751 DEFVAR_INT ("canna-key-control-up", &canna_key_Cntrl_Up /*
|
70
|
1752
|
|
1753 */ );
|
373
|
1754 canna_key_Cntrl_Up = IROHA_KEY_Cntrl_Up;
|
|
1755
|
|
1756 DEFVAR_INT ("canna-key-control-left", &canna_key_Cntrl_Left /*
|
70
|
1757
|
|
1758 */ );
|
373
|
1759 canna_key_Cntrl_Left = IROHA_KEY_Cntrl_Left;
|
|
1760
|
|
1761 DEFVAR_INT ("canna-key-control-right", &canna_key_Cntrl_Right /*
|
70
|
1762
|
|
1763 */ );
|
373
|
1764 canna_key_Cntrl_Right = IROHA_KEY_Cntrl_Right;
|
|
1765
|
|
1766 DEFVAR_INT ("canna-key-control-down", &canna_key_Cntrl_Down /*
|
70
|
1767
|
|
1768 */ );
|
373
|
1769 canna_key_Cntrl_Down = IROHA_KEY_Cntrl_Down;
|
207
|
1770
|
|
1771 Fprovide(intern("CANNA"));
|
70
|
1772 }
|
|
1773
|
|
1774 #ifdef CANNA_MULE
|
|
1775 /* To handle MULE internal code and EUC.
|
|
1776 I assume CANNA can handle only Japanese EUC. */
|
|
1777
|
|
1778 /* EUC multibyte string to MULE internal string */
|
|
1779
|
|
1780 static void
|
404
|
1781 c2mu (unsigned char *cp, int l, unsigned char *mp)
|
70
|
1782 {
|
404
|
1783 unsigned char ch, *ep = cp+l;
|
380
|
1784
|
70
|
1785 while ((cp < ep) && (ch = *cp))
|
|
1786 {
|
|
1787 if ((unsigned char) ch == ISO_CODE_SS2)
|
|
1788 {
|
74
|
1789 *mp++ = LEADING_BYTE_KATAKANA_JISX0201;
|
70
|
1790 cp++;
|
|
1791 }
|
|
1792 else if ((unsigned char) ch == ISO_CODE_SS3)
|
|
1793 {
|
|
1794 *mp++ = LEADING_BYTE_JAPANESE_JISX0212;
|
|
1795 cp++;
|
|
1796 *mp++ = *cp++;
|
|
1797 }
|
|
1798 else if (ch & 0x80)
|
|
1799 {
|
|
1800 *mp++ = LEADING_BYTE_JAPANESE_JISX0208;
|
|
1801 *mp++ = *cp++;
|
|
1802 }
|
|
1803 *mp++ = *cp++;
|
|
1804 }
|
|
1805 *mp = 0;
|
|
1806 }
|
|
1807
|
|
1808 /* MULE internal string to EUC multibyte string */
|
|
1809
|
|
1810 static void
|
|
1811 m2c (unsigned char *mp, int l, unsigned char *cp)
|
|
1812 {
|
380
|
1813 unsigned char ch, *ep = mp + l;
|
|
1814
|
70
|
1815 while ((mp < ep) && (ch = *mp++))
|
|
1816 {
|
|
1817 switch (ch)
|
|
1818 {
|
74
|
1819 case LEADING_BYTE_KATAKANA_JISX0201:
|
70
|
1820 *cp++ = ISO_CODE_SS2;
|
|
1821 *cp++ = *mp++;
|
|
1822 break;
|
|
1823 case LEADING_BYTE_JAPANESE_JISX0212:
|
|
1824 *cp++ = ISO_CODE_SS3;
|
|
1825 case LEADING_BYTE_JAPANESE_JISX0208:
|
|
1826 *cp++ = *mp++;
|
|
1827 *cp++ = *mp++;
|
|
1828 break;
|
|
1829 default:
|
|
1830 *cp++ = ch;
|
|
1831 break;
|
|
1832 }
|
380
|
1833 }
|
70
|
1834 *cp = 0;
|
|
1835 }
|
|
1836
|
|
1837 #undef make_string
|
|
1838
|
|
1839 /* make_string after converting EUC string to MULE internal string */
|
|
1840 static Lisp_Object
|
|
1841 mule_make_string (unsigned char *p, int l)
|
|
1842 {
|
|
1843 unsigned char cbuf[4096];
|
380
|
1844
|
70
|
1845 c2mu (p,l,cbuf);
|
|
1846 return (make_string (cbuf,strlen (cbuf)));
|
380
|
1847 }
|
70
|
1848
|
|
1849 /* return the MULE internal string length of EUC string */
|
116
|
1850 /* Modified by sb to return a character count not byte count. */
|
70
|
1851 static int
|
|
1852 mule_strlen (unsigned char *p, int l)
|
|
1853 {
|
|
1854 unsigned char ch, *cp = p;
|
|
1855 int len = 0;
|
380
|
1856
|
70
|
1857 while ((cp < p + l) && (ch = *cp))
|
|
1858 {
|
|
1859 if ((unsigned char) ch == ISO_CODE_SS2)
|
|
1860 {
|
116
|
1861 len++;
|
70
|
1862 cp += 2;
|
|
1863 }
|
|
1864 else if ((unsigned char) ch == ISO_CODE_SS3)
|
|
1865 {
|
116
|
1866 len++;
|
70
|
1867 cp += 3;
|
|
1868 }
|
|
1869 else if (ch & 0x80)
|
|
1870 {
|
116
|
1871 len++;
|
70
|
1872 cp += 2;
|
|
1873 }
|
|
1874 else
|
|
1875 {
|
|
1876 len++;
|
380
|
1877 cp++;
|
70
|
1878 }
|
|
1879 }
|
|
1880 return (len);
|
|
1881 }
|
|
1882
|
|
1883 /* count number of characters */
|
197
|
1884 static void
|
70
|
1885 count_char (unsigned char *p, int len, int pos, int rev, int *clen, int *cpos,
|
|
1886 int *crev)
|
|
1887 {
|
|
1888 unsigned char *q = p;
|
380
|
1889
|
70
|
1890 *clen = *cpos = *crev = 0;
|
|
1891 if (len == 0) return;
|
|
1892 while (q < p + pos)
|
|
1893 {
|
|
1894 (*clen)++;
|
|
1895 (*cpos)++;
|
|
1896 if (*q++ & 0x80) q++;
|
|
1897 }
|
|
1898 while (q < p + pos + rev)
|
|
1899 {
|
|
1900 (*clen)++;
|
|
1901 (*crev)++;
|
|
1902 if (*q++ & 0x80) q++;
|
380
|
1903 }
|
70
|
1904 while (q < p + len)
|
|
1905 {
|
|
1906 (*clen)++;
|
|
1907 if (*q++ & 0x80) q++;
|
|
1908 }
|
|
1909 }
|
|
1910 #endif /* CANNA_MULE */
|