Commit 1baa27d0 authored by Ulrich Sibiller's avatar Ulrich Sibiller

update files from modules dir of libX11 1.3.4

parent da3e7fd2
......@@ -5,14 +5,14 @@ Copyright 1994 by Sony Corporation
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Digital, FUJITSU
LIMITED and Sony Corporation not be used in advertising or publicity
pertaining to distribution of the software without specific, written
prior permission.
prior permission.
DIGITAL, FUJITSU LIMITED AND SONY CORPORATION DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
......@@ -29,7 +29,7 @@ PERFORMANCE OF THIS SOFTWARE.
fujiwara@a80.tech.yk.fujitsu.co.jp
Makoto Wakamatsu Sony Corporation
makoto@sm.sony.co.jp
***********************************************************************/
#ifdef HAVE_CONFIG_H
......@@ -68,11 +68,11 @@ extern int _Xmblen ();
#define sz_ximStatusDone 0
typedef enum {
XimCbSuccess,
XimCbNoCallback,
XimCbError,
XimCbQueued,
XimCbBadContextID,
XimCbSuccess,
XimCbNoCallback,
XimCbError,
XimCbQueued,
XimCbBadContextID,
XimCbBadOpcode
} XimCbStatus;
......@@ -111,7 +111,7 @@ Private XimCbStatus _XimPreeditStateNotifyCallback(Xim, Xic, char *, int);
#endif
/* NOTE:
* the table below depends on the protocol number
* the table below depends on the protocol number
* defined in the IM Protocol document.
*/
static RConst XimCb callback_table[] = {
......@@ -149,11 +149,11 @@ _XimProcessPendingCallbacks(Xic ic)
{
XimPendingCallback pcbq;
while (((pcbq = ic->private.proto.pend_cb_que) != (XimPendingCallback)NULL)
while (((pcbq = ic->private.proto.pend_cb_que) != (XimPendingCallback)NULL)
&& _XimIsReadyForProcess(ic)) {
(void) (*callback_table[pcbq->major_opcode])(pcbq->im,
pcbq->ic,
pcbq->proto,
(void) (*callback_table[pcbq->major_opcode])(pcbq->im,
pcbq->ic,
pcbq->proto,
pcbq->proto_len);
ic->private.proto.pend_cb_que = pcbq->next;
Xfree(pcbq->proto); /* free memory of XimPendingCallback */
......@@ -183,9 +183,9 @@ _XimPutCbIntoQueue(Xic ic, XimPendingCallback call_data)
}
Public Bool
_XimCbDispatch(Xim xim,
INT16 len,
XPointer data,
_XimCbDispatch(Xim xim,
INT16 len,
XPointer data,
XPointer call_data)
{
/* `data' points to the beginning of the packet defined in IM Protocol doc.
......@@ -260,16 +260,16 @@ _XimCbDispatch(Xim xim,
}
Private XimCbStatus
_XimGeometryCallback(Xim im,
Xic ic,
char* proto,
_XimGeometryCallback(Xim im,
Xic ic,
char* proto,
int len)
{
XICCallback* cb = &ic->core.geometry_callback;
/* invoke the callack
*/
if (cb && cb->callback) {
if (cb && cb->callback) {
(*cb->callback)((XIC)ic, cb->client_data, (XPointer)NULL);
}
else {
......@@ -283,9 +283,9 @@ _XimGeometryCallback(Xim im,
}
Private XimCbStatus
_XimStrConversionCallback(Xim im,
Xic ic,
char* proto,
_XimStrConversionCallback(Xim im,
Xic ic,
char* proto,
int len)
{
XICCallback* cb = &ic->core.string_conversion_callback; /* check HM */
......@@ -310,10 +310,10 @@ _XimStrConversionCallback(Xim im,
/* no callback registered
*/
_XimError(im, ic,
(CARD16)XIM_BadSomething,
(INT16)len,
(CARD16)XIM_STR_CONVERSION,
_XimError(im, ic,
(CARD16)XIM_BadSomething,
(INT16)len,
(CARD16)XIM_STR_CONVERSION,
(char*)proto); /* send XIM_ERROR */
return XimCbNoCallback;
}
......@@ -332,9 +332,9 @@ _XimStrConversionCallback(Xim im,
length_in_bytes = (cbrec.text->encoding_is_wchar)?
sizeof(wchar_t) * cbrec.text->length: /* wchar */
strlen(cbrec.text->string.mbs); /* mb */
buf_len = XIM_HEADER_SIZE +
buf_len = XIM_HEADER_SIZE +
sz_CARD16 +
2 + length_in_bytes +
2 + length_in_bytes +
XIM_PAD(2 + length_in_bytes) +
2 + 2 + sz_CARD32 * cbrec.text->length;
buf = (CARD8*)Xmalloc(buf_len);
......@@ -366,9 +366,9 @@ _XimStrConversionCallback(Xim im,
}
Private XimCbStatus
_XimPreeditStartCallback(Xim im,
Xic ic,
char* proto,
_XimPreeditStartCallback(Xim im,
Xic ic,
char* proto,
int len)
{
XICCallback* cb = &ic->core.preedit_attr.start_callback;
......@@ -381,12 +381,12 @@ _XimPreeditStartCallback(Xim im,
}
else {
/* no callback registered
/* no callback registered
*/
_XimError(im, ic,
(CARD16)XIM_BadSomething,
(INT16)len,
(CARD16)XIM_PREEDIT_START,
_XimError(im, ic,
(CARD16)XIM_BadSomething,
(INT16)len,
(CARD16)XIM_PREEDIT_START,
(char*)proto); /* send XIM_ERROR */
return XimCbNoCallback;
}
......@@ -415,9 +415,9 @@ _XimPreeditStartCallback(Xim im,
}
Private XimCbStatus
_XimPreeditDoneCallback(Xim im,
Xic ic,
char* proto,
_XimPreeditDoneCallback(Xim im,
Xic ic,
char* proto,
int len)
{
XICCallback* cb = &ic->core.preedit_attr.done_callback;
......@@ -438,8 +438,8 @@ _XimPreeditDoneCallback(Xim im,
}
Private void
_read_text_from_packet(Xim im,
char* buf,
_read_text_from_packet(Xim im,
char* buf,
XIMText** text_ptr)
{
int status;
......@@ -469,8 +469,8 @@ _read_text_from_packet(Xim im,
tmp_buf[tmp_len] = '\0';
text->encoding_is_wchar = False;
text->length = im->methods->ctstombs((XIM)im,
tmp_buf, tmp_len,
text->length = im->methods->ctstombs((XIM)im,
tmp_buf, tmp_len,
NULL, 0, &s); /* CT? HM */
if (s != XLookupNone) {
#ifndef NO_DEC_I18N_FIX
......@@ -487,12 +487,12 @@ _read_text_from_packet(Xim im,
int char_len;
#endif
tmp = im->methods->ctstombs((XIM)im,
tmp_buf, tmp_len,
tmp_buf, tmp_len,
#ifndef NO_DEC_I18N_FIX
text->string.multi_byte,
text->length * XLC_PUBLIC(im->core.lcd,mb_cur_max) + 1,
#else
text->string.multi_byte, text->length,
text->string.multi_byte, text->length,
#endif
&s);
text->string.multi_byte[tmp] = '\0';
......@@ -536,7 +536,7 @@ _read_text_from_packet(Xim im,
i -= sz_CARD32;
j++;
}
/*
/*
* text->length tells how long both the status string and
* the feedback array are. If there's "no string" the
* text->length was set to zero previously. See above.
......@@ -565,9 +565,9 @@ _free_memory_for_text(XIMText* text)
}
Private XimCbStatus
_XimPreeditDrawCallback(Xim im,
Xic ic,
char* proto,
_XimPreeditDrawCallback(Xim im,
Xic ic,
char* proto,
int len)
{
XICCallback* cb = &ic->core.preedit_attr.draw_callback;
......@@ -596,8 +596,8 @@ _XimPreeditDrawCallback(Xim im,
}
Private XimCbStatus
_XimPreeditCaretCallback(Xim im,
Xic ic,
_XimPreeditCaretCallback(Xim im,
Xic ic,
char* proto,
int len)
{
......@@ -615,12 +615,12 @@ _XimPreeditCaretCallback(Xim im,
}
else {
/* no callback registered
/* no callback registered
*/
_XimError(im, ic,
(CARD16)XIM_BadSomething,
(INT16)len,
(CARD16)XIM_PREEDIT_CARET,
_XimError(im, ic,
(CARD16)XIM_BadSomething,
(INT16)len,
(CARD16)XIM_PREEDIT_CARET,
(char*)proto); /* send XIM_ERROR */
return XimCbNoCallback;
}
......@@ -648,9 +648,9 @@ _XimPreeditCaretCallback(Xim im,
}
Private XimCbStatus
_XimStatusStartCallback(Xim im,
Xic ic,
char* proto,
_XimStatusStartCallback(Xim im,
Xic ic,
char* proto,
int len)
{
XICCallback* cb = &ic->core.status_attr.start_callback;
......@@ -671,9 +671,9 @@ _XimStatusStartCallback(Xim im,
}
Private XimCbStatus
_XimStatusDoneCallback(Xim im,
Xic ic,
char* proto,
_XimStatusDoneCallback(Xim im,
Xic ic,
char* proto,
int len)
{
XICCallback* cb = &ic->core.status_attr.done_callback;
......@@ -694,9 +694,9 @@ _XimStatusDoneCallback(Xim im,
}
Private XimCbStatus
_XimStatusDrawCallback(Xim im,
Xic ic,
char* proto,
_XimStatusDrawCallback(Xim im,
Xic ic,
char* proto,
int len)
{
XICCallback* cb = &ic->core.status_attr.draw_callback;
......@@ -735,7 +735,7 @@ _XimPreeditStateNotifyCallback( Xim im, Xic ic, char* proto, int len )
/* invoke the callack
*/
if( cb && cb->callback ) {
if( cb && cb->callback ) {
XIMPreeditStateNotifyCallbackStruct cbrec;
cbrec.state = *(BITMASK32 *)proto;
......
......@@ -10,7 +10,7 @@ in supporting documentation, and that the name of FUJITSU LIMITED
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
FUJITSU LIMITED makes no representations about the suitability of
this software for any purpose.
this software for any purpose.
It is provided "as is" without express or implied warranty.
FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
......@@ -21,7 +21,7 @@ USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Author: Takashi Fujiwara FUJITSU LIMITED
Author: Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
......@@ -261,7 +261,7 @@ _XimFilterKeyrelease(
return _XimProtoKeyreleaseFilter((Xic)client_data, (XKeyEvent *)ev);
}
Private void
Private void
_XimRegisterKeyPressFilter(
Xic ic)
{
......@@ -278,7 +278,7 @@ _XimRegisterKeyPressFilter(
return;
}
Private void
Private void
_XimRegisterKeyReleaseFilter(
Xic ic)
{
......@@ -295,7 +295,7 @@ _XimRegisterKeyReleaseFilter(
return;
}
Private void
Private void
_XimUnregisterKeyPressFilter(
Xic ic)
{
......@@ -311,7 +311,7 @@ _XimUnregisterKeyPressFilter(
return;
}
Private void
Private void
_XimUnregisterKeyReleaseFilter(
Xic ic)
{
......@@ -380,7 +380,7 @@ _XimFilterServerDestroy(
return True;
}
Public void
Public void
_XimRegisterServerFilter(
Xim im)
{
......@@ -399,7 +399,7 @@ _XimRegisterServerFilter(
return;
}
Public void
Public void
_XimUnregisterServerFilter(
Xim im)
{
......
/*
* Copyright 1991, 1992 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/******************************************************************
Copyright 1991, 1992 by Sun Microsystems, Inc.
Copyright 1992, 1993, 1994 by FUJITSU LIMITED
Permission to use, copy, modify, distribute, and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear
in supporting documentation, and that the name of Sun Microsystems, Inc.
and FUJITSU LIMITED not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior permission.
Sun Microsystems, Inc. and FUJITSU LIMITED makes no representations about
the suitability of this software for any purpose.
in supporting documentation, and that the name of FUJITSU LIMITED
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
FUJITSU LIMITED makes no representations about the suitability of
this software for any purpose.
It is provided "as is" without express or implied warranty.
Sun Microsystems Inc. AND FUJITSU LIMITED DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL Sun Microsystems, Inc. AND FUJITSU LIMITED
BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL FUJITSU LIMITED BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Author: Hideki Hiura (hhiura@Sun.COM) Sun Microsystems, Inc.
Takashi Fujiwara FUJITSU LIMITED
Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
......@@ -916,7 +937,7 @@ _XimProtoSetFocus(
CARD8 *buf = (CARD8 *)buf32;
CARD16 *buf_s = (CARD16 *)&buf[XIM_HEADER_SIZE];
INT16 len;
#ifndef XIM_CONNECTABLE
if (!IS_IC_CONNECTED(ic))
return;
......@@ -947,6 +968,8 @@ _XimProtoSetFocus(
(void)_XimWrite(im, len, (XPointer)buf);
_XimFlush(im);
MARK_FOCUSED(ic);
_XimRegisterFilter(ic);
return;
}
......@@ -992,6 +1015,8 @@ _XimProtoUnsetFocus(
(void)_XimWrite(im, len, (XPointer)buf);
_XimFlush(im);
UNMARK_FOCUSED(ic);
_XimUnregisterFilter(ic);
return;
}
......@@ -1311,7 +1336,7 @@ _XimDelayModeCreateIC(
XimDefICValues ic_values;
int len;
XIMStyle input_style;
bzero((char *)&ic_values, sizeof(XimDefICValues));
_XimGetCurrentICValues(ic, &ic_values);
if (!(_XimGetInputStyle(values, &input_style)))
......
/*
* Copyright 1990, 1991, 1992 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/******************************************************************
Copyright 1990, 1991, 1992 by Sun Microsystems, Inc.
Copyright 1992, 1993, 1994 by FUJITSU LIMITED
Copyright 1993, 1994 by Sony Corporation
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting documentation, and
that the name of Sun Microsystems, Inc., FUJITSU LIMITED and Sony
Corporation not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior permission.
Sun Microsystems, Inc., FUJITSU LIMITED and Sony Corporation makes no
representations about the suitability of this software for any purpose. It
is provided "as is" without express or implied warranty.
Sun Microsystems Inc., FUJITSU LIMITED AND SONY CORPORATION DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL Sun Microsystems, Inc.,
FUJITSU LIMITED AND SONY CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
OF THIS SOFTWARE.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Digital, FUJITSU
LIMITED and Sony Corporation not be used in advertising or publicity
pertaining to distribution of the software without specific, written
prior permission.
DIGITAL, FUJITSU LIMITED AND SONY CORPORATION DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL, FUJITSU LIMITED
AND SONY CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Author: Hideki Hiura (hhiura@Sun.COM) Sun Microsystems, Inc.
Takashi Fujiwara FUJITSU LIMITED
Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
Makoto Wakamatsu Sony Corporation
makoto@sm.sony.co.jp
......@@ -73,7 +93,7 @@ _XimSetHeader(
return;
}
Private char
Public char
_XimGetMyEndian(void)
{
CARD16 test_card = 1;
......@@ -106,7 +126,7 @@ _XimCheckServerName(
if(strncmp(str, XIM_SERVER_CATEGORY, category_len))
return False;
pp = &str[category_len];
for(;;) {
......@@ -142,7 +162,7 @@ _XimCheckLocaleName(
if(strncmp(address, XIM_LOCAL_CATEGORY, category_len))
return (char*)NULL;
pp = &address[category_len];
for(;;) {
......@@ -166,7 +186,7 @@ Private Bool
_XimCheckTransport(
char *address,
int address_len,
char *transport,
const char *transport,
int len,
char **trans_addr)
{
......@@ -179,7 +199,7 @@ _XimCheckTransport(
if(strncmp(address, XIM_TRANSPORT_CATEGORY, category_len))
return False;
pp = &address[category_len];
for(;;) {
......@@ -254,7 +274,7 @@ _XimPreConnectionIM(
Xim im,
Atom selection)
{
Display *display = im->core.display;
Display *display = im->core.display;
Atom locales, transport;
char *address;
XLCd lcd;
......@@ -364,14 +384,14 @@ Error:
if( locale_name[i] != NULL )
XFree( locale_name[i] );
XDestroyWindow(display, window);
return False;
return False;
}
Private Bool
_XimPreConnect(
Xim im)
{
Display *display = im->core.display;
Display *display = im->core.display;
Atom imserver;
Atom actual_type;
int actual_format;
......@@ -386,7 +406,7 @@ _XimPreConnect(
return False;
if(XGetWindowProperty(display, RootWindow(display, 0),
imserver, 0L, 1000000L, False, XA_ATOM, &actual_type,
imserver, 0L, 1000000L, False, XA_ATOM, &actual_type,
&actual_format, &nitems, &bytes_after,
&prop_return) != Success)
return False;
......@@ -681,7 +701,7 @@ _XimConnection(
}
}
if (!( buf_s[0] == im->private.proto.protocol_major_version
if (!( buf_s[0] == im->private.proto.protocol_major_version
&& buf_s[1] == im->private.proto.protocol_minor_version)) {
if(reply != preply)
Xfree(preply);
......@@ -915,7 +935,7 @@ _XimClose(
buf_s[1] = 0; /* unused */
len = sizeof(CARD16) /* sizeof imid */
+ sizeof(CARD16); /* sizeof unused */
_XimSetHeader((XPointer)buf, XIM_CLOSE, 0, &len);
if (!(_XimWrite(im, len, (XPointer)buf)))
return False;
......
......@@ -10,7 +10,7 @@ in supporting documentation, and that the name of FUJITSU LIMITED
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
FUJITSU LIMITED makes no representations about the suitability of
this software for any purpose.
this software for any purpose.
It is provided "as is" without express or implied warranty.
FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
......@@ -21,7 +21,7 @@ USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Author: Takashi Fujiwara FUJITSU LIMITED
Author: Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
......@@ -213,8 +213,13 @@ _XimRespSyncReply(
Xic ic,
BITMASK16 mode)
{
if (mode & XimSYNCHRONUS) /* SYNC Request */
MARK_NEED_SYNC_REPLY(ic);
if (mode & XimSYNCHRONUS) /* SYNC Request */ {
if (IS_FOCUSED(ic))
MARK_NEED_SYNC_REPLY(ic);
else
_XimProcSyncReply((Xim)ic->core.im, ic);
}
return True;
}
......@@ -463,7 +468,7 @@ _XimGetWindowEventmask(
Xim im = (Xim )ic->core.im;
XWindowAttributes atr;
if (!_XGetWindowAttributes(im->core.display, ic->core.focus_window, &atr))
if (!XGetWindowAttributes(im->core.display, ic->core.focus_window, &atr))
return 0;
return (EVENTMASK)atr.your_event_mask;
}
......@@ -885,13 +890,8 @@ _Ximctsconvert(
}
Public int
_Ximctstombs(xim, from, from_len, to, to_len, state)
XIM xim;
char *from;
int from_len;
char *to;
int to_len;
Status *state;
_Ximctstombs(XIM xim, char *from, int from_len,
char *to, int to_len, Status *state)
{
return _Ximctsconvert(((Xim)xim)->private.proto.ctom_conv,
from, from_len, to, to_len, state);
......@@ -930,7 +930,7 @@ _Ximctstowcs(
/* Reset the converter. The CompoundText at 'from' starts in
initial state. */
_XlcResetConverter(conv);
from_left = from_len;
to_left = BUFSIZ;
from_cnvlen = 0;
......
......@@ -10,7 +10,7 @@ in supporting documentation, and that the name of FUJITSU LIMITED
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
FUJITSU LIMITED makes no representations about the suitability of
this software for any purpose.
this software for any purpose.
It is provided "as is" without express or implied warranty.
FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
......@@ -21,7 +21,7 @@ USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Author: Takashi Fujiwara FUJITSU LIMITED
Author: Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
......@@ -61,8 +61,7 @@ _XimRegProtoIntrCallback(
}
Public void
_XimFreeProtoIntrCallback(im)
Xim im;
_XimFreeProtoIntrCallback(Xim im)
{
register XimProtoIntrRec *rec, *next;
......@@ -97,8 +96,7 @@ _XimTransportIntr(
}
Public Bool
_XimDispatchInit(im)
Xim im;
_XimDispatchInit(Xim im)
{
if (_XimRegisterDispatcher(im, _XimTransportIntr, (XPointer)im))
return True;
......
......@@ -3,13 +3,13 @@ Copyright 1993 by Digital Equipment Corporation, Maynard, Massachusetts,
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
......@@ -55,14 +55,14 @@ _XimProtoEventToWire(
event->u.keyButtonPointer.root = sw32(ev->root, sw);
event->u.keyButtonPointer.event =
sw32(ev->window, sw);
event->u.keyButtonPointer.child =
event->u.keyButtonPointer.child =
sw32(ev->subwindow, sw);
event->u.keyButtonPointer.time = sw32(ev->time, sw);
event->u.keyButtonPointer.eventX = sw16(ev->x, sw) ;
event->u.keyButtonPointer.eventY = sw16(ev->y, sw) ;
event->u.keyButtonPointer.rootX =
sw16(ev->x_root, sw);
event->u.keyButtonPointer.rootY =
event->u.keyButtonPointer.rootY =
sw16(ev->y_root, sw);
event->u.keyButtonPointer.state = sw16(ev->state, sw);
event->u.keyButtonPointer.sameScreen = ev->same_screen;
......@@ -139,7 +139,7 @@ _XimProtoEventToWire(
{
register XKeymapEvent *ev = (XKeymapEvent *) re;
memcpy((char *)(((xKeymapEvent *) event)->map),
&ev->key_vector[1],
&ev->key_vector[1],
sizeof (((xKeymapEvent *) event)->map));
}
break;
......@@ -356,12 +356,12 @@ _XimProtoEventToWire(
case ClientMessage:
{
register int i;
register XClientMessageEvent *ev
register XClientMessageEvent *ev
= (XClientMessageEvent *) re;
event->u.clientMessage.window = sw32(ev->window, sw);
event->u.u.detail = ev->format;
switch (ev->format) {
case 8:
case 8:
event->u.clientMessage.u.b.type = sw32(ev->message_type, sw);
for (i = 0; i < 20; i++)
event->u.clientMessage.u.b.bytes[i] = ev->data.b[i];
......@@ -401,7 +401,7 @@ _XimProtoEventToWire(
event->u.mappingNotify.count = ev->count;
}
break;
default:
return(0);
}
......@@ -429,7 +429,7 @@ _XimProtoWireToEvent(
((XAnyEvent *)re)->serial = sw16(event->u.u.sequenceNumber, sw);
((XAnyEvent *)re)->send_event = ((event->u.u.type & 0x80) != 0);
((XAnyEvent *)re)->display = NULL;
/* Ignore the leading bit of the event type since it is set when a
client sends an event rather than the server. */
......@@ -498,7 +498,7 @@ _XimProtoWireToEvent(
ev->y_root = cvtINT16toInt(sw16(event->u.enterLeave.rootY, sw));
ev->state = sw16(event->u.enterLeave.state, sw);
ev->mode = event->u.enterLeave.mode;
ev->same_screen = (event->u.enterLeave.flags &
ev->same_screen = (event->u.enterLeave.flags &
ELFlagSameScreen) && True;
ev->focus = (event->u.enterLeave.flags &
ELFlagFocus) && True;
......@@ -518,7 +518,7 @@ _XimProtoWireToEvent(
{
register XKeymapEvent *ev = (XKeymapEvent *) re;
ev->window = None;
memcpy(&ev->key_vector[1],
memcpy(&ev->key_vector[1],
(char *)((xKeymapEvent *) event)->map,
sizeof (((xKeymapEvent *) event)->map));
}
......@@ -736,14 +736,14 @@ _XimProtoWireToEvent(
case ClientMessage:
{
register int i;
register XClientMessageEvent *ev
register XClientMessageEvent *ev
= (XClientMessageEvent *) re;
ev->window = sw32(event->u.clientMessage.window, sw);
ev->format = event->u.u.detail;
switch (ev->format) {
case 8:
case 8:
ev->message_type = sw32(event->u.clientMessage.u.b.type, sw);
for (i = 0; i < 20; i++)
for (i = 0; i < 20; i++)
ev->data.b[i] = event->u.clientMessage.u.b.bytes[i];
break;
case 16:
......
......@@ -10,7 +10,7 @@ in supporting documentation, and that the name of FUJITSU LIMITED
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
FUJITSU LIMITED makes no representations about the suitability of
this software for any purpose.
this software for any purpose.
It is provided "as is" without express or implied warranty.
FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
......@@ -21,7 +21,7 @@ USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Author: Takashi Fujiwara FUJITSU LIMITED
Author: Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
......@@ -48,7 +48,7 @@ PERFORMANCE OF THIS SOFTWARE.
typedef struct _XIM_QueryExtRec {
Bool is_support;
char *name;
const char *name;
int name_len;
CARD16 major_opcode;
CARD16 minor_opcode;
......@@ -57,7 +57,7 @@ typedef struct _XIM_QueryExtRec {
Private XIM_QueryExtRec extensions[] = {
{False, "XIM_EXT_SET_EVENT_MASK", 0, 0, 0,
XIM_EXT_SET_EVENT_MASK_IDX},
XIM_EXT_SET_EVENT_MASK_IDX},
#ifdef EXT_FORWARD
{False, "XIM_EXT_FORWARD_KEYEVENT", 0, 0, 0,
XIM_EXT_FORWARD_KEYEVENT_IDX},
......@@ -222,7 +222,7 @@ _XimExtForwardKeyEvent(
Xim im = (Xim) ic->core.im;
CARD32 buf32[BUFSIZE/4];
CARD8 *buf = (CARD8 *)buf32;
CARD8 *buf_b = &buf[XIM_HEADER_SIZE];
CARD8 *buf_b = &buf[XIM_HEADER_SIZE];
CARD16 *buf_s = (CARD16 *)buf_b;
CARD32 *buf_l = (CARD32 *)buf_b;
CARD32 reply32[BUFSIZE/4];
......@@ -382,7 +382,7 @@ _XimParseExtensionList(
+ sizeof(CARD8) /* sizeof minor_opcode */
+ sizeof(INT16) /* sizeof length */
+ XIM_PAD(len); /* sizeof pad */
buf += len;
buf += len;
}
return True;
......
......@@ -15,17 +15,17 @@ makes no representations about the suitability of this software for
any purpose. It is provided "as is" without express or implied
warranty.
FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION DISCLAIM ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR
ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION DISCLAIM ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR
ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
Author: Takashi Fujiwara FUJITSU LIMITED
Author: Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
Modifier: Franky Ling Digital Equipment Corporation
frankyling@hgrd01.enet.dec.com
......
......@@ -108,7 +108,7 @@ _XimFilterPropertyNotify(
}
lock = True;
for( ii = 0; ii < nitems; ii++ ) {
for( ii = 0; ii < nitems; ii++, atoms ) {
if(XGetSelectionOwner (display, atoms[ii])) {
for( icb = callback_list; icb; icb = icb->next ) {
if( !icb->call && !icb->destroy ) {
......@@ -268,8 +268,7 @@ _XimUnRegisterIMInstantiateCallback(
Public void
_XimResetIMInstantiateCallback( xim )
Xim xim;
_XimResetIMInstantiateCallback(Xim xim)
{
char locale[XIM_MAXLCNAMELEN];
XimInstCallback icb;
......
......@@ -10,7 +10,7 @@ in supporting documentation, and that the name of FUJITSU LIMITED
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
FUJITSU LIMITED makes no representations about the suitability of
this software for any purpose.
this software for any purpose.
It is provided "as is" without express or implied warranty.
FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
......@@ -21,7 +21,7 @@ USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Author: Takashi Fujiwara FUJITSU LIMITED
Author: Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
......@@ -61,7 +61,7 @@ _XimSetIMStructureList(
}
}
if(i >= _XimCurrentIMcount) {
if(!(xim = (Xim *)Xrealloc(_XimCurrentIMlist,
if(!(xim = (Xim *)Xrealloc(_XimCurrentIMlist,
((i + 1) * sizeof(Xim)))))
return False;
_XimCurrentIMlist = xim;
......@@ -73,8 +73,7 @@ _XimSetIMStructureList(
}
Public void
_XimDestroyIMStructureList(im)
Xim im;
_XimDestroyIMStructureList(Xim im)
{
register int i;
......@@ -88,8 +87,7 @@ _XimDestroyIMStructureList(im)
}
Public void
_XimServerDestroy(im_2_destroy)
Xim im_2_destroy;
_XimServerDestroy(Xim im_2_destroy)
{
register int i;
Xim im;
......@@ -123,7 +121,7 @@ _XimServerDestroy(im_2_destroy)
#ifdef XIM_CONNECTABLE
Public void
_XimServerReconectableDestroy()
_XimServerReconectableDestroy(void)
{
register int i;
Xim im;
......@@ -149,13 +147,13 @@ _XimServerReconectableDestroy()
}
#endif /* XIM_CONNECTABLE */
Private char *
Private const char *
_XimStrstr(
register char *src,
register char *dest)
register const char *src,
register const char *dest)
{
int len;
len = strlen(dest);
while((src = strchr(src, *dest))) {
if(!strncmp(src, dest, len))
......@@ -169,10 +167,10 @@ Private char *
_XimMakeImName(
XLCd lcd)
{
char* begin = NULL;
char* end = NULL;
const char* begin = NULL;
const char* end = NULL;
char* ret = NULL;
char* ximmodifier = XIMMODIFIER;
const char* ximmodifier = XIMMODIFIER;
if(lcd->core->modifiers != NULL && *lcd->core->modifiers != '\0') {
begin = _XimStrstr(lcd->core->modifiers, ximmodifier);
......@@ -205,7 +203,7 @@ _XimOpenIM(
{
Xim im;
register int i;
if (!(im = (Xim)Xmalloc(sizeof(XimRec))))
return (XIM)NULL;
bzero(im, sizeof(XimRec));
......@@ -257,8 +255,7 @@ Error1:
}
Public Bool
_XInitIM(lcd)
XLCd lcd;
_XInitIM(XLCd lcd)
{
if(lcd == (XLCd)NULL)
return False;
......
......@@ -7,7 +7,7 @@ Permission to use, copy, modify, distribute, and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear
in supporting documentation, and that the name of Fuji Xerox,
in supporting documentation, and that the name of Fuji Xerox,
FUJITSU LIMITED not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission. Fuji Xerox, FUJITSU LIMITED make no representations
......@@ -24,7 +24,7 @@ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Author : Kazunori Nishihara Fuji Xerox
Modifier : Takashi Fujiwara FUJITSU LIMITED
Modifier : Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
......@@ -38,43 +38,67 @@ PERFORMANCE OF THIS SOFTWARE.
#include "Ximint.h"
Bool
_XimLocalFilter(d, w, ev, client_data)
Display *d;
Window w;
XEvent *ev;
XPointer client_data;
_XimLocalFilter(Display *d, Window w, XEvent *ev, XPointer client_data)
{
Xic ic = (Xic)client_data;
KeySym keysym;
static char buf[256];
DefTree *p;
DefTree *b = ic->private.local.base.tree;
DTIndex t;
if( (ev->type != KeyPress)
|| (ev->xkey.keycode == 0)
|| (((Xim)ic->core.im)->private.local.top == (DefTree *)NULL) )
return(False);
if(ev->xkey.keycode == 0)
return (False);
XLookupString((XKeyEvent *)ev, buf, sizeof(buf), &keysym, NULL);
if(IsModifierKey(keysym))
return (False);
for(p = ic->private.local.context; p; p = p->next) {
if(((ev->xkey.state & p->modifier_mask) == p->modifier) &&
(keysym == p->keysym)) {
break;
if(keysym >= XK_braille_dot_1 && keysym <= XK_braille_dot_8) {
if(ev->type == KeyPress) {
ic->private.local.brl_pressed |=
1<<(keysym-XK_braille_dot_1);
} else {
if(!ic->private.local.brl_committing
|| ev->xkey.time - ic->private.local.brl_release_start > 300) {
ic->private.local.brl_committing = ic->private.local.brl_pressed;
ic->private.local.brl_release_start = ev->xkey.time;
}
ic->private.local.brl_pressed &= ~(1<<(keysym-XK_braille_dot_1));
if(!ic->private.local.brl_pressed) {
if(ic->private.local.brl_committing) {
ic->private.local.brl_committed =
ic->private.local.brl_committing;
ic->private.local.composed = 0;
ev->type = KeyPress;
ev->xkey.keycode = 0;
_XPutBackEvent(d, ev);
}
}
}
return(True);
}
if( (ev->type != KeyPress)
|| (((Xim)ic->core.im)->private.local.top == 0 ) )
return(False);
for(t = ic->private.local.context; t; t = b[t].next) {
if(((ev->xkey.state & b[t].modifier_mask) == b[t].modifier) &&
(keysym == b[t].keysym))
break;
}
if(p) { /* Matched */
if(p->succession) { /* Intermediate */
ic->private.local.context = p->succession;
if(t) { /* Matched */
if(b[t].succession) { /* Intermediate */
ic->private.local.context = b[t].succession;
return(True);
} else { /* Terminate (reached to leaf) */
ic->private.local.composed = p;
ic->private.local.composed = t;
ic->private.local.brl_committed = 0;
/* return back to client KeyPressEvent keycode == 0 */
ev->xkey.keycode = 0;
_XPutBackEvent(d, ev);
XPutBackEvent(d, ev);
/* initialize internal state for next key sequence */
ic->private.local.context = ((Xim)ic->core.im)->private.local.top;
return(True);
......
......@@ -10,7 +10,7 @@ in supporting documentation, and that the name of FUJITSU LIMITED
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
FUJITSU LIMITED makes no representations about the suitability of
this software for any purpose.
this software for any purpose.
It is provided "as is" without express or implied warranty.
FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
......@@ -21,7 +21,7 @@ USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Author: Takashi Fujiwara FUJITSU LIMITED
Author: Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
......@@ -34,9 +34,7 @@ PERFORMANCE OF THIS SOFTWARE.
#include "Ximint.h"
Public char *
_XimLocalGetICValues(xic, values)
XIC xic;
XIMArg *values;
_XimLocalGetICValues(XIC xic, XIMArg *values)
{
Xic ic = (Xic)xic;
XimDefICValues ic_values;
......
......@@ -10,7 +10,7 @@ in supporting documentation, and that the name of FUJITSU LIMITED
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
FUJITSU LIMITED makes no representations about the suitability of
this software for any purpose.
this software for any purpose.
It is provided "as is" without express or implied warranty.
FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
......@@ -21,7 +21,7 @@ USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Author: Takashi Fujiwara FUJITSU LIMITED
Author: Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
......@@ -85,7 +85,7 @@ _XimLocalSetFocus(
if (ic->core.focus_window)
_XRegisterFilterByType(ic->core.im->core.display,
ic->core.focus_window, KeyPress, KeyPress,
ic->core.focus_window, KeyPress, KeyRelease,
_XimLocalFilter, (XPointer)ic);
return;
}
......@@ -95,8 +95,11 @@ _XimLocalReset(
XIC xic)
{
Xic ic = (Xic)xic;
ic->private.local.composed = (DefTree *)NULL;
ic->private.local.context = ((Xim)ic->core.im)->private.local.top;
ic->private.local.composed = 0;
ic->private.local.context = ((Xim)ic->core.im)->private.local.top;
ic->private.local.brl_pressed = 0;
ic->private.local.brl_committing = 0;
ic->private.local.brl_committed = 0;
}
Private char *
......@@ -147,8 +150,12 @@ _XimLocalCreateIC(
ic->methods = &Local_ic_methods;
ic->core.im = im;
ic->private.local.context = ((Xim)im)->private.local.top;
ic->private.local.composed = (DefTree *)NULL;
ic->private.local.base = ((Xim)im)->private.local.base;
ic->private.local.context = ((Xim)im)->private.local.top;
ic->private.local.composed = 0;
ic->private.local.brl_pressed = 0;
ic->private.local.brl_committing = 0;
ic->private.local.brl_committed = 0;
num = im->core.ic_num_resources;
len = sizeof(XIMResource) * num;
......
......@@ -16,7 +16,7 @@ It is provided "as is" without express or implied warranty.
FUJI XEROX, FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL FUJI XEROX,
MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL FUJI XEROX,
FUJITSU LIMITED BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA
OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
......@@ -24,7 +24,7 @@ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Author: Kazunori Nishihara Fuji Xerox
Takashi Fujiwara FUJITSU LIMITED
Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
......@@ -40,43 +40,59 @@ PERFORMANCE OF THIS SOFTWARE.
#include <nx-X11/Xutil.h>
#include "Xlibint.h"
#include "Xlcint.h"
#include "XlcPubI.h"
#include "Ximint.h"
Public int
_XimLocalMbLookupString(xic, ev, buffer, bytes, keysym, status)
XIC xic;
XKeyEvent *ev;
char *buffer;
int bytes;
KeySym *keysym;
Status *status;
_XimLocalMbLookupString(XIC xic, XKeyEvent *ev, char *buffer, int bytes,
KeySym *keysym, Status *status)
{
Xic ic = (Xic)xic;
int ret;
DefTree *b = ic->private.local.base.tree;
char *mb = ic->private.local.base.mb;
if(ev->type != KeyPress) {
if(status) *status = XLookupNone;
return(0);
}
if(ev->keycode == 0 && ic->private.local.composed != NULL) { /* Composed Event */
ret = strlen(ic->private.local.composed->mb);
if(ret > bytes) {
if(status) *status = XBufferOverflow;
return(ret);
}
memcpy(buffer, ic->private.local.composed->mb, ret);
if(keysym) *keysym = ic->private.local.composed->ks;
if (ret > 0) {
if (keysym && *keysym != NoSymbol) {
if(ev->keycode == 0 &&
( (ic->private.local.composed != 0)
||(ic->private.local.brl_committed != 0))) {
if (ic->private.local.brl_committed != 0) { /* Braille Event */
unsigned char pattern = ic->private.local.brl_committed;
char mb[XLC_PUBLIC(ic->core.im->core.lcd, mb_cur_max)];
ret = _Xlcwctomb(ic->core.im->core.lcd, mb, BRL_UC_ROW | pattern);
if(ret > bytes) {
if(status) *status = XBufferOverflow;
return(ret);
}
if(keysym) {
*keysym = XK_braille_blank | pattern;
if(status) *status = XLookupBoth;
} else {
} else
if(status) *status = XLookupChars;
memcpy(buffer, mb, ret);
} else { /* Composed Event */
ret = strlen(&mb[b[ic->private.local.composed].mb]);
if(ret > bytes) {
if(status) *status = XBufferOverflow;
return(ret);
}
} else {
if(keysym && *keysym != NoSymbol) {
if(status) *status = XLookupKeySym;
memcpy(buffer, &mb[b[ic->private.local.composed].mb], ret);
if(keysym) *keysym = b[ic->private.local.composed].ks;
if (ret > 0) {
if (keysym && *keysym != NoSymbol) {
if(status) *status = XLookupBoth;
} else {
if(status) *status = XLookupChars;
}
} else {
if(status) *status = XLookupNone;
if(keysym && *keysym != NoSymbol) {
if(status) *status = XLookupKeySym;
} else {
if(status) *status = XLookupNone;
}
}
}
return (ret);
......@@ -102,41 +118,53 @@ _XimLocalMbLookupString(xic, ev, buffer, bytes, keysym, status)
}
Public int
_XimLocalWcLookupString(xic, ev, buffer, wlen, keysym, status)
XIC xic;
XKeyEvent *ev;
wchar_t *buffer;
int wlen;
KeySym *keysym;
Status *status;
_XimLocalWcLookupString(XIC xic, XKeyEvent *ev, wchar_t *buffer, int wlen,
KeySym *keysym, Status *status)
{
Xic ic = (Xic)xic;
int ret;
DefTree *b = ic->private.local.base.tree;
wchar_t *wc = ic->private.local.base.wc;
if(ev->type != KeyPress) {
if(status) *status = XLookupNone;
return(0);
}
if(ev->keycode == 0) { /* Composed Event */
ret = _Xwcslen(ic->private.local.composed->wc);
if(ret > wlen) {
if(status) *status = XBufferOverflow;
return (ret);
}
memcpy((char *)buffer, (char *)ic->private.local.composed->wc,
ret * sizeof(wchar_t));
if(keysym) *keysym = ic->private.local.composed->ks;
if (ret > 0) {
if (keysym && *keysym != NoSymbol) {
if(ev->keycode == 0) {
if (ic->private.local.brl_committed != 0) { /* Braille Event */
unsigned char pattern = ic->private.local.brl_committed;
ret = 1;
if (ret > wlen) {
if(status) *status = XBufferOverflow;
return (ret);
}
*buffer = BRL_UC_ROW | pattern;
if(keysym) {
*keysym = XK_braille_blank | pattern;
if(status) *status = XLookupBoth;
} else {
} else
if(status) *status = XLookupChars;
} else { /* Composed Event */
ret = _Xwcslen(&wc[b[ic->private.local.composed].wc]);
if(ret > wlen) {
if(status) *status = XBufferOverflow;
return (ret);
}
} else {
if(keysym && *keysym != NoSymbol) {
if(status) *status = XLookupKeySym;
memcpy((char *)buffer, (char *)&wc[b[ic->private.local.composed].wc],
ret * sizeof(wchar_t));
if(keysym) *keysym = b[ic->private.local.composed].ks;
if (ret > 0) {
if (keysym && *keysym != NoSymbol) {
if(status) *status = XLookupBoth;
} else {
if(status) *status = XLookupChars;
}
} else {
if(status) *status = XLookupNone;
if(keysym && *keysym != NoSymbol) {
if(status) *status = XLookupKeySym;
} else {
if(status) *status = XLookupNone;
}
}
}
return (ret);
......@@ -162,40 +190,49 @@ _XimLocalWcLookupString(xic, ev, buffer, wlen, keysym, status)
}
Public int
_XimLocalUtf8LookupString(xic, ev, buffer, bytes, keysym, status)
XIC xic;
XKeyEvent *ev;
char *buffer;
int bytes;
KeySym *keysym;
Status *status;
_XimLocalUtf8LookupString(XIC xic, XKeyEvent *ev, char *buffer, int bytes,
KeySym *keysym, Status *status)
{
Xic ic = (Xic)xic;
int ret;
DefTree *b = ic->private.local.base.tree;
char *utf8 = ic->private.local.base.utf8;
if(ev->type != KeyPress) {
if(status) *status = XLookupNone;
return(0);
}
if(ev->keycode == 0) { /* Composed Event */
ret = strlen(ic->private.local.composed->utf8);
if(ret > bytes) {
if(status) *status = XBufferOverflow;
return (ret);
}
memcpy(buffer, ic->private.local.composed->utf8, ret);
if(keysym) *keysym = ic->private.local.composed->ks;
if (ret > 0) {
if (keysym && *keysym != NoSymbol) {
if(status) *status = XLookupBoth;
} else {
if(status) *status = XLookupChars;
if(ev->keycode == 0) {
if (ic->private.local.brl_committed != 0) { /* Braille Event */
unsigned char pattern = ic->private.local.brl_committed;
ret = 3;
if (ret > bytes) {
if(status) *status = XBufferOverflow;
return (ret);
}
} else {
if(keysym && *keysym != NoSymbol) {
if(status) *status = XLookupKeySym;
buffer[0] = 0xe0 | ((BRL_UC_ROW >> 12) & 0x0f);
buffer[1] = 0x80 | ((BRL_UC_ROW >> 8) & 0x30) | (pattern >> 6);
buffer[2] = 0x80 | (pattern & 0x3f);
} else { /* Composed Event */
ret = strlen(&utf8[b[ic->private.local.composed].utf8]);
if(ret > bytes) {
if(status) *status = XBufferOverflow;
return (ret);
}
memcpy(buffer, &utf8[b[ic->private.local.composed].utf8], ret);
if(keysym) *keysym = b[ic->private.local.composed].ks;
if (ret > 0) {
if (keysym && *keysym != NoSymbol) {
if(status) *status = XLookupBoth;
} else {
if(status) *status = XLookupChars;
}
} else {
if(status) *status = XLookupNone;
if(keysym && *keysym != NoSymbol) {
if(status) *status = XLookupKeySym;
} else {
if(status) *status = XLookupNone;
}
}
}
return (ret);
......@@ -287,26 +324,16 @@ _XimLcctsconvert(
}
Public int
_XimLcctstombs(xim, from, from_len, to, to_len, state)
XIM xim;
char *from;
int from_len;
char *to;
int to_len;
Status *state;
_XimLcctstombs(XIM xim, char *from, int from_len,
char *to, int to_len, Status *state)
{
return _XimLcctsconvert(((Xim)xim)->private.local.ctom_conv,
from, from_len, to, to_len, state);
}
Public int
_XimLcctstowcs(xim, from, from_len, to, to_len, state)
XIM xim;
char *from;
int from_len;
wchar_t *to;
int to_len;
Status *state;
_XimLcctstowcs(XIM xim, char *from, int from_len,
wchar_t *to, int to_len, Status *state)
{
Xim im = (Xim)xim;
XlcConv conv = im->private.local.ctow_conv;
......@@ -332,7 +359,7 @@ _XimLcctstowcs(xim, from, from_len, to, to_len, state)
/* Reset the converter. The CompoundText at 'from' starts in
initial state. */
_XlcResetConverter(conv);
from_left = from_len;
to_left = BUFSIZ;
from_cnvlen = 0;
......@@ -368,13 +395,8 @@ _XimLcctstowcs(xim, from, from_len, to, to_len, state)
}
Public int
_XimLcctstoutf8(xim, from, from_len, to, to_len, state)
XIM xim;
char *from;
int from_len;
char *to;
int to_len;
Status *state;
_XimLcctstoutf8(XIM xim, char *from, int from_len,
char *to, int to_len, Status *state)
{
return _XimLcctsconvert(((Xim)xim)->private.local.ctoutf8_conv,
from, from_len, to, to_len, state);
......
......@@ -42,6 +42,8 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include <sys/stat.h>
#include <stdio.h>
#define XLC_BUFSIZE 256
extern int _Xmbstowcs(
wchar_t *wstr,
char *str,
......@@ -276,38 +278,33 @@ static long
modmask(
char *name)
{
long mask;
struct _modtbl {
char *name;
const char name[6];
long mask;
};
struct _modtbl *p;
static struct _modtbl tbl[] = {
static const struct _modtbl tbl[] = {
{ "Ctrl", ControlMask },
{ "Lock", LockMask },
{ "Caps", LockMask },
{ "Shift", ShiftMask },
{ "Alt", Mod1Mask },
{ "Meta", Mod1Mask },
{ NULL, 0 }};
p = tbl;
mask = 0;
for (p = tbl; p->name != NULL; p++) {
if (strcmp(name, p->name) == 0) {
mask = p->mask;
break;
}
}
return(mask);
{ "Meta", Mod1Mask }};
int i, num_entries = sizeof (tbl) / sizeof (tbl[0]);
for (i = 0; i < num_entries; i++)
if (!strcmp (name, tbl[i].name))
return tbl[i].mask;
return 0;
}
static char*
TransFileName(Xim im, char *name)
{
char *home = NULL, *lcCompose = NULL;
char dir[XLC_BUFSIZE];
char *i = name, *ret, *j;
int l = 0;
......@@ -328,6 +325,10 @@ TransFileName(Xim im, char *name)
if (lcCompose)
l += strlen(lcCompose);
break;
case 'S':
xlocaledir(dir, XLC_BUFSIZE);
l += strlen(dir);
break;
}
} else {
l++;
......@@ -359,6 +360,10 @@ TransFileName(Xim im, char *name)
Xfree(lcCompose);
}
break;
case 'S':
strcpy(j, dir);
j += strlen(dir);
break;
}
i++;
} else {
......@@ -408,7 +413,7 @@ get_mb_string (Xim im, char *buf, KeySym ks)
return len;
}
#define AllMask (ShiftMask | LockMask | ControlMask | Mod1Mask)
#define AllMask (ShiftMask | LockMask | ControlMask | Mod1Mask)
#define LOCAL_WC_BUFSIZE 128
#define LOCAL_UTF8_BUFSIZE 256
#define SEQUENCE_MAX 10
......@@ -420,11 +425,13 @@ parseline(
char* tokenbuf)
{
int token;
unsigned modifier_mask;
unsigned modifier;
unsigned tmp;
DTModifier modifier_mask;
DTModifier modifier;
DTModifier tmp;
KeySym keysym = NoSymbol;
DefTree **top = &im->private.local.top;
DTIndex *top = &im->private.local.top;
DefTreeBase *b = &im->private.local.base;
DTIndex t;
DefTree *p = NULL;
Bool exclam, tilde;
KeySym rhs_keysym = 0;
......@@ -436,8 +443,8 @@ parseline(
char local_utf8_buf[LOCAL_UTF8_BUFSIZE], *rhs_string_utf8;
struct DefBuffer {
unsigned modifier_mask;
unsigned modifier;
DTModifier modifier_mask;
DTModifier modifier;
KeySym keysym;
};
......@@ -447,7 +454,7 @@ parseline(
do {
token = nexttoken(fp, tokenbuf, &lastch);
} while (token == ENDOFLINE);
if (token == ENDOFFILE) {
return(-1);
}
......@@ -467,6 +474,7 @@ parseline(
if (infp == NULL)
goto error;
_XimParseStringFile(infp, im);
fclose(infp);
return (0);
} else if ((token == KEY) && (strcmp("None", tokenbuf) == 0)) {
modifier = 0;
......@@ -534,20 +542,24 @@ parseline(
token = nexttoken(fp, tokenbuf, &lastch);
if (token == STRING) {
if( (rhs_string_mb = Xmalloc(strlen(tokenbuf) + 1)) == NULL )
goto error;
l = strlen(tokenbuf) + 1;
while (b->mbused + l > b->mbsize) {
b->mbsize = b->mbsize ? b->mbsize * 1.5 : 1024;
if (! (b->mb = Xrealloc (b->mb, b->mbsize)) )
goto error;
}
rhs_string_mb = &b->mb[b->mbused];
b->mbused += l;
strcpy(rhs_string_mb, tokenbuf);
token = nexttoken(fp, tokenbuf, &lastch);
if (token == KEY) {
rhs_keysym = XStringToKeysym(tokenbuf);
if (rhs_keysym == NoSymbol) {
Xfree(rhs_string_mb);
goto error;
}
token = nexttoken(fp, tokenbuf, &lastch);
}
if (token != ENDOFLINE && token != ENDOFFILE) {
Xfree(rhs_string_mb);
goto error;
}
} else if (token == KEY) {
......@@ -561,14 +573,13 @@ parseline(
}
l = get_mb_string(im, local_mb_buf, rhs_keysym);
if (l == 0) {
rhs_string_mb = Xmalloc(1);
} else {
rhs_string_mb = Xmalloc(l + 1);
}
if( rhs_string_mb == NULL ) {
goto error;
while (b->mbused + l + 1 > b->mbsize) {
b->mbsize = b->mbsize ? b->mbsize * 1.5 : 1024;
if (! (b->mb = Xrealloc (b->mb, b->mbsize)) )
goto error;
}
rhs_string_mb = &b->mb[b->mbused];
b->mbused += l + 1;
memcpy(rhs_string_mb, local_mb_buf, l);
rhs_string_mb[l] = '\0';
} else {
......@@ -579,62 +590,70 @@ parseline(
if (l == LOCAL_WC_BUFSIZE - 1) {
local_wc_buf[l] = (wchar_t)'\0';
}
if( (rhs_string_wc = (wchar_t *)Xmalloc((l + 1) * sizeof(wchar_t))) == NULL ) {
Xfree( rhs_string_mb );
return( 0 );
while (b->wcused + l + 1 > b->wcsize) {
b->wcsize = b->wcsize ? b->wcsize * 1.5 : 512;
if (! (b->wc = Xrealloc (b->wc, sizeof(wchar_t) * b->wcsize)) )
goto error;
}
rhs_string_wc = &b->wc[b->wcused];
b->wcused += l + 1;
memcpy((char *)rhs_string_wc, (char *)local_wc_buf, (l + 1) * sizeof(wchar_t) );
l = _Xmbstoutf8(local_utf8_buf, rhs_string_mb, LOCAL_UTF8_BUFSIZE - 1);
if (l == LOCAL_UTF8_BUFSIZE - 1) {
local_utf8_buf[l] = '\0';
}
if( (rhs_string_utf8 = (char *)Xmalloc(l + 1)) == NULL ) {
Xfree( rhs_string_wc );
Xfree( rhs_string_mb );
return( 0 );
while (b->utf8used + l + 1 > b->utf8size) {
b->utf8size = b->utf8size ? b->utf8size * 1.5 : 1024;
if (! (b->utf8 = Xrealloc (b->utf8, b->utf8size)) )
goto error;
}
rhs_string_utf8 = &b->utf8[b->utf8used];
b->utf8used += l + 1;
memcpy(rhs_string_utf8, local_utf8_buf, l + 1);
for (i = 0; i < n; i++) {
for (p = *top; p; p = p->next) {
if (buf[i].keysym == p->keysym &&
buf[i].modifier == p->modifier &&
buf[i].modifier_mask == p->modifier_mask) {
for (t = *top; t; t = b->tree[t].next) {
if (buf[i].keysym == b->tree[t].keysym &&
buf[i].modifier == b->tree[t].modifier &&
buf[i].modifier_mask == b->tree[t].modifier_mask) {
break;
}
}
if (p) {
if (t) {
p = &b->tree[t];
top = &p->succession;
} else {
if( (p = (DefTree*)Xmalloc(sizeof(DefTree))) == NULL ) {
Xfree( rhs_string_mb );
goto error;
while (b->treeused >= b->treesize) {
DefTree *old = b->tree;
int oldsize = b->treesize;
b->treesize = b->treesize ? b->treesize * 1.5 : 256;
if (! (b->tree = Xrealloc (b->tree, sizeof(DefTree) * b->treesize)) )
goto error;
if (top >= (DTIndex *) old && top < (DTIndex *) &old[oldsize])
top = (DTIndex *) (((char *) top) + (((char *)b->tree)-(char *)old));
}
p = &b->tree[b->treeused];
p->keysym = buf[i].keysym;
p->modifier = buf[i].modifier;
p->modifier_mask = buf[i].modifier_mask;
p->succession = NULL;
p->succession = 0;
p->next = *top;
p->mb = NULL;
p->wc = NULL;
p->utf8 = NULL;
p->mb = 0;
p->wc = 0;
p->utf8 = 0;
p->ks = NoSymbol;
*top = p;
*top = b->treeused;
top = &p->succession;
b->treeused++;
}
}
if( p->mb != NULL )
Xfree( p->mb );
p->mb = rhs_string_mb;
if( p->wc != NULL )
Xfree( p->wc );
p->wc = rhs_string_wc;
if( p->utf8 != NULL )
Xfree( p->utf8 );
p->utf8 = rhs_string_utf8;
p->ks = rhs_keysym;
/* old entries no longer freed... */
p->mb = rhs_string_mb - b->mb;
p->wc = rhs_string_wc - b->wc;
p->utf8 = rhs_string_utf8 - b->utf8;
p->ks = rhs_keysym;
return(n);
error:
while (token != ENDOFLINE && token != ENDOFFILE) {
......
......@@ -10,7 +10,7 @@ in supporting documentation, and that the name of FUJITSU LIMITED
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
FUJITSU LIMITED makes no representations about the suitability of
this software for any purpose.
this software for any purpose.
It is provided "as is" without express or implied warranty.
FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
......@@ -21,7 +21,7 @@ USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Author: Takashi Fujiwara FUJITSU LIMITED
Author: Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
......@@ -38,9 +38,7 @@ PERFORMANCE OF THIS SOFTWARE.
#include "Ximint.h"
Public char *
_XimLocalSetICValues(xic, values)
XIC xic;
XIMArg *values;
_XimLocalSetICValues(XIC xic, XIMArg *values)
{
XimDefICValues ic_values;
Xic ic = (Xic)xic;
......
......@@ -10,7 +10,7 @@ in supporting documentation, and that the name of FUJITSU LIMITED
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
FUJITSU LIMITED makes no representations about the suitability of
this software for any purpose.
this software for any purpose.
It is provided "as is" without express or implied warranty.
FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
......@@ -21,7 +21,7 @@ USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Author: Takashi Fujiwara FUJITSU LIMITED
Author: Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
......@@ -457,7 +457,7 @@ _XimDecodeIMATTRIBUTE(
if (total < min_len)
return p->name;
if (!(_XimAttributeToValue((Xic) im->private.local.current_ic,
if (!(_XimAttributeToValue((Xic) im->private.local.current_ic,
res, &buf[2], buf[1], p->value, mode)))
return p->name;
}
......
......@@ -15,17 +15,17 @@ makes no representations about the suitability of this software for
any purpose. It is provided "as is" without express or implied
warranty.
FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION DISCLAIM ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR
ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION DISCLAIM ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR
ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
Author: Takashi Fujiwara FUJITSU LIMITED
Author: Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
Modifier: Franky Ling Digital Equipment Corporation
frankyling@hgrd01.enet.dec.com
......@@ -60,6 +60,8 @@ _XimThaiDestroyIC(
XIC xic)
{
Xic ic = (Xic)xic;
DefTreeBase *b = &ic->private.local.base;
if(((Xim)ic->core.im)->private.local.current_ic == (XIC)ic) {
_XimThaiUnSetFocus(xic);
}
......@@ -68,14 +70,14 @@ _XimThaiDestroyIC(
ic->private.local.ic_resources = NULL;
}
Xfree(ic->private.local.context->mb);
Xfree(ic->private.local.context->wc);
Xfree(ic->private.local.context->utf8);
Xfree(ic->private.local.context);
Xfree(ic->private.local.composed->mb);
Xfree(ic->private.local.composed->wc);
Xfree(ic->private.local.composed->utf8);
Xfree(ic->private.local.composed);
if (b->tree) Xfree (b->tree);
if (b->mb) Xfree (b->mb);
if (b->wc) Xfree (b->wc);
if (b->utf8) Xfree (b->utf8);
b->tree = NULL;
b->mb = NULL;
b->wc = NULL;
b->utf8 = NULL;
return;
}
......@@ -105,11 +107,12 @@ _XimThaiReset(
XIC xic)
{
Xic ic = (Xic)xic;
DefTreeBase *b = &ic->private.local.base;
ic->private.local.thai.comp_state = 0;
ic->private.local.thai.keysym = 0;
ic->private.local.composed->mb[0] = '\0';
ic->private.local.composed->wc[0] = 0;
ic->private.local.composed->utf8[0] = '\0';
b->mb[b->tree[ic->private.local.composed].mb] = '\0';
b->wc[b->tree[ic->private.local.composed].wc] = '\0';
b->utf8[b->tree[ic->private.local.composed].utf8] = '\0';
}
Private char *
......@@ -152,6 +155,7 @@ _XimThaiCreateIC(
XIMResourceList res;
unsigned int num;
int len;
DefTree *tree;
if((ic = (Xic)Xmalloc(sizeof(XicRec))) == (Xic)NULL) {
return ((XIC)NULL);
......@@ -161,30 +165,23 @@ _XimThaiCreateIC(
ic->methods = &Thai_ic_methods;
ic->core.im = im;
ic->core.filter_events = KeyPressMask;
if ((ic->private.local.context = (DefTree *)Xmalloc(sizeof(DefTree)))
== (DefTree *)NULL)
goto Set_Error;
if ((ic->private.local.context->mb = (char *)Xmalloc(10))
== (char *)NULL)
goto Set_Error;
if ((ic->private.local.context->wc = (wchar_t *)Xmalloc(10*sizeof(wchar_t)))
== (wchar_t *)NULL)
goto Set_Error;
if ((ic->private.local.context->utf8 = (char *)Xmalloc(10))
== (char *)NULL)
goto Set_Error;
if ((ic->private.local.composed = (DefTree *)Xmalloc(sizeof(DefTree)))
== (DefTree *)NULL)
if (! (ic->private.local.base.tree = tree = (DefTree *)Xmalloc(sizeof(DefTree)*3)) )
goto Set_Error;
if ((ic->private.local.composed->mb = (char *)Xmalloc(10))
== (char *)NULL)
if (! (ic->private.local.base.mb = (char *)Xmalloc(21)) )
goto Set_Error;
if ((ic->private.local.composed->wc = (wchar_t *)Xmalloc(10*sizeof(wchar_t)))
== (wchar_t *)NULL)
if (! (ic->private.local.base.wc = (wchar_t*)Xmalloc(sizeof(wchar_t)*21)) )
goto Set_Error;
if ((ic->private.local.composed->utf8 = (char *)Xmalloc(10))
== (char *)NULL)
if (! (ic->private.local.base.utf8 = (char *)Xmalloc(21)) )
goto Set_Error;
ic->private.local.context = 1;
tree[1].mb = 1;
tree[1].wc = 1;
tree[1].utf8 = 1;
ic->private.local.composed = 2;
tree[2].mb = 11;
tree[2].wc = 11;
tree[2].utf8 = 11;
ic->private.local.thai.comp_state = 0;
ic->private.local.thai.keysym = 0;
......
......@@ -15,17 +15,17 @@ makes no representations about the suitability of this software for
any purpose. It is provided "as is" without express or implied
warranty.
FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION DISCLAIM ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR
ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION DISCLAIM ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR
ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
Author: Takashi Fujiwara FUJITSU LIMITED
Author: Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
Modifier: Franky Ling Digital Equipment Corporation
frankyling@hgrd01.enet.dec.com
......@@ -59,21 +59,25 @@ Private XIMMethodsRec Xim_im_thai_methods = {
#define THAI_LANGUAGE_NAME "th"
Bool
_XimCheckIfThaiProcessing(im)
Xim im;
_XimCheckIfThaiProcessing(Xim im)
{
char *language;
_XGetLCValues(im->core.lcd, XlcNLanguage, &language, NULL);
if(strcmp(language, THAI_LANGUAGE_NAME) == 0) {
if(strcmp(language, THAI_LANGUAGE_NAME) == 0 &&
(strcmp(im->core.im_name, "") == 0 ||
strcmp(im->core.im_name, "BasicCheck") == 0 ||
strcmp(im->core.im_name, "Strict") == 0 ||
strcmp(im->core.im_name, "Thaicat") == 0 ||
strcmp(im->core.im_name, "Passthrough") == 0))
{
return(True);
}
return(False);
}
Public Bool
_XimThaiOpenIM(im)
Xim im;
_XimThaiOpenIM(Xim im)
{
XLCd lcd = im->core.lcd;
XlcConv conv;
......@@ -142,8 +146,7 @@ Open_Error :
}
Public void
_XimThaiIMFree(im)
Xim im;
_XimThaiIMFree(Xim im)
{
if(im->core.im_resources) {
Xfree(im->core.im_resources);
......@@ -213,8 +216,7 @@ _XimThaiIMFree(im)
}
Public Status
_XimThaiCloseIM(xim)
XIM xim;
_XimThaiCloseIM(XIM xim)
{
Xim im = (Xim)xim;
XIC ic;
......
/*
* Copyright 1992 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/******************************************************************
Copyright 1992 by Sun Microsystems, Inc.
Copyright 1992, 1993, 1994 by FUJITSU LIMITED
Permission to use, copy, modify, distribute, and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear
in supporting documentation, and that the name of Sun Microsystems, Inc.
and FUJITSU LIMITED not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior permission.
Sun Microsystems, Inc. and FUJITSU LIMITED makes no representations about
the suitability of this software for any purpose.
in supporting documentation, and that the name of FUJITSU LIMITED
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
FUJITSU LIMITED makes no representations about the suitability of
this software for any purpose.
It is provided "as is" without express or implied warranty.
Sun Microsystems Inc. AND FUJITSU LIMITED DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL Sun Microsystems, Inc. AND FUJITSU LIMITED
BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL FUJITSU LIMITED BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Author: Hideki Hiura (hhiura@Sun.COM) Sun Microsystems, Inc.
Takashi Fujiwara FUJITSU LIMITED
Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
......@@ -102,12 +123,12 @@ _XimXFilterWaitEvent(
spec->ev = (XPointer)ev;
ret = _XimFilterWaitEvent(im);
/*
/*
* If ev is a pointer to a stack variable, there could be
* a coredump later on if the pointer is dereferenced.
* Therefore, reset to NULL to force reinitialization in
* _XimXRead().
*
*
* Keep in mind _XimXRead may be called again when the stack
* is very different.
*/
......@@ -153,6 +174,8 @@ _XimXConnect(Xim im)
event.xclient.data.l[0] = (CARD32)spec->lib_connect_wid;
event.xclient.data.l[1] = spec->major_code;
event.xclient.data.l[2] = spec->minor_code;
event.xclient.data.l[3] = 0;
event.xclient.data.l[4] = 0;
if(event.xclient.data.l[1] == 1 || event.xclient.data.l[1] == 2) {
XWindowAttributes atr;
......@@ -193,7 +216,7 @@ _XimXConnect(Xim im)
((major_code == 2) && (minor_code == 1))) {
spec->BoundarySize = (CARD32)event.xclient.data.l[3];
}
/* ClientMessage Event Filter */
_XRegisterFilterByType(im->core.display, spec->lib_connect_wid,
ClientMessage, ClientMessage,
......@@ -233,7 +256,7 @@ _NewAtom(
}
Private Bool
_XimXWrite(Xim im, INT16 len, XPointer data)
_XimXWrite(Xim im, INT16 len, XPointer data)
{
Atom atom;
char atomName[16];
......@@ -353,6 +376,7 @@ _XimXGetReadData(
(void)memcpy(buf, prop_ret, (int)nitems);
*ret_len = (int)nitems;
if (bytes_after_ret > 0) {
XFree(prop_ret);
XGetWindowProperty(im->core.display,
spec->lib_connect_wid, prop, 0L,
((length + bytes_after_ret + 3)/ 4), True, AnyPropertyType,
......@@ -360,7 +384,7 @@ _XimXGetReadData(
&prop_ret);
XChangeProperty(im->core.display, spec->lib_connect_wid, prop,
XA_STRING, 8, PropModePrepend, &prop_ret[length],
(nitems - length));
(nitems - length));
}
} else {
(void)memcpy(buf, prop_ret, buf_len);
......@@ -375,7 +399,7 @@ _XimXGetReadData(
&type_ret, &format_ret, &nitems, &bytes_after_ret, &prop_ret);
}
XChangeProperty(im->core.display, spec->lib_connect_wid, prop,
XA_STRING, 8, PropModePrepend, &prop_ret[buf_len], len);
XA_STRING, 8, PropModePrepend, &prop_ret[buf_len], len);
event->xclient.data.l[0] = (long)len;
event->xclient.data.l[1] = (long)prop;
XPutBackEvent(im->core.display, event);
......@@ -400,7 +424,7 @@ _XimXGetReadData(
*ret_len = buf_len;
len = nitems - buf_len;
XChangeProperty(im->core.display, spec->lib_connect_wid, prop,
XA_STRING, 8, PropModePrepend, &prop_ret[buf_len], len);
XA_STRING, 8, PropModePrepend, &prop_ret[buf_len], len);
}
XFree(prop_ret);
}
......@@ -459,9 +483,7 @@ _XimXFlush(Xim im)
}
Public Bool
_XimXConf(im, address)
Xim im;
char *address;
_XimXConf(Xim im, char *address)
{
XSpecRec *spec;
......
/*
* Copyright 1992 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/******************************************************************
Copyright 1992 by Sun Microsystems, Inc.
Copyright 1992, 1993, 1994 by FUJITSU LIMITED
Permission to use, copy, modify, distribute, and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear
in supporting documentation, and that the name of Sun Microsystems, Inc.
and FUJITSU LIMITED not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior permission.
Sun Microsystems, Inc. and FUJITSU LIMITED makes no representations about
the suitability of this software for any purpose.
in supporting documentation, and that the name of FUJITSU LIMITED
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
FUJITSU LIMITED makes no representations about the suitability of
this software for any purpose.
It is provided "as is" without express or implied warranty.
Sun Microsystems Inc. AND FUJITSU LIMITED DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL Sun Microsystems, Inc. AND FUJITSU LIMITED
BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL FUJITSU LIMITED BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Author: Hideki Hiura (hhiura@Sun.COM) Sun Microsystems, Inc.
Takashi Fujiwara FUJITSU LIMITED
Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
......@@ -74,10 +95,7 @@ _XimTransConnect(
spec->trans_conn = NULL;
if (connect_stat == TRANS_TRY_CONNECT_AGAIN)
{
sleep(1);
continue;
}
else
break;
}
......@@ -98,8 +116,8 @@ _XimTransConnect(
_XRegisterFilterByType(im->core.display, window, KeyPress, KeyPress,
_XimTransFilterWaitEvent, (XPointer)im);
return _XRegisterInternalConnection(im->core.display, spec->fd,
(_XInternalConnectionProc)_XimTransInternalConnection,
return _XRegisterInternalConnection(im->core.display, spec->fd,
(_XInternalConnectionProc)_XimTransInternalConnection,
(XPointer)im);
}
......
/*
* Copyright 1992 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/******************************************************************
Copyright 1992 by Sun Microsystems, Inc.
Copyright 1992, 1993, 1994 by FUJITSU LIMITED
Permission to use, copy, modify, distribute, and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear
in supporting documentation, and that the name of Sun Microsystems, Inc.
and FUJITSU LIMITED not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior permission.
Sun Microsystems, Inc. and FUJITSU LIMITED makes no representations about
the suitability of this software for any purpose.
in supporting documentation, and that the name of FUJITSU LIMITED
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
FUJITSU LIMITED makes no representations about the suitability of
this software for any purpose.
It is provided "as is" without express or implied warranty.
Sun Microsystems Inc. AND FUJITSU LIMITED DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL Sun Microsystems, Inc. AND FUJITSU LIMITED
BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL FUJITSU LIMITED BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Author: Hideki Hiura (hhiura@Sun.COM) Sun Microsystems, Inc.
Takashi Fujiwara FUJITSU LIMITED
Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
......@@ -37,7 +58,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "Ximint.h"
Public TransportSW _XimTransportRec[] = {
{ "X", _XimXConf }, /* 1st entry must be X.
{ "X", _XimXConf }, /* 1st entry must be X.
This will be a fallback */
#ifdef TCPCONN
{ "tcp", _XimTransConf }, /* use X transport lib */
......@@ -55,15 +76,13 @@ Public TransportSW _XimTransportRec[] = {
};
Public Bool
_XimConnect(im)
Xim im;
_XimConnect(Xim im)
{
return im->private.proto.connect(im);
}
Public Bool
_XimShutdown(im)
Xim im;
_XimShutdown(Xim im)
{
return im->private.proto.shutdown(im);
}
......@@ -212,15 +231,8 @@ _XimCallDispatcher(
}
Public int
_XimRead(im, len, buf, buf_size, predicate, arg)
Xim im;
INT16 *len;
XPointer buf;
int buf_size;
Bool (*predicate)(
Xim, INT16, XPointer, XPointer
);
XPointer arg;
_XimRead(Xim im, INT16 *len, XPointer buf, int buf_size,
Bool (*predicate)(Xim, INT16, XPointer, XPointer), XPointer arg)
{
INT16 read_len;
int ret_code;
......@@ -252,16 +264,14 @@ _XimRegisterDispatcher(
}
Public void
_XimFlush(im)
Xim im;
_XimFlush(Xim im)
{
im->private.proto.flush(im);
return;
}
Public Bool
_XimFilterWaitEvent(im)
Xim im;
_XimFilterWaitEvent(Xim im)
{
INT16 read_len;
CARD32 reply32[BUFSIZE/4];
......
......@@ -44,7 +44,7 @@
#define MB_LEN_MAX 6
#endif
#if !defined(macII) && !defined(Lynx_22) && !defined(X_LOCALE)
#if !defined(Lynx_22) && !defined(X_LOCALE)
#define STDCVT
#endif
......
......@@ -62,7 +62,7 @@ OF THIS SOFTWARE.
#define KANJI_CODESET 1
#define KANA_CODESET 2
#define USERDEF_CODESET 3
#define MAX_CODESETS
#define MAX_CODESETS
#define GR 0x80 /* begins right-side (non-ascii) region */
#define GL 0x7f /* ends left-side (ascii) region */
......@@ -123,7 +123,7 @@ euc_mbstowcs(
const char *inbufptr = *from;
wchar_t *outbufptr = (wchar_t *) *to;
CodeSet *codesets = XLC_GENERIC(lcd, codeset_list);
CodeSet *codesets = XLC_GENERIC(lcd, codeset_list);
int codeset_num = XLC_GENERIC(lcd, codeset_num);
Ulong wc_shift = XLC_GENERIC(lcd, wc_shift_bits);
......@@ -213,7 +213,7 @@ euc_mbstowcs(
chrcode <<= (wc_shift * shift_mult);
shift_mult--;
wc_tmp |= chrcode;
wc_tmp |= chrcode;
if (--chr_len == 0) {
wc_tmp |= wc_encode;
......@@ -438,11 +438,11 @@ euc_mbstocs(
*from_left = tmp_from_left;
*to = (XPointer) tmp_to;
*to_left = tmp_to_left;
}
}
if (num_args > 0)
*((XlcCharSet *) args[0]) = charset;
return unconv_num;
}
......@@ -528,7 +528,7 @@ euc_cstombs(
if (num_args < 1)
return -1;
if (!(codeset = GetCodeSetFromCharSet(lcd, (XlcCharSet) args[0])))
return -1;
......@@ -586,10 +586,10 @@ euc_cstowcs(
int length;
Ulong wc_shift_bits = XLC_GENERIC(lcd, wc_shift_bits);
CodeSet codeset;
if (num_args < 1)
return -1;
if (!(codeset = GetCodeSetFromCharSet(lcd, (XlcCharSet) args[0])))
return -1;
......@@ -602,7 +602,7 @@ euc_cstowcs(
toptr += buf_len;
*to = (XPointer) toptr;
while (buf_len--) {
wch = (wchar_t) BIT8OFF(*csptr);
......@@ -674,7 +674,7 @@ create_conv(
conv = (XlcConv) Xmalloc(sizeof(XlcConvRec));
if (conv == NULL)
return (XlcConv) NULL;
conv->methods = methods;
conv->state = (XPointer) lcd;
return conv;
......@@ -1068,7 +1068,7 @@ euc_wcstocts(
}
} while (length);
} while (length);
} /* end for */
......@@ -1327,7 +1327,7 @@ euc_mbstocts(
unconv_num++;
break;
}
if (ctptr) {
strcpy(ctptr, ctdptr[cs_num]->ct_encoding);
ctptr += ctdptr[cs_num]->ct_encoding_len;
......@@ -1347,7 +1347,7 @@ euc_mbstocts(
do {
*ctptr++ = charset == ct_state.GR_charset ?
BIT8ON(*inbufptr++) : BIT8OFF(*inbufptr++);
} while (--clen);
} while (--clen);
}
*to = (XPointer)ctptr;
......
......@@ -39,7 +39,7 @@
#include "XlcGeneric.h"
#include <stdio.h>
#if !defined(macII) && !defined(X_LOCALE)
#if !defined(X_LOCALE)
#define STDCVT
#endif
......@@ -220,7 +220,7 @@ mbstocs(
if (num_args > 0)
*((XlcCharSet *) args[0]) = charset;
return unconv_num;
}
......@@ -372,7 +372,7 @@ cstombs(
if (num_args < 1)
return -1;
charset = (XlcCharSet) args[0];
codeset = GetCodeSetFromCharSet(state->lcd, charset);
......@@ -418,7 +418,7 @@ cstombs(
buf_len /= codeset->length + encoding_len;
if (csstr_len < buf_len)
buf_len = csstr_len;
cvt_length += buf_len * (encoding_len + codeset->length);
if (bufptr) {
while (buf_len--) {
......@@ -478,7 +478,7 @@ cstowcs(
if (num_args < 1)
return -1;
codeset = GetCodeSetFromCharSet(lcd, (XlcCharSet) args[0]);
if (codeset == NULL)
return -1;
......@@ -487,7 +487,7 @@ cstowcs(
csstr_len /= length;
if (csstr_len < buf_len)
buf_len = csstr_len;
code_mask = ~XLC_GENERIC(lcd, wc_encode_mask);
wc_encoding = codeset->wc_encoding;
wc_shift_bits = XLC_GENERIC(lcd, wc_shift_bits);
......@@ -537,7 +537,7 @@ create_conv(
conv = (XlcConv) Xmalloc(sizeof(XlcConvRec));
if (conv == NULL)
return (XlcConv) NULL;
conv->methods = (XlcConvMethods) Xmalloc(sizeof(XlcConvMethodsRec));
if (conv->methods == NULL)
goto err;
......@@ -549,11 +549,11 @@ create_conv(
if (conv->state == NULL)
goto err;
bzero((char *) conv->state, sizeof(StateRec));
state = (State) conv->state;
state->lcd = lcd;
init_state(conv);
return conv;
err:
......@@ -760,7 +760,7 @@ stdc_wcstocs(
length = 1;
*tmp = '\0';
}
if (length < 0)
break;
......@@ -786,7 +786,7 @@ stdc_wcstocs(
if (num_args > 0)
*((XlcCharSet *) args[0]) = charset;
return unconv_num;
}
......@@ -808,7 +808,7 @@ stdc_cstowcs(
DefineLocalBuf;
XPointer buf, save_buf;
int length, left, ret;
left = length = *to_left * XLC_PUBLIC(lcd, mb_cur_max);
buf = save_buf = (XPointer) AllocLocalBuf(length);
if (buf == NULL)
......@@ -817,7 +817,7 @@ stdc_cstowcs(
ret = cstombs(conv, from, from_left, &buf, &left, args, num_args);
if (ret < 0)
goto err;
buf = save_buf;
length -= left;
if (stdc_mbstowcs(conv, &buf, &length, to, to_left, args, num_args) < 0)
......
......@@ -154,7 +154,7 @@ sjis_mbstowcs(
wchar_t *outbufptr = (wchar_t *) *to;
wchar_t *outbuf_base = outbufptr;
CodeSet *codesets = XLC_GENERIC(lcd, codeset_list);
CodeSet *codesets = XLC_GENERIC(lcd, codeset_list);
int codeset_num = XLC_GENERIC(lcd, codeset_num);
Ulong wc_shift = XLC_GENERIC(lcd, wc_shift_bits);
......@@ -321,7 +321,7 @@ sjis_wcstombs(
}
*outbufptr++ = (char)tmp;
} while (length);
} while (length);
} /* end for */
......@@ -390,7 +390,7 @@ wc_codeset(
return( codesets[0] );
#endif
}
static int
sjis_mbtocs(
......@@ -419,7 +419,7 @@ sjis_mbtocs(
if (*from_left >= char_size && *to_left >= char_size) {
*dst++ = *src++;
*dst++ = *src++;
*dst++ = *src++;
if (!VALID_MULTIBYTE((Uchar) *(src-1))) /* check 2nd byte */
unconv_num++;
sjis_to_jis((Uchar *)(dst-2), (Uchar *)(dst-1));
......@@ -431,10 +431,10 @@ sjis_mbtocs(
return -1;
charset = *CS3->charset_list;
char_size = charset->char_size;
if (*from_left >= char_size && *to_left >= char_size) {
*dst++ = *src++;
*dst++ = *src++;
*dst++ = *src++;
if (!VALID_MULTIBYTE((Uchar) *(src-1))) /* check 2nd byte */
unconv_num++;
sjis_to_jis((Uchar *)(dst-2), (Uchar *)(dst-1));
......@@ -528,11 +528,11 @@ sjis_mbstocs(
*from_left = tmp_from_left;
*to = (XPointer) tmp_to;
*to_left = tmp_to_left;
}
}
if (num_args > 0)
*((XlcCharSet *) args[0]) = charset;
return unconv_num;
}
......@@ -660,7 +660,7 @@ sjis_cstombs(
if (num_args < 1)
return -1;
if (!(codeset = GetCodeSetFromCharSet(lcd, (XlcCharSet) args[0])))
return -1;
......@@ -668,7 +668,7 @@ sjis_cstombs(
buf_len /= codeset->length;
if (csstr_len < buf_len)
buf_len = csstr_len;
cvt_length += buf_len * codeset->length;
if (bufptr) {
......@@ -962,7 +962,7 @@ sjis_mbstocts(
unconv_num++;
break;
}
if (ctptr) {
strcpy(ctptr, ctdptr[cs_num]->ct_encoding);
ctptr += ctdptr[cs_num]->ct_encoding_len;
......@@ -972,7 +972,7 @@ sjis_mbstocts(
clen = charset->length;
do {
*ctptr++ = *inbufptr++;
} while (--clen);
} while (--clen);
if (charset->length >= 2) {
sjis_to_jis((Uchar *)(ctptr-2), (Uchar *)(ctptr-1));
......@@ -1118,7 +1118,7 @@ sjis_wcstocts(
}
*ctptr++ = (char)tmp;
}
} while (length);
} while (length);
} /* end for */
......@@ -1297,7 +1297,7 @@ sjis_ctstowcs(
if (*from_left > *to_left)
*from_left = *to_left;
for (length = ctdata[Ascii].length; *from_left > 0; (*from_left) -= length )
{
ct_type = CT_STD;
......@@ -1434,7 +1434,7 @@ create_conv(
conv = (XlcConv) Xmalloc(sizeof(XlcConvRec));
if (conv == NULL)
return (XlcConv) NULL;
conv->methods = methods;
conv->state = (XPointer) lcd;
return conv;
......
/* $TOG: $ */
/******************************************************************
Copyright 1993 by SunSoft, Inc.
......@@ -50,13 +49,21 @@ _XlcUtf8Loader(
return lcd;
/* The official IANA name for UTF-8 is "UTF-8" in upper case with a dash. */
if (!XLC_PUBLIC_PART(lcd)->codeset ||
(_XlcCompareISOLatin1(XLC_PUBLIC_PART(lcd)->codeset, "UTF-8"))) {
if (!XLC_PUBLIC_PART(lcd)->codeset) {
_XlcDestroyLC(lcd);
return (XLCd) NULL;
}
else if (!_XlcCompareISOLatin1(XLC_PUBLIC_PART(lcd)->codeset, "UTF-8")) {
_XlcAddUtf8LocaleConverters(lcd);
}
else if (!_XlcCompareISOLatin1(XLC_PUBLIC_PART(lcd)->codeset, "GB18030")) {
_XlcAddGB18030LocaleConverters(lcd);
}
else {
_XlcDestroyLC(lcd);
return (XLCd) NULL;
}
_XlcAddUtf8LocaleConverters(lcd);
_XlcAddUtf8Converters(lcd);
return lcd;
......
......@@ -108,7 +108,7 @@ draw_vertical(
int direction = 0;
int font_ascent_return = 0, font_descent_return = 0;
int i;
XCharStruct overall;
XCharStruct overall;
wy = y;
if (is_xchar2b) {
......@@ -190,7 +190,7 @@ DrawStringWithFontSet(
* If it was, use that font. If it was not set, then use the
* font defined by font_set->font_data[0] (which is what
* _XomGetFontDataFromFontSet() always seems to return for
* non-VW text). Note that given the new algorithm in
* non-VW text). Note that given the new algorithm in
* parse_fontname() and parse_fontdata(), fs->font will
* *always* contain good data. We should probably remove
* the check for "fd->font", but we won't :-) -- jjw/pma (HP)
......@@ -305,7 +305,7 @@ _XomGenericDrawString(
conv = _XomInitConverter(oc, type);
if (conv == NULL)
return -1;
args[0] = (XPointer) &font;
args[1] = (XPointer) &is_xchar2b;
args[2] = (XPointer) &fs;
......
......@@ -257,7 +257,7 @@ _XomGenericTextEscapement(
conv = _XomInitConverter(oc, type);
if (conv == NULL)
return escapement;
args[0] = (XPointer) &font;
args[1] = (XPointer) &is_xchar2b;
args[2] = (XPointer) &font_set;
......
......@@ -57,7 +57,7 @@ _XomGenericTextPerCharExtents(
conv = _XomInitConverter(oc, type);
if (conv == NULL)
return 0;
bzero((char *) &overall, sizeof(XCharStruct));
logical_ascent = logical_descent = require_num = *num_chars = 0;
......
......@@ -118,7 +118,7 @@ _XomGetFontDataFromFontSet(
unsigned char *str,
int len,
int *len_ret,
int is2b,
int is2b,
int type) /* VMAP , VROTATE , else */
{
unsigned long value;
......@@ -126,7 +126,7 @@ _XomGetFontDataFromFontSet(
FontData fontdata;
unsigned char *c;
int vfont_type;
c = str;
hit = -1;
if(type == VMAP){
......@@ -162,7 +162,7 @@ _XomGetFontDataFromFontSet(
} else {
value = (unsigned long)*c;
}
/* ### NOTE: This routine DOES NOT WORK!
* ### We can work around the problem in the calling routine,
* ### but we really need to understand this better. As it
......@@ -289,7 +289,7 @@ load_font(
oc->core.font_info.font_name_list[font_set->id]);
if (font_set->font == NULL)
return False;
oc->core.font_info.font_struct_list[font_set->id] = font_set->font;
XFreeFontInfo(NULL, font_set->info, 1);
font_set->info = NULL;
......@@ -365,7 +365,7 @@ _XomInitConverter(
{
XOCGenericPart *gen = XOC_GENERIC(oc);
XlcConv *convp;
char *conv_type;
const char *conv_type;
XlcConv conv;
XLCd lcd;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment