comparison src/intl.c @ 380:8626e4521993 r21-2-5

Import from CVS: tag r21-2-5
author cvs
date Mon, 13 Aug 2007 11:07:10 +0200
parents 2c611d1463a6
children 74fd4e045ea6
comparison
equal deleted inserted replaced
379:76b7d63099ad 380:8626e4521993
121 allocated memory and send a single event pointing to that memory. 121 allocated memory and send a single event pointing to that memory.
122 That would cut down on the event processing as well as allow quick 122 That would cut down on the event processing as well as allow quick
123 insertion into the buffer of the whole string. It might require some 123 insertion into the buffer of the whole string. It might require some
124 care, though, to avoid fragmenting memory through the allocation and 124 care, though, to avoid fragmenting memory through the allocation and
125 freeing of many small chunks. Maybe the existing system for 125 freeing of many small chunks. Maybe the existing system for
126 (single-byte) string allocation can be used, multipling the length by 126 (single-byte) string allocation can be used, multiplying the length by
127 sizeof (wchar_t) to get the right size. 127 sizeof (wchar_t) to get the right size.
128 */ 128 */
129 void 129 void
130 x_get_composed_input (XKeyPressedEvent *x_key_event, XIC context, 130 x_get_composed_input (XKeyPressedEvent *x_key_event, XIC context,
131 Display *display) 131 Display *display)
134 Status status; 134 Status status;
135 int len; 135 int len;
136 int i; 136 int i;
137 XClientMessageEvent new_event; 137 XClientMessageEvent new_event;
138 138
139 try_again: 139 retry:
140 len = XwcLookupString (context, x_key_event, composed_input_buf.data, 140 len = XwcLookupString (context, x_key_event, composed_input_buf.data,
141 composed_input_buf.size, &keysym, &status); 141 composed_input_buf.size, &keysym, &status);
142 switch (status) 142 switch (status)
143 { 143 {
144 case XBufferOverflow: 144 case XBufferOverflow:
145 /* GROW_WC_STRING (&composed_input_buf, 32); mrb */ 145 /* GROW_WC_STRING (&composed_input_buf, 32); mrb */
146 goto try_again; 146 goto retry;
147 case XLookupChars: 147 case XLookupChars:
148 break; 148 break;
149 default: 149 default:
150 abort (); 150 abort ();
151 } 151 }