diff --git a/modules/im/ximcp/imRmAttr.c b/modules/im/ximcp/imRmAttr.c index af4db3d..92ccca5 100644 --- a/modules/im/ximcp/imRmAttr.c +++ b/modules/im/ximcp/imRmAttr.c @@ -391,6 +391,59 @@ _XimAttributeToValue( break; } + case XimType_XIMValuesList: + { + unsigned int i; + unsigned int alloc_len; + unsigned int n; + unsigned int len; + unsigned int values_len; + XIMValuesList *values_list; + char **values; + char *names; + char *p; + unsigned char *tmp; + + if (value == NULL) + return False; + + n = data[0]; + data++; + + tmp = (unsigned char*)data; + values_len = 0; + for (i = 0; i < n; i++) { + len = *((CARD16*)tmp); /* text length */ + values_len += len + 1; + tmp += sizeof(CARD16) + len + XIM_PAD(sizeof(CARD16) + len); + } + + alloc_len = sizeof(XIMValuesList) + sizeof(char **) * n + values_len; + p = (char *)Xmalloc(alloc_len); + if (p == NULL) + return False; + + values_list = (XIMValuesList *)p; + values = (char **)(p + sizeof(XIMValuesList)); + names = (char*)((char*)values + sizeof(char **) * n); + + values_list->count_values = n; + values_list->supported_values = values; + + tmp = (unsigned char*)data; + for (i = 0; i < n; i++) { + len = *((CARD16*)tmp); /* text length */ + (void)memcpy(names, (char *)&tmp[sizeof(CARD16)], len); + names[len] = '\0'; + values[i] = names; + names += len + 1; + tmp += sizeof(CARD16) + len + XIM_PAD(sizeof(CARD16) + len); + } + + *((XIMValuesList **)value) = values_list; + break; + } + default: return False; } diff --git a/src/xlibi18n/XimProto.h b/src/xlibi18n/XimProto.h index fe6e5f6..e143807 100644 --- a/src/xlibi18n/XimProto.h +++ b/src/xlibi18n/XimProto.h @@ -164,6 +164,9 @@ PERFORMANCE OF THIS SOFTWARE. #define XimType_XIMHotKeyTriggers 15 #define XimType_XIMHotKeyState 16 #define XimType_XIMStringConversion 17 +#define XimType_XIMPreeditState 18 +#define XimType_XIMResetState 19 +#define XimType_XIMValuesList 20 #define XimType_NEST 0x7fff /*