comparison lwlib/xlwmenu.c @ 181:bfd6434d15b3 r20-3b17

Import from CVS: tag r20-3b17
author cvs
date Mon, 13 Aug 2007 09:53:19 +0200
parents 6075d714658b
children e121b013d1f0
comparison
equal deleted inserted replaced
180:add28d59e586 181:bfd6434d15b3
399 #ifdef NEED_MOTIF 399 #ifdef NEED_MOTIF
400 Dimension width, height; 400 Dimension width, height;
401 XmStringExtent (mw->menu.font_list, s, &width, &height); 401 XmStringExtent (mw->menu.font_list, s, &width, &height);
402 return width; 402 return width;
403 #else 403 #else
404 # ifdef USE_XFONTSET
405 XRectangle ri, rl;
406 XmbTextExtents (mw->menu.font_set, string, strlen (string), &ri, &rl);
407 return rl.width;
408 # else /* ! USE_XFONTSET */
404 XCharStruct xcs; 409 XCharStruct xcs;
405 int i,s=0,w=0; 410 int i,s=0,w=0;
406 int drop; 411 int drop;
407 for (i=0;string[i];++i) { 412 for (i=0;string[i];++i) {
408 if (string[i]=='%'&&string[i+1]=='_') { 413 if (string[i]=='%'&&string[i+1]=='_') {
415 if (string[s]) { 420 if (string[s]) {
416 XTextExtents (mw->menu.font, &string[s], i-s, &drop, &drop, &drop, &xcs); 421 XTextExtents (mw->menu.font, &string[s], i-s, &drop, &drop, &drop, &xcs);
417 w += xcs.width; 422 w += xcs.width;
418 } 423 }
419 return w; 424 return w;
425 # endif /* USE_XFONTSET */
420 #endif 426 #endif
421 } 427 }
422 428
423 static void 429 static void
424 massage_resource_name (CONST char *in, char *out) 430 massage_resource_name (CONST char *in, char *out)