diff -cr kinput2/lib/imlib/im.h kinput2.new/lib/imlib/im.h *** kinput2/lib/imlib/im.h Tue Dec 9 17:38:07 1997 --- kinput2.new/lib/imlib/im.h Wed Mar 25 20:41:52 1998 *************** *** 158,163 **** --- 158,167 ---- XIMStyle input_style; Window client; /* client window */ Window focus; /* focus window */ + #ifndef ORIGINAL + #define ATTR_MASK_FILTER_EVENTS (1<<3) + unsigned long filter_events; /* Event mask that IM need */ + #endif } IMCommonAttributes; typedef struct { diff -cr kinput2/lib/imlib/imattr.c kinput2.new/lib/imlib/imattr.c *** kinput2/lib/imlib/imattr.c Tue Dec 9 17:38:08 1997 --- kinput2.new/lib/imlib/imattr.c Wed Mar 25 20:41:52 1998 *************** *** 127,132 **** --- 127,137 ---- static int getLineSpace _Pt_((IMIC *, unsigned int, int, int, char *, int)); static int getCursor _Pt_((IMIC *, unsigned int, int, int, char *, int)); + #ifndef ORIGINAL + static int setFilterEvents _Pt_((IMIC *, char *, int, int, int, int)); + static int getFilterEvents _Pt_((IMIC *, unsigned int, int, int, char *, int)); + #endif + static ICAttribute icAttributes[] = { { XNInputStyle, TYPE_CARD32, OP_C|OP_G, setInputStyle, getInputStyle }, *************** *** 134,139 **** --- 139,146 ---- setClientWindow, getClientWindow }, { XNFocusWindow, TYPE_WINDOW, OP_C|OP_S|OP_G, setFocusWindow, getFocusWindow }, + { XNFilterEvents, TYPE_CARD32, OP_C|OP_S|OP_G, + setFilterEvents, getFilterEvents }, { XNPreeditAttributes, TYPE_NESTED_LIST, OP_C|OP_S|OP_G, setPreeditAttributes, getPreeditAttributes }, { XNStatusAttributes, TYPE_NESTED_LIST, OP_C|OP_S|OP_G, *************** *** 543,548 **** --- 550,583 ---- return 0; } + #ifndef ORIGINAL + /* ARGSUSED */ + static int + setFilterEvents(icp, value, len, order, nest, op) + IMIC *icp; + char *value; + int len; + int order; + int nest; + int op; + { + unsigned long filter_events; + + TRACE(("imlib:setFilterEvents()\n")); + + CHECK_ICATTR_SIZE(4, IMBadSomething); + + filter_events = (unsigned long)getC32(value, order); + TRACE(("\tfilter events: %08lx\n", filter_events)); + + if (!(icp->common_attr.set_mask & ATTR_MASK_FILTER_EVENTS) || + filter_events != icp->common_attr.filter_events) { + icp->common_attr.change_mask |= ATTR_MASK_FILTER_EVENTS; + } + return 0; + } + #endif + /* ARGSUSED */ static int setPreeditAttributes(icp, value, len, order, nest, op) *************** *** 1261,1266 **** --- 1296,1337 ---- } } + #ifndef ORIGINAL + /* ARGSUSED */ + static int + getFilterEvents(icp, id, nest, offset, data, len) + IMIC *icp; + unsigned int id; + int nest; + int offset; + char *data; + int len; + { + IMConnection *conn = icp->im->connection; + + TRACE(("imlib:getFilterEvents()\n")); + + if (!(icp->common_attr.set_mask & ATTR_MASK_FILTER_EVENTS)) { + /* fill default value */ + fillCommonDefault(icp, (unsigned long)ATTR_MASK_FILTER_EVENTS); + } + + if (icp->common_attr.set_mask & ATTR_MASK_FILTER_EVENTS) { + IMPutC16(conn, id); /* attribute ID */ + IMPutC16(conn, 4); /* value length */ + IMPutC32(conn, icp->common_attr.filter_events); + } + else { + /* no default is available */ + DPRINT(("getFilterEvents without setting\n")); + IMCancelRequest(conn, offset); + IMSendError(conn, IMBadSomething, icp->im->id, icp->id, + "filter events not specified yet"); + return -1; + } + } + #endif + /* ARGSUSED */ static int getArea(icp, id, nest, offset, data, len) *************** *** 1679,1684 **** --- 1750,1762 ---- TRACE(("\tdefault focus window: %08lx\n", ap->focus)); } } + #ifndef ORIGINAL + if (mask & ATTR_MASK_FILTER_EVENTS) { + ap->filter_events = NoEventMask; + ap->set_mask |= ATTR_MASK_FILTER_EVENTS; + TRACE(("\tdefault filter events: %08lx\n", ap->filter_events)); + } + #endif } static int *************** *** 1848,1853 **** --- 1926,1937 ---- SENDERROR(IMBadFocusWindow, "invalid focus window ID"); } } + #ifndef ORIGINAL + if (mask & ATTR_MASK_FILTER_EVENTS) { + DPRINT(("filter events not support\n")); + SENDERROR(IMBadSomething, "filter events not support"); + } + #endif return ret; #undef SENDERROR *************** *** 2070,2076 **** sattr->area = sattr->area_needed; } } - /* * Public functions --- 2154,2159 ----