comparison lib/Xatoklib/sysline.c @ 0:92745d501b9a

initial import from kinput2-v3.1
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 08 Mar 2010 04:44:30 +0900
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:92745d501b9a
1 /*
2 * Copyright 1999 Justsystem Corporation, Japan.
3 *
4 * Permission to use, copy, modify, and distribute this software and its
5 * documentation for any purpose and without fee is hereby granted,
6 * provided that the above copyright notice appear in all copies and that
7 * both that copyright notice and this permission notice appear in
8 * supporting documentation, and that the name of Justsystem Corporation
9 * not be used in advertising or publicity pertaining to distribution
10 * of the software without specific, written prior permission. Justsystem
11 * Corporation makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express
13 * or implied warranty.
14 *
15 * Author: Atsushi Irisawa
16 */
17
18 #ifndef lint
19 static char rcsid[] = "$Id: sysline.c,v 1.2 1999/08/24 09:01:10 ishisone Exp $" ;
20 #endif /* !lint */
21
22 #include <stdio.h>
23 #include <X11/IntrinsicP.h>
24 #include <X11/StringDefs.h>
25 #include <X11/Xmu/Atoms.h>
26 #include <X11/keysym.h>
27 #include <InputConv.h>
28
29 #include <Xatoklib.h>
30
31 /* Page */
32 /*
33 * [$B4X?tL>(B]
34 * auxSyslineCtrl( )
35 * [$BI=Bj(B]
36 * $B%G!<%?$NAw?.(B
37 * [$B8F=P7A<0(B]
38 * int auxSyslineCtrl( _XatokRecPtr acomm, int isdecision )
39 *
40 * [$B0z?t(B]
41 * $B7?(B : $BL>(B $B>N(B : I O : $B@b(B $BL@(B
42 * _XatokRecPtr : acomm : i/o : kinput2$BMQJQ49%P%C%U%!(B
43 * int : isdecision : i : $B3NDj%G!<%?%U%i%0(B
44 *
45 *
46 * [$BJV$jCM(B]
47 * 0 : AUX $B%&%#%s%I%&7QB3(B
48 * 1 : AUX $B%&%#%s%I%&=*N;(B
49 *
50 * [$B;HMQ4X?t(B]
51 * $B$J$7(B
52 * [$B5!G=(B]
53 * SYSLINE$B%G!<%?$N%U%i%0$,(B ATOK12CE $B%(%s%8%s$G@_Dj$5$l$F$$$k>l9g$K(B
54 * $B%7%9%F%`9T$r?75,$K3+$/!"%7%9%F%`9T$NJ8;zNs$rJQ99$9$k!"(B
55 * $B%7%9%F%`9T$rJD$8$k$J$I$N!"I=<($r$I$N$h$&$K9T$J$&$+$rH=CG$9$k(B
56 * $B%U%!%s%/%7%g%s$G$"$j!"I=<($r4IM}$7$F$$$k%b%8%e!<%k$h$j(B
57 * $B8F$S=P$5$l$k!#(B
58 */
59 int auxSyslineCtrl(acomm, isdecision)
60 _XatokRecPtr acomm;
61 int isdecision; /* $B3NDjJ8;z$,$"$k$+$J$$$+!)(B */
62 {
63 int status = 0 ;
64
65 #ifdef ATOK_DEBUG
66 printf( "GUIDE isdecision %d\n", isdecision ) ;
67 printf( "GUIDE VAL %d\n", acomm->guide_OpenIndex ) ;
68 printf( "GUIDE CLOSE VAL %d\n", acomm->guide_closeEventIndex ) ;
69 printf( "GUIDE OPEN VAL %d\n", acomm->guide_openEventIndex ) ;
70 #endif
71 if ( acomm->guide_openEventIndex & CEGUIDEINDX_ERROR ) {
72 /* printf( "CEGUIDEINDX_ERROR\n" ) ; */
73 acomm->convStatus |= M_SYSLINE ;
74 if ( acomm->aux_isopened ) {
75 acomm->menuStatus = ICAuxChange ;
76 }
77 else {
78 acomm->menuStatus = ICAuxStart ;
79 }
80 acomm->aux_isopened = 1 ;
81 }
82 else if ( acomm->guide_OpenIndex & CEGUIDEINDX_CODE ) {
83 /* printf( "CEGUIDEINDX_CODE\n" ) ; */
84 acomm->convStatus |= M_SYSLINE ;
85 if ( acomm->aux_isopened ) {
86 acomm->menuStatus = ICAuxChange ;
87 }
88 else {
89 acomm->menuStatus = ICAuxStart ;
90 }
91 acomm->aux_isopened = 1 ;
92 }
93 else if ( acomm->guide_OpenIndex & CEGUIDEINDX_KIGOU ) {
94 /* printf( "CEGUIDEINDX_CODE\n" ) ; */
95 acomm->convStatus |= M_SYSLINE ;
96 if ( acomm->aux_isopened ) {
97 acomm->menuStatus = ICAuxChange ;
98 }
99 else {
100 acomm->menuStatus = ICAuxStart ;
101 }
102 acomm->aux_isopened = 1 ;
103 status = isdecision ;
104 }
105 else {
106 /* printf( "SYSLINE OTHER\n" ) ; */
107
108 acomm->convStatus ^= M_SYSLINE ; /* 0616 */
109 acomm->aux_isopened = 0 ;
110 acomm->menuStatus = ICAuxEnd ;
111 status = 1 ;
112 }
113 return status ;
114 }
115 /* Page */
116 /*
117 * [$B4X?tL>(B]
118 * auxSyslineString( )
119 * AtokNetSend( )
120 * [$BI=Bj(B]
121 * $B%7%9%F%`9TJ8;zNs$N:n@.!#(B
122 * [$B8F=P7A<0(B]
123 * int auxSyslineString( _XatokRecPtr acomm, menuAux *mAux,
124 * wchar *echoStr, int *echoLen, int *revLen, int *revPos )
125 *
126 * [$B0z?t(B]
127 * $B7?(B : $BL>(B $B>N(B : I O : $B@b(B $BL@(B
128 * _XatokRecPtr : acomm : i/o : kinput2$BMQJQ49%P%C%U%!(B
129 * menuAux : *mAux: : $B8=:_L$;HMQ(B
130 * wchar : *echoStr: o : $BI=<(J8;zNs(B
131 * int : *echoLen: o : $BI=<(J8;zNs$ND9$5(B
132 * int : *revLen : o : $BH?E>3+;O0LCV(B
133 * int : *revPos : o : $BH?E>J8;zNsD9$5(B
134 *
135 *
136 * [$BJV$jCM(B]
137 * -1 : $BAw?.%(%i!<(B
138 * N : $BAw?.%P%$%H?t(B
139 *
140 * [$B;HMQ4X?t(B]
141 * $B$J$7(B
142 * [$B5!G=(B]
143 * $B%7%9%F%`9T$KI=<($9$kJ8;zNs$r:n@.$7!"H?E>I=<(0LCV!"H?E>I=<($N(B
144 * $BD9$5$r5a$a$k!#(B
145 */
146
147 int auxSyslineString(acomm, mAux, echoStr, echoLen, revLen, revPos)
148 _XatokRecPtr acomm;
149 menuAux *mAux;
150 wchar *echoStr;
151 int *echoLen;
152 int *revLen;
153 int *revPos;
154 {
155 int wsize = sizeof( wchar ) ;
156 int isreverse = 0 ;
157 int rev = 0 ;
158 int i ;
159
160 *revPos = 0 ;
161 *revLen = 0 ;
162
163 memcpy( acomm->aux_echoStr, acomm->sysLineStr, acomm->sysLineLen * wsize ) ;
164
165 *echoLen = acomm->sysLineLen ;
166 for ( i = 0 ; i < acomm->sysLineLen ; i++ ) {
167 switch( acomm->sysAttrPtr[i] ) {
168 case ATCOLINDX_SYSLINEBACK :
169 case ATCOLINDX_SYSLINEINPUT :
170 case ATCOLINDX_SYSLINEINPUTCUR :
171 case ATCOLINDX_SYSLINENOTSELECTITEM :
172 case ATCOLINDX_SYSLINEHOSOKU :
173 case ATCOLINDX_SYSLINEGUIDEMESSAGE :
174 if ( isreverse ) {
175 goto done;
176 }
177 rev++ ;
178 break ;
179 case ATCOLINDX_SYSLINESELECTITEM :
180 isreverse = 1 ;
181 ( *revLen ) ++ ;
182 break ;
183 }
184 }
185 done:
186 if ( isreverse ) {
187 *revPos = rev ;
188 }
189 return 1 ;
190 }
191 /* End of sysline.c */