diff options
author | Egbert Eich <eich@freedesktop.org> | 2004-04-23 18:42:09 +0000 |
---|---|---|
committer | Egbert Eich <eich@freedesktop.org> | 2004-04-23 18:42:09 +0000 |
commit | c6349f43193b74a3c09945f3093a871b0157ba47 (patch) | |
tree | aea173c19da6fa57e24eb4633ff815feb7ae3fa0 /modules/im/ximcp/imTrX.c | |
parent | c3c4ddc682950a01b80825021f3e2503ab01ea7f (diff) | |
download | xorg-lib-libX11-c6349f43193b74a3c09945f3093a871b0157ba47.tar.gz |
Merging XORG-CURRENT into trunk
Diffstat (limited to 'modules/im/ximcp/imTrX.c')
-rw-r--r-- | modules/im/ximcp/imTrX.c | 105 |
1 files changed, 37 insertions, 68 deletions
diff --git a/modules/im/ximcp/imTrX.c b/modules/im/ximcp/imTrX.c index 01bc8286..c226cc69 100644 --- a/modules/im/ximcp/imTrX.c +++ b/modules/im/ximcp/imTrX.c @@ -28,6 +28,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. fujiwara@a80.tech.yk.fujitsu.co.jp ******************************************************************/ +/* $XFree86: xc/lib/X11/imTrX.c,v 1.3 2003/04/13 19:22:21 dawes Exp $ */ #include <string.h> #include <X11/Xatom.h> @@ -39,14 +40,12 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "XimTrX.h" Private Bool -_XimXRegisterDispatcher(im, callback, call_data) - Xim im; +_XimXRegisterDispatcher( + Xim im, Bool (*callback)( -#if NeedNestedPrototypes Xim, INT16, XPointer, XPointer -#endif - ); - XPointer call_data; + ), + XPointer call_data) { XIntrCallbackPtr rec; XSpecRec *spec = (XSpecRec *)im->private.proto.spec; @@ -62,8 +61,8 @@ _XimXRegisterDispatcher(im, callback, call_data) } Private void -_XimXFreeIntrCallback(im) - Xim im; +_XimXFreeIntrCallback( + Xim im) { XSpecRec *spec = (XSpecRec *)im->private.proto.spec; register XIntrCallbackPtr rec, next; @@ -77,14 +76,7 @@ _XimXFreeIntrCallback(im) } Private Bool -#if NeedFunctionPrototypes _XimXCallDispatcher(Xim im, INT16 len, XPointer data) -#else -_XimXCallDispatcher(im, len, data) - Xim im; - INT16 len; - XPointer data; -#endif { register XIntrCallbackRec *rec; XSpecRec *spec = (XSpecRec *)im->private.proto.spec; @@ -97,11 +89,11 @@ _XimXCallDispatcher(im, len, data) } Private Bool -_XimXFilterWaitEvent(d, w, ev, arg) - Display *d; - Window w; - XEvent *ev; - XPointer arg; +_XimXFilterWaitEvent( + Display *d, + Window w, + XEvent *ev, + XPointer arg) { Xim im = (Xim)arg; XSpecRec *spec = (XSpecRec *)im->private.proto.spec; @@ -125,10 +117,10 @@ _XimXFilterWaitEvent(d, w, ev, arg) } Private Bool -_CheckConnect(display, event, xim) - Display *display; - XEvent *event; - XPointer xim; +_CheckConnect( + Display *display, + XEvent *event, + XPointer xim) { Xim im = (Xim)xim; XSpecRec *spec = (XSpecRec *)im->private.proto.spec; @@ -141,12 +133,7 @@ _CheckConnect(display, event, xim) } Private Bool -#if NeedFunctionPrototypes _XimXConnect(Xim im) -#else -_XimXConnect(im) - Xim im; -#endif { XEvent event; XSpecRec *spec = (XSpecRec *)im->private.proto.spec; @@ -215,12 +202,7 @@ _XimXConnect(im) } Private Bool -#if NeedFunctionPrototypes _XimXShutdown(Xim im) -#else -_XimXShutdown(im) - Xim im; -#endif { XSpecRec *spec = (XSpecRec *)im->private.proto.spec; @@ -240,8 +222,8 @@ _XimXShutdown(im) } Private char * -_NewAtom(atomName) - char *atomName; +_NewAtom( + char *atomName) { static int sequence = 0; @@ -251,14 +233,7 @@ _NewAtom(atomName) } Private Bool -#if NeedFunctionPrototypes _XimXWrite(Xim im, INT16 len, XPointer data) -#else -_XimXWrite(im, len, data) - Xim im; - INT16 len; - XPointer data; -#endif { Atom atom; char atomName[16]; @@ -319,12 +294,12 @@ _XimXWrite(im, len, data) } Private Bool -_XimXGetReadData(im, buf, buf_len, ret_len, event) - Xim im; - char *buf; - int buf_len; - int *ret_len; - XEvent *event; +_XimXGetReadData( + Xim im, + char *buf, + int buf_len, + int *ret_len, + XEvent *event) { char *data; int len; @@ -340,8 +315,15 @@ _XimXGetReadData(im, buf, buf_len, ret_len, event) unsigned long bytes_after_ret; unsigned char *prop_ret; - if ((event->type == ClientMessage) && (event->xclient.format == 8)) { - data = event->xclient.data.b; + if ((event->type == ClientMessage) && + !((event->xclient.message_type == spec->improtocolid) || + (event->xclient.message_type == spec->immoredataid))) { + /* This event has nothing to do with us, + * FIXME should not have gotten here then... + */ + return False; + } else if ((event->type == ClientMessage) && (event->xclient.format == 8)) { + data = event->xclient.data.b; if (buf_len >= XIM_CM_DATA_SIZE) { (void)memcpy(buf, data, XIM_CM_DATA_SIZE); *ret_len = XIM_CM_DATA_SIZE; @@ -426,10 +408,10 @@ _XimXGetReadData(im, buf, buf_len, ret_len, event) } Private Bool -_CheckCMEvent(display, event, xim) - Display *display; - XEvent *event; - XPointer xim; +_CheckCMEvent( + Display *display, + XEvent *event, + XPointer xim) { Xim im = (Xim)xim; XSpecRec *spec = (XSpecRec *)im->private.proto.spec; @@ -447,15 +429,7 @@ _CheckCMEvent(display, event, xim) } Private Bool -#if NeedFunctionPrototypes _XimXRead(Xim im, XPointer recv_buf, int buf_len, int *ret_len) -#else -_XimXRead(im, recv_buf, buf_len, ret_len) - Xim im; - XPointer recv_buf; - int buf_len; - int *ret_len; -#endif { XEvent *ev; XEvent event; @@ -478,12 +452,7 @@ _XimXRead(im, recv_buf, buf_len, ret_len) } Private void -#if NeedFunctionPrototypes _XimXFlush(Xim im) -#else -_XimXFlush(im) - Xim im; -#endif { XFlush(im->core.display); return; |